tree.h
Go to the documentation of this file.
55 #define _DECLARE_TREE(L) typedef struct __attribute__((packed)) { co_obj_t _header; uint##L##_t _len; \
138 * @brief insert object into given tree and associate with key, where value is not tied to tree (overwrite if it exists)
144 int co_tree_insert_unsafe_force(co_obj_t *root, const char *key, const size_t klen, co_obj_t *value);
154 int co_tree_set_str(co_obj_t *root, const char *key, const size_t klen, const char *value, const size_t vlen);
163 int co_tree_set_int(co_obj_t *root, const char *key, const size_t klen, const signed long value);
172 int co_tree_set_uint(co_obj_t *root, const char *key, const size_t klen, const unsigned long value);
co_obj_t * co_node_value(_treenode_t *node)
return value object for given node
Definition: tree.c:98
int co_tree_set_float(co_obj_t *root, const char *key, const size_t klen, const double value)
set value contained in an object in the tree with a specified key (if a float)
Definition: tree.c:524
co_obj_t * co_tree_find(const co_obj_t *root, const char *key, const size_t klen)
return value from given tree that corresponds to key
Definition: tree.c:173
_treenode_t * co_tree_find_node(_treenode_t *root, const char *key, const size_t klen)
find node in given tree
Definition: tree.c:140
ssize_t co_tree_length(co_obj_t *tree)
return length (number of key-value pairs) of given tree
Definition: tree.c:122
int co_tree_process(co_obj_t *tree, const co_iter_t iter, void *context)
process tree with given iterator function
Definition: tree.c:555
debug macros for the Commotion daemon
int co_tree_set_str(co_obj_t *root, const char *key, const size_t klen, const char *value, const size_t vlen)
set value contained in an object in the tree with a specified key (if a string)
Definition: tree.c:408
int co_tree_insert(co_obj_t *root, const char *key, const size_t klen, co_obj_t *value)
insert object into given tree and associate with key
Definition: tree.c:332
void co_tree_print_indent(co_obj_t *tree, int indent)
print tree with indent
Definition: tree.c:809
Definition: tree.h:44
int co_tree_set_int(co_obj_t *root, const char *key, const size_t klen, const signed long value)
set value contained in an object in the tree with a specified key (if an int)
Definition: tree.c:449
int co_tree_insert_unsafe_force(co_obj_t *root, const char *key, const size_t klen, co_obj_t *value)
insert object into given tree and associate with key, where value is not tied to tree (overwrite if i...
Definition: tree.c:358
co_obj_t * co_tree_delete(co_obj_t *root, const char *key, const size_t klen)
delete value from given tree that corresponds to key
Definition: tree.c:227
co_obj_t * co_node_key(_treenode_t *node)
return key object for given node
Definition: tree.c:89
_treenode_t * co_tree_root(const co_obj_t *tree)
return root node of tree object
Definition: tree.c:69
Definition: obj.h:131
size_t co_tree_import(co_obj_t **tree, const char *input, const size_t ilen)
import raw representation of tree
Definition: tree.c:659
size_t co_tree_raw(char *output, const size_t olen, const co_obj_t *tree)
dump raw representation of tree
Definition: tree.c:623
int co_tree_insert_unsafe(co_obj_t *root, const char *key, const size_t klen, co_obj_t *value)
insert object into given tree and associate with key, where value is not tied to tree ...
Definition: tree.c:342
int co_tree_insert_force(co_obj_t *root, const char *key, const size_t klen, co_obj_t *value)
insert object into given tree and associate with key (overwrite if it exists)
Definition: tree.c:352
int co_tree_set_uint(co_obj_t *root, const char *key, const size_t klen, const unsigned long value)
set value contained in an object in the tree with a specified key (if an unsigned int) ...
Definition: tree.c:490
Generated on Fri Jun 6 2014 13:22:05 for commotiond by 1.8.7