Simple data structures / objects in plain C Snapshot
|
#include <cutils/base.h>
Go to the source code of this file.
Classes | |
struct | tagTREENODE |
Defines | |
#define | TREE_NEXTLEVEL_LAST |
#define | TREE_NEXTLEVEL_LEFT |
#define | TREE_FOREACH_CHILD(current, node) |
#define | TREE_FOREACH_CHILD_REVERSE(current, node) |
#define | TREE_FOREACH_PREORDER(current, tree) |
#define | TREE_FOREACH_PREORDER_END |
#define | TREE_FOREACH_POSTORDER(current, tree) |
#define | TREE_FOREACH_POSTORDER_END |
Typedefs | |
typedef struct tagTREENODE | TREENODE |
typedef int(* | TREE_VISITOR )(TREENODE *entry, void *context) |
typedef void(* | TREE_VISITOR_V )(TREENODE *entry, void *context) |
typedef int(* | TREE_VISITOR_EXT_V )(TREENODE *entry, TREE_VISIT_EVENT visit, void *context) |
Enumerations | |
enum | TREE_INSERT_MODE { TREE_INSERT_FIRST, TREE_INSERT_LAST } |
enum | TREE_VISIT_EVENT { TREE_PREORDER, TREE_POSTORDER } |
Functions | |
M_INLINE void | TREE_init_root (TREENODE *tree) |
M_INLINE TREENODE * | TREE_parent (TREENODE *node) |
M_INLINE TREENODE * | TREE_left_sibling (TREENODE *node) |
M_INLINE TREENODE * | TREE_right_sibling (TREENODE *node) |
M_INLINE TREENODE * | TREE_leftmost_sibling (TREENODE *node) |
M_INLINE TREENODE * | TREE_rightmost_sibling (TREENODE *node) |
M_INLINE TREENODE * | TREE_first_child (TREENODE *node) |
M_INLINE TREENODE * | TREE_last_child (TREENODE *node) |
M_INLINE int | TREE_insert_right_sibling (TREENODE *current, TREENODE *newnode, int node_is_leaf) |
M_INLINE int | TREE_insert_left_sibling (TREENODE *current, TREENODE *newnode, int node_is_leaf) |
M_INLINE void | TREE_insert_child (TREENODE *parent, TREENODE *newnode, TREE_INSERT_MODE mode, int node_is_leaf) |
M_INLINE void | TREE_merge_childs (TREENODE *parent, TREE_INSERT_MODE mode, TREENODE *newnode) |
M_INLINE TREENODE * | TREE_unlink_node (TREENODE *node) |
M_INLINE size_t | TREE_count_child_nodes (TREENODE *current) |
M_INLINE TREENODE * | TREE_preorder_next (TREENODE *current) |
M_INLINE void | TREE_foreach_child (TREENODE *lst, TREE_VISITOR_V eval, void *context) |
iterate over all elements of a list of child nodes, callback is invoked for either element of the list. list is traversed from first element to the last element. | |
M_INLINE void | TREE_foreach_child_reverse (TREENODE *lst, TREE_VISITOR_V eval, void *context) |
M_INLINE TREENODE * | TREE_findif_child (TREENODE *tree, TREE_VISITOR eval, void *context, int32_t *retval) |
find an element within the list of child nodes. callback is invoked for each element of the list, in forward direction from first element to last element; when the callback returns non zero value the iteration stops as we have found what we searched for. | |
M_INLINE TREENODE * | TREE_findif_child_reverse (TREENODE *tree, TREE_VISITOR eval, void *context, int32_t *retval) |
M_INLINE TREENODE * | TREE_postorder_next (TREENODE *current, TREENODE *prev) |
M_INLINE void | TREE_foreach_preorder (TREENODE *node, TREE_VISITOR_V visit, void *context) |
M_INLINE TREENODE * | TREE_find_preorder (TREENODE *node, TREE_VISITOR visit, void *context) |
M_INLINE void | TREE_foreach_postorder (TREENODE *node, TREE_VISITOR_V visit, void *context) |
M_INLINE TREENODE * | TREE_find_postorder (TREENODE *node, TREE_VISITOR visit, void *context) |
M_INLINE int | TREE_check_tree (TREENODE *root) |
check tree for consistency errors |