[asterisk-dev] RFC: move
struct ast_format to include/asterisk/file.h ?
Luigi Rizzo
rizzo at icir.org
Thu Feb 2 11:11:38 MST 2006
On Thu, Feb 02, 2006 at 11:46:45AM -0600, Kevin P. Fleming wrote:
> Luigi Rizzo wrote:
>
> > related - what's the purpose of AST_FRIENDLY_OFFSET that is
> > used in various places ?
> > i understand that it is some extra leading space that
> > one tries to leave empty to possibly accommodate headers etc,
> > but what is the invariant that we can use to be sure that
> > we do not move before the beginning ?
>
> That is exactly what it is for. I don't understand your last question,
> though.
so you have 3 data-related fields in a buffer:
offset
data
datalen;
i suppose that if you move data x bytes behind, you do
if (offset < x)
<error, offset too large>
else {
offset -= x;
data -= x;
datalen += x;
}
correct ?
btw - many of the ast_filestream fields in format_*.c have one
'empty' field between the 'waste[AST_FRIENDLY_OFFSET]'
and the actuall buffer. What is this for, just safety belt ?
cheers
luigi
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
More information about the asterisk-dev
mailing list