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 <assert.h>`
`#include <rpmlib.h>`
`#include <db.h>`

Go to the source code of this file.

## Data Structures

struct | _dbiIndex
struct | _dbiIndexItem
struct | _dbiIndexSet
struct | _dbiVec
struct | rpmdb_s

## Defines

#define | rpmdbUnlink(_db, _msg) XrpmdbUnlink(_db, _msg, __FILE__, __LINE__)
#define | rpmdbLink(_db, _msg) XrpmdbLink(_db, _msg, __FILE__, __LINE__)

## Typedefs

typedef enum rpmMireMode_e | rpmMireMode
| Tag value pattern match mode. More...
typedef _dbiIndexItem * | dbiIndexItem
typedef _dbiIndexSet * | dbiIndexSet
typedef _dbiIndex * | dbiIndex

## Enumerations

enum | rpmMireMode_e { RPMMIRE_DEFAULT = 0, RPMMIRE_STRCMP = 1, RPMMIRE_REGEX = 2, RPMMIRE_GLOB = 3 }
| Tag value pattern match mode. More...
enum | rpmdbFlags { RPMDB_FLAG_JUSTCHECK = (1 << 0), RPMDB_FLAG_MINIMAL = (1 << 1), RPMDB_FLAG_CHROOT = (1 << 2) }

## Functions

dbiIndex | db3New (rpmdb rpmdb, rpmTag rpmtag)
dbiIndex | db3Free (dbiIndex dbi)
const char *const | prDbiOpenFlags (int dbflags, int print_dbenv_flags)
dbiIndex | dbiOpen (rpmdb db, rpmTag rpmtag, unsigned int flags)
int | dbiCopen (dbiIndex dbi, DB_TXN *txnid, DBC **dbcp, unsigned int flags)
int | dbiCclose (dbiIndex dbi, DBC *dbcursor, unsigned int flags)
int | dbiCdup (dbiIndex dbi, DBC *dbcursor, DBC **dbcp, unsigned int flags)
int | dbiDel (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, unsigned int flags)
int | dbiGet (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, unsigned int flags)
int | dbiPget (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *pkey, DBT *data, unsigned int flags)
int | dbiPut (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, unsigned int flags)
int | dbiCount (dbiIndex dbi, DBC *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 | dbiAssociate (dbiIndex dbi, dbiIndex dbisecondary, int(*callback)(DB *, const DBT *, const DBT *, DBT *), unsigned int flags)
int | dbiJoin (dbiIndex dbi, DBC **curslist, DBC **dbcp, unsigned int flags)
int | dbiByteSwapped (dbiIndex dbi)
int | dbiStat (dbiIndex dbi, unsigned int flags)
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)
rpmdb | rpmdbUnlink (rpmdb db, const char *msg)
rpmdb | XrpmdbUnlink (rpmdb db, const char *msg, const char *fn, unsigned ln)
rpmdb | rpmdbLink (rpmdb db, const char *msg)
rpmdb | XrpmdbLink (rpmdb db, const char *msg, const char *fn, unsigned ln)
int | rpmdbOpen (const char *prefix, rpmdb *dbp, int mode, int perms)
int | rpmdbInit (const char *prefix, int perms)
int | rpmdbVerify (const char *prefix)
int | rpmdbCloseDBI (rpmdb db, int rpmtag)
| Close a single database index. More...
int | rpmdbClose (rpmdb db)
int | rpmdbSync (rpmdb db)
int | rpmdbOpenAll (rpmdb db)
int | rpmdbCountPackages (rpmdb db, const char *name)
unsigned int | rpmdbGetIteratorOffset (rpmdbMatchIterator mi)
int | rpmdbGetIteratorCount (rpmdbMatchIterator mi)
int | rpmdbAppendIterator (rpmdbMatchIterator mi, const int *hdrNums, int nHdrNums)
int | rpmdbPruneIterator (rpmdbMatchIterator mi, int *hdrNums, int nHdrNums, int sorted)
int | rpmdbSetIteratorRE (rpmdbMatchIterator mi, rpmTag tag, rpmMireMode mode, const char *pattern)
int | rpmdbSetIteratorRewrite (rpmdbMatchIterator mi, int rewrite)
int | rpmdbSetIteratorModified (rpmdbMatchIterator mi, int modified)
int | rpmdbSetHdrChk (rpmdbMatchIterator mi, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg))
rpmdbMatchIterator | rpmdbInitIterator (rpmdb db, rpmTag rpmtag, const void *keyp, size_t keylen)
Header | rpmdbNextIterator (rpmdbMatchIterator mi)
int | rpmdbCheckSignals (void)
rpmdbMatchIterator | rpmdbFreeIterator (rpmdbMatchIterator mi)
int | rpmdbAdd (rpmdb db, int iid, Header h, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg))
int | rpmdbRemove (rpmdb db, int rid, unsigned int hdrNum, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg))
int | rpmdbRebuild (const char *prefix, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg))
int | mergesort (void *base, size_t nmemb, size_t size, int(*cmp)(const void *, const void *))
| Mergesort, same arguments as qsort(2). More...

## Variables

int | _rpmdb_debug
int * | dbiTags
int | dbiTagsMax

## Detailed Description

Access RPM indices using Berkeley DB interface(s).

Definition in file rpmdb.h.

## Define Documentation

#define rpmdbLink | ( | _db,
|  | _msg |  | ) | XrpmdbLink(_db, _msg, __FILE__, __LINE__)

| Definition at line 831 of file rpmdb.h. Referenced by newRpmdb, and rpmdbInitIterator.

#define rpmdbUnlink | ( | _db,
|  | _msg |  | ) | XrpmdbUnlink(_db, _msg, __FILE__, __LINE__)

| Definition at line 813 of file rpmdb.h. Referenced by rpmdbClose, and rpmdbFreeIterator.

## Typedef Documentation

typedef struct _dbiIndex* dbiIndex

| Definition at line 52 of file rpmdb.h.

typedef struct _dbiIndexItem* dbiIndexItem

| Definition at line 43 of file rpmdb.h.

typedef enum rpmMireMode_e rpmMireMode

| Tag value pattern match mode. Referenced by mireDup, and rpmdbSetIteratorRE.

## Enumeration Type Documentation

enum rpmMireMode_e

Tag value pattern match mode.

Enumeration values:

  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 34 of file rpmdb.h.

## Function Documentation

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

| Mergesort, same arguments as qsort(2). Definition at line 207 of file merge.c. Referenced by rpmdbSortIterator.

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

Close a single database index.

Parameters:

  db | rpm database
  rpmtag | rpm tag

Returns:
  0 on success

Definition at line 812 of file rpmdb.c.

Referenced by rpmtsCheck.

rpmdb XrpmdbLink | ( | rpmdb | db,
|  | const char * | msg,
|  | const char * | fn,
|  | unsigned | ln
| ) |

Todo:
  Remove debugging entry from the ABI.

Definition at line 1073 of file rpmdb.c.

rpmdb XrpmdbUnlink | ( | rpmdb | db,
|  | const char * | msg,
|  | const char * | fn,
|  | unsigned | ln
| ) |

Todo:
  Remove debugging entry from the ABI.

Definition at line 1063 of file rpmdb.c.

References rpmRC, and rpmts.

## Variable Documentation

int _rpmdb_debug

| Definition at line 16 of file rpmdb.h.

int dbiTagsMax

| Definition at line 793 of file rpmdb.h.