16 #define CTX(x) I.context->x
22 #define I rz_cons_instance
44 CTX(rowcol_calc_start) = 0;
79 if (recreate &&
CTX(buffer_sz) > 0) {
118 context->is_interactive =
false;
128 context->color_mode = parent->color_mode;
156 rz_cons_w32_print(
buf,
len,
false);
170 const size_t bucket = 64 * 1024;
175 for (
i = 0; (
i + bucket) < olen;
i += bucket) {
222 if (
r ==
g &&
g ==
b) {
223 k = 232 + (
int)(((
r +
g +
b) / 3) / 10.3);
228 k = 16 + (
r * 36) + (
g * 6) +
b;
241 if (
str[
i] ==
'\n') {
248 if (
str[o +
len] ==
'\n') {
264 if (
x < 0 || y < 0) {
276 if (w < 0 || rows >
w) {
279 if (
str[
i] ==
'\n') {
327 b->event_interrupt =
context->event_interrupt;
328 b->event_interrupt_data =
context->event_interrupt_data;
332 context->event_interrupt_data = user;
343 context->event_interrupt =
b->event_interrupt;
344 context->event_interrupt_data =
b->event_interrupt_data;
366 return CTX(is_interactive);
390 CONSOLE_SCREEN_BUFFER_INFO
info;
391 if (!GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &
info)) {
394 curline =
info.dwCursorPosition.Y -
info.srWindow.Top;
401 (void)tcgetattr(0, &
save);
403 (void)tcsetattr(0,
TCSANOW, &raw);
404 if (isatty(fileno(stdin))) {
408 curline = (
buf[2] -
'0');
411 curline = curline * 10 + (
buf[3] -
'0');
438 CTX(event_interrupt_data) =
NULL;
444 if (!
I.cb_sleep_begin) {
447 return I.cb_sleep_begin(
I.user);
451 if (
I.cb_sleep_end) {
452 I.cb_sleep_end(
I.user, user);
458 if (
type == CTRL_C_EVENT) {
460 eprintf(
"{ctrl+c} pressed.\n");
467 static void resize(
int sig) {
472 if (
I.event_resize) {
473 I.event_resize(
I.event_data);
491 bool set =
I.click_set;
497 I.enable_highlight = enable;
501 if ((
I.mouse && enable) || (!
I.mouse && !enable)) {
507 const char *click = enable
508 ?
"\x1b[?1000;1006;1015h"
509 :
"\x1b[?1000;1006;1015l";
511 bool enabled =
I.mouse;
512 const size_t click_len = strlen(click);
513 if (
write(2, click, click_len) != click_len) {
522 bool enabled =
I.mouse;
523 h = GetStdHandle(STD_INPUT_HANDLE);
524 GetConsoleMode(
h, &
mode);
529 if (SetConsoleMode(
h,
mode)) {
539 static void set_console_codepage_to_utf8(
void) {
540 if (IsValidCodePage(CP_UTF8)) {
541 if (!SetConsoleOutputCP(CP_UTF8)) {
544 if (!SetConsoleCP(CP_UTF8)) {
552 static void save_console_state(
void) {
554 if (!(
I.old_ocp = GetConsoleOutputCP())) {
557 if (!(
I.old_cp = GetConsoleCP())) {
560 if (!GetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), &
I.old_output_mode)) {
563 if (!GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &
I.old_input_mode)) {
569 static void restore_console_state(
void) {
571 if (!SetConsoleCP(
I.old_cp)) {
574 if (!SetConsoleOutputCP(
I.old_ocp)) {
577 if (!SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE),
I.old_output_mode)) {
580 if (!SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),
I.old_input_mode)) {
596 I.enable_highlight =
true;
606 I.event_resize =
NULL;
611 I.break_lines =
false;
615 I.input->bufactive =
true;
623 save_console_state();
624 I.vtmode = rz_cons_detect_vt_mode();
625 set_console_codepage_to_utf8();
632 tcgetattr(0, &
I.term_buf);
633 memcpy(&
I.term_raw, &
I.term_buf,
sizeof(
I.term_raw));
637 I.term_raw.c_cflag |=
CS8;
638 I.term_raw.c_cc[
VMIN] = 1;
641 I.term_buf =
I.old_input_mode | ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT;
642 I.term_raw = ~(ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT);
643 if (!SetConsoleCtrlHandler((PHANDLER_ROUTINE)__w32_control,
TRUE)) {
644 eprintf(
"rz_cons: Cannot set control console handler\n");
667 restore_console_state();
684 #define MOAR (4096 * 8)
695 new_sz = moar +
MOAR;
698 CTX(buffer_sz) = new_sz;
702 }
else if (moar +
CTX(buffer_len) >
CTX(buffer_sz)) {
704 int old_buffer_sz =
CTX(buffer_sz);
713 CTX(buffer_sz) = old_buffer_sz;
726 rz_cons_w32_gotoxy(1,
x, y);
738 char *
p, white[1024];
739 int cols =
I.columns - 1;
743 p = (cols >=
sizeof(white))
762 memset(&white,
' ',
sizeof(white));
763 if (
I.columns > 0 &&
I.columns <
sizeof(white)) {
764 white[
I.columns - 1] = 0;
765 }
else if (
I.columns == 0) {
768 white[
sizeof(white) - 1] = 0;
770 fprintf(std_err ? stderr : stdout,
"\r%s\r", white);
775 fflush(std_err ? stderr : stdout);
812 CTX(pageable) =
true;
833 return CTX(buffer_len);
838 if (
I.filter ||
CTX(grep).nstrings > 0 ||
CTX(grep).tokens_used ||
CTX(grep).less ||
CTX(grep).json) {
849 CTX(buffer_len) = newlen;
850 CTX(buffer_sz) = newlen;
861 if (!
CTX(cons_stack)) {
877 if (!
CTX(cons_stack)) {
922 if (
context->event_interrupt) {
928 if (!
CTX(lastEnabled)) {
931 CTX(lastMode) =
true;
936 return (
CTX(buffer_len) > 0) && (
CTX(lastEnabled) && !
I.filter &&
CTX(grep).nstrings < 1 && !
CTX(grep).tokens_used && !
CTX(grep).less && !
CTX(grep).json && !
I.is_html);
960 const char *tee =
I.teefile;
970 if (
CTX(buffer_len) >
CTX(lastLength)) {
974 CTX(lastLength) =
CTX(buffer_len);
977 CTX(lastMode) =
false;
984 if (!strcmp(
I.pager,
"..")) {
986 CTX(pageable) =
false;
1023 eprintf(
"rz_cons_flush: fwrite: error (%s)\n", tee);
1027 eprintf(
"Cannot write on '%s'\n", tee);
1034 if (
I.linesleep > 0 &&
I.linesleep < 1000) {
1036 int pagesize =
RZ_MAX(1,
I.pagesize);
1038 char *nl = strchr(ptr,
'\n');
1039 int len =
CTX(buffer_len);
1044 if (
I.linesleep && !(
i % pagesize)) {
1048 nl = strchr(ptr,
'\n');
1090 int diff =
len - utf8len;
1094 return ansilen - diff;
1099 int cols =
I.columns;
1100 int alen, plen,
lines =
I.rows;
1101 bool break_lines =
I.break_lines;
1103 char *nl, *ptr =
buffer, *pptr;
1108 memset(&white,
' ',
sizeof(white));
1109 while ((nl = strchr(ptr,
'\n'))) {
1110 int len = ((
int)(
size_t)(nl - ptr)) + 1;
1111 int lines_needed = 0;
1116 pptr = ptr >
buffer ? ptr - 1 : ptr;
1120 lines_needed = alen / cols + (alen % cols == 0 ? 0 : 1);
1122 if ((break_lines && lines < lines_needed && lines > 0) || (!break_lines && alen > cols)) {
1137 int w = cols - (alen % cols == 0 ? cols : alen % cols);
1139 if (
I.blankline &&
w > 0) {
1140 if (
w >
sizeof(white) - 1) {
1141 w =
sizeof(white) - 1;
1153 lines -= lines_needed;
1161 if (cols >
sizeof(white)) {
1162 cols =
sizeof(white);
1164 while (--
lines >= 0) {
1171 size_t size, written;
1176 if (
I.null || !format) {
1181 if (strchr(format,
'%')) {
1186 if (written >=
size) {
1187 if (
palloc(written + 1)) {
1193 CTX(buffer_len) += written;
1204 if (!format || !*format) {
1207 va_start(ap, format);
1235 if (
str &&
len > 0 && !
I.null) {
1245 if (
I.break_word &&
str &&
len > 0) {
1254 if (!
I.null &&
len > 0) {
1265 if (!
str ||
I.null) {
1279 This place is wrong
to manage the
color reset, can interfire with rzpipe
output sending resetchars
1280 and
break json
output appending extra chars.
1281 this
code now is managed into
output.c:118 at
function rz_cons_w32_print
1282 now the console
color is reset with
each \n (same stuff
do it here but
in correct place ...
i think)
1302 if (
CTX(rowcol_calc_start) >
CTX(buffer_len)) {
1304 CTX(rowcol_calc_start) = 0;
1310 const char *last_line =
CTX(
buffer) +
CTX(rowcol_calc_start);
1312 while ((ptr = strchr(last_line,
'\n'))) {
1316 const char *last_escape = last_line;
1317 while ((ptr = strchr(last_escape,
'\x1b'))) {
1319 col += ptr - last_escape;
1323 }
else if (ch2 ==
']') {
1324 if (!strncmp(ptr + 2 + 5,
"rgb:", 4)) {
1327 }
else if (ch2 ==
'[') {
1328 for (++ptr; *ptr && *ptr !=
'J' && *ptr !=
'm' && *ptr !=
'H'; ptr++) {
1337 CTX(rowcol_calc_start) =
CTX(buffer_len);
1365 HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
1366 if (GetFileType(hOut) == FILE_TYPE_CHAR) {
1375 static int __xterm_get_cur_pos(
int *xpos) {
1378 if (
write(
I.fdout, get_pos,
sizeof(get_pos)) < 1) {
1402 (
i == 1 && ch ==
'~')) {
1412 }
while (!is_reply);
1428 static bool __xterm_get_size(
void) {
1433 rz_xwrite(
I.fdout,
"\x1b[999;999H",
sizeof(
"\x1b[999;999H"));
1434 rows = __xterm_get_cur_pos(&columns);
1437 I.columns = columns;
1448 CONSOLE_SCREEN_BUFFER_INFO csbi;
1449 bool ret = GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
1451 I.columns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
1452 I.rows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
1455 ret = __xterm_get_size();
1457 if (!ret || (
I.columns == -1 &&
I.rows == 0)) {
1470 const char *
tty = isatty(1) ? ttyname(1) :
NULL;
1490 I.columns = atoi(
str);
1498 #if SIMULATE_ADB_SHELL
1510 if (
I.columns < 0) {
1513 if (
I.force_columns) {
1514 I.columns =
I.force_columns;
1517 I.rows =
I.force_rows;
1519 if (
I.fix_columns) {
1520 I.columns +=
I.fix_columns;
1523 I.rows +=
I.fix_rows;
1549 if (strstr(
term,
"xterm")) {
1565 char *dot = strtok(
info->version,
".");
1567 dot = strtok(
NULL,
".");
1569 if (
info->release) {
1585 rz_xwrite(1, cursor ?
"\x1b[?25h" :
"\x1b[?25l", 6);
1590 CONSOLE_CURSOR_INFO cursor_info;
1592 hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
1595 GetConsoleCursorInfo(hStdout, &cursor_info);
1596 size = cursor_info.dwSize;
1598 cursor_info.dwSize =
size;
1599 cursor_info.bVisible = cursor ?
TRUE :
FALSE;
1600 SetConsoleCursorInfo(hStdout, &cursor_info);
1618 static int oldraw = -1;
1620 if (is_raw == oldraw) {
1630 tcsetattr(0,
TCSANOW, &
I.term_raw);
1632 tcsetattr(0,
TCSANOW, &
I.term_buf);
1636 HANDLE h = GetStdHandle(STD_INPUT_HANDLE);
1637 GetConsoleMode(
h, &
mode);
1642 SetConsoleMode(
h,
mode &
I.term_raw);
1648 SetConsoleMode(
h,
mode |
I.term_buf);
1652 #warning No raw console supported for this platform
1674 const char *
code = enable
1682 const size_t code_len = strlen(
code);
1683 if (
write(2,
code, code_len) != code_len) {
1690 const char *
code = enable
1693 :
"\x1b[?1049l\x1b[?47l"
1696 const size_t code_len = strlen(
code);
1697 if (
write(2,
code, code_len) != code_len) {
1713 b[
CTX(buffer_len)] = 0;
1735 #if defined(_UNICODE)
1736 wchar_t *wstr = rz_utf8_to_utf16_l(
str, strlen(
str));
1738 SetConsoleTitleW(wstr);
1742 SetConsoleTitle(
str);
1751 I.line->zerosep =
true;
1757 int l, *cpos =
NULL;
1758 char *rword =
NULL, *res, *clean =
NULL;
1760 RZ_CONS_INVERT(
true,
true),
1761 RZ_CONS_INVERT(
false,
true)
1768 if (!
I.enable_highlight) {
1773 int word_len = strlen(word);
1780 if (strcmp(word,
I.highlight)) {
1787 rword =
malloc(word_len + linv[0] + linv[1] + 1);
1793 strcpy(rword, inv[0]);
1794 strcpy(rword + linv[0], word);
1795 strcpy(rword + linv[0] + word_len, inv[1]);
1800 CTX(buffer_len) =
CTX(buffer_sz) = strlen(res);
1838 int last_possible_ansi_end = 0;
1852 if ((ch & 0xc0) != 0x80) {
1857 if (ch ==
'J' || ch ==
'm' || ch ==
'H') {
1858 last_possible_ansi_end = l - 1;
1859 }
else if (ch ==
'\x1b' && ch2 ==
'[') {
1860 l = last_possible_ansi_end;
1875 if (!strncmp(col,
"\x1b[48;5;", 7)) {
1878 }
else if (!strncmp(col,
"\x1b[38;5;", 7)) {
1881 }
else if (!strncmp(col,
"\x1b[4", 3)) {
1884 }
else if (!strncmp(col,
"\x1b[3", 3)) {
1892 if (
n >
CTX(buffer_len)) {
1893 CTX(buffer_len) = 0;
1896 CTX(buffer_len) -=
n;
1901 while (
CTX(buffer_len) > 0) {
1906 (
CTX(buffer_len))--;
1943 I.break_word_len = strlen(
s);
1945 I.break_word =
NULL;
1946 I.break_word_len = 0;
1956 const char *pal_args_color = use_color ? cons->
context->
pal.
args :
"",
1960 int i, max_length = 0;
1961 const char *usage_str =
"Usage:";
1963 for (
i = 0;
help[
i];
i += 3) {
1964 int len0 = strlen(
help[
i]);
1965 int len1 = strlen(
help[
i + 1]);
1967 max_length =
RZ_MAX(max_length, len0 + len1);
1971 for (
i = 0;
help[
i];
i += 3) {
1972 if (!strncmp(
help[
i], usage_str, strlen(usage_str))) {
1983 int str_length = strlen(
help[
i]) + strlen(
help[
i + 1]);
1984 int padding = (str_length < max_length) ? (max_length - str_length) : 0;
1986 pal_input_color,
help[
i], pal_args_color,
help[
i + 1],
1987 padding,
"", pal_help_color,
help[
i + 2], pal_reset);
2007 CTX(noflush) = !flush;
RzBinInfo * info(RzBinFile *bf)
static RzBinSourceLineInfo * lines(RzBinFile *bf)
const lzma_allocator const uint8_t * in
static RzBuffer * new_buffer(RzBufferType type, void *user)
static RzNumCalcValue term(RzNum *, RzNumCalc *, int)
RZ_API void rz_cons_break_clear(void)
RZ_API int rz_cons_get_buffer_len(void)
static bool lastMatters(void)
static void cons_context_init(RzConsContext *context, RZ_NULLABLE RzConsContext *parent)
RZ_API void rz_cons_set_utf8(bool b)
RZ_API void rz_cons_zero(void)
RZ_API void rz_cons_filter(void)
RZ_API bool rz_cons_default_context_is_interactive(void)
static RzConsContext rz_cons_context_default
RZ_API void rz_cons_memset(char ch, int len)
static void __cons_write_ll(const char *buf, int len)
RZ_API void rz_cons_last(void)
RZ_API void rz_cons_clear00(void)
RZ_API void rz_cons_break_timeout(int timeout)
RZ_API bool rz_cons_set_cup(bool enable)
RZ_API void rz_cons_breakword(RZ_NULLABLE const char *s)
RZ_API void rz_cons_set_raw(bool is_raw)
RZ_API bool rz_cons_drop(int n)
RZ_API int rz_cons_get_size(int *rows)
RZ_API RZ_OWN char * rz_cons_get_buffer_dup(void)
Return a newly allocated buffer containing what's currently in RzCons buffer.
RZ_API void rz_cons_context_free(RzConsContext *context)
RZ_API int rz_cons_memcat(const char *str, int len)
RZ_API const char * rz_cons_get_rune(const ut8 ch)
static void break_stack_free(void *ptr)
RZ_API void rz_cons_set_last_interactive(void)
static RzCons rz_cons_instance
static void __break_signal(int sig)
static void cons_grep_reset(RzConsGrep *grep)
RZ_API RzConsContext * rz_cons_context_new(RZ_NULLABLE RzConsContext *parent)
static void cons_stack_load(RzConsStack *data, bool free_current)
RZ_API void rz_cons_enable_highlight(const bool enable)
RZ_API void rz_cons_visual_write(char *buffer)
RZ_API void rz_cons_set_title(const char *str)
RZ_API void rz_cons_context_reset(void)
RZ_API bool rz_cons_enable_mouse(const bool enable)
RZ_API void rz_cons_column(int c)
RZ_API RzCons * rz_cons_singleton(void)
RZ_API char * rz_cons_lastline_utf8_ansi_len(int *len)
RZ_API void rz_cons_clear_line(int std_err)
RZ_API void rz_cons_context_break(RzConsContext *context)
RZ_API void rz_cons_strcat(const char *str)
RZ_API void rz_cons_newline(void)
RZ_API void rz_cons_highlight(const char *word)
static bool palloc(int moar)
RZ_API void * rz_cons_sleep_begin(void)
RZ_API void rz_cons_break_pop(void)
RZ_API char * rz_cons_lastline(int *len)
RZ_API void rz_cons_strcat_justify(const char *str, int j, char c)
RZ_API void rz_cons_bind(RzConsBind *bind)
RZ_API void rz_cons_break_push(RzConsBreak cb, void *user)
RZ_API void rz_cons_set_interactive(bool x)
RZ_API RzCons * rz_cons_new(void)
RZ_API int rz_cons_printf(const char *format,...)
RZ_API void rz_cons_reset_colors(void)
RZ_API void rz_cons_echo(const char *msg)
RZ_API void rz_cons_chop(void)
RZ_API void rz_cons_color(int fg, int r, int g, int b)
RZ_API const char * rz_cons_get_buffer(void)
Return the current RzCons buffer.
RZ_API void rz_cons_printf_list(const char *format, va_list ap)
RZ_API void rz_cons_invert(int set, int color)
static void ctx_rowcol_calc_reset(void)
RZ_API void rz_cons_clear_buffer(void)
RZ_API int rz_cons_get_cur_line(void)
RZ_API bool rz_cons_is_interactive(void)
RZ_API void rz_cons_context_break_pop(RzConsContext *context, bool sig)
static void cons_stack_free(void *ptr)
RZ_API void rz_cons_cmd_help(const char *help[], bool use_color)
RZ_API bool rz_cons_isatty(void)
RZ_API int rz_cons_get_cursor(RZ_NONNULL int *rows)
Calculates the aproximated x,y coordinates of the cursor before flushing.
RZ_API void rz_cons_visual_flush(void)
RZ_API void rz_cons_strcat_at(const char *_str, int x, char y, int w, int h)
RZ_API bool rz_cons_get_click(int *x, int *y)
RZ_API void rz_cons_goto_origin_reset(void)
RZ_API char * rz_cons_swap_ground(const char *col)
RZ_API void rz_cons_show_cursor(int cursor)
RZ_API void rz_cons_set_click(int x, int y)
RZ_API void rz_cons_flush(void)
RZ_API RzColor rz_cons_color_random(ut8 alpha)
static void __cons_write(const char *obuf, int olen)
RZ_API int rz_cons_eof(void)
RZ_API void rz_cons_fill_line(void)
RZ_API void rz_cons_break_end(void)
RZ_API void rz_cons_context_load(RzConsContext *context)
RZ_API bool rz_cons_is_breaked(void)
RZ_API void rz_cons_println(const char *str)
RZ_API void rz_cons_context_break_push(RzConsContext *context, RzConsBreak cb, void *user, bool sig)
RZ_API void rz_cons_set_flush(bool flush)
Set whether RzCons should flush content to screen or not.
static RzConsStack * cons_stack_dump(bool recreate)
RZ_API void rz_cons_sleep_end(void *user)
static int real_strlen(const char *ptr, int len)
RZ_API void rz_cons_gotoxy(int x, int y)
RZ_API void rz_cons_clear(void)
RZ_API int rz_cons_get_column(void)
RZ_API bool rz_cons_context_is_main(void)
RZ_API void rz_cons_reset(void)
RZ_API RzCons * rz_cons_free(void)
static void cons_context_deinit(RzConsContext *context)
RZ_API void rz_cons_pop(void)
RZ_API void rz_cons_push(void)
static static fork const void static count close
static static sync static getppid static getegid const char static filename ioctl
RZ_API void rz_cons_grep(const char *grep)
RZ_API void rz_cons_grepbuf(void)
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API char * rz_cons_html_filter(const char *ptr, int *newlen)
RZ_API int rz_cons_less_str(const char *str, const char *exitkeys)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
void * realloc(void *ptr, size_t size)
void * malloc(size_t size)
void * calloc(size_t number, size_t size)
RZ_API RzLine * rz_line_new(void)
RZ_API void rz_line_free(void)
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")
RZ_API void rz_cons_pal_free(RzConsContext *ctx)
RZ_API void rz_cons_pal_init(RzConsContext *ctx)
RZ_API void rz_cons_pal_copy(RzConsContext *dst, RzConsContext *src)
RZ_API void rz_print_set_is_interrupted_cb(RzPrintIsInterruptedCallback cb)
RZ_API void rz_cons_rgb_init(void)
RZ_API char * rz_cons_rgb_str_off(char *outstr, size_t sz, ut64 off)
#define rz_warn_if_reached()
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
@ RZ_VIRT_TERM_MODE_COMPLETE
All the sequences goes through VT (Windows Terminal, mintty, all OSs)
@ RZ_VIRT_TERM_MODE_OUTPUT_ONLY
Windows only: Use console c api for input, but output on VT (Windows >= 10)
@ RZ_VIRT_TERM_MODE_DISABLE
Windows only: Use console c api for everything (Windows <= 8)
#define RZ_CONS_CLEAR_LINE
#define RZ_CONS_CLEAR_SCREEN
#define RZ_CONS_CURSOR_SAVE
#define RUNECODE_LINE_HORIZ
#define RZ_CONS_CMD_DEPTH
#define RUNECODE_CURVE_CORNER_TL
void(* RzConsEvent)(void *)
#define RUNE_CURVE_CORNER_TL
#define RUNECODE_CORNER_BL
#define RUNECODE_CORNER_BR
#define RUNECODE_LINE_VERT
#define RUNECODE_LINE_CROSS
#define RUNECODE_CURVE_CORNER_BR
#define RUNECODE_CURVE_CORNER_BL
#define RZ_CONS_CURSOR_RESTORE
#define RZ_CONS_GET_CURSOR_POSITION
#define RUNECODE_CURVE_CORNER_TR
#define RUNECODE_CORNER_TL
#define RUNE_CURVE_CORNER_BR
#define RUNE_CURVE_CORNER_BL
#define RZ_CONS_CLEAR_FROM_CURSOR_TO_END
#define RUNECODE_CORNER_TR
#define RUNE_CURVE_CORNER_TR
#define RZ_LOG_INFO(fmtstr,...)
RZ_API const ut8 * rz_mem_mem(const ut8 *haystack, int hlen, const ut8 *needle, int nlen)
RZ_API char * rz_num_units(char *buf, size_t len, ut64 number)
RZ_API int rz_num_rand(int max)
RZ_API bool rz_stack_is_empty(RzStack *s)
RZ_API RzStack * rz_stack_newf(ut32 n, RzStackFree f)
RZ_API void * rz_stack_pop(RzStack *s)
RZ_API bool rz_stack_push(RzStack *s, void *el)
RZ_API void rz_stack_free(RzStack *s)
RZ_API int rz_str_char_count(const char *string, char ch)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API char * rz_str_ndup(RZ_NULLABLE const char *ptr, int len)
Create new copy of string ptr limited to size len.
RZ_API size_t rz_str_ansi_len(const char *str)
RZ_API int rz_str_ansi_filter(char *str, char **out, int **cposs, int len)
RZ_API const char * rz_str_ansi_chrn(const char *str, size_t n)
RZ_API size_t rz_str_len_utf8(const char *s)
RZ_API char * rz_str_ansi_crop(const char *str, unsigned int x, unsigned int y, unsigned int x2, unsigned int y2)
RZ_API char * rz_str_replace_thunked(char *str, char *clean, int *thunk, int clen, const char *key, const char *val, int g)
RZ_API RZ_OWN char * rz_strbuf_drain(RzStrBuf *sb)
RZ_API bool rz_strbuf_append(RzStrBuf *sb, const char *s)
RZ_API RzStrBuf * rz_strbuf_new(const char *s)
RZ_API char * rz_sys_getenv(const char *key)
Get the value of an environment variable named key or NULL if none exists.
#define rz_sys_xsystem(cmd)
RZ_API FILE * rz_sys_fopen(const char *path, const char *mode)
RZ_API void rz_sys_info_free(RSysInfo *si)
RZ_API int rz_sys_usleep(int usecs)
Sleep for usecs microseconds.
RZ_API RSysInfo * rz_sys_info(void)
RZ_API int rz_sys_signal(int sig, void(*handler)(int))
RZ_API int rz_sys_cmd_str_full(const char *cmd, const char *input, char **output, int *len, char **sterr)
RZ_API ut64 rz_time_now_mono(void)
Returns the current time in microseconds, using the monotonic clock.
#define rz_xwrite(fd, buf, count)
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
static struct sockaddr static addrlen static backlog const void msg
RzConsEvent event_interrupt
void * event_interrupt_data
zip_uint8_t buffer[BUFSIZE]
RzConsPrintablePalette pal
#define ENABLE_QUICK_EDIT_MODE
#define ENABLE_EXTENDED_FLAGS
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static const z80_opcode fd[]
static unsigned char * obuf
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)
int read(izstream &zs, T *x, Items items)