rpm
5.4.10
rpmdb
db_emu.h
Go to the documentation of this file.
1
/*
2
* This file emulates the db3/4 structures
3
* ...this is supposed to be compatible w/ the _real_ db.h!
4
*/
5
6
#ifndef __DB_EMU_H
7
#define __DB_EMU_H
8
9
struct
__db
;
typedef
struct
__db
DB
;
10
struct
__db_dbt
;
typedef
struct
__db_dbt
DBT
;
11
struct
__db_env
;
typedef
struct
__db_env
DB_ENV
;
12
struct
__db_h_stat
;
typedef
struct
__db_h_stat
DB_HASH_STAT
;
13
struct
__dbc
;
typedef
struct
__dbc
DBC
;
14
struct
__db_sequence;
typedef
struct
__db_sequence
DB_SEQUENCE
;
15
struct
__db_txn
;
typedef
struct
__db_txn
DB_TXN
;
16
17
struct
__db
{
18
void
*
app_private
;
19
};
20
21
struct
__db_dbt
{
22
void
*
data
;
23
uint32_t
size
;
24
25
uint32_t
ulen
;
26
uint32_t
dlen
;
27
uint32_t
doff
;
28
29
void
*
app_data
;
30
31
#define DB_DBT_APPMALLOC 0x001
/* Callback allocated memory. */
32
#define DB_DBT_BULK 0x002
/* Internal: Insert if duplicate. */
33
#define DB_DBT_DUPOK 0x004
/* Internal: Insert if duplicate. */
34
#define DB_DBT_ISSET 0x008
/* Lower level calls set value. */
35
#define DB_DBT_MALLOC 0x010
/* Return in malloc'd memory. */
36
#define DB_DBT_MULTIPLE 0x020
/* References multiple records. */
37
#define DB_DBT_PARTIAL 0x040
/* Partial put/get. */
38
#define DB_DBT_REALLOC 0x080
/* Return in realloc'd memory. */
39
#define DB_DBT_READONLY 0x100
/* Readonly, don't update. */
40
#define DB_DBT_STREAMING 0x200
/* Internal: DBT is being streamed. */
41
#define DB_DBT_USERCOPY 0x400
/* Use the user-supplied callback. */
42
#define DB_DBT_USERMEM 0x800
/* Return in user's memory. */
43
uint32_t
flags
;
44
};
45
46
struct
__db_env
{
47
void
*
app_private
;
48
int (*txn_begin) (
DB_ENV
*,
DB_TXN
*, DB_TXN **, uint32_t);
49
int (*txn_checkpoint) (
DB_ENV
*, uint32_t, uint32_t, uint32_t);
50
};
51
52
struct
__db_h_stat
{
/* SHARED */
53
uint32_t
hash_magic
;
/* Magic number. */
54
uint32_t
hash_version
;
/* Version number. */
55
uint32_t
hash_metaflags
;
/* Metadata flags. */
56
uint32_t
hash_nkeys
;
/* Number of unique keys. */
57
uint32_t
hash_ndata
;
/* Number of data items. */
58
uint32_t
hash_pagecnt
;
/* Page count. */
59
uint32_t
hash_pagesize
;
/* Page size. */
60
uint32_t
hash_ffactor
;
/* Fill factor specified at create. */
61
uint32_t
hash_buckets
;
/* Number of hash buckets. */
62
uint32_t
hash_free
;
/* Pages on the free list. */
63
uintmax_t
hash_bfree
;
/* Bytes free on bucket pages. */
64
uint32_t
hash_bigpages
;
/* Number of big key/data pages. */
65
uintmax_t
hash_big_bfree
;
/* Bytes free on big item pages. */
66
uint32_t
hash_overflows
;
/* Number of overflow pages. */
67
uintmax_t
hash_ovfl_free
;
/* Bytes free on ovfl pages. */
68
uint32_t
hash_dup
;
/* Number of dup pages. */
69
uintmax_t
hash_dup_free
;
/* Bytes free on duplicate pages. */
70
};
71
72
struct
__dbc
{
73
DB
*
dbp
;
74
};
75
76
struct
__db_txn
{
77
int (*abort) (
DB_TXN
*);
78
int (*commit) (
DB_TXN
*, uint32_t);
79
int (*get_name) (
DB_TXN
*,
const
char
**);
80
uint32_t (*
id
) (
DB_TXN
*);
81
int (*set_name) (
DB_TXN
*,
const
char
*);
82
};
83
84
#define DB_CURRENT 6
85
#define DB_KEYLAST 14
86
#define DB_NEXT 16
87
#define DB_NEXT_DUP 17
88
#define DB_SET 26
89
#define DB_SET_RANGE 27
90
91
#define DB_WRITECURSOR 0x00000010
92
93
#define DB_BUFFER_SMALL (-30999)
94
#define DB_NOTFOUND (-30988)
95
96
#define DB_INIT_TXN 0x00002000
97
#define DB_EXCL 0x0004000
98
#define DB_PRIVATE 0x0200000
99
100
#define DB_VERSION_MAJOR 3
101
#define DB_VERSION_MINOR 0
102
#define DB_VERSION_PATCH 0
103
104
/* --- for rpmdb/dbconfig.c tables: */
105
typedef
enum
{
106
DB_BTREE
=1,
107
DB_HASH
=2,
108
DB_HEAP
=6,
109
DB_RECNO
=3,
110
DB_QUEUE
=4,
111
DB_UNKNOWN
=5
/* Figure it out on open. */
112
}
DBTYPE
;
113
#define DB_CREATE 0x00000001
114
#define DB_INIT_LOCK 0x00000100
115
#define DB_INIT_LOG 0x00000200
116
#define DB_INIT_MPOOL 0x00000400
117
#define DB_INIT_TXN 0x00002000
118
#define DB_AUTO_COMMIT 0x00000100
119
#define DB_THREAD 0x00000020
120
#define DB_DUP 0x00000010
121
#define DB_DUPSORT 0x00000002
122
123
#endif
__db::app_private
void * app_private
Definition:
db_emu.h:18
__db_h_stat::hash_ovfl_free
uintmax_t hash_ovfl_free
Definition:
db_emu.h:67
__db_h_stat::hash_bigpages
uint32_t hash_bigpages
Definition:
db_emu.h:64
__db_h_stat::hash_dup_free
uintmax_t hash_dup_free
Definition:
db_emu.h:69
__db_h_stat::hash_overflows
uint32_t hash_overflows
Definition:
db_emu.h:66
__db_h_stat::hash_metaflags
uint32_t hash_metaflags
Definition:
db_emu.h:55
DB_UNKNOWN
Definition:
db_emu.h:111
__db_env::app_private
void * app_private
Definition:
db_emu.h:47
DB_QUEUE
Definition:
db_emu.h:110
__db_env
Definition:
db_emu.h:46
__db_h_stat
Definition:
db_emu.h:52
__db_h_stat::hash_bfree
uintmax_t hash_bfree
Definition:
db_emu.h:63
__db_h_stat::hash_free
uint32_t hash_free
Definition:
db_emu.h:62
DB_BTREE
Definition:
db_emu.h:106
DB_RECNO
Definition:
db_emu.h:109
__db_dbt::data
void * data
Definition:
db_emu.h:22
DB_HASH
Definition:
db_emu.h:107
DBTYPE
DBTYPE
Definition:
db_emu.h:105
__db_dbt::dlen
uint32_t dlen
Definition:
db_emu.h:26
__db_txn
Definition:
db_emu.h:76
__db_h_stat::hash_buckets
uint32_t hash_buckets
Definition:
db_emu.h:61
__db_dbt
Definition:
db_emu.h:21
__db_h_stat::hash_pagecnt
uint32_t hash_pagecnt
Definition:
db_emu.h:58
__db_dbt::ulen
uint32_t ulen
Definition:
db_emu.h:25
DB_HEAP
Definition:
db_emu.h:108
__db_dbt::size
uint32_t size
Definition:
db_emu.h:23
__db_dbt::flags
uint32_t flags
Definition:
db_emu.h:43
DB_SEQUENCE
struct __db_sequence DB_SEQUENCE
Definition:
db_emu.h:14
__db_h_stat::hash_nkeys
uint32_t hash_nkeys
Definition:
db_emu.h:56
__db_h_stat::hash_version
uint32_t hash_version
Definition:
db_emu.h:54
__db_h_stat::hash_big_bfree
uintmax_t hash_big_bfree
Definition:
db_emu.h:65
__db_h_stat::hash_ndata
uint32_t hash_ndata
Definition:
db_emu.h:57
__db_h_stat::hash_magic
uint32_t hash_magic
Definition:
db_emu.h:53
__db_h_stat::hash_ffactor
uint32_t hash_ffactor
Definition:
db_emu.h:60
__db_dbt::app_data
void * app_data
Definition:
db_emu.h:29
__dbc
Definition:
db_emu.h:72
__dbc::dbp
DB * dbp
Definition:
db_emu.h:73
__db
Definition:
db_emu.h:17
__db_h_stat::hash_pagesize
uint32_t hash_pagesize
Definition:
db_emu.h:59
__db_h_stat::hash_dup
uint32_t hash_dup
Definition:
db_emu.h:68
__db_dbt::doff
uint32_t doff
Definition:
db_emu.h:27
Generated by
1.8.12