Sanitize python object -> tag number exception handling
[platform/upstream/rpm.git] / lib / rpmts.h
1 #ifndef H_RPMTS
2 #define H_RPMTS
3
4 /** \ingroup rpmts
5  * \file lib/rpmts.h
6  * Structures and prototypes used for an "rpmts" transaction set.
7  */
8
9 #include <sys/types.h>
10
11 #include <rpm/rpmtypes.h>
12 #include <rpm/rpmps.h>
13 #include <rpm/rpmsw.h>
14 #include <rpm/rpmpgp.h>
15 #include <rpm/rpmfi.h>
16 #include <rpm/rpmcallback.h>
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 extern int _rpmts_debug;
23 extern int _rpmts_stats;
24
25 /** \ingroup rpmts
26  * Bit(s) to control rpmtsRun() operation.
27  */
28 typedef enum rpmtransFlags_e {
29     RPMTRANS_FLAG_NONE          = 0,
30     RPMTRANS_FLAG_TEST          = (1 <<  0),    /*!< from --test */
31     RPMTRANS_FLAG_BUILD_PROBS   = (1 <<  1),    /*!< don't process payload */
32     RPMTRANS_FLAG_NOSCRIPTS     = (1 <<  2),    /*!< from --noscripts */
33     RPMTRANS_FLAG_JUSTDB        = (1 <<  3),    /*!< from --justdb */
34     RPMTRANS_FLAG_NOTRIGGERS    = (1 <<  4),    /*!< from --notriggers */
35     RPMTRANS_FLAG_NODOCS        = (1 <<  5),    /*!< from --excludedocs */
36     RPMTRANS_FLAG_ALLFILES      = (1 <<  6),    /*!< from --allfiles */
37     RPMTRANS_FLAG_KEEPOBSOLETE  = (1 <<  7),    /*!< @todo Document. */
38     RPMTRANS_FLAG_NOCONTEXTS    = (1 <<  8),    /*!< from --nocontexts */
39     RPMTRANS_FLAG_DIRSTASH      = (1 <<  9),    /*!< obsolete, unused */
40     RPMTRANS_FLAG_REPACKAGE     = (1 << 10),    /*!< obsolete, unused */
41
42     RPMTRANS_FLAG_PKGCOMMIT     = (1 << 11),
43     RPMTRANS_FLAG_PKGUNDO       = (1 << 12),
44     RPMTRANS_FLAG_COMMIT        = (1 << 13),
45     RPMTRANS_FLAG_UNDO          = (1 << 14),
46     RPMTRANS_FLAG_REVERSE       = (1 << 15),
47
48     RPMTRANS_FLAG_NOTRIGGERPREIN= (1 << 16),    /*!< from --notriggerprein */
49     RPMTRANS_FLAG_NOPRE         = (1 << 17),    /*!< from --nopre */
50     RPMTRANS_FLAG_NOPOST        = (1 << 18),    /*!< from --nopost */
51     RPMTRANS_FLAG_NOTRIGGERIN   = (1 << 19),    /*!< from --notriggerin */
52     RPMTRANS_FLAG_NOTRIGGERUN   = (1 << 20),    /*!< from --notriggerun */
53     RPMTRANS_FLAG_NOPREUN       = (1 << 21),    /*!< from --nopreun */
54     RPMTRANS_FLAG_NOPOSTUN      = (1 << 22),    /*!< from --nopostun */
55     RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23),  /*!< from --notriggerpostun */
56     RPMTRANS_FLAG_NOPAYLOAD     = (1 << 24),
57     RPMTRANS_FLAG_APPLYONLY     = (1 << 25),
58
59     RPMTRANS_FLAG_NOMD5         = (1 << 27),    /*!< from --nomd5 */
60     RPMTRANS_FLAG_NOFILEDIGEST  = (1 << 27),    /*!< from --nofiledigest (alias to --nomd5) */
61     RPMTRANS_FLAG_NOSUGGEST     = (1 << 28),    /*!< from --nosuggest */
62     RPMTRANS_FLAG_ADDINDEPS     = (1 << 29),    /*!< from --aid */
63     RPMTRANS_FLAG_NOCONFIGS     = (1 << 30),    /*!< from --noconfigs */
64     RPMTRANS_FLAG_DEPLOOPS      = (1 << 31)     /*!< from --deploops */
65 } rpmtransFlags;
66
67 #define _noTransScripts         \
68   ( RPMTRANS_FLAG_NOPRE |       \
69     RPMTRANS_FLAG_NOPOST |      \
70     RPMTRANS_FLAG_NOPREUN |     \
71     RPMTRANS_FLAG_NOPOSTUN      \
72   )
73
74 #define _noTransTriggers        \
75   ( RPMTRANS_FLAG_NOTRIGGERPREIN | \
76     RPMTRANS_FLAG_NOTRIGGERIN | \
77     RPMTRANS_FLAG_NOTRIGGERUN | \
78     RPMTRANS_FLAG_NOTRIGGERPOSTUN \
79   )
80
81 /** \ingroup rpmts
82  * Bit(s) to control digest and signature verification.
83  */
84 typedef enum rpmVSFlags_e {
85     RPMVSF_DEFAULT      = 0,
86     RPMVSF_NOHDRCHK     = (1 <<  0),
87     RPMVSF_NEEDPAYLOAD  = (1 <<  1),
88     /* bit(s) 2-7 unused */
89     RPMVSF_NOSHA1HEADER = (1 <<  8),
90     RPMVSF_NOMD5HEADER  = (1 <<  9),    /* unimplemented */
91     RPMVSF_NODSAHEADER  = (1 << 10),
92     RPMVSF_NORSAHEADER  = (1 << 11),    /* unimplemented */
93     /* bit(s) 12-15 unused */
94     RPMVSF_NOSHA1       = (1 << 16),    /* unimplemented */
95     RPMVSF_NOMD5        = (1 << 17),
96     RPMVSF_NODSA        = (1 << 18),
97     RPMVSF_NORSA        = (1 << 19)
98     /* bit(s) 16-31 unused */
99 } rpmVSFlags;
100
101 #define _RPMVSF_NODIGESTS       \
102   ( RPMVSF_NOSHA1HEADER |       \
103     RPMVSF_NOMD5HEADER |        \
104     RPMVSF_NOSHA1 |             \
105     RPMVSF_NOMD5 )
106
107 #define _RPMVSF_NOSIGNATURES    \
108   ( RPMVSF_NODSAHEADER |        \
109     RPMVSF_NORSAHEADER |        \
110     RPMVSF_NODSA |              \
111     RPMVSF_NORSA )
112
113 #define _RPMVSF_NOHEADER        \
114   ( RPMVSF_NOSHA1HEADER |       \
115     RPMVSF_NOMD5HEADER |        \
116     RPMVSF_NODSAHEADER |        \
117     RPMVSF_NORSAHEADER )
118
119 #define _RPMVSF_NOPAYLOAD       \
120   ( RPMVSF_NOSHA1 |             \
121     RPMVSF_NOMD5 |              \
122     RPMVSF_NODSA |              \
123     RPMVSF_NORSA )
124
125 /** \ingroup rpmts
126  * Indices for timestamps.
127  */
128 typedef enum rpmtsOpX_e {
129     RPMTS_OP_TOTAL              =  0,
130     RPMTS_OP_CHECK              =  1,
131     RPMTS_OP_ORDER              =  2,
132     RPMTS_OP_FINGERPRINT        =  3,
133     RPMTS_OP_INSTALL            =  5,
134     RPMTS_OP_ERASE              =  6,
135     RPMTS_OP_SCRIPTLETS         =  7,
136     RPMTS_OP_COMPRESS           =  8,
137     RPMTS_OP_UNCOMPRESS         =  9,
138     RPMTS_OP_DIGEST             = 10,
139     RPMTS_OP_SIGNATURE          = 11,
140     RPMTS_OP_DBADD              = 12,
141     RPMTS_OP_DBREMOVE           = 13,
142     RPMTS_OP_DBGET              = 14,
143     RPMTS_OP_DBPUT              = 15,
144     RPMTS_OP_DBDEL              = 16,
145     RPMTS_OP_MAX                = 17
146 } rpmtsOpX;
147
148 /** \ingroup rpmts
149  * Perform dependency resolution on the transaction set.
150  *
151  * Any problems found by rpmtsCheck() can be examined by retrieving the 
152  * problem set with rpmtsProblems(), success here only means that
153  * the resolution was successfully attempted for all packages in the set.
154  *
155  * @param ts            transaction set
156  * @return              0 on success
157  */
158 int rpmtsCheck(rpmts ts);
159
160 /** \ingroup rpmts
161  * Determine package order in a transaction set according to dependencies.
162  *
163  * Order packages, returning error if circular dependencies cannot be
164  * eliminated by removing Requires's from the loop(s). Only dependencies from
165  * added or removed packages are used to determine ordering using a
166  * topological sort (Knuth vol. 1, p. 262). Use rpmtsCheck() to verify
167  * that all dependencies can be resolved.
168  *
169  * The final order ends up as installed packages followed by removed packages,
170  * with packages removed for upgrades immediately following the new package
171  * to be installed.
172  *
173  * @param ts            transaction set
174  * @return              no. of (added) packages that could not be ordered
175  */
176 int rpmtsOrder(rpmts ts);
177
178 /** \ingroup rpmts
179  * Process all package elements in a transaction set.  Before calling
180  * rpmtsRun be sure to have:
181  *
182  *    - setup the rpm root dir via rpmtsSetRoot().
183  *    - setup the rpm notify callback via rpmtsSetNotifyCallback().
184  *    - setup the rpm transaction flags via rpmtsSetFlags().
185  * 
186  * Additionally, though not required you may want to:
187  *
188  *    - setup the rpm verify signature flags via rpmtsSetVSFlags().
189  *       
190  * @param ts            transaction set
191  * @param okProbs       previously known problems (or NULL)
192  * @param ignoreSet     bits to filter problem types
193  * @return              0 on success, -1 on error, >0 with newProbs set
194  */
195 int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet);
196
197 /** \ingroup rpmts
198  * Unreference a transaction instance.
199  * @param ts            transaction set
200  * @param msg
201  * @return              NULL always
202  */
203 rpmts rpmtsUnlink (rpmts ts,
204                 const char * msg);
205
206 /** \ingroup rpmts
207  * Reference a transaction set instance.
208  * @param ts            transaction set
209  * @param msg
210  * @return              new transaction set reference
211  */
212 rpmts rpmtsLink (rpmts ts, const char * msg);
213
214 /** \ingroup rpmts
215  * Close the database used by the transaction.
216  * @param ts            transaction set
217  * @return              0 on success
218  */
219 int rpmtsCloseDB(rpmts ts);
220
221 /** \ingroup rpmts
222  * Open the database used by the transaction.
223  * @param ts            transaction set
224  * @param dbmode        O_RDONLY or O_RDWR
225  * @return              0 on success
226  */
227 int rpmtsOpenDB(rpmts ts, int dbmode);
228
229 /** \ingroup rpmts
230  * Initialize the database used by the transaction.
231  * @deprecated An explicit rpmdbInit() is almost never needed.
232  * @param ts            transaction set
233  * @param dbmode        O_RDONLY or O_RDWR
234  * @return              0 on success
235  */
236 int rpmtsInitDB(rpmts ts, int dbmode);
237
238 /** \ingroup rpmts
239  * Return the transaction database mode
240  * @param ts            transaction set
241  * @return              O_RDONLY, O_RDWR or -1 (lazy opens disabled)
242  */
243 int rpmtsGetDBMode(rpmts ts);
244
245 /** \ingroup rpmts
246  * Set the transaction database mode. Only permitted when when backing
247  * database hasn't been opened yet (ie rpmtsGetRdb(ts) == NULL)
248  * @param ts            transaction set
249  * @param dbmode        O_RDONLY, O_RDWR or -1 (disable lazy opens)
250  * @return              0 on success, 1 on error 
251  */
252 int rpmtsSetDBMode(rpmts ts, int dbmode);
253
254 /** \ingroup rpmts
255  * Rebuild the database used by the transaction.
256  * @param ts            transaction set
257  * @return              0 on success
258  */
259 int rpmtsRebuildDB(rpmts ts);
260
261 /** \ingroup rpmts
262  * Verify the database used by the transaction.
263  * @param ts            transaction set
264  * @return              0 on success
265  */
266 int rpmtsVerifyDB(rpmts ts);
267
268 /** \ingroup rpmts
269  * Return transaction database iterator.
270  * @param ts            transaction set
271  * @param rpmtag        rpm tag
272  * @param keyp          key data (NULL for sequential access)
273  * @param keylen        key data length (0 will use strlen(keyp))
274  * @return              NULL on failure
275  */
276 rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
277                         const void * keyp, size_t keylen);
278
279 /** \ingroup rpmts
280  * Retrieve pubkey from rpm database.
281  * @param ts            rpm transaction
282  * @param dig           OpenPGP packet container
283  * @return              RPMRC_OK on success, RPMRC_NOKEY if not found
284  */
285 rpmRC rpmtsFindPubkey(rpmts ts, pgpDig dig) RPM_GNUC_DEPRECATED;
286
287 /** \ingroup rpmts
288  * Import public key packet(s).
289  * @todo Implicit --update policy for gpg-pubkey headers.
290  * @param ts            transaction set
291  * @param pkt           pgp pubkey packet(s)
292  * @param pktlen        pgp pubkey length
293  * @return              RPMRC_OK/RPMRC_FAIL
294  */
295 rpmRC rpmtsImportPubkey(rpmts ts, const unsigned char * pkt, size_t pktlen);
296
297 /** \ingroup rpmts
298  * Retrieve handle for keyring used for this transaction set
299  * @param ts            transaction set
300  * @param autoload      load default keyring if keyring is not set
301  * @return              keyring handle (or NULL)
302  */
303 rpmKeyring rpmtsGetKeyring(rpmts ts, int autoload);
304
305 /** \ingroup rpmts
306  * Set keyring to use for this transaction set.
307  * Keyring can be only changed while the underlying rpm database is not
308  * yet open.
309  * @param ts            transaction set
310  * @param keyring       keyring handle (NULL to free current keyring)
311  * @return              0 on success, -1 on error
312  */
313 int rpmtsSetKeyring(rpmts ts, rpmKeyring keyring);
314
315 /** \ingroup rpmts
316  * Set dependency solver callback.
317  * @param ts            transaction set
318  * @param (*solve)      dependency solver callback
319  * @param solveData     dependency solver callback data (opaque)
320  * @return              0 on success
321  */
322 int rpmtsSetSolveCallback(rpmts ts,
323                 int (*solve) (rpmts ts, rpmds ds, const void * data),
324                 const void * solveData);
325
326 /** \ingroup rpmts
327  * Return current transaction set problems.
328  * @param ts            transaction set
329  * @return              current problem set (or NULL)
330  */
331 rpmps rpmtsProblems(rpmts ts);
332
333 /** \ingroup rpmts
334  * Clean current transaction problem set.
335  * @param ts            transaction set
336  */
337 void rpmtsCleanProblems(rpmts ts);
338
339 /** \ingroup rpmts
340  * Free memory needed only for dependency checks and ordering.
341  * @param ts            transaction set
342  */
343 void rpmtsClean(rpmts ts);
344
345 /** \ingroup rpmts
346  * Re-create an empty transaction set.
347  * @param ts            transaction set
348  */
349 void rpmtsEmpty(rpmts ts);
350
351 /** \ingroup rpmts
352  * Destroy transaction set, closing the database as well.
353  * @param ts            transaction set
354  * @return              NULL always
355  */
356 rpmts rpmtsFree(rpmts ts);
357
358 /** \ingroup rpmts
359  * Get verify signatures flag(s).
360  * @param ts            transaction set
361  * @return              verify signatures flags
362  */
363 rpmVSFlags rpmtsVSFlags(rpmts ts);
364
365 /** \ingroup rpmts
366  * Set verify signatures flag(s).
367  * @param ts            transaction set
368  * @param vsflags       new verify signatures flags
369  * @return              previous value
370  */
371 rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags);
372
373 /** \ingroup rpmts
374  * Get transaction rootDir, i.e. path to chroot(2).
375  * @param ts            transaction set
376  * @return              transaction rootDir
377  */
378 const char * rpmtsRootDir(rpmts ts);
379
380 /** \ingroup rpmts
381  * Set transaction rootDir, i.e. path to chroot(2).
382  * @param ts            transaction set
383  * @param rootDir       new transaction rootDir (or NULL)
384  * @return              0 on success, -1 on error (invalid rootDir)
385  */
386 int rpmtsSetRootDir(rpmts ts, const char * rootDir);
387
388 /** \ingroup rpmts
389  * Get transaction currDir, i.e. current directory before chroot(2).
390  * @param ts            transaction set
391  * @return              transaction currDir
392  */
393 const char * rpmtsCurrDir(rpmts ts);
394
395 /** \ingroup rpmts
396  * Set transaction currDir, i.e. current directory before chroot(2).
397  * @param ts            transaction set
398  * @param currDir       new transaction currDir (or NULL)
399  */
400 void rpmtsSetCurrDir(rpmts ts, const char * currDir);
401
402 /** \ingroup rpmts
403  * Get transaction script file handle, i.e. stdout/stderr on scriptlet execution
404  * @param ts            transaction set
405  * @return              transaction script file handle
406  */
407 FD_t rpmtsScriptFd(rpmts ts);
408
409 /** \ingroup rpmts
410  * Set transaction script file handle, i.e. stdout/stderr on scriptlet execution
411  * @param ts            transaction set
412  * @param scriptFd      new script file handle (or NULL)
413  */
414 void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd);
415
416 /** \ingroup rpmts
417  * Get selinuxEnabled flag, i.e. is SE linux enabled?
418  * @param ts            transaction set
419  * @return              selinuxEnabled flag
420  */
421 int rpmtsSELinuxEnabled(rpmts ts);
422
423 /** \ingroup rpmts
424  * Get chrootDone flag, i.e. has chroot(2) been performed?
425  * @param ts            transaction set
426  * @return              chrootDone flag
427  */
428 int rpmtsChrootDone(rpmts ts);
429
430 /** \ingroup rpmts
431  * Set chrootDone flag, i.e. has chroot(2) been performed?
432  * @param ts            transaction set
433  * @param chrootDone    new chrootDone flag
434  * @return              previous chrootDone flag
435  */
436 int rpmtsSetChrootDone(rpmts ts, int chrootDone);
437
438 /** \ingroup rpmts
439  * Get transaction id, i.e. transaction time stamp.
440  * @param ts            transaction set
441  * @return              transaction id
442  */
443 rpm_tid_t rpmtsGetTid(rpmts ts);
444
445 /** \ingroup rpmts
446  * Set transaction id, i.e. transaction time stamp.
447  * @param ts            transaction set
448  * @param tid           new transaction id
449  * @return              previous transaction id
450  */
451 rpm_tid_t rpmtsSetTid(rpmts ts, rpm_tid_t tid);
452
453 /** \ingroup rpmts
454  * Get transaction set database handle.
455  * @param ts            transaction set
456  * @return              transaction database handle
457  */
458 rpmdb rpmtsGetRdb(rpmts ts);
459
460 /** \ingroup rpmts
461  * Initialize disk space info for each and every mounted file systems.
462  * @param ts            transaction set
463  * @return              0 on success
464  */
465 int rpmtsInitDSI(const rpmts ts);
466
467 /** \ingroup rpmts
468  * Update disk space info for a file.
469  * @param ts            transaction set
470  * @param dev           mount point device
471  * @param fileSize      long (64bit) file size
472  * @param prevSize      previous long file size (if upgrading)
473  * @param fixupSize     long size difference
474  * @param action        file disposition
475  */
476 void rpmtsUpdateDSI(const rpmts ts, dev_t dev,
477                 rpm_loff_t fileSize, rpm_loff_t prevSize, rpm_loff_t fixupSize,
478                 rpmFileAction action);
479
480 /** \ingroup rpmts
481  * Check a transaction element for disk space problems.
482  * @param ts            transaction set
483  * @param te            current transaction element
484  */
485 void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te);
486
487 /** \ingroup rpmts
488  * Perform transaction progress notify callback.
489  * @param ts            transaction set
490  * @param te            current transaction element
491  * @param what          type of call back
492  * @param amount        current value
493  * @param total         final value
494  * @return              callback dependent pointer
495  */
496 void * rpmtsNotify(rpmts ts, rpmte te,
497                 rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total);
498
499 /** \ingroup rpmts
500  * Return number of (ordered) transaction set elements.
501  * @param ts            transaction set
502  * @return              no. of transaction set elements
503  */
504 int rpmtsNElements(rpmts ts);
505
506 /** \ingroup rpmts
507  * Return (ordered) transaction set element.
508  * @param ts            transaction set
509  * @param ix            transaction element index
510  * @return              transaction element (or NULL)
511  */
512 rpmte rpmtsElement(rpmts ts, int ix);
513
514 /** \ingroup rpmts
515  * Get problem ignore bit mask, i.e. bits to filter encountered problems.
516  * @param ts            transaction set
517  * @return              ignore bit mask
518  */
519 rpmprobFilterFlags rpmtsFilterFlags(rpmts ts);
520
521 /** \ingroup rpmts
522  * Get transaction flags, i.e. bits that control rpmtsRun().
523  * @param ts            transaction set
524  * @return              transaction flags
525  */
526 rpmtransFlags rpmtsFlags(rpmts ts);
527
528 /** \ingroup rpmts
529  * Set transaction flags, i.e. bits that control rpmtsRun().
530  * @param ts            transaction set
531  * @param transFlags    new transaction flags
532  * @return              previous transaction flags
533  */
534 rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags);
535
536 /** \ingroup rpmts
537  * Get spec control structure from transaction set.
538  * @param ts            transaction set
539  * @return              spec control structure
540  */
541 rpmSpec rpmtsSpec(rpmts ts);
542
543 /** \ingroup rpmts
544  * Set a spec control structure in transaction set.
545  * @param ts            transaction set
546  * @param spec          new spec control structure
547  * @return              previous spec control structure
548  */
549 rpmSpec rpmtsSetSpec(rpmts ts, rpmSpec spec);
550
551 /** \ingroup rpmts
552  * Retrieve color bits of transaction set.
553  * @param ts            transaction set
554  * @return              color bits
555  */
556 rpm_color_t rpmtsColor(rpmts ts);
557
558 /** \ingroup rpmts
559  * Retrieve prefered file color
560  * @param ts            transaction set
561  * @return              color bits
562  */
563 rpm_color_t rpmtsPrefColor(rpmts ts);
564
565 /** \ingroup rpmts
566  * Set color bits of transaction set.
567  * @param ts            transaction set
568  * @param color         new color bits
569  * @return              previous color bits
570  */
571 rpm_color_t rpmtsSetColor(rpmts ts, rpm_color_t color);
572
573 /** \ingroup rpmts
574  * Retrieve operation timestamp from a transaction set.
575  * @param ts            transaction set
576  * @param opx           operation timestamp index
577  * @return              pointer to operation timestamp.
578  */
579 rpmop rpmtsOp(rpmts ts, rpmtsOpX opx);
580
581 /** \ingroup rpmts
582  * Set transaction notify callback function and argument.
583  *
584  * @warning This call must be made before rpmtsRun() for
585  *      install/upgrade/freshen to function correctly.
586  *
587  * @param ts            transaction set
588  * @param notify        progress callback
589  * @param notifyData    progress callback private data
590  * @return              0 on success
591  */
592 int rpmtsSetNotifyCallback(rpmts ts,
593                 rpmCallbackFunction notify,
594                 rpmCallbackData notifyData);
595
596 /** \ingroup rpmts
597  * Create an empty transaction set.
598  * @return              new transaction set
599  */
600 rpmts rpmtsCreate(void);
601
602 /** \ingroup rpmts
603  * Add package to be installed to transaction set.
604  *
605  * The transaction set is checked for duplicate package names.
606  * If found, the package with the "newest" EVR will be replaced.
607  *
608  * @param ts            transaction set
609  * @param h             header
610  * @param key           package retrieval key (e.g. file name)
611  * @param upgrade       is package being upgraded?
612  * @param relocs        package file relocations
613  * @return              0 on success, 1 on I/O error, 2 needs capabilities
614  */
615 int rpmtsAddInstallElement(rpmts ts, Header h,
616                 const fnpyKey key, int upgrade,
617                 rpmRelocation * relocs);
618
619 /** \ingroup rpmts
620  * Add package to be erased to transaction set.
621  * @param ts            transaction set
622  * @param h             header
623  * @param dboffset      ununsed
624  * @return              0 on success
625  */
626 int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset);
627
628 /** \ingroup rpmts
629  * Retrieve keys from ordered transaction set.
630  * @todo Removed packages have no keys, returned as interleaved NULL pointers.
631  * @param ts            transaction set
632  * @retval ep           address of returned element array pointer (or NULL)
633  * @retval nep          address of no. of returned elements (or NULL)
634  * @return              0 always
635  */
636 int rpmtsGetKeys(rpmts ts,
637                 fnpyKey ** ep,
638                 int * nep);
639
640 #ifdef __cplusplus
641 }
642 #endif
643
644
645 #endif  /* H_RPMTS */