13#define CRTX_DICT_GET_NUMBER(dict_item) ( \
14 (dict_item)->type == 'u' ? (dict_item)->uint32 : \
15 (dict_item)->type == 'i' ? (dict_item)->int32 : \
16 (dict_item)->type == 'U' ? (dict_item)->uint64 : \
17 (dict_item)->type == 'I' ? (dict_item)->int64 : \
18 (dict_item)->type == 'd' ? (dict_item)->double_fp : \
19 ( crtx_printf(CRTX_VLEVEL_ERR, "invalid type %c for get_int32\n", (dict_item)->type), 0) \
22#define CRTX_DIF_ALLOCATED_KEY (1<<0)
23#define CRTX_DIF_DONT_FREE_DATA (1<<1)
24#define CRTX_DIF_CREATE_DATA_COPY (1<<2)
25#define CRTX_DIF_CREATE_KEY_COPY (1<<3)
26#define CRTX_DIF_LAST_ITEM (1<<7)
28#define CRTX_DIF_IS_LAST(di) ( ((di)->flags & CRTX_DIF_LAST_ITEM) != 0 )
65 uint32_t signature_length;
72 unsigned int ref_count;
97struct crtx_dict * crtx_init_dict(
char *signature, uint32_t sign_length,
size_t payload_size);
98struct crtx_dict * crtx_create_dict_va(
char *signature, va_list *va);
99struct crtx_dict * crtx_create_dict(
char *signature, ...);
100char crtx_fill_data_item(
struct crtx_dict_item *di,
unsigned char type,
char *key, ...);
101char crtx_fill_data_item_va2(
struct crtx_dict_item *di,
unsigned char type,
char *key, va_list *va);
102char crtx_fill_data_item_va(
struct crtx_dict_item *di,
unsigned char type, va_list *va);
104char crtx_get_value(
struct crtx_dict *ds,
const char *key,
char type,
void *buffer,
size_t buffer_size);
105char crtx_copy_value(
struct crtx_dict_item *di,
void *buffer,
size_t buffer_size);
106void crtx_print_dict(
struct crtx_dict *ds);
111char *crtx_get_string(
struct crtx_dict *ds,
const char *key);
112char *crtx_dict_get_string(
struct crtx_dict *ds,
const char *key);
120void crtx_print_dict_item(
struct crtx_dict_item *di,
unsigned char level);
124char crtx_get_item_value(
struct crtx_dict_item *di,
char type,
void *buffer,
size_t buffer_size);
126char crtx_resize_dict(
struct crtx_dict *dict,
size_t n_items);
127int crx_append_to_dict(
struct crtx_dict **dictionary,
char *signature, ...);
129void crtx_dict_ref(
struct crtx_dict *dict);
130void crtx_dict_unref(
struct crtx_dict *dict);
132char crtx_dict_locate_value(
struct crtx_dict *dict,
const char *path,
char type,
void *buffer,
size_t buffer_size);
133char *crtx_dict_locate_string(
struct crtx_dict *dict,
const char *path);
134void crtx_dict_remove_item(
struct crtx_dict *dict,
char *key);
135char crtx_dict_new_item(
struct crtx_dict *dict,
unsigned char type,
char *key, ...);
138char crtx_is_string_in_dict(
struct crtx_dict *dict,
char *str);
140void crtx_dict_item_print(
struct crtx_dict_item *di,
unsigned char level, FILE *f);
141void crtx_dict_print(
struct crtx_dict *ds, FILE *f);
142int crtx_dict_snaprintf(
char **result,
size_t *rlen,
size_t *alloc,
char *format,
struct crtx_dict *ds);
structure that represents a graph of tasks (crtx_task) that will be traversed with every crtx_event
Definition core.h:115
a task basically represents a function that will be executed for an crtx_event
Definition core.h:91