Rizin
unix-like reverse engineering framework and cli tools
rz_cons.h
Go to the documentation of this file.
1 #ifndef RZ_CONS_H
2 #define RZ_CONS_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #include <rz_types.h>
9 #include <rz_util/rz_graph.h>
10 #include <rz_util/rz_hex.h>
11 #include <rz_util/rz_log.h>
12 #include <rz_util/rz_num.h>
13 #include <rz_util/rz_panels.h>
14 #include <rz_util/rz_pj.h>
15 #include <rz_util/rz_signal.h>
16 #include <rz_util/rz_stack.h>
17 #include <rz_util/rz_str.h>
19 #include <rz_util/rz_sys.h>
20 #include <rz_util/rz_utf8.h>
21 #include <rz_util/rz_file.h>
22 #include <rz_vector.h>
23 #include <sdb.h>
24 #include <ht_up.h>
25 
26 #include <stdio.h>
27 #include <sys/types.h>
28 #include <sys/stat.h>
29 #include <fcntl.h>
30 #if __UNIX__
31 #include <termios.h>
32 #include <sys/ioctl.h>
33 #include <sys/wait.h>
34 #include <sys/socket.h>
35 #endif
36 #if !__WINDOWS__
37 #include <unistd.h>
38 #endif
39 
40 /* constants */
41 #define CONS_MAX_USER 102400
42 #define CONS_BUFSZ 0x4f00
43 #define STR_IS_NULL(x) (!x || !x[0])
44 
45 /* palette */
46 #define CONS_PALETTE_SIZE 22
47 #define CONS_COLORS_SIZE 21
48 
49 #define RZ_CONS_GREP_WORDS 10
50 #define RZ_CONS_GREP_WORD_SIZE 64
51 #define RZ_CONS_GREP_TOKENS 64
52 
54 
55 #define RZ_CONS_CMD_DEPTH 100
56 
57 typedef int (*RzConsGetSize)(int *rows);
58 typedef int (*RzConsGetCursor)(RZ_NONNULL int *rows);
59 typedef bool (*RzConsIsBreaked)(void);
60 typedef void (*RzConsFlush)(void);
61 typedef void (*RzConsGrepCallback)(const char *grep);
62 
63 typedef struct rz_cons_bind_t {
71 
72 typedef struct rz_cons_grep_t {
74  int nstrings;
75  char *str;
76  int counter;
78  int less;
79  bool hud;
80  bool human;
81  int json;
82  char *json_path;
84  int line;
85  int sort;
86  int sort_row;
88  int f_line; // first line
89  int l_line; // last line
92  int amp;
93  int zoom;
94  int zoomy; // if set then its scaled unproportionally
95  int neg;
96  int begin;
97  int end;
98  int icase;
100 
101 #if 0
102 // TODO Might be better than using rz_cons_pal_get_i
103 // And have smaller RzConsPrintablePalette and RzConsPalette
104 enum {
105  RZ_CONS_PAL_0x00 = 0,
106  RZ_CONS_PAL_0x7f,
107  RZ_CONS_PAL_0xff,
108  RZ_CONS_PAL_ARGS,
109  RZ_CONS_PAL_BIN,
110  RZ_CONS_PAL_BTEXT,
111  RZ_CONS_PAL_CALL,
112  RZ_CONS_PAL_CJMP,
113  RZ_CONS_PAL_CMP,
114  RZ_CONS_PAL_COMMENT,
115  RZ_CONS_PAL_CREG,
116  RZ_CONS_PAL_FLAG,
117  RZ_CONS_PAL_FLINE,
118  RZ_CONS_PAL_FLOC,
119  RZ_CONS_PAL_FLOW,
120  RZ_CONS_PAL_FLOW2,
121  RZ_CONS_PAL_FNAME,
122  RZ_CONS_PAL_HELP,
123  RZ_CONS_PAL_INPUT,
124  RZ_CONS_PAL_INVALID,
125  RZ_CONS_PAL_JMP,
126  RZ_CONS_PAL_LABEL,
127  RZ_CONS_PAL_MATH,
128  RZ_CONS_PAL_MOV,
129  RZ_CONS_PAL_NOP,
130  RZ_CONS_PAL_NUM,
131  RZ_CONS_PAL_OFFSET,
132  RZ_CONS_PAL_OTHER,
133  RZ_CONS_PAL_POP,
134  RZ_CONS_PAL_PROMPT,
135  RZ_CONS_PAL_PUSH,
136  RZ_CONS_PAL_CRYPTO,
137  RZ_CONS_PAL_REG,
138  RZ_CONS_PAL_RESET,
139  RZ_CONS_PAL_RET,
140  RZ_CONS_PAL_SWI,
141  RZ_CONS_PAL_TRAP,
142  RZ_CONS_PAL_AI_READ,
143  RZ_CONS_PAL_AI_WRITE,
144  RZ_CONS_PAL_AI_EXEC,
145  RZ_CONS_PAL_AI_SEQ,
146  RZ_CONS_PAL_AI_ASCII,
147  RZ_CONS_PAL_AI_UNMAP,
148  RZ_CONS_PAL_GUI_CFLOW,
149  RZ_CONS_PAL_GUI_DATAOFFSET,
150  RZ_CONS_PAL_GUI_BACKGROUND,
151  RZ_CONS_PAL_GUI_ALT_BACKGROUND,
152  RZ_CONS_PAL_GUI_BORDER,
153  RZ_CONS_PAL_LINEHL,
154  RZ_CONS_PAL_GRAPH_BOX,
155  RZ_CONS_PAL_GRAPH_BOX2,
156  RZ_CONS_PAL_GRAPH_BOX3,
157  RZ_CONS_PAL_GRAPH_BOX4,
158  RZ_CONS_PAL_GRAPH_TRUE,
159  RZ_CONS_PAL_GRAPH_FALSE,
160  RZ_CONS_PAL_GRAPH_TRUFAE,
161  RZ_CONS_PAL_GRAPH_TRACED,
162  RZ_CONS_PAL_GRAPH_CURRENT,
163  RZ_CONS_PAL_LAST
164 };
165 #endif
166 
167 enum { ALPHA_RESET = 0x00,
168  ALPHA_FG = 0x01,
169  ALPHA_BG = 0x02,
170  ALPHA_FGBG = 0x03 };
171 enum { RZ_CONS_ATTR_BOLD = 1u << 1,
172  RZ_CONS_ATTR_DIM = 1u << 2,
175  RZ_CONS_ATTR_BLINK = 1u << 5
176 };
177 
178 typedef struct rcolor_t {
179  // bold, italic, underline, ...
185  ut8 r2; // Background color
186  ut8 g2; // Only used when a &= ALPHA_FGBG
188  st8 id16; // Mapping to 16-color table
190 
191 typedef struct rz_cons_palette_t {
250 
251  /* Graph colors */
266 
268  char *b0x00;
269  char *b0x7f;
270  char *b0xff;
271  char *args;
272  char *bin;
273  char *btext;
274  char *call;
275  char *cjmp;
276  char *cmp;
277  char *comment;
278  char *usercomment;
279  char *creg;
280  char *flag;
281  char *fline;
282  char *floc;
283  char *flow;
284  char *flow2;
285  char *fname;
286  char *help;
287  char *input;
288  char *invalid;
289  char *jmp;
290  char *label;
291  char *math;
292  char *mov;
293  char *nop;
294  char *num;
295  char *offset;
296  char *other;
297  char *pop;
298  char *prompt;
299  char *push;
300  char *crypto;
301  char *reg;
302  char *reset;
303  char *ret;
304  char *swi;
305  char *trap;
306  char *ucall;
307  char *ujmp;
308  char *ai_read;
309  char *ai_write;
310  char *ai_exec;
311  char *ai_seq;
312  char *ai_ascii;
313  char *ai_unmap;
314  char *gui_cflow;
318  char *gui_border;
319  char *wordhl;
320  char *linehl;
321  char *func_var;
324  char *widget_bg;
325  char *widget_sel;
326  char *meta;
327 
328  /* graph colors */
329  char *graph_box;
330  char *graph_box2;
331  char *graph_box3;
332  char *graph_box4;
333  char *diff_match;
336  char *diff_new;
337  char *graph_true;
338  char *graph_false;
339  char *graph_ujump;
342  char **rainbow; // rainbow
343  int rainbow_sz; // size of rainbow
345 
346 typedef void (*RzConsEvent)(void *);
347 
348 #define CONS_MAX_ATTR_SZ 16
349 
350 typedef struct rz_cons_canvas_t {
351  int w;
352  int h;
353  int x;
354  int y;
355  char **b;
356  int *blen;
357  int *bsize;
358  const char *attr; // The current attr (inserted on each write)
359  HtUP *attrs; // all the different attributes <key: unsigned int loc, const char *attr>
360  RzStrConstPool constpool; // Pool for non-compile-time attrs
361  int sx; // scrollx
362  int sy; // scrolly
363  int color;
364  int linemode; // 0 = diagonal , 1 = square
366 
367 #define RUNECODE_MIN 0xc8 // 200
368 #define RUNECODE_LINE_VERT 0xc8
369 #define RUNECODE_LINE_CROSS 0xc9
370 #define RUNECODE_CORNER_BR 0xca
371 #define RUNECODE_CORNER_BL 0xcb
372 #define RUNECODE_ARROW_RIGHT 0xcc
373 #define RUNECODE_ARROW_LEFT 0xcd
374 #define RUNECODE_LINE_HORIZ 0xce
375 #define RUNECODE_CORNER_TL 0xcf
376 #define RUNECODE_CORNER_TR 0xd0
377 #define RUNECODE_LINE_UP 0xd1
378 #define RUNECODE_CURVE_CORNER_TL 0xd2
379 #define RUNECODE_CURVE_CORNER_TR 0xd3
380 #define RUNECODE_CURVE_CORNER_BR 0xd4
381 #define RUNECODE_CURVE_CORNER_BL 0xd5
382 #define RUNECODE_MAX 0xd6
383 
384 #define RUNECODESTR_MIN 0xc8 // 200
385 #define RUNECODESTR_LINE_VERT "\xc8"
386 #define RUNECODESTR_LINE_CROSS "\xc9"
387 #define RUNECODESTR_CORNER_BR "\xca"
388 #define RUNECODESTR_CORNER_BL "\xcb"
389 #define RUNECODESTR_ARROW_RIGHT "\xcc"
390 #define RUNECODESTR_ARROW_LEFT "\xcd"
391 #define RUNECODESTR_LINE_HORIZ "\xce"
392 #define RUNECODESTR_CORNER_TL "\xcf"
393 #define RUNECODESTR_CORNER_TR "\xd0"
394 #define RUNECODESTR_LINE_UP "\xd1"
395 #define RUNECODESTR_CURVE_CORNER_TL "\xd2"
396 #define RUNECODESTR_CURVE_CORNER_TR "\xd3"
397 #define RUNECODESTR_CURVE_CORNER_BR "\xd4"
398 #define RUNECODESTR_CURVE_CORNER_BL "\xd5"
399 #define RUNECODESTR_MAX 0xd5
400 
401 #define RUNE_LINE_VERT "│"
402 #define RUNE_LINE_CROSS "┼" /* ├ */
403 #define RUNE_LINE_HORIZ "─"
404 #define RUNE_LINE_UP "↑"
405 #define RUNE_CORNER_BR "┘"
406 #define RUNE_CORNER_BL "└"
407 #define RUNE_CORNER_TL "┌"
408 #define RUNE_CORNER_TR "┐"
409 #define RUNE_ARROW_RIGHT "ᐳ"
410 #define RUNE_ARROW_LEFT "ᐸ"
411 #define RUNE_ARROW_UP "ᐱ"
412 #define RUNE_ARROW_DOWN "ᐯ"
413 #define RUNE_CURVE_CORNER_TL "╭"
414 #define RUNE_CURVE_CORNER_TR "╮"
415 #define RUNE_CURVE_CORNER_BR "╯"
416 #define RUNE_CURVE_CORNER_BL "╰"
417 #define RUNE_LONG_LINE_HORIZ "―"
418 #define UTF_CIRCLE "\u25EF"
419 #define UTF_BLOCK "\u2588"
420 
421 // Emoji
422 #define UTF8_POLICE_CARS_REVOLVING_LIGHT "🚨"
423 #define UTF8_WHITE_HEAVY_CHECK_MARK "✅"
424 #define UTF8_SEE_NO_EVIL_MONKEY "🙈"
425 #define UTF8_SKULL_AND_CROSSBONES "☠"
426 #define UTF8_KEYBOARD "⌨"
427 #define UTF8_LEFT_POINTING_MAGNIFYING_GLASS "🔍"
428 #define UTF8_DOOR "🚪"
429 
430 // Variation Selectors
431 #define UTF8_VS16 "\xef\xb8\x8f"
432 
433 typedef char *(*RzConsEditorCallback)(void *core, const char *file, const char *str);
434 typedef int (*RzConsClickCallback)(void *core, int x, int y);
435 typedef void (*RzConsBreakCallback)(void *core);
436 typedef void *(*RzConsSleepBeginCallback)(void *core);
437 typedef void (*RzConsSleepEndCallback)(void *core, void *user);
438 typedef void (*RzConsQueueTaskOneshot)(void *core, void *task, void *user);
439 typedef void (*RzConsFunctionKey)(void *core, int fkey);
440 
441 typedef enum {
447 
448 typedef enum {
453 
454 typedef struct rz_cons_input_context_t {
456  char *readbuffer;
457  bool bufactive;
459 
460 typedef enum {
464 
465 typedef struct rz_cons_context_t {
468  char *buffer;
469  size_t buffer_len;
470  size_t buffer_sz;
471 
472  bool breaked;
477 
478  // Used for per-task logging redirection
479  RzLogCallback log_callback; // TODO: RzList of callbacks
480 
481  char *lastOutput;
483  bool lastMode;
486  bool pageable;
487  bool noflush;
488 
492 
493  // Memoized last calculated row/column inside buffer
494  int row;
495  int col;
498 
499 #define HUD_BUF_SIZE 512
500 
501 typedef struct rz_cons_t {
504  char *lastline;
505  bool is_html;
506  bool was_html;
507  int lines;
508  int rows;
509  int echo; // dump to stdout in realtime
510  int columns;
513  int fix_rows;
517  FILE *fdin; // FILE? and then int ??
518  int fdout; // only used in pipe.c :?? remove?
519  const char *teefile;
520  int (*user_fgets)(char *buf, int len, void *user);
523  void *event_data;
525 
533 
534  void *user; // Used by <RzCore*>
535 #if __UNIX__
536  struct termios term_raw, term_buf;
537 #elif __WINDOWS__
538  unsigned long term_raw, term_buf, term_xterm;
539  unsigned long old_input_mode, old_output_mode;
540  ut32 old_cp;
541  ut32 old_ocp;
542 #endif
544  /* Pager (like more or less) to use if the output doesn't fit on the
545  * current window. If NULL or "" no pager is used. */
546  char *pager;
548  char *highlight;
550  int null; // if set, does not show anything
551  int mouse;
552  int is_wine;
553  struct rz_line_t *line;
554  const char **vline;
555  int refcnt;
558  bool flush;
559  bool use_utf8; // use utf8 features
560  bool use_utf8_curvy; // use utf8 curved corners
563  int pagesize;
564  char *break_word;
566  ut64 timeout; // must come from rz_time_now_mono()
569  bool filter;
570  char *(*rgbstr)(char *str, size_t sz, ut64 addr);
571  bool click_set;
572  int click_x;
573  int click_y;
574  bool show_vals; // show which section in Vv
575  // TODO: move into instance? + avoid unnecessary copies
577 
578 #define RZ_CONS_KEY_F1 0xf1
579 #define RZ_CONS_KEY_F2 0xf2
580 #define RZ_CONS_KEY_F3 0xf3
581 #define RZ_CONS_KEY_F4 0xf4
582 #define RZ_CONS_KEY_F5 0xf5
583 #define RZ_CONS_KEY_F6 0xf6
584 #define RZ_CONS_KEY_F7 0xf7
585 #define RZ_CONS_KEY_F8 0xf8
586 #define RZ_CONS_KEY_F9 0xf9
587 #define RZ_CONS_KEY_F10 0xfa
588 #define RZ_CONS_KEY_F11 0xfb
589 #define RZ_CONS_KEY_F12 0xfc
590 
591 #define RZ_CONS_KEY_ESC 0x1b
592 
593 #define RZ_CONS_CLEAR_LINE "\x1b[2K\r"
594 #define RZ_CONS_CLEAR_SCREEN "\x1b[2J\r"
595 #define RZ_CONS_CLEAR_FROM_CURSOR_TO_END "\x1b[0J\r"
596 
597 #define RZ_CONS_CURSOR_SAVE "\x1b[s"
598 #define RZ_CONS_CURSOR_RESTORE "\x1b[u"
599 #define RZ_CONS_GET_CURSOR_POSITION "\x1b[6n"
600 #define RZ_CONS_CURSOR_UP "\x1b[A"
601 #define RZ_CONS_CURSOR_DOWN "\x1b[B"
602 #define RZ_CONS_CURSOR_RIGHT "\x1b[C"
603 #define RZ_CONS_CURSOR_LEFT "\x1b[D"
604 
605 #define Color_BLINK "\x1b[5m"
606 #define Color_INVERT "\x1b[7m"
607 #define Color_INVERT_RESET "\x1b[27m"
608 /* See 'man 4 console_codes' for details:
609  * "ESC c" -- Reset
610  * "ESC ( K" -- Select user mapping
611  * "ESC [ 0 m" -- Reset all display attributes
612  * "ESC [ J" -- Erase to the end of screen
613  * "ESC [ ? 25 h" -- Make cursor visible
614  */
615 #define Color_RESET_TERMINAL "\x1b" \
616  "c\x1b(K\x1b[0m\x1b[J\x1b[?25h"
617 #define Color_RESET "\x1b[0m" /* reset all */
618 #define Color_RESET_NOBG "\x1b[27;22;24;25;28;39m" /* Reset everything except background (order is important) */
619 #define Color_RESET_BG "\x1b[49m"
620 #define Color_RESET_ALL "\x1b[0m\x1b[49m"
621 #define Color_BLACK "\x1b[30m"
622 #define Color_BGBLACK "\x1b[40m"
623 #define Color_RED "\x1b[31m"
624 #define Color_BGRED "\x1b[41m"
625 #define Color_WHITE "\x1b[37m"
626 #define Color_BGWHITE "\x1b[47m"
627 #define Color_GREEN "\x1b[32m"
628 #define Color_BGGREEN "\x1b[42m"
629 #define Color_MAGENTA "\x1b[35m"
630 #define Color_BGMAGENTA "\x1b[45m"
631 #define Color_YELLOW "\x1b[33m"
632 #define Color_BGYELLOW "\x1b[43m"
633 #define Color_CYAN "\x1b[36m"
634 #define Color_BGCYAN "\x1b[46m"
635 #define Color_BLUE "\x1b[34m"
636 #define Color_BGBLUE "\x1b[44m"
637 #define Color_GRAY "\x1b[90m"
638 #define Color_BGGRAY "\x1b[100m"
639 /* bright colors */
640 #define Color_BBLACK Color_GRAY
641 #define Color_BBGBLACK Color_BGGRAY
642 #define Color_BRED "\x1b[91m"
643 #define Color_BBGRED "\x1b[101m"
644 #define Color_BWHITE "\x1b[97m"
645 #define Color_BBGWHITE "\x1b[107m"
646 #define Color_BGREEN "\x1b[92m"
647 #define Color_BBGGREEN "\x1b[102m"
648 #define Color_BMAGENTA "\x1b[95m"
649 #define Color_BBGMAGENTA "\x1b[105m"
650 #define Color_BYELLOW "\x1b[93m"
651 #define Color_BBGYELLOW "\x1b[103m"
652 #define Color_BCYAN "\x1b[96m"
653 #define Color_BBGCYAN "\x1b[106m"
654 #define Color_BBLUE "\x1b[94m"
655 #define Color_BBGBLUE "\x1b[104m"
656 
657 #if defined(_MSC_VER) || (defined(__GNUC__) && __GNUC__ < 5)
658 #define RZCOLOR(a, r, g, b, bgr, bgg, bgb, id16) \
659  { 0, a, r, g, b, bgr, bgg, bgb, id16 }
660 #else
661 #define RZCOLOR(a, r, g, b, bgr, bgg, bgb, id16) \
662  (RzColor) { 0, a, r, g, b, bgr, bgg, bgb, id16 }
663 #endif
664 #define RzColor_NULL RZCOLOR(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -1)
665 #if __WINDOWS__
666 #define RzColor_BLACK RZCOLOR(ALPHA_FG, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0)
667 #define RzColor_BGBLACK RZCOLOR(ALPHA_BG, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0)
668 #define RzColor_RED RZCOLOR(ALPHA_FG, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 1)
669 #define RzColor_BGRED RZCOLOR(ALPHA_BG, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 1)
670 #define RzColor_WHITE RZCOLOR(ALPHA_FG, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 7)
671 #define RzColor_BGWHITE RZCOLOR(ALPHA_BG, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 7)
672 #define RzColor_GREEN RZCOLOR(ALPHA_FG, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 2)
673 #define RzColor_BGGREEN RZCOLOR(ALPHA_BG, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 2)
674 #define RzColor_MAGENTA RZCOLOR(ALPHA_FG, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 5)
675 #define RzColor_BGMAGENTA RZCOLOR(ALPHA_BG, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 5)
676 #define RzColor_YELLOW RZCOLOR(ALPHA_FG, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 3)
677 #define RzColor_BGYELLOW RZCOLOR(ALPHA_BG, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 3)
678 #define RzColor_CYAN RZCOLOR(ALPHA_FG, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 6)
679 #define RzColor_BGCYAN RZCOLOR(ALPHA_BG, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 6)
680 #define RzColor_BLUE RZCOLOR(ALPHA_FG, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 4)
681 #define RzColor_BGBLUE RZCOLOR(ALPHA_BG, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 4)
682 #define RzColor_BBLACK RZCOLOR(ALPHA_FG, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 8)
683 #define RzColor_BBGBLACK RZCOLOR(ALPHA_BG, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 8)
684 #define RzColor_BRED RZCOLOR(ALPHA_FG, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 9)
685 #define RzColor_BBGRED RZCOLOR(ALPHA_BG, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 9)
686 #define RzColor_BWHITE RZCOLOR(ALPHA_FG, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 15)
687 #define RzColor_BBGWHITE RZCOLOR(ALPHA_BG, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 15)
688 #define RzColor_BGREEN RZCOLOR(ALPHA_FG, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 10)
689 #define RzColor_BBGGREEN RZCOLOR(ALPHA_BG, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 10)
690 #define RzColor_BMAGENTA RZCOLOR(ALPHA_FG, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 13)
691 #define RzColor_BBGMAGENTA RZCOLOR(ALPHA_BG, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 13)
692 #define RzColor_BYELLOW RZCOLOR(ALPHA_FG, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 11)
693 #define RzColor_BBGYELLOW RZCOLOR(ALPHA_BG, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 11)
694 #define RzColor_BCYAN RZCOLOR(ALPHA_FG, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 14)
695 #define RzColor_BBGCYAN RZCOLOR(ALPHA_BG, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 14)
696 #define RzColor_BBLUE RZCOLOR(ALPHA_FG, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 12)
697 #define RzColor_BBGBLUE RZCOLOR(ALPHA_BG, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 12)
698 #else
699 // Campbell (https://devblogs.microsoft.com/commandline/updating-the-windows-console-colors/).
700 // Not used on Windows since cmd.exe doesn't support bold (needed for easier
701 // differentiation between normal and bright color text for some colors).
702 #define RzColor_BLACK RZCOLOR(ALPHA_FG, 12, 12, 12, 0x00, 0x00, 0x00, 0)
703 #define RzColor_BGBLACK RZCOLOR(ALPHA_BG, 12, 12, 12, 0x00, 0x00, 0x00, 0)
704 #define RzColor_RED RZCOLOR(ALPHA_FG, 197, 15, 31, 0x00, 0x00, 0x00, 1)
705 #define RzColor_BGRED RZCOLOR(ALPHA_BG, 197, 15, 31, 0x00, 0x00, 0x00, 1)
706 #define RzColor_WHITE RZCOLOR(ALPHA_FG, 204, 204, 204, 0x00, 0x00, 0x00, 7)
707 #define RzColor_BGWHITE RZCOLOR(ALPHA_BG, 204, 204, 204, 0x00, 0x00, 0x00, 7)
708 #define RzColor_GREEN RZCOLOR(ALPHA_FG, 19, 161, 14, 0x00, 0x00, 0x00, 2)
709 #define RzColor_BGGREEN RZCOLOR(ALPHA_BG, 19, 161, 14, 0x00, 0x00, 0x00, 2)
710 #define RzColor_MAGENTA RZCOLOR(ALPHA_FG, 136, 23, 152, 0x00, 0x00, 0x00, 5)
711 #define RzColor_BGMAGENTA RZCOLOR(ALPHA_BG, 136, 23, 152, 0x00, 0x00, 0x00, 5)
712 #define RzColor_YELLOW RZCOLOR(ALPHA_FG, 193, 156, 0, 0x00, 0x00, 0x00, 3)
713 #define RzColor_BGYELLOW RZCOLOR(ALPHA_BG, 193, 156, 0, 0x00, 0x00, 0x00, 3)
714 #define RzColor_CYAN RZCOLOR(ALPHA_FG, 58, 150, 221, 0x00, 0x00, 0x00, 6)
715 #define RzColor_BGCYAN RZCOLOR(ALPHA_BG, 58, 150, 221, 0x00, 0x00, 0x00, 6)
716 #define RzColor_BLUE RZCOLOR(ALPHA_FG, 0, 55, 218, 0x00, 0x00, 0x00, 4)
717 #define RzColor_BGBLUE RZCOLOR(ALPHA_BG, 0, 55, 218, 0x00, 0x00, 0x00, 4)
718 #define RzColor_BBLACK RZCOLOR(ALPHA_FG, 118, 118, 118, 0x00, 0x00, 0x00, 8)
719 #define RzColor_BBGBLACK RZCOLOR(ALPHA_BG, 118, 118, 118, 0x00, 0x00, 0x00, 8)
720 #define RzColor_BRED RZCOLOR(ALPHA_FG, 231, 72, 86, 0x00, 0x00, 0x00, 9)
721 #define RzColor_BBGRED RZCOLOR(ALPHA_BG, 231, 72, 86, 0x00, 0x00, 0x00, 9)
722 #define RzColor_BWHITE RZCOLOR(ALPHA_FG, 242, 242, 242, 0x00, 0x00, 0x00, 15)
723 #define RzColor_BBGWHITE RZCOLOR(ALPHA_BG, 242, 242, 242, 0x00, 0x00, 0x00, 15)
724 #define RzColor_BGREEN RZCOLOR(ALPHA_FG, 22, 198, 12, 0x00, 0x00, 0x00, 10)
725 #define RzColor_BBGGREEN RZCOLOR(ALPHA_BG, 22, 198, 12, 0x00, 0x00, 0x00, 10)
726 #define RzColor_BMAGENTA RZCOLOR(ALPHA_FG, 180, 0, 158, 0x00, 0x00, 0x00, 13)
727 #define RzColor_BBGMAGENTA RZCOLOR(ALPHA_BG, 180, 0, 158, 0x00, 0x00, 0x00, 13)
728 #define RzColor_BYELLOW RZCOLOR(ALPHA_FG, 249, 241, 165, 0x00, 0x00, 0x00, 11)
729 #define RzColor_BBGYELLOW RZCOLOR(ALPHA_BG, 249, 241, 165, 0x00, 0x00, 0x00, 11)
730 #define RzColor_BCYAN RZCOLOR(ALPHA_FG, 97, 214, 214, 0x00, 0x00, 0x00, 14)
731 #define RzColor_BBGCYAN RZCOLOR(ALPHA_BG, 97, 214, 214, 0x00, 0x00, 0x00, 14)
732 #define RzColor_BBLUE RZCOLOR(ALPHA_FG, 59, 120, 255, 0x00, 0x00, 0x00, 12)
733 #define RzColor_BBGBLUE RZCOLOR(ALPHA_BG, 59, 120, 255, 0x00, 0x00, 0x00, 12)
734 #endif
735 #define RzColor_GRAY RzColor_BBLACK
736 #define RzColor_BGGRAY RzColor_BBGBLACK
737 
738 #define Colors_PLAIN \
739  { \
740  Color_BLACK, Color_RED, Color_WHITE, \
741  Color_GREEN, Color_MAGENTA, Color_YELLOW, \
742  Color_CYAN, Color_BLUE, Color_GRAY \
743  }
744 
745 enum {
765  PAL_FF
766 };
767 
768 /* canvas line colors */
769 enum {
776 };
777 
778 typedef enum {
779  INSERT_MODE = 'i',
780  CONTROL_MODE = 'c'
782 
783 #define DOT_STYLE_NORMAL 0
784 #define DOT_STYLE_CONDITIONAL 1
785 #define DOT_STYLE_BACKEDGE 2
786 
788  int color;
789  int symbol;
792 
793 // UTF-8 symbols indexes
794 #define LINE_VERT 0
795 #define LINE_CROSS 1
796 #define LINE_HORIZ 2
797 #define LINE_UP 3
798 #define CORNER_TL 6
799 #define CORNER_BR 4
800 #define CORNER_BL 5
801 #define CORNER_TR 6
802 #define ARROW_RIGHT 8
803 #define ARROW_LEFT 9
804 #define SELF_LOOP 10
805 
806 #ifdef RZ_API
813 RZ_API void rz_cons_canvas_write(RzConsCanvas *c, const char *_s);
814 RZ_API bool rz_cons_canvas_gotoxy(RzConsCanvas *c, int x, int y);
815 RZ_API void rz_cons_canvas_box(RzConsCanvas *c, int x, int y, int w, int h, const char *color);
816 RZ_API void rz_cons_canvas_line(RzConsCanvas *c, int x, int y, int x2, int y2, RzCanvasLineStyle *style);
817 RZ_API void rz_cons_canvas_line_diagonal(RzConsCanvas *c, int x, int y, int x2, int y2, RzCanvasLineStyle *style);
818 RZ_API void rz_cons_canvas_line_square(RzConsCanvas *c, int x, int y, int x2, int y2, RzCanvasLineStyle *style);
819 RZ_API int rz_cons_canvas_resize(RzConsCanvas *c, int w, int h);
820 RZ_API void rz_cons_canvas_fill(RzConsCanvas *c, int x, int y, int w, int h, char ch);
821 RZ_API void rz_cons_canvas_line_square_defined(RzConsCanvas *c, int x, int y, int x2, int y2, RzCanvasLineStyle *style, int bendpoint, int isvert);
822 RZ_API void rz_cons_canvas_line_back_edge(RzConsCanvas *c, int x, int y, int x2, int y2, RzCanvasLineStyle *style, int ybendpoint1, int xbendpoint, int ybendpoint2, int isvert);
823 RZ_API RzCons *rz_cons_new(void);
825 RZ_API RzCons *rz_cons_free(void);
826 RZ_API char *rz_cons_lastline(int *size);
828 RZ_API void rz_cons_set_click(int x, int y);
829 RZ_API bool rz_cons_get_click(int *x, int *y);
830 
831 typedef void (*RzConsBreak)(void *);
832 RZ_API bool rz_cons_is_breaked(void);
833 RZ_API bool rz_cons_is_interactive(void);
835 RZ_API void *rz_cons_sleep_begin(void);
836 RZ_API void rz_cons_sleep_end(void *user);
837 
838 /* ^C */
839 RZ_API void rz_cons_break_push(RzConsBreak cb, void *user);
840 RZ_API void rz_cons_break_pop(void);
841 RZ_API void rz_cons_break_clear(void);
842 RZ_API void rz_cons_breakword(RZ_NULLABLE const char *s);
843 RZ_API void rz_cons_break_end(void);
845 
846 /* pipe */
847 RZ_API int rz_cons_pipe_open(const char *file, int fdn, int append);
848 RZ_API void rz_cons_pipe_close(int fd);
849 
850 #if __WINDOWS__
851 RZ_API RzVirtTermMode rz_cons_detect_vt_mode(void);
852 RZ_API void rz_cons_w32_clear(void);
853 RZ_API void rz_cons_w32_gotoxy(int fd, int x, int y);
854 RZ_API int rz_cons_w32_print(const char *ptr, int len, bool vmode);
855 RZ_API int rz_cons_win_printf(bool vmode, const char *fmt, ...) RZ_PRINTF_CHECK(2, 3);
856 RZ_API int rz_cons_win_eprintf(bool vmode, const char *fmt, ...) RZ_PRINTF_CHECK(2, 3);
857 RZ_API int rz_cons_win_vhprintf(unsigned long hdl, bool vmode, const char *fmt, va_list ap);
858 #endif
859 
860 RZ_API void rz_cons_push(void);
861 RZ_API void rz_cons_pop(void);
865 RZ_API void rz_cons_context_reset(void);
868 RZ_API void rz_cons_context_break_push(RzConsContext *context, RzConsBreak cb, void *user, bool sig);
870 
871 /* control */
872 RZ_API void rz_cons_reset(void);
873 RZ_API void rz_cons_reset_colors(void);
875 RZ_API void rz_cons_echo(const char *msg);
876 RZ_API void rz_cons_zero(void);
877 RZ_API void rz_cons_highlight(const char *word);
878 RZ_API void rz_cons_clear(void);
879 RZ_API void rz_cons_clear_buffer(void);
880 RZ_API void rz_cons_clear00(void);
881 RZ_API void rz_cons_clear_line(int err);
882 RZ_API void rz_cons_fill_line(void);
883 RZ_API void rz_cons_gotoxy(int x, int y);
884 RZ_API int rz_cons_get_cur_line(void);
885 RZ_API void rz_cons_show_cursor(int cursor);
886 RZ_API char *rz_cons_swap_ground(const char *col);
887 RZ_API bool rz_cons_drop(int n);
888 RZ_API void rz_cons_chop(void);
889 RZ_API void rz_cons_set_raw(bool b);
890 RZ_API void rz_cons_set_interactive(bool b);
892 RZ_API void rz_cons_set_utf8(bool b);
893 RZ_API void rz_cons_grep(const char *grep);
894 
895 /* output */
896 RZ_API int rz_cons_printf(const char *format, ...) RZ_PRINTF_CHECK(1, 2);
897 RZ_API void rz_cons_printf_list(const char *format, va_list ap);
898 RZ_API void rz_cons_strcat(const char *str);
899 RZ_API void rz_cons_strcat_at(const char *str, int x, char y, int w, int h);
900 #define rz_cons_print(x) rz_cons_strcat(x)
901 RZ_API void rz_cons_println(const char *str);
902 
903 RZ_API void rz_cons_strcat_justify(const char *str, int j, char c);
904 RZ_API int rz_cons_memcat(const char *str, int len);
905 RZ_API void rz_cons_newline(void);
906 RZ_API void rz_cons_filter(void);
907 RZ_API void rz_cons_flush(void);
908 RZ_API void rz_cons_set_flush(bool flush);
909 RZ_API void rz_cons_last(void);
910 RZ_API int rz_cons_less_str(const char *str, const char *exitkeys);
911 RZ_API void rz_cons_less(void);
912 RZ_API void rz_cons_memset(char ch, int len);
913 RZ_API void rz_cons_visual_flush(void);
915 RZ_API bool rz_cons_is_utf8(void);
916 RZ_API void rz_cons_cmd_help(const char *help[], bool use_color);
917 
918 /* input */
919 RZ_API int rz_cons_controlz(int ch);
920 RZ_API int rz_cons_readchar(void);
921 RZ_API bool rz_cons_readbuffer_readchar(char *ch);
922 RZ_API bool rz_cons_readpush(const char *str, int len);
923 RZ_API void rz_cons_readflush(void);
924 RZ_API void rz_cons_switchbuf(bool active);
926 RZ_API int rz_cons_any_key(const char *msg);
927 RZ_API int rz_cons_eof(void);
928 
929 RZ_API int rz_cons_pal_set(const char *key, const char *val);
934 RZ_API char *rz_cons_pal_parse(const char *str, RzColor *outcol);
935 RZ_API void rz_cons_pal_random(void);
936 RZ_API RzColor rz_cons_pal_get(const char *key);
937 RZ_API RzColor rz_cons_pal_get_i(int index);
938 RZ_API const char *rz_cons_pal_get_name(int index);
939 RZ_API int rz_cons_pal_len(void);
940 RZ_API int rz_cons_rgb_parse(const char *p, ut8 *r, ut8 *g, ut8 *b, ut8 *a);
942 RZ_API void rz_cons_pal_list(int rad, const char *arg);
943 RZ_API void rz_cons_pal_show(void);
944 RZ_API int rz_cons_get_size(int *rows);
945 RZ_API bool rz_cons_isatty(void);
946 RZ_API int rz_cons_get_cursor(RZ_NONNULL int *rows);
947 RZ_API int rz_cons_arrow_to_hjkl(int ch);
948 RZ_API char *rz_cons_html_filter(const char *ptr, int *newlen);
949 RZ_API char *rz_cons_rainbow_get(int idx, int last, bool bg);
952 
953 RZ_API int rz_cons_fgets(char *buf, int len, int argc, const char **argv);
954 RZ_API char *rz_cons_hud(RzList /*<char *>*/ *list, const char *prompt);
955 RZ_API char *rz_cons_hud_path(const char *path, int dir);
956 RZ_API char *rz_cons_hud_string(const char *s);
957 RZ_API char *rz_cons_hud_file(const char *f);
958 
959 RZ_API const char *rz_cons_get_buffer(void);
962 RZ_API void rz_cons_grep_help(void);
963 RZ_API void rz_cons_grep_parsecmd(char *cmd, const char *quotestr);
964 RZ_API char *rz_cons_grep_strip(char *cmd, const char *quotestr);
965 RZ_API void rz_cons_grep_process(char *grep);
966 RZ_API int rz_cons_grep_line(char *buf, int len); // must be static
967 RZ_API void rz_cons_grepbuf(void);
968 
969 RZ_API void rz_cons_rgb_init(void);
970 RZ_API char *rz_cons_rgb_str_mode(RzConsColorMode mode, char *outstr, size_t sz, const RzColor *rcolor);
971 RZ_API char *rz_cons_rgb_str(char *outstr, size_t sz, const RzColor *rcolor);
972 RZ_API char *rz_cons_rgb_str_off(char *outstr, size_t sz, ut64 off);
973 RZ_API void rz_cons_color(int fg, int r, int g, int b);
974 
976 RZ_API void rz_cons_invert(int set, int color);
977 RZ_API bool rz_cons_yesno(int def, const char *fmt, ...) RZ_PRINTF_CHECK(2, 3);
978 RZ_API char *rz_cons_input(const char *msg);
979 RZ_API bool rz_cons_set_cup(bool enable);
980 RZ_API void rz_cons_column(int c);
981 RZ_API int rz_cons_get_column(void);
983 RZ_API void rz_cons_set_title(const char *str);
984 RZ_API bool rz_cons_enable_mouse(const bool enable);
985 RZ_API void rz_cons_enable_highlight(const bool enable);
988 #endif
989 
990 /* rz_line */
991 #define RZ_LINE_BUFSIZE 4096
992 #define RZ_LINE_HISTSIZE 256
993 
994 #define RZ_EDGES_X_INC 4
995 
996 #define RZ_SELWIDGET_MAXH 15
997 #define RZ_SELWIDGET_MAXW 30
998 #define RZ_SELWIDGET_DIR_UP 0
999 #define RZ_SELWIDGET_DIR_DOWN 1
1000 
1001 typedef struct rz_selection_widget_t {
1002  const char **options;
1005  int w, h;
1006  int scroll;
1010 
1011 typedef struct rz_line_hist_t {
1012  char **data;
1013  char *match;
1014  int size;
1015  int index;
1016  int top;
1020 
1021 typedef struct rz_line_buffer_t {
1023  int index;
1024  int length;
1026 
1027 typedef struct rz_hud_t {
1030  char activate;
1031  int vi;
1033 
1034 typedef struct rz_line_t RzLine; // forward declaration
1035 typedef struct rz_line_comp_t RzLineCompletion;
1036 
1037 typedef enum { RZ_LINE_PROMPT_DEFAULT,
1040 
1041 typedef int (*RzLineCompletionCb)(RzLineCompletion *completion, RzLineBuffer *buf, RzLinePromptType prompt_type, void *user);
1042 
1044  bool opt;
1045  size_t args_limit;
1046  bool quit;
1047  RzPVector args; /* <char *> */
1049  void *run_user;
1050 };
1051 
1053 
1061  HtPP *options_ht;
1062  size_t start;
1063  size_t end;
1064  const char *end_string;
1066 
1074 typedef RzLineNSCompletionResult *(*RzLineNSCompletionCb)(RzLineBuffer *buf, RzLinePromptType prompt_type, void *user);
1075 
1081  void *run_user;
1082 };
1083 
1084 typedef char *(*RzLineEditorCb)(void *core, const char *str);
1087 
1088 struct rz_line_t {
1094  /* callbacks */
1098  // RzLineFunctionKeyCb cb_fkey;
1100  /* state , TODO: use more bool */
1101  int echo;
1103  char *prompt;
1104  RzList /*<char *>*/ *kill_ring;
1106  char *clipboard;
1107  int disable;
1108  void *user;
1109  int (*hist_up)(void *user);
1110  int (*hist_down)(void *user);
1111  char *contents;
1112  bool zerosep;
1114  int vi_mode;
1120  RzList /*<char *>*/ *sdbshell_hist;
1123 }; /* RzLine */
1124 
1125 #ifdef RZ_API
1126 
1127 RZ_API RzLine *rz_line_new(void);
1129 RZ_API void rz_line_free(void);
1130 RZ_API RZ_OWN char *rz_line_get_prompt(void);
1131 RZ_API void rz_line_set_prompt(const char *prompt);
1132 RZ_API int rz_line_dietline_init(void);
1133 RZ_API void rz_line_clipboard_push(const char *str);
1134 RZ_API void rz_line_hist_free(void);
1135 RZ_API void rz_line_autocomplete(void);
1136 
1137 typedef int(RzLineReadCallback)(void *user, const char *line);
1138 RZ_API const char *rz_line_readline(void);
1139 RZ_API const char *rz_line_readline_cb(RzLineReadCallback cb, void *user);
1140 
1141 RZ_API int rz_line_hist_load(RZ_NONNULL const char *file);
1142 RZ_API int rz_line_hist_add(const char *line);
1143 RZ_API int rz_line_hist_save(RZ_NONNULL const char *file);
1144 RZ_API int rz_line_hist_list(void);
1145 RZ_API const char *rz_line_hist_get(int n);
1146 
1150 
1151 RZ_API void rz_line_completion_init(RzLineCompletion *completion, size_t args_limit);
1153 RZ_API void rz_line_completion_push(RzLineCompletion *completion, const char *str);
1154 RZ_API void rz_line_completion_set(RzLineCompletion *completion, int argc, const char **argv);
1156 
1157 RZ_API RzLineNSCompletionResult *rz_line_ns_completion_result_new(size_t start, size_t end, const char *end_string);
1160 RZ_API void rz_line_ns_completion_result_propose(RzLineNSCompletionResult *res, const char *option, const char *cur, size_t cur_len);
1161 
1162 #define RZ_CONS_INVERT(x, y) (y ? (x ? Color_INVERT : Color_INVERT_RESET) : (x ? "[" : "]"))
1163 
1164 #endif
1165 
1166 typedef int (*RzPanelsMenuCallback)(void *user);
1167 typedef struct rz_panels_menu_item {
1169  char *name;
1174 
1175 typedef struct rz_panels_menu_t {
1178  int depth;
1182 
1183 typedef enum {
1190 
1191 typedef enum {
1195 
1196 typedef struct {
1199  int idx;
1200  int offset;
1201 } RModal;
1202 
1203 typedef struct rz_panels_t {
1208  int curnode;
1218  HtPP *mht;
1222  char *name;
1224 
1225 typedef enum {
1231 
1232 typedef struct rz_panels_root_t {
1240 
1241 #ifdef __sun
1242 static inline void cfmakeraw(struct termios *tm) {
1243  tm->c_cflag &= ~(CSIZE | PARENB);
1244  tm->c_cflag |= CS8;
1245  tm->c_iflag &= ~(IMAXBEL | IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
1246  tm->c_oflag &= ~OPOST;
1247  tm->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
1248 }
1249 #endif
1250 
1251 #ifdef __cplusplus
1252 }
1253 #endif
1254 #endif
size_t len
Definition: 6502dis.c:15
lzma_index * src
Definition: index.h:567
ut16 val
Definition: armass64_const.h:6
static bool err
Definition: armass.c:435
RZ_API void rz_cons_canvas_print_region(RzConsCanvas *c)
Definition: canvas.c:410
RZ_API void rz_cons_canvas_print(RzConsCanvas *c)
Definition: canvas.c:423
RZ_API RZ_OWN char * rz_cons_canvas_to_string(RzConsCanvas *c)
Definition: canvas.c:351
RZ_API void rz_cons_canvas_write(RzConsCanvas *c, const char *s)
Definition: canvas.c:283
RZ_API bool rz_cons_canvas_gotoxy(RzConsCanvas *c, int x, int y)
Definition: canvas.c:184
RZ_API void rz_cons_canvas_fill(RzConsCanvas *c, int x, int y, int w, int h, char ch)
Definition: canvas.c:551
RZ_API int rz_cons_canvas_resize(RzConsCanvas *c, int w, int h)
Definition: canvas.c:432
RZ_API void rz_cons_canvas_line(RzConsCanvas *c, int x, int y, int x2, int y2, RzCanvasLineStyle *style)
Definition: canvas.c:570
RZ_API void rz_cons_canvas_clear(RzConsCanvas *c)
Definition: canvas.c:174
RZ_API RzConsCanvas * rz_cons_canvas_new(int w, int h)
Definition: canvas.c:223
RZ_API void rz_cons_canvas_box(RzConsCanvas *c, int x, int y, int w, int h, const char *color)
Definition: canvas.c:486
RZ_API void rz_cons_canvas_free(RzConsCanvas *c)
Definition: canvas.c:150
RZ_API void rz_cons_canvas_line_square_defined(RzConsCanvas *c, int x, int y, int x2, int y2, RzCanvasLineStyle *style, int bendpoint, int isvert)
Definition: canvas_line.c:401
RZ_API void rz_cons_canvas_line_square(RzConsCanvas *c, int x, int y, int x2, int y2, RzCanvasLineStyle *style)
Definition: canvas_line.c:371
RZ_API void rz_cons_canvas_line_diagonal(RzConsCanvas *c, int x, int y, int x2, int y2, RzCanvasLineStyle *style)
Definition: canvas_line.c:285
RZ_API void rz_cons_canvas_line_back_edge(RzConsCanvas *c, int x, int y, int x2, int y2, RzCanvasLineStyle *style, int ybendpoint1, int xbendpoint, int ybendpoint2, int isvert)
Definition: canvas_line.c:454
#define append(x, y)
Definition: cmd_print.c:1740
RZ_API void rz_cons_pipe_close(int fd)
Definition: cpipe.c:53
RZ_API int rz_cons_pipe_open(const char *file, int fdn, int append)
Definition: cpipe.c:29
RZ_API void rz_cons_break_clear(void)
Definition: cons.c:304
RZ_API int rz_cons_get_buffer_len(void)
Definition: cons.c:832
RZ_API void rz_cons_set_utf8(bool b)
Definition: cons.c:1658
RZ_API void rz_cons_zero(void)
Definition: cons.c:1749
RZ_API void rz_cons_filter(void)
Definition: cons.c:836
RZ_API bool rz_cons_default_context_is_interactive(void)
Definition: cons.c:369
RZ_API void rz_cons_memset(char ch, int len)
Definition: cons.c:1253
RZ_API void rz_cons_last(void)
Definition: cons.c:927
RZ_API void rz_cons_clear00(void)
Definition: cons.c:778
RZ_API void rz_cons_break_timeout(int timeout)
Definition: cons.c:421
RZ_API bool rz_cons_set_cup(bool enable)
Definition: cons.c:1672
RZ_API void rz_cons_breakword(RZ_NULLABLE const char *s)
Definition: cons.c:1939
RZ_API void rz_cons_set_raw(bool is_raw)
Definition: cons.c:1617
RZ_API bool rz_cons_drop(int n)
Definition: cons.c:1891
RZ_API int rz_cons_get_size(int *rows)
Definition: cons.c:1446
RZ_API RZ_OWN char * rz_cons_get_buffer_dup(void)
Return a newly allocated buffer containing what's currently in RzCons buffer.
Definition: cons.c:827
RZ_API void rz_cons_context_free(RzConsContext *context)
Definition: cons.c:897
RZ_API int rz_cons_memcat(const char *str, int len)
Definition: cons.c:1224
RZ_API const char * rz_cons_get_rune(const ut8 ch)
Definition: cons.c:1922
RZ_API void rz_cons_set_last_interactive(void)
Definition: cons.c:1729
RZ_API RzConsContext * rz_cons_context_new(RZ_NULLABLE RzConsContext *parent)
Definition: cons.c:888
RZ_API void rz_cons_enable_highlight(const bool enable)
Definition: cons.c:496
RZ_API void rz_cons_visual_write(char *buffer)
Definition: cons.c:1097
RZ_API void rz_cons_set_title(const char *str)
Definition: cons.c:1733
RZ_API void rz_cons_context_reset(void)
Definition: cons.c:909
RZ_API bool rz_cons_enable_mouse(const bool enable)
Definition: cons.c:500
RZ_API void rz_cons_column(int c)
Definition: cons.c:1707
RZ_API RzCons * rz_cons_singleton(void)
Definition: cons.c:300
RZ_API char * rz_cons_lastline_utf8_ansi_len(int *len)
Definition: cons.c:1831
RZ_API void rz_cons_clear_line(int std_err)
Definition: cons.c:756
RZ_API void rz_cons_context_break(RzConsContext *context)
Definition: cons.c:917
RZ_API void rz_cons_strcat(const char *str)
Definition: cons.c:1263
RZ_API void rz_cons_newline(void)
Definition: cons.c:1274
RZ_API void rz_cons_highlight(const char *word)
Definition: cons.c:1756
RZ_API void * rz_cons_sleep_begin(void)
Definition: cons.c:443
RZ_API void rz_cons_break_pop(void)
Definition: cons.c:361
RZ_API char * rz_cons_lastline(int *len)
Definition: cons.c:1813
RZ_API void rz_cons_strcat_justify(const char *str, int j, char c)
Definition: cons.c:238
RZ_API void rz_cons_bind(RzConsBind *bind)
Definition: cons.c:1910
RZ_API void rz_cons_break_push(RzConsBreak cb, void *user)
Definition: cons.c:357
RZ_API void rz_cons_set_interactive(bool x)
Definition: cons.c:1724
RZ_API RzCons * rz_cons_new(void)
Definition: cons.c:589
RZ_API int rz_cons_printf(const char *format,...)
Definition: cons.c:1202
RZ_API void rz_cons_reset_colors(void)
Definition: cons.c:783
RZ_API void rz_cons_echo(const char *msg)
Definition: cons.c:939
RZ_API void rz_cons_chop(void)
Definition: cons.c:1900
RZ_API void rz_cons_color(int fg, int r, int g, int b)
Definition: cons.c:217
RZ_API const char * rz_cons_get_buffer(void)
Return the current RzCons buffer.
Definition: cons.c:819
RZ_API void rz_cons_printf_list(const char *format, va_list ap)
Definition: cons.c:1170
RZ_API void rz_cons_invert(int set, int color)
Definition: cons.c:1662
RZ_API void rz_cons_clear_buffer(void)
Definition: cons.c:1992
RZ_API int rz_cons_get_cur_line(void)
Definition: cons.c:387
RZ_API bool rz_cons_is_interactive(void)
Definition: cons.c:365
RZ_API void rz_cons_context_break_pop(RzConsContext *context, bool sig)
Definition: cons.c:335
RZ_API void rz_cons_cmd_help(const char *help[], bool use_color)
Definition: cons.c:1954
RZ_API bool rz_cons_isatty(void)
Definition: cons.c:1341
RZ_API int rz_cons_get_cursor(RZ_NONNULL int *rows)
Calculates the aproximated x,y coordinates of the cursor before flushing.
Definition: cons.c:1298
RZ_API void rz_cons_visual_flush(void)
Definition: cons.c:1067
RZ_API void rz_cons_strcat_at(const char *_str, int x, char y, int w, int h)
Definition: cons.c:260
RZ_API bool rz_cons_get_click(int *x, int *y)
Definition: cons.c:484
RZ_API void rz_cons_goto_origin_reset(void)
Definition: cons.c:732
RZ_API char * rz_cons_swap_ground(const char *col)
Definition: cons.c:1871
RZ_API void rz_cons_show_cursor(int cursor)
Definition: cons.c:1581
RZ_API void rz_cons_set_click(int x, int y)
Definition: cons.c:477
RZ_API void rz_cons_flush(void)
Definition: cons.c:959
RZ_API RzColor rz_cons_color_random(ut8 alpha)
Definition: cons.c:183
RZ_API int rz_cons_eof(void)
Definition: cons.c:720
RZ_API void rz_cons_fill_line(void)
Definition: cons.c:737
RZ_API void rz_cons_break_end(void)
Definition: cons.c:427
RZ_API void rz_cons_context_load(RzConsContext *context)
Definition: cons.c:905
RZ_API bool rz_cons_is_breaked(void)
Definition: cons.c:373
RZ_API void rz_cons_println(const char *str)
Definition: cons.c:233
RZ_API void rz_cons_context_break_push(RzConsContext *context, RzConsBreak cb, void *user, bool sig)
Definition: cons.c:308
RZ_API void rz_cons_set_flush(bool flush)
Set whether RzCons should flush content to screen or not.
Definition: cons.c:2006
RZ_API void rz_cons_sleep_end(void *user)
Definition: cons.c:450
RZ_API void rz_cons_gotoxy(int x, int y)
Definition: cons.c:724
RZ_API void rz_cons_clear(void)
Definition: cons.c:787
RZ_API int rz_cons_get_column(void)
Definition: cons.c:1214
RZ_API bool rz_cons_context_is_main(void)
Definition: cons.c:913
RZ_API void rz_cons_reset(void)
Definition: cons.c:804
RZ_API RzCons * rz_cons_free(void)
Definition: cons.c:658
RZ_API void rz_cons_pop(void)
Definition: cons.c:876
RZ_API void rz_cons_push(void)
Definition: cons.c:860
#define RZ_API
#define r
Definition: crypto_rc6.c:12
#define w
Definition: crypto_rc6.c:13
RZ_API bool rz_cons_is_utf8(void)
Definition: cutf8.c:242
static static fork const void static count static fd const char const char static newpath const char static path const char path
Definition: sflib.h:35
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void start
Definition: sflib.h:133
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags cmd
Definition: sflib.h:79
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
Definition: sflib.h:118
uint32_t ut32
RZ_API int rz_line_dietline_init(void)
Definition: dietline.c:147
RZ_API int rz_line_hist_cmd_down(RzLine *line)
Definition: dietline.c:346
RZ_API const char * rz_line_readline(void)
Definition: dietline.c:913
RZ_API int rz_line_hist_cmd_up(RzLine *line)
Definition: dietline.c:316
RZ_API int rz_line_hist_list(void)
Definition: dietline.c:440
RZ_API void rz_line_autocomplete(void)
Definition: dietline.c:775
RZ_API void rz_line_hist_free(void)
Definition: dietline.c:455
RZ_API int rz_line_hist_load(RZ_NONNULL const char *path)
Load the history of commands from path.
Definition: dietline.c:474
RZ_API const char * rz_line_readline_cb(RzLineReadCallback cb, void *user)
Definition: dietline.c:1331
RZ_API int rz_line_set_hist_callback(RzLine *line, RzLineHistoryUpCb up, RzLineHistoryDownCb down)
Definition: dietline.c:292
RZ_API const char * rz_line_hist_get(int n)
Definition: dietline.c:424
RZ_API int rz_line_hist_add(const char *line)
Definition: dietline.c:382
RZ_API int rz_line_hist_save(RZ_NONNULL const char *path)
Save the history of commands executed until now to file path.
Definition: dietline.c:497
struct @667 g
RZ_API void rz_cons_grep_help(void)
Definition: grep.c:70
RZ_API char * rz_cons_grep_strip(char *cmd, const char *quotestr)
Definition: grep.c:411
RZ_API void rz_cons_grep_parsecmd(char *cmd, const char *quotestr)
Definition: grep.c:401
RZ_API int rz_cons_grep_line(char *buf, int len)
Definition: grep.c:746
RZ_API void rz_cons_grep_process(char *grep)
Definition: grep.c:421
RZ_API void rz_cons_grep(const char *grep)
Definition: grep.c:874
RZ_API void rz_cons_grepbuf(void)
Definition: grep.c:463
RZ_API char * rz_cons_html_filter(const char *ptr, int *newlen)
Definition: html.c:34
RZ_API void rz_cons_message(RZ_NONNULL const char *msg)
Definition: hud.c:321
RZ_API char * rz_cons_hud_path(const char *path, int dir)
Definition: hud.c:285
RZ_API char * rz_cons_hud_file(const char *f)
Definition: hud.c:10
RZ_API char * rz_cons_hud(RzList *list, const char *prompt)
Definition: hud.c:202
RZ_API char * rz_cons_hud_string(const char *s)
Definition: hud.c:22
RZ_API void rz_cons_readflush(void)
Definition: input.c:596
RZ_API void rz_cons_switchbuf(bool active)
Definition: input.c:601
RZ_API char * rz_cons_input(const char *msg)
Definition: input.c:696
RZ_API int rz_cons_controlz(int ch)
Definition: input.c:14
RZ_API bool rz_cons_readbuffer_readchar(char *ch)
Definition: input.c:609
RZ_API int rz_cons_arrow_to_hjkl(int ch)
Definition: input.c:78
RZ_API int rz_cons_any_key(const char *msg)
Definition: input.c:393
RZ_API int rz_cons_readchar_timeout(ut32 usec)
Definition: input.c:560
RZ_API bool rz_cons_readpush(const char *str, int len)
Definition: input.c:585
RZ_API int rz_cons_fgets(char *buf, int len, int argc, const char **argv)
Definition: input.c:339
RZ_API bool rz_cons_yesno(int def, const char *fmt,...)
Definition: input.c:666
RZ_API int rz_cons_readchar(void)
Definition: input.c:619
voidpf void uLong size
Definition: ioapi.h:138
const char int mode
Definition: ioapi.h:137
voidpf void * buf
Definition: ioapi.h:138
RZ_API int rz_cons_less_str(const char *str, const char *exitkeys)
Definition: less.c:10
RZ_API void rz_cons_less(void)
Definition: less.c:171
uint8_t ut8
Definition: lh5801.h:11
void * p
Definition: libc.cpp:67
#define const
Definition: ansidecl.h:240
static void list(RzEgg *egg)
Definition: rz-gg.c:52
RZ_API RzLine * rz_line_singleton(void)
Definition: line.c:15
RZ_API void rz_line_set_prompt(const char *prompt)
Definition: line.c:56
RZ_API void rz_line_completion_push(RzLineCompletion *completion, const char *str)
Definition: line.c:79
RZ_API RZ_OWN char * rz_line_get_prompt(void)
Definition: line.c:64
RZ_API void rz_line_clipboard_push(const char *str)
Definition: line.c:50
RZ_API void rz_line_completion_set(RzLineCompletion *completion, int argc, const char **argv)
Definition: line.c:95
RZ_API void rz_line_ns_completion_result_free(RzLineNSCompletionResult *res)
Definition: line.c:144
RZ_API RzLine * rz_line_new(void)
Definition: line.c:19
RZ_API RzLineNSCompletionResult * rz_line_ns_completion_result_new(size_t start, size_t end, const char *end_string)
Definition: line.c:122
RZ_API void rz_line_completion_fini(RzLineCompletion *completion)
Definition: line.c:75
RZ_API void rz_line_ns_completion_result_add(RzLineNSCompletionResult *res, const char *option)
Definition: line.c:156
RZ_API void rz_line_completion_clear(RzLineCompletion *completion)
Definition: line.c:109
RZ_API void rz_line_completion_init(RzLineCompletion *completion, size_t args_limit)
Definition: line.c:68
RZ_API void rz_line_ns_completion_result_propose(RzLineNSCompletionResult *res, const char *option, const char *cur, size_t cur_len)
Add a new option to the list of possible autocomplete-able value if it matches the given string.
Definition: line.c:170
RZ_API void rz_line_free(void)
Definition: line.c:41
static static fork const void static count static fd const char const char static newpath char char argv
Definition: sflib.h:40
char * dst
Definition: lz4.h:724
int x
Definition: mipsasm.c:20
int n
Definition: mipsasm.c:19
string FILE
Definition: benchmark.py:21
line
Definition: setup.py:34
int idx
Definition: setup.py:197
RZ_API RzColor rz_cons_pal_get(const char *key)
Definition: pal.c:626
RZ_API void rz_cons_pal_show(void)
Definition: pal.c:501
RZ_API void rz_cons_pal_free(RzConsContext *ctx)
Definition: pal.c:247
RZ_API void rz_cons_pal_update_event(void)
Definition: pal.c:652
RZ_API int rz_cons_pal_set(const char *key, const char *val)
Definition: pal.c:611
RZ_API const char * rz_cons_pal_get_name(int index)
Definition: pal.c:644
RZ_API void rz_cons_pal_list(int rad, const char *arg)
Definition: pal.c:528
int off
Definition: pal.c:13
RZ_API char * rz_cons_rainbow_get(int idx, int last, bool bg)
Definition: pal.c:673
RZ_API void rz_cons_pal_init(RzConsContext *ctx)
Definition: pal.c:154
RZ_API void rz_cons_rainbow_free(RzConsContext *ctx)
Definition: pal.c:662
RzColor rcolor
Definition: pal.c:97
RZ_API RzColor rz_cons_pal_get_i(int index)
Definition: pal.c:639
RZ_API int rz_cons_pal_len(void)
Definition: pal.c:648
RZ_API char * rz_cons_pal_parse(const char *str, RzColor *outcol)
Definition: pal.c:281
RZ_API void rz_cons_rainbow_new(RzConsContext *ctx, int sz)
Definition: pal.c:656
RZ_API void rz_cons_pal_random(void)
Definition: pal.c:270
RZ_API void rz_cons_pal_copy(RzConsContext *dst, RzConsContext *src)
Definition: pal.c:258
RZ_API void rz_cons_rgb_init(void)
Definition: rgb.c:106
RZ_API char * rz_cons_rgb_str_mode(RzConsColorMode mode, char *outstr, size_t sz, const RzColor *rcolor)
Definition: rgb.c:292
RZ_API int rz_cons_rgb_parse(const char *p, ut8 *r, ut8 *g, ut8 *b, ut8 *a)
Definition: rgb.c:113
RZ_API char * rz_cons_rgb_str_off(char *outstr, size_t sz, ut64 off)
Definition: rgb.c:209
RZ_API char * rz_cons_rgb_str(char *outstr, size_t sz, const RzColor *rcolor)
Definition: rgb.c:318
RZ_API char * rz_cons_rgb_tostring(ut8 r, ut8 g, ut8 b)
Definition: rgb.c:322
static RzSocket * s
Definition: rtr.c:28
int(* RzLineHistoryUpCb)(RzLine *line)
Definition: rz_cons.h:1085
RzVirtTermMode
Definition: rz_cons.h:448
@ RZ_VIRT_TERM_MODE_COMPLETE
All the sequences goes through VT (Windows Terminal, mintty, all OSs)
Definition: rz_cons.h:451
@ RZ_VIRT_TERM_MODE_OUTPUT_ONLY
Windows only: Use console c api for input, but output on VT (Windows >= 10)
Definition: rz_cons.h:450
@ RZ_VIRT_TERM_MODE_DISABLE
Windows only: Use console c api for everything (Windows <= 8)
Definition: rz_cons.h:449
void(* RzConsQueueTaskOneshot)(void *core, void *task, void *user)
Definition: rz_cons.h:438
RZ_LIB_VERSION_HEADER(rz_cons)
@ ALPHA_RESET
Definition: rz_cons.h:167
@ ALPHA_FGBG
Definition: rz_cons.h:170
@ ALPHA_FG
Definition: rz_cons.h:168
@ ALPHA_BG
Definition: rz_cons.h:169
void(* RzConsFlush)(void)
Definition: rz_cons.h:60
int(* RzConsGetSize)(int *rows)
Definition: rz_cons.h:57
int(* RzLineCompletionCb)(RzLineCompletion *completion, RzLineBuffer *buf, RzLinePromptType prompt_type, void *user)
Definition: rz_cons.h:1041
struct rz_cons_context_t RzConsContext
RViMode
Definition: rz_cons.h:778
@ CONTROL_MODE
Definition: rz_cons.h:780
@ INSERT_MODE
Definition: rz_cons.h:779
RzConsColorMode
Definition: rz_cons.h:441
@ COLOR_MODE_16
Definition: rz_cons.h:443
@ COLOR_MODE_16M
Definition: rz_cons.h:445
@ COLOR_MODE_256
Definition: rz_cons.h:444
@ COLOR_MODE_DISABLED
Definition: rz_cons.h:442
int(* RzConsGetCursor)(RZ_NONNULL int *rows)
Definition: rz_cons.h:58
struct rz_cons_bind_t RzConsBind
void(* RzConsEvent)(void *)
Definition: rz_cons.h:346
struct rz_selection_widget_t RzSelWidget
void(* RzConsFunctionKey)(void *core, int fkey)
Definition: rz_cons.h:439
struct rz_hud_t RzLineHud
RzLineNSCompletionResult *(* RzLineNSCompletionCb)(RzLineBuffer *buf, RzLinePromptType prompt_type, void *user)
Definition: rz_cons.h:1074
struct rz_line_hist_t RzLineHistory
struct rz_cons_input_context_t RzConsInputContext
struct rz_panels_t RzPanels
struct rz_panels_root_t RzPanelsRoot
RzPanelsLayout
Definition: rz_cons.h:1191
@ PANEL_LAYOUT_DEFAULT_DYNAMIC
Definition: rz_cons.h:1193
@ PANEL_LAYOUT_DEFAULT_STATIC
Definition: rz_cons.h:1192
int(* RzPanelsMenuCallback)(void *user)
Definition: rz_cons.h:1166
struct rz_cons_canvas_line_style_t RzCanvasLineStyle
void(* RzConsGrepCallback)(const char *grep)
Definition: rz_cons.h:61
struct rz_cons_grep_t RzConsGrep
RzLinePromptType
Definition: rz_cons.h:1037
@ RZ_LINE_PROMPT_DEFAULT
Definition: rz_cons.h:1037
@ RZ_LINE_PROMPT_OFFSET
Definition: rz_cons.h:1038
@ RZ_LINE_PROMPT_FILE
Definition: rz_cons.h:1039
void *(* RzConsSleepBeginCallback)(void *core)
Definition: rz_cons.h:436
struct rcolor_t RzColor
struct rz_panels_menu_item RzPanelsMenuItem
struct rz_line_buffer_t RzLineBuffer
struct rz_cons_canvas_t RzConsCanvas
#define RZ_CONS_GREP_WORDS
Definition: rz_cons.h:49
int(* RzLineHistoryDownCb)(RzLine *line)
Definition: rz_cons.h:1086
#define RZ_CONS_GREP_TOKENS
Definition: rz_cons.h:51
struct rz_cons_t RzCons
struct rz_cons_palette_t RzConsPalette
int(* RzConsClickCallback)(void *core, int x, int y)
Definition: rz_cons.h:434
struct rz_cons_printable_palette_t RzConsPrintablePalette
#define RZ_LINE_BUFSIZE
Definition: rz_cons.h:991
struct rz_line_ns_completion_result_t RzLineNSCompletionResult
bool(* RzConsIsBreaked)(void)
Definition: rz_cons.h:59
void(* RzConsSleepEndCallback)(void *core, void *user)
Definition: rz_cons.h:437
@ PAL_CHANGED
Definition: rz_cons.h:749
@ PAL_LINES2
Definition: rz_cons.h:762
@ PAL_METADATA
Definition: rz_cons.h:757
@ PAL_ADDRESS
Definition: rz_cons.h:747
@ PAL_TRAP
Definition: rz_cons.h:753
@ PAL_NOP
Definition: rz_cons.h:756
@ PAL_7F
Definition: rz_cons.h:764
@ PAL_PRINTABLE
Definition: rz_cons.h:759
@ PAL_LINES1
Definition: rz_cons.h:761
@ PAL_DEFAULT
Definition: rz_cons.h:748
@ PAL_JUMP
Definition: rz_cons.h:750
@ PAL_CALL
Definition: rz_cons.h:751
@ PAL_RET
Definition: rz_cons.h:755
@ PAL_FF
Definition: rz_cons.h:765
@ PAL_00
Definition: rz_cons.h:763
@ PAL_CMP
Definition: rz_cons.h:754
@ PAL_LINES0
Definition: rz_cons.h:760
@ PAL_HEADER
Definition: rz_cons.h:758
@ PAL_PUSH
Definition: rz_cons.h:752
@ PAL_PROMPT
Definition: rz_cons.h:746
#define RZ_CONS_GREP_WORD_SIZE
Definition: rz_cons.h:50
struct rz_panels_menu_t RzPanelsMenu
char *(* RzLineEditorCb)(void *core, const char *str)
Definition: rz_cons.h:1084
char *(* RzConsEditorCallback)(void *core, const char *file, const char *str)
Definition: rz_cons.h:433
@ LINE_NOSYM_HORIZ
Definition: rz_cons.h:775
@ LINE_NOSYM_VERT
Definition: rz_cons.h:774
@ LINE_TRUE
Definition: rz_cons.h:771
@ LINE_NONE
Definition: rz_cons.h:770
@ LINE_FALSE
Definition: rz_cons.h:772
@ LINE_UNCJMP
Definition: rz_cons.h:773
RzConsPalSeekMode
Definition: rz_cons.h:460
@ RZ_CONS_PAL_SEEK_NEXT
Definition: rz_cons.h:462
@ RZ_CONS_PAL_SEEK_PREVIOUS
Definition: rz_cons.h:461
@ RZ_CONS_ATTR_BLINK
Definition: rz_cons.h:175
@ RZ_CONS_ATTR_ITALIC
Definition: rz_cons.h:173
@ RZ_CONS_ATTR_DIM
Definition: rz_cons.h:172
@ RZ_CONS_ATTR_UNDERLINE
Definition: rz_cons.h:174
@ RZ_CONS_ATTR_BOLD
Definition: rz_cons.h:171
void(* RzConsBreakCallback)(void *core)
Definition: rz_cons.h:435
RzPanelsMode
Definition: rz_cons.h:1183
@ PANEL_MODE_MENU
Definition: rz_cons.h:1185
@ PANEL_MODE_DEFAULT
Definition: rz_cons.h:1184
@ PANEL_MODE_HELP
Definition: rz_cons.h:1188
@ PANEL_MODE_ZOOM
Definition: rz_cons.h:1186
@ PANEL_MODE_WINDOW
Definition: rz_cons.h:1187
RzPanelsRootState
Definition: rz_cons.h:1225
@ DEL
Definition: rz_cons.h:1228
@ ROTATE
Definition: rz_cons.h:1227
@ QUIT
Definition: rz_cons.h:1229
@ DEFAULT
Definition: rz_cons.h:1226
void(* RzLogCallback)(const char *output, const char *funcname, const char *filename, ut32 lineno, RzLogLevel level, const char *tag, const char *fmtstr,...) RZ_PRINTF_CHECK(7
Definition: rz_log.h:33
#define RZ_NULLABLE
Definition: rz_types.h:65
#define RZ_OWN
Definition: rz_types.h:62
#define RZ_NONNULL
Definition: rz_types.h:64
int(* PrintfCallback)(const char *str,...) RZ_PRINTF_CHECK(1
Definition: rz_types.h:233
#define RZ_PRINTF_CHECK(fmt, dots)
Definition: rz_types.h:192
#define RZ_DEPRECATE
Definition: rz_types.h:66
#define st8
Definition: rz_types_base.h:16
static bind
Definition: sfsocketcall.h:114
static int
Definition: sfsocketcall.h:114
static struct sockaddr static addrlen static backlog const void msg
Definition: sfsocketcall.h:119
#define CS8
Definition: sftypes.h:942
#define OPOST
Definition: sftypes.h:886
#define IGNBRK
Definition: sftypes.h:870
#define BRKINT
Definition: sftypes.h:871
#define ISIG
Definition: sftypes.h:970
#define ICANON
Definition: sftypes.h:971
#define PARMRK
Definition: sftypes.h:873
#define IXON
Definition: sftypes.h:880
#define IMAXBEL
Definition: sftypes.h:883
#define ECHO
Definition: sftypes.h:973
#define IGNCR
Definition: sftypes.h:877
#define IEXTEN
Definition: sftypes.h:984
#define PARENB
Definition: sftypes.h:945
#define INLCR
Definition: sftypes.h:876
#define CSIZE
Definition: sftypes.h:938
#define ECHONL
Definition: sftypes.h:976
#define ICRNL
Definition: sftypes.h:878
#define ISTRIP
Definition: sftypes.h:875
#define b(i)
Definition: sha256.c:42
#define f(i)
Definition: sha256.c:46
#define c(i)
Definition: sha256.c:43
#define a(i)
Definition: sha256.c:41
#define h(i)
Definition: sha256.c:48
RzPanelPos pos
Definition: rz_cons.h:1198
int offset
Definition: rz_cons.h:1200
int idx
Definition: rz_cons.h:1199
RzStrBuf * data
Definition: rz_cons.h:1197
Definition: buffer.h:15
Definition: gzappend.c:170
Definition: getopt.h:84
ut8 r2
Definition: rz_cons.h:185
st8 id16
Definition: rz_cons.h:188
ut8 g2
Definition: rz_cons.h:186
ut8 g
Definition: rz_cons.h:183
ut8 b
Definition: rz_cons.h:184
ut8 b2
Definition: rz_cons.h:187
ut8 r
Definition: rz_cons.h:182
ut8 a
Definition: rz_cons.h:181
ut8 attr
Definition: rz_cons.h:180
RzConsIsBreaked is_breaked
Definition: rz_cons.h:67
RzConsFlush cb_flush
Definition: rz_cons.h:68
PrintfCallback cb_printf
Definition: rz_cons.h:66
RzConsGetSize get_size
Definition: rz_cons.h:64
RzConsGetCursor get_cursor
Definition: rz_cons.h:65
RzConsGrepCallback cb_grep
Definition: rz_cons.h:69
const char * attr
Definition: rz_cons.h:358
HtUP * attrs
Definition: rz_cons.h:359
RzStrConstPool constpool
Definition: rz_cons.h:360
RzStack * cons_stack
Definition: rz_cons.h:467
RzConsEvent event_interrupt
Definition: rz_cons.h:474
RzConsPrintablePalette pal
Definition: rz_cons.h:491
void * event_interrupt_data
Definition: rz_cons.h:475
RzConsPalette cpal
Definition: rz_cons.h:490
size_t buffer_sz
Definition: rz_cons.h:470
RzStack * break_stack
Definition: rz_cons.h:473
bool is_interactive
Definition: rz_cons.h:485
int rowcol_calc_start
Definition: rz_cons.h:496
char * lastOutput
Definition: rz_cons.h:481
RzConsGrep grep
Definition: rz_cons.h:466
RzLogCallback log_callback
Definition: rz_cons.h:479
size_t buffer_len
Definition: rz_cons.h:469
bool human
Definition: rz_cons.h:80
char * str
Definition: rz_cons.h:75
char * json_path
Definition: rz_cons.h:82
bool sort_invert
Definition: rz_cons.h:87
int tokens[RZ_CONS_GREP_TOKENS]
Definition: rz_cons.h:90
int nstrings
Definition: rz_cons.h:74
bool charCounter
Definition: rz_cons.h:77
char strings[RZ_CONS_GREP_WORDS][RZ_CONS_GREP_WORD_SIZE]
Definition: rz_cons.h:73
int tokens_used
Definition: rz_cons.h:91
int range_line
Definition: rz_cons.h:83
int sort_row
Definition: rz_cons.h:86
RzColor gui_cflow
Definition: rz_cons.h:237
RzColor widget_sel
Definition: rz_cons.h:248
RzColor ai_seq
Definition: rz_cons.h:235
RzColor graph_ujump
Definition: rz_cons.h:258
RzColor graph_box
Definition: rz_cons.h:252
RzColor offset
Definition: rz_cons.h:219
RzColor call
Definition: rz_cons.h:198
RzColor creg
Definition: rz_cons.h:203
RzColor func_var_type
Definition: rz_cons.h:245
RzColor prompt
Definition: rz_cons.h:222
RzColor widget_bg
Definition: rz_cons.h:247
RzColor graph_traced
Definition: rz_cons.h:259
RzColor gui_dataoffset
Definition: rz_cons.h:238
RzColor ai_ascii
Definition: rz_cons.h:236
RzColor linehl
Definition: rz_cons.h:243
RzColor flag
Definition: rz_cons.h:204
RzColor ai_read
Definition: rz_cons.h:232
RzColor crypto
Definition: rz_cons.h:224
RzColor btext
Definition: rz_cons.h:197
RzColor graph_current
Definition: rz_cons.h:260
RzColor b0xff
Definition: rz_cons.h:194
RzColor b0x00
Definition: rz_cons.h:192
RzColor fname
Definition: rz_cons.h:209
RzColor diff_unmatch
Definition: rz_cons.h:262
RzColor graph_box2
Definition: rz_cons.h:253
RzColor args
Definition: rz_cons.h:195
RzColor ai_write
Definition: rz_cons.h:233
RzColor label
Definition: rz_cons.h:214
RzColor floc
Definition: rz_cons.h:206
RzColor usercomment
Definition: rz_cons.h:202
RzColor gui_alt_background
Definition: rz_cons.h:240
RzColor graph_false
Definition: rz_cons.h:257
RzColor trap
Definition: rz_cons.h:229
RzColor fline
Definition: rz_cons.h:205
RzColor flow2
Definition: rz_cons.h:208
RzColor math
Definition: rz_cons.h:215
RzColor other
Definition: rz_cons.h:220
RzColor flow
Definition: rz_cons.h:207
RzColor diff_match
Definition: rz_cons.h:261
RzColor b0x7f
Definition: rz_cons.h:193
RzColor ucall
Definition: rz_cons.h:230
RzColor cjmp
Definition: rz_cons.h:199
RzColor invalid
Definition: rz_cons.h:212
RzColor reset
Definition: rz_cons.h:226
RzColor ujmp
Definition: rz_cons.h:231
RzColor diff_unknown
Definition: rz_cons.h:263
RzColor gui_background
Definition: rz_cons.h:239
RzColor graph_true
Definition: rz_cons.h:256
RzColor graph_box4
Definition: rz_cons.h:255
RzColor input
Definition: rz_cons.h:211
RzColor graph_box3
Definition: rz_cons.h:254
RzColor meta
Definition: rz_cons.h:249
RzColor help
Definition: rz_cons.h:210
RzColor push
Definition: rz_cons.h:223
RzColor gui_border
Definition: rz_cons.h:241
RzColor ai_exec
Definition: rz_cons.h:234
RzColor func_var
Definition: rz_cons.h:244
RzColor comment
Definition: rz_cons.h:201
RzColor func_var_addr
Definition: rz_cons.h:246
RzColor diff_new
Definition: rz_cons.h:264
RzColor wordhl
Definition: rz_cons.h:242
bool enable_highlight
Definition: rz_cons.h:549
int click_x
Definition: rz_cons.h:572
bool was_html
Definition: rz_cons.h:506
bool filter
Definition: rz_cons.h:569
int columns
Definition: rz_cons.h:510
struct rz_line_t * line
Definition: rz_cons.h:553
int break_word_len
Definition: rz_cons.h:565
char * break_word
Definition: rz_cons.h:564
int pagesize
Definition: rz_cons.h:563
const char * teefile
Definition: rz_cons.h:519
RzNum * num
Definition: rz_cons.h:543
int blankline
Definition: rz_cons.h:547
const char ** vline
Definition: rz_cons.h:554
int echo
Definition: rz_cons.h:509
RzConsSleepBeginCallback cb_sleep_begin
Definition: rz_cons.h:528
bool grep_highlight
Definition: rz_cons.h:568
bool show_autocomplete_widget
Definition: rz_cons.h:516
RzConsEvent event_resize
Definition: rz_cons.h:522
void * user_fgets_user
Definition: rz_cons.h:521
ut64 timeout
Definition: rz_cons.h:566
bool grep_color
Definition: rz_cons.h:567
char * highlight
Definition: rz_cons.h:548
void * event_data
Definition: rz_cons.h:523
char * lastline
Definition: rz_cons.h:504
RzConsSleepEndCallback cb_sleep_end
Definition: rz_cons.h:529
int linesleep
Definition: rz_cons.h:562
bool use_utf8
Definition: rz_cons.h:559
bool use_utf8_curvy
Definition: rz_cons.h:560
bool flush
Definition: rz_cons.h:558
int refcnt
Definition: rz_cons.h:555
bool click_set
Definition: rz_cons.h:571
RzConsContext * context
Definition: rz_cons.h:502
bool dotted_lines
Definition: rz_cons.h:561
bool is_html
Definition: rz_cons.h:505
RzConsBreakCallback cb_break
Definition: rz_cons.h:527
RzVirtTermMode vtmode
Definition: rz_cons.h:557
int fdout
Definition: rz_cons.h:518
int force_columns
Definition: rz_cons.h:512
int fix_columns
Definition: rz_cons.h:514
int is_wine
Definition: rz_cons.h:552
RzConsQueueTaskOneshot cb_task_oneshot
Definition: rz_cons.h:531
RzConsClickCallback cb_click
Definition: rz_cons.h:530
FILE * fdin
Definition: rz_cons.h:517
bool show_vals
Definition: rz_cons.h:574
int force_rows
Definition: rz_cons.h:511
int lines
Definition: rz_cons.h:507
int rows
Definition: rz_cons.h:508
int click_y
Definition: rz_cons.h:573
bool break_lines
Definition: rz_cons.h:515
void * user
Definition: rz_cons.h:534
RzConsEditorCallback cb_editor
Definition: rz_cons.h:526
int fix_rows
Definition: rz_cons.h:513
int mouse_event
Definition: rz_cons.h:524
RZ_DEPRECATE bool newline
Definition: rz_cons.h:556
RzConsFunctionKey cb_fkey
Definition: rz_cons.h:532
int mouse
Definition: rz_cons.h:551
RzConsInputContext * input
Definition: rz_cons.h:503
char * pager
Definition: rz_cons.h:546
int(* user_fgets)(char *buf, int len, void *user)
Definition: rz_cons.h:520
int current_entry_n
Definition: rz_cons.h:1028
int vi
Definition: rz_cons.h:1031
int top_entry_n
Definition: rz_cons.h:1029
char activate
Definition: rz_cons.h:1030
char data[RZ_LINE_BUFSIZE]
Definition: rz_cons.h:1022
size_t args_limit
Definition: rz_cons.h:1045
RzLineCompletionCb run
Definition: rz_cons.h:1048
void * run_user
Definition: rz_cons.h:1049
RzPVector args
Definition: rz_cons.h:1047
bool do_setup_match
Definition: rz_cons.h:1018
char ** data
Definition: rz_cons.h:1012
char * match
Definition: rz_cons.h:1013
size_t start
First byte that was considered for autocompletion. Everything before this will be left intact.
Definition: rz_cons.h:1062
const char * end_string
String to place after the only option available is autocompleted. By default a space is used.
Definition: rz_cons.h:1064
HtPP * options_ht
Hash table to keep track of duplicated autocompletion suggestions.
Definition: rz_cons.h:1061
size_t end
Last byte that was considered for autocompletion. Everything after this will be left intact.
Definition: rz_cons.h:1063
RzPVector options
Vector of options that can be used for autocompletion.
Definition: rz_cons.h:1060
void * run_user
User data that can be passed to the callback.
Definition: rz_cons.h:1081
RzLineNSCompletionCb run
Callback function that is called when autocompletion is required. (e.g. TAB is pressed)
Definition: rz_cons.h:1080
bool zerosep
Definition: rz_cons.h:1112
RzLineBuffer buffer
Definition: rz_cons.h:1091
char * clipboard
Definition: rz_cons.h:1106
int(* hist_up)(void *user)
Definition: rz_cons.h:1109
void * user
Definition: rz_cons.h:1108
RzListIter * sdbshell_hist_iter
Definition: rz_cons.h:1121
RzLineCompletion completion
Definition: rz_cons.h:1089
int vi_mode
Definition: rz_cons.h:1114
RzVirtTermMode vtmode
Definition: rz_cons.h:1122
int has_echo
Definition: rz_cons.h:1102
bool prompt_mode
Definition: rz_cons.h:1115
char * prompt
Definition: rz_cons.h:1103
int disable
Definition: rz_cons.h:1107
int offset_hist_index
Definition: rz_cons.h:1117
RzLinePromptType prompt_type
Definition: rz_cons.h:1116
RzLineHistory history
Definition: rz_cons.h:1092
char * contents
Definition: rz_cons.h:1111
int echo
Definition: rz_cons.h:1101
RzLineEditorCb cb_editor
Definition: rz_cons.h:1097
int kill_ring_ptr
Definition: rz_cons.h:1105
int file_hist_index
Definition: rz_cons.h:1118
RzLineHistoryDownCb cb_history_down
Definition: rz_cons.h:1096
int(* hist_down)(void *user)
Definition: rz_cons.h:1110
RzLineHud * hud
Definition: rz_cons.h:1119
RzSelWidget * sel_widget
Definition: rz_cons.h:1093
RzList * kill_ring
Definition: rz_cons.h:1104
RzLineHistoryUpCb cb_history_up
Definition: rz_cons.h:1095
RzLineNSCompletion ns_completion
Definition: rz_cons.h:1090
RzList * sdbshell_hist
Definition: rz_cons.h:1120
RzConsFunctionKey cb_fkey
Definition: rz_cons.h:1099
bool enable_vi_mode
Definition: rz_cons.h:1113
RzPanelsMenuCallback cb
Definition: rz_cons.h:1171
struct rz_panels_menu_item ** sub
Definition: rz_cons.h:1170
RzPanelsMenuItem * root
Definition: rz_cons.h:1176
RzPanelsMenuItem ** history
Definition: rz_cons.h:1177
RzPanel ** refreshPanels
Definition: rz_cons.h:1180
RzPanelsRootState root_state
Definition: rz_cons.h:1238
Sdb * cur_pdc_cache
Definition: rz_cons.h:1236
Sdb * pdc_caches
Definition: rz_cons.h:1235
RzPanels ** panels
Definition: rz_cons.h:1237
bool mouse_on_edge_x
Definition: rz_cons.h:1212
Sdb * almighty_db
Definition: rz_cons.h:1217
int mouse_orig_y
Definition: rz_cons.h:1210
RzConsCanvas * can
Definition: rz_cons.h:1204
char * name
Definition: rz_cons.h:1222
RzPanelsLayout layout
Definition: rz_cons.h:1221
RzPanelsMenu * panels_menu
Definition: rz_cons.h:1214
bool mouse_on_edge_y
Definition: rz_cons.h:1213
RzPanelsMode prevMode
Definition: rz_cons.h:1220
RzPanel ** panel
Definition: rz_cons.h:1205
bool autoUpdate
Definition: rz_cons.h:1211
int curnode
Definition: rz_cons.h:1208
RzPanelsMode mode
Definition: rz_cons.h:1219
int mouse_orig_x
Definition: rz_cons.h:1209
int columnWidth
Definition: rz_cons.h:1207
int n_panels
Definition: rz_cons.h:1206
HtPP * mht
Definition: rz_cons.h:1218
Sdb * db
Definition: rz_cons.h:1215
Sdb * rotate_db
Definition: rz_cons.h:1216
const char ** options
Definition: rz_cons.h:1002
Definition: sdb.h:63
tcflag_t c_cflag
Definition: sftypes.h:844
tcflag_t c_iflag
Definition: sftypes.h:842
tcflag_t c_lflag
Definition: sftypes.h:845
tcflag_t c_oflag
Definition: sftypes.h:843
uv_timer_t timeout
Definition: main.c:9
#define bool
Definition: sysdefs.h:146
static int color
Definition: visual.c:20
static char * prompt(const char *str, const char *txt)
Definition: vmenus.c:30
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static const z80_opcode fd[]
Definition: z80_tab.h:997
static const char * cb[]
Definition: z80_tab.h:176
static int file
Definition: z80asm.c:58
static int addr
Definition: z80asm.c:58
int def(FILE *source, FILE *dest, int level)
Definition: zpipe.c:36