RzConfig#

class RzConfig#
property ht: HtPP#
property _lock: int#
property nodes: RzList[RzConfigNode]#
property num: RzNum#
property user: Any#
static hold_free() None#

Calls function rz_config_hold_free (defined in hold.c)

Free a RzConfigHold object h.

Parameters:

h – Reference to RzConfigHold

static hold_i() bool#

Calls function rz_config_hold_i (defined in hold.c)

Save the current values of a list of config options that have integer values.

Get the current values of a list of config variables (terminated by NULL) and save them in the RzConfigHold object h . rz_config_get_i is used to retrieve the current config values.

Parameters:
  • h – Reference to RzConfigHold instance

  • ... – List of config variables to save, terminated by NULL.

Returns:

true if at least one variable is correctly saved, false otherwise

static hold_restore() None#

Calls function rz_config_hold_restore (defined in hold.c)

Restore whatever config options were previously saved in h.

Parameters:

h – Reference to RzConfigHold

static hold_s() bool#

Calls function rz_config_hold_s (defined in hold.c)

Save the current values of a list of config options that have string values.

Get the current values of a list of config variables (terminated by NULL) and save them in the RzConfigHold object h . rz_config_get is used to retrieve the current config values.

Parameters:
  • h – Reference to RzConfigHold instance

  • ... – List of config variables to save, terminated by NULL.

Returns:

true if at least one variable is correctly saved, false otherwise

static new() RzConfig#

Calls function rz_config_new (defined in config.c)

static node_clone() RzConfigNode#

Calls function rz_config_node_clone (defined in config.c)

static node_desc(desc: str) str#

Calls function rz_config_node_desc (defined in config.c)

static node_free() None#

Calls function rz_config_node_free (defined in config.c)

static node_new(value: str) RzConfigNode#

Calls function rz_config_node_new (defined in config.c)

static node_type() str#

Calls function rz_config_node_type (defined in config.c)

static node_value_format_i(buf_size: size_t, i: int, node: RzConfigNode) None#

Calls function rz_config_node_value_format_i (defined in config.c)

add_node(node: RzConfigNode) bool#

Calls function rz_config_add_node (defined in config.c)

Appends the given node to the config cfg.

Parameters:
  • cfg – The configuration the node is appended.

  • node – The node to append.

Returns:

bool True if the node was successful added. False otherwise.

bump(key: str) None#

Calls function rz_config_bump (defined in config.c)

clone() RzConfig#

Calls function rz_config_clone (defined in config.c)

desc(name: str, desc: str) str#

Calls function rz_config_desc (defined in config.c)

eval(str: str) bool#

Calls function rz_config_eval (defined in config.c)

Sets the configuration variable and its value passed as argument.

Parameters:
  • cfg – reference to RzConfig

  • str – reference the configuration variable string (eg, ‘asm.arch=x86’)

free() None#

Calls function rz_config_free (defined in config.c)

get(name: str) str#

Calls function rz_config_get (defined in config.c)

Returns the value of the config variable of name as a string

get_b(name: str) bool#

Calls function rz_config_get_b (defined in config.c)

Reads the value of the config variable of name only and only if the variable is boolean. Returns false in case of the failure.

get_i(name: str) int#

Calls function rz_config_get_i (defined in config.c)

Reads the value of the config variable of name only and only if the variable is integer.

hold_new() RzConfigHold#

Calls function rz_config_hold_new (defined in hold.c)

Create an opaque object to save/restore some configuration options.

Parameters:

cfg – RzConfig reference

Returns:

RzConfigHold allocated object

lock(l: int) None#

Calls function rz_config_lock (defined in config.c)

node_get(name: str) RzConfigNode#

Calls function rz_config_node_get (defined in config.c)

readonly(key: str) bool#

Calls function rz_config_readonly (defined in config.c)

rm(name: str) bool#

Calls function rz_config_rm (defined in config.c)

serialize(db: Sdb) None#

Calls function rz_config_serialize (defined in config.c)

set(name: str, value: str) RzConfigNode#

Calls function rz_config_set (defined in config.c)

Writes the string value in the config variable of name.

set_b(name: str, value: bool) RzConfigNode#

Calls function rz_config_set_b (defined in config.c)

Writes the boolean value in the config variable of name only and only if the variable is boolean.

set_cb(name: str, value: str, callback: CFunction[[Any, Any], bool]) RzConfigNode#

Calls function rz_config_set_cb (defined in config.c)

set_getter(key: str, cb: RzConfigCallback) bool#

Calls function rz_config_set_getter (defined in config.c)

set_i(name: str, i: int) RzConfigNode#

Calls function rz_config_set_i (defined in config.c)

Writes the integer value in the config variable of name only and only if the variable is integer.

set_i_cb(name: str, ivalue: int, callback: CFunction[[Any, Any], bool]) RzConfigNode#

Calls function rz_config_set_i_cb (defined in config.c)

set_setter(key: str, cb: RzConfigCallback) bool#

Calls function rz_config_set_setter (defined in config.c)

toggle(name: str) bool#

Calls function rz_config_toggle (defined in config.c)

Reads the value of the config variable of name only and only if the variable is boolean, then tries to write back the inverted value. Returns true in case of success.

unserialize(db: Sdb, err: Pointer[Pointer[int]]) bool#

Calls function rz_config_unserialize (defined in config.c)