Rizin
unix-like reverse engineering framework and cli tools
rz_table.h
Go to the documentation of this file.
1 #ifndef RZ_UTIL_TABLE_H
2 #define RZ_UTIL_TABLE_H
3 
4 #include <rz_util.h>
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
10 typedef struct {
11  const char *name;
14 
15 typedef struct {
16  char *name;
18  int align; // left, right, center (TODO: unused)
19  int width; // computed
20  int maxWidth;
22  int total;
24 
25 typedef struct {
26  char *name;
29  int perm;
30  char *extra;
31 } RzListInfo;
32 
33 enum {
37 };
38 
39 typedef struct {
41 } RzTableRow;
42 
43 typedef struct {
46  int totalCols;
47  bool showHeader;
48  bool showFancy;
49  bool showJSON;
50  bool showCSV;
51  bool showSum;
53  void *cons;
54 } RzTable;
55 
56 typedef void (*RzTableSelector)(RzTableRow *acc, RzTableRow *new_row, int nth);
57 
58 RZ_API void rz_table_row_fini(RZ_NONNULL void *_row);
59 RZ_API void rz_table_column_fini(RZ_NONNULL void *_col);
64 RZ_API int rz_table_column_nth(RzTable *t, const char *name);
65 RZ_API void rz_table_add_column(RzTable *t, RzTableColumnType *type, const char *name, int maxWidth);
66 RZ_API void rz_table_set_columnsf(RzTable *t, const char *fmt, ...);
67 RZ_API void rz_table_set_vcolumnsf(RzTable *t, const char *fmt, va_list ap);
69 RZ_API void rz_table_add_row(RZ_NONNULL RzTable *t, const char *name, ...);
70 RZ_API void rz_table_add_rowf(RzTable *t, const char *fmt, ...);
71 RZ_API void rz_table_add_row_columnsf(RzTable *t, const char *fmt, ...);
76 RZ_API char *rz_table_tocsv(RzTable *t);
78 RZ_API void rz_table_filter(RzTable *t, int nth, int op, const char *un);
79 RZ_API void rz_table_sort(RzTable *t, int nth, bool inc);
81 RZ_API void rz_table_group(RzTable *t, int nth, RzTableSelector fcn);
82 RZ_API bool rz_table_query(RzTable *t, const char *q);
84 RZ_API bool rz_table_align(RzTable *t, int nth, int align);
85 RZ_API void rz_table_visual_list(RzTable *table, RzList *list, ut64 seek, ut64 len, int width, bool va);
87 RZ_API void rz_table_columns(RzTable *t, RzList *cols); // const char *name, ...);
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif
size_t len
Definition: 6502dis.c:15
#define RZ_API
static void list(RzEgg *egg)
Definition: rz-gg.c:52
int type
Definition: mipsasm.c:17
int(* RzListComparator)(const void *value, const void *list_data)
Definition: rz_list.h:33
RZ_API bool rz_table_align(RzTable *t, int nth, int align)
Definition: table.c:1192
RZ_API RzTableRow * rz_table_row_new(RzPVector *items)
Definition: table.c:152
RZ_API void rz_table_add_column(RzTable *t, RzTableColumnType *type, const char *name, int maxWidth)
Definition: table.c:134
RZ_API void rz_table_visual_list(RzTable *table, RzList *list, ut64 seek, ut64 len, int width, bool va)
Definition: table.c:1205
RZ_API void rz_table_column_fini(RZ_NONNULL void *_col)
clear function for RzVector cols in RzTable
Definition: table.c:83
RZ_API void rz_table_uniq(RzTable *t)
Definition: table.c:842
RZ_API void rz_table_hide_header(RzTable *t)
Definition: table.c:1201
RZ_API void rz_table_add_rowf(RzTable *t, const char *fmt,...)
Definition: table.c:316
RZ_API void rz_table_add_row_vec(RZ_NONNULL RzTable *t, RZ_NONNULL RzPVector *items)
Add a new row to RzTable.
Definition: table.c:176
RZ_API RZ_OWN char * rz_table_tojson(RzTable *t)
Convert RzTable to json format.
Definition: table.c:626
RZ_API void rz_table_free(RzTable *t)
Definition: table.c:114
RZ_API char * rz_table_tocsv(RzTable *t)
Definition: table.c:580
RZ_API bool rz_table_query(RzTable *t, const char *q)
Definition: table.c:1050
RZ_API void rz_table_add_row_columnsf(RzTable *t, const char *fmt,...)
Definition: table.c:289
RZ_API void rz_table_add_row(RZ_NONNULL RzTable *t, const char *name,...)
Definition: table.c:329
RZ_API char * rz_table_tosimplestring(RzTable *t)
Definition: table.c:527
RZ_API void rz_table_set_vcolumnsf(RzTable *t, const char *fmt, va_list ap)
Specify the types and names of the referenced table.
Definition: table.c:193
RZ_API RzTableColumn * rz_table_column_clone(RzTableColumn *col)
Definition: table.c:93
RZ_API void rz_table_group(RzTable *t, int nth, RzTableSelector fcn)
Definition: table.c:846
RZ_API void rz_table_columns(RzTable *t, RzList *cols)
Select specific columns in RzTable.
Definition: table.c:914
RZ_API void rz_table_sort(RzTable *t, int nth, bool inc)
Definition: table.c:784
@ RZ_TABLE_ALIGN_LEFT
Definition: rz_table.h:34
@ RZ_TABLE_ALIGN_RIGHT
Definition: rz_table.h:35
@ RZ_TABLE_ALIGN_CENTER
Definition: rz_table.h:36
RZ_API int rz_table_column_nth(RzTable *t, const char *name)
Definition: table.c:873
RZ_API void rz_table_set_columnsf(RzTable *t, const char *fmt,...)
Specify the types and names of the referenced table.
Definition: table.c:234
RZ_API void rz_table_row_fini(RZ_NONNULL void *_row)
clear function for RzVector rows in RzTable
Definition: table.c:68
RZ_API char * rz_table_tostring(RzTable *t)
Definition: table.c:510
RZ_API RZ_OWN RzTable * rz_table_transpose(RZ_NONNULL RzTable *t)
Generates the transpose of RzTable.
Definition: table.c:1292
RZ_API RzTable * rz_table_new(void)
Definition: table.c:103
RZ_API RZ_OWN char * rz_table_tofancystring(RZ_NONNULL RzTable *t)
Convert the content of RzTable to string.
Definition: table.c:404
RZ_API RzTableColumnType * rz_table_type(const char *name)
Definition: table.c:24
void(* RzTableSelector)(RzTableRow *acc, RzTableRow *new_row, int nth)
Definition: rz_table.h:56
RZ_API void rz_table_filter(RzTable *t, int nth, int op, const char *un)
Definition: table.c:661
#define RZ_OWN
Definition: rz_types.h:62
#define RZ_NONNULL
Definition: rz_types.h:64
RzInterval vitv
Definition: rz_table.h:28
RzInterval pitv
Definition: rz_table.h:27
char * name
Definition: rz_table.h:26
char * extra
Definition: rz_table.h:30
int perm
Definition: rz_table.h:29
const char * name
Definition: rz_table.h:11
RzListComparator cmp
Definition: rz_table.h:12
RzTableColumnType * type
Definition: rz_table.h:17
bool forceUppercase
Definition: rz_table.h:21
int maxWidth
Definition: rz_table.h:20
char * name
Definition: rz_table.h:16
RzPVector * items
Definition: rz_table.h:40
bool showFancy
Definition: rz_table.h:48
RzVector * cols
Definition: rz_table.h:45
bool showSum
Definition: rz_table.h:51
bool showHeader
Definition: rz_table.h:47
int totalCols
Definition: rz_table.h:46
bool showCSV
Definition: rz_table.h:50
bool showJSON
Definition: rz_table.h:49
void * cons
Definition: rz_table.h:53
bool adjustedCols
Definition: rz_table.h:52
RzVector * rows
Definition: rz_table.h:44
Definition: z80asm.h:102
int width
Definition: main.c:10
Definition: dis.c:32
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static int seek(char *argv[])