Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
const char* rz_il_var_kind_name | ( | RzILVarKind | kind | ) |
Get a readable string representation of kind
Definition at line 181 of file variable.c.
References RZ_IL_VAR_KIND_GLOBAL, RZ_IL_VAR_KIND_LOCAL, and RZ_IL_VAR_KIND_LOCAL_PURE.
Referenced by rz_il_handler_var().
Set the contents of the variable called name
to val
In order for this to succeed, a variable called name
must already exist and the sort of val
must match the variable's sort. Checking this is done inside this function, so calling it with invalid args in that sense is fine.
Definition at line 129 of file variable.c.
References rz_il_var_set_t::contents, NULL, rz_il_sort_pure_eq(), rz_il_value_free(), rz_il_value_get_sort(), RZ_LOG_ERROR, rz_return_val_if_fail, rz_il_var_t::sort, val, and rz_il_var_set_t::vars.
Referenced by rz_il_vm_create_global_var(), rz_il_vm_pop_local_pure_var(), rz_il_vm_push_local_pure_var(), rz_il_vm_set_global_var(), and rz_il_vm_set_local_var().
RZ_API RZ_BORROW RzILVar* rz_il_var_set_create_var | ( | RzILVarSet * | vs, |
const char * | name, | ||
RzILSortPure | sort | ||
) |
Create a new variable of the given name and sort. If a variable of this name already exists, nothing happens.
Definition at line 90 of file variable.c.
References NULL, rz_il_variable_new(), rz_return_val_if_fail, and rz_il_var_set_t::vars.
Referenced by rz_il_vm_create_global_var(), rz_il_vm_pop_local_pure_var(), rz_il_vm_push_local_pure_var(), and rz_il_vm_set_local_var().
RZ_API void rz_il_var_set_fini | ( | RzILVarSet * | vs | ) |
Definition at line 76 of file variable.c.
References rz_il_var_set_t::contents, and rz_il_var_set_t::vars.
Referenced by rz_il_var_set_reset(), and rz_il_vm_fini().
RZ_API RZ_BORROW RzILVar* rz_il_var_set_get | ( | RzILVarSet * | vs, |
const char * | name | ||
) |
Get the definition of the variable called name
Definition at line 148 of file variable.c.
References NULL, and rz_il_var_set_t::vars.
Referenced by rz_il_vm_get_var().
RZ_API RZ_OWN RzPVector* rz_il_var_set_get_all | ( | RzILVarSet * | vs | ) |
Get a list of all variable definitions in the given set
Definition at line 160 of file variable.c.
References NULL, r, rz_pvector_new(), rz_return_val_if_fail, rz_il_var_set_t::vars, and vars_collect_cb().
Referenced by rz_il_vm_get_all_vars().
RZ_API RZ_BORROW RzILVal* rz_il_var_set_get_value | ( | RzILVarSet * | vs, |
const char * | name | ||
) |
Get the current value of the variable called name
Definition at line 173 of file variable.c.
References rz_il_var_set_t::contents, NULL, and rz_return_val_if_fail.
Referenced by rz_il_vm_get_var_value().
RZ_API bool rz_il_var_set_init | ( | RzILVarSet * | vs | ) |
Initialize vs
as an empty variable set
This makes sure that if a failure occurs, the contents are still zeroed out, so it is safe (but not required) to call rz_il_var_set_fini(), even if the init failed.
Definition at line 60 of file variable.c.
References rz_il_var_set_t::contents, memset(), NULL, rz_return_val_if_fail, val_ht_free(), var_ht_free(), and rz_il_var_set_t::vars.
Referenced by rz_il_var_set_reset(), and rz_il_vm_init().
RZ_API RZ_OWN RZ_NULLABLE RzILVal* rz_il_var_set_remove_var | ( | RzILVarSet * | vs, |
const char * | name | ||
) |
Remove a variable, if it exists
Definition at line 107 of file variable.c.
References rz_il_var_set_t::contents, NULL, r, rz_return_val_if_fail, and rz_il_var_set_t::vars.
Referenced by rz_il_vm_pop_local_pure_var(), and rz_il_vm_push_local_pure_var().
RZ_API void rz_il_var_set_reset | ( | RzILVarSet * | vs | ) |
Definition at line 81 of file variable.c.
References rz_il_var_set_fini(), and rz_il_var_set_init().
Referenced by rz_il_vm_step().
RZ_API void rz_il_variable_free | ( | RZ_NULLABLE RzILVar * | var | ) |
Free variable
var | RzILVar, pointer to RzILVar |
Definition at line 32 of file variable.c.
References free().
Referenced by var_ht_free().
RZ_API RZ_OWN RzILVar* rz_il_variable_new | ( | RZ_NONNULL const char * | name, |
RzILSortPure | sort | ||
) |
Create a new variable description
Definition at line 13 of file variable.c.
References free(), rz_il_var_t::name, NULL, RZ_NEW0, rz_return_val_if_fail, rz_il_var_t::sort, and strdup().
Referenced by rz_il_var_set_create_var().
|
static |
Definition at line 47 of file variable.c.
References free(), and rz_il_value_free().
Referenced by rz_il_var_set_init().
|
static |
Definition at line 42 of file variable.c.
References free(), and rz_il_variable_free().
Referenced by rz_il_var_set_init().
Definition at line 152 of file variable.c.
References rz_pvector_push(), and v.
Referenced by rz_il_var_set_get_all().