You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2005/08/11 10:51:21 UTC
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
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