Rename RStrBuf to RzStrBuf
This commit is contained in:
parent
778978022b
commit
b8bf83b856
89 changed files with 303 additions and 303 deletions
|
|
@ -70,7 +70,7 @@ static char *read_string_val(char **nextline, const char *val, ut64 *linenum) {
|
|||
eprintf ("Error: End token must be \"EOF\", got \"%s\" instead.", endtoken);
|
||||
return NULL;
|
||||
}
|
||||
RStrBuf *buf = rz_strbuf_new ("");
|
||||
RzStrBuf *buf = rz_strbuf_new ("");
|
||||
char *line = *nextline;
|
||||
size_t linesz = 0;
|
||||
do {
|
||||
|
|
@ -596,7 +596,7 @@ static bool database_load(RzTestDatabase *db, const char *path, int depth) {
|
|||
}
|
||||
RzListIter *it;
|
||||
const char *subname;
|
||||
RStrBuf subpath;
|
||||
RzStrBuf subpath;
|
||||
rz_strbuf_init (&subpath);
|
||||
bool ret = true;
|
||||
rz_list_foreach (dir, it, subname) {
|
||||
|
|
@ -735,7 +735,7 @@ RZ_API bool rz_test_test_database_load_fuzz(RzTestDatabase *db, const char *path
|
|||
}
|
||||
RzListIter *it;
|
||||
const char *subname;
|
||||
RStrBuf subpath;
|
||||
RzStrBuf subpath;
|
||||
rz_strbuf_init (&subpath);
|
||||
bool ret = true;
|
||||
rz_list_foreach (dir, it, subname) {
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ struct rz_test_subprocess_t {
|
|||
HANDLE stderr_read;
|
||||
HANDLE proc;
|
||||
int ret;
|
||||
RStrBuf out;
|
||||
RStrBuf err;
|
||||
RzStrBuf out;
|
||||
RzStrBuf err;
|
||||
};
|
||||
|
||||
static volatile long pipe_id = 0;
|
||||
|
|
@ -381,8 +381,8 @@ struct rz_test_subprocess_t {
|
|||
int stderr_fd;
|
||||
int killpipe[2];
|
||||
int ret;
|
||||
RStrBuf out;
|
||||
RStrBuf err;
|
||||
RzStrBuf out;
|
||||
RzStrBuf err;
|
||||
};
|
||||
|
||||
static RzPVector subprocs;
|
||||
|
|
@ -1032,7 +1032,7 @@ RZ_API RzAsmTestOutput *rz_test_run_asm_test(RzTestRunConfig *config, RzAsmTest
|
|||
rz_pvector_push (&args, offset);
|
||||
}
|
||||
|
||||
RStrBuf cmd_buf;
|
||||
RzStrBuf cmd_buf;
|
||||
rz_strbuf_init (&cmd_buf);
|
||||
if (test->mode & RZ_ASM_TEST_MODE_ASSEMBLE) {
|
||||
rz_pvector_push (&args, test->disasm);
|
||||
|
|
|
|||
|
|
@ -813,7 +813,7 @@ beach:
|
|||
}
|
||||
|
||||
static char *format_cmd_kv(const char *key, const char *val) {
|
||||
RStrBuf buf;
|
||||
RzStrBuf buf;
|
||||
rz_strbuf_init (&buf);
|
||||
rz_strbuf_appendf (&buf, "%s=", key);
|
||||
if (strchr (val, '\n')) {
|
||||
|
|
@ -849,7 +849,7 @@ static char *replace_lines(const char *src, size_t from, size_t to, const char *
|
|||
line++;
|
||||
}
|
||||
|
||||
RStrBuf buf;
|
||||
RzStrBuf buf;
|
||||
rz_strbuf_init (&buf);
|
||||
rz_strbuf_append_n (&buf, src, begin - src);
|
||||
rz_strbuf_append (&buf, news);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
RZ_API void rz_anal_cc_del(RzAnal *anal, const char *name) {
|
||||
size_t i;
|
||||
RStrBuf sb;
|
||||
RzStrBuf sb;
|
||||
sdb_unset (DB, rz_strbuf_initf (&sb, "%s", name), 0);
|
||||
sdb_unset (DB, rz_strbuf_setf (&sb, "cc.%s.ret", name), 0);
|
||||
sdb_unset (DB, rz_strbuf_setf (&sb, "cc.%s.argn", name), 0);
|
||||
|
|
@ -80,7 +80,7 @@ RZ_API char *rz_anal_cc_get(RzAnal *anal, const char *name) {
|
|||
eprintf ("Cannot find return key\n");
|
||||
return NULL;
|
||||
}
|
||||
RStrBuf *sb = rz_strbuf_new (NULL);
|
||||
RzStrBuf *sb = rz_strbuf_new (NULL);
|
||||
const char *self = rz_anal_cc_self (anal, name);
|
||||
rz_strbuf_appendf (sb, "%s %s%s%s (", ret, self? self: "", self? ".": "", name);
|
||||
bool isFirst = true;
|
||||
|
|
@ -141,7 +141,7 @@ RZ_API void rz_anal_cc_set_self(RzAnal *anal, const char *convention, const char
|
|||
if (!rz_anal_cc_exist (anal, convention)) {
|
||||
return;
|
||||
}
|
||||
RStrBuf sb;
|
||||
RzStrBuf sb;
|
||||
sdb_set (anal->sdb_cc, rz_strbuf_initf (&sb, "cc.%s.self", convention), self, 0);
|
||||
rz_strbuf_fini (&sb);
|
||||
}
|
||||
|
|
@ -157,7 +157,7 @@ RZ_API void rz_anal_cc_set_error(RzAnal *anal, const char *convention, const cha
|
|||
if (!rz_anal_cc_exist (anal, convention)) {
|
||||
return;
|
||||
}
|
||||
RStrBuf sb;
|
||||
RzStrBuf sb;
|
||||
sdb_set (anal->sdb_cc, rz_strbuf_initf (&sb, "cc.%s.error", convention), error, 0);
|
||||
rz_strbuf_fini (&sb);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ RZ_API char *rz_anal_data_to_string(RzAnalData *d, RzConsPrintablePalette *pal)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
RStrBuf *sb = rz_strbuf_new (NULL);
|
||||
RzStrBuf *sb = rz_strbuf_new (NULL);
|
||||
if (!sb || !rz_strbuf_reserve (sb, mallocsz)) {
|
||||
eprintf ("Cannot allocate %d byte(s)\n", mallocsz);
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ static RBinDwarfAttrValue *find_attr(const RBinDwarfDie *die, st32 attr_name) {
|
|||
* @param s
|
||||
* @param c
|
||||
*/
|
||||
static bool strbuf_rev_prepend_char(RStrBuf *sb, const char *s, int c) {
|
||||
static bool strbuf_rev_prepend_char(RzStrBuf *sb, const char *s, int c) {
|
||||
rz_return_val_if_fail (sb && s, false);
|
||||
size_t l = strlen (s);
|
||||
// fast path if no chars to append
|
||||
|
|
@ -123,7 +123,7 @@ static bool strbuf_rev_prepend_char(RStrBuf *sb, const char *s, int c) {
|
|||
* @param s
|
||||
* @param needle
|
||||
*/
|
||||
static bool strbuf_rev_append_char(RStrBuf *sb, const char *s, const char *needle) {
|
||||
static bool strbuf_rev_append_char(RzStrBuf *sb, const char *s, const char *needle) {
|
||||
rz_return_val_if_fail (sb && s, false);
|
||||
size_t l = strlen (s);
|
||||
// fast path if no chars to append
|
||||
|
|
@ -203,7 +203,7 @@ static ut64 get_die_size(const RBinDwarfDie *die) {
|
|||
* @param strbuf strbuf to store the type into
|
||||
* @return st32 -1 if error else 0
|
||||
*/
|
||||
static st32 parse_array_type(Context *ctx, ut64 idx, RStrBuf *strbuf) {
|
||||
static st32 parse_array_type(Context *ctx, ut64 idx, RzStrBuf *strbuf) {
|
||||
const RBinDwarfDie *die = &ctx->all_dies[idx];
|
||||
|
||||
if (die->has_children) {
|
||||
|
|
@ -254,7 +254,7 @@ static st32 parse_array_type(Context *ctx, ut64 idx, RStrBuf *strbuf) {
|
|||
* TODO make cache for type entries, one type is usually referenced
|
||||
* multiple times which means it's parsed multiple times instead of once
|
||||
*/
|
||||
static st32 parse_type (Context *ctx, const ut64 offset, RStrBuf *strbuf, ut64 *size) {
|
||||
static st32 parse_type (Context *ctx, const ut64 offset, RzStrBuf *strbuf, ut64 *size) {
|
||||
rz_return_val_if_fail (strbuf, -1);
|
||||
RBinDwarfDie *die = ht_up_find (ctx->die_map, offset, NULL);
|
||||
if (!die) {
|
||||
|
|
@ -377,7 +377,7 @@ static RzAnalStructMember *parse_struct_member (Context *ctx, ut64 idx, RzAnalSt
|
|||
char *type = NULL;
|
||||
ut64 offset = 0;
|
||||
ut64 size = 0;
|
||||
RStrBuf strbuf;
|
||||
RzStrBuf strbuf;
|
||||
rz_strbuf_init (&strbuf);
|
||||
size_t i;
|
||||
for (i = 0; i < die->count; i++) {
|
||||
|
|
@ -583,7 +583,7 @@ static void parse_enum_type(Context *ctx, ut64 idx) {
|
|||
|
||||
st32 type_attr_idx = find_attr_idx (die, DW_AT_type);
|
||||
if (type_attr_idx != -1) {
|
||||
RStrBuf strbuf;
|
||||
RzStrBuf strbuf;
|
||||
rz_strbuf_init (&strbuf);
|
||||
parse_type (ctx, die->attr_values[type_attr_idx].reference, &strbuf, &base_type->size);
|
||||
base_type->type = rz_strbuf_drain_nofree (&strbuf);
|
||||
|
|
@ -638,7 +638,7 @@ static void parse_typedef(Context *ctx, ut64 idx) {
|
|||
char *name = NULL;
|
||||
char *type = NULL;
|
||||
ut64 size = 0;
|
||||
RStrBuf strbuf;
|
||||
RzStrBuf strbuf;
|
||||
rz_strbuf_init (&strbuf);
|
||||
size_t i;
|
||||
|
||||
|
|
@ -737,7 +737,7 @@ static const char *get_specification_die_name(const RBinDwarfDie *die) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void get_spec_die_type(Context *ctx, RBinDwarfDie *die, RStrBuf *ret_type) {
|
||||
static void get_spec_die_type(Context *ctx, RBinDwarfDie *die, RzStrBuf *ret_type) {
|
||||
st32 attr_idx = find_attr_idx (die, DW_AT_type);
|
||||
if (attr_idx != -1) {
|
||||
ut64 size = 0;
|
||||
|
|
@ -756,7 +756,7 @@ static bool prefer_linkage_name(char *lang) {
|
|||
return true;
|
||||
}
|
||||
|
||||
static void parse_abstract_origin(Context *ctx, ut64 offset, RStrBuf *type, const char **name) {
|
||||
static void parse_abstract_origin(Context *ctx, ut64 offset, RzStrBuf *type, const char **name) {
|
||||
RBinDwarfDie *die = ht_up_find (ctx->die_map, offset, NULL);
|
||||
if (die) {
|
||||
size_t i;
|
||||
|
|
@ -1141,7 +1141,7 @@ static VariableLocation *parse_dwarf_location (Context *ctx, const RBinDwarfAttr
|
|||
return location;
|
||||
}
|
||||
|
||||
static st32 parse_function_args_and_vars(Context *ctx, ut64 idx, RStrBuf *args, RzList/*<Variable*>*/ *variables) {
|
||||
static st32 parse_function_args_and_vars(Context *ctx, ut64 idx, RzStrBuf *args, RzList/*<Variable*>*/ *variables) {
|
||||
const RBinDwarfDie *die = &ctx->all_dies[idx];
|
||||
|
||||
if (die->has_children) {
|
||||
|
|
@ -1154,7 +1154,7 @@ static st32 parse_function_args_and_vars(Context *ctx, ut64 idx, RStrBuf *args,
|
|||
size_t j;
|
||||
for (j = idx; child_depth > 0 && j < ctx->count; j++) {
|
||||
child_die = &ctx->all_dies[j];
|
||||
RStrBuf type;
|
||||
RzStrBuf type;
|
||||
rz_strbuf_init (&type);
|
||||
const char *name = NULL;
|
||||
if (child_die->tag == DW_TAG_formal_parameter || child_die->tag == DW_TAG_variable) {
|
||||
|
|
@ -1251,7 +1251,7 @@ static void sdb_save_dwarf_function(Function *dwarf_fcn, RzList/*<Variable*>*/ *
|
|||
sdb_set (sdb, signature_key, dwarf_fcn->signature, 0);
|
||||
free (signature_key);
|
||||
|
||||
RStrBuf vars;
|
||||
RzStrBuf vars;
|
||||
rz_strbuf_init (&vars);
|
||||
RzListIter *iter;
|
||||
Variable *var;
|
||||
|
|
@ -1328,7 +1328,7 @@ static void parse_function(Context *ctx, ut64 idx) {
|
|||
Function fcn = { 0 };
|
||||
bool has_linkage_name = false;
|
||||
bool get_linkage_name = prefer_linkage_name (ctx->lang);
|
||||
RStrBuf ret_type;
|
||||
RzStrBuf ret_type;
|
||||
rz_strbuf_init (&ret_type);
|
||||
if (find_attr_idx (die, DW_AT_declaration) != -1) {
|
||||
return; /* just declaration skip */
|
||||
|
|
@ -1393,7 +1393,7 @@ static void parse_function(Context *ctx, ut64 idx) {
|
|||
if (!fcn.name || !fcn.addr) { /* we need a name, faddr */
|
||||
goto cleanup;
|
||||
}
|
||||
RStrBuf args;
|
||||
RzStrBuf args;
|
||||
rz_strbuf_init (&args);
|
||||
/* TODO do the same for arguments in future so we can use their location */
|
||||
RzList/*<Variable*>*/ *variables = rz_list_new ();
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ bool _round_1_cb (void *user, void *data, ut32 id) {
|
|||
void _round_2_cb (RzGraphNode *n, RzGraphVisitor *vi) {
|
||||
RzAnalEsilBB *bb = (RzAnalEsilBB *)n->data;
|
||||
EsilCfgGen *gen = (EsilCfgGen *)vi->data;
|
||||
RStrBuf *buf = rz_strbuf_new ((char *)rz_id_storage_get (gen->atoms, bb->first.idx));
|
||||
RzStrBuf *buf = rz_strbuf_new ((char *)rz_id_storage_get (gen->atoms, bb->first.idx));
|
||||
rz_strbuf_append (buf, ",");
|
||||
ut32 id;
|
||||
for (id = bb->first.idx + 1; id <= bb->last.idx; id++) {
|
||||
|
|
@ -409,7 +409,7 @@ void _round_2_cb (RzGraphNode *n, RzGraphVisitor *vi) {
|
|||
// concatinates to already existing graph.
|
||||
// Also expects RIDStorage atoms and RContRBTree to be allocate in prior of the call
|
||||
static RzAnalEsilCFG *esil_cfg_gen(RzAnalEsilCFG *cfg, RzAnal *anal, RIDStorage *atoms, RContRBTree *blocks, RStack *stack, ut64 off, char *expr) {
|
||||
// consider expr as RStrBuf, so that we can sanitze broken esil
|
||||
// consider expr as RzStrBuf, so that we can sanitze broken esil
|
||||
// (ex: "b,a,+=,$z,zf,:=,7,$c,cf,:=,zf,?{,1,b,+=,cf,?{,3,a,-=" =>
|
||||
// "b,a,+=,$z,zf,:=,7,$c,cf,:=,zf,?{,1,b,+=,cf,?{,3,a,-=,},}")
|
||||
|
||||
|
|
@ -484,7 +484,7 @@ static RzAnalEsilCFG *esil_cfg_gen(RzAnalEsilCFG *cfg, RzAnal *anal, RIDStorage
|
|||
|
||||
// next do dfs:
|
||||
// - remove each node from blocks-tree, that can be reached by a dfs path
|
||||
// - when removing a node from block-tree, synthesize node->bb->expr with RStrBuf
|
||||
// - when removing a node from block-tree, synthesize node->bb->expr with RzStrBuf
|
||||
{
|
||||
// dfs walk removes used atoms
|
||||
RzGraphVisitor vi = { _round_2_cb, NULL, NULL, NULL, NULL, &gen };
|
||||
|
|
@ -580,7 +580,7 @@ RZ_API RzAnalEsilCFG *rz_anal_esil_cfg_op(RzAnalEsilCFG *cfg, RzAnal *anal, RzAn
|
|||
eprintf ("Couldn't allocate glue_bb\n");
|
||||
return NULL;
|
||||
}
|
||||
RStrBuf *glue = rz_strbuf_new ("");
|
||||
RzStrBuf *glue = rz_strbuf_new ("");
|
||||
if (!glue) {
|
||||
free (glue_bb);
|
||||
eprintf ("Couldn't allocate glue\n");
|
||||
|
|
@ -639,7 +639,7 @@ static void merge_2_blocks(RzAnalEsilCFG *cfg, RzGraphNode *node, RzGraphNode *b
|
|||
} else {
|
||||
node_bb->enter = RZ_ANAL_ESIL_BLOCK_ENTER_NORMAL;
|
||||
}
|
||||
RStrBuf *buf = rz_strbuf_new (block_bb->expr);
|
||||
RzStrBuf *buf = rz_strbuf_new (block_bb->expr);
|
||||
node_bb->first = block_bb->first;
|
||||
rz_graph_del_node (cfg->g, block);
|
||||
rz_strbuf_appendf (buf, "\n%s", node_bb->expr);
|
||||
|
|
|
|||
|
|
@ -498,9 +498,9 @@ static RzGraphNode *_edf_var_get (RzAnalEsilDFG *dfg, const char *var) {
|
|||
static bool edf_consume_2_set_reg(RzAnalEsil *esil);
|
||||
static bool edf_consume_2_push_1(RzAnalEsil *esil);
|
||||
static bool edf_consume_1_push_1(RzAnalEsil *esil);
|
||||
typedef void (*AddConstraintStringUseNewCB) (RStrBuf *result, const char *new_node_str);
|
||||
typedef void (*AddConstraintStringUseNewCB) (RzStrBuf *result, const char *new_node_str);
|
||||
static bool edf_use_new_push_1(RzAnalEsil *esil, const char *op_string, AddConstraintStringUseNewCB cb);
|
||||
typedef void (*AddConstraintStringConsume1UseOldNewCB) (RStrBuf *result, const char *consume_str, const char *old_node_str, const char *new_node_str);
|
||||
typedef void (*AddConstraintStringConsume1UseOldNewCB) (RzStrBuf *result, const char *consume_str, const char *old_node_str, const char *new_node_str);
|
||||
static bool edf_consume_1_use_old_new_push_1(RzAnalEsil *esil, const char *op_string, AddConstraintStringConsume1UseOldNewCB cb);
|
||||
|
||||
static bool edf_eq_weak(RzAnalEsil *esil) {
|
||||
|
|
@ -516,7 +516,7 @@ static bool edf_eq_weak(RzAnalEsil *esil) {
|
|||
return true;
|
||||
}
|
||||
|
||||
static void edf_zf_constraint(RStrBuf *result, const char *new_node_str) {
|
||||
static void edf_zf_constraint(RzStrBuf *result, const char *new_node_str) {
|
||||
rz_strbuf_appendf (result, ":(%s==0)", new_node_str);
|
||||
}
|
||||
|
||||
|
|
@ -524,7 +524,7 @@ static bool edf_zf(RzAnalEsil *esil) {
|
|||
return edf_use_new_push_1 (esil, "$z", edf_zf_constraint);
|
||||
}
|
||||
|
||||
static void edf_pf_constraint(RStrBuf *result, const char *new_node_str) {
|
||||
static void edf_pf_constraint(RzStrBuf *result, const char *new_node_str) {
|
||||
rz_strbuf_appendf (result, ":parity_of(%s)", new_node_str);
|
||||
}
|
||||
|
||||
|
|
@ -532,7 +532,7 @@ static bool edf_pf(RzAnalEsil *esil) {
|
|||
return edf_use_new_push_1 (esil, "$p", edf_pf_constraint);
|
||||
}
|
||||
|
||||
static void edf_cf_constraint(RStrBuf *result, const char *consume, const char *o, const char *n) {
|
||||
static void edf_cf_constraint(RzStrBuf *result, const char *consume, const char *o, const char *n) {
|
||||
rz_strbuf_appendf (result, ":((%s&mask(%s&0x3f))<(%s&mask(%s&0x3f)))",
|
||||
n, consume, o, consume);
|
||||
}
|
||||
|
|
@ -541,7 +541,7 @@ static bool edf_cf(RzAnalEsil *esil) {
|
|||
return edf_consume_1_use_old_new_push_1 (esil, "$c", edf_cf_constraint);
|
||||
}
|
||||
|
||||
static void edf_bf_constraint(RStrBuf *result, const char *consume, const char *o, const char *n) {
|
||||
static void edf_bf_constraint(RzStrBuf *result, const char *consume, const char *o, const char *n) {
|
||||
rz_strbuf_appendf (result, ":((%s&mask((%s+0x3f)&0x3f))<(%s& mask((%s+0x3f)&0x3f)))",
|
||||
o, consume, n, consume);
|
||||
}
|
||||
|
|
@ -1028,9 +1028,9 @@ static char *condrets_strtok(char *str, const char tok) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static RStrBuf *get_resolved_expr(RzAnalEsilDFGFilter *filter, RzAnalEsilDFGNode *node) {
|
||||
static RzStrBuf *get_resolved_expr(RzAnalEsilDFGFilter *filter, RzAnalEsilDFGNode *node) {
|
||||
char *expr = strdup (rz_strbuf_get (node->content));
|
||||
RStrBuf *res = rz_strbuf_new ("");
|
||||
RzStrBuf *res = rz_strbuf_new ("");
|
||||
if (!expr) { //empty expressions. can this happen?
|
||||
return res;
|
||||
}
|
||||
|
|
@ -1041,7 +1041,7 @@ static RStrBuf *get_resolved_expr(RzAnalEsilDFGFilter *filter, RzAnalEsilDFGNode
|
|||
if (!gn) {
|
||||
rz_strbuf_appendf (res, ",%s,", p);
|
||||
} else {
|
||||
RStrBuf *r = get_resolved_expr (filter, (RzAnalEsilDFGNode *)gn->data);
|
||||
RzStrBuf *r = get_resolved_expr (filter, (RzAnalEsilDFGNode *)gn->data);
|
||||
rz_strbuf_appendf (res, ",%s,", rz_strbuf_get (r));
|
||||
rz_strbuf_free (r);
|
||||
}
|
||||
|
|
@ -1051,7 +1051,7 @@ static RStrBuf *get_resolved_expr(RzAnalEsilDFGFilter *filter, RzAnalEsilDFGNode
|
|||
return res;
|
||||
}
|
||||
|
||||
RZ_API RStrBuf *rz_anal_esil_dfg_filter(RzAnalEsilDFG *dfg, const char *reg) {
|
||||
RZ_API RzStrBuf *rz_anal_esil_dfg_filter(RzAnalEsilDFG *dfg, const char *reg) {
|
||||
if (!dfg || !reg) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -1062,7 +1062,7 @@ RZ_API RStrBuf *rz_anal_esil_dfg_filter(RzAnalEsilDFG *dfg, const char *reg) {
|
|||
|
||||
// allocate stuff
|
||||
RzAnalEsilDFGFilter filter = { dfg, rz_rbtree_cont_new (), sdb_new0 () };
|
||||
RStrBuf *filtered = rz_strbuf_new ("");
|
||||
RzStrBuf *filtered = rz_strbuf_new ("");
|
||||
RzGraphVisitor vi = { _dfg_rev_dfs_cb, NULL, NULL, NULL, NULL, &filter };
|
||||
|
||||
// dfs the graph starting at node of esp-register
|
||||
|
|
@ -1072,7 +1072,7 @@ RZ_API RStrBuf *rz_anal_esil_dfg_filter(RzAnalEsilDFG *dfg, const char *reg) {
|
|||
RzAnalEsilDFGNode *node;
|
||||
rz_rbtree_cont_foreach (filter.tree, ator, node) {
|
||||
// resolve results to opstr here
|
||||
RStrBuf *resolved = get_resolved_expr (&filter, node);
|
||||
RzStrBuf *resolved = get_resolved_expr (&filter, node);
|
||||
rz_strbuf_append (filtered, rz_strbuf_get (resolved));
|
||||
rz_strbuf_free (resolved);
|
||||
}
|
||||
|
|
@ -1086,7 +1086,7 @@ RZ_API RStrBuf *rz_anal_esil_dfg_filter(RzAnalEsilDFG *dfg, const char *reg) {
|
|||
return filtered;
|
||||
}
|
||||
|
||||
RZ_API RStrBuf *rz_anal_esil_dfg_filter_expr(RzAnal *anal, const char *expr, const char *reg) {
|
||||
RZ_API RzStrBuf *rz_anal_esil_dfg_filter_expr(RzAnal *anal, const char *expr, const char *reg) {
|
||||
if (!reg) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -1094,7 +1094,7 @@ RZ_API RStrBuf *rz_anal_esil_dfg_filter_expr(RzAnal *anal, const char *expr, con
|
|||
if (!dfg) {
|
||||
return NULL;
|
||||
}
|
||||
RStrBuf *filtered = rz_anal_esil_dfg_filter (dfg, reg);
|
||||
RzStrBuf *filtered = rz_anal_esil_dfg_filter (dfg, reg);
|
||||
rz_anal_esil_dfg_free (dfg);
|
||||
return filtered;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ static const char *cc_name(arm_cc cc) {
|
|||
}
|
||||
}
|
||||
|
||||
static void opex(RStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
static void opex(RzStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
int i;
|
||||
rz_strbuf_init (buf);
|
||||
rz_strbuf_append (buf, "{");
|
||||
|
|
@ -507,7 +507,7 @@ static const char *vess_name(arm64_vess vess) {
|
|||
}
|
||||
#endif
|
||||
|
||||
static void opex64(RStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
static void opex64(RzStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
int i;
|
||||
rz_strbuf_init (buf);
|
||||
rz_strbuf_append (buf, "{");
|
||||
|
|
@ -873,7 +873,7 @@ static const char *arg(RzAnal *a, csh *handle, cs_insn *insn, char *buf, int n)
|
|||
#define SHIFTED_REG64_APPEND(sb, n) shifted_reg64_append(sb, handle, insn, n)
|
||||
|
||||
// do the sign extension here as well, but honestly this whole thing should maybe be redesigned
|
||||
static void shifted_reg64_append(RStrBuf *sb, csh *handle, cs_insn *insn, int n) {
|
||||
static void shifted_reg64_append(RzStrBuf *sb, csh *handle, cs_insn *insn, int n) {
|
||||
int signext = EXT64(n);
|
||||
const char *rn;
|
||||
|
||||
|
|
|
|||
|
|
@ -234,8 +234,8 @@ static CPU_CONST *const_by_value(CPU_MODEL *cpu, int type, ut32 v) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static RStrBuf *__generic_io_dest(ut8 port, int write, CPU_MODEL *cpu) {
|
||||
RStrBuf *r = rz_strbuf_new ("");
|
||||
static RzStrBuf *__generic_io_dest(ut8 port, int write, CPU_MODEL *cpu) {
|
||||
RzStrBuf *r = rz_strbuf_new ("");
|
||||
CPU_CONST *c = const_by_value (cpu, CPU_CONST_REG, port);
|
||||
if (c != NULL) {
|
||||
rz_strbuf_set (r, c->key);
|
||||
|
|
@ -492,7 +492,7 @@ INST_HANDLER (cbi) { // CBI A, b
|
|||
}
|
||||
int a = (buf[0] >> 3) & 0x1f;
|
||||
int b = buf[0] & 0x07;
|
||||
RStrBuf *io_port;
|
||||
RzStrBuf *io_port;
|
||||
|
||||
op->family = RZ_ANAL_OP_FAMILY_IO;
|
||||
op->type2 = 1;
|
||||
|
|
@ -741,7 +741,7 @@ INST_HANDLER (in) { // IN Rd, A
|
|||
}
|
||||
int r = ((buf[0] >> 4) & 0x0f) | ((buf[1] & 0x01) << 4);
|
||||
int a = (buf[0] & 0x0f) | ((buf[1] & 0x6) << 3);
|
||||
RStrBuf *io_src = __generic_io_dest (a, 0, cpu);
|
||||
RzStrBuf *io_src = __generic_io_dest (a, 0, cpu);
|
||||
op->type2 = 0;
|
||||
op->val = a;
|
||||
op->family = RZ_ANAL_OP_FAMILY_IO;
|
||||
|
|
@ -1089,7 +1089,7 @@ INST_HANDLER (out) { // OUT A, Rr
|
|||
}
|
||||
int r = ((buf[0] >> 4) & 0x0f) | ((buf[1] & 0x01) << 4);
|
||||
int a = (buf[0] & 0x0f) | ((buf[1] & 0x6) << 3);
|
||||
RStrBuf *io_dst = __generic_io_dest (a, 1, cpu);
|
||||
RzStrBuf *io_dst = __generic_io_dest (a, 1, cpu);
|
||||
op->type2 = 1;
|
||||
op->val = a;
|
||||
op->family = RZ_ANAL_OP_FAMILY_IO;
|
||||
|
|
@ -1267,7 +1267,7 @@ INST_HANDLER (sbi) { // SBI A, b
|
|||
}
|
||||
int a = (buf[0] >> 3) & 0x1f;
|
||||
int b = buf[0] & 0x07;
|
||||
RStrBuf *io_port;
|
||||
RzStrBuf *io_port;
|
||||
|
||||
op->type2 = 1;
|
||||
op->val = a;
|
||||
|
|
@ -1292,7 +1292,7 @@ INST_HANDLER (sbix) { // SBIC A, b
|
|||
int a = (buf[0] >> 3) & 0x1f;
|
||||
int b = buf[0] & 0x07;
|
||||
RzAnalOp next_op = { 0 };
|
||||
RStrBuf *io_port;
|
||||
RzStrBuf *io_port;
|
||||
|
||||
op->type2 = 0;
|
||||
op->val = a;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ static inline void handle_jump_instruction(RzAnalOp *op, ut64 addr, cs_m68k *m68
|
|||
op->fail = make_64bits_address (addr + op->size);
|
||||
}
|
||||
|
||||
static void opex(RStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
static void opex(RzStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
int i;
|
||||
rz_strbuf_init (buf);
|
||||
rz_strbuf_append (buf, "{");
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ static inline void es_add_ck(RzAnalOp *op, const char *a1, const char *a2, const
|
|||
ARG(1), REG(0));\
|
||||
}
|
||||
|
||||
static void opex(RStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
static void opex(RzStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
int i;
|
||||
rz_strbuf_init (buf);
|
||||
rz_strbuf_append (buf, "{");
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ static const char* getspr(struct Getarg *gop, int n) {
|
|||
return cspr;
|
||||
}
|
||||
|
||||
static void opex(RStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
static void opex(RzStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
int i;
|
||||
rz_strbuf_init (buf);
|
||||
rz_strbuf_append (buf, "{");
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@
|
|||
ARG(1), REG(0));\
|
||||
}
|
||||
|
||||
static void opex(RStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
static void opex(RzStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
int i;
|
||||
rz_strbuf_init (buf);
|
||||
rz_strbuf_append (buf, "{");
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#define INSOP(n) insn->detail->sparc.operands[n]
|
||||
#define INSCC insn->detail->sparc.cc
|
||||
|
||||
static void opex(RStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
static void opex(RzStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
int i;
|
||||
rz_strbuf_init (buf);
|
||||
rz_strbuf_append (buf, "{");
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#define esilprintf(op, fmt, ...) rz_strbuf_setf (&op->esil, fmt, ##__VA_ARGS__)
|
||||
#define INSOP(n) insn->detail->sysz.operands[n]
|
||||
|
||||
static void opex(RStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
static void opex(RzStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
int i;
|
||||
rz_strbuf_init (buf);
|
||||
rz_strbuf_append (buf, "{");
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
#define INSOP(n) insn->detail->tms320c64x.operands[n]
|
||||
#define INSCC insn->detail->tms320c64x.cc
|
||||
|
||||
static void opex(RStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
static void opex(RzStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
int i;
|
||||
rz_strbuf_init (buf);
|
||||
rz_strbuf_append (buf, "{");
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ static void hidden_op(cs_insn *insn, cs_x86 *x, int mode) {
|
|||
}
|
||||
}
|
||||
|
||||
static void opex(RStrBuf *buf, cs_insn *insn, int mode) {
|
||||
static void opex(RzStrBuf *buf, cs_insn *insn, int mode) {
|
||||
int i;
|
||||
rz_strbuf_init (buf);
|
||||
rz_strbuf_append (buf, "{");
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#define esilprintf(op, fmt, ...) rz_strbuf_setf (&op->esil, fmt, ##__VA_ARGS__)
|
||||
#define INSOP(n) insn->detail->xcore.operands[n]
|
||||
|
||||
static void opex(RStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
static void opex(RzStrBuf *buf, csh handle, cs_insn *insn) {
|
||||
int i;
|
||||
rz_strbuf_init (buf);
|
||||
rz_strbuf_append (buf, "{");
|
||||
|
|
|
|||
|
|
@ -663,7 +663,7 @@ static void xtensa_check_stack_op(xtensa_isa isa, xtensa_opcode opcode, xtensa_f
|
|||
}
|
||||
}
|
||||
|
||||
static void esil_push_signed_imm(RStrBuf * esil, st32 imm) {
|
||||
static void esil_push_signed_imm(RzStrBuf * esil, st32 imm) {
|
||||
if (imm >= 0) {
|
||||
rz_strbuf_appendf (esil, "0x%x" CM, imm);
|
||||
} else {
|
||||
|
|
@ -677,7 +677,7 @@ static void esil_push_signed_imm(RStrBuf * esil, st32 imm) {
|
|||
}
|
||||
}
|
||||
|
||||
static void esil_sign_extend(RStrBuf *esil, ut8 bit) {
|
||||
static void esil_sign_extend(RzStrBuf *esil, ut8 bit) {
|
||||
// check sign bit, and, if needed, apply or mask
|
||||
|
||||
ut32 bit_mask = 1 << bit;
|
||||
|
|
|
|||
|
|
@ -457,7 +457,7 @@ static void serialize(RzAnal *a, RzSignItem *it, char *k, char *v) {
|
|||
types = rz_str_append (types, type);
|
||||
i++;
|
||||
}
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
if (bytes) {
|
||||
// TODO: do not hardcoded s,b,m here, use RzSignType enum
|
||||
rz_strbuf_appendf (sb, "|s:%d|b:%s|m:%s", bytes->size, hexbytes, hexmask);
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ static RzAnalBaseType *get_atomic_type(RzAnal *anal, const char *sname) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
RStrBuf key;
|
||||
RzStrBuf key;
|
||||
base_type->size = sdb_num_get (anal->sdb_types, rz_strbuf_initf (&key, "type.%s.size", sname), 0);
|
||||
rz_strbuf_fini (&key);
|
||||
|
||||
|
|
@ -373,9 +373,9 @@ static void save_struct(const RzAnal *anal, const RzAnalBaseType *type) {
|
|||
// name=struct
|
||||
sdb_set (anal->sdb_types, sname, kind, 0);
|
||||
|
||||
RStrBuf arglist;
|
||||
RStrBuf param_key;
|
||||
RStrBuf param_val;
|
||||
RzStrBuf arglist;
|
||||
RzStrBuf param_key;
|
||||
RzStrBuf param_val;
|
||||
rz_strbuf_init (&arglist);
|
||||
rz_strbuf_init (¶m_key);
|
||||
rz_strbuf_init (¶m_val);
|
||||
|
|
@ -422,9 +422,9 @@ static void save_union(const RzAnal *anal, const RzAnalBaseType *type) {
|
|||
// name=union
|
||||
sdb_set (anal->sdb_types, sname, kind, 0);
|
||||
|
||||
RStrBuf arglist;
|
||||
RStrBuf param_key;
|
||||
RStrBuf param_val;
|
||||
RzStrBuf arglist;
|
||||
RzStrBuf param_key;
|
||||
RzStrBuf param_val;
|
||||
rz_strbuf_init (&arglist);
|
||||
rz_strbuf_init (¶m_key);
|
||||
rz_strbuf_init (¶m_val);
|
||||
|
|
@ -472,9 +472,9 @@ static void save_enum(const RzAnal *anal, const RzAnalBaseType *type) {
|
|||
char *sname = rz_str_sanitize_sdb_key (type->name);
|
||||
sdb_set (anal->sdb_types, sname, "enum", 0);
|
||||
|
||||
RStrBuf arglist;
|
||||
RStrBuf param_key;
|
||||
RStrBuf param_val;
|
||||
RzStrBuf arglist;
|
||||
RzStrBuf param_key;
|
||||
RzStrBuf param_val;
|
||||
rz_strbuf_init (&arglist);
|
||||
rz_strbuf_init (¶m_key);
|
||||
rz_strbuf_init (¶m_val);
|
||||
|
|
@ -520,8 +520,8 @@ static void save_atomic_type(const RzAnal *anal, const RzAnalBaseType *type) {
|
|||
char *sname = rz_str_sanitize_sdb_key (type->name);
|
||||
sdb_set (anal->sdb_types, sname, "type", 0);
|
||||
|
||||
RStrBuf key;
|
||||
RStrBuf val;
|
||||
RzStrBuf key;
|
||||
RzStrBuf val;
|
||||
rz_strbuf_init (&key);
|
||||
rz_strbuf_init (&val);
|
||||
|
||||
|
|
@ -550,8 +550,8 @@ static void save_typedef(const RzAnal *anal, const RzAnalBaseType *type) {
|
|||
char *sname = rz_str_sanitize_sdb_key (type->name);
|
||||
sdb_set (anal->sdb_types, sname, "typedef", 0);
|
||||
|
||||
RStrBuf key;
|
||||
RStrBuf val;
|
||||
RzStrBuf key;
|
||||
RzStrBuf val;
|
||||
rz_strbuf_init (&key);
|
||||
rz_strbuf_init (&val);
|
||||
|
||||
|
|
|
|||
|
|
@ -529,7 +529,7 @@ RZ_API char *rz_anal_var_get_constraints_readable(RzAnalVar *var) {
|
|||
return NULL;
|
||||
}
|
||||
bool low = false, high = false;
|
||||
RStrBuf sb;
|
||||
RzStrBuf sb;
|
||||
rz_strbuf_init (&sb);
|
||||
size_t i;
|
||||
for (i = 0; i < n; i += 1) {
|
||||
|
|
@ -1393,7 +1393,7 @@ RZ_API char *rz_anal_fcn_format_sig(RZ_NONNULL RzAnal *anal, RZ_NONNULL RzAnalFu
|
|||
}
|
||||
}
|
||||
|
||||
RStrBuf *buf = rz_strbuf_new (NULL);
|
||||
RzStrBuf *buf = rz_strbuf_new (NULL);
|
||||
if (!buf) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ static char *generic_array_obj_to_string(RzList *l) {
|
|||
RzListIter *iter = NULL;
|
||||
pyc_object *e = NULL;
|
||||
|
||||
RStrBuf *rbuf = rz_strbuf_new (NULL);
|
||||
RzStrBuf *rbuf = rz_strbuf_new (NULL);
|
||||
|
||||
rz_list_foreach (l, iter, e) {
|
||||
rz_strbuf_append (rbuf, e->data);
|
||||
|
|
|
|||
|
|
@ -474,7 +474,7 @@ RZ_IPI int wasm_asm(const char *str, unsigned char *buf, int buf_len) {
|
|||
|
||||
// disassemble an instruction from the given buffer.
|
||||
RZ_IPI int wasm_dis(WasmOp *op, const unsigned char *buf, int buf_len) {
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
int id = buf[0];
|
||||
if (id < 0xc0) {
|
||||
op->type = WASM_TYPE_OP_CORE;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ static char *directives[] = {
|
|||
|
||||
static RzAsmPlugin *asm_static_plugins[] = { RZ_ASM_STATIC_PLUGINS };
|
||||
|
||||
static void parseHeap(RzParse *p, RStrBuf *s) {
|
||||
static void parseHeap(RzParse *p, RzStrBuf *s) {
|
||||
char *op_buf_asm = rz_strbuf_get (s);
|
||||
size_t len = rz_strbuf_length (s);
|
||||
char *out = malloc (64 + (len * 2));
|
||||
|
|
@ -510,7 +510,7 @@ static Ase findAssembler(RzAsm *a, const char *kw) {
|
|||
}
|
||||
|
||||
static char *replace_directives_for(char *str, char *token) {
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
char *p = NULL;
|
||||
char *q = str;
|
||||
bool changes = false;
|
||||
|
|
@ -607,11 +607,11 @@ RZ_API int rz_asm_assemble(RzAsm *a, RzAsmOp *op, const char *buf) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
// TODO: Use RStrBuf api here pls
|
||||
// TODO: Use RzStrBuf api here pls
|
||||
RZ_API RzAsmCode* rz_asm_mdisassemble(RzAsm *a, const ut8 *buf, int len) {
|
||||
rz_return_val_if_fail (a && buf && len >= 0, NULL);
|
||||
|
||||
RStrBuf *buf_asm;
|
||||
RzStrBuf *buf_asm;
|
||||
RzAsmCode *acode;
|
||||
ut64 pc = a->pc;
|
||||
RzAsmOp op;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ int ARCompact_decodeInstr (bfd_vma address, disassemble_info * info);
|
|||
|
||||
/* ugly globals */
|
||||
static ut32 Offset = 0;
|
||||
static RStrBuf *buf_global = NULL;
|
||||
static RzStrBuf *buf_global = NULL;
|
||||
static int buf_len = 0;
|
||||
static ut8 bytes[32] = {0};
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ static const struct arm_arch_option_table arm_archs[] = {
|
|||
|
||||
static int arm_mode = 0;
|
||||
static unsigned long Offset = 0;
|
||||
static RStrBuf *buf_global = NULL;
|
||||
static RzStrBuf *buf_global = NULL;
|
||||
static unsigned char bytes[8];
|
||||
|
||||
static int arm_buffer_read_memory(bfd_vma memaddr, bfd_byte *myaddr,
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ http://developer.axis.com/old/documentation/hw/etraxfs/iop_howto/iop_howto.pdf
|
|||
|
||||
|
||||
static unsigned long Offset = 0;
|
||||
static RStrBuf *buf_global = NULL;
|
||||
static RzStrBuf *buf_global = NULL;
|
||||
static unsigned char bytes[8];
|
||||
|
||||
static int cris_buffer_read_memory (bfd_vma memaddr, bfd_byte *myaddr, ut32 length, struct disassemble_info *info) {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
|
||||
static unsigned long Offset = 0;
|
||||
static RStrBuf *buf_global = NULL;
|
||||
static RzStrBuf *buf_global = NULL;
|
||||
static unsigned char bytes[4];
|
||||
|
||||
static int hppa_buffer_read_memory (bfd_vma memaddr, bfd_byte *myaddr, ut32 length, struct disassemble_info *info) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "disas-asm.h"
|
||||
|
||||
static unsigned long Offset = 0;
|
||||
static RStrBuf *buf_global = NULL;
|
||||
static RzStrBuf *buf_global = NULL;
|
||||
static unsigned char bytes[4];
|
||||
|
||||
static int lanai_buffer_read_memory(bfd_vma memaddr, bfd_byte *myaddr, ut32 length, struct disassemble_info *info) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include <rz_lib.h>
|
||||
#include "../arch/mcs96/mcs96.h"
|
||||
|
||||
static int mcs96_len (const ut8 *buf, int len, RStrBuf *asm_buf) {
|
||||
static int mcs96_len (const ut8 *buf, int len, RzStrBuf *asm_buf) {
|
||||
int ret = 1;
|
||||
if (buf[0] == 0xfe) {
|
||||
if (len < 2) {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ int mips_assemble(const char *str, ut64 pc, ut8 *out);
|
|||
|
||||
static int mips_mode = 0;
|
||||
static unsigned long Offset = 0;
|
||||
static RStrBuf *buf_global = NULL;
|
||||
static RzStrBuf *buf_global = NULL;
|
||||
static unsigned char bytes[4];
|
||||
static char *pre_cpu = NULL;
|
||||
static char *pre_features = NULL;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
int print_insn_big_nios2 (bfd_vma address, disassemble_info *info);
|
||||
int print_insn_little_nios2 (bfd_vma address, disassemble_info *info);
|
||||
static unsigned long Offset = 0;
|
||||
static RStrBuf *buf_global = NULL;
|
||||
static RzStrBuf *buf_global = NULL;
|
||||
static unsigned char bytes[4];
|
||||
|
||||
static int nios2_buffer_read_memory (bfd_vma memaddr, bfd_byte *myaddr, ut32 length, struct disassemble_info *info) {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
|
||||
static unsigned long Offset = 0;
|
||||
static RStrBuf *buf_global = NULL;
|
||||
static RzStrBuf *buf_global = NULL;
|
||||
static unsigned char bytes[4];
|
||||
|
||||
static int ppc_buffer_read_memory (bfd_vma memaddr, bfd_byte *myaddr, ut32 length, struct disassemble_info *info) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "disas-asm.h"
|
||||
|
||||
static unsigned long Offset = 0;
|
||||
static RStrBuf *buf_global = NULL;
|
||||
static RzStrBuf *buf_global = NULL;
|
||||
static unsigned char bytes[4];
|
||||
|
||||
static int sh_buffer_read_memory (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length, struct disassemble_info *info) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include <mybfd.h>
|
||||
|
||||
static unsigned long Offset = 0;
|
||||
static RStrBuf *buf_global = NULL;
|
||||
static RzStrBuf *buf_global = NULL;
|
||||
static unsigned char bytes[4];
|
||||
|
||||
static int sparc_buffer_read_memory (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length, struct disassemble_info *info) {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
|
||||
static unsigned long Offset = 0;
|
||||
static RStrBuf *buf_global = NULL;
|
||||
static RzStrBuf *buf_global = NULL;
|
||||
static ut8 bytes[128];
|
||||
enum {
|
||||
TRICORE_GENERIC = 0x00000000,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#include "../arch/vax/vax.h"
|
||||
|
||||
static unsigned long Offset = 0;
|
||||
static RStrBuf *buf_global = NULL;
|
||||
static RzStrBuf *buf_global = NULL;
|
||||
static const ut8 *bytes = NULL;
|
||||
static int bytes_size = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#define INSN_BUFFER_SIZE 4
|
||||
|
||||
static ut64 offset = 0;
|
||||
static RStrBuf *buf_global = NULL;
|
||||
static RzStrBuf *buf_global = NULL;
|
||||
static ut8 bytes[INSN_BUFFER_SIZE];
|
||||
|
||||
static int xtensa_buffer_read_memory (bfd_vma memaddr, bfd_byte *myaddr, ut32 length, struct disassemble_info *info) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ static char *mnemonics(RzAsm *a, int id, bool json) {
|
|||
}
|
||||
return name? strdup (name): NULL;
|
||||
}
|
||||
RStrBuf *buf = rz_strbuf_new ("");
|
||||
RzStrBuf *buf = rz_strbuf_new ("");
|
||||
if (json) {
|
||||
rz_strbuf_append (buf, "[");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ static char *dex_get_proto(RBinDexObj *bin, int proto_id) {
|
|||
typeidx_bufsize = bin->size - params_off;
|
||||
eprintf ("Warning: truncated typeidx buffer\n");
|
||||
}
|
||||
RStrBuf *sig = rz_strbuf_new ("(");
|
||||
RzStrBuf *sig = rz_strbuf_new ("(");
|
||||
if (typeidx_bufsize > 0) {
|
||||
ut8 *typeidx_buf = malloc (typeidx_bufsize);
|
||||
if (!typeidx_buf || !rz_buf_read_at (bin->b, params_off + 4, typeidx_buf, typeidx_bufsize)) {
|
||||
|
|
|
|||
|
|
@ -801,7 +801,7 @@ static int simple_type_to_format (const SLF_SIMPLE_TYPE *simple_type, char **mem
|
|||
* @param names buffer for the member names
|
||||
* @return int -1 if it can't build the format
|
||||
*/
|
||||
static int build_member_format(STypeInfo *type_info, RStrBuf *format, RStrBuf *names) {
|
||||
static int build_member_format(STypeInfo *type_info, RzStrBuf *format, RzStrBuf *names) {
|
||||
rz_return_val_if_fail (type_info && format && names && type_info->type_info, -1);
|
||||
// THOUGHT: instead of not doing anything for unknown types I can just skip the bytes
|
||||
// format is 2 chars tops + null terminator
|
||||
|
|
@ -1250,9 +1250,9 @@ static void print_types_format(const RPdb *pdb, const RzList *types) {
|
|||
type_info->get_members (type_info, &members);
|
||||
}
|
||||
// pf.name <format chars> <member names>
|
||||
RStrBuf format;
|
||||
RzStrBuf format;
|
||||
rz_strbuf_init (&format);
|
||||
RStrBuf member_names;
|
||||
RzStrBuf member_names;
|
||||
rz_strbuf_init (&member_names);
|
||||
|
||||
if (type_info->leaf_type == eLF_UNION) {
|
||||
|
|
|
|||
|
|
@ -1685,7 +1685,7 @@ static void get_array_print_type(void *type, char **name) {
|
|||
if (ti->get_val) {
|
||||
ti->get_val (ti, &size);
|
||||
}
|
||||
RStrBuf buff;
|
||||
RzStrBuf buff;
|
||||
rz_strbuf_init (&buff);
|
||||
if (tmp_name) {
|
||||
rz_strbuf_append (&buff, tmp_name);
|
||||
|
|
@ -1715,7 +1715,7 @@ static void get_pointer_print_type(void *type, char **name) {
|
|||
ti->get_print_type (ti, &tmp_name);
|
||||
}
|
||||
|
||||
RStrBuf buff;
|
||||
RzStrBuf buff;
|
||||
rz_strbuf_init (&buff);
|
||||
if (tmp_name) {
|
||||
rz_strbuf_append (&buff, tmp_name);
|
||||
|
|
@ -1747,7 +1747,7 @@ static void get_modifier_print_type(void *type, char **name) {
|
|||
}
|
||||
|
||||
SLF_MODIFIER *modifier = stype_info->type_info;
|
||||
RStrBuf buff;
|
||||
RzStrBuf buff;
|
||||
rz_strbuf_init (&buff);
|
||||
if (modifier->umodifier.bits.const_) {
|
||||
rz_strbuf_append (&buff, "const ");
|
||||
|
|
@ -1852,7 +1852,7 @@ static void get_enum_print_type(void *type, char **name) {
|
|||
ti->get_print_type (ti, &tmp_name);
|
||||
}
|
||||
|
||||
RStrBuf buff;
|
||||
RzStrBuf buff;
|
||||
rz_strbuf_init (&buff);
|
||||
rz_strbuf_append (&buff, "enum ");
|
||||
if (tmp_name) {
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ static const char *set_attr(RzConsCanvas *c, const char *s) {
|
|||
|
||||
const int slen = p - s;
|
||||
if (slen > 0) {
|
||||
RStrBuf tmp;
|
||||
RzStrBuf tmp;
|
||||
rz_strbuf_init (&tmp);
|
||||
rz_strbuf_append_n (&tmp, s, slen);
|
||||
c->attr = rz_str_constpool_get (&c->constpool, rz_strbuf_get (&tmp));
|
||||
|
|
@ -509,7 +509,7 @@ RZ_API void rz_cons_canvas_circle(RzConsCanvas *c, int x, int y, int w, int h, c
|
|||
RZ_API void rz_cons_canvas_box(RzConsCanvas *c, int x, int y, int w, int h, const char *color) {
|
||||
const char *hline = useUtf8? RUNECODESTR_LINE_HORIZ : "-";
|
||||
const char *vtmp = useUtf8? RUNECODESTR_LINE_VERT : "|";
|
||||
RStrBuf *vline = rz_strbuf_new (NULL);
|
||||
RzStrBuf *vline = rz_strbuf_new (NULL);
|
||||
rz_strbuf_appendf (vline, Color_RESET"%s%s", color, vtmp);
|
||||
const char *tl_corner = useUtf8 ? (useUtf8Curvy ? RUNECODESTR_CURVE_CORNER_TL : RUNECODESTR_CORNER_TL) : ".";
|
||||
const char *tr_corner = useUtf8 ? (useUtf8Curvy ? RUNECODESTR_CURVE_CORNER_TR : RUNECODESTR_CORNER_TR) : ".";
|
||||
|
|
|
|||
|
|
@ -853,7 +853,7 @@ static bool lastMatters(void) {
|
|||
}
|
||||
|
||||
RZ_API void rz_cons_echo(const char *msg) {
|
||||
static RStrBuf *echodata = NULL; // TODO: move into RzConsInstance? maybe nope
|
||||
static RzStrBuf *echodata = NULL; // TODO: move into RzConsInstance? maybe nope
|
||||
if (msg) {
|
||||
if (echodata) {
|
||||
rz_strbuf_append (echodata, msg);
|
||||
|
|
|
|||
|
|
@ -562,7 +562,7 @@ RZ_API void rz_cons_grepbuf(void) {
|
|||
cons->context->buffer = malloc (cons->context->buffer_len);
|
||||
cons->context->buffer[0] = 0;
|
||||
}
|
||||
RStrBuf *ob = rz_strbuf_new ("");
|
||||
RzStrBuf *ob = rz_strbuf_new ("");
|
||||
// if we modify cons->lines we should update I.context->buffer too
|
||||
cons->lines = 0;
|
||||
// used to count lines and change negative grep.line values
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ RZ_API char *rz_cons_html_filter(const char *ptr, int *newlen) {
|
|||
if (!ptr) {
|
||||
return NULL;
|
||||
}
|
||||
RStrBuf *res = rz_strbuf_new ("");
|
||||
RzStrBuf *res = rz_strbuf_new ("");
|
||||
if (!res) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ static void __var_retype(RzAnal *anal, RzAnalVar *var, const char *vname, const
|
|||
// except for "void *", since "void *" => "char *" is possible
|
||||
return;
|
||||
}
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
if (pfx) {
|
||||
if (is_default && strncmp (var->type, "signed", 6)) {
|
||||
rz_strbuf_setf (sb, "%s %s", type, tmp);
|
||||
|
|
|
|||
|
|
@ -5953,7 +5953,7 @@ RZ_API void rz_core_anal_esil_graph(RzCore *core, const char *expr) {
|
|||
RzAnalEsilDFG * edf = rz_anal_esil_dfg_expr(core->anal, NULL, expr);
|
||||
RzListIter *iter, *ator;
|
||||
RzGraphNode *node, *edon;
|
||||
RStrBuf *buf = rz_strbuf_new ("");
|
||||
RzStrBuf *buf = rz_strbuf_new ("");
|
||||
rz_cons_printf ("ag-\n");
|
||||
rz_list_foreach (rz_graph_get_nodes (edf->flow), iter, node) {
|
||||
const RzAnalEsilDFGNode *enode = (RzAnalEsilDFGNode *)node->data;
|
||||
|
|
|
|||
|
|
@ -518,7 +518,7 @@ static void _print_strings(RzCore *r, RzList *list, int mode, int va) {
|
|||
}
|
||||
}
|
||||
|
||||
RStrBuf *buf = rz_strbuf_new (str);
|
||||
RzStrBuf *buf = rz_strbuf_new (str);
|
||||
switch (string->type) {
|
||||
case RZ_STRING_TYPE_UTF8:
|
||||
case RZ_STRING_TYPE_WIDE:
|
||||
|
|
@ -1523,7 +1523,7 @@ static char *resolveModuleOrdinal(Sdb *sdb, const char *module, int ordinal) {
|
|||
|
||||
// name can be optionally used to explicitly set the used base name (for example for demangling), otherwise the import name will be used.
|
||||
static char *construct_reloc_name(RZ_NONNULL RBinReloc *reloc, RZ_NULLABLE const char *name) {
|
||||
RStrBuf *buf = rz_strbuf_new ("");
|
||||
RzStrBuf *buf = rz_strbuf_new ("");
|
||||
|
||||
// (optional) libname_
|
||||
if (reloc->import && reloc->import->libname) {
|
||||
|
|
@ -1809,7 +1809,7 @@ static int bin_relocs(RzCore *r, int mode, int va) {
|
|||
}
|
||||
}
|
||||
char *reloc_name = construct_reloc_name (reloc, name);
|
||||
RStrBuf *buf = rz_strbuf_new (reloc_name ? reloc_name : "");
|
||||
RzStrBuf *buf = rz_strbuf_new (reloc_name ? reloc_name : "");
|
||||
free (reloc_name);
|
||||
RZ_FREE (name);
|
||||
if (reloc->addend) {
|
||||
|
|
@ -4421,7 +4421,7 @@ RZ_API int rz_core_bin_list(RzCore *core, int mode) {
|
|||
RZ_API char *rz_core_bin_method_flags_str(ut64 flags, int mode) {
|
||||
int i, len = 0;
|
||||
|
||||
RStrBuf *buf = rz_strbuf_new ("");
|
||||
RzStrBuf *buf = rz_strbuf_new ("");
|
||||
if (IS_MODE_SET (mode) || IS_MODE_RAD (mode)) {
|
||||
if (!flags) {
|
||||
goto out;
|
||||
|
|
|
|||
|
|
@ -4881,7 +4881,7 @@ static char *do_handle_ts_unescape_arg(struct tsr2cmd_state *state, TSNode arg,
|
|||
return res;
|
||||
} else if (is_ts_concatenation (arg)) {
|
||||
uint32_t i, n_children = ts_node_named_child_count (arg);
|
||||
RStrBuf *sb = rz_strbuf_new (NULL);
|
||||
RzStrBuf *sb = rz_strbuf_new (NULL);
|
||||
for (i = 0; i < n_children; i++) {
|
||||
TSNode sub_arg = ts_node_named_child (arg, i);
|
||||
char *s = do_handle_ts_unescape_arg (state, sub_arg, do_unwrap);
|
||||
|
|
@ -6472,7 +6472,7 @@ DEFINE_HANDLE_TS_FCN_AND_SYMBOL(grep_command) {
|
|||
char *arg_str = ts_node_handle_arg (state, node, arg, 1);
|
||||
RzCmdStatus res = handle_ts_command (state, command);
|
||||
RZ_LOG_DEBUG ("grep_command specifier: '%s'\n", arg_str);
|
||||
RStrBuf *sb = rz_strbuf_new (arg_str);
|
||||
RzStrBuf *sb = rz_strbuf_new (arg_str);
|
||||
rz_strbuf_prepend (sb, "~");
|
||||
char *specifier_str = rz_cons_grep_strip (rz_strbuf_get (sb), "`");
|
||||
rz_strbuf_free (sb);
|
||||
|
|
|
|||
|
|
@ -865,7 +865,7 @@ static void __add_vars_sdb(RzCore *core, RzAnalFunction *fcn) {
|
|||
rz_list_join (all_vars, cache.bvars);
|
||||
rz_list_join (all_vars, cache.svars);
|
||||
|
||||
RStrBuf key, value;
|
||||
RzStrBuf key, value;
|
||||
rz_strbuf_init (&key);
|
||||
rz_strbuf_init (&value);
|
||||
|
||||
|
|
@ -2224,7 +2224,7 @@ static RzList *get_xrefs(RzAnalBlock *block) {
|
|||
static char *fcnjoin(RzList *list) {
|
||||
RzAnalFunction *n;
|
||||
RzListIter *iter;
|
||||
RStrBuf buf;
|
||||
RzStrBuf buf;
|
||||
rz_strbuf_init (&buf);
|
||||
rz_list_foreach (list, iter, n) {
|
||||
rz_strbuf_appendf (&buf, " 0x%08" PFMT64x, n->addr);
|
||||
|
|
@ -2237,7 +2237,7 @@ static char *fcnjoin(RzList *list) {
|
|||
static char *ut64join(RzList *list) {
|
||||
ut64 *n;
|
||||
RzListIter *iter;
|
||||
RStrBuf buf;
|
||||
RzStrBuf buf;
|
||||
rz_strbuf_init (&buf);
|
||||
rz_list_foreach (list, iter, n) {
|
||||
rz_strbuf_appendf (&buf, " 0x%08" PFMT64x, *n);
|
||||
|
|
@ -3869,7 +3869,7 @@ static int cmd_anal_fcn(RzCore *core, const char *input) {
|
|||
}
|
||||
case 'r': { // "afcr"
|
||||
int i;
|
||||
RStrBuf *json_buf = rz_strbuf_new ("{");
|
||||
RzStrBuf *json_buf = rz_strbuf_new ("{");
|
||||
bool json = input[3] == 'j';
|
||||
|
||||
char *cmd = rz_str_newf ("cc.%s.ret", fcn->cc);
|
||||
|
|
@ -6834,7 +6834,7 @@ static void cmd_anal_opcode(RzCore *core, const char *input) {
|
|||
if (ret > 0) {
|
||||
const char *arg = input + 2;
|
||||
const char *expr = RZ_STRBUF_SAFEGET (&aop.esil);
|
||||
RStrBuf *b = rz_anal_esil_dfg_filter_expr (core->anal, expr, arg);
|
||||
RzStrBuf *b = rz_anal_esil_dfg_filter_expr (core->anal, expr, arg);
|
||||
if (b) {
|
||||
char *s = rz_strbuf_drain (b);
|
||||
rz_cons_printf ("%s\n", s);
|
||||
|
|
@ -10413,7 +10413,7 @@ static void cmd_anal_classes(RzCore *core, const char *input) {
|
|||
}
|
||||
}
|
||||
|
||||
static void show_reg_args(RzCore *core, int nargs, RStrBuf *sb) {
|
||||
static void show_reg_args(RzCore *core, int nargs, RzStrBuf *sb) {
|
||||
int i;
|
||||
char regname[8];
|
||||
if (nargs < 0) {
|
||||
|
|
@ -10450,7 +10450,7 @@ static void cmd_anal_aC(RzCore *core, const char *input) {
|
|||
eprintf ("Usage: aC[e] [addr-of-call] # analyze call args (aCe does esil emulation with abte)\n");
|
||||
return;
|
||||
}
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
ut64 pcv = rz_num_math (core->num, iarg);
|
||||
if (input[0] == 'e') { // "aCe"
|
||||
is_aCer = (input[1] == '*');
|
||||
|
|
|
|||
|
|
@ -450,17 +450,17 @@ static size_t strlen0(const char *s) {
|
|||
return s? strlen (s): 0;
|
||||
}
|
||||
|
||||
static size_t strbuf_append_calc(RStrBuf *sb, const char *s) {
|
||||
static size_t strbuf_append_calc(RzStrBuf *sb, const char *s) {
|
||||
rz_strbuf_append (sb, s);
|
||||
return strlen (s);
|
||||
}
|
||||
|
||||
static size_t fill_children_chars(RStrBuf *sb, RzCmdDesc *cd) {
|
||||
static size_t fill_children_chars(RzStrBuf *sb, RzCmdDesc *cd) {
|
||||
if (cd->help->options) {
|
||||
return strbuf_append_calc (sb, cd->help->options);
|
||||
}
|
||||
|
||||
RStrBuf csb;
|
||||
RzStrBuf csb;
|
||||
rz_strbuf_init (&csb);
|
||||
|
||||
void **it;
|
||||
|
|
@ -502,7 +502,7 @@ static bool show_children_shortcut(RzCmdDesc *cd) {
|
|||
return cd->n_children || cd->help->options || cd->type == RZ_CMD_DESC_TYPE_OLDINPUT;
|
||||
}
|
||||
|
||||
static void fill_wrapped_comment(RzCmd *cmd, RStrBuf *sb, const char *comment, size_t columns) {
|
||||
static void fill_wrapped_comment(RzCmd *cmd, RzStrBuf *sb, const char *comment, size_t columns) {
|
||||
int rows, cols;
|
||||
bool is_interactive = false;
|
||||
if (cmd->has_cons) {
|
||||
|
|
@ -531,7 +531,7 @@ static void fill_wrapped_comment(RzCmd *cmd, RStrBuf *sb, const char *comment, s
|
|||
}
|
||||
}
|
||||
|
||||
static void fill_usage_strbuf(RzCmd *cmd, RStrBuf *sb, RzCmdDesc *cd, bool use_color) {
|
||||
static void fill_usage_strbuf(RzCmd *cmd, RzStrBuf *sb, RzCmdDesc *cd, bool use_color) {
|
||||
const char *pal_label_color = "",
|
||||
*pal_args_color = "",
|
||||
*pal_input_color = "",
|
||||
|
|
@ -581,7 +581,7 @@ static size_t calc_padding_len(RzCmdDesc *cd) {
|
|||
size_t args_len = 0;
|
||||
size_t children_length = 0;
|
||||
if (show_children_shortcut (cd)) {
|
||||
RStrBuf sb;
|
||||
RzStrBuf sb;
|
||||
rz_strbuf_init (&sb);
|
||||
fill_children_chars (&sb, cd);
|
||||
children_length += rz_strbuf_length (&sb);
|
||||
|
|
@ -599,7 +599,7 @@ static void update_minmax_len(RzCmdDesc *cd, size_t *max_len, size_t *min_len) {
|
|||
*min_len = val < *min_len? val: *min_len;
|
||||
}
|
||||
|
||||
static void print_child_help(RzCmd *cmd, RStrBuf *sb, RzCmdDesc *cd, size_t max_len, bool use_color) {
|
||||
static void print_child_help(RzCmd *cmd, RzStrBuf *sb, RzCmdDesc *cd, size_t max_len, bool use_color) {
|
||||
size_t str_len = calc_padding_len (cd);
|
||||
size_t padding = str_len < max_len? max_len - str_len: 0;
|
||||
const char *cd_summary = cd->help->summary? cd->help->summary: "";
|
||||
|
|
@ -639,7 +639,7 @@ static void print_child_help(RzCmd *cmd, RStrBuf *sb, RzCmdDesc *cd, size_t max_
|
|||
}
|
||||
|
||||
static char *group_get_help(RzCmd *cmd, RzCmdDesc *cd, bool use_color) {
|
||||
RStrBuf *sb = rz_strbuf_new (NULL);
|
||||
RzStrBuf *sb = rz_strbuf_new (NULL);
|
||||
fill_usage_strbuf (cmd, sb, cd, use_color);
|
||||
|
||||
void **it_cd;
|
||||
|
|
@ -660,7 +660,7 @@ static char *group_get_help(RzCmd *cmd, RzCmdDesc *cd, bool use_color) {
|
|||
return rz_strbuf_drain (sb);
|
||||
}
|
||||
|
||||
static void fill_details(RzCmd *cmd, RzCmdDesc *cd, RStrBuf *sb, bool use_color) {
|
||||
static void fill_details(RzCmd *cmd, RzCmdDesc *cd, RzStrBuf *sb, bool use_color) {
|
||||
if (!cd->help->details) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -720,7 +720,7 @@ static void fill_details(RzCmd *cmd, RzCmdDesc *cd, RStrBuf *sb, bool use_color)
|
|||
}
|
||||
|
||||
static char *argv_get_help(RzCmd *cmd, RzCmdDesc *cd, size_t detail, bool use_color) {
|
||||
RStrBuf *sb = rz_strbuf_new (NULL);
|
||||
RzStrBuf *sb = rz_strbuf_new (NULL);
|
||||
|
||||
fill_usage_strbuf (cmd, sb, cd, use_color);
|
||||
|
||||
|
|
@ -1356,7 +1356,7 @@ RZ_API bool rz_cmd_parsed_args_setcmd(RzCmdParsedArgs *a, const char *cmd) {
|
|||
return true;
|
||||
}
|
||||
|
||||
static void parsed_args_iterateargs(RzCmdParsedArgs *a, RStrBuf *sb) {
|
||||
static void parsed_args_iterateargs(RzCmdParsedArgs *a, RzStrBuf *sb) {
|
||||
int i;
|
||||
for (i = 1; i < a->argc; i++) {
|
||||
if (i > 1) {
|
||||
|
|
@ -1368,14 +1368,14 @@ static void parsed_args_iterateargs(RzCmdParsedArgs *a, RStrBuf *sb) {
|
|||
|
||||
RZ_API char *rz_cmd_parsed_args_argstr(RzCmdParsedArgs *a) {
|
||||
rz_return_val_if_fail (a && a->argv && a->argv[0], NULL);
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
parsed_args_iterateargs (a, sb);
|
||||
return rz_strbuf_drain (sb);
|
||||
}
|
||||
|
||||
RZ_API char *rz_cmd_parsed_args_execstr(RzCmdParsedArgs *a) {
|
||||
rz_return_val_if_fail (a && a->argv && a->argv[0], NULL);
|
||||
RStrBuf *sb = rz_strbuf_new (a->argv[0]);
|
||||
RzStrBuf *sb = rz_strbuf_new (a->argv[0]);
|
||||
if (a->argc > 1 && a->has_space_after_cmd) {
|
||||
rz_strbuf_append (sb, " ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1193,7 +1193,7 @@ static void cmd_print_fromage(RzCore *core, const char *input, const ut8* data,
|
|||
{
|
||||
RX509Certificate* x509 = rz_x509_parse_certificate (rz_asn1_create_object (data, size, data));
|
||||
if (x509) {
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
rz_x509_certificate_dump (x509, NULL, sb);
|
||||
char *res = rz_strbuf_drain (sb);
|
||||
if (res) {
|
||||
|
|
@ -4411,7 +4411,7 @@ static void print_json_string(RzCore *core, const char* block, int len, const ch
|
|||
}
|
||||
|
||||
static char *__op_refs(RzCore *core, RzAnalOp *op, int n) {
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
if (n) {
|
||||
// RzList *list = rz_anal_xrefs_get_from (core->anal, op->addr);
|
||||
RzList *list = rz_anal_xrefs_get (core->anal, op->addr);
|
||||
|
|
|
|||
|
|
@ -1957,7 +1957,7 @@ static char *rz_core_anal_hasrefs_to_depth(RzCore *core, ut64 value, int depth)
|
|||
if (depth < 1 || value == UT64_MAX) {
|
||||
return NULL;
|
||||
}
|
||||
RStrBuf *s = rz_strbuf_new (NULL);
|
||||
RzStrBuf *s = rz_strbuf_new (NULL);
|
||||
char *mapname = NULL;
|
||||
RzFlagItem *fi = rz_flag_get_i (core->flags, value);
|
||||
ut64 type = rz_core_anal_address (core, value);
|
||||
|
|
|
|||
|
|
@ -569,7 +569,7 @@ static void __delegate_show_all_decompiler_cb(void *user, RPanel *panel, const R
|
|||
static void __del_menu(RzCore *core);
|
||||
static void __clear_panels_menu(RzCore *core);
|
||||
static void __clear_panels_menuRec(RPanelsMenuItem *pmi);
|
||||
static RStrBuf *__draw_menu(RzCore *core, RPanelsMenuItem *item);
|
||||
static RzStrBuf *__draw_menu(RzCore *core, RPanelsMenuItem *item);
|
||||
static void __handle_menu(RzCore *core, const int key);
|
||||
static int cmpstr(const void *_a, const void *_b);
|
||||
static RzList *__sorted_list(RzCore *core, char *menu[], int count);
|
||||
|
|
@ -1079,8 +1079,8 @@ void __update_help_contents(RzCore *core, RPanel *panel) {
|
|||
|
||||
void __update_help_title(RzCore *core, RPanel *panel) {
|
||||
RzConsCanvas *can = core->panels->can;
|
||||
RStrBuf *title = rz_strbuf_new (NULL);
|
||||
RStrBuf *cache_title = rz_strbuf_new (NULL);
|
||||
RzStrBuf *title = rz_strbuf_new (NULL);
|
||||
RzStrBuf *cache_title = rz_strbuf_new (NULL);
|
||||
if (__check_if_cur_panel (core, panel)) {
|
||||
rz_strbuf_setf (title, "%s[X] %s"Color_RESET,
|
||||
core->cons->context->pal.graph_box2, panel->model->title);
|
||||
|
|
@ -1147,8 +1147,8 @@ void __update_panel_contents(RzCore *core, RPanel *panel, const char *cmdstr) {
|
|||
|
||||
void __update_panel_title(RzCore *core, RPanel *panel) {
|
||||
RzConsCanvas *can = core->panels->can;
|
||||
RStrBuf *title = rz_strbuf_new (NULL);
|
||||
RStrBuf *cache_title = rz_strbuf_new (NULL);
|
||||
RzStrBuf *title = rz_strbuf_new (NULL);
|
||||
RzStrBuf *cache_title = rz_strbuf_new (NULL);
|
||||
char *cmd_title = __apply_filter_cmd (core, panel);
|
||||
if (__check_if_cur_panel (core, panel)) {
|
||||
if (!strcmp (panel->model->title, cmd_title)) {
|
||||
|
|
@ -1521,7 +1521,7 @@ ut64 __parse_string_on_cursor(RzCore *core, RPanel *panel, int idx) {
|
|||
if (!panel->model->cmdStrCache) {
|
||||
return UT64_MAX;
|
||||
}
|
||||
RStrBuf *buf = rz_strbuf_new (NULL);
|
||||
RzStrBuf *buf = rz_strbuf_new (NULL);
|
||||
char *s = panel->model->cmdStrCache;
|
||||
int l = 0;
|
||||
while (RZ_STR_ISNOTEMPTY (s) && l != idx) {
|
||||
|
|
@ -3408,7 +3408,7 @@ int __config_toggle_cb(void *user) {
|
|||
RPanelsMenu *menu = core->panels->panels_menu;
|
||||
RPanelsMenuItem *parent = menu->history[menu->depth - 1];
|
||||
RPanelsMenuItem *child = parent->sub[parent->selectedIndex];
|
||||
RStrBuf *tmp = rz_strbuf_new (child->name);
|
||||
RzStrBuf *tmp = rz_strbuf_new (child->name);
|
||||
(void)rz_str_split (rz_strbuf_get (tmp), ':');
|
||||
rz_config_toggle (core->config, rz_strbuf_get (tmp));
|
||||
rz_strbuf_free (tmp);
|
||||
|
|
@ -3434,7 +3434,7 @@ int __config_value_cb(void *user) {
|
|||
RPanelsMenu *menu = core->panels->panels_menu;
|
||||
RPanelsMenuItem *parent = menu->history[menu->depth - 1];
|
||||
RPanelsMenuItem *child = parent->sub[parent->selectedIndex];
|
||||
RStrBuf *tmp = rz_strbuf_new (child->name);
|
||||
RzStrBuf *tmp = rz_strbuf_new (child->name);
|
||||
(void)rz_str_split (rz_strbuf_get(tmp), ':');
|
||||
const char *v = __show_status_input (core, "New value: ");
|
||||
rz_config_set (core->config, rz_strbuf_get (tmp), v);
|
||||
|
|
@ -3537,7 +3537,7 @@ int __esil_step_to_cb(void *user) {
|
|||
}
|
||||
|
||||
int __esil_step_range_cb(void *user) {
|
||||
RStrBuf *rsb = rz_strbuf_new (NULL);
|
||||
RzStrBuf *rsb = rz_strbuf_new (NULL);
|
||||
RzCore *core = (RzCore *)user;
|
||||
rz_strbuf_append (rsb, "start addr: ");
|
||||
char *s = __show_status_input (core, rz_strbuf_get (rsb));
|
||||
|
|
@ -3647,7 +3647,7 @@ void __update_help(RzCore *core, RPanels *ps) {
|
|||
for (i = 0; i < ps->n_panels; i++) {
|
||||
RPanel *p = __get_panel (ps, i);
|
||||
if (rz_str_endswith (p->model->cmd, "Help")) {
|
||||
RStrBuf *rsb = rz_strbuf_new (NULL);
|
||||
RzStrBuf *rsb = rz_strbuf_new (NULL);
|
||||
const char *title, *cmd;
|
||||
const char **msg;
|
||||
switch (ps->mode) {
|
||||
|
|
@ -4348,7 +4348,7 @@ int __open_menu_cb (void *user) {
|
|||
__set_pos (&child->p->view->pos, parent2->p->view->pos.x + parent2->p->view->pos.w - 1,
|
||||
menu->depth == 2 ? parent2->p->view->pos.y + parent2->selectedIndex : parent2->p->view->pos.y);
|
||||
}
|
||||
RStrBuf *buf = __draw_menu (core, child);
|
||||
RzStrBuf *buf = __draw_menu (core, child);
|
||||
if (!buf) {
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -4433,8 +4433,8 @@ void __del_menu(RzCore *core) {
|
|||
menu->n_refresh = menu->depth - 1;
|
||||
}
|
||||
|
||||
RStrBuf *__draw_menu(RzCore *core, RPanelsMenuItem *item) {
|
||||
RStrBuf *buf = rz_strbuf_new (NULL);
|
||||
RzStrBuf *__draw_menu(RzCore *core, RPanelsMenuItem *item) {
|
||||
RzStrBuf *buf = rz_strbuf_new (NULL);
|
||||
if (!buf) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -4453,7 +4453,7 @@ RStrBuf *__draw_menu(RzCore *core, RPanelsMenuItem *item) {
|
|||
|
||||
void __update_menu_contents(RzCore *core, RPanelsMenu *menu, RPanelsMenuItem *parent) {
|
||||
RPanel *p = parent->p;
|
||||
RStrBuf *buf = __draw_menu (core, parent);
|
||||
RzStrBuf *buf = __draw_menu (core, parent);
|
||||
if (!buf) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -4495,7 +4495,7 @@ void __init_menu_color_settings_layout (void *_core, const char *parent) {
|
|||
RzList *list = __sorted_list (core, menus_Colors, COUNT (menus_Colors));
|
||||
char *pos;
|
||||
RzListIter* iter;
|
||||
RStrBuf *buf = rz_strbuf_new (NULL);
|
||||
RzStrBuf *buf = rz_strbuf_new (NULL);
|
||||
rz_list_foreach (list, iter, pos) {
|
||||
if (pos && !strcmp (now, pos)) {
|
||||
rz_strbuf_setf (buf, "%s%s", color, pos);
|
||||
|
|
@ -4515,7 +4515,7 @@ void __init_menu_disasm_settings_layout (void *_core, const char *parent) {
|
|||
RzList *list = __sorted_list (core, menus_settings_disassembly, COUNT (menus_settings_disassembly));
|
||||
char *pos;
|
||||
RzListIter* iter;
|
||||
RStrBuf *rsb = rz_strbuf_new (NULL);
|
||||
RzStrBuf *rsb = rz_strbuf_new (NULL);
|
||||
rz_list_foreach (list, iter, pos) {
|
||||
if (!strcmp (pos, "asm")) {
|
||||
__add_menu (core, parent, pos, __open_menu_cb);
|
||||
|
|
@ -4537,7 +4537,7 @@ static void __init_menu_disasm_asm_settings_layout(void *_core, const char *pare
|
|||
RzList *list = __sorted_list (core, menus_settings_disassembly_asm, COUNT (menus_settings_disassembly_asm));
|
||||
char *pos;
|
||||
RzListIter* iter;
|
||||
RStrBuf *rsb = rz_strbuf_new (NULL);
|
||||
RzStrBuf *rsb = rz_strbuf_new (NULL);
|
||||
rz_list_foreach (list, iter, pos) {
|
||||
rz_strbuf_set (rsb, pos);
|
||||
rz_strbuf_append (rsb, ": ");
|
||||
|
|
@ -4557,7 +4557,7 @@ static void __init_menu_disasm_asm_settings_layout(void *_core, const char *pare
|
|||
|
||||
static void __init_menu_screen_settings_layout(void *_core, const char *parent) {
|
||||
RzCore *core = (RzCore *)_core;
|
||||
RStrBuf *rsb = rz_strbuf_new (NULL);
|
||||
RzStrBuf *rsb = rz_strbuf_new (NULL);
|
||||
int i = 0;
|
||||
while (menus_settings_screen[i]) {
|
||||
const char *menu = menus_settings_screen[i];
|
||||
|
|
@ -4997,7 +4997,7 @@ void __panels_refresh(RzCore *core) {
|
|||
if (!rz_cons_canvas_resize (can, w, h)) {
|
||||
return;
|
||||
}
|
||||
RStrBuf *title = rz_strbuf_new (" ");
|
||||
RzStrBuf *title = rz_strbuf_new (" ");
|
||||
bool utf8 = rz_config_get_i (core->config, "scr.utf8");
|
||||
if (firstRun) {
|
||||
rz_config_set_i (core->config, "scr.utf8", 0);
|
||||
|
|
@ -5772,7 +5772,7 @@ RZ_API bool rz_load_panels_layout(RzCore *core, const char *_name) {
|
|||
if (rz_str_endswith (cmd, "Help")) {
|
||||
p->model->title = rz_str_dup (p->model->title, "Help");
|
||||
p->model->cmd = rz_str_dup (p->model->cmd, "Help");
|
||||
RStrBuf *rsb = rz_strbuf_new (NULL);
|
||||
RzStrBuf *rsb = rz_strbuf_new (NULL);
|
||||
rz_core_visual_append_help (rsb, "Visual Ascii Art Panels", help_msg_panels);
|
||||
if (!rsb) {
|
||||
return false;
|
||||
|
|
@ -6598,7 +6598,7 @@ void __panel_prompt(const char *prompt, char *buf, int len) {
|
|||
}
|
||||
|
||||
char *get_word_from_canvas(RzCore *core, RPanels *panels, int x, int y) {
|
||||
RStrBuf rsb;
|
||||
RzStrBuf rsb;
|
||||
rz_strbuf_init (&rsb);
|
||||
char *cs = rz_cons_canvas_to_string (panels->can);
|
||||
rz_strbuf_setf (&rsb, " %s", cs);
|
||||
|
|
|
|||
|
|
@ -540,7 +540,7 @@ RZ_API void rz_core_visual_jump(RzCore *core, ut8 ch) {
|
|||
}
|
||||
}
|
||||
|
||||
RZ_API void rz_core_visual_append_help(RStrBuf *p, const char *title, const char **help) {
|
||||
RZ_API void rz_core_visual_append_help(RzStrBuf *p, const char *title, const char **help) {
|
||||
int i, max_length = 0, padding = 0;
|
||||
RzConsContext *cons_ctx = rz_cons_singleton ()->context;
|
||||
const char *pal_args_color = cons_ctx->color_mode ? cons_ctx->pal.args : "",
|
||||
|
|
@ -562,7 +562,7 @@ RZ_API void rz_core_visual_append_help(RStrBuf *p, const char *title, const char
|
|||
|
||||
static int visual_help(RzCore *core) {
|
||||
int ret = 0;
|
||||
RStrBuf *p, *q;
|
||||
RzStrBuf *p, *q;
|
||||
repeat:
|
||||
p = rz_strbuf_new (NULL);
|
||||
q = rz_strbuf_new (NULL);
|
||||
|
|
|
|||
|
|
@ -1615,7 +1615,7 @@ RZ_API int rz_core_visual_view_rop(RzCore *core) {
|
|||
(addr == UT64_MAX)? 0: addr + delta, cursearch);
|
||||
|
||||
// compute chain
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
char *msg;
|
||||
rz_list_foreach (core->ropchain, iter, msg) {
|
||||
if (core->rasm->bits == 64) {
|
||||
|
|
@ -2744,7 +2744,7 @@ static const char *help_vv_actions_visual[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
static void rz_core_vmenu_append_help (RStrBuf *p, const char **help) {
|
||||
static void rz_core_vmenu_append_help (RzStrBuf *p, const char **help) {
|
||||
int i;
|
||||
RzConsContext *cons_ctx = rz_cons_singleton ()->context;
|
||||
const char *pal_args_color = cons_ctx->color_mode ? cons_ctx->pal.args : "",
|
||||
|
|
@ -2763,7 +2763,7 @@ static ut64 rz_core_visual_anal_refresh (RzCore *core) {
|
|||
return 0LL;
|
||||
}
|
||||
ut64 addr;
|
||||
RStrBuf *buf;
|
||||
RzStrBuf *buf;
|
||||
char old[1024];
|
||||
bool color = rz_config_get_i (core->config, "scr.color");
|
||||
int h, cols = rz_cons_get_size (&h);
|
||||
|
|
@ -3011,7 +3011,7 @@ RZ_API void rz_core_visual_anal(RzCore *core, const char *input) {
|
|||
break;
|
||||
case '?':
|
||||
rz_cons_clear00 ();
|
||||
RStrBuf *buf = rz_strbuf_new ("");
|
||||
RzStrBuf *buf = rz_strbuf_new ("");
|
||||
rz_cons_println ("|Usage: vv");
|
||||
rz_core_visual_append_help (buf, "Actions supported", help_vv_actions_visual);
|
||||
rz_core_visual_append_help (buf, "Keys", help_vv_visual);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
// find a better name and move to rz_util or rz_cons?
|
||||
RZ_API char *rz_str_widget_list(void *user, RzList *list, int rows, int cur, PrintItemCallback cb) {
|
||||
void *item;
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
RzListIter *iter;
|
||||
int count = 0;
|
||||
int skip = 0;
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ RZ_API int rz_debug_thread_list(RzDebug *dbg, int pid, char fmt) {
|
|||
RzDebugPid *p;
|
||||
RzAnalFunction *fcn = NULL;
|
||||
RzDebugMap *map = NULL;
|
||||
RStrBuf *path = NULL;
|
||||
RzStrBuf *path = NULL;
|
||||
if (pid == -1) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -887,8 +887,8 @@ typedef struct rz_anal_op_t {
|
|||
RzAnalValue *src[3];
|
||||
RzAnalValue *dst;
|
||||
RzList *access; /* RzAnalValue access information */
|
||||
RStrBuf esil;
|
||||
RStrBuf opex;
|
||||
RzStrBuf esil;
|
||||
RzStrBuf opex;
|
||||
const char *reg; /* destination register */
|
||||
const char *ireg; /* register used for indirect memory computation*/
|
||||
int scale;
|
||||
|
|
@ -1281,7 +1281,7 @@ typedef struct rz_anal_esil_dfg_t {
|
|||
typedef struct rz_anal_esil_dfg_node_t {
|
||||
// add more info here
|
||||
ut32 idx;
|
||||
RStrBuf *content;
|
||||
RzStrBuf *content;
|
||||
RzAnalEsilDFGBlockType type;
|
||||
} RzAnalEsilDFGNode;
|
||||
|
||||
|
|
@ -2111,8 +2111,8 @@ RZ_API RzAnalEsilDFGNode *rz_anal_esil_dfg_node_new (RzAnalEsilDFG *edf, const c
|
|||
RZ_API RzAnalEsilDFG *rz_anal_esil_dfg_new(RzReg *regs);
|
||||
RZ_API void rz_anal_esil_dfg_free(RzAnalEsilDFG *dfg);
|
||||
RZ_API RzAnalEsilDFG *rz_anal_esil_dfg_expr(RzAnal *anal, RzAnalEsilDFG *dfg, const char *expr);
|
||||
RZ_API RStrBuf *rz_anal_esil_dfg_filter(RzAnalEsilDFG *dfg, const char *reg);
|
||||
RZ_API RStrBuf *rz_anal_esil_dfg_filter_expr(RzAnal *anal, const char *expr, const char *reg);
|
||||
RZ_API RzStrBuf *rz_anal_esil_dfg_filter(RzAnalEsilDFG *dfg, const char *reg);
|
||||
RZ_API RzStrBuf *rz_anal_esil_dfg_filter_expr(RzAnal *anal, const char *expr, const char *reg);
|
||||
RZ_API RzList *rz_anal_types_from_fcn(RzAnal *anal, RzAnalFunction *fcn);
|
||||
|
||||
RZ_API RzAnalBaseType *rz_anal_get_base_type(RzAnal *anal, const char *name);
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ typedef struct rz_asm_op_t {
|
|||
int bitsize; // instruction size in bits (or 0 if fits in 8bit bytes) // wtf why dupe this field? :D
|
||||
int payload; // size of payload (opsize = (size-payload))
|
||||
// But this is pretty slow..so maybe we should add some accessors
|
||||
RStrBuf buf;
|
||||
RStrBuf buf_asm;
|
||||
RzStrBuf buf;
|
||||
RzStrBuf buf_asm;
|
||||
RBuffer *buf_inc; // must die
|
||||
} RzAsmOp;
|
||||
|
||||
|
|
|
|||
|
|
@ -1171,7 +1171,7 @@ typedef struct {
|
|||
} RPanelsSnow;
|
||||
|
||||
typedef struct {
|
||||
RStrBuf *data;
|
||||
RzStrBuf *data;
|
||||
RPanelPos pos;
|
||||
int idx;
|
||||
int offset;
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@ RZ_API void rz_core_visual_toggle_decompiler_disasm(RzCore *core, bool for_graph
|
|||
RZ_API void rz_core_visual_applyDisMode(RzCore *core, int disMode);
|
||||
RZ_API void rz_core_visual_applyHexMode(RzCore *core, int hexMode);
|
||||
RZ_API int rz_core_visual_refs(RzCore *core, bool xref, bool fcnInsteadOfAddr);
|
||||
RZ_API void rz_core_visual_append_help(RStrBuf *p, const char *title, const char **help);
|
||||
RZ_API void rz_core_visual_append_help(RzStrBuf *p, const char *title, const char **help);
|
||||
RZ_API bool rz_core_prevop_addr(RzCore* core, ut64 start_addr, int numinstrs, ut64* prev_addr);
|
||||
RZ_API ut64 rz_core_prevop_addr_force(RzCore *core, ut64 start_addr, int numinstrs);
|
||||
RZ_API bool rz_core_visual_hudstuff(RzCore *core);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
typedef struct pj_t {
|
||||
RStrBuf sb;
|
||||
RzStrBuf sb;
|
||||
bool is_first;
|
||||
bool is_key;
|
||||
char braces[RZ_PRINT_JSON_DEPTH_LIMIT];
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ RZ_API RASN1String *rz_asn1_stringify_oid (const ut8* buffer, ut32 length);
|
|||
|
||||
RZ_API void rz_asn1_free_object (RASN1Object *object);
|
||||
// RZ_API void rz_asn1_print_object (RASN1Object *object, ut32 depth);
|
||||
RZ_API char *rz_asn1_to_string (RASN1Object *object, ut32 depth, RStrBuf *sb);
|
||||
RZ_API char *rz_asn1_to_string (RASN1Object *object, ut32 depth, RzStrBuf *sb);
|
||||
RZ_API void rz_asn1_free_string (RASN1String *string);
|
||||
RZ_API void rz_asn1_free_binary (RASN1Binary *string);
|
||||
RZ_API void asn1_setformat (int fmt);
|
||||
|
|
|
|||
|
|
@ -11,35 +11,35 @@ typedef struct {
|
|||
char *ptr; // ptr replacing buf in case strlen > sizeof(buf)
|
||||
size_t ptrlen; // string length + 1 or binary buffer size
|
||||
bool weakref; // ptr is not owned
|
||||
} RStrBuf;
|
||||
} RzStrBuf;
|
||||
|
||||
#define RZ_STRBUF_SAFEGET(sb) (rz_strbuf_get (sb) ? rz_strbuf_get (sb) : "")
|
||||
RZ_API RStrBuf *rz_strbuf_new(const char *s);
|
||||
RZ_API const char *rz_strbuf_set(RStrBuf *sb, const char *s); // return = the string or NULL on fail
|
||||
RZ_API bool rz_strbuf_slice(RStrBuf *sb, int from, int len);
|
||||
RZ_API bool rz_strbuf_setbin(RStrBuf *sb, const ut8 *s, size_t len);
|
||||
RZ_API ut8* rz_strbuf_getbin(RStrBuf *sb, int *len);
|
||||
RZ_API const char *rz_strbuf_setf(RStrBuf *sb, const char *fmt, ...); // return = the string or NULL on fail
|
||||
RZ_API const char *rz_strbuf_vsetf(RStrBuf *sb, const char *fmt, va_list ap); // return = the string or NULL on fail
|
||||
RZ_API bool rz_strbuf_append(RStrBuf *sb, const char *s);
|
||||
RZ_API bool rz_strbuf_append_n(RStrBuf *sb, const char *s, size_t l);
|
||||
RZ_API bool rz_strbuf_prepend(RStrBuf *sb, const char *s);
|
||||
RZ_API bool rz_strbuf_appendf(RStrBuf *sb, const char *fmt, ...);
|
||||
RZ_API bool rz_strbuf_vappendf(RStrBuf *sb, const char *fmt, va_list ap);
|
||||
RZ_API char *rz_strbuf_get(RStrBuf *sb);
|
||||
RZ_API char *rz_strbuf_drain(RStrBuf *sb);
|
||||
RZ_API char *rz_strbuf_drain_nofree(RStrBuf *sb);
|
||||
RZ_API int rz_strbuf_length(RStrBuf *sb);
|
||||
RZ_API int rz_strbuf_size(RStrBuf *sb);
|
||||
RZ_API void rz_strbuf_free(RStrBuf *sb);
|
||||
RZ_API void rz_strbuf_fini(RStrBuf *sb);
|
||||
RZ_API void rz_strbuf_init(RStrBuf *sb);
|
||||
RZ_API const char *rz_strbuf_initf(RStrBuf *sb, const char *fmt, ...); // same as init + setf for convenience
|
||||
RZ_API bool rz_strbuf_copy(RStrBuf *dst, RStrBuf *src);
|
||||
RZ_API bool rz_strbuf_equals(RStrBuf *sa, RStrBuf *sb);
|
||||
RZ_API bool rz_strbuf_reserve(RStrBuf *sb, size_t len);
|
||||
RZ_API bool rz_strbuf_is_empty(RStrBuf *sb);
|
||||
RZ_API bool rz_strbuf_setptr(RStrBuf *sb, char *p, int l);
|
||||
RZ_API RzStrBuf *rz_strbuf_new(const char *s);
|
||||
RZ_API const char *rz_strbuf_set(RzStrBuf *sb, const char *s); // return = the string or NULL on fail
|
||||
RZ_API bool rz_strbuf_slice(RzStrBuf *sb, int from, int len);
|
||||
RZ_API bool rz_strbuf_setbin(RzStrBuf *sb, const ut8 *s, size_t len);
|
||||
RZ_API ut8* rz_strbuf_getbin(RzStrBuf *sb, int *len);
|
||||
RZ_API const char *rz_strbuf_setf(RzStrBuf *sb, const char *fmt, ...); // return = the string or NULL on fail
|
||||
RZ_API const char *rz_strbuf_vsetf(RzStrBuf *sb, const char *fmt, va_list ap); // return = the string or NULL on fail
|
||||
RZ_API bool rz_strbuf_append(RzStrBuf *sb, const char *s);
|
||||
RZ_API bool rz_strbuf_append_n(RzStrBuf *sb, const char *s, size_t l);
|
||||
RZ_API bool rz_strbuf_prepend(RzStrBuf *sb, const char *s);
|
||||
RZ_API bool rz_strbuf_appendf(RzStrBuf *sb, const char *fmt, ...);
|
||||
RZ_API bool rz_strbuf_vappendf(RzStrBuf *sb, const char *fmt, va_list ap);
|
||||
RZ_API char *rz_strbuf_get(RzStrBuf *sb);
|
||||
RZ_API char *rz_strbuf_drain(RzStrBuf *sb);
|
||||
RZ_API char *rz_strbuf_drain_nofree(RzStrBuf *sb);
|
||||
RZ_API int rz_strbuf_length(RzStrBuf *sb);
|
||||
RZ_API int rz_strbuf_size(RzStrBuf *sb);
|
||||
RZ_API void rz_strbuf_free(RzStrBuf *sb);
|
||||
RZ_API void rz_strbuf_fini(RzStrBuf *sb);
|
||||
RZ_API void rz_strbuf_init(RzStrBuf *sb);
|
||||
RZ_API const char *rz_strbuf_initf(RzStrBuf *sb, const char *fmt, ...); // same as init + setf for convenience
|
||||
RZ_API bool rz_strbuf_copy(RzStrBuf *dst, RzStrBuf *src);
|
||||
RZ_API bool rz_strbuf_equals(RzStrBuf *sa, RzStrBuf *sb);
|
||||
RZ_API bool rz_strbuf_reserve(RzStrBuf *sb, size_t len);
|
||||
RZ_API bool rz_strbuf_is_empty(RzStrBuf *sb);
|
||||
RZ_API bool rz_strbuf_setptr(RzStrBuf *sb, char *p, int l);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ RZ_API RX509Certificate *rz_x509_parse_certificate2(const ut8 *buffer, ut32 leng
|
|||
RZ_API void rz_x509_free_certificate(RX509Certificate* certificate);
|
||||
RZ_API char *rz_x509_certificate_to_string(RX509Certificate* certificate, const char* pad);
|
||||
RZ_API void rz_x509_certificate_json(PJ* pj, RX509Certificate *certificate);
|
||||
RZ_API void rz_x509_certificate_dump(RX509Certificate* cert, const char* pad, RStrBuf *sb);
|
||||
RZ_API void rz_x509_certificate_dump(RX509Certificate* cert, const char* pad, RzStrBuf *sb);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ static int parse(RzParse *p, const char *data, char *str) {
|
|||
}
|
||||
|
||||
static void parse_localvar (RzParse *p, char *newstr, size_t newstr_len, const char *var, const char *reg, char sign, char *ireg, bool att) {
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
if (att) {
|
||||
if (p->localvar_only) {
|
||||
if (ireg) {
|
||||
|
|
@ -317,7 +317,7 @@ static void parse_localvar (RzParse *p, char *newstr, size_t newstr_len, const c
|
|||
}
|
||||
|
||||
static inline void mk_reg_str(const char *regname, int delta, bool sign, bool att, char *ireg, char *dest, int len) {
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
if (att) {
|
||||
if (ireg) {
|
||||
rz_strbuf_setf (sb, ", %%%s", ireg);
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ RZ_API bool rz_reg_set_profile(RzReg *reg, const char *profile) {
|
|||
|
||||
static char *gdb_to_rz_profile(const char *gdb) {
|
||||
rz_return_val_if_fail (gdb, NULL);
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
if (!sb) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1321,7 +1321,7 @@ RZ_API char *rz_run_get_environ_profile(char **env) {
|
|||
if (!env) {
|
||||
return NULL;
|
||||
}
|
||||
RStrBuf *sb = rz_strbuf_new (NULL);
|
||||
RzStrBuf *sb = rz_strbuf_new (NULL);
|
||||
while (*env) {
|
||||
char *k = strdup (*env);
|
||||
char *v = strchr (k, '=');
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ RZ_API void rz_asn1_print_hex (RASN1Object *object, char* buffer, ut32 size, ut3
|
|||
}
|
||||
|
||||
#if !ASN1_STD_FORMAT
|
||||
static void rz_asn1_print_padded(RStrBuf *sb, RASN1Object *object, int depth, const char *k, const char *v) {
|
||||
static void rz_asn1_print_padded(RzStrBuf *sb, RASN1Object *object, int depth, const char *k, const char *v) {
|
||||
const char *pad = rz_str_pad (' ', (depth * 2) - 2);
|
||||
if (object->form && !*v) {
|
||||
return;
|
||||
|
|
@ -222,7 +222,7 @@ static RASN1String* rz_asn1_print_hexdump_padded (RASN1Object *object, ut32 dept
|
|||
if (!object || !object->sector || object->length < 1) {
|
||||
return NULL;
|
||||
}
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
if (ASN1_STD_FORMAT) {
|
||||
pad = " : ";
|
||||
} else {
|
||||
|
|
@ -255,7 +255,7 @@ static RASN1String* rz_asn1_print_hexdump_padded (RASN1Object *object, ut32 dept
|
|||
return asn1str;
|
||||
}
|
||||
|
||||
RZ_API char *rz_asn1_to_string (RASN1Object *object, ut32 depth, RStrBuf *sb) {
|
||||
RZ_API char *rz_asn1_to_string (RASN1Object *object, ut32 depth, RzStrBuf *sb) {
|
||||
ut32 i;
|
||||
bool root = false;
|
||||
if (!object) {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ RZ_API char *rz_graph_drawable_to_dot(RzGraph /*RzGraphNodeInfo*/ *graph, const
|
|||
RzList *nodes = graph->nodes;
|
||||
RzListIter *it, *itt;
|
||||
RzGraphNode *node = NULL, *target = NULL;
|
||||
RStrBuf buf;
|
||||
RzStrBuf buf;
|
||||
rz_strbuf_init (&buf);
|
||||
rz_strbuf_appendf (&buf,
|
||||
"digraph code {\nrankdir=LR;\noutputorder=edgesfirst\ngraph [bgcolor=azure];\n"
|
||||
|
|
|
|||
|
|
@ -603,7 +603,7 @@ RZ_API RzList *rz_list_uniq(const RzList *list, RzListComparator cmp) {
|
|||
}
|
||||
RZ_API char *rz_list_to_str(RzList *list, char ch) {
|
||||
RzListIter *iter;
|
||||
RStrBuf *buf = rz_strbuf_new ("");
|
||||
RzStrBuf *buf = rz_strbuf_new ("");
|
||||
if (!buf) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
extern void rz_x509_name_json (PJ *pj, RX509Name *name);
|
||||
extern void rz_x509_free_crl (RX509CertificateRevocationList *crl);
|
||||
extern void rz_x509_crlentry_dump (RX509CRLEntry *crle, const char *pad, RStrBuf *sb);
|
||||
extern void rz_x509_crlentry_dump (RX509CRLEntry *crle, const char *pad, RzStrBuf *sb);
|
||||
static bool rz_pkcs7_parse_attributes(RPKCS7Attributes *attribute, RASN1Object *object);
|
||||
|
||||
static bool rz_pkcs7_parse_contentinfo(RPKCS7ContentInfo *ci, RASN1Object *object) {
|
||||
|
|
@ -387,7 +387,7 @@ static bool rz_pkcs7_parse_attributes(RPKCS7Attributes *attributes, RASN1Object
|
|||
|
||||
#if 0
|
||||
// XXX: unused
|
||||
static void rz_pkcs7_signerinfos_dump(RX509CertificateRevocationList *crl, const char* pad, RStrBuf *sb) {
|
||||
static void rz_pkcs7_signerinfos_dump(RX509CertificateRevocationList *crl, const char* pad, RzStrBuf *sb) {
|
||||
RASN1String *algo = NULL, *last = NULL, *next = NULL;
|
||||
ut32 i;
|
||||
char *pad2, *pad3;
|
||||
|
|
@ -416,7 +416,7 @@ static void rz_pkcs7_signerinfos_dump(RX509CertificateRevocationList *crl, const
|
|||
}
|
||||
#endif
|
||||
|
||||
static void rz_x509_signedinfo_dump(RPKCS7SignerInfo *si, const char *pad, RStrBuf *sb) {
|
||||
static void rz_x509_signedinfo_dump(RPKCS7SignerInfo *si, const char *pad, RzStrBuf *sb) {
|
||||
RASN1String *s = NULL;
|
||||
RASN1Binary *o = NULL;
|
||||
ut32 i;
|
||||
|
|
@ -480,7 +480,7 @@ RZ_API char *rz_pkcs7_cms_to_string(RCMS *container) {
|
|||
return NULL;
|
||||
}
|
||||
RPKCS7SignedData *sd = &container->signedData;
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
rz_strbuf_appendf (sb, "signedData\n Version: v%u\n Digest Algorithms:\n", sd->version);
|
||||
|
||||
if (container->signedData.digestAlgorithms.elements) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ static const char* s_wire(const ut8 byte) {
|
|||
}
|
||||
}
|
||||
|
||||
static void pad(RStrBuf *sb, ut32 count) {
|
||||
static void pad(RzStrBuf *sb, ut32 count) {
|
||||
ut32 i;
|
||||
for (i = 0; i < count; i++) {
|
||||
rz_strbuf_appendf (sb, " ");
|
||||
|
|
@ -50,7 +50,7 @@ static bool is_string(const ut8* start, const ut8* end) {
|
|||
return true;
|
||||
}
|
||||
|
||||
static void decode_array(RStrBuf *sb, const ut8* start, const ut8* end) {
|
||||
static void decode_array(RzStrBuf *sb, const ut8* start, const ut8* end) {
|
||||
while (start < end) {
|
||||
rz_strbuf_appendf (sb, "%02x ", *start);
|
||||
start++;
|
||||
|
|
@ -58,7 +58,7 @@ static void decode_array(RStrBuf *sb, const ut8* start, const ut8* end) {
|
|||
rz_strbuf_appendf (sb, "\n");
|
||||
}
|
||||
|
||||
static void decode_buffer(RStrBuf *sb, const ut8* start, const ut8* end, ut32 padcnt, bool debug) {
|
||||
static void decode_buffer(RzStrBuf *sb, const ut8* start, const ut8* end, ut32 padcnt, bool debug) {
|
||||
size_t bytes_read = 0;
|
||||
ut32 var32 = 0;
|
||||
ut64 var64 = 0;
|
||||
|
|
@ -156,7 +156,7 @@ RZ_API char *rz_protobuf_decode(const ut8* start, const ut64 size, bool debug) {
|
|||
return NULL;
|
||||
}
|
||||
const ut8* end = start + size;
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
decode_buffer (sb, start, end, 0u, debug);
|
||||
return rz_strbuf_drain (sb);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1634,7 +1634,7 @@ RZ_API char *rz_str_escape_utf8_for_json(const char *buf, int buf_size) {
|
|||
// http://daviddeley.com/autohotkey/parameters/parameters.htm#WINCRULES
|
||||
// https://docs.microsoft.com/en-us/cpp/cpp/main-function-command-line-args?redirectedfrom=MSDN&view=vs-2019#parsing-c-command-line-arguments
|
||||
RZ_API char *rz_str_format_msvc_argv(size_t argc, const char **argv) {
|
||||
RStrBuf sb;
|
||||
RzStrBuf sb;
|
||||
rz_strbuf_init (&sb);
|
||||
|
||||
size_t i;
|
||||
|
|
@ -3021,7 +3021,7 @@ RZ_API char *rz_str_repeat(const char *ch, int sz) {
|
|||
if (sz == 0) {
|
||||
return strdup ("");
|
||||
}
|
||||
RStrBuf *buf = rz_strbuf_new (ch);
|
||||
RzStrBuf *buf = rz_strbuf_new (ch);
|
||||
for (i = 1; i < sz; i++) {
|
||||
rz_strbuf_append (buf, ch);
|
||||
}
|
||||
|
|
@ -3443,7 +3443,7 @@ RZ_API void rz_str_stripLine(char *str, const char *key) {
|
|||
}
|
||||
|
||||
RZ_API char *rz_str_list_join(RzList *str, const char *sep) {
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
const char *p;
|
||||
while ((p = rz_list_pop_head (str))) {
|
||||
if (rz_strbuf_length (sb) != 0) {
|
||||
|
|
@ -3455,7 +3455,7 @@ RZ_API char *rz_str_list_join(RzList *str, const char *sep) {
|
|||
}
|
||||
|
||||
RZ_API char *rz_str_array_join(const char **a, size_t n, const char *sep) {
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
size_t i;
|
||||
|
||||
if (n > 0) {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ RZ_API char* rz_str_trim_lines(char *str) {
|
|||
RzList *list = rz_str_split_list (str, "\n", 0);
|
||||
char *s;
|
||||
RzListIter *iter;
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
rz_list_foreach (list, iter, s) {
|
||||
//rz_str_ansi_trim (s, -1, 99999);
|
||||
rz_str_ansi_filter (s, NULL, NULL, -1);
|
||||
|
|
|
|||
|
|
@ -4,15 +4,15 @@
|
|||
#include "rz_util.h"
|
||||
#include <stdio.h>
|
||||
|
||||
RZ_API RStrBuf *rz_strbuf_new(const char *str) {
|
||||
RStrBuf *s = RZ_NEW0 (RStrBuf);
|
||||
RZ_API RzStrBuf *rz_strbuf_new(const char *str) {
|
||||
RzStrBuf *s = RZ_NEW0 (RzStrBuf);
|
||||
if (str) {
|
||||
rz_strbuf_set (s, str);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
RZ_API bool rz_strbuf_equals(RStrBuf *sa, RStrBuf *sb) {
|
||||
RZ_API bool rz_strbuf_equals(RzStrBuf *sa, RzStrBuf *sb) {
|
||||
rz_return_val_if_fail (sa && sb, false);
|
||||
if (sa->len != sb->len) {
|
||||
return false;
|
||||
|
|
@ -20,21 +20,21 @@ RZ_API bool rz_strbuf_equals(RStrBuf *sa, RStrBuf *sb) {
|
|||
return strcmp (rz_strbuf_get (sa), rz_strbuf_get (sb)) == 0;
|
||||
}
|
||||
|
||||
RZ_API bool rz_strbuf_is_empty(RStrBuf *sb) {
|
||||
RZ_API bool rz_strbuf_is_empty(RzStrBuf *sb) {
|
||||
return sb->len == 0;
|
||||
}
|
||||
|
||||
RZ_API int rz_strbuf_length(RStrBuf *sb) {
|
||||
RZ_API int rz_strbuf_length(RzStrBuf *sb) {
|
||||
rz_return_val_if_fail (sb, 0);
|
||||
return sb->len;
|
||||
}
|
||||
|
||||
RZ_API void rz_strbuf_init(RStrBuf *sb) {
|
||||
RZ_API void rz_strbuf_init(RzStrBuf *sb) {
|
||||
rz_return_if_fail (sb);
|
||||
memset (sb, 0, sizeof (RStrBuf));
|
||||
memset (sb, 0, sizeof (RzStrBuf));
|
||||
}
|
||||
|
||||
RZ_API const char *rz_strbuf_initf(RStrBuf *sb, const char *fmt, ...) {
|
||||
RZ_API const char *rz_strbuf_initf(RzStrBuf *sb, const char *fmt, ...) {
|
||||
rz_return_val_if_fail (sb && fmt, NULL);
|
||||
rz_strbuf_init (sb);
|
||||
va_list ap;
|
||||
|
|
@ -44,7 +44,7 @@ RZ_API const char *rz_strbuf_initf(RStrBuf *sb, const char *fmt, ...) {
|
|||
return r;
|
||||
}
|
||||
|
||||
RZ_API bool rz_strbuf_copy(RStrBuf *dst, RStrBuf *src) {
|
||||
RZ_API bool rz_strbuf_copy(RzStrBuf *dst, RzStrBuf *src) {
|
||||
rz_return_val_if_fail (dst && src, false);
|
||||
if (src->ptr) {
|
||||
char *p = malloc (src->ptrlen);
|
||||
|
|
@ -63,7 +63,7 @@ RZ_API bool rz_strbuf_copy(RStrBuf *dst, RStrBuf *src) {
|
|||
return true;
|
||||
}
|
||||
|
||||
RZ_API bool rz_strbuf_reserve(RStrBuf *sb, size_t len) {
|
||||
RZ_API bool rz_strbuf_reserve(RzStrBuf *sb, size_t len) {
|
||||
rz_return_val_if_fail (sb, false);
|
||||
|
||||
if ((sb->ptr && len < sb->ptrlen) || (!sb->ptr && len < sizeof (sb->buf))) {
|
||||
|
|
@ -81,7 +81,7 @@ RZ_API bool rz_strbuf_reserve(RStrBuf *sb, size_t len) {
|
|||
return true;
|
||||
}
|
||||
|
||||
RZ_API bool rz_strbuf_setbin(RStrBuf *sb, const ut8 *s, size_t l) {
|
||||
RZ_API bool rz_strbuf_setbin(RzStrBuf *sb, const ut8 *s, size_t l) {
|
||||
rz_return_val_if_fail (sb && s, false);
|
||||
if (l >= sizeof (sb->buf)) {
|
||||
char *ptr = sb->ptr;
|
||||
|
|
@ -107,7 +107,7 @@ RZ_API bool rz_strbuf_setbin(RStrBuf *sb, const ut8 *s, size_t l) {
|
|||
}
|
||||
|
||||
// TODO: there's room for optimizations here
|
||||
RZ_API bool rz_strbuf_slice(RStrBuf *sb, int from, int len) {
|
||||
RZ_API bool rz_strbuf_slice(RzStrBuf *sb, int from, int len) {
|
||||
rz_return_val_if_fail (sb && from >= 0 && len >= 0, false);
|
||||
if (from < 1 && len >= sb->len) {
|
||||
return false;
|
||||
|
|
@ -128,7 +128,7 @@ RZ_API bool rz_strbuf_slice(RStrBuf *sb, int from, int len) {
|
|||
return true;
|
||||
}
|
||||
|
||||
RZ_API bool rz_strbuf_setptr(RStrBuf *sb, char *s, int len) {
|
||||
RZ_API bool rz_strbuf_setptr(RzStrBuf *sb, char *s, int len) {
|
||||
rz_return_val_if_fail (sb, false);
|
||||
if (len < 0) {
|
||||
sb->len = strlen (s);
|
||||
|
|
@ -142,7 +142,7 @@ RZ_API bool rz_strbuf_setptr(RStrBuf *sb, char *s, int len) {
|
|||
return true;
|
||||
}
|
||||
|
||||
RZ_API const char *rz_strbuf_set(RStrBuf *sb, const char *s) {
|
||||
RZ_API const char *rz_strbuf_set(RzStrBuf *sb, const char *s) {
|
||||
rz_return_val_if_fail (sb, NULL);
|
||||
if (!s) {
|
||||
rz_strbuf_init (sb);
|
||||
|
|
@ -156,7 +156,7 @@ RZ_API const char *rz_strbuf_set(RStrBuf *sb, const char *s) {
|
|||
return rz_strbuf_get (sb);
|
||||
}
|
||||
|
||||
RZ_API const char *rz_strbuf_setf(RStrBuf *sb, const char *fmt, ...) {
|
||||
RZ_API const char *rz_strbuf_setf(RzStrBuf *sb, const char *fmt, ...) {
|
||||
rz_return_val_if_fail (sb && fmt, false);
|
||||
|
||||
va_list ap;
|
||||
|
|
@ -166,7 +166,7 @@ RZ_API const char *rz_strbuf_setf(RStrBuf *sb, const char *fmt, ...) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
RZ_API const char *rz_strbuf_vsetf(RStrBuf *sb, const char *fmt, va_list ap) {
|
||||
RZ_API const char *rz_strbuf_vsetf(RzStrBuf *sb, const char *fmt, va_list ap) {
|
||||
rz_return_val_if_fail (sb && fmt, false);
|
||||
|
||||
const char *ret = NULL;
|
||||
|
|
@ -190,7 +190,7 @@ done:
|
|||
return ret;
|
||||
}
|
||||
|
||||
RZ_API bool rz_strbuf_prepend(RStrBuf *sb, const char *s) {
|
||||
RZ_API bool rz_strbuf_prepend(RzStrBuf *sb, const char *s) {
|
||||
rz_return_val_if_fail (sb && s, false);
|
||||
int l = strlen (s);
|
||||
// fast path if no chars to append
|
||||
|
|
@ -211,14 +211,14 @@ RZ_API bool rz_strbuf_prepend(RStrBuf *sb, const char *s) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
RZ_API bool rz_strbuf_append(RStrBuf *sb, const char *s) {
|
||||
RZ_API bool rz_strbuf_append(RzStrBuf *sb, const char *s) {
|
||||
rz_return_val_if_fail (sb && s, false);
|
||||
|
||||
int l = strlen (s);
|
||||
return rz_strbuf_append_n (sb, s, l);
|
||||
}
|
||||
|
||||
RZ_API bool rz_strbuf_append_n(RStrBuf *sb, const char *s, size_t l) {
|
||||
RZ_API bool rz_strbuf_append_n(RzStrBuf *sb, const char *s, size_t l) {
|
||||
rz_return_val_if_fail (sb && s, false);
|
||||
|
||||
if (sb->weakref) {
|
||||
|
|
@ -264,7 +264,7 @@ RZ_API bool rz_strbuf_append_n(RStrBuf *sb, const char *s, size_t l) {
|
|||
return true;
|
||||
}
|
||||
|
||||
RZ_API bool rz_strbuf_appendf(RStrBuf *sb, const char *fmt, ...) {
|
||||
RZ_API bool rz_strbuf_appendf(RzStrBuf *sb, const char *fmt, ...) {
|
||||
va_list ap;
|
||||
|
||||
rz_return_val_if_fail (sb && fmt, -1);
|
||||
|
|
@ -275,7 +275,7 @@ RZ_API bool rz_strbuf_appendf(RStrBuf *sb, const char *fmt, ...) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
RZ_API bool rz_strbuf_vappendf(RStrBuf *sb, const char *fmt, va_list ap) {
|
||||
RZ_API bool rz_strbuf_vappendf(RzStrBuf *sb, const char *fmt, va_list ap) {
|
||||
int ret;
|
||||
va_list ap2;
|
||||
char string[1024];
|
||||
|
|
@ -306,12 +306,12 @@ RZ_API bool rz_strbuf_vappendf(RStrBuf *sb, const char *fmt, va_list ap) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
RZ_API char *rz_strbuf_get(RStrBuf *sb) {
|
||||
RZ_API char *rz_strbuf_get(RzStrBuf *sb) {
|
||||
rz_return_val_if_fail (sb, NULL);
|
||||
return sb->ptr ? sb->ptr : sb->buf;
|
||||
}
|
||||
|
||||
RZ_API ut8 *rz_strbuf_getbin(RStrBuf *sb, int *len) {
|
||||
RZ_API ut8 *rz_strbuf_getbin(RzStrBuf *sb, int *len) {
|
||||
rz_return_val_if_fail (sb, NULL);
|
||||
if (len) {
|
||||
*len = sb->len;
|
||||
|
|
@ -319,7 +319,7 @@ RZ_API ut8 *rz_strbuf_getbin(RStrBuf *sb, int *len) {
|
|||
return (ut8 *)(sb->ptr ? sb->ptr : sb->buf);
|
||||
}
|
||||
|
||||
static inline char *drain(RStrBuf *sb) {
|
||||
static inline char *drain(RzStrBuf *sb) {
|
||||
return sb->ptr
|
||||
? sb->weakref
|
||||
? rz_mem_dup (sb->ptr, sb->ptrlen)
|
||||
|
|
@ -327,14 +327,14 @@ static inline char *drain(RStrBuf *sb) {
|
|||
: strdup (sb->buf);
|
||||
}
|
||||
|
||||
RZ_API char *rz_strbuf_drain(RStrBuf *sb) {
|
||||
RZ_API char *rz_strbuf_drain(RzStrBuf *sb) {
|
||||
rz_return_val_if_fail (sb, NULL);
|
||||
char *ret = drain (sb);
|
||||
free (sb);
|
||||
return ret;
|
||||
}
|
||||
|
||||
RZ_API char *rz_strbuf_drain_nofree(RStrBuf *sb) {
|
||||
RZ_API char *rz_strbuf_drain_nofree(RzStrBuf *sb) {
|
||||
rz_return_val_if_fail (sb, NULL);
|
||||
char *ret = drain (sb);
|
||||
sb->ptr = NULL;
|
||||
|
|
@ -343,14 +343,14 @@ RZ_API char *rz_strbuf_drain_nofree(RStrBuf *sb) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
RZ_API void rz_strbuf_free(RStrBuf *sb) {
|
||||
RZ_API void rz_strbuf_free(RzStrBuf *sb) {
|
||||
if (sb) {
|
||||
rz_strbuf_fini (sb);
|
||||
free (sb);
|
||||
}
|
||||
}
|
||||
|
||||
RZ_API void rz_strbuf_fini(RStrBuf *sb) {
|
||||
RZ_API void rz_strbuf_fini(RzStrBuf *sb) {
|
||||
if (sb && !sb->weakref) {
|
||||
RZ_FREE (sb->ptr);
|
||||
sb->len = 0;
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ RZ_API void rz_table_add_row(RTable *t, const char *name, ...) {
|
|||
|
||||
// import / export
|
||||
|
||||
static int __strbuf_append_col_aligned_fancy(RTable *t, RStrBuf *sb, RTableColumn *col, char *str) {
|
||||
static int __strbuf_append_col_aligned_fancy(RTable *t, RzStrBuf *sb, RTableColumn *col, char *str) {
|
||||
RzCons *cons = (RzCons *) t->cons;
|
||||
const char *v_line = (cons && (cons->use_utf8 || cons->use_utf8_curvy)) ? RUNE_LINE_VERT : "|";
|
||||
int ll = rz_strbuf_length (sb);
|
||||
|
|
@ -295,7 +295,7 @@ RZ_API char *rz_table_tofancystring(RTable *t) {
|
|||
if (rz_list_length (t->cols) == 0) {
|
||||
return strdup ("");
|
||||
}
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
RTableRow *row;
|
||||
RTableColumn *col;
|
||||
RzCons *cons = (RzCons *)t->cons;
|
||||
|
|
@ -355,7 +355,7 @@ RZ_API char *rz_table_tofancystring(RTable *t) {
|
|||
return rz_strbuf_drain (sb);
|
||||
}
|
||||
|
||||
static int __strbuf_append_col_aligned(RStrBuf *sb, RTableColumn *col, const char *str, bool nopad) {
|
||||
static int __strbuf_append_col_aligned(RzStrBuf *sb, RTableColumn *col, const char *str, bool nopad) {
|
||||
int ll = rz_strbuf_length (sb);
|
||||
if (nopad) {
|
||||
rz_strbuf_appendf (sb, "%s", str);
|
||||
|
|
@ -410,7 +410,7 @@ RZ_API char *rz_table_tostring(RTable *t) {
|
|||
}
|
||||
|
||||
RZ_API char *rz_table_tosimplestring(RTable *t) {
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
RTableRow *row;
|
||||
RTableColumn *col;
|
||||
RzListIter *iter, *iter2;
|
||||
|
|
@ -463,7 +463,7 @@ RZ_API char *rz_table_tosimplestring(RTable *t) {
|
|||
}
|
||||
|
||||
RZ_API char *rz_table_tocsv(RTable *t) {
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
RTableRow *row;
|
||||
RTableColumn *col;
|
||||
RzListIter *iter, *iter2;
|
||||
|
|
@ -1089,7 +1089,7 @@ RZ_API void rz_table_visual_list(RTable *table, RzList *list, ut64 seek, ut64 le
|
|||
if (min != -1 && mul > 0) {
|
||||
i = 0;
|
||||
rz_list_foreach (list, iter, info) {
|
||||
RStrBuf *buf = rz_strbuf_new ("");
|
||||
RzStrBuf *buf = rz_strbuf_new ("");
|
||||
for (j = 0; j < width; j++) {
|
||||
ut64 pos = min + j * mul;
|
||||
ut64 npos = min + (j + 1) * mul;
|
||||
|
|
@ -1116,7 +1116,7 @@ RZ_API void rz_table_visual_list(RTable *table, RzList *list, ut64 seek, ut64 le
|
|||
free (b);
|
||||
i++;
|
||||
}
|
||||
RStrBuf *buf = rz_strbuf_new ("");
|
||||
RzStrBuf *buf = rz_strbuf_new ("");
|
||||
/* current seek */
|
||||
if (i > 0 && len != 0) {
|
||||
if (seek == UT64_MAX) {
|
||||
|
|
|
|||
|
|
@ -514,7 +514,7 @@ RZ_API void rz_type_del(Sdb *TDB, const char *name) {
|
|||
sdb_unset (TDB, name, 0);
|
||||
rz_list_free (list);
|
||||
} else if (!strcmp (kind, "typedef")) {
|
||||
RStrBuf buf;
|
||||
RzStrBuf buf;
|
||||
rz_strbuf_init (&buf);
|
||||
rz_strbuf_setf (&buf, "typedef.%s", name);
|
||||
sdb_unset (TDB, rz_strbuf_get (&buf), 0);
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ void rz_x509_free_crl (RX509CertificateRevocationList *crl) {
|
|||
}
|
||||
}
|
||||
|
||||
static void rz_x509_validity_dump(RX509Validity *validity, const char *pad, RStrBuf *sb) {
|
||||
static void rz_x509_validity_dump(RX509Validity *validity, const char *pad, RzStrBuf *sb) {
|
||||
if (!validity) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -430,7 +430,7 @@ static void rz_x509_validity_dump(RX509Validity *validity, const char *pad, RStr
|
|||
rz_strbuf_appendf (sb, "%sNot Before: %s\n%sNot After: %s\n", pad, b, pad, a);
|
||||
}
|
||||
|
||||
void rz_x509_name_dump (RX509Name *name, const char *pad, RStrBuf *sb) {
|
||||
void rz_x509_name_dump (RX509Name *name, const char *pad, RzStrBuf *sb) {
|
||||
ut32 i;
|
||||
if (!name) {
|
||||
return;
|
||||
|
|
@ -446,7 +446,7 @@ void rz_x509_name_dump (RX509Name *name, const char *pad, RStrBuf *sb) {
|
|||
}
|
||||
}
|
||||
|
||||
static void rz_x509_subjectpublickeyinfo_dump(RX509SubjectPublicKeyInfo *spki, const char *pad, RStrBuf *sb) {
|
||||
static void rz_x509_subjectpublickeyinfo_dump(RX509SubjectPublicKeyInfo *spki, const char *pad, RzStrBuf *sb) {
|
||||
const char *a;
|
||||
if (!spki) {
|
||||
return;
|
||||
|
|
@ -468,7 +468,7 @@ static void rz_x509_subjectpublickeyinfo_dump(RX509SubjectPublicKeyInfo *spki, c
|
|||
// rz_asn1_free_string (e);
|
||||
}
|
||||
|
||||
static void rz_x509_extensions_dump(RX509Extensions *exts, const char *pad, RStrBuf *sb) {
|
||||
static void rz_x509_extensions_dump(RX509Extensions *exts, const char *pad, RzStrBuf *sb) {
|
||||
ut32 i;
|
||||
if (!exts) {
|
||||
return;
|
||||
|
|
@ -491,7 +491,7 @@ static void rz_x509_extensions_dump(RX509Extensions *exts, const char *pad, RStr
|
|||
}
|
||||
}
|
||||
|
||||
static void rz_x509_tbscertificate_dump(RX509TBSCertificate *tbsc, const char *pad, RStrBuf *sb) {
|
||||
static void rz_x509_tbscertificate_dump(RX509TBSCertificate *tbsc, const char *pad, RzStrBuf *sb) {
|
||||
RASN1String *sid = NULL, *iid = NULL;
|
||||
if (!tbsc) {
|
||||
return;
|
||||
|
|
@ -542,7 +542,7 @@ static void rz_x509_tbscertificate_dump(RX509TBSCertificate *tbsc, const char *p
|
|||
free (pad2);
|
||||
}
|
||||
|
||||
void rz_x509_certificate_dump (RX509Certificate *cert, const char *pad, RStrBuf *sb) {
|
||||
void rz_x509_certificate_dump (RX509Certificate *cert, const char *pad, RzStrBuf *sb) {
|
||||
RASN1String *algo = NULL;
|
||||
char *pad2;
|
||||
if (!cert) {
|
||||
|
|
@ -569,7 +569,7 @@ void rz_x509_certificate_dump (RX509Certificate *cert, const char *pad, RStrBuf
|
|||
// rz_asn1_free_string (signature);
|
||||
}
|
||||
|
||||
void rz_x509_crlentry_dump (RX509CRLEntry *crle, const char *pad, RStrBuf *sb) {
|
||||
void rz_x509_crlentry_dump (RX509CRLEntry *crle, const char *pad, RzStrBuf *sb) {
|
||||
RASN1String *id = NULL, *utc = NULL;
|
||||
if (!crle) {
|
||||
return;
|
||||
|
|
@ -606,7 +606,7 @@ RZ_API char *rz_x509_crl_to_string(RX509CertificateRevocationList *crl, const ch
|
|||
algo = crl->signature.algorithm;
|
||||
last = crl->lastUpdate;
|
||||
next = crl->nextUpdate;
|
||||
RStrBuf *sb = rz_strbuf_new ("");
|
||||
RzStrBuf *sb = rz_strbuf_new ("");
|
||||
rz_strbuf_appendf (sb, "%sCRL:\n%sSignature:\n%s%s\n%sIssuer\n", pad, pad2, pad3,
|
||||
algo ? algo->string : "", pad2);
|
||||
rz_x509_name_dump (&crl->issuer, pad3, sb);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ RZ_API bool rz_x509_parse_tbscertificate(RX509TBSCertificate *tbsc, RASN1Object
|
|||
RZ_API void rz_x509_free_tbscertificate(RX509TBSCertificate * tbsc);
|
||||
|
||||
RZ_API RX509CRLEntry *rz_x509_parse_crlentry(RASN1Object *object);
|
||||
RZ_API void rz_x509_name_dump(RX509Name* name, const char* pad, RStrBuf *sb);
|
||||
RZ_API void rz_x509_name_dump(RX509Name* name, const char* pad, RzStrBuf *sb);
|
||||
|
||||
#endif /* RZ_X509_INTERNAL_H */
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ struct Proc *proc = &x##_proc;
|
|||
|
||||
#if USE_R2
|
||||
#include <rz_util.h>
|
||||
#define SStrBuf RStrBuf
|
||||
#define SStrBuf RzStrBuf
|
||||
#else
|
||||
typedef struct s_strbuf_t {
|
||||
int len;
|
||||
|
|
|
|||
|
|
@ -30,14 +30,14 @@ bool test_r_rbtree_cont_insert() {
|
|||
|
||||
static int strbuf_num_cmp0(void *incoming, void *in, void *user) {
|
||||
ut64 v[2] = {
|
||||
rz_num_get(NULL, rz_strbuf_get((RStrBuf *)incoming)),
|
||||
rz_num_get(NULL, rz_strbuf_get((RStrBuf *)in))
|
||||
rz_num_get(NULL, rz_strbuf_get((RzStrBuf *)incoming)),
|
||||
rz_num_get(NULL, rz_strbuf_get((RzStrBuf *)in))
|
||||
};
|
||||
return (int)(v[0] - v[1]);
|
||||
}
|
||||
|
||||
static int strbuf_num_cmp1(void *incoming, void *in, void *user) {
|
||||
ut64 v[2] = { ((ut64 *)incoming)[0], rz_num_get(NULL, rz_strbuf_get((RStrBuf *)in)) };
|
||||
ut64 v[2] = { ((ut64 *)incoming)[0], rz_num_get(NULL, rz_strbuf_get((RzStrBuf *)in)) };
|
||||
return (int)(v[0] - v[1]);
|
||||
}
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ bool test_r_rbtree_cont_delete() {
|
|||
rz_rbtree_cont_insert(tree, rz_strbuf_new("0x13373"), strbuf_num_cmp0, NULL);
|
||||
ut64 del_me = 0x9090;
|
||||
rz_rbtree_cont_delete(tree, &del_me, strbuf_num_cmp1, NULL);
|
||||
RStrBuf *s;
|
||||
RzStrBuf *s;
|
||||
RBIter ator;
|
||||
bool ret = true;
|
||||
rz_rbtree_cont_foreach_prev(tree, ator, s) {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ bool test_filter_regs(void) {
|
|||
RzAnalEsilDFG *dfg = rz_anal_esil_dfg_expr (anal, NULL, "0x9090,ax,:=,0xff,ah,:=");
|
||||
|
||||
// filter for ax register
|
||||
RStrBuf *filtered_expr = rz_anal_esil_dfg_filter (dfg, "ax");
|
||||
RzStrBuf *filtered_expr = rz_anal_esil_dfg_filter (dfg, "ax");
|
||||
rz_anal_esil_parse (esil, rz_strbuf_get (filtered_expr));
|
||||
const ut64 filtered_ax = rz_reg_getv (anal->reg, "ax");
|
||||
rz_strbuf_free (filtered_expr);
|
||||
|
|
|
|||
|
|
@ -474,7 +474,7 @@ static bool test_rz_str_wrap(void) {
|
|||
size_t i;
|
||||
RzListIter *it;
|
||||
const char *ts;
|
||||
RStrBuf sb;
|
||||
RzStrBuf sb;
|
||||
rz_strbuf_init (&sb);
|
||||
|
||||
char s1[] = "This is a very long string we would like to wrap at around X characters. It should not split words.";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include "minunit.h"
|
||||
|
||||
bool test_r_strbuf_slice(void) {
|
||||
RStrBuf *sa = rz_strbuf_new ("foo,bar,cow");
|
||||
RzStrBuf *sa = rz_strbuf_new ("foo,bar,cow");
|
||||
rz_strbuf_slice (sa, 2, 4); // should be from/to instead of from/len ?
|
||||
char *a = rz_strbuf_drain (sa);
|
||||
mu_assert_streq (a, "o,ba", "slicing fails");
|
||||
|
|
@ -12,7 +12,7 @@ bool test_r_strbuf_slice(void) {
|
|||
}
|
||||
|
||||
bool test_r_strbuf_append(void) {
|
||||
RStrBuf *sa = rz_strbuf_new ("foo");
|
||||
RzStrBuf *sa = rz_strbuf_new ("foo");
|
||||
rz_strbuf_append (sa, "bar");
|
||||
rz_strbuf_prepend (sa, "pre");
|
||||
char *a = rz_strbuf_drain (sa);
|
||||
|
|
@ -24,7 +24,7 @@ bool test_r_strbuf_append(void) {
|
|||
|
||||
bool test_r_strbuf_strong_string(void) {
|
||||
// small string
|
||||
RStrBuf *sa = rz_strbuf_new ("");
|
||||
RzStrBuf *sa = rz_strbuf_new ("");
|
||||
rz_strbuf_set (sa, "food");
|
||||
mu_assert_eq (rz_strbuf_length (sa), 4, "rz_strbuf_set:food");
|
||||
mu_assert_eq (sa->len, 4, "len of string");
|
||||
|
|
@ -55,7 +55,7 @@ bool test_r_strbuf_strong_string(void) {
|
|||
}
|
||||
|
||||
bool test_r_strbuf_strong_binary(void) {
|
||||
RStrBuf *sa = rz_strbuf_new ("");
|
||||
RzStrBuf *sa = rz_strbuf_new ("");
|
||||
bool res = rz_strbuf_setbin (sa, (const ut8 *)"food", 4);
|
||||
mu_assert ("setbin success", res);
|
||||
mu_assert_memeq ((const ut8 *)rz_strbuf_get (sa), (const ut8 *)"food", 4, "small binary data");
|
||||
|
|
@ -88,7 +88,7 @@ bool test_r_strbuf_strong_binary(void) {
|
|||
bool test_r_strbuf_weak_string(void) {
|
||||
// small string
|
||||
char *myptr = "food";
|
||||
RStrBuf *sa = rz_strbuf_new ("");
|
||||
RzStrBuf *sa = rz_strbuf_new ("");
|
||||
rz_strbuf_setptr (sa, myptr, -1);
|
||||
mu_assert_eq (rz_strbuf_length (sa), 4, "length from api");
|
||||
mu_assert_eq (sa->len, 4, "len of string");
|
||||
|
|
@ -123,7 +123,7 @@ bool test_r_strbuf_weak_string(void) {
|
|||
|
||||
bool test_r_strbuf_weak_binary(void) {
|
||||
char *myptr = "food";
|
||||
RStrBuf *sa = rz_strbuf_new ("");
|
||||
RzStrBuf *sa = rz_strbuf_new ("");
|
||||
bool res = rz_strbuf_setptr (sa, myptr, 4);
|
||||
mu_assert ("setbin success", res);
|
||||
mu_assert_ptreq (rz_strbuf_get (sa), myptr, "weak ptr");
|
||||
|
|
@ -156,7 +156,7 @@ bool test_r_strbuf_weak_binary(void) {
|
|||
}
|
||||
|
||||
bool test_r_strbuf_setbin(void) {
|
||||
RStrBuf *sa = rz_strbuf_new ("");
|
||||
RzStrBuf *sa = rz_strbuf_new ("");
|
||||
rz_strbuf_setbin (sa, (const ut8 *)"inbuffffffff", 5);
|
||||
mu_assert_streq (rz_strbuf_get (sa), "inbuf", "setbin str with size");
|
||||
mu_assert_eq (rz_strbuf_length (sa), 5, "len from api");
|
||||
|
|
@ -185,7 +185,7 @@ bool test_r_strbuf_setbin(void) {
|
|||
}
|
||||
|
||||
bool test_r_strbuf_set(void) {
|
||||
RStrBuf sb;
|
||||
RzStrBuf sb;
|
||||
rz_strbuf_init (&sb);
|
||||
const char *s = rz_strbuf_set (&sb, "I have packed only the essentials");
|
||||
mu_assert_notnull (s, "set return notnull");
|
||||
|
|
@ -196,7 +196,7 @@ bool test_r_strbuf_set(void) {
|
|||
}
|
||||
|
||||
bool test_r_strbuf_setf(void) {
|
||||
RStrBuf sb;
|
||||
RzStrBuf sb;
|
||||
rz_strbuf_init (&sb);
|
||||
const char *s = rz_strbuf_setf (&sb, "One %s for hydration", "water");
|
||||
mu_assert_notnull (s, "setf return notnull");
|
||||
|
|
@ -207,7 +207,7 @@ bool test_r_strbuf_setf(void) {
|
|||
}
|
||||
|
||||
bool test_r_strbuf_initf(void) {
|
||||
RStrBuf sb;
|
||||
RzStrBuf sb;
|
||||
const char *s = rz_strbuf_initf (&sb, "hmmst, %s was that audial occurence? %d", "wat", 42);
|
||||
mu_assert_notnull (s, "initf return notnull");
|
||||
mu_assert_ptreq (s, rz_strbuf_get (&sb), "initf return");
|
||||
|
|
|
|||
Loading…
Reference in a new issue