Rabbit Tree
Radix bit tries for implementing associative arrays and sets in C.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
wrapper.h File Reference
#include "common.h"
#include "debug.h"
#include "node.h"
Include dependency graph for wrapper.h:

Go to the source code of this file.

Functions

RBT_VALUE_T RBT_DELETE (RBT_NODE_T *node, RBT_KEY_T key)
 
int RBT_HAS_KEY (RBT_NODE_T *node, RBT_KEY_T key)
 
RBT_VALUE_T RBT_INSERT (RBT_NODE_T *node, RBT_KEY_T key, RBT_VALUE_T value)
 
RBT_VALUE_T RBT_NODE_QUERY_WRAPPER (RBT_NODE_T *node, RBT_KEY_T key, rbt_query_action_t action, RBT_VALUE_T value)
 
RBT_VALUE_T RBT_RETRIEVE (RBT_NODE_T *node, RBT_KEY_T key)
 
RBT_VALUE_T RBT_SWAP (RBT_NODE_T *node, RBT_KEY_T key, RBT_VALUE_T value)
 

Detailed Description

Author
Xyne

Required Headers

Required Macro Definitions:

Optional Macro Definitions

Function Documentation

RBT_VALUE_T RBT_DELETE ( RBT_NODE_T node,
RBT_KEY_T  key 
)

A convenient wrapper for RBT_NODE_QUERY_WRAPPER() for deleting values.

Parameters
[in]nodeThe root node.
[in]keyThe query key.
Returns
The value returned by RBT_NODE_QUERY() for this action.
int RBT_HAS_KEY ( RBT_NODE_T node,
RBT_KEY_T  key 
)

Check if a key is present in the tree.

RBT_VALUE_T RBT_INSERT ( RBT_NODE_T node,
RBT_KEY_T  key,
RBT_VALUE_T  value 
)

A convenient wrapper for RBT_NODE_QUERY_WRAPPER() for inserting values.

Parameters
[in]nodeThe root node.
[in]keyThe query key.
[in]valueThe value to insert.
Returns
The value returned by RBT_NODE_QUERY() for this action.
RBT_VALUE_T RBT_NODE_QUERY_WRAPPER ( RBT_NODE_T node,
RBT_KEY_T  key,
rbt_query_action_t  action,
RBT_VALUE_T  value 
)

A wrapper function around RBT_NODE_QUERY() that automatically casts the key to the required pointer type.

Parameters
[in]nodeThe root node.
[in]keyThe query key.
[in]actionThe action to perform.
[in]valueThe value with which to perform the action.
Returns
The value returned by RBT_NODE_QUERY() for this action.
RBT_VALUE_T RBT_RETRIEVE ( RBT_NODE_T node,
RBT_KEY_T  key 
)

A convenient wrapper for RBT_NODE_QUERY_WRAPPER() for retrieving values.

Parameters
[in]nodeThe root node.
[in]keyThe query key.
Returns
The value returned by RBT_NODE_QUERY() for this action.
RBT_VALUE_T RBT_SWAP ( RBT_NODE_T node,
RBT_KEY_T  key,
RBT_VALUE_T  value 
)

A convenient wrapper for RBT_NODE_QUERY_WRAPPER() for swapping values.

Parameters
[in]nodeThe root node.
[in]keyThe query key.
[in]valueThe value to insert.
Returns
The value returned by RBT_NODE_QUERY() for this action.