C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
cm.h File Reference

Headder for C-Menu API library, libcm.so. More...

#include "version.h"
#include <argp.h>
#include <ncursesw/ncurses.h>
#include <ncursesw/panel.h>
#include <signal.h>
#include <stddef.h>
#include <stdlib.h>
#include <time.h>
#include <ui_backend.h>
#include <wait.h>
#include <stdio.h>
Include dependency graph for cm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Arg
 The Arg structure represents a string argument with a pointer to the string and its allocated length. More...
struct  Argv
 The Argv structure represents an argument vector, which is an array of Arg structures, along with the number of allocated elements in the array. More...
struct  CCStr
 complex character objectl with a pointer to the complex character string and its allocated length More...
struct  Chyron
struct  ChyronKey
struct  ColorPair
struct  Date
struct  RGB
struct  SIO
 The SIO structure encapsulates various aspects of the terminal's state and configuration, including color management, file pointers, and terminal device information. More...
struct  String
 The String structure represents a string object with a pointer to the string and its allocated length. More...
struct  Time
struct  WCStr
 wide character string object with a pointer to the wide character string and its allocated length More...

Macros

#define __atexit
 This macro registers the end_pgm function to be called when the program exits.
#define _GNU_SOURCE
#define _XOPEN_SOURCE_EXTENDED   1
#define ABS(x)
 ABS macro for absolute value, which evaluates the expression once and returns the absolute value.
#define BG_COLOR   0
#define BO_COLOR   1
#define BW_BL   L'\x2514'
#define BW_BR   L'\x2518'
#define BW_BT   L'\x2534'
#define BW_CHK   L'\x2611'
#define BW_CR   L'\x253C'
#define BW_DA   L'\x2193'
#define BW_HO   L'\x2500'
#define BW_LA   L'\x2190'
#define BW_LAN   L'\x276E'
#define BW_LT   L'\x251C'
#define BW_RA   L'\x2192'
#define BW_RAN   L'\x276F'
#define BW_RBL   L'\x2570'
#define BW_RBR   L'\x256f'
#define BW_RT   L'\x2524'
#define BW_RTL   L'\x256d'
#define BW_RTR   L'\x256e'
#define BW_SP   L'\x20'
#define BW_TL   L'\x250C'
#define BW_TR   L'\x2510'
#define BW_TT   L'\x252C'
#define BW_UA   L'\x2191'
#define BW_VE   L'\x2502'
#define CHYRON_KEY_MAXLEN   64
#define CHYRON_KEYS   20
#define COLOR_LEN   8
#define Ctrl(c)
#define DEFAULTSHELL   "/bin/bash"
#define DIV_ROUND_UP(n, d)
#define F_NO_STDERR   1
#define FG_COLOR   2
#define KEY_ALTDEL   0x20e
#define KEY_ALTDOWN   0x214
#define KEY_ALTEND   0x219
#define KEY_ALTF(n)
#define KEY_ALTF0   0x138
#define KEY_ALTHOME   0x21e
#define KEY_ALTINS   0x223
#define KEY_ALTLEFT   0x228
#define KEY_ALTPGDN   0x22d
#define KEY_ALTPGUP   0x232
#define KEY_ALTRIGHT   0x237
#define KEY_ALTUP   0x23d
#define LN_BG_COLOR   7
#define LN_COLOR   4
#define MAX(a, b)
 MIN macro for compatibility with code that uses the same name, while avoiding multiple evaluations of the arguments.
#define max(a, b)
 max macro evaluates two expressions, returning greatest result.
#define MAX_ARGS   64
#define MAX_DEPTH   3
#define MAXARGS   64
#define MAXLEN   256
#define MAXWIN   30
#define MAXWIN   30
#define MIN(x, y)
 MAX macro for compatibility with code that uses the same name, while avoiding multiple evaluations of the arguments.
#define min(x, y)
 min macro evaluates two expressions, returning least result
#define NCURSES_WIDECHAR   1
#define nullptr   NULL
#define S_QUIET   0x2000
#define S_TOLOWER(c)
#define S_TOUPPER(c)
#define S_WCOK   0x1000
#define SCR_COLS   1024
#define SCREEN_MAX_LINES   100
#define to_lowercase(c)
#define to_uppercase(c)
#define to_uppercase(c)
#define XTERM_256COLOR

Typedefs

typedef unsigned char uchar

Enumerations

enum  ColorsEnum {
  CLR_BLACK , CLR_RED , CLR_GREEN , CLR_YELLOW ,
  CLR_BLUE , CLR_MAGENTA , CLR_CYAN , CLR_WHITE ,
  CLR_BBLACK , CLR_BRED , CLR_BGREEN , CLR_BYELLOW ,
  CLR_BBLUE , CLR_BMAGENTA , CLR_BCYAN , CLR_BWHITE ,
  CLR_BORANGE , CLR_FG , CLR_BG , CLR_BOX_FG ,
  CLR_BOX_BG , CLR_IND_FG , CLR_IND_BG , CLR_BRACKETS_FG ,
  CLR_BRACKETS_BG , CLR_FILL_CHAR_FG , CLR_FILL_CHAR_BG , CLR_LN_FG ,
  CLR_LN_BG , CLR_CMDLN_FG , CLR_CMDLN_BG , CLR_NT_FG ,
  CLR_NT_BG , CLR_NT_REV_FG , CLR_NT_REV_BG , CLR_NT_HL_FG ,
  CLR_NT_HL_BG , CLR_NT_HL_REV_FG , CLR_NT_HL_REV_BG , CLR_TITLE_FG ,
  CLR_TITLE_BG , CLR_NCOLORS
}
 Used for xterm256 color conversions. More...
enum  F_Type {
  F_F0 , F_FIFO , F_CHR , F_F1 ,
  F_DIR , F_F2 , F_BLK , F_F3 ,
  F_REG , F_F4 , F_LNK , F_F5 ,
  F_SOCK , F_F6 , F_UNKNOWN
}
enum  LFFlags {
  LF_HIDE = 0b00000001 , LF_ICASE = 0b00000010 , LF_EXC_REGEX = 0b00000100 , LF_REGEX = 0b00001000 ,
  LF_EXEC = 0b00010000 , LF_USER = 0b00100000 , LF_IXUSR = 0b00000001 , LF_IWUSR = 0b00000010 ,
  LF_IRUSR = 0b00000100 , LF_ISGID = 0b00010000 , LF_ISUID = 0b00100000
}
enum  LFTypes {
  LF_FIFO = 0b00000001 , LF_CHR = 0b00000010 , LF_DIR = 0b00000100 , LF_BLK = 0b00001000 ,
  LF_REG = 0b00010000 , LF_LNK = 0b00100000 , LF_SOCK = 0b01000000 , LF_UNKNOWN = 0b10000000
}

Functions

unsigned long a_to_ul (const char *)
 Converts a string to an unsigned long long integer, with support for suffixes K, M, and G for kilobytes, megabytes, and gigabytes respectively.
int a_toi (char *, bool *)
 a safer alternative to atoi() for converting ASCII strings to integers.
void abend (int, char *)
 Abnormal program termination.
bool action_disposition (char *eitle, char *action_str)
 Display a simple action disposition message window or print to stderr.
void activate_all_chyron_keys (Chyron *)
 Deactivate chyron key.
void activate_chyron_key (Chyron *, int)
 Activate chyron key.
int answer_yn (char *, char *, char *, char *)
 Accept a single letter answer.
void apply_gamma (RGB *)
 Apply gamma correction to RGB color.
int bare_box_new (int, int, int, int, char *)
 Create a new window with optional box and title.
bool base_name (char *, char *)
 Returns the base name of a file specification.
int border_draw (WINDOW *)
int border_hsplit (WINDOW *, int)
 Draw a box with a separator line around the specified window.
int border_hsplit_text (WINDOW *, char *, int)
 Draw a box with a separator line and text around the specified window.
int border_title (WINDOW *, char *)
 Draw a box with a title around the specified window.
int box2_new (int, int, int, int, char *)
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.
int box_new (int, int, int, int, char *)
 Create a new window with optional box and title.
size_t canonicalize_file_spec (char *)
 Removes quotes and trims at first space.
bool capture_curses_tioctl ()
 capture_curses_tioctl() - capture curses terminal settings
bool capture_shell_tioctl ()
 capture_shell_tioctl() - capture shell terminal settings
int cf_accept (WINDOW *, char *, int, int, int)
 Accepts input for a field in a C-Menu window.
void check_panels (int)
 Check and display the panels for a given window index.
bool chrep (char *, char, char)
 Replaces all occurrences of old_chr in s with new_chr in place.
int clr_name_to_idx (char *)
 Get color index from color name.
void compile_chyron (Chyron *)
 construct the chyron string from the chyron structure
bool construct_file_spec (char *, char *, char *, char *, char *, int)
void curskeys (WINDOW *)
void deactivate_all_chyron_keys (Chyron *)
 Deactivate all chyron keys.
void deactivate_chyron_key (Chyron *, int)
 Deactivate chyron key.
int destroy_argv (int argc, char **argv)
 Deallocates memory allocated for argument strings in argv.
void destroy_box (WINDOW *)
Chyrondestroy_chyron (Chyron *chyron)
 Destroy Chyron structure.
void destroy_curses ()
 Gracefully shut down NCurses and restore terminal settings.
void destroy_win (WINDOW *)
char di_getch ()
 get single character from terminal in raw mode
bool dir_name (char *, char *)
 Returns the directory name of a file specification.
void display_argv_error_msg (char *, char **)
void display_chyron (WINDOW *, Chyron *, int, int)
 Display chyron on window.
void display_cmplx_str (WINDOW *, cchar_t *, int, int)
 Display a complex character string on a window.
int display_curses_keys ()
int display_error (char *, char *, char *, char *)
 Display an error message window or print to stderr.
int display_ok_message (char *)
void dump_opts ()
void dump_opts_by_use (char *, char *)
int dxwgetch (WINDOW *, WINDOW *, WINDOW *, WINDOW *, WINDOW *, Chyron *, int)
 Wrapper for wgetch that handles signals, mouse events, checks for clicks on the chyron line, and accepts a sinigle character answer.
int enter_option ()
bool expand_tilde (char *, int)
 Replaces "~/" in string with the user's home directory.
char * fdname (int, char *)
 Retrieves the file path associated with a given file descriptor.
bool file_spec_name (char *, char *)
 extracts the file name component of a file specification
bool file_spec_path (char *, char *)
 extracts the path component of a file specification
char * fill_field (char *, char *, char, int)
int fork_detach_execvp (char **)
 Fork, set new session ID, close files, and execute detached command.
int fork_exec (char **)
 Fork and exec a command.
char * format_local_timestamp (time_t, char *, size_t)
 Formats a time_t as an ISO 8601 string in local time.
String free_string (String)
 Free the dynamically allocated String.
int full_screen_fork_exec (char **)
 Execute a command in full screen mode.
int full_screen_shell (char *)
 Execute a shell command in full screen mode.
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.
int get_chyron_key (Chyron *, int)
 Get keycode from chyron.
int get_clr_pair (int, int)
 Get color pair index for foreground and background colors.
char * get_ip_addresses (char *, int)
 Retrieves the IP addresses of the local machine and formats them into a string.
char * get_local_timestamp ()
 Returns the current local time as an ISO 8601 formatted string.
void get_rfc3339_s (char *, size_t)
char * get_user_str (char *, size_t)
 Retrieves the current user's name and UID, and formats it into a string.
bool handle_signal (sig_atomic_t)
bool init_clr_palette (SIO *)
 Initialize color palette based on SIO settings.
void init_stdscr ()
bool is_directory (const char *)
 Checks if the given path is a directory.
bool is_hex_str (char *, int)
 Validates that a string consists of exactly len hexadecimal digits.
bool is_newer (char *, char *)
 Checks if the file specified by "fut" is newer than the file specified by "control".
bool is_set_chyron_key (Chyron *, int)
 Check if function key label is set.
bool is_symlink_to_dir (const char *)
 Checks if the given path is a symbolic link to a directory.
bool is_valid_date (int yyyy, int mm, int dd)
 Check if a given date is valid, including leap years.
bool is_valid_regex (const char *)
 Checks if the given regular expression pattern is valid.
bool is_valid_time (int hh, int mm, int ss)
 Check if a given time is valid.
char * iso8601_time (char *, int, time_t *, bool)
 Formats a struct tm as an ISO 8601 string.
void left_justify (char *s)
 Left justify string by removing leading spaces.
bool locate_file_in_path (char *, char *)
 Locates a file in the system PATH.
WINDOW * message_win (char *)
 Display a message in a window or print to stderr if curses is not available.
size_t mk_cmplx_str (cchar_t *, char *, attr_t, int)
 Convert a multibyte string to an array of cchar_t complex characters.
bool mk_dir (char *dir)
 If directory doesn't exist, make it.
bool mk_raw_tioctl (struct termios *)
 mk_raw_tioctl() - set terminal to raw mode
String mk_string (size_t)
 Create a String struct with a dynamically allocated string.
cchar_t mkcc (int, attr_t, const char *)
 Create a cchar_t with the specified color pair index.
void mouse_getch (int *, int *, int *, int *)
void mvwaddstr_fill (WINDOW *, int, int, char *, int)
 For lines shorter than their display area, fill the rest with spaces.
Chyronnew_chyron ()
 Create and initialize Chyron structure.
bool normalize_file_spec (char *)
 replace backslashes with forward lashes
void numeric (char *d, char *s)
 Extract numeric characters from source string to destination string.
void open_cmenu_log ()
 Open new C-Menu log file.
bool open_curses (SIO *)
 Initialize NCurses and color settings.
int open_log (char *)
bool parse_local_timestamp (const char *, time_t *)
 Parses an ISO 8601 timestamp string in local time and converts it to time_t.
int Perror (char *)
 Display a simple error message window or print to stderr.
char * rep_substring (const char *, const char *, const char *)
 Replace all occurrences of "tgt_s" in "org_s" with "rep_s".
void resize_panel (PANEL *, int, int, int, int)
bool restore_curses_tioctl ()
 restore_curses_tioctl() - restore curses terminal settings
bool restore_shell_tioctl ()
 restore_shell_tioctl() - restore shell terminal settings
void restore_wins ()
 Restore all windows after a screen resize.
int rgb_clr_to_cube (int)
int rgb_to_curses_clr (RGB *)
 Get color index for RGB color.
int rgb_to_xterm256_idx (RGB *)
 Convert RGB color to XTerm 256 color index.
void right_justify (char *, int)
 Right justify string by removing trailing spaces and adding leadingspaces.
size_t rtrim (char *)
 Trims trailing spaces from string s in place.
int segmentation_fault ()
 Function to intentionally cause a segmentation fault for testing purposes.
void set_chyron_key (Chyron *, int, char *, int)
 Set chyron key with default color pair (cp_nt_rev).
void set_chyron_key_cp (Chyron *, int, char *, int, int)
 Set chyron key with color pair (cp).
bool set_sane_tioctl (struct termios *)
 set_sane_tioctl() - set terminal to sane settings for C-MENU
int shell (char *)
 Execute a shell command.
void sig_dfl_mode ()
 Set signal handlers to default behavior.
void sig_prog_mode ()
 Set up signal handlers for interrupt signals.
void sig_shell_mode ()
void signal_handler (int)
 Signal handler for interrupt signals.
size_t ssnprintf (char *, size_t, const char *,...)
 ssnprintf was designed to be a safer alternative to snprintf.
char * stdio_fdnames (char *, char *)
char * stdio_names (char *, char *)
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 occurrences of a character in a string with another string, copying the result to a destination buffer.
int str_to_args (char **, char *, int)
 Converts a string into an array of argument strings.
bool str_to_bool (const char *)
 Converts String to boolean true or false.
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.
double str_to_double (char *)
 converts string to double
bool str_to_lower (char *)
 Converts a string to lowercase.
bool str_to_upper (char *)
 Converts a string to uppercase.
size_t string_cat (String *, const String *)
 Concatenates src String to dest String, allocating additional memory for dest String if necessary.
size_t string_cpy (String *, const String *)
 Copy src String to dest String, allocating additional memory for dest String if necessary.
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 String if necessary.
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 String if necessary
size_t strip_ansi (char *, char *)
 Strips ANSI SGR escape sequences (ending in 'm') from string s to d.
bool strip_quotes (char *)
 removes leading and trailing double quotes if present
bool stripz_quotes (char *)
 removes leading and trailing double quotes if present
bool strnfill (char *, char, int)
size_t strnlf (char *, size_t)
 terminates string with line feed
size_t strnz (char *, size_t)
 terminates string at New Line, Carriage Return, or max_len
size_t strnz__cat (char *, const char *, size_t)
 safer alternative to strncat
size_t strnz__cpy (char *, const char *, size_t)
 safer alternative to strncpy
char * strnz_dup (char *, size_t)
 Allocates memory for and duplicates string s up to length l or until line feed or carriage return.
String to_string (const char *)
 String functions provide a simple string library to facilitate string manipulation in C, allowing developers to easily create, copy, concatenate, and free strings without having to manage memory manually.
size_t trim (char *)
 Trims leading and trailing spaces from string s in place.
bool trim_ext (char *, char *)
 trims the file extension from "filename" and copies the result to "buf"
bool trim_path (char *)
 Trims trailing spaces and slashes from directory path in place.
void unset_chyron_key (Chyron *, int)
 Unset chyron key.
bool unstr_hex_clr (char *, char *)
 Validates that a string is a hex color code in the format "#RRGGBB".
void user_end ()
bool verify_dir (char *, int)
 Verifies that the directory specified by "spec" exists and is accessible with the permissions specified by "imode".
bool verify_dir_q (char *, int)
bool verify_file (char *, int)
 Verifies that the file specified by "in_spec" exists and is accessible with the permissions specified by "imode".
bool verify_file_q (char *, int)
bool verify_spec_arg (char *, char *, char *, char *, int)
 Verify file specification argument.
int vgetch (WINDOW *, int)
 Wrapper for wgetch that handles signals and mouse events, and accepts a single character answer.
void w_mouse_getch (WINDOW *, int *, int *, int *, int *)
int wait_continue (WINDOW *, Chyron *, int)
 Update the waiting message with remaining time and check for user input.
bool wait_destroy (Chyron *)
 Destroy the waiting message window and chyron.
Chyronwait_mk_chyron ()
 Create a Chyron struct for the waiting message.
WINDOW * wait_mk_win (Chyron *, char *)
 Display a popup waiting message.
bool waitpid_with_timeout (pid_t, int)
 Wait for a process to finish with a timeout and optional user cancellation.
int wccp_to_str (wchar_t, uint8_t *)
 Converts a Unicode code point to a UTF-8 encoded string.
int win2_box_new (int, int, int, int, char *)
 Create a new window with optional box and title, and a second window inside it.
int win2_new (int, int, int, int)
 Create a new subwindow (win2) with specified dimensions and position.
void win_del ()
 Delete the current window and its associated box window.
void win_init_attrs ()
 Initialize window attributes.
int win_new (int, int)
 Create a new window with specified dimensions and position.
void win_redraw (WINDOW *)
 Redraw the specified window.
void win_resize (int, int, char *)
 Resize the current window and its box, and update the title.
void win_Toggle_Attrs ()
void write_cmenu_log (char *)
 Write message to C-Menu log file with timestamp.
void write_cmenu_log_nt (char *)
 Write message to C-Menu log file without timestamp.
void write_log (char *)
RGB xterm256_idx_to_rgb (int)
 Convert XTerm 256 color index to RGB.
int xwgetch (WINDOW *, Chyron *, int)
 Wrapper for wgetch that handles signals, mouse events, checks for clicks on the chyron line, and accepts a sinigle character answer.

Variables

cchar_t bl
cchar_t br
cchar_t bs
const wchar_t bw_bl
const wchar_t bw_br
const wchar_t bw_bt
const wchar_t bw_chk
const wchar_t bw_cr
const wchar_t bw_da
const wchar_t bw_ho
const wchar_t bw_la
const wchar_t bw_lt
const wchar_t bw_ra
const wchar_t bw_ran
const wchar_t bw_rt
const wchar_t bw_sp
const wchar_t bw_tl
const wchar_t bw_tr
const wchar_t bw_tt
const wchar_t bw_ua
const wchar_t bw_ve
cchar_t CC_BLUE
cchar_t CC_BOX
cchar_t CC_BRKTL
cchar_t CC_BRKTR
cchar_t CC_CMDLN
cchar_t CC_DATA1
cchar_t CC_DATA2
cchar_t CC_DATA3
cchar_t CC_FILL_CHAR
cchar_t CC_GREEN
cchar_t CC_IND
cchar_t CC_LN
cchar_t CC_NT
cchar_t CC_NT_HL
cchar_t CC_NT_HL_REV
cchar_t CC_NT_REV
cchar_t CC_RED
cchar_t CC_REVERSE
cchar_t CC_TITLE
cchar_t CC_YELLOW
cchar_t chk
int click_x
int click_y
int clr_cnt
int clr_idx
int clr_pair_cnt
int clr_pair_idx
int cmenu_log_fd
FILE * cmenu_log_fp
char const colors_text [][10]
 Color names for .minitrc overrides.
int cp_blue
int cp_bold
int cp_box
int cp_brackets
int cp_cmdln_bg
int cp_cmdln_fg
int cp_default
int cp_fill_char
int cp_green
int cp_highlight
int cp_ind
int cp_ln_bg
int cp_ln_fg
int cp_nt
int cp_nt_hl
int cp_nt_hl_rev
int cp_nt_rev
int cp_red
int cp_title
int cp_yellow
struct termios shell_err_tioctl curses_err_tioctl
struct termios shell_in_tioctl curses_in_tioctl
struct termios shell_out_tioctl curses_out_tioctl
struct termios shell_tioctl curses_tioctl
cchar_t da
int dbgfd
char em0 [MAXLEN]
char em1 [MAXLEN]
char em2 [MAXLEN]
char em3 [MAXLEN]
char errmsg []
int exit_code
bool f_curses_open
bool f_debug
bool f_have_curses_tioctl
bool f_have_shell_tioctl
bool f_restore_screen
char fn [MAXLEN]
cchar_t la
cchar_t ls
cchar_t lt
int mbegx
int mbegy
int mcols
int mg_action
int mg_col
int mg_line
int mlines
WINDOW * mouse_win
int n_cols
int n_lines
PANEL * panel_box [MAXWIN]
PANEL * panel_win [MAXWIN]
PANEL * panel_win2 [MAXWIN]
cchar_t ra
cchar_t ran
cchar_t rs
cchar_t rt
SCREEN * screen
volatile sig_atomic_t sig_received
cchar_t sp
int src_line
char * src_name
char stdio_names_str [MAXLEN]
cchar_t tl
cchar_t tr
cchar_t ts
int tty_fd
FILE * tty_fp
cchar_t ua
int wait_timeout
int win_attr
int win_attr_even
int win_attr_odd
WINDOW * win_box [MAXWIN]
int win_ptr
WINDOW * win_win [MAXWIN]
WINDOW * win_win2 [MAXWIN]

Detailed Description

Headder for C-Menu API library, libcm.so.

Author
Bill Waller Copyright (c) 2025 MIT License billx.nosp@m.wall.nosp@m.er@gm.nosp@m.ail..nosp@m.com
Date
2026-02-09

Definition in file cm.h.

Macro Definition Documentation

◆ __atexit

#define __atexit
Value:
{ \
int rc; \
rc = atexit(end_pgm); \
if (rc != 0) { \
fprintf(stderr, "\nCannot set exit function\n"); \
exit(EXIT_FAILURE); \
} \
}

This macro registers the end_pgm function to be called when the program exits.

It checks the return value of atexit() to ensure that the registration was successful, and if not, it prints an error message and exits with a failure status. Programs using libcm should call __atexit in their main function to ensure that the end_pgm function is registered to be called on program exit. This will help ensure that the terminal is properly restored to its original state, even if the program encounters an error or is terminated unexpectedly.

Definition at line 297 of file cm.h.

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 }

◆ _GNU_SOURCE

#define _GNU_SOURCE

Definition at line 13 of file cm.h.

◆ _XOPEN_SOURCE_EXTENDED

#define _XOPEN_SOURCE_EXTENDED   1

Enable wide character support

Definition at line 14 of file cm.h.

◆ ABS

#define ABS ( x)
Value:
({ \
__typeof__(x) _a = (x); \
_a < 0 ? -_a : _a; \
})

ABS macro for absolute value, which evaluates the expression once and returns the absolute value.

This macro uses a compound statement to create a local scope for the temporary variable _a, which stores the value of x. This ensures that if x has side effects (such as being incremented), it will only be evaluated once when the macro is expanded. The use of typeof allows the macro to work with any data type that supports comparison with zero and negation.

Definition at line 137 of file cm.h.

137#define ABS(x) \
138 ({ \
139 __typeof__(x) _a = (x); \
140 _a < 0 ? -_a : _a; \
141 })

◆ BG_COLOR

#define BG_COLOR   0

default background color

Definition at line 386 of file cm.h.

◆ BO_COLOR

#define BO_COLOR   1

default bold foreground color

Definition at line 387 of file cm.h.

◆ BW_BL

#define BW_BL   L'\x2514'

bottom left

Definition at line 584 of file cm.h.

◆ BW_BR

#define BW_BR   L'\x2518'

bottom right

Definition at line 585 of file cm.h.

◆ BW_BT

#define BW_BT   L'\x2534'

bottom tee

Definition at line 594 of file cm.h.

◆ BW_CHK

#define BW_CHK   L'\x2611'

left_angle

Definition at line 603 of file cm.h.

◆ BW_CR

#define BW_CR   L'\x253C'

cross

Definition at line 593 of file cm.h.

◆ BW_DA

#define BW_DA   L'\x2193'

large down arrow

Definition at line 599 of file cm.h.

◆ BW_HO

#define BW_HO   L'\x2500'

UNICODE BOX DRAWING SYMBOLS horizontal line

Definition at line 580 of file cm.h.

◆ BW_LA

#define BW_LA   L'\x2190'

large left arrow

Definition at line 597 of file cm.h.

◆ BW_LAN

#define BW_LAN   L'\x276E'

left_angle

Definition at line 601 of file cm.h.

◆ BW_LT

#define BW_LT   L'\x251C'

left tee

Definition at line 590 of file cm.h.

◆ BW_RA

#define BW_RA   L'\x2192'

large right arrow

Definition at line 596 of file cm.h.

◆ BW_RAN

#define BW_RAN   L'\x276F'

right_angle

Definition at line 600 of file cm.h.

◆ BW_RBL

#define BW_RBL   L'\x2570'

rounded bottom left

Definition at line 588 of file cm.h.

◆ BW_RBR

#define BW_RBR   L'\x256f'

rounded bottom right

Definition at line 589 of file cm.h.

◆ BW_RT

#define BW_RT   L'\x2524'

right tee

Definition at line 592 of file cm.h.

◆ BW_RTL

#define BW_RTL   L'\x256d'

rounded top left

Definition at line 586 of file cm.h.

◆ BW_RTR

#define BW_RTR   L'\x256e'

rounded top right

Definition at line 587 of file cm.h.

◆ BW_SP

#define BW_SP   L'\x20'

space

Definition at line 595 of file cm.h.

◆ BW_TL

#define BW_TL   L'\x250C'

top left

Definition at line 582 of file cm.h.

◆ BW_TR

#define BW_TR   L'\x2510'

top right

Definition at line 583 of file cm.h.

◆ BW_TT

#define BW_TT   L'\x252C'

top tee

Definition at line 591 of file cm.h.

◆ BW_UA

#define BW_UA   L'\x2191'

large up arrow

Definition at line 598 of file cm.h.

◆ BW_VE

#define BW_VE   L'\x2502'

vertical line

Definition at line 581 of file cm.h.

◆ CHYRON_KEY_MAXLEN

#define CHYRON_KEY_MAXLEN   64

maximum length of the command text for a key \ binding in the chyron

Definition at line 330 of file cm.h.

330#define CHYRON_KEY_MAXLEN \
331 64

◆ CHYRON_KEYS

#define CHYRON_KEYS   20

maximum number of key bindings for the chyron

Definition at line 333 of file cm.h.

◆ COLOR_LEN

#define COLOR_LEN   8
              Include     Exclude
             ----------  ----------

LF_FIFO 1 0 00000001 7 11111110 named pipe LF_CHR 2 1 00000010 6 11111101 character device LF_DIR 4 2 00000100 5 11111011 directory LF_BLK 8 3 00001000 4 11110111 block device LF_REG 16 4 00010000 3 11101111 regular file LF_LNK 32 5 00100000 2 11011111 link LF_SOCK 64 6 01000000 1 10111111 socket LF_UNKNOWN 128 7 10000000 0 01111111 unknown length of color code strings

Definition at line 283 of file cm.h.

◆ Ctrl

#define Ctrl ( c)
Value:

Definition at line 52 of file cm.h.

◆ DEFAULTSHELL

#define DEFAULTSHELL   "/bin/bash"

Definition at line 284 of file cm.h.

◆ DIV_ROUND_UP

#define DIV_ROUND_UP ( n,
d )
Value:

Definition at line 67 of file cm.h.

◆ F_NO_STDERR

#define F_NO_STDERR   1

Definition at line 268 of file cm.h.

◆ FG_COLOR

#define FG_COLOR   2

default foreground color

Definition at line 385 of file cm.h.

◆ KEY_ALTDEL

#define KEY_ALTDEL   0x20e

Definition at line 559 of file cm.h.

◆ KEY_ALTDOWN

#define KEY_ALTDOWN   0x214

Definition at line 564 of file cm.h.

◆ KEY_ALTEND

#define KEY_ALTEND   0x219

Definition at line 560 of file cm.h.

◆ KEY_ALTF

#define KEY_ALTF ( n)
Value:

define alt function keys

Definition at line 503 of file cm.h.

◆ KEY_ALTF0

#define KEY_ALTF0   0x138

Definition at line 502 of file cm.h.

◆ KEY_ALTHOME

#define KEY_ALTHOME   0x21e

Definition at line 557 of file cm.h.

◆ KEY_ALTINS

#define KEY_ALTINS   0x223

EXTENDED NCURSES KEYS

Key code bindings are customarily defined in terminfo. xterm-256color tends to be the most complete, and indeed, it seems to work with Ghostty, Kitty, and Alacritty. If you want to use the altkey bindings, you may need to set your terminal's TERM environment variable to xterm-256color. Here's why:

Ghostty, Kitty, and Alacritty all come with their own terminfo files:

Ghostty with xterm-ghostty, Kitty with xterm-kitty, and Alacritty with alacritty

None of the three produced the correct extended altkey bindings when paired with the terminfo provided in their distribution, yet all three worked with xterm-256color.

The extended altkeys were not defined in any of the terminfo files, not even xterm-256color. Yet, xterm-256color produced consistent keycode bindings with all three emulators. The standard key bindings, ins, delete, up, down arrows, etc., were the same for all three terminfos, and all three emulators produced the correct key bindings for those keys.

The fact that xterm-256color produced consistent keycode bindings for the altkeys, while the other three terminfos did not, is likely due to the fact that xterm-256color is more widely used and has better support for extended key bindings, even if they are not explicitly defined in the terminfo file. It's possible that xterm-256color has some default behavior or fallback mechanism that allows it to recognize and produce key codes for the altkeys, while the other terminfos do not have such a mechanism in place. This could explain why xterm-256color produced consistent keycode bindings for the altkeys across all three emulators, while the other terminfos did not.

Definition at line 556 of file cm.h.

◆ KEY_ALTLEFT

#define KEY_ALTLEFT   0x228

Definition at line 563 of file cm.h.

◆ KEY_ALTPGDN

#define KEY_ALTPGDN   0x22d

Definition at line 561 of file cm.h.

◆ KEY_ALTPGUP

#define KEY_ALTPGUP   0x232

Definition at line 558 of file cm.h.

◆ KEY_ALTRIGHT

#define KEY_ALTRIGHT   0x237

Definition at line 565 of file cm.h.

◆ KEY_ALTUP

#define KEY_ALTUP   0x23d

Definition at line 562 of file cm.h.

◆ LN_BG_COLOR

#define LN_BG_COLOR   7

default line number background

Definition at line 389 of file cm.h.

◆ LN_COLOR

#define LN_COLOR   4

default line number color

Definition at line 388 of file cm.h.

◆ MAX

#define MAX ( a,
b )
Value:

MIN macro for compatibility with code that uses the same name, while avoiding multiple evaluations of the arguments.

/usr/include/sys/param.h contains implementations of the MIN and MAX macros, which are simple but can lead to issues with multiple evaluations of the arguments if they have side effects. These macros provides a safer alternative to param.h Here are the macros from /usr/include/sys/param.h. You may comment out the macros defined herein and use the macros in param.h if you prefer.

Note
The following macro provides a safer alternative to param.h

Definition at line 112 of file cm.h.

◆ max

#define max ( a,
b )
Value:

max macro evaluates two expressions, returning greatest result.

These macros use compound statements to create local scopes for the temporary variables _x and _y, which store the values of x and y, respectively. This ensures that if x or y have side effects (such as being incremented), they will only be evaluated once when the macro is expanded. The use of typeof allows the macro to work with any data type. The line (void)(&_x == &_y) is a compile-time check to ensure that the types of the arguments are compatible. This implementation of the min and max macros provides a safer and more robust way to determine the minimum and maximum values between two expressions without risking unintended consequences from multiple evaluations.

Definition at line 82 of file cm.h.

◆ MAX_ARGS

#define MAX_ARGS   64

maximum number of arguments for external commands

Definition at line 46 of file cm.h.

◆ MAX_DEPTH

#define MAX_DEPTH   3

default depth for recursive file searching

Definition at line 50 of file cm.h.

◆ MAXARGS

#define MAXARGS   64

maximum number of arguments

Definition at line 48 of file cm.h.

◆ MAXLEN

#define MAXLEN   256

maximum length for strings and buffers

Definition at line 47 of file cm.h.

◆ MAXWIN [1/2]

#define MAXWIN   30

maximum number of windows that can be created

Definition at line 37 of file cm.h.

◆ MAXWIN [2/2]

#define MAXWIN   30

maximum number of windows that can be created

Definition at line 37 of file cm.h.

◆ MIN

#define MIN ( x,
y )
Value:

MAX macro for compatibility with code that uses the same name, while avoiding multiple evaluations of the arguments.

Note
The following macro provides a safer alternative to param.h

Definition at line 122 of file cm.h.

◆ min

#define min ( x,
y )
Value:

min macro evaluates two expressions, returning least result

Definition at line 89 of file cm.h.

◆ NCURSES_WIDECHAR

#define NCURSES_WIDECHAR   1

Enable wide character support

Definition at line 15 of file cm.h.

◆ nullptr

#define nullptr   NULL

Definition at line 34 of file cm.h.

◆ S_QUIET

#define S_QUIET   0x2000

quiet mode flag for file validation

Definition at line 286 of file cm.h.

◆ S_TOLOWER

#define S_TOLOWER ( c)
Value:

Definition at line 142 of file cm.h.

◆ S_TOUPPER

#define S_TOUPPER ( c)
Value:

Definition at line 147 of file cm.h.

◆ S_WCOK

#define S_WCOK   0x1000

write or create permitted

Definition at line 285 of file cm.h.

◆ SCR_COLS

#define SCR_COLS   1024

maximum number of columns in the terminal screen

Definition at line 49 of file cm.h.

◆ SCREEN_MAX_LINES

#define SCREEN_MAX_LINES   100

Definition at line 51 of file cm.h.

◆ to_lowercase

#define to_lowercase ( c)
Value:

to_lowercase(c) - convert an uppercase letter to lowercase

Definition at line 710 of file cm.h.

◆ to_uppercase [1/2]

#define to_uppercase ( c)
Value:

to_uppercase(c) - convert a lowercase letter to uppercase

simple macro to convert a character to uppercase

Definition at line 706 of file cm.h.

◆ to_uppercase [2/2]

#define to_uppercase ( c)
Value:

to_uppercase(c) - convert a lowercase letter to uppercase

simple macro to convert a character to uppercase

Definition at line 706 of file cm.h.

◆ XTERM_256COLOR

#define XTERM_256COLOR

use xterm-256color terminfo for altkey bindings

Definition at line 504 of file cm.h.

Typedef Documentation

◆ uchar

typedef unsigned char uchar

Definition at line 648 of file cm.h.

Enumeration Type Documentation

◆ ColorsEnum

enum ColorsEnum

Used for xterm256 color conversions.

Enumerator
CLR_BLACK 
CLR_RED 
CLR_GREEN 
CLR_YELLOW 
CLR_BLUE 
CLR_MAGENTA 
CLR_CYAN 
CLR_WHITE 
CLR_BBLACK 
CLR_BRED 
CLR_BGREEN 
CLR_BYELLOW 
CLR_BBLUE 
CLR_BMAGENTA 
CLR_BCYAN 
CLR_BWHITE 
CLR_BORANGE 
CLR_FG 
CLR_BG 
CLR_BOX_FG 
CLR_BOX_BG 
CLR_IND_FG 
CLR_IND_BG 
CLR_BRACKETS_FG 
CLR_BRACKETS_BG 
CLR_FILL_CHAR_FG 
CLR_FILL_CHAR_BG 
CLR_LN_FG 
CLR_LN_BG 
CLR_CMDLN_FG 
CLR_CMDLN_BG 
CLR_NT_FG 
CLR_NT_BG 
CLR_NT_REV_FG 
CLR_NT_REV_BG 
CLR_NT_HL_FG 
CLR_NT_HL_BG 
CLR_NT_HL_REV_FG 
CLR_NT_HL_REV_BG 
CLR_TITLE_FG 
CLR_TITLE_BG 
CLR_NCOLORS 

Definition at line 156 of file cm.h.

◆ F_Type

enum F_Type
Enumerator
F_F0 
F_FIFO 
F_CHR 
F_F1 
F_DIR 
F_F2 
F_BLK 
F_F3 
F_REG 
F_F4 
F_LNK 
F_F5 
F_SOCK 
F_F6 
F_UNKNOWN 

Definition at line 230 of file cm.h.

◆ LFFlags

enum LFFlags
Enumerator
LF_HIDE 

byte 0 - bits 0-7 Selection Flags 1 Don't list hidden files

LF_ICASE 

2 Ignore case in search

LF_EXC_REGEX 

4 Exclude files matching regex

LF_REGEX 

8 Include files matching regex

LF_EXEC 

16 Execute command each file

LF_USER 

32 Select User Name

LF_IXUSR 

<< 16 byte 1 - bits 8-15 1 Select Files with Execute Permission

LF_IWUSR 

2 Select Files with Write Permission

LF_IRUSR 

4 Select Files with Read Permission

LF_ISGID 

16 Select Setgid Files

LF_ISUID 

32 Select Setuid Files

Definition at line 201 of file cm.h.

203 LF_HIDE = 0b00000001,
204 LF_ICASE = 0b00000010,
205 LF_EXC_REGEX = 0b00000100,
206 LF_REGEX = 0b00001000,
207 LF_EXEC = 0b00010000,
208 LF_USER = 0b00100000,
211 LF_IXUSR = 0b00000001,
212 LF_IWUSR = 0b00000010,
213 LF_IRUSR = 0b00000100,
214 LF_ISGID = 0b00010000,
215 LF_ISUID = 0b00100000,
216} LFFlags;
LFFlags
Definition cm.h:201
@ 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

◆ LFTypes

enum LFTypes

byte 2 - bits 16-23 File types

Enumerator
LF_FIFO 

1 named pipe

LF_CHR 

2 character device

LF_DIR 

4 directory

LF_BLK 

8 block

LF_REG 

16 regular file

LF_LNK 

32 link

LF_SOCK 

64 socket

LF_UNKNOWN 

128 unknown

Definition at line 219 of file cm.h.

219 {
220 LF_FIFO = 0b00000001,
221 LF_CHR = 0b00000010,
222 LF_DIR = 0b00000100,
223 LF_BLK = 0b00001000,
224 LF_REG = 0b00010000,
225 LF_LNK = 0b00100000,
226 LF_SOCK = 0b01000000,
227 LF_UNKNOWN = 0b10000000
228} LFTypes;
LFTypes
Definition cm.h:219
@ LF_FIFO
Definition cm.h:220
@ LF_UNKNOWN
Definition cm.h:227
@ LF_SOCK
Definition cm.h:226
@ LF_BLK
Definition cm.h:223
@ LF_CHR
Definition cm.h:221
#define LF_DIR
Definition futil.c:44
#define LF_REG
Definition futil.c:45
#define LF_LNK
Definition futil.c:43

Function Documentation

◆ border_draw()

int border_draw ( WINDOW * box)
extern

Definition at line 1236 of file dwin.c.

1236 {
1237 int maxy = getmaxy(box);
1238 int maxx = getmaxx(box);
1239 int y = 0;
1240 int x = 0;
1241 mvwadd_wchnstr(box, y, x++, &tl, 1); // top left
1242 for (x = 1; x < maxx - 1; x++)
1243 mvwadd_wchnstr(box, y, x, &ts, 1); // horizontal line
1244 mvwadd_wchnstr(box, y, maxx - 1, &tr, 1); // top left
1245
1246 for (y = 1; y < maxy - 1; y++) {
1247 mvwadd_wchnstr(box, y, 0, &ls, 1); // vertical line
1248 mvwadd_wchnstr(box, y, maxx - 1, &rs, 1); // vertical line
1249 }
1250
1251 mvwadd_wchnstr(box, y, 0, &bl, 1); // bottom left
1252 for (x = 1; x < maxx - 1; x++)
1253 mvwadd_wchnstr(box, y, x, &bs, 1); // horizontal line
1254 mvwadd_wchnstr(box, y, maxx - 1, &br, 1); // bottom right
1255 return 0;
1256}
cchar_t tl
Definition cm.h:501
cchar_t br
Definition cm.h:501
cchar_t rs
Definition cm.h:501
cchar_t bl
Definition cm.h:501
cchar_t ts
Definition cm.h:501
cchar_t tr
Definition cm.h:501
cchar_t ls
Definition cm.h:631
cchar_t bs
Definition cm.h:501

References bl, br, bs, ls, rs, tl, tr, and ts.

Referenced by bare_box_new().

Here is the caller graph for this function:

◆ box2_new()

int box2_new ( int ,
int ,
int ,
int ,
char *  )
extern

◆ cf_accept()

int cf_accept ( WINDOW * win,
char * accept_s,
int flin,
int fcol,
int flen )
extern

Accepts input for a field in a C-Menu window.

Parameters
winThe window to accept input from
accept_sThe string to accept input into
flinThe line number of the field
fcolThe column number of the field
flenThe length of the field
Returns
The key pressed to exit the field (KEY_ENTER, KEY_F(9), etc.)

< Enter accepts the field and moves to the next field if f_erase_remainder is set, it will clear the remaining characters above and after the current cursor location

KEY_IC toggles insert mode

KEY_DC deletes character at cursor

KEY_HOME moves cursor to start of field

KEY_BACKSPACE deletes character before cursor

KEY_LEFT moves cursor left one character

KEY_RIGHT moves cursor right one character

Handles mouse events for field editing

Definition at line 51 of file cm_fields.c.

51 {
52 bool f_insert = FALSE;
53 int in_key = 0;
54 char *s, *d;
55 char *fstart;
56
57 click_x = click_y = -1;
58 char *p = fstart = accept_s;
59 char *fend = fstart + flen;
60 int x = fcol;
61 char *str_end = p + strlen(p);
62 while (1) {
63 if (in_key == 0) {
64 mvwaddstr(win, flin, fcol, accept_s);
65 wclrtoeol(win);
66 wmove(win, flin, x);
67 tcflush(0, TCIFLUSH);
68 in_key = vgetch(win, 0);
69 }
70 curs_set(0);
71 switch (in_key) {
72 case KEY_F(9):
73 in_key = KEY_F(9);
74 return (in_key);
75 case '\t':
76 case KEY_END:
77 case Ctrl('e'):
78 while (*p != '\0')
79 p++;
80 x = fcol + (p - fstart);
81 in_key = 0;
82 continue;
86 case '\n':
87 case KEY_ENTER:
89 *p = '\0';
90 in_key = KEY_ENTER;
91 return (in_key);
93 case KEY_IC:
94 f_insert = !f_insert;
95 in_key = 0;
96 continue;
98 case KEY_DC:
99 s = p + 1;
100 d = p;
101 while (*s != '\0')
102 *d++ = *s++;
103 *d = '\0';
104 str_end = d;
105 f_insert = FALSE;
106 in_key = 0;
107 continue;
109 case KEY_HOME:
110 case Ctrl('a'):
111 p = fstart;
112 x = fcol;
113 in_key = 0;
114 continue;
116 case KEY_BACKSPACE:
117 if (p > fstart) {
118 p--;
119 x--;
120 }
121 s = p + 1;
122 d = p;
123 while (*s != '\0')
124 *d++ = *s++;
125 *d = '\0';
126 str_end = d;
127 in_key = 0;
128 continue;
130 case KEY_LEFT:
131 if (p > fstart) {
132 p--;
133 x--;
134 }
135 in_key = 0;
136 continue;
138 case KEY_RIGHT:
139 if (p < fend && p < str_end) {
140 p++;
141 x++;
142 }
143 in_key = 0;
144 continue;
146 case KEY_MOUSE:
147 x = click_x;
148 flin = click_y;
149 fstart = accept_s;
150 fend = fstart + flen;
151 str_end = fstart + strlen(fstart);
152 p = fstart + (x - fcol);
153 if (p > str_end)
154 x -= p - str_end;
155 p = min(p, str_end);
156 in_key = 0;
157 continue;
158 default:
159 if (p >= fend) {
160 in_key = 0;
161 continue;
162 }
163 if (in_key < ' ' || in_key > '~') {
164 in_key = 0;
165 continue;
166 }
167 if (f_insert) {
168 if (str_end < fend) {
169 s = str_end - 1;
170 d = str_end;
171 while (s >= p)
172 *d-- = *s--;
173 *p++ = in_key;
174 str_end++;
175 x++;
176 }
177 } else {
178 if (p < fend) {
179 if (p < str_end) {
180 if (p == accept_s && in_key == ' ') {
181 d = accept_s;
182 s = accept_s + 1;
183 while (*s != '\0')
184 *d++ = *s++;
185 *d = '\0';
186 in_key = 0;
187 continue;
188 }
189 *p++ = in_key;
190 x++;
191 } else if (p == str_end) {
192 *p++ = in_key;
193 *p = '\0';
194 str_end = p;
195 x++;
196 }
197 }
198 }
199 in_key = 0;
200 continue;
201 }
202 }
203}
int click_x
Definition dwin.c:81
int click_y
Definition dwin.c:80
#define min(x, y)
min macro evaluates two expressions, returning least result
Definition cm.h:89
#define Ctrl(c)
Definition cm.h:52
#define FALSE
Definition iloan.c:18
bool f_erase_remainder
Definition cm_fields.c:39
int vgetch(WINDOW *, int)
Wrapper for wgetch that handles signals and mouse events, and accepts a single character answer.
Definition dwin.c:2258

References click_x, click_y, f_erase_remainder, and vgetch().

Referenced by get_cmd_arg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ construct_file_spec()

bool construct_file_spec ( char * ,
char * ,
char * ,
char * ,
char * ,
int  )
extern

◆ curskeys()

void curskeys ( WINDOW * )
extern

◆ destroy_box()

void destroy_box ( WINDOW * )
extern

◆ destroy_win()

void destroy_win ( WINDOW * )
extern

◆ display_argv_error_msg()

void display_argv_error_msg ( char * ,
char **  )
extern

◆ display_curses_keys()

int display_curses_keys ( )
extern

◆ display_ok_message()

int display_ok_message ( char * )
extern

◆ dump_opts()

void dump_opts ( )
extern

dump options to stdout

◆ dump_opts_by_use()

void dump_opts_by_use ( char * ,
char *  )
extern

dump options to stdout

◆ enter_option()

int enter_option ( )
extern

◆ fill_field()

char * fill_field ( char * accept_s,
char * display_s,
char fill_char,
int flen )
extern

Definition at line 1748 of file futil.c.

1749 {
1750 char *s = accept_s;
1751 char *d = display_s;
1752 char *e = d + flen;
1753 while (*s != '\0' && d < e)
1754 *d++ = *s++;
1755 while (d < e)
1756 *d++ = fill_char;
1757 *d = '\0';
1758 return display_s;

◆ get_rfc3339_s()

void get_rfc3339_s ( char * ,
size_t  )
extern

◆ handle_signal()

bool handle_signal ( sig_atomic_t )
extern

Referenced by dxwgetch(), popup_ckeys(), and xwgetch().

Here is the caller graph for this function:

◆ init_stdscr()

void init_stdscr ( )
extern

◆ mk_string()

String mk_string ( size_t l)
extern

Create a String struct with a dynamically allocated string.

Parameters
llength of string to create including null terminator
Returns
String struct

The returned String struct contains a dynamically allocated string of he specified length

Note
the caller is responsible for calling free_string to free the allocated memory.

Definition at line 1543 of file futil.c.

1544 {
1545 if (l == 0) {
1546 String str;
1547 str.l = 0;
1548 str.s = nullptr;
1549 return str;
1550 }
1551 String str;
1552 str.l = l + 1;
1553 str.s = (char *)malloc(str.l);
1554 str.s[0] = '\0';
1555 return str;
The String structure represents a string object with a pointer to the string and its allocated length...
Definition cm.h:762
size_t l
Definition cm.h:764
char * s
Definition cm.h:763

References String::l, and String::s.

◆ mouse_getch()

void mouse_getch ( int * ,
int * ,
int * ,
int *  )
extern

◆ open_log()

int open_log ( char * )
extern

◆ resize_panel()

void resize_panel ( PANEL * ,
int ,
int ,
int ,
int  )
extern

◆ rgb_clr_to_cube()

int rgb_clr_to_cube ( int )
extern

◆ rtrim()

size_t rtrim ( char * s)
extern

Trims trailing spaces from string s in place.

Parameters
s- string to trim
Returns
length of trimmed string

Definition at line 338 of file futil.c.

338 {
339 if (s == nullptr || *s == '\0')
340 return (size_t)0;
341 char *p = s + strlen(s) - 1;
342 while (p >= s && *p == ' ')
343 p--;
344 *(p + 1) = '\0';
345 return (size_t)(p - s + 1);
346}

Referenced by fmt_line(), and picker().

Here is the caller graph for this function:

◆ sig_shell_mode()

void sig_shell_mode ( )
extern

◆ stdio_fdnames()

char * stdio_fdnames ( char * ,
char *  )
extern

Definition at line 1089 of file futil.c.

1090 {
1091 if (!stdio_str)
1092 return nullptr;
1093 char buf[MAXLEN] = {'\0'};
1094 ssnprintf(buf, MAXLEN - 1, "%s - ", id);
1095 strnz__cpy(stdio_str, buf, MAXLEN - 1);
1096 strnz__cat(stdio_str, fdname(0, buf), MAXLEN - 1);
1097 strnz__cat(stdio_str, ",", MAXLEN - 1);
1098 strnz__cat(stdio_str, fdname(1, buf), MAXLEN - 1);
1099 strnz__cat(stdio_str, ",", MAXLEN - 1);
1100 strnz__cat(stdio_str, fdname(2, buf), MAXLEN - 1);
1101 strnz__cat(stdio_str, ",", MAXLEN - 1);
1102 strnz__cat(stdio_str, fdname(3, buf), MAXLEN - 1);
1103 strnz__cat(stdio_str, ",", MAXLEN - 1);
1104 strnz__cat(stdio_str, fdname(4, buf), MAXLEN - 1);
1105 strnz__cat(stdio_str, ",", MAXLEN - 1);
1106 strnz__cat(stdio_str, fdname(5, buf), MAXLEN - 1);
1107 strnz__cat(stdio_str, ",", MAXLEN - 1);
1108 strnz__cat(stdio_str, fdname(6, buf), MAXLEN - 1);
1109 strnz__cat(stdio_str, ",", MAXLEN - 1);
1110 strnz__cat(stdio_str, fdname(7, buf), MAXLEN - 1);
1111 strnz__cat(stdio_str, ",", MAXLEN - 1);
1112 strnz__cat(stdio_str, fdname(8, buf), MAXLEN - 1);
1113 return stdio_str;
1114 return stdio_str;
#define MAXLEN
Definition curskeys.c:15
size_t strnz__cpy(char *, const char *, size_t)
safer alternative to strncpy
Definition futil.c:544
size_t ssnprintf(char *, size_t, const char *,...)
ssnprintf was designed to be a safer alternative to snprintf.
Definition futil.c:420
size_t strnz__cat(char *, const char *, size_t)
safer alternative to strncat
Definition futil.c:573
char * fdname(int fd, char *out_path)
Retrieves the file path associated with a given file descriptor.
Definition futil.c:1054

References fdname(), ssnprintf(), strnz__cat(), and strnz__cpy().

Referenced by destroy_pick_view(), form_process(), and view_init_input().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stdio_names()

char * stdio_names ( char * ,
char *  )
extern

Definition at line 1064 of file futil.c.

1065 {
1066 if (!stdio_str)
1067 return nullptr;
1068 char buf[MAXLEN] = {'\0'};
1069 char err_str[MAXLEN] = {'\0'};
1070 errno = 0;
1071 ssnprintf(buf, MAXLEN - 1, "%s - ", id);
1072 strnz__cpy(stdio_str, buf, MAXLEN - 1);
1073 strnz__cat(stdio_str, ttyname(0), MAXLEN - 1);
1074 strnz__cat(stdio_str, ", ", MAXLEN - 1);
1075 if (errno)
1076 ssnprintf(err_str, MAXLEN - 1, "Error fd %d: %s\n", 0, strerror(errno));
1077
1078 strnz__cat(stdio_str, ttyname(1), MAXLEN - 1);
1079 strnz__cat(stdio_str, ", ", MAXLEN - 1);
1080 if (errno)
1081 ssnprintf(err_str, MAXLEN - 1, "Error fd %d: %s\n", 1, strerror(errno));
1082
1083 strnz__cat(stdio_str, ttyname(2), MAXLEN - 1);
1084 strnz__cat(stdio_str, ", ", MAXLEN - 1);
1085 if (errno)
1086 ssnprintf(err_str, MAXLEN - 1, "Error fd %d: %s\n", 2, strerror(errno));
1087
1088 return stdio_str;

References ssnprintf(), strnz__cat(), and strnz__cpy().

Referenced by fork_exec(), menu_cmd_processor(), and view_init_input().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ str_to_bool()

bool str_to_bool ( const char * s)
extern

Converts String to boolean true or false.

Parameters
s- string to convert
Returns
boolean true or false

Definition at line 941 of file futil.c.

942 {
943 if (s == nullptr || *s == '\0')
944 return false;
945 switch (s[0]) {
946 case 't':
947 case 'T':
948 case 'y':
949 case 'Y':
950 case '1':
951 return true;
952 case 'o':
953 case 'O':
954 switch (s[1]) {
955 case 'n':
956 case 'N':
957 return true;
958 default:
959 break;
960 }
961 default:
962 break;
963 }
964 return false;

Referenced by process_config_file().

Here is the caller graph for this function:

◆ strnfill()

bool strnfill ( char * ,
char ,
int  )
extern

◆ user_end()

void user_end ( )
extern

◆ verify_dir_q()

bool verify_dir_q ( char * ,
int  )
extern

◆ verify_file_q()

bool verify_file_q ( char * ,
int  )
extern

◆ w_mouse_getch()

void w_mouse_getch ( WINDOW * ,
int * ,
int * ,
int * ,
int *  )
extern

◆ win_Toggle_Attrs()

void win_Toggle_Attrs ( )
extern

◆ write_log()

void write_log ( char * )
extern

Variable Documentation

◆ bl

cchar_t bl

Definition at line 501 of file cm.h.

Referenced by border_draw(), init_view_boxwin(), initialize_local_colors(), message_win(), and win_resize().

◆ br

cchar_t br

Definition at line 501 of file cm.h.

Referenced by border_draw(), init_view_boxwin(), initialize_local_colors(), message_win(), and win_resize().

◆ bs

cchar_t bs

Definition at line 501 of file cm.h.

Referenced by border_draw(), init_view_boxwin(), initialize_local_colors(), message_win(), and win_resize().

◆ bw_bl

const wchar_t bw_bl
extern

bottom left corner

Definition at line 142 of file dwin.c.

Referenced by initialize_local_colors().

◆ bw_br

const wchar_t bw_br
extern

bottom right corner

Definition at line 143 of file dwin.c.

Referenced by initialize_local_colors().

◆ bw_bt

const wchar_t bw_bt
extern

bottom tee

◆ bw_chk

const wchar_t bw_chk
extern

right piointing angle

right angle

Definition at line 152 of file dwin.c.

Referenced by initialize_local_colors().

◆ bw_cr

const wchar_t bw_cr
extern

cross

◆ bw_da

const wchar_t bw_da
extern

down arrow

right arrow

Definition at line 150 of file dwin.c.

Referenced by initialize_local_colors().

◆ bw_ho

const wchar_t bw_ho
extern

The following are the actual wchar_t variables that will hold the box drawing characters. These correspond to the above Unicode code points. By defining them as wchar_t, we can use them in the ncurses library to draw boxes and lines in the terminal. The variables are named with a "bw_" prefix to indicate that they are box (wide) drawing characters, and they will be initialized with the corresponding Unicode characters defined above. horizontal line

horizontal line

Definition at line 138 of file dwin.c.

Referenced by border_hsplit(), and initialize_local_colors().

◆ bw_la

const wchar_t bw_la
extern

left arrow

right arrow

Definition at line 148 of file dwin.c.

Referenced by initialize_local_colors().

◆ bw_lt

const wchar_t bw_lt
extern

left tee

Definition at line 144 of file dwin.c.

Referenced by border_hsplit(), initialize_local_colors(), and win_resize().

◆ bw_ra

const wchar_t bw_ra
extern

right arrow

Definition at line 147 of file dwin.c.

Referenced by initialize_local_colors().

◆ bw_ran

const wchar_t bw_ran
extern

right piointing angle

right angle

Definition at line 151 of file dwin.c.

Referenced by initialize_local_colors().

◆ bw_rt

const wchar_t bw_rt
extern

right tee

Definition at line 145 of file dwin.c.

Referenced by border_hsplit(), initialize_local_colors(), and win_resize().

◆ bw_sp

const wchar_t bw_sp
extern

space

tee space

Definition at line 146 of file dwin.c.

Referenced by initialize_local_colors(), picker(), and win_resize().

◆ bw_tl

const wchar_t bw_tl
extern

top left corner

Definition at line 140 of file dwin.c.

Referenced by initialize_local_colors().

◆ bw_tr

const wchar_t bw_tr
extern

top right corner

Definition at line 141 of file dwin.c.

Referenced by initialize_local_colors().

◆ bw_tt

const wchar_t bw_tt
extern

top tee

◆ bw_ua

const wchar_t bw_ua
extern

up arrow

right arrow

Definition at line 149 of file dwin.c.

Referenced by initialize_local_colors().

◆ bw_ve

const wchar_t bw_ve
extern

vertical line

Definition at line 139 of file dwin.c.

Referenced by initialize_local_colors().

◆ CC_BLUE

cchar_t CC_BLUE
extern

blue background

Definition at line 217 of file dwin.c.

Referenced by check_panels(), and initialize_local_colors().

◆ CC_BOX

cchar_t CC_BOX
extern

indicator colors

Definition at line 199 of file dwin.c.

Referenced by bare_box_new(), box_hsplit_new(), init_view_boxwin(), initialize_local_colors(), message_win(), and win_resize().

◆ CC_BRKTL

cchar_t CC_BRKTL
extern

left bracket

left field bracket

Definition at line 494 of file cm.h.

Referenced by initialize_local_colors().

◆ CC_BRKTR

cchar_t CC_BRKTR
extern

right bracket

right field bracket

Definition at line 495 of file cm.h.

Referenced by initialize_local_colors().

◆ CC_CMDLN

cchar_t CC_CMDLN
extern

Definition at line 202 of file dwin.c.

Referenced by initialize_local_colors().

◆ CC_DATA1

cchar_t CC_DATA1
extern

◆ CC_DATA2

cchar_t CC_DATA2
extern

◆ CC_DATA3

cchar_t CC_DATA3
extern

◆ CC_FILL_CHAR

cchar_t CC_FILL_CHAR
extern

fill character

Definition at line 211 of file dwin.c.

Referenced by initialize_local_colors().

◆ CC_GREEN

cchar_t CC_GREEN
extern

green background

Definition at line 215 of file dwin.c.

Referenced by check_panels(), and initialize_local_colors().

◆ CC_IND

cchar_t CC_IND
extern

box colors

Definition at line 200 of file dwin.c.

Referenced by get_cmd_char(), and initialize_local_colors().

◆ CC_LN

cchar_t CC_LN
extern

Definition at line 201 of file dwin.c.

Referenced by init_view_boxwin(), init_view_full_screen(), and initialize_local_colors().

◆ CC_NT

◆ CC_NT_HL

cchar_t CC_NT_HL
extern

highlight

Definition at line 207 of file dwin.c.

Referenced by initialize_local_colors().

◆ CC_NT_HL_REV

cchar_t CC_NT_HL_REV
extern

highlight reverse

Definition at line 206 of file dwin.c.

Referenced by initialize_local_colors().

◆ CC_NT_REV

cchar_t CC_NT_REV
extern

◆ CC_RED

cchar_t CC_RED
extern

red background

Definition at line 214 of file dwin.c.

Referenced by check_panels(), and initialize_local_colors().

◆ CC_REVERSE

cchar_t CC_REVERSE
extern

curses default reverse

◆ CC_TITLE

cchar_t CC_TITLE
extern

title colors

Definition at line 203 of file dwin.c.

Referenced by initialize_local_colors().

◆ CC_YELLOW

cchar_t CC_YELLOW
extern

yellow background

Definition at line 216 of file dwin.c.

Referenced by initialize_local_colors().

◆ chk

cchar_t chk

◆ click_x

int click_x
extern

the x coordinate of a mouse click

Definition at line 81 of file dwin.c.

Referenced by cf_accept(), dxwgetch(), field_editor(), form_post(), form_process(), menu_cmd_processor(), picker(), and xwgetch().

◆ click_y

int click_y
extern

the y coordinate of a mouse click

Definition at line 80 of file dwin.c.

Referenced by cf_accept(), dxwgetch(), field_editor(), form_post(), form_process(), menu_cmd_processor(), picker(), and xwgetch().

◆ clr_cnt

int clr_cnt
extern

number of colors used

Definition at line 195 of file dwin.c.

Referenced by init_clr_palette(), and rgb_to_curses_clr().

◆ clr_idx

int clr_idx
extern

current color index

◆ clr_pair_cnt

int clr_pair_cnt
extern

number of color pairs supported by the terminal

Definition at line 197 of file dwin.c.

Referenced by get_clr_pair().

◆ clr_pair_idx

int clr_pair_idx
extern

current color pair index

Definition at line 196 of file dwin.c.

Referenced by parse_ansi_str().

◆ cmenu_log_fd

int cmenu_log_fd
extern

Definition at line 54 of file futil.c.

Referenced by open_cmenu_log(), write_cmenu_log(), and write_cmenu_log_nt().

◆ cmenu_log_fp

FILE* cmenu_log_fp
extern

◆ colors_text

char const colors_text[][10]
extern

Color names for .minitrc overrides.

color codes for the 16 basic colors

colors_text

These names are used in .minitrc to specify color overrides The order of these names corresponds to the ColorsEnum values

Definition at line 133 of file dwin.c.

133 {
134 "black", "red", "green", "yellow", "blue", "magenta", "cyan",
135 "white", "orange", "bg", "abg", "bblack", "bred", "bgreen",
136 "byellow", "bblue", "bcyan", "bmagenta", "bwhite", "borange", ""};

Referenced by clr_name_to_idx(), and list_colors().

◆ cp_blue

int cp_blue
extern

blue background color pair index

Definition at line 194 of file dwin.c.

Referenced by initialize_local_colors().

◆ cp_bold

int cp_bold
extern

bold color pair index

◆ cp_box

int cp_box
extern

box color pair index

Definition at line 179 of file dwin.c.

Referenced by border_hsplit_text(), initialize_local_colors(), and picker().

◆ cp_brackets

int cp_brackets
extern

color pair index for field brackets

Definition at line 190 of file dwin.c.

Referenced by init_form(), and initialize_local_colors().

◆ cp_cmdln_bg

int cp_cmdln_bg
extern

command line number background color pair index

◆ cp_cmdln_fg

int cp_cmdln_fg
extern

command line number color pair index

◆ cp_default

int cp_default
extern

default color pair index

◆ cp_fill_char

int cp_fill_char
extern

fill character color pair index

Definition at line 189 of file dwin.c.

Referenced by form_display_fields(), and initialize_local_colors().

◆ cp_green

int cp_green
extern

green background color pair index

Definition at line 192 of file dwin.c.

Referenced by initialize_local_colors().

◆ cp_highlight

int cp_highlight
extern

highlight color pair index

◆ cp_ind

int cp_ind
extern

indicator color pair index

Definition at line 180 of file dwin.c.

Referenced by initialize_local_colors().

◆ cp_ln_bg

int cp_ln_bg
extern

line number background color pair index

◆ cp_ln_fg

int cp_ln_fg
extern

line number color pair index

◆ cp_nt

int cp_nt
extern

normal color pair index

Definition at line 183 of file dwin.c.

Referenced by fmt_line(), form_display_field(), form_display_fields(), and initialize_local_colors().

◆ cp_nt_hl

int cp_nt_hl
extern

highlight color pair index

Definition at line 185 of file dwin.c.

Referenced by initialize_local_colors(), menu_cmd_processor(), and menu_engine().

◆ cp_nt_hl_rev

int cp_nt_hl_rev
extern

highlight reverse color pair index

Definition at line 186 of file dwin.c.

Referenced by field_editor(), form_engine(), initialize_local_colors(), menu_cmd_processor(), and picker().

◆ cp_nt_rev

int cp_nt_rev
extern

reverse color pair index

Definition at line 184 of file dwin.c.

Referenced by compile_chyron(), field_editor(), initialize_local_colors(), picker(), search(), and set_chyron_key().

◆ cp_red

int cp_red
extern

red background color pair index

Definition at line 191 of file dwin.c.

Referenced by initialize_local_colors().

◆ cp_title

int cp_title
extern

title color pair index

Definition at line 182 of file dwin.c.

Referenced by border_title(), and initialize_local_colors().

◆ cp_yellow

int cp_yellow
extern

yellow background color pair index

Definition at line 193 of file dwin.c.

Referenced by initialize_local_colors().

◆ curses_err_tioctl

struct termios shell_err_tioctl curses_err_tioctl
extern

Definition at line 37 of file scriou.c.

Referenced by capture_curses_tioctl(), and restore_curses_tioctl().

◆ curses_in_tioctl

struct termios shell_in_tioctl curses_in_tioctl
extern

Definition at line 35 of file scriou.c.

Referenced by capture_curses_tioctl(), and restore_curses_tioctl().

◆ curses_out_tioctl

struct termios shell_out_tioctl curses_out_tioctl
extern

Definition at line 36 of file scriou.c.

Referenced by capture_curses_tioctl(), and restore_curses_tioctl().

◆ curses_tioctl

struct termios shell_tioctl curses_tioctl
extern

Definition at line 34 of file scriou.c.

Referenced by dxwgetch(), vgetch(), and xwgetch().

◆ da

cchar_t da

Definition at line 631 of file cm.h.

Referenced by initialize_local_colors().

◆ dbgfd

int dbgfd
extern

the file descriptor for debug output, for debugging purposes

◆ em0

◆ em1

◆ em2

◆ em3

char em3[MAXLEN]
extern

error message string for error messages

Definition at line 178 of file dwin.c.

Referenced by verify_dir(), and verify_file().

◆ errmsg

char errmsg[]
extern

Global variables for error reporting

Definition at line 138 of file futil.c.

◆ exit_code

int exit_code
extern

the exit code for the program, for error messages and other output

Definition at line 159 of file dwin.c.

◆ f_curses_open

bool f_curses_open
extern

◆ f_debug

bool f_debug
extern

a flag to indicate whether debug output should be printed, for debugging purposes

◆ f_have_curses_tioctl

bool f_have_curses_tioctl
extern

curses tioctl captured

Definition at line 25 of file scriou.c.

Referenced by capture_curses_tioctl(), and restore_curses_tioctl().

◆ f_have_shell_tioctl

bool f_have_shell_tioctl
extern

shell tioctl captured

Definition at line 24 of file scriou.c.

Referenced by capture_shell_tioctl(), and restore_shell_tioctl().

◆ f_restore_screen

bool f_restore_screen
extern

whether to restore the screen

◆ fn

char fn[MAXLEN]
extern

function name for error messages

Definition at line 174 of file dwin.c.

Referenced by verify_dir(), and verify_file().

◆ la

cchar_t la

Definition at line 631 of file cm.h.

Referenced by initialize_local_colors().

◆ ls

cchar_t ls
extern

Definition at line 631 of file cm.h.

Referenced by border_draw(), init_view_boxwin(), initialize_local_colors(), message_win(), and win_resize().

◆ lt

cchar_t lt

Definition at line 631 of file cm.h.

Referenced by border_hsplit_text(), border_title(), and initialize_local_colors().

◆ mbegx

int mbegx
extern

beginning x coordinate of the current window, which can be used to determine the position of the window on the terminal screen.

◆ mbegy

int mbegy
extern

beginning y coordinate of the current window, which can be used to determine the position of the window on the terminal screen.

◆ mcols

int mcols
extern

number of columns in the current window, which may be less than the total number of columns in the terminal if the window is resized or if multiple windows are being used.

◆ mg_action

int mg_action
extern

action in progress, which can be used to keep track of the current state of the program and determine how to respond to user input or other events.

◆ mg_col

int mg_col
extern

window column, which can be used to determine the current column position in the window for displaying text or other content.

◆ mg_line

int mg_line
extern

window line, which can be used to determine the current line position in the window for displaying text or other content.

◆ mlines

int mlines
extern

number of lines in the current window, which may be less than the total number of lines in the terminal if the window is resized or if multiple windows are being used.

◆ mouse_win

WINDOW* mouse_win
extern

input from window n

Definition at line 118 of file dwin.c.

Referenced by dxwgetch(), and picker().

◆ n_cols

int n_cols
extern

number of columns in the terminal

◆ n_lines

int n_lines
extern

number of lines in the terminal

◆ panel_box

PANEL* panel_box[MAXWIN]
extern

Definition at line 57 of file dwin.c.

Referenced by bare_box_new(), check_panels(), destroy_curses(), open_curses(), and win_del().

◆ panel_win

PANEL* panel_win[MAXWIN]
extern

Definition at line 56 of file dwin.c.

Referenced by check_panels(), win_del(), and win_new().

◆ panel_win2

PANEL* panel_win2[MAXWIN]
extern

Definition at line 55 of file dwin.c.

Referenced by check_panels(), win2_new(), and win_del().

◆ ra

cchar_t ra

Definition at line 631 of file cm.h.

Referenced by initialize_local_colors().

◆ ran

cchar_t ran

Definition at line 631 of file cm.h.

Referenced by get_cmd_arg(), get_cmd_char(), initialize_local_colors(), picker(), and reverse_object().

◆ rs

cchar_t rs

Definition at line 501 of file cm.h.

Referenced by border_draw(), init_view_boxwin(), initialize_local_colors(), message_win(), and win_resize().

◆ rt

cchar_t rt

Definition at line 631 of file cm.h.

Referenced by border_hsplit_text(), border_title(), and initialize_local_colors().

◆ screen

SCREEN* screen
extern

Definition at line 42 of file dwin.c.

Referenced by destroy_curses(), open_curses(), ui_init(), and ui_shutdown().

◆ sig_received

volatile sig_atomic_t sig_received
extern

Definition at line 31 of file sig.c.

Referenced by dxwgetch(), handle_signal(), popup_ckeys(), signal_handler(), and xwgetch().

◆ sp

◆ src_line

int src_line
extern

the line number of the source file being processed, for error messages

Definition at line 172 of file dwin.c.

Referenced by verify_dir(), and verify_file().

◆ src_name

char* src_name
extern

the name of the source file being processed, for error messages

Definition at line 173 of file dwin.c.

Referenced by verify_dir(), and verify_file().

◆ stdio_names_str

char stdio_names_str[MAXLEN]
extern

◆ tl

cchar_t tl

◆ tr

cchar_t tr

Definition at line 501 of file cm.h.

Referenced by border_draw(), init_view_boxwin(), initialize_local_colors(), message_win(), and win_resize().

◆ ts

◆ tty_fd

int tty_fd
extern

the file descriptor for the terminal, for error messages and other output

Global file/pipe numbers

Definition at line 219 of file dwin.c.

◆ tty_fp

FILE* tty_fp
extern

Definition at line 43 of file dwin.c.

Referenced by destroy_curses(), open_curses(), ui_init(), and ui_shutdown().

◆ ua

cchar_t ua

Definition at line 631 of file cm.h.

Referenced by initialize_local_colors().

◆ wait_timeout

int wait_timeout
extern

Definition at line 152 of file futil.c.

Referenced by form_process(), process_config_file(), and write_config().

◆ win_attr

int win_attr
extern

Ncurses attributes for the current window, such as color pair, bold, etc.

Definition at line 162 of file dwin.c.

◆ win_attr_even

int win_attr_even
extern

Ncurses attributes for the current window even lines, which may be different from the attributes for odd lines to create a striped effect in the window.

◆ win_attr_odd

int win_attr_odd
extern

Ncurses attributes for the current window odd lines, which may be different from the attributes for even lines to create a striped effect in the window.

◆ win_box

WINDOW* win_box[MAXWIN]
extern

◆ win_ptr

int win_ptr
extern

Pointer to the current window pair, box and window, which can be used to keep track of the currently active window and its associated box.

Definition at line 164 of file dwin.c.

Referenced by action_disposition(), answer_yn(), bare_box_new(), box_hsplit_new(), destroy_curses(), display_error(), display_form(), menu_cmd_processor(), menu_engine(), open_curses(), open_pick_win(), Perror(), popup_ckeys(), restore_wins(), ui_init(), wait_mk_win(), win2_new(), win_del(), win_new(), and win_resize().

◆ win_win

◆ win_win2

WINDOW* win_win2[MAXWIN]
extern

array of pointers to windows

Definition at line 51 of file dwin.c.

Referenced by check_panels(), destroy_curses(), open_curses(), open_pick_win(), restore_wins(), win2_new(), and win_del().