23 #ifndef _ASTERISK_TERM_H
24 #define _ASTERISK_TERM_H
26 #if defined(__cplusplus) || defined(c_plusplus)
50 #define COLOR_BLACK 30
51 #define COLOR_GRAY (30 | 128)
53 #define COLOR_BRRED (31 | 128)
54 #define COLOR_GREEN 32
55 #define COLOR_BRGREEN (32 | 128)
56 #define COLOR_BROWN 33
57 #define COLOR_YELLOW (33 | 128)
59 #define COLOR_BRBLUE (34 | 128)
60 #define COLOR_MAGENTA 35
61 #define COLOR_BRMAGENTA (35 | 128)
63 #define COLOR_BRCYAN (36 | 128)
64 #define COLOR_WHITE 37
65 #define COLOR_BRWHITE (37 | 128)
71 #define COLORIZE_FMT "%s%s%s"
72 #define COLORIZE(fg, bg, str) ast_term_color(fg,bg),str,ast_term_reset()
75 #define AST_TERM_MAX_ESCAPE_CHARS 23
76 #define AST_TERM_MAX_ROTATING_BUFFERS 15
90 char *
term_color(
char *outbuf,
const char *
inbuf,
int fgcolor,
int bgcolor,
int maxout);
131 char *
term_color_code(
char *outbuf,
int fgcolor,
int bgcolor,
int maxout);
142 void term_filter_escapes(
char *line);
144 const char *term_end(
void);
146 const char *term_quit(
void);
148 #if defined(__cplusplus) || defined(c_plusplus)
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()
char * term_color_code(char *outbuf, int fgcolor, int bgcolor, int maxout)
Write a color sequence to a string.
char * term_color(char *outbuf, const char *inbuf, int fgcolor, int bgcolor, int maxout)
Colorize a specified string by adding terminal color codes.
Support for dynamic strings.
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.