Asterisk - The Open Source Telephony Project  18.5.0
Data Structures | Macros | Typedefs | Enumerations | Functions
db.h File Reference
#include <sys/types.h>
#include <limits.h>
Include dependency graph for db.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  __db
 
struct  BTREEINFO
 
struct  DBT
 
struct  HASHINFO
 
struct  RECNOINFO
 

Macros

#define __BIT_TYPES_DEFINED__
 
#define __R_UNUSED   2 /* UNUSED */
 
#define BTREEMAGIC   0x053162
 
#define BTREEVERSION   3
 
#define DB_LOCK   0x2000 /* Do locking. */
 
#define DB_SHMEM   0x4000 /* Use shared memory. */
 
#define DB_TXN   0x8000 /* Do transactions. */
 
#define HASHMAGIC   0x061561
 
#define HASHVERSION   2
 
#define MAX_PAGE_NUMBER   0xffffffff /* >= # of pages in a file */
 
#define MAX_PAGE_OFFSET   65535 /* >= # of bytes in a page */
 
#define MAX_REC_NUMBER   0xffffffff /* >= # of records in a tree */
 
#define R_CURSOR   1 /* del, put, seq */
 
#define R_DUP   0x01 /* duplicate keys */
 
#define R_FIRST   3 /* seq */
 
#define R_FIXEDLEN   0x01 /* fixed-length records */
 
#define R_IAFTER   4 /* put (RECNO) */
 
#define R_IBEFORE   5 /* put (RECNO) */
 
#define R_LAST   6 /* seq (BTREE, RECNO) */
 
#define R_NEXT   7 /* seq */
 
#define R_NOKEY   0x02 /* key not required */
 
#define R_NOOVERWRITE   8 /* put */
 
#define R_PREV   9 /* seq (BTREE, RECNO) */
 
#define R_RECNOSYNC   11 /* sync (RECNO) */
 
#define R_SETCURSOR   10 /* put (RECNO) */
 
#define R_SNAPSHOT   0x04 /* snapshot the input */
 
#define RET_ERROR   -1 /* Return values. */
 
#define RET_SPECIAL   1
 
#define RET_SUCCESS   0
 

Typedefs

typedef struct __db DB
 
typedef u_int16_t indx_t
 
typedef short int16_t
 
typedef int int32_t
 
typedef __signed char int8_t
 
typedef u_int32_t pgno_t
 
typedef u_int32_t recno_t
 
typedef unsigned short u_int16_t
 
typedef unsigned int u_int32_t
 
typedef unsigned char u_int8_t
 

Enumerations

enum  DBTYPE { DB_BTREE, DB_HASH, DB_RECNO }
 

Functions

__BEGIN_DECLS DB *__dbopen __P ((const char *, int, int, DBTYPE, const void *))
 

Macro Definition Documentation

◆ __BIT_TYPES_DEFINED__

#define __BIT_TYPES_DEFINED__

Definition at line 56 of file db.h.

◆ __R_UNUSED

#define __R_UNUSED   2 /* UNUSED */

Definition at line 92 of file db.h.

◆ BTREEMAGIC

#define BTREEMAGIC   0x053162

Definition at line 141 of file db.h.

Referenced by __bt_open(), and bt_meta().

◆ BTREEVERSION

#define BTREEVERSION   3

Definition at line 142 of file db.h.

Referenced by __bt_open(), and bt_meta().

◆ DB_LOCK

#define DB_LOCK   0x2000 /* Do locking. */

Definition at line 123 of file db.h.

Referenced by __bt_open().

◆ DB_SHMEM

#define DB_SHMEM   0x4000 /* Use shared memory. */

Definition at line 124 of file db.h.

Referenced by __bt_open().

◆ DB_TXN

#define DB_TXN   0x8000 /* Do transactions. */

Definition at line 125 of file db.h.

Referenced by __bt_open().

◆ HASHMAGIC

#define HASHMAGIC   0x061561

Definition at line 159 of file db.h.

Referenced by __hash_open(), and flush_meta().

◆ HASHVERSION

#define HASHVERSION   2

Definition at line 160 of file db.h.

Referenced by __hash_open(), and flush_meta().

◆ MAX_PAGE_NUMBER

#define MAX_PAGE_NUMBER   0xffffffff /* >= # of pages in a file */

Definition at line 77 of file db.h.

Referenced by mpool_new().

◆ MAX_PAGE_OFFSET

#define MAX_PAGE_OFFSET   65535 /* >= # of bytes in a page */

Definition at line 79 of file db.h.

Referenced by __bt_open().

◆ MAX_REC_NUMBER

#define MAX_REC_NUMBER   0xffffffff /* >= # of records in a tree */

Definition at line 81 of file db.h.

Referenced by __rec_open(), __rec_seq(), and __rec_sync().

◆ R_CURSOR

#define R_CURSOR   1 /* del, put, seq */

◆ R_DUP

#define R_DUP   0x01 /* duplicate keys */

Definition at line 146 of file db.h.

Referenced by __bt_open().

◆ R_FIRST

#define R_FIRST   3 /* seq */

◆ R_FIXEDLEN

#define R_FIXEDLEN   0x01 /* fixed-length records */

Definition at line 175 of file db.h.

Referenced by __rec_open().

◆ R_IAFTER

#define R_IAFTER   4 /* put (RECNO) */

Definition at line 94 of file db.h.

Referenced by __rec_iput(), and __rec_put().

◆ R_IBEFORE

#define R_IBEFORE   5 /* put (RECNO) */

Definition at line 95 of file db.h.

Referenced by __rec_iput(), and __rec_put().

◆ R_LAST

#define R_LAST   6 /* seq (BTREE, RECNO) */

Definition at line 96 of file db.h.

Referenced by __bt_seq(), __bt_seqset(), __rec_seq(), and convert_bdb_to_sqlite3().

◆ R_NEXT

#define R_NEXT   7 /* seq */

◆ R_NOKEY

#define R_NOKEY   0x02 /* key not required */

Definition at line 176 of file db.h.

Referenced by __rec_open().

◆ R_NOOVERWRITE

#define R_NOOVERWRITE   8 /* put */

Definition at line 98 of file db.h.

Referenced by __bt_put(), __rec_put(), dbm_store(), hash_put(), and hsearch().

◆ R_PREV

#define R_PREV   9 /* seq (BTREE, RECNO) */

Definition at line 99 of file db.h.

Referenced by __bt_seq(), __bt_seqadv(), __bt_seqset(), and __rec_seq().

◆ R_RECNOSYNC

#define R_RECNOSYNC   11 /* sync (RECNO) */

Definition at line 101 of file db.h.

Referenced by __rec_sync().

◆ R_SETCURSOR

#define R_SETCURSOR   10 /* put (RECNO) */

Definition at line 100 of file db.h.

Referenced by __bt_put(), and __rec_put().

◆ R_SNAPSHOT

#define R_SNAPSHOT   0x04 /* snapshot the input */

Definition at line 177 of file db.h.

Referenced by __rec_open().

◆ RET_ERROR

#define RET_ERROR   -1 /* Return values. */

◆ RET_SPECIAL

#define RET_SPECIAL   1

◆ RET_SUCCESS

#define RET_SUCCESS   0

Typedef Documentation

◆ DB

typedef struct __db DB

◆ indx_t

typedef u_int16_t indx_t

Definition at line 80 of file db.h.

◆ int16_t

typedef short int16_t

Definition at line 59 of file db.h.

◆ int32_t

typedef int int32_t

Definition at line 60 of file db.h.

◆ int8_t

typedef __signed char int8_t

Definition at line 58 of file db.h.

◆ pgno_t

typedef u_int32_t pgno_t

Definition at line 78 of file db.h.

◆ recno_t

typedef u_int32_t recno_t

Definition at line 82 of file db.h.

◆ u_int16_t

typedef unsigned short u_int16_t

Definition at line 62 of file db.h.

◆ u_int32_t

typedef unsigned int u_int32_t

Definition at line 63 of file db.h.

◆ u_int8_t

typedef unsigned char u_int8_t

Definition at line 61 of file db.h.

Enumeration Type Documentation

◆ DBTYPE

enum DBTYPE
Enumerator
DB_BTREE 
DB_HASH 
DB_RECNO 

Definition at line 103 of file db.h.

Definition: db.h:103
Definition: db.h:103
Definition: db.h:103
DBTYPE
Definition: db.h:103

Function Documentation

◆ __P()

DB *dbopen __P ( (const char *, int, int, DBTYPE, const void *)  )