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