Add macro %isu_package to generate ISU Package
[platform/upstream/rpm.git] / lib / rpmte.h
1 #ifndef H_RPMTE
2 #define H_RPMTE
3
4 /** \ingroup rpmts rpmte
5  * \file lib/rpmte.h
6  * Structures used for an "rpmte" transaction element.
7  */
8
9 #include <rpm/rpmtypes.h>
10 #include <rpm/argv.h>
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 /** \ingroup rpmte
17  * Transaction element type.
18  */
19 typedef enum rpmElementType_e {
20     TR_ADDED            = (1 << 0),     /*!< Package will be installed. */
21     TR_REMOVED          = (1 << 1)      /*!< Package will be removed. */
22 } rpmElementType;
23
24 typedef rpmFlags rpmElementTypes;
25
26 /** \ingroup rpmte
27  * Retrieve header from transaction element.
28  * @param te            transaction element
29  * @return              header (new reference)
30  */
31 Header rpmteHeader(rpmte te);
32
33 /** \ingroup rpmte
34  * Save header into transaction element.
35  * @param te            transaction element
36  * @param h             header
37  * @return              NULL always
38  */
39 Header rpmteSetHeader(rpmte te, Header h);
40
41 /** \ingroup rpmte
42  * Retrieve type of transaction element.
43  * @param te            transaction element
44  * @return              type
45  */
46 rpmElementType rpmteType(rpmte te);
47
48 /** \ingroup rpmte
49  * Retrieve name string of transaction element.
50  * @param te            transaction element
51  * @return              name string
52  */
53 const char * rpmteN(rpmte te);
54
55 /** \ingroup rpmte
56  * Retrieve epoch string of transaction element.
57  * @param te            transaction element
58  * @return              epoch string
59  */
60 const char * rpmteE(rpmte te);
61
62 /** \ingroup rpmte
63  * Retrieve version string of transaction element.
64  * @param te            transaction element
65  * @return              version string
66  */
67 const char * rpmteV(rpmte te);
68
69 /** \ingroup rpmte
70  * Retrieve release string of transaction element.
71  * @param te            transaction element
72  * @return              release string
73  */
74 const char * rpmteR(rpmte te);
75
76 /** \ingroup rpmte
77  * Retrieve arch string of transaction element.
78  * @param te            transaction element
79  * @return              arch string
80  */
81 const char * rpmteA(rpmte te);
82
83 /** \ingroup rpmte
84  * Retrieve os string of transaction element.
85  * @param te            transaction element
86  * @return              os string
87  */
88 const char * rpmteO(rpmte te);
89
90 /** \ingroup rpmte
91  * Retrieve isSource attribute of transaction element.
92  * @param te            transaction element
93  * @return              isSource attribute
94  */
95 int rpmteIsSource(rpmte te);
96
97 /** \ingroup rpmte
98  * Retrieve color bits of transaction element.
99  * @param te            transaction element
100  * @return              color bits
101  */
102 rpm_color_t rpmteColor(rpmte te);
103
104 /** \ingroup rpmte
105  * Set color bits of transaction element.
106  * @param te            transaction element
107  * @param color         new color bits
108  * @return              previous color bits
109  */
110 rpm_color_t rpmteSetColor(rpmte te, rpm_color_t color);
111
112 /** \ingroup rpmte
113  * Retrieve last instance installed to the database.
114  * @param te            transaction element
115  * @return              last install instance.
116  */
117 unsigned int rpmteDBInstance(rpmte te);
118
119 /** \ingroup rpmte
120  * Set last instance installed to the database.
121  * @param te            transaction element
122  * @param instance      Database instance of last install element.
123  * @return              last install instance.
124  */
125 void rpmteSetDBInstance(rpmte te, unsigned int instance);
126
127 /** \ingroup rpmte
128  * Retrieve size in bytes of package file.
129  * @todo Signature header is estimated at 256b.
130  * @param te            transaction element
131  * @return              size in bytes of package file.
132  */
133 rpm_loff_t rpmtePkgFileSize(rpmte te);
134
135 /** \ingroup rpmte
136  * Retrieve parent transaction element.
137  * @param te            transaction element
138  * @return              parent transaction element
139  */
140 rpmte rpmteParent(rpmte te);
141
142 /** \ingroup rpmte
143  * Set parent transaction element.
144  * @param te            transaction element
145  * @param pte           new parent transaction element
146  * @return              previous parent transaction element
147  */
148 rpmte rpmteSetParent(rpmte te, rpmte pte);
149
150 /** \ingroup rpmte
151  * Return problem set info of transaction element.
152  * @param te            transaction element
153  * @return              problem set (or NULL if none)
154  */
155 rpmps rpmteProblems(rpmte te);
156
157 /** \ingroup rpmte
158  * Destroy problem set info of transaction element.
159  * @param te            transaction element
160  */
161 void rpmteCleanProblems(rpmte te);
162
163 /** \ingroup rpmte
164  * Destroy dependency set info of transaction element.
165  * @param te            transaction element
166  */
167 void rpmteCleanDS(rpmte te);
168
169 /** \ingroup rpmte
170  * Set dependent element of TR_REMOVED transaction element.
171  * @param te            transaction element
172  * @param depends       dependent transaction element
173  */
174 void rpmteSetDependsOn(rpmte te, rpmte depends);
175
176 /** \ingroup rpmte
177  * Retrieve dependent element of TR_REMOVED transaction element.
178  * @param te            transaction element
179  * @return              dependent transaction element
180  */
181 rpmte rpmteDependsOn(rpmte te);
182
183 /** \ingroup rpmte
184  * Retrieve rpmdb instance of TR_REMOVED transaction element.
185  * @param te            transaction element
186  * @return              rpmdb instance
187  */
188 int rpmteDBOffset(rpmte te);
189
190 /** \ingroup rpmte
191  * Retrieve [epoch:]version-release string from transaction element.
192  * @param te            transaction element
193  * @return              [epoch:]version-release string
194  */
195 const char * rpmteEVR(rpmte te);
196
197 /** \ingroup rpmte
198  * Retrieve name-[epoch:]version-release string from transaction element.
199  * @param te            transaction element
200  * @return              name-[epoch:]version-release string
201  */
202 const char * rpmteNEVR(rpmte te);
203
204 /** \ingroup rpmte
205  * Retrieve name-[epoch:]version-release.arch string from transaction element.
206  * @param te            transaction element
207  * @return              name-[epoch:]version-release.arch string
208  */
209 const char * rpmteNEVRA(rpmte te);
210
211 /** \ingroup rpmte
212  * Retrieve key from transaction element.
213  * @param te            transaction element
214  * @return              key
215  */
216 fnpyKey rpmteKey(rpmte te);
217
218 /** \ingroup rpmte
219  * Return failure status of transaction element.
220  * If the element itself failed, this is 1, larger count means one of
221  * it's parents failed.
222  * @param te            transaction element
223  * @return              number of failures for this transaction element
224  */
225 int rpmteFailed(rpmte te);
226
227 /** \ingroup rpmte
228  * Retrieve dependency tag set from transaction element.
229  * @param te            transaction element
230  * @param tag           dependency tag
231  * @return              dependency tag set
232  */
233 rpmds rpmteDS(rpmte te, rpmTagVal tag);
234
235 /** \ingroup rpmte
236  * Retrieve file info set from transaction element.
237  * @param te            transaction element
238  * @return              file info set (refcounted)
239  */
240 rpmfiles rpmteFiles(rpmte te);
241
242 /** \ingroup rpmte
243  * Retrieve file info iterator from transaction element.
244  * @deprecated          use rpmteFiles() instead
245  * @param te            transaction element
246  * @return              file info tag set
247  */
248 rpmfi rpmteFI(rpmte te);
249
250 #ifdef __cplusplus
251 }
252 #endif
253
254 #endif  /* H_RPMTE */