use string fields for some stuff in ast_channel

const-ify some more APIs
remove 'type' field from ast_channel, in favor of the one in the channel's tech structure
allow string field module users to specify the 'chunk size' for pool allocations
update chan_alsa to be compatible with recent const-ification patches


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2006-02-01 23:05:28 +00:00
parent f246b9fc64
commit a16ae226b6
45 changed files with 306 additions and 317 deletions

40
frame.c
View File

@@ -655,9 +655,9 @@ static char frame_show_codec_n_usage[] =
" Displays codec mapping\n";
/*! Dump a frame for debugging purposes */
void ast_frame_dump(char *name, struct ast_frame *f, char *prefix)
void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix)
{
char *n = "unknown";
const char noname[] = "unknown";
char ftype[40] = "Unknown Frametype";
char cft[80];
char subclass[40] = "Unknown Subclass";
@@ -666,13 +666,16 @@ void ast_frame_dump(char *name, struct ast_frame *f, char *prefix)
char cn[60];
char cp[40];
char cmn[40];
if (name)
n = name;
if (!name)
name = noname;
if (!f) {
ast_verbose("%s [ %s (NULL) ] [%s]\n",
term_color(cp, prefix, COLOR_BRMAGENTA, COLOR_BLACK, sizeof(cp)),
term_color(cft, "HANGUP", COLOR_BRRED, COLOR_BLACK, sizeof(cft)),
term_color(cn, n, COLOR_YELLOW, COLOR_BLACK, sizeof(cn)));
term_color(cn, name, COLOR_YELLOW, COLOR_BLACK, sizeof(cn)));
return;
}
/* XXX We should probably print one each of voice and video when the format changes XXX */
@@ -795,22 +798,21 @@ void ast_frame_dump(char *name, struct ast_frame *f, char *prefix)
}
if (!ast_strlen_zero(moreinfo))
ast_verbose("%s [ TYPE: %s (%d) SUBCLASS: %s (%d) '%s' ] [%s]\n",
term_color(cp, prefix, COLOR_BRMAGENTA, COLOR_BLACK, sizeof(cp)),
term_color(cft, ftype, COLOR_BRRED, COLOR_BLACK, sizeof(cft)),
f->frametype,
term_color(csub, subclass, COLOR_BRCYAN, COLOR_BLACK, sizeof(csub)),
f->subclass,
term_color(cmn, moreinfo, COLOR_BRGREEN, COLOR_BLACK, sizeof(cmn)),
term_color(cn, n, COLOR_YELLOW, COLOR_BLACK, sizeof(cn)));
term_color(cp, prefix, COLOR_BRMAGENTA, COLOR_BLACK, sizeof(cp)),
term_color(cft, ftype, COLOR_BRRED, COLOR_BLACK, sizeof(cft)),
f->frametype,
term_color(csub, subclass, COLOR_BRCYAN, COLOR_BLACK, sizeof(csub)),
f->subclass,
term_color(cmn, moreinfo, COLOR_BRGREEN, COLOR_BLACK, sizeof(cmn)),
term_color(cn, name, COLOR_YELLOW, COLOR_BLACK, sizeof(cn)));
else
ast_verbose("%s [ TYPE: %s (%d) SUBCLASS: %s (%d) ] [%s]\n",
term_color(cp, prefix, COLOR_BRMAGENTA, COLOR_BLACK, sizeof(cp)),
term_color(cft, ftype, COLOR_BRRED, COLOR_BLACK, sizeof(cft)),
f->frametype,
term_color(csub, subclass, COLOR_BRCYAN, COLOR_BLACK, sizeof(csub)),
f->subclass,
term_color(cn, n, COLOR_YELLOW, COLOR_BLACK, sizeof(cn)));
term_color(cp, prefix, COLOR_BRMAGENTA, COLOR_BLACK, sizeof(cp)),
term_color(cft, ftype, COLOR_BRRED, COLOR_BLACK, sizeof(cft)),
f->frametype,
term_color(csub, subclass, COLOR_BRCYAN, COLOR_BLACK, sizeof(csub)),
f->subclass,
term_color(cn, name, COLOR_YELLOW, COLOR_BLACK, sizeof(cn)));
}