mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-19 04:12:46 +00:00
Add RConfig.{get,set}_b dummy APIs
This commit is contained in:
parent
8413fd630a
commit
ebed292f66
@ -323,10 +323,14 @@ R_API bool r_config_toggle(RConfig *cfg, const char *name) {
|
|||||||
eprintf ("(error: '%s' config key is read only)\n", name);
|
eprintf ("(error: '%s' config key is read only)\n", name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
(void)r_config_set_i (cfg, name, !node->i_value);
|
(void)r_config_set_b (cfg, name, !node->i_value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
R_API bool r_config_get_b(RConfig *cfg, const char *name) {
|
||||||
|
return r_config_get_i (cfg, name) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
R_API ut64 r_config_get_i(RConfig *cfg, const char *name) {
|
R_API ut64 r_config_get_i(RConfig *cfg, const char *name) {
|
||||||
RConfigNode *node = r_config_node_get (cfg, name);
|
RConfigNode *node = r_config_node_get (cfg, name);
|
||||||
if (node) {
|
if (node) {
|
||||||
@ -516,6 +520,14 @@ R_API void r_config_node_value_format_i(char *buf, size_t buf_size, const ut64 i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
R_API RConfigNode* r_config_set_b(RConfig *cfg, const char *name, bool b) {
|
||||||
|
RConfigNode *node = r_config_node_get (cfg, name);
|
||||||
|
if (node && r_config_node_is_bool (node)) {
|
||||||
|
return r_config_set_i (cfg, name, b? 1: 0);
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
R_API RConfigNode* r_config_set_i(RConfig *cfg, const char *name, const ut64 i) {
|
R_API RConfigNode* r_config_set_i(RConfig *cfg, const char *name, const ut64 i) {
|
||||||
char buf[128], *ov = NULL;
|
char buf[128], *ov = NULL;
|
||||||
r_return_val_if_fail (cfg && name, NULL);
|
r_return_val_if_fail (cfg && name, NULL);
|
||||||
|
@ -74,6 +74,8 @@ R_API void r_config_free(RConfig *cfg);
|
|||||||
R_API void r_config_lock(RConfig *cfg, bool lock);
|
R_API void r_config_lock(RConfig *cfg, bool lock);
|
||||||
R_API bool r_config_eval(RConfig *cfg, const char *str, bool many);
|
R_API bool r_config_eval(RConfig *cfg, const char *str, bool many);
|
||||||
R_API void r_config_bump(RConfig *cfg, const char *key);
|
R_API void r_config_bump(RConfig *cfg, const char *key);
|
||||||
|
R_API bool r_config_get_b(RConfig *cfg, const char *name) {
|
||||||
|
R_API RConfigNode* r_config_set_b(RConfig *cfg, const char *name, bool b);
|
||||||
R_API RConfigNode *r_config_set_i(RConfig *cfg, const char *name, const ut64 i);
|
R_API RConfigNode *r_config_set_i(RConfig *cfg, const char *name, const ut64 i);
|
||||||
R_API RConfigNode *r_config_set_cb(RConfig *cfg, const char *name, const char *value, RConfigCallback cb);
|
R_API RConfigNode *r_config_set_cb(RConfig *cfg, const char *name, const char *value, RConfigCallback cb);
|
||||||
R_API RConfigNode *r_config_set_i_cb(RConfig *cfg, const char *name, int ivalue, RConfigCallback cb);
|
R_API RConfigNode *r_config_set_i_cb(RConfig *cfg, const char *name, int ivalue, RConfigCallback cb);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user