4 /** \ingroup rpmts rpmte
6 * Structures used for an "rpmte" transaction element.
9 #include <rpm/rpmtypes.h>
16 * Transaction element type.
18 typedef enum rpmElementType_e {
19 TR_ADDED = (1 << 0), /*!< Package will be installed. */
20 TR_REMOVED = (1 << 1) /*!< Package will be removed. */
24 * Destroy a transaction element.
25 * @param te transaction element
28 rpmte rpmteFree(rpmte te);
31 * Create a transaction element.
34 * @param type TR_ADDED/TR_REMOVED
35 * @param key (TR_ADDED) package retrieval key (e.g. file name)
36 * @param relocs (TR_ADDED) package file relocations
37 * @param dboffset unused
38 * @return new transaction element
40 rpmte rpmteNew(const rpmts ts, Header h, rpmElementType type,
42 rpmRelocation * relocs,
46 * Retrieve header from transaction element.
47 * @param te transaction element
48 * @return header (new reference)
50 Header rpmteHeader(rpmte te);
53 * Save header into transaction element.
54 * @param te transaction element
58 Header rpmteSetHeader(rpmte te, Header h);
61 * Retrieve type of transaction element.
62 * @param te transaction element
65 rpmElementType rpmteType(rpmte te);
68 * Retrieve name string of transaction element.
69 * @param te transaction element
72 const char * rpmteN(rpmte te);
75 * Retrieve epoch string of transaction element.
76 * @param te transaction element
77 * @return epoch string
79 const char * rpmteE(rpmte te);
82 * Retrieve version string of transaction element.
83 * @param te transaction element
84 * @return version string
86 const char * rpmteV(rpmte te);
89 * Retrieve release string of transaction element.
90 * @param te transaction element
91 * @return release string
93 const char * rpmteR(rpmte te);
96 * Retrieve arch string of transaction element.
97 * @param te transaction element
100 const char * rpmteA(rpmte te);
103 * Retrieve os string of transaction element.
104 * @param te transaction element
107 const char * rpmteO(rpmte te);
110 * Retrieve isSource attribute of transaction element.
111 * @param te transaction element
112 * @return isSource attribute
114 int rpmteIsSource(rpmte te);
117 * Retrieve color bits of transaction element.
118 * @param te transaction element
121 rpm_color_t rpmteColor(rpmte te);
124 * Set color bits of transaction element.
125 * @param te transaction element
126 * @param color new color bits
127 * @return previous color bits
129 rpm_color_t rpmteSetColor(rpmte te, rpm_color_t color);
132 * Retrieve last instance installed to the database.
133 * @param te transaction element
134 * @return last install instance.
136 unsigned int rpmteDBInstance(rpmte te);
139 * Set last instance installed to the database.
140 * @param te transaction element
141 * @param instance Database instance of last install element.
142 * @return last install instance.
144 void rpmteSetDBInstance(rpmte te, unsigned int instance);
147 * Retrieve size in bytes of package file.
148 * @todo Signature header is estimated at 256b.
149 * @param te transaction element
150 * @return size in bytes of package file.
152 rpm_loff_t rpmtePkgFileSize(rpmte te);
155 * Retrieve parent transaction element.
156 * @param te transaction element
157 * @return parent transaction element
159 rpmte rpmteParent(rpmte te);
162 * Set parent transaction element.
163 * @param te transaction element
164 * @param pte new parent transaction element
165 * @return previous parent transaction element
167 rpmte rpmteSetParent(rpmte te, rpmte pte);
170 * Return problem set info of transaction element.
171 * @param te transaction element
172 * @return problem set (or NULL if none)
174 rpmps rpmteProblems(rpmte te);
177 * Destroy problem set info of transaction element.
178 * @param te transaction element
180 void rpmteCleanProblems(rpmte te);
183 * Destroy dependency set info of transaction element.
184 * @param te transaction element
186 void rpmteCleanDS(rpmte te);
189 * Set dependent element of TR_REMOVED transaction element.
190 * @param te transaction element
191 * @param depends dependent transaction element
193 void rpmteSetDependsOn(rpmte te, rpmte depends);
196 * Retrieve dependent element of TR_REMOVED transaction element.
197 * @param te transaction element
198 * @return dependent transaction element
200 rpmte rpmteDependsOn(rpmte te);
203 * Retrieve rpmdb instance of TR_REMOVED transaction element.
204 * @param te transaction element
205 * @return rpmdb instance
207 int rpmteDBOffset(rpmte te);
210 * Retrieve [epoch:]version-release string from transaction element.
211 * @param te transaction element
212 * @return [epoch:]version-release string
214 const char * rpmteEVR(rpmte te);
217 * Retrieve name-[epoch:]version-release string from transaction element.
218 * @param te transaction element
219 * @return name-[epoch:]version-release string
221 const char * rpmteNEVR(rpmte te);
224 * Retrieve name-[epoch:]version-release.arch string from transaction element.
225 * @param te transaction element
226 * @return name-[epoch:]version-release.arch string
228 const char * rpmteNEVRA(rpmte te);
231 * Retrieve key from transaction element.
232 * @param te transaction element
235 fnpyKey rpmteKey(rpmte te);
238 * Return failure status of transaction element.
239 * If the element itself failed, this is 1, larger count means one of
240 * it's parents failed.
241 * @param te transaction element
242 * @return number of failures for this transaction element
244 int rpmteFailed(rpmte te);
247 * Retrieve dependency tag set from transaction element.
248 * @param te transaction element
249 * @param tag dependency tag
250 * @return dependency tag set
252 rpmds rpmteDS(rpmte te, rpmTag tag);
255 * Retrieve file info tag set from transaction element.
256 * @param te transaction element
257 * @return file info tag set
259 rpmfi rpmteFI(rpmte te);