Terminal Routines. More...
#include "asterisk.h"
#include "asterisk/_private.h"
#include <sys/time.h>
#include <signal.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "asterisk/term.h"
#include "asterisk/lock.h"
#include "asterisk/utils.h"
Go to the source code of this file.
Functions | |
int | ast_term_color_code (struct ast_str **str, int fgcolor, int bgcolor) |
Append a color sequence to an ast_str. More... | |
int | ast_term_init (void) |
static void | check_bgcolor (int *bgcolor) |
static int | check_colors_allowed (int fgcolor) |
static void | check_fgcolor (int *fgcolor, int *attr) |
static short | convshort (char *s) |
static int | opposite (int color) |
char * | term_color (char *outbuf, const char *inbuf, int fgcolor, int bgcolor, int maxout) |
char * | term_color_code (char *outbuf, int fgcolor, int bgcolor, int maxout) |
Write a color sequence to a string. More... | |
char * | term_end (void) |
void | term_filter_escapes (char *line) |
char * | term_prep (void) |
char * | term_prompt (char *outbuf, const char *inbuf, int maxout) |
char * | term_quit (void) |
char * | term_strip (char *outbuf, const char *inbuf, int maxout) |
Variables | |
static char | enddata [80] = "" |
static char | prepdata [80] = "" |
static char | quitdata [80] = "" |
static const char *const | termpath [] |
static int | vt100compat |
Terminal Routines.
Definition in file term.c.
int ast_term_color_code | ( | struct ast_str ** | str, |
int | fgcolor, | ||
int | bgcolor | ||
) |
Append a color sequence to an ast_str.
str | The string to append to |
fgcolor | foreground color |
bgcolor | background color |
0 | success |
-1 | failure |
Definition at line 242 of file term.c.
References ast_opt_force_black_background, ast_str_append(), check_bgcolor(), check_colors_allowed(), check_fgcolor(), COLOR_BLACK, and ESC.
Referenced by ast_xmldoc_printable(), data_result_print_cli(), and data_result_print_cli_node().
int ast_term_init | ( | void | ) |
Provided by term.c
Definition at line 87 of file term.c.
References ast_opt_console, ast_opt_force_black_background, ast_opt_light_background, ast_opt_no_color, ATTR_BRIGHT, ATTR_RESET, COLOR_BLACK, COLOR_BROWN, COLOR_WHITE, convshort(), and ESC.
Referenced by main().
|
static |
Definition at line 230 of file term.c.
Referenced by ast_term_color_code(), and term_color_code().
|
static |
|
static |
Definition at line 218 of file term.c.
References ast_opt_light_background, ATTR_BRIGHT, and opposite().
Referenced by ast_term_color_code(), and term_color_code().
|
static |
Definition at line 72 of file term.c.
Referenced by ast_term_init().
|
static |
Definition at line 57 of file term.c.
References COLOR_BLACK, COLOR_BLUE, COLOR_BROWN, COLOR_CYAN, COLOR_GREEN, COLOR_MAGENTA, and COLOR_RED.
Referenced by check_fgcolor(), and term_color().
char* term_color | ( | char * | outbuf, |
const char * | inbuf, | ||
int | fgcolor, | ||
int | bgcolor, | ||
int | maxout | ||
) |
Definition at line 184 of file term.c.
References ast_copy_string(), ast_opt_force_black_background, ast_opt_light_background, ATTR_BRIGHT, COLOR_BLACK, COLOR_WHITE, ESC, and opposite().
Referenced by __ast_custom_function_register(), __ast_register_translator(), ast_frame_dump(), ast_register_application2(), ast_unregister_translator(), fix_header(), handle_cli_agi_show(), handle_dahdi_show_cadences(), handle_show_function(), handle_showmancmd(), logger_print_normal(), lua_pbx_exec(), main(), pbx_extension_helper(), print_app_docs(), realtime_exec(), show_config_description(), and start_resource().
char* term_color_code | ( | char * | outbuf, |
int | fgcolor, | ||
int | bgcolor, | ||
int | maxout | ||
) |
Write a color sequence to a string.
outbuf | the location to write to |
fgcolor | foreground color |
bgcolor | background color |
maxout | maximum number of characters to write |
Definition at line 264 of file term.c.
References ast_opt_force_black_background, check_bgcolor(), check_colors_allowed(), check_fgcolor(), COLOR_BLACK, and ESC.
Referenced by cli_prompt().
char* term_end | ( | void | ) |
Definition at line 365 of file term.c.
References enddata.
Referenced by ast_xmldoc_printable(), consolehandler(), and main().
void term_filter_escapes | ( | char * | line | ) |
Definition at line 338 of file term.c.
Referenced by ast_log().
char* term_prep | ( | void | ) |
char* term_prompt | ( | char * | outbuf, |
const char * | inbuf, | ||
int | maxout | ||
) |
Definition at line 309 of file term.c.
References ast_copy_string(), ast_opt_force_black_background, ast_opt_light_background, ATTR_BRIGHT, COLOR_BLACK, COLOR_BLUE, COLOR_WHITE, and ESC.
char* term_quit | ( | void | ) |
Definition at line 370 of file term.c.
References quitdata.
Referenced by ast_el_read_char(), main(), and really_quit().
char* term_strip | ( | char * | outbuf, |
const char * | inbuf, | ||
int | maxout | ||
) |
Definition at line 287 of file term.c.
Referenced by action_command(), ast_log_vsyslog(), and logger_print_normal().
|
static |
Definition at line 47 of file term.c.
Referenced by term_end().
|
static |
Definition at line 46 of file term.c.
Referenced by term_prep().
|
static |
Definition at line 48 of file term.c.
Referenced by term_quit().