rpm  4.14.0
rpmdb.h
Go to the documentation of this file.
1 #ifndef H_RPMDB
2 #define H_RPMDB
3 
9 #include <rpm/rpmtypes.h>
10 #include <rpm/rpmsw.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
19 typedef enum rpmMireMode_e {
24 } rpmMireMode;
25 
26 typedef enum rpmdbOpX_e {
31 } rpmdbOpX;
32 
33 typedef enum rpmdbCtrlOp_e {
39 } rpmdbCtrlOp;
40 
47 rpmop rpmdbOp(rpmdb db, rpmdbOpX opx);
48 
54 int rpmdbOpenAll (rpmdb db);
55 
62 int rpmdbCountPackages(rpmdb db, const char * name);
63 
70 
77 
81 
90  const unsigned int * hdrNums, unsigned int nHdrNums);
91 
101  rpmMireMode mode, const char * pattern);
102 
110 int rpmdbSetIteratorRewrite(rpmdbMatchIterator mi, int rewrite);
111 
118 int rpmdbSetIteratorModified(rpmdbMatchIterator mi, int modified);
119 
128  rpmRC (*hdrchk) (rpmts ts, const void * uh, size_t uc, char ** msg));
129 
139  const void * keyp, size_t keylen);
140 
147 
154 
162 
171 int rpmdbIndexIteratorNext(rpmdbIndexIterator ii, const void ** key, size_t * keylen);
172 
182 
189 
196 unsigned int rpmdbIndexIteratorPkgOffset(rpmdbIndexIterator ii, unsigned int nr);
197 
204 unsigned int rpmdbIndexIteratorTagNum(rpmdbIndexIterator ii, unsigned int nr);
205 
212 
219 int rpmdbCtrl(rpmdb db, rpmdbCtrlOp ctrl);
220 
221 #ifdef __cplusplus
222 }
223 #endif
224 
225 #endif /* H_RPMDB */
struct rpmdbMatchIterator_s * rpmdbMatchIterator
Definition: rpmtypes.h:69
int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTagVal tag, rpmMireMode mode, const char *pattern)
Add pattern to iterator selector.
unsigned int rpmdbIndexIteratorPkgOffset(rpmdbIndexIterator ii, unsigned int nr)
Get package offset of entry.
enum rpmMireMode_e rpmMireMode
Tag value pattern match mode.
int rpmdbCountPackages(rpmdb db, const char *name)
Return number of instances of package in rpm database.
rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi)
Destroy rpm database iterator.
struct rpmdbIndexIterator_s * rpmdbIndexIterator
Definition: rpmtypes.h:74
struct rpmts_s * rpmts
The main types involved in transaction manipulation.
Definition: rpmtypes.h:63
int rpmdbIndexIteratorNextTd(rpmdbIndexIterator ii, rpmtd keytd)
Get the next key into a tag data container.
rpmdbIndexIterator rpmdbIndexIteratorInit(rpmdb db, rpmDbiTag rpmtag)
Get an iterator for an index.
rpmop rpmdbOp(rpmdb db, rpmdbOpX opx)
Retrieve operation timestamp from rpm database.
int rpmdbGetIteratorCount(rpmdbMatchIterator mi)
Return number of elements in rpm database iterator.
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...
struct rpmdb_s * rpmdb
Definition: rpmtypes.h:68
enum rpmdbCtrlOp_e rpmdbCtrlOp
unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi)
rpmdbOpX_e
Definition: rpmdb.h:26
struct headerToken_s * Header
RPM header and data retrieval types.
Definition: rpmtypes.h:24
rpmdbIndexIterator rpmdbIndexIteratorFree(rpmdbIndexIterator ii)
Free index iterator.
int rpmdbSetIteratorModified(rpmdbMatchIterator mi, int modified)
Modify iterator to mark header for lazy write on release.
Cumulative statistics for an operation.
Definition: rpmsw.h:42
unsigned int rpmdbIndexIteratorNumPkgs(rpmdbIndexIterator ii)
Get number of entries for current key.
rpm_tag_t rpmTagVal
Definition: rpmtypes.h:30
enum rpmdbOpX_e rpmdbOpX
rpm_tag_t rpmDbiTagVal
Definition: rpmtypes.h:31
unsigned int rpmdbIndexIteratorTagNum(rpmdbIndexIterator ii, unsigned int nr)
Get tag number of entry.
Container for rpm tag data (from headers or extensions).
Definition: rpmtd.h:32
rpmMireMode_e
Tag value pattern match mode.
Definition: rpmdb.h:19
int rpmdbCtrl(rpmdb db, rpmdbCtrlOp ctrl)
manipulate the rpm database
int rpmdbOpenAll(rpmdb db)
Open all database indices.
rpmdbCtrlOp_e
Definition: rpmdb.h:33
unsigned int rpmdbGetIteratorOffset(rpmdbMatchIterator mi)
Return header join key for current position of rpm database iterator.
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.
Header rpmdbNextIterator(rpmdbMatchIterator mi)
Return next package header from iteration.
int rpmdbSetIteratorRewrite(rpmdbMatchIterator mi, int rewrite)
Prepare iterator for lazy writes.
rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)
Return database iterator.
enum rpmDbiTag_e rpmDbiTag
Rpm database index tags.
int rpmdbAppendIterator(rpmdbMatchIterator mi, const unsigned int *hdrNums, unsigned int nHdrNums)
Append items to set of package instances to iterate.
enum rpmRC_e rpmRC
Package read return codes.