On Wed, 27 Feb 2002, Brian Pane wrote:
> >> + if (!APR_BRIGADE_EMPTY(ctx->ssi_tag_brigade)) {
> >> + for (;;) {
> >> + apr_bucket *e =
> >> APR_BRIGADE_LAST(ctx->ssi_tag_brigade);
> >> + if (e == APR_BRIGADE_SENTINEL(ctx->ssi_tag_brigade))
> >> {
> >> + break;
> >> + }
> >> + APR_BUCKET_REMOVE(e);
> >> + APR_BRIGADE_INSERT_HEAD(bb, e);
> >> + }
> >> }
> >>
>
> I was thinking about APR_BRIGADE_CONCAT, but what I really needed
> was APR_BRIGADE_PREPEND because _CONCAT would have left bb empty.
> Is there a "prepend" variant anywhere?
The following is equivalent to the above (except it runs in constant
time):
/* prepend ctx->ssi_tag_brigade onto bb */
APR_BRIGADE_CONCAT(ctx->ssi_tag_brigade, bb);
APR_BRIGADE_CONCAT(bb, ctx->ssi_tag_brigade);
But I'd be fine with adding a prepend macro in the API if others agree
it's useful.
--Cliff
--------------------------------------------------------------
Cliff Woolley
[EMAIL PROTECTED]
Charlottesville, VA