Apache HTTPD
Modules | Classes | Macros | Typedefs | Functions | Variables
DBM routines

Modules

 SDBM library
 

Classes

struct  apr_datum_t
 

Macros

#define APR_DBM_READONLY   1
 
#define APR_DBM_READWRITE   2
 
#define APR_DBM_RWCREATE   3
 
#define APR_DBM_RWTRUNC   4
 

Typedefs

typedef struct apr_dbm_t apr_dbm_t
 

Functions

 APU_DECLARE (apr_status_t) apr_dbm_open_ex(apr_dbm_t **dbm
 
 APU_DECLARE (void) apr_dbm_close(apr_dbm_t *dbm)
 Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIPHASH_KSIZE) secret key, into a possibly unaligned buffer (using the little endian representation as defined by the authors for interoperabilty) usable as a MAC.
 
 APU_DECLARE (char *) apr_dbm_geterror(apr_dbm_t *dbm
 

Variables

const chartype
 
const char const charname
 
const char const char apr_int32_t mode
 
const char const char apr_int32_t apr_fileperms_t perm
 
const char const char apr_int32_t apr_fileperms_t apr_pool_tcntxt
 
apr_datum_t key
 
apr_datum_t apr_datum_tpvalue
 
apr_datum_t apr_datum_t value
 
apr_datum_tpkey
 
apr_datum_t data
 
interrcode
 
int charerrbuf
 
int char apr_size_t errbufsize
 
const char const charpathname
 
const char const char const char ** used1
 
const char const char const char const char ** used2
 

Detailed Description

Macro Definition Documentation

◆ APR_DBM_READONLY

#define APR_DBM_READONLY   1

open for read-only access

Definition at line 56 of file apr_dbm.h.

◆ APR_DBM_READWRITE

#define APR_DBM_READWRITE   2

open for read-write access

Definition at line 57 of file apr_dbm.h.

◆ APR_DBM_RWCREATE

#define APR_DBM_RWCREATE   3

open for r/w, create if needed

Definition at line 58 of file apr_dbm.h.

◆ APR_DBM_RWTRUNC

#define APR_DBM_RWTRUNC   4

open for r/w, truncating an existing DB if present

Definition at line 60 of file apr_dbm.h.

Typedef Documentation

◆ apr_dbm_t

Structure for referencing a dbm

Definition at line 42 of file apr_dbm.h.

Function Documentation

◆ APU_DECLARE() [1/3]

APU_DECLARE ( apr_status_t  )

Open a dbm file by file name and type of DBM

Parameters
dbmThe newly opened database
typeThe type of the DBM (not all may be available at run time)
 db   for Berkeley DB files
 gdbm for GDBM files
 ndbm for NDBM files
 sdbm for SDBM files (always available)
 default for the default DBM type
 
nameThe dbm file name to open
modeThe flag value
          APR_DBM_READONLY   open for read-only access
          APR_DBM_READWRITE  open for read-write access
          APR_DBM_RWCREATE   open for r/w, create if needed
          APR_DBM_RWTRUNC    open for r/w, truncate if already there
permPermissions to apply to if created
cntxtThe pool to use when creating the dbm
Remarks
The dbm name may not be a true file name, as many dbm packages append suffixes for seperate data and index files.
Bug:
In apr-util 0.9 and 1.x, the type arg was case insensitive. This was highly inefficient, and as of 2.x the dbm name must be provided in the correct case (lower case for all bundled providers)

Open a dbm file by file name

Parameters
dbmThe newly opened database
nameThe dbm file name to open
modeThe flag value
          APR_DBM_READONLY   open for read-only access
          APR_DBM_READWRITE  open for read-write access
          APR_DBM_RWCREATE   open for r/w, create if needed
          APR_DBM_RWTRUNC    open for r/w, truncate if already there
permPermissions to apply to if created
cntxtThe pool to use when creating the dbm
Remarks
The dbm name may not be a true file name, as many dbm packages append suffixes for seperate data and index files.

Fetch a dbm record value by key

Parameters
dbmThe database
keyThe key datum to find this record
pvalueThe value datum retrieved for this record

Store a dbm record value by key

Parameters
dbmThe database
keyThe key datum to store this record by
valueThe value datum to store in this record

Delete a dbm record value by key

Parameters
dbmThe database
keyThe key datum of the record to delete
Remarks
It is not an error to delete a non-existent record.

Search for a key within the dbm

Parameters
dbmThe database
keyThe datum describing a key to test

Retrieve the first record key from a dbm

Parameters
dbmThe database
pkeyThe key datum of the first record

Retrieve the next record key from a dbm

Parameters
dbmThe database
pkeyThe key datum of the next record

If the specified file/path were passed to apr_dbm_open(), return the actual file/path names which would be (created and) used. At most, two files may be used; used2 may be NULL if only one file is used.

Parameters
poolThe pool for allocating used1 and used2.
typeThe type of DBM you require info on
See also
apr_dbm_open_ex
Parameters
pathnameThe path name to generate used-names from.
used1The first pathname used by the apr_dbm implementation.
used2The second pathname used by apr_dbm. If only one file is used by the specific implementation, this will be set to NULL.
Returns
An error if the specified type is invalid.
Remarks
The dbm file(s) don't need to exist. This function only manipulates the pathnames.

< 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.

< 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.

< mask to extract lock type

< 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".

< Size of the file

< 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".

Definition at line 358 of file apr_brigade.c.

◆ APU_DECLARE() [2/3]

APU_DECLARE ( char )

Report more information when an apr_dbm function fails.

Parameters
dbmThe database
errcodeA DBM-specific value for the error (for logging). If this isn't needed, it may be NULL.
errbufLocation to store the error text
errbufsizeThe size of the provided buffer
Returns
The errbuf parameter, for convenience.

◆ APU_DECLARE() [3/3]

APU_DECLARE ( void  )

Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIPHASH_KSIZE) secret key, into a possibly unaligned buffer (using the little endian representation as defined by the authors for interoperabilty) usable as a MAC.

Close a dbm file previously opened by apr_dbm_open

Parameters
dbmThe database to close

Proactively toss any memory associated with the apr_datum_t.

Parameters
dbmThe database
dataThe datum to free.

If the specified file/path were passed to apr_dbm_open(), return the actual file/path names which would be (created and) used. At most, two files may be used; used2 may be NULL if only one file is used.

Parameters
poolThe pool for allocating used1 and used2.
pathnameThe path name to generate used-names from.
used1The first pathname used by the apr_dbm implementation.
used2The second pathname used by apr_dbm. If only one file is used by the specific implementation, this will be set to NULL.
Remarks
The dbm file(s) don't need to exist. This function only manipulates the pathnames.

< use pool pre cleanup

Definition at line 128 of file apr_sha1.c.

Variable Documentation

◆ cntxt

Definition at line 92 of file apr_dbm.h.

◆ data

Definition at line 172 of file apr_dbm.h.

◆ errbuf

int char* errbuf

Definition at line 184 of file apr_dbm.h.

◆ errbufsize

int char apr_size_t errbufsize

Definition at line 184 of file apr_dbm.h.

◆ errcode

int* errcode

Definition at line 183 of file apr_dbm.h.

◆ key

Definition at line 127 of file apr_dbm.h.

◆ mode

Definition at line 91 of file apr_dbm.h.

◆ name

const char * name

Definition at line 90 of file apr_dbm.h.

◆ pathname

const char * pathname

Definition at line 201 of file apr_dbm.h.

◆ perm

Definition at line 91 of file apr_dbm.h.

◆ pkey

apr_datum_t * pkey

Definition at line 158 of file apr_dbm.h.

◆ pvalue

Definition at line 128 of file apr_dbm.h.

◆ type

const char * type

Definition at line 89 of file apr_dbm.h.

◆ used1

const char const char ** used1

Definition at line 202 of file apr_dbm.h.

◆ used2

Definition at line 203 of file apr_dbm.h.

◆ value

Definition at line 136 of file apr_dbm.h.