First version, development moved to 5110-connected machine
[gnokii.git] / include / files / cfgreader.h
1 /*
2
3   $Id$
4   
5   G N O K I I
6
7   A Linux/Unix toolset and driver for Nokia mobile phones.
8
9   Released under the terms of the GNU GPL, see file COPYING for more details.
10
11   Header file for config file reader.
12
13 */
14
15 #ifndef _CFGREADER_H
16 #define _CFGREADER_H
17
18 #ifndef WIN32
19   #include "config.h"
20 #endif
21
22 /* Structure definitions */
23
24 /* A linked list of key/value pairs */
25
26 struct CFG_Entry {
27         struct CFG_Entry *next, *prev;
28         char *key;
29         char *value;
30 };
31
32 struct CFG_Header {
33         struct CFG_Header *next, *prev;
34         struct CFG_Entry *entries;
35         char *section;
36 };
37
38 #ifndef UCLINUX
39
40 /* Function prototypes */
41
42 struct CFG_Header *CFG_ReadFile(char *filename);
43 char              *CFG_Get(struct CFG_Header *cfg, char *section, char *key);
44 char              *CFG_Set(struct CFG_Header *cfg, char *section, char *key, 
45                            char *value);
46 int                CFG_WriteFile(struct CFG_Header *cfg, char *filename);
47
48 #endif /* UCLINUX */
49
50 int               CFG_ReadConfig(char **model, char **port, char **initlength,
51                                  char **connection, char **bindir,
52                                  bool isgnokiid);
53
54 #ifndef UCLINUX
55
56 struct CFG_Header *CFG_FindGnokiirc();
57
58 #endif /* UCLINUX */
59
60 #endif /* _CFGREADER_H */