rpm
4.17.0
|
Opening & accessing the RPM database. More...
Files | |
file | rpmdb.h |
RPM database API. | |
file | rpmlib.h |
In Memoriam: Steve Taylor stayl was here, now he's not. or@r edhat .com | |
Functions | |
rpmop | rpmdbOp (rpmdb db, rpmdbOpX opx) |
Retrieve operation timestamp from rpm database. More... | |
int | rpmdbOpenAll (rpmdb db) |
Open all database indices. More... | |
int | rpmdbCountPackages (rpmdb db, const char *name) |
Return number of instances of package in rpm database. More... | |
unsigned int | rpmdbGetIteratorOffset (rpmdbMatchIterator mi) |
Return header join key for current position of rpm database iterator. More... | |
int | rpmdbGetIteratorCount (rpmdbMatchIterator mi) |
Return number of elements in rpm database iterator. More... | |
unsigned int | rpmdbGetIteratorFileNum (rpmdbMatchIterator mi) |
int | rpmdbAppendIterator (rpmdbMatchIterator mi, const unsigned int *hdrNums, unsigned int nHdrNums) |
Append items to set of package instances to iterate. More... | |
int | rpmdbSetIteratorRE (rpmdbMatchIterator mi, rpmTagVal tag, rpmMireMode mode, const char *pattern) |
Add pattern to iterator selector. More... | |
int | rpmdbSetIteratorRewrite (rpmdbMatchIterator mi, int rewrite) |
Prepare iterator for lazy writes. More... | |
int | rpmdbSetIteratorModified (rpmdbMatchIterator mi, int modified) |
Modify iterator to mark header for lazy write on release. More... | |
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. More... | |
rpmdbMatchIterator | rpmdbInitIterator (rpmdb db, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen) |
Return database iterator. More... | |
Header | rpmdbNextIterator (rpmdbMatchIterator mi) |
Return next package header from iteration. More... | |
rpmdbMatchIterator | rpmdbFreeIterator (rpmdbMatchIterator mi) |
Destroy rpm database iterator. More... | |
rpmdbIndexIterator | rpmdbIndexKeyIteratorInit (rpmdb db, rpmDbiTag rpmtag) |
Get an iterator for index keys. More... | |
rpmdbIndexIterator | rpmdbIndexIteratorInit (rpmdb db, rpmDbiTag rpmtag) |
Get an iterator for an index. More... | |
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. More... | |
int | rpmdbIndexIteratorNextTd (rpmdbIndexIterator ii, rpmtd keytd) |
Get the next key into a tag data container. More... | |
unsigned int | rpmdbIndexIteratorNumPkgs (rpmdbIndexIterator ii) |
Get number of entries for current key. More... | |
unsigned int | rpmdbIndexIteratorPkgOffset (rpmdbIndexIterator ii, unsigned int nr) |
Get package offset of entry. More... | |
unsigned int | rpmdbIndexIteratorTagNum (rpmdbIndexIterator ii, unsigned int nr) |
Get tag number of entry. More... | |
rpmdbIndexIterator | rpmdbIndexIteratorFree (rpmdbIndexIterator ii) |
Free index iterator. More... | |
int | rpmdbCtrl (rpmdb db, rpmdbCtrlOp ctrl) |
manipulate the rpm database More... | |
char * | rpmdbCookie (rpmdb db) |
Retrieve rpm database changed-cookie. More... | |
int | rpmdbStat (const char *prefix, struct stat *statbuf) |
Perform stat() on rpm database. More... | |
int | rpmdbFStat (rpmdb db, struct stat *statbuf) |
Perform stat() on an open rpm database. More... | |
Opening & accessing the RPM database.
int rpmdbAppendIterator | ( | rpmdbMatchIterator | mi, |
const unsigned int * | hdrNums, | ||
unsigned int | nHdrNums | ||
) |
Append items to set of package instances to iterate.
mi | rpm database iterator |
hdrNums | array of package instances |
nHdrNums | number of elements in array |
char* rpmdbCookie | ( | rpmdb | db | ) |
Retrieve rpm database changed-cookie.
Useful for eg. determining cache validity.
db | rpm database |
int rpmdbCountPackages | ( | rpmdb | db, |
const char * | name | ||
) |
Return number of instances of package in rpm database.
db | rpm database |
name | rpm package name |
int rpmdbCtrl | ( | rpmdb | db, |
rpmdbCtrlOp | ctrl | ||
) |
manipulate the rpm database
db | rpm database |
ctrl | operation |
rpmdbMatchIterator rpmdbFreeIterator | ( | rpmdbMatchIterator | mi | ) |
Destroy rpm database iterator.
mi | rpm database iterator |
int rpmdbFStat | ( | rpmdb | db, |
struct stat * | statbuf | ||
) |
Perform stat() on an open rpm database.
db | rpm database | |
[out] | statbuf | returned data from stat() |
int rpmdbGetIteratorCount | ( | rpmdbMatchIterator | mi | ) |
Return number of elements in rpm database iterator.
mi | rpm database iterator |
unsigned int rpmdbGetIteratorFileNum | ( | rpmdbMatchIterator | mi | ) |
unsigned int rpmdbGetIteratorOffset | ( | rpmdbMatchIterator | mi | ) |
Return header join key for current position of rpm database iterator.
mi | rpm database iterator |
rpmdbIndexIterator rpmdbIndexIteratorFree | ( | rpmdbIndexIterator | ii | ) |
Free index iterator.
ii | index iterator return NULL |
rpmdbIndexIterator rpmdbIndexIteratorInit | ( | rpmdb | db, |
rpmDbiTag | rpmtag | ||
) |
Get an iterator for an index.
db | rpm database |
rpmtag | the index to iterate over |
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.
ii | index iterator |
key | address to save the pointer to the key |
keylen | address to save the length of the key to |
int rpmdbIndexIteratorNextTd | ( | rpmdbIndexIterator | ii, |
rpmtd | keytd | ||
) |
Get the next key into a tag data container.
Caller is responsible for calling rpmtdFreeData() to freeing the data returned in keytd once done with it.
ii | index iterator |
keytd | tag container to store the key in |
unsigned int rpmdbIndexIteratorNumPkgs | ( | rpmdbIndexIterator | ii | ) |
Get number of entries for current key.
ii | index iterator |
unsigned int rpmdbIndexIteratorPkgOffset | ( | rpmdbIndexIterator | ii, |
unsigned int | nr | ||
) |
Get package offset of entry.
ii | index iterator |
nr | number of the entry |
unsigned int rpmdbIndexIteratorTagNum | ( | rpmdbIndexIterator | ii, |
unsigned int | nr | ||
) |
Get tag number of entry.
ii | index iterator |
nr | number of the entry |
rpmdbIndexIterator rpmdbIndexKeyIteratorInit | ( | rpmdb | db, |
rpmDbiTag | rpmtag | ||
) |
Get an iterator for index keys.
db | rpm database |
rpmtag | the index to iterate over |
rpmdbMatchIterator rpmdbInitIterator | ( | rpmdb | db, |
rpmDbiTagVal | rpmtag, | ||
const void * | keyp, | ||
size_t | keylen | ||
) |
Return database iterator.
db | rpm database |
rpmtag | database index tag |
keyp | key data (NULL for sequential access) |
keylen | key data length (0 will use strlen(keyp)) |
Header rpmdbNextIterator | ( | rpmdbMatchIterator | mi | ) |
Return next package header from iteration.
mi | rpm database iterator |
Retrieve operation timestamp from rpm database.
db | rpm database |
opx | operation timestamp index |
int rpmdbOpenAll | ( | rpmdb | db | ) |
Open all database indices.
db | rpm database |
int rpmdbSetHdrChk | ( | rpmdbMatchIterator | mi, |
rpmts | ts, | ||
rpmRC(*)(rpmts ts, const void *uh, size_t uc, char **msg) | hdrchk | ||
) |
Modify iterator to verify retrieved header blobs.
mi | rpm database iterator |
ts | transaction set |
(*hdrchk) | headerCheck() vector |
int rpmdbSetIteratorModified | ( | rpmdbMatchIterator | mi, |
int | modified | ||
) |
Modify iterator to mark header for lazy write on release.
mi | rpm database iterator |
modified | new value of modified |
int rpmdbSetIteratorRE | ( | rpmdbMatchIterator | mi, |
rpmTagVal | tag, | ||
rpmMireMode | mode, | ||
const char * | pattern | ||
) |
Add pattern to iterator selector.
mi | rpm database iterator |
tag | rpm tag |
mode | type of pattern match |
pattern | pattern to match |
int rpmdbSetIteratorRewrite | ( | rpmdbMatchIterator | mi, |
int | rewrite | ||
) |
Prepare iterator for lazy writes.
mi | rpm database iterator |
rewrite | new value of rewrite |
int rpmdbStat | ( | const char * | prefix, |
struct stat * | statbuf | ||
) |
Perform stat() on rpm database.
prefix | prefix or NULL for / | |
[out] | statbuf | returned data from stat() |