00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
#ifndef APR_SDBM_H
00024
#define APR_SDBM_H
00025
00026
#include "apu.h"
00027
#include "apr_errno.h"
00028
#include "apr_file_io.h"
00029
00043 typedef struct apr_sdbm_t apr_sdbm_t;
00044
00048 typedef struct {
00050 char *dptr;
00052 int dsize;
00053 }
apr_sdbm_datum_t;
00054
00055
00057 #define APR_SDBM_DIRFEXT ".dir"
00058
00059 #define APR_SDBM_PAGFEXT ".pag"
00060
00061
00062 #define APR_SDBM_INSERT 0
00063 #define APR_SDBM_REPLACE 1
00064 #define APR_SDBM_INSERTDUP 2
00084
APU_DECLARE(apr_status_t) apr_sdbm_open(apr_sdbm_t **db, const char *name,
00085
apr_int32_t mode,
00086 apr_fileperms_t perms, apr_pool_t *p);
00087
00092
APU_DECLARE(apr_status_t) apr_sdbm_close(apr_sdbm_t *db);
00093
00109 APU_DECLARE(apr_status_t) apr_sdbm_lock(apr_sdbm_t *db,
int type);
00110
00115 APU_DECLARE(apr_status_t) apr_sdbm_unlock(apr_sdbm_t *db);
00116
00123 APU_DECLARE(apr_status_t) apr_sdbm_fetch(apr_sdbm_t *db,
00124
apr_sdbm_datum_t *value,
00125
apr_sdbm_datum_t key);
00126
00138 APU_DECLARE(apr_status_t) apr_sdbm_store(apr_sdbm_t *db,
apr_sdbm_datum_t key,
00139
apr_sdbm_datum_t value,
int opt);
00140
00147 APU_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db,
00148 const
apr_sdbm_datum_t key);
00149
00159 APU_DECLARE(apr_status_t) apr_sdbm_firstkey(apr_sdbm_t *db,
apr_sdbm_datum_t *key);
00160
00166 APU_DECLARE(apr_status_t) apr_sdbm_nextkey(apr_sdbm_t *db,
apr_sdbm_datum_t *key);
00167
00172 APU_DECLARE(
int) apr_sdbm_rdonly(apr_sdbm_t *db);
00174 #endif