rpm 4.15.1

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
33 typedef enum rpmdbCtrlOp_e {
34 RPMDB_CTRL_LOCK_RO = 1,
35 RPMDB_CTRL_UNLOCK_RO = 2,
36 RPMDB_CTRL_LOCK_RW = 3,
37 RPMDB_CTRL_UNLOCK_RW = 4,
38 RPMDB_CTRL_INDEXSYNC = 5
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
69 unsigned int rpmdbGetIteratorOffset(rpmdbMatchIterator mi);
70
76 int rpmdbGetIteratorCount(rpmdbMatchIterator mi);
77
80 unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi);
81
89 int rpmdbAppendIterator(rpmdbMatchIterator mi,
90 const unsigned int * hdrNums, unsigned int nHdrNums);
91
100 int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTagVal tag,
101 rpmMireMode mode, const char * pattern);
102
110 int rpmdbSetIteratorRewrite(rpmdbMatchIterator mi, int rewrite);
111
118 int rpmdbSetIteratorModified(rpmdbMatchIterator mi, int modified);
119
127 int rpmdbSetHdrChk(rpmdbMatchIterator mi, rpmts ts,
128 rpmRC (*hdrchk) (rpmts ts, const void * uh, size_t uc, char ** msg));
129
138 rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmDbiTagVal rpmtag,
139 const void * keyp, size_t keylen);
140
146 Header rpmdbNextIterator(rpmdbMatchIterator mi);
147
153 rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
154
161 rpmdbIndexIterator rpmdbIndexIteratorInit(rpmdb db, rpmDbiTag rpmtag);
162
171 int rpmdbIndexIteratorNext(rpmdbIndexIterator ii, const void ** key, size_t * keylen);
172
181 int rpmdbIndexIteratorNextTd(rpmdbIndexIterator ii, rpmtd keytd);
182
188 unsigned int rpmdbIndexIteratorNumPkgs(rpmdbIndexIterator ii);
189
196 unsigned int rpmdbIndexIteratorPkgOffset(rpmdbIndexIterator ii, unsigned int nr);
197
204 unsigned int rpmdbIndexIteratorTagNum(rpmdbIndexIterator ii, unsigned int nr);
205
211 rpmdbIndexIterator rpmdbIndexIteratorFree(rpmdbIndexIterator ii);
212
219 int rpmdbCtrl(rpmdb db, rpmdbCtrlOp ctrl);
220
227 char *rpmdbCookie(rpmdb db);
228
229 #ifdef __cplusplus
230 }
231 #endif
232
233 #endif /* H_RPMDB */
rpmMireMode
enum rpmMireMode_e rpmMireMode
Tag value pattern match mode.
rpmdbSetIteratorRewrite
int rpmdbSetIteratorRewrite(rpmdbMatchIterator mi, int rewrite)
rpmDbiTag
enum rpmDbiTag_e rpmDbiTag
rpmts
struct rpmts_s * rpmts
Definition: rpmtypes.h:63
RPMDB_CTRL_LOCK_RO
@ RPMDB_CTRL_LOCK_RO
Definition: rpmdb.h:34
RPMDB_CTRL_UNLOCK_RO
@ RPMDB_CTRL_UNLOCK_RO
Definition: rpmdb.h:35
rpmdbOpenAll
int rpmdbOpenAll(rpmdb db)
RPMDB_CTRL_UNLOCK_RW
@ RPMDB_CTRL_UNLOCK_RW
Definition: rpmdb.h:37
rpmdbInitIterator
rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)
RPMDB_OP_DBPUT
@ RPMDB_OP_DBPUT
Definition: rpmdb.h:28
rpmdbGetIteratorFileNum
unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi)
rpmdbIndexIteratorTagNum
unsigned int rpmdbIndexIteratorTagNum(rpmdbIndexIterator ii, unsigned int nr)
rpmDbiTagVal
rpm_tag_t rpmDbiTagVal
Definition: rpmtypes.h:31
rpmdbGetIteratorCount
int rpmdbGetIteratorCount(rpmdbMatchIterator mi)
rpmdbIndexIteratorInit
rpmdbIndexIterator rpmdbIndexIteratorInit(rpmdb db, rpmDbiTag rpmtag)
rpmRC
enum rpmRC_e rpmRC
rpmdb
struct rpmdb_s * rpmdb
Definition: rpmtypes.h:68
rpmdbOp
rpmop rpmdbOp(rpmdb db, rpmdbOpX opx)
rpmdbCookie
char * rpmdbCookie(rpmdb db)
rpmdbSetHdrChk
int rpmdbSetHdrChk(rpmdbMatchIterator mi, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, char **msg))
rpmdbGetIteratorOffset
unsigned int rpmdbGetIteratorOffset(rpmdbMatchIterator mi)
RPMMIRE_GLOB
@ RPMMIRE_GLOB
Definition: rpmdb.h:23
rpmdbIndexIteratorNext
int rpmdbIndexIteratorNext(rpmdbIndexIterator ii, const void **key, size_t *keylen)
rpmdbFreeIterator
rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi)
rpmdbSetIteratorModified
int rpmdbSetIteratorModified(rpmdbMatchIterator mi, int modified)
rpmdbCtrl
int rpmdbCtrl(rpmdb db, rpmdbCtrlOp ctrl)
RPMDB_OP_DBGET
@ RPMDB_OP_DBGET
Definition: rpmdb.h:27
rpmdbSetIteratorRE
int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTagVal tag, rpmMireMode mode, const char *pattern)
rpmdbCtrlOp_e
rpmdbCtrlOp_e
Definition: rpmdb.h:33
rpmtd_s
Definition: rpmtd.h:32
rpmdbIndexIteratorPkgOffset
unsigned int rpmdbIndexIteratorPkgOffset(rpmdbIndexIterator ii, unsigned int nr)
rpmdbIndexIteratorNumPkgs
unsigned int rpmdbIndexIteratorNumPkgs(rpmdbIndexIterator ii)
rpmdbAppendIterator
int rpmdbAppendIterator(rpmdbMatchIterator mi, const unsigned int *hdrNums, unsigned int nHdrNums)
RPMMIRE_REGEX
@ RPMMIRE_REGEX
Definition: rpmdb.h:22
RPMDB_CTRL_INDEXSYNC
@ RPMDB_CTRL_INDEXSYNC
Definition: rpmdb.h:38
rpmdbIndexIteratorNextTd
int rpmdbIndexIteratorNextTd(rpmdbIndexIterator ii, rpmtd keytd)
RPMMIRE_STRCMP
@ RPMMIRE_STRCMP
Definition: rpmdb.h:21
rpmTagVal
rpm_tag_t rpmTagVal
Definition: rpmtypes.h:30
RPMDB_OP_MAX
@ RPMDB_OP_MAX
Definition: rpmdb.h:30
rpmop_s
Definition: rpmsw.h:42
rpmdbIndexIterator
struct rpmdbIndexIterator_s * rpmdbIndexIterator
Definition: rpmtypes.h:74
Header
struct headerToken_s * Header
Definition: rpmtypes.h:24
rpmdbCtrlOp
enum rpmdbCtrlOp_e rpmdbCtrlOp
rpmMireMode_e
rpmMireMode_e
Tag value pattern match mode.
Definition: rpmdb.h:19
RPMDB_CTRL_LOCK_RW
@ RPMDB_CTRL_LOCK_RW
Definition: rpmdb.h:36
rpmdbNextIterator
Header rpmdbNextIterator(rpmdbMatchIterator mi)
rpmdbIndexIteratorFree
rpmdbIndexIterator rpmdbIndexIteratorFree(rpmdbIndexIterator ii)
RPMDB_OP_DBDEL
@ RPMDB_OP_DBDEL
Definition: rpmdb.h:29
rpmdbCountPackages
int rpmdbCountPackages(rpmdb db, const char *name)
RPMMIRE_DEFAULT
@ RPMMIRE_DEFAULT
Definition: rpmdb.h:20
rpmdbOpX_e
rpmdbOpX_e
Definition: rpmdb.h:26
rpmdbMatchIterator
struct rpmdbMatchIterator_s * rpmdbMatchIterator
Definition: rpmtypes.h:69
rpmdbOpX
enum rpmdbOpX_e rpmdbOpX