]> granicus.if.org Git - apache/blob - include/util_cfgtree.h
fix name of The Apache Software Foundation
[apache] / include / util_cfgtree.h
1 /* Copyright 2000-2004 The Apache Software Foundation
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 #ifndef AP_CONFTREE_H
17 #define AP_CONFTREE_H
18
19 #include "ap_config.h"
20
21 /**
22  * @package Config Tree Package
23  */
24
25 typedef struct ap_directive_t ap_directive_t;
26
27 /**
28  * Structure used to build the config tree.  The config tree only stores
29  * the directives that will be active in the running server.  Directives
30  * that contain other directions, such as <Directory ...> cause a sub-level
31  * to be created, where the included directives are stored.  The closing
32  * directive (</Directory>) is not stored in the tree.
33  */
34 struct ap_directive_t {
35     /** The current directive */
36     const char *directive;
37     /** The arguments for the current directive, stored as a space 
38      *  separated list */
39     const char *args;
40     /** The next directive node in the tree
41      *  @defvar ap_directive_t *next */
42     struct ap_directive_t *next;
43     /** The first child node of this directive 
44      *  @defvar ap_directive_t *first_child */
45     struct ap_directive_t *first_child;
46     /** The parent node of this directive 
47      *  @defvar ap_directive_t *parent */
48     struct ap_directive_t *parent;
49
50     /** directive's module can store add'l data here */
51     void *data;
52
53     /* ### these may go away in the future, but are needed for now */
54     /** The name of the file this directive was found in */
55     const char *filename;
56     /** The line number the directive was on */
57     int line_num;
58 };
59
60 /**
61  * The root of the configuration tree
62  * @defvar ap_directive_t *conftree
63  */
64 AP_DECLARE_DATA extern ap_directive_t *ap_conftree;
65
66 /**
67  * Add a node to the configuration tree.
68  * @param parent The current parent node.  If the added node is a first_child,
69                  then this is changed to the current node
70  * @param current The current node
71  * @param toadd The node to add to the tree
72  * @param child Is the node to add a child node
73  * @return the added node
74  */
75 ap_directive_t *ap_add_node(ap_directive_t **parent, ap_directive_t *current, 
76                             ap_directive_t *toadd, int child);
77
78 #endif