Files | |
file | rpmlib.h |
In Memoriam: Steve Taylor <staylor@redhat.com> was here, now he's not. | |
file | rpmdb.c |
file | rpmdb.h |
Access RPM indices using Berkeley DB interface(s). | |
Data Structures | |
struct | dbiHStats_s |
Hash database statistics. More... | |
struct | dbiBStats_s |
B-tree database statistics. More... | |
struct | _dbiIndexItem |
A single item from an index database (i.e. More... | |
struct | _dbiIndexSet |
Items retrieved from the index database. More... | |
struct | _dbiVec |
Private methods for accessing an index database. More... | |
struct | _dbiIndex |
Describes an index database (implemented on Berkeley db3 functionality). More... | |
Functions | |
dbiIndex | dbiOpen (rpmdb db, rpmTag rpmtag, unsigned int flags) |
Return handle for an index database. | |
static int | dbiCopen (dbiIndex dbi, DB_TXN *txnid, DBC **dbcp, unsigned int flags) |
Open a database cursor. | |
static int | dbiCclose (dbiIndex dbi, DBC *dbcursor, unsigned int flags) |
Close a database cursor. | |
static int | dbiCdup (dbiIndex dbi, DBC *dbcursor, DBC **dbcp, unsigned int flags) |
Duplicate a database cursor. | |
static int | dbiDel (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, unsigned int flags) |
Delete (key,data) pair(s) from index database. | |
static int | dbiGet (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, unsigned int flags) |
Retrieve (key,data) pair from index database. | |
static int | dbiPget (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *pkey, DBT *data, unsigned int flags) |
Retrieve (key,data) pair using dbcursor->c_pget. | |
static int | dbiPut (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, unsigned int flags) |
Store (key,data) pair in index database. | |
static int | dbiCount (dbiIndex dbi, DBC *dbcursor, unsigned int *countp, unsigned int flags) |
Retrieve count of (possible) duplicate items. | |
static int | dbiVerify (dbiIndex dbi, unsigned int flags) |
Verify (and close) index database. | |
static int | dbiClose (dbiIndex dbi, unsigned int flags) |
Close index database. | |
static int | dbiSync (dbiIndex dbi, unsigned int flags) |
Flush pending operations to disk. | |
static int | dbiAssociate (dbiIndex dbi, dbiIndex dbisecondary, int(*callback)(DB *, const DBT *, const DBT *, DBT *), unsigned int flags) |
Associate secondary database with primary. | |
static int | dbiJoin (dbiIndex dbi, DBC **curslist, DBC **dbcp, unsigned int flags) |
Return join cursor for list of cursors. | |
static int | dbiByteSwapped (dbiIndex dbi) |
Is database byte swapped? | |
static int | dbiStat (dbiIndex dbi, unsigned int flags) |
Is database byte swapped? | |
dbiIndexSet | dbiFreeIndexSet (dbiIndexSet set) |
Destroy set of index database items. | |
unsigned int | dbiIndexSetCount (dbiIndexSet set) |
Count items in index database set. | |
unsigned int | dbiIndexRecordOffset (dbiIndexSet set, int recno) |
Return record offset of header from element in index database set. | |
unsigned int | dbiIndexRecordFileNumber (dbiIndexSet set, int recno) |
Return file index from element in index database set. | |
Variables | |
int(* | _dbiVec::open )(rpmdb rpmdb, rpmTag rpmtag, dbiIndex *dbip) |
Return handle for an index database. | |
int(* | _dbiVec::close )(dbiIndex dbi, unsigned int flags) |
Close index database, and destroy database handle. | |
int(* | _dbiVec::sync )(dbiIndex dbi, unsigned int flags) |
Flush pending operations to disk. | |
int(* | _dbiVec::associate )(dbiIndex dbi, dbiIndex dbisecondary, int(*callback)(DB *, const DBT *, const DBT *, DBT *), unsigned int flags) |
Associate secondary database with primary. | |
int(* | _dbiVec::join )(dbiIndex dbi, DBC **curslist, DBC **dbcp, unsigned int flags) |
Return join cursor for list of cursors. | |
int(* | _dbiVec::copen )(dbiIndex dbi, DB_TXN *txnid, DBC **dbcp, unsigned int dbiflags) |
Open database cursor. | |
int(* | _dbiVec::cclose )(dbiIndex dbi, DBC *dbcursor, unsigned int flags) |
Close database cursor. | |
int(* | _dbiVec::cdup )(dbiIndex dbi, DBC *dbcursor, DBC **dbcp, unsigned int flags) |
Duplicate a database cursor. | |
int(* | _dbiVec::cdel )(dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, unsigned int flags) |
Delete (key,data) pair(s) using db->del or dbcursor->c_del. | |
int(* | _dbiVec::cget )(dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, unsigned int flags) |
Retrieve (key,data) pair using db->get or dbcursor->c_get. | |
int(* | _dbiVec::cpget )(dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *pkey, DBT *data, unsigned int flags) |
Retrieve (key,data) pair using dbcursor->c_pget. | |
int(* | _dbiVec::cput )(dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, unsigned int flags) |
Store (key,data) pair using db->put or dbcursor->c_put. | |
int(* | _dbiVec::ccount )(dbiIndex dbi, DBC *dbcursor, unsigned int *countp, unsigned int flags) |
Retrieve count of (possible) duplicate items using dbcursor->c_count. | |
int(* | _dbiVec::byteswapped )(dbiIndex dbi) |
Is database byte swapped? | |
int(* | _dbiVec::stat )(dbiIndex dbi, unsigned int flags) |
Save statistics in database handle. |
static int dbiAssociate | ( | dbiIndex | dbi, | |
dbiIndex | dbisecondary, | |||
int(*)(DB *, const DBT *, const DBT *, DBT *) | callback, | |||
unsigned int | flags | |||
) | [inline, static] |
Associate secondary database with primary.
dbi | index database handle | |
dbisecondary | secondary index database handle | |
callback | create secondary key from primary (NULL if DB_RDONLY) | |
flags | DB_CREATE or 0 |
Definition at line 712 of file rpmdb.h.
References _dbiVec::associate, and _dbiIndex::dbi_vec.
static int dbiByteSwapped | ( | dbiIndex | dbi | ) | [inline, static] |
Is database byte swapped?
dbi | index database handle |
Definition at line 744 of file rpmdb.h.
References _dbiVec::byteswapped, _dbiIndex::dbi_byteswapped, and _dbiIndex::dbi_vec.
Referenced by dbt2set(), rpmdbAdd(), rpmdbInitIterator(), rpmdbNextIterator(), rpmdbRemove(), and set2dbt().
static int dbiCclose | ( | dbiIndex | dbi, | |
DBC * | dbcursor, | |||
unsigned int | flags | |||
) | [inline, static] |
Close a database cursor.
dbi | index database handle | |
dbcursor | database cursor | |
flags | (unused) |
Definition at line 527 of file rpmdb.h.
References _dbiVec::cclose, and _dbiIndex::dbi_vec.
Referenced by rpmdbAdd(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbFreeIterator(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbRemove(), and unsatisfiedDepend().
static int dbiCdup | ( | dbiIndex | dbi, | |
DBC * | dbcursor, | |||
DBC ** | dbcp, | |||
unsigned int | flags | |||
) | [inline, static] |
Duplicate a database cursor.
dbi | index database handle | |
dbcursor | database cursor |
dbcp | address of new database cursor |
flags | DB_POSITION for same position, 0 for uninitialized |
Definition at line 543 of file rpmdb.h.
References _dbiVec::cdup, and _dbiIndex::dbi_vec.
static int dbiClose | ( | dbiIndex | dbi, | |
unsigned int | flags | |||
) | [inline, static] |
Close index database.
dbi | index database handle | |
flags | (unused) |
Definition at line 682 of file rpmdb.h.
References _dbiVec::close, and _dbiIndex::dbi_vec.
Referenced by rpmdbClose(), and rpmdbCloseDBI().
static int dbiCopen | ( | dbiIndex | dbi, | |
DB_TXN * | txnid, | |||
DBC ** | dbcp, | |||
unsigned int | flags | |||
) | [inline, static] |
Open a database cursor.
dbi | index database handle | |
txnid | database transaction handle |
dbcp | returned database cursor |
flags | DB_WRITECURSOR if writing, or 0 |
Definition at line 511 of file rpmdb.h.
References _dbiVec::copen, and _dbiIndex::dbi_vec.
Referenced by rpmdbAdd(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbNextIterator(), rpmdbRemove(), and unsatisfiedDepend().
static int dbiCount | ( | dbiIndex | dbi, | |
DBC * | dbcursor, | |||
unsigned int * | countp, | |||
unsigned int | flags | |||
) | [inline, static] |
Retrieve count of (possible) duplicate items.
dbi | index database handle | |
dbcursor | database cursor | |
countp | address of count | |
flags | (unused) |
Definition at line 652 of file rpmdb.h.
References _dbiVec::ccount, and _dbiIndex::dbi_vec.
static int dbiDel | ( | dbiIndex | dbi, | |
DBC * | dbcursor, | |||
DBT * | key, | |||
DBT * | data, | |||
unsigned int | flags | |||
) | [inline, static] |
Delete (key,data) pair(s) from index database.
dbi | index database handle | |
dbcursor | database cursor (NULL will use db->del) | |
key | delete key value/length/flags | |
data | delete data value/length/flags | |
flags | (unused) |
Definition at line 560 of file rpmdb.h.
References _dbiVec::cdel, rpmdb_s::db_delops, _dbiIndex::dbi_rpmdb, _dbiIndex::dbi_vec, rpmswEnter(), and rpmswExit().
Referenced by rpmdbRemove().
dbiIndexSet dbiFreeIndexSet | ( | dbiIndexSet | set | ) |
Destroy set of index database items.
set | set of index database items |
Definition at line 643 of file rpmdb.c.
References _free(), and _dbiIndexSet::recs.
Referenced by dbiFindByLabel(), dbiFindMatches(), rpmdbAdd(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbInitIterator(), rpmdbRemove(), and rpmtsRun().
static int dbiGet | ( | dbiIndex | dbi, | |
DBC * | dbcursor, | |||
DBT * | key, | |||
DBT * | data, | |||
unsigned int | flags | |||
) | [inline, static] |
Retrieve (key,data) pair from index database.
dbi | index database handle | |
dbcursor | database cursor (NULL will use db->get) | |
key | retrieve key value/length/flags | |
data | retrieve data value/length/flags | |
flags | (unused) |
Definition at line 583 of file rpmdb.h.
References _dbiVec::cget, rpmdb_s::db_getops, _dbiIndex::dbi_rpmdb, _dbiIndex::dbi_vec, rpmswEnter(), and rpmswExit().
Referenced by dbiFindMatches(), rpmdbAdd(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbNextIterator(), rpmdbRemove(), and unsatisfiedDepend().
unsigned int dbiIndexRecordFileNumber | ( | dbiIndexSet | set, | |
int | recno | |||
) |
Return file index from element in index database set.
set | set of index database items | |
recno | index of item in set |
Definition at line 638 of file rpmdb.c.
Referenced by rpmdbFindByFile(), rpmdbNextIterator(), and rpmtsRun().
unsigned int dbiIndexRecordOffset | ( | dbiIndexSet | set, | |
int | recno | |||
) |
Return record offset of header from element in index database set.
set | set of index database items | |
recno | index of item in set |
Definition at line 633 of file rpmdb.c.
Referenced by dbiFindMatches(), rpmdbFindByFile(), rpmdbNextIterator(), and rpmtsRun().
unsigned int dbiIndexSetCount | ( | dbiIndexSet | set | ) |
Count items in index database set.
set | set of index database items |
Definition at line 628 of file rpmdb.c.
Referenced by dbiFindMatches(), rpmdbCountPackages(), and rpmtsRun().
static int dbiJoin | ( | dbiIndex | dbi, | |
DBC ** | curslist, | |||
DBC ** | dbcp, | |||
unsigned int | flags | |||
) | [inline, static] |
Return join cursor for list of cursors.
dbi | index database handle | |
curslist | NULL terminated list of database cursors |
dbcp | address of join database cursor |
flags | DB_JOIN_NOSORT or 0 |
Definition at line 730 of file rpmdb.h.
References _dbiIndex::dbi_vec, and _dbiVec::join.
Return handle for an index database.
db | rpm database | |
rpmtag | rpm tag | |
flags | (unused) |
Definition at line 265 of file rpmdb.c.
References _, rpmdb_s::_dbi, _rebuildinprogress, db3Free(), rpmdb_s::db_api, rpmdb_s::db_bits, rpmdb_s::db_nbits, _dbiIndex::dbi_stats, dbiStat(), dbiTagsMax, dbiTagToDbix(), errno, mydbvecs, _dbiVec::open, PBM_ALLOC, RPMDBI_PACKAGES, RPMERR_DBOPEN, rpmError, rpmExpandNumeric(), RPMMESS_DEBUG, rpmMessage, strerror, and tagName().
Referenced by openDatabase(), rpmdbAdd(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbFreeIterator(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbNextIterator(), rpmdbOpenAll(), rpmdbRemove(), rpmpsmStage(), and unsatisfiedDepend().
static int dbiPget | ( | dbiIndex | dbi, | |
DBC * | dbcursor, | |||
DBT * | key, | |||
DBT * | pkey, | |||
DBT * | data, | |||
unsigned int | flags | |||
) | [inline, static] |
Retrieve (key,data) pair using dbcursor->c_pget.
dbi | index database handle | |
dbcursor | database cursor (NULL will use db->get) | |
key | secondary retrieve key value/length/flags | |
pkey | primary retrieve key value/length/flags | |
data | primary retrieve data value/length/flags | |
flags | DB_NEXT, DB_SET, or 0 |
Definition at line 607 of file rpmdb.h.
References _dbiVec::cpget, rpmdb_s::db_getops, _dbiIndex::dbi_rpmdb, _dbiIndex::dbi_vec, rpmswEnter(), and rpmswExit().
static int dbiPut | ( | dbiIndex | dbi, | |
DBC * | dbcursor, | |||
DBT * | key, | |||
DBT * | data, | |||
unsigned int | flags | |||
) | [inline, static] |
Store (key,data) pair in index database.
dbi | index database handle | |
dbcursor | database cursor (NULL will use db->put) | |
key | store key value/length/flags | |
data | store data value/length/flags | |
flags | (unused) |
Definition at line 630 of file rpmdb.h.
References _dbiVec::cput, rpmdb_s::db_putops, _dbiIndex::dbi_rpmdb, _dbiIndex::dbi_vec, rpmswEnter(), and rpmswExit().
Referenced by miFreeHeader(), rpmdbAdd(), rpmdbRemove(), and unsatisfiedDepend().
static int dbiStat | ( | dbiIndex | dbi, | |
unsigned int | flags | |||
) | [inline, static] |
Is database byte swapped?
dbi | index database handle | |
flags | DB_FAST_STAT or 0 |
Definition at line 758 of file rpmdb.h.
References _dbiIndex::dbi_vec, and _dbiVec::stat.
Referenced by dbiOpen().
static int dbiSync | ( | dbiIndex | dbi, | |
unsigned int | flags | |||
) | [inline, static] |
Flush pending operations to disk.
dbi | index database handle | |
flags | (unused) |
Definition at line 696 of file rpmdb.h.
References _dbiIndex::dbi_vec, and _dbiVec::sync.
Referenced by miFreeHeader(), rpmdbAdd(), rpmdbRemove(), and rpmdbSync().
static int dbiVerify | ( | dbiIndex | dbi, | |
unsigned int | flags | |||
) | [inline, static] |
Verify (and close) index database.
dbi | index database handle | |
flags | (unused) |
Definition at line 667 of file rpmdb.h.
References _dbiVec::close, _dbiIndex::dbi_vec, and _dbiIndex::dbi_verify_on_close.
Referenced by rpmdbVerify().
int(* _dbiVec::associate)(dbiIndex dbi, dbiIndex dbisecondary, int(*callback)(DB *, const DBT *, const DBT *, DBT *), unsigned int flags) [inherited] |
Associate secondary database with primary.
dbi | index database handle | |
dbisecondary | secondary index database handle | |
callback | create secondary key from primary (NULL if DB_RDONLY) | |
flags | DB_CREATE or 0 |
Referenced by dbiAssociate().
int(* _dbiVec::byteswapped)(dbiIndex dbi) [inherited] |
Is database byte swapped?
dbi | index database handle |
Referenced by dbiByteSwapped().
int(* _dbiVec::cclose)(dbiIndex dbi,DBC *dbcursor, unsigned int flags) [inherited] |
Close database cursor.
dbi | index database handle | |
dbcursor | database cursor | |
flags | (unused) |
Referenced by dbiCclose().
int(* _dbiVec::ccount)(dbiIndex dbi, DBC *dbcursor,unsigned int *countp, unsigned int flags) [inherited] |
Retrieve count of (possible) duplicate items using dbcursor->c_count.
dbi | index database handle | |
dbcursor | database cursor | |
countp | address of count | |
flags | (unused) |
Referenced by dbiCount().
int(* _dbiVec::cdel)(dbiIndex dbi,DBC *dbcursor, DBT *key, DBT *data, unsigned int flags) [inherited] |
Delete (key,data) pair(s) using db->del or dbcursor->c_del.
dbi | index database handle | |
dbcursor | database cursor (NULL will use db->del) | |
key | delete key value/length/flags | |
data | delete data value/length/flags | |
flags | (unused) |
Referenced by dbiDel().
int(* _dbiVec::cdup)(dbiIndex dbi, DBC *dbcursor,DBC **dbcp, unsigned int flags) [inherited] |
Duplicate a database cursor.
dbi | index database handle | |
dbcursor | database cursor |
dbcp | address of new database cursor |
flags | DB_POSITION for same position, 0 for uninitialized |
Referenced by dbiCdup().
int(* _dbiVec::cget)(dbiIndex dbi,DBC *dbcursor, DBT *key, DBT *data, unsigned int flags) [inherited] |
Retrieve (key,data) pair using db->get or dbcursor->c_get.
dbi | index database handle | |
dbcursor | database cursor (NULL will use db->get) | |
key | retrieve key value/length/flags | |
data | retrieve data value/length/flags | |
flags | (unused) |
Referenced by dbiGet().
int(* _dbiVec::close)(dbiIndex dbi, unsigned int flags) [inherited] |
Close index database, and destroy database handle.
dbi | index database handle | |
flags | (unused) |
Referenced by dbiClose(), and dbiVerify().
int(* _dbiVec::copen)(dbiIndex dbi,DB_TXN *txnid,DBC **dbcp, unsigned int dbiflags) [inherited] |
Open database cursor.
dbi | index database handle | |
txnid | database transaction handle |
dbcp | address of new database cursor |
dbiflags | DB_WRITECURSOR or 0 |
Referenced by dbiCopen().
int(* _dbiVec::cpget)(dbiIndex dbi,DBC *dbcursor, DBT *key, DBT *pkey, DBT *data, unsigned int flags) [inherited] |
Retrieve (key,data) pair using dbcursor->c_pget.
dbi | index database handle | |
dbcursor | database cursor | |
key | secondary retrieve key value/length/flags | |
pkey | primary retrieve key value/length/flags | |
data | primary retrieve data value/length/flags | |
flags | DB_NEXT, DB_SET, or 0 |
Referenced by dbiPget().
int(* _dbiVec::cput)(dbiIndex dbi,DBC *dbcursor, DBT *key, DBT *data, unsigned int flags) [inherited] |
Store (key,data) pair using db->put or dbcursor->c_put.
dbi | index database handle | |
dbcursor | database cursor (NULL will use db->put) | |
key | store key value/length/flags | |
data | store data value/length/flags | |
flags | (unused) |
Referenced by dbiPut().
int(* _dbiVec::join)(dbiIndex dbi, DBC **curslist,DBC **dbcp, unsigned int flags) [inherited] |
Return join cursor for list of cursors.
dbi | index database handle | |
curslist | NULL terminated list of database cursors |
dbcp | address of join database cursor |
flags | DB_JOIN_NOSORT or 0 |
Referenced by dbiJoin().
int(* _dbiVec::open)(rpmdb rpmdb, rpmTag rpmtag,dbiIndex *dbip) [inherited] |
Return handle for an index database.
rpmdb | rpm database | |
rpmtag | rpm tag |
Referenced by dbiOpen().
int(* _dbiVec::stat)(dbiIndex dbi, unsigned int flags) [inherited] |
Save statistics in database handle.
dbi | index database handle | |
flags | retrieve statistics that don't require traversal? |
Referenced by dbiStat().
int(* _dbiVec::sync)(dbiIndex dbi, unsigned int flags) [inherited] |
Flush pending operations to disk.
dbi | index database handle | |
flags | (unused) |
Referenced by dbiSync().