net/mlx5: handle Rx CQE compression
[dpdk.git] / lib / librte_cfgfile / rte_cfgfile.h
index 7c9fc91..f649836 100644 (file)
@@ -47,8 +47,13 @@ extern "C" {
 *
 ***/
 
-#define CFG_NAME_LEN 32
-#define CFG_VALUE_LEN 64
+#ifndef CFG_NAME_LEN
+#define CFG_NAME_LEN 64
+#endif
+
+#ifndef CFG_VALUE_LEN
+#define CFG_VALUE_LEN 256
+#endif
 
 /** Configuration file */
 struct rte_cfgfile;
@@ -67,7 +72,7 @@ struct rte_cfgfile_entry {
 * @param flags
 *   Config file flags, Reserved for future use. Must be set to 0.
 * @return
-*   Handle to configuration file
+*   Handle to configuration file on success, NULL otherwise
 */
 struct rte_cfgfile *rte_cfgfile_load(const char *filename, int flags);
 
@@ -121,6 +126,9 @@ int rte_cfgfile_has_section(struct rte_cfgfile *cfg, const char *sectionname);
 /**
 * Get number of entries in given config file section
 *
+* If multiple sections have the given name this function operates on the
+* first one.
+*
 * @param cfg
 *   Config file
 * @param sectionname
@@ -133,6 +141,9 @@ int rte_cfgfile_section_num_entries(struct rte_cfgfile *cfg,
 
 /** Get section entries as key-value pairs
 *
+* If multiple sections have the given name this function operates on the
+* first one.
+*
 * @param cfg
 *   Config file
 * @param sectionname
@@ -150,8 +161,38 @@ int rte_cfgfile_section_entries(struct rte_cfgfile *cfg,
        struct rte_cfgfile_entry *entries,
        int max_entries);
 
+/** Get section entries as key-value pairs
+*
+* The index of a section is the same as the index of its name in the
+* result of rte_cfgfile_sections. This API can be used when there are
+* multiple sections with the same name.
+*
+* @param cfg
+*   Config file
+* @param index
+*   Section index
+* @param sectionname
+*   Pre-allocated string of at least CFG_NAME_LEN characters where the
+*   section name is stored after successful invocation.
+* @param entries
+*   Pre-allocated array of at least max_entries entries where the section
+*   entries are stored as key-value pair after successful invocation
+* @param max_entries
+*   Maximum number of section entries to be stored in entries array
+* @return
+*   Number of entries populated on success, negative error code otherwise
+*/
+int rte_cfgfile_section_entries_by_index(struct rte_cfgfile *cfg,
+       int index,
+       char *sectionname,
+       struct rte_cfgfile_entry *entries,
+       int max_entries);
+
 /** Get value of the named entry in named config file section
 *
+* If multiple sections have the given name this function operates on the
+* first one.
+*
 * @param cfg
 *   Config file
 * @param sectionname
@@ -167,6 +208,9 @@ const char *rte_cfgfile_get_entry(struct rte_cfgfile *cfg,
 
 /** Check if given entry exists in named config file section
 *
+* If multiple sections have the given name this function operates on the
+* first one.
+*
 * @param cfg
 *   Config file
 * @param sectionname