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     
00054     int dsize;
00055 } apr_sdbm_datum_t;
00056 
00057 
00059 #define APR_SDBM_DIRFEXT        ".dir"
00060 
00061 #define APR_SDBM_PAGFEXT        ".pag"
00062 
00063 
00064 #define APR_SDBM_INSERT     0   
00065 #define APR_SDBM_REPLACE    1   
00066 #define APR_SDBM_INSERTDUP  2   
00086 APU_DECLARE(apr_status_t) apr_sdbm_open(apr_sdbm_t **db, const char *name, 
00087                                         apr_int32_t mode, 
00088                                         apr_fileperms_t perms, apr_pool_t *p);
00089 
00094 APU_DECLARE(apr_status_t) apr_sdbm_close(apr_sdbm_t *db);
00095 
00111 APU_DECLARE(apr_status_t) apr_sdbm_lock(apr_sdbm_t *db, int type);
00112 
00117 APU_DECLARE(apr_status_t) apr_sdbm_unlock(apr_sdbm_t *db);
00118 
00125 APU_DECLARE(apr_status_t) apr_sdbm_fetch(apr_sdbm_t *db, 
00126                                          apr_sdbm_datum_t *value, 
00127                                          apr_sdbm_datum_t key);
00128 
00140 APU_DECLARE(apr_status_t) apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key,
00141                                          apr_sdbm_datum_t value, int opt);
00142 
00149 APU_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db, 
00150                                           const apr_sdbm_datum_t key);
00151 
00161 APU_DECLARE(apr_status_t) apr_sdbm_firstkey(apr_sdbm_t *db, apr_sdbm_datum_t *key);
00162 
00168 APU_DECLARE(apr_status_t) apr_sdbm_nextkey(apr_sdbm_t *db, apr_sdbm_datum_t *key);
00169 
00174 APU_DECLARE(int) apr_sdbm_rdonly(apr_sdbm_t *db);
00176 #endif