Definition in file dt_node.h.
Go to the source code of this file.
Typedefs | |
typedef dt_node_ | dt_node |
Enumerations | |
enum | dt_node_kind { dt_leaf_node, dt_arr_node, dt_rec_node } |
A value that identifies the type of a node. More... | |
Functions | |
void | dt_node_addref (dt_node *node) |
Increment the use count of a node. | |
void | dt_node_release (dt_node *node) |
Decrement the use count of a node, and free the node if the count reaches zero. | |
enum dt_node_kind | dt_node_get_kind (dt_node *node) |
Returns the type of the node referred to by node. | |
dt_bool | dt_leaf_get_data (dt_node const *leaf, dt_byte const **begin, size_t *len) |
Access the data associated with a leaf node. | |
size_t | dt_arr_get_size (dt_node const *arr) |
Returns the number of sub-nodes available in an array node. | |
dt_node * | dt_arr_get (dt_node const *arr, unsigned ind) |
Returns the sub-node of the array node located at index ind. | |
dt_bool | dt_arr_put (dt_node *arr, unsigned ind, dt_node *item) |
Assign a new sub-node to a specified existing index within the array. | |
dt_bool | dt_arr_append (dt_node *arr, dt_node *item) |
Appends a new sub-node to the end of an array node. | |
size_t | dt_rec_get_size (dt_node const *node) |
Returns the number of sub-nodes available in the record node. | |
dt_node * | dt_rec_get (dt_node const *rec, dt_byte const *key, size_t key_len) |
Returns the sub-node of the record node which is associated with key (of length key_len). | |
dt_node * | dt_rec_sget (dt_node const *rec, char const *key) |
Identical to dt_rec_get(), but takes a zero-terminated string key to define the key. | |
dt_bool | dt_rec_put (dt_node *rec, dt_byte const *key, size_t key_len, dt_node *item) |
Put a sub-node associated with key (of length key_len) in the record node. | |
dt_bool | dt_rec_sput (dt_node *rec, char const *key, dt_node *item) |
Identical to dt_rec_get(), but takes a zero-terminated string key to define the key. | |
dt_node * | dt_rec_get_nth (dt_node *rec, unsigned ind, dt_byte const **key, size_t *key_len) |
Returns information about the ind -th item in the record node. |
|
|
|
A value that identifies the type of a node.
|
|
Appends a new sub-node to the end of an array node.
Definition at line 219 of file dt_node_impl.c. |
|
Returns the sub-node of the array node located at index ind. A NULL return value indicates that node is not an array node or that ind is out-of-range. Definition at line 183 of file dt_node_impl.c. |
|
Returns the number of sub-nodes available in an array node. A return value of zero indicates that the array is empty, or that arr is not an array node. Definition at line 173 of file dt_node_impl.c. |
|
Assign a new sub-node to a specified existing index within the array.
Definition at line 195 of file dt_node_impl.c. |
|
Access the data associated with a leaf node.
Definition at line 159 of file dt_node_impl.c. |
|
Returns a new empty array node.
Definition at line 82 of file dt_node_impl.c. |
|
Returns a new leaf node containing the data starting at begin of length len.
Definition at line 44 of file dt_node_impl.c. |
|
Returns a new empty record node.
Definition at line 63 of file dt_node_impl.c. |
|
Increment the use count of a node.
Definition at line 102 of file dt_node_impl.c. |
|
Returns the type of the node referred to by node.
Definition at line 152 of file dt_node_impl.c. |
|
Decrement the use count of a node, and free the node if the count reaches zero. When the use count reaches zero, the memory allocated for the node is released, and dt_node_release is called for all the direct sub-nodes it might contain. Definition at line 111 of file dt_node_impl.c. |
|
Returns the sub-node of the record node which is associated with key (of length key_len). A NULL return value indicates that node is not an array node, or that the record does not contain a key matching (key,key_len). Definition at line 303 of file dt_node_impl.c. |
|
Returns information about the ind -th item in the record node.
Definition at line 386 of file dt_node_impl.c. |
|
Returns the number of sub-nodes available in the record node. A return value of zero indicates that the record is empty, or that node is not an record node. Definition at line 235 of file dt_node_impl.c. |
|
Put a sub-node associated with key (of length key_len) in the record node.
Definition at line 330 of file dt_node_impl.c. |
|
Identical to dt_rec_get(), but takes a zero-terminated string key to define the key.
Definition at line 320 of file dt_node_impl.c. |
|
Identical to dt_rec_get(), but takes a zero-terminated string key to define the key.
Definition at line 379 of file dt_node_impl.c. |