4 /** \ingroup rpmdep rpmtrans
6 * Structures used for a transactionElement.
9 typedef /*@abstract@*/ struct tsortInfo_s * tsortInfo;
11 typedef /*@abstract@*/ struct teIterator_s * teIterator;
19 * Dependncy ordering information.
21 /*@-fielduse@*/ /* LCL: confused by union? */
25 /*@exposed@*/ /*@dependent@*/ /*@null@*/
26 transactionElement suc;
28 #define tsi_count tsi_u.count
29 #define tsi_suc tsi_u.suc
30 /*@owned@*/ /*@null@*/
31 struct tsortInfo_s * tsi_next;
32 /*@exposed@*/ /*@dependent@*/ /*@null@*/
33 transactionElement tsi_chain;
41 typedef enum rpmTransactionType_e {
42 TR_ADDED, /*!< Package will be installed. */
43 TR_REMOVED /*!< Package will be removed. */
47 * A single package instance to be installed/removed atomically.
49 struct transactionElement_s {
50 rpmTransactionType type; /*!< Package disposition (installed/removed). */
52 /*@refcounted@*/ /*@null@*/
53 Header h; /*!< Package header. */
55 const char * NEVR; /*!< Package name-version-release. */
57 const char * name; /*!< Name: */
60 /*@dependent@*/ /*@null@*/
61 char * version; /*!< Version: */
62 /*@dependent@*/ /*@null@*/
63 char * release; /*!< Release: */
65 const char * arch; /*!< Architecture hint. */
67 const char * os; /*!< Operating system hint. */
69 int npreds; /*!< No. of predecessors. */
70 int depth; /*!< Max. depth in dependency tree. */
72 tsortInfo tsi; /*!< Dependency ordering chains. */
74 /*@refcounted@*/ /*@null@*/
75 rpmDepSet this; /*!< This package's provided NEVR. */
76 /*@refcounted@*/ /*@null@*/
77 rpmDepSet provides; /*!< Provides: dependencies. */
78 /*@refcounted@*/ /*@null@*/
79 rpmDepSet requires; /*!< Requires: dependencies. */
80 /*@refcounted@*/ /*@null@*/
81 rpmDepSet conflicts; /*!< Conflicts: dependencies. */
82 /*@refcounted@*/ /*@null@*/
83 rpmDepSet obsoletes; /*!< Obsoletes: dependencies. */
84 /*@refcounted@*/ /*@null@*/
85 TFI_t fi; /*!< File information. */
87 uint_32 multiLib; /*!< (TR_ADDED) MULTILIB */
89 /*@exposed@*/ /*@dependent@*/ /*@null@*/
90 fnpyKey key; /*!< (TR_ADDED) Retrieval key. */
91 /*@owned@*/ /*@null@*/
92 rpmRelocation * relocs; /*!< (TR_ADDED) Payload file relocations. */
93 /*@refcounted@*/ /*@null@*/
94 FD_t fd; /*!< (TR_ADDED) Payload file descriptor. */
96 /*@-fielduse@*/ /* LCL: confused by union? */
98 /*@exposed@*/ /*@dependent@*/ /*@null@*/
101 /*@exposed@*/ /*@dependent@*/ /*@null@*/
110 #if defined(_NEED_TEITERATOR)
112 * Iterator across transaction elements, forward on install, backward on erase.
114 struct teIterator_s {
116 rpmTransactionSet ts; /*!< transaction set. */
117 int reverse; /*!< reversed traversal? */
118 int ocsave; /*!< last returned iterator index. */
119 int oc; /*!< iterator index. */
128 * Destroy a transaction element.
129 * @param te transaction element
130 * @return NULL always
133 transactionElement teFree(/*@only@*/ /*@null@*/ transactionElement te)
136 * Create a transaction element.
137 * @param ts transaction set
139 * @param type TR_ADDED/TR_REMOVED
140 * @param key (TR_ADDED) package retrieval key (e.g. file name)
141 * @param relocs (TR_ADDED) package file relocations
142 * @param dboffset (TR_REMOVED) rpmdb instance
143 * @param pkgKey associated added package (if any)
144 * @return new transaction element
146 /*@only@*/ /*@null@*/
147 transactionElement teNew(const rpmTransactionSet ts, Header h,
148 rpmTransactionType type,
149 /*@exposed@*/ /*@dependent@*/ /*@null@*/ fnpyKey key,
150 /*@null@*/ rpmRelocation * relocs,
152 /*@exposed@*/ /*@dependent@*/ /*@null@*/ alKey pkgKey)
153 /*@modifies ts, h @*/;
156 * Retrieve type of transaction element.
157 * @param te transaction element
160 rpmTransactionType teGetType(transactionElement te)
164 * Retrieve name string of transaction element.
165 * @param te transaction element
166 * @return name string
169 const char * teGetN(transactionElement te)
173 * Retrieve epoch string of transaction element.
174 * @param te transaction element
175 * @return epoch string
177 /*@observer@*/ /*@null@*/
178 const char * teGetE(transactionElement te)
182 * Retrieve version string of transaction element.
183 * @param te transaction element
184 * @return version string
186 /*@observer@*/ /*@null@*/
187 const char * teGetV(transactionElement te)
191 * Retrieve release string of transaction element.
192 * @param te transaction element
193 * @return release string
195 /*@observer@*/ /*@null@*/
196 const char * teGetR(transactionElement te)
200 * Retrieve arch string of transaction element.
201 * @param te transaction element
202 * @return arch string
204 /*@observer@*/ /*@null@*/
205 const char * teGetA(transactionElement te)
209 * Retrieve os string of transaction element.
210 * @param te transaction element
213 /*@observer@*/ /*@null@*/
214 const char * teGetO(transactionElement te)
218 * Retrieve multlib flags of transaction element.
219 * @param te transaction element
220 * @return multilib flags
222 int teGetMultiLib(transactionElement te)
226 * Set multlib flags of transaction element.
227 * @param te transaction element
228 * @param nmultiLib new multilib flags
229 * @return previous multilib flags
231 int teSetMultiLib(transactionElement te, int nmultiLib)
235 * Retrieve tsort tree depth of transaction element.
236 * @param te transaction element
239 int teGetDepth(transactionElement te)
243 * Set tsort tree depth of transaction element.
244 * @param te transaction element
245 * @param ndepth new depth
246 * @return previous depth
248 int teSetDepth(transactionElement te, int ndepth)
252 * Retrieve tsort no. of predecessors of transaction element.
253 * @param te transaction element
254 * @return no. of predecessors
256 int teGetNpreds(transactionElement te)
260 * Set tsort no. of predecessors of transaction element.
261 * @param te transaction element
262 * @param ndepth new no. of predecessors
263 * @return previous no. of predecessors
265 int teSetNpreds(transactionElement te, int npreds)
269 * Retrieve tsort info for transaction element.
270 * @param te transaction element
273 tsortInfo teGetTSI(transactionElement te)
277 * Destroy tsort info of transaction element.
278 * @param te transaction element
280 void teFreeTSI(transactionElement te)
284 * Initialize tsort info of transaction element.
285 * @param te transaction element
287 void teNewTSI(transactionElement te)
291 * Destroy dependency set info of transaction element.
292 * @param te transaction element
294 void teCleanDS(transactionElement te)
298 * Retrieve pkgKey of TR_ADDED transaction element.
299 * @param te transaction element
302 /*@exposed@*/ /*@dependent@*/ /*@null@*/
303 alKey teGetAddedKey(transactionElement te)
307 * Set pkgKey of TR_ADDED transaction element.
308 * @param te transaction element
309 * @param npkgKey new pkgKey
310 * @return previous pkgKey
312 /*@exposed@*/ /*@dependent@*/ /*@null@*/
313 alKey teSetAddedKey(transactionElement te,
314 /*@exposed@*/ /*@dependent@*/ /*@null@*/ alKey npkgKey)
318 * Retrieve dependent pkgKey of TR_REMOVED transaction element.
319 * @param te transaction element
320 * @return dependent pkgKey
322 /*@exposed@*/ /*@dependent@*/ /*@null@*/
323 alKey teGetDependsOnKey(transactionElement te)
327 * Retrieve rpmdb instance of TR_REMOVED transaction element.
328 * @param te transaction element
329 * @return rpmdb instance
331 int teGetDBOffset(transactionElement te)
335 * Retrieve name-version-release string from transaction element.
336 * @param te transaction element
337 * @return name-version-release string
340 const char * teGetNEVR(transactionElement te)
344 * Retrieve file handle from transaction element.
345 * @param te transaction element
346 * @return file handle
348 FD_t teGetFd(transactionElement te)
352 * Retrieve key from transaction element.
353 * @param te transaction element
357 fnpyKey teGetKey(transactionElement te)
361 * Retrieve dependency tag set from transaction element.
362 * @param te transaction element
363 * @param tag dependency tag
364 * @return dependency tag set
366 rpmDepSet teGetDS(transactionElement te, rpmTag tag)
370 * Retrieve file info tag set from transaction element.
371 * @param te transaction element
372 * @param tag file info tag
373 * @return file info tag set
375 TFI_t teGetFI(transactionElement te, rpmTag tag)
378 #if defined(_NEED_TEITERATOR)
380 * Return transaction element index.
381 * @param tei transaction element iterator
382 * @return transaction element index
384 int teiGetOc(teIterator tei)
388 * Destroy transaction element iterator.
389 * @param tei transaction element iterator
390 * @return NULL always
393 teIterator teFreeIterator(/*@only@*//*@null@*/ teIterator tei)
397 * Create transaction element iterator.
398 * @param ts transaction set
399 * @return transaction element iterator
402 teIterator teInitIterator(rpmTransactionSet ts)
406 * Return next transaction element
407 * @param tei transaction element iterator
408 * @return transaction element, NULL on termination
410 /*@dependent@*/ /*@null@*/
411 transactionElement teNextIterator(teIterator tei)
415 * Return next transaction element of type.
416 * @param tei transaction element iterator
417 * @param type transaction element type selector
418 * @return next transaction element of type, NULL on termination
420 /*@dependent@*/ /*@null@*/
421 transactionElement teNext(teIterator tei, rpmTransactionType type)
424 #endif /* defined(_NEED_TEITERATOR) */