1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #ifndef PHP_LIB_INIFILE_H
22 #define PHP_LIB_INIFILE_H
23
24 typedef struct {
25 char *group;
26 char *name;
27 } key_type;
28
29 typedef struct {
30 char *value;
31 } val_type;
32
33 typedef struct {
34 key_type key;
35 val_type val;
36 size_t pos;
37 } line_type;
38
39 typedef struct {
40 char *lockfn;
41 int lockfd;
42 php_stream *fp;
43 int readonly;
44 line_type curr;
45 line_type next;
46 } inifile;
47
48 val_type inifile_fetch(inifile *dba, const key_type *key, int skip);
49 int inifile_firstkey(inifile *dba);
50 int inifile_nextkey(inifile *dba);
51 int inifile_delete(inifile *dba, const key_type *key);
52 int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found);
53 int inifile_replace(inifile *dba, const key_type *key, const val_type *val);
54 int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *val, zend_bool *found);
55 int inifile_append(inifile *dba, const key_type *key, const val_type *val);
56 char *inifile_version();
57
58 key_type inifile_key_split(const char *group_name);
59 char * inifile_key_string(const key_type *key);
60
61 void inifile_key_free(key_type *key);
62 void inifile_val_free(val_type *val);
63 void inifile_line_free(line_type *ln);
64
65 inifile * inifile_alloc(php_stream *fp, int readonly, int persistent);
66 void inifile_free(inifile *dba, int persistent);
67
68 #endif