本文整理汇总了C++中r_list_free函数的典型用法代码示例。如果您正苦于以下问题:C++ r_list_free函数的具体用法?C++ r_list_free怎么用?C++ r_list_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了r_list_free函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: r_list_new
R_API RList *r_anal_refs_get (RAnal *anal, ut64 from) {
RList *list = r_list_new ();
if (!list) {
return NULL;
}
r_anal_xrefs_from (anal, list, "ref", R_ANAL_REF_TYPE_NULL, from);
r_anal_xrefs_from (anal, list, "ref", R_ANAL_REF_TYPE_CODE, from);
r_anal_xrefs_from (anal, list, "ref", R_ANAL_REF_TYPE_CALL, from);
r_anal_xrefs_from (anal, list, "ref", R_ANAL_REF_TYPE_DATA, from);
r_anal_xrefs_from (anal, list, "ref", R_ANAL_REF_TYPE_STRING, from);
if (r_list_empty (list)) {
r_list_free (list);
list = NULL;
}
return list;
}
开发者ID:XVilka,项目名称:radare2,代码行数:16,代码来源:xrefs.c
示例2: r_bflt_get_entry
static RList *entries(RBinFile *bf) {
struct r_bin_bflt_obj *obj = (struct r_bin_bflt_obj *) bf->o->bin_obj;
RList *ret;
RBinAddr *ptr;
if (!(ret = r_list_newf (free))) {
return NULL;
}
ptr = r_bflt_get_entry (obj);
if (!ptr) {
r_list_free (ret);
return NULL;
}
r_list_append (ret, ptr);
return ret;
}
开发者ID:aronsky,项目名称:radare2,代码行数:16,代码来源:bin_bflt.c
示例3: r_anal_bb_free
R_API void r_anal_bb_free(RAnalBlock *bb) {
if (!bb) return;
r_anal_cond_free (bb->cond);
free (bb->fingerprint);
if (bb->diff)
r_anal_diff_free (bb->diff);
#if R_ANAL_BB_HAS_OPS
if (bb->ops)
r_list_free (bb->ops);
bb->ops = NULL;
bb->diff = NULL;
#endif
bb->fingerprint = NULL;
bb->cond = NULL;
free (bb);
}
开发者ID:BatchDrake,项目名称:radare2,代码行数:16,代码来源:bb.c
示例4: r_buf_deinit
R_API void r_buf_deinit(RBuffer *b) {
if (!b) return;
if (b->fd != -1) {
r_sandbox_close (b->fd);
b->fd = -1;
return;
}
if (b->sparse) {
r_list_free (b->sparse);
b->sparse = NULL;
}
if (b->mmap) {
r_file_mmap_free (b->mmap);
b->mmap = NULL;
} else R_FREE (b->buf);
}
开发者ID:HKingz,项目名称:radare2,代码行数:16,代码来源:buf.c
示例5: r_list_free
static RList *imports(RBinFile *arch) {
RBinWasmObj *bin = NULL;
RList *imports = NULL;
RBinImport *ptr = NULL;
RList *ret = NULL;
if (!arch || !arch->o || !arch->o->bin_obj) {
return NULL;
}
bin = arch->o->bin_obj;
if (!(ret = r_list_newf (r_bin_import_free))) {
return NULL;
}
if (!(imports = r_bin_wasm_get_imports (bin))) {
r_list_free (ret);
return NULL;
}
RBinWasmImportEntry *import = NULL;
ut32 i = 0;
RListIter *iter;
r_list_foreach (imports, iter, import) {
if (!(ptr = R_NEW0 (RBinImport))) {
break;
}
ptr->name = strdup (import->field_str);
ptr->classname = strdup (import->module_str);
ptr->ordinal = i;
ptr->bind = r_str_const ("NONE");
switch(import->kind) {
case R_BIN_WASM_EXTERNALKIND_Function:
ptr->type = r_str_const ("FUNC");
break;
case R_BIN_WASM_EXTERNALKIND_Table:
ptr->type = r_str_const ("TABLE");
break;
case R_BIN_WASM_EXTERNALKIND_Memory:
ptr->type = r_str_const ("MEM");
break;
case R_BIN_WASM_EXTERNALKIND_Global:
ptr->type = r_str_const ("GLOBAL");
break;
}
r_list_append (ret, ptr);
}
return ret;
}
开发者ID:P4N74,项目名称:radare2,代码行数:47,代码来源:bin_wasm.c
示例6: radare2_rc
static void radare2_rc(RCore *r) {
char* env_debug = r_sys_getenv ("R_DEBUG");
bool has_debug = false;
if (env_debug) {
has_debug = true;
R_FREE (env_debug);
}
char *homerc = r_str_home (".radare2rc");
if (homerc && r_file_is_regular (homerc)) {
if (has_debug) {
eprintf ("USER CONFIG loaded from %s\n", homerc);
}
r_core_cmd_file (r, homerc);
}
free (homerc);
homerc = r_str_home (".config/radare2/radare2rc");
if (homerc && r_file_is_regular (homerc)) {
if (has_debug) {
eprintf ("USER CONFIG loaded from %s\n", homerc);
}
r_core_cmd_file (r, homerc);
}
free (homerc);
homerc = r_str_home (".config/radare2/radare2rc.d");
if (homerc) {
if (r_file_is_directory (homerc)) {
char *file;
RListIter *iter;
RList *files = r_sys_dir (homerc);
r_list_foreach (files, iter, file) {
if (*file != '.') {
char *path = r_str_newf ("%s/%s", homerc, file);
if (r_file_is_regular (path)) {
if (has_debug) {
eprintf ("USER CONFIG loaded from %s\n", homerc);
}
r_core_cmd_file (r, path);
}
free (path);
}
}
r_list_free (files);
}
free (homerc);
}
}
开发者ID:P4N74,项目名称:radare2,代码行数:47,代码来源:radare2.c
示例7: strdup
- follow symlinks
#endif
static char *rtr_dir_files (const char *path) {
char *ptr = strdup ("<html><body>\n");
const char *file;
RListIter *iter;
// list files
RList *files = r_sys_dir (path);
eprintf ("Listing directory %s\n", path);
r_list_foreach (files, iter, file) {
if (file[0] == '.') continue;
ptr = r_str_concatf (ptr, "<a href=\"%s%s\">%s</a><br />\n",
path, file, file);
}
r_list_free (files);
return r_str_concat (ptr, "</body></html>\n");
}
开发者ID:dialeth,项目名称:radare2,代码行数:18,代码来源:rtr.c
示例8: test_r_list_sort2
bool test_r_list_sort2(void) {
RList* list = r_list_new ();
char* test1 = "AAAA";
char* test2 = "BBBB";
char* test3 = "CCCC";
// Put in not sorted order.
r_list_append (list, (void*)test3);
r_list_append (list, (void*)test2);
r_list_append (list, (void*)test1);
// Sort.
r_list_merge_sort (list, (RListComparator)strcmp);
// Check that the list is actually sorted.
mu_assert_streq ((char*)list->head->data, "AAAA", "first value in sorted list");
mu_assert_streq ((char*)list->head->n->data, "BBBB", "second value in sorted list");
mu_assert_streq ((char*)list->head->n->n->data, "CCCC", "third value in sorted list");
r_list_free (list);
mu_end;
}
开发者ID:condret,项目名称:radare2-regressions,代码行数:18,代码来源:test_list.c
示例9: r_list_new
static RList *r_debug_native_threads (RDebug *dbg, int pid) {
RList *list = r_list_new ();
if (list == NULL) {
eprintf ("No list?\n");
return NULL;
}
#if __WINDOWS__ && !__CYGWIN__
return w32_thread_list (pid, list);
#elif __APPLE__
return xnu_thread_list (dbg, pid, list);
#elif __linux__
return linux_thread_list (pid, list);
#else
eprintf ("TODO: list threads\n");
r_list_free (list);
return NULL;
#endif
}
开发者ID:JohnDoe1234123,项目名称:radare2,代码行数:18,代码来源:debug_native.c
示例10: test_r_list_sort3
bool test_r_list_sort3(void) {
RList* list = r_list_new ();
int test1 = 33508;
int test2 = 33480;
int test3 = 33964;
// Put in not sorted order.
r_list_append (list, (void*)&test1);
r_list_append (list, (void*)&test3);
r_list_append (list, (void*)&test2);
// Sort.
r_list_merge_sort (list, (RListComparator)cmp_range);
// Check that the list is actually sorted.
mu_assert_eq (*(int*)list->head->data, 33480, "first value in sorted list");
mu_assert_eq (*(int*)list->head->n->data, 33508, "second value in sorted list");
mu_assert_eq (*(int*)list->head->n->n->data, 33964, "third value in sorted list");
r_list_free (list);
mu_end;
}
开发者ID:condret,项目名称:radare2-regressions,代码行数:18,代码来源:test_list.c
示例11: entries
static RList* entries(RBinFile *bf) {
RList* ret = r_list_newf (free);
RBinAddr *ptr = NULL;
if (ret) {
if ((ptr = R_NEW0 (RBinAddr))) {
ut64 entry = (ut64)readLE32(bf->buf, 0x80);
ut64 size = (ut64)readLE32(bf->buf, 0x84);
// eprintf ("0x%x 0x%x\n", entry, size);
ptr->paddr = entry;
ptr->vaddr = entry;
r_list_append (ret, ptr);
} else {
r_list_free (ret);
ret = NULL;
}
}
return ret;
}
开发者ID:radare,项目名称:radare2-extras,代码行数:18,代码来源:bin_md380fw.c
示例12: test_r_list_sort5
bool test_r_list_sort5(void) {
RList* list = r_list_new ();
int i = 0;
char *upper[] = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
char *lower[] = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
for (i = 0; i < 26; i++) {
r_list_append (list, (void *)lower[i]);
}
for (i = 0; i < 26; i++) {
r_list_append (list, (void *)upper[i]);
}
//add more than 43 elements to trigger merge sort
r_list_sort (list, (RListComparator)strcmp);
mu_assert_streq ((char *)list->head->data, upper[0], "First element");
mu_assert_streq ((char *)list->tail->data, lower[25], "Last element");
r_list_free (list);
mu_end;
}
开发者ID:condret,项目名称:radare2-regressions,代码行数:18,代码来源:test_list.c
示例13: entries
static RList* entries(RBinFile *arch) {
RList* ret = r_list_newf (free);
RBinAddr *ptr = NULL;
if (ret) {
if ((ptr = R_NEW0 (RBinAddr))) {
ut64 entry = findEntry (arch->buf, 2);
if (!entry) entry = findEntry (arch->buf, 1);
if (!entry) entry = findEntry (arch->buf, 0);
if (!entry) entry = 4;
ptr->paddr = entry;
ptr->vaddr = entry;
r_list_append (ret, ptr);
} else {
r_list_free (ret);
ret = NULL;
}
}
return ret;
}
开发者ID:P4N74,项目名称:radare2-extras,代码行数:19,代码来源:bin_bcl.c
示例14: r_list_newf
static RList *r_debug_bochs_map_get(RDebug* dbg) { //TODO
//eprintf("bochs_map_getdebug:\n");
RDebugMap *mr;
RList *list = r_list_newf ((RListFree)map_free);
if (!list) return NULL;
mr = R_NEW0 (RDebugMap);
if (!mr) {
r_list_free (list);
return NULL;
}
mr->name = strdup ("fake");
mr->addr = 0;
mr->addr_end = UT32_MAX;
mr->size = UT32_MAX;
mr->perm = 0;
mr->user = 0;
r_list_append (list, mr);
return list;
}
开发者ID:EliaGeretto,项目名称:radare2,代码行数:19,代码来源:debug_bochs.c
示例15: r_core_asm_bwdis_len
/* Compute the len and the starting address
* when disassembling `nb` opcodes backward. */
R_API ut32 r_core_asm_bwdis_len (RCore* core, int* instr_len, ut64* start_addr, ut32 nb) {
ut32 instr_run = 0;
RCoreAsmHit *hit;
RListIter *iter = NULL;
RList* hits = r_core_asm_bwdisassemble (core, core->offset, nb, core->blocksize);
if (instr_len)
*instr_len = 0;
if (hits && r_list_length (hits) > 0) {
hit = r_list_get_bottom (hits);
if (start_addr)
*start_addr = hit->addr;
r_list_foreach (hits, iter, hit)
instr_run += hit->len;
if (instr_len)
*instr_len = instr_run;
}
r_list_free (hits);
return instr_run;
}
开发者ID:ghostbar,项目名称:radare2.deb,代码行数:21,代码来源:asm.c
示例16: rtti_msvc_print_all
static void rtti_msvc_print_all(RVTableContext *context, int mode) {
r_cons_break_push (NULL, NULL);
RList *vtables = r_anal_vtable_search (context);
RListIter *vtableIter;
RVTableInfo *table;
if (vtables) {
r_list_foreach (vtables, vtableIter, table) {
if (r_cons_is_breaked ()) {
break;
}
r_anal_rtti_msvc_print_at_vtable (context, table->saddr, mode);
r_cons_print ("\n");
}
}
r_list_free (vtables);
r_cons_break_pop ();
}
开发者ID:leberus,项目名称:radare2,代码行数:19,代码来源:rtti.c
示例17: r_list_new
static RList *sections(RBinFile *bf) {
RList /*<RBinSection>*/ *ret = r_list_new ();
if (!ret) {
return NULL;
}
RBinSection *text = R_NEW0 (RBinSection);
if (!text) {
r_list_free (ret);
return NULL;
}
text->name = strdup ("text");
text->size = r_buf_size (bf->buf) - N64_ROM_START;
text->vsize = text->size;
text->paddr = N64_ROM_START;
text->vaddr = baddr (bf);
text->perm = R_PERM_RX;
text->add = true;
r_list_append (ret, text);
return ret;
}
开发者ID:radare,项目名称:radare2,代码行数:20,代码来源:bin_z64.c
示例18: r_anal_var_retype
R_API int r_anal_var_retype (RAnal *a, ut64 addr, int scope, int delta, char kind, const char *type, int size, const char *name) {
char *var_def;
if (!kind) kind ='v';
if (!type) type = "int";
if (size==-1) {
RAnalFunction *fcn = r_anal_get_fcn_in (a, addr, 0);
RList *list = r_anal_var_list (a, fcn, kind);
RListIter *iter;
RAnalVar *var;
r_list_foreach (list, iter, var) {
if (delta == -1) {
if (!strcmp (var->name, name)) {
delta = var->delta;
size = var->size;
break;
}
}
}
r_list_free (list);
}
开发者ID:dukebarman,项目名称:radare2,代码行数:20,代码来源:var.c
示例19: r_list_new
static RList *sections(RBinFile *bf) {
RList /*<RBinSection>*/ *ret = r_list_new ();
if (!ret) {
return NULL;
}
RBinSection *text = R_NEW0 (RBinSection);
if (!text) {
r_list_free (ret);
return NULL;
}
strncpy (text->name, "text", R_BIN_SIZEOF_STRINGS);
text->size = bf->buf->length - N64_ROM_START;
text->vsize = text->size;
text->paddr = N64_ROM_START;
text->vaddr = baddr (bf);
text->perm = R_PERM_RX;
text->add = true;
r_list_append (ret, text);
return ret;
}
开发者ID:montekki,项目名称:radare2,代码行数:20,代码来源:bin_z64.c
示例20: r_anal_bb_free
R_API void r_anal_bb_free(RAnalBlock *bb) {
if (!bb) return;
r_anal_cond_free (bb->cond);
free (bb->fingerprint);
if (bb->diff) {
r_anal_diff_free (bb->diff);
bb->diff = NULL;
}
free (bb->op_bytes);
if (bb->switch_op)
r_anal_switch_op_free (bb->switch_op);
#if R_ANAL_BB_HAS_OPS
r_list_free (bb->ops);
bb->ops = NULL;
#endif
bb->fingerprint = NULL;
bb->cond = NULL;
free (bb->label);
free (bb);
}
开发者ID:AnwarMohamed,项目名称:radare2,代码行数:20,代码来源:bb.c
注:本文中的r_list_free函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论