Use an INI file in C on Linux

2019-01-23 03:13发布

Is there a standard way of reading a kind of configuration like INI files for Linux using C?

I am working on a Linux based handheld and writing code in C.

Otherwise, I shall like to know about any alternatives.

Final update:

I have explored and even used LibConfig. But the footprint is high and my usage is too simple. So, to reduce the footprint, I have rolled out my own implementation. The implementation is not too generic, in fact quite coupled as of now. The configuration file is parsed once at the time of starting the application and set to some global variables.

7条回答
Deceive 欺骗
2楼-- · 2019-01-23 03:43

I hate to suggest something entirely different in suggesting XML, but libexpat is pretty minimal, but does XML.

I came to this conclusion as I had the same question as you did, but then I realized the project already had libexpat linked-in--and I should probably just use that.

查看更多
登录 后发表回答