]> git.deb.at Git - pkg/abook.git/blob - conff.h
31d563fac633f603d8e48f55e63f7c6dc8efed59
[pkg/abook.git] / conff.h
1
2 /*
3  *
4  *  $Id: conff.h,v 1.3 2001/12/19 20:20:55 jheinonen Exp $
5  *
6  *  Copyright (C) Jaakko Heinonen
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  */
22
23 #ifndef _CONFF_H
24 #define _CONFF_H
25
26 #include <stdlib.h>
27
28
29 struct conff_node
30 {
31         char *key, *value;
32
33         struct conff_node *next;
34 };
35
36
37 int             conff_add_key(struct conff_node **ptr, char *key,
38                 char *value, int flags);
39 char            *conff_get_value(struct conff_node *node, char *key);
40 #ifdef DEBUG
41 void            print_values(struct conff_node *root);
42 #endif
43 void            conff_free_nodes(struct conff_node *node);
44 void            conff_remove_key(struct conff_node **node, char *key);
45 int             conff_save_file(struct conff_node *node, char *filename);
46 int             conff_load_file(struct conff_node **node,
47                 char *filename, int flags);
48 char            *strtrim(char *);
49
50
51 #define DONT_REPLACE_KEY        0
52 #define REPLACE_KEY             1
53
54 #endif