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 <pthread.h>
#include <signal.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <time.h>
#include <wait.h>
#include <wchar.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
struct  Argv
struct  CmField
struct  Date
struct  String
struct  Time
struct  WCStr

Macros

#define _(String)
#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 bindtextdomain(Package, Directory)
#define Ctrl(c)
#define DEFAULTSHELL   "/bin/bash"
#define DIV_ROUND_UP(n, d)
#define F_NO_STDERR   1
#define KEY_ALTF(n)
#define KEY_ALTF0   0x138
#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 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 N_(String)
#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 textdomain(Domain)
#define to_lowercase(c)
#define to_uppercase(c)
#define to_uppercase(c)

Typedefs

typedef unsigned char uchar

Enumerations

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
}
 Used for xterm256 color conversions. More...
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 *)
 Convert a string to an unsigned long with optional size suffixes.
int a_toi (char *, bool *)
 a safer alternative to atoi() for converting ASCII strings to integers.
bool base_name (char *, char *)
 Returns the base name of a file specification.
size_t canonicalize_file_spec (char *)
 Removes quotes and trims at first space.
bool capture_program_tioctl ()
 capture_program_tioctl() - capture program terminal settings
bool capture_shell_tioctl ()
 capture_shell_tioctl() - capture shell terminal settings
int cf_accept (UiSurface *, ss_t w, char *, uint, uint, uint)
 Accepts input for a field in a C-Menu window.
bool chrep (char *, char, char)
 Replaces all occurrences of old_chr in s with new_chr in place.
bool construct_file_spec (char *, char *, char *, char *, char *, uint)
int destroy_argv (uint argc, char **argv)
 Deallocates memory allocated for argument strings in argv.
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 **)
int display_curses_keys ()
void dump_opts ()
void dump_opts_by_use (char *, char *)
uint enter_option ()
bool expand_tilde (char *, uint)
 Expand a tilde (~) in a file path to 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, uint)
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.
char * get_ip_addresses (char *, uint)
 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)
void init_stdscr ()
bool is_directory (const char *)
 Check if a given path is a directory.
bool is_hex_str (char *, uint)
 Validates that a string consists of exactly len hexadecimal digits.
bool is_image_file (const char *filename)
bool is_newer (char *, char *)
 Checks if the file specified by "fut" is newer than the file specified by "control".
bool is_symlink_to_dir (const char *)
 Check if a given path is a symbolic link that points to a directory.
bool is_valid_date (uint yyyy, uint mm, uint dd)
 Check if a given date is valid, including leap years.
bool is_valid_regex (const char *)
 Check if a given path is a regular file.
bool is_valid_time (uint hh, uint mm, uint ss)
 Check if a given time is valid.
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.
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.
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.
bool parse_local_timestamp (const char *, time_t *)
 Parses an ISO 8601 timestamp string in local time and converts it to time_t.
char * rep_substring (const char *, const char *, const char *) __attribute__((nonnull(1
 Replace all occurrences of "tgt_s" in "org_s" with "rep_s".
bool restore_program_tioctl ()
 restore_program_tioctl() - restore program terminal settings
bool restore_shell_tioctl ()
 restore_shell_tioctl() - restore shell terminal settings
void restore_wins ()
void right_justify (char *, uint)
 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.
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 *,...)
 Custom safe string formatting utility (Variadic version).
char * stdio_fdnames (char *, char *)
char * stdio_names (char *, char *)
bool str_subc (char *, char *, char, char *, uint)
 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 *, uint)
 Converts a string into an array of argument strings.
bool str_to_bool (const char *)
 Converts String to boolean true or false.
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.
char * strerror__r (int errnum, char *buf, size_t buflen)
 A thread-safe alternative to strerror() that writes the error message corresponding to errnum into the provided buffer.
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
char 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, uint)
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
size_t strnz__pcat (char *d, size_t pos, const char *s, size_t max_len)
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.
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 *, uint)
 Verifies that the directory specified by "spec" exists and is accessible with the permissions specified by "imode".
bool verify_dir_q (char *, uint)
bool verify_file (char *, uint)
 Verifies that the file specified by "in_spec" exists and is accessible with the permissions specified by "imode".
bool verify_file_q (char *, uint)
bool verify_spec_arg (char *, char *, char *, char *, uint)
 Verify file specification argument.
size_t vssnprintf (char *buf, size_t buf_size, const char *format, va_list args)
 Custom safe string formatting utility (va_list version).
bool wait_destroy (UiChyron *)
UiChyron * wait_mk_chyron ()
bool waitpid_with_timeout (pid_t, uint)
void win_del ()
void win_init_attrs ()
void win_resize (uint, uint, char *)
void win_Toggle_Attrs ()

Variables

uint dbgfd
char errmsg []
int exit_code
bool f_debug
bool f_have_program_tioctl = false
bool f_have_shell_tioctl = false
bool f_program_open
bool f_restore_screen
char fn [MAXLEN]
uint mbegx
uint mbegy
uint mcols
uint mg_action
uint mg_col
uint mg_line
uint mlines
uint n_cols
uint n_lines
struct termios shell_err_tioctl program_err_tioctl
struct termios shell_in_tioctl program_in_tioctl
struct termios shell_out_tioctl program_out_tioctl
struct termios shell_tioctl program_tioctl
volatile sig_atomic_t sig_received = 0
uint src_line
char * src_name
int stderr_fd
int stdin_fd
char stdio_names_str [4096]
int stdout_fd
FILE * tty_fp
int wait_timeout
uint16_t win_attr

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

◆ _

#define _ ( String)
Value:
Definition cm.h:412

Definition at line 49 of file cm.h.

◆ __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 278 of file cm.h.

278#define __atexit \
279 { \
280 int rc; \
281 rc = atexit(end_pgm); \
282 if (rc != 0) { \
283 fprintf(stderr, "\nCannot set exit function\n"); \
284 exit(EXIT_FAILURE); \
285 } \
286 }

◆ _GNU_SOURCE

#define _GNU_SOURCE

Definition at line 15 of file cm.h.

◆ _XOPEN_SOURCE_EXTENDED

#define _XOPEN_SOURCE_EXTENDED   1

Enable wide character support

Definition at line 16 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 155 of file cm.h.

155#define ABS(x) \
156 ({ \
157 __typeof__(x) _a = (x); \
158 _a < 0 ? -_a : _a; \
159 })

◆ bindtextdomain

#define bindtextdomain ( Package,
Directory )

Definition at line 52 of file cm.h.

◆ Ctrl

#define Ctrl ( c)
Value:
((c) & 0x1f)

Definition at line 70 of file cm.h.

◆ DEFAULTSHELL

#define DEFAULTSHELL   "/bin/bash"
              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

Definition at line 265 of file cm.h.

◆ DIV_ROUND_UP

#define DIV_ROUND_UP ( n,
d )
Value:
(((n) + (d) - 1) / (d))

Definition at line 85 of file cm.h.

◆ F_NO_STDERR

#define F_NO_STDERR   1

Definition at line 250 of file cm.h.

◆ KEY_ALTF

#define KEY_ALTF ( n)
Value:
(KEY_ALTF0 + (n))
#define KEY_ALTF0
Definition cm.h:334

define alt function keys

Definition at line 335 of file cm.h.

◆ KEY_ALTF0

#define KEY_ALTF0   0x138

Definition at line 334 of file cm.h.

◆ MAX

#define MAX ( a,
b )
Value:
({ \
typeof(a) _a = (a); \
typeof(y) _b = (b); \
_a > _b ? _a : _b; \
})

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.

#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
Note
The following macro provides a safer alternative to param.h

Definition at line 130 of file cm.h.

130#define MAX(a, b) \
131 ({ \
132 typeof(a) _a = (a); \
133 typeof(y) _b = (b); \
134 _a > _b ? _a : _b; \
135 })

◆ max

#define max ( a,
b )
Value:
({ \
__typeof__(a) _a = (a); \
__typeof__(a) _b = (b); \
_a > _b ? _a : _b; \
})

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 100 of file cm.h.

100#define max(a, b) \
101 ({ \
102 __typeof__(a) _a = (a); \
103 __typeof__(a) _b = (b); \
104 _a > _b ? _a : _b; \
105 })

◆ MAX_ARGS

#define MAX_ARGS   64

maximum number of arguments for external commands

Definition at line 65 of file cm.h.

◆ MAXARGS

#define MAXARGS   64

maximum number of arguments

Definition at line 67 of file cm.h.

◆ MAXLEN

#define MAXLEN   256

maximum length for strings and buffers

Definition at line 66 of file cm.h.

◆ MAXWIN [1/2]

#define MAXWIN   30

maximum number of windows that can be created

Definition at line 59 of file cm.h.

◆ MAXWIN [2/2]

#define MAXWIN   30

maximum number of windows that can be created

Definition at line 59 of file cm.h.

◆ MIN

#define MIN ( x,
y )
Value:
({ \
typeof(x) _x = (x); \
typeof(y) _y = (y); \
(void)(&_x == &_y); \
_x < _y ? _x : _y; \
})

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 140 of file cm.h.

140#define MIN(x, y) \
141 ({ \
142 typeof(x) _x = (x); \
143 typeof(y) _y = (y); \
144 (void)(&_x == &_y); \
145 _x < _y ? _x : _y; \
146 })

◆ min

#define min ( x,
y )
Value:
({ \
typeof(x) _x = (x); \
typeof(x) _y = (y); \
(void)(&_x == &_y); \
_x < _y ? _x : _y; \
})

min macro evaluates two expressions, returning least result

Definition at line 107 of file cm.h.

107#define min(x, y) \
108 ({ \
109 typeof(x) _x = (x); \
110 typeof(x) _y = (y); \
111 (void)(&_x == &_y); \
112 _x < _y ? _x : _y; \
113 })

◆ N_

#define N_ ( String)
Value:

Definition at line 50 of file cm.h.

◆ NCURSES_WIDECHAR

#define NCURSES_WIDECHAR   1

Enable wide character support

Definition at line 17 of file cm.h.

◆ nullptr

#define nullptr   NULL

Definition at line 56 of file cm.h.

◆ S_QUIET

#define S_QUIET   0x2000

quiet mode flag for file validation

Definition at line 267 of file cm.h.

◆ S_TOLOWER

#define S_TOLOWER ( c)
Value:
({ \
int __c = (c); \
(__c >= 'A' && __c <= 'Z') ? (__c + ('a' - 'A')) : __c; \
})

Definition at line 160 of file cm.h.

160#define S_TOLOWER(c) \
161 ({ \
162 int __c = (c); \
163 (__c >= 'A' && __c <= 'Z') ? (__c + ('a' - 'A')) : __c; \
164 })

◆ S_TOUPPER

#define S_TOUPPER ( c)
Value:
({ \
int __c = (c); \
(__c >= 'a' && __c <= 'z') ? (__c - ('a' - 'A')) : __c; \
})

Definition at line 165 of file cm.h.

165#define S_TOUPPER(c) \
166 ({ \
167 int __c = (c); \
168 (__c >= 'a' && __c <= 'z') ? (__c - ('a' - 'A')) : __c; \
169 })

◆ S_WCOK

#define S_WCOK   0x1000

write or create permitted

Definition at line 266 of file cm.h.

◆ SCR_COLS

#define SCR_COLS   1024

maximum number of columns in the terminal screen

Definition at line 68 of file cm.h.

◆ SCREEN_MAX_LINES

#define SCREEN_MAX_LINES   100

Definition at line 69 of file cm.h.

◆ textdomain

#define textdomain ( Domain)

Definition at line 51 of file cm.h.

◆ to_lowercase

#define to_lowercase ( c)
Value:
if (c >= 'A' && c <= 'Z') \
c += ' '

to_lowercase(c) - convert an uppercase letter to lowercase

Definition at line 176 of file cm.h.

176#define to_lowercase(c) \
177 if (c >= 'A' && c <= 'Z') \
178 c += ' '

◆ to_uppercase [1/2]

#define to_uppercase ( c)
Value:
if (c >= 'a' && c <= 'z') \
c -= ' '

to_uppercase(c) - convert a lowercase letter to uppercase

simple macro to convert a character to uppercase

Definition at line 172 of file cm.h.

172#define to_uppercase(c) \
173 if (c >= 'a' && c <= 'z') \
174 c -= ' '

◆ to_uppercase [2/2]

#define to_uppercase ( c)
Value:
if (c >= 'a' && c <= 'z') \
c -= ' '

to_uppercase(c) - convert a lowercase letter to uppercase

simple macro to convert a character to uppercase

Definition at line 172 of file cm.h.

172#define to_uppercase(c) \
173 if (c >= 'a' && c <= 'z') \
174 c -= ' '

Typedef Documentation

◆ uchar

typedef unsigned char uchar

Definition at line 348 of file cm.h.

Enumeration Type Documentation

◆ 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 212 of file cm.h.

212 {
213 F_F0, // 0
214 F_FIFO, // 1
215 F_CHR, // 2
216 F_F1, // 3
217 F_DIR, // 4
218 F_F2, // 5
219 F_BLK, // 6
220 F_F3, // 7
221 F_REG, // 8
222 F_F4, // 9
223 F_LNK, // 10
224 F_F5, // 11
225 F_SOCK, // 12
226 F_F6, // 13
227 F_UNKNOWN, // 14
228} F_Type;
F_Type
Definition cm.h:212
@ F_REG
Definition cm.h:221
@ F_BLK
Definition cm.h:219
@ F_FIFO
Definition cm.h:214
@ F_F0
Definition cm.h:213
@ F_F3
Definition cm.h:220
@ F_SOCK
Definition cm.h:225
@ F_CHR
Definition cm.h:215
@ F_F5
Definition cm.h:224
@ F_F1
Definition cm.h:216
@ F_DIR
Definition cm.h:217
@ F_UNKNOWN
Definition cm.h:227
@ F_F2
Definition cm.h:218
@ F_F4
Definition cm.h:222
@ F_LNK
Definition cm.h:223
@ F_F6
Definition cm.h:226

◆ LFFlags

enum LFFlags

Used for xterm256 color conversions.

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 183 of file cm.h.

183 {
185 LF_HIDE = 0b00000001,
186 LF_ICASE = 0b00000010,
187 LF_EXC_REGEX = 0b00000100,
188 LF_REGEX = 0b00001000,
189 LF_EXEC = 0b00010000,
190 LF_USER = 0b00100000,
193 LF_IXUSR = 0b00000001,
194 LF_IWUSR = 0b00000010,
195 LF_IRUSR = 0b00000100,
196 LF_ISGID = 0b00010000,
197 LF_ISUID = 0b00100000,
198} LFFlags;
LFFlags
Used for xterm256 color conversions.
Definition cm.h:183
@ LF_EXC_REGEX
Definition cm.h:187
@ LF_HIDE
Definition cm.h:185
@ LF_ISUID
Definition cm.h:197
@ LF_IRUSR
Definition cm.h:195
@ LF_ICASE
Definition cm.h:186
@ LF_ISGID
Definition cm.h:196
@ LF_EXEC
Definition cm.h:189
@ LF_REGEX
Definition cm.h:188
@ LF_USER
Definition cm.h:190
@ LF_IXUSR
Definition cm.h:193
@ LF_IWUSR
Definition cm.h:194

◆ 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 201 of file cm.h.

201 {
202 LF_FIFO = 0b00000001,
203 LF_CHR = 0b00000010,
204 LF_DIR = 0b00000100,
205 LF_BLK = 0b00001000,
206 LF_REG = 0b00010000,
207 LF_LNK = 0b00100000,
208 LF_SOCK = 0b01000000,
209 LF_UNKNOWN = 0b10000000
210} LFTypes;
LFTypes
Definition cm.h:201
@ LF_FIFO
Definition cm.h:202
@ LF_UNKNOWN
Definition cm.h:209
@ LF_SOCK
Definition cm.h:208
@ LF_BLK
Definition cm.h:205
@ LF_CHR
Definition cm.h:203
#define LF_DIR
Definition futil.c:44
#define LF_REG
Definition futil.c:45
#define LF_LNK
Definition futil.c:43

Function Documentation

◆ cf_accept()

int cf_accept ( UiSurface * sfc,
ss_t w,
char * accept_s,
uint flin,
uint fcol,
uint flen )
extern

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

Parameters
UiSurface*sfc The surface to accept input from
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 (UIKEY_ENTER, UIKEY_F09, 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

UIKEY_IC toggles insert mode

UIKEY_DC deletes character at cursor

UIKEY_HOME moves cursor to start of field

UIKEY_BACKSPACE deletes character before cursor

UIKEY_LEFT moves cursor left one character

UIKEY_RIGHT moves cursor right one character

Handles mouse events for field editing

Definition at line 41 of file cm_fields.c.

41 {
42 bool f_insert = false;
43 int in_key = 0;
44 char *s, *d;
45 char *fstart;
46 UiEvent event;
47
48 click_x = click_y = -1;
49 char *p = fstart = accept_s;
50 char *fend = fstart + flen;
51 int x = fcol;
52 char *str_end = p + strlen(p);
53 while (1) {
54 if (in_key == 0) {
55 ui_mvwaddstr(sfc, w, flin, fcol, accept_s);
56 ui_wclrtoeol(sfc, w);
57 ui_cursor_move(sfc, w, flin, x);
58 ui_render();
59 in_key = ui_get_event(sfc, w, NULL, &event, -1);
60 }
61 ui_curs_set(0);
62 switch (in_key) {
63 case UIKEY_F09:
64 in_key = UIKEY_F09;
65 return (in_key);
66 case '\t':
67 case UIKEY_END:
68 case Ctrl('e'):
69 while (*p != '\0')
70 p++;
71 x = fcol + (p - fstart);
72 in_key = 0;
73 continue;
77 case '\n':
78 case UIKEY_ENTER:
80 *p = '\0';
81 in_key = UIKEY_ENTER;
82 return (in_key);
84 case UIKEY_IC:
85 f_insert = !f_insert;
86 in_key = 0;
87 continue;
89 case UIKEY_DC:
90 s = p + 1;
91 d = p;
92 while (*s != '\0')
93 *d++ = *s++;
94 *d = '\0';
95 str_end = d;
96 f_insert = false;
97 in_key = 0;
98 continue;
100 case UIKEY_HOME:
101 case Ctrl('a'):
102 p = fstart;
103 x = fcol;
104 in_key = 0;
105 continue;
107 case UIKEY_BACKSPACE:
108 if (p > fstart) {
109 p--;
110 x--;
111 }
112 s = p + 1;
113 d = p;
114 while (*s != '\0')
115 *d++ = *s++;
116 *d = '\0';
117 str_end = d;
118 in_key = 0;
119 continue;
121 case UIKEY_LEFT:
122 if (p > fstart) {
123 p--;
124 x--;
125 }
126 in_key = 0;
127 continue;
129 case UIKEY_RIGHT:
130 if (p < fend && p < str_end) {
131 p++;
132 x++;
133 }
134 in_key = 0;
135 continue;
137 case UIKEY_BUTTON1:
138 x = click_x;
139 flin = click_y;
140 fstart = accept_s;
141 fend = fstart + flen;
142 str_end = fstart + strlen(fstart);
143 p = fstart + (x - fcol);
144 if (p > str_end)
145 x -= p - str_end;
146 p = min(p, str_end);
147 in_key = 0;
148 continue;
149 default:
150 if (p >= fend) {
151 in_key = 0;
152 continue;
153 }
154 if (in_key < ' ' || in_key > '~') {
155 in_key = 0;
156 continue;
157 }
158 if (f_insert) {
159 if (str_end < fend) {
160 s = str_end - 1;
161 d = str_end;
162 while (s >= p)
163 *d-- = *s--;
164 *p++ = in_key;
165 str_end++;
166 x++;
167 }
168 } else {
169 if (p < fend) {
170 if (p < str_end) {
171 if (p == accept_s && in_key == ' ') {
172 d = accept_s;
173 s = accept_s + 1;
174 while (*s != '\0')
175 *d++ = *s++;
176 *d = '\0';
177 in_key = 0;
178 continue;
179 }
180 *p++ = in_key;
181 x++;
182 } else if (p == str_end) {
183 *p++ = in_key;
184 *p = '\0';
185 str_end = p;
186 x++;
187 }
188 }
189 }
190 in_key = 0;
191 continue;
192 }
193 }
194}
#define Ctrl(c)
Definition cm.h:70
void ui_render()
Render the UI by updating panels and refreshing the display.
Definition ui_ncurses.c:931
int ui_cursor_move(UiSurface *s, ss_t w, uint y, uint x)
Move the cursor to a specified position within a UiSurface.
Definition ui_ncurses.c:698
int ui_curs_set(int visibility)
Set the visibility of the cursor.
Definition ui_ncurses.c:881
int ui_wclrtoeol(UiSurface *s, ss_t w)
Clear to the end of the line in a surface window.
#define UIKEY_DC
#define UIKEY_BACKSPACE
#define UIKEY_LEFT
#define UIKEY_F09
#define UIKEY_IC
#define UIKEY_END
#define UIKEY_BUTTON1
#define UIKEY_RIGHT
#define UIKEY_HOME
#define UIKEY_ENTER
int ui_get_event(UiSurface *s, ss_t w, UiChyron *chyron, UiEvent *ev, int timeout_ms)
Read input events.
int click_x
Definition ui_common.c:30
int click_y
Definition ui_common.c:29
int ui_mvwaddstr(UiSurface *s, ss_t w, uint y, uint x, const char *text)
Draw a text string at a specific position in a surface window.
#define min(x, y)
Definition lf.h:158
bool f_erase_remainder
Structure to hold field information for C-Menu.
Definition cm_fields.c:30

References click_x, click_y, f_erase_remainder, ui_curs_set(), ui_cursor_move(), ui_get_event(), ui_mvwaddstr(), ui_render(), and ui_wclrtoeol().

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 * ,
uint  )
extern

◆ display_argv_error_msg()

void display_argv_error_msg ( char * ,
char **  )
extern

◆ display_curses_keys()

int display_curses_keys ( )
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()

uint enter_option ( )
extern

◆ fill_field()

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

Definition at line 1736 of file futil.c.

1737 {
1738 char *s = accept_s;
1739 char *d = display_s;
1740 char *e = d + flen;
1741 while (*s != '\0' && d < e)
1742 *d++ = *s++;
1743 while (d < e)
1744 *d++ = fill_char;
1745 *d = '\0';
1746 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 ncurses_input(), and ui_get_event().

Here is the caller graph for this function:

◆ init_stdscr()

void init_stdscr ( )
extern

◆ is_image_file()

bool is_image_file ( const char * filename)
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 1572 of file futil.c.

1573 {
1574 if (l == 0) {
1575 String str;
1576 str.l = 0;
1577 str.s = nullptr;
1578 return str;
1579 }
1580 String str;
1581 str.l = l + 1;
1582 str.s = (char *)malloc(str.l);
1583 str.s[0] = '\0';
1584 return str;
size_t l
Definition cm.h:414
char * s
Definition cm.h:413

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

◆ rep_substring()

char * rep_substring ( const char * org_s,
const char * tgt_s,
const char * rep_s )
extern

Replace all occurrences of "tgt_s" in "org_s" with "rep_s".

Replace all occurrences of a target substring in a string with a replacement substring.

Parameters
org_s- original string
tgt_s- target substring to replace
rep_s- replacement substring
Returns
A pointer to the newly allocated string with replacements or a copy of the replacement string if original string is the same as target string This is a special case that allows for replacing the entire original string. If any parameter is nullptr, the function returns nullptr. If "tgt_s" is not found in "org_s", the function returns a copy of "org_s". If target substring is not found the function returns a copy of the original string.
Note
allocates memory for the return value, so the caller is responsible for freeing this memory when it is no longer needed to avoid memory leaks. Does not modify the original string "org_s".
Assumes that "tgt_s" and "rep_s" are null-terminated strings. If they are not, the behavior is undefined.
Does not perform any bounds checking on the input strings, so it is the caller's responsibility to ensure that they are valid and that the resulting string does not exceed available memory.
Uses the standard library functions strlen, strstr, malloc, and strcpy, which may have their own limitations and behaviors that the caller should be aware of.
Does not handle overlapping occurrences of "tgt_s" in "org_s". If "tgt_s" can overlap with itself in "org_s", the behavior may be unexpected. The caller should ensure that "tgt_s" does not contain overlapping patterns to avoid this issue.
Does not handle cases where "tgt_s" is a substring of "rep_s", which could lead to unintended consequences if "tgt_s" appears in "rep_s". The caller should ensure that "tgt_s" and "rep_s" are distinct to avoid this issue.
Parameters
org_s- the original string
tgt_s- the target substring to be replaced
rep_s- the replacement substring
Returns
a newly allocated string with replacements made, or nullptr on error

This function searches for all occurrences of the target substring in the original string and replaces them with the replacement substring. It handles edge cases such as empty strings and overlapping substrings. The caller is responsible for freeing the returned string.

Definition at line 1471 of file futil.c.

1472 {
1473 if (*org_s == '\0' || *tgt_s == '\0' || *rep_s == '\0')
1474 return nullptr;
1475 if (strstr(org_s, tgt_s) == nullptr)
1476 return strdup(org_s);
1477 if (strstr(rep_s, tgt_s) != nullptr)
1478 return nullptr;
1479 if (tgt_s == rep_s || tgt_s == org_s || rep_s == org_s)
1480 return strdup(org_s);
1481 if (strcmp(org_s, tgt_s) == 0)
1482 return strdup(rep_s);
1483 char *out_s, *ip, *tmp;
1484 uint tgt_l = strlen(tgt_s);
1485 uint rep_l = strlen(rep_s);
1486 uint head_l;
1487 uint n = 0;
1488 ip = (char *)org_s;
1489 while ((tmp = strstr(ip, tgt_s)) != nullptr) {
1490 n++;
1491 ip = tmp + tgt_l;
1492 }
1493 out_s = malloc(strlen(org_s) + (rep_l - tgt_l) * n + 1);
1494 if (!out_s) {
1495 return nullptr;
1496 }
1497 tmp = out_s;
1498 ip = (char *)org_s;
1499 while (n--) {
1500 char *p = strstr(ip, tgt_s);
1501 head_l = p - ip;
1502 strnz__cpy(tmp, ip, head_l);
1503 tmp += head_l;
1504 strnz__cpy(tmp, rep_s, MAXLEN - 1);
1505 tmp += rep_l;
1506 ip += head_l + tgt_l;
1507 }
1508 strnz__cpy(tmp, ip, MAXLEN - 1);
1509 return out_s;
#define MAXLEN
Definition lf.h:38
size_t strnz__cpy(char *d, const char *s, size_t max_len)
safer alternative to strncpy
Definition futil.c:526

References strnz__cpy().

Referenced by exec_objects(), expand_tilde(), expand_tilde(), and form_exec_receiver().

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

◆ restore_wins()

void restore_wins ( )
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 307 of file futil.c.

307 {
308 if (s == nullptr || *s == '\0')
309 return (size_t)0;
310 char *p = s + strlen(s) - 1;
311 while (p >= s && *p == ' ')
312 p--;
313 *(p + 1) = '\0';
314 return (size_t)(p - s + 1);
315}

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 * stdio_str,
char * id )
extern

Definition at line 1130 of file futil.c.

1131 {
1132 if (!stdio_str)
1133 return nullptr;
1134 char buf[MAXLEN] = {'\0'};
1135 char buf0[MAXLEN] = {'\0'};
1136 ssnprintf(buf, MAXLEN - 1, "%s: ", id);
1137 strnz__cpy(stdio_str, buf, MAXLEN - 1);
1138 for (int i = 0; i < 16; i++) {
1139 if (fdname(i, buf0) != nullptr) {
1140 ssnprintf(buf, 4095, " fd%d=%s", i, buf0);
1141 strnz__cat(stdio_str, buf, MAXLEN - 1);
1142 strnz__cat(stdio_str, ",", MAXLEN - 1);
1143 }
1144 }
1145 return stdio_str;
size_t ssnprintf(char *buf, size_t buf_size, const char *format,...)
Custom safe string formatting utility (Variadic version).
Definition futil.c:398
size_t strnz__cat(char *d, const char *s, size_t max_len)
safer alternative to strncat
Definition futil.c:558
char * fdname(int fd, char *out_path)
Retrieves the file path associated with a given file descriptor.
Definition futil.c:1095

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

Referenced by form_process(), init_pick(), 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 * stdio_str,
char * id )
extern

Definition at line 1105 of file futil.c.

1106 {
1107 if (!stdio_str)
1108 return nullptr;
1109 char buf[MAXLEN] = {'\0'};
1110 char err_str[MAXLEN] = {'\0'};
1111 errno = 0;
1112 ssnprintf(buf, MAXLEN - 1, "%s - ", id);
1113 strnz__cpy(stdio_str, buf, MAXLEN - 1);
1114 strnz__cat(stdio_str, ttyname(0), MAXLEN - 1);
1115 strnz__cat(stdio_str, ", ", MAXLEN - 1);
1116 if (errno)
1117 ssnprintf(err_str, MAXLEN - 1, "Error fd %d: %s\n", 0, strerror(errno));
1118
1119 strnz__cat(stdio_str, ttyname(1), MAXLEN - 1);
1120 strnz__cat(stdio_str, ", ", MAXLEN - 1);
1121 if (errno)
1122 ssnprintf(err_str, MAXLEN - 1, _("Error fd %d: %s\n"), 1, strerror(errno));
1123
1124 strnz__cat(stdio_str, ttyname(2), MAXLEN - 1);
1125 strnz__cat(stdio_str, ", ", MAXLEN - 1);
1126 if (errno)
1127 ssnprintf(err_str, MAXLEN - 1, _("Error fd %d: %s\n"), 2, strerror(errno));
1128
1129 return stdio_str;
#define _(String)
Definition amort.c:23

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

Referenced by fork_exec(), and menu_cmd_processor().

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 982 of file futil.c.

983 {
984 if (s == nullptr || *s == '\0')
985 return false;
986 switch (s[0]) {
987 case 't':
988 case 'T':
989 case 'y':
990 case 'Y':
991 case '1':
992 return true;
993 case 'o':
994 case 'O':
995 switch (s[1]) {
996 case 'n':
997 case 'N':
998 return true;
999 default:
1000 break;
1001 }
1002 default:
1003 break;
1004 }
1005 return false;

Referenced by process_config_file().

Here is the caller graph for this function:

◆ strnfill()

bool strnfill ( char * ,
char ,
uint  )
extern

◆ strnz__pcat()

size_t strnz__pcat ( char * d,
size_t pos,
const char * s,
size_t max_len )

Definition at line 577 of file futil.c.

577 {
578 if (d == nullptr || s == nullptr)
579 return 0;
580 if (max_len == 0)
581 return 0;
582 char *e;
583 size_t len = pos;
584 d += pos;
585 e = d + max_len;
586 while (*s != '\0' && *s != '\n' && *s != '\r' && d < e) {
587 *d++ = *s++;
588 len++;
589 }
590 *d = '\0';
591 return len;
592}

◆ user_end()

void user_end ( )
extern

◆ verify_dir_q()

bool verify_dir_q ( char * ,
uint  )
extern

◆ verify_file_q()

bool verify_file_q ( char * ,
uint  )
extern

◆ wait_destroy()

bool wait_destroy ( UiChyron * )
extern

◆ wait_mk_chyron()

UiChyron * wait_mk_chyron ( )
extern

◆ waitpid_with_timeout()

bool waitpid_with_timeout ( pid_t ,
uint  )
extern

◆ win_del()

void win_del ( )
extern

◆ win_init_attrs()

void win_init_attrs ( )
extern

◆ win_resize()

void win_resize ( uint ,
uint ,
char *  )
extern

◆ win_Toggle_Attrs()

void win_Toggle_Attrs ( )
extern

Variable Documentation

◆ dbgfd

uint dbgfd
extern

the file descriptor for debug output, for debugging purposes

◆ errmsg

char errmsg
extern

Global variables for error reporting

Definition at line 125 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 31 of file ui_common.c.

◆ f_debug

bool f_debug
extern

a flag to indicate whether debug output should be printed, for debugging purposes see termios.h

◆ f_have_program_tioctl

bool f_have_program_tioctl = false
extern

program tioctl captured

Definition at line 25 of file scriou.c.

Referenced by capture_program_tioctl(), and restore_program_tioctl().

◆ f_have_shell_tioctl

bool f_have_shell_tioctl = false
extern

shell tioctl captured

Definition at line 24 of file scriou.c.

Referenced by capture_shell_tioctl(), and restore_shell_tioctl().

◆ f_program_open

bool f_program_open
extern

program mode is active

◆ f_restore_screen

bool f_restore_screen
extern

whether to restore the screen

◆ fn

char fn
extern

function name for error messages

Definition at line 45 of file ui_common.c.

Referenced by verify_dir(), and verify_file().

◆ mbegx

uint 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

uint 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

uint 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

uint 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

uint 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

uint 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

uint 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.

◆ n_cols

uint n_cols
extern

number of columns in the terminal

◆ n_lines

uint n_lines
extern

number of lines in the terminal

◆ program_err_tioctl

struct termios shell_err_tioctl program_err_tioctl
extern

Definition at line 37 of file scriou.c.

Referenced by capture_program_tioctl(), and restore_program_tioctl().

◆ program_in_tioctl

struct termios shell_in_tioctl program_in_tioctl
extern

Definition at line 35 of file scriou.c.

Referenced by capture_program_tioctl(), and restore_program_tioctl().

◆ program_out_tioctl

struct termios shell_out_tioctl program_out_tioctl
extern

Definition at line 36 of file scriou.c.

Referenced by capture_program_tioctl(), and restore_program_tioctl().

◆ program_tioctl

struct termios shell_tioctl program_tioctl
extern

Definition at line 34 of file scriou.c.

◆ sig_received

volatile sig_atomic_t sig_received = 0
extern

Definition at line 32 of file sig.c.

Referenced by handle_signal(), ncurses_input(), signal_handler(), and ui_get_event().

◆ src_line

uint src_line
extern

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

Definition at line 43 of file ui_common.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 44 of file ui_common.c.

Referenced by verify_dir(), and verify_file().

◆ stderr_fd

int stderr_fd
extern

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

Definition at line 62 of file lf.c.

◆ stdin_fd

int stdin_fd
extern

the file descriptor for the terminal, for error messages

Definition at line 78 of file ui_common.c.

◆ stdio_names_str

char stdio_names_str
extern

Definition at line 121 of file futil.c.

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

◆ stdout_fd

int stdout_fd
extern

the file descriptor for the terminal, for error messages

Definition at line 78 of file ui_common.c.

◆ tty_fp

FILE* tty_fp
extern

◆ wait_timeout

int wait_timeout
extern

Definition at line 139 of file futil.c.

◆ win_attr

uint16_t win_attr
extern

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

Definition at line 34 of file ui_common.c.