23 #ifndef _ASTERISK_TERM_H 24 #define _ASTERISK_TERM_H 26 #if defined(__cplusplus) || defined(c_plusplus) 47 #define COLOR_BLACK 30 48 #define COLOR_GRAY (30 | 128) 50 #define COLOR_BRRED (31 | 128) 51 #define COLOR_GREEN 32 52 #define COLOR_BRGREEN (32 | 128) 53 #define COLOR_BROWN 33 54 #define COLOR_YELLOW (33 | 128) 56 #define COLOR_BRBLUE (34 | 128) 57 #define COLOR_MAGENTA 35 58 #define COLOR_BRMAGENTA (35 | 128) 60 #define COLOR_BRCYAN (36 | 128) 61 #define COLOR_WHITE 37 62 #define COLOR_BRWHITE (37 | 128) 67 #define COLORIZE_FMT "%s%s%s" 68 #define COLORIZE(fg, bg, str) ast_term_color(fg,bg),str,ast_term_reset() 71 #define AST_TERM_MAX_ESCAPE_CHARS 23 72 #define AST_TERM_MAX_ROTATING_BUFFERS 15 86 char *
term_color(
char *outbuf,
const char *
inbuf,
int fgcolor,
int bgcolor,
int maxout);
127 char *
term_color_code(
char *outbuf,
int fgcolor,
int bgcolor,
int maxout);
144 #if defined(__cplusplus) || defined(c_plusplus) const char * term_quit(void)
int ast_term_color_code(struct ast_str **str, int fgcolor, int bgcolor)
Append a color sequence to an ast_str.
char * term_strip(char *outbuf, const char *inbuf, int maxout)
Remove colorings from a specified string.
static int inbuf(struct baseio *bio, FILE *fi)
utility used by inchar(), for base_encode()
const char * term_end(void)
char * term_color_code(char *outbuf, int fgcolor, int bgcolor, int maxout)
Write a color sequence to a string.
void term_filter_escapes(char *line)
char * term_color(char *outbuf, const char *inbuf, int fgcolor, int bgcolor, int maxout)
Colorize a specified string by adding terminal color codes.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
const char * ast_term_reset(void)
Returns the terminal reset code.
const char * ast_term_color(int fgcolor, int bgcolor)
Return a color sequence string.