Re: [PATCH v3 2/4] cfgfile: add new functions to API
From: Bruce Richardson <hidden>
Date: 2017-06-30 09:55:23
On Tue, Jun 27, 2017 at 12:26:48PM +0200, Jacek Piasecki wrote:
Extend existing cfgfile library with providing new API functions: rte_cfgfile_create() - create new cfgfile object rte_cfgfile_add_section() - add new section to existing cfgfile object rte_cfgfile_add_entry() - add new entry to existing cfgfile object in specified section rte_cfgfile_set_entry() - update existing entry in cfgfile object rte_cfgfile_save() - save existing cfgfile object to INI file This modification allows to create a cfgfile on runtime and opens up the possibility to have applications dynamically build up a proper DPDK configuration, rather than having to have a pre-existing one. Signed-off-by: Jacek Piasecki <redacted> --- lib/librte_cfgfile/rte_cfgfile.c | 249 +++++++++++++++++++++++++++-- lib/librte_cfgfile/rte_cfgfile.h | 76 +++++++++ lib/librte_cfgfile/rte_cfgfile_version.map | 11 ++ 3 files changed, 323 insertions(+), 13 deletions(-)
<snip>
+/** + * Add entry to specified section in cfgfile instance. + * + * @param cfg + * Pointer to the cfgfile structure. + * @param sectionname + * Given section name to add an entry. + * @param entryname + * Entry name to add. + * @entryvalue
missing "param" here. Building the docs throws an error on this. +/home/bruce/dpdk.org/lib/librte_cfgfile/rte_cfgfile.h:161: warning: Found unknown command `\entryvalue' +/home/bruce/dpdk.org/lib/librte_cfgfile/rte_cfgfile.h:166: warning: The following parameters of rte_cfgfile_add_entry(struct rte_cfgfile *cfg, const char *sectionname, const char *entryname, const char *entryvalue) are not documented: + parameter 'entryvalue'
+ * Entry value to add. + * @return + * 0 on success, -EEXIST if entry already exist, -EINVAL if bad argument + */ +int rte_cfgfile_add_entry(struct rte_cfgfile *cfg, + const char *sectionname, const char *entryname, + const char *entryvalue); +