-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.h
44 lines (29 loc) · 956 Bytes
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef CONFIG_H
#define CONFIG_H
#include "common.h"
/*
Very simple and naive text config file parser.
Config files cosist of sections which should be
defined like that:
[section]
Properties in section should be defined:
property_name=value
with no whitespace between property name and the
equal sign. Values are whitespace-trimmed.
You can use tags:
+tag_name
Tag, if found in a section returns true,
otherwise returns false.
Valid values for bool properties:
1, 0, true, false, t, f, yes, no, y, n
*/
bool cfg_Open(const char *filepath);
void cfg_Close();
bool cfg_SeekSection(char *section_name);
bool cfg_NextSection(char *section_name);
bool cfg_GetIntValue(char *value_name, int *value);
bool cfg_GetDoubleValue(char *value_name, double *value);
bool cfg_GetStringValue(char *value_name, char *str);
bool cfg_GetTag(char *tag_name);
bool cfg_GetBool(char *propertyName);
#endif