summaryrefslogtreecommitdiffstats
path: root/lib/librte_cfgfile/rte_cfgfile.h
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2017-05-16 14:51:32 +0200
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2017-05-16 16:20:45 +0200
commit7595afa4d30097c1177b69257118d8ad89a539be (patch)
tree4bfeadc905c977e45e54a90c42330553b8942e4e /lib/librte_cfgfile/rte_cfgfile.h
parentce3d555e43e3795b5d9507fcfc76b7a0a92fd0d6 (diff)
Imported Upstream version 17.05
Change-Id: Id1e419c5a214e4a18739663b91f0f9a549f1fdc6 Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'lib/librte_cfgfile/rte_cfgfile.h')
-rw-r--r--lib/librte_cfgfile/rte_cfgfile.h44
1 files changed, 43 insertions, 1 deletions
diff --git a/lib/librte_cfgfile/rte_cfgfile.h b/lib/librte_cfgfile/rte_cfgfile.h
index b40e6a13..fa10d408 100644
--- a/lib/librte_cfgfile/rte_cfgfile.h
+++ b/lib/librte_cfgfile/rte_cfgfile.h
@@ -66,19 +66,61 @@ struct rte_cfgfile_entry {
char value[CFG_VALUE_LEN]; /**< Value */
};
+/** Configuration file operation optional arguments */
+struct rte_cfgfile_parameters {
+ /** Config file comment character; one of '!', '#', '%', ';', '@' */
+ char comment_character;
+};
+
+/**@{ cfgfile load operation flags */
+enum {
+ /**
+ * Indicates that the file supports key value entries before the first
+ * defined section. These entries can be accessed in the "GLOBAL"
+ * section.
+ */
+ CFG_FLAG_GLOBAL_SECTION = 1,
+
+ /**
+ * Indicates that file supports key value entries where the value can
+ * be zero length (e.g., "key=").
+ */
+ CFG_FLAG_EMPTY_VALUES = 2,
+};
+/**@} */
+
+/** Defines the default comment character used for parsing config files. */
+#define CFG_DEFAULT_COMMENT_CHARACTER ';'
+
/**
* Open config file
*
* @param filename
* Config file name
* @param flags
-* Config file flags, Reserved for future use. Must be set to 0.
+* Config file flags
* @return
* Handle to configuration file on success, NULL otherwise
*/
struct rte_cfgfile *rte_cfgfile_load(const char *filename, int flags);
/**
+ * Open config file with specified optional parameters.
+ *
+ * @param filename
+ * Config file name
+ * @param flags
+ * Config file flags
+ * @param params
+ * Additional configuration attributes. Must be configured with desired
+ * values prior to invoking this API.
+ * @return
+ * Handle to configuration file on success, NULL otherwise
+ */
+struct rte_cfgfile *rte_cfgfile_load_with_params(const char *filename,
+ int flags, const struct rte_cfgfile_parameters *params);
+
+/**
* Get number of sections in config file
*
* @param cfg