Hello,
On 24.09.2009 13:52 Uhr, Jan Janak wrote:
Hello,
I am not sure if everybody is aware of that, but the sip-router core has inherited a standalone configuration file parser from SER.
good to know, I think there are some modules -- iirc, some K module use libconfuse for own config, maybe this one fits to remove extra dependency.
Does it have support for custom memory manger? e.g., load config either in shm or pkg as needed.
Daniel
The parser lives in files cfg_parser.[ch] and can be used to parse configuration files of form:
# comment... [section] name1 = value1 name2 = value2 ...
The format of section identifiers as well as the format of configuration values are extensible it can be anything from booleans, integers, strings, and even more complicated compound formats of your own.
Two SER modules currently use the parser. The tls module uses it to parse standalone configuration files with TLS related configuration. The ldap SER module uses the parser to parse a configuration file that maps LDAP objects to tables and columns for the database API.
Here is an example of a non-trivial configuration file the parse can parse: http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=blob_plain;f=mod...
Some documentation can be found in file sip_router/cfg_parser.c. For examples how to use it have a look at the following files: http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=blob;f=modules_s... http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=blob;f=modules/t...
Jan.
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev