Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 19352 invoked from network); 10 Dec 2004 05:47:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Dec 2004 05:47:47 -0000 Received: (qmail 48310 invoked by uid 500); 10 Dec 2004 05:47:44 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 48277 invoked by uid 500); 10 Dec 2004 05:47:44 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 48263 invoked by uid 99); 10 Dec 2004 05:47:44 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Message-ID: <41B9389D.4030803@xbc.nu> Date: Fri, 10 Dec 2004 06:48:13 +0100 From: =?UTF-8?B?QnJhbmtvIMSMaWJlag==?= User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nick Kew Cc: dev@apr.apache.org Subject: Re: apr_dbd: a generic SQL wrapper References: <41B9081D.7080706@xbc.nu> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at amis.net X-Spam-Status: No, hits=-2.584 required=5 tests=AWL, BAYES_00 X-Spam-Level: X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Nick Kew wrote: >On Fri, 10 Dec 2004, Branko �^Libej wrote: > > > >>Nick Kew wrote: >> >> >> >>>/* These are opaque structs. Instantiation is up to each backend */ >>>#ifndef APR_DBD_INTERNAL >>>typedef struct apr_dbd_t apr_dbd_t; >>>typedef struct apr_dbd_transaction apr_dbd_transaction; >>>typedef struct apr_dbd_results apr_dbd_results; >>>typedef struct apr_dbd_row apr_dbd_row; >>>typedef struct apr_dbd_prepared apr_dbd_prepared; >>>#endif >>> >>> >>> >>> >>If these are truly internal, they shouldn't be declared in the public >>header, even #ifdefed out. That's a small nit, but I thought I'd mention >>ti since it leaped out at me. >> >> > >They're not internal. Applications need to know them all to pass to >functions in the API. It's the instantiations that are internal. > >The #ifndef is because *drivers* have to declare them before >#including apr_dbd.h. > > They don't have to declare them before including the header. This sequence is completely valid: typedef struct foo foo; struct foo { int bar; }; IOW, the typedef serves as a forward declaration of the structure. So that #ifdef can go away. -- Brane