Rizin
unix-like reverse engineering framework and cli tools
variable.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2021 RizinOrg <info@rizin.re>
2 // SPDX-FileCopyrightText: 2021 deroad <wargio@libero.it>
3 // SPDX-FileCopyrightText: 2021 heersin <teablearcher@gmail.com>
4 // SPDX-License-Identifier: LGPL-3.0-only
5 
6 #ifndef RZ_IL_VARIABLE_H
7 #define RZ_IL_VARIABLE_H
8 
9 #include <rz_util/rz_bitvector.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
19 typedef struct rz_il_var_t {
20  char *name;
23 
26 
31 typedef struct rz_il_var_set_t {
32  HtPP /* <char *, RzILVar *> */ *vars;
33  HtPP /* <char *, RzILVal *> */ *contents;
35 
41 RZ_API bool rz_il_var_set_bind(RzILVarSet *vs, const char *name, RZ_OWN RzILVal *val);
45 
46 typedef enum {
51 
52 const char *rz_il_var_kind_name(RzILVarKind kind);
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 #endif // RZ_IL_VARIABLE_H
ut16 val
Definition: armass64_const.h:6
#define RZ_API
#define RZ_NULLABLE
Definition: rz_types.h:65
#define RZ_OWN
Definition: rz_types.h:62
#define RZ_NONNULL
Definition: rz_types.h:64
#define RZ_BORROW
Definition: rz_types.h:63
Definition: z80asm.h:102
Holds a set of variable definitions and their current contents This is meant only as a low-level cont...
Definition: variable.h:31
HtPP * vars
Definition: variable.h:32
HtPP * contents
Definition: variable.h:33
Definition of a variable inside the vm.
Definition: variable.h:19
RzILSortPure sort
"type" of the variable
Definition: variable.h:21
char * name
Definition: variable.h:20
RZ_API RZ_BORROW RzILVar * rz_il_var_set_create_var(RzILVarSet *vs, const char *name, RzILSortPure sort)
Definition: variable.c:90
RZ_API void rz_il_variable_free(RZ_NULLABLE RzILVar *var)
Definition: variable.c:32
RZ_API bool rz_il_var_set_bind(RzILVarSet *vs, const char *name, RZ_OWN RzILVal *val)
Definition: variable.c:129
RZ_API bool rz_il_var_set_init(RzILVarSet *vs)
Definition: variable.c:60
RZ_API void rz_il_var_set_reset(RzILVarSet *vs)
Definition: variable.c:81
RZ_API RZ_OWN RzPVector * rz_il_var_set_get_all(RzILVarSet *vs)
Definition: variable.c:160
const char * rz_il_var_kind_name(RzILVarKind kind)
Definition: variable.c:181
RZ_API RZ_BORROW RzILVar * rz_il_var_set_get(RzILVarSet *vs, const char *name)
Definition: variable.c:148
RZ_API RZ_OWN RzILVar * rz_il_variable_new(RZ_NONNULL const char *name, RzILSortPure sort)
Definition: variable.c:13
struct rz_il_var_t RzILVar
Definition of a variable inside the vm.
RZ_API RZ_BORROW RzILVal * rz_il_var_set_get_value(RzILVarSet *vs, const char *name)
Definition: variable.c:173
struct rz_il_var_set_t RzILVarSet
Holds a set of variable definitions and their current contents This is meant only as a low-level cont...
RZ_API void rz_il_var_set_fini(RzILVarSet *vs)
Definition: variable.c:76
RzILVarKind
Definition: variable.h:46
@ RZ_IL_VAR_KIND_GLOBAL
global var, usually bound to a physical representation like a register.
Definition: variable.h:47
@ RZ_IL_VAR_KIND_LOCAL
local var, defined and assigned by set ops, mutable and useable across effects.
Definition: variable.h:48
@ RZ_IL_VAR_KIND_LOCAL_PURE
local pure var, bound only by let expressions, scope is limited to the let's pure body,...
Definition: variable.h:49
RZ_API RZ_OWN RZ_NULLABLE RzILVal * rz_il_var_set_remove_var(RzILVarSet *vs, const char *name)
Definition: variable.c:107