Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_util.h>
Go to the source code of this file.
Classes | |
struct | RzTableColumnType |
struct | RzTableColumn |
struct | RzListInfo |
struct | RzTableRow |
struct | RzTable |
Typedefs | |
typedef void(* | RzTableSelector) (RzTableRow *acc, RzTableRow *new_row, int nth) |
Enumerations | |
enum | { RZ_TABLE_ALIGN_LEFT , RZ_TABLE_ALIGN_RIGHT , RZ_TABLE_ALIGN_CENTER } |
typedef void(* RzTableSelector) (RzTableRow *acc, RzTableRow *new_row, int nth) |
Definition at line 56 of file rz_table.h.
anonymous enum |
Enumerator | |
---|---|
RZ_TABLE_ALIGN_LEFT | |
RZ_TABLE_ALIGN_RIGHT | |
RZ_TABLE_ALIGN_CENTER |
Definition at line 33 of file rz_table.h.
RZ_API void rz_table_add_column | ( | RzTable * | t, |
RzTableColumnType * | type, | ||
const char * | name, | ||
int | maxWidth | ||
) |
Definition at line 134 of file table.c.
References c, RzTable::cols, column_exists(), RZ_FREE, RZ_NEW0, rz_str_len_utf8_ansi(), rz_vector_push(), strdup(), and type.
Referenced by __new_heapblock_tbl(), cmd_pxr(), create_window_table(), function_list_print_to_table(), print_stats(), rz_analysis_function_all_opcode_stat_handler(), rz_heap_list_w32(), rz_table_filter_columns(), rz_table_set_vcolumnsf(), and rz_table_transpose().
RZ_API void rz_table_add_row | ( | RZ_NONNULL RzTable * | t, |
const char * | name, | ||
... | |||
) |
Definition at line 329 of file table.c.
References __addRow(), free(), RZ_FREE, RZ_MAX, rz_pvector_len(), rz_pvector_new(), rz_return_if_fail, rz_table_row_new(), and rz_vector_push().
Referenced by add_window_to_table(), and rz_table_transpose().
Add some columns values to the last created row, if any, or create a new row otherwise.
Definition at line 289 of file table.c.
References add_column_to_rowf, f, free(), RzTableRow::items, RzTable::rows, rz_pvector_new(), rz_return_if_fail, rz_table_add_row_vec(), and rz_vector_tail().
Referenced by bin_resources_print_table(), rz_core_bin_sections_mapping_print(), and sections_print_table().
RZ_API void rz_table_add_row_vec | ( | RZ_NONNULL RzTable * | t, |
RZ_NONNULL RzPVector * | items | ||
) |
Add a new row to RzTable.
t | pointer to RzTable |
items | pointer to RzPVector which contains row elements |
Definition at line 176 of file table.c.
References RZ_FREE, RZ_MAX, rz_pvector_len(), rz_return_if_fail, rz_table_row_new(), and rz_vector_push().
Referenced by analysis_class_print(), print_stats(), rz_analysis_function_all_opcode_stat_handler(), rz_table_add_row_columnsf(), and rz_table_add_rowf().
Add a new row with the specified columns values.
Definition at line 316 of file table.c.
References add_column_to_rowf, f, free(), rz_pvector_new(), rz_return_if_fail, and rz_table_add_row_vec().
Referenced by __tableItemCallback(), bb_info_print(), bin_memory_print_rec(), bin_resources_print_table(), cmd_print_blocks(), cmd_pxr(), core_bin_file_print(), desc_list_table_cb(), disassembly_as_table(), entries_initfini_print(), function_list_print_to_table(), open_maps_show(), print_arch(), print_demangler_info(), references_handler(), rz_analysis_basic_block_list_handler(), rz_cmd_debug_list_bp_handler(), rz_core_analysis_sigdb_print(), rz_core_bin_basefind_print(), rz_core_bin_class_fields_print(), rz_core_bin_class_methods_print(), rz_core_bin_classes_print(), rz_core_bin_fields_print(), rz_core_bin_imports_print(), rz_core_bin_info_print(), rz_core_bin_libs_print(), rz_core_bin_main_print(), rz_core_bin_plugin_print(), rz_core_bin_relocs_print(), rz_core_bin_sections_mapping_print(), rz_core_binxtr_plugin_print(), rz_core_file_info_print(), rz_core_io_plugin_print(), rz_heap_debug_block_win(), rz_heap_list_w32(), rz_table_filter(), rz_table_visual_list(), rzil_print_register_bitv(), rzil_print_register_bool(), sections_print_table(), show_regs_handler(), strings_print(), symbols_print(), table_add_row_bool(), and w32_list_heaps_blocks().
Definition at line 1192 of file table.c.
References RzTableColumn::align, RzTable::cols, and rz_vector_index_ptr().
Referenced by analysis_class_print().
RZ_API RzTableColumn* rz_table_column_clone | ( | RzTableColumn * | col | ) |
RZ_API void rz_table_column_fini | ( | RZ_NONNULL void * | _col | ) |
clear function for RzVector cols in RzTable
_col | pointer to the elements of cols in RzTable |
Definition at line 83 of file table.c.
References free(), RzTableColumn::name, and rz_return_if_fail.
Referenced by rz_table_column_fini_wrapper(), and rz_table_columns().
Definition at line 873 of file table.c.
References RzTable::cols, n, RzTableColumn::name, and rz_vector_foreach.
Referenced by rz_table_columns(), rz_table_filter_columns(), and rz_table_query().
Select specific columns in RzTable.
t | pointer to RzTable |
col_names | pointer to RzList containing column names |
Definition at line 914 of file table.c.
References calloc(), RzTable::cols, dup, rz_vector_t::free, free(), i, RzTableRow::items, malloc(), NULL, RzTable::rows, RZ_FREE, rz_list_length(), rz_pvector_foreach, rz_pvector_free(), rz_pvector_index_ptr(), rz_pvector_new(), rz_pvector_push(), rz_table_column_clone(), rz_table_column_fini(), rz_table_column_fini_wrapper(), rz_table_column_nth(), rz_vector_foreach, rz_vector_free(), rz_vector_index_ptr(), rz_vector_len(), rz_vector_new(), rz_vector_push(), strdup(), and rz_pvector_t::v.
Referenced by rz_table_query().
Definition at line 661 of file table.c.
References i, RzTableRow::items, NULL, RzTable::rows, RZ_FREE, RZ_LOG_ERROR, RZ_NEW, rz_num_math(), rz_pvector_at(), rz_return_if_fail, rz_table_add_rowf(), rz_table_row_fini(), rz_vector_index_ptr(), rz_vector_len(), rz_vector_remove_at(), and ut64().
Referenced by rz_table_query().
Definition at line 114 of file table.c.
References RzTable::cols, free(), RzTable::rows, and rz_vector_free().
Referenced by analysis_class_print(), cmd_print_blocks(), print_windows(), references_handler(), rz_analysis_function_list_ascii_handler(), rz_cmd_info_section_bars_handler(), rz_cmd_state_output_fini(), rz_core_analysis_bbs_asciiart(), rz_core_analysis_il_vm_status(), rz_core_bin_sections_print(), rz_debug_traces_ascii(), rz_heap_debug_block_win(), rz_heap_list_w32(), rz_open_binary_list_ascii_handler(), rz_open_maps_list_ascii_handler(), rz_w32_identify_window(), and w32_list_heaps_blocks().
RZ_API void rz_table_group | ( | RzTable * | t, |
int | nth, | ||
RzTableSelector | fcn | ||
) |
Definition at line 846 of file table.c.
References RzTable::cols, i, RzTableRow::items, RzTable::rows, RZ_FREE, RZ_LOG_ERROR, RZ_NEW, rz_rows_cmp(), rz_table_row_fini(), rz_vector_index_ptr(), rz_vector_len(), and rz_vector_remove_at().
Referenced by rz_table_query(), and rz_table_uniq().
Definition at line 1201 of file table.c.
References RzTable::showHeader.
Referenced by rz_core_bin_info_print(), and rz_core_file_info_print().
Definition at line 103 of file table.c.
References RzTable::cols, NULL, RzTable::rows, RZ_NEW0, rz_table_column_fini_wrapper(), rz_table_row_fini_wrapper(), rz_vector_new(), RzTable::showHeader, and RzTable::showSum.
Referenced by __new_heapblock_tbl(), analysis_class_print(), create_window_table(), rz_cmd_state_output_init(), rz_core_analysis_il_vm_status(), rz_core_bin_sections_print(), rz_core_table(), rz_debug_traces_ascii(), rz_heap_list_w32(), and rz_table_transpose().
Definition at line 1050 of file table.c.
References __resolveOperation(), __table_adjust(), eprintf, free(), list(), NULL, rz_list_append(), rz_list_free(), rz_list_get_n(), rz_list_length(), rz_list_new(), rz_list_prepend(), rz_return_val_if_fail, rz_str_split_list(), rz_str_trim_head_ro(), rz_table_column_nth(), rz_table_columns(), rz_table_filter(), rz_table_group(), rz_table_sort(), rz_table_sortlen(), set_table_format(), and strdup().
Referenced by argv_call_cb(), cmd_pxr(), and rz_core_bin_sections_print().
RZ_API void rz_table_row_fini | ( | RZ_NONNULL void * | _row | ) |
clear function for RzVector rows in RzTable
_row | pointer to the elements of rows in RzTable |
Definition at line 68 of file table.c.
References RzTableRow::items, rz_pvector_free(), and rz_return_if_fail.
Referenced by rz_table_filter(), rz_table_group(), and rz_table_row_fini_wrapper().
RZ_API RzTableRow* rz_table_row_new | ( | RzPVector * | items | ) |
Definition at line 152 of file table.c.
References RzTableRow::items, and RZ_NEW.
Referenced by rz_table_add_row(), and rz_table_add_row_vec().
Specify the types and names of the referenced table.
t | Referenced RzTable |
fmt | String containing the numer and types of the columns |
... | Variable number of strings that specify the names of the columns. There should be enough string as characters in fmt . |
Definition at line 234 of file table.c.
References rz_table_set_vcolumnsf().
Referenced by analysis_class_print(), cmd_print_blocks(), disassembly_as_table(), references_handler(), rz_core_analysis_il_vm_status(), rz_core_analysis_sigdb_print(), rz_core_bin_info_print(), rz_core_io_plugin_print(), rz_table_visual_list(), and show_regs_handler().
Specify the types and names of the referenced table.
t | Referenced RzTable |
fmt | String containing the numer and types of the columns |
ap | Variable number of strings that specify the names of the columns. There should be enough string as characters in fmt . |
Definition at line 193 of file table.c.
References eprintf, f, name, rz_table_add_column(), rz_table_type(), and typeString().
Referenced by rz_cmd_state_output_set_columnsf(), and rz_table_set_columnsf().
Definition at line 784 of file table.c.
References RzTableColumnType::cmp, cmp(), RzTable::cols, Gcmp, Gnth, NULL, RzTable::rows, rz_vector_index_ptr(), rz_vector_sort(), and RzTableColumn::type.
Referenced by rz_table_query().
Definition at line 580 of file table.c.
References c, RzTable::cols, comma, RzTableRow::items, RzTableColumn::name, RzTable::rows, rz_pvector_foreach, rz_strbuf_append(), rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_new(), rz_vector_foreach, rz_vector_index_ptr(), sb, and RzTable::showHeader.
Referenced by rz_table_tostring().
RZ_API RZ_OWN char* rz_table_tofancystring | ( | RZ_NONNULL RzTable * | t | ) |
Convert the content of RzTable to string.
t | pointer to RzTable |
Definition at line 404 of file table.c.
References __computeTotal(), __strbuf_append_col_aligned_fancy(), __table_adjust(), c, free(), RzTableRow::items, len, maxlen, RzTableColumn::name, NULL, num, RUNE_CORNER_BL, RUNE_CORNER_BR, RUNE_CORNER_TL, RUNE_CORNER_TR, RUNE_CURVE_CORNER_BL, RUNE_CURVE_CORNER_BR, RUNE_CURVE_CORNER_TL, RUNE_CURVE_CORNER_TR, RUNE_LINE_HORIZ, RUNE_LINE_VERT, RZ_MAX, rz_pvector_foreach, rz_return_val_if_fail, rz_str_len_utf8_ansi(), rz_str_newf(), rz_str_repeat(), rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_get(), rz_strbuf_new(), rz_strbuf_prepend(), rz_vector_foreach, rz_vector_index_ptr(), rz_vector_len(), s, sb, sdb_itoa(), strdup(), autogen_x86imm::tmp, RzTableColumn::total, rz_cons_t::use_utf8, rz_cons_t::use_utf8_curvy, useUtf8, and useUtf8Curvy.
Referenced by cmd_print_blocks(), rz_table_tostring(), and rz_w32_identify_window().
Convert RzTable to json format.
t | pointer to RzTable |
Definition at line 626 of file table.c.
References c, RzTable::cols, RzTableRow::items, n, RzTableColumn::name, NULL, pj_a(), pj_drain(), pj_end(), pj_kn(), pj_ks(), pj_new(), pj_o(), RzTable::rows, rz_num_get(), rz_pvector_foreach, rz_return_val_if_fail, rz_table_type_number, rz_vector_foreach, rz_vector_index_ptr(), RzTableColumn::type, and ut64().
Referenced by references_handler(), and rz_table_tostring().
Definition at line 527 of file table.c.
References __computeTotal(), __strbuf_append_col_aligned(), __table_adjust(), c, RzTable::cols, RzTable::cons, free(), RzTableRow::items, len, maxlen, RzTableColumn::name, RzTable::rows, RUNE_LONG_LINE_HORIZ, RZ_MAX, rz_pvector_foreach, rz_pvector_tail(), rz_str_len_utf8_ansi(), rz_str_repeat(), rz_strbuf_append(), rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_get(), rz_strbuf_new(), rz_vector_foreach, rz_vector_index_ptr(), rz_vector_tail(), sb, sdb_itoa(), RzTable::showHeader, RzTable::showSum, autogen_x86imm::tmp, RzTableColumn::total, rz_cons_t::use_utf8, and rz_cons_t::use_utf8_curvy.
Referenced by rz_table_tostring().
Definition at line 510 of file table.c.
References free(), rz_str_newf(), rz_table_tocsv(), rz_table_tofancystring(), rz_table_tojson(), rz_table_tosimplestring(), s, RzTable::showCSV, RzTable::showFancy, and RzTable::showJSON.
Referenced by add_footer(), analysis_class_print(), print_windows(), references_handler(), rz_analysis_function_list_ascii_handler(), rz_cmd_info_section_bars_handler(), rz_cmd_state_output_print(), rz_core_analysis_bbs_asciiart(), rz_core_analysis_il_vm_status(), rz_core_bin_sections_print(), rz_debug_traces_ascii(), rz_heap_debug_block_win(), rz_heap_list_w32(), rz_open_binary_list_ascii_handler(), rz_open_maps_list_ascii_handler(), and w32_list_heaps_blocks().
RZ_API RZ_OWN RzTable* rz_table_transpose | ( | RZ_NONNULL RzTable * | t | ) |
Generates the transpose of RzTable.
/param t Referenced RzTable
/return t Referenced RzTable
This function returns the transpose of the RzTable passed to the table.
Definition at line 1292 of file table.c.
References rz_list_t::head, i, RzTableRow::items, RzTableColumn::name, NULL, RzTable::rows, rz_list_append(), rz_list_free(), rz_list_new(), RZ_LOG_WARN, rz_pvector_foreach, rz_pvector_push(), rz_return_val_if_fail, rz_strf, rz_table_add_column(), rz_table_add_row(), rz_table_new(), rz_table_type(), rz_vector_foreach, rz_vector_index_ptr(), rz_vector_len(), strdup(), and typeString().
RZ_API RzTableColumnType* rz_table_type | ( | const char * | name | ) |
Definition at line 24 of file table.c.
References NULL, rz_table_type_bool, rz_table_type_number, and rz_table_type_string.
Referenced by __new_heapblock_tbl(), cmd_pxr(), create_window_table(), function_list_print_to_table(), print_stats(), rz_analysis_function_all_opcode_stat_handler(), rz_heap_list_w32(), rz_table_set_vcolumnsf(), rz_table_transpose(), and table_add_row_bool().
Definition at line 842 of file table.c.
References NULL, and rz_table_group().
RZ_API void rz_table_visual_list | ( | RzTable * | table, |
RzList * | list, | ||
ut64 | seek, | ||
ut64 | len, | ||
int | width, | ||
bool | va | ||
) |
Definition at line 1205 of file table.c.
References b, RzTable::cons, free(), i, if(), info(), len, list(), max, min, mul(), PFMT64x, pos, RUNE_LONG_LINE_HORIZ, rz_itv_contain(), rz_itv_end(), rz_str_rwx_i(), rz_strbuf_append(), rz_strbuf_drain(), rz_strbuf_free(), rz_strbuf_new(), rz_strf, rz_table_add_rowf(), rz_table_set_columnsf(), s, sdb_fmt(), seek(), RzTable::showHeader, rz_cons_t::use_utf8, ut64(), UT64_MAX, UTF_BLOCK, and width.
Referenced by rz_analysis_function_list_ascii_handler(), rz_cmd_info_section_bars_handler(), rz_core_analysis_bbs_asciiart(), rz_debug_traces_ascii(), rz_open_binary_list_ascii_handler(), and rz_open_maps_list_ascii_handler().