rpm: rpmdb.h Source File

rpm 4.11.2-rc1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

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 {
20 RPMMIRE_DEFAULT = 0,
21 RPMMIRE_STRCMP = 1,
22 RPMMIRE_REGEX = 2,
23 RPMMIRE_GLOB = 3
24 } rpmMireMode;
25
26 typedef enum rpmdbOpX_e {
27 RPMDB_OP_DBGET = 1,
28 RPMDB_OP_DBPUT = 2,
29 RPMDB_OP_DBDEL = 3,
30 RPMDB_OP_MAX = 4
31 } rpmdbOpX;
32
39 rpmop rpmdbOp(rpmdb db, rpmdbOpX opx);
40
46 int rpmdbOpenAll (rpmdb db);
47
54 int rpmdbCountPackages(rpmdb db, const char * name);
55
61 unsigned int rpmdbGetIteratorOffset(rpmdbMatchIterator mi);
62
68 int rpmdbGetIteratorCount(rpmdbMatchIterator mi);
69
72 unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi);
73
81 int rpmdbAppendIterator(rpmdbMatchIterator mi,
82 const int * hdrNums, int nHdrNums);
83
92 int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTagVal tag,
93 rpmMireMode mode, const char * pattern);
94
102 int rpmdbSetIteratorRewrite(rpmdbMatchIterator mi, int rewrite);
103
110 int rpmdbSetIteratorModified(rpmdbMatchIterator mi, int modified);
111
119 int rpmdbSetHdrChk(rpmdbMatchIterator mi, rpmts ts,
120 rpmRC (*hdrchk) (rpmts ts, const void * uh, size_t uc, char ** msg));
121
130 rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmDbiTagVal rpmtag,
131 const void * keyp, size_t keylen);
132
138 Header rpmdbNextIterator(rpmdbMatchIterator mi);
139
143 int rpmdbCheckSignals(void);
144
153 int rpmdbCheckTerminate(int terminate);
154
160 rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
161
168 rpmdbIndexIterator rpmdbIndexIteratorInit(rpmdb db, rpmDbiTag rpmtag);
169
178 int rpmdbIndexIteratorNext(rpmdbIndexIterator ii, const void ** key, size_t * keylen);
179
185 unsigned int rpmdbIndexIteratorNumPkgs(rpmdbIndexIterator ii);
186
193 unsigned int rpmdbIndexIteratorPkgOffset(rpmdbIndexIterator ii, unsigned int nr);
194
201 unsigned int rpmdbIndexIteratorTagNum(rpmdbIndexIterator ii, unsigned int nr);
202
208 rpmdbIndexIterator rpmdbIndexIteratorFree(rpmdbIndexIterator ii);
209
210
211 #ifdef __cplusplus
212 }
213 #endif
214
215 #endif /* H_RPMDB */
RPMDB_OP_DBPUT
Definition: rpmdb.h:28
rpmdbMatchIterator
struct rpmdbMatchIterator_s * rpmdbMatchIterator
Definition: rpmtypes.h:68
rpmdbSetIteratorRE
int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTagVal tag, rpmMireMode mode, const char *pattern)
Add pattern to iterator selector.
rpmdbIndexIteratorPkgOffset
unsigned int rpmdbIndexIteratorPkgOffset(rpmdbIndexIterator ii, unsigned int nr)
Get package offset of entry.
rpmdbAppendIterator
int rpmdbAppendIterator(rpmdbMatchIterator mi, const int *hdrNums, int nHdrNums)
Append items to set of package instances to iterate.
rpmMireMode
enum rpmMireMode_e rpmMireMode
Tag value pattern match mode.
RPMMIRE_REGEX
Definition: rpmdb.h:22
RPMMIRE_STRCMP
Definition: rpmdb.h:21
rpmdbCountPackages
int rpmdbCountPackages(rpmdb db, const char *name)
Return number of instances of package in rpm database.
rpmdbFreeIterator
rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi)
Destroy rpm database iterator.
rpmdbIndexIterator
struct rpmdbIndexIterator_s * rpmdbIndexIterator
Definition: rpmtypes.h:72
rpmts
struct rpmts_s * rpmts
The main types involved in transaction manipulation.
Definition: rpmtypes.h:63
rpmdbIndexIteratorInit
rpmdbIndexIterator rpmdbIndexIteratorInit(rpmdb db, rpmDbiTag rpmtag)
Get an iterator for an index.
rpmdbOp
rpmop rpmdbOp(rpmdb db, rpmdbOpX opx)
Retrieve operation timestamp from rpm database.
rpmdbGetIteratorCount
int rpmdbGetIteratorCount(rpmdbMatchIterator mi)
Return number of elements in rpm database iterator.
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...
RPMDB_OP_DBGET
Definition: rpmdb.h:27
rpmdb
struct rpmdb_s * rpmdb
Definition: rpmtypes.h:67
RPMDB_OP_MAX
Definition: rpmdb.h:30
rpmdbGetIteratorFileNum
unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi)
rpmdbOpX_e
rpmdbOpX_e
Definition: rpmdb.h:26
Header
struct headerToken_s * Header
RPM header and data retrieval types.
Definition: rpmtypes.h:24
rpmdbIndexIteratorFree
rpmdbIndexIterator rpmdbIndexIteratorFree(rpmdbIndexIterator ii)
Free index iterator.
rpmdbSetIteratorModified
int rpmdbSetIteratorModified(rpmdbMatchIterator mi, int modified)
Modify iterator to mark header for lazy write on release.
rpmdbCheckSignals
int rpmdbCheckSignals(void)
Check for and exit on termination signals.
rpmop_s
Cumulative statistics for an operation.
Definition: rpmsw.h:40
rpmdbIndexIteratorNumPkgs
unsigned int rpmdbIndexIteratorNumPkgs(rpmdbIndexIterator ii)
Get number of entries for current key.
rpmTagVal
rpm_tag_t rpmTagVal
Definition: rpmtypes.h:30
rpmdbOpX
enum rpmdbOpX_e rpmdbOpX
mode
static int mode
Definition: rpmdb.c:18
rpmDbiTagVal
rpm_tag_t rpmDbiTagVal
Definition: rpmtypes.h:31
RPMDB_OP_DBDEL
Definition: rpmdb.h:29
rpmdbIndexIteratorTagNum
unsigned int rpmdbIndexIteratorTagNum(rpmdbIndexIterator ii, unsigned int nr)
Get tag number of entry.
RPMMIRE_DEFAULT
Definition: rpmdb.h:20
rpmMireMode_e
rpmMireMode_e
Tag value pattern match mode.
Definition: rpmdb.h:19
rpmdbOpenAll
int rpmdbOpenAll(rpmdb db)
Open all database indices.
rpmdbCheckTerminate
int rpmdbCheckTerminate(int terminate)
Check rpmdb signal handler for trapped signal and/or requested exit, clean up any open iterators and ...
rpmdbGetIteratorOffset
unsigned int rpmdbGetIteratorOffset(rpmdbMatchIterator mi)
Return header join key for current position of 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.
rpmdbNextIterator
Header rpmdbNextIterator(rpmdbMatchIterator mi)
Return next package header from iteration.
RPMMIRE_GLOB
Definition: rpmdb.h:23
rpmdbSetIteratorRewrite
int rpmdbSetIteratorRewrite(rpmdbMatchIterator mi, int rewrite)
Prepare iterator for lazy writes.
rpmdbInitIterator
rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)
Return database iterator.
rpmDbiTag
enum rpmDbiTag_e rpmDbiTag
Rpm database index tags.
rpmRC
enum rpmRC_e rpmRC
Package read return codes.