DPDK 22.11.5
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
23#ifndef CFG_NAME_LEN
24#define CFG_NAME_LEN 64
25#endif
26
27#ifndef CFG_VALUE_LEN
28#define CFG_VALUE_LEN 256
29#endif
30
32struct rte_cfgfile;
33
36 char name[CFG_NAME_LEN];
37 char value[CFG_VALUE_LEN];
38};
39
44};
45
47enum {
54
60};
64#define CFG_DEFAULT_COMMENT_CHARACTER ';'
65
76struct rte_cfgfile *rte_cfgfile_load(const char *filename, int flags);
77
91struct rte_cfgfile *rte_cfgfile_load_with_params(const char *filename,
92 int flags, const struct rte_cfgfile_parameters *params);
93
108struct rte_cfgfile *rte_cfgfile_create(int flags);
109
120int
121rte_cfgfile_add_section(struct rte_cfgfile *cfg, const char *sectionname);
122
137int rte_cfgfile_add_entry(struct rte_cfgfile *cfg,
138 const char *sectionname, const char *entryname,
139 const char *entryvalue);
140
155int rte_cfgfile_set_entry(struct rte_cfgfile *cfg, const char *sectionname,
156 const char *entryname, const char *entryvalue);
157
168int rte_cfgfile_save(struct rte_cfgfile *cfg, const char *filename);
169
182int rte_cfgfile_num_sections(struct rte_cfgfile *cfg, const char *sec_name,
183 size_t length);
184
202int rte_cfgfile_sections(struct rte_cfgfile *cfg, char *sections[],
203 int max_sections);
204
215int rte_cfgfile_has_section(struct rte_cfgfile *cfg, const char *sectionname);
216
230int rte_cfgfile_section_num_entries(struct rte_cfgfile *cfg,
231 const char *sectionname);
232
250 char *sectionname,
251 int index);
252
271int rte_cfgfile_section_entries(struct rte_cfgfile *cfg,
272 const char *sectionname,
273 struct rte_cfgfile_entry *entries,
274 int max_entries);
275
298int rte_cfgfile_section_entries_by_index(struct rte_cfgfile *cfg,
299 int index,
300 char *sectionname,
301 struct rte_cfgfile_entry *entries,
302 int max_entries);
303
319const char *rte_cfgfile_get_entry(struct rte_cfgfile *cfg,
320 const char *sectionname,
321 const char *entryname);
322
338int rte_cfgfile_has_entry(struct rte_cfgfile *cfg, const char *sectionname,
339 const char *entryname);
340
349int rte_cfgfile_close(struct rte_cfgfile *cfg);
350
351#ifdef __cplusplus
352}
353#endif
354
355#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:53
@ CFG_FLAG_EMPTY_VALUES
Definition: rte_cfgfile.h:59
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:35
char value[CFG_VALUE_LEN]
Definition: rte_cfgfile.h:37
char name[CFG_NAME_LEN]
Definition: rte_cfgfile.h:36