DPDK 25.03.0-rc0
rte_cfgfile.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
3 */
4
5#ifndef __INCLUDE_RTE_CFGFILE_H__
6#define __INCLUDE_RTE_CFGFILE_H__
7
8#include <stddef.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
22#ifndef CFG_NAME_LEN
23#define CFG_NAME_LEN 64
24#endif
25
26#ifndef CFG_VALUE_LEN
27#define CFG_VALUE_LEN 256
28#endif
29
31struct rte_cfgfile;
32
35 char name[CFG_NAME_LEN];
36 char value[CFG_VALUE_LEN];
37};
38
43};
44
46enum {
53
59};
63#define CFG_DEFAULT_COMMENT_CHARACTER ';'
64
75struct rte_cfgfile *rte_cfgfile_load(const char *filename, int flags);
76
90struct rte_cfgfile *rte_cfgfile_load_with_params(const char *filename,
91 int flags, const struct rte_cfgfile_parameters *params);
92
107struct rte_cfgfile *rte_cfgfile_create(int flags);
108
119int
120rte_cfgfile_add_section(struct rte_cfgfile *cfg, const char *sectionname);
121
136int rte_cfgfile_add_entry(struct rte_cfgfile *cfg,
137 const char *sectionname, const char *entryname,
138 const char *entryvalue);
139
154int rte_cfgfile_set_entry(struct rte_cfgfile *cfg, const char *sectionname,
155 const char *entryname, const char *entryvalue);
156
167int rte_cfgfile_save(struct rte_cfgfile *cfg, const char *filename);
168
181int rte_cfgfile_num_sections(struct rte_cfgfile *cfg, const char *sec_name,
182 size_t length);
183
201int rte_cfgfile_sections(struct rte_cfgfile *cfg, char *sections[],
202 int max_sections);
203
214int rte_cfgfile_has_section(struct rte_cfgfile *cfg, const char *sectionname);
215
229int rte_cfgfile_section_num_entries(struct rte_cfgfile *cfg,
230 const char *sectionname);
231
249 char *sectionname,
250 int index);
251
270int rte_cfgfile_section_entries(struct rte_cfgfile *cfg,
271 const char *sectionname,
272 struct rte_cfgfile_entry *entries,
273 int max_entries);
274
297int rte_cfgfile_section_entries_by_index(struct rte_cfgfile *cfg,
298 int index,
299 char *sectionname,
300 struct rte_cfgfile_entry *entries,
301 int max_entries);
302
318const char *rte_cfgfile_get_entry(struct rte_cfgfile *cfg,
319 const char *sectionname,
320 const char *entryname);
321
337int rte_cfgfile_has_entry(struct rte_cfgfile *cfg, const char *sectionname,
338 const char *entryname);
339
348int rte_cfgfile_close(struct rte_cfgfile *cfg);
349
350#ifdef __cplusplus
351}
352#endif
353
354#endif
int rte_cfgfile_close(struct rte_cfgfile *cfg)
int rte_cfgfile_section_entries_by_index(struct rte_cfgfile *cfg, int index, char *sectionname, struct rte_cfgfile_entry *entries, int max_entries)
@ CFG_FLAG_GLOBAL_SECTION
Definition: rte_cfgfile.h:52
@ CFG_FLAG_EMPTY_VALUES
Definition: rte_cfgfile.h:58
struct rte_cfgfile * rte_cfgfile_load_with_params(const char *filename, int flags, const struct rte_cfgfile_parameters *params)
int rte_cfgfile_add_section(struct rte_cfgfile *cfg, const char *sectionname)
int rte_cfgfile_section_num_entries(struct rte_cfgfile *cfg, const char *sectionname)
int rte_cfgfile_add_entry(struct rte_cfgfile *cfg, const char *sectionname, const char *entryname, const char *entryvalue)
const char * rte_cfgfile_get_entry(struct rte_cfgfile *cfg, const char *sectionname, const char *entryname)
int rte_cfgfile_sections(struct rte_cfgfile *cfg, char *sections[], int max_sections)
int rte_cfgfile_save(struct rte_cfgfile *cfg, const char *filename)
int rte_cfgfile_section_entries(struct rte_cfgfile *cfg, const char *sectionname, struct rte_cfgfile_entry *entries, int max_entries)
struct rte_cfgfile * rte_cfgfile_load(const char *filename, int flags)
int rte_cfgfile_section_num_entries_by_index(struct rte_cfgfile *cfg, char *sectionname, int index)
int rte_cfgfile_has_entry(struct rte_cfgfile *cfg, const char *sectionname, const char *entryname)
int rte_cfgfile_has_section(struct rte_cfgfile *cfg, const char *sectionname)
struct rte_cfgfile * rte_cfgfile_create(int flags)
int rte_cfgfile_num_sections(struct rte_cfgfile *cfg, const char *sec_name, size_t length)
int rte_cfgfile_set_entry(struct rte_cfgfile *cfg, const char *sectionname, const char *entryname, const char *entryvalue)
Definition: rte_cfgfile.h:34
char value[CFG_VALUE_LEN]
Definition: rte_cfgfile.h:36
char name[CFG_NAME_LEN]
Definition: rte_cfgfile.h:35