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