:pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001
[gnokii.git] / include / 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   Copyright (C) 1999, 2000 Hugh Blemings & Pavel Janík ml.
10
11   Released under the terms of the GNU GPL, see file COPYING for more details.
12
13   Header file for config file reader.
14
15   $Log$
16   Revision 1.1.1.1  2001/11/25 21:59:19  short
17   :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001
18
19   Revision 1.4  2000/12/19 16:18:19  pkot
20   configure script updates and added shared function for configfile reading
21
22   
23 */
24
25 #ifndef _CFGREADER_H
26 #define _CFGREADER_H
27
28 #include "config.h"
29
30 /* Structure definitions */
31
32 /* A linked list of key/value pairs */
33
34 struct CFG_Entry {
35         struct CFG_Entry *next, *prev;
36         char *key;
37         char *value;
38 };
39
40 struct CFG_Header {
41         struct CFG_Header *next, *prev;
42         struct CFG_Entry *entries;
43         char *section;
44 };
45
46 /* Function prototypes */
47
48 struct CFG_Header *CFG_ReadFile(char *filename);
49 char              *CFG_Get(struct CFG_Header *cfg, char *section, char *key);
50 char              *CFG_Set(struct CFG_Header *cfg, char *section, char *key, 
51                            char *value);
52 int                CFG_WriteFile(struct CFG_Header *cfg, char *filename);
53 int                readconfig(char **model, char **port, char **initlength, char **connection, char **bindir);
54
55 #endif /* _CFGREADER_H */