[lug] OT: C Programming Question

Michael J. Hammel mjhammel at graphics-muse.org
Fri Dec 14 16:50:27 MST 2001


Thus spoke Sexton, George
> Are there any standard C library routines to read name value pairs from a
> text file using C?
> 
> I.E.
> 
> INTERFACE="eth0"
> 
> comparable to the INI File functions in Windows?

Don't know if there are any standard ones, but I wrote one for use in
XNotesPlus.  It's in the config.c file under srcgtk-d.  The main routine is
XPReadConfigFile(), but it calls at least one, maybe two, other utility
functions.  Not hard to pull out and use on their own.  It parses name
value pairs but you'll have to deal with the enclosing double quotes
yourself.

You can use those functions if you'd like.
-- 
Michael J. Hammel           |
The Graphics Muse           |  Why do women wear evening gowns to night-clubs? 
mjhammel at graphics-muse.org  |  Shouldn't they be wearing night gowns?
http://www.graphics-muse.com 



More information about the LUG mailing list