4 /** \ingroup rpmts rpmte
6 * Structures used for an "rpmte" transaction element.
9 #include <rpm/rpmtypes.h>
17 extern int _rpmte_debug;
20 * Transaction element ordering chain linkage.
22 typedef struct tsortInfo_s * tsortInfo;
25 * Transaction element type.
27 typedef enum rpmElementType_e {
28 TR_ADDED = (1 << 0), /*!< Package will be installed. */
29 TR_REMOVED = (1 << 1) /*!< Package will be removed. */
33 * Destroy a transaction element.
34 * @param te transaction element
37 rpmte rpmteFree(rpmte te);
40 * Create a transaction element.
43 * @param type TR_ADDED/TR_REMOVED
44 * @param key (TR_ADDED) package retrieval key (e.g. file name)
45 * @param relocs (TR_ADDED) package file relocations
46 * @param dboffset unused
47 * @return new transaction element
49 rpmte rpmteNew(const rpmts ts, Header h, rpmElementType type,
51 rpmRelocation * relocs,
55 * Retrieve header from transaction element.
56 * @param te transaction element
59 Header rpmteHeader(rpmte te);
62 * Save header into transaction element.
63 * @param te transaction element
67 Header rpmteSetHeader(rpmte te, Header h);
70 * Retrieve type of transaction element.
71 * @param te transaction element
74 rpmElementType rpmteType(rpmte te);
77 * Retrieve name string of transaction element.
78 * @param te transaction element
81 const char * rpmteN(rpmte te);
84 * Retrieve epoch string of transaction element.
85 * @param te transaction element
86 * @return epoch string
88 const char * rpmteE(rpmte te);
91 * Retrieve version string of transaction element.
92 * @param te transaction element
93 * @return version string
95 const char * rpmteV(rpmte te);
98 * Retrieve release string of transaction element.
99 * @param te transaction element
100 * @return release string
102 const char * rpmteR(rpmte te);
105 * Retrieve arch string of transaction element.
106 * @param te transaction element
107 * @return arch string
109 const char * rpmteA(rpmte te);
112 * Retrieve os string of transaction element.
113 * @param te transaction element
116 const char * rpmteO(rpmte te);
119 * Retrieve isSource attribute of transaction element.
120 * @param te transaction element
121 * @return isSource attribute
123 int rpmteIsSource(rpmte te);
126 * Retrieve color bits of transaction element.
127 * @param te transaction element
130 rpm_color_t rpmteColor(rpmte te);
133 * Set color bits of transaction element.
134 * @param te transaction element
135 * @param color new color bits
136 * @return previous color bits
138 rpm_color_t rpmteSetColor(rpmte te, rpm_color_t color);
141 * Retrieve last instance installed to the database.
142 * @param te transaction element
143 * @return last install instance.
145 unsigned int rpmteDBInstance(rpmte te);
148 * Set last instance installed to the database.
149 * @param te transaction element
150 * @param instance Database instance of last install element.
151 * @return last install instance.
153 void rpmteSetDBInstance(rpmte te, unsigned int instance);
156 * Retrieve size in bytes of package file.
157 * @todo Signature header is estimated at 256b.
158 * @param te transaction element
159 * @return size in bytes of package file.
161 rpm_loff_t rpmtePkgFileSize(rpmte te);
164 * Retrieve parent transaction element.
165 * @param te transaction element
166 * @return parent transaction element
168 rpmte rpmteParent(rpmte te);
171 * Set parent transaction element.
172 * @param te transaction element
173 * @param pte new parent transaction element
174 * @return previous parent transaction element
176 rpmte rpmteSetParent(rpmte te, rpmte pte);
179 * Destroy dependency set info of transaction element.
180 * @param te transaction element
182 void rpmteCleanDS(rpmte te);
185 * Set dependent element of TR_REMOVED transaction element.
186 * @param te transaction element
187 * @param depends dependent transaction element
189 void rpmteSetDependsOn(rpmte te, rpmte depends);
192 * Retrieve dependent element of TR_REMOVED transaction element.
193 * @param te transaction element
194 * @return dependent transaction element
196 rpmte rpmteDependsOn(rpmte te);
199 * Retrieve rpmdb instance of TR_REMOVED transaction element.
200 * @param te transaction element
201 * @return rpmdb instance
203 int rpmteDBOffset(rpmte te);
206 * Retrieve [epoch:]version-release string from transaction element.
207 * @param te transaction element
208 * @return [epoch:]version-release string
210 const char * rpmteEVR(rpmte te);
213 * Retrieve name-[epoch:]version-release string from transaction element.
214 * @param te transaction element
215 * @return name-[epoch:]version-release string
217 const char * rpmteNEVR(rpmte te);
220 * Retrieve name-[epoch:]version-release.arch string from transaction element.
221 * @param te transaction element
222 * @return name-[epoch:]version-release.arch string
224 const char * rpmteNEVRA(rpmte te);
227 * Retrieve key from transaction element.
228 * @param te transaction element
231 fnpyKey rpmteKey(rpmte te);
234 * Return failed status of transaction element.
235 * @param te transaction element
236 * @return 1 if transaction element (or its parents) failed
238 int rpmteFailed(rpmte te);
241 * Retrieve dependency tag set from transaction element.
242 * @param te transaction element
243 * @param tag dependency tag
244 * @return dependency tag set
246 rpmds rpmteDS(rpmte te, rpmTag tag);
249 * Retrieve file info tag set from transaction element.
250 * @param te transaction element
251 * @return file info tag set
253 rpmfi rpmteFI(rpmte te);
256 * Calculate transaction element dependency colors/refs from file info.
257 * @param te transaction element
258 * @param tag dependency tag (RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME)
260 void rpmteColorDS(rpmte te, rpmTag tag);