rpm 4.19.0
The RPM Package Manager
Loading...
Searching...
No Matches
rpmdb.h
Go to the documentation of this file.
1#ifndef H_RPMDB
2#define H_RPMDB
3
9#include <rpm/rpmtag.h>
10#include <rpm/rpmsw.h>
11#include <sys/stat.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
20typedef enum rpmMireMode_e {
24 RPMMIRE_GLOB = 3
26
27typedef enum rpmdbOpX_e {
28 RPMDB_OP_DBGET = 1,
29 RPMDB_OP_DBPUT = 2,
30 RPMDB_OP_DBDEL = 3,
31 RPMDB_OP_MAX = 4
32} rpmdbOpX;
33
34typedef enum rpmdbCtrlOp_e {
35 RPMDB_CTRL_LOCK_RO = 1,
36 RPMDB_CTRL_UNLOCK_RO = 2,
37 RPMDB_CTRL_LOCK_RW = 3,
38 RPMDB_CTRL_UNLOCK_RW = 4,
39 RPMDB_CTRL_INDEXSYNC = 5
40} rpmdbCtrlOp;
41
48rpmop rpmdbOp(rpmdb db, rpmdbOpX opx);
49
55int rpmdbOpenAll (rpmdb db);
56
63int rpmdbCountPackages(rpmdb db, const char * name);
64
70unsigned int rpmdbGetIteratorOffset(rpmdbMatchIterator mi);
71
77int rpmdbGetIteratorCount(rpmdbMatchIterator mi);
78
81unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi);
82
90int rpmdbAppendIterator(rpmdbMatchIterator mi,
91 const unsigned int * hdrNums, unsigned int nHdrNums);
92
101int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTagVal tag,
102 rpmMireMode mode, const char * pattern);
103
111int rpmdbSetIteratorRewrite(rpmdbMatchIterator mi, int rewrite);
112
119int rpmdbSetIteratorModified(rpmdbMatchIterator mi, int modified);
120
128int rpmdbSetHdrChk(rpmdbMatchIterator mi, rpmts ts,
129 rpmRC (*hdrchk) (rpmts ts, const void * uh, size_t uc, char ** msg));
130
139rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmDbiTagVal rpmtag,
140 const void * keyp, size_t keylen);
141
147Header rpmdbNextIterator(rpmdbMatchIterator mi);
148
154rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi);
155
162rpmdbIndexIterator rpmdbIndexKeyIteratorInit(rpmdb db, rpmDbiTag rpmtag);
163
170rpmdbIndexIterator rpmdbIndexIteratorInit(rpmdb db, rpmDbiTag rpmtag);
171
180int rpmdbIndexIteratorNext(rpmdbIndexIterator ii, const void ** key, size_t * keylen);
181
190int rpmdbIndexIteratorNextTd(rpmdbIndexIterator ii, rpmtd keytd);
191
197unsigned int rpmdbIndexIteratorNumPkgs(rpmdbIndexIterator ii);
198
205unsigned int rpmdbIndexIteratorPkgOffset(rpmdbIndexIterator ii, unsigned int nr);
206
213unsigned int rpmdbIndexIteratorTagNum(rpmdbIndexIterator ii, unsigned int nr);
214
220rpmdbIndexIterator rpmdbIndexIteratorFree(rpmdbIndexIterator ii);
221
228int rpmdbCtrl(rpmdb db, rpmdbCtrlOp ctrl);
229
236char *rpmdbCookie(rpmdb db);
237
244int rpmdbStat(const char *prefix, struct stat *statbuf);
245
252int rpmdbFStat(rpmdb db, struct stat *statbuf);
253
254#ifdef __cplusplus
255}
256#endif
257
258#endif /* H_RPMDB */
int rpmdbIndexIteratorNextTd(rpmdbIndexIterator ii, rpmtd keytd)
int rpmdbGetIteratorCount(rpmdbMatchIterator mi)
int rpmdbCtrl(rpmdb db, rpmdbCtrlOp ctrl)
rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)
unsigned int rpmdbIndexIteratorNumPkgs(rpmdbIndexIterator ii)
int rpmdbStat(const char *prefix, struct stat *statbuf)
rpmdbIndexIterator rpmdbIndexIteratorInit(rpmdb db, rpmDbiTag rpmtag)
int rpmdbAppendIterator(rpmdbMatchIterator mi, const unsigned int *hdrNums, unsigned int nHdrNums)
int rpmdbCountPackages(rpmdb db, const char *name)
unsigned int rpmdbGetIteratorOffset(rpmdbMatchIterator mi)
rpmdbIndexIterator rpmdbIndexIteratorFree(rpmdbIndexIterator ii)
unsigned int rpmdbIndexIteratorTagNum(rpmdbIndexIterator ii, unsigned int nr)
rpmdbIndexIterator rpmdbIndexKeyIteratorInit(rpmdb db, rpmDbiTag rpmtag)
rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi)
int rpmdbSetHdrChk(rpmdbMatchIterator mi, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, char **msg))
Header rpmdbNextIterator(rpmdbMatchIterator mi)
int rpmdbSetIteratorModified(rpmdbMatchIterator mi, int modified)
int rpmdbOpenAll(rpmdb db)
int rpmdbSetIteratorRewrite(rpmdbMatchIterator mi, int rewrite)
rpmop rpmdbOp(rpmdb db, rpmdbOpX opx)
int rpmdbIndexIteratorNext(rpmdbIndexIterator ii, const void **key, size_t *keylen)
char * rpmdbCookie(rpmdb db)
int rpmdbFStat(rpmdb db, struct stat *statbuf)
unsigned int rpmdbIndexIteratorPkgOffset(rpmdbIndexIterator ii, unsigned int nr)
int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTagVal tag, rpmMireMode mode, const char *pattern)
enum rpmDbiTag_e rpmDbiTag
struct rpmts_s * rpmts
Definition: rpmtypes.h:63
enum rpmRC_e rpmRC
struct headerToken_s * Header
Definition: rpmtypes.h:24
enum rpmMireMode_e rpmMireMode
rpmMireMode_e
Definition: rpmdb.h:20
@ RPMMIRE_STRCMP
Definition: rpmdb.h:22
@ RPMMIRE_REGEX
Definition: rpmdb.h:23
@ RPMMIRE_GLOB
Definition: rpmdb.h:24
@ RPMMIRE_DEFAULT
Definition: rpmdb.h:21
Definition: rpmsw.h:42
Definition: rpmtd.h:32