Merge changes from team/group/appdocsxml

This commit introduces the first phase of an effort to manage documentation of the
interfaces in Asterisk in an XML format.  Currently, a new format is available for
applications and dialplan functions.  A good number of conversions to the new format
are also included.

For more information, see the following message to asterisk-dev:

http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2008-11-01 21:10:07 +00:00
parent 1fef0f63bb
commit 5b168ee34b
111 changed files with 8063 additions and 2478 deletions

View File

@@ -199,32 +199,72 @@ char *term_color(char *outbuf, const char *inbuf, int fgcolor, int bgcolor, int
return outbuf;
}
static void check_fgcolor(int *fgcolor, int *attr)
{
if (*fgcolor & 128) {
*attr = ast_opt_light_background ? 0 : ATTR_BRIGHT;
*fgcolor &= ~128;
}
if (ast_opt_light_background) {
*fgcolor = opposite(*fgcolor);
}
}
static void check_bgcolor(int *bgcolor)
{
if (*bgcolor) {
*bgcolor &= ~128;
}
}
static int check_colors_allowed(int fgcolor)
{
return (!vt100compat || !fgcolor) ? 0 : 1;
}
int ast_term_color_code(struct ast_str **str, int fgcolor, int bgcolor)
{
int attr = 0;
if (!check_colors_allowed(fgcolor)) {
return -1;
}
check_fgcolor(&fgcolor, &attr);
check_bgcolor(&bgcolor);
if (ast_opt_force_black_background) {
ast_str_append(str, 0, "%c[%d;%d;%dm", ESC, attr, fgcolor, COLOR_BLACK + 10);
} else if (bgcolor) {
ast_str_append(str, 0, "%c[%d;%d;%dm", ESC, attr, fgcolor, bgcolor + 10);
} else {
ast_str_append(str, 0, "%c[%d;%dm", ESC, attr, fgcolor);
}
return 0;
}
char *term_color_code(char *outbuf, int fgcolor, int bgcolor, int maxout)
{
int attr = 0;
if ((!vt100compat) || (!fgcolor)) {
if (!check_colors_allowed(fgcolor)) {
*outbuf = '\0';
return outbuf;
}
if (fgcolor & 128) {
attr = ast_opt_light_background ? 0 : ATTR_BRIGHT;
fgcolor &= ~128;
}
if (ast_opt_light_background) {
fgcolor = opposite(fgcolor);
}
if (bgcolor) {
bgcolor &= ~128;
}
check_fgcolor(&fgcolor, &attr);
check_bgcolor(&bgcolor);
if (ast_opt_force_black_background) {
snprintf(outbuf, maxout, "%c[%d;%d;%dm", ESC, attr, fgcolor, COLOR_BLACK + 10);
} else if (bgcolor) {
snprintf(outbuf, maxout, "%c[%d;%d;%dm", ESC, attr, fgcolor, bgcolor + 10);
} else {
snprintf(outbuf, maxout, "%c[%d;%dm", ESC, attr, fgcolor);
}
return outbuf;
}