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

apr_sdbm.h

Go to the documentation of this file.
00001 /* Copyright 2000-2004 The Apache Software Foundation
00002  *
00003  * Licensed under the Apache License, Version 2.0 (the "License");
00004  * you may not use this file except in compliance with the License.
00005  * You may obtain a copy of the License at
00006  *
00007  *     http://www.apache.org/licenses/LICENSE-2.0
00008  *
00009  * Unless required by applicable law or agreed to in writing, software
00010  * distributed under the License is distributed on an "AS IS" BASIS,
00011  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012  * See the License for the specific language governing permissions and
00013  * limitations under the License.
00014  */
00015 
00016 /*
00017  * sdbm - ndbm work-alike hashed database library
00018  * based on Per-Ake Larson's Dynamic Hashing algorithms. BIT 18 (1978).
00019  * author: oz@nexus.yorku.ca
00020  * status: ex-public domain
00021  */
00022 
00023 #ifndef APR_SDBM_H
00024 #define APR_SDBM_H
00025 
00026 #include "apu.h"
00027 #include "apr_errno.h"
00028 #include "apr_file_io.h"   /* for apr_fileperms_t */
00029 
00043 typedef struct apr_sdbm_t apr_sdbm_t;
00044 
00048 typedef struct {
00050     char *dptr;
00052     int dsize;
00053 } apr_sdbm_datum_t;
00054 
00055 /* The extensions used for the database files */
00057 #define APR_SDBM_DIRFEXT        ".dir"
00058 
00059 #define APR_SDBM_PAGFEXT        ".pag"
00060 
00061 /* flags to sdbm_store */
00062 #define APR_SDBM_INSERT     0   
00063 #define APR_SDBM_REPLACE    1   
00064 #define APR_SDBM_INSERTDUP  2   
00084 APU_DECLARE(apr_status_t) apr_sdbm_open(apr_sdbm_t **db, const char *name, 
00085                                         apr_int32_t mode, 
00086                                         apr_fileperms_t perms, apr_pool_t *p);
00087 
00092 APU_DECLARE(apr_status_t) apr_sdbm_close(apr_sdbm_t *db);
00093 
00109 APU_DECLARE(apr_status_t) apr_sdbm_lock(apr_sdbm_t *db, int type);
00110 
00115 APU_DECLARE(apr_status_t) apr_sdbm_unlock(apr_sdbm_t *db);
00116 
00123 APU_DECLARE(apr_status_t) apr_sdbm_fetch(apr_sdbm_t *db, 
00124                                          apr_sdbm_datum_t *value, 
00125                                          apr_sdbm_datum_t key);
00126 
00138 APU_DECLARE(apr_status_t) apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key,
00139                                          apr_sdbm_datum_t value, int opt);
00140 
00147 APU_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db, 
00148                                           const apr_sdbm_datum_t key);
00149 
00159 APU_DECLARE(apr_status_t) apr_sdbm_firstkey(apr_sdbm_t *db, apr_sdbm_datum_t *key);
00160 
00166 APU_DECLARE(apr_status_t) apr_sdbm_nextkey(apr_sdbm_t *db, apr_sdbm_datum_t *key);
00167 
00172 APU_DECLARE(int) apr_sdbm_rdonly(apr_sdbm_t *db);
00174 #endif /* APR_SDBM_H */

Generated on Thu Sep 8 12:20:49 2005 for Apache Portable Runtime Utility Library by  doxygen 1.4.4