Main Page | Modules | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

dbm.c File Reference

#include "apr_strings.h"
#include "apr_file_io.h"
#include "apr_dbm.h"
#include "apr_want.h"
#include "mod_dav.h"
#include "repos.h"

Include dependency graph for dbm.c:

Go to the source code of this file.

Defines

#define APR_WANT_BYTEFUNC
#define DAV_GDBM_NS_KEY   "METADATA"
#define DAV_GDBM_NS_KEY_LEN   8
#define DAV_DBVSN_MAJOR   4
#define DAV_DBVSN_MINOR   0

Functions

void dav_dbm_get_statefiles (apr_pool_t *p, const char *fname, const char **state1, const char **state2)
static dav_errordav_fs_dbm_error (dav_db *db, apr_pool_t *p, apr_status_t status)
void dav_fs_ensure_state_dir (apr_pool_t *p, const char *dirname)
dav_errordav_dbm_open_direct (apr_pool_t *p, const char *pathname, int ro, dav_db **pdb)
static dav_errordav_dbm_open (apr_pool_t *p, const dav_resource *resource, int ro, dav_db **pdb)
void dav_dbm_close (dav_db *db)
dav_errordav_dbm_fetch (dav_db *db, apr_datum_t key, apr_datum_t *pvalue)
dav_errordav_dbm_store (dav_db *db, apr_datum_t key, apr_datum_t value)
dav_errordav_dbm_delete (dav_db *db, apr_datum_t key)
int dav_dbm_exists (dav_db *db, apr_datum_t key)
static dav_errordav_dbm_firstkey (dav_db *db, apr_datum_t *pkey)
static dav_errordav_dbm_nextkey (dav_db *db, apr_datum_t *pkey)
void dav_dbm_freedatum (dav_db *db, apr_datum_t data)
static apr_datum_t dav_build_key (dav_db *db, const dav_prop_name *name)
static void dav_append_prop (apr_pool_t *pool, const char *name, const char *value, apr_text_header *phdr)
static dav_errordav_propdb_open (apr_pool_t *pool, const dav_resource *resource, int ro, dav_db **pdb)
static void dav_propdb_close (dav_db *db)
static dav_errordav_propdb_define_namespaces (dav_db *db, dav_xmlns_info *xi)
static dav_errordav_propdb_output_value (dav_db *db, const dav_prop_name *name, dav_xmlns_info *xi, apr_text_header *phdr, int *found)
static dav_errordav_propdb_map_namespaces (dav_db *db, const apr_array_header_t *namespaces, dav_namespace_map **mapping)
static dav_errordav_propdb_store (dav_db *db, const dav_prop_name *name, const apr_xml_elem *elem, dav_namespace_map *mapping)
static dav_errordav_propdb_remove (dav_db *db, const dav_prop_name *name)
static int dav_propdb_exists (dav_db *db, const dav_prop_name *name)
static const char * dav_get_ns_table_uri (dav_db *db, int ns_id)
static void dav_set_name (dav_db *db, dav_prop_name *pname)
static dav_errordav_propdb_next_name (dav_db *db, dav_prop_name *pname)
static dav_errordav_propdb_first_name (dav_db *db, dav_prop_name *pname)
static dav_errordav_propdb_get_rollback (dav_db *db, const dav_prop_name *name, dav_deadprop_rollback **prollback)
static dav_errordav_propdb_apply_rollback (dav_db *db, dav_deadprop_rollback *rollback)

Variables

const dav_hooks_db dav_hooks_db_dbm


Define Documentation

#define APR_WANT_BYTEFUNC
 

Definition at line 37 of file dbm.c.

#define DAV_DBVSN_MAJOR   4
 

Definition at line 244 of file dbm.c.

Referenced by dav_propdb_close(), and dav_propdb_open().

#define DAV_DBVSN_MINOR   0
 

Definition at line 269 of file dbm.c.

Referenced by dav_propdb_open().

#define DAV_GDBM_NS_KEY   "METADATA"
 

Definition at line 239 of file dbm.c.

Referenced by dav_propdb_close(), and dav_propdb_open().

#define DAV_GDBM_NS_KEY_LEN   8
 

Definition at line 240 of file dbm.c.

Referenced by dav_propdb_close(), and dav_propdb_open().


Function Documentation

static void dav_append_prop apr_pool_t pool,
const char *  name,
const char *  value,
apr_text_header phdr
[static]
 

Definition at line 332 of file dbm.c.

References DEBUG_CR, and s.

Referenced by dav_propdb_output_value().

static apr_datum_t dav_build_key dav_db db,
const dav_prop_name name
[static]
 

Definition at line 291 of file dbm.c.

References APR_HASH_KEY_STRING, dav_buffer::buf, apr_datum_t::dptr, apr_datum_t::dsize, int, key, dav_prop_name::name, dav_prop_name::ns, dav_db::pool, dav_db::uri_index, and dav_db::wb_key.

Referenced by dav_propdb_exists(), dav_propdb_get_rollback(), dav_propdb_output_value(), dav_propdb_remove(), and dav_propdb_store().

void dav_dbm_close dav_db db  ) 
 

Definition at line 183 of file dbm.c.

References dav_db::file.

Referenced by dav_fs_close_lockdb(), dav_propdb_close(), and dav_propdb_open().

dav_error* dav_dbm_delete dav_db db,
apr_datum_t  key
 

Definition at line 202 of file dbm.c.

References dav_fs_dbm_error(), dav_db::file, NULL, and status.

Referenced by dav_fs_save_lock_record(), dav_propdb_apply_rollback(), and dav_propdb_remove().

Here is the call graph for this function:

int dav_dbm_exists dav_db db,
apr_datum_t  key
 

Definition at line 209 of file dbm.c.

References dav_db::file.

Referenced by dav_fs_has_locks(), dav_propdb_exists(), and dav_propdb_open().

dav_error* dav_dbm_fetch dav_db db,
apr_datum_t  key,
apr_datum_t pvalue
 

Definition at line 188 of file dbm.c.

References dav_fs_dbm_error(), dav_db::file, NULL, and status.

Referenced by dav_fs_load_lock_record(), dav_propdb_get_rollback(), dav_propdb_open(), and dav_propdb_output_value().

Here is the call graph for this function:

static dav_error* dav_dbm_firstkey dav_db db,
apr_datum_t pkey
[static]
 

Definition at line 214 of file dbm.c.

References dav_fs_dbm_error(), dav_db::file, NULL, and status.

Referenced by dav_propdb_first_name().

Here is the call graph for this function:

void dav_dbm_freedatum dav_db db,
apr_datum_t  data
 

Definition at line 228 of file dbm.c.

References dav_db::file.

Referenced by dav_fs_load_lock_record(), dav_propdb_next_name(), dav_propdb_open(), and dav_propdb_output_value().

void dav_dbm_get_statefiles apr_pool_t p,
const char *  fname,
const char **  state1,
const char **  state2
 

Definition at line 70 of file dbm.c.

References DAV_FS_STATE_FILE_FOR_DIR, and NULL.

Referenced by dav_fs_copymoveset(), and dav_fs_deleteset().

static dav_error* dav_dbm_nextkey dav_db db,
apr_datum_t pkey
[static]
 

Definition at line 221 of file dbm.c.

References dav_fs_dbm_error(), dav_db::file, NULL, and status.

Referenced by dav_propdb_next_name().

Here is the call graph for this function:

static dav_error* dav_dbm_open apr_pool_t p,
const dav_resource resource,
int  ro,
dav_db **  pdb
[static]
 

Definition at line 154 of file dbm.c.

References dav_dbm_open_direct(), dav_fs_dir_file_name(), dav_fs_ensure_state_dir(), DAV_FS_STATE_DIR, DAV_FS_STATE_FILE_FOR_DIR, fname, NULL, pathname, and void().

Referenced by dav_propdb_open().

Here is the call graph for this function:

dav_error* dav_dbm_open_direct apr_pool_t p,
const char *  pathname,
int  ro,
dav_db **  pdb
 

Definition at line 123 of file dbm.c.

References APR_DBM_READONLY, APR_DBM_RWCREATE, APR_OS_DEFAULT, apr_pcalloc, APR_SUCCESS, dav_fs_dbm_error(), file, NULL, and status.

Referenced by dav_dbm_open(), and dav_fs_really_open_lockdb().

Here is the call graph for this function:

dav_error* dav_dbm_store dav_db db,
apr_datum_t  key,
apr_datum_t  value
 

Definition at line 195 of file dbm.c.

References dav_fs_dbm_error(), dav_db::file, NULL, and status.

Referenced by dav_fs_save_lock_record(), dav_propdb_apply_rollback(), dav_propdb_close(), and dav_propdb_store().

Here is the call graph for this function:

static dav_error* dav_fs_dbm_error dav_db db,
apr_pool_t p,
apr_status_t  status
[static]
 

Definition at line 79 of file dbm.c.

References APR_SUCCESS, err, errbuf, errcode, dav_db::file, HTTP_INTERNAL_SERVER_ERROR, NULL, dav_db::pool, dav_error::save_errno, and void().

Referenced by dav_dbm_delete(), dav_dbm_fetch(), dav_dbm_firstkey(), dav_dbm_nextkey(), dav_dbm_open_direct(), and dav_dbm_store().

Here is the call graph for this function:

void dav_fs_ensure_state_dir apr_pool_t p,
const char *  dirname
 

Definition at line 110 of file dbm.c.

References apr_dir_make(), APR_OS_DEFAULT, DAV_FS_STATE_DIR, NULL, pathname, and void().

Referenced by dav_dbm_open(), and dav_fs_save_locknull_list().

Here is the call graph for this function:

static const char* dav_get_ns_table_uri dav_db db,
int  ns_id
[static]
 

Definition at line 632 of file dbm.c.

References dav_buffer::buf, dav_db::ns_table, and p.

Referenced by dav_set_name().

static dav_error* dav_propdb_apply_rollback dav_db db,
dav_deadprop_rollback rollback
[static]
 

Definition at line 725 of file dbm.c.

References dav_dbm_delete(), dav_dbm_store(), apr_datum_t::dptr, dav_deadprop_rollback::key, NULL, dav_deadprop_rollback::value, and void().

Here is the call graph for this function:

static void dav_propdb_close dav_db db  )  [static]
 

Definition at line 469 of file dbm.c.

References dav_buffer::buf, dav_buffer::cur_len, dav_dbm_close(), dav_dbm_store(), DAV_DBVSN_MAJOR, DAV_GDBM_NS_KEY, DAV_GDBM_NS_KEY_LEN, apr_datum_t::dptr, apr_datum_t::dsize, err, key, m, dav_propdb_metadata::major, dav_propdb_metadata::minor, dav_db::ns_count, dav_propdb_metadata::ns_count, dav_db::ns_table, dav_db::ns_table_dirty, value, and dav_db::version.

Here is the call graph for this function:

static dav_error* dav_propdb_define_namespaces dav_db db,
dav_xmlns_info xi
[static]
 

Definition at line 498 of file dbm.c.

References dav_buffer::buf, ns, dav_db::ns_table, NULL, dav_xmlns_info::pool, and uri.

static int dav_propdb_exists dav_db db,
const dav_prop_name name
[static]
 

Definition at line 626 of file dbm.c.

References dav_build_key(), dav_dbm_exists(), and key.

Here is the call graph for this function:

static dav_error* dav_propdb_first_name dav_db db,
dav_prop_name pname
[static]
 

Definition at line 686 of file dbm.c.

References dav_dbm_firstkey(), dav_propdb_next_name(), dav_set_name(), apr_datum_t::dptr, err, dav_db::iter, and NULL.

Here is the call graph for this function:

static dav_error* dav_propdb_get_rollback dav_db db,
const dav_prop_name name,
dav_deadprop_rollback **  prollback
[static]
 

Definition at line 701 of file dbm.c.

References apr_pcalloc, dav_build_key(), dav_dbm_fetch(), apr_datum_t::dptr, apr_datum_t::dsize, err, key, NULL, dav_db::pool, and value.

Here is the call graph for this function:

static dav_error* dav_propdb_map_namespaces dav_db db,
const apr_array_header_t namespaces,
dav_namespace_map **  mapping
[static]
 

Definition at line 548 of file dbm.c.

References dav_buffer::buf, dav_buffer::cur_len, apr_array_header_t::elts, int, m, apr_array_header_t::nelts, dav_db::ns_count, dav_db::ns_table, dav_db::ns_table_dirty, NULL, dav_db::pool, uri, and dav_db::uri_index.

static dav_error* dav_propdb_next_name dav_db db,
dav_prop_name pname
[static]
 

Definition at line 666 of file dbm.c.

References dav_dbm_freedatum(), dav_dbm_nextkey(), dav_set_name(), apr_datum_t::dptr, err, dav_db::iter, and NULL.

Referenced by dav_propdb_first_name().

Here is the call graph for this function:

static dav_error* dav_propdb_open apr_pool_t pool,
const dav_resource resource,
int  ro,
dav_db **  pdb
[static]
 

Definition at line 374 of file dbm.c.

References APR_HASH_KEY_STRING, dav_buffer::buf, dav_dbm_close(), dav_dbm_exists(), dav_dbm_fetch(), dav_dbm_freedatum(), dav_dbm_open(), DAV_DBVSN_MAJOR, DAV_DBVSN_MINOR, DAV_ERR_PROP_BAD_MAJOR, DAV_GDBM_NS_KEY, DAV_GDBM_NS_KEY_LEN, apr_datum_t::dptr, apr_datum_t::dsize, err, HTTP_INTERNAL_SERVER_ERROR, key, m, ns, dav_db::ns_count, dav_db::ns_table, NULL, uri, dav_db::uri_index, value, and dav_db::version.

Here is the call graph for this function:

static dav_error* dav_propdb_output_value dav_db db,
const dav_prop_name name,
dav_xmlns_info xi,
apr_text_header phdr,
int found
[static]
 

Definition at line 523 of file dbm.c.

References dav_append_prop(), dav_build_key(), dav_dbm_fetch(), dav_dbm_freedatum(), apr_datum_t::dptr, err, key, NULL, dav_db::pool, and value.

Here is the call graph for this function:

static dav_error* dav_propdb_remove dav_db db,
const dav_prop_name name
[static]
 

Definition at line 620 of file dbm.c.

References dav_build_key(), dav_dbm_delete(), and key.

Here is the call graph for this function:

static dav_error* dav_propdb_store dav_db db,
const dav_prop_name name,
const apr_xml_elem elem,
dav_namespace_map mapping
[static]
 

Definition at line 596 of file dbm.c.

References APR_XML_X2T_LANG_INNER, dav_build_key(), dav_dbm_store(), apr_datum_t::dptr, apr_datum_t::dsize, key, dav_namespace_map::ns_map, NULL, dav_db::pool, and value.

Here is the call graph for this function:

static void dav_set_name dav_db db,
dav_prop_name pname
[static]
 

Definition at line 642 of file dbm.c.

References ap_strchr_c, dav_get_ns_table_uri(), apr_datum_t::dptr, dav_db::iter, dav_prop_name::name, dav_prop_name::ns, NULL, and s.

Referenced by dav_propdb_first_name(), and dav_propdb_next_name().

Here is the call graph for this function:


Variable Documentation

const dav_hooks_db dav_hooks_db_dbm
 

Initial value:

Definition at line 737 of file dbm.c.