From dev-return-14579-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Tue Aug 16 02:24:36 2005 Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 51520 invoked from network); 16 Aug 2005 02:24:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Aug 2005 02:24:35 -0000 Received: (qmail 29942 invoked by uid 500); 16 Aug 2005 02:24:34 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 29904 invoked by uid 500); 16 Aug 2005 02:24:33 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 29891 invoked by uid 99); 16 Aug 2005 02:24:33 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2005 19:24:33 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [209.68.5.17] (HELO relay03.pair.com) (209.68.5.17) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 15 Aug 2005 19:24:53 -0700 Received: (qmail 90883 invoked from network); 16 Aug 2005 02:24:30 -0000 Received: from unknown (HELO ?192.168.0.3?) (unknown) by unknown with SMTP; 16 Aug 2005 02:24:30 -0000 X-pair-Authenticated: 24.4.253.245 Message-ID: <43014E5D.9080008@electricjellyfish.net> Date: Mon, 15 Aug 2005 19:24:29 -0700 From: Garrett Rooney User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050727) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@apr.apache.org Subject: APR_ARRAY_FOO convenience macros Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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: http://svn.collab.net/repos/svn/trunk/subversion/include/svn_types.h -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) [1] http://mail-archives.apache.org/mod_mbox/apr-dev/200312.mbox/%3c1071252440.1568.7093.camel@localhost.localdomain%3e [2] http://mail-archives.apache.org/mod_mbox/apr-dev/200312.mbox/%3cBA3254D8-2D04-11D8-A9BB-000393753936@gbiv.com%3e [3] http://mail-archives.apache.org/mod_mbox/apr-dev/200312.mbox/%3c20031212180702.B27042@lyra.org%3e