3 ms·
> I will write a parser for the “ini” file format in about 150 lines of pure and readable ISO C99 Sounds like overkill. Most often you don't need a full-fledg
by enriquto 3y ago
> I will write a parser for the “ini” file format in about 150 lines of pure and readable ISO C99
Sounds like overkill. Most often you don't need a full-fledged ini format, but just a list of "KEY=value" pairs that can be parsed with a single call to scanf.
- dfox 3y agoscanf() is probably not the right approach to that, but still you can implement a parser for the common INI syntax in about a third of the code with fgets(), strchr()/str(c)spn and bunch of hand-rolled ad-hoc logic.