apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject bucket deletion, macro caps
Date Fri, 16 Feb 2001 02:11:44 GMT

I'm still trying to come up with ways to make the bucket API easier to use.
Here are my latest musings:

These sequences are very common:


The two almost but not quite always go together.  That brings up two issues
in my mind:

(1) It'd be cool to have a third macro that combines the two, both to save
typing and to try to avoid removing without destroying (a memory leak) or
vice versa (a broken brigade).  The only problem I'm having is coming up
with a name for a new macro to combine the two.  I had to resort to the
APR_BUCKET_AMPUTATE were probably the most amusing possibilities...
APR_BUCKET_DELETE is probably the most appropriate.  Does that sound good?

(2) I'm ambivalent about the lingering non-capitalization of
apr_bucket_destroy|read|split|setaside|copy.  On the one hand, these things
really are just calls to a single function (well, almost), so lower case is
okay.  And it's consistent with apr_brigade_destroy, apr_bucket_foo_create,
and so on, which really ARE functions.  On the other hand, they're almost
the only macros with lowercase names.  I guess the only reason they're lower
case is that I left them that way when I converted them to macros in the
first place--it was easier at the time because it didn't affect any of the
callers.  But now I'm really torn.  It seems like it'd be a real pain for
someone new to the bucket API to remember which case goes with which
function/macro name.  I can remember, and I'm sure most of you can too, but
then again we've been looking at these things since they were created.  What
do you all think?  Is the documentation sufficient?  Or is a mass rename in
order, on the premise that consistency is a Good Thing?  Which way IS
consistent?  I could be convinced either way.


    Cliff Woolley
    Charlottesville, VA

View raw message