|
Apache HTTPD
|
#include "apr.h"#include "apr_file_io.h"#include "apr_strings.h"#include "apr_errno.h"#include "apr_sdbm.h"#include "sdbm_tune.h"#include "sdbm_pair.h"#include "sdbm_private.h"#include <string.h>#include <stdlib.h>Go to the source code of this file.
Macros | |
| #define | bad(x) ((x).dptr == NULL || (x).dsize <= 0) |
| #define | exhash(item) sdbm_hash((item).dptr, (item).dsize) |
| #define | OFF_PAG(off) (apr_off_t) (off) * PBLKSIZ |
| #define | OFF_DIR(off) (apr_off_t) (off) * DBLKSIZ |
Functions | |
| static int | getdbit (apr_sdbm_t *, long) |
| static apr_status_t | setdbit (apr_sdbm_t *, long) |
| static apr_status_t | getpage (apr_sdbm_t *db, long, int, int) |
| static apr_status_t | getnext (apr_sdbm_datum_t *key, apr_sdbm_t *db) |
| static apr_status_t | makroom (apr_sdbm_t *, long, int) |
| static apr_status_t | database_cleanup (void *data) |
| static apr_status_t | prep (apr_sdbm_t **pdb, const char *dirname, const char *pagname, apr_int32_t flags, apr_fileperms_t perms, apr_pool_t *p) |
| APU_DECLARE (apr_status_t) | |
| static apr_status_t | write_page (apr_sdbm_t *db, const char *buf, long pagno) |
| static apr_status_t | read_from (apr_file_t *f, void *buf, apr_off_t off, apr_size_t len, int create) |
Variables | |
| static const long | masks [] |
| const apr_sdbm_datum_t | apu__sdbm_nullitem = { NULL, 0 } |
| APU_DECLARE | ( | int | ) |
Most DBM libraries take a POSIX mode for creating files. Don't trust the mode_t type, some platforms may not support it, int is safe.
< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.
< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".
< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".
< Replace
< Insert with duplicates
< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.
< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.
|
static |
|
static |
|
static |
|
static |
|
static |
< Open the file for writing
< Platform dependent support for higher level locked read/write access to support writes across process/machines
< Platform dependent support for higher level locked read/write access to support writes across process/machines
< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)
< Open the file for reading
< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.
< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".
|
static |
|
static |
|
static |
| const apr_sdbm_datum_t apu__sdbm_nullitem = { NULL, 0 } |