Apache HTTPD
Classes | Macros | Typedefs | Functions | Variables
SDBM library

Classes

struct  apr_sdbm_datum_t
 

Macros

#define APR_SDBM_DIRFEXT   ".dir"
 
#define APR_SDBM_PAGFEXT   ".pag"
 
#define APR_SDBM_INSERT   0
 
#define APR_SDBM_REPLACE   1
 
#define APR_SDBM_INSERTDUP   2
 

Typedefs

typedef struct apr_sdbm_t apr_sdbm_t
 

Functions

 APU_DECLARE (apr_status_t) apr_sdbm_open(apr_sdbm_t **db
 

Variables

const charname
 
const char apr_int32_t mode
 
const char apr_int32_t apr_fileperms_t perms
 
const char apr_int32_t apr_fileperms_t apr_pool_tp
 
int type
 
apr_sdbm_datum_tvalue
 
apr_sdbm_datum_t apr_sdbm_datum_t key
 
apr_sdbm_datum_t apr_sdbm_datum_t int opt
 

Detailed Description

Macro Definition Documentation

◆ APR_SDBM_DIRFEXT

#define APR_SDBM_DIRFEXT   ".dir"

SDBM Directory file extension

Definition at line 59 of file apr_sdbm.h.

◆ APR_SDBM_INSERT

#define APR_SDBM_INSERT   0

Insert

Definition at line 64 of file apr_sdbm.h.

◆ APR_SDBM_INSERTDUP

#define APR_SDBM_INSERTDUP   2

Insert with duplicates

Definition at line 66 of file apr_sdbm.h.

◆ APR_SDBM_PAGFEXT

#define APR_SDBM_PAGFEXT   ".pag"

SDBM page file extension

Definition at line 61 of file apr_sdbm.h.

◆ APR_SDBM_REPLACE

#define APR_SDBM_REPLACE   1

Replace

Definition at line 65 of file apr_sdbm.h.

Typedef Documentation

◆ apr_sdbm_t

Structure for referencing an sdbm

Definition at line 44 of file apr_sdbm.h.

Function Documentation

◆ APU_DECLARE()

APU_DECLARE ( apr_status_t  )

Open an sdbm database by file name

Parameters
dbThe newly opened database
nameThe sdbm file to open
modeThe flag values (APR_READ and APR_BINARY flags are implicit)
          APR_WRITE          open for read-write access
          APR_CREATE         create the sdbm if it does not exist
          APR_TRUNCATE       empty the contents of the sdbm
          APR_EXCL           fail for APR_CREATE if the file exists
          APR_DELONCLOSE     delete the sdbm when closed
          APR_SHARELOCK      support locking across process/machines
permsPermissions to apply to if created
pThe pool to use when creating the sdbm
Remarks
The sdbm name is not a true file name, as sdbm appends suffixes for seperate data and index files.

Close an sdbm file previously opened by apr_sdbm_open

Parameters
dbThe database to close

Lock an sdbm database for concurency of multiple operations

Parameters
dbThe database to lock
typeThe lock type
          APR_FLOCK_SHARED
          APR_FLOCK_EXCLUSIVE
Remarks
Calls to apr_sdbm_lock may be nested. All apr_sdbm functions perform implicit locking. Since an APR_FLOCK_SHARED lock cannot be portably promoted to an APR_FLOCK_EXCLUSIVE lock, apr_sdbm_store and apr_sdbm_delete calls will fail if an APR_FLOCK_SHARED lock is held. The apr_sdbm_lock call requires the database to be opened with the APR_SHARELOCK mode value.

Release an sdbm lock previously aquired by apr_sdbm_lock

Parameters
dbThe database to unlock

Fetch an sdbm record value by key

Parameters
dbThe database
valueThe value datum retrieved for this record
keyThe key datum to find this record

Store an sdbm record value by key

Parameters
dbThe database
keyThe key datum to store this record by
valueThe value datum to store in this record
optThe method used to store the record
          APR_SDBM_INSERT     return an error if the record exists
          APR_SDBM_REPLACE    overwrite any existing record for key

Delete an sdbm record value by key

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

Retrieve the first record key from a dbm

Parameters
dbThe database
keyThe key datum of the first record
Remarks
The keys returned are not ordered. To traverse the list of keys for an sdbm opened with APR_SHARELOCK, the caller must use apr_sdbm_lock prior to retrieving the first record, and hold the lock until after the last call to apr_sdbm_nextkey.

Retrieve the next record key from an sdbm

Parameters
dbThe database
keyThe key datum of the next record

Returns true if the sdbm database opened for read-only access

Parameters
dbThe database to test

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

Variable Documentation

◆ key

Definition at line 127 of file apr_sdbm.h.

◆ mode

Definition at line 87 of file apr_sdbm.h.

◆ name

const char* name

Definition at line 86 of file apr_sdbm.h.

◆ opt

Definition at line 141 of file apr_sdbm.h.

◆ p

Definition at line 88 of file apr_sdbm.h.

◆ perms

Definition at line 88 of file apr_sdbm.h.

◆ type

int type

Definition at line 111 of file apr_sdbm.h.

◆ value

Definition at line 126 of file apr_sdbm.h.