Rizin
unix-like reverse engineering framework and cli tools
config.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2006-2021 pancake <pancake@nopcode.org>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #include "rz_config.h"
5 
9  if (!node) {
10  return NULL;
11  }
12  node->name = strdup(name);
13  node->value = strdup(value);
14  node->flags = CN_RW | CN_STR;
15  node->i_value = rz_num_get(NULL, value);
16  node->options = rz_list_new();
17  return node;
18 }
19 
23  if (!cn) {
24  return NULL;
25  }
26  cn->name = strdup(n->name);
27  cn->desc = n->desc ? strdup(n->desc) : NULL;
28  cn->value = strdup(n->value ? n->value : "");
29  cn->i_value = n->i_value;
30  cn->flags = n->flags;
31  cn->setter = n->setter;
32  cn->options = rz_list_clone(n->options);
33  return cn;
34 }
35 
37  RzConfigNode *node = (RzConfigNode *)n;
38  if (!node) {
39  return;
40  }
41  free(node->name);
42  free(node->desc);
43  free(node->value);
44  rz_list_free(node->options);
45  free(node);
46 }
47 
50  return ht_pp_find(cfg->ht, name, NULL);
51 }
52 
54  rz_return_val_if_fail(cfg && key, false);
55  RzConfigNode *node = rz_config_node_get(cfg, key);
56  if (node) {
57  node->getter = cb;
58  return true;
59  }
60  return false;
61 }
62 
64  RzConfigNode *node = rz_config_node_get(cfg, key);
65  if (node) {
66  node->setter = cb;
67  return true;
68  }
69  return false;
70 }
71 
75 RZ_API RZ_BORROW const char *rz_config_get(RzConfig *cfg, RZ_NONNULL const char *name) {
77  RzConfigNode *node = rz_config_node_get(cfg, name);
78  if (node) {
79  if (node->getter) {
80  node->getter(cfg->user, node);
81  }
82  if (rz_config_node_is_bool(node)) {
83  return rz_str_bool(rz_str_is_true(node->value));
84  }
85  return node->value;
86  } else {
87  RZ_LOG_DEBUG("rz_config_get: variable '%s' not found\n", name);
88  }
89  return NULL;
90 }
91 
97 RZ_API bool rz_config_toggle(RzConfig *cfg, RZ_NONNULL const char *name) {
99  RzConfigNode *node = rz_config_node_get(cfg, name);
100  if (!node) {
101  return false;
102  }
103  if (!rz_config_node_is_bool(node)) {
104  RZ_LOG_DEBUG("(error: '%s' is not a boolean variable)\n", name);
105  return false;
106  }
107  if (rz_config_node_is_ro(node)) {
108  RZ_LOG_DEBUG("(error: '%s' config key is read only)\n", name);
109  return false;
110  }
111  (void)rz_config_set_i(cfg, name, !node->i_value);
112  return true;
113 }
114 
121  RzConfigNode *node = rz_config_node_get(cfg, name);
122  if (node) {
123  if (node->getter) {
124  node->getter(cfg->user, node);
125  }
126  if (node->i_value || !strcmp(node->value, "false")) {
127  return node->i_value;
128  }
129  // TODO: Remove it once the switch to `rz_config_get_b()` is complete
130  if (!strcmp(node->value, "true")) {
131  return 1;
132  }
133  return (ut64)rz_num_math(cfg->num, node->value);
134  }
135  return (ut64)0LL;
136 }
137 
142 RZ_API bool rz_config_get_b(RzConfig *cfg, RZ_NONNULL const char *name) {
144  RzConfigNode *node = rz_config_node_get(cfg, name);
145  if (!node) {
146  return false;
147  }
148  if (!rz_config_node_is_bool(node)) {
149  RZ_LOG_DEBUG("(error: '%s' is not a boolean variable)\n", name);
150  return false;
151  }
152  return rz_str_is_true(node->value);
153 }
154 
156  rz_return_val_if_fail(node, "");
157 
158  if (rz_config_node_is_bool(node)) {
159  return "bool";
160  }
161  if (rz_config_node_is_str(node)) {
162  return "str";
163  }
164  if (rz_config_node_is_int(node)) {
165  if (!strncmp(node->value, "0x", 2)) {
166  return "addr";
167  }
168  return "int";
169  }
170  return "";
171 }
172 
174  RzConfigNode *node = rz_config_set(cfg, name, value);
175  if (node && (node->setter = cb)) {
176  if (!cb(cfg->user, node)) {
177  return NULL;
178  }
179  }
180  return node;
181 }
182 
184  RzConfigNode *node = rz_config_set_i(cfg, name, ivalue);
185  if (node && (node->setter = cb)) {
186  if (!node->setter(cfg->user, node)) {
187  return NULL;
188  }
189  }
190  return node;
191 }
192 
193 static bool __is_true_or_false(const char *s) {
194  return s && (!rz_str_casecmp(s, "true") || !rz_str_casecmp(s, "false"));
195 }
196 
202  rz_return_val_if_fail(cfg && cfg->ht, NULL);
204 
205  char *ov = NULL;
206  ut64 oi = 0;
207  RzConfigNode *node = rz_config_node_get(cfg, name);
208  if (node) {
209  if (rz_config_node_is_ro(node)) {
210  RZ_LOG_DEBUG("(error: '%s' config key is read only)\n", name);
211  return node;
212  }
213 
214  oi = node->i_value;
215  if (node->value) {
216  ov = strdup(node->value);
217  }
218  if (rz_config_node_is_bool(node)) {
219  node->i_value = value ? 1 : 0;
220  char *svalue = strdup(rz_str_bool(value));
221  if (svalue) {
222  free(node->value);
223  node->value = svalue;
224  }
225  } else {
226  RZ_LOG_ERROR("(error: '%s' is not a boolean variable)\n", name);
227  free(ov);
228  return NULL;
229  }
230  } else {
231  if (!cfg->lock) {
233  if (!node) {
234  node = NULL;
235  goto beach;
236  }
237  node->flags = CN_RW | CN_BOOL;
238  node->i_value = value ? 1 : 0;
239  ht_pp_insert(cfg->ht, node->name, node);
240  if (cfg->nodes) {
241  rz_list_append(cfg->nodes, node);
242  }
243  } else {
244  RZ_LOG_ERROR("(locked: no new keys can be created (%s))\n", name);
245  }
246  }
247 
248  if (node && node->setter) {
249  if (!node->setter(cfg->user, node)) {
250  if (oi != UT64_MAX) {
251  node->i_value = oi;
252  }
253  free(node->value);
254  node->value = strdup(ov ? ov : "");
255  }
256  }
257 
258 beach:
259  free(ov);
260  return node;
261 }
262 
263 /* TODO: reduce number of strdups here */
267 RZ_API RzConfigNode *rz_config_set(RzConfig *cfg, RZ_NONNULL const char *name, const char *value) {
268  rz_return_val_if_fail(cfg && cfg->ht, NULL);
270 
271  char *ov = NULL;
272  ut64 oi;
273  RzConfigNode *node = rz_config_node_get(cfg, name);
274  if (node) {
275  if (rz_config_node_is_ro(node)) {
276  eprintf("(error: '%s' config key is read only)\n", name);
277  return node;
278  }
279  oi = node->i_value;
280  if (node->value) {
281  ov = strdup(node->value);
282  if (!ov) {
283  goto beach;
284  }
285  } else {
286  free(node->value);
287  node->value = strdup("");
288  }
289  if (rz_config_node_is_bool(node)) {
290  bool b = rz_str_is_true(value);
291  node->i_value = b ? 1 : 0;
292  char *value = strdup(rz_str_bool(b));
293  if (value) {
294  free(node->value);
295  node->value = value;
296  }
297  } else {
298  if (!value) {
299  free(node->value);
300  node->value = strdup("");
301  node->i_value = 0;
302  } else {
303  if (node->value == value) {
304  goto beach;
305  }
306  free(node->value);
307  node->value = strdup(value);
308  if (IS_DIGIT(*value) || (value[0] == '-' && IS_DIGIT(value[1]))) {
309  if (strchr(value, '/')) {
310  node->i_value = rz_num_get(cfg->num, value);
311  } else {
312  node->i_value = rz_num_math(cfg->num, value);
313  }
314  } else {
315  node->i_value = 0;
316  }
317  node->flags |= CN_INT;
318  }
319  }
320  } else { // Create a new RzConfigNode
321  oi = UT64_MAX;
322  if (!cfg->lock) {
323  node = rz_config_node_new(name, value);
324  if (node) {
325  if (__is_true_or_false(value)) {
326  node->flags |= CN_BOOL;
327  node->i_value = rz_str_is_true(value) ? 1 : 0;
328  }
329  ht_pp_insert(cfg->ht, node->name, node);
330  rz_list_append(cfg->nodes, node);
331  } else {
332  eprintf("rz_config_set: unable to create a new RzConfigNode\n");
333  }
334  } else {
335  eprintf("rz_config_set: variable '%s' not found\n", name);
336  }
337  }
338 
339  if (node && node->setter) {
340  if (!node->setter(cfg->user, node)) {
341  if (oi != UT64_MAX) {
342  node->i_value = oi;
343  }
344  free(node->value);
345  node->value = strdup(ov ? ov : "");
346  free(ov);
347  return NULL;
348  }
349  }
350 beach:
351  free(ov);
352  return node;
353 }
354 
363  rz_return_val_if_fail(cfg && node, false);
364  if (cfg->lock) {
365  RZ_LOG_WARN("Config locked. Plugin config node not copied.\n");
366  rz_config_node_free(node);
367  return false;
368  }
369  ht_pp_insert(cfg->ht, node->name, node);
370  rz_list_append(cfg->nodes, node);
371  return true;
372 }
373 
374 /* rz_config_desc takes a RzConfig and a name,
375  * rz_config_node_desc takes a RzConfigNode
376  * Both set and return node->desc */
377 RZ_API const char *rz_config_desc(RzConfig *cfg, RZ_NONNULL const char *name, RZ_NULLABLE const char *desc) {
379  RzConfigNode *node = rz_config_node_get(cfg, name);
380  return rz_config_node_desc(node, desc);
381 }
382 
383 RZ_API const char *rz_config_node_desc(RzConfigNode *node, RZ_NULLABLE const char *desc) {
385  if (desc) {
386  free(node->desc);
387  node->desc = strdup(desc);
388  }
389  return node->desc;
390 }
391 
392 RZ_API bool rz_config_rm(RzConfig *cfg, RZ_NONNULL const char *name) {
394  RzConfigNode *node = rz_config_node_get(cfg, name);
395  if (node) {
396  ht_pp_delete(cfg->ht, node->name);
397  rz_list_delete_data(cfg->nodes, node);
398  return true;
399  }
400  return false;
401 }
402 
404  if (node && rz_config_node_is_bool(node)) {
406  return;
407  }
408  if (i < 1024) {
409  snprintf(buf, buf_size, "%" PFMT64d "", i);
410  } else {
411  snprintf(buf, buf_size, "0x%08" PFMT64x "", i);
412  }
413 }
414 
420  char buf[128], *ov = NULL;
422  RzConfigNode *node = rz_config_node_get(cfg, name);
423  if (node) {
424  if (rz_config_node_is_ro(node)) {
425  node = NULL;
426  goto beach;
427  }
428  if (node->value) {
429  ov = strdup(node->value);
430  }
432  free(node->value);
433  node->value = strdup(buf);
434  if (!node->value) {
435  node = NULL;
436  goto beach;
437  }
438  node->i_value = i;
439  } else {
440  if (!cfg->lock) {
442  node = rz_config_node_new(name, buf);
443  if (!node) {
444  node = NULL;
445  goto beach;
446  }
447  node->flags = CN_RW | CN_INT;
448  node->i_value = i;
449  ht_pp_insert(cfg->ht, node->name, node);
450  if (cfg->nodes) {
451  rz_list_append(cfg->nodes, node);
452  }
453  } else {
454  RZ_LOG_ERROR("(locked: no new keys can be created (%s))\n", name);
455  }
456  }
457 
458  if (node && node->setter) {
459  ut64 oi = node->i_value;
460  int ret = node->setter(cfg->user, node);
461  if (!ret) {
462  node->i_value = oi;
463  free(node->value);
464  node->value = strdup(ov ? ov : "");
465  }
466  }
467 beach:
468  free(ov);
469  return node;
470 }
471 
472 static int cmp(RzConfigNode *a, RzConfigNode *b) {
473  return strcmp(a->name, b->name);
474 }
475 
476 RZ_API void rz_config_lock(RzConfig *cfg, int l) {
478  cfg->lock = l;
479 }
480 
481 RZ_API bool rz_config_readonly(RzConfig *cfg, const char *key) {
483  if (n) {
484  n->flags |= CN_RO;
485  return true;
486  }
487  return false;
488 }
489 
491  RzConfig *cfg = RZ_NEW0(RzConfig);
492  if (!cfg) {
493  return NULL;
494  }
495  cfg->ht = ht_pp_new0();
497  if (!cfg->nodes) {
498  RZ_FREE(cfg);
499  return NULL;
500  }
501  cfg->user = user;
502  cfg->num = NULL;
503  cfg->lock = 0;
504  return cfg;
505 }
506 
508  RzListIter *iter;
509  RzConfigNode *node;
510  RzConfig *c = rz_config_new(cfg->user);
511  if (!c) {
512  return NULL;
513  }
514  rz_list_foreach (cfg->nodes, iter, node) {
516  ht_pp_insert(c->ht, node->name, nn);
517  rz_list_append(c->nodes, nn);
518  }
519  c->lock = cfg->lock;
520  return c;
521 }
522 
524  if (cfg) {
526  rz_list_free(cfg->nodes);
527  ht_pp_free(cfg->ht);
528  free(cfg);
529  }
530 }
531 
532 RZ_API void rz_config_visual_hit_i(RzConfig *cfg, const char *name, int delta) {
533  RzConfigNode *node = rz_config_node_get(cfg, name);
534  if (node && rz_config_node_is_int(node)) {
535  (void)rz_config_set_i(cfg, name, rz_config_get_i(cfg, name) + delta);
536  }
537 }
538 
539 RZ_API void rz_config_bump(RzConfig *cfg, const char *key) {
540  char *orig = strdup(rz_config_get(cfg, key));
541  if (orig) {
542  rz_config_set(cfg, key, orig);
543  free(orig);
544  }
545 }
546 
548  RzListIter *iter;
549  RzConfigNode *node;
550  rz_list_foreach (config->nodes, iter, node) {
551  sdb_set(db, node->name, node->value, 0);
552  }
553 }
554 
555 static bool load_config_cb(void *user, const char *k, const char *v) {
556  RzConfig *config = user;
558  if (node) {
559  rz_config_set(config, k, v);
560  }
561  return true;
562 }
563 
566  return true;
567 }
568 
576  rz_return_val_if_fail(str, false);
577 
578  char *name = rz_str_trim_dup(str);
579  char *value = strchr(name, '=');
580  if (!value) {
581  free(name);
582  return false;
583  }
584  *value++ = 0;
585  rz_config_set(cfg, name, value);
586  free(name);
587  return true;
588 }
lzma_index ** i
Definition: index.h:629
static bool err
Definition: armass.c:435
const char * desc
Definition: bin_vsf.c:19
static int value
Definition: cmd_api.c:93
RZ_API ut64 rz_config_get_i(RzConfig *cfg, RZ_NONNULL const char *name)
Definition: config.c:119
RZ_API bool rz_config_get_b(RzConfig *cfg, RZ_NONNULL const char *name)
Definition: config.c:142
static bool load_config_cb(void *user, const char *k, const char *v)
Definition: config.c:555
RZ_API bool rz_config_unserialize(RZ_NONNULL RzConfig *config, RZ_NONNULL Sdb *db, RZ_NULLABLE char **err)
Definition: config.c:564
RZ_API bool rz_config_eval(RZ_NONNULL RzConfig *cfg, RZ_NONNULL const char *str)
Sets the configuration variable and its value passed as argument.
Definition: config.c:575
RZ_API RzConfigNode * rz_config_set(RzConfig *cfg, RZ_NONNULL const char *name, const char *value)
Definition: config.c:267
RZ_API bool rz_config_readonly(RzConfig *cfg, const char *key)
Definition: config.c:481
RZ_API RzConfig * rz_config_clone(RzConfig *cfg)
Definition: config.c:507
RZ_API bool rz_config_set_getter(RzConfig *cfg, const char *key, RzConfigCallback cb)
Definition: config.c:53
RZ_API RZ_BORROW RzConfigNode * rz_config_node_get(RzConfig *cfg, RZ_NONNULL const char *name)
Definition: config.c:48
RZ_API RZ_OWN RzConfigNode * rz_config_node_new(RZ_NONNULL const char *name, RZ_NONNULL const char *value)
Definition: config.c:6
static bool __is_true_or_false(const char *s)
Definition: config.c:193
RZ_API bool rz_config_rm(RzConfig *cfg, RZ_NONNULL const char *name)
Definition: config.c:392
static int cmp(RzConfigNode *a, RzConfigNode *b)
Definition: config.c:472
RZ_API void rz_config_visual_hit_i(RzConfig *cfg, const char *name, int delta)
Definition: config.c:532
RZ_API const char * rz_config_node_desc(RzConfigNode *node, RZ_NULLABLE const char *desc)
Definition: config.c:383
RZ_API RzConfigNode * rz_config_set_i(RzConfig *cfg, RZ_NONNULL const char *name, const ut64 i)
Definition: config.c:419
RZ_API RzConfigNode * rz_config_set_cb(RzConfig *cfg, const char *name, const char *value, RzConfigCallback cb)
Definition: config.c:173
RZ_API void rz_config_node_free(RZ_NULLABLE void *n)
Definition: config.c:36
RZ_API bool rz_config_add_node(RZ_BORROW RzConfig *cfg, RZ_OWN RzConfigNode *node)
Appends the given node to the config cfg.
Definition: config.c:362
RZ_API RZ_BORROW const char * rz_config_get(RzConfig *cfg, RZ_NONNULL const char *name)
Definition: config.c:75
RZ_API const char * rz_config_node_type(RzConfigNode *node)
Definition: config.c:155
RZ_API const char * rz_config_desc(RzConfig *cfg, RZ_NONNULL const char *name, RZ_NULLABLE const char *desc)
Definition: config.c:377
RZ_API RzConfig * rz_config_new(void *user)
Definition: config.c:490
RZ_API bool rz_config_set_setter(RzConfig *cfg, const char *key, RzConfigCallback cb)
Definition: config.c:63
RZ_API void rz_config_lock(RzConfig *cfg, int l)
Definition: config.c:476
RZ_API RzConfigNode * rz_config_set_b(RzConfig *cfg, RZ_NONNULL const char *name, bool value)
Definition: config.c:201
RZ_API RZ_OWN RzConfigNode * rz_config_node_clone(RzConfigNode *n)
Definition: config.c:20
RZ_API void rz_config_serialize(RZ_NONNULL RzConfig *config, RZ_NONNULL Sdb *db)
Definition: config.c:547
RZ_API void rz_config_bump(RzConfig *cfg, const char *key)
Definition: config.c:539
RZ_API void rz_config_node_value_format_i(char *buf, size_t buf_size, const ut64 i, RZ_NULLABLE RzConfigNode *node)
Definition: config.c:403
RZ_API bool rz_config_toggle(RzConfig *cfg, RZ_NONNULL const char *name)
Definition: config.c:97
RZ_API void rz_config_free(RzConfig *cfg)
Definition: config.c:523
RZ_API RzConfigNode * rz_config_set_i_cb(RzConfig *cfg, const char *name, int ivalue, RzConfigCallback cb)
Definition: config.c:183
#define RZ_API
#define NULL
Definition: cris-opc.c:27
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
Definition: sflib.h:118
static int buf_size
Definition: debug_qnx.c:35
const char * k
Definition: dsignal.c:11
const char * v
Definition: dsignal.c:12
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
voidpf void * buf
Definition: ioapi.h:138
snprintf
Definition: kernel.h:364
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
Definition: list.c:248
RZ_API RZ_OWN RzList * rz_list_clone(RZ_NONNULL const RzList *list)
Shallow copies of the list (but doesn't free its elements)
Definition: list.c:496
RZ_API bool rz_list_delete_data(RZ_NONNULL RzList *list, void *ptr)
Deletes an entry in the list by searching for a pointer.
Definition: list.c:148
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
Definition: list.c:235
RZ_API void rz_list_sort(RZ_NONNULL RzList *list, RZ_NONNULL RzListComparator cmp)
Sorts via merge sort or via insertion sort a list.
Definition: list.c:743
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
Definition: list.c:288
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
Definition: list.c:137
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
int n
Definition: mipsasm.c:19
#define eprintf(x, y...)
Definition: rlcc.c:7
static RzSocket * s
Definition: rtr.c:28
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108
#define CN_BOOL
Definition: rz_config.h:14
static bool rz_config_node_is_bool(RzConfigNode *node)
Definition: rz_config.h:117
static bool rz_config_node_is_int(RzConfigNode *node)
Definition: rz_config.h:120
static bool rz_config_node_is_ro(RzConfigNode *node)
Definition: rz_config.h:123
static bool rz_config_node_is_str(RzConfigNode *node)
Definition: rz_config.h:126
#define CN_STR
Definition: rz_config.h:19
#define CN_RW
Definition: rz_config.h:21
bool(* RzConfigCallback)(void *user, void *data)
Definition: rz_config.h:34
#define CN_INT
Definition: rz_config.h:15
#define CN_RO
Definition: rz_config.h:20
void(* RzListFree)(void *ptr)
Definition: rz_list.h:11
int(* RzListComparator)(const void *value, const void *list_data)
Definition: rz_list.h:33
#define RZ_LOG_WARN(fmtstr,...)
Definition: rz_log.h:56
#define RZ_LOG_DEBUG(fmtstr,...)
Definition: rz_log.h:49
#define RZ_LOG_ERROR(fmtstr,...)
Definition: rz_log.h:58
RZ_API ut64 rz_num_get(RzNum *num, const char *str)
Definition: unum.c:172
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
Definition: unum.c:456
#define RZ_STR_ISNOTEMPTY(x)
Definition: rz_str.h:68
RZ_API int rz_str_casecmp(const char *dst, const char *orig)
Definition: str.c:121
RZ_API bool rz_str_is_true(const char *s)
Definition: str.c:3900
RZ_API const char * rz_str_bool(int b)
Definition: str.c:3896
RZ_API char * rz_str_trim_dup(const char *str)
Definition: str_trim.c:78
RZ_API size_t rz_str_ncpy(char *dst, const char *src, size_t n)
Secure string copy with null terminator.
Definition: str.c:923
#define IS_DIGIT(x)
Definition: rz_str_util.h:11
#define PFMT64d
Definition: rz_types.h:394
#define RZ_NULLABLE
Definition: rz_types.h:65
#define RZ_OWN
Definition: rz_types.h:62
#define RZ_NEW0(x)
Definition: rz_types.h:284
#define RZ_NONNULL
Definition: rz_types.h:64
#define RZ_FREE(x)
Definition: rz_types.h:369
#define PFMT64x
Definition: rz_types.h:393
#define RZ_BORROW
Definition: rz_types.h:63
#define UT64_MAX
Definition: rz_types_base.h:86
RZ_API int sdb_set(Sdb *s, const char *key, const char *val, ut32 cas)
Definition: sdb.c:611
RZ_API bool sdb_foreach(Sdb *s, SdbForeachCallback cb, void *user)
Definition: sdb.c:758
#define b(i)
Definition: sha256.c:42
#define c(i)
Definition: sha256.c:43
#define a(i)
Definition: sha256.c:41
Definition: z80asm.h:102
RzList * options
Definition: rz_config.h:47
RzConfigCallback setter
Definition: rz_config.h:45
RzConfigCallback getter
Definition: rz_config.h:44
RzNum * num
Definition: rz_config.h:55
RzList * nodes
Definition: rz_config.h:56
HtPP * ht
Definition: rz_config.h:57
void * user
Definition: rz_config.h:54
RzListFree free
Definition: rz_list.h:21
Definition: sdb.h:63
static st64 delta
Definition: vmenus.c:2425
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static const char * cb[]
Definition: z80_tab.h:176