MGE System Utility Library - API Documentation  v1.1.3
Library of system utility functions.
configfile.h
Go to the documentation of this file.
1 
16 /* **********************************************************************
17  * *
18  * Changelog *
19  * *
20  * Date Author Version Description *
21  * *
22  * 12/07/2015 MG 1.0.1 First release. *
23  * 16/07/2016 MG 1.0.2 Move towards kernel coding style. *
24  * 17/07/2016 MG 1.0.3 Further coding style changes. *
25  * 07/11/2017 MG 1.0.4 Add Doxygen comments. *
26  * 10/11/2017 MG 1.0.5 Add SPDX license tag. *
27  * 02/01/2018 MG 1.0.6 Move to new source directory structure. *
28  * 16/05/2019 MG 1.0.7 Collapse AT subprojects into one. *
29  * 30/10/2019 MG 1.0.8 Apply clang-format. *
30  * *
31  ************************************************************************
32  */
33 
34 #ifndef CONFIGFILE_H
35 #define CONFIGFILE_H
36 
37 #include <portability.h>
38 
39 BEGIN_C_DECLS
40 
42 #define MAX_KEYVAL_LENGTH 1000
43 
45 #define MAX_KEYS_PER_SECTION 1000
46 
48 #define MAX_LINE_LENGTH 1000
49 
51 struct confkey {
52  char *key;
53  int mandatory;
54  int present;
56 };
57 
59 struct confsection {
60  char *section;
61  int mandatory;
62  int present;
64 };
65 
66 int parsefile(struct confsection *params, int nparams, char *filename);
67 
68 END_C_DECLS
69 
70 #endif /* ndef CONFIGFILE_H */
71 
int mandatory
Mandatory, 1 = true, 0 = false.
Definition: configfile.h:61
int mandatory
Mandatory, 1 = true, 0 = false.
Definition: configfile.h:53
char * section
Section name.
Definition: configfile.h:60
Configuration section definition.
Definition: configfile.h:59
Configuration Key / Value Pair.
Definition: configfile.h:51
#define MAX_KEYS_PER_SECTION
Max number of keys per section.
Definition: configfile.h:45
char * key
Key part of pair.
Definition: configfile.h:52
#define MAX_KEYVAL_LENGTH
Max length of Key and value.
Definition: configfile.h:42
char value[MAX_KEYVAL_LENGTH]
Value part of pair.
Definition: configfile.h:55
int present
Pair present, 1 = true, 0 =false.
Definition: configfile.h:62
int parsefile(struct confsection *params, int nparams, char *filename)
Parse a configuration file.
Definition: configfile.c:102
int present
Pair present, 1 = true, 0 =false.
Definition: configfile.h:54