Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 84 lines (64 sloc) 3.579 kB
8c0604c @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@257 5dc97367-97…
alobbs authored
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
3 /* Cherokee
4 *
5 * Authors:
6 * Alvaro Lopez Ortega <alvaro@alobbs.com>
7 *
920e20b @alobbs Happy new year!
alobbs authored
8 * Copyright (C) 2001-2011 Alvaro Lopez Ortega
8c0604c @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@257 5dc97367-97…
alobbs authored
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of version 2 of the GNU General Public
12 * License as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
2c39092 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@2660 5dc97367-9…
alobbs authored
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 * 02110-1301, USA.
72f6444 @alobbs Clean up: Trims trailing spaces.
alobbs authored
23 */
8c0604c @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@257 5dc97367-97…
alobbs authored
24
25 #if !defined (CHEROKEE_INSIDE_CHEROKEE_H) && !defined (CHEROKEE_COMPILATION)
26 # error "Only <cherokee/cherokee.h> can be included directly, this file may disappear or change contents."
27 #endif
28
29 #ifndef CHEROKEE_CONFIG_NODE_H
30 #define CHEROKEE_CONFIG_NODE_H
31
32 #include <cherokee/common.h>
33 #include <cherokee/list.h>
34 #include <cherokee/buffer.h>
35
36 CHEROKEE_BEGIN_DECLS
37
38 typedef struct {
ee8023f @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@384 5dc97367-97…
alobbs authored
39 cherokee_list_t entry;
40 cherokee_list_t child;
8c0604c @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@257 5dc97367-97…
alobbs authored
41
42 cherokee_buffer_t key;
43 cherokee_buffer_t val;
44 } cherokee_config_node_t;
45
46 #define CONFIG_NODE(c) ((cherokee_config_node_t *)(c))
47
b6c69ad @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@269 5dc97367-97…
alobbs authored
48 #define cherokee_config_node_foreach(i,config) \
49 list_for_each (i, &config->child)
8c0604c @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@257 5dc97367-97…
alobbs authored
50
b6c69ad @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@269 5dc97367-97…
alobbs authored
51 typedef ret_t (* cherokee_config_node_while_func_t) (cherokee_config_node_t *, void *);
52 typedef ret_t (* cherokee_config_node_list_func_t) (char *, void *);
8c0604c @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@257 5dc97367-97…
alobbs authored
53
b061149 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@272 5dc97367-97…
alobbs authored
54 ret_t cherokee_config_node_new (cherokee_config_node_t **conf);
c2962be @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@690 5dc97367-97…
alobbs authored
55 ret_t cherokee_config_node_free (cherokee_config_node_t *conf);
56 ret_t cherokee_config_node_init (cherokee_config_node_t *conf);
57 ret_t cherokee_config_node_mrproper (cherokee_config_node_t *conf);
8c0604c @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@257 5dc97367-97…
alobbs authored
58
b6c69ad @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@269 5dc97367-97…
alobbs authored
59 ret_t cherokee_config_node_add (cherokee_config_node_t *conf, const char *key, cherokee_buffer_t *val);
60 ret_t cherokee_config_node_add_buf (cherokee_config_node_t *conf, cherokee_buffer_t *key, cherokee_buffer_t *val);
8c0604c @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@257 5dc97367-97…
alobbs authored
61
b6c69ad @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@269 5dc97367-97…
alobbs authored
62 ret_t cherokee_config_node_get (cherokee_config_node_t *conf, const char *key, cherokee_config_node_t **entry);
63 ret_t cherokee_config_node_get_buf (cherokee_config_node_t *conf, cherokee_buffer_t *key, cherokee_config_node_t **entry);
64
65 ret_t cherokee_config_node_while (cherokee_config_node_t *conf, cherokee_config_node_while_func_t func, void *data);
d19c92c @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@270 5dc97367-97…
alobbs authored
66
b6c69ad @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@269 5dc97367-97…
alobbs authored
67 /* Convenience functions: value retrieving
68 */
51ebcfa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@277 5dc97367-97…
alobbs authored
69 ret_t cherokee_config_node_read (cherokee_config_node_t *conf, const char *key, cherokee_buffer_t **buf);
b0dd10b @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1398 5dc97367-9…
alobbs authored
70 ret_t cherokee_config_node_copy (cherokee_config_node_t *conf, const char *key, cherokee_buffer_t *buf);
71
51ebcfa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@277 5dc97367-97…
alobbs authored
72 ret_t cherokee_config_node_read_path (cherokee_config_node_t *conf, const char *key, cherokee_buffer_t **buf);
73 ret_t cherokee_config_node_read_int (cherokee_config_node_t *conf, const char *key, int *num);
86720a6 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1878 5dc97367-9…
alobbs authored
74 ret_t cherokee_config_node_read_long (cherokee_config_node_t *conf, const char *key, long *num);
337832a @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@1375 5dc97367-9…
alobbs authored
75 ret_t cherokee_config_node_read_bool (cherokee_config_node_t *conf, const char *key, cherokee_boolean_t *val);
72f6444 @alobbs Clean up: Trims trailing spaces.
alobbs authored
76 ret_t cherokee_config_node_read_list (cherokee_config_node_t *conf, const char *key,
51ebcfa @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@277 5dc97367-97…
alobbs authored
77 cherokee_config_node_list_func_t func, void *param);
78
ee8023f @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@384 5dc97367-97…
alobbs authored
79 ret_t cherokee_config_node_convert_list (cherokee_config_node_t *conf, const char *key, cherokee_list_t *list);
8c0604c @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@257 5dc97367-97…
alobbs authored
80
81 CHEROKEE_END_DECLS
82
83 #endif /* CHEROKEE_CONFIG_NODE_H */
Something went wrong with that request. Please try again.