Main Page | Modules | Namespace List | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

util_cfgtree.h File Reference

#include "ap_config.h"

Go to the source code of this file.

Classes

struct  ap_directive_t
 Structure used to build the config tree. More...
typedef ap_directive_t ap_directive_t
ap_directive_tap_add_node (ap_directive_t **parent, ap_directive_t *current, ap_directive_t *toadd, int child)
AP_DECLARE_DATA ap_directive_tap_conftree


Typedef Documentation

typedef struct ap_directive_t ap_directive_t
 

Definition at line 35 of file util_cfgtree.h.


Function Documentation

ap_directive_t* ap_add_node ap_directive_t **  parent,
ap_directive_t current,
ap_directive_t toadd,
int  child
 

Add a node to the configuration tree.

Parameters:
parent The current parent node. If the added node is a first_child, then this is changed to the current node
current The current node
toadd The node to add to the tree
child Is the node to add a child node
Returns:
the added node

Definition at line 21 of file util_cfgtree.c.

References ap_directive_t::first_child, ap_directive_t::next, NULL, and ap_directive_t::parent.

Referenced by ap_build_config_sub().

00023 {
00024     if (current == NULL) {
00025         /* we just started a new parent */
00026         if (*parent != NULL) {
00027             (*parent)->first_child = toadd;
00028             toadd->parent = *parent;
00029         }
00030         if (child) {
00031             /* First item in config file or container is a container */
00032             *parent = toadd;
00033             return NULL;
00034         }
00035         return toadd;
00036     }
00037     current->next = toadd;
00038     toadd->parent = *parent;
00039     if (child) {
00040         /* switch parents, navigate into child */
00041         *parent = toadd;
00042         return NULL;
00043     }
00044     return toadd;
00045 }


Variable Documentation

AP_DECLARE_DATA ap_directive_t* ap_conftree
 

The root of the configuration tree ap_directive_t *conftree

Definition at line 65 of file config.c.

Referenced by display_info(), main(), show_server_settings(), and worker_pre_config().


© sourcejam.com 2005-2008