00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef APR_DBD_INTERNAL_H
00022 #define APR_DBD_INTERNAL_H
00023
00024 #include <stdarg.h>
00025
00026 #include "apr_dbd.h"
00027
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031
00032 struct apr_dbd_driver_t {
00034 const char *name;
00035
00039 void (*init)(apr_pool_t *pool);
00040
00046 void *(*native_handle)(apr_dbd_t *handle);
00047
00057 apr_dbd_t *(*open)(apr_pool_t *pool, const char *params);
00058
00065 apr_status_t (*check_conn)(apr_pool_t *pool, apr_dbd_t *handle);
00066
00072 apr_status_t (*close)(apr_dbd_t *handle);
00073
00081 int (*set_dbname)(apr_pool_t* pool, apr_dbd_t *handle, const char *name);
00082
00090 int (*start_transaction)(apr_pool_t *pool, apr_dbd_t *handle,
00091 apr_dbd_transaction_t **trans);
00092
00100 int (*end_transaction)(apr_dbd_transaction_t *trans);
00101
00109 int (*query)(apr_dbd_t *handle, int *nrows, const char *statement);
00110
00122 int (*select)(apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res,
00123 const char *statement, int random);
00124
00130 int (*num_cols)(apr_dbd_results_t *res);
00131
00138 int (*num_tuples)(apr_dbd_results_t *res);
00139
00149 int (*get_row)(apr_pool_t *pool, apr_dbd_results_t *res,
00150 apr_dbd_row_t **row, int rownum);
00151
00159 const char* (*get_entry)(const apr_dbd_row_t *row, int col);
00160
00168 const char *(*error)(apr_dbd_t *handle, int errnum);
00169
00177 const char *(*escape)(apr_pool_t *pool, const char *string,
00178 apr_dbd_t *handle);
00179
00191 int (*prepare)(apr_pool_t *pool, apr_dbd_t *handle, const char *query,
00192 const char *label, apr_dbd_prepared_t **statement);
00193
00203 int (*pvquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows,
00204 apr_dbd_prepared_t *statement, va_list args);
00205
00216 int (*pvselect)(apr_pool_t *pool, apr_dbd_t *handle,
00217 apr_dbd_results_t **res,
00218 apr_dbd_prepared_t *statement, int random, va_list args);
00219
00230 int (*pquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows,
00231 apr_dbd_prepared_t *statement, int nargs,
00232 const char **args);
00233
00245 int (*pselect)(apr_pool_t *pool, apr_dbd_t *handle,
00246 apr_dbd_results_t **res, apr_dbd_prepared_t *statement,
00247 int random, int nargs, const char **args);
00248
00249
00250 };
00251
00252
00253 #ifdef __cplusplus
00254 }
00255 #endif
00256
00257 #endif