rpm  4.16.1.2
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 #include <sys/stat.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
20 typedef enum rpmMireMode_e {
24  RPMMIRE_GLOB = 3
26 
27 typedef enum rpmdbOpX_e {
31  RPMDB_OP_MAX = 4
33 
34 typedef enum rpmdbCtrlOp_e {
41 
49 
56 
63 int rpmdbCountPackages(rpmdb db, const char * name);
64 
71 
78 
82 
91  const unsigned int * hdrNums, unsigned int nHdrNums);
92 
102  rpmMireMode mode, const char * pattern);
103 
112 
120 
129  rpmRC (*hdrchk) (rpmts ts, const void * uh, size_t uc, char ** msg));
130 
140  const void * keyp, size_t keylen);
141 
148 
155 
163 
171 
180 int rpmdbIndexIteratorNext(rpmdbIndexIterator ii, const void ** key, size_t * keylen);
181 
191 
198 
205 unsigned int rpmdbIndexIteratorPkgOffset(rpmdbIndexIterator ii, unsigned int nr);
206 
213 unsigned int rpmdbIndexIteratorTagNum(rpmdbIndexIterator ii, unsigned int nr);
214 
221 
229 
236 char *rpmdbCookie(rpmdb db);
237 
244 int rpmdbStat(const char *prefix, struct stat *statbuf);
245 
252 int rpmdbFStat(rpmdb db, struct stat *statbuf);
253 
254 #ifdef __cplusplus
255 }
256 #endif
257 
258 #endif /* H_RPMDB */
rpmMireMode
enum rpmMireMode_e rpmMireMode
Tag value pattern match mode.
rpmdbSetIteratorRewrite
int rpmdbSetIteratorRewrite(rpmdbMatchIterator mi, int rewrite)
Prepare iterator for lazy writes.
rpmDbiTag
enum rpmDbiTag_e rpmDbiTag
Rpm database index tags.
rpmts
struct rpmts_s * rpmts
The main types involved in transaction manipulation.
Definition: rpmtypes.h:63
RPMDB_CTRL_LOCK_RO
@ RPMDB_CTRL_LOCK_RO
Definition: rpmdb.h:35
RPMDB_CTRL_UNLOCK_RO
@ RPMDB_CTRL_UNLOCK_RO
Definition: rpmdb.h:36
rpmdbOpenAll
int rpmdbOpenAll(rpmdb db)
Open all database indices.
RPMDB_CTRL_UNLOCK_RW
@ RPMDB_CTRL_UNLOCK_RW
Definition: rpmdb.h:38
rpmdbInitIterator
rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)
Return database iterator.
RPMDB_OP_DBPUT
@ RPMDB_OP_DBPUT
Definition: rpmdb.h:29
rpmdbGetIteratorFileNum
unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi)
rpmdbIndexIteratorTagNum
unsigned int rpmdbIndexIteratorTagNum(rpmdbIndexIterator ii, unsigned int nr)
Get tag number of entry.
rpmdbFStat
int rpmdbFStat(rpmdb db, struct stat *statbuf)
Perform stat() on an open rpm database.
rpmdbGetIteratorCount
int rpmdbGetIteratorCount(rpmdbMatchIterator mi)
Return number of elements in rpm database iterator.
rpmdbIndexIteratorInit
rpmdbIndexIterator rpmdbIndexIteratorInit(rpmdb db, rpmDbiTag rpmtag)
Get an iterator for an index.
rpmRC
enum rpmRC_e rpmRC
Package read return codes.
rpmdbOp
rpmop rpmdbOp(rpmdb db, rpmdbOpX opx)
Retrieve operation timestamp from rpm database.
rpmdbCookie
char * rpmdbCookie(rpmdb db)
Retrieve rpm database changed-cookie.
rpmdbStat
int rpmdbStat(const char *prefix, struct stat *statbuf)
Perform stat() on rpm database.
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.
rpmdbGetIteratorOffset
unsigned int rpmdbGetIteratorOffset(rpmdbMatchIterator mi)
Return header join key for current position of rpm database iterator.
rpmdbIndexIterator
struct rpmdbIndexIterator_s * rpmdbIndexIterator
Definition: rpmtypes.h:75
RPMMIRE_GLOB
@ RPMMIRE_GLOB
Definition: rpmdb.h:24
rpmdbMatchIterator
struct rpmdbMatchIterator_s * rpmdbMatchIterator
Definition: rpmtypes.h:69
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.
rpmdbIndexKeyIteratorInit
rpmdbIndexIterator rpmdbIndexKeyIteratorInit(rpmdb db, rpmDbiTag rpmtag)
Get an iterator for index keys.
rpmdbFreeIterator
rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi)
Destroy rpm database iterator.
rpmdbSetIteratorModified
int rpmdbSetIteratorModified(rpmdbMatchIterator mi, int modified)
Modify iterator to mark header for lazy write on release.
rpmdbCtrl
int rpmdbCtrl(rpmdb db, rpmdbCtrlOp ctrl)
manipulate the rpm database
RPMDB_OP_DBGET
@ RPMDB_OP_DBGET
Definition: rpmdb.h:28
rpmdbSetIteratorRE
int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTagVal tag, rpmMireMode mode, const char *pattern)
Add pattern to iterator selector.
rpmdbCtrlOp_e
rpmdbCtrlOp_e
Definition: rpmdb.h:34
rpmtd_s
Container for rpm tag data (from headers or extensions).
Definition: rpmtd.h:32
rpmdbIndexIteratorPkgOffset
unsigned int rpmdbIndexIteratorPkgOffset(rpmdbIndexIterator ii, unsigned int nr)
Get package offset of entry.
rpmdbIndexIteratorNumPkgs
unsigned int rpmdbIndexIteratorNumPkgs(rpmdbIndexIterator ii)
Get number of entries for current key.
rpmdbAppendIterator
int rpmdbAppendIterator(rpmdbMatchIterator mi, const unsigned int *hdrNums, unsigned int nHdrNums)
Append items to set of package instances to iterate.
RPMMIRE_REGEX
@ RPMMIRE_REGEX
Definition: rpmdb.h:23
RPMDB_CTRL_INDEXSYNC
@ RPMDB_CTRL_INDEXSYNC
Definition: rpmdb.h:39
rpmdbIndexIteratorNextTd
int rpmdbIndexIteratorNextTd(rpmdbIndexIterator ii, rpmtd keytd)
Get the next key into a tag data container.
RPMMIRE_STRCMP
@ RPMMIRE_STRCMP
Definition: rpmdb.h:22
RPMDB_OP_MAX
@ RPMDB_OP_MAX
Definition: rpmdb.h:31
rpmop_s
Cumulative statistics for an operation.
Definition: rpmsw.h:42
Header
struct headerToken_s * Header
RPM header and data retrieval types.
Definition: rpmtypes.h:24
rpmdbCtrlOp
enum rpmdbCtrlOp_e rpmdbCtrlOp
rpmMireMode_e
rpmMireMode_e
Tag value pattern match mode.
Definition: rpmdb.h:20
rpmTagVal
rpm_tag_t rpmTagVal
Definition: rpmtypes.h:30
RPMDB_CTRL_LOCK_RW
@ RPMDB_CTRL_LOCK_RW
Definition: rpmdb.h:37
rpmDbiTagVal
rpm_tag_t rpmDbiTagVal
Definition: rpmtypes.h:31
rpmdbNextIterator
Header rpmdbNextIterator(rpmdbMatchIterator mi)
Return next package header from iteration.
rpmdbIndexIteratorFree
rpmdbIndexIterator rpmdbIndexIteratorFree(rpmdbIndexIterator ii)
Free index iterator.
RPMDB_OP_DBDEL
@ RPMDB_OP_DBDEL
Definition: rpmdb.h:30
rpmdbCountPackages
int rpmdbCountPackages(rpmdb db, const char *name)
Return number of instances of package in rpm database.
RPMMIRE_DEFAULT
@ RPMMIRE_DEFAULT
Definition: rpmdb.h:21
rpmdb
struct rpmdb_s * rpmdb
Definition: rpmtypes.h:68
rpmdbOpX_e
rpmdbOpX_e
Definition: rpmdb.h:27
rpmdbOpX
enum rpmdbOpX_e rpmdbOpX