include/apr_dbd.h

Go to the documentation of this file.
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 /* Overview of what this is and does:
00018  * http://www.apache.org/~niq/dbd.html
00019  */
00020 
00021 #ifndef APR_DBD_H
00022 #define APR_DBD_H
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00038 /* These are opaque structs.  Instantiation is up to each backend */
00039 typedef struct apr_dbd_driver_t apr_dbd_driver_t;
00040 typedef struct apr_dbd_t apr_dbd_t;
00041 typedef struct apr_dbd_transaction_t apr_dbd_transaction_t;
00042 typedef struct apr_dbd_results_t apr_dbd_results_t;
00043 typedef struct apr_dbd_row_t apr_dbd_row_t;
00044 typedef struct apr_dbd_prepared_t apr_dbd_prepared_t;
00045 
00050 APU_DECLARE(apr_status_t) apr_dbd_init(apr_pool_t *pool);
00051 
00062 APU_DECLARE(apr_status_t) apr_dbd_get_driver(apr_pool_t *pool, const char *name,
00063                                              const apr_dbd_driver_t **driver);
00064 
00092 APU_DECLARE(apr_status_t) apr_dbd_open(const apr_dbd_driver_t *driver,
00093                                        apr_pool_t *pool, const char *params,
00094                                        apr_dbd_t **handle);
00095 
00102 APU_DECLARE(apr_status_t) apr_dbd_close(const apr_dbd_driver_t *driver,
00103                                         apr_dbd_t *handle);
00104 
00105 /* apr-function-shaped versions of things */
00106 
00112 APU_DECLARE(const char*) apr_dbd_name(const apr_dbd_driver_t *driver);
00113 
00120 APU_DECLARE(void*) apr_dbd_native_handle(const apr_dbd_driver_t *driver,
00121                                          apr_dbd_t *handle);
00122 
00130 APU_DECLARE(int) apr_dbd_check_conn(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00131                                     apr_dbd_t *handle);
00132 
00141 APU_DECLARE(int) apr_dbd_set_dbname(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00142                                     apr_dbd_t *handle, const char *name);
00143 
00155 APU_DECLARE(int) apr_dbd_transaction_start(const apr_dbd_driver_t *driver,
00156                                            apr_pool_t *pool,
00157                                            apr_dbd_t *handle,
00158                                            apr_dbd_transaction_t **trans);
00159 
00169 APU_DECLARE(int) apr_dbd_transaction_end(const apr_dbd_driver_t *driver,
00170                                          apr_pool_t *pool,
00171                                          apr_dbd_transaction_t *trans);
00172 
00181 APU_DECLARE(int) apr_dbd_query(const apr_dbd_driver_t *driver, apr_dbd_t *handle,
00182                                int *nrows, const char *statement);
00183 
00196 APU_DECLARE(int) apr_dbd_select(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00197                                 apr_dbd_t *handle, apr_dbd_results_t **res,
00198                                 const char *statement, int random);
00199 
00206 APU_DECLARE(int) apr_dbd_num_cols(const apr_dbd_driver_t *driver,
00207                                   apr_dbd_results_t *res);
00208 
00216 APU_DECLARE(int) apr_dbd_num_tuples(const apr_dbd_driver_t *driver,
00217                                     apr_dbd_results_t *res);
00218 
00229 APU_DECLARE(int) apr_dbd_get_row(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00230                                  apr_dbd_results_t *res, apr_dbd_row_t **row,
00231                                  int rownum);
00232 
00240 APU_DECLARE(const char*) apr_dbd_get_entry(const apr_dbd_driver_t *driver,
00241                                            apr_dbd_row_t *row, int col);
00242 
00251 APU_DECLARE(const char*) apr_dbd_error(const apr_dbd_driver_t *driver,
00252                                        apr_dbd_t *handle, int errnum);
00253 
00262 APU_DECLARE(const char*) apr_dbd_escape(const apr_dbd_driver_t *driver,
00263                                         apr_pool_t *pool, const char *string,
00264                                         apr_dbd_t *handle);
00265 
00284 APU_DECLARE(int) apr_dbd_prepare(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00285                                  apr_dbd_t *handle, const char *query,
00286                                  const char *label,
00287                                  apr_dbd_prepared_t **statement);
00288 
00289 
00301 APU_DECLARE(int) apr_dbd_pquery(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00302                                 apr_dbd_t *handle, int *nrows,
00303                                 apr_dbd_prepared_t *statement, int nargs,
00304                                 const char **args);
00305 
00318 APU_DECLARE(int) apr_dbd_pselect(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00319                                  apr_dbd_t *handle, apr_dbd_results_t **res,
00320                                  apr_dbd_prepared_t *statement, int random,
00321                                  int nargs, const char **args);
00322 
00333 APU_DECLARE(int) apr_dbd_pvquery(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00334                                  apr_dbd_t *handle, int *nrows,
00335                                  apr_dbd_prepared_t *statement, ...);
00336 
00348 APU_DECLARE(int) apr_dbd_pvselect(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00349                                   apr_dbd_t *handle, apr_dbd_results_t **res,
00350                                   apr_dbd_prepared_t *statement, int random,
00351                                   ...);
00352 
00355 #ifdef __cplusplus
00356 }
00357 #endif
00358 
00359 #endif

Generated on Mon Nov 26 11:24:10 2007 for Apache Portable Runtime Utility Library by  doxygen 1.5.2