apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garrett Rooney <roo...@electricjellyfish.net>
Subject APR_ARRAY_FOO convenience macros
Date Tue, 16 Aug 2005 02:24:29 GMT
So back in Dec 2003 Sander Striker suggested [1] adding Subversion's 
macros for manipulating apr arrays (APR_ARRAY_IDX, which automates the 
casting needed to access entries in the array, and APR_ARRAY_PUSH, which 
automates the casting needed to add entries to the array) to 
apr_tables.h.  Roy Fielding commented [2] that he felt the macros tied 
the interface to the implementation too much, and Greg Stein replied [3] 
that they had to be done as macros, not functions, because of the need 
to pass a type name for the cast.  Conversation sort of died off there.

And here we are, years later, and I still find myself copying these 
macros into each and ever program I write that uses APR because without 
them I'm simply unable to use the apr array interface without looking up 
how to do it each and every time.  Does anyone have any reason we can't 
just add them?  The interface for these data structures is wide open, we 
can't change it without massive changes to each and every caller anyway, 
can we please just include the macros so apr arrays aren't such a 
collosal pain in the ass to actually use?

For the curious, the actual macros are here:


-garrett (who just screwed up the casting to access an apr array in a 
patch to mod_smtpd and would prefer to never have that happen again)




View raw message