cfgfile: support global properties section
authorAllain Legacy <allain.legacy@windriver.com>
Fri, 31 Mar 2017 13:51:59 +0000 (09:51 -0400)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 4 Apr 2017 14:32:06 +0000 (16:32 +0200)
commit1a5efe749959e14a3af6c962bdfb51dcc14e6929
treef56e4753413b18ff7ac942aafe0f54da900db948
parentc54e7234bc9e105cc4d6da5b5e5eea94c4343a11
cfgfile: support global properties section

The current implementation of the cfgfile library requires that all
key=value pairs be within [SECTION] definitions.  The ini file standard
allows for key=value pairs in an unnamed section.

   https://en.wikipedia.org/wiki/INI_file#Global_properties

This commit adds the capability of parsing key=value pairs from such an
unnamed section. The CFG_FLAG_GLOBAL_SECTION flag must be passed to the
rte_cfgfile_load() API to enable this functionality.  Any key=value pairs
found before the first section can be accessed in the section named
"GLOBAL".

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
test/test/test_cfgfile.c