4 /** \ingroup rpmdep rpmtrans
6 * Structure(s) used for dependency tag sets.
10 * A package dependency set.
13 int i; /*!< Element index. */
16 const char * Type; /*!< Tag name. */
18 const char * DNEVR; /*!< Formatted dependency string. */
20 rpmTag tagN; /*!< Header tag. */
21 /*@refcounted@*/ /*@null@*/
22 Header h; /*!< Header for dependency set (or NULL) */
25 const char ** N; /*!< Name. */
27 const char ** EVR; /*!< Epoch-Version-Release. */
29 int_32 * Flags; /*!< Flags identifying context/comparison. */
30 rpmTagType Nt, EVRt, Ft; /*!< Tag data types. */
31 int_32 Count; /*!< No. of elements */
32 /*@refs@*/ int nrefs; /*!< Reference count. */
40 * Unreference a dependency set instance.
41 * @param ds dependency set
45 /*@unused@*/ /*@null@*/
46 rpmds rpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds,
47 /*@null@*/ const char * msg)
50 /** @todo Remove debugging entry from the ABI. */
53 rpmds XrpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds,
54 /*@null@*/ const char * msg, const char * fn, unsigned ln)
57 #define rpmdsUnlink(_ds, _msg) XrpmdsUnlink(_ds, _msg, __FILE__, __LINE__)
60 * Reference a dependency set instance.
61 * @param ds dependency set
63 * @return new dependency set reference
66 rpmds rpmdsLink (/*@null@*/ rpmds ds, /*@null@*/ const char * msg)
69 /** @todo Remove debugging entry from the ABI. */
70 rpmds XrpmdsLink (/*@null@*/ rpmds ds, /*@null@*/ const char * msg,
71 const char * fn, unsigned ln)
73 #define rpmdsLink(_ds, _msg) XrpmdsLink(_ds, _msg, __FILE__, __LINE__)
76 * Destroy a dependency set.
77 * @param ds dependency set
81 rpmds rpmdsFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds)
84 * Create and load a dependency set.
86 * @param tagN type of dependency
87 * @param scareMem Use pointers to refcounted header memory?
88 * @return new dependency set
91 rpmds rpmdsNew(Header h, rpmTag tagN, int scareMem)
95 * Return new formatted dependency string.
96 * @param dspfx formatted dependency string prefix
97 * @param ds dependency set
98 * @return new formatted dependency (malloc'ed)
101 char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds)
105 * Create, load and initialize a dependency for this header.
107 * @param tagN type of dependency
108 * @param Flags comparison flags
109 * @return new dependency set
112 rpmds rpmdsThis(Header h, rpmTag tagN, int_32 Flags)
116 * Create, load and initialize a dependency set of size 1.
117 * @param tagN type of dependency
119 * @param EVR epoch:version-release
120 * @param Flags comparison flags
121 * @return new dependency set
124 rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * EVR, int_32 Flags)
128 * Return dependency set count.
129 * @param ds dependency set
130 * @return current count
132 int rpmdsCount(/*@null@*/ const rpmds ds)
136 * Return dependency set index.
137 * @param ds dependency set
138 * @return current index
140 int rpmdsIx(/*@null@*/ const rpmds ds)
144 * Set dependency set index.
145 * @param ds dependency set
146 * @param ix new index
147 * @return current index
149 int rpmdsSetIx(/*@null@*/ rpmds ds, int ix)
153 * Return current formatted dependency string.
154 * @param ds dependency set
155 * @return current dependency DNEVR, NULL on invalid
157 /*@observer@*/ /*@null@*/
158 const char * rpmdsDNEVR(/*@null@*/ const rpmds ds)
162 * Return current dependency name.
163 * @param ds dependency set
164 * @return current dependency name, NULL on invalid
166 /*@observer@*/ /*@null@*/
167 const char * rpmdsN(/*@null@*/ const rpmds ds)
171 * Return current dependency epoch-version-release.
172 * @param ds dependency set
173 * @return current dependency EVR, NULL on invalid
175 /*@observer@*/ /*@null@*/
176 const char * rpmdsEVR(/*@null@*/ const rpmds ds)
180 * Return current dependency flags.
181 * @param ds dependency set
182 * @return current dependency flags, 0 on invalid
184 int_32 rpmdsFlags(/*@null@*/ const rpmds ds)
188 * Return current dependency type.
189 * @param ds dependency set
190 * @return current dependency type, 0 on invalid
192 rpmTag rpmdsTagN(/*@null@*/ const rpmds ds)
196 * Notify of results of dependency match.
197 * @param ds dependency set
198 * @param where where dependency was resolved (or NULL)
199 * @param rc 0 == YES, otherwise NO
201 /*@-globuse@*/ /* FIX: rpmMessage annotation is a lie */
202 void rpmdsNotify(/*@null@*/ rpmds ds, /*@null@*/ const char * where, int rc)
203 /*@globals fileSystem @*/
204 /*@modifies fileSystem @*/;
208 * Return next dependency set iterator index.
209 * @param ds dependency set
210 * @return dependency set iterator index, -1 on termination
212 int rpmdsNext(/*@null@*/ rpmds ds)
216 * Initialize dependency set iterator.
217 * @param ds dependency set
218 * @return dependency set
221 rpmds rpmdsInit(/*@null@*/ rpmds ds)
225 * Compare two versioned dependency ranges, looking for overlap.
226 * @param A 1st dependency
227 * @param B 2nd dependency
228 * @return 1 if dependencies overlap, 0 otherwise
230 int rpmdsCompare(const rpmds A, const rpmds B)
234 * Report a Requires: or Conflicts: dependency problem.
235 * @param ps transaction set problems
236 * @param pkgNEVR package name/epoch/version/release
237 * @param ds dependency set
238 * @param suggestedKeys
240 void rpmdsProblem(/*@null@*/ rpmps ps, const char * pkgNEVR, const rpmds ds,
241 /*@only@*/ /*@null@*/ const fnpyKey * suggestedKeys)
245 * Compare package provides dependencies from header with a single dependency.
247 * @param req dependency set
249 int rangeMatchesDepFlags (Header h, const rpmds req)
253 * Compare package name-version-release from header with a single dependency.
254 * @deprecated Remove from API when obsoletes is correctly implemented.
256 * @param req dependency
257 * @return 1 if dependency overlaps, 0 otherwise
259 int headerMatchesDepFlags(const Header h, const rpmds req)