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 type.
22 typedef enum rpmElementType_e {
23 TR_ADDED = (1 << 0), /*!< Package will be installed. */
24 TR_REMOVED = (1 << 1) /*!< Package will be removed. */
28 * Destroy a transaction element.
29 * @param te transaction element
32 rpmte rpmteFree(rpmte te);
35 * Create a transaction element.
38 * @param type TR_ADDED/TR_REMOVED
39 * @param key (TR_ADDED) package retrieval key (e.g. file name)
40 * @param relocs (TR_ADDED) package file relocations
41 * @param dboffset unused
42 * @return new transaction element
44 rpmte rpmteNew(const rpmts ts, Header h, rpmElementType type,
46 rpmRelocation * relocs,
50 * Retrieve header from transaction element.
51 * @param te transaction element
54 Header rpmteHeader(rpmte te);
57 * Save header into transaction element.
58 * @param te transaction element
62 Header rpmteSetHeader(rpmte te, Header h);
65 * Retrieve type of transaction element.
66 * @param te transaction element
69 rpmElementType rpmteType(rpmte te);
72 * Retrieve name string of transaction element.
73 * @param te transaction element
76 const char * rpmteN(rpmte te);
79 * Retrieve epoch string of transaction element.
80 * @param te transaction element
81 * @return epoch string
83 const char * rpmteE(rpmte te);
86 * Retrieve version string of transaction element.
87 * @param te transaction element
88 * @return version string
90 const char * rpmteV(rpmte te);
93 * Retrieve release string of transaction element.
94 * @param te transaction element
95 * @return release string
97 const char * rpmteR(rpmte te);
100 * Retrieve arch string of transaction element.
101 * @param te transaction element
102 * @return arch string
104 const char * rpmteA(rpmte te);
107 * Retrieve os string of transaction element.
108 * @param te transaction element
111 const char * rpmteO(rpmte te);
114 * Retrieve isSource attribute of transaction element.
115 * @param te transaction element
116 * @return isSource attribute
118 int rpmteIsSource(rpmte te);
121 * Retrieve color bits of transaction element.
122 * @param te transaction element
125 rpm_color_t rpmteColor(rpmte te);
128 * Set color bits of transaction element.
129 * @param te transaction element
130 * @param color new color bits
131 * @return previous color bits
133 rpm_color_t rpmteSetColor(rpmte te, rpm_color_t color);
136 * Retrieve last instance installed to the database.
137 * @param te transaction element
138 * @return last install instance.
140 unsigned int rpmteDBInstance(rpmte te);
143 * Set last instance installed to the database.
144 * @param te transaction element
145 * @param instance Database instance of last install element.
146 * @return last install instance.
148 void rpmteSetDBInstance(rpmte te, unsigned int instance);
151 * Retrieve size in bytes of package file.
152 * @todo Signature header is estimated at 256b.
153 * @param te transaction element
154 * @return size in bytes of package file.
156 rpm_loff_t rpmtePkgFileSize(rpmte te);
159 * Retrieve parent transaction element.
160 * @param te transaction element
161 * @return parent transaction element
163 rpmte rpmteParent(rpmte te);
166 * Set parent transaction element.
167 * @param te transaction element
168 * @param pte new parent transaction element
169 * @return previous parent transaction element
171 rpmte rpmteSetParent(rpmte te, rpmte pte);
174 * Destroy dependency set info of transaction element.
175 * @param te transaction element
177 void rpmteCleanDS(rpmte te);
180 * Set dependent element of TR_REMOVED transaction element.
181 * @param te transaction element
182 * @param depends dependent transaction element
184 void rpmteSetDependsOn(rpmte te, rpmte depends);
187 * Retrieve dependent element of TR_REMOVED transaction element.
188 * @param te transaction element
189 * @return dependent transaction element
191 rpmte rpmteDependsOn(rpmte te);
194 * Retrieve rpmdb instance of TR_REMOVED transaction element.
195 * @param te transaction element
196 * @return rpmdb instance
198 int rpmteDBOffset(rpmte te);
201 * Retrieve [epoch:]version-release string from transaction element.
202 * @param te transaction element
203 * @return [epoch:]version-release string
205 const char * rpmteEVR(rpmte te);
208 * Retrieve name-[epoch:]version-release string from transaction element.
209 * @param te transaction element
210 * @return name-[epoch:]version-release string
212 const char * rpmteNEVR(rpmte te);
215 * Retrieve name-[epoch:]version-release.arch string from transaction element.
216 * @param te transaction element
217 * @return name-[epoch:]version-release.arch string
219 const char * rpmteNEVRA(rpmte te);
222 * Retrieve key from transaction element.
223 * @param te transaction element
226 fnpyKey rpmteKey(rpmte te);
229 * Return failure status of transaction element.
230 * If the element itself failed, this is 1, larger count means one of
231 * it's parents failed.
232 * @param te transaction element
233 * @return number of failures for this transaction element
235 int rpmteFailed(rpmte te);
238 * Retrieve dependency tag set from transaction element.
239 * @param te transaction element
240 * @param tag dependency tag
241 * @return dependency tag set
243 rpmds rpmteDS(rpmte te, rpmTag tag);
246 * Retrieve file info tag set from transaction element.
247 * @param te transaction element
248 * @return file info tag set
250 rpmfi rpmteFI(rpmte te);
253 * Calculate transaction element dependency colors/refs from file info.
254 * @param te transaction element
255 * @param tag dependency tag (RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME)
257 void rpmteColorDS(rpmte te, rpmTag tag);