rpm  4.11.1-rc1
rpmts.h
Go to the documentation of this file.
1 #ifndef H_RPMTS
2 #define H_RPMTS
3 
9 #include <sys/types.h>
10 
11 #include <rpm/rpmtypes.h>
12 #include <rpm/rpmte.h>
13 #include <rpm/rpmps.h>
14 #include <rpm/rpmsw.h>
15 #include <rpm/rpmpgp.h>
16 #include <rpm/rpmfi.h>
17 #include <rpm/rpmcallback.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 extern int _rpmts_stats;
24 
30  RPMTRANS_FLAG_TEST = (1 << 0),
33  RPMTRANS_FLAG_JUSTDB = (1 << 3),
35  RPMTRANS_FLAG_NODOCS = (1 << 5),
37  /* bit 7 unused */
39  /* bits 9-15 unused */
41  RPMTRANS_FLAG_NOPRE = (1 << 17),
42  RPMTRANS_FLAG_NOPOST = (1 << 18),
45  RPMTRANS_FLAG_NOPREUN = (1 << 21),
46  RPMTRANS_FLAG_NOPOSTUN = (1 << 22),
48  /* bits 24-25 unused */
50  RPMTRANS_FLAG_NOMD5 = (1 << 27),
52  /* bits 28-29 unused */
55 };
56 
58 
59 #define _noTransScripts \
60  ( RPMTRANS_FLAG_NOPRE | \
61  RPMTRANS_FLAG_NOPOST | \
62  RPMTRANS_FLAG_NOPREUN | \
63  RPMTRANS_FLAG_NOPOSTUN \
64  )
65 
66 #define _noTransTriggers \
67  ( RPMTRANS_FLAG_NOTRIGGERPREIN | \
68  RPMTRANS_FLAG_NOTRIGGERIN | \
69  RPMTRANS_FLAG_NOTRIGGERUN | \
70  RPMTRANS_FLAG_NOTRIGGERPOSTUN \
71  )
72 
73 /* Avoid unnecessary breakage for stuff referring to these unused flags */
74 #define RPMTRANS_FLAG_NOPAYLOAD 0
75 #define RPMTRANS_FLAG_APPLYONLY 0
76 #define RPMTRANS_FLAG_KEEPOBSOLETE 0
77 #define RPMTRANS_FLAG_DIRSTASH 0
78 #define RPMTRANS_FLAG_REPACKAGE 0
79 #define RPMTRANS_FLAG_PKGCOMMIT 0
80 #define RPMTRANS_FLAG_PKGUNDO 0
81 #define RPMTRANS_FLAG_COMMIT 0
82 #define RPMTRANS_FLAG_UNDO 0
83 #define RPMTRANS_FLAG_REVERSE 0
84 #define RPMTRANS_FLAG_NOSUGGEST 0
85 #define RPMTRANS_FLAG_ADDINDEPS 0
86 
92  RPMVSF_NOHDRCHK = (1 << 0),
93  RPMVSF_NEEDPAYLOAD = (1 << 1),
94  /* bit(s) 2-7 unused */
95  RPMVSF_NOSHA1HEADER = (1 << 8),
96  RPMVSF_NOMD5HEADER = (1 << 9), /* unimplemented */
97  RPMVSF_NODSAHEADER = (1 << 10),
98  RPMVSF_NORSAHEADER = (1 << 11), /* unimplemented */
99  /* bit(s) 12-15 unused */
100  RPMVSF_NOSHA1 = (1 << 16), /* unimplemented */
101  RPMVSF_NOMD5 = (1 << 17),
102  RPMVSF_NODSA = (1 << 18),
103  RPMVSF_NORSA = (1 << 19)
104  /* bit(s) 16-31 unused */
105 };
106 
108 
109 #define _RPMVSF_NODIGESTS \
110  ( RPMVSF_NOSHA1HEADER | \
111  RPMVSF_NOMD5HEADER | \
112  RPMVSF_NOSHA1 | \
113  RPMVSF_NOMD5 )
114 
115 #define _RPMVSF_NOSIGNATURES \
116  ( RPMVSF_NODSAHEADER | \
117  RPMVSF_NORSAHEADER | \
118  RPMVSF_NODSA | \
119  RPMVSF_NORSA )
120 
121 #define _RPMVSF_NOHEADER \
122  ( RPMVSF_NOSHA1HEADER | \
123  RPMVSF_NOMD5HEADER | \
124  RPMVSF_NODSAHEADER | \
125  RPMVSF_NORSAHEADER )
126 
127 #define _RPMVSF_NOPAYLOAD \
128  ( RPMVSF_NOSHA1 | \
129  RPMVSF_NOMD5 | \
130  RPMVSF_NODSA | \
131  RPMVSF_NORSA )
132 
136 typedef enum rpmtsOpX_e {
154 } rpmtsOpX;
155 
166 int rpmtsCheck(rpmts ts);
167 
184 int rpmtsOrder(rpmts ts);
185 
203 int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet);
204 
210 rpmts rpmtsLink (rpmts ts);
211 
217 int rpmtsCloseDB(rpmts ts);
218 
225 int rpmtsOpenDB(rpmts ts, int dbmode);
226 
234 int rpmtsInitDB(rpmts ts, int dbmode);
235 
241 int rpmtsGetDBMode(rpmts ts);
242 
250 int rpmtsSetDBMode(rpmts ts, int dbmode);
251 
257 int rpmtsRebuildDB(rpmts ts);
258 
264 int rpmtsVerifyDB(rpmts ts);
265 
275  const void * keyp, size_t keylen);
276 
285 rpmRC rpmtsImportPubkey(rpmts ts, const unsigned char * pkt, size_t pktlen);
286 
293 rpmKeyring rpmtsGetKeyring(rpmts ts, int autoload);
294 
303 int rpmtsSetKeyring(rpmts ts, rpmKeyring keyring);
304 
313  int (*solve) (rpmts ts, rpmds ds, const void * data),
314  const void * solveData);
315 
322 
327 void rpmtsCleanProblems(rpmts ts);
328 
333 void rpmtsClean(rpmts ts);
334 
339 void rpmtsEmpty(rpmts ts);
340 
346 rpmts rpmtsFree(rpmts ts);
347 
353 rpmVSFlags rpmtsVSFlags(rpmts ts);
354 
361 rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags);
362 
368 const char * rpmtsRootDir(rpmts ts);
369 
376 int rpmtsSetRootDir(rpmts ts, const char * rootDir);
377 
384 
390 void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd);
391 
398 
406 
413 
423 void * rpmtsNotify(rpmts ts, rpmte te,
424  rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total);
425 
431 int rpmtsNElements(rpmts ts);
432 
439 rpmte rpmtsElement(rpmts ts, int ix);
440 
447 
453 rpmtransFlags rpmtsFlags(rpmts ts);
454 
461 rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags);
462 
469 
476 
484 
492 
499 rpmop rpmtsOp(rpmts ts, rpmtsOpX opx);
500 
507 
520  rpmCallbackFunction notify,
521  rpmCallbackData notifyData);
522 
527 rpmts rpmtsCreate(void);
528 
543  const fnpyKey key, int upgrade,
544  rpmRelocation * relocs);
545 
553 int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset);
554 
561 
568 
576 
577 #ifdef __cplusplus
578 }
579 #endif
580 
581 
582 #endif /* H_RPMTS */