4 /** \ingroup rpmdep rpmtrans
6 * Structure(s) used for dependency tag sets.
15 extern int _rpmds_debug;
18 #if defined(_RPMDS_INTERNAL)
20 * A package dependency set.
23 int i; /*!< Element index. */
26 const char * Type; /*!< Tag name. */
28 const char * DNEVR; /*!< Formatted dependency string. */
30 rpmTag tagN; /*!< Header tag. */
31 /*@refcounted@*/ /*@null@*/
32 Header h; /*!< Header for dependency set (or NULL) */
35 const char ** N; /*!< Name. */
37 const char ** EVR; /*!< Epoch-Version-Release. */
39 int_32 * Flags; /*!< Flags identifying context/comparison. */
40 rpmTagType Nt, EVRt, Ft; /*!< Tag data types. */
41 int_32 Count; /*!< No. of elements */
43 int nrefs; /*!< Reference count. */
45 #endif /* _RPMDS_INTERNAL */
52 * Unreference a dependency set instance.
53 * @param ds dependency set
57 /*@unused@*/ /*@null@*/
58 rpmds rpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds,
59 /*@null@*/ const char * msg)
62 /** @todo Remove debugging entry from the ABI. */
65 rpmds XrpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds,
66 /*@null@*/ const char * msg, const char * fn, unsigned ln)
69 #define rpmdsUnlink(_ds, _msg) XrpmdsUnlink(_ds, _msg, __FILE__, __LINE__)
72 * Reference a dependency set instance.
73 * @param ds dependency set
75 * @return new dependency set reference
77 /*@unused@*/ /*@newref@*/
78 rpmds rpmdsLink (/*@null@*/ rpmds ds, /*@null@*/ const char * msg)
81 /** @todo Remove debugging entry from the ABI. */
83 rpmds XrpmdsLink (/*@null@*/ rpmds ds, /*@null@*/ const char * msg,
84 const char * fn, unsigned ln)
86 #define rpmdsLink(_ds, _msg) XrpmdsLink(_ds, _msg, __FILE__, __LINE__)
89 * Destroy a dependency set.
90 * @param ds dependency set
94 rpmds rpmdsFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds)
97 * Create and load a dependency set.
99 * @param tagN type of dependency
100 * @param scareMem Use pointers to refcounted header memory?
101 * @return new dependency set
104 rpmds rpmdsNew(Header h, rpmTag tagN, int scareMem)
108 * Return new formatted dependency string.
109 * @param dspfx formatted dependency string prefix
110 * @param ds dependency set
111 * @return new formatted dependency (malloc'ed)
114 char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds)
118 * Create, load and initialize a dependency for this header.
120 * @param tagN type of dependency
121 * @param Flags comparison flags
122 * @return new dependency set
125 rpmds rpmdsThis(Header h, rpmTag tagN, int_32 Flags)
129 * Create, load and initialize a dependency set of size 1.
130 * @param tagN type of dependency
132 * @param EVR epoch:version-release
133 * @param Flags comparison flags
134 * @return new dependency set
137 rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * EVR, int_32 Flags)
141 * Return dependency set count.
142 * @param ds dependency set
143 * @return current count
145 int rpmdsCount(/*@null@*/ const rpmds ds)
149 * Return dependency set index.
150 * @param ds dependency set
151 * @return current index
153 int rpmdsIx(/*@null@*/ const rpmds ds)
157 * Set dependency set index.
158 * @param ds dependency set
159 * @param ix new index
160 * @return current index
162 int rpmdsSetIx(/*@null@*/ rpmds ds, int ix)
166 * Return current formatted dependency string.
167 * @param ds dependency set
168 * @return current dependency DNEVR, NULL on invalid
170 /*@observer@*/ /*@null@*/
171 extern const char * rpmdsDNEVR(/*@null@*/ const rpmds ds)
175 * Return current dependency name.
176 * @param ds dependency set
177 * @return current dependency name, NULL on invalid
179 /*@observer@*/ /*@null@*/
180 extern const char * rpmdsN(/*@null@*/ const rpmds ds)
184 * Return current dependency epoch-version-release.
185 * @param ds dependency set
186 * @return current dependency EVR, NULL on invalid
188 /*@observer@*/ /*@null@*/
189 extern const char * rpmdsEVR(/*@null@*/ const rpmds ds)
193 * Return current dependency flags.
194 * @param ds dependency set
195 * @return current dependency flags, 0 on invalid
197 int_32 rpmdsFlags(/*@null@*/ const rpmds ds)
201 * Return current dependency type.
202 * @param ds dependency set
203 * @return current dependency type, 0 on invalid
205 rpmTag rpmdsTagN(/*@null@*/ const rpmds ds)
209 * Notify of results of dependency match.
210 * @param ds dependency set
211 * @param where where dependency was resolved (or NULL)
212 * @param rc 0 == YES, otherwise NO
214 /*@-globuse@*/ /* FIX: rpmMessage annotation is a lie */
215 void rpmdsNotify(/*@null@*/ rpmds ds, /*@null@*/ const char * where, int rc)
216 /*@globals fileSystem @*/
217 /*@modifies fileSystem @*/;
221 * Return next dependency set iterator index.
222 * @param ds dependency set
223 * @return dependency set iterator index, -1 on termination
225 int rpmdsNext(/*@null@*/ rpmds ds)
229 * Initialize dependency set iterator.
230 * @param ds dependency set
231 * @return dependency set
234 rpmds rpmdsInit(/*@null@*/ rpmds ds)
238 * Compare two versioned dependency ranges, looking for overlap.
239 * @param A 1st dependency
240 * @param B 2nd dependency
241 * @return 1 if dependencies overlap, 0 otherwise
243 int rpmdsCompare(const rpmds A, const rpmds B)
247 * Report a Requires: or Conflicts: dependency problem.
248 * @param ps transaction set problems
249 * @param pkgNEVR package name/epoch/version/release
250 * @param ds dependency set
251 * @param suggestedKeys filename or python object address
252 * @param adding dependency problem is from added package set?
254 void rpmdsProblem(/*@null@*/ rpmps ps, const char * pkgNEVR, const rpmds ds,
255 /*@only@*/ /*@null@*/ const fnpyKey * suggestedKeys,
260 * Compare package provides dependencies from header with a single dependency.
262 * @param req dependency set
264 int rangeMatchesDepFlags (Header h, const rpmds req)
268 * Compare package name-version-release from header with a single dependency.
269 * @deprecated Remove from API when obsoletes is correctly implemented.
271 * @param req dependency
272 * @return 1 if dependency overlaps, 0 otherwise
274 int headerMatchesDepFlags(const Header h, const rpmds req)