Loading...
Searching...
No Matches
apr_dbm_private.h
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef APR_DBM_PRIVATE_H
#define APR_DBM_PRIVATE_H
#include "apr.h"
#include "apr_errno.h"
#include "apr_pools.h"
#include "apr_dbm.h"
#include "apr_file_io.h"
#include "apu.h"
/* ### for now, include the DBM selection; this will go away once we start
### building and linking all of the DBMs at once. */
#include "apu_select_dbm.h"
#ifdef __cplusplus
extern "C" {
#endif
APU_DECLARE(int) apr_posix_perms2mode(apr_fileperms_t perm);
typedef struct {
const char *name;
apr_status_t (*open)(apr_dbm_t **pdb, const char *pathname,
apr_int32_t mode, apr_fileperms_t perm,
apr_pool_t *pool);
void (*close)(apr_dbm_t *dbm);
apr_status_t (*fetch)(apr_dbm_t *dbm, apr_datum_t key,
apr_datum_t * pvalue);
apr_status_t (*store)(apr_dbm_t *dbm, apr_datum_t key, apr_datum_t value);
apr_status_t (*del)(apr_dbm_t *dbm, apr_datum_t key);
int (*exists)(apr_dbm_t *dbm, apr_datum_t key);
apr_status_t (*firstkey)(apr_dbm_t *dbm, apr_datum_t * pkey);
apr_status_t (*nextkey)(apr_dbm_t *dbm, apr_datum_t * pkey);
void (*freedatum)(apr_dbm_t *dbm, apr_datum_t data);
void (*getusednames)(apr_pool_t *pool,
const char *pathname,
const char **used1,
const char **used2);
} apr_dbm_type_t;
struct apr_dbm_t
{
apr_pool_t *pool;
void *file;
int errcode;
const char *errmsg;
const apr_dbm_type_t *type;
};
/* Declare all of the DBM provider tables */
APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_sdbm;
APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_gdbm;
APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_ndbm;
APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db;
#ifdef __cplusplus
}
#endif
#endif /* APR_DBM_PRIVATE_H */
apr_dbm.h
APR-UTIL DBM library.
APU_MODULE_DECLARE_DATA
#define APU_MODULE_DECLARE_DATA
Definition apu.h:94
apr_datum_t
Definition apr_dbm.h:48
apr_dbm_t
Definition apr_dbm_private.h:94
apr_dbm_t::errcode
int errcode
Definition apr_dbm_private.h:102
apr_dbm_t::file
void * file
Definition apr_dbm_private.h:99
apr_dbm_t::type
const apr_dbm_type_t * type
Definition apr_dbm_private.h:107
apr_dbm_t::errmsg
const char * errmsg
Definition apr_dbm_private.h:104
apr_dbm_t::pool
apr_pool_t * pool
Definition apr_dbm_private.h:96
apr_dbm_type_t
Definition apr_dbm_private.h:47
apr_dbm_type_t::store
apr_status_t(* store)(apr_dbm_t *dbm, apr_datum_t key, apr_datum_t value)
Definition apr_dbm_private.h:64
apr_dbm_type_t::getusednames
void(* getusednames)(apr_pool_t *pool, const char *pathname, const char **used1, const char **used2)
Definition apr_dbm_private.h:82
apr_dbm_type_t::nextkey
apr_status_t(* nextkey)(apr_dbm_t *dbm, apr_datum_t *pkey)
Definition apr_dbm_private.h:76
apr_dbm_type_t::del
apr_status_t(* del)(apr_dbm_t *dbm, apr_datum_t key)
Definition apr_dbm_private.h:67
apr_dbm_type_t::freedatum
void(* freedatum)(apr_dbm_t *dbm, apr_datum_t data)
Definition apr_dbm_private.h:79
apr_dbm_type_t::open
apr_status_t(* open)(apr_dbm_t **pdb, const char *pathname, apr_int32_t mode, apr_fileperms_t perm, apr_pool_t *pool)
Definition apr_dbm_private.h:52
apr_dbm_type_t::exists
int(* exists)(apr_dbm_t *dbm, apr_datum_t key)
Definition apr_dbm_private.h:70
apr_dbm_type_t::firstkey
apr_status_t(* firstkey)(apr_dbm_t *dbm, apr_datum_t *pkey)
Definition apr_dbm_private.h:73
apr_dbm_type_t::close
void(* close)(apr_dbm_t *dbm)
Definition apr_dbm_private.h:57
apr_dbm_type_t::fetch
apr_status_t(* fetch)(apr_dbm_t *dbm, apr_datum_t key, apr_datum_t *pvalue)
Definition apr_dbm_private.h:60
apr_dbm_type_t::name
const char * name
Definition apr_dbm_private.h:49