Apache2
apr_sdbm.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /*
18  * sdbm - ndbm work-alike hashed database library
19  * based on Per-Ake Larson's Dynamic Hashing algorithms. BIT 18 (1978).
20  * author: oz@nexus.yorku.ca
21  * status: ex-public domain
22  */
23 
24 #ifndef APR_SDBM_H
25 #define APR_SDBM_H
26 
27 #include "apu.h"
28 #include "apr_errno.h"
29 #include "apr_file_io.h" /* for apr_fileperms_t */
30 
44 typedef struct apr_sdbm_t apr_sdbm_t;
45 
49 typedef struct {
51  char *dptr;
53  /* apr_ssize_t for release 2.0??? */
54  int dsize;
56 
57 /* The extensions used for the database files */
59 #define APR_SDBM_DIRFEXT ".dir"
61 #define APR_SDBM_PAGFEXT ".pag"
62 
63 /* flags to sdbm_store */
64 #define APR_SDBM_INSERT 0
65 #define APR_SDBM_REPLACE 1
66 #define APR_SDBM_INSERTDUP 2
89  apr_fileperms_t perms, apr_pool_t *p);
90 
96 
113 
119 
127  apr_sdbm_datum_t *value,
128  apr_sdbm_datum_t key);
129 
142  apr_sdbm_datum_t value, int opt);
143 
151  const apr_sdbm_datum_t key);
152 
163 
170 
177 #endif /* APR_SDBM_H */
APR Error Codes.
APR File I/O Handling.
apr_status_t apr_sdbm_open(apr_sdbm_t **db, const char *name, apr_int32_t mode, apr_fileperms_t perms, apr_pool_t *p)
apr_status_t apr_sdbm_lock(apr_sdbm_t *db, int type)
apr_status_t apr_sdbm_delete(apr_sdbm_t *db, const apr_sdbm_datum_t key)
apr_status_t apr_sdbm_nextkey(apr_sdbm_t *db, apr_sdbm_datum_t *key)
apr_status_t apr_sdbm_fetch(apr_sdbm_t *db, apr_sdbm_datum_t *value, apr_sdbm_datum_t key)
apr_status_t apr_sdbm_unlock(apr_sdbm_t *db)
int apr_sdbm_rdonly(apr_sdbm_t *db)
apr_status_t apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key, apr_sdbm_datum_t value, int opt)
apr_status_t apr_sdbm_firstkey(apr_sdbm_t *db, apr_sdbm_datum_t *key)
apr_status_t apr_sdbm_close(apr_sdbm_t *db)
apr_bucket_brigade ap_input_mode_t mode
Definition: mod_dav.h:2662
const char * name
Definition: mod_dav.h:805
int apr_status_t
Definition: apr_errno.h:44
apr_int32_t apr_fileperms_t
Definition: apr_file_info.h:125
int apr_int32_t
Definition: apr.h:347
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
#define APR_DECLARE(x)
Definition: macros.h:6
Definition: apr_sdbm.h:49
char * dptr
Definition: apr_sdbm.h:51
int dsize
Definition: apr_sdbm.h:54
Definition: sdbm_private.h:49
apr_pool_t * p