1 /* Copyright 2000-2004 The Apache Software Foundation
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include "ap_config.h"
22 * @package Config Tree Package
25 typedef struct ap_directive_t ap_directive_t;
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.
34 struct ap_directive_t {
35 /** The current directive */
36 const char *directive;
37 /** The arguments for the current directive, stored as a space
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;
50 /** directive's module can store add'l data here */
53 /* ### these may go away in the future, but are needed for now */
54 /** The name of the file this directive was found in */
56 /** The line number the directive was on */
61 * The root of the configuration tree
62 * @defvar ap_directive_t *conftree
64 AP_DECLARE_DATA extern ap_directive_t *ap_conftree;
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
75 ap_directive_t *ap_add_node(ap_directive_t **parent, ap_directive_t *current,
76 ap_directive_t *toadd, int child);