rtl433
UNKNOWN
RTL-433 utility
|
Terminal control utility functions. More...
Data Structures | |
struct | console |
Typedefs | |
typedef struct console | console_t |
Functions | |
static WORD | _term_get_win_color (BOOL fore, term_color_t color) |
static void | _term_set_color (console_t *console, BOOL fore, term_color_t color) |
static void | _term_free (console_t *console) |
static BOOL | _term_has_color (console_t *console) |
static void * | _term_init (FILE *fp) |
int | term_get_columns (void *ctx) |
int | term_has_color (void *ctx) |
void * | term_init (FILE *fp) |
void | term_free (void *ctx) |
void | term_ring_bell (void *ctx) |
void | term_set_fg (void *ctx, term_color_t color) |
void | term_set_bg (void *ctx, term_color_t color) |
int | term_set_color_map (int ascii_idx, term_color_t color) |
Change the default color map. More... | |
int | term_get_color_map (int ascii_idx) |
Returns the current color-value ('enum term_color') for color-index. More... | |
int | term_puts (void *ctx, char const *buf) |
Like 'term_printf()', but no var-arg format. More... | |
int | term_printf (void *ctx, char const *format,...) |
int | term_help_puts (void *ctx, char const *buf) |
Like 'term_help_printf()', but no var-arg format. More... | |
int | term_help_printf (char const *format,...) |
Variables | |
static term_color_t | color_map [] |
Terminal control utility functions.
Copyright (C) 2018 Christian Zuckschwerdt
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
static |
References console::file, console::hnd, and console::info.
Referenced by term_free().
|
static |
References TERM_COLOR_BLACK, TERM_COLOR_BLUE, TERM_COLOR_BRIGHT_BLACK, TERM_COLOR_BRIGHT_BLUE, TERM_COLOR_BRIGHT_CYAN, TERM_COLOR_BRIGHT_GREEN, TERM_COLOR_BRIGHT_MAGENTA, TERM_COLOR_BRIGHT_RED, TERM_COLOR_BRIGHT_WHITE, TERM_COLOR_BRIGHT_YELLOW, TERM_COLOR_CYAN, TERM_COLOR_GREEN, TERM_COLOR_MAGENTA, TERM_COLOR_RED, TERM_COLOR_RESET, TERM_COLOR_WHITE, and TERM_COLOR_YELLOW.
Referenced by _term_set_color().
|
static |
References console::hnd, and console::redirected.
Referenced by term_has_color().
|
static |
References _term_set_color(), console::file, console::hnd, console::info, console::redirected, and TERM_COLOR_RESET.
Referenced by term_init().
|
static |
References _term_get_win_color(), console::bg, console::fg, console::file, console::hnd, console::info, TERM_COLOR_BLACK, TERM_COLOR_RESET, and TERM_COLOR_WHITE.
Referenced by _term_init(), term_set_bg(), and term_set_fg().
void term_free | ( | void * | ctx | ) |
References _term_free(), and term_has_color().
Referenced by data_output_kv_free(), and term_help_printf().
int term_get_color_map | ( | int | idx | ) |
Returns the current color-value ('enum term_color') for color-index.
'idx'. This index goes from ASCII '0' to 'X'. 'X' = '0' + the dimension of the internal 'color_map[]'.
References color_map.
Referenced by term_help_puts(), and term_puts().
int term_get_columns | ( | void * | ctx | ) |
References console::hnd.
Referenced by print_kv_data().
int term_has_color | ( | void * | ctx | ) |
References _term_has_color().
Referenced by data_output_kv_create(), term_free(), and term_help_printf().
int term_help_printf | ( | char const * | format, |
... | |||
) |
References term_free(), term_has_color(), term_help_puts(), and term_init().
int term_help_puts | ( | void * | ctx, |
const char * | buf | ||
) |
Like 'term_help_printf()', but no var-arg format.
Simply takes a 0-terminated buffer.
References color_map, console::file, strlen(), term_get_color_map(), and term_set_fg().
Referenced by term_help_printf().
void* term_init | ( | FILE * | fp | ) |
References _term_init().
Referenced by data_output_kv_create(), and term_help_printf().
int term_printf | ( | void * | ctx, |
char const * | format, | ||
... | |||
) |
References term_puts().
int term_puts | ( | void * | ctx, |
const char * | buf | ||
) |
Like 'term_printf()', but no var-arg format.
Simply takes a 0-terminated buffer.
References console::file, strlen(), term_get_color_map(), and term_set_fg().
Referenced by term_printf().
void term_ring_bell | ( | void * | ctx | ) |
Referenced by print_kv_data().
void term_set_bg | ( | void * | ctx, |
term_color_t | color | ||
) |
References _term_set_color(), and TERM_COLOR_RESET.
int term_set_color_map | ( | int | idx, |
term_color_t | color | ||
) |
Change the default color map.
By default, the color-codes maps to these foreground colour: "~0": always restores terminal-colors; TERM_COLOR_RESET. "~1": print using TERM_COLOR_GREEN. "~2": print using TERM_COLOR_WHITE. "~3": print using TERM_COLOR_BLUE. "~4": print using TERM_COLOR_CYAN. "~5": print using TERM_COLOR_MAGENTA. "~6": print using TERM_COLOR_YELLOW. "~7": print using TERM_COLOR_BLACK. "~8": print using TERM_COLOR_RED.
References color_map.
void term_set_fg | ( | void * | ctx, |
term_color_t | color | ||
) |
References _term_set_color(), and TERM_COLOR_RESET.
Referenced by print_kv_data(), term_help_puts(), and term_puts().
|
static |
Referenced by term_get_color_map(), term_help_puts(), and term_set_color_map().