| majidkamali1370 (226) | |||
|
Hi. Windows API has some functions for reading *.ini files
Is there something similar in linux? or maybe with different format. Thanks | |||
|
|
|||
| guestgulkan (2915) | |
| The ini file layout is straight forward and well known and you can easily pickup up a some opensource code on the web quite easily. | |
|
|
|
| barbodar (2) | |||||||
|
You have to use glib library here is an example ini file
ini reader
main fie (how to use)
| |||||||
|
Last edited on
|
|||||||
| andywestken (1964) | ||
|
Well, as guestgulkan said, there are a number of open source libraries to handle ini-files. I don't thinks it's compulsory to use glib! For example: inih Simple .INI file parser in C, good for embedded systems http://code.google.com/p/inih/ libini http://sourceforge.net/projects/libini/ Boost.Program_options http://www.boost.org/doc/libs/1_51_0/doc/html/program_options.html (The Boost library does more that just ini files. http://stackoverflow.com/questions/4509062/boostprogram-options-how-to-handle-sections-in-ini-file ) And other popular formats include JSON http://en.wikipedia.org/wiki/JSON YAML http://en.wikipedia.org/wiki/YAML XML http://en.wikipedia.org/wiki/XML Java style .properties file http://en.wikipedia.org/wiki/.properties Assorted libraries exist for all of these! Andy PS If I understand correctly, as primarily a Windows developer, there is no single Linux config file format? (I do also do cross-platform work, but not Linux specific) http://redhatlinux4u.wordpress.com/2012/10/08/understanding-linux-configuration-files/
| ||
|
Last edited on
|
||
| vince1027 (148) | |
|
Just to add to the list: http://code.jellycan.com/simpleini/ | |
|
|
|
| barbodar (2) | |
| I apologize, that was my mistake, I hav to say you can use! | |
|
|
|