aboutsummaryrefslogtreecommitdiff
path: root/gconf/gconf.h
diff options
context:
space:
mode:
Diffstat (limited to 'gconf/gconf.h')
-rw-r--r--gconf/gconf.h163
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
24typedef struct {
25 char *file;
26 int line;
27} gconf_locus_t;
28
29extern gconf_locus_t gconf_locus;
30
31enum 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
58enum 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
68typedef 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
80typedef 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
88struct 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
100struct gconf_sockaddr {
101 int len;
102 struct sockaddr *sa;
103};
104
105gconf_value_t *gconf_value_dup(gconf_value_t *input);
106
107extern void gconf_print_diag(gconf_locus_t *, int, int, const char*);
108
109void gconf_warning(gconf_locus_t *locus, int errcode, const char *fmt, ...)
110 __attribute__ ((__format__ (__printf__, 3, 4)));
111void gconf_error(gconf_locus_t *locus, int errcode, const char *fmt, ...)
112 __attribute__ ((__format__ (__printf__, 3, 4)));
113void gconf_set_keywords(struct gconf_keyword *kwd);
114void gconf_gram_trace(int n);
115void gconf_lex_trace (int n);
116
117int gconf_lex_begin(const char*);
118void gconf_lex_end(void);
119int gconf_parse (const char *name);
120
121void gconf_line_begin (void);
122void gconf_line_add (const char *text, size_t len);
123char *gconf_line_finish (void);
124
125extern int gconf_string_convert (void *target, enum gconf_data_type type,
126 const char *string);
127
128extern gconf_locus_t gconf_current_locus;
129extern int gconf_error_count;
130extern int gconf_default_port;
131
132extern const char *gconf_preprocessor;
133extern bool gconf_log_to_stderr;
134extern void (*gconf_log_setup_hook) ();
135
136size_t gconf_preproc_fill_buffer (char *buf, size_t size);
137void gconf_preproc_add_include_dir (char *dir);
138int gconf_preproc_init (const char *name);
139void gconf_preproc_done (void);
140int gconf_preproc_run (const char *config_file, const char *extpp);
141
142FILE *gconf_preproc_extrn_start (const char *file, pid_t *ppid);
143void gconf_preproc_extrn_shutdown (pid_t pid);
144
145char *gconf_install_text (const char *str);
146void gconf_destroy_text (void);
147
148void gconf_include_path_setup (const char *dir, ...);
149void gconf_include_path_setup_v (char **dirs);
150
151const char *gconf_data_type_string (enum gconf_data_type type);
152void gconf_format_docstring (FILE *stream, const char *docstring,
153 unsigned level);
154void gconf_format_simple_statement (FILE *stream, struct gconf_keyword *kwp,
155 unsigned level);
156void gconf_format_block_statement (FILE *stream, struct gconf_keyword *kwp,
157 unsigned level);
158void gconf_format_statement_array (FILE *stream, struct gconf_keyword *kwp,
159 unsigned n,
160 unsigned level);
161
162
163

Return to:

Send suggestions and report system problems to the System administrator.