apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <jwool...@virginia.edu>
Subject Re: cvs commit: httpd-2.0/modules/filters mod_include.c
Date Thu, 28 Feb 2002 17:57:50 GMT
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
   cliffwoolley@yahoo.com
   Charlottesville, VA



Mime
View raw message