diff options
Diffstat (limited to 'gconf/gconf.h')
-rw-r--r-- | gconf/gconf.h | 163 |
1 files changed, 0 insertions, 163 deletions
diff --git a/gconf/gconf.h b/gconf/gconf.h deleted file mode 100644 index f3d1bf8..0000000 --- a/gconf/gconf.h +++ /dev/null | |||
@@ -1,163 +0,0 @@ | |||
1 | /* gconf - General purpose configuration parser. | ||
2 | Copyright (C) 2007, 2008, 2009 Sergey Poznyakoff | ||
3 | |||
4 | This program is free software; you can redistribute it and/or modify it | ||
5 | under the terms of the GNU General Public License as published by the | ||
6 | Free Software Foundation; either version 3 of the License, or (at your | ||
7 | option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License along | ||
15 | with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
16 | |||
17 | #include <sys/types.h> | ||
18 | #include <unistd.h> | ||
19 | #include <stdlib.h> | ||
20 | #include <stdio.h> | ||
21 | #include <stdbool.h> | ||
22 | #include <gl_linked_list.h> | ||
23 | |||
24 | typedef struct { | ||
25 | char *file; | ||
26 | int line; | ||
27 | } gconf_locus_t; | ||
28 | |||
29 | extern gconf_locus_t gconf_locus; | ||
30 | |||
31 | enum gconf_data_type { | ||
32 | gconf_type_void, | ||
33 | gconf_type_string, | ||
34 | gconf_type_short, | ||
35 | gconf_type_ushort, | ||
36 | gconf_type_int, | ||
37 | gconf_type_uint, | ||
38 | gconf_type_long, | ||
39 | gconf_type_ulong, | ||
40 | gconf_type_size, | ||
41 | /* gconf_type_off,*/ | ||
42 | gconf_type_uintmax, | ||
43 | gconf_type_intmax, | ||
44 | gconf_type_time, | ||
45 | gconf_type_bool, | ||
46 | gconf_type_ipv4, | ||
47 | gconf_type_cidr, | ||
48 | gconf_type_host, | ||
49 | gconf_type_sockaddr, | ||
50 | gconf_type_section | ||
51 | }; | ||
52 | |||
53 | #define GCONF_LIST 0x8000 | ||
54 | #define GCONF_TYPE_MASK 0x00ff | ||
55 | #define GCONF_TYPE(c) ((c) & GCONF_TYPE_MASK) | ||
56 | #define GCONF_IS_LIST(c) ((c) & GCONF_LIST) | ||
57 | |||
58 | enum gconf_callback_command { | ||
59 | gconf_callback_section_begin, | ||
60 | gconf_callback_section_end, | ||
61 | gconf_callback_set_value | ||
62 | }; | ||
63 | |||
64 | #define GCONF_TYPE_STRING 0 | ||
65 | #define GCONF_TYPE_LIST 1 | ||
66 | #define GCONF_TYPE_ARRAY 2 | ||
67 | |||
68 | typedef struct gconf_value { | ||
69 | int type; | ||
70 | union { | ||
71 | gl_list_t list; | ||
72 | const char *string; | ||
73 | struct { | ||
74 | size_t c; | ||
75 | struct gconf_value *v; | ||
76 | } arg; | ||
77 | } v; | ||
78 | } gconf_value_t; | ||
79 | |||
80 | typedef int (*gconf_callback_fn) ( | ||
81 | enum gconf_callback_command cmd, | ||
82 | gconf_locus_t * /* locus */, | ||
83 | void * /* varptr */, | ||
84 | gconf_value_t * /* value */, | ||
85 | void * /* cb_data */ | ||
86 | ); | ||
87 | |||
88 | struct gconf_keyword { | ||
89 | const char *ident; | ||
90 | const char *argname; | ||
91 | const char *docstring; | ||
92 | enum gconf_data_type type; | ||
93 | void *varptr; | ||
94 | size_t offset; | ||
95 | gconf_callback_fn callback; | ||
96 | void *callback_data; | ||
97 | struct gconf_keyword *kwd; | ||
98 | }; | ||
99 | |||
100 | struct gconf_sockaddr { | ||
101 | int len; | ||
102 | struct sockaddr *sa; | ||
103 | }; | ||
104 | |||
105 | gconf_value_t *gconf_value_dup(gconf_value_t *input); | ||
106 | |||
107 | extern void gconf_print_diag(gconf_locus_t *, int, int, const char*); | ||
108 | |||
109 | void gconf_warning(gconf_locus_t *locus, int errcode, const char *fmt, ...) | ||
110 | __attribute__ ((__format__ (__printf__, 3, 4))); | ||
111 | void gconf_error(gconf_locus_t *locus, int errcode, const char *fmt, ...) | ||
112 | __attribute__ ((__format__ (__printf__, 3, 4))); | ||
113 | void gconf_set_keywords(struct gconf_keyword *kwd); | ||
114 | void gconf_gram_trace(int n); | ||
115 | void gconf_lex_trace (int n); | ||
116 | |||
117 | int gconf_lex_begin(const char*); | ||
118 | void gconf_lex_end(void); | ||
119 | int gconf_parse (const char *name); | ||
120 | |||
121 | void gconf_line_begin (void); | ||
122 | void gconf_line_add (const char *text, size_t len); | ||
123 | char *gconf_line_finish (void); | ||
124 | |||
125 | extern int gconf_string_convert (void *target, enum gconf_data_type type, | ||
126 | const char *string); | ||
127 | |||
128 | extern gconf_locus_t gconf_current_locus; | ||
129 | extern int gconf_error_count; | ||
130 | extern int gconf_default_port; | ||
131 | |||
132 | extern const char *gconf_preprocessor; | ||
133 | extern bool gconf_log_to_stderr; | ||
134 | extern void (*gconf_log_setup_hook) (); | ||
135 | |||
136 | size_t gconf_preproc_fill_buffer (char *buf, size_t size); | ||
137 | void gconf_preproc_add_include_dir (char *dir); | ||
138 | int gconf_preproc_init (const char *name); | ||
139 | void gconf_preproc_done (void); | ||
140 | int gconf_preproc_run (const char *config_file, const char *extpp); | ||
141 | |||
142 | FILE *gconf_preproc_extrn_start (const char *file, pid_t *ppid); | ||
143 | void gconf_preproc_extrn_shutdown (pid_t pid); | ||
144 | |||
145 | char *gconf_install_text (const char *str); | ||
146 | void gconf_destroy_text (void); | ||
147 | |||
148 | void gconf_include_path_setup (const char *dir, ...); | ||
149 | void gconf_include_path_setup_v (char **dirs); | ||
150 | |||
151 | const char *gconf_data_type_string (enum gconf_data_type type); | ||
152 | void gconf_format_docstring (FILE *stream, const char *docstring, | ||
153 | unsigned level); | ||
154 | void gconf_format_simple_statement (FILE *stream, struct gconf_keyword *kwp, | ||
155 | unsigned level); | ||
156 | void gconf_format_block_statement (FILE *stream, struct gconf_keyword *kwp, | ||
157 | unsigned level); | ||
158 | void gconf_format_statement_array (FILE *stream, struct gconf_keyword *kwp, | ||
159 | unsigned n, | ||
160 | unsigned level); | ||
161 | |||
162 | |||
163 | |||