|
Packit |
90a5c9 |
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
Packit |
90a5c9 |
* contributor license agreements. See the NOTICE file distributed with
|
|
Packit |
90a5c9 |
* this work for additional information regarding copyright ownership.
|
|
Packit |
90a5c9 |
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
Packit |
90a5c9 |
* (the "License"); you may not use this file except in compliance with
|
|
Packit |
90a5c9 |
* the License. You may obtain a copy of the License at
|
|
Packit |
90a5c9 |
*
|
|
Packit |
90a5c9 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
Packit |
90a5c9 |
*
|
|
Packit |
90a5c9 |
* Unless required by applicable law or agreed to in writing, software
|
|
Packit |
90a5c9 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
Packit |
90a5c9 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
Packit |
90a5c9 |
* See the License for the specific language governing permissions and
|
|
Packit |
90a5c9 |
* limitations under the License.
|
|
Packit |
90a5c9 |
*/
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
/**
|
|
Packit |
90a5c9 |
* @file util_cfgtree.h
|
|
Packit |
90a5c9 |
* @brief Config Tree Package
|
|
Packit |
90a5c9 |
*
|
|
Packit |
90a5c9 |
* @defgroup APACHE_CORE_CONFIG_TREE Config Tree Package
|
|
Packit |
90a5c9 |
* @ingroup APACHE_CORE_CONFIG
|
|
Packit |
90a5c9 |
* @{
|
|
Packit |
90a5c9 |
*/
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
#ifndef AP_CONFTREE_H
|
|
Packit |
90a5c9 |
#define AP_CONFTREE_H
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
#include "ap_config.h"
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
#ifdef __cplusplus
|
|
Packit |
90a5c9 |
extern "C" {
|
|
Packit |
90a5c9 |
#endif
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
typedef struct ap_directive_t ap_directive_t;
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
/**
|
|
Packit |
90a5c9 |
* @brief Structure used to build the config tree.
|
|
Packit |
90a5c9 |
*
|
|
Packit |
90a5c9 |
* The config tree only stores
|
|
Packit |
90a5c9 |
* the directives that will be active in the running server. Directives
|
|
Packit |
90a5c9 |
* that contain other directions, such as <Directory ...> cause a sub-level
|
|
Packit |
90a5c9 |
* to be created, where the included directives are stored. The closing
|
|
Packit |
90a5c9 |
* directive (</Directory>) is not stored in the tree.
|
|
Packit |
90a5c9 |
*/
|
|
Packit |
90a5c9 |
struct ap_directive_t {
|
|
Packit |
90a5c9 |
/** The current directive */
|
|
Packit |
90a5c9 |
const char *directive;
|
|
Packit |
90a5c9 |
/** The arguments for the current directive, stored as a space
|
|
Packit |
90a5c9 |
* separated list */
|
|
Packit |
90a5c9 |
const char *args;
|
|
Packit |
90a5c9 |
/** The next directive node in the tree */
|
|
Packit |
90a5c9 |
struct ap_directive_t *next;
|
|
Packit |
90a5c9 |
/** The first child node of this directive */
|
|
Packit |
90a5c9 |
struct ap_directive_t *first_child;
|
|
Packit |
90a5c9 |
/** The parent node of this directive */
|
|
Packit |
90a5c9 |
struct ap_directive_t *parent;
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
/** directive's module can store add'l data here */
|
|
Packit |
90a5c9 |
void *data;
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
/* ### these may go away in the future, but are needed for now */
|
|
Packit |
90a5c9 |
/** The name of the file this directive was found in */
|
|
Packit |
90a5c9 |
const char *filename;
|
|
Packit |
90a5c9 |
/** The line number the directive was on */
|
|
Packit |
90a5c9 |
int line_num;
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
/** A short-cut towards the last directive node in the tree.
|
|
Packit |
90a5c9 |
* The value may not always be up-to-date but it always points to
|
|
Packit |
90a5c9 |
* somewhere in the tree, nearer to the tail.
|
|
Packit |
90a5c9 |
* This value is only set in the first node
|
|
Packit |
90a5c9 |
*/
|
|
Packit |
90a5c9 |
struct ap_directive_t *last;
|
|
Packit |
90a5c9 |
};
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
/**
|
|
Packit |
90a5c9 |
* The root of the configuration tree
|
|
Packit |
90a5c9 |
*/
|
|
Packit |
90a5c9 |
AP_DECLARE_DATA extern ap_directive_t *ap_conftree;
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
/**
|
|
Packit |
90a5c9 |
* Add a node to the configuration tree.
|
|
Packit |
90a5c9 |
* @param parent The current parent node. If the added node is a first_child,
|
|
Packit |
90a5c9 |
then this is changed to the current node
|
|
Packit |
90a5c9 |
* @param current The current node
|
|
Packit |
90a5c9 |
* @param toadd The node to add to the tree
|
|
Packit |
90a5c9 |
* @param child Is the node to add a child node
|
|
Packit |
90a5c9 |
* @return the added node
|
|
Packit |
90a5c9 |
*/
|
|
Packit |
90a5c9 |
ap_directive_t *ap_add_node(ap_directive_t **parent, ap_directive_t *current,
|
|
Packit |
90a5c9 |
ap_directive_t *toadd, int child);
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
#ifdef __cplusplus
|
|
Packit |
90a5c9 |
}
|
|
Packit |
90a5c9 |
#endif
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
#endif
|
|
Packit |
90a5c9 |
/** @} */
|