Cross reference for modules/rx/rx_tree.c of index.

# File modules/rx/rx_tree.c

      $Revision: 1.16 $

      Radix tree (rx).  rx_tree.c - functions to operate on trees
      (creation/deletion/finding).

      Status: NOT REVUED, TESTED, INCOMPLETE

      Design and implementation by: Marek Bukowy

## Included Files

- `#include <include/erroutines.h>`

- `#include <include/iproutines.h>`

- `#include <include/memwrap.h>`

- `#include <stubs.h>`

- `#include <include/rxroutines.h>`

## Preprocessor definitions

`#define RX_IMPL`

## Global Function RX_tree_cre()

      creates a (top) tree for the space, fills out sql table of trees
      generates a tablename for a tree (if NONE)
      updates LL of trees

      MT-note: locks/unlocks the forest (still to be done)

`er_ret_t RX_tree_cre ( char* prefixstr, rx_fam_t fam_id, rx_mem_mt mem_mode, rx_subtree_mt subtrees, rx_tree_t** treestore )`

`char* prefixstr`
  prefix the tree will cover (string)
`rx_fam_t fam_id`
  &nbs;
`rx_mem_mt mem_mode`
  &nbs;
`rx_subtree_mt subtrees`
  one of NONE, AUTO, HAND
`rx_tree_t** treestore`
  &nbs;

Prototyped in: | include/rxroutines.h
Calls: | ER_dbg_va() | modules/er/er.c
| IP_pref_b2_space() | modules/ip/ip.c
| IP_pref_t2b() | modules/ip/ip.c
| IP_sizebits() | modules/ip/ip.c
| TH_init_read_write_lock(), fprintf(), strcpy(), wr_real_malloc()
Called by: | AC_build() | modules/ac/access_control.c
| RP_tree_add() | modules/rp/rp_tree.c

## Global Function RX_treecheck()

`er_ret_t RX_treecheck ( rx_tree_t* tree, int datatoo, rx_treecheck_t* errorfound )`

Prototyped in: | include/rxroutines.h
Calls: | rx_check_walk_tree() | modules/rx/rx_tree.c
Called by: | AC_findexless_acl_l() | modules/ac/access_control.c

## Global Function rx_check_walk_tree()

`int rx_check_walk_tree ( rx_node_t* node, rx_node_t* parent_node, int nodecounter, rx_treecheck_t* checkstruct )`

Calls: | rx_check_walk_tree() | modules/rx/rx_tree.c
| g_list_length()
Called by: | RX_treecheck() | modules/rx/rx_tree.c
| rx_check_walk_tree() | modules/rx/rx_tree.c

## Global Function rx_walk_tree()

      go down the tree calling func on every node.
      (func takes the node pointer and the current level)

      the function is called recursively with level increased
      it stops recursing when no child nodes are found or maxlevel is reached.

      therefore the initial call must set level to 0.

      the nodecounter increments at every node, and is the return value
      of the function. So start with 0 to get the number of nodes traversed.

      ERROR HANDLING IS DIFFERENT HERE!
      Unlike other functions it is not the return value:
      The error code from the func function IF DEFINED (== not NULL ) goes
      to the variable pointed to by the last parameter.

`int rx_walk_tree ( rx_node_t* node, er_ret_t (*func)(rx_node_t* node,int level,int nodecounter,void* userptr), rx_walk_mt walk_mode, int maxlevel, int level, int nodecounter, void* userptr, er_ret_t* err )`

Prototyped in: | include/rxroutines.h
Calls: | ER_dbg_va() | modules/er/er.c
| rx_walk_tree() | modules/rx/rx_tree.c
| fprintf()
Called by: | AC_decay() | modules/ac/access_control.c
| rx_nod_search() | modules/rx/rx_search.c
| rx_tree_print() | modules/rx/rx_print.c
| rx_walk_tree() | modules/rx/rx_tree.c
| show_access() | modules/pc/pc_commands.c
| show_acl() | modules/pc/pc_commands.c