Apache HTTPD
apr_dbd_internal.h
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/* Overview of what this is and does:
18 * http://www.apache.org/~niq/dbd.html
19 */
20
21#ifndef APR_DBD_INTERNAL_H
22#define APR_DBD_INTERNAL_H
23
24#include <stdarg.h>
25
26#include "apr_dbd.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#define TXN_IGNORE_ERRORS(t) \
33 ((t) && ((t)->mode & APR_DBD_TRANSACTION_IGNORE_ERRORS))
34#define TXN_NOTICE_ERRORS(t) \
35 ((t) && !((t)->mode & APR_DBD_TRANSACTION_IGNORE_ERRORS))
36
37#define TXN_DO_COMMIT(t) (!((t)->mode & APR_DBD_TRANSACTION_ROLLBACK))
38#define TXN_DO_ROLLBACK(t) ((t)->mode & APR_DBD_TRANSACTION_ROLLBACK)
39
40#define TXN_MODE_BITS \
41 (APR_DBD_TRANSACTION_ROLLBACK|APR_DBD_TRANSACTION_IGNORE_ERRORS)
42
45 const char *name;
46
50 void (*init)(apr_pool_t *pool);
51
57 void *(*native_handle)(apr_dbd_t *handle);
58
69 apr_dbd_t *(*open)(apr_pool_t *pool, const char *params,
70 const char **error);
71
79
86
95
105
114
122 int (*query)(apr_dbd_t *handle, int *nrows, const char *statement);
123
136 const char *statement, int random);
137
144
152
163 apr_dbd_row_t **row, int rownum);
164
172 const char* (*get_entry)(const apr_dbd_row_t *row, int col);
173
181 const char *(*error)(apr_dbd_t *handle, int errnum);
182
190 const char *(*escape)(apr_pool_t *pool, const char *string,
192
208 const char *label, int nargs, int nvals,
210
222
236
247 apr_dbd_prepared_t *statement, const char **args);
248
261 int random, const char **args);
262
263
270 const char* (*get_name)(const apr_dbd_results_t *res, int col);
271
278
286
288 const char *pformat;
289
301
315
326 apr_dbd_prepared_t *statement,const void **args);
327
340 int random, const void **args);
341
351 apr_dbd_type_e type, void *data);
352};
353
354/* Export mutex lock/unlock for drivers that need it
355 * deprecated; create a per-dbd mutex within the (*init) function
356 * to avoid blocking other providers running on other threads
357 */
360
361#ifdef __cplusplus
362}
363#endif
364
365#endif
const char * string
Definition ap_regex.h:171
APR-UTIL DBD library.
APU_DECLARE(void)
Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIP...
Definition apr_sha1.c:206
apr_dbd_type_e
Definition apr_dbd.h:55
struct apr_dbd_prepared_t apr_dbd_prepared_t
Definition apr_dbd.h:87
apr_pool_t apr_dbd_t const char const char * label
Definition apr_dbd.h:397
apr_pool_t apr_dbd_t apr_dbd_results_t ** res
Definition apr_dbd.h:287
struct apr_dbd_t apr_dbd_t
Definition apr_dbd.h:83
apr_dbd_t int const char * statement
Definition apr_dbd.h:272
apr_dbd_transaction_t int mode
Definition apr_dbd.h:261
struct apr_dbd_results_t apr_dbd_results_t
Definition apr_dbd.h:85
apr_pool_t const char apr_dbd_t ** handle
Definition apr_dbd.h:142
apr_dbd_t int errnum
Definition apr_dbd.h:353
apr_pool_t apr_dbd_results_t apr_dbd_row_t int rownum
Definition apr_dbd.h:321
apr_pool_t apr_dbd_t int apr_dbd_prepared_t int nargs
Definition apr_dbd.h:414
struct apr_dbd_transaction_t apr_dbd_transaction_t
Definition apr_dbd.h:84
apr_pool_t apr_dbd_results_t apr_dbd_row_t ** row
Definition apr_dbd.h:320
apr_pool_t const char * params
Definition apr_dbd.h:141
apr_dbd_t int * nrows
Definition apr_dbd.h:272
struct apr_dbd_row_t apr_dbd_row_t
Definition apr_dbd.h:86
apr_dbd_row_t int col
Definition apr_dbd.h:331
apr_size_t size
const char int apr_pool_t * pool
Definition apr_cstr.h:84
int apr_status_t
Definition apr_errno.h:44
void * data
int type
void * random
Definition apr_random.h:99
const char const char *const * args
static const char *const types[]
static const char *const trans[040]
Definition sed1.c:28
int(* pvbselect)(apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, va_list args)
int(* transaction_mode_get)(apr_dbd_transaction_t *trans)
int(* set_dbname)(apr_pool_t *pool, apr_dbd_t *handle, const char *name)
int(* pselect)(apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, const char **args)
int(* select)(apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, const char *statement, int random)
int(* prepare)(apr_pool_t *pool, apr_dbd_t *handle, const char *query, const char *label, int nargs, int nvals, apr_dbd_type_e *types, apr_dbd_prepared_t **statement)
int(* num_tuples)(apr_dbd_results_t *res)
int(* num_cols)(apr_dbd_results_t *res)
apr_status_t(* close)(apr_dbd_t *handle)
apr_status_t(* check_conn)(apr_pool_t *pool, apr_dbd_t *handle)
int(* start_transaction)(apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_transaction_t **trans)
int(* transaction_mode_set)(apr_dbd_transaction_t *trans, int mode)
int(* pquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, const char **args)
int(* end_transaction)(apr_dbd_transaction_t *trans)
const char *(* error)(apr_dbd_t *handle, int errnum)
int(* pvbquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, va_list args)
int(* pvquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, va_list args)
apr_status_t(* datum_get)(const apr_dbd_row_t *row, int col, apr_dbd_type_e type, void *data)
void(* init)(apr_pool_t *pool)
int(* pbselect)(apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, const void **args)
int(* query)(apr_dbd_t *handle, int *nrows, const char *statement)
int(* pvselect)(apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, va_list args)
int(* get_row)(apr_pool_t *pool, apr_dbd_results_t *res, apr_dbd_row_t **row, int rownum)
int(* pbquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, const void **args)
typedef int(WSAAPI *apr_winapi_fpt_WSAPoll)(IN OUT LPWSAPOLLFD fdArray