-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.h
37 lines (25 loc) · 882 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
#ifndef __CONFIG_H__
#define __CONFIG_H__
typedef struct cfgElement
{
char* name;
char* svalue;
float value;
struct cfgElement* next;
} cfgElement;
typedef struct cfgFile
{
char* name;
cfgElement* elements;
} cfgFile;
void cfgReadCallback( const char* filename, char* section, void (*callback)( char*, char* ) );
cfgFile* cfgRead( const char* filename );
int cfgWrite( cfgFile* cfg );
void cfgClose( cfgFile* cfg );
char* cfgGetString( cfgFile* cfg, const char* element, const char* default_value );
float cfgGetFloat( cfgFile* cfg, const char* element, float default_value );
int cfgGetInt( cfgFile* cfg, const char* element, int default_value );
int cfgSetString( cfgFile* cfg, const char* element, char* value );
int cfgSetFloat( cfgFile* cfg, const char* element, float value );
int cfgSetInt( cfgFile* cfg, const char* element, int value );
#endif