18 #include <libubox/avl-cmp.h>
25 static int ubus_cmp_id(
const void *k1,
const void *k2,
void *ptr)
27 const uint32_t *id1 = k1, *id2 = k2;
37 avl_init(tree, avl_strcmp, dup, NULL);
43 random_fd = open(
"/dev/urandom", O_RDONLY);
55 id->avl.key = &
id->id;
58 return avl_insert(tree, &id->
avl) == 0;
67 }
while (avl_insert(tree, &id->
avl) != 0);
static int ubus_cmp_id(const void *k1, const void *k2, void *ptr)
void ubus_init_id_tree(struct avl_tree *tree)
void ubus_init_string_tree(struct avl_tree *tree, bool dup)
bool ubus_alloc_id(struct avl_tree *tree, struct ubus_id *id, uint32_t val)
#define UBUS_SYSTEM_OBJECT_MAX