Remove rpmteColorDS() from the API/ABI
[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
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 /** \ingroup rpmte
16  * Transaction element type.
17  */
18 typedef enum rpmElementType_e {
19     TR_ADDED            = 1,    /*!< Package will be installed. */
20     TR_REMOVED          = 2,    /*!< Package will be removed. */
21 } rpmElementType;
22
23 /** \ingroup rpmte
24  * Destroy a transaction element.
25  * @param te            transaction element
26  * @return              NULL always
27  */
28 rpmte rpmteFree(rpmte te);
29
30 /** \ingroup rpmte
31  * Create a transaction element.
32  * @param ts            unused
33  * @param h             header
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
39  */
40 rpmte rpmteNew(const rpmts ts, Header h, rpmElementType type,
41                 fnpyKey key,
42                 rpmRelocation * relocs,
43                 int dboffset);
44
45 /** \ingroup rpmte
46  * Retrieve header from transaction element.
47  * @param te            transaction element
48  * @return              header (new reference)
49  */
50 Header rpmteHeader(rpmte te);
51
52 /** \ingroup rpmte
53  * Save header into transaction element.
54  * @param te            transaction element
55  * @param h             header
56  * @return              NULL always
57  */
58 Header rpmteSetHeader(rpmte te, Header h);
59
60 /** \ingroup rpmte
61  * Retrieve type of transaction element.
62  * @param te            transaction element
63  * @return              type
64  */
65 rpmElementType rpmteType(rpmte te);
66
67 /** \ingroup rpmte
68  * Retrieve name string of transaction element.
69  * @param te            transaction element
70  * @return              name string
71  */
72 const char * rpmteN(rpmte te);
73
74 /** \ingroup rpmte
75  * Retrieve epoch string of transaction element.
76  * @param te            transaction element
77  * @return              epoch string
78  */
79 const char * rpmteE(rpmte te);
80
81 /** \ingroup rpmte
82  * Retrieve version string of transaction element.
83  * @param te            transaction element
84  * @return              version string
85  */
86 const char * rpmteV(rpmte te);
87
88 /** \ingroup rpmte
89  * Retrieve release string of transaction element.
90  * @param te            transaction element
91  * @return              release string
92  */
93 const char * rpmteR(rpmte te);
94
95 /** \ingroup rpmte
96  * Retrieve arch string of transaction element.
97  * @param te            transaction element
98  * @return              arch string
99  */
100 const char * rpmteA(rpmte te);
101
102 /** \ingroup rpmte
103  * Retrieve os string of transaction element.
104  * @param te            transaction element
105  * @return              os string
106  */
107 const char * rpmteO(rpmte te);
108
109 /** \ingroup rpmte
110  * Retrieve isSource attribute of transaction element.
111  * @param te            transaction element
112  * @return              isSource attribute
113  */
114 int rpmteIsSource(rpmte te);
115
116 /** \ingroup rpmte
117  * Retrieve color bits of transaction element.
118  * @param te            transaction element
119  * @return              color bits
120  */
121 rpm_color_t rpmteColor(rpmte te);
122
123 /** \ingroup rpmte
124  * Set color bits of transaction element.
125  * @param te            transaction element
126  * @param color         new color bits
127  * @return              previous color bits
128  */
129 rpm_color_t rpmteSetColor(rpmte te, rpm_color_t color);
130
131 /** \ingroup rpmte
132  * Retrieve last instance installed to the database.
133  * @param te            transaction element
134  * @return              last install instance.
135  */
136 unsigned int rpmteDBInstance(rpmte te);
137
138 /** \ingroup rpmte
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.
143  */
144 void rpmteSetDBInstance(rpmte te, unsigned int instance);
145
146 /** \ingroup rpmte
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.
151  */
152 rpm_loff_t rpmtePkgFileSize(rpmte te);
153
154 /** \ingroup rpmte
155  * Retrieve parent transaction element.
156  * @param te            transaction element
157  * @return              parent transaction element
158  */
159 rpmte rpmteParent(rpmte te);
160
161 /** \ingroup rpmte
162  * Set parent transaction element.
163  * @param te            transaction element
164  * @param pte           new parent transaction element
165  * @return              previous parent transaction element
166  */
167 rpmte rpmteSetParent(rpmte te, rpmte pte);
168
169 /** \ingroup rpmte
170  * Return problem set info of transaction element.
171  * @param te            transaction element
172  * @return              problem set (or NULL if none)
173  */
174 rpmps rpmteProblems(rpmte te);
175
176 /** \ingroup rpmte
177  * Destroy problem set info of transaction element.
178  * @param te            transaction element
179  */
180 void rpmteCleanProblems(rpmte te);
181
182 /** \ingroup rpmte
183  * Destroy dependency set info of transaction element.
184  * @param te            transaction element
185  */
186 void rpmteCleanDS(rpmte te);
187
188 /** \ingroup rpmte
189  * Set dependent element of TR_REMOVED transaction element.
190  * @param te            transaction element
191  * @param depends       dependent transaction element
192  */
193 void rpmteSetDependsOn(rpmte te, rpmte depends);
194
195 /** \ingroup rpmte
196  * Retrieve dependent element of TR_REMOVED transaction element.
197  * @param te            transaction element
198  * @return              dependent transaction element
199  */
200 rpmte rpmteDependsOn(rpmte te);
201
202 /** \ingroup rpmte
203  * Retrieve rpmdb instance of TR_REMOVED transaction element.
204  * @param te            transaction element
205  * @return              rpmdb instance
206  */
207 int rpmteDBOffset(rpmte te);
208
209 /** \ingroup rpmte
210  * Retrieve [epoch:]version-release string from transaction element.
211  * @param te            transaction element
212  * @return              [epoch:]version-release string
213  */
214 const char * rpmteEVR(rpmte te);
215
216 /** \ingroup rpmte
217  * Retrieve name-[epoch:]version-release string from transaction element.
218  * @param te            transaction element
219  * @return              name-[epoch:]version-release string
220  */
221 const char * rpmteNEVR(rpmte te);
222
223 /** \ingroup rpmte
224  * Retrieve name-[epoch:]version-release.arch string from transaction element.
225  * @param te            transaction element
226  * @return              name-[epoch:]version-release.arch string
227  */
228 const char * rpmteNEVRA(rpmte te);
229
230 /** \ingroup rpmte
231  * Retrieve key from transaction element.
232  * @param te            transaction element
233  * @return              key
234  */
235 fnpyKey rpmteKey(rpmte te);
236
237 /** \ingroup rpmte
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
243  */
244 int rpmteFailed(rpmte te);
245
246 /** \ingroup rpmte
247  * Retrieve dependency tag set from transaction element.
248  * @param te            transaction element
249  * @param tag           dependency tag
250  * @return              dependency tag set
251  */
252 rpmds rpmteDS(rpmte te, rpmTag tag);
253
254 /** \ingroup rpmte
255  * Retrieve file info tag set from transaction element.
256  * @param te            transaction element
257  * @return              file info tag set
258  */
259 rpmfi rpmteFI(rpmte te);
260
261 #ifdef __cplusplus
262 }
263 #endif
264
265 #endif  /* H_RPMTE */