rpmdb.h
Go to the documentation of this file.
#ifndef H_RPMDB
#define H_RPMDB
#include <rpm/rpmtypes.h>
#include <rpm/rpmsw.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum rpmMireMode_e {
RPMMIRE_DEFAULT = 0,
RPMMIRE_STRCMP = 1,
RPMMIRE_REGEX = 2,
RPMMIRE_GLOB = 3
} rpmMireMode;
typedef enum rpmdbOpX_e {
RPMDB_OP_DBGET = 1,
RPMDB_OP_DBPUT = 2,
RPMDB_OP_DBDEL = 3,
RPMDB_OP_MAX = 4
} rpmdbOpX;
typedef enum rpmdbCtrlOp_e {
RPMDB_CTRL_LOCK_RO = 1,
RPMDB_CTRL_UNLOCK_RO = 2,
RPMDB_CTRL_LOCK_RW = 3,
RPMDB_CTRL_UNLOCK_RW = 4,
RPMDB_CTRL_INDEXSYNC = 5
} rpmdbCtrlOp;
rpmop rpmdbOp(rpmdb db, rpmdbOpX opx);
int rpmdbOpenAll (rpmdb db);
int rpmdbCountPackages(rpmdb db, const char * name);
unsigned int rpmdbGetIteratorOffset(rpmdbMatchIterator mi);
int rpmdbGetIteratorCount(rpmdbMatchIterator mi);
unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi);
int rpmdbAppendIterator(rpmdbMatchIterator mi,
const unsigned int * hdrNums, unsigned int nHdrNums);
int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTagVal 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, char ** msg));
rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmDbiTagVal rpmtag,
const void * keyp, size_t keylen);
Header rpmdbNextIterator(rpmdbMatchIterator mi);
int rpmdbCheckSignals(void);
int rpmdbCheckTerminate(int terminate);
rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
rpmdbIndexIterator rpmdbIndexIteratorInit(rpmdb db, rpmDbiTag rpmtag);
int rpmdbIndexIteratorNext(rpmdbIndexIterator ii, const void ** key, size_t * keylen);
int rpmdbIndexIteratorNextTd(rpmdbIndexIterator ii, rpmtd keytd);
unsigned int rpmdbIndexIteratorNumPkgs(rpmdbIndexIterator ii);
unsigned int rpmdbIndexIteratorPkgOffset(rpmdbIndexIterator ii, unsigned int nr);
unsigned int rpmdbIndexIteratorTagNum(rpmdbIndexIterator ii, unsigned int nr);
rpmdbIndexIterator rpmdbIndexIteratorFree(rpmdbIndexIterator ii);
int rpmdbCtrl(rpmdb db, rpmdbCtrlOp ctrl);
#ifdef __cplusplus
}
#endif
#endif /* H_RPMDB */
RPMDB_OP_DBPUT
Definition: rpmdb.h:28
rpmdbIndexIteratorTagNum
unsigned int rpmdbIndexIteratorTagNum(rpmdbIndexIterator ii, unsigned int nr)
Get tag number of entry.
rpmdbOpenAll
int rpmdbOpenAll(rpmdb db)
Open all database indices.
rpmMireMode
enum rpmMireMode_e rpmMireMode
Tag value pattern match mode.
RPMMIRE_REGEX
Definition: rpmdb.h:22
RPMMIRE_STRCMP
Definition: rpmdb.h:21
rpmdbCheckTerminate
int rpmdbCheckTerminate(int terminate)
Check rpmdb signal handler for trapped signal and/or requested exit, clean up any open iterators and ...
rpmdbIndexIteratorNext
int rpmdbIndexIteratorNext(rpmdbIndexIterator ii, const void **key, size_t *keylen)
Get the next key - Warning! Keys are not zero terminated! Binary tags may even contain zero bytes...
rpmdbIndexIteratorFree
rpmdbIndexIterator rpmdbIndexIteratorFree(rpmdbIndexIterator ii)
Free index iterator.
RPMDB_CTRL_LOCK_RW
Definition: rpmdb.h:36
rpmdbNextIterator
Header rpmdbNextIterator(rpmdbMatchIterator mi)
Return next package header from iteration.
rpmDbiTag
enum rpmDbiTag_e rpmDbiTag
Rpm database index tags.
rpmDbiTagVal
rpm_tag_t rpmDbiTagVal
Definition: rpmtypes.h:31
rpmTagVal
rpm_tag_t rpmTagVal
Definition: rpmtypes.h:30
rpmdbGetIteratorCount
int rpmdbGetIteratorCount(rpmdbMatchIterator mi)
Return number of elements in rpm database iterator.
rpmdbSetHdrChk
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.
rpmdbFreeIterator
rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi)
Destroy rpm database iterator.
RPMDB_OP_DBGET
Definition: rpmdb.h:27
rpmdbMatchIterator
struct rpmdbMatchIterator_s * rpmdbMatchIterator
Definition: rpmtypes.h:69
rpmdbSetIteratorModified
int rpmdbSetIteratorModified(rpmdbMatchIterator mi, int modified)
Modify iterator to mark header for lazy write on release.
rpmdbAppendIterator
int rpmdbAppendIterator(rpmdbMatchIterator mi, const unsigned int *hdrNums, unsigned int nHdrNums)
Append items to set of package instances to iterate.
RPMDB_OP_MAX
Definition: rpmdb.h:30
RPMDB_CTRL_UNLOCK_RO
Definition: rpmdb.h:35
rpmdbOp
rpmop rpmdbOp(rpmdb db, rpmdbOpX opx)
Retrieve operation timestamp from rpm database.
rpmdbCtrl
int rpmdbCtrl(rpmdb db, rpmdbCtrlOp ctrl)
manipulate the rpm database
rpmdbCtrlOp
enum rpmdbCtrlOp_e rpmdbCtrlOp
RPMDB_CTRL_INDEXSYNC
Definition: rpmdb.h:38
rpmdbSetIteratorRE
int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTagVal tag, rpmMireMode mode, const char *pattern)
Add pattern to iterator selector.
RPMDB_CTRL_LOCK_RO
Definition: rpmdb.h:34
rpmdbOpX_e
rpmdbOpX_e
Definition: rpmdb.h:26
RPMDB_CTRL_UNLOCK_RW
Definition: rpmdb.h:37
rpmdb
struct rpmdb_s * rpmdb
Definition: rpmtypes.h:68
rpmdbGetIteratorFileNum
unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi)
rpmdbIndexIteratorNumPkgs
unsigned int rpmdbIndexIteratorNumPkgs(rpmdbIndexIterator ii)
Get number of entries for current key.
rpmop_s
Cumulative statistics for an operation.
Definition: rpmsw.h:40
rpmdbSetIteratorRewrite
int rpmdbSetIteratorRewrite(rpmdbMatchIterator mi, int rewrite)
Prepare iterator for lazy writes.
rpmdbOpX
enum rpmdbOpX_e rpmdbOpX
mode
static int mode
Definition: rpmdb.c:21
rpmdbIndexIteratorInit
rpmdbIndexIterator rpmdbIndexIteratorInit(rpmdb db, rpmDbiTag rpmtag)
Get an iterator for an index.
RPMDB_OP_DBDEL
Definition: rpmdb.h:29
rpmts
struct rpmts_s * rpmts
The main types involved in transaction manipulation.
Definition: rpmtypes.h:63
rpmdbGetIteratorOffset
unsigned int rpmdbGetIteratorOffset(rpmdbMatchIterator mi)
Return header join key for current position of rpm database iterator.
rpmtd_s
Container for rpm tag data (from headers or extensions).
Definition: rpmtd.h:26
RPMMIRE_DEFAULT
Definition: rpmdb.h:20
rpmMireMode_e
rpmMireMode_e
Tag value pattern match mode.
Definition: rpmdb.h:19
rpmdbCountPackages
int rpmdbCountPackages(rpmdb db, const char *name)
Return number of instances of package in rpm database.
rpmdbIndexIteratorPkgOffset
unsigned int rpmdbIndexIteratorPkgOffset(rpmdbIndexIterator ii, unsigned int nr)
Get package offset of entry.
rpmdbInitIterator
rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)
Return database iterator.
rpmdbCtrlOp_e
rpmdbCtrlOp_e
Definition: rpmdb.h:33
rpmdbIndexIteratorNextTd
int rpmdbIndexIteratorNextTd(rpmdbIndexIterator ii, rpmtd keytd)
Get the next key into a tag data container.
rpmRC
enum rpmRC_e rpmRC
Package read return codes.
rpmdbIndexIterator
struct rpmdbIndexIterator_s * rpmdbIndexIterator
Definition: rpmtypes.h:74
rpmdbCheckSignals
int rpmdbCheckSignals(void)
Check for and exit on termination signals.
RPMMIRE_GLOB
Definition: rpmdb.h:23
Header
struct headerToken_s * Header
RPM header and data retrieval types.
Definition: rpmtypes.h:24