00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 #ifndef APR_SDBM_H
00025 #define APR_SDBM_H
00026 
00027 #include "apu.h"
00028 #include "apr_errno.h"
00029 #include "apr_file_io.h"   
00030 
00044 typedef struct apr_sdbm_t apr_sdbm_t;
00045 
00049 typedef struct {
00051     char *dptr;
00053     int dsize;
00054 } apr_sdbm_datum_t;
00055 
00056 
00058 #define APR_SDBM_DIRFEXT        ".dir"
00059 
00060 #define APR_SDBM_PAGFEXT        ".pag"
00061 
00062 
00063 #define APR_SDBM_INSERT     0   
00064 #define APR_SDBM_REPLACE    1   
00065 #define APR_SDBM_INSERTDUP  2   
00085 APU_DECLARE(apr_status_t) apr_sdbm_open(apr_sdbm_t **db, const char *name, 
00086                                         apr_int32_t mode, 
00087                                         apr_fileperms_t perms, apr_pool_t *p);
00088 
00093 APU_DECLARE(apr_status_t) apr_sdbm_close(apr_sdbm_t *db);
00094 
00110 APU_DECLARE(apr_status_t) apr_sdbm_lock(apr_sdbm_t *db, int type);
00111 
00116 APU_DECLARE(apr_status_t) apr_sdbm_unlock(apr_sdbm_t *db);
00117 
00124 APU_DECLARE(apr_status_t) apr_sdbm_fetch(apr_sdbm_t *db, 
00125                                          apr_sdbm_datum_t *value, 
00126                                          apr_sdbm_datum_t key);
00127 
00139 APU_DECLARE(apr_status_t) apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key,
00140                                          apr_sdbm_datum_t value, int opt);
00141 
00148 APU_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db, 
00149                                           const apr_sdbm_datum_t key);
00150 
00160 APU_DECLARE(apr_status_t) apr_sdbm_firstkey(apr_sdbm_t *db, apr_sdbm_datum_t *key);
00161 
00167 APU_DECLARE(apr_status_t) apr_sdbm_nextkey(apr_sdbm_t *db, apr_sdbm_datum_t *key);
00168 
00173 APU_DECLARE(int) apr_sdbm_rdonly(apr_sdbm_t *db);
00175 #endif