00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef APR_DBM_PRIVATE_H
00017 #define APR_DBM_PRIVATE_H
00018
00019 #include "apr.h"
00020 #include "apr_errno.h"
00021 #include "apr_pools.h"
00022 #include "apr_dbm.h"
00023 #include "apr_file_io.h"
00024
00025 #include "apu.h"
00026
00027
00028
00029 #include "apu_select_dbm.h"
00030
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034
00041 APU_DECLARE(int) apr_posix_perms2mode(apr_fileperms_t perm);
00042
00046 typedef struct {
00048 const char *name;
00049
00051 apr_status_t (*open)(apr_dbm_t **pdb, const char *pathname,
00052 apr_int32_t mode, apr_fileperms_t perm,
00053 apr_pool_t *pool);
00054
00056 void (*close)(apr_dbm_t *dbm);
00057
00059 apr_status_t (*fetch)(apr_dbm_t *dbm, apr_datum_t key,
00060 apr_datum_t * pvalue);
00061
00063 apr_status_t (*store)(apr_dbm_t *dbm, apr_datum_t key, apr_datum_t value);
00064
00066 apr_status_t (*del)(apr_dbm_t *dbm, apr_datum_t key);
00067
00069 int (*exists)(apr_dbm_t *dbm, apr_datum_t key);
00070
00072 apr_status_t (*firstkey)(apr_dbm_t *dbm, apr_datum_t * pkey);
00073
00075 apr_status_t (*nextkey)(apr_dbm_t *dbm, apr_datum_t * pkey);
00076
00078 void (*freedatum)(apr_dbm_t *dbm, apr_datum_t data);
00079
00081 void (*getusednames)(apr_pool_t *pool,
00082 const char *pathname,
00083 const char **used1,
00084 const char **used2);
00085
00086 } apr_dbm_type_t;
00087
00088
00092 struct apr_dbm_t
00093 {
00095 apr_pool_t *pool;
00096
00098 void *file;
00099
00101 int errcode;
00103 const char *errmsg;
00104
00106 const apr_dbm_type_t *type;
00107 };
00108
00109
00110
00111 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_sdbm;
00112 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_gdbm;
00113 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_ndbm;
00114 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db1;
00115 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db2;
00116 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db3;
00117 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db4;
00118 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db;
00119
00120 #ifdef __cplusplus
00121 }
00122 #endif
00123
00124 #endif