Main Page | Modules | Namespace List | Data Structures | File List | Data Fields | Globals | Related Pages

include/apr_dbd.h

00001 /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
00002  * applicable.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * 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 
00028 /* These are opaque structs.  Instantiation is up to each backend */
00029 typedef struct apr_dbd_driver_t apr_dbd_driver_t;
00030 typedef struct apr_dbd_t apr_dbd_t;
00031 typedef struct apr_dbd_transaction_t apr_dbd_transaction_t;
00032 typedef struct apr_dbd_results_t apr_dbd_results_t;
00033 typedef struct apr_dbd_row_t apr_dbd_row_t;
00034 typedef struct apr_dbd_prepared_t apr_dbd_prepared_t;
00035 
00040 APU_DECLARE(apr_status_t) apr_dbd_init(apr_pool_t *pool);
00041 
00052 APU_DECLARE(apr_status_t) apr_dbd_get_driver(apr_pool_t *pool, const char *name,
00053                                              const apr_dbd_driver_t **driver);
00054 
00064 APU_DECLARE(apr_status_t) apr_dbd_open(const apr_dbd_driver_t *driver,
00065                                        apr_pool_t *ptmp, const char *params,
00066                                        apr_dbd_t **handle);
00067 
00075 APU_DECLARE(apr_status_t) apr_dbd_close(const apr_dbd_driver_t *driver,
00076                                         apr_dbd_t *handle);
00077 
00078 /* apr-function-shaped versions of things */
00079 
00085 APU_DECLARE(const char*) apr_dbd_name(const apr_dbd_driver_t *driver);
00086 
00093 APU_DECLARE(void*) apr_dbd_native_handle(const apr_dbd_driver_t *driver,
00094                                          apr_dbd_t *handle);
00095 
00103 APU_DECLARE(int) apr_dbd_check_conn(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00104                                     apr_dbd_t *handle);
00105 
00114 APU_DECLARE(int) apr_dbd_set_dbname(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00115                                     apr_dbd_t *handle, const char *name);
00116 
00125 APU_DECLARE(int) apr_dbd_transaction_start(const apr_dbd_driver_t *driver,
00126                                            apr_pool_t *pool,
00127                                            apr_dbd_t *handle,
00128                                            apr_dbd_transaction_t **trans);
00129 
00139 APU_DECLARE(int) apr_dbd_transaction_end(const apr_dbd_driver_t *driver,
00140                                          apr_pool_t *pool,
00141                                          apr_dbd_transaction_t *trans);
00142 
00151 APU_DECLARE(int) apr_dbd_query(const apr_dbd_driver_t *driver, apr_dbd_t *handle,
00152                                int *nrows, const char *statement);
00153 
00166 APU_DECLARE(int) apr_dbd_select(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00167                                 apr_dbd_t *handle, apr_dbd_results_t **res,
00168                                 const char *statement, int random);
00169 
00176 APU_DECLARE(int) apr_dbd_num_cols(const apr_dbd_driver_t *driver,
00177                                   apr_dbd_results_t *res);
00178 
00186 APU_DECLARE(int) apr_dbd_num_tuples(const apr_dbd_driver_t *driver,
00187                                     apr_dbd_results_t *res);
00188 
00199 APU_DECLARE(int) apr_dbd_get_row(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00200                                  apr_dbd_results_t *res, apr_dbd_row_t **row,
00201                                  int rownum);
00202 
00210 APU_DECLARE(const char*) apr_dbd_get_entry(const apr_dbd_driver_t *driver,
00211                                            apr_dbd_row_t *row, int col);
00212 
00221 APU_DECLARE(const char*) apr_dbd_error(const apr_dbd_driver_t *driver,
00222                                        apr_dbd_t *handle, int errnum);
00223 
00232 APU_DECLARE(const char*) apr_dbd_escape(const apr_dbd_driver_t *driver,
00233                                         apr_pool_t *pool, const char *string,
00234                                         apr_dbd_t *handle);
00235 
00248 APU_DECLARE(int) apr_dbd_prepare(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00249                                  apr_dbd_t *handle, const char *query,
00250                                  const char *label,
00251                                  apr_dbd_prepared_t **statement);
00252 
00253 
00265 APU_DECLARE(int) apr_dbd_pquery(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00266                                 apr_dbd_t *handle, int *nrows,
00267                                 apr_dbd_prepared_t *statement, int nargs,
00268                                 const char **args);
00269 
00282 APU_DECLARE(int) apr_dbd_pselect(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00283                                  apr_dbd_t *handle, apr_dbd_results_t **res,
00284                                  apr_dbd_prepared_t *statement, int random,
00285                                  int nargs, const char **args);
00286 
00297 APU_DECLARE(int) apr_dbd_pvquery(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00298                                  apr_dbd_t *handle, int *nrows,
00299                                  apr_dbd_prepared_t *statement, ...);
00300 
00312 APU_DECLARE(int) apr_dbd_pvselect(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00313                                   apr_dbd_t *handle, apr_dbd_results_t **res,
00314                                   apr_dbd_prepared_t *statement, int random,
00315                                   ...);
00316 
00317 #ifdef __cplusplus
00318 }
00319 #endif
00320 
00321 #endif

Generated on Sun Nov 20 19:11:00 2005 for Apache Portable Runtime Utility Library by doxygen 1.3.6