00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef APR_DBM_PRIVATE_H
00018 #define APR_DBM_PRIVATE_H
00019
00020 #include "apr.h"
00021 #include "apr_errno.h"
00022 #include "apr_pools.h"
00023 #include "apr_dbm.h"
00024 #include "apr_file_io.h"
00025
00026 #include "apu.h"
00027
00028
00029
00030 #include "apu_select_dbm.h"
00031
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035
00042 APU_DECLARE(int) apr_posix_perms2mode(apr_fileperms_t perm);
00043
00047 typedef struct {
00049 const char *name;
00050
00052 apr_status_t (*open)(apr_dbm_t **pdb, const char *pathname,
00053 apr_int32_t mode, apr_fileperms_t perm,
00054 apr_pool_t *pool);
00055
00057 void (*close)(apr_dbm_t *dbm);
00058
00060 apr_status_t (*fetch)(apr_dbm_t *dbm, apr_datum_t key,
00061 apr_datum_t * pvalue);
00062
00064 apr_status_t (*store)(apr_dbm_t *dbm, apr_datum_t key, apr_datum_t value);
00065
00067 apr_status_t (*del)(apr_dbm_t *dbm, apr_datum_t key);
00068
00070 int (*exists)(apr_dbm_t *dbm, apr_datum_t key);
00071
00073 apr_status_t (*firstkey)(apr_dbm_t *dbm, apr_datum_t * pkey);
00074
00076 apr_status_t (*nextkey)(apr_dbm_t *dbm, apr_datum_t * pkey);
00077
00079 void (*freedatum)(apr_dbm_t *dbm, apr_datum_t data);
00080
00082 void (*getusednames)(apr_pool_t *pool,
00083 const char *pathname,
00084 const char **used1,
00085 const char **used2);
00086
00087 } apr_dbm_type_t;
00088
00089
00093 struct apr_dbm_t
00094 {
00096 apr_pool_t *pool;
00097
00099 void *file;
00100
00102 int errcode;
00104 const char *errmsg;
00105
00107 const apr_dbm_type_t *type;
00108 };
00109
00110
00111
00112 APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_sdbm;
00113 APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_gdbm;
00114 APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_ndbm;
00115 APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db;
00116
00117 #ifdef __cplusplus
00118 }
00119 #endif
00120
00121 #endif