Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions librz/arch/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <rz_arch.h>
#include <rz_lib.h>

RZ_API RzParse *rz_parse_new(void) {
RZ_API RZ_OWN RzParse *rz_parse_new(void) {
RzParse *p = RZ_NEW0(RzParse);
if (!p) {
return NULL;
Expand Down Expand Up @@ -128,7 +128,7 @@ RZ_API bool rz_parse_assemble(RzParse *p, char *data, char *str) {
*
* Converts the assembly line into pseudocode
* */
RZ_API char *rz_parse_pseudocode(RzParse *p, const char *assembly) {
RZ_API RZ_OWN char *rz_parse_pseudocode(RzParse *p, const char *assembly) {
rz_return_val_if_fail(p, NULL);
if (RZ_STR_ISEMPTY(assembly)) {
return NULL;
Expand All @@ -148,7 +148,7 @@ RZ_API char *rz_parse_pseudocode(RzParse *p, const char *assembly) {
return rz_strbuf_drain(sb);
}

RZ_API char *rz_parse_immtrim(char *opstr) {
RZ_API RZ_BORROW char *rz_parse_immtrim(char *opstr) {
if (!opstr || !*opstr) {
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion librz/bin/dbginfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static int line_sample_cmp(const void *a, const void *b, void *user) {
return strcmp(sa->file, sb->file);
}

RZ_API RzBinSourceLineInfo *rz_bin_source_line_info_builder_build_and_fini(RzBinSourceLineInfoBuilder *builder) {
RZ_API RZ_OWN RzBinSourceLineInfo *rz_bin_source_line_info_builder_build_and_fini(RzBinSourceLineInfoBuilder *builder) {
RzBinSourceLineInfo *r = RZ_NEW0(RzBinSourceLineInfo);
if (!r) {
goto err;
Expand Down
2 changes: 1 addition & 1 deletion librz/config/hold.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ RZ_API bool rz_config_hold_i(RzConfigHold *h, ...) {
* \param cfg RzConfig reference
* \return RzConfigHold allocated object
*/
RZ_API RzConfigHold *rz_config_hold_new(RzConfig *cfg) {
RZ_API RZ_OWN RzConfigHold *rz_config_hold_new(RzConfig *cfg) {
if (cfg) {
RzConfigHold *hold = RZ_NEW0(RzConfigHold);
if (hold) {
Expand Down
4 changes: 2 additions & 2 deletions librz/core/agraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -3633,7 +3633,7 @@ static void agraph_sdb_init(const RzAGraph *g) {
sdb_set_enc(g->db, "agraph.color_false", cons->context->pal.graph_false);
}

RZ_API Sdb *rz_agraph_get_sdb(RzAGraph *g) {
RZ_API RZ_BORROW Sdb *rz_agraph_get_sdb(RzAGraph *g) {
g->need_update_dim = true;
g->need_set_layout = true;
AGraphContext grp_ctx = { 0 };
Expand Down Expand Up @@ -3948,7 +3948,7 @@ RZ_API void rz_agraph_free(RzAGraph *g) {
free(g);
}

RZ_API RzAGraph *rz_agraph_new(RzConsCanvas *can) {
RZ_API RZ_OWN RzAGraph *rz_agraph_new(RzConsCanvas *can) {
RzAGraph *g = RZ_NEW0(RzAGraph);
if (!g) {
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion librz/core/cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ RZ_API void rz_core_cmpwatch_free(RzCoreCmpWatcher *w) {
* \param addr Expected address for the memory watcher to be found
* \return RzCoreCmpWatcher* Pointer to the found memory watcher; NULL if not found
*/
RZ_API RzCoreCmpWatcher *rz_core_cmpwatch_get(RzCore *core, ut64 addr) {
RZ_API RZ_BORROW RzCoreCmpWatcher *rz_core_cmpwatch_get(RzCore *core, ut64 addr) {
rz_return_val_if_fail(core, NULL);
RzListIter *iter;
RzCoreCmpWatcher *w;
Expand Down
2 changes: 1 addition & 1 deletion librz/hash/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ RZ_API RZ_OWN char *rz_hash_cfg_calculate_small_block_string(RZ_NONNULL RzHash *
* Create a new RzHash object where plugins can be registered and specific
* configurations can be created from.
*/
RZ_API RzHash *rz_hash_new(void) {
RZ_API RZ_OWN RzHash *rz_hash_new(void) {
RzHash *rh = RZ_NEW0(RzHash);
if (!rh) {
return NULL;
Expand Down
10 changes: 5 additions & 5 deletions librz/il/definitions/bool.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* \param true_or_false bool, set bool as true or false
* \return bool RzILBool, pointer to bool value
*/
RZ_API RzILBool *rz_il_bool_new(bool true_or_false) {
RZ_API RZ_OWN RzILBool *rz_il_bool_new(bool true_or_false) {
RzILBool *ret = RZ_NEW0(RzILBool);
if (!ret) {
return NULL;
Expand All @@ -23,7 +23,7 @@ RZ_API RzILBool *rz_il_bool_new(bool true_or_false) {
* \param b RzILBool, operand of `AND`
* \return bool RzILBool, pointer to the result
*/
RZ_API RzILBool *rz_il_bool_and(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b) {
RZ_API RZ_OWN RzILBool *rz_il_bool_and(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b) {
rz_return_val_if_fail(a && b, NULL);
bool result = a->b && b->b;
RzILBool *ret = rz_il_bool_new(result);
Expand All @@ -36,7 +36,7 @@ RZ_API RzILBool *rz_il_bool_and(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b)
* \param b RzILBool, operand of `AND`
* \return bool RzILBool, pointer to the result
*/
RZ_API RzILBool *rz_il_bool_or(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b) {
RZ_API RZ_OWN RzILBool *rz_il_bool_or(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b) {
rz_return_val_if_fail(a && b, NULL);
bool result = a->b || b->b;
RzILBool *ret = rz_il_bool_new(result);
Expand All @@ -49,7 +49,7 @@ RZ_API RzILBool *rz_il_bool_or(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b) {
* \param b RzILBool, operand of `AND`
* \return bool RzILBool, pointer to the result
*/
RZ_API RzILBool *rz_il_bool_xor(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b) {
RZ_API RZ_OWN RzILBool *rz_il_bool_xor(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b) {
rz_return_val_if_fail(a && b, NULL);
bool result = a->b != b->b;
return rz_il_bool_new(result);
Expand All @@ -60,7 +60,7 @@ RZ_API RzILBool *rz_il_bool_xor(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b)
* \param a RzILBool, operand of `AND`
* \return bool RzILBool, pointer to the result
*/
RZ_API RzILBool *rz_il_bool_not(RZ_NONNULL RzILBool *a) {
RZ_API RZ_OWN RzILBool *rz_il_bool_not(RZ_NONNULL RzILBool *a) {
rz_return_val_if_fail(a, NULL);
bool result = !a->b;
RzILBool *ret = rz_il_bool_new(result);
Expand Down
2 changes: 1 addition & 1 deletion librz/il/definitions/label.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RZ_API void rz_il_effect_label_free(RzILEffectLabel *lbl) {
return;
}

RZ_API RzILEffectLabel *rz_il_effect_label_dup(RZ_NONNULL RzILEffectLabel *lbl) {
RZ_API RZ_OWN RzILEffectLabel *rz_il_effect_label_dup(RZ_NONNULL RzILEffectLabel *lbl) {
rz_return_val_if_fail(lbl, NULL);
RzILEffectLabel *r = rz_il_effect_label_new(lbl->label_id, lbl->type);
if (!r) {
Expand Down
4 changes: 2 additions & 2 deletions librz/il/definitions/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ RZ_API ut32 rz_il_mem_value_len(RzILMem *mem) {
* \param key address (bitvector)
* \return data (bitvector)
*/
RZ_API RzBitVector *rz_il_mem_load(RzILMem *mem, RzBitVector *key) {
RZ_API RZ_OWN RzBitVector *rz_il_mem_load(RzILMem *mem, RzBitVector *key) {
rz_return_val_if_fail(mem && key, NULL);
return_val_if_key_len_wrong(mem, key, NULL);
ut8 v = 0;
Expand Down Expand Up @@ -180,7 +180,7 @@ static bool write_n_bits(RzBuffer *buf, RzBitVector *key, RzBitVector *value, bo
* \param n_bits How many bits to read. This also determines the size of the returned bitvector
* \return data (bitvector)
*/
RZ_API RzBitVector *rz_il_mem_loadw(RzILMem *mem, RzBitVector *key, ut32 n_bits, bool big_endian) {
RZ_API RZ_OWN RzBitVector *rz_il_mem_loadw(RzILMem *mem, RzBitVector *key, ut32 n_bits, bool big_endian) {
rz_return_val_if_fail(mem && key && n_bits, NULL);
return_val_if_key_len_wrong(mem, key, NULL);
return read_n_bits(mem->buf, n_bits, key, big_endian);
Expand Down
2 changes: 1 addition & 1 deletion librz/il/il_opcodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ RZ_API RZ_OWN RzILOpFloat *rz_il_op_new_fcompound(RzFloatRMode rmode, RZ_NONNULL
/**
* Duplicate the given op recursively, for example to reuse it multiple times in another op.
*/
RZ_API RzILOpPure *rz_il_op_pure_dup(RZ_NONNULL RzILOpPure *op) {
RZ_API RZ_OWN RzILOpPure *rz_il_op_pure_dup(RZ_NONNULL RzILOpPure *op) {
rz_return_val_if_fail(op, NULL);
RzILOpPure *r = RZ_NEW0(RzILOpPure);
if (!r) {
Expand Down
2 changes: 1 addition & 1 deletion librz/il/il_reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static void reg_binding_item_fini(RzILRegBindingItem *item, void *unused) {
*
* If two registers have the same offset and size, the result is currently undefined.
*/
RZ_API RzILRegBinding *rz_il_reg_binding_derive(RZ_NONNULL RzReg *reg) {
RZ_API RZ_OWN RzILRegBinding *rz_il_reg_binding_derive(RZ_NONNULL RzReg *reg) {
rz_return_val_if_fail(reg, NULL);
RzILRegBinding *rb = RZ_NEW0(RzILRegBinding);
if (!rb) {
Expand Down
4 changes: 2 additions & 2 deletions librz/il/il_validate.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct rz_il_validate_global_context_t {
* Create a new global context for validation
* Vars and mems can be added manually with rz_il_validate_global_context_add_* functions.
*/
RZ_API RzILValidateGlobalContext *rz_il_validate_global_context_new_empty(ut32 pc_len) {
RZ_API RZ_OWN RzILValidateGlobalContext *rz_il_validate_global_context_new_empty(ut32 pc_len) {
rz_return_val_if_fail(pc_len, NULL);
RzILValidateGlobalContext *ctx = RZ_NEW0(RzILValidateGlobalContext);
if (!ctx) {
Expand Down Expand Up @@ -65,7 +65,7 @@ RZ_API void rz_il_validate_global_context_add_mem(RzILValidateGlobalContext *ctx
/**
* Create a new context for IL validation based on the global vars and mems in \p vm
*/
RZ_API RzILValidateGlobalContext *rz_il_validate_global_context_new_from_vm(RZ_NONNULL RzILVM *vm) {
RZ_API RZ_OWN RzILValidateGlobalContext *rz_il_validate_global_context_new_from_vm(RZ_NONNULL RzILVM *vm) {
rz_return_val_if_fail(vm, NULL);
RzILValidateGlobalContext *ctx = rz_il_validate_global_context_new_empty(rz_il_vm_get_pc_len(vm));
RzPVector *vars = rz_il_vm_get_all_vars(vm, RZ_IL_VAR_KIND_GLOBAL);
Expand Down
4 changes: 2 additions & 2 deletions librz/include/rz_agraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ typedef struct rz_ascii_graph_t {
} RzAGraph;

#ifdef RZ_API
RZ_API RzAGraph *rz_agraph_new(RzConsCanvas *can);
RZ_API RZ_OWN RzAGraph *rz_agraph_new(RzConsCanvas *can);
RZ_API void rz_agraph_free(RzAGraph *g);
RZ_API void rz_agraph_reset(RzAGraph *g);
RZ_API void rz_agraph_set_title(RzAGraph *g, const char *title);
Expand All @@ -106,7 +106,7 @@ RZ_API void rz_agraph_add_edge_at(const RzAGraph *g, RzANode *a, RzANode *b, int
RZ_API void rz_agraph_del_edge(const RzAGraph *g, RzANode *a, RzANode *b);
RZ_API void rz_agraph_print(RzAGraph *g);
RZ_API void rz_agraph_print_json(RzAGraph *g, PJ *pj);
RZ_API Sdb *rz_agraph_get_sdb(RzAGraph *g);
RZ_API RZ_BORROW Sdb *rz_agraph_get_sdb(RzAGraph *g);
RZ_API void rz_agraph_foreach(RzAGraph *g, RzANodeCallback cb, void *user);
RZ_API void rz_agraph_foreach_edge(RzAGraph *g, RAEdgeCallback cb, void *user);
RZ_API void rz_agraph_set_curnode(RzAGraph *g, RzANode *node);
Expand Down
2 changes: 1 addition & 1 deletion librz/include/rz_bin_source_line.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ typedef struct {
RZ_API void rz_bin_source_line_info_builder_init(RzBinSourceLineInfoBuilder *builder);
RZ_API void rz_bin_source_line_info_builder_fini(RzBinSourceLineInfoBuilder *builder);
RZ_API void rz_bin_source_line_info_builder_push_sample(RzBinSourceLineInfoBuilder *builder, ut64 address, ut32 line, ut32 column, const char *file);
RZ_API RzBinSourceLineInfo *rz_bin_source_line_info_builder_build_and_fini(RzBinSourceLineInfoBuilder *builder);
RZ_API RZ_OWN RzBinSourceLineInfo *rz_bin_source_line_info_builder_build_and_fini(RzBinSourceLineInfoBuilder *builder);

RZ_API bool rz_bin_source_line_info_merge(RZ_BORROW RZ_NONNULL RzBinSourceLineInfo *dst, RZ_BORROW RZ_NONNULL RzBinSourceLineInfo *src);
RZ_API void rz_bin_source_line_info_free(RzBinSourceLineInfo *sli);
Expand Down
2 changes: 1 addition & 1 deletion librz/include/rz_cmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ typedef struct rz_core_cmpwatch_t {

/* watchers */
RZ_API void rz_core_cmpwatch_free(RzCoreCmpWatcher *w);
RZ_API RzCoreCmpWatcher *rz_core_cmpwatch_get(RzCore *core, ut64 addr);
RZ_API RZ_BORROW RzCoreCmpWatcher *rz_core_cmpwatch_get(RzCore *core, ut64 addr);
RZ_API bool rz_core_cmpwatch_add(RzCore *core, ut64 addr, int size, const char *cmd);
RZ_API bool rz_core_cmpwatch_del(RzCore *core, ut64 addr);
RZ_API bool rz_core_cmpwatch_update(RzCore *core, ut64 addr);
Expand Down
2 changes: 1 addition & 1 deletion librz/include/rz_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ typedef struct rz_config_hold_t {
} RzConfigHold;

#ifdef RZ_API
RZ_API RzConfigHold *rz_config_hold_new(RzConfig *cfg);
RZ_API RZ_OWN RzConfigHold *rz_config_hold_new(RzConfig *cfg);
RZ_API void rz_config_hold_free(RzConfigHold *h);

RZ_API bool rz_config_hold_i(RzConfigHold *h, ...);
Expand Down
2 changes: 1 addition & 1 deletion librz/include/rz_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static inline int rz_hash_plugin_cmp(RZ_NULLABLE const RzHashPlugin *a, RZ_NULLA

#ifdef RZ_API

RZ_API RzHash *rz_hash_new(void);
RZ_API RZ_OWN RzHash *rz_hash_new(void);
RZ_API void rz_hash_free(RZ_NULLABLE RzHash *rh);
RZ_API bool rz_hash_plugin_add(RZ_NONNULL RzHash *rh, RZ_NONNULL RZ_OWN RzHashPlugin *plugin);
RZ_API bool rz_hash_plugin_del(RZ_NONNULL RzHash *rh, RZ_NONNULL RzHashPlugin *plugin);
Expand Down
10 changes: 5 additions & 5 deletions librz/include/rz_il/definitions/bool.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ typedef struct rz_il_bool_t {
bool b;
} RzILBool;

RZ_API RzILBool *rz_il_bool_new(bool true_or_false);
RZ_API RzILBool *rz_il_bool_and(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b);
RZ_API RzILBool *rz_il_bool_or(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b);
RZ_API RzILBool *rz_il_bool_xor(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b);
RZ_API RzILBool *rz_il_bool_not(RZ_NONNULL RzILBool *a);
RZ_API RZ_OWN RzILBool *rz_il_bool_new(bool true_or_false);
RZ_API RZ_OWN RzILBool *rz_il_bool_and(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b);
RZ_API RZ_OWN RzILBool *rz_il_bool_or(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b);
RZ_API RZ_OWN RzILBool *rz_il_bool_xor(RZ_NONNULL RzILBool *a, RZ_NONNULL RzILBool *b);
RZ_API RZ_OWN RzILBool *rz_il_bool_not(RZ_NONNULL RzILBool *a);
RZ_API void rz_il_bool_free(RzILBool *bool_var);

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion librz/include/rz_il/definitions/label.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ typedef struct rz_il_effect_label_t {

RZ_API RzILEffectLabel *rz_il_effect_label_new(RZ_NONNULL const char *name, RzILEffectLabelType type);
RZ_API void rz_il_effect_label_free(RzILEffectLabel *lbl);
RZ_API RzILEffectLabel *rz_il_effect_label_dup(RZ_NONNULL RzILEffectLabel *lbl);
RZ_API RZ_OWN RzILEffectLabel *rz_il_effect_label_dup(RZ_NONNULL RzILEffectLabel *lbl);

#ifdef __cplusplus
}
Expand Down
4 changes: 2 additions & 2 deletions librz/include/rz_il/definitions/mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ RZ_API RZ_OWN RzILMem *rz_il_mem_new_borrowed(RZ_NONNULL RZ_BORROW RzBuffer *buf
RZ_API void rz_il_mem_free(RzILMem *mem);
RZ_API ut32 rz_il_mem_key_len(RzILMem *mem);
RZ_API ut32 rz_il_mem_value_len(RzILMem *mem);
RZ_API RzBitVector *rz_il_mem_load(RzILMem *mem, RzBitVector *key);
RZ_API RZ_OWN RzBitVector *rz_il_mem_load(RzILMem *mem, RzBitVector *key);
RZ_API bool rz_il_mem_store(RzILMem *mem, RzBitVector *key, RzBitVector *value);
RZ_API RzBitVector *rz_il_mem_loadw(RzILMem *mem, RzBitVector *key, ut32 n_bits, bool big_endian);
RZ_API RZ_OWN RzBitVector *rz_il_mem_loadw(RzILMem *mem, RzBitVector *key, ut32 n_bits, bool big_endian);
RZ_API bool rz_il_mem_storew(RzILMem *mem, RzBitVector *key, RzBitVector *value, bool big_endian);

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion librz/include/rz_il/rz_il_opcodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ typedef RzILOpBitVector *(rz_il_pure_2args_op)(RzILOpBitVector *, RzILOpBitVecto
typedef RzILOpBitVector *(rz_il_pure_3args_op)(RzILOpBitVector *, RzILOpBitVector *, RzILOpBitVector *);

RZ_API void rz_il_op_pure_free(RZ_NULLABLE RzILOpPure *op);
RZ_API RzILOpPure *rz_il_op_pure_dup(RZ_NONNULL RzILOpPure *op);
RZ_API RZ_OWN RzILOpPure *rz_il_op_pure_dup(RZ_NONNULL RzILOpPure *op);

RZ_API RZ_OWN RzILOpPure *rz_il_op_new_ite(RZ_NONNULL RzILOpPure *condition, RZ_NULLABLE RzILOpPure *x, RZ_NULLABLE RzILOpPure *y);
RZ_API RZ_OWN RzILOpPure *rz_il_op_new_var(RZ_NONNULL const char *var, RzILVarKind kind);
Expand Down
2 changes: 1 addition & 1 deletion librz/include/rz_il/rz_il_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ typedef struct rz_il_reg_binding_t {

struct rz_il_vm_t;

RZ_API RzILRegBinding *rz_il_reg_binding_derive(RZ_NONNULL RzReg *reg);
RZ_API RZ_OWN RzILRegBinding *rz_il_reg_binding_derive(RZ_NONNULL RzReg *reg);
RZ_API RzILRegBinding *rz_il_reg_binding_exactly(RZ_NONNULL RzReg *reg, size_t regs_count, RZ_NONNULL RZ_BORROW const char **regs);
RZ_API void rz_il_reg_binding_free(RzILRegBinding *rb);

Expand Down
4 changes: 2 additions & 2 deletions librz/include/rz_il/rz_il_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ typedef char *RzILValidateReport;
*/
typedef struct rz_il_validate_global_context_t RzILValidateGlobalContext;

RZ_API RzILValidateGlobalContext *rz_il_validate_global_context_new_empty(ut32 pc_len);
RZ_API RZ_OWN RzILValidateGlobalContext *rz_il_validate_global_context_new_empty(ut32 pc_len);
RZ_API void rz_il_validate_global_context_add_var(RzILValidateGlobalContext *ctx, RZ_NONNULL const char *name, RzILSortPure sort);
RZ_API void rz_il_validate_global_context_add_mem(RzILValidateGlobalContext *ctx, RzILMemIndex idx, ut32 key_len, ut32 val_len);
RZ_API RzILValidateGlobalContext *rz_il_validate_global_context_new_from_vm(RZ_NONNULL RzILVM *vm);
RZ_API RZ_OWN RzILValidateGlobalContext *rz_il_validate_global_context_new_from_vm(RZ_NONNULL RzILVM *vm);
RZ_API void rz_il_validate_global_context_free(RzILValidateGlobalContext *ctx);
RZ_API bool rz_il_validate_pure(RZ_NULLABLE RzILOpPure *op, RZ_NONNULL RzILValidateGlobalContext *ctx,
RZ_NULLABLE RZ_OUT RzILSortPure *sort_out, RZ_NULLABLE RZ_OUT RzILValidateReport *report_out);
Expand Down
2 changes: 1 addition & 1 deletion librz/include/rz_lang.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ typedef struct rz_lang_def_t {
} RzLangDef;

#ifdef RZ_API
RZ_API RzLang *rz_lang_new(void);
RZ_API RZ_OWN RzLang *rz_lang_new(void);
RZ_API void rz_lang_free(RzLang *lang);
RZ_API bool rz_lang_setup(RzLang *lang);
RZ_API bool rz_lang_plugin_add(RzLang *lang, RZ_NONNULL RzLangPlugin *plugin);
Expand Down
6 changes: 3 additions & 3 deletions librz/include/rz_parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ typedef struct rz_parse_plugin_t {
#ifdef RZ_API

/* lifecycle */
RZ_API RzParse *rz_parse_new(void);
RZ_API RZ_OWN RzParse *rz_parse_new(void);
RZ_API void rz_parse_free(RzParse *p);

/* plugins */
Expand All @@ -60,11 +60,11 @@ RZ_API bool rz_parse_plugin_del(RzParse *p, RZ_NONNULL RzParsePlugin *plugin);
RZ_API bool rz_parse_use(RzParse *p, const char *name);

/* action */
RZ_API char *rz_parse_pseudocode(RzParse *p, const char *data);
RZ_API RZ_OWN char *rz_parse_pseudocode(RzParse *p, const char *data);
RZ_API bool rz_parse_assemble(RzParse *p, char *data, char *str); // XXX deprecate, unused and probably useless, related to write-hack
RZ_API bool rz_parse_filter(RzParse *p, ut64 addr, RzFlag *f, RzAnalysisHint *hint, char *data, char *str, int len, bool big_endian);
RZ_API bool rz_parse_subvar(RzParse *p, RZ_NULLABLE RzAnalysisFunction *f, RZ_NONNULL RzAnalysisOp *op, RZ_NONNULL RZ_IN char *data, RZ_BORROW RZ_NONNULL RZ_OUT char *str, int len);
RZ_API char *rz_parse_immtrim(char *opstr);
RZ_API RZ_BORROW char *rz_parse_immtrim(char *opstr);

#endif

Expand Down
14 changes: 7 additions & 7 deletions librz/include/rz_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,22 @@ typedef struct rz_search_value_range_t {

#define RZ_SEARCH_AES_BOX_SIZE 31

RZ_API RzSearch *rz_search_new(int mode);
RZ_API RZ_OWN RzSearch *rz_search_new(int mode);
RZ_API int rz_search_set_mode(RzSearch *s, int mode);
RZ_API RzSearch *rz_search_free(RzSearch *s);

/* keyword management */
RZ_API RzList /*<RzSearchHit *>*/ *rz_search_find(RzSearch *s, ut64 addr, const ut8 *buf, int len);
RZ_API RZ_OWN RzList /*<RzSearchHit *>*/ *rz_search_find(RzSearch *s, ut64 addr, const ut8 *buf, int len);
RZ_API int rz_search_update(RzSearch *s, ut64 from, const ut8 *buf, long len);
RZ_API int rz_search_update_i(RzSearch *s, ut64 from, const ut8 *buf, long len);

RZ_API void rz_search_keyword_free(RzSearchKeyword *kw);
RZ_API RZ_OWN RzSearchKeyword *rz_search_keyword_new(const ut8 *kw_buf, int kw_len, RZ_NULLABLE const ut8 *bm_buf, int bm_buf_len, RZ_NULLABLE const char *data);
RZ_API RzSearchKeyword *rz_search_keyword_new_str(const char *kw, const char *bm, const char *data, int icase);
RZ_API RzSearchKeyword *rz_search_keyword_new_wide(const char *kw, const char *bm, const char *data, int icase);
RZ_API RzSearchKeyword *rz_search_keyword_new_hex(const char *kwstr, const char *bmstr, const char *data);
RZ_API RzSearchKeyword *rz_search_keyword_new_hexmask(const char *kwstr, const char *data);
RZ_API RzSearchKeyword *rz_search_keyword_new_regexp(const char *str, const char *data);
RZ_API RZ_OWN RzSearchKeyword *rz_search_keyword_new_str(const char *kw, const char *bm, const char *data, int icase);
RZ_API RZ_OWN RzSearchKeyword *rz_search_keyword_new_wide(const char *kw, const char *bm, const char *data, int icase);
RZ_API RZ_OWN RzSearchKeyword *rz_search_keyword_new_hex(const char *kwstr, const char *bmstr, const char *data);
RZ_API RZ_OWN RzSearchKeyword *rz_search_keyword_new_hexmask(const char *kwstr, const char *data);
RZ_API RZ_OWN RzSearchKeyword *rz_search_keyword_new_regexp(const char *str, const char *data);

RZ_API int rz_search_kw_add(RzSearch *s, RzSearchKeyword *kw);
RZ_API void rz_search_reset(RzSearch *s, int mode);
Expand Down
2 changes: 1 addition & 1 deletion librz/include/rz_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ typedef struct rz_type_format_t {

#ifdef RZ_API

RZ_API RzTypeDB *rz_type_db_new();
RZ_API RZ_OWN RzTypeDB *rz_type_db_new();
RZ_API void rz_type_db_free(RzTypeDB *typedb);
RZ_API bool rz_type_db_load_sdb(RzTypeDB *typedb, RZ_NONNULL const char *path);
RZ_API bool rz_type_db_load_sdb_str(RzTypeDB *typedb, RZ_NONNULL const char *str);
Expand Down
2 changes: 1 addition & 1 deletion librz/include/rz_util/rz_annotated_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ typedef struct rz_annotated_code_t {
* @param code A deallocatable character array.
* @return Pointer to the new RzAnnotatedCode structure created.
*/
RZ_API RzAnnotatedCode *rz_annotated_code_new(char *code);
RZ_API RZ_OWN RzAnnotatedCode *rz_annotated_code_new(char *code);
/**
* @brief Deallocates the dynamically allocated memory for the specified RzAnnotatedCode.
*
Expand Down
Loading
Loading