# 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 | _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...
struct | rpmdb_s
| Describes the collection of index databases used by rpm. More...

## 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 _dbiIndexItem * | dbiIndexItem
typedef _dbiIndex * | dbiIndex

## 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)
| Return new configured index database handle instance.
dbiIndex | db3Free (dbiIndex dbi)
| Destroy index database handle instance.
const char *const | prDbiOpenFlags (int dbflags, int print_dbenv_flags)
| Format db3 open flags for debugging print.
dbiIndex | dbiOpen (rpmdb db, int rpmtag, unsigned int flags)
| Return handle for an index database.
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)
| Delete (key,data) pair(s) from index database.
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.
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.
int | dbiCount (dbiIndex dbi, void *dbcursor, unsigned int *countp, unsigned int flags)
| Retrieve count of (possible) duplicate items.
int | dbiVerify (dbiIndex dbi, unsigned int flags)
| Verify (and close) index database.
int | dbiClose (dbiIndex dbi, unsigned int flags)
| Close index database.
int | dbiSync (dbiIndex dbi, unsigned int flags)
| Flush pending operations to disk.
int | dbiByteSwapped (dbiIndex dbi)
| Is database byte swapped?
char * | db1basename (int rpmtag)
| Return base file name for db1 database (legacy).
unsigned int | rpmdbGetIteratorFileNum (rpmdbMatchIterator mi)
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.

## 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 db1copen(), db3copen(), db3open(), rpmdbAdd(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbRemove(), and unsatisfiedDepend().

#define DBI_ITERATOR (1 << 1)

| Definition at line 399 of file rpmdb.h. Referenced by db3cclose(), db3copen(), and rpmdbNextIterator().

#define DBI_WRITECURSOR (1 << 0)

| Definition at line 398 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.