00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00056 #define APR_DBM_READONLY 1
00057 #define APR_DBM_READWRITE 2
00058 #define APR_DBM_RWCREATE 3
00059 #define APR_DBM_RWTRUNC 4
00086 APU_DECLARE(apr_status_t) apr_dbm_open_ex(apr_dbm_t **dbm, const char* type,
00087 const char *name,
00088 apr_int32_t mode, apr_fileperms_t perm,
00089 apr_pool_t *cntxt);
00090
00091
00108 APU_DECLARE(apr_status_t) apr_dbm_open(apr_dbm_t **dbm, const char *name,
00109 apr_int32_t mode, apr_fileperms_t perm,
00110 apr_pool_t *cntxt);
00111
00116 APU_DECLARE(void) apr_dbm_close(apr_dbm_t *dbm);
00117
00124 APU_DECLARE(apr_status_t) apr_dbm_fetch(apr_dbm_t *dbm, apr_datum_t key,
00125 apr_datum_t *pvalue);
00132 APU_DECLARE(apr_status_t) apr_dbm_store(apr_dbm_t *dbm, apr_datum_t key,
00133 apr_datum_t value);
00134
00141 APU_DECLARE(apr_status_t) apr_dbm_delete(apr_dbm_t *dbm, apr_datum_t key);
00142
00148 APU_DECLARE(int) apr_dbm_exists(apr_dbm_t *dbm, apr_datum_t key);
00149
00155 APU_DECLARE(apr_status_t) apr_dbm_firstkey(apr_dbm_t *dbm, apr_datum_t *pkey);
00156
00162 APU_DECLARE(apr_status_t) apr_dbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey);
00163
00169 APU_DECLARE(void) apr_dbm_freedatum(apr_dbm_t *dbm, apr_datum_t data);
00170
00180 APU_DECLARE(char *) apr_dbm_geterror(apr_dbm_t *dbm, int *errcode,
00181 char *errbuf, apr_size_t errbufsize);
00196 APU_DECLARE(apr_status_t) apr_dbm_get_usednames_ex(apr_pool_t *pool,
00197 const char *type,
00198 const char *pathname,
00199 const char **used1,
00200 const char **used2);
00201
00214 APU_DECLARE(void) apr_dbm_get_usednames(apr_pool_t *pool,
00215 const char *pathname,
00216 const char **used1,
00217 const char **used2);
00218
00220 #ifdef __cplusplus
00221 }
00222 #endif
00223
00224 #endif