Core: Add cfgset bind methods
* Fix `RzCoreConfigGetI` return to `ut64`
This commit is contained in:
parent
6b95dc16ae
commit
fd8409d054
2 changed files with 16 additions and 2 deletions
|
|
@ -342,7 +342,7 @@ static void archbits(RzCore *core, ut64 addr) {
|
|||
rz_core_seek_arch_bits(core, addr);
|
||||
}
|
||||
|
||||
static int cfggeti(RzCore *core, const char *k) {
|
||||
static ut64 cfggeti(RzCore *core, const char *k) {
|
||||
return rz_config_get_i(core->config, k);
|
||||
}
|
||||
|
||||
|
|
@ -350,6 +350,14 @@ static const char *cfgget(RzCore *core, const char *k) {
|
|||
return rz_config_get(core->config, k);
|
||||
}
|
||||
|
||||
static bool cfgseti(RzCore *core, const char *k, ut64 v) {
|
||||
return rz_config_set_i(core->config, k, v);
|
||||
}
|
||||
|
||||
static bool cfgset(RzCore *core, const char *k, const char *v) {
|
||||
return rz_config_set(core->config, k, v);
|
||||
}
|
||||
|
||||
static ut64 numget(RzCore *core, const char *k) {
|
||||
return rz_num_math(core->num, k);
|
||||
}
|
||||
|
|
@ -373,6 +381,8 @@ RZ_API int rz_core_bind(RzCore *core, RzCoreBind *bnd) {
|
|||
bnd->archbits = (RzCoreSeekArchBits)archbits;
|
||||
bnd->cfggeti = (RzCoreConfigGetI)cfggeti;
|
||||
bnd->cfgGet = (RzCoreConfigGet)cfgget;
|
||||
bnd->cfgSetI = (RzCoreConfigSetI)cfgseti;
|
||||
bnd->cfgSet = (RzCoreConfigSet)cfgset;
|
||||
bnd->numGet = (RzCoreNumGet)numget;
|
||||
bnd->flagsGet = (RzCoreFlagsGet)__flagsGet;
|
||||
bnd->applyBinInfo = (RzCoreBinApplyInfo)rz_core_bin_apply_info;
|
||||
|
|
|
|||
|
|
@ -19,8 +19,10 @@ typedef void (*RzCoreSetArchBits)(void *core, const char *arch, int bits);
|
|||
typedef const char *(*RzCoreGetName)(void *core, ut64 off);
|
||||
typedef char *(*RzCoreGetNameDelta)(void *core, ut64 off);
|
||||
typedef void (*RzCoreSeekArchBits)(void *core, ut64 addr);
|
||||
typedef int (*RzCoreConfigGetI)(void *core, const char *key);
|
||||
typedef ut64 (*RzCoreConfigGetI)(void *core, const char *key);
|
||||
typedef const char *(*RzCoreConfigGet)(void *core, const char *key);
|
||||
typedef bool (*RzCoreConfigSet)(void *core, const char *key, const char *value);
|
||||
typedef bool (*RzCoreConfigSetI)(void *core, const char *key, ut64 value);
|
||||
typedef ut64 (*RzCoreNumGet)(void *core, const char *str);
|
||||
typedef const RzList *(*RzCoreFlagsGet)(void *core, ut64 offset);
|
||||
typedef bool (*RzCoreBinApplyInfo)(void *core, void *binfile, ut32 mask);
|
||||
|
|
@ -40,6 +42,8 @@ typedef struct rz_core_bind_t {
|
|||
RzCoreSeekArchBits archbits;
|
||||
RzCoreConfigGetI cfggeti;
|
||||
RzCoreConfigGet cfgGet;
|
||||
RzCoreConfigSet cfgSet;
|
||||
RzCoreConfigSetI cfgSetI;
|
||||
RzCoreNumGet numGet;
|
||||
RzCoreFlagsGet flagsGet;
|
||||
RzCoreBinApplyInfo applyBinInfo;
|
||||
|
|
|
|||
Loading…
Reference in a new issue