Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

_tc_node.c File Reference


Detailed Description

For internal use only.

This file contains the implementation of the _tc_release_children() and _tc_create_node() functions, which are used to allocate and release treeconf_node_t variable nodes.

Definition in file _tc_node.c.

#include <stdlib.h>
#include <string.h>
#include "treeconf_int.h"

Include dependency graph for _tc_node.c:

Include dependency graph

Go to the source code of this file.

Functions

void _tc_release_children (treeconf_node_t *node)
 Release a node's children.
treeconf_node_t_tc_create_node (treeconf_ctx_t *ctx, treeconf_node_t *parent, treeconf_type_t type, const char *name, int len, const char *def, treeconf_nodown_t nodown, treeconf_change_t change, void *assoc)
 Create a node.


Function Documentation

treeconf_node_t* _tc_create_node treeconf_ctx_t ctx,
treeconf_node_t parent,
treeconf_type_t  type,
const char *  name,
int  len,
const char *  def,
treeconf_nodown_t  nodown,
treeconf_change_t  change,
void *  assoc
 

For internal use only.

This function creates a node with a given set of characteristics.

Parameters:
ctx A pointer to a treeconf_ctx_t.
parent The parent of the node to be created.
type The type of node to create.
name The name of the node (as opposed to variable) to create.
len The length of the node name.
def The default value of the node, or NULL to create an internal node.
nodown A treeconf_nodown_t designating the nodown callback for the node.
change A treeconf_change_t designating the change callback for the node.
assoc A pointer to void designating application-specific association data for the node.
Returns:
A pointer to the newly-created and initialized node.

Definition at line 82 of file _tc_node.c.

References _treeconf_node_s::tn_assoc, _treeconf_node_s::tn_change, _treeconf_node_s::tn_context, _treeconf_node_s::tn_default, _treeconf_node_s::tn_down, _treeconf_node_s::tn_magic, _treeconf_node_s::tn_name, _treeconf_node_s::tn_next, _treeconf_node_s::tn_nodown, _treeconf_node_s::tn_parent, _treeconf_node_s::tn_type, _treeconf_node_s::tn_value, treeconf_ctx_t, treeconf_node_t, _treeconf_ctx_s::tx_config, and _treeconf_ctx_s::tx_count.

Referenced by tc_find(), tc_register(), and tc_set().

void _tc_release_children treeconf_node_t node  ) 
 

For internal use only.

This function walks through the list of children for the given node, releasing all memory allocated for them.

Parameters:
node A pointer to a treeconf_node_t designating the node to release the children of.

Definition at line 45 of file _tc_node.c.

References _tc_release_node, _treeconf_node_s::tn_down, _treeconf_node_s::tn_next, and treeconf_node_t.

Referenced by tc_register(), and tc_set().


Generated on Wed Jun 8 09:18:28 2005 for treeconf by  doxygen 1.3.9.1