# rpmdb.h File Reference

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

`#include <rpm/rpmtypes.h>`
`#include <rpm/rpmsw.h>`

Include dependency graph for rpmdb.h:

Go to the source code of this file.

## Typedefs
typedef enum rpmMireMode_e | rpmMireMode
| Tag value pattern match mode.
typedef enum rpmdbOpX_e | rpmdbOpX
## Enumerations
enum | rpmMireMode_e { RPMMIRE_DEFAULT = 0, RPMMIRE_STRCMP = 1, RPMMIRE_REGEX = 2, RPMMIRE_GLOB = 3 }
| Tag value pattern match mode. More...
enum | rpmdbOpX_e { RPMDB_OP_DBGET = 1, RPMDB_OP_DBPUT = 2, RPMDB_OP_DBDEL = 3, RPMDB_OP_MAX = 4 }
## Functions
rpmop | rpmdbOp (rpmdb db, rpmdbOpX opx)
| Retrieve operation timestamp from rpm database.
int | rpmdbSetChrootDone (rpmdb db, int chrootDone)
| Set chrootDone flag, i.e.
rpmdb | rpmdbUnlink (rpmdb db, const char *msg)
| Unreference a database instance.
rpmdb | rpmdbLink (rpmdb db, const char *msg)
| Reference a database instance.
int | rpmdbOpen (const char *prefix, rpmdb *dbp, int mode, int perms)
| Open rpm database.
int | rpmdbInit (const char *prefix, int perms)
| Initialize database.
int | rpmdbVerify (const char *prefix)
| Verify database components.
int | rpmdbCloseDBI (rpmdb db, rpmTag rpmtag)
| Close a single database index.
int | rpmdbClose (rpmdb db)
| Close all database indices and free rpmdb.
int | rpmdbSync (rpmdb db)
| Sync all database indices.
int | rpmdbOpenAll (rpmdb db)
| Open all database indices.
int | rpmdbCountPackages (rpmdb db, const char *name)
| Return number of instances of package in rpm database.
unsigned int | rpmdbGetIteratorOffset (rpmdbMatchIterator mi)
| Return header join key for current position of rpm database iterator.
int | rpmdbGetIteratorCount (rpmdbMatchIterator mi)
| Return number of elements in rpm database iterator.
unsigned int | rpmdbGetIteratorFileNum (rpmdbMatchIterator mi)
int | rpmdbAppendIterator (rpmdbMatchIterator mi, const int *hdrNums, int nHdrNums)
| Append items to set of package instances to iterate.
int | rpmdbPruneIterator (rpmdbMatchIterator mi, int *hdrNums, int nHdrNums, int sorted)
| Remove items from set of package instances to iterate.
int | rpmdbSetIteratorRE (rpmdbMatchIterator mi, rpmTag tag, rpmMireMode mode, const char *pattern)
| Add pattern to iterator selector.
int | rpmdbSetIteratorRewrite (rpmdbMatchIterator mi, int rewrite)
| Prepare iterator for lazy writes.
int | rpmdbSetIteratorModified (rpmdbMatchIterator mi, int modified)
| Modify iterator to mark header for lazy write on release.
int | rpmdbSetHdrChk (rpmdbMatchIterator mi, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, char **msg))
| Modify iterator to verify retrieved header blobs.
rpmdbMatchIterator | rpmdbInitIterator (rpmdb db, rpmTag rpmtag, const void *keyp, size_t keylen)
| Return database iterator.
Header | rpmdbNextIterator (rpmdbMatchIterator mi)
| Return next package header from iteration.
int | rpmdbCheckSignals (void)
| Check for and exit on termination signals.
int | rpmdbCheckTerminate (int terminate)
| Check rpmdb signal handler for trapped signal and/or requested exit, clean up any open iterators and databases on termination condition.
rpmdbMatchIterator | rpmdbFreeIterator (rpmdbMatchIterator mi)
| Destroy rpm database iterator.
int | rpmdbAdd (rpmdb db, int iid, Header h, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, char **msg))
| Add package header to rpm database and indices.
int | rpmdbRemove (rpmdb db, int rid, unsigned int hdrNum, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, char **msg))
| Remove package header from rpm database and indices.
int | rpmdbRebuild (const char *prefix, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, char **msg))
| Rebuild database indices from package headers.
## Variables
int | _rpmdb_debug

## Detailed Description

Access RPM indices using Berkeley DB interface(s).

Definition in file rpmdb.h.

## Typedef Documentation

typedef enum rpmdbOpX_e rpmdbOpX

typedef enum rpmMireMode_e rpmMireMode

Tag value pattern match mode.

## Enumeration Type Documentation

enum rpmdbOpX_e

Enumerator:

  RPMDB_OP_DBGET |
  RPMDB_OP_DBPUT |
  RPMDB_OP_DBDEL |
  RPMDB_OP_MAX |

Definition at line 28 of file rpmdb.h.

enum rpmMireMode_e

Tag value pattern match mode.

Enumerator:

  RPMMIRE_DEFAULT | regex with \., .* and ^...$ added
  RPMMIRE_STRCMP | strings using strcmp(3)
  RPMMIRE_REGEX | regex(7) patterns through regcomp(3)
  RPMMIRE_GLOB | glob(7) patterns through fnmatch(3)

Definition at line 21 of file rpmdb.h.

## Function Documentation

int rpmdbCloseDBI | ( | rpmdb | db,
|  | rpmTag | rpmtag |
| ) |  |  |

Close a single database index.

Parameters:

  | db | rpm database
  | rpmtag | rpm tag

Returns:
  0 on success

## Variable Documentation

int _rpmdb_debug