Apache Portable Runtime Utility Library
include/apr_dbm.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 #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       
00089 APU_DECLARE(apr_status_t) apr_dbm_open_ex(apr_dbm_t **dbm, const char* type, 
00090                                        const char *name, 
00091                                        apr_int32_t mode, apr_fileperms_t perm,
00092                                        apr_pool_t *cntxt);
00093 
00094 
00111 APU_DECLARE(apr_status_t) apr_dbm_open(apr_dbm_t **dbm, const char *name, 
00112                                        apr_int32_t mode, apr_fileperms_t perm,
00113                                        apr_pool_t *cntxt);
00114 
00119 APU_DECLARE(void) apr_dbm_close(apr_dbm_t *dbm);
00120 
00127 APU_DECLARE(apr_status_t) apr_dbm_fetch(apr_dbm_t *dbm, apr_datum_t key,
00128                                         apr_datum_t *pvalue);
00135 APU_DECLARE(apr_status_t) apr_dbm_store(apr_dbm_t *dbm, apr_datum_t key, 
00136                                         apr_datum_t value);
00137 
00144 APU_DECLARE(apr_status_t) apr_dbm_delete(apr_dbm_t *dbm, apr_datum_t key);
00145 
00151 APU_DECLARE(int) apr_dbm_exists(apr_dbm_t *dbm, apr_datum_t key);
00152 
00158 APU_DECLARE(apr_status_t) apr_dbm_firstkey(apr_dbm_t *dbm, apr_datum_t *pkey);
00159 
00165 APU_DECLARE(apr_status_t) apr_dbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey);
00166 
00172 APU_DECLARE(void) apr_dbm_freedatum(apr_dbm_t *dbm, apr_datum_t data);
00173 
00183 APU_DECLARE(char *) apr_dbm_geterror(apr_dbm_t *dbm, int *errcode,
00184                                      char *errbuf, apr_size_t errbufsize);
00199 APU_DECLARE(apr_status_t) apr_dbm_get_usednames_ex(apr_pool_t *pool,
00200                                                    const char *type,
00201                                                    const char *pathname,
00202                                                    const char **used1,
00203                                                    const char **used2);
00204 
00217 APU_DECLARE(void) apr_dbm_get_usednames(apr_pool_t *pool,
00218                                         const char *pathname,
00219                                         const char **used1,
00220                                         const char **used2);
00221 
00223 #ifdef __cplusplus
00224 }
00225 #endif
00226 
00227 #endif  /* !APR_DBM_H */
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines