4 /** \ingroup rpmdep rpmtrans
6 * Structure(s) used for dependency tag sets.
9 #if defined(_RPMDS_INTERNAL)
11 * A package dependency set.
14 int i; /*!< Element index. */
17 const char * Type; /*!< Tag name. */
19 const char * DNEVR; /*!< Formatted dependency string. */
21 rpmTag tagN; /*!< Header tag. */
22 /*@refcounted@*/ /*@null@*/
23 Header h; /*!< Header for dependency set (or NULL) */
26 const char ** N; /*!< Name. */
28 const char ** EVR; /*!< Epoch-Version-Release. */
30 int_32 * Flags; /*!< Flags identifying context/comparison. */
31 rpmTagType Nt, EVRt, Ft; /*!< Tag data types. */
32 int_32 Count; /*!< No. of elements */
33 /*@refs@*/ int nrefs; /*!< Reference count. */
35 #endif /* _RPMDS_INTERNAL */
42 * Unreference a dependency set instance.
43 * @param ds dependency set
47 /*@unused@*/ /*@null@*/
48 rpmds rpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds,
49 /*@null@*/ const char * msg)
52 /** @todo Remove debugging entry from the ABI. */
55 rpmds XrpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds,
56 /*@null@*/ const char * msg, const char * fn, unsigned ln)
59 #define rpmdsUnlink(_ds, _msg) XrpmdsUnlink(_ds, _msg, __FILE__, __LINE__)
62 * Reference a dependency set instance.
63 * @param ds dependency set
65 * @return new dependency set reference
68 rpmds rpmdsLink (/*@null@*/ rpmds ds, /*@null@*/ const char * msg)
71 /** @todo Remove debugging entry from the ABI. */
72 rpmds XrpmdsLink (/*@null@*/ rpmds ds, /*@null@*/ const char * msg,
73 const char * fn, unsigned ln)
75 #define rpmdsLink(_ds, _msg) XrpmdsLink(_ds, _msg, __FILE__, __LINE__)
78 * Destroy a dependency set.
79 * @param ds dependency set
83 rpmds rpmdsFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds)
86 * Create and load a dependency set.
88 * @param tagN type of dependency
89 * @param scareMem Use pointers to refcounted header memory?
90 * @return new dependency set
93 rpmds rpmdsNew(Header h, rpmTag tagN, int scareMem)
97 * Return new formatted dependency string.
98 * @param dspfx formatted dependency string prefix
99 * @param ds dependency set
100 * @return new formatted dependency (malloc'ed)
103 char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds)
107 * Create, load and initialize a dependency for this header.
109 * @param tagN type of dependency
110 * @param Flags comparison flags
111 * @return new dependency set
114 rpmds rpmdsThis(Header h, rpmTag tagN, int_32 Flags)
118 * Create, load and initialize a dependency set of size 1.
119 * @param tagN type of dependency
121 * @param EVR epoch:version-release
122 * @param Flags comparison flags
123 * @return new dependency set
126 rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * EVR, int_32 Flags)
130 * Return dependency set count.
131 * @param ds dependency set
132 * @return current count
134 int rpmdsCount(/*@null@*/ const rpmds ds)
138 * Return dependency set index.
139 * @param ds dependency set
140 * @return current index
142 int rpmdsIx(/*@null@*/ const rpmds ds)
146 * Set dependency set index.
147 * @param ds dependency set
148 * @param ix new index
149 * @return current index
151 int rpmdsSetIx(/*@null@*/ rpmds ds, int ix)
155 * Return current formatted dependency string.
156 * @param ds dependency set
157 * @return current dependency DNEVR, NULL on invalid
159 /*@observer@*/ /*@null@*/
160 const char * rpmdsDNEVR(/*@null@*/ const rpmds ds)
164 * Return current dependency name.
165 * @param ds dependency set
166 * @return current dependency name, NULL on invalid
168 /*@observer@*/ /*@null@*/
169 const char * rpmdsN(/*@null@*/ const rpmds ds)
173 * Return current dependency epoch-version-release.
174 * @param ds dependency set
175 * @return current dependency EVR, NULL on invalid
177 /*@observer@*/ /*@null@*/
178 const char * rpmdsEVR(/*@null@*/ const rpmds ds)
182 * Return current dependency flags.
183 * @param ds dependency set
184 * @return current dependency flags, 0 on invalid
186 int_32 rpmdsFlags(/*@null@*/ const rpmds ds)
190 * Return current dependency type.
191 * @param ds dependency set
192 * @return current dependency type, 0 on invalid
194 rpmTag rpmdsTagN(/*@null@*/ const rpmds ds)
198 * Notify of results of dependency match.
199 * @param ds dependency set
200 * @param where where dependency was resolved (or NULL)
201 * @param rc 0 == YES, otherwise NO
203 /*@-globuse@*/ /* FIX: rpmMessage annotation is a lie */
204 void rpmdsNotify(/*@null@*/ rpmds ds, /*@null@*/ const char * where, int rc)
205 /*@globals fileSystem @*/
206 /*@modifies fileSystem @*/;
210 * Return next dependency set iterator index.
211 * @param ds dependency set
212 * @return dependency set iterator index, -1 on termination
214 int rpmdsNext(/*@null@*/ rpmds ds)
218 * Initialize dependency set iterator.
219 * @param ds dependency set
220 * @return dependency set
223 rpmds rpmdsInit(/*@null@*/ rpmds ds)
227 * Compare two versioned dependency ranges, looking for overlap.
228 * @param A 1st dependency
229 * @param B 2nd dependency
230 * @return 1 if dependencies overlap, 0 otherwise
232 int rpmdsCompare(const rpmds A, const rpmds B)
236 * Report a Requires: or Conflicts: dependency problem.
237 * @param ps transaction set problems
238 * @param pkgNEVR package name/epoch/version/release
239 * @param ds dependency set
240 * @param suggestedKeys
242 void rpmdsProblem(/*@null@*/ rpmps ps, const char * pkgNEVR, const rpmds ds,
243 /*@only@*/ /*@null@*/ const fnpyKey * suggestedKeys)
247 * Compare package provides dependencies from header with a single dependency.
249 * @param req dependency set
251 int rangeMatchesDepFlags (Header h, const rpmds req)
255 * Compare package name-version-release from header with a single dependency.
256 * @deprecated Remove from API when obsoletes is correctly implemented.
258 * @param req dependency
259 * @return 1 if dependency overlaps, 0 otherwise
261 int headerMatchesDepFlags(const Header h, const rpmds req)