#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <libubox/avl-cmp.h>
#include "ubusmsg.h"
#include "ubusd_id.h"
Go to the source code of this file.
◆ ubus_alloc_id()
bool ubus_alloc_id |
( |
struct avl_tree * |
tree, |
|
|
struct ubus_id * |
id, |
|
|
uint32_t |
val |
|
) |
| |
Definition at line 53 of file ubusd_id.c.
55 id->avl.key = &
id->id;
58 return avl_insert(tree, &id->
avl) == 0;
67 }
while (avl_insert(tree, &id->
avl) != 0);
#define UBUS_SYSTEM_OBJECT_MAX
◆ ubus_cmp_id()
static int ubus_cmp_id |
( |
const void * |
k1, |
|
|
const void * |
k2, |
|
|
void * |
ptr |
|
) |
| |
|
static |
Definition at line 25 of file ubusd_id.c.
27 const uint32_t *id1 = k1, *id2 = k2;
◆ ubus_init_id_tree()
void ubus_init_id_tree |
( |
struct avl_tree * |
tree | ) |
|
Definition at line 40 of file ubusd_id.c.
43 random_fd = open(
"/dev/urandom", O_RDONLY);
static int ubus_cmp_id(const void *k1, const void *k2, void *ptr)
◆ ubus_init_string_tree()
void ubus_init_string_tree |
( |
struct avl_tree * |
tree, |
|
|
bool |
dup |
|
) |
| |
Definition at line 35 of file ubusd_id.c.
37 avl_init(tree, avl_strcmp, dup, NULL);
◆ random_fd