include/apr_dbd.h

Go to the documentation of this file.
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 
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 
00090 APU_DECLARE(apr_status_t) apr_dbd_open(const apr_dbd_driver_t *driver,
00091                                        apr_pool_t *pool, const char *params,
00092                                        apr_dbd_t **handle);
00093 
00100 APU_DECLARE(apr_status_t) apr_dbd_close(const apr_dbd_driver_t *driver,
00101                                         apr_dbd_t *handle);
00102 
00103 /* apr-function-shaped versions of things */
00104 
00110 APU_DECLARE(const char*) apr_dbd_name(const apr_dbd_driver_t *driver);
00111 
00118 APU_DECLARE(void*) apr_dbd_native_handle(const apr_dbd_driver_t *driver,
00119                                          apr_dbd_t *handle);
00120 
00128 APU_DECLARE(int) apr_dbd_check_conn(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00129                                     apr_dbd_t *handle);
00130 
00139 APU_DECLARE(int) apr_dbd_set_dbname(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00140                                     apr_dbd_t *handle, const char *name);
00141 
00153 APU_DECLARE(int) apr_dbd_transaction_start(const apr_dbd_driver_t *driver,
00154                                            apr_pool_t *pool,
00155                                            apr_dbd_t *handle,
00156                                            apr_dbd_transaction_t **trans);
00157 
00167 APU_DECLARE(int) apr_dbd_transaction_end(const apr_dbd_driver_t *driver,
00168                                          apr_pool_t *pool,
00169                                          apr_dbd_transaction_t *trans);
00170 
00179 APU_DECLARE(int) apr_dbd_query(const apr_dbd_driver_t *driver, apr_dbd_t *handle,
00180                                int *nrows, const char *statement);
00181 
00194 APU_DECLARE(int) apr_dbd_select(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00195                                 apr_dbd_t *handle, apr_dbd_results_t **res,
00196                                 const char *statement, int random);
00197 
00204 APU_DECLARE(int) apr_dbd_num_cols(const apr_dbd_driver_t *driver,
00205                                   apr_dbd_results_t *res);
00206 
00214 APU_DECLARE(int) apr_dbd_num_tuples(const apr_dbd_driver_t *driver,
00215                                     apr_dbd_results_t *res);
00216 
00227 APU_DECLARE(int) apr_dbd_get_row(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00228                                  apr_dbd_results_t *res, apr_dbd_row_t **row,
00229                                  int rownum);
00230 
00238 APU_DECLARE(const char*) apr_dbd_get_entry(const apr_dbd_driver_t *driver,
00239                                            apr_dbd_row_t *row, int col);
00240 
00249 APU_DECLARE(const char*) apr_dbd_error(const apr_dbd_driver_t *driver,
00250                                        apr_dbd_t *handle, int errnum);
00251 
00260 APU_DECLARE(const char*) apr_dbd_escape(const apr_dbd_driver_t *driver,
00261                                         apr_pool_t *pool, const char *string,
00262                                         apr_dbd_t *handle);
00263 
00282 APU_DECLARE(int) apr_dbd_prepare(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00283                                  apr_dbd_t *handle, const char *query,
00284                                  const char *label,
00285                                  apr_dbd_prepared_t **statement);
00286 
00287 
00299 APU_DECLARE(int) apr_dbd_pquery(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00300                                 apr_dbd_t *handle, int *nrows,
00301                                 apr_dbd_prepared_t *statement, int nargs,
00302                                 const char **args);
00303 
00316 APU_DECLARE(int) apr_dbd_pselect(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00317                                  apr_dbd_t *handle, apr_dbd_results_t **res,
00318                                  apr_dbd_prepared_t *statement, int random,
00319                                  int nargs, const char **args);
00320 
00331 APU_DECLARE(int) apr_dbd_pvquery(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00332                                  apr_dbd_t *handle, int *nrows,
00333                                  apr_dbd_prepared_t *statement, ...);
00334 
00346 APU_DECLARE(int) apr_dbd_pvselect(const apr_dbd_driver_t *driver, apr_pool_t *pool,
00347                                   apr_dbd_t *handle, apr_dbd_results_t **res,
00348                                   apr_dbd_prepared_t *statement, int random,
00349                                   ...);
00350 
00353 #ifdef __cplusplus
00354 }
00355 #endif
00356 
00357 #endif

Generated on Thu Dec 14 06:58:58 2006 for Apache Portable Runtime Utility Library by  doxygen 1.5.1