This commit was manufactured by cvs2svn to create tag
[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 /* Function prototypes */
39
40 struct CFG_Header *CFG_ReadFile(char *filename);
41 char              *CFG_Get(struct CFG_Header *cfg, char *section, char *key);
42 char              *CFG_Set(struct CFG_Header *cfg, char *section, char *key, 
43                            char *value);
44 int                CFG_WriteFile(struct CFG_Header *cfg, char *filename);
45
46 int               CFG_ReadConfig(char **model, char **port, char **initlength,
47                                  char **connection, char **bindir, char **synchronizetime,
48                                  bool isgnokiid);
49
50 struct CFG_Header *CFG_FindGnokiirc();
51
52 #endif /* _CFGREADER_H */