Parsing a .conf file with single function call in c -
is there elegant way of parsing .conf file in c program? say, if have normal text file -
param1 = 22 param2 = 99 param34 = 11 param11 = 15 ...
it'd nice access in 1 function call, smth like:
int c = xfunction(my.conf, param34);
and c = 11. many in advance.
it better if use linked list follow
struct node { char *key; int value; };
and assign key
value
pair node , can add many node
during parsing of conf file linked list
.
later when search can traverse linked list
, check key
simple strcmp()
, value.
Comments
Post a Comment