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 /*@unused@*/ alKey addedKey;
108 #if defined(_NEED_TEITERATOR)
110 * Iterator across transaction elements, forward on install, backward on erase.
112 struct teIterator_s {
114 rpmTransactionSet ts; /*!< transaction set. */
115 int reverse; /*!< reversed traversal? */
116 int ocsave; /*!< last returned iterator index. */
117 int oc; /*!< iterator index. */
126 * Destroy a transaction element.
127 * @param te transaction element
128 * @return NULL always
131 transactionElement teFree(/*@only@*/ /*@null@*/ transactionElement te)
134 * Create a transaction element.
135 * @param ts transaction set
137 * @param key package retrieval key (e.g. file name)
138 * @param relocs package file relocations
139 * @return new transaction element
141 /*@only@*/ /*@null@*/
142 transactionElement teNew(const rpmTransactionSet ts, Header h,
143 /*@exposed@*/ /*@null@*/ fnpyKey key,
144 /*@null@*/ rpmRelocation * relocs)
145 /*@modifies ts, h @*/;
148 * Retrieve type of transaction element.
149 * @param te transaction element
152 rpmTransactionType teGetType(transactionElement te)
156 * Retrieve name string of transaction element.
157 * @param te transaction element
158 * @return name string
161 const char * teGetN(transactionElement te)
165 * Retrieve epoch string of transaction element.
166 * @param te transaction element
167 * @return epoch string
169 /*@observer@*/ /*@null@*/
170 const char * teGetE(transactionElement te)
174 * Retrieve version string of transaction element.
175 * @param te transaction element
176 * @return version string
178 /*@observer@*/ /*@null@*/
179 const char * teGetV(transactionElement te)
183 * Retrieve release string of transaction element.
184 * @param te transaction element
185 * @return release string
187 /*@observer@*/ /*@null@*/
188 const char * teGetR(transactionElement te)
192 * Retrieve arch string of transaction element.
193 * @param te transaction element
194 * @return arch string
196 /*@observer@*/ /*@null@*/
197 const char * teGetA(transactionElement te)
201 * Retrieve os string of transaction element.
202 * @param te transaction element
205 /*@observer@*/ /*@null@*/
206 const char * teGetO(transactionElement te)
210 * Retrieve multlib flags of transaction element.
211 * @param te transaction element
212 * @return multilib flags
214 int teGetMultiLib(transactionElement te)
218 * Retrieve tsort info for transaction element.
219 * @param te transaction element
222 tsortInfo teGetTSI(transactionElement te)
226 * Retrieve pkgKey of TR_ADDED transaction element.
227 * @param te transaction element
231 alKey teGetAddedKey(transactionElement te)
235 * Retrieve dependent pkgKey of TR_REMOVED transaction element.
236 * @param te transaction element
237 * @return dependent pkgKey
240 alKey teGetDependsOnKey(transactionElement te)
244 * Retrieve rpmdb instance of TR_REMOVED transaction element.
245 * @param te transaction element
246 * @return rpmdb instance
248 int teGetDBOffset(transactionElement te)
252 * Retrieve name-version-release string from transaction element.
253 * @param te transaction element
254 * @return name-version-release string
257 const char * teGetNEVR(transactionElement te)
261 * Retrieve file handle from transaction element.
262 * @param te transaction element
263 * @return file handle
265 FD_t teGetFd(transactionElement te)
269 * Retrieve key from transaction element.
270 * @param te transaction element
274 fnpyKey teGetKey(transactionElement te)
278 * Retrieve dependency tag set from transaction element.
279 * @param te transaction element
280 * @param tag dependency tag
281 * @return dependency tag set
283 rpmDepSet teGetDS(transactionElement te, rpmTag tag)
287 * Retrieve file info tag set from transaction element.
288 * @param te transaction element
289 * @param tag file info tag
290 * @return file info tag set
292 TFI_t teGetFI(transactionElement te, rpmTag tag)
295 #if defined(_NEED_TEITERATOR)
297 * Return transaction element index.
298 * @param tei transaction element iterator
299 * @return transaction element index
301 int teiGetOc(teIterator tei)
305 * Destroy transaction element iterator.
306 * @param tei transaction element iterator
307 * @return NULL always
310 teIterator teFreeIterator(/*@only@*//*@null@*/ teIterator tei)
314 * Create transaction element iterator.
315 * @param ts transaction set
316 * @return transaction element iterator
319 teIterator teInitIterator(rpmTransactionSet ts)
323 * Return next transaction element
324 * @param tei transaction element iterator
325 * @return transaction element, NULL on termination
327 /*@dependent@*/ /*@null@*/
328 transactionElement teNextIterator(teIterator tei)
332 * Return next transaction element of type.
333 * @param tei transaction element iterator
334 * @param type transaction element type selector
335 * @return next transaction element of type, NULL on termination
337 /*@dependent@*/ /*@null@*/
338 transactionElement teNext(teIterator tei, rpmTransactionType type)
341 #endif /* defined(_NEED_TEITERATOR) */