include/apr_dbm.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 #ifndef APR_DBM_H
00018 #define APR_DBM_H
00019 
00020 #include "apu.h"
00021 #include "apr.h"
00022 #include "apr_errno.h"
00023 #include "apr_pools.h"
00024 #include "apr_file_info.h"
00025 
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029 
00042 typedef struct apr_dbm_t apr_dbm_t;
00043 
00047 typedef struct
00048 {
00050     char *dptr;
00052     apr_size_t dsize;
00053 } apr_datum_t;
00054 
00055 /* modes to open the DB */
00056 #define APR_DBM_READONLY        1       
00057 #define APR_DBM_READWRITE       2       
00058 #define APR_DBM_RWCREATE        3       
00059 #define APR_DBM_RWTRUNC         4       
00086 APU_DECLARE(apr_status_t) apr_dbm_open_ex(apr_dbm_t **dbm, const char* type, 
00087                                        const char *name, 
00088                                        apr_int32_t mode, apr_fileperms_t perm,
00089                                        apr_pool_t *cntxt);
00090 
00091 
00108 APU_DECLARE(apr_status_t) apr_dbm_open(apr_dbm_t **dbm, const char *name, 
00109                                        apr_int32_t mode, apr_fileperms_t perm,
00110                                        apr_pool_t *cntxt);
00111 
00116 APU_DECLARE(void) apr_dbm_close(apr_dbm_t *dbm);
00117 
00124 APU_DECLARE(apr_status_t) apr_dbm_fetch(apr_dbm_t *dbm, apr_datum_t key,
00125                                         apr_datum_t *pvalue);
00132 APU_DECLARE(apr_status_t) apr_dbm_store(apr_dbm_t *dbm, apr_datum_t key, 
00133                                         apr_datum_t value);
00134 
00141 APU_DECLARE(apr_status_t) apr_dbm_delete(apr_dbm_t *dbm, apr_datum_t key);
00142 
00148 APU_DECLARE(int) apr_dbm_exists(apr_dbm_t *dbm, apr_datum_t key);
00149 
00155 APU_DECLARE(apr_status_t) apr_dbm_firstkey(apr_dbm_t *dbm, apr_datum_t *pkey);
00156 
00162 APU_DECLARE(apr_status_t) apr_dbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey);
00163 
00169 APU_DECLARE(void) apr_dbm_freedatum(apr_dbm_t *dbm, apr_datum_t data);
00170 
00180 APU_DECLARE(char *) apr_dbm_geterror(apr_dbm_t *dbm, int *errcode,
00181                                      char *errbuf, apr_size_t errbufsize);
00196 APU_DECLARE(apr_status_t) apr_dbm_get_usednames_ex(apr_pool_t *pool,
00197                                                    const char *type,
00198                                                    const char *pathname,
00199                                                    const char **used1,
00200                                                    const char **used2);
00201 
00214 APU_DECLARE(void) apr_dbm_get_usednames(apr_pool_t *pool,
00215                                         const char *pathname,
00216                                         const char **used1,
00217                                         const char **used2);
00218 
00220 #ifdef __cplusplus
00221 }
00222 #endif
00223 
00224 #endif  /* !APR_DBM_H */

Generated on Tue Sep 11 08:13:14 2007 for Apache Portable Runtime Utility Library by  doxygen 1.5.2