cfgfile: support configurable comment character
authorAllain Legacy <allain.legacy@windriver.com>
Fri, 31 Mar 2017 13:52:00 +0000 (09:52 -0400)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 4 Apr 2017 14:32:06 +0000 (16:32 +0200)
commitf3b1a6981f4ab0628cd29543f01b33541d8ca969
tree315e8df418b96d84113b8c82843861a864f66152
parent1a5efe749959e14a3af6c962bdfb51dcc14e6929
cfgfile: support configurable comment character

The current cfgfile comment character is hardcoded to ';'.  This commit a
new API to allow the user to specify which comment character to use while
parsing the file.

This is to ease adoption by applications that have an existing
configuration file which may use a different comment character.  For
instance, an application may already have a configuration file that uses
the '#' as the comment character.

The approach of using a new API with an extensible parameters structure was
used rather than simply adding a new argument to the existing API to allow
for additional arguments to be introduced in the future.

Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
lib/librte_cfgfile/rte_cfgfile.c
lib/librte_cfgfile/rte_cfgfile.h
lib/librte_cfgfile/rte_cfgfile_version.map
test/test/test_cfgfile.c
test/test/test_cfgfiles/etc/sample2.ini [new file with mode: 0644]