4 /** \ingroup rpmdep rpmtrans
6 * Structure(s) used for dependency tag sets.
9 #include "rpmlib.h" /* for rpmds */
18 extern int _rpmds_debug;
22 extern int _rpmds_nopromote;
25 * Unreference a dependency set instance.
26 * @param ds dependency set
30 rpmds rpmdsUnlink (rpmds ds,
33 /** @todo Remove debugging entry from the ABI. */
34 rpmds XrpmdsUnlink (rpmds ds,
35 const char * msg, const char * fn, unsigned ln);
36 #define rpmdsUnlink(_ds, _msg) XrpmdsUnlink(_ds, _msg, __FILE__, __LINE__)
39 * Reference a dependency set instance.
40 * @param ds dependency set
42 * @return new dependency set reference
44 rpmds rpmdsLink (rpmds ds, const char * msg);
46 /** @todo Remove debugging entry from the ABI. */
47 rpmds XrpmdsLink (rpmds ds, const char * msg,
48 const char * fn, unsigned ln);
49 #define rpmdsLink(_ds, _msg) XrpmdsLink(_ds, _msg, __FILE__, __LINE__)
52 * Destroy a dependency set.
53 * @param ds dependency set
56 rpmds rpmdsFree(rpmds ds);
58 * Create and load a dependency set.
59 * @deprecated Only scareMem = 0 will be permitted.
61 * @param tagN type of dependency
62 * @param flags scareMem(0x1)
63 * @return new dependency set
65 rpmds rpmdsNew(Header h, rpmTag tagN, int flags);
68 * Return new formatted dependency string.
69 * @param dspfx formatted dependency string prefix
70 * @param ds dependency set
71 * @return new formatted dependency (malloc'ed)
73 char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds);
76 * Create, load and initialize a dependency for this header.
78 * @param tagN type of dependency
79 * @param Flags comparison flags
80 * @return new dependency set
82 rpmds rpmdsThis(Header h, rpmTag tagN, int32_t Flags);
85 * Create, load and initialize a dependency set of size 1.
86 * @param tagN type of dependency
88 * @param EVR epoch:version-release
89 * @param Flags comparison flags
90 * @return new dependency set
92 rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * EVR, int32_t Flags);
95 * Return dependency set count.
96 * @param ds dependency set
97 * @return current count
99 int rpmdsCount(const rpmds ds);
102 * Return dependency set index.
103 * @param ds dependency set
104 * @return current index
106 int rpmdsIx(const rpmds ds);
109 * Set dependency set index.
110 * @param ds dependency set
111 * @param ix new index
112 * @return current index
114 int rpmdsSetIx(rpmds ds, int ix);
117 * Return current formatted dependency string.
118 * @param ds dependency set
119 * @return current dependency DNEVR, NULL on invalid
121 extern const char * rpmdsDNEVR(const rpmds ds);
124 * Return current dependency name.
125 * @param ds dependency set
126 * @return current dependency name, NULL on invalid
128 extern const char * rpmdsN(const rpmds ds);
131 * Return current dependency epoch-version-release.
132 * @param ds dependency set
133 * @return current dependency EVR, NULL on invalid
135 extern const char * rpmdsEVR(const rpmds ds);
138 * Return current dependency flags.
139 * @param ds dependency set
140 * @return current dependency flags, 0 on invalid
142 int32_t rpmdsFlags(const rpmds ds);
145 * Return current dependency type.
146 * @param ds dependency set
147 * @return current dependency type, 0 on invalid
149 rpmTag rpmdsTagN(const rpmds ds);
152 * Return dependency build time.
153 * @param ds dependency set
154 * @return dependency build time, 0 on invalid
156 time_t rpmdsBT(const rpmds ds);
159 * Set dependency build time.
160 * @param ds dependency set
161 * @param BT build time
162 * @return dependency build time, 0 on invalid
164 time_t rpmdsSetBT(const rpmds ds, time_t BT);
167 * Return current "Don't promote Epoch:" flag.
169 * This flag controls for Epoch: promotion when a dependency set is
170 * compared. If the flag is set (for already installed packages), then
171 * an unspecified value will be treated as Epoch: 0. Otherwise (for added
172 * packages), the Epoch: portion of the comparison is skipped if the value
173 * is not specified, i.e. an unspecified Epoch: is assumed to be equal
174 * in dependency comparisons.
176 * @param ds dependency set
177 * @return current "Don't promote Epoch:" flag
179 int rpmdsNoPromote(const rpmds ds);
182 * Set "Don't promote Epoch:" flag.
183 * @param ds dependency set
184 * @param nopromote Should an unspecified Epoch: be treated as Epoch: 0?
185 * @return previous "Don't promote Epoch:" flag
187 int rpmdsSetNoPromote(rpmds ds, int nopromote);
190 * Return current dependency color.
191 * @param ds dependency set
192 * @return current dependency color
194 uint32_t rpmdsColor(const rpmds ds);
197 * Return current dependency color.
198 * @param ds dependency set
199 * @param color new dependency color
200 * @return previous dependency color
202 uint32_t rpmdsSetColor(const rpmds ds, uint32_t color);
205 * Return current dependency file refs.
206 * @param ds dependency set
207 * @return current dependency file refs, -1 on global
209 int32_t rpmdsRefs(const rpmds ds);
212 * Return current dependency color.
213 * @param ds dependency set
214 * @param refs new dependency refs
215 * @return previous dependency refs
217 int32_t rpmdsSetRefs(const rpmds ds, int32_t refs);
220 * Notify of results of dependency match.
221 * @param ds dependency set
222 * @param where where dependency was resolved (or NULL)
223 * @param rc 0 == YES, otherwise NO
225 /* FIX: rpmMessage annotation is a lie */
226 void rpmdsNotify(rpmds ds, const char * where, int rc);
229 * Return next dependency set iterator index.
230 * @param ds dependency set
231 * @return dependency set iterator index, -1 on termination
233 int rpmdsNext(rpmds ds);
236 * Initialize dependency set iterator.
237 * @param ds dependency set
238 * @return dependency set
240 rpmds rpmdsInit(rpmds ds);
243 * Find a dependency set element using binary search.
244 * @param ds dependency set to search
245 * @param ods dependency set element to find.
246 * @return dependency index (or -1 if not found)
248 int rpmdsFind(rpmds ds, const rpmds ods);
251 * Merge a dependency set maintaining (N,EVR,Flags) sorted order.
252 * @retval *dsp (merged) dependency set
253 * @param ods dependency set to merge
254 * @return (merged) dependency index
256 int rpmdsMerge(rpmds * dsp, rpmds ods);
259 * Compare two versioned dependency ranges, looking for overlap.
260 * @param A 1st dependency
261 * @param B 2nd dependency
262 * @return 1 if dependencies overlap, 0 otherwise
264 int rpmdsCompare(const rpmds A, const rpmds B);
267 * Report a Requires: or Conflicts: dependency problem.
268 * @param ps transaction set problems
269 * @param pkgNEVR package name/epoch/version/release
270 * @param ds dependency set
271 * @param suggestedKeys filename or python object address
272 * @param adding dependency problem is from added package set?
274 void rpmdsProblem(rpmps ps, const char * pkgNEVR, const rpmds ds,
275 const fnpyKey * suggestedKeys,
279 * Compare package provides dependencies from header with a single dependency.
281 * @param req dependency set
282 * @param nopromote Don't promote Epoch: in comparison?
283 * @return 1 if any dependency overlaps, 0 otherwise
285 int rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote);
288 * Compare package name-version-release from header with a single dependency.
290 * @param req dependency set
291 * @param nopromote Don't promote Epoch: in comparison?
292 * @return 1 if dependency overlaps, 0 otherwise
294 int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote);