![]() |
Home page |
Mailing list |
Docs
Asterisk developer's documentation :: Codename Pineapple
term.h File Reference
Definition in file term.h.
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Defines | |
| #define | ATTR_BLINK 5 |
| #define | ATTR_BRIGHT 1 |
| #define | ATTR_DIM 2 |
| #define | ATTR_HIDDEN 8 |
| #define | ATTR_RESET 0 |
| #define | ATTR_REVER 7 |
| #define | ATTR_UNDER 4 |
| #define | COLOR_BLACK 30 |
| #define | COLOR_BLUE 34 |
| #define | COLOR_BRBLUE (34 | 128) |
| #define | COLOR_BRCYAN (36 | 128) |
| #define | COLOR_BRGREEN (32 | 128) |
| #define | COLOR_BRMAGENTA (35 | 128) |
| #define | COLOR_BROWN 33 |
| #define | COLOR_BRRED (31 | 128) |
| #define | COLOR_BRWHITE (37 | 128) |
| #define | COLOR_CYAN 36 |
| #define | COLOR_GRAY (30 | 128) |
| #define | COLOR_GREEN 32 |
| #define | COLOR_MAGENTA 35 |
| #define | COLOR_RED 31 |
| #define | COLOR_WHITE 37 |
| #define | COLOR_YELLOW (33 | 128) |
| #define | ESC 0x1b |
Functions | |
| 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) |
| 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, char *inbuf, int maxout) |
|
|
|
|
|
Definition at line 32 of file term.h. Referenced by term_color(), term_color_code(), and term_prompt(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 39 of file term.h. Referenced by __ast_register_translator(), ast_frame_dump(), ast_unregister_translator(), cli_prompt(), handle_zap_show_cadences(), load_resource(), term_color(), term_color_code(), and term_prompt(). |
|
|
Definition at line 47 of file term.h. Referenced by term_prompt(). |
|
|
|
|
|
Definition at line 52 of file term.h. Referenced by ast_frame_dump(), ast_register_application(), pbx_extension_helper(), and realtime_exec(). |
|
|
Definition at line 44 of file term.h. Referenced by ast_frame_dump(). |
|
|
Definition at line 50 of file term.h. Referenced by ast_frame_dump(), pbx_extension_helper(), and realtime_exec(). |
|
|
Definition at line 45 of file term.h. Referenced by load_resource(). |
|
|
Definition at line 42 of file term.h. Referenced by ast_frame_dump(). |
|
|
Definition at line 54 of file term.h. Referenced by logger_print_normal(), and show_config_description(). |
|
|
Definition at line 51 of file term.h. Referenced by handle_show_application(), and handle_show_function(). |
|
|
Definition at line 40 of file term.h. Referenced by fix_header(). |
|
|
Definition at line 43 of file term.h. Referenced by handle_zap_show_cadences(). |
|
|
Definition at line 49 of file term.h. Referenced by __ast_register_translator(), ast_unregister_translator(), handle_show_application(), handle_show_function(), and handle_zap_show_cadences(). |
|
|
|
|
|
Definition at line 53 of file term.h. Referenced by cli_prompt(), term_color(), and term_prompt(). |
|
|
Definition at line 46 of file term.h. Referenced by ast_frame_dump(), and show_config_description(). |
|
|
Definition at line 30 of file term.h. Referenced by term_color(), term_color_code(), term_filter_escapes(), term_prompt(), and term_strip(). |
|
||||||||||||||||||||||||
|
Definition at line 150 of file term.c. References ATTR_BRIGHT, COLOR_BLACK, COLOR_WHITE, and ESC. Referenced by __ast_register_translator(), ast_frame_dump(), ast_register_application(), ast_unregister_translator(), fix_header(), handle_show_application(), handle_show_function(), handle_zap_show_cadences(), load_resource(), logger_print_normal(), pbx_extension_helper(), realtime_exec(), and show_config_description(). 00151 { 00152 int attr=0; 00153 char tmp[40]; 00154 if (!vt100compat) { 00155 ast_copy_string(outbuf, inbuf, maxout); 00156 return outbuf; 00157 } 00158 if (!fgcolor && !bgcolor) { 00159 ast_copy_string(outbuf, inbuf, maxout); 00160 return outbuf; 00161 } 00162 if ((fgcolor & 128) && (bgcolor & 128)) { 00163 /* Can't both be highlighted */ 00164 ast_copy_string(outbuf, inbuf, maxout); 00165 return outbuf; 00166 } 00167 if (!bgcolor) 00168 bgcolor = COLOR_BLACK; 00169 00170 if (bgcolor) { 00171 bgcolor &= ~128; 00172 bgcolor += 10; 00173 } 00174 if (fgcolor & 128) { 00175 attr = ATTR_BRIGHT; 00176 fgcolor &= ~128; 00177 } 00178 if (fgcolor && bgcolor) { 00179 snprintf(tmp, sizeof(tmp), "%d;%d", fgcolor, bgcolor); 00180 } else if (bgcolor) { 00181 snprintf(tmp, sizeof(tmp), "%d", bgcolor); 00182 } else if (fgcolor) { 00183 snprintf(tmp, sizeof(tmp), "%d", fgcolor); 00184 } 00185 if (attr) { 00186 snprintf(outbuf, maxout, "%c[%d;%sm%s%c[0;%d;%dm", ESC, attr, tmp, inbuf, ESC, COLOR_WHITE, COLOR_BLACK + 10); 00187 } else { 00188 snprintf(outbuf, maxout, "%c[%sm%s%c[0;%d;%dm", ESC, tmp, inbuf, ESC, COLOR_WHITE, COLOR_BLACK + 10); 00189 } 00190 return outbuf; 00191 }
|
|
||||||||||||||||||||
|
Definition at line 193 of file term.c. References ATTR_BRIGHT, COLOR_BLACK, and ESC. Referenced by cli_prompt(). 00194 { 00195 int attr=0; 00196 char tmp[40]; 00197 if ((!vt100compat) || (!fgcolor && !bgcolor)) { 00198 *outbuf = '\0'; 00199 return outbuf; 00200 } 00201 if ((fgcolor & 128) && (bgcolor & 128)) { 00202 /* Can't both be highlighted */ 00203 *outbuf = '\0'; 00204 return outbuf; 00205 } 00206 if (!bgcolor) 00207 bgcolor = COLOR_BLACK; 00208 00209 if (bgcolor) { 00210 bgcolor &= ~128; 00211 bgcolor += 10; 00212 } 00213 if (fgcolor & 128) { 00214 attr = ATTR_BRIGHT; 00215 fgcolor &= ~128; 00216 } 00217 if (fgcolor && bgcolor) { 00218 snprintf(tmp, sizeof(tmp), "%d;%d", fgcolor, bgcolor); 00219 } else if (bgcolor) { 00220 snprintf(tmp, sizeof(tmp), "%d", bgcolor); 00221 } else if (fgcolor) { 00222 snprintf(tmp, sizeof(tmp), "%d", fgcolor); 00223 } 00224 if (attr) { 00225 snprintf(outbuf, maxout, "%c[%d;%sm", ESC, attr, tmp); 00226 } else { 00227 snprintf(outbuf, maxout, "%c[%sm", ESC, tmp); 00228 } 00229 return outbuf; 00230 }
|
|
|
Definition at line 295 of file term.c. Referenced by consolehandler(). 00296 { 00297 return enddata; 00298 }
|
|
|
Definition at line 268 of file term.c. Referenced by ast_log(). 00269 { 00270 int i; 00271 int len = strlen(line); 00272 00273 for (i = 0; i < len; i++) { 00274 if (line[i] != ESC) 00275 continue; 00276 if ((i < (len - 2)) && 00277 (line[i + 1] == 0x5B)) { 00278 switch (line[i + 2]) { 00279 case 0x30: 00280 case 0x31: 00281 case 0x33: 00282 continue; 00283 } 00284 } 00285 /* replace ESC with a space */ 00286 line[i] = ' '; 00287 } 00288 }
|
|
|
Definition at line 290 of file term.c. 00291 { 00292 return prepdata; 00293 }
|
|
||||||||||||||||
|
Definition at line 253 of file term.c. References ATTR_BRIGHT, COLOR_BLACK, COLOR_BLUE, COLOR_WHITE, and ESC. 00254 { 00255 if (!vt100compat) { 00256 ast_copy_string(outbuf, inbuf, maxout); 00257 return outbuf; 00258 } 00259 snprintf(outbuf, maxout, "%c[%d;%d;%dm%c%c[%d;%d;%dm%s", 00260 ESC, ATTR_BRIGHT, COLOR_BLUE, COLOR_BLACK + 10, 00261 inbuf[0], 00262 ESC, 0, COLOR_WHITE, COLOR_BLACK + 10, 00263 inbuf + 1); 00264 return outbuf; 00265 }
|
|
|
Definition at line 300 of file term.c. 00301 { 00302 return quitdata; 00303 }
|
|
||||||||||||||||
|
Definition at line 232 of file term.c. References ESC. Referenced by ast_log_vsyslog(). 00233 { 00234 char *outbuf_ptr = outbuf, *inbuf_ptr = inbuf; 00235 00236 while (outbuf_ptr < outbuf + maxout) { 00237 switch (*inbuf_ptr) { 00238 case ESC: 00239 while (*inbuf_ptr && (*inbuf_ptr != 'm')) 00240 inbuf_ptr++; 00241 break; 00242 default: 00243 *outbuf_ptr = *inbuf_ptr; 00244 outbuf_ptr++; 00245 } 00246 if (! *inbuf_ptr) 00247 break; 00248 inbuf_ptr++; 00249 } 00250 return outbuf; 00251 }
|