C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
cm.h
Go to the documentation of this file.
1/** @file cm.h
2 * @brief Headder for C-Menu API library, libcm.so
3 * @author Bill Waller
4 * Copyright (c) 2025
5 * MIT License
6 * billxwaller@gmail.com
7 * @date 2026-02-09
8 */
9
10#ifndef _CM_H
11#define _CM_H 1
12
13#define _GNU_SOURCE
14#define _XOPEN_SOURCE_EXTENDED 1 /**< Enable wide character support */
15#define NCURSES_WIDECHAR 1 /**< Enable wide character support */
16#include "version.h"
17#include <argp.h>
18#include <ncursesw/ncurses.h>
19#include <ncursesw/panel.h>
20#include <signal.h>
21#include <stddef.h>
22#include <stdlib.h>
23#include <time.h>
24#include <ui_backend.h>
25#ifdef UAL_UI
26#include <ui_backend.h>
27#include <ui_ncurses_internal.h>
28#endif
29#include <wait.h>
30
31extern int cmenu_log_fd;
32
33#if __STDC_VERSION__ < 202311L
34#define nullptr NULL
35#endif
36
37#define MAXWIN 30 /**< maximum number of windows that can be created */
38extern SCREEN *screen;
39extern FILE *tty_fp;
40#ifdef UAL_UI
41extern UiRuntime *ui_runtime;
42extern UiSurface *ui_box[MAXWIN];
43extern UiSurface *ui_win[MAXWIN];
44extern UiSurface *ui_win2[MAXWIN];
45#endif
46#define MAX_ARGS 64 /**< maximum number of arguments for external commands */
47#define MAXLEN 256 /**< maximum length for strings and buffers */
48#define MAXARGS 64 /**< maximum number of arguments */
49#define SCR_COLS 1024 /**< maximum number of columns in the terminal screen */
50#define MAX_DEPTH 3 /**< default depth for recursive file searching */
51#define SCREEN_MAX_LINES 100
52#define Ctrl(c) ((c) & 0x1f)
53#include <stdio.h>
54
55typedef struct {
56 int yyyy;
57 int mm;
58 int dd;
59} Date;
60
61typedef struct {
62 int hh;
63 int mm;
64 int ss;
65} Time;
66
67#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
68
69/** @brief max macro evaluates two expressions, returning greatest result.
70 @details These macros use compound statements to create local scopes for the
71 temporary variables _x and _y, which store the values of x and y,
72 respectively. This ensures that if x or y have side effects (such as being
73 incremented), they will only be evaluated once when the macro is expanded.
74 The use of typeof allows the macro to work with any data type.
75 The line (void)(&_x == &_y) is a compile-time check to ensure that the
76 types of the arguments are compatible.
77 This implementation of the min and max macros provides a safer and
78 more robust way to determine the minimum and maximum values between two
79 expressions without risking unintended consequences from multiple
80 evaluations.
81 */
82#define max(a, b)
83 ({
84 __typeof__(a) _a = (a);
85 __typeof__(b) _b = (b);
86 _a > _b ? _a : _b;
87 })
88/** @brief min macro evaluates two expressions, returning least result */
89#define min(x, y)
90 ({
91 typeof(x) _x = (x);
92 typeof(y) _y = (y);
93 (void)(&_x == &_y);
94 _x < _y ? _x : _y;
95 })
96/**
97 */
98/** @brief MIN macro for compatibility with code that uses the same name,
99 while avoiding multiple evaluations of the arguments.
100 @details /usr/include/sys/param.h contains implementations of the MIN and MAX
101 macros, which are simple but can lead to issues with multiple evaluations of
102 the arguments if they have side effects. These macros provides a safer
103 alternative to param.h Here are the macros from /usr/include/sys/param.h. You
104 may comment out the macros defined herein and use the macros in param.h if
105 you prefer.
106 @code
107 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
108 #define MAX(a, b) (((a) > (b)) ? (a) : (b))
109 @endcode
110 @note The following macro provides a safer alternative to param.h
111 */
112#define MAX(a, b)
113 ({
114 typeof(a) _a = (a);
115 typeof(b) _b = (b);
116 _a > _b ? _a : _b;
117 })
118/** @brief MAX macro for compatibility with code that uses the same name,
119 while avoiding multiple evaluations of the arguments.
120 @note The following macro provides a safer alternative to param.h
121 */
122#define MIN(x, y)
123 ({
124 typeof(x) _x = (x);
125 typeof(y) _y = (y);
126 (void)(&_x == &_y);
127 _x < _y ? _x : _y;
128 })
129/** @brief ABS macro for absolute value, which evaluates the expression once and
130 returns the absolute value.
131 @details This macro uses a compound statement to create a local scope for
132 the temporary variable _a, which stores the value of x. This ensures that if
133 x has side effects (such as being incremented), it will only be evaluated
134 once when the macro is expanded. The use of typeof allows the macro to work
135 with any data type that supports comparison with zero and negation.
136 */
137#define ABS(x)
138 ({
139 __typeof__(x) _a = (x);
140 _a < 0 ? -_a : _a;
141 })
142#define S_TOLOWER(c)
143 ({
144 int __c = (c);
145 (__c >= 'A' && __c <= 'Z') ? (__c + ('a' - 'A')) : __c;
146 })
147#define S_TOUPPER(c)
148 ({
149 int __c = (c);
150 (__c >= 'a' && __c <= 'z') ? (__c - ('a' - 'A')) : __c;
151 })
152
153/**
154 @brief Used for xterm256 color conversions
155 */
156typedef enum {
199} ColorsEnum;
200
201typedef enum {
202 /** byte 0 - bits 0-7 Selection Flags*/
203 LF_HIDE = 0b00000001, /**< 1 Don't list hidden files */
204 LF_ICASE = 0b00000010, /**< 2 Ignore case in search */
205 LF_EXC_REGEX = 0b00000100, /**< 4 Exclude files matching regex */
206 LF_REGEX = 0b00001000, /**< 8 Include files matching regex */
207 LF_EXEC = 0b00010000, /**< 16 Execute command each file */
208 LF_USER = 0b00100000, /**< 32 Select User Name */
209 /** << 16 */
210 /** byte 1 - bits 8-15 */
211 LF_IXUSR = 0b00000001, /**< 1 Select Files with Execute Permission */
212 LF_IWUSR = 0b00000010, /**< 2 Select Files with Write Permission */
213 LF_IRUSR = 0b00000100, /**< 4 Select Files with Read Permission */
214 LF_ISGID = 0b00010000, /**< 16 Select Setgid Files */
215 LF_ISUID = 0b00100000, /**< 32 Select Setuid Files */
216} LFFlags;
217
218/** byte 2 - bits 16-23 File types*/
219typedef enum {
220 LF_FIFO = 0b00000001, /**< 1 named pipe */
221 LF_CHR = 0b00000010, /**< 2 character device */
222 LF_DIR = 0b00000100, /**< 4 directory */
223 LF_BLK = 0b00001000, /**< 8 block */
224 LF_REG = 0b00010000, /**< 16 regular file */
225 LF_LNK = 0b00100000, /**< 32 link */
226 LF_SOCK = 0b01000000, /**< 64 socket */
227 LF_UNKNOWN = 0b10000000 /**< 128 unknown */
228} LFTypes;
229
230typedef enum {
231 F_F0, // 0
232 F_FIFO, // 1
233 F_CHR, // 2
234 F_F1, // 3
235 F_DIR, // 4
236 F_F2, // 5
237 F_BLK, // 6
238 F_F3, // 7
239 F_REG, // 8
240 F_F4, // 9
241 F_LNK, // 10
242 F_F5, // 11
243 F_SOCK, // 12
244 F_F6, // 13
246} F_Type;
247
248// int const lf_type[][15] = {
249// {0, 0b00000001, 0b00000010, 0, 0b00000100, 0, 0b00001000, 0, 0b00010000, 0,
250// 0b00100000, 0,0b01000000, 0, 0b10000000}};
251
252/*
253 * dirent d_type to lf_type for reference
254------------------------ --------------------
255d_type binary dec lf_type binary dec ordinal
256--------- -------- --- ----------- -------- --- -------
257DT_FIFO: 00000001 1 LF_FIFO: 00000001 1 1
258DT_CHR: 00000010 2 LF_CHR: 00000010 2 2
259DT_DIR: 00000100 4 LF_DIR: 00000100 4 3
260DT_BLK: 00000110 6 LF_BLK: 00001000 8 4
261DT_REG: 00001000 8 LF_REG: 00010000 16 5
262DT_LNK: 00001010 10 LF_LNK: 00100000 32 6
263DT_SOCK: 00001100 12 LF_SOCK: 01000000 64 7
264DT_UNKNOWN: 00001110 14 LF_UNKNOWN: 10000000 128 8
265
266 */
267
268#define F_NO_STDERR 1
269
270/**
271 Include Exclude
272 ---------- ----------
273 LF_FIFO 1 0 00000001 7 11111110 named pipe
274 LF_CHR 2 1 00000010 6 11111101 character device
275 LF_DIR 4 2 00000100 5 11111011 directory
276 LF_BLK 8 3 00001000 4 11110111 block device
277 LF_REG 16 4 00010000 3 11101111 regular file
278 LF_LNK 32 5 00100000 2 11011111 link
279 LF_SOCK 64 6 01000000 1 10111111 socket
280 LF_UNKNOWN 128 7 10000000 0 01111111 unknown
281*/
282
283#define COLOR_LEN 8 /**< length of color code strings */
284#define DEFAULTSHELL "/bin/bash"
285#define S_WCOK 0x1000 /**< write or create permitted */
286#define S_QUIET 0x2000 /**< quiet mode flag for file validation */
287
288/** @brief This macro registers the end_pgm function to be called when the
289 program exits.
290 @details It checks the return value of atexit() to ensure that the
291 registration was successful, and if not, it prints an error message and
292 exits with a failure status. Programs using libcm should call __atexit in
293 their main function to ensure that the end_pgm function is registered to be
294 called on program exit. This will help ensure that the terminal is properly
295 restored to its original state, even if the program encounters an error or
296 is terminated unexpectedly. */
297#define __atexit
298 {
299 int rc;
300 rc = atexit(end_pgm);
301 if (rc != 0) {
302 fprintf(stderr, "\nCannot set exit function\n");
303 exit(EXIT_FAILURE);
304 }
305 }
306
307/** @struct Chyron
308 @details The Chyron structure represents a key binding for a command in the
309 chyron, which is a status line or message area in the terminal interface.
310 The ChyronKey structure includes fields for displayable text,
311 the key code, and the end position of the command text in the chyron.
312 This structure allows xwgetch to map mouse clicks to key codes
313 as defined by NCursesw and the C-Menu program.
314 The text field holds the displayable text associated with the command.
315 xwgetch() translates a mouse click on the chyron with a particular key code
316 stored in this table.
317 The use case is when the developer wants a dynamic chyron that can be
318 easily changed depending on the context of the program without having to
319 worry about translating mouse click positions to key codes.
320 While many key codes are defined by NCursesw, the developer is free to
321 define their own key codes for custom commands in the chyron. However,
322 xwgetch() will translate mouse clicks to the key codes defined in this table,
323 even if they interfere with standard NCurses key codes, Unicode code points,
324 or ASCII characters. Just use common sense.
325 In addition to returning the key code associated with mouse clicks on
326 the chyron, xwgetch() also returns the key codes for standard keyboard input,
327 and sets the global variables cliek_y and click_x to the coordinates of the
328 mouse click.
329 */
330#define CHYRON_KEY_MAXLEN
331 64 /**< maximum length of the command text for a key \
332 binding in the chyron */
333#define CHYRON_KEYS 20 /**< maximum number of key bindings for the chyron */
334
335typedef struct {
336 bool active; /**< whether the key binding is active */
337 char text[CHYRON_KEY_MAXLEN]; /**< command text associated with the key code
338 */
339 int keycode; /**< key code associated with the command */
340 int end_pos; /**< end position of the command text in the chyron */
341 int cp; /**< color pair index for the command text in the chyron */
342} ChyronKey;
343
344typedef struct {
345 ChyronKey *key[CHYRON_KEYS]; /**< array of key bindings for the chyron */
346 char s[MAXLEN]; /**< the chyron string, for displaying messages in */
347 cchar_t cmplx_buf[MAXLEN]; /**< the chyron wide character string */
348 int l; /**< length of the chyron string, for display purposes */
349} Chyron;
350
351extern void activate_chyron_key(Chyron *, int);
352extern void activate_all_chyron_keys(Chyron *);
353extern void deactivate_chyron_key(Chyron *, int);
354extern void deactivate_all_chyron_keys(Chyron *);
355extern int vgetch(WINDOW *, int);
356extern int xwgetch(WINDOW *, Chyron *, int);
357extern int dxwgetch(WINDOW *, WINDOW *, WINDOW *, WINDOW *, WINDOW *, Chyron *, int);
358
359extern int click_y; /**< the y coordinate of a mouse click */
360extern int click_x; /**< the x coordinate of a mouse click */
361extern WINDOW *mouse_win; /**< input from window n */
362
363extern Chyron *wait_mk_chyron();
364extern WINDOW *wait_mk_win(Chyron *, char *);
365extern int wait_continue(WINDOW *, Chyron *, int);
366extern bool wait_destroy(Chyron *);
367extern bool waitpid_with_timeout(pid_t, int);
368extern int wait_timeout;
369extern bool action_disposition(char *eitle, char *action_str);
370extern int fork_detach_execvp(char **);
371extern WINDOW *message_win(char *);
372extern bool is_hex_str(char *, int);
373extern bool unstr_hex_clr(char *, char *);
374
375extern bool f_debug; /**< a flag to indicate whether debug
376output should be printed, for debugging purposes */
377// extern unsigned int cmd_key; /**< the command key for the current command,
378// for
379// error messages and other output */
380/** @struct RGB */
381typedef struct {
382 int r, g, b;
383} RGB;
384
385#define FG_COLOR 2 /**< default foreground color */
386#define BG_COLOR 0 /**< default background color */
387#define BO_COLOR 1 /**< default bold foreground color */
388#define LN_COLOR 4 /**< default line number color */
389#define LN_BG_COLOR 7 /**< default line number background */
390
391extern int cp_default; /**< default color pair index */
392extern int cp_box; /**< box color pair index */
393extern int cp_ind; /**< indicator color pair index */
394extern int cp_bold; /**< bold color pair index */
395extern int cp_title; /**< title color pair index */
396extern int cp_highlight; /**< highlight color pair index */
397extern int cp_fill_char; /**< fill character color pair index */
398extern int cp_brackets; /**< color pair index for field brackets */
399extern int cp_nt; /**< normal color pair index */
400extern int cp_nt_rev; /**< reverse color pair index */
401extern int cp_nt_hl; /**< highlight color pair index */
402extern int cp_nt_hl_rev; /**< highlight reverse color pair index */
403extern int cp_ln_fg; /**< line number color pair index */
404extern int cp_ln_bg; /**< line number background color pair index */
405extern int cp_cmdln_fg; /**< command line number color pair index */
406extern int cp_cmdln_bg; /**< command line number background color pair index */
407extern int cp_red; /**< red background color pair index */
408extern int cp_green; /**< green background color pair index */
409extern int cp_yellow; /**< yellow background color pair index */
410extern int cp_blue; /**< blue background color pair index */
411extern int clr_idx; /**< current color index */
412extern int clr_cnt; /**< number of colors used */
413extern int clr_pair_idx; /**< current color pair index */
414extern int clr_pair_cnt; /**< number of color pairs supported by the terminal */
415extern char const colors_text[][10]; /**< color codes for the 16 basic colors */
416
417/** @struct ColorPair
418 @details The ColorPair structure is a simple structure that holds information
419 about a color pair, including the foreground color index, background color
420 index, and the color pair index. This structure can be used to manage and
421 apply color pairs in the ncurses library, allowing for easy customization of
422 the terminal's appearance. By using this structure, you can easily keep track
423 of the different color pairs you have defined and apply them to various
424 elements in your terminal interface. */
425typedef struct {
426 int fg; /**< foreground color index */
427 int bg; /**< background color index */
428 int pair_id; /**< color pair index */
429} ColorPair;
430
431/**< see termios.h */
432extern struct termios shell_tioctl, curses_tioctl;
433extern struct termios shell_in_tioctl, curses_in_tioctl;
434extern struct termios shell_out_tioctl, curses_out_tioctl;
435extern struct termios shell_err_tioctl, curses_err_tioctl;
436
437extern bool f_have_shell_tioctl; /**< shell tioctl captured */
438extern bool f_have_curses_tioctl; /**< curses tioctl captured */
439extern bool f_curses_open; /**< curses mode is active */
440extern bool f_restore_screen; /**< whether to restore the screen */
441
442extern void dump_opts(); /**< dump options to stdout */
443
444extern void dump_opts_by_use(char *, char *); /**< dump options to stdout */
445extern bool capture_shell_tioctl();
446extern bool restore_shell_tioctl();
447extern bool capture_curses_tioctl();
448extern bool restore_curses_tioctl();
449extern bool mk_raw_tioctl(struct termios *);
450extern bool set_sane_tioctl(struct termios *);
451extern int box_new(int, int, int, int, char *);
452extern int box2_new(int, int, int, int, char *);
453extern int box_hsplit_new(int, int, int, int, int, char *);
454extern int win_new(int, int);
455extern int win2_new(int, int, int, int);
456extern int border_draw(WINDOW *);
457extern int border_title(WINDOW *, char *);
458extern int border_hsplit(WINDOW *, int);
459extern int border_hsplit_text(WINDOW *, char *, int);
460extern void win_redraw(WINDOW *);
461extern void win_resize(int, int, char *);
462extern void signal_handler(int);
463extern bool handle_signal(sig_atomic_t);
464extern volatile sig_atomic_t sig_received;
465extern void sig_prog_mode();
466extern void sig_dfl_mode();
467extern bool mk_dir(char *dir);
468extern int segmentation_fault();
469extern cchar_t mkcc(int, attr_t, const char *);
470extern char *iso8601_time(char *, int, time_t *, bool);
471extern bool parse_local_timestamp(const char *, time_t *);
472extern char *format_local_timestamp(time_t, char *, size_t);
473extern char *get_local_timestamp();
474extern char *get_user_str(char *, size_t);
475extern char *get_ip_addresses(char *, int);
476extern bool is_newer(char *, char *);
477extern cchar_t CC_REVERSE; /**< curses default reverse */
478extern cchar_t CC_NT; /**< C-Menu normal text */
479extern cchar_t CC_NT_REV; /**< reverse */
480extern cchar_t CC_NT_HL; /**< highlight */
481extern cchar_t CC_NT_HL_REV; /**< highlight reverse */
482extern cchar_t CC_FILL_CHAR; /**< fill character */
483extern cchar_t CC_BRKTL; /**< left bracket */
484extern cchar_t CC_BRKTR; /**< right bracket */
485extern cchar_t CC_BOX; /**< indicator colors */
486extern cchar_t CC_IND; /**< box colors */
487extern cchar_t CC_CMDLN;
488extern cchar_t CC_LN;
489extern cchar_t CC_DATA1;
490extern cchar_t CC_DATA2;
491extern cchar_t CC_DATA3;
492extern cchar_t CC_TITLE; /**< title colors */
493
494extern cchar_t CC_BRKTL; /**< left field bracket */
495extern cchar_t CC_BRKTR; /**< right field bracket */
496extern cchar_t CC_RED; /**< red background */
497extern cchar_t CC_GREEN; /**< green background */
498extern cchar_t CC_YELLOW; /**< yellow background */
499extern cchar_t CC_BLUE; /**< blue background */
500
501extern cchar_t ls, rs, ts, bs, tl, tr, bl, br;
502#define KEY_ALTF0 0x138
503#define KEY_ALTF(n) (KEY_ALTF0 + (n)) /**< define alt function keys */
504#define XTERM_256COLOR /**< use xterm-256color terminfo for altkey bindings */
505/**
506 EXTENDED NCURSES KEYS
507
508 Key code bindings are customarily defined in terminfo.
509 xterm-256color tends to be the most complete, and indeed, it seems to
510 work with Ghostty, Kitty, and Alacritty. If you want to use the
511 altkey bindings, you may need to set your terminal's TERM environment
512 variable to xterm-256color. Here's why:
513
514 Ghostty, Kitty, and Alacritty all come with their own terminfo files:
515
516 Ghostty with xterm-ghostty,
517 Kitty with xterm-kitty, and
518 Alacritty with alacritty
519
520 None of the three produced the correct extended altkey bindings when
521 paired with the terminfo provided in their distribution, yet all
522 three worked with xterm-256color.
523
524 The extended altkeys were not defined in any of the terminfo files, not
525 even xterm-256color. Yet, xterm-256color produced consistent keycode
526 bindings with all three emulators. The standard key bindings, ins, delete,
527 up, down arrows, etc., were the same for all three terminfos, and all
528 three emulators produced the correct key bindings for those keys.
529
530 The fact that xterm-256color produced consistent keycode bindings for the
531 altkeys, while the other three terminfos did not, is likely due to the fact
532 that xterm-256color is more widely used and has better support for extended
533 key bindings, even if they are not explicitly defined in the terminfo file.
534 It's possible that xterm-256color has some default behavior or fallback
535 mechanism that allows it to recognize and produce key codes for the altkeys,
536 while the other terminfos do not have such a mechanism in place. This could
537 explain why xterm-256color produced consistent keycode bindings for the
538 altkeys across all three emulators, while the other terminfos did not.
539 @code
540 mapped altkey ncurses
541 2nd fld - 1 name binding keycode
542 ------------- --------- -------- -------
543 kIC=\E[2;2~, key_ins \E[2;3~, 223
544 kHOM=\E[1;2H, key_home \E[1;3H, 21e
545 kPRV=\E[5;2~, key_pgup \E[5;3~, 232
546 kDC=\E[3;2~, key_del \E[3;3~, 20e
547 kEND=\E[1;2F, key_end \E[1;3F, 219
548 kNXT=\E[6;2~, key_pgdn \E[6;3~, 22d
549 kri=\E[1;2A, key_up \E[1;3A, 23d
550 kind=\E[1;2B, key_down \E[1;3B, 214
551 kRIT=\E[1;2C, key_right \E[1;3C, 237
552 kLFT=\E[1;2D, key_left \E[1;3D, 228
553 @endcode
554 */
555#if defined(XTERM_256COLOR)
556#define KEY_ALTINS 0x223
557#define KEY_ALTHOME 0x21e
558#define KEY_ALTPGUP 0x232
559#define KEY_ALTDEL 0x20e
560#define KEY_ALTEND 0x219
561#define KEY_ALTPGDN 0x22d
562#define KEY_ALTUP 0x23d
563#define KEY_ALTLEFT 0x228
564#define KEY_ALTDOWN 0x214
565#define KEY_ALTRIGHT 0x237
566#elif defined(XTERM_GHOSTTY)
567#define KEY_ALTINS 0x228
568#define KEY_ALTHOME 0x223
569#define KEY_ALTPGUP 0x237
570#define KEY_ALTDEL 0x213
571#define KEY_ALTEND 0x21e
572#define KEY_ALTPGDN 0x232
573#define KEY_ALTUP 0x242
574#define KEY_ALTLEFT 0x22d
575#define KEY_ALTDOWN 0x219
576#define KEY_ALTRIGHT 0x23c
577#endif
578
579/** UNICODE BOX DRAWING SYMBOLS */
580#define BW_HO L'\x2500' /**< horizontal line */
581#define BW_VE L'\x2502' /**< vertical line */
582#define BW_TL L'\x250C' /**< top left */
583#define BW_TR L'\x2510' /**< top right */
584#define BW_BL L'\x2514' /**< bottom left */
585#define BW_BR L'\x2518' /**< bottom right */
586#define BW_RTL L'\x256d' /**< rounded top left */
587#define BW_RTR L'\x256e' /**< rounded top right */
588#define BW_RBL L'\x2570' /**< rounded bottom left */
589#define BW_RBR L'\x256f' /**< rounded bottom right */
590#define BW_LT L'\x251C' /**< left tee */
591#define BW_TT L'\x252C' /**< top tee */
592#define BW_RT L'\x2524' /**< right tee */
593#define BW_CR L'\x253C' /**< cross */
594#define BW_BT L'\x2534' /**< bottom tee */
595#define BW_SP L'\x20' /**< space */
596#define BW_RA L'\x2192' /**< large right arrow */
597#define BW_LA L'\x2190' /**< large left arrow */
598#define BW_UA L'\x2191' /**< large up arrow */
599#define BW_DA L'\x2193' /**< large down arrow */
600#define BW_RAN L'\x276F' /**< right_angle */
601#define BW_LAN L'\x276E' /**< left_angle */
602// #define BW_CHK L'\x2705' /**< left_angle */
603#define BW_CHK L'\x2611' /**< left_angle */
604
605/** The following are the actual wchar_t variables that will hold the box
606 drawing characters. These correspond to the above Unicode code points. By
607 defining them as wchar_t, we can use them in the ncurses library to draw
608 boxes and lines in the terminal. The variables are named with a "bw_" prefix
609 to indicate that they are box (wide) drawing characters, and they will be
610 initialized with the corresponding Unicode characters defined above. */
611
612extern const wchar_t bw_ho; /**< horizontal line */
613extern const wchar_t bw_ve; /**< vertical line */
614extern const wchar_t bw_tl; /**< top left corner */
615extern const wchar_t bw_tr; /**< top right corner */
616extern const wchar_t bw_bl; /**< bottom left corner */
617extern const wchar_t bw_br; /**< bottom right corner */
618extern const wchar_t bw_lt; /**< left tee */
619extern const wchar_t bw_tt; /**< top tee */
620extern const wchar_t bw_rt; /**< right tee */
621extern const wchar_t bw_cr; /**< cross */
622extern const wchar_t bw_bt; /**< bottom tee */
623extern const wchar_t bw_sp; /**< space */
624extern const wchar_t bw_ra; /**< right arrow */
625extern const wchar_t bw_la; /**< left arrow */
626extern const wchar_t bw_ua; /**< up arrow */
627extern const wchar_t bw_da; /**< down arrow */
628extern const wchar_t bw_ran; /**< right piointing angle */
629extern const wchar_t bw_chk; /**< right piointing angle */
630
631extern cchar_t ls, rs, ts, bs, tl, tr, bl, br, lt, rt, sp, ra, la, ua, da, ran, chk;
632
633extern void write_cmenu_log_nt(char *);
634extern void write_cmenu_log(char *);
635extern void open_cmenu_log();
636extern FILE *cmenu_log_fp;
637extern int n_lines; /**< number of lines in the terminal */
638extern int n_cols; /**< number of columns in the terminal */
639// extern int lines; current number of lines (may be less than n_lines if
640// the terminal is resized)
641// extern int cols; current number of columns (may be less than n_cols
642// if the
643// terminal is resized) extern int begx;
644// beginning x coordinate of the terminal */
645// extern int begy; beginning y coordinate of the terminal
646//
647#define MAXWIN 30 /**< maximum number of windows that can be created */
648typedef unsigned char uchar;
649
650extern void sig_prog_mode();
651extern void sig_shell_mode();
652extern char di_getch();
653extern int enter_option();
654
655// extern PANEL *std_panel;
656
657// extern WINDOW *win_main;
658// extern PANEL *panel_main;
659
660extern WINDOW *win_win[MAXWIN]; /**< array of pointers to windows */
661extern WINDOW *win_win2[MAXWIN]; /**< array of pointers to windows */
662extern WINDOW *win_box[MAXWIN]; /**< array of pointers to box windows */
663extern PANEL *panel_win[MAXWIN];
664extern PANEL *panel_win2[MAXWIN];
665extern PANEL *panel_box[MAXWIN];
666
667extern int win_attr; /**< Ncurses attributes for the current window, such as
668 color pair, bold, etc. */
669extern int
670 win_attr_odd; /**< Ncurses attributes for the current window odd lines,
671 which may be different from the attributes for even lines
672 to create a striped effect in the window. */
673extern int
674 win_attr_even; /**< Ncurses attributes for the current window even lines,
675 which may be different from the attributes for odd lines
676 to create a striped effect in the window. */
677extern int win_ptr; /**< Pointer to the current window pair, box and window,
678 which can be used to keep track of the currently active
679 window and its associated box. */
680// extern bool win_pair; /**< Flag to indicate whether the current window is
681// part of a window pair */
682extern int
683 mlines; /**< number of lines in the current window, which may be less than
684 the total number of lines in the terminal if the window is
685 resized or if multiple windows are being used. */
686extern int
687 mcols; /**< number of columns in the current window, which may be less than
688 the total number of columns in the terminal if the window is
689 resized or if multiple windows are being used. */
690extern int
691 mbegy; /**< beginning y coordinate of the current window, which can be used
692 to determine the position of the window on the terminal screen. */
693extern int
694 mbegx; /**< beginning x coordinate of the current window, which can be used
695 to determine the position of the window on the terminal screen. */
696extern int mg_action; /**< action in progress, which can be used to keep track
697 of the current state of the program and determine how
698 to respond to user input or other events. */
699extern int mg_col; /**< window column, which can be used to determine the
700 current column position in the window for displaying text
701 or other content. */
702extern int
703 mg_line; /**< window line, which can be used to determine the current line
704 position in the window for displaying text or other content. */
705 /** to_uppercase(c) - convert a lowercase letter to uppercase */
706#define to_uppercase(c)
707 if (c >= 'a' && c <= 'z')
708 c -= ' '
709/** to_lowercase(c) - convert an uppercase letter to lowercase */
710#define to_lowercase(c)
711 if (c >= 'A' && c <= 'Z')
712 c += ' '
713extern int tty_fd; /**< the file descriptor for the terminal, for error messages
714 and other output */
715extern int
716 dbgfd; /**< the file descriptor for debug output, for debugging purposes */
717extern int src_line; /**< the line number of the source file being processed,
718 for error messages */
719extern char *src_name; /**< the name of the source file being processed, for
720 error messages */
721extern char fn[MAXLEN]; /**< function name for error messages */
722extern char em0[MAXLEN]; /**< error message string for error messages */
723extern char em1[MAXLEN]; /**< error message string for error messages */
724extern char em2[MAXLEN]; /**< error message string for error messages */
725extern char em3[MAXLEN]; /**< error message string for error messages */
726
727extern int exit_code; /**< the exit code for the program, for error messages and
728 other output */
729
730extern void win_del();
731extern void destroy_win(WINDOW *);
732extern void destroy_box(WINDOW *);
733extern void restore_wins();
734extern void win_init_attrs();
735extern void win_Toggle_Attrs();
736extern void mvwaddstr_fill(WINDOW *, int, int, char *, int);
738extern void init_stdscr();
739extern void curskeys(WINDOW *);
740extern void mouse_getch(int *, int *, int *, int *);
741extern void w_mouse_getch(WINDOW *, int *, int *, int *, int *);
742extern bool get_argp_doc_by_name(char *comment, const struct argp_option *, const char *);
743
744/** @struct Arg
745 @brief The Arg structure represents a string argument with a pointer to the
746 string and its allocated length. */
747typedef struct {
748 char *s; /**< pointer to the string argument */
749 size_t l; /**< allocated length */
750} Arg;
751/** @struct Argv
752 @brief The Argv structure represents an argument vector, which is an array of
753 Arg structures, along with the number of allocated elements in the array. */
754typedef struct {
755 Arg **v; /**< pointer to an array of Arg pointers, representing the argument
756 vector */
757 size_t n; /**< allocated array elements */
758} Argv;
759/** @struct String
760 @brief The String structure represents a string object with a pointer to the
761 string and its allocated length. */
762typedef struct {
763 char *s; /**< pointer to the string */
764 size_t l; /**< allocated length */
765} String;
766/** @struct WCStr
767 @brief wide character string object with a pointer to the wide character
768 string and its allocated length
769 @details The WCStr structure represents a wide character string with a
770 pointer to the wide character string and its allocated length. */
771typedef struct {
772 wchar_t *s; /**< pointer to the wide character string */
773 size_t l; /**< @brief allocated length */
774} WCStr;
775/** @struct CCStr
776 @brief complex character objectl with a pointer to the complex character
777 string and its allocated length
778 @details The CCStr structure represents a complex character string, which is
779 a string that can contain both regular characters and attributes (such as
780 color, bold, etc.) in the ncurses library. This structure includes a pointer
781 to the complex character string and its allocated length, allowing for
782 dynamic handling of complex character strings in the terminal interface. */
783typedef struct {
784 cchar_t *s; /**< pointer to the complex character string */
785 size_t l; /**< allocated length */
786} CCStr;
787/** simple macro to convert a character to uppercase */
788#define to_uppercase(c)
789 if (c >= 'a' && c <= 'z')
790 c -= ' '
791/** @struct SIO
792 @brief The SIO structure encapsulates various aspects of the terminal's
793 state and configuration, including color management, file pointers, and
794 terminal device information.
795 @details The SIO structure serves as a central repository for all relevant
796 information needed to manage the terminal's appearance and behavior
797 effectively, allowing for a highly customizable and visually appealing
798 terminal experience. The SIO structure includes fields for managing colors,
799 gamma correction values, color codes for different colors, file pointers and
800 descriptors for standard input/output/error and the terminal device, as well
801 as counters and indices for color management. Additionally, it contains a
802 field for storing the name of the terminal device. This comprehensive
803 structure allows for efficient management of the terminal's state and
804 configuration in a structured way. */
805typedef struct {
806 double red_gamma; /**< red gamma correction value */
807 double green_gamma; /**< green gamma correction value */
808 double blue_gamma; /**< blue gamma correction value */
809 double gray_gamma; /**< gray gamma correction value */
810 char black[COLOR_LEN]; /**< color code for black */
811 char red[COLOR_LEN]; /**< color code for red */
812 char green[COLOR_LEN]; /**< color code for green */
813 char yellow[COLOR_LEN]; /**< color code for yellow */
814 char blue[COLOR_LEN]; /**< color code for blue */
815 char magenta[COLOR_LEN]; /**< color code for magenta */
816 char cyan[COLOR_LEN]; /**< color code for cyan */
817 char white[COLOR_LEN]; /**< color code for white */
818 char orange[COLOR_LEN]; /**< color code for orange */
819 char bblack[COLOR_LEN]; /**< color code for bold black */
820 char bred[COLOR_LEN]; /**< color code for bold red */
821 char bgreen[COLOR_LEN]; /**< color code for bold green */
822 char byellow[COLOR_LEN]; /**< color code for bold yellow */
823 char bblue[COLOR_LEN]; /**< color code for bold blue */
824 char bmagenta[COLOR_LEN]; /**< color code for bold magenta */
825 char bcyan[COLOR_LEN]; /**< color code for bold cyan */
826 char bwhite[COLOR_LEN]; /**< color code for bold white */
827 char borange[COLOR_LEN]; /**< color code for bold orange */
828 char abg[COLOR_LEN]; /**< color code for background with alpha */
829 char fg[COLOR_LEN]; /**< foreground color index */
830 char bg[COLOR_LEN]; /**< background color index */
831 char box_fg[COLOR_LEN]; /**< box foreground */
832 char box_bg[COLOR_LEN]; /**< box background */
833 char ind_fg[COLOR_LEN]; /**< indicator foreground */
834 char ind_bg[COLOR_LEN]; /**< indicator background */
835 char brackets_fg[COLOR_LEN]; /**< brackets foreground */
836 char brackets_bg[COLOR_LEN]; /**< brackets background */
837 char fill_char_fg[COLOR_LEN]; /**< fill character foreground */
838 char fill_char_bg[COLOR_LEN]; /**< fill character background */
839 char ln_fg[COLOR_LEN]; /**< line number color index */
840 char ln_bg[COLOR_LEN]; /**< line number background index */
841 char cmdln_fg[COLOR_LEN]; /**< line number color index */
842 char cmdln_bg[COLOR_LEN]; /**< line number background index */
843 char nt_fg[COLOR_LEN]; /**< color code for normal text foreground */
844 char nt_bg[COLOR_LEN]; /**< color code for normal text background */
845 char nt_rev_fg[COLOR_LEN]; /**< normal text reverse foreground */
846 char nt_rev_bg[COLOR_LEN]; /**< normal text reverse background */
847 char nt_hl_fg[COLOR_LEN]; /**< normal text highlight foreground */
848 char nt_hl_bg[COLOR_LEN]; /**< normal text highlight background */
849 char
850 nt_hl_rev_fg[COLOR_LEN]; /**< normal text highlight reverse foreground */
851 char
852 nt_hl_rev_bg[COLOR_LEN]; /**< normal text highlight reverse background */
853 char title_fg[COLOR_LEN]; /**< title foreground */
854 char title_bg[COLOR_LEN]; /**< title background */
855 char tty_name[MAXLEN]; /**< name of the terminal device */
856 FILE *stdin_fp; /**< stdin stream pointer */
857 FILE *stdout_fp; /**< stdout stream pointer */
858 FILE *stderr_fp; /**< stderr stream pointer */
859 FILE *tty_fp; /**< terminal device stream pointer */
860 int stdin_fd; /**< stdin file descriptor */
861 int stdout_fd; /**< stdout file descriptor */
862 int stderr_fd; /**< stderr file descriptor */
863 int tty_fd; /**< terminal device file descriptor */
864 int clr_cnt; /**< number of colors currently in use */
865 int clr_pair_cnt; /**< number of color pairs currently in use */
866 int clr_idx; /**< current color index */
867 int clr_pair_idx; /**< current color pair index */
868 int cp_default; /**< default color pair index */
869 int cp_norm; /**< normal color pair index */
870 int cp_win; /**< window color pair index */
871 int cp_nt_rev; /**< reverse color pair index */
872 int cp_nt_hl; /**< highlight color pair index */
873 int cp_nt_hl_rev; /**< reverse highlight color pair index */
874 int cp_box; /**< box color pair index */
875 int cp_ind; /**< box color pair index */
876 int cp_bold; /**< bold color pair index */
877 int cp_title; /**< title color pair index */
878 int cp_highlight; /**< highlight color pair index */
879 int cp_ln; /**< line number color pair index */
880 int cp_cmdln; /**< line number color pair index */
881} SIO;
882extern void destroy_curses();
883extern int a_toi(char *, bool *);
884extern bool chrep(char *, char, char);
885extern char *rep_substring(const char *, const char *, const char *);
886extern size_t strip_ansi(char *, char *);
887extern bool strip_quotes(char *);
888extern bool stripz_quotes(char *);
889extern int str_to_args(char **, char *, int);
890extern int destroy_argv(int argc, char **argv);
891extern bool str_to_bool(const char *);
892extern bool str_to_lower(char *);
893extern bool str_to_upper(char *);
894extern bool strnfill(char *, char, int);
895extern bool str_subc(char *, char *, char, char *, int);
896extern size_t strnz(char *, size_t);
897extern size_t strnlf(char *, size_t);
898extern char *strnz_dup(char *, size_t);
899extern size_t ssnprintf(char *, size_t, const char *, ...);
900extern size_t strnz__cpy(char *, const char *, size_t);
901extern size_t strnz__cat(char *, const char *, size_t);
902extern double str_to_double(char *);
903extern size_t string_cpy(String *, const String *);
904extern size_t string_cat(String *, const String *);
905extern size_t string_ncat(String *, const String *, size_t);
906extern size_t string_ncpy(String *, const String *, size_t);
907extern size_t trim(char *);
908extern size_t rtrim(char *);
909extern String to_string(const char *);
910extern String mk_string(size_t);
911extern String free_string(String);
912extern void apply_gamma(RGB *);
913extern int get_clr_pair(int, int);
914extern int clr_name_to_idx(char *);
915extern int rgb_to_xterm256_idx(RGB *);
916extern bool init_clr_palette(SIO *);
917extern bool open_curses(SIO *);
918extern int rgb_clr_to_cube(int);
919extern int rgb_to_curses_clr(RGB *);
920extern RGB xterm256_idx_to_rgb(int);
921extern int fork_exec(char **);
922extern int full_screen_fork_exec(char **);
923extern int full_screen_shell(char *);
924extern int shell(char *);
925extern char errmsg[];
926extern void get_rfc3339_s(char *, size_t);
927extern int open_log(char *);
928extern void write_log(char *);
929extern void compile_chyron(Chyron *);
930extern void display_chyron(WINDOW *, Chyron *, int, int);
931extern int get_chyron_key(Chyron *, int);
932extern bool is_set_chyron_key(Chyron *, int);
933extern void set_chyron_key(Chyron *, int, char *, int);
934extern void set_chyron_key_cp(Chyron *, int, char *, int, int);
935extern void unset_chyron_key(Chyron *, int);
936extern Chyron *new_chyron();
937extern Chyron *destroy_chyron(Chyron *chyron);
938extern void abend(int, char *);
939extern void display_argv_error_msg(char *, char **);
940extern int display_error(char *, char *, char *, char *);
941extern int answer_yn(char *, char *, char *, char *);
942extern int display_ok_message(char *);
943extern int Perror(char *);
944extern void user_end();
945extern unsigned long a_to_ul(const char *);
946extern size_t canonicalize_file_spec(char *);
947extern bool construct_file_spec(char *, char *, char *, char *, char *, int);
948extern bool file_spec_path(char *, char *);
949extern bool file_spec_name(char *, char *);
950extern bool is_directory(const char *);
951extern bool is_symlink_to_dir(const char *);
952extern bool is_valid_regex(const char *);
953extern bool dir_name(char *, char *);
954extern bool base_name(char *, char *);
955extern bool expand_tilde(char *, int);
956extern bool locate_file_in_path(char *, char *);
957extern bool normalize_file_spec(char *);
958extern bool trim_ext(char *, char *);
959extern bool trim_path(char *);
960extern bool verify_file(char *, int);
961extern bool verify_file_q(char *, int);
962extern bool verify_dir(char *, int);
963extern bool verify_dir_q(char *, int);
964extern bool verify_spec_arg(char *, char *, char *, char *, int);
965extern size_t mk_cmplx_str(cchar_t *, char *, attr_t, int);
966extern size_t str_to_cc(cchar_t *, const char *, attr_t, int, size_t);
967extern void display_cmplx_str(WINDOW *, cchar_t *, int, int);
968extern int wccp_to_str(wchar_t, uint8_t *);
969extern char *fdname(int, char *);
970extern char *stdio_names(char *, char *);
971extern char *stdio_fdnames(char *, char *);
972extern char stdio_names_str[MAXLEN];
973extern void check_panels(int);
974extern int bare_box_new(int, int, int, int, char *);
975extern int win2_box_new(int, int, int, int, char *);
976extern void resize_panel(PANEL *, int, int, int, int);
977extern void left_justify(char *s);
978extern void right_justify(char *, int);
979extern bool is_valid_date(int yyyy, int mm, int dd);
980extern bool is_valid_time(int hh, int mm, int ss);
981extern void numeric(char *d, char *s);
982extern int cf_accept(WINDOW *, char *, int, int, int);
983extern char *fill_field(char *, char *, char, int);
984#endif
int cmd_processor(Init *)
@ OT_INT
Definition common.h:85
@ OT_BOOL
Definition common.h:86
@ OT_HEX
Definition common.h:87
@ OT_STRING
Definition common.h:84
int popup_ckeys()
Display Curses Keys Responds to curses keys and mouse events, displaying the key code and description...
Definition curskeys.c:23
int process_config_file(char *, Init *)
Definition init.c:631
@ FORM
Definition common.h:77
@ MENU
Definition common.h:79
@ VIEW
Definition common.h:76
@ PICK
Definition common.h:78
int popup_form(Init *, int, char **, int, int)
instantiate a form popup window
Definition popups.c:112
@ OG_FILES
Definition common.h:92
@ OG_DIRS
Definition common.h:93
@ OG_SPECS
Definition common.h:94
@ OG_MISC
Definition common.h:95
@ OG_FLAGS
Definition common.h:97
@ OG_PARMS
Definition common.h:96
@ OG_COL
Definition common.h:98
void destroy_view_win(Init *)
Definition init_view.c:318
int popup_menu(Init *, int, char **, int, int)
instantiate a menu popup window
Definition popups.c:53
ViewStack view_stack
Definition init_view.c:34
int popup_view(Init *, int, char **, int, int, int, int)
instantiate a view popup window
Definition popups.c:144
int popup_pick(Init *, int, char **, int, int)
instantiate a pick popup window
Definition popups.c:83
char minitrc[MAXLEN]
int init_cnt
Definition mem.c:44
void destroy_line_table(View *)
cchar_t CC_YELLOW
Definition dwin.c:216
volatile sig_atomic_t sig_received
Definition sig.c:31
size_t rtrim(char *)
Trims trailing spaces from string s in place.
Definition futil.c:338
const wchar_t bw_chk
Definition dwin.c:152
bool handle_signal(sig_atomic_t)
int cp_box
Definition dwin.c:179
void win_Toggle_Attrs()
#define MAXWIN
Definition cm.h:37
const wchar_t bw_rt
Definition dwin.c:145
int cp_brackets
Definition dwin.c:190
const wchar_t bw_ho
Definition dwin.c:138
int cp_nt
Definition dwin.c:183
int n_cols
int mbegx
int cp_nt_hl
Definition dwin.c:185
int cp_ind
Definition dwin.c:180
cchar_t CC_DATA2
void curskeys(WINDOW *)
int clr_pair_cnt
Definition dwin.c:197
void sig_shell_mode()
WINDOW * win_win[MAXWIN]
Definition dwin.c:52
int cmenu_log_fd
Definition futil.c:54
cchar_t tl
Definition cm.h:501
void get_rfc3339_s(char *, size_t)
bool f_have_shell_tioctl
Definition scriou.c:24
void init_stdscr()
cchar_t chk
Definition cm.h:631
cchar_t CC_DATA1
cchar_t la
Definition cm.h:631
const wchar_t bw_tl
Definition dwin.c:140
const wchar_t bw_ua
Definition dwin.c:149
cchar_t CC_FILL_CHAR
Definition dwin.c:211
char em1[MAXLEN]
Definition dwin.c:176
PANEL * panel_win2[MAXWIN]
Definition dwin.c:55
cchar_t ua
Definition cm.h:631
int dbgfd
void mouse_getch(int *, int *, int *, int *)
int display_ok_message(char *)
int cp_title
Definition dwin.c:182
@ F_REG
Definition cm.h:239
@ F_BLK
Definition cm.h:237
@ F_FIFO
Definition cm.h:232
@ F_F0
Definition cm.h:231
@ F_F3
Definition cm.h:238
@ F_SOCK
Definition cm.h:243
@ F_CHR
Definition cm.h:233
@ F_F5
Definition cm.h:242
@ F_F1
Definition cm.h:234
@ F_DIR
Definition cm.h:235
@ F_UNKNOWN
Definition cm.h:245
@ F_F2
Definition cm.h:236
@ F_F4
Definition cm.h:240
@ F_LNK
Definition cm.h:241
@ F_F6
Definition cm.h:244
int tty_fd
Definition dwin.c:219
int cp_yellow
Definition dwin.c:193
#define KEY_ALTF0
Definition cm.h:502
int cp_default
WINDOW * win_win2[MAXWIN]
Definition dwin.c:51
cchar_t CC_DATA3
int clr_cnt
Definition dwin.c:195
void destroy_win(WINDOW *)
bool f_curses_open
Definition sig.c:33
cchar_t CC_BLUE
Definition dwin.c:217
int enter_option()
cchar_t da
Definition cm.h:631
void resize_panel(PANEL *, int, int, int, int)
#define CHYRON_KEYS
Definition cm.h:333
struct termios shell_tioctl curses_tioctl
Definition scriou.c:34
void dump_opts()
cchar_t br
Definition cm.h:501
WINDOW * mouse_win
Definition dwin.c:118
const wchar_t bw_tr
Definition dwin.c:141
int mg_line
cchar_t CC_NT
Definition dwin.c:204
cchar_t rs
Definition cm.h:501
char * stdio_names(char *, char *)
Definition futil.c:1064
const wchar_t bw_tt
void write_log(char *)
cchar_t lt
Definition cm.h:631
unsigned char uchar
Definition cm.h:648
int clr_pair_idx
Definition dwin.c:196
int cp_bold
cchar_t CC_GREEN
Definition dwin.c:215
cchar_t ran
Definition cm.h:631
bool verify_dir_q(char *, int)
const wchar_t bw_ran
Definition dwin.c:151
int cp_blue
Definition dwin.c:194
cchar_t CC_IND
Definition dwin.c:200
cchar_t CC_BRKTL
Definition cm.h:494
const wchar_t bw_sp
Definition dwin.c:146
String mk_string(size_t)
Create a String struct with a dynamically allocated string.
Definition futil.c:1543
int border_draw(WINDOW *)
Definition dwin.c:1236
const wchar_t bw_ra
Definition dwin.c:147
bool construct_file_spec(char *, char *, char *, char *, char *, int)
cchar_t CC_BOX
Definition dwin.c:199
int mcols
const wchar_t bw_cr
bool strnfill(char *, char, int)
const wchar_t bw_da
Definition dwin.c:150
cchar_t sp
Definition cm.h:631
cchar_t CC_TITLE
Definition dwin.c:203
int cp_red
Definition dwin.c:191
int mg_action
FILE * cmenu_log_fp
const wchar_t bw_lt
Definition dwin.c:144
#define XTERM_256COLOR
Definition cm.h:504
SCREEN * screen
Definition dwin.c:42
cchar_t bl
Definition cm.h:501
const wchar_t bw_la
Definition dwin.c:148
const wchar_t bw_bt
int click_x
Definition dwin.c:81
int cp_nt_hl_rev
Definition dwin.c:186
#define CHYRON_KEY_MAXLEN
Definition cm.h:330
bool verify_file_q(char *, int)
int src_line
Definition dwin.c:172
bool f_debug
cchar_t CC_RED
Definition dwin.c:214
char * src_name
Definition dwin.c:173
int box2_new(int, int, int, int, char *)
int cp_highlight
void dump_opts_by_use(char *, char *)
int open_log(char *)
int cp_cmdln_bg
int wait_timeout
Definition futil.c:152
PANEL * panel_win[MAXWIN]
Definition dwin.c:56
int win_attr_even
const wchar_t bw_bl
Definition dwin.c:142
char stdio_names_str[MAXLEN]
Definition futil.c:134
char errmsg[]
Definition futil.c:138
int win_ptr
Definition dwin.c:164
@ LF_EXC_REGEX
Definition cm.h:205
@ LF_HIDE
Definition cm.h:203
@ LF_ISUID
Definition cm.h:215
@ LF_IRUSR
Definition cm.h:213
@ LF_ICASE
Definition cm.h:204
@ LF_ISGID
Definition cm.h:214
@ LF_EXEC
Definition cm.h:207
@ LF_REGEX
Definition cm.h:206
@ LF_USER
Definition cm.h:208
@ LF_IXUSR
Definition cm.h:211
@ LF_IWUSR
Definition cm.h:212
int mlines
@ CLR_CMDLN_BG
Definition cm.h:187
@ CLR_FILL_CHAR_BG
Definition cm.h:183
@ CLR_BOX_BG
Definition cm.h:177
@ CLR_FILL_CHAR_FG
Definition cm.h:182
@ CLR_FG
Definition cm.h:174
@ CLR_RED
Definition cm.h:158
@ CLR_NT_FG
Definition cm.h:188
@ CLR_BRACKETS_FG
Definition cm.h:180
@ CLR_YELLOW
Definition cm.h:160
@ CLR_IND_FG
Definition cm.h:178
@ CLR_BCYAN
Definition cm.h:171
@ CLR_TITLE_FG
Definition cm.h:196
@ CLR_WHITE
Definition cm.h:164
@ CLR_MAGENTA
Definition cm.h:162
@ CLR_BRACKETS_BG
Definition cm.h:181
@ CLR_NT_REV_BG
Definition cm.h:191
@ CLR_BLACK
Definition cm.h:157
@ CLR_BWHITE
Definition cm.h:172
@ CLR_LN_BG
Definition cm.h:185
@ CLR_NT_HL_REV_BG
Definition cm.h:195
@ CLR_BBLACK
Definition cm.h:165
@ CLR_LN_FG
Definition cm.h:184
@ CLR_NT_HL_FG
Definition cm.h:192
@ CLR_BBLUE
Definition cm.h:169
@ CLR_BGREEN
Definition cm.h:167
@ CLR_BYELLOW
Definition cm.h:168
@ CLR_BMAGENTA
Definition cm.h:170
@ CLR_BORANGE
Definition cm.h:173
@ CLR_NT_HL_BG
Definition cm.h:193
@ CLR_NT_HL_REV_FG
Definition cm.h:194
@ CLR_BG
Definition cm.h:175
@ CLR_BOX_FG
Definition cm.h:176
@ CLR_NT_BG
Definition cm.h:189
@ CLR_TITLE_BG
Definition cm.h:197
@ CLR_BRED
Definition cm.h:166
@ CLR_NCOLORS
Definition cm.h:198
@ CLR_BLUE
Definition cm.h:161
@ CLR_IND_BG
Definition cm.h:179
@ CLR_GREEN
Definition cm.h:159
@ CLR_CMDLN_FG
Definition cm.h:186
@ CLR_NT_REV_FG
Definition cm.h:190
@ CLR_CYAN
Definition cm.h:163
void destroy_box(WINDOW *)
bool f_restore_screen
@ LF_FIFO
Definition cm.h:220
@ LF_DIR
Definition cm.h:222
@ LF_UNKNOWN
Definition cm.h:227
@ LF_SOCK
Definition cm.h:226
@ LF_BLK
Definition cm.h:223
@ LF_LNK
Definition cm.h:225
@ LF_REG
Definition cm.h:224
@ LF_CHR
Definition cm.h:221
int exit_code
Definition dwin.c:159
FILE * tty_fp
Definition dwin.c:43
#define COLOR_LEN
Definition cm.h:283
int cp_green
Definition dwin.c:192
int click_y
Definition dwin.c:80
int win_attr_odd
#define min(x, y)
min macro evaluates two expressions, returning least result
Definition cm.h:89
int n_lines
cchar_t CC_REVERSE
char em0[MAXLEN]
Definition dwin.c:175
cchar_t CC_NT_HL
Definition dwin.c:207
cchar_t ts
Definition cm.h:501
int mg_col
bool f_have_curses_tioctl
Definition scriou.c:25
char em3[MAXLEN]
Definition dwin.c:178
cchar_t CC_CMDLN
Definition dwin.c:202
PANEL * panel_box[MAXWIN]
Definition dwin.c:57
void w_mouse_getch(WINDOW *, int *, int *, int *, int *)
char const colors_text[][10]
Color names for .minitrc overrides.
Definition dwin.c:133
int mbegy
bool str_to_bool(const char *)
Converts String to boolean true or false.
Definition futil.c:941
int rgb_clr_to_cube(int)
#define __atexit
This macro registers the end_pgm function to be called when the program exits.
Definition cm.h:297
int cp_ln_fg
const wchar_t bw_ve
Definition dwin.c:139
cchar_t CC_NT_REV
Definition dwin.c:205
int cp_nt_rev
Definition dwin.c:184
struct termios shell_out_tioctl curses_out_tioctl
Definition scriou.c:36
char * stdio_fdnames(char *, char *)
Definition futil.c:1089
int cp_cmdln_fg
cchar_t tr
Definition cm.h:501
void user_end()
int display_curses_keys()
cchar_t ra
Definition cm.h:631
cchar_t ls
Definition cm.h:631
int win_attr
Definition dwin.c:162
cchar_t rt
Definition cm.h:631
WINDOW * win_box[MAXWIN]
Definition dwin.c:53
int cp_fill_char
Definition dwin.c:189
#define Ctrl(c)
Definition cm.h:52
char fn[MAXLEN]
Definition dwin.c:174
char em2[MAXLEN]
Definition dwin.c:177
char * fill_field(char *, char *, char, int)
Definition futil.c:1748
const wchar_t bw_br
Definition dwin.c:143
void display_argv_error_msg(char *, char **)
struct termios shell_in_tioctl curses_in_tioctl
Definition scriou.c:35
int cp_ln_bg
cchar_t bs
Definition cm.h:501
cchar_t CC_BRKTR
Definition cm.h:495
cchar_t CC_LN
Definition dwin.c:201
struct termios shell_err_tioctl curses_err_tioctl
Definition scriou.c:37
cchar_t CC_NT_HL_REV
Definition dwin.c:206
int clr_idx
#define TRUE
Definition iloan.c:19
#define FALSE
Definition iloan.c:18
#define MAXLEN
Definition curskeys.c:15
int cf_accept(WINDOW *win, char *accept_s, int flin, int fcol, int flen)
Accepts input for a field in a C-Menu window.
Definition cm_fields.c:51
bool f_erase_remainder
Definition cm_fields.c:39
struct termios shell_tioctl
Definition scriou.c:22
bool open_curses(SIO *)
Initialize NCurses and color settings.
Definition dwin.c:244
int border_title(WINDOW *, char *)
Draw a box with a title around the specified window.
Definition dwin.c:1327
int dxwgetch(WINDOW *, WINDOW *, WINDOW *, WINDOW *, WINDOW *, Chyron *, int)
Wrapper for wgetch that handles signals, mouse events, checks for clicks on the chyron line,...
Definition dwin.c:2180
int xwgetch(WINDOW *, Chyron *, int)
Wrapper for wgetch that handles signals, mouse events, checks for clicks on the chyron line,...
Definition dwin.c:2094
void restore_wins()
Restore all windows after a screen resize.
Definition dwin.c:1225
void win_del()
Delete the current window and its associated box window.
Definition dwin.c:1179
void check_panels(int)
Check and display the panels for a given window index.
Definition dwin.c:1090
void view_full_screen_resize(Init *)
Resize the full screen view and its components.
Definition init_view.c:140
void view_boxwin_resize(Init *)
Resize the current window and its box.
Definition init_view.c:346
int border_hsplit_text(WINDOW *, char *, int)
Draw a box with a separator line and text around the specified window.
Definition dwin.c:1289
int bare_box_new(int, int, int, int, char *)
Create a new window with optional box and title.
Definition dwin.c:981
int win_new(int, int)
Create a new window with specified dimensions and position.
Definition dwin.c:1037
int border_hsplit(WINDOW *, int)
Draw a box with a separator line around the specified window.
Definition dwin.c:1269
void win_init_attrs()
Initialize window attributes.
Definition dwin.c:226
void mvwaddstr_fill(WINDOW *, int, int, char *, int)
For lines shorter than their display area, fill the rest with spaces.
Definition dwin.c:1941
int box_new(int, int, int, int, char *)
Create a new window with optional box and title.
Definition dwin.c:967
int box_hsplit_new(int, int, int, int, int, char *)
Create a new window with optional box and title, and a second window inside it, split horizontally.
Definition dwin.c:925
int win2_new(int, int, int, int)
Create a new subwindow (win2) with specified dimensions and position.
Definition dwin.c:1066
int vgetch(WINDOW *, int)
Wrapper for wgetch that handles signals and mouse events, and accepts a single character answer.
Definition dwin.c:2258
void win_resize(int, int, char *)
Resize the current window and its box, and update the title.
Definition dwin.c:1128
void destroy_curses()
Gracefully shut down NCurses and restore terminal settings.
Definition dwin.c:670
void win_redraw(WINDOW *)
Redraw the specified window.
Definition dwin.c:1168
int win2_box_new(int, int, int, int, char *)
Create a new window with optional box and title, and a second window inside it.
Definition dwin.c:952
void initialize_local_colors(SIO *)
Initialize local color variables and color pairs based on SIO settings.
Definition dwin.c:320
void display_cmplx_str(WINDOW *, cchar_t *, int, int)
Display a complex character string on a window.
Definition dwin.c:857
RGB xterm256_idx_to_rgb(int)
Convert XTerm 256 color index to RGB.
Definition dwin.c:483
size_t str_to_cc(cchar_t *, const char *, attr_t, int, size_t)
Convert a multibyte string to an array of cchar_t complex characters.
Definition dwin.c:786
int clr_name_to_idx(char *)
Get color index from color name.
Definition dwin.c:1966
int rgb_to_curses_clr(RGB *)
Get color index for RGB color.
Definition dwin.c:432
size_t mk_cmplx_str(cchar_t *, char *, attr_t, int)
Convert a multibyte string to an array of cchar_t complex characters.
Definition dwin.c:828
bool init_clr_palette(SIO *)
Initialize color palette based on SIO settings.
Definition dwin.c:546
void apply_gamma(RGB *)
Apply gamma correction to RGB color.
Definition dwin.c:518
int rgb_to_xterm256_idx(RGB *)
Convert RGB color to XTerm 256 color index.
Definition dwin.c:461
cchar_t mkcc(int, attr_t, const char *)
Create a cchar_t with the specified color pair index.
Definition dwin.c:748
int get_clr_pair(int, int)
Get color pair index for foreground and background colors.
Definition dwin.c:401
WINDOW * message_win(char *)
Display a message in a window or print to stderr if curses is not available.
Definition dwin.c:1377
bool wait_destroy(Chyron *)
Destroy the waiting message window and chyron.
Definition dwin.c:1621
bool waitpid_with_timeout(pid_t, int)
Wait for a process to finish with a timeout and optional user cancellation.
Definition dwin.c:2033
bool action_disposition(char *eitle, char *action_str)
Display a simple action disposition message window or print to stderr.
Definition dwin.c:1651
int answer_yn(char *, char *, char *, char *)
Accept a single letter answer.
Definition dwin.c:1406
int wait_continue(WINDOW *, Chyron *, int)
Update the waiting message with remaining time and check for user input.
Definition dwin.c:1636
WINDOW * wait_mk_win(Chyron *, char *)
Display a popup waiting message.
Definition dwin.c:1589
int Perror(char *)
Display a simple error message window or print to stderr.
Definition dwin.c:1526
void abend(int, char *)
Abnormal program termination.
Definition dwin.c:2018
Chyron * wait_mk_chyron()
Create a Chyron struct for the waiting message.
Definition dwin.c:1576
int display_error(char *, char *, char *, char *)
Display an error message window or print to stderr.
Definition dwin.c:1467
bool is_set_chyron_key(Chyron *, int)
Check if function key label is set.
Definition dwin.c:1743
void set_chyron_key(Chyron *, int, char *, int)
Set chyron key with default color pair (cp_nt_rev).
Definition dwin.c:1783
void display_chyron(WINDOW *, Chyron *, int, int)
Display chyron on window.
Definition dwin.c:1892
Chyron * destroy_chyron(Chyron *chyron)
Destroy Chyron structure.
Definition dwin.c:1722
void activate_chyron_key(Chyron *, int)
Activate chyron key.
Definition dwin.c:1807
int get_chyron_key(Chyron *, int)
Get keycode from chyron.
Definition dwin.c:1917
void set_chyron_key_cp(Chyron *, int, char *, int, int)
Set chyron key with color pair (cp).
Definition dwin.c:1759
void compile_chyron(Chyron *)
construct the chyron string from the chyron structure
Definition dwin.c:1848
void activate_all_chyron_keys(Chyron *)
Deactivate chyron key.
Definition dwin.c:1816
void unset_chyron_key(Chyron *, int)
Unset chyron key.
Definition dwin.c:1798
void deactivate_all_chyron_keys(Chyron *)
Deactivate all chyron keys.
Definition dwin.c:1834
void deactivate_chyron_key(Chyron *, int)
Deactivate chyron key.
Definition dwin.c:1826
Chyron * new_chyron()
Create and initialize Chyron structure.
Definition dwin.c:1701
int fork_exec(char **)
Fork and exec a command.
Definition exec.c:126
int shell(char *)
Execute a shell command.
Definition exec.c:78
int full_screen_fork_exec(char **)
Execute a command in full screen mode.
Definition exec.c:46
int full_screen_shell(char *)
Execute a shell command in full screen mode.
Definition exec.c:62
int fork_detach_execvp(char **)
Fork, set new session ID, close files, and execute detached command.
Definition detach.c:29
void numeric(char *d, char *s)
Extract numeric characters from source string to destination string.
Definition fields.c:644
bool is_valid_date(int yyyy, int mm, int dd)
Check if a given date is valid, including leap years.
Definition fields.c:607
void left_justify(char *s)
Left justify string by removing leading spaces.
Definition fields.c:568
bool is_valid_time(int hh, int mm, int ss)
Check if a given time is valid.
Definition fields.c:628
void right_justify(char *, int)
Right justify string by removing trailing spaces and adding leadingspaces.
Definition fields.c:581
int init_form(Init *, int, char **, int, int)
Initialize form data structure and parse description file.
Definition form_engine.c:61
bool locate_file_in_path(char *, char *)
Locates a file in the system PATH.
Definition futil.c:1287
size_t canonicalize_file_spec(char *)
Removes quotes and trims at first space.
Definition futil.c:1341
size_t strnz__cpy(char *, const char *, size_t)
safer alternative to strncpy
Definition futil.c:544
int destroy_argv(int argc, char **argv)
Deallocates memory allocated for argument strings in argv.
Definition futil.c:494
bool parse_local_timestamp(const char *, time_t *)
Parses an ISO 8601 timestamp string in local time and converts it to time_t.
Definition futil.c:280
bool trim_ext(char *, char *)
trims the file extension from "filename" and copies the result to "buf"
Definition futil.c:1016
bool stripz_quotes(char *)
removes leading and trailing double quotes if present
Definition futil.c:733
void write_cmenu_log(char *)
Write message to C-Menu log file with timestamp.
Definition futil.c:1685
size_t trim(char *)
Trims leading and trailing spaces from string s in place.
Definition futil.c:391
char * get_local_timestamp()
Returns the current local time as an ISO 8601 formatted string.
Definition futil.c:314
bool is_directory(const char *)
Checks if the given path is a directory.
Definition futil.c:1372
bool file_spec_path(char *, char *)
extracts the path component of a file specification
Definition futil.c:870
bool str_to_upper(char *)
Converts a string to uppercase.
Definition futil.c:522
bool dir_name(char *, char *)
Returns the directory name of a file specification.
Definition futil.c:1149
double str_to_double(char *)
converts string to double
Definition futil.c:929
bool str_to_lower(char *)
Converts a string to lowercase.
Definition futil.c:508
size_t strnz(char *, size_t)
terminates string at New Line, Carriage Return, or max_len
Definition futil.c:615
size_t ssnprintf(char *, size_t, const char *,...)
ssnprintf was designed to be a safer alternative to snprintf.
Definition futil.c:420
bool expand_tilde(char *, int)
Replaces "~/" in string with the user's home directory.
Definition futil.c:970
bool strip_quotes(char *)
removes leading and trailing double quotes if present
Definition futil.c:718
bool is_valid_regex(const char *)
Checks if the given regular expression pattern is valid.
Definition futil.c:1400
void open_cmenu_log()
Open new C-Menu log file.
Definition futil.c:1667
char * strnz_dup(char *, size_t)
Allocates memory for and duplicates string s up to length l or until line feed or carriage return.
Definition futil.c:654
bool file_spec_name(char *, char *)
extracts the file name component of a file specification
Definition futil.c:897
size_t strip_ansi(char *, char *)
Strips ANSI SGR escape sequences (ending in 'm') from string s to d.
Definition futil.c:829
bool mk_dir(char *dir)
If directory doesn't exist, make it.
Definition futil.c:1320
int wccp_to_str(wchar_t, uint8_t *)
Converts a Unicode code point to a UTF-8 encoded string.
Definition dwin.c:871
size_t strnz__cat(char *, const char *, size_t)
safer alternative to strncat
Definition futil.c:573
bool str_subc(char *, char *, char, char *, int)
Replaces "ReplaceChr" in "s" with "Withstr" in "d" won't copy more than "l" bytes to "d" Replaces all...
Definition futil.c:690
bool get_argp_doc_by_name(char *comment, const struct argp_option *, const char *)
Retrieves the documentation string for a given key name from an argp options array.
Definition futil.c:176
bool verify_file(char *, int)
Verifies that the file specified by "in_spec" exists and is accessible with the permissions specified...
Definition futil.c:1240
char * rep_substring(const char *, const char *, const char *)
Replace all occurrences of "tgt_s" in "org_s" with "rep_s".
Definition futil.c:1440
bool is_symlink_to_dir(const char *)
Checks if the given path is a symbolic link to a directory.
Definition futil.c:1385
size_t strnlf(char *, size_t)
terminates string with line feed
Definition futil.c:633
int a_toi(char *, bool *)
a safer alternative to atoi() for converting ASCII strings to integers.
Definition futil.c:769
bool is_hex_str(char *, int)
Validates that a string consists of exactly len hexadecimal digits.
Definition futil.c:209
void write_cmenu_log_nt(char *)
Write message to C-Menu log file without timestamp.
Definition futil.c:1701
bool verify_dir(char *, int)
Verifies that the directory specified by "spec" exists and is accessible with the permissions specifi...
Definition futil.c:1189
bool chrep(char *, char, char)
Replaces all occurrences of old_chr in s with new_chr in place.
Definition futil.c:750
bool base_name(char *, char *)
Returns the base name of a file specification.
Definition futil.c:1123
char * get_ip_addresses(char *, int)
Retrieves the IP addresses of the local machine and formats them into a string.
Definition futil.c:354
bool normalize_file_spec(char *)
replace backslashes with forward lashes
Definition futil.c:853
char * format_local_timestamp(time_t, char *, size_t)
Formats a time_t as an ISO 8601 string in local time.
Definition futil.c:303
bool is_newer(char *, char *)
Checks if the file specified by "fut" is newer than the file specified by "control".
Definition futil.c:160
char * fdname(int, char *)
Retrieves the file path associated with a given file descriptor.
Definition futil.c:1054
int str_to_args(char **, char *, int)
Converts a string into an array of argument strings.
Definition futil.c:440
char * get_user_str(char *, size_t)
Retrieves the current user's name and UID, and formats it into a string.
Definition futil.c:327
bool trim_path(char *)
Trims trailing spaces and slashes from directory path in place.
Definition futil.c:988
unsigned long a_to_ul(const char *)
Converts a string to an unsigned long long integer, with support for suffixes K, M,...
Definition futil.c:793
bool unstr_hex_clr(char *, char *)
Validates that a string is a hex color code in the format "#RRGGBB".
Definition futil.c:232
char * iso8601_time(char *, int, time_t *, bool)
Formats a struct tm as an ISO 8601 string.
Definition futil.c:264
size_t string_cpy(String *, const String *)
Copy src String to dest String, allocating additional memory for dest String if necessary.
Definition futil.c:1577
String to_string(const char *)
String functions provide a simple string library to facilitate string manipulation in C,...
Definition futil.c:1523
size_t string_ncpy(String *, const String *, size_t)
copies up to n characters from src String to dest String, allocating additional memory for dest Strin...
Definition futil.c:1634
size_t string_cat(String *, const String *)
Concatenates src String to dest String, allocating additional memory for dest String if necessary.
Definition futil.c:1594
String free_string(String)
Free the dynamically allocated String.
Definition futil.c:1562
size_t string_ncat(String *, const String *, size_t)
Concatenates up to n characters from src String to dest String, allocating additional memory for dest...
Definition futil.c:1613
int segmentation_fault()
Function to intentionally cause a segmentation fault for testing purposes.
Definition futil.c:1659
int parse_opt_args(Init *, int, char **)
Parse command-line options and set Init struct values accordingly.
Definition init.c:559
bool derive_file_spec(char *, char *, char *)
Derive full file specification from directory and file name.
Definition init.c:1306
int write_config(Init *)
Write the current configuration to a file specified in init->minitrc.
Definition init.c:1049
void mapp_initialization(Init *, int, char **)
Main initialization function for MAPP - Menu Application.
Definition init.c:441
void zero_opt_args(Init *)
Initialize optional arguments in the Init struct to default values.
Definition init.c:574
void view_calc_boxwin_dimensions(Init *)
Calculate the dimensions and position of the box window for C-Menu View.
Definition init_view.c:362
int init_view_full_screen(Init *)
Initialize C-Menu View in full screen mode.
Definition init_view.c:49
int init_view_boxwin(Init *)
Initialize the C-Menu View in box window mode.
Definition init_view.c:194
void view_calc_full_screen_dimensions(Init *)
Calculate the dimensions for full screen mode.
Definition init_view.c:159
int view_init_input(Init *, char *)
Initialize the input for the C-Menu View.
Definition init_view.c:447
View * destroy_view(Init *init)
Destroy View structure.
Definition mem.c:356
Form * new_form(Init *, int, char **, int, int)
Create and initialize Form structure.
Definition mem.c:263
bool init_menu_files(Init *, int, char **)
Initialize Menu file specifications.
Definition mem.c:502
bool verify_spec_arg(char *, char *, char *, char *, int)
Verify file specification argument.
Definition mem.c:380
Init * new_init(int, char **)
Create and initialize Init structure.
Definition mem.c:71
Menu * new_menu(Init *, int, char **, int, int)
Create and initialize Menu structure.
Definition mem.c:145
Menu * destroy_menu(Init *init)
Destroy Menu structure.
Definition mem.c:166
Form * destroy_form(Init *init)
Destroy Form structure.
Definition mem.c:286
View * new_view(Init *)
Create and initialize View structure.
Definition mem.c:310
Pick * new_pick(Init *, int, char **, int, int)
Create and initialize Pick structure.
Definition mem.c:197
Init * destroy_init(Init *init)
Destroy Init structure.
Definition mem.c:106
Pick * destroy_pick(Init *init)
Destroy Pick structure.
Definition mem.c:236
unsigned int menu_engine(Init *)
The main loop of the menu system.
Definition menu_engine.c:38
unsigned int parse_menu_description(Init *)
Parse menu description file and create Menu.
int init_pick(Init *, int, char **, int, int)
Initializes pick structure and opens pick input file or pipe.
Definition pick_engine.c:66
int pick_engine(Init *)
Initializes pick interface, calculates window size and position, and enters picker loop.
int open_pick_win(Init *)
Initializes the pick window based on the parameters specified in the Pick structure.
bool capture_shell_tioctl()
capture_shell_tioctl() - capture shell terminal settings
Definition scriou.c:43
char di_getch()
get single character from terminal in raw mode
Definition scriou.c:148
bool restore_curses_tioctl()
restore_curses_tioctl() - restore curses terminal settings
Definition scriou.c:81
bool capture_curses_tioctl()
capture_curses_tioctl() - capture curses terminal settings
Definition scriou.c:68
bool mk_raw_tioctl(struct termios *)
mk_raw_tioctl() - set terminal to raw mode
Definition scriou.c:126
bool set_sane_tioctl(struct termios *)
set_sane_tioctl() - set terminal to sane settings for C-MENU
Definition scriou.c:95
bool restore_shell_tioctl()
restore_shell_tioctl() - restore shell terminal settings
Definition scriou.c:56
void sig_dfl_mode()
Set signal handlers to default behavior.
Definition sig.c:42
void signal_handler(int)
Signal handler for interrupt signals.
Definition sig.c:95
void sig_prog_mode()
Set up signal handlers for interrupt signals.
Definition sig.c:62
int view_file(Init *)
Start view.
bool view_stack_pop(ViewStack *, View *)
Pop Item from View Stack.
bool view_stack_peek(const ViewStack *, View *)
Peek at Top Item of View Stack.
void view_stack_free(ViewStack *)
Free View Stack.
int view_cmd_processor(Init *)
Main Command Processing Loop for View.
bool view_stack_init(ViewStack *, size_t)
Initialize View Stack.
void build_prompt(View *)
Build Prompt String.
bool view_stack_push(ViewStack *, View)
Push Item onto View Stack.
void initialize_line_table(View *)
Initialize Line Table.
void next_page(View *)
Advance to Next Page.
int pad_refresh(View *)
Refresh Pad and Line Number Window.
int display_prompt(View *, char *)
Display Command Line Prompt.
char title[MAXLEN]
Definition common.h:129
char mapp_data[MAXLEN]
Definition common.h:147
char minitrc[MAXLEN]
Definition common.h:173
bool f_out_spec
Definition common.h:170
char mapp_help[MAXLEN]
Definition common.h:148
int begx
Definition common.h:118
bool f_title
Definition common.h:165
char chyron_s[MAXLEN]
Definition common.h:128
SIO * sio
Definition common.h:114
int pick_cnt
Definition common.h:187
bool f_cmd_all
Definition common.h:164
Form * form
Definition common.h:184
char in_spec[MAXLEN]
Definition common.h:167
char cmd_all[MAXLEN]
Definition common.h:123
bool f_mapp_help
Definition common.h:156
bool f_mapp_msrc
Definition common.h:157
int argc
Definition common.h:130
bool f_cmd
Definition common.h:163
int prompt_type
Definition common.h:126
char about_fn[MAXLEN]
Definition common.h:174
char mapp_msrc[MAXLEN]
Definition common.h:149
int cols
Definition common.h:116
int menu_cnt
Definition common.h:183
int tab_stop
Definition common.h:180
bool f_mapp_home
Definition common.h:153
bool f_erase_remainder
Definition common.h:141
bool f_mapp_data
Definition common.h:154
bool f_read_theme
Definition common.h:142
bool f_mapp_desc
Definition common.h:160
char mapp_home[MAXLEN]
Definition common.h:146
bool f_mapp_user
Definition common.h:158
char prompt_str[MAXLEN]
Definition common.h:125
char fill_char[4]
Definition common.h:145
bool f_squeeze
Definition common.h:137
int begy
Definition common.h:117
char parent_cmd[MAXLEN]
Definition common.h:124
char mapp_spec[MAXLEN]
Definition common.h:175
char receiver_cmd[MAXLEN]
Definition common.h:121
int h_shift
Definition common.h:181
bool f_multiple_cmd_args
Definition common.h:139
int select_max
Definition common.h:178
bool f_ln
Definition common.h:143
bool f_mapp_spec
Definition common.h:155
char provider_cmd[MAXLEN]
Definition common.h:120
char out_spec[MAXLEN]
Definition common.h:168
bool f_strip_ansi
Definition common.h:136
View * view
Definition common.h:188
bool p_view_files
Definition common.h:134
Menu * menu
Definition common.h:182
bool f_at_end_remove
Definition common.h:135
int view_cnt
Definition common.h:189
char brackets[3]
Definition common.h:144
bool f_ignore_case
Definition common.h:133
char ** argv
Definition common.h:131
int lines
Definition common.h:115
char mapp_user[MAXLEN]
Definition common.h:150
char cmd[MAXLEN]
Definition common.h:122
char mapp_theme[MAXLEN]
Definition common.h:151
int optind
Definition common.h:132
bool f_help_spec
Definition common.h:166
bool f_receiver_cmd
Definition common.h:162
bool f_provider_cmd
Definition common.h:161
int form_cnt
Definition common.h:185
char help_spec[MAXLEN]
Definition common.h:176
char editor[MAXLEN]
Definition common.h:171
Pick * pick
Definition common.h:186
bool f_in_spec
Definition common.h:169
char menuapp[MAXLEN]
Definition common.h:172
int dd
Definition cm.h:58
int yyyy
Definition cm.h:56
int mm
Definition cm.h:57
int ss
Definition cm.h:64
int mm
Definition cm.h:63
int hh
Definition cm.h:62
char text[CHYRON_KEY_MAXLEN]
Definition cm.h:337
int end_pos
Definition cm.h:340
int cp
Definition cm.h:341
int keycode
Definition cm.h:339
bool active
Definition cm.h:336
int l
Definition cm.h:348
cchar_t cmplx_buf[MAXLEN]
Definition cm.h:347
char s[MAXLEN]
Definition cm.h:346
ChyronKey * key[CHYRON_KEYS]
Definition cm.h:345
int r
Definition cm.h:382
int b
Definition cm.h:382
int g
Definition cm.h:382
int pair_id
Definition cm.h:428
int fg
Definition cm.h:426
int bg
Definition cm.h:427
char * s
Definition cm.h:748
size_t l
Definition cm.h:749
Arg ** v
Definition cm.h:755
size_t n
Definition cm.h:757
size_t l
Definition cm.h:764
char * s
Definition cm.h:763
size_t l
allocated length
Definition cm.h:773
wchar_t * s
Definition cm.h:772
size_t l
Definition cm.h:785
cchar_t * s
Definition cm.h:784
char nt_hl_rev_bg[COLOR_LEN]
Definition cm.h:852
double green_gamma
Definition cm.h:807
char nt_rev_bg[COLOR_LEN]
Definition cm.h:846
char ln_fg[COLOR_LEN]
Definition cm.h:839
int cp_nt_hl_rev
Definition cm.h:873
char black[COLOR_LEN]
Definition cm.h:810
FILE * stdout_fp
Definition cm.h:857
char title_bg[COLOR_LEN]
Definition cm.h:854
double blue_gamma
Definition cm.h:808
int clr_idx
Definition cm.h:866
char bred[COLOR_LEN]
Definition cm.h:820
char yellow[COLOR_LEN]
Definition cm.h:813
int clr_cnt
Definition cm.h:864
char nt_hl_bg[COLOR_LEN]
Definition cm.h:848
int stdout_fd
Definition cm.h:861
char nt_hl_fg[COLOR_LEN]
Definition cm.h:847
char cmdln_bg[COLOR_LEN]
Definition cm.h:842
char abg[COLOR_LEN]
Definition cm.h:828
int stderr_fd
Definition cm.h:862
int cp_ln
Definition cm.h:879
int cp_box
Definition cm.h:874
FILE * stdin_fp
Definition cm.h:856
char ind_fg[COLOR_LEN]
Definition cm.h:833
char bcyan[COLOR_LEN]
Definition cm.h:825
char borange[COLOR_LEN]
Definition cm.h:827
double red_gamma
Definition cm.h:806
char red[COLOR_LEN]
Definition cm.h:811
char nt_fg[COLOR_LEN]
Definition cm.h:843
FILE * tty_fp
Definition cm.h:859
char magenta[COLOR_LEN]
Definition cm.h:815
char ln_bg[COLOR_LEN]
Definition cm.h:840
char bgreen[COLOR_LEN]
Definition cm.h:821
char nt_rev_fg[COLOR_LEN]
Definition cm.h:845
char brackets_fg[COLOR_LEN]
Definition cm.h:835
char fill_char_fg[COLOR_LEN]
Definition cm.h:837
int cp_bold
Definition cm.h:876
char byellow[COLOR_LEN]
Definition cm.h:822
char bwhite[COLOR_LEN]
Definition cm.h:826
char box_bg[COLOR_LEN]
Definition cm.h:832
char fg[COLOR_LEN]
Definition cm.h:829
char cyan[COLOR_LEN]
Definition cm.h:816
int cp_ind
Definition cm.h:875
int cp_default
Definition cm.h:868
char brackets_bg[COLOR_LEN]
Definition cm.h:836
FILE * stderr_fp
Definition cm.h:858
char box_fg[COLOR_LEN]
Definition cm.h:831
char tty_name[MAXLEN]
Definition cm.h:855
int cp_highlight
Definition cm.h:878
int cp_cmdln
Definition cm.h:880
int cp_title
Definition cm.h:877
char orange[COLOR_LEN]
Definition cm.h:818
int clr_pair_cnt
Definition cm.h:865
char fill_char_bg[COLOR_LEN]
Definition cm.h:838
char green[COLOR_LEN]
Definition cm.h:812
char white[COLOR_LEN]
Definition cm.h:817
char bg[COLOR_LEN]
Definition cm.h:830
char bblue[COLOR_LEN]
Definition cm.h:823
int tty_fd
Definition cm.h:863
char title_fg[COLOR_LEN]
Definition cm.h:853
char cmdln_fg[COLOR_LEN]
Definition cm.h:841
int cp_norm
Definition cm.h:869
char bmagenta[COLOR_LEN]
Definition cm.h:824
char blue[COLOR_LEN]
Definition cm.h:814
int cp_win
Definition cm.h:870
int cp_nt_rev
Definition cm.h:871
char nt_hl_rev_fg[COLOR_LEN]
Definition cm.h:850
int stdin_fd
Definition cm.h:860
double gray_gamma
Definition cm.h:809
char bblack[COLOR_LEN]
Definition cm.h:819
int clr_pair_idx
Definition cm.h:867
int cp_nt_hl
Definition cm.h:872
char ind_bg[COLOR_LEN]
Definition cm.h:834
char nt_bg[COLOR_LEN]
Definition cm.h:844