Rizin
unix-like reverse engineering framework and cli tools
list.c File Reference
#include <stdio.h>
#include "rz_util.h"

Go to the source code of this file.

Functions

RzListIterrz_list_iter_new (void)
 
RZ_API void rz_list_iter_free (RzListIter *list)
 
RZ_API RZ_BORROW RzListIterrz_list_iter_get_next (RzListIter *list)
 returns the next RzList iterator in the list More...
 
RZ_API RZ_BORROW void * rz_list_iter_get_next_data (RzListIter *list)
 returns the value stored in the next RzList iterator More...
 
RZ_API void * rz_list_iter_get_data (RzListIter *list)
 returns the value stored in the list element More...
 
RZ_API RZ_BORROW RzListIterrz_list_iterator (const RzList *list)
 returns the first RzList iterator int the list More...
 
RZ_API RZ_BORROW RzListIterrz_list_push (RZ_NONNULL RzList *list, void *item)
 Alias for rz_list_append. More...
 
RZ_API RzListIterrz_list_get_next (RzListIter *list)
 Returns the next element of the list. More...
 
RZ_API RZ_BORROW void * rz_list_first (RZ_NONNULL const RzList *list)
 Returns the first element of the list. More...
 
RZ_API RZ_BORROW void * rz_list_last (RZ_NONNULL const RzList *list)
 Returns the last element of the list. More...
 
RZ_API void rz_list_init (RZ_NONNULL RzList *list)
 Initializes the RzList pointer. More...
 
RZ_API ut32 rz_list_length (RZ_NONNULL const RzList *list)
 Returns the length of the list. More...
 
RZ_API void rz_list_purge (RZ_NONNULL RzList *list)
 Empties the list without freeing the list pointer. More...
 
RZ_API void rz_list_free (RZ_NONNULL RzList *list)
 Empties the list and frees the list pointer. More...
 
RZ_API bool rz_list_delete_data (RZ_NONNULL RzList *list, void *ptr)
 Deletes an entry in the list by searching for a pointer. More...
 
RZ_API void rz_list_delete (RZ_NONNULL RzList *list, RZ_NONNULL RzListIter *iter)
 Removes an entry in the list by using the RzListIter pointer. More...
 
RZ_API void rz_list_split (RZ_NONNULL RzList *list, void *ptr)
 
RZ_API void rz_list_split_iter (RZ_NONNULL RzList *list, RZ_NONNULL RzListIter *iter)
 
RZ_API bool rz_list_join (RZ_NONNULL RzList *list1, RZ_NONNULL RzList *list2)
 Joins 2 list into one (list2 pointer needs to be freed by the user) More...
 
RZ_API RZ_OWN RzListrz_list_new (void)
 Returns a new initialized RzList pointer (free method is not initialized) More...
 
RZ_API RZ_OWN RzListrz_list_newf (RzListFree f)
 Returns a new initialized RzList pointer and sets the free method. More...
 
RZ_API RZ_OWN RzListrz_list_new_from_array (RZ_NONNULL const void **arr, size_t arr_size)
 Allocates a new RzList and adds an array elements to it. More...
 
RZ_API RZ_OWN RzListIterrz_list_item_new (void *data)
 Creates a RzListIter element that can be inserted into a RzList. More...
 
RZ_API RZ_BORROW RzListIterrz_list_append (RZ_NONNULL RzList *list, void *data)
 Appends at the end of the list a new element. More...
 
RZ_API RZ_BORROW RzListIterrz_list_prepend (RZ_NONNULL RzList *list, void *data)
 Appends at the beginning of the list a new element. More...
 
RZ_API RZ_BORROW RzListIterrz_list_insert (RZ_NONNULL RzList *list, ut32 n, void *data)
 Inserts a new element at the N-th position. More...
 
RZ_API RZ_OWN void * rz_list_pop (RZ_NONNULL RzList *list)
 Removes and returns the last element of the list. More...
 
RZ_API RZ_OWN void * rz_list_pop_head (RZ_NONNULL RzList *list)
 Removes and returns the first element of the list. More...
 
RZ_API ut32 rz_list_del_n (RZ_NONNULL RzList *list, ut32 n)
 Removes the N-th element of the list. More...
 
RZ_API RZ_BORROW void * rz_list_get_top (RZ_NONNULL const RzList *list)
 Returns the last element of the list. More...
 
RZ_API RZ_BORROW void * rz_list_get_bottom (RZ_NONNULL const RzList *list)
 Returns the first element of the list. More...
 
RZ_API void rz_list_reverse (RZ_NONNULL RzList *list)
 Reverses the list. More...
 
RZ_API RZ_OWN RzListrz_list_clone (RZ_NONNULL const RzList *list)
 Shallow copies of the list (but doesn't free its elements) More...
 
RZ_API RZ_BORROW RzListIterrz_list_add_sorted (RZ_NONNULL RzList *list, void *data, RZ_NONNULL RzListComparator cmp)
 Adds an element to a sorted list via the RzListComparator. More...
 
RZ_API ut32 rz_list_set_n (RZ_NONNULL RzList *list, ut32 n, void *p)
 Sets the N-th element of the list. More...
 
RZ_API RZ_BORROW void * rz_list_get_n (RZ_NONNULL const RzList *list, ut32 n)
 Returns the N-th element of the list. More...
 
RZ_API RZ_BORROW RzListIterrz_list_contains (RZ_NONNULL const RzList *list, RZ_NONNULL const void *ptr)
 Returns the RzListIter of the given pointer, if found. More...
 
RZ_API RZ_BORROW RzListIterrz_list_find_ptr (RZ_NONNULL const RzList *list, RZ_NONNULL const void *ptr)
 Returns the RzListIter of the given pointer, if found. More...
 
RZ_API RZ_BORROW RzListIterrz_list_find (RZ_NONNULL const RzList *list, const void *p, RZ_NONNULL RzListComparator cmp)
 Returns RzListIter element which matches via the RzListComparator. More...
 
static RzListIter_merge (RzListIter *first, RzListIter *second, RzListComparator cmp)
 
static RzListIter_r_list_half_split (RzListIter *head)
 
static RzListIter_merge_sort (RzListIter *head, RzListComparator cmp)
 
RZ_API void rz_list_merge_sort (RZ_NONNULL RzList *list, RZ_NONNULL RzListComparator cmp)
 Merge sorts the list via the RzListComparator. More...
 
RZ_API void rz_list_insertion_sort (RZ_NONNULL RzList *list, RZ_NONNULL RzListComparator cmp)
 Insertion sorts the list via the RzListComparator. More...
 
RZ_API void rz_list_sort (RZ_NONNULL RzList *list, RZ_NONNULL RzListComparator cmp)
 Sorts via merge sort or via insertion sort a list. More...
 
RZ_API RZ_OWN RzListrz_list_uniq (RZ_NONNULL const RzList *list, RZ_NONNULL RzListComparator cmp)
 Returns a new RzList which contains only unique values. More...
 
RZ_API RZ_OWN char * rz_list_to_str (RZ_NONNULL RzList *list, char ch)
 Casts a RzList containg strings into a concatenated string. More...
 
RZ_API RZ_OWN RzListrz_list_of_sdblist (SdbList *sl)
 Converts a SdbList into a RzList. More...
 

Function Documentation

◆ _merge()

static RzListIter* _merge ( RzListIter first,
RzListIter second,
RzListComparator  cmp 
)
static

Definition at line 634 of file list.c.

634  {
635  RzListIter *next = NULL, *result = NULL, *head = NULL;
636  while (first || second) {
637  if (!second) {
638  next = first;
639  first = first->n;
640  } else if (!first) {
641  next = second;
642  second = second->n;
643  } else if (cmp(first->data, second->data) <= 0) {
644  next = first;
645  first = first->n;
646  } else {
647  next = second;
648  second = second->n;
649  }
650  if (!head) {
651  result = next;
652  head = result;
653  head->p = NULL;
654  } else {
655  result->n = next;
656  next->p = result;
657  result = result->n;
658  }
659  }
660  head->p = NULL;
661  next->n = NULL;
662  return head;
663 }
static RzILOpEffect * cmp(cs_insn *insn, bool is_thumb)
Definition: arm_il32.c:942
#define NULL
Definition: cris-opc.c:27
struct rz_list_iter_t * n
Definition: rz_list.h:15
void * data
Definition: rz_list.h:14
struct rz_list_iter_t * p
Definition: rz_list.h:15

References cmp(), rz_list_iter_t::data, test-lz4-versions::head, rz_list_iter_t::n, NULL, and rz_list_iter_t::p.

Referenced by _merge_sort().

◆ _merge_sort()

static RzListIter* _merge_sort ( RzListIter head,
RzListComparator  cmp 
)
static

Definition at line 683 of file list.c.

683  {
684  RzListIter *second;
685  if (!head || !head->n) {
686  return head;
687  }
688  second = _r_list_half_split(head);
689  head = _merge_sort(head, cmp);
690  second = _merge_sort(second, cmp);
691  return _merge(head, second, cmp);
692 }
static RzListIter * _r_list_half_split(RzListIter *head)
Definition: list.c:665
static RzListIter * _merge(RzListIter *first, RzListIter *second, RzListComparator cmp)
Definition: list.c:634
static RzListIter * _merge_sort(RzListIter *head, RzListComparator cmp)
Definition: list.c:683

References _merge(), _r_list_half_split(), cmp(), and test-lz4-versions::head.

Referenced by rz_list_merge_sort().

◆ _r_list_half_split()

static RzListIter* _r_list_half_split ( RzListIter head)
static

Definition at line 665 of file list.c.

665  {
666  RzListIter *tmp;
667  RzListIter *fast;
668  RzListIter *slow;
669  if (!head || !head->n) {
670  return head;
671  }
672  slow = head;
673  fast = head;
674  while (fast && fast->n && fast->n->n) {
675  fast = fast->n->n;
676  slow = slow->n;
677  }
678  tmp = slow->n;
679  slow->n = NULL;
680  return tmp;
681 }
static char * slow(struct match *, char *, char *, sopno, sopno)
Definition: engine.c:806
static char * fast(struct match *, char *, char *, sopno, sopno)
Definition: engine.c:717

References fast(), test-lz4-versions::head, NULL, slow(), and autogen_x86imm::tmp.

Referenced by _merge_sort().

◆ rz_list_add_sorted()

RZ_API RZ_BORROW RzListIter* rz_list_add_sorted ( RZ_NONNULL RzList list,
void *  data,
RZ_NONNULL RzListComparator  cmp 
)

Adds an element to a sorted list via the RzListComparator.

Definition at line 518 of file list.c.

518  {
519  RzListIter *it, *item = NULL;
520 
521  rz_return_val_if_fail(list && data && cmp, NULL);
522 
523  for (it = list->head; it && it->data && cmp(data, it->data) > 0; it = it->n) {
524  ;
525  }
526  if (it) {
527  item = RZ_NEW0(RzListIter);
528  if (!item) {
529  return NULL;
530  }
531  item->n = it;
532  item->p = it->p;
533  item->data = data;
534  item->n->p = item;
535  if (!item->p) {
536  list->head = item;
537  } else {
538  item->p->n = item;
539  }
540  list->length++;
541  } else {
542  rz_list_append(list, data);
543  }
544  list->sorted = true;
545  return item;
546 }
static void list(RzEgg *egg)
Definition: rz-gg.c:52
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
Definition: list.c:288
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108
#define RZ_NEW0(x)
Definition: rz_types.h:284

References cmp(), rz_list_iter_t::data, list(), rz_list_iter_t::n, NULL, rz_list_iter_t::p, rz_list_append(), RZ_NEW0, and rz_return_val_if_fail.

Referenced by add_hit_to_sorted_hits(), add_refline(), agraph_print_edges(), collect_changes(), handle_forward_disassemble(), rz_analysis_reflines_str(), rz_bin_mz_get_segments(), rz_core_asm_back_disassemble_all(), sort_loclists(), valgroup_regcb(), and winkd_list_modules().

◆ rz_list_append()

RZ_API RZ_BORROW RzListIter* rz_list_append ( RZ_NONNULL RzList list,
void *  data 
)

Appends at the end of the list a new element.

Definition at line 288 of file list.c.

288  {
289  RzListIter *item = NULL;
290 
292 
293  item = RZ_NEW(RzListIter);
294  if (!item) {
295  return item;
296  }
297  if (list->tail) {
298  list->tail->n = item;
299  }
300  item->data = data;
301  item->p = list->tail;
302  item->n = NULL;
303  list->tail = item;
304  if (!list->head) {
305  list->head = item;
306  }
307  list->length++;
308  list->sorted = false;
309  return item;
310 }
#define RZ_NEW(x)
Definition: rz_types.h:285

References rz_list_iter_t::data, list(), rz_list_iter_t::n, NULL, rz_list_iter_t::p, RZ_NEW, and rz_return_val_if_fail.

Referenced by __childrenFlagsOf(), __create_iter_sections(), __fcns(), __fix_layout_h(), __fix_layout_w(), __io_maps(), __ne_get_resources(), __refs(), __save_old_sections(), __sorted_list(), __xrefs(), _list(), _parse_resource_directory(), add_arg_fmt(), add_hit_to_hits(), add_item_to_regset(), add_library(), add_map(), add_new_func_symbol(), add_refline(), add_thread(), add_tls_callbacks(), addrom(), addsym(), adjust_class(), agraph_follow_innodes(), agraph_print_edges(), analPaths(), append_bound(), append_to_list(), appendRef(), ar_open_all(), arch_parse_reg_profile(), backedge_info(), backtrace_fuzzy(), backtrace_windows(), backtrace_windows_x64(), backtrace_x86_32(), backtrace_x86_32_analysis(), backtrace_x86_64(), backtrace_x86_64_analysis(), base_type_collect_cb(), base_type_kind_collect_cb(), base_type_typeclass_collect_cb(), base_type_typeclass_sized_collect_cb(), basefind_thread_runner(), bin_pe_dotnet_init_metadata(), bin_pe_init_rich_info(), bsd_desc_list(), bsd_native_sysctl_map(), bsd_pid_list(), bsd_thread_list(), calc_reachable_and_remove_block(), callback_list(), classes(), classes_from_symbols(), cmd_descriptor_init(), cmd_print_gadget(), compute_classes(), compute_vertical_nodes(), construct_rop_gadget(), copy_into_flagitem_list(), create_cache_bins(), create_dummy_nodes(), create_initterm_syms(), DEFINE_HANDLE_TS_FCN_AND_SYMBOL(), deserialize_checkpoints_cb(), dex_class_def_new(), dex_resolve_entrypoints_in_class(), dex_resolve_fields_in_class(), dex_resolve_fields_in_class_as_symbols(), dex_resolve_methods_in_class(), dict2keylist(), dmp_get_modules(), ds_show_xrefs(), duplicate_flag(), entries(), extract_sections_symbols(), fields(), fill_exports_list(), filter_function(), flirt_create_child_from_analysis(), flirt_module_new(), flirt_node_shorten_and_insert(), flirt_pat_parse_line(), format_collect_cb(), function_names_collect_cb(), gdbr_parse_processes_xml(), gdbr_pids_list(), gdbr_threads_list(), get_array_object_generic(), get_constants(), get_dict_object(), get_entries_from_section(), get_interned_object(), get_ivar_list_t(), get_maps_unpatched(), get_method_list_t(), get_objc_property_list(), get_object(), get_sections_or_segment(), get_segments(), get_symbols_list(), global_var_collect_cb(), handle_cmd_substitution_arg(), hex_extend_op(), hud_filter(), hudstuff_append(), imports(), iter_glob_flag(), le_get_entries(), le_get_symbols_at(), libs(), linux_add_new_thread(), linux_desc_list(), linux_pid_list(), linux_thread_list(), listcb(), listFlag(), load_buffer(), lua_parse_const_entry(), lua_parse_debug(), lua_parse_protos(), lua_parse_upvalue_entry(), luac_add_entry(), luac_add_section(), luac_add_string(), luac_add_symbol(), MACH0_(), maps(), mem(), noreturn_function_names_collect_cb(), oneshotall(), oneshotall_buffer(), pager_all_matches(), parse_alias(), parse_categories(), parse_classes(), parse_custom_name_entry(), parse_dbi_stream_ex_header(), parse_def(), parse_enum(), parse_format(), parse_function_args_and_vars(), parse_gdata_stream(), parse_hash_algorithms(), parse_leaf(), parse_loc_raw(), parse_omap_stream(), parse_pe_stream(), parse_reg_profile_str(), parse_structure(), parse_tree(), parse_type_fieldlist(), parse_type_methodlist(), parse_union(), pdb7_extract_streams(), pidlist_cb(), populate_cache_headers(), print_rop(), process_constructors(), read_image_metadata_tilde_header(), read_module_public_functions(), read_module_referenced_functions(), read_module_tail_bytes(), recursive_search_glob(), relocs(), resolve_mig_subsystem(), resolve_syscalls(), rtti_msvc_read_base_class_array(), run_basic_block_analysis(), rz_analysis_add(), rz_analysis_add_device_peripheral_map(), rz_analysis_add_function(), rz_analysis_calling_conventions(), rz_analysis_function_add_block(), rz_analysis_function_all_opcode_stat_handler(), rz_analysis_function_import_list_handler(), rz_analysis_function_list_ascii_handler(), rz_analysis_noreturn_functions(), rz_analysis_op_copy(), rz_analysis_rtti_itanium_recover_all(), rz_analysis_switch_op_add_case(), rz_analysis_types_from_fcn(), rz_analysis_var_global_list_show(), rz_analysis_vtable_search(), rz_asm_add(), rz_asm_code_set_equ(), rz_bin_dex_classes(), rz_bin_dex_imports(), rz_bin_dex_libraries(), rz_bin_dex_sections(), rz_bin_dex_strings(), rz_bin_dex_symbols(), rz_bin_dmp64_init_bmp_pages(), rz_bin_dmp64_init_memory_runs(), rz_bin_elf_get_libs(), rz_bin_elf_section_flag_to_rzlist(), rz_bin_file_add_class(), rz_bin_file_add_method(), rz_bin_file_new_from_buffer(), rz_bin_file_xtr_load_buffer(), rz_bin_java_class_as_libraries(), rz_bin_java_class_as_sections(), rz_bin_java_class_const_pool_as_imports(), rz_bin_java_class_const_pool_as_symbols(), rz_bin_java_class_entrypoints(), rz_bin_java_class_fields_as_binfields(), rz_bin_java_class_fields_as_symbols(), rz_bin_java_class_methods_as_symbols(), rz_bin_java_class_strings(), rz_bin_le_get_entrypoints(), rz_bin_le_get_imports(), rz_bin_le_get_libs(), rz_bin_le_get_relocs(), rz_bin_le_get_sections(), rz_bin_mdmp_init_directory_entry(), rz_bin_mdmp_init_pe_bins(), rz_bin_mdmp_pe_get_entrypoint(), rz_bin_mdmp_pe_get_imports(), rz_bin_mdmp_pe_get_sections(), rz_bin_mdmp_pe_get_symbols(), rz_bin_ne_get_entrypoints(), rz_bin_ne_get_imports(), rz_bin_ne_get_relocs(), rz_bin_ne_get_segments(), rz_bin_ne_get_symbols(), rz_bin_object_sections_mapping_list(), rz_bin_omf_send_sections(), rz_bin_pe_get_clr_symbols(), rz_bin_plugin_add(), rz_bin_sections_of_maps(), rz_bin_string_database_add(), rz_bin_wasm_get_custom_name_entries(), rz_bin_wasm_get_sections(), rz_bin_wasm_get_sections_by_id(), rz_bin_xtr_add(), rz_bp_item_insert(), rz_bp_plugin_add(), rz_bp_traptrace_add(), rz_cmd_debug_process_profile_handler(), rz_cmd_info_section_bars_handler(), rz_cmd_kuery(), rz_cmd_macro_add(), rz_cmd_print_gadget_add_handler(), rz_cmd_search(), rz_config_add_node(), rz_config_clone(), rz_config_hold_i(), rz_config_hold_s(), rz_config_set(), rz_config_set_b(), rz_config_set_i(), rz_cons_grep_line(), rz_cons_hud_string(), rz_core_analysis_bbs_asciiart(), rz_core_analysis_callgraph(), rz_core_analysis_cycles(), rz_core_analysis_graph_to(), rz_core_analysis_propagate_noreturn(), rz_core_asm_strsearch(), rz_core_cmd_foreach3(), rz_core_cmd_subst_i(), rz_core_cmp_disasm(), rz_core_cmpwatch_add(), rz_core_config_in_space(), rz_core_debug_backtraces(), rz_core_file_open(), rz_core_file_open_many(), rz_core_gdiff_function_1_file(), rz_core_gdiff_function_2_files(), rz_core_get_boundaries_prot(), rz_core_get_func_args(), rz_core_plugin_add(), rz_core_search_rop(), rz_core_seek_list(), rz_core_task_enqueue(), rz_core_task_enqueue_oneshot(), rz_core_task_schedule(), rz_core_task_scheduler_init(), rz_core_theme_list(), rz_core_visual_config_hud(), rz_core_visual_hudclasses(), rz_crypto_add(), rz_debug_add_checkpoint(), rz_debug_bochs_map_get(), rz_debug_dmp_maps(), rz_debug_dmp_modules(), rz_debug_dmp_pids(), rz_debug_dmp_threads(), rz_debug_esil_watch(), rz_debug_gdb_map_get(), rz_debug_gdb_modules_get(), rz_debug_native_map_get(), rz_debug_plugin_add(), rz_debug_qnx_pids(), rz_debug_trace_add(), rz_debug_traces_info(), rz_debug_winkd_maps(), rz_debug_winkd_modules(), rz_debug_winkd_pids(), rz_debug_winkd_threads(), rz_demangler_new(), rz_demangler_plugin_add(), rz_diff_matches_new(), rz_diff_opcodes_grouped_new(), rz_diff_opcodes_new(), rz_dyldcache_symbols_from_locsym(), rz_egg_add(), rz_egg_patch(), rz_file_globsearch(), rz_flag_tags_list(), rz_flag_zone_add(), rz_flag_zone_barlist(), rz_graph_add_edge_at(), rz_graph_add_node(), rz_graph_node_split_forward(), rz_hash_cfg_configure(), rz_hash_plugin_add(), rz_heap_arenas_list(), rz_heap_bin_content(), rz_heap_blocks_list(), rz_heap_chunks_list(), rz_heap_fastbin_content(), rz_heap_list(), rz_heap_tcache_content(), rz_il_vm_event_add(), rz_io_ar_open_many(), rz_io_map_get_for_fd(), rz_io_plugin_add(), rz_io_zip_get_files(), rz_io_zip_open_many(), rz_lang_add(), rz_lang_define(), rz_lib_add_handler(), rz_lib_open_ptr(), rz_list_add_sorted(), rz_list_clone(), rz_list_insert(), rz_list_new_from_array(), rz_list_of_sdblist(), rz_list_push(), rz_list_uniq(), rz_log_add_callback(), rz_main_rizin(), rz_main_rz_find(), rz_main_rz_sign(), rz_num_str_split_list(), rz_open_binary_file_handler(), rz_open_binary_list_ascii_handler(), rz_open_maps_list_ascii_handler(), rz_parse_add(), rz_range_add(), rz_reg_reindex(), rz_regex_get_match_list(), rz_regs_show_valgroup(), rz_scan_strings_raw(), rz_search_hit_new(), rz_search_kw_add(), rz_serialize_spaces_load(), rz_sign_flirt_node_new(), rz_skiplist_to_list(), rz_spaces_unset(), rz_str_scale(), rz_str_wrap(), rz_sys_dir(), rz_syscmd_join(), rz_table_query(), rz_table_transpose(), rz_th_queue_push(), rz_tree_add_node(), rz_type_db_all(), rz_type_db_enum_names(), rz_type_db_find_enums_by_val(), rz_type_db_struct_names(), rz_type_db_typedef_names(), rz_type_db_union_names(), rz_type_path_by_offset(), rz_w32_dbg_modules(), rz_xnu_update_thread_list(), search_string_thread_runner(), section_flag_to_rzlist(), sections(), sections_from_bin(), sections_from_mach0(), set_access_info(), set_b(), set_options(), sigdb_to_list(), stack_append_block(), str_split_list_common(), str_split_list_common_regex(), string_scan_range_cfstring(), structured_member_walker(), symbols(), symbols_from_bin(), symbols_from_mach0(), symbols_from_stubs(), system_exec(), task_wakeup(), tokenize_lines(), trycatch(), type_collect_cb(), update_asmfeatures_options(), update_asmplatforms_options(), update_flag_item_offset(), var_add_structure_fields_to_list(), view_cyclic_edge(), view_dummy(), w32_desc_list(), w32_pid_list(), w32_thread_list(), walkSymbols(), windbg_frames(), windbg_map_get(), windbg_modules_get(), windbg_pids(), windbg_threads(), winkd_list_process(), winkd_list_threads(), winkd_walk_vadtree(), xnu_dbg_maps(), xnu_dbg_modules(), xnu_thread_list(), and zone_load_cb().

◆ rz_list_clone()

RZ_API RZ_OWN RzList* rz_list_clone ( RZ_NONNULL const RzList list)

Shallow copies of the list (but doesn't free its elements)

Definition at line 496 of file list.c.

496  {
497  RzListIter *iter;
498  void *data;
499 
501 
502  RzList *l = rz_list_new();
503  if (!l) {
504  return NULL;
505  }
506  l->free = NULL;
507  rz_list_foreach (list, iter, data) {
508  rz_list_append(l, data);
509  }
510  l->sorted = list->sorted;
511  return l;
512 }
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
Definition: list.c:235
RzListFree free
Definition: rz_list.h:21
bool sorted
Definition: rz_list.h:23

References rz_list_t::free, list(), NULL, rz_list_append(), rz_list_new(), rz_return_val_if_fail, and rz_list_t::sorted.

Referenced by copy_object(), filter_reg_items(), get_next_i(), maps(), relocs(), rz_analysis_block_chop_noreturn(), rz_analysis_function_list_ascii_handler(), rz_config_node_clone(), rz_core_analysis_propagate_noreturn(), rz_core_task_join(), rz_debug_native_frames(), sections(), and update_analysis().

◆ rz_list_contains()

RZ_API RZ_BORROW RzListIter* rz_list_contains ( RZ_NONNULL const RzList list,
RZ_NONNULL const void *  ptr 
)

Returns the RzListIter of the given pointer, if found.

Definition at line 592 of file list.c.

592  {
593  return rz_list_find_ptr(list, ptr);
594 }
RZ_API RZ_BORROW RzListIter * rz_list_find_ptr(RZ_NONNULL const RzList *list, RZ_NONNULL const void *ptr)
Returns the RzListIter of the given pointer, if found.
Definition: list.c:600

References list(), and rz_list_find_ptr().

Referenced by analize_addr_cb(), calc_reachable_and_remove_block(), get_bb_body(), get_functions_block_cb(), noreturn_remove_unreachable_cb(), pr_bb(), run_basic_block_analysis(), rz_analysis_block_chop_noreturn(), rz_analysis_block_merge(), rz_analysis_function_add_block(), rz_core_analysis_propagate_noreturn(), rz_graph_adjacent(), and rz_log_add_callback().

◆ rz_list_del_n()

RZ_API ut32 rz_list_del_n ( RZ_NONNULL RzList list,
ut32  n 
)

Removes the N-th element of the list.

Definition at line 425 of file list.c.

425  {
426  RzListIter *it;
427  ut32 i;
428 
429  rz_return_val_if_fail(list, false);
430 
431  for (it = list->head, i = 0; it && it->data; it = it->n, i++) {
432  if (i == n) {
433  if (!it->p && !it->n) {
434  list->head = list->tail = NULL;
435  } else if (!it->p) {
436  it->n->p = NULL;
437  list->head = it->n;
438  } else if (!it->n) {
439  it->p->n = NULL;
440  list->tail = it->p;
441  } else {
442  it->p->n = it->n;
443  it->n->p = it->p;
444  }
445  free(it);
446  list->length--;
447  return true;
448  }
449  }
450  return false;
451 }
lzma_index ** i
Definition: index.h:629
uint32_t ut32
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
int n
Definition: mipsasm.c:19

References rz_list_iter_t::data, free(), i, list(), n, rz_list_iter_t::n, NULL, rz_list_iter_t::p, and rz_return_val_if_fail.

◆ rz_list_delete()

◆ rz_list_delete_data()

RZ_API bool rz_list_delete_data ( RZ_NONNULL RzList list,
void *  ptr 
)

Deletes an entry in the list by searching for a pointer.

Definition at line 148 of file list.c.

148  {
149  rz_return_val_if_fail(list, false);
151  if (!iter) {
152  return false;
153  }
155  return true;
156 }
RZ_API void rz_list_delete(RZ_NONNULL RzList *list, RZ_NONNULL RzListIter *iter)
Removes an entry in the list by using the RzListIter pointer.
Definition: list.c:162

References list(), rz_list_delete(), rz_list_find_ptr(), and rz_return_val_if_fail.

Referenced by delete_dup_edges(), hex_extend_op(), remove_library(), remove_offsetmap(), rz_analysis_function_delete(), rz_analysis_function_free(), rz_analysis_function_remove_block(), rz_bin_string_database_remove(), rz_bp_del_index(), rz_config_rm(), rz_crypto_del(), rz_graph_del_edge(), rz_graph_del_node(), rz_graph_node_split_forward(), rz_log_del_callback(), rz_reg_free_internal(), unlinkBreakpoint(), and w32_continue().

◆ rz_list_find()

RZ_API RZ_BORROW RzListIter* rz_list_find ( RZ_NONNULL const RzList list,
const void *  p,
RZ_NONNULL RzListComparator  cmp 
)

◆ rz_list_find_ptr()

RZ_API RZ_BORROW RzListIter* rz_list_find_ptr ( RZ_NONNULL const RzList list,
RZ_NONNULL const void *  ptr 
)

Returns the RzListIter of the given pointer, if found.

Definition at line 600 of file list.c.

600  {
602  void *p;
603  RzListIter *iter;
604  rz_list_foreach (list, iter, p) {
605  if (ptr == p) {
606  return iter;
607  }
608  }
609  return NULL;
610 }

References list(), NULL, p, and rz_return_val_if_fail.

Referenced by rz_bin_file_delete(), rz_core_file_close(), rz_core_file_open(), rz_list_contains(), and rz_list_delete_data().

◆ rz_list_first()

RZ_API RZ_BORROW void* rz_list_first ( RZ_NONNULL const RzList list)

Returns the first element of the list.

Definition at line 77 of file list.c.

77  {
79  return list->head ? list->head->data : NULL;
80 }

References list(), NULL, and rz_return_val_if_fail.

Referenced by agraph_print_edges(), analysis_get_function_in(), autoname_imp_trampoline(), cmd_print_bars(), diff_unified_append_ranges(), diff_unified_json_ranges(), do_string_search(), fcn_takeover_block_recursive_followthrough_cb(), fix_back_edge_dummy_nodes(), flirt_compare_module(), get_edge_number(), get_next_i(), meta_string_guess_add(), pager_next_match(), pager_prev_match(), parse_enum(), parse_structure(), parse_union(), rz_agraph_get_first_node(), rz_analysis_block_merge(), rz_analysis_delete_block(), rz_analysis_function_analyze_jmptable_handler(), rz_analysis_function_blocks_del_all_handler(), rz_analysis_function_blocks_del_handler(), rz_analysis_function_blocks_edge_handler(), rz_analysis_function_blocks_switch_type_handler(), rz_analysis_get_fcn_in(), rz_bin_wasm_get_codes(), rz_bin_wasm_get_custom_names(), rz_bin_wasm_get_datas(), rz_bin_wasm_get_elements(), rz_bin_wasm_get_entrypoint(), rz_bin_wasm_get_exports(), rz_bin_wasm_get_globals(), rz_bin_wasm_get_imports(), rz_bin_wasm_get_memories(), rz_bin_wasm_get_tables(), rz_bin_wasm_get_types(), rz_core_analysis_bb_info_print(), rz_core_file_close_fd(), rz_core_file_open_many(), rz_core_types_link(), rz_diff_opcodes_grouped_new(), v850_tokenize(), winkd_set_target(), and z80_tokenize().

◆ rz_list_free()

RZ_API void rz_list_free ( RZ_NONNULL RzList list)

Empties the list and frees the list pointer.

Definition at line 137 of file list.c.

137  {
138  if (list) {
140  free(list);
141  }
142 }
RZ_API void rz_list_purge(RZ_NONNULL RzList *list)
Empties the list without freeing the list pointer.
Definition: list.c:120

References free(), list(), and rz_list_purge().

Referenced by __clear_layout_cb(), __core_analysis_fcn(), __file_history_down(), __file_history_up(), __fix_layout_h(), __free_resource(), __get_panels_config_file_from_dir(), __init_menu_color_settings_layout(), __init_menu_disasm_asm_settings_layout(), __init_menu_disasm_settings_layout(), __init_menu_saved_layout(), __io_maps(), __printRecursive(), __sync_status_with_cursor(), _extract_flags(), _extract_regs(), add_single_addr_xrefs(), adjust_class(), agraph_edge_free(), agraph_follow_innodes(), agraph_print_edges(), analysis_function_vars_accesses(), analysis_get_function_in(), analysis_graph_to(), analysis_path_exists(), analysis_preludes(), ar_open_all(), ar_parse_header(), arch_parse_reg_profile(), assign_layers(), autocmplt_cmd_arg_alias_type(), autocmplt_cmd_arg_any_type(), autocmplt_cmd_arg_enum_type(), autocmplt_cmd_arg_fcn_var(), autocmplt_cmd_arg_file(), autocmplt_cmd_arg_flag(), autocmplt_cmd_arg_global_var(), autocmplt_cmd_arg_struct_type(), autocmplt_cmd_arg_union_type(), autocomplete_process_path(), autocomplete_theme(), autoname_imp_trampoline(), backtrace_fuzzy(), backtrace_windows_x64(), basefind_create_array_of_addresses(), bb_info_print(), bbget(), bin_dwarf(), bin_file_string_search_free(), bin_pe_dotnet_destroy_clr(), bin_pe_dotnet_init_metadata(), block_free(), bsd_desc_list(), bsd_thread_list(), calculate_hash(), carve_kexts(), cb_analysis_roregs(), check_purity(), classes(), cmd_aea(), cmd_debug_current_modules(), cmd_debug_modules(), cmd_print_bars(), cmd_print_blocks(), cmd_print_format(), cmd_print_gadget(), combine_sequences(), compute_pos(), construct_rop_gadget(), core_analysis_var_list_show(), create_cache_bins(), database_load(), DEFINE_HANDLE_TS_FCN_AND_SYMBOL(), destroy(), dex_class_def_free(), dmp_get_modules(), do_analysis_search(), do_debug_trace_calls(), do_ref_search(), ds_build_op_str(), ds_print_esil_analysis(), ds_print_ptr(), ds_reflines_fini(), ds_reflines_init(), ds_show_flags(), ds_show_refs(), ds_show_xrefs(), ensure_kexts_initialized(), entries(), fcn_print_info(), fill_wrapped_comment(), find_apk_binary(), find_block_at_xref_addr(), find_ipa_binary(), flag_skiplist_free(), flag_tag_print(), flirt_node_optimize(), flirt_pat_parse_line(), free_dbi_stream(), free_gdata_stream(), free_hits(), free_loc_table_list(), free_object(), free_omap_stream(), free_opcode(), free_pe_stream(), free_rz_bin_class(), free_tpi_stream(), free_tpi_type(), free_vertical_nodes_kv(), function_list_print_as_cmd(), function_list_print_to_table(), function_print_calls(), function_print_to_json(), gdbr_parse_target_xml(), gdbr_pids_list(), gdbr_threads_list(), get_array_object_generic(), get_callable_type(), get_cgnodes(), get_dict_object(), get_next_i(), get_sections_symbols_from_code_objects(), get_windows(), GetHeapGlobalsOffset(), getref(), group_op_free(), imports(), InitHeapInfo(), is_cpu_valid(), iter_dbt_commands(), kexts_from_load_commands(), line_free(), linux_attach_new_process(), linux_dbg_wait(), linux_desc_list(), linux_info(), linux_pid_list(), linux_thread_list(), list_themes_in_path(), load_buffer(), load_scripts_for(), lua_free_proto_entry(), map_cpu_memory(), maps(), mem(), meta_string_guess_add(), mht_free_kv(), module_free(), parse_asm_path(), parse_categories(), parse_classes(), parse_custom_name_entry(), parse_function(), parse_omap_stream(), parse_pe_stream(), parse_reg_profile_str(), parse_type_fieldlist(), parse_type_methodlist(), pdb7_extract_streams(), place_original(), populate_cache_headers(), print_diff(), print_rop(), print_stats(), print_tcache_content(), rax(), read_module_tail_bytes(), recovery_complete_object_locator_free(), recursive_search_glob(), regs_to_flags(), reloc_targets_map_base(), relocs(), resolve_mig_subsystem(), resolve_syscalls(), rop_classify_arithmetic_const(), rop_classify_constant(), rtr_dir_files(), rtti_msvc_read_base_class_array(), run_basic_block_analysis(), rz_agraph_free(), rz_agraph_reset(), rz_analysis_analyze_fcn_refs(), rz_analysis_basic_block_find_paths_handler(), rz_analysis_basic_block_list_handler(), rz_analysis_block_automerge(), rz_analysis_block_chop_noreturn(), rz_analysis_cc_set(), rz_analysis_cycle_frame_free(), rz_analysis_del_jmprefs(), rz_analysis_extract_rarg(), rz_analysis_fcn_vars_cache_fini(), rz_analysis_free(), rz_analysis_function_all_opcode_stat_handler(), rz_analysis_function_analyze_jmptable_handler(), rz_analysis_function_blocks_edge_handler(), rz_analysis_function_blocks_switch_type_handler(), rz_analysis_function_describe_offset_handler(), rz_analysis_function_free(), rz_analysis_function_import_list_del_handler(), rz_analysis_function_info_handler(), rz_analysis_function_list_ascii_handler(), rz_analysis_function_list_in_handler(), rz_analysis_function_rebase_vars(), rz_analysis_function_update_analysis(), rz_analysis_function_vars_dis_refs_handler(), rz_analysis_function_vars_stackframe_handler(), rz_analysis_function_xrefs_handler(), rz_analysis_get_fcn_in(), rz_analysis_get_used_function_var(), rz_analysis_is_prelude(), rz_analysis_list_struct_offsets_handler(), rz_analysis_list_vtables(), rz_analysis_op_fini(), rz_analysis_purge(), rz_analysis_reflines_get(), rz_analysis_reflines_str(), rz_analysis_rtti_itanium_recover_all(), rz_analysis_rtti_print_all(), rz_analysis_rtti_recover_all(), rz_analysis_set_stringrefs(), rz_analysis_switch_op_free(), rz_analysis_syscall_print_handler(), rz_analysis_trim_jmprefs(), rz_analysis_types_from_fcn(), rz_analysis_update_analysis_range(), rz_analysis_var_all_list(), rz_analysis_var_count(), rz_analysis_var_global_list_show(), rz_analysis_vtable_parse_at(), rz_analysis_vtable_search(), rz_analysis_xrefs_copy_handler(), rz_analysis_xrefs_del_handler(), rz_analysis_xrefs_from_list_handler(), rz_analysis_xrefs_get_from(), rz_analysis_xrefs_get_to(), rz_analysis_xrefs_list_handler(), rz_analysis_xrefs_to_graph_cmd_handler(), rz_analysis_xrefs_to_list_handler(), rz_analyze_all_consecutive_functions_in_section_handler(), rz_analyze_all_data_references_to_code_handler(), rz_analyze_cycles_handler(), rz_asm_code_free(), rz_asm_free(), rz_bin_class_free(), rz_bin_dex_entrypoints(), rz_bin_dex_fields(), rz_bin_dex_symbols(), rz_bin_dmp64_free(), rz_bin_dwarf_line_info_free(), rz_bin_elf_get_libs(), rz_bin_elf_section_flag_to_rzlist(), rz_bin_file_compute_hashes(), rz_bin_file_free(), rz_bin_file_golang_compiler(), rz_bin_file_xtr_load_buffer(), rz_bin_free(), rz_bin_info_free(), rz_bin_java_class_as_source_code(), rz_bin_le_get_relocs(), rz_bin_le_get_symbols(), rz_bin_maps_of_file_sections(), rz_bin_mdmp_free(), rz_bin_mdmp_pe_get_sections(), rz_bin_mem_free(), rz_bin_mz_get_segments(), rz_bin_ne_free(), rz_bin_ne_get_entrypoints(), rz_bin_new(), rz_bin_object_free(), rz_bin_object_sections_mapping_list(), rz_bin_object_set_items(), rz_bin_pdb_free(), rz_bin_pe_free(), rz_bin_reloc_storage_new(), rz_bin_string_database_free(), rz_bin_string_database_new(), rz_bin_wasm_destroy(), rz_bin_wasm_get_codes(), rz_bin_wasm_get_custom_name_entries(), rz_bin_wasm_get_custom_names(), rz_bin_wasm_get_datas(), rz_bin_wasm_get_elements(), rz_bin_wasm_get_entrypoint(), rz_bin_wasm_get_exports(), rz_bin_wasm_get_globals(), rz_bin_wasm_get_imports(), rz_bin_wasm_get_memories(), rz_bin_wasm_get_tables(), rz_bin_wasm_get_types(), rz_bp_free(), rz_cf_value_array_free(), rz_cf_value_dict_free(), rz_cf_value_dict_parse(), rz_cmd_arena_print_handler(), rz_cmd_cmp_disasm_handler(), rz_cmd_cmp_unified_disasm_handler(), rz_cmd_debug_display_bt_ascii_handler(), rz_cmd_debug_display_bt_handler(), rz_cmd_debug_display_bt_local_vars_handler(), rz_cmd_debug_display_bt_oneline_handler(), rz_cmd_debug_process_profile_handler(), rz_cmd_debug_step_until_optype_handler(), rz_cmd_eval_color_load_theme_handler(), rz_cmd_heap_chunks_print_handler(), rz_cmd_help(), rz_cmd_info_cur_section_handler(), rz_cmd_info_cur_segment_handler(), rz_cmd_info_hashes_handler(), rz_cmd_info_resources_handler(), rz_cmd_info_section_bars_handler(), rz_cmd_info_sections_handler(), rz_cmd_info_segments_handler(), rz_cmd_macro_fini(), rz_cmd_print(), rz_cmd_print_gadget_remove_handler(), rz_cmd_search(), rz_config_free(), rz_config_hold_free(), rz_config_node_free(), rz_cons_grepbuf(), rz_cons_hud(), rz_cons_hud_path(), rz_cons_hud_string(), rz_cons_less_str(), rz_core_analysis_all_vars_display(), rz_core_analysis_bbs_asciiart(), rz_core_analysis_callgraph(), rz_core_analysis_calls(), rz_core_analysis_calls_count(), rz_core_analysis_coderefs(), rz_core_analysis_cycles(), rz_core_analysis_datarefs(), rz_core_analysis_esil_default(), rz_core_analysis_everything(), rz_core_analysis_fcn(), rz_core_analysis_function_add(), rz_core_analysis_function_autoname(), rz_core_analysis_function_signature(), rz_core_analysis_function_strings_print(), rz_core_analysis_hint_set_offset(), rz_core_analysis_paths(), rz_core_analysis_propagate_noreturn(), rz_core_analysis_propagate_noreturn_relocs(), rz_core_analysis_refs(), rz_core_analysis_resolve_jumps(), rz_core_analysis_sigdb_apply(), rz_core_analysis_sigdb_print(), rz_core_analysis_type_match(), rz_core_analysis_value_pointers(), rz_core_asm_bwdis_len(), rz_core_asm_bwdisassemble(), rz_core_autocomplete(), rz_core_bin_basefind_print(), rz_core_bin_dwarf_print_loc(), rz_core_bin_sections_print(), rz_core_bin_segments_print(), rz_core_bin_whole_strings_print(), rz_core_cmd_foreach(), rz_core_cmd_foreach3(), rz_core_cmd_subst_i(), rz_core_cmp_disasm(), rz_core_debug_backtraces(), rz_core_debug_continue_until(), rz_core_debug_print_status(), rz_core_file_open_many(), rz_core_file_reopen_debug(), rz_core_file_reopen_remote_debug(), rz_core_fini(), rz_core_flirt_app_from_option_list(), rz_core_flirt_file_from_option_list(), rz_core_flirt_os_from_option_list(), rz_core_gdiff_function_1_file(), rz_core_gdiff_function_2_files(), rz_core_get_func_args(), rz_core_io_file_open(), rz_core_io_pcache_print(), rz_core_io_plugin_print(), rz_core_loadlibs(), rz_core_parse_rizinrc(), rz_core_plugin_fini(), rz_core_print_disasm_json(), rz_core_print_func_args(), rz_core_print_scrollbar(), rz_core_print_scrollbar_bottom(), rz_core_raw_file_print(), rz_core_reg_filter_items_sync(), rz_core_rtr_http_run(), rz_core_search_preludes(), rz_core_search_rop(), rz_core_seek_list(), rz_core_task_join(), rz_core_task_scheduler_fini(), rz_core_theme_nextpal(), rz_core_types_calling_conventions_print(), rz_core_types_enum_as_c_all(), rz_core_types_enum_print_all(), rz_core_types_function_noreturn_print(), rz_core_types_function_print_all(), rz_core_types_link(), rz_core_types_print_all(), rz_core_types_struct_as_c_all(), rz_core_types_struct_print_all(), rz_core_types_struct_print_format_all(), rz_core_types_typedef_as_c_all(), rz_core_types_typedef_print_all(), rz_core_types_union_as_c_all(), rz_core_types_union_print_all(), rz_core_types_union_print_format_all(), rz_core_vfile_bin_file_deleted(), rz_core_visual_config_hud(), rz_core_visual_hudclasses(), rz_core_visual_hudstuff(), rz_core_visual_trackflags(), rz_core_visual_view_graph(), rz_core_visual_view_rop(), rz_core_visual_xrefs(), rz_crypto_free(), rz_debug_bochs_map_get(), rz_debug_bp_add(), rz_debug_checkpoint_fini(), rz_debug_dmp_frames(), rz_debug_dmp_maps(), rz_debug_dmp_modules(), rz_debug_dmp_pids(), rz_debug_dmp_threads(), rz_debug_esil_watch_reset(), rz_debug_free(), rz_debug_gdb_info(), rz_debug_gdb_map_get(), rz_debug_gdb_modules_get(), rz_debug_map_sync(), rz_debug_pid_list(), rz_debug_thread_list(), rz_debug_traces_ascii(), rz_debug_traces_info(), rz_debug_winkd_attach(), rz_debug_winkd_maps(), rz_debug_winkd_modules(), rz_debug_winkd_pids(), rz_debug_winkd_select(), rz_debug_winkd_threads(), rz_demangler_free(), rz_diff_lines_new(), rz_diff_matches_new(), rz_diff_opcodes_grouped_new(), rz_diff_opcodes_new(), rz_diff_ratio(), rz_diff_unified_json(), rz_diff_unified_text(), rz_dyldcache_free(), rz_egg_config_handler(), rz_egg_free(), rz_eval_getset_handler(), rz_eval_spaces_handler(), rz_file_globsearch(), rz_flag_describe_closest_handler(), rz_flag_free(), rz_flag_graph_handler(), rz_flag_new(), rz_flag_tag_list_handler(), rz_flag_tags_get(), rz_flag_unset_all_in_space(), rz_flag_zone_reset(), rz_flirt_scan_handler(), rz_graph_free(), rz_graph_node_free(), rz_graph_reset(), rz_hash_cfg_free(), rz_hash_free(), rz_heap_bin_free(), rz_heap_blocks_list(), rz_heap_list(), rz_heap_tcache_content(), rz_il_reg_binding_derive(), rz_il_step_until_opt_handler(), rz_il_vm_fini(), rz_io_ar_open_many(), rz_io_desc_cache_list(), rz_io_fini(), rz_io_map_remap_fd(), rz_io_resize(), rz_io_zip_open(), rz_io_zip_open_many(), rz_lang_free(), rz_lang_undef(), rz_lib_free(), rz_line_free(), rz_main_rizin(), rz_main_rz_agent(), rz_main_rz_bin(), rz_main_rz_diff(), rz_main_rz_find(), rz_main_rz_sign(), rz_num_between(), rz_open_binary_file_handler(), rz_open_binary_list_ascii_handler(), rz_open_maps_list_ascii_handler(), rz_parse_free(), rz_project_migrate_v1_v2(), rz_project_migrate_v2_v3(), rz_project_migrate_v3_v4(), rz_pseudo_convert(), rz_reg_flags_handler(), rz_reg_free_internal(), rz_reg_reindex(), rz_regs_args_handler(), rz_regs_columns_handler(), rz_regs_references_handler(), rz_regs_show_valgroup(), rz_regs_valgroup_handler(), rz_search_free(), rz_serialize_result_info_free(), rz_sign_flirt_node_free(), rz_sign_sigdb_load_database(), rz_spaces_fini(), rz_spaces_unset(), rz_str_scale(), rz_str_split_lines(), rz_str_trim_lines(), rz_syscmd_join(), rz_syscmd_ls(), rz_syscmd_sort(), rz_syscmd_uniq(), rz_table_query(), rz_table_transpose(), rz_test_cmp_cmd_output(), rz_test_run_cmd_test(), rz_test_run_fuzz_test(), rz_test_run_json_test(), rz_test_test_database_load_fuzz(), rz_th_queue_free(), rz_tree_node_free(), rz_type_db_all(), rz_type_db_enum_names(), rz_type_db_find_enums_by_val(), rz_type_db_get_by_offset(), rz_type_db_struct_names(), rz_type_db_typedef_names(), rz_type_db_union_names(), rz_type_typeclass_get_default_sized(), rz_w32_add_winmsg_breakpoint(), rz_w32_dbg_maps(), rz_w32_print_windows(), rzfind_open_dir(), rzfind_open_file(), search_string_thread_runner(), sections(), sections_print_json(), sections_print_table(), set_layout(), sh_assembler(), show_regs_handler(), string_scan_range(), substitute_args(), subvar(), symbols(), syscalls_dump(), system_exec(), test_type_for_path(), tokenize_lines(), try_free_empty_list(), type_match(), types_enum_member_find_all(), types_xrefs_all(), types_xrefs_function(), update_analysis(), var_functions_show(), var_variables_show(), variable_rename(), variable_set_type(), vtable_is_addr_vtable_start_msvc(), walk_exports(), windbg_map_get(), winkd_continue(), winkd_kdctx_free(), winkd_list_modules(), winkd_set_target(), winkd_sync(), xnu_dbg_maps(), xnu_dbg_modules(), xnu_detach(), xnu_generate_corefile(), and xrefs_graph().

◆ rz_list_get_bottom()

RZ_API RZ_BORROW void* rz_list_get_bottom ( RZ_NONNULL const RzList list)

Returns the first element of the list.

Definition at line 467 of file list.c.

467  {
469 
470  return list->head ? list->head->data : NULL;
471 }

References list(), NULL, and rz_return_val_if_fail.

Referenced by parse_reg_profile_str(), rz_core_asm_bwdis_len(), and rz_core_debug_continue_until().

◆ rz_list_get_n()

RZ_API RZ_BORROW void* rz_list_get_n ( RZ_NONNULL const RzList list,
ut32  n 
)

Returns the N-th element of the list.

Definition at line 574 of file list.c.

574  {
575  RzListIter *it;
576  ut32 i;
577 
579 
580  for (it = list->head, i = 0; it && it->data; it = it->n, i++) {
581  if (i == n) {
582  return it->data;
583  }
584  }
585  return NULL;
586 }

References rz_list_iter_t::data, i, list(), n, rz_list_iter_t::n, NULL, and rz_return_val_if_fail.

Referenced by __core_visual_print_command(), __file_history_down(), __file_history_up(), __sync_status_with_cursor(), adjust_class(), adjust_directions(), agraph_follow_innodes(), cmd_print_gadget(), construct_rop_gadget(), disassemble(), follow_ref(), gdbr_parse_target_xml(), get_ref_object(), get_stringref_object(), hex_add_to_pkt(), hex_get_loop_flag(), le_get_symbols_at(), line_elem_at(), parse_alias(), parse_arg(), parse_def(), parse_reg_profile_str(), pdb_set_symbols(), pyc_op(), rabin_do_operation(), rabin_extract(), resolve_n_register(), rotate_kill_ring(), rz_bin_le_get_relocs(), rz_bin_ne_get_entrypoints(), rz_bin_ne_get_relocs(), rz_bin_ne_get_symbols(), rz_bin_pdb_omap_remap(), rz_bin_use_arch(), rz_bin_wasm_get_entrypoint(), rz_cmd_debug_process_profile_handler(), rz_cmd_kuery(), rz_cmd_print_gadget_move_handler(), rz_core_analysis_graph_to(), rz_core_bin_pdb_gvars_as_string(), rz_core_file_bin_raise(), rz_core_search_rop(), rz_core_visual_view_graph(), rz_diff_list_elem_at(), rz_egg_config_handler(), rz_eval_getset_handler(), rz_graph_nth_neighbour(), rz_io_map_remap_fd(), rz_pseudo_convert(), rz_str_scale(), rz_table_query(), type_match(), and z80_tokenize().

◆ rz_list_get_next()

RZ_API RzListIter* rz_list_get_next ( RzListIter list)

Returns the next element of the list.

Definition at line 68 of file list.c.

68  {
70  return list->n;
71 }

References list(), NULL, and rz_return_val_if_fail.

◆ rz_list_get_top()

◆ rz_list_init()

RZ_API void rz_list_init ( RZ_NONNULL RzList list)

Initializes the RzList pointer.

Definition at line 95 of file list.c.

95  {
97 
98  list->head = NULL;
99  list->tail = NULL;
100  list->free = NULL;
101  list->length = 0;
102  list->sorted = false;
103 }

References list(), NULL, and rz_return_if_fail.

Referenced by rz_analysis_block_chop_noreturn(), and rz_list_new().

◆ rz_list_insert()

RZ_API RZ_BORROW RzListIter* rz_list_insert ( RZ_NONNULL RzList list,
ut32  n,
void *  data 
)

Inserts a new element at the N-th position.

Definition at line 342 of file list.c.

342  {
343  RzListIter *it, *item;
344  ut32 i;
345 
347 
348  if (!list->head || !n) {
349  return rz_list_prepend(list, data);
350  }
351  for (it = list->head, i = 0; it && it->data; it = it->n, i++) {
352  if (i == n) {
353  item = RZ_NEW(RzListIter);
354  if (!item) {
355  return NULL;
356  }
357  item->data = data;
358  item->n = it;
359  item->p = it->p;
360  if (it->p) {
361  it->p->n = item;
362  }
363  it->p = item;
364  list->length++;
365  list->sorted = true;
366  return item;
367  }
368  }
369  return rz_list_append(list, data);
370 }
RZ_API RZ_BORROW RzListIter * rz_list_prepend(RZ_NONNULL RzList *list, void *data)
Appends at the beginning of the list a new element.
Definition: list.c:316

References rz_list_iter_t::data, i, list(), n, rz_list_iter_t::n, NULL, rz_list_iter_t::p, rz_list_append(), rz_list_prepend(), RZ_NEW, and rz_return_val_if_fail.

Referenced by _6502_tokenize(), avr_tokenize(), hex_add_to_pkt(), hex_add_to_stale_pkt(), hex_to_new_pkt(), mips_tokenize(), rz_cmd_kuery(), rz_graph_add_edge_at(), rz_line_clipboard_push(), and v850_tokenize().

◆ rz_list_insertion_sort()

RZ_API void rz_list_insertion_sort ( RZ_NONNULL RzList list,
RZ_NONNULL RzListComparator  cmp 
)

Insertion sorts the list via the RzListComparator.

Definition at line 718 of file list.c.

718  {
720 
721  if (!list->sorted) {
722  RzListIter *it;
723  RzListIter *it2;
724  if (cmp) {
725  for (it = list->head; it && it->data; it = it->n) {
726  for (it2 = it->n; it2 && it2->data; it2 = it2->n) {
727  if (cmp(it->data, it2->data) > 0) {
728  void *t = it->data;
729  it->data = it2->data;
730  it2->data = t;
731  }
732  }
733  }
734  }
735  list->sorted = true;
736  }
737 }

References cmp(), rz_list_iter_t::data, list(), rz_list_iter_t::n, and rz_return_if_fail.

Referenced by rz_list_sort().

◆ rz_list_item_new()

RZ_API RZ_OWN RzListIter* rz_list_item_new ( void *  data)

Creates a RzListIter element that can be inserted into a RzList.

Definition at line 276 of file list.c.

276  {
277  RzListIter *item = RZ_NEW0(RzListIter);
278  if (item) {
279  item->data = data;
280  }
281  return item;
282 }

References rz_list_iter_t::data, and RZ_NEW0.

◆ rz_list_iter_free()

RZ_API void rz_list_iter_free ( RzListIter list)

Definition at line 12 of file list.c.

12  {
13  /* do nothing? */
14 }

◆ rz_list_iter_get_data()

RZ_API void* rz_list_iter_get_data ( RzListIter list)

◆ rz_list_iter_get_next()

RZ_API RZ_BORROW RzListIter* rz_list_iter_get_next ( RzListIter list)

returns the next RzList iterator in the list

Definition at line 20 of file list.c.

20  {
22  return list->n;
23 }

References list(), NULL, and rz_return_val_if_fail.

Referenced by ds_print_esil_analysis(), and rz_analysis_block_recurse_depth_first().

◆ rz_list_iter_get_next_data()

RZ_API RZ_BORROW void* rz_list_iter_get_next_data ( RzListIter list)

returns the value stored in the next RzList iterator

Definition at line 29 of file list.c.

29  {
31  RzListIter *n = list->n;
32  if (!n) {
33  return NULL;
34  }
35  return n->data;
36 }

References list(), n, NULL, and rz_return_val_if_fail.

Referenced by flirt_write_node().

◆ rz_list_iter_new()

RzListIter* rz_list_iter_new ( void  )
inline

Definition at line 8 of file list.c.

8  {
9  return calloc(1, sizeof(RzListIter));
10 }
void * calloc(size_t number, size_t size)
Definition: malloc.c:102

References calloc().

◆ rz_list_iterator()

RZ_API RZ_BORROW RzListIter* rz_list_iterator ( const RzList list)

returns the first RzList iterator int the list

Definition at line 51 of file list.c.

51  {
53  return list->head;
54 }

References list(), NULL, and rz_return_val_if_fail.

Referenced by match_bin_entries(), rz_bin_pdb_omap_remap(), rz_bin_pe_get_clr_symbols(), rz_cmd_info_hashes_handler(), and rz_list_split().

◆ rz_list_join()

RZ_API bool rz_list_join ( RZ_NONNULL RzList list1,
RZ_NONNULL RzList list2 
)

Joins 2 list into one (list2 pointer needs to be freed by the user)

Definition at line 209 of file list.c.

209  {
210  rz_return_val_if_fail(list1 && list2, 0);
211 
212  if (!(list2->length)) {
213  return false;
214  }
215  if (!(list1->length)) {
216  list1->head = list2->head;
217  list1->tail = list2->tail;
218  } else {
219  list1->tail->n = list2->head;
220  list2->head->p = list1->tail;
221  list1->tail = list2->tail;
222  list1->tail->n = NULL;
223  list1->sorted = false;
224  }
225  list1->length += list2->length;
226  list2->length = 0;
227  list2->head = list2->tail = NULL;
228  return true;
229 }

References NULL, and rz_return_val_if_fail.

Referenced by ds_show_functions(), entries(), flirt_node_shorten_and_insert(), imports(), relocs(), rz_analysis_fcn_vars_add_types(), rz_analysis_var_all_list(), rz_bin_dex_entrypoints(), rz_bin_dex_fields(), rz_bin_dex_symbols(), rz_bin_file_compute_hashes(), rz_bin_file_strings(), rz_type_db_get_by_offset(), sections(), symbols(), type_paths_collect_by_address_cb(), type_paths_collect_by_offset_cb(), and winkd_list_modules().

◆ rz_list_last()

RZ_API RZ_BORROW void* rz_list_last ( RZ_NONNULL const RzList list)

Returns the last element of the list.

Definition at line 86 of file list.c.

86  {
88  return list->tail ? list->tail->data : NULL;
89 }

References list(), NULL, and rz_return_val_if_fail.

Referenced by diff_unified_append_ranges(), diff_unified_json_ranges(), flirt_write_node(), get_next_i(), parse_asm_path(), and rz_diff_opcodes_grouped_new().

◆ rz_list_length()

RZ_API ut32 rz_list_length ( RZ_NONNULL const RzList list)

Returns the length of the list.

Definition at line 109 of file list.c.

109  {
110  if (!list) {
111  return 0;
112  }
113  return list->length;
114 }

References list().

Referenced by _6502_tokenize(), __file_history_down(), __file_history_up(), _extract_regs(), _luac_build_info(), add_new_bin_string(), adjust_class(), agraph_follow_innodes(), agraph_print_edges(), analBars(), analize_addr_cb(), analysis_get_function_in(), analysis_graph_to(), ar_parse_header(), arch_parse_reg_profile(), autocmplt_cmd_arg_eval_full(), autoname_imp_trampoline(), avr_tokenize(), backedge_info(), basefind_create_array_of_addresses(), bb_info_print(), calculate_hash(), cb_iova(), classdump_cpp(), cmd_print_bars(), construct_rop_gadget(), core_walk_function_blocks(), dex_print_class_def(), ds_show_xrefs(), ensure_kexts_initialized(), fcn_print_info(), flirt_has_references(), flirt_node_optimize(), flirt_pat_parse_line(), flirt_pat_write_line(), flirt_write_module(), flirt_write_node(), func_walk_blocks(), function_list_print(), function_list_print_to_table(), function_print_to_json(), gdbr_parse_target_xml(), get_edge_number(), get_ref_object(), get_stringref_object(), get_symbols_list(), hex_add_to_pkt(), hex_extend_op(), hex_get_loop_flag(), is_pkt_full(), mips_tokenize(), node_match_functions(), parse_arg(), parse_def(), parse_reg_profile_str(), place_single(), print_bin_content(), print_heap_fastbin(), print_tcache_content(), rax(), resolve_type_links(), rz_analysis_block_merge(), rz_analysis_block_unref(), rz_analysis_function_complexity(), rz_analysis_function_count_handler(), rz_analysis_reflines_get(), rz_bin_file_add_class(), rz_bin_file_delete_all(), rz_bin_java_class_as_source_code(), rz_bin_java_class_methods_as_symbols(), rz_bin_object_is_static(), rz_bin_object_sections_mapping_list(), rz_bin_pdb_omap_remap(), rz_bin_reloc_storage_new(), rz_cf_value_array_print(), rz_cf_value_dict_print(), rz_cmd_debug_process_profile_handler(), rz_cmd_help(), rz_cmd_info_demangle_lang_choices(), rz_cmd_kuery(), rz_cmd_search(), rz_core_analysis_calls(), rz_core_analysis_calls_count(), rz_core_analysis_graph_to(), rz_core_asm_back_disassemble(), rz_core_asm_bwdis_len(), rz_core_print_disasm_json(), rz_core_search_rop(), rz_core_types_link(), rz_core_visual_analysis(), rz_core_visual_classes(), rz_core_visual_view_graph(), rz_diff_classes_new(), rz_diff_entries_new(), rz_diff_fields_new(), rz_diff_imports_new(), rz_diff_libraries_new(), rz_diff_lines_new(), rz_diff_matches_new(), rz_diff_opcodes_grouped_new(), rz_diff_sections_new(), rz_diff_strings_new(), rz_diff_symbols_new(), rz_diff_unified_json(), rz_diff_unified_text(), rz_egg_config_handler(), rz_eval_getset_handler(), rz_flag_get_by_spaces(), rz_hash_bang_details_cb(), rz_hash_cfg_configure(), rz_kext_index_new(), rz_num_between(), rz_print_analysis_details_handler(), rz_reg_arena_pop(), rz_reg_arena_push(), rz_reg_arena_swap(), rz_reg_arenas_stack_size_handler(), rz_reg_get_list(), rz_sign_flirt_node_count_nodes(), rz_sign_flirt_node_new(), rz_str_scale(), rz_str_split_lines(), rz_table_columns(), rz_table_query(), rz_th_queue_is_full(), rz_th_queue_push(), rz_vlog(), rz_w32_dbg_modules(), set_offset_hint(), sh_assembler(), str_split_list_common_regex(), symbols(), type_match(), types_xrefs_graph(), types_xrefs_summary(), update_graph_sizes(), update_node_dimension(), v850_tokenize(), var_variables_show(), walk_exports(), windbg_map_get(), xnu_generate_corefile(), and z80_tokenize().

◆ rz_list_merge_sort()

RZ_API void rz_list_merge_sort ( RZ_NONNULL RzList list,
RZ_NONNULL RzListComparator  cmp 
)

Merge sorts the list via the RzListComparator.

Definition at line 698 of file list.c.

698  {
700 
701  if (!list->sorted && list->head && cmp) {
702  RzListIter *iter;
703  list->head = _merge_sort(list->head, cmp);
704  // update tail reference
705  iter = list->head;
706  while (iter && iter->n) {
707  iter = iter->n;
708  }
709  list->tail = iter;
710  }
711  list->sorted = true;
712 }

References _merge_sort(), cmp(), list(), and rz_return_if_fail.

Referenced by rz_list_sort().

◆ rz_list_new()

RZ_API RZ_OWN RzList* rz_list_new ( void  )

Returns a new initialized RzList pointer (free method is not initialized)

Definition at line 235 of file list.c.

235  {
237  if (!list) {
238  return NULL;
239  }
241  return list;
242 }
RZ_API void rz_list_init(RZ_NONNULL RzList *list)
Initializes the RzList pointer.
Definition: list.c:95

References list(), NULL, rz_list_init(), and RZ_NEW0.

Referenced by __fix_layout_h(), __fix_layout_w(), __io_maps(), __save_old_sections(), __sorted_list(), __switch_op_new(), _extract_flags(), _extract_regs(), adjust_class(), agraph_print_edges(), analysis_graph_to(), assign_layers(), backedge_info(), backtrace_fuzzy(), backtrace_x86_32(), backtrace_x86_32_analysis(), backtrace_x86_64(), backtrace_x86_64_analysis(), block_new(), bsd_desc_list(), classes(), cmd_aea(), combine_sequences(), compute_classes(), compute_vertical_nodes(), create_loc_list(), entries(), filter_reg_items(), flags_at_offset(), gdbr_pids_list(), gdbr_threads_list(), get_next_i(), get_pid_thread_list(), get_sections_or_segment(), GetListOfHeaps(), linux_info(), mem(), meta_string_guess_add(), node_new(), parse_categories(), parse_classes(), parse_custom_name_entry(), parse_dbi_stream_ex_header(), parse_format(), parse_function(), parse_gdata_stream(), parse_omap_stream(), rz_analysis_block_automerge(), rz_analysis_calling_conventions(), rz_analysis_cycle_frame_new(), rz_analysis_function_new(), rz_analysis_function_update_analysis(), rz_analysis_get_functions_in(), rz_analysis_op_list_new(), rz_analysis_reflines_str(), rz_analysis_rtti_itanium_recover_all(), rz_analysis_type_links(), rz_analysis_type_links_by_offset(), rz_analysis_type_paths_by_address(), rz_analysis_types_from_fcn(), rz_analysis_update_analysis_range(), rz_analysis_var_all_list(), rz_analysis_var_global_get_all(), rz_analysis_var_global_list_show(), rz_bin_class_new(), rz_bin_elf_section_flag_to_rzlist(), rz_bin_mdmp_new_buf(), rz_bin_mdmp_pe_get_entrypoint(), rz_bin_mdmp_pe_get_imports(), rz_bin_mdmp_pe_get_sections(), rz_bin_mdmp_pe_get_symbols(), rz_bin_new(), rz_bin_object_sections_mapping_list(), rz_bin_wasm_get_codes(), rz_bin_wasm_get_custom_name_entries(), rz_bin_wasm_get_custom_names(), rz_bin_wasm_get_datas(), rz_bin_wasm_get_elements(), rz_bin_wasm_get_exports(), rz_bin_wasm_get_globals(), rz_bin_wasm_get_imports(), rz_bin_wasm_get_memories(), rz_bin_wasm_get_tables(), rz_bin_wasm_get_types(), rz_bp_traptrace_new(), rz_bp_traptrace_reset(), rz_cmd_debug_process_profile_handler(), rz_config_node_new(), rz_cons_hud_string(), rz_cons_less_str(), rz_core_analysis_callgraph(), rz_core_analysis_cycles(), rz_core_analysis_fcn_clean(), rz_core_analysis_graph_to(), rz_core_analysis_paths(), rz_core_asm_hit_list_new(), rz_core_autocomplete(), rz_core_bin_dwarf_print_loc(), rz_core_cmp_disasm(), rz_core_config_in_space(), rz_core_debug_continue_until(), rz_core_gdiff_function_1_file(), rz_core_gdiff_function_2_files(), rz_core_init(), rz_core_reg_flags_candidates(), rz_core_task_scheduler_init(), rz_core_visual_config_hud(), rz_core_visual_hudclasses(), rz_core_visual_hudstuff(), rz_debug_esil_watch(), rz_debug_gdb_map_get(), rz_debug_map_list_new(), rz_debug_qnx_pids(), rz_debug_trace_new(), rz_debug_trace_reset(), rz_debug_traces_info(), rz_demangler_new(), rz_egg_new(), rz_flag_all_list(), rz_graph_new(), rz_graph_node_new(), rz_graph_reset(), rz_hash_new(), rz_il_reg_binding_derive(), rz_io_ar_open_many(), rz_io_zip_open_many(), rz_lang_new(), rz_list_clone(), rz_list_new_from_array(), rz_list_newf(), rz_log_add_callback(), rz_main_rizin(), rz_num_str_split_list(), rz_parse_pdb_types(), rz_range_new(), rz_reg_filter_items_covered(), rz_regs_args_handler(), rz_search_find(), rz_sign_sigdb_list(), rz_skiplist_to_list(), rz_spaces_init(), rz_str_wrap(), rz_sys_dir(), rz_table_query(), rz_table_transpose(), rz_test_run_cmd_test(), rz_test_run_fuzz_test(), rz_test_run_json_test(), rz_type_db_all(), rz_type_db_enum_names(), rz_type_db_get_base_types(), rz_type_db_get_base_types_of_kind(), rz_type_db_struct_names(), rz_type_db_typedef_names(), rz_type_db_union_names(), rz_type_typeclass_get_all(), rz_type_typeclass_get_all_sized(), section_flag_to_rzlist(), sections(), var_generate_list(), xnu_dbg_maps(), and xnu_generate_corefile().

◆ rz_list_new_from_array()

RZ_API RZ_OWN RzList* rz_list_new_from_array ( RZ_NONNULL const void **  arr,
size_t  arr_size 
)

Allocates a new RzList and adds an array elements to it.

Definition at line 260 of file list.c.

260  {
261  RzList *l = rz_list_new();
262  if (!l) {
263  return NULL;
264  }
265  size_t i;
266  for (i = 0; i < arr_size; i++) {
267  rz_list_append(l, (void *)arr[i]);
268  }
269  return l;
270 }

References syscall_preprocessing::arr, i, NULL, rz_list_append(), and rz_list_new().

Referenced by filter_reg_items(), rz_cmd_debug_step_until_optype_handler(), rz_cmd_info_cur_section_handler(), rz_cmd_info_cur_segment_handler(), rz_cmd_info_resources_handler(), rz_cmd_info_sections_handler(), rz_cmd_info_segments_handler(), and rz_il_step_until_opt_handler().

◆ rz_list_newf()

RZ_API RZ_OWN RzList* rz_list_newf ( RzListFree  f)

Returns a new initialized RzList pointer and sets the free method.

Definition at line 248 of file list.c.

248  {
249  RzList *l = rz_list_new();
250  if (l) {
251  l->free = f;
252  }
253  return l;
254 }
#define f(i)
Definition: sha256.c:46

References f, rz_list_t::free, and rz_list_new().

Referenced by __childrenFlagsOf(), __fcns(), __ne_get_resources(), __refs(), __sync_status_with_cursor(), __xrefs(), add_item_to_regset(), add_library(), add_thread(), aea_stats_init(), agraph_follow_innodes(), agraph_init(), analysis_preludes(), ar_open_all(), arch_parse_reg_profile(), backtrace_generic(), backtrace_windows(), backtrace_windows_x64(), bin_pe_dotnet_init_metadata(), bin_pe_init_resource(), bin_pe_init_rich_info(), bsd_desc_list(), carve_kexts(), classes(), cmd_aea(), cmd_print_gadget(), create_cache_bins(), create_dummy_nodes(), create_string_search_thread(), DEFINE_HANDLE_TS_FCN_AND_SYMBOL(), deserialize_checkpoints_cb(), dex_class_def_new(), dex_resolve_entrypoints_in_class(), dex_resolve_fields_in_class(), dex_resolve_fields_in_class_as_symbols(), dex_resolve_methods_in_class(), dmp_get_modules(), ds_show_xrefs(), entries(), fields(), filter_kexts(), flirt_create_child(), flirt_module_new(), flirt_node_optimize(), flirt_pat_parse_line(), function_load_cb(), get_array_object_generic(), get_callable_type(), get_calls(), get_constants(), get_dict_object(), get_entries_from_section(), get_maps_unpatched(), get_sections_symbols_from_code_objects(), get_segments(), get_symbols_list(), get_virtual_files(), get_windows(), get_xrefs(), hexagon_get_state(), hud_filter(), imports(), kexts_from_load_commands(), le_get_entries(), libs(), linux_desc_list(), load_buffer(), lua_new_proto_entry(), luac_build_info(), MACH0_(), maps(), mem(), new_pyc_opcodes(), oneshotall(), oneshotall_buffer(), parse_aranges_raw(), parse_categories(), parse_classes(), parse_hash_algorithms(), parse_leaf(), parse_line_raw(), parse_pe_stream(), parse_tree(), parse_type_fieldlist(), parse_type_methodlist(), pdb7_extract_streams(), place_original(), populate_cache_headers(), print_rop(), print_stats(), read_module_public_functions(), read_module_referenced_functions(), read_module_tail_bytes(), relocs(), remove_cycles(), resolve_mig_subsystem(), resolve_syscalls(), rtti_msvc_read_base_class_array(), run_basic_block_analysis(), rz_agraph_reset(), rz_analysis_block_recurse_list(), rz_analysis_block_shortest_path(), rz_analysis_function_all_opcode_stat_handler(), rz_analysis_function_get_var_fields(), rz_analysis_function_import_list_handler(), rz_analysis_function_list_ascii_handler(), rz_analysis_get_blocks_in(), rz_analysis_get_blocks_intersect(), rz_analysis_new(), rz_analysis_op_copy(), rz_analysis_purge(), rz_analysis_reflines_get(), rz_analysis_vtable_search(), rz_analysis_xref_list_new(), rz_asm_code_set_equ(), rz_asm_new(), rz_basefind(), rz_bin_dex_classes(), rz_bin_dex_entrypoints(), rz_bin_dex_fields(), rz_bin_dex_imports(), rz_bin_dex_libraries(), rz_bin_dex_sections(), rz_bin_dex_strings(), rz_bin_dex_symbols(), rz_bin_dmp64_init_bmp_pages(), rz_bin_dmp64_init_memory_runs(), rz_bin_dmp64_init_triage_datablocks(), rz_bin_dmp64_init_triage_drivers(), rz_bin_elf_get_libs(), rz_bin_file_compute_hashes(), rz_bin_file_new(), rz_bin_file_strings(), rz_bin_java_class_as_libraries(), rz_bin_java_class_as_sections(), rz_bin_java_class_const_pool_as_imports(), rz_bin_java_class_const_pool_as_symbols(), rz_bin_java_class_entrypoints(), rz_bin_java_class_fields_as_binfields(), rz_bin_java_class_fields_as_symbols(), rz_bin_java_class_methods_as_symbols(), rz_bin_java_class_strings(), rz_bin_le_get_entrypoints(), rz_bin_le_get_imports(), rz_bin_le_get_libs(), rz_bin_le_get_relocs(), rz_bin_le_get_sections(), rz_bin_le_get_symbols(), rz_bin_maps_of_file_sections(), rz_bin_mdmp_new_buf(), rz_bin_mdmp_pe_get_imports(), rz_bin_mz_get_segments(), rz_bin_ne_get_entrypoints(), rz_bin_ne_get_imports(), rz_bin_ne_get_relocs(), rz_bin_ne_get_segments(), rz_bin_ne_get_symbols(), rz_bin_new(), rz_bin_object_new(), rz_bin_pe_get_clr_symbols(), rz_bin_sections_of_maps(), rz_bin_string_database_new(), rz_bin_wasm_get_sections(), rz_bin_wasm_get_sections_by_id(), rz_bp_new(), rz_cf_value_array_new(), rz_cf_value_dict_new(), rz_cf_value_dict_parse(), rz_cmd_info_section_bars_handler(), rz_cmd_kuery(), rz_cmd_macro_init(), rz_cmd_print_gadget_remove_handler(), rz_coff_get_relocs(), rz_config_hold_i(), rz_config_hold_s(), rz_config_new(), rz_cons_grep_line(), rz_core_analysis_bbs_asciiart(), rz_core_analysis_propagate_noreturn(), rz_core_cmd_foreach(), rz_core_cmd_foreach3(), rz_core_cmd_init(), rz_core_cmd_subst_i(), rz_core_debug_backtraces(), rz_core_get_boundaries_prot(), rz_core_get_func_args(), rz_core_init(), rz_core_plugin_init(), rz_core_search_rop(), rz_core_seek_list(), rz_core_task_scheduler_init(), rz_core_theme_list(), rz_crypto_new(), rz_debug_add_checkpoint(), rz_debug_bochs_map_get(), rz_debug_dmp_maps(), rz_debug_dmp_modules(), rz_debug_dmp_pids(), rz_debug_dmp_threads(), rz_debug_gdb_modules_get(), rz_debug_native_map_get(), rz_debug_plugin_init(), rz_debug_winkd_maps(), rz_debug_winkd_modules(), rz_debug_winkd_pids(), rz_debug_winkd_threads(), rz_diff_matches_new(), rz_diff_opcodes_grouped_new(), rz_diff_opcodes_new(), rz_diff_parse_arguments(), rz_egg_new(), rz_file_globsearch(), rz_flag_graph_handler(), rz_flag_tags_get(), rz_flag_tags_list(), rz_flag_zone_barlist(), rz_flag_zone_reset(), rz_hash_cfg_new(), rz_heap_arena_list_wrapper(), rz_heap_arenas_list(), rz_heap_bin_content(), rz_heap_blocks_list(), rz_heap_chunks_list(), rz_heap_chunks_list_wrapper(), rz_heap_fastbin_content(), rz_heap_list(), rz_heap_tcache_content(), rz_id_storage_list(), rz_il_vm_init(), rz_io_desc_cache_list(), rz_io_map_get_for_fd(), rz_io_plugin_init(), rz_io_zip_get_files(), rz_lib_new(), rz_line_new(), rz_list_of_sdblist(), rz_list_uniq(), rz_main_rz_sign(), rz_open_binary_file_handler(), rz_open_binary_list_ascii_handler(), rz_open_maps_list_ascii_handler(), rz_parse_new(), rz_project_migrate_v1_v2(), rz_project_migrate_v2_v3(), rz_project_migrate_v3_v4(), rz_reg_free_internal(), rz_reg_new(), rz_reg_reindex(), rz_reg_set_profile_string(), rz_regex_get_match_list(), rz_regs_show_valgroup(), rz_search_new(), rz_serialize_result_info_new(), rz_sign_flirt_node_new(), rz_sign_flirt_parse_string_pattern_from_buffer(), rz_spaces_unset(), rz_str_scale(), rz_sys_dir(), rz_syscall_list(), rz_syscmd_join(), rz_th_queue_new(), rz_type_db_find_enums_by_val(), rz_type_db_format_all(), rz_type_db_get_by_offset(), rz_type_function_names(), rz_type_noreturn_function_names(), rz_type_path_by_offset(), rz_w32_dbg_maps(), rz_w32_dbg_modules(), rz_xnu_update_thread_list(), rzfind_options_init(), sections(), set_access_info(), set_b(), set_layout(), str_split_list_common(), str_split_list_common_regex(), string_scan_range(), substitute_args(), symbols(), system_exec(), tokenize_lines(), trycatch(), types_xrefs_all(), var_functions_show(), virtual_files(), w32_desc_list(), w32_select(), walk_exports(), windbg_frames(), windbg_map_get(), windbg_modules_get(), windbg_pids(), windbg_threads(), winkd_list_maps(), winkd_list_modules(), winkd_list_process(), winkd_list_threads(), and xnu_dbg_modules().

◆ rz_list_of_sdblist()

RZ_API RZ_OWN RzList* rz_list_of_sdblist ( SdbList sl)

Converts a SdbList into a RzList.

Definition at line 802 of file list.c.

802  {
803  RzList *l = rz_list_newf(free);
804  SdbKv *kv;
805  SdbListIter *iter;
806  ls_foreach (sl, iter, kv) {
808  }
809  return l;
810 }
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
Definition: list.c:248
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
#define ls_foreach(list, it, pos)
Definition: ls.h:31
static char * sdbkv_key(const SdbKv *kv)
Definition: sdbht.h:21
Definition: ls.h:17
Definition: sdbht.h:14

References free(), ls_foreach, rz_list_append(), rz_list_newf(), sdbkv_key(), and strdup().

◆ rz_list_pop()

RZ_API RZ_OWN void* rz_list_pop ( RZ_NONNULL RzList list)

Removes and returns the last element of the list.

Definition at line 376 of file list.c.

376  {
377  void *data = NULL;
378  RzListIter *iter;
379 
381 
382  if (list->tail) {
383  iter = list->tail;
384  if (list->head == list->tail) {
385  list->head = list->tail = NULL;
386  } else {
387  list->tail = iter->p;
388  list->tail->n = NULL;
389  }
390  data = iter->data;
391  free(iter);
392  list->length--;
393  }
394  return data;
395 }

References free(), list(), NULL, and rz_return_val_if_fail.

Referenced by analPaths(), ar_parse_header(), backtrace_windows_x64(), combine_sequences(), get_next_i(), myregwrite(), rz_cf_value_dict_parse(), rz_core_analysis_cycles(), rz_core_analysis_propagate_noreturn(), rz_core_run_script(), rz_core_search_rop(), rz_core_visual_view_rop(), rz_diff_matches_new(), rz_reg_arena_pop(), rz_spaces_pop(), rz_th_queue_pop(), rz_th_queue_wait_pop(), rz_type_typeclass_get_default_sized(), test_type_for_path(), and walk_exports().

◆ rz_list_pop_head()

RZ_API RZ_OWN void* rz_list_pop_head ( RZ_NONNULL RzList list)

Removes and returns the first element of the list.

Definition at line 401 of file list.c.

401  {
402  void *data = NULL;
403 
405 
406  if (list->head) {
407  RzListIter *iter = list->head;
408  if (list->head == list->tail) {
409  list->head = list->tail = NULL;
410  } else {
411  list->head = iter->n;
412  list->head->p = NULL;
413  }
414  data = iter->data;
415  free(iter);
416  list->length--;
417  }
418  return data;
419 }

References free(), list(), NULL, and rz_return_val_if_fail.

Referenced by ar_parse_header(), cmd_print_gadget(), flirt_pat_parse_line(), initializeEsil(), rz_cmd_help(), rz_core_debug_continue_until(), rz_core_print_scrollbar(), rz_core_print_scrollbar_bottom(), rz_core_task_schedule(), rz_num_between(), rz_str_list_join(), rz_th_queue_pop(), rz_th_queue_wait_pop(), search_string_thread_runner(), sh_assembler(), and v_writebuf().

◆ rz_list_prepend()

RZ_API RZ_BORROW RzListIter* rz_list_prepend ( RZ_NONNULL RzList list,
void *  data 
)

Appends at the beginning of the list a new element.

Definition at line 316 of file list.c.

316  {
318 
319  RzListIter *item = RZ_NEW0(RzListIter);
320  if (!item) {
321  return NULL;
322  }
323  if (list->head) {
324  list->head->p = item;
325  }
326  item->data = data;
327  item->n = list->head;
328  item->p = NULL;
329  list->head = item;
330  if (!list->tail) {
331  list->tail = item;
332  }
333  list->length++;
334  list->sorted = true;
335  return item;
336 }

References rz_list_iter_t::data, list(), rz_list_iter_t::n, NULL, rz_list_iter_t::p, RZ_NEW0, and rz_return_val_if_fail.

Referenced by add_sorted(), analysis_path_exists(), get_ivar_list_t(), maps(), prepend_current_pc(), rz_analysis_block_shortest_path(), rz_bin_relocs_patch_maps(), rz_core_debug_continue_until(), rz_list_insert(), rz_table_query(), and rz_th_queue_push().

◆ rz_list_purge()

RZ_API void rz_list_purge ( RZ_NONNULL RzList list)

Empties the list without freeing the list pointer.

Definition at line 120 of file list.c.

120  {
122 
123  RzListIter *it = list->head;
124  while (it) {
125  RzListIter *next = it->n;
126  rz_list_delete(list, it);
127  it = next;
128  }
129  list->length = 0;
130  list->head = list->tail = NULL;
131 }

References list(), rz_list_iter_t::n, NULL, rz_list_delete(), and rz_return_if_fail.

Referenced by __close_file_cb(), backtrace_x86_64(), do_asm_search(), ds_show_xrefs(), hex_clear_pkt(), hex_extend_op(), opcode_10(), opcode_11(), opcode_12(), opcode_13(), opcode_14(), opcode_15(), opcode_16(), opcode_20(), opcode_21(), opcode_22(), opcode_23(), opcode_24(), opcode_25(), opcode_26(), opcode_27(), opcode_2x(), opcode_30(), opcode_31(), opcode_32(), opcode_33(), opcode_34(), opcode_35(), opcode_36(), opcode_37(), opcode_38(), opcode_39(), opcode_3x(), pager_all_matches(), rz_agraph_reset(), rz_analysis_block_automerge(), rz_analysis_block_chop_noreturn(), rz_analysis_purge_imports(), rz_bin_file_delete_all(), rz_bp_del_all(), rz_core_analysis_fcn_clean(), rz_core_asm_back_disassemble(), rz_core_asm_back_disassemble_all(), rz_core_asm_strsearch(), rz_debug_desc_list(), rz_debug_trace_free(), rz_debug_trace_reset(), rz_egg_reset(), rz_il_vm_clear_events(), rz_list_free(), rz_range_free(), rz_search_kw_reset(), rz_serialize_flag_zones_load(), rz_spaces_purge(), update_analysis_arch_options(), update_asmarch_options(), update_asmbits_options(), update_asmcpu_options(), update_asmfeatures_options(), update_asmparser_options(), update_asmplatforms_options(), w32_dbg_wait(), w32_detach(), and w32_kill().

◆ rz_list_push()

RZ_API RZ_BORROW RzListIter* rz_list_push ( RZ_NONNULL RzList list,
void *  item 
)

Alias for rz_list_append.

Definition at line 60 of file list.c.

60  {
61  return rz_list_append(list, item);
62 }

References list(), and rz_list_append().

Referenced by __desc_cache_list_cb(), _extract_flags(), _extract_regs(), add_file_hash(), backtrace_generic(), block_list_cb(), carve_kexts(), cmd_aea(), convert_relocs(), enum_childs(), filter_kexts(), filter_reg_items(), function_load_cb(), get_calls(), get_functions_block_cb(), get_next_i(), get_relocs_list_cb(), get_virtual_files(), get_windows(), get_xrefs(), GetListOfHeaps(), initializeEsil(), kexts_from_load_commands(), libs(), list_keys_cb(), mymemread(), mymemwrite(), myregread(), myregwrite(), noreturn_get_blocks_cb(), parse_aranges_raw(), parse_line_raw(), parse_type_string_cached(), recurse_list_cb(), rz_analysis_add_import(), rz_analysis_block_automerge(), rz_analysis_function_get_var_fields(), rz_bin_dmp64_init_triage_datablocks(), rz_bin_dmp64_init_triage_drivers(), rz_bin_maps_of_file_sections(), rz_cf_value_array_add(), rz_cf_value_dict_add(), rz_cf_value_dict_parse(), rz_core_analysis_cycles(), rz_core_reg_flags_candidates(), rz_core_run_script(), rz_core_visual_hudstuff(), rz_core_visual_view_rop(), rz_il_reg_binding_derive(), rz_project_migrate(), rz_reg_arena_push(), rz_reg_filter_items_covered(), rz_reg_new(), rz_regs_args_handler(), rz_spaces_push(), rz_test_run_cmd_test(), rz_test_run_fuzz_test(), rz_test_run_json_test(), sections(), set_dist_nodes(), types_xrefs_all(), v1_v2_types_foreach_cb(), v2_v3_types_foreach_cb(), var_generate_list(), virtual_files(), and walk_exports().

◆ rz_list_reverse()

RZ_API void rz_list_reverse ( RZ_NONNULL RzList list)

Reverses the list.

Definition at line 477 of file list.c.

477  {
478  RzListIter *it, *tmp;
479 
481 
482  for (it = list->head; it && it->data; it = it->p) {
483  tmp = it->p;
484  it->p = it->n;
485  it->n = tmp;
486  }
487  tmp = list->head;
488  list->head = list->tail;
489  list->tail = tmp;
490 }

References rz_list_iter_t::data, list(), rz_list_iter_t::n, rz_list_iter_t::p, rz_return_if_fail, and autogen_x86imm::tmp.

Referenced by rz_cmd_debug_display_bt_handler(), rz_cmd_debug_display_bt_oneline_handler(), rz_cons_grepbuf(), and rz_core_search_rop().

◆ rz_list_set_n()

RZ_API ut32 rz_list_set_n ( RZ_NONNULL RzList list,
ut32  n,
void *  p 
)

Sets the N-th element of the list.

Definition at line 552 of file list.c.

552  {
553  RzListIter *it;
554  ut32 i;
555 
556  rz_return_val_if_fail(list, false);
557  for (it = list->head, i = 0; it; it = it->n, i++) {
558  if (i == n) {
559  if (list->free) {
560  list->free(it->data);
561  }
562  it->data = p;
563  list->sorted = false;
564  return true;
565  }
566  }
567  return false;
568 }

References rz_list_iter_t::data, i, list(), n, rz_list_iter_t::n, p, and rz_return_val_if_fail.

Referenced by _extract_regs(), and z80_tokenize().

◆ rz_list_sort()

RZ_API void rz_list_sort ( RZ_NONNULL RzList list,
RZ_NONNULL RzListComparator  cmp 
)

Sorts via merge sort or via insertion sort a list.

Definition at line 743 of file list.c.

743  {
745  if (list->length > 43) {
747  } else {
749  }
750 }
RZ_API void rz_list_insertion_sort(RZ_NONNULL RzList *list, RZ_NONNULL RzListComparator cmp)
Insertion sorts the list via the RzListComparator.
Definition: list.c:718
RZ_API void rz_list_merge_sort(RZ_NONNULL RzList *list, RZ_NONNULL RzListComparator cmp)
Merge sorts the list via the RzListComparator.
Definition: list.c:698

References cmp(), list(), rz_list_insertion_sort(), rz_list_merge_sort(), and rz_return_if_fail.

Referenced by __sort(), __sorted_list(), adjust_class(), agraph_print_edges(), analysis_fcn_data_gaps(), cmd_descriptor_init(), core_analysis_var_list_show(), core_walk_function_blocks(), DEFINE_HANDLE_TS_FCN_AND_SYMBOL(), filter_kexts(), flirt_node_optimize(), flirt_node_shorten_and_insert(), func_walk_blocks(), get_bbnodes(), get_bbupdate(), get_ivar_list_t(), print_debug_maps_ascii_art(), print_stats(), rz_analysis_class_method_recover(), rz_analysis_fcn_vars_cache_init(), rz_analysis_function_all_opcode_stat_handler(), rz_analysis_function_list_ascii_handler(), rz_analysis_function_vars_stackframe_handler(), rz_basefind(), rz_bin_file_strings(), rz_config_lock(), rz_cons_grepbuf(), rz_core_analysis_bbs_info_print(), rz_core_analysis_type_match(), rz_core_cmd_foreach(), rz_core_diff_show(), rz_core_link_stroff(), rz_core_print_function_disasm_json(), rz_core_theme_list(), rz_debug_traces_info(), rz_diff_classes_new(), rz_diff_entries_new(), rz_diff_fields_new(), rz_diff_imports_new(), rz_diff_libraries_new(), rz_diff_matches_new(), rz_diff_sections_new(), rz_diff_strings_new(), rz_diff_symbols_new(), rz_flag_describe_closest_handler(), rz_il_reg_binding_derive(), rz_range_sort(), rz_reg_reindex(), rz_sign_flirt_node_new(), rz_sign_flirt_parse_string_pattern_from_buffer(), rz_sign_sigdb_list(), rz_syscmd_sort(), sort_flags(), sortxrefs(), types_xrefs_all(), and xnu_dbg_maps().

◆ rz_list_split()

RZ_API void rz_list_split ( RZ_NONNULL RzList list,
void *  ptr 
)

Definition at line 172 of file list.c.

172  {
174 
176  while (iter) {
177  void *item = iter->data;
178  if (ptr == item) {
180  free(iter);
181  break;
182  }
183  iter = iter->n;
184  }
185 }
RZ_API RZ_BORROW RzListIter * rz_list_iterator(const RzList *list)
returns the first RzList iterator int the list
Definition: list.c:51

References free(), list(), rz_list_iterator(), rz_list_split_iter(), and rz_return_if_fail.

◆ rz_list_split_iter()

RZ_API void rz_list_split_iter ( RZ_NONNULL RzList list,
RZ_NONNULL RzListIter iter 
)

Definition at line 187 of file list.c.

187  {
189 
190  if (list->head == iter) {
191  list->head = iter->n;
192  }
193  if (list->tail == iter) {
194  list->tail = iter->p;
195  }
196  if (iter->p) {
197  iter->p->n = iter->n;
198  }
199  if (iter->n) {
200  iter->n->p = iter->p;
201  }
202  list->length--;
203 }

References list(), and rz_return_if_fail.

Referenced by rz_analysis_block_automerge(), rz_list_delete(), and rz_list_split().

◆ rz_list_to_str()

RZ_API RZ_OWN char* rz_list_to_str ( RZ_NONNULL RzList list,
char  ch 
)

Casts a RzList containg strings into a concatenated string.

Definition at line 785 of file list.c.

785  {
786  RzListIter *iter;
787  RzStrBuf *buf = rz_strbuf_new("");
788  if (!buf) {
789  return NULL;
790  }
791  char *item;
792  rz_list_foreach (list, iter, item) {
793  rz_strbuf_appendf(buf, "%s%c", item, ch);
794  }
795  return rz_strbuf_drain(buf);
796 }
voidpf void * buf
Definition: ioapi.h:138
RZ_API RZ_OWN char * rz_strbuf_drain(RzStrBuf *sb)
Definition: strbuf.c:342
RZ_API RzStrBuf * rz_strbuf_new(const char *s)
Definition: strbuf.c:8
RZ_API bool rz_strbuf_appendf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2

References list(), NULL, rz_strbuf_appendf(), rz_strbuf_drain(), and rz_strbuf_new().

Referenced by print_diff(), rz_cmd_debug_process_profile_handler(), rz_syscmd_join(), rz_syscmd_sort(), rz_syscmd_uniq(), and rz_test_cmp_cmd_output().

◆ rz_list_uniq()

RZ_API RZ_OWN RzList* rz_list_uniq ( RZ_NONNULL const RzList list,
RZ_NONNULL RzListComparator  cmp 
)

Returns a new RzList which contains only unique values.

Definition at line 756 of file list.c.

756  {
757  RzListIter *iter, *iter2;
758  void *item, *item2;
759 
761 
762  RzList *nl = rz_list_newf(NULL);
763  if (!nl) {
764  return NULL;
765  }
766  rz_list_foreach (list, iter, item) {
767  bool found = false;
768  rz_list_foreach (nl, iter2, item2) {
769  if (cmp(item, item2) == 0) {
770  found = true;
771  break;
772  }
773  }
774  if (!found) {
775  rz_list_append(nl, item);
776  }
777  }
778  return nl;
779 }
RZ_API const KEY_TYPE bool * found
Definition: ht_inc.h:130

References cmp(), found, list(), NULL, rz_list_append(), rz_list_newf(), and rz_return_val_if_fail.

Referenced by bb_info_print(), ds_show_flags(), function_list_print_to_table(), function_print_calls(), rz_analysis_types_from_fcn(), rz_syscmd_uniq(), and types_xrefs_all().