Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 93544 invoked from network); 11 Aug 2005 08:51:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Aug 2005 08:51:24 -0000 Received: (qmail 54557 invoked by uid 500); 11 Aug 2005 08:51:23 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 54506 invoked by uid 500); 11 Aug 2005 08:51:23 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 54493 invoked by uid 99); 11 Aug 2005 08:51:23 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 11 Aug 2005 01:51:22 -0700 Received: (qmail 93537 invoked by uid 65534); 11 Aug 2005 08:51:22 -0000 Message-ID: <20050811085122.93536.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r231416 - in /apr/apr-util/trunk: dbd/apr_dbd_pgsql.c dbd/apr_dbd_sqlite2.c dbd/apr_dbd_sqlite3.c include/apr_dbd.h include/private/apr_dbd_internal.h Date: Thu, 11 Aug 2005 08:51:21 -0000 To: commits@apr.apache.org From: jorton@apache.org X-Mailer: svnmailer-1.0.3 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jorton Date: Thu Aug 11 01:51:16 2005 New Revision: 231416 URL: http://svn.apache.org/viewcvs?rev=231416&view=rev Log: * include/private/apr_dbd_internal.h: Include public header; remove duplicate typedefs and use of APR_DBD_INTERNAL. * include/apr_dbd.h: Unconditionally define the typedefs. * dbd/apr_dbd_sqlite2.c, dbd/apr_dbd_sqlite3.c, dbd/apr_dbd_pgsql.c: Include just the private header; remove duplicate typedefs and use of APR_DBD_INTERNAL. Modified: apr/apr-util/trunk/dbd/apr_dbd_pgsql.c apr/apr-util/trunk/dbd/apr_dbd_sqlite2.c apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c apr/apr-util/trunk/include/apr_dbd.h apr/apr-util/trunk/include/private/apr_dbd_internal.h Modified: apr/apr-util/trunk/dbd/apr_dbd_pgsql.c URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/dbd/apr_dbd_pgsql.c?rev=231416&r1=231415&r2=231416&view=diff ============================================================================== --- apr/apr-util/trunk/dbd/apr_dbd_pgsql.c (original) +++ apr/apr-util/trunk/dbd/apr_dbd_pgsql.c Thu Aug 11 01:51:16 2005 @@ -26,46 +26,42 @@ #include "apr_strings.h" #include "apr_time.h" -#define QUERY_MAX_ARGS 40 +#include "apr_dbd_internal.h" -typedef struct apr_dbd_t apr_dbd_t; +#define QUERY_MAX_ARGS 40 -typedef struct { +struct apr_dbd_transaction_t { int errnum; apr_dbd_t *handle; -} apr_dbd_transaction_t; +}; struct apr_dbd_t { PGconn *conn; apr_dbd_transaction_t *trans; }; -typedef struct { +struct apr_dbd_results_t { int random; PGconn *handle; PGresult *res; size_t ntuples; size_t sz; size_t index; -} apr_dbd_results_t; +}; -typedef struct { +struct apr_dbd_row_t { int n; apr_dbd_results_t *res; -} apr_dbd_row_t; +}; -typedef struct { +struct apr_dbd_prepared_t { const char *name; int prepared; -} apr_dbd_prepared_t; +}; #define dbd_pgsql_is_success(x) (((x) == PGRES_EMPTY_QUERY) \ || ((x) == PGRES_COMMAND_OK) \ || ((x) == PGRES_TUPLES_OK)) - -#define APR_DBD_INTERNAL -#include "apr_dbd_internal.h" -#include "apr_dbd.h" static int dbd_pgsql_select(apr_pool_t *pool, apr_dbd_t *sql, apr_dbd_results_t **results, Modified: apr/apr-util/trunk/dbd/apr_dbd_sqlite2.c URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/dbd/apr_dbd_sqlite2.c?rev=231416&r1=231415&r2=231416&view=diff ============================================================================== --- apr/apr-util/trunk/dbd/apr_dbd_sqlite2.c (original) +++ apr/apr-util/trunk/dbd/apr_dbd_sqlite2.c Thu Aug 11 01:51:16 2005 @@ -26,47 +26,38 @@ #include "apr_strings.h" #include "apr_time.h" -typedef struct apr_dbd_t apr_dbd_t; +#include "apr_dbd_internal.h" -typedef struct -{ +struct apr_dbd_transaction_t { int errnum; apr_dbd_t *handle; -} apr_dbd_transaction_t; +}; -struct apr_dbd_t -{ +struct apr_dbd_t { sqlite *conn; char *errmsg; apr_dbd_transaction_t *trans; }; -typedef struct -{ +struct apr_dbd_results_t { int random; sqlite *handle; char **res; size_t ntuples; size_t sz; size_t index; -} apr_dbd_results_t; +}; -typedef struct -{ +struct apr_dbd_row_t { int n; char **data; apr_dbd_results_t *res; -} apr_dbd_row_t; +}; -typedef struct -{ +struct apr_dbd_prepared_t { const char *name; int prepared; -} apr_dbd_prepared_t; - -#define APR_DBD_INTERNAL -#include "apr_dbd_internal.h" -#include "apr_dbd.h" +}; #define FREE_ERROR_MSG(dbd) \ do { \ Modified: apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c?rev=231416&r1=231415&r2=231416&view=diff ============================================================================== --- apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c (original) +++ apr/apr-util/trunk/dbd/apr_dbd_sqlite3.c Thu Aug 11 01:51:16 2005 @@ -26,17 +26,15 @@ #include "apr_strings.h" #include "apr_time.h" +#include "apr_dbd_internal.h" + #define MAX_RETRY_COUNT 15 #define MAX_RETRY_SLEEP 100000 -typedef struct apr_dbd_t apr_dbd_t; -typedef struct apr_dbd_results_t apr_dbd_results_t; -typedef struct apr_dbd_column_t apr_dbd_column_t; -typedef struct apr_dbd_row_t apr_dbd_row_t; -typedef struct { +struct apr_dbd_transaction_t { int errnum; apr_dbd_t *handle; -} apr_dbd_transaction_t; +}; struct apr_dbd_t { sqlite3 *conn; @@ -45,6 +43,13 @@ apr_pool_t *pool; }; +typedef struct { + char *name; + char *value; + int size; + int type; +} apr_dbd_column_t; + struct apr_dbd_row_t { apr_dbd_results_t *res; apr_dbd_column_t **columns; @@ -53,13 +58,6 @@ int rownum; }; -struct apr_dbd_column_t { - char *name; - char *value; - int size; - int type; -}; - struct apr_dbd_results_t { int random; sqlite3 *handle; @@ -69,19 +67,13 @@ int tuples; }; - - -typedef struct { +struct apr_dbd_prepared_t { const char *name; int prepared; -} apr_dbd_prepared_t; +}; #define dbd_sqlite3_is_success(x) (((x) == SQLITE_DONE ) \ || ((x) == SQLITE_OK )) - -#define APR_DBD_INTERNAL -#include "apr_dbd_internal.h" -#include "apr_dbd.h" static int dbd_sqlite3_select(apr_pool_t * pool, apr_dbd_t * sql, apr_dbd_results_t ** results, const char *query, int seek) { Modified: apr/apr-util/trunk/include/apr_dbd.h URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/include/apr_dbd.h?rev=231416&r1=231415&r2=231416&view=diff ============================================================================== --- apr/apr-util/trunk/include/apr_dbd.h (original) +++ apr/apr-util/trunk/include/apr_dbd.h Thu Aug 11 01:51:16 2005 @@ -26,14 +26,12 @@ #endif /* These are opaque structs. Instantiation is up to each backend */ -#ifndef APR_DBD_INTERNAL_H typedef struct apr_dbd_driver_t apr_dbd_driver_t; 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 /** apr_dbd_init: perform once-only initialisation. Call once only. * Modified: apr/apr-util/trunk/include/private/apr_dbd_internal.h URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/include/private/apr_dbd_internal.h?rev=231416&r1=231415&r2=231416&view=diff ============================================================================== --- apr/apr-util/trunk/include/private/apr_dbd_internal.h (original) +++ apr/apr-util/trunk/include/private/apr_dbd_internal.h Thu Aug 11 01:51:16 2005 @@ -21,20 +21,13 @@ #ifndef APR_DBD_INTERNAL_H #define APR_DBD_INTERNAL_H +#include "apr_dbd.h" + #ifdef __cplusplus extern "C" { #endif -#ifndef APR_DBD_INTERNAL -#define 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 - -typedef struct apr_dbd_driver_t { +struct apr_dbd_driver_t { /** name */ const char *name; @@ -253,7 +246,7 @@ int random, int nargs, const char **args); -} apr_dbd_driver_t; +}; #ifdef __cplusplus