DPDK 26.03.0-rc1
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
140int rte_cfgfile_add_entry(struct rte_cfgfile *cfg,
141 const char *sectionname, const char *entryname,
142 const char *entryvalue);
143
158int rte_cfgfile_set_entry(struct rte_cfgfile *cfg, const char *sectionname,
159 const char *entryname, const char *entryvalue);
160
171int rte_cfgfile_save(struct rte_cfgfile *cfg, const char *filename);
172
185int rte_cfgfile_num_sections(struct rte_cfgfile *cfg, const char *sec_name,
186 size_t length);
187
205int rte_cfgfile_sections(struct rte_cfgfile *cfg, char *sections[],
206 int max_sections);
207
218int rte_cfgfile_has_section(struct rte_cfgfile *cfg, const char *sectionname);
219
233int rte_cfgfile_section_num_entries(struct rte_cfgfile *cfg,
234 const char *sectionname);
235
253 char *sectionname,
254 int index);
255
274int rte_cfgfile_section_entries(struct rte_cfgfile *cfg,
275 const char *sectionname,
276 struct rte_cfgfile_entry *entries,
277 int max_entries);
278
301int rte_cfgfile_section_entries_by_index(struct rte_cfgfile *cfg,
302 int index,
303 char *sectionname,
304 struct rte_cfgfile_entry *entries,
305 int max_entries);
306
322const char *rte_cfgfile_get_entry(struct rte_cfgfile *cfg,
323 const char *sectionname,
324 const char *entryname);
325
341int rte_cfgfile_has_entry(struct rte_cfgfile *cfg, const char *sectionname,
342 const char *entryname);
343
352int rte_cfgfile_close(struct rte_cfgfile *cfg);
353
354#ifdef __cplusplus
355}
356#endif
357
358#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)
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)
@ CFG_FLAG_GLOBAL_SECTION
Definition: rte_cfgfile.h:52
@ CFG_FLAG_EMPTY_VALUES
Definition: rte_cfgfile.h:58
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