Cross reference for modules/rp/rp_tree.c of index.

# File modules/rp/rp_tree.c

      $Revision: 1.7 $

      Radix payload (rp) - user level functions for storing data in radix trees

      rp_load = user level tree maintenance (knows about registries and attributes)

      Status: NOT REVIEWED, TESTED

      Design and implementation by: Marek Bukowy

## Included Files

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

- `#include <rxroutines.h>`

## Preprocessor definitions

`#define RP_IMPL`

## Global Variable Lock

`pthread_mutex_t Lock`

Included from | include/ca_defs.h
Visible in: |  | modules/ac/access_control.c
|  | modules/ca/ca_configFns.c
|  | modules/ca/ca_initFn.c
|  | modules/ca/ca_sanityCheck.c
|  | modules/ca/ca_sourceLoader.c
|  | modules/ca/ca_values.c
|  | modules/er/er_macro.c
|  | modules/pc/pc_commands.c
|  | modules/pm/pm_serials.c
|  | modules/pm/protocol_mirror.c
|  | modules/pw/protocol_whois.c
|  | modules/qc/query_command.c
|  | modules/qi/query_instructions.c
|  | modules/rp/rp_convert.c
|  | modules/rp/rp_load.c
|  | modules/rp/rp_search.c
|  | modules/rp/rp_tree.c
Used in: | ca_get_adminIntElement() | modules/ca/ca_configFns.c
| ca_get_adminStrElement() | modules/ca/ca_configFns.c
| ca_get_boolean() | modules/ca/ca_configFns.c
| ca_get_dirlist() | modules/ca/ca_configFns.c
| ca_get_int() | modules/ca/ca_configFns.c
| ca_get_string() | modules/ca/ca_configFns.c
| ca_set_boolean() | modules/ca/ca_configFns.c
| ca_set_string() | modules/ca/ca_configFns.c
| ca_srchandle2Intelement() | modules/ca/ca_configFns.c
| ca_srchandle2Strelement() | modules/ca/ca_configFns.c

## Global Variable rx_forest_rwlock

`rw_lock_t rx_forest_rwlock`

Included from | include/rp.h
Visible in: |  | modules/pc/pc_commands.c
|  | modules/pm/pm_serials.c
|  | modules/qi/query_instructions.c
|  | modules/rp/rp_tree.c
Used in: | RP_tree_add() | modules/rp/rp_tree.c
| RP_tree_get() | modules/rp/rp_tree.c

## Global Variable rx_forest

`GList* rx_forest`

Included from | include/rp.h
Visible in: |  | modules/pc/pc_commands.c
|  | modules/pm/pm_serials.c
|  | modules/qi/query_instructions.c
|  | modules/rp/rp_tree.c
Used in: | RP_tree_add() | modules/rp/rp_tree.c
| RP_tree_get() | modules/rp/rp_tree.c

## Global Function RP_init_trees()

`er_ret_t RP_init_trees ( rp_regid_t reg_id )`

Prototyped in: | include/rp.h
Calls: | NOERR() | modules/er/er.c
| rp_init_attr_tree() | modules/rp/rp_tree.c
Called by: | set_initrx() | modules/pc/pc_commands.c

## Global Function RP_tree_add()

           put into LL of trees; handle alloc err ???

           since other threads are supposed to be reading already,
           must create the tree locked and observe the forest mutex.

`er_ret_t RP_tree_add ( rp_regid_t reg_id, rp_attr_t attr, char* prefixstr, rx_mem_mt mem_mode, rx_subtree_mt subtrees )`

`rp_regid_t reg_id`
  id of the registry
`rp_attr_t attr`
  extra tree id (within the same registry/space/family
`char* prefixstr`
  prefix the tree will cover (string)
`rx_mem_mt mem_mode`
  &nbs;
`rx_subtree_mt subtrees`
  one of NONE, AUTO, HAND

Prototyped in: | include/rp.h
Calls: | RP_attr2fam() | modules/rp/rp_convert.c
| RP_tree_del() | modules/rp/rp_tree.c
| RP_tree_get() | modules/rp/rp_tree.c
| RX_tree_cre(), TH_acquire_write_lockw(), TH_release_write_lockw(), UT_free_real(), fprintf(), g_list_append(), wr_real_malloc()
Called by: | rp_init_attr_tree() | modules/rp/rp_tree.c
References Variables: | rx_forest | modules/rp/rp_tree.c
| rx_forest_rwlock | modules/rp/rp_tree.c

## Global Function RP_tree_del()

      finds a tree and deletes its contents
      the tree itself is not deleted !

      Returns: RX_OK or RX_NOTREE if no such tree can be found.

`er_ret_t RP_tree_del ( rx_tree_t* tree )`

Prototyped in: | include/rp.h
Calls: | ER_inf_va() | modules/er/er.c
| ER_perror() | modules/er/er.c
| rx_delete_tree()
Called by: | RP_tree_add() | modules/rp/rp_tree.c

## Global Function RP_tree_get()

      finds a tree matching the specified criteria(registry+space+family+tid).

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

      Returns: RX_OK or RX_NOTREE if no such tree can be found.

`er_ret_t RP_tree_get ( rx_tree_t** treeptr, rp_regid_t reg_id, ip_space_t spc_id, rp_attr_t attr )`

`rx_tree_t** treeptr`
  answer goes here, please
`rp_regid_t reg_id`
  id of the registry
`ip_space_t spc_id`
  type of space (ipv4/ipv6)
`rp_attr_t attr`
  extra tree id (within the same reg/spc/fam

Prototyped in: | include/rp.h
Calls: | ER_dbg_va() | modules/er/er.c
| TH_acquire_read_lockw(), TH_release_read_lockw(), g_list_first()
Called by: | RP_asc_search() | modules/rp/rp_search.c
| RP_sql_load_attr_space() | modules/rp/rp_load.c
| RP_tree_add() | modules/rp/rp_tree.c
References Variables: | rx_forest | modules/rp/rp_tree.c
| rx_forest_rwlock | modules/rp/rp_tree.c

## Global Function rp_init_attr_tree()

`er_ret_t rp_init_attr_tree ( rp_regid_t reg_id, rp_attr_t attr )`

Calls: | RP_attr2spc() | modules/rp/rp_convert.c
| RP_tree_add() | modules/rp/rp_tree.c
Called by: | RP_init_trees() | modules/rp/rp_tree.c