embeddedartistry / libc

libc targeted for embedded systems usage. Reduced set of functionality (due to embedded nature). Chosen for portability and quick bringup.
MIT License
504 stars 67 forks source link

Missing scanf family of functions #175

Open stefanct opened 2 years ago

stefanct commented 2 years ago

If there is no intention to add support for them, I think it should at least be documented as it is quite essential for parsing data in some applications. What's your stance on the issue? Is there any suggested workaround currently?

phillipjohnston commented 2 years ago

I have no stance on these functions :). I haven't developed a system that has required them, and you are the first to ask. No technical or ideological reason.

phillipjohnston commented 2 years ago

picolibc (newlib-nano) has full support. I only mention as an immediate solution - I assume you are here because you do not wish to use newlib.

phillipjohnston commented 2 years ago

Looking over these functions, one blocker is that I do not actually support FILE or stdin/out/err in this library, so it would be gated on having a suitable solution for that.

Some of the functions, such as sscanf and vsscanf, look like they would be suitable for implementation, however.

stefanct commented 2 years ago

Yes, in this regard it is similar to some of the printf functions. sscanf is what I was after in this case. It's not a big deal for me and I can work around it.