You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Branko Čibej <br...@xbc.nu> on 2005/08/10 11:21:37 UTC
Re: svn commit: r231136 - in /apr/apr-util/trunk: dbd/apr_dbd.c dbd/apr_dbd_internal.h
include/apr_dbd.h
niq@apache.org wrote:
>Author: niq
>Date: Tue Aug 9 16:15:03 2005
>New Revision: 231136
>
>URL: http://svn.apache.org/viewcvs?rev=231136&view=rev
>Log:
>Revise apr_dbd to hide driver struct from public API
> - so it can be extended without touching any public structs
>
>
[...]
>Modified: apr/apr-util/trunk/dbd/apr_dbd.c
>URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/dbd/apr_dbd.c?rev=231136&r1=231135&r2=231136&view=diff
>==============================================================================
>--- apr/apr-util/trunk/dbd/apr_dbd.c (original)
>+++ apr/apr-util/trunk/dbd/apr_dbd.c Tue Aug 9 16:15:03 2005
>@@ -16,8 +16,11 @@
>
> #include <stdio.h>
>
>+#define APR_DBD_C
>
>
[...]
>+#ifndef APR_DBD_INTERNAL
>+typedef struct apr_dbd_t apr_dbd_t;
>+typedef struct apr_dbd_transaction_t apr_dbd_transaction_t;
>+typedef struct apr_dbd_results_t apr_dbd_results_t;
>+typedef struct apr_dbd_row_t apr_dbd_row_t;
>+typedef struct apr_dbd_prepared_t apr_dbd_prepared_t;
>+#endif
>
>
[...]
>Modified: apr/apr-util/trunk/include/apr_dbd.h
>URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/include/apr_dbd.h?rev=231136&r1=231135&r2=231136&view=diff
>==============================================================================
>--- apr/apr-util/trunk/include/apr_dbd.h (original)
>+++ apr/apr-util/trunk/include/apr_dbd.h Tue Aug 9 16:15:03 2005
>@@ -25,8 +25,10 @@
> extern "C" {
> #endif
>
>+#if defined APR_DBD_INTERNAL || defined APR_DBD_C
>+#include "apr_dbd_internal.h"
>+#else
>
>
Please don't do this. Conditionally including private headers from
public ones is evil, and it's not necessary anyway.
Just put the forward declarations of the opaque structures inth
apr_dbd.h, loose the APR_DBD_INTERNAL and APR_DBD_C defines, and let the
implementation files include apr_dbd_internal.h when they need it. You
can move apr_dbd_internal.h back to the dbd directory then.
-- Brane