7#include "ui_ncurses_internal.h"
8#include <ncursesw/ncurses.h>
9#include <ncursesw/panel.h>
12#include "ui_notcurses_internal.h"
13#include <notcurses/notcurses.h>
60 [FATAL] =
"\033[1;31m",
61 [ERROR] =
"\033[0;31m",
62 [WARN] =
"\033[0;33m",
63 [INFO] =
"\033[0;32m",
64 [VERBOSE] =
"\033[0;36m",
65 [DEBUG] =
"\033[0;34m",
66 [SILENT] =
_(
"SILENT"),
68 .
level = {[FATAL] =
"FATAL", [ERROR] =
"ERROR", [WARN] =
"WARN", [INFO] =
"INFO", [VERBOSE] =
"VERBOSE", [DEBUG] =
"DEBUG", [SILENT] =
"SILENT"}};
97const wchar_t *
bw_ra = L"\u2192";
98const wchar_t *
bw_la = L"\u2190";
99const wchar_t *
bw_ua = L"\u2191";
107
108
109
111 _(
"black"),
_(
"red"),
_(
"green"),
_(
"yellow"),
_(
"blue"),
_(
"magenta"),
_(
"cyan"),
112 _(
"white"),
_(
"orange"),
_(
"bg"),
_(
"abg"),
_(
"bblack"),
_(
"bred"),
_(
"bgreen"),
113 _(
"byellow"),
_(
"bblue"),
_(
"bcyan"),
_(
"bmagenta"),
_(
"bwhite"),
_(
"borange"),
""};
251 memset(&mbstate, 0,
sizeof(mbstate));
336
337
338
339
340
341
342
343
345 wc[0] = wc[1] = L'\0';
346 mbstate_t state = {};
347 size_t len = mbrtowc(wc, &mbc, MB_CUR_MAX, &state);
355
356
357
358
359
360
361
362
363
365 const char *src_ptr = mb_str;
366 mbstate_t state = {};
367 size_t wc_count = mbsrtowcs(NULL, &src_ptr, 0, &state);
368 if (wc_count == (size_t)-1)
371 wmemset((wchar_t *)&state, 0,
sizeof(state) /
sizeof(wchar_t));
372 wchar_t *wc_str = malloc((wc_count + 1) *
sizeof(wchar_t));
375 mbsrtowcs(wc_str, &src_ptr, wc_count + 1, &state);
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
396
397
398
399
400
401
402
403
408 fprintf(stderr,
_(
"\n\nABEND: %s (code: %d)\n"), s, ec);
415
416
417
418
419
420
421
422
423
424
425
426
427
428
431 ui_log(ERROR,
_(
"Maximum number of surfaces (%d) exceeded"),
SFC_MAX);
436 wlines =
min(wlines, maxy);
437 wcols =
min(wcols, maxx);
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
469 ui_log(ERROR,
_(
"Maximum number of surfaces (%d) exceeded"),
SFC_MAX);
472 if (wlines == 0 || wcols == 0) {
473 ui_log(ERROR,
_(
"Invalid window size: lines=%d, cols=%d"), wlines
, wcols);
478 if (wbegy > maxy || wbegx > maxx) {
479 ui_log(ERROR,
_(
"Invalid window position: wbegy=%d, wbegx=%d, wlines=%d, wcols=%d"), wbegy
, wbegx
, wlines
, wcols);
482 wlines =
min(wlines, maxy);
483 wcols =
min(wcols, maxx);
484 split_x =
min(split_x, maxx);
485 uint split_wlines =
min(wlines + split_y + 1, maxy);
486 wcols =
min(wcols, maxx);
509
510
511
512
513
514
529 for (x = 1; x < maxx - 1; x++)
532 for (y = 1; y < maxy - 1; y++) {
537 for (x = 1; x < maxx - 1; x++)
546
547
548
549
550
551
552
553
554
555
559 for (uint x = 1; x < maxx - 1; x++)
568
569
570
571
572
573
574
575
576
577
578
583 uint y = separator_line;
595 l = wcswidth(text_wc, wcslen(text_wc));
599 l =
min(l, maxx - 7);
612
613
614
615
616
617
618
619
620
622 if (!title || !*title)
633 l = wcswidth(title_wc, wcslen(title_wc));
634 l =
min(l, maxx - 7);
642 while (x < maxx - 1) {
654
655
656
657
658
659
660
661
663 UiChyron *chyron = (UiChyron *)calloc(1,
sizeof(UiChyron));
671 chyron->key[i] = (UiChyronKey *)calloc(1,
sizeof(UiChyronKey));
672 if (!chyron->key[i]) {
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
696 bool a_toi_error =
false;
712
713
714
715
716
723 if (chyron->key[i]) {
724 free(chyron->key[i]);
725 chyron->key[i] =
nullptr;
733
734
735
736
737
739 if (chyron->key[k]->text[0] !=
'\0')
745
746
747
748
749
750
751
752
753
758 chyron->key[k]->text[0] =
'\0';
759 chyron->key[k]->keycode = kc;
760 chyron->key[k]->active =
true;
761 chyron->key[k]->cell_base = cell_base;
764
765
766
767
768
769
770
771
772
773
774
775
776
777
782 chyron->key[k]->text[0] =
'\0';
783 chyron->key[k]->keycode = kc;
784 chyron->key[k]->active =
true;
788
789
790
791
792
794 chyron->key[k]->text[0] =
'\0';
797
798
799
800
801
803 chyron->key[k]->active =
true;
806
807
808
809
810
813 chyron->key[k]->active =
true;
816
817
818
819
820
822 chyron->key[k]->active =
false;
825
826
827
828
831 chyron->key[k]->active =
false;
834
835
836
837
838
839
840
841
842
851 if (chyron->key[k]->text[0] ==
'\0' || !chyron->key[k]->active) {
855 cell_base = chyron->key[k]->cell_base;
857 cx = chyron->cmplx_buf;
858 ui_mbstr_to_cellstr(chyron->sfc, chyron->w,
865 ui_mbstr_to_cellstr(chyron->sfc, chyron->w,
872 cx = chyron->cmplx_buf;
873 ui_mbstr_to_cellstr(chyron->sfc, chyron->w, cx, chyron->key[k]->text, &cell_base, &pos,
MAXLEN - 1);
876 chyron->key[k]->end_pos = end_pos;
878 chyron->key[k]->text
, chyron->key[k]->end_pos
);
881 ui_mbstr_to_cellstr(chyron->sfc, chyron->w, chyron->cmplx_buf,
" ", &cell_base, &pos,
MAXLEN - 1);
885
886
887
888
889
890
891
892
893
894
895
896
897
908
909
910
911
912
913
914
915
916
917
918
919
920
921
926 if (chyron->key[i]->text[0] !=
'\0' && chyron->key[i]->active)
927 if (chyron->key[i]->end_pos >= x) {
933 return chyron->key[k]->keycode;
939
940
941
942
943
944
945
946
948 if (rgb->r == rgb->g && rgb->g == rgb->b) {
953 return ((rgb->r - 8) / 10) + 231;
955 uint r_index = (rgb->r < 45) ? 0 : (rgb->r - 60) / 40 + 1;
956 uint g_index = (rgb->g < 45) ? 0 : (rgb->g - 60) / 40 + 1;
957 uint b_index = (rgb->b < 45) ? 0 : (rgb->b - 60) / 40 + 1;
958 return 16 + (36 * r_index) + (6 * g_index) + b_index;
962
963
964
965
966
967
968
971
972
976 rgb.r = rgb.g = rgb.b = 0;
981 }
else if (idx >= 16 && idx <= 231) {
983 rgb.r = (idx / 36) % 6 * 51;
984 rgb.g = (idx / 6) % 6 * 51;
985 rgb.b = (idx % 6) * 51;
986 }
else if (idx >= 232 && idx <= 255) {
987 uint gray = (idx - 232) * 11;
988 rgb.r = rgb.g = rgb.b = gray;
994
995
996
997
998
999
1000
1001
1003 if (rgb->r == rgb->g && rgb->r == rgb->b) {
1005 rgb->r = (
int)(pow((rgb->r / 255.0f), 1.0f /
GRAY_GAMMA) * 255.0f);
1012 rgb->r = (
int)(pow((rgb->r / 255.0f), 1.0f /
RED_GAMMA) * 255.0f);
1014 rgb->g = (
int)(pow((rgb->g / 255.0f), 1.0f /
GREEN_GAMMA) * 255.0f);
1016 rgb->b = (
int)(pow((rgb->b / 255.0f), 1.0f /
BLUE_GAMMA) * 255.0f);
1022
1023
1024
1026
1027
1028
1029
1030
1031
1032
1035 uint line, pos, msg_l, msg0_l, msg1_l, msg2_l, msg3_l;
1038 fprintf(stderr,
_(
"\n\n%s\n%s\n%s\n%s\n\n"), msg0, msg1, msg2, msg3);
1043 msg0_l = strlen(msg0);
1044 msg1_l = strlen(msg1);
1045 msg2_l = strlen(msg2);
1046 msg3_l = strlen(msg3);
1047 msg_l =
max(msg0_l, msg1_l);
1048 msg_l =
max(msg_l, msg2_l);
1049 msg_l =
max(msg_l, msg3_l);
1050 msg_l =
max(msg_l, 50);
1051 msg_l =
min(msg_l, maxx - 4);
1052 pos = ((maxx - msg_l) - 4) / 2;
1053 line = (maxy - 6) / 2;
1057 msg_l + 2
, line
, pos
, title
);
1074 event
.y = event
.x = -1;
1087
1088
1089
1090
1091
1092
1093
1096 uint line, pos, msg_l, msg0_l, msg1_l;
1098 fprintf(stderr,
"\n\n%s\n", msg0);
1099 fprintf(stderr,
"%s\n", msg1);
1104 msg0_l = strlen(msg0);
1105 msg1_l = strlen(msg1);
1106 msg_l =
max(msg0_l, msg1_l);
1107 msg_l =
max(msg_l, 50);
1108 msg_l =
min(msg_l, maxx - 4);
1110 pos = ((maxx - msg_l) - 4) / 2;
1111 line = (maxy - 6) / 2;
1115 msg_l + 2
, line
, pos
, title
);
1131 event
.y = event
.x = -1;
1136 timeout_ms += timeout_secs * 1000;
1140 }
while (timeout_ms > 0);
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1159 fprintf(stderr,
_(
"Timeout in %d seconds\n"), timeout_ms / 1000);
1169
1170
1171
1172
1173
1174
1175
1176
1177
1187
1188
1189
1190
1191
1192
1193
1194
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1217 if (timeout_ms <= 0)
1227 memset(fds, 0,
sizeof(fds));
1230 fds[nfds].events = POLLIN;
1233 int poll_rc = poll(fds, nfds, timeout_ms);
1241 for (nfds_t i = ext_start_idx; i < nfds; i++) {
1242 if (fds[i].revents & (POLLIN | POLLHUP | POLLERR)) {
1243 reg_idx = i - ext_start_idx;
1254
1255
1256
1257
1258
1259
1260
1263 uint line = 0, pos = 0, msg_l = 0, msg0_l = 0, msg1_l = 0, msg2_l = 0, msg3_l = 0;
1265 fprintf(stderr,
"\n\n%s\n", msg0);
1266 fprintf(stderr,
"%s\n", msg1);
1267 fprintf(stderr,
"%s\n", msg2);
1268 fprintf(stderr,
"%s\n\n", msg3);
1273 if (msg0 !=
nullptr)
1274 msg0_l = strlen(msg0);
1275 if (msg1 !=
nullptr)
1276 msg1_l = strlen(msg1);
1277 if (msg2 !=
nullptr)
1278 msg2_l = strlen(msg2);
1279 if (msg3 !=
nullptr)
1280 msg3_l = strlen(msg3);
1281 msg_l =
max(msg0_l, msg1_l);
1282 msg_l =
max(msg_l, msg2_l);
1283 msg_l =
max(msg_l, msg3_l);
1284 msg_l =
max(msg_l, 50);
1285 msg_l =
min(msg_l, maxx - 4);
1287 pos = ((maxx - msg_l) - 4) / 2;
1288 line = (maxy - 6) / 2;
1292 msg_l + 2
, line
, pos
, title
);
1309 event
.y = event
.x = -1;
1319
1320
1321
1322
1326 uint line, pos, cols;
1329 bool f_xwgetch =
true;
1330 if (emsg_str[0] ==
'␛' && emsg_str[1] ==
'w') {
1336 fprintf(stderr,
"\n%s\n", emsg);
1342 cols =
max(cols, 50);
1343 pos = (maxx - cols - 4) / 2;
1344 line = (maxy - 4) / 2;
1348 4
, line
, line
, pos
, title
);
1349 ui_log(ERROR,
"%s", tmp_str);
1364 event
.y = event
.x = -1;
1374
1375
1376
1377
1378
1384 fprintf(stderr,
"\n%s\n", title);
1385 fprintf(stderr,
"%s\n", action_str);
1388 len =
max(strlen(title), strlen(action_str));
1391 col = (maxx - len - 4) / 2;
1392 line = (maxy - 4) / 2;
1395 line
, line
, col
, title
);
1405 event
.y = event
.x = -1;
1415
1416
1417
1418
1419
1420
1424 time_t t = time(NULL);
1425 struct tm *tp = local ? localtime(&t) : gmtime(&t);
1427 strftime(buf, n,
_(
"%Y-%m-%dT%H:%M:%S%z"), tp);
1429 strftime(buf, n,
_(
"%Y-%m-%dT%H:%M:%SZ"), tp);
1433#define AS_STRING(NAME) #NAME,
1438 return _(
"unknown");
1443
1444
1445
1448 char *user = getenv(
"USER");
1449 time_t t = time(NULL);
1451 localtime_r(&t, &tp);
1453 strftime(time_s, 100,
"%Y%m%d%H%M%S", &tp);
1461 fprintf(stderr,
"%s\n%s\n%s\n%s\n",
em0,
em1,
em2,
em3);
1467 char *p = getenv(
_(
"USER"));
1469 if (ttyname_r(STDERR_FILENO, ttyname,
sizeof(ttyname)) == 0)
1472 ui_log(INFO,
"%s:",
em0);
1476void ui_log_write(
const UiLogLevel level,
const char *file,
const char *func,
const int line,
const char *fmt, ...) {
1484 char old_archive[
MAXLEN];
1492 int written = snprintf(log_buffer + offset,
sizeof(log_buffer) - offset,
"[%s]%s[%s]%s<%s:%s:%d> ",
1501 va_start(args, fmt);
1502 written = vsnprintf(log_buffer + offset,
sizeof(log_buffer) - offset, fmt, args);
1506 if (offset < (
int)
sizeof(log_buffer) - 2) {
1507 log_buffer[offset++] =
'\n';
1508 log_buffer[offset] =
'\0';
1510 log_buffer[
sizeof(log_buffer) - 2] =
'\n';
1511 log_buffer[
sizeof(log_buffer) - 1] =
'\0';
1512 offset =
sizeof(log_buffer) - 1;
1516 perror(
"Failed to write atomic log record");
1523
1524
1525
1526
1527
1528
1529
1530
1531
1538 uint fg_clr, bg_clr;
1539 char *ansi_p = ansi_str + 2;
1545 tok = strtok((
char *)ansi_p,
";m");
1546 bool a_toi_error =
false;
1548 if (tok ==
nullptr || *tok ==
'\0')
1554 if (t0 ==
'3' || t0 ==
'4') {
1556 tok = strtok(
nullptr,
";m");
1557 if (tok !=
nullptr) {
1559 tok = strtok(
nullptr,
";m");
1560 if (tok !=
nullptr) {
1565 }
else if (*tok ==
'2') {
1566 tok = strtok(
nullptr,
";m");
1567 if (tok !=
nullptr) {
1569 tok = strtok(
nullptr,
";m");
1570 if (tok !=
nullptr) {
1572 tok = strtok(
nullptr,
";m");
1573 if (tok !=
nullptr) {
1587 }
else if (t1 ==
'9') {
1592 }
else if (t1 >=
'0' && t1 <=
'7') {
1599 }
else if (t0 ==
'4') {
1607 }
else if (t0 ==
'0') {
1618 switch (
a_toi(tok
, &a_toi_error
)) {
1644 }
else if (len == 0) {
1649 tok = strtok(
nullptr,
";m");
1651 if (!a_toi_error && (fg_clr != fg || bg_clr != bg))
UiSurface * ui_surface_box(UiSurface *parent, ss_t p, uint lines, uint cols, uint y, uint x, const char *title)
Create a new UI surface with a border box and optional title.
#define SUB_SURFACE_LIST(X)
void ui_render()
Render the UI by updating panels and refreshing the display.
int ui_draw_text(UiSurface *s, ss_t w, uint y, uint x, const char *text)
on specified window, move to y, x, add string
int ui_wmove(UiSurface *s, ss_t w, uint y, uint x)
Move the cursor to a specified position within a UiSurface.
int ui_surface_addwin(UiSurface *s, ss_t w, ss_t p, uint lines, uint cols, uint y, uint x)
Add a new window to the specified UiSurface.
void ui_surface_destroy(UiSurface *s)
Destroy a UiSurface, cleaning up its windows and panels.
int ui_bkgd(UiSurface *s, ss_t w, const UiCell *cell)
Set the background of a specific window within a UiSurface.
int ui_getmaxy(UiSurface *s, ss_t w)
Get the maximum number of lines (rows) of a UiSurface.
#define CHYRON_KEY_MAXLEN
void ui_get_screen_size(uint *lines, uint *cols)
Get the current screen size (number of lines and columns).
void ui_shutdown()
Shutdown the UI runtime, cleaning up resources and freeing memory.
int ui_curs_set(int visibility)
Set the visibility of the cursor.
int ui_getmaxx(UiSurface *s, ss_t w)
Get the maximum number of columns of a UiSurface.
int ui_wclrtoeol(UiSurface *s, ss_t w)
Clear to the end of the line in a surface window.
int ui_bkgdset(UiSurface *s, ss_t w, const UiCell *cell)
Set the background for new content to be written to a specific window within a UiSurface.
int ui_werase(UiSurface *s, ss_t w)
Erase the contents of a UiSurface or all surfaces.
#define UIKEY_STREAM_DATA
int ui_get_event(UiSurface *s, ss_t w, UiChyron *chyron, UiEvent *ev, int timeout_ms)
Read input events.
const wchar_t * border_none
void ui_unset_chyron_key(UiChyron *chyron, uint k)
Unset chyron key.
void ui_set_chyron_key(UiChyron *chyron, uint k, char *s, uint kc)
Set chyron key with default color pair (cp_nt_rev).
int ui_border_draw(UiSurface *sfc, ss_t w)
void ui_deactivate_all_chyron_keys(UiChyron *chyron)
Deactivate all chyron keys.
char const colors_text[][10]
Color names for .minitrc overrides.
int ui_tracked_sfc_split_box(uint wlines, uint wcols, uint split_y, uint split_x, uint wbegy, uint wbegx, const char *wtitle)
Create a new surface with a split box window.
wchar_t * ui_mbstr_to_wcstr(const char *mb_str)
Convert a multibyte string to a wide character string.
UiChyron * ui_new_chyron(UiSurface *sfc, ss_t w)
Create new chyron structure.
const char * ui_sub_surface_str(ss_t w)
char * ui_iso8601_timestamp(char *buf, size_t n, bool local)
Generate an ISO 8601 timestamp string.
RGB ui_xterm256_idx_to_rgb(uint idx)
Convert XTerm 256 color index to RGB.
void ui_activate_chyron_key(UiChyron *chyron, uint k)
Activate chyron key.
int ui_cm_surface_destroy(UiSurface *sfc)
Destroy the most recently created surface.
void ui_display_chyron(UiSurface *sfc, ss_t w, UiChyron *chyron, uint line, uint col)
Display chyron on the specified line and column of the surface.
const wchar_t * border_double
void ui_set_chyron_key_cb(UiChyron *chyron, uint k, char *s, uint kc, UiCell cell_base)
Set chyron key with color pair (cp).
int ui_assign_chyron_win(UiChyron *chyron, UiSurface *sfc, ss_t w, char *y)
Assign surface and window to chyron structure.
bool ui_init_clr_palette(SIO *sio)
bool ui_is_set_chyron_key(UiChyron *chyron, uint k)
Check if function key label is set.
int ui_border_ysplit_text(UiSurface *sfc, char *text_in, uint separator_line)
Draw a box with a separator line and text around the specified window.
const wchar_t * border_single
void ui_parse_ansi(char *ansi_str, attr_t *attrs, uint *cpx)
Parse ANSI escape sequences for color and attributes.
void ui_abend(int ec, char *s)
Convert multibyte string to complex character array.
void ui_initialize_sio(SIO *sio)
int ui_border_title(UiSurface *sfc, ss_t w, const char *title)
Draw a box with a title around the specified window.
int ui_border_ysplit(UiSurface *sfc, ss_t w, uint y)
Draw a box with a separator line around the specified window.
int ui_tracked_sfc_box(uint wlines, uint wcols, uint wbegy, uint wbegx, const char *wtitle)
Create a new surface with a box window.
UiChyron * ui_destroy_chyron(UiChyron *chyron)
Destroy UiChyron structure.
int ui_get_chyron_key(UiChyron *chyron, uint x)
Get keycode from chyron.
void ui_mbc_to_wc(wchar_t wc[2], const char mbc)
Convert a multibyte character to a wide character.
void ui_deactivate_chyron_key(UiChyron *chyron, uint k)
Deactivate chyron key.
const wchar_t * border_heavy
const wchar_t * border_rounded
void ui_apply_gamma(RGB *rgb)
Apply gamma correction to RGB color.
void ui_activate_all_chyron_keys(UiChyron *chyron)
Deactivate chyron key.
uint ui_rgb_to_xterm256_idx(RGB *rgb)
Convert RGB color to XTerm 256 color index.
void ui_compile_chyron(UiChyron *chyron)
construct the chyron string from the chyron structure
int ui_open_log()
Open the log file for writing.
void ui_log_write(const UiLogLevel level, const char *file, const char *func, const int line, const char *fmt,...)
int ui_pair_content(uint pair, uint *fg, uint *bg)
Get the foreground and background colors of a specified color pair.
uint ui_add_pair(uint fg, uint bg)
Add a new color pair to the UI, or retrieve the index of an existing pair.
UiSurface * ui_surface[UI_SFC_MAX]
UiCell ui_cell_from_ucp(const wchar_t *ucp, const uint32_t *fg, const uint32_t *bg)
Convert a Unicode code point to a curses UiCell with specified foreground and background colors.
int ui_color_from_rgb(RGB *rgb)
Convert RGB to curses color index, adding new color if necessary.
int ui_chg_color(uint16_t color_idx, uint32_t *color)
Change the RGB color value for a given color index.
int ui_mvwadd_wchnstr(UiSurface *s, ss_t w, uint y, uint x, const UiCell *cmplx_buf, uint n)
Draw a complex character string at a specific position in a surface window, with a maximum length.
int ui_mvwaddnwstr(UiSurface *s, ss_t w, uint y, uint x, const wchar_t *wstr, int m)
Draw a wide-character string at a specific position in a surface window, with a maximum length.
int ui_mvwadd_wchstr(UiSurface *s, ss_t w, uint y, uint x, const UiCell *cmplx_buf)
Draw a complex character string at a specific position in a surface window.
size_t strnz__cpy(char *, const char *, size_t)
safer alternative to strncpy
size_t strnz(char *, size_t)
terminates string at New Line, Carriage Return, or max_len
size_t ssnprintf(char *, size_t, const char *,...)
Custom safe string formatting utility (Variadic version).
size_t strnz__cat(char *, const char *, size_t)
safer alternative to strncat
int a_toi(char *, bool *)
a safer alternative to atoi() for converting ASCII strings to integers.
bool restore_shell_tioctl()
restore_shell_tioctl() - restore shell terminal settings
void sig_dfl_mode()
Set signal handlers to default behavior.
int ui_perror(char *emsg_str)
Display a simple error message window or print to stderr.
void ui_unregister_read_fd(int fd)
Unregister an external file descriptor from polling.
void ui_register_read_fd(int fd, int token_id)
Register an external file descriptor for polling.
int ui_timeout_prompt(char *msg0, char *msg1, uint timeout_ms, uint timeout_secs)
Display a timeout prompt window or print to stderr.
int ui_update_timeout_prompt(UiSurface *sfc, ss_t w, uint timeout_ms)
Update the timeout prompt with the remaining time.
int ui_poll_reg_read_fd(int timeout_ms)
Poll for input on registered external files.
bool ui_action_disposition(char *title, char *action_str)
Display a simple action disposition message window or print to stderr.
int ui_answer_yn(char *msg0, char *msg1, char *msg2, char *msg3)
Accept a single letter answer.
int ui_display_error(char *msg0, char *msg1, char *msg2, char *msg3)
Display an error message window or print to stderr.
ext_fd_reg_t ext_fds[MAX_EXT_FDS]
char * color[LOG_LEVEL_COUNT]
char * level[LOG_LEVEL_COUNT]