23#ifndef _ASTERISK_TERM_H
24#define _ASTERISK_TERM_H
26#if defined(__cplusplus) || defined(c_plusplus)
51#define COLOR_GRAY (30 | 128)
53#define COLOR_BRRED (31 | 128)
55#define COLOR_BRGREEN (32 | 128)
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)
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
90char *
term_color(
char *outbuf,
const char *
inbuf,
int fgcolor,
int bgcolor,
int maxout);
131char *
term_color_code(
char *outbuf,
int fgcolor,
int bgcolor,
int maxout);
148#if defined(__cplusplus) || defined(c_plusplus)
Support for dynamic strings.
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.
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.
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.
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()