130 if (!strcmp(node->
value,
"true")) {
165 if (!strncmp(node->
value,
"0x", 2)) {
176 if (!
cb(cfg->
user, node)) {
223 node->
value = svalue;
239 ht_pp_insert(cfg->
ht, node->
name, node);
248 if (node && node->
setter) {
276 eprintf(
"(error: '%s' config key is read only)\n",
name);
309 if (strchr(
value,
'/')) {
329 ht_pp_insert(cfg->
ht, node->
name, node);
332 eprintf(
"rz_config_set: unable to create a new RzConfigNode\n");
335 eprintf(
"rz_config_set: variable '%s' not found\n",
name);
339 if (node && node->
setter) {
365 RZ_LOG_WARN(
"Config locked. Plugin config node not copied.\n");
369 ht_pp_insert(cfg->ht, node->name, node);
396 ht_pp_delete(cfg->
ht, node->
name);
449 ht_pp_insert(cfg->
ht, node->
name, node);
458 if (node && node->
setter) {
473 return strcmp(
a->name,
b->name);
495 cfg->
ht = ht_pp_new0();
514 rz_list_foreach (cfg->
nodes,
iter, node) {
516 ht_pp_insert(
c->ht, node->
name, nn);
RZ_API ut64 rz_config_get_i(RzConfig *cfg, RZ_NONNULL const char *name)
RZ_API bool rz_config_get_b(RzConfig *cfg, RZ_NONNULL const char *name)
static bool load_config_cb(void *user, const char *k, const char *v)
RZ_API bool rz_config_unserialize(RZ_NONNULL RzConfig *config, RZ_NONNULL Sdb *db, RZ_NULLABLE char **err)
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.
RZ_API RzConfigNode * rz_config_set(RzConfig *cfg, RZ_NONNULL const char *name, const char *value)
RZ_API bool rz_config_readonly(RzConfig *cfg, const char *key)
RZ_API RzConfig * rz_config_clone(RzConfig *cfg)
RZ_API bool rz_config_set_getter(RzConfig *cfg, const char *key, RzConfigCallback cb)
RZ_API RZ_BORROW RzConfigNode * rz_config_node_get(RzConfig *cfg, RZ_NONNULL const char *name)
RZ_API RZ_OWN RzConfigNode * rz_config_node_new(RZ_NONNULL const char *name, RZ_NONNULL const char *value)
static bool __is_true_or_false(const char *s)
RZ_API bool rz_config_rm(RzConfig *cfg, RZ_NONNULL const char *name)
static int cmp(RzConfigNode *a, RzConfigNode *b)
RZ_API void rz_config_visual_hit_i(RzConfig *cfg, const char *name, int delta)
RZ_API const char * rz_config_node_desc(RzConfigNode *node, RZ_NULLABLE const char *desc)
RZ_API RzConfigNode * rz_config_set_i(RzConfig *cfg, RZ_NONNULL const char *name, const ut64 i)
RZ_API RzConfigNode * rz_config_set_cb(RzConfig *cfg, const char *name, const char *value, RzConfigCallback cb)
RZ_API void rz_config_node_free(RZ_NULLABLE void *n)
RZ_API bool rz_config_add_node(RZ_BORROW RzConfig *cfg, RZ_OWN RzConfigNode *node)
Appends the given node to the config cfg.
RZ_API RZ_BORROW const char * rz_config_get(RzConfig *cfg, RZ_NONNULL const char *name)
RZ_API const char * rz_config_node_type(RzConfigNode *node)
RZ_API const char * rz_config_desc(RzConfig *cfg, RZ_NONNULL const char *name, RZ_NULLABLE const char *desc)
RZ_API RzConfig * rz_config_new(void *user)
RZ_API bool rz_config_set_setter(RzConfig *cfg, const char *key, RzConfigCallback cb)
RZ_API void rz_config_lock(RzConfig *cfg, int l)
RZ_API RzConfigNode * rz_config_set_b(RzConfig *cfg, RZ_NONNULL const char *name, bool value)
RZ_API RZ_OWN RzConfigNode * rz_config_node_clone(RzConfigNode *n)
RZ_API void rz_config_serialize(RZ_NONNULL RzConfig *config, RZ_NONNULL Sdb *db)
RZ_API void rz_config_bump(RzConfig *cfg, const char *key)
RZ_API void rz_config_node_value_format_i(char *buf, size_t buf_size, const ut64 i, RZ_NULLABLE RzConfigNode *node)
RZ_API bool rz_config_toggle(RzConfig *cfg, RZ_NONNULL const char *name)
RZ_API void rz_config_free(RzConfig *cfg)
RZ_API RzConfigNode * rz_config_set_i_cb(RzConfig *cfg, const char *name, int ivalue, RzConfigCallback cb)
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
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_OWN RzList * rz_list_clone(RZ_NONNULL const RzList *list)
Shallow copies of the list (but doesn't free its elements)
RZ_API bool rz_list_delete_data(RZ_NONNULL RzList *list, void *ptr)
Deletes an entry in the list by searching for a pointer.
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
RZ_API void rz_list_sort(RZ_NONNULL RzList *list, RZ_NONNULL RzListComparator cmp)
Sorts via merge sort or via insertion sort a list.
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
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")
#define rz_return_val_if_fail(expr, val)
static bool rz_config_node_is_bool(RzConfigNode *node)
static bool rz_config_node_is_int(RzConfigNode *node)
static bool rz_config_node_is_ro(RzConfigNode *node)
static bool rz_config_node_is_str(RzConfigNode *node)
bool(* RzConfigCallback)(void *user, void *data)
void(* RzListFree)(void *ptr)
int(* RzListComparator)(const void *value, const void *list_data)
#define RZ_LOG_WARN(fmtstr,...)
#define RZ_LOG_DEBUG(fmtstr,...)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API ut64 rz_num_get(RzNum *num, const char *str)
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
#define RZ_STR_ISNOTEMPTY(x)
RZ_API int rz_str_casecmp(const char *dst, const char *orig)
RZ_API bool rz_str_is_true(const char *s)
RZ_API const char * rz_str_bool(int b)
RZ_API char * rz_str_trim_dup(const char *str)
RZ_API size_t rz_str_ncpy(char *dst, const char *src, size_t n)
Secure string copy with null terminator.
RZ_API int sdb_set(Sdb *s, const char *key, const char *val, ut32 cas)
RZ_API bool sdb_foreach(Sdb *s, SdbForeachCallback cb, void *user)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()