MGE System Utility Library - Full Internal Documentation  v1.7.3
Library of system utility functions.
mge-configfile.h
Go to the documentation of this file.
1 
16 #ifndef MGE_CONFIGFILE_H
17 #define MGE_CONFIGFILE_H
18 
19 #include <libmgec/mge-portability.h>
20 
21 BEGIN_C_DECLS
22 
24 #define MAX_KEYVAL_LENGTH 1000
25 
27 #define MAX_KEYS_PER_SECTION 1000
28 
30 #define MAX_LINE_LENGTH 1000
31 
33 struct confkey {
34  const char *key;
35  int mandatory;
36  int present;
38 };
39 
41 struct confsection {
42  const char *section;
43  int mandatory;
44  int present;
46 };
47 
48 int parsefile(struct confsection *params, int nparams, const char *filename);
49 
50 END_C_DECLS
51 
52 #endif /* ndef MGE_CONFIGFILE_H */
int parsefile(struct confsection *params, int nparams, const char *filename)
Parse a configuration file.
Definition: configfile.c:409
int mandatory
Mandatory, 1 = true, 0 = false.
Definition: mge-configfile.h:43
int mandatory
Mandatory, 1 = true, 0 = false.
Definition: mge-configfile.h:35
const char * section
Section name.
Definition: mge-configfile.h:42
const char * key
Key part of pair.
Definition: mge-configfile.h:34
Configuration section definition.
Definition: mge-configfile.h:41
Configuration Key / Value Pair.
Definition: mge-configfile.h:33
#define MAX_KEYVAL_LENGTH
Max length of Key and value.
Definition: mge-configfile.h:24
struct confkey keys[MAX_KEYS_PER_SECTION]
Array of KV Pairs.
Definition: mge-configfile.h:45
char value[MAX_KEYVAL_LENGTH]
Value part of pair.
Definition: mge-configfile.h:37
#define MAX_KEYS_PER_SECTION
Max number of keys per section.
Definition: mge-configfile.h:27
int present
Pair present, 1 = true, 0 =false.
Definition: mge-configfile.h:44
int present
Pair present, 1 = true, 0 =false.
Definition: mge-configfile.h:36