Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

rpmdb/rpmdb.h File Reference

Access RPM indices using Berkeley DB interface(s). More...

#include <rpmlib.h>

Go to the source code of this file.

Data Structures

struct  _dbiIndex
struct  _dbiIndexItem
struct  _dbiIndexSet
struct  _dbiVec
struct  rpmdb_s

Defines

#define DB   void
#define DB_ENV   void
#define DBC   void
#define DBT   void
#define DB_LSN   void
#define DBI_WRITECURSOR   (1 << 0)
#define DBI_ITERATOR   (1 << 1)

Typedefs

typedef _dbiIndexItemdbiIndexItem
typedef _dbiIndexdbiIndex

Enumerations

enum  rpmdbFlags { RPMDB_FLAG_JUSTCHECK = (1 << 0), RPMDB_FLAG_MINIMAL = (1 << 1), RPMDB_FLAG_CHROOT = (1 << 2) }

Functions

dbiIndex db3New (rpmdb rpmdb, int rpmtag)
dbiIndex db3Free (dbiIndex dbi)
const char *const prDbiOpenFlags (int dbflags, int print_dbenv_flags)
dbiIndex dbiOpen (rpmdb db, int rpmtag, unsigned int flags)
int dbiCopen (dbiIndex dbi, void **dbcp, unsigned int flags)
int dbiCclose (dbiIndex dbi, void *dbcursor, unsigned int flags)
int dbiDel (dbiIndex dbi, void *dbcursor, const void *keyp, size_t keylen, unsigned int flags)
int dbiGet (dbiIndex dbi, void *dbcursor, void **keypp, size_t *keylenp, void **datapp, size_t *datalenp, unsigned int flags)
int dbiPut (dbiIndex dbi, void *dbcursor, const void *keyp, size_t keylen, const void *datap, size_t datalen, unsigned int flags)
int dbiCount (dbiIndex dbi, void *dbcursor, unsigned int *countp, unsigned int flags)
int dbiVerify (dbiIndex dbi, unsigned int flags)
int dbiClose (dbiIndex dbi, unsigned int flags)
int dbiSync (dbiIndex dbi, unsigned int flags)
int dbiByteSwapped (dbiIndex dbi)
char * db1basename (int rpmtag)
unsigned int rpmdbGetIteratorFileNum (rpmdbMatchIterator mi)
dbiIndexSet dbiFreeIndexSet (dbiIndexSet set)
unsigned int dbiIndexSetCount (dbiIndexSet set)
unsigned int dbiIndexRecordOffset (dbiIndexSet set, int recno)
unsigned int dbiIndexRecordFileNumber (dbiIndexSet set, int recno)
int mergesort (void *base, size_t nmemb, size_t size, int(*cmp)(const void *, const void *))
 Mergesort, same arguments as qsort(2).


Detailed Description

Access RPM indices using Berkeley DB interface(s).

Definition in file rpmdb.h.


Define Documentation

#define DB   void
 

Definition at line 42 of file rpmdb.h.

Referenced by db1cdel(), db1cget(), db1close(), db1cput(), db1sync(), db3byteswapped(), db3c_open(), db3cdel(), db3cget(), db3close(), db3cput(), db3open(), db3stat(), and db3sync().

#define DB_ENV   void
 

Definition at line 43 of file rpmdb.h.

Referenced by db3close(), db3open(), db_fini(), and db_init().

#define DB_LSN   void
 

Definition at line 46 of file rpmdb.h.

#define DBC   void
 

Definition at line 44 of file rpmdb.h.

Referenced by addIndexEntry(), db1cclose(), db1ccount(), db1cdel(), db1cget(), db1copen(), db1cput(), db3c_close(), db3c_del(), db3c_dup(), db3c_get(), db3c_open(), db3c_put(), db3cclose(), db3ccount(), db3cdel(), db3cget(), db3copen(), db3cput(), db3open(), dbiCclose(), dbiCopen(), dbiCount(), dbiDel(), dbiFindByLabel(), dbiFindMatches(), dbiGet(), dbiPut(), dbiSearch(), dbiUpdateIndex(), dbiUpdateRecord(), openDatabase(), removeIndexEntry(), rpmdbAdd(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbRemove(), and unsatisfiedDepend().

#define DBI_ITERATOR   (1 << 1)
 

Definition at line 401 of file rpmdb.h.

Referenced by db3cclose(), db3copen(), rpmdbFreeIterator(), and rpmdbNextIterator().

#define DBI_WRITECURSOR   (1 << 0)
 

Definition at line 400 of file rpmdb.h.

Referenced by db3c_open(), dbiCopen(), rpmdbAdd(), rpmdbRemove(), rpmdbSetIteratorRewrite(), and unsatisfiedDepend().

#define DBT   void
 

Definition at line 45 of file rpmdb.h.


Typedef Documentation

typedef struct _dbiIndex* dbiIndex
 

Definition at line 17 of file rpmdb.h.

typedef struct _dbiIndexItem* dbiIndexItem
 

Definition at line 13 of file rpmdb.h.


Function Documentation

char* db1basename int    rpmtag
 

Return base file name for db1 database (legacy).

Parameters:
rpmtag  rpm tag
Returns:
base file name of db1 database

Definition at line 3112 of file rpmdb.c.

References alloca(), RPMDBI_PACKAGES, RPMTAG_BASENAMES, RPMTAG_CONFLICTNAME, RPMTAG_GROUP, RPMTAG_NAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTAG_TRIGGERNAME, stpcpy(), tagName(), and xstrdup().

Referenced by db1close(), db1open(), rpmdbMoveDatabase(), and rpmdbRemoveDatabase().

int dbiByteSwapped dbiIndex    dbi
 

Is database byte swapped?

Parameters:
dbi  index database handle
Returns:
0 no

Definition at line 215 of file rpmdb.c.

References _dbiVec::byteswapped, _dbiIndex::dbi_vec, and INLINE.

Referenced by dbiSearch(), and dbiUpdateIndex().

int dbiCclose dbiIndex    dbi,
void *    dbcursor,
unsigned int    flags
 

Parameters:
dbi  index database handle
dbcursor  database cursor
flags  (unused)

Definition at line 227 of file rpmdb.c.

References _debug, _dbiVec::cclose, DBC, _dbiIndex::dbi_debug, _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_vec, INLINE, and tagName().

Referenced by openDatabase(), rpmdbAdd(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbFreeIterator(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbRemove(), and unsatisfiedDepend().

int dbiClose dbiIndex    dbi,
unsigned int    flags
 

Close index database.

Parameters:
dbi  index database handle
flags  (unused)
Returns:
0 on success

Definition at line 382 of file rpmdb.c.

References _debug, _dbiVec::close, _dbiIndex::dbi_debug, _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_vec, INLINE, and tagName().

Referenced by rpmdbClose(), and rpmdbCloseDBI().

int dbiCopen dbiIndex    dbi,
void **    dbcp,
unsigned int    flags
 

Parameters:
dbi  index database handle
Return values:
dbcp  database cursor
Parameters:
flags  DBI_WRITECURSOR, DBI_ITERATOR or 0

Definition at line 220 of file rpmdb.c.

References _debug, _dbiVec::copen, DBC, _dbiIndex::dbi_debug, _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_vec, DBI_WRITECURSOR, INLINE, and tagName().

Referenced by openDatabase(), rpmdbAdd(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbNextIterator(), rpmdbRemove(), and unsatisfiedDepend().

int dbiCount dbiIndex    dbi,
void *    dbcursor,
unsigned int *    countp,
unsigned int    flags
 

Retrieve count of (possible) duplicate items.

Parameters:
dbi  index database handle
dbcursor  database cursor
countp  address of count
flags  (unused)
Returns:
0 on success

Definition at line 356 of file rpmdb.c.

References _dbiVec::ccount, DBC, _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_vec, INLINE, and tagName().

int dbiDel dbiIndex    dbi,
void *    dbcursor,
const void *    keyp,
size_t    keylen,
unsigned int    flags
 

Delete (key,data) pair(s) from index database.

Parameters:
dbi  index database handle
dbcursor  database cursor
keyp  key data
keylen  key data length
flags  (unused)
Returns:
0 on success

Definition at line 234 of file rpmdb.c.

References _debug, _dbiVec::cdel, DBC, _dbiIndex::dbi_debug, _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_vec, INLINE, RPMDBI_PACKAGES, and tagName().

Referenced by dbiUpdateIndex(), and rpmdbRemove().

dbiIndexSet dbiFreeIndexSet dbiIndexSet    set
 

Destroy set of index database items.

Parameters:
set  set of index database items
Returns:
NULL always

Definition at line 793 of file rpmdb.c.

References _free(), and _dbiIndexSet::recs.

Referenced by addIndexEntry(), dbiFindByLabel(), dbiFindMatches(), removeIndexEntry(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbFreeIterator(), rpmdbGrowIterator(), rpmdbInitIterator(), and rpmRunTransactions().

int dbiGet dbiIndex    dbi,
void *    dbcursor,
void **    keypp,
size_t *    keylenp,
void **    datapp,
size_t *    datalenp,
unsigned int    flags
 

Retrieve (key,data) pair from index database.

Parameters:
dbi  index database handle
dbcursor  database cursor
keypp  address of key data
keylenp  address of key data length
datapp  address of data pointer
datalenp  address of data length
flags  (unused)
Returns:
0 on success

Definition at line 252 of file rpmdb.c.

References _debug, _dbiVec::cget, DBC, _dbiIndex::dbi_debug, _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_vec, INLINE, printable(), and tagName().

Referenced by dbiSearch(), openDatabase(), rpmdbAdd(), rpmdbNextIterator(), and unsatisfiedDepend().

unsigned int dbiIndexRecordFileNumber dbiIndexSet    set,
int    recno
 

Return file index from element in index database set.

Parameters:
set  set of index database items
recno  index of item in set
Returns:
file index

Definition at line 788 of file rpmdb.c.

References _dbiIndexSet::recs, and _dbiIndexItem::tagNum.

Referenced by rpmdbFindByFile(), rpmdbNextIterator(), and rpmRunTransactions().

unsigned int dbiIndexRecordOffset dbiIndexSet    set,
int    recno
 

Return record offset of header from element in index database set.

Parameters:
set  set of index database items
recno  index of item in set
Returns:
record offset of header

Definition at line 783 of file rpmdb.c.

References _dbiIndexItem::hdrNum, and _dbiIndexSet::recs.

Referenced by dbiFindMatches(), rpmdbFindByFile(), rpmdbNextIterator(), and rpmRunTransactions().

unsigned int dbiIndexSetCount dbiIndexSet    set
 

Count items in index database set.

Parameters:
set  set of index database items
Returns:
number of items

Definition at line 778 of file rpmdb.c.

References _dbiIndexSet::count.

Referenced by dbiFindMatches(), rpmdbCountPackages(), and rpmRunTransactions().

dbiIndex dbiOpen rpmdb    db,
int    rpmtag,
unsigned int    flags
 

Return handle for an index database.

Parameters:
db  rpm database
rpmtag  rpm tag
flags  (unused)
Returns:
index database handle

Definition at line 388 of file rpmdb.c.

References _, rpmdb_s::_dbi, _rebuildinprogress, db3Free(), rpmdb_s::db_api, dbiTagsMax, dbiTagToDbix(), errno, _dbiVec::open, RPMERR_DBOPEN, rpmError, rpmExpandNumeric(), and tagName().

Referenced by openDatabase(), rpmdbAdd(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbFreeIterator(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbNextIterator(), rpmdbOpenAll(), rpmdbRemove(), and unsatisfiedDepend().

int dbiPut dbiIndex    dbi,
void *    dbcursor,
const void *    keyp,
size_t    keylen,
const void *    datap,
size_t    datalen,
unsigned int    flags
 

Store (key,data) pair in index database.

Parameters:
dbi  index database handle
dbcursor  database cursor
keyp  key data
keylen  key data length
datap  data pointer
datalen  data length
flags  (unused)
Returns:
0 on success

Definition at line 305 of file rpmdb.c.

References _debug, _dbiVec::cput, DBC, _dbiIndex::dbi_debug, _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_vec, INLINE, printable(), and tagName().

Referenced by dbiUpdateIndex(), dbiUpdateRecord(), rpmdbAdd(), and unsatisfiedDepend().

int dbiSync dbiIndex    dbi,
unsigned int    flags
 

Flush pending operations to disk.

Parameters:
dbi  index database handle
flags  (unused)
Returns:
0 on success

Definition at line 208 of file rpmdb.c.

References _debug, _dbiIndex::dbi_debug, _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_vec, INLINE, _dbiVec::sync, and tagName().

Referenced by dbiUpdateRecord(), rpmdbAdd(), rpmdbRemove(), and rpmdbSync().

int dbiVerify dbiIndex    dbi,
unsigned int    flags
 

Verify (and close) index database.

Parameters:
dbi  index database handle
flags  (unused)
Returns:
0 on success

Definition at line 367 of file rpmdb.c.

References _debug, _dbiVec::close, _dbiIndex::dbi_debug, _dbiIndex::dbi_rpmtag, _dbiIndex::dbi_vec, _dbiIndex::dbi_verify_on_close, INLINE, and tagName().

Referenced by rpmdbVerify().

int mergesort void *    base,
size_t    nmemb,
size_t    size,
int(*    cmp)(const void *, const void *)
 

Mergesort, same arguments as qsort(2).

Referenced by rpmdbSortIterator().

unsigned int rpmdbGetIteratorFileNum rpmdbMatchIterator    mi
 

Definition at line 1657 of file rpmdb.c.

References _rpmdbMatchIterator::mi_filenum.


Generated on Sun Feb 2 23:32:11 2003 for rpm by doxygen1.2.18