4 /** \ingroup rpmdep rpmtrans
6 * Structure(s) used for dependency tag sets.
13 extern int _rpmds_debug;
16 #if defined(_RPMDS_INTERNAL)
18 * A package dependency set.
21 int i; /*!< Element index. */
24 const char * Type; /*!< Tag name. */
26 const char * DNEVR; /*!< Formatted dependency string. */
28 rpmTag tagN; /*!< Header tag. */
29 /*@refcounted@*/ /*@null@*/
30 Header h; /*!< Header for dependency set (or NULL) */
33 const char ** N; /*!< Name. */
35 const char ** EVR; /*!< Epoch-Version-Release. */
37 int_32 * Flags; /*!< Flags identifying context/comparison. */
38 rpmTagType Nt, EVRt, Ft; /*!< Tag data types. */
39 int_32 Count; /*!< No. of elements */
41 int nrefs; /*!< Reference count. */
43 #endif /* _RPMDS_INTERNAL */
50 * Unreference a dependency set instance.
51 * @param ds dependency set
55 /*@unused@*/ /*@null@*/
56 rpmds rpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds,
57 /*@null@*/ const char * msg)
60 /** @todo Remove debugging entry from the ABI. */
63 rpmds XrpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds,
64 /*@null@*/ const char * msg, const char * fn, unsigned ln)
67 #define rpmdsUnlink(_ds, _msg) XrpmdsUnlink(_ds, _msg, __FILE__, __LINE__)
70 * Reference a dependency set instance.
71 * @param ds dependency set
73 * @return new dependency set reference
75 /*@unused@*/ /*@newref@*/
76 rpmds rpmdsLink (/*@null@*/ rpmds ds, /*@null@*/ const char * msg)
79 /** @todo Remove debugging entry from the ABI. */
81 rpmds XrpmdsLink (/*@null@*/ rpmds ds, /*@null@*/ const char * msg,
82 const char * fn, unsigned ln)
84 #define rpmdsLink(_ds, _msg) XrpmdsLink(_ds, _msg, __FILE__, __LINE__)
87 * Destroy a dependency set.
88 * @param ds dependency set
92 rpmds rpmdsFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds)
95 * Create and load a dependency set.
97 * @param tagN type of dependency
98 * @param scareMem Use pointers to refcounted header memory?
99 * @return new dependency set
102 rpmds rpmdsNew(Header h, rpmTag tagN, int scareMem)
106 * Return new formatted dependency string.
107 * @param dspfx formatted dependency string prefix
108 * @param ds dependency set
109 * @return new formatted dependency (malloc'ed)
112 char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds)
116 * Create, load and initialize a dependency for this header.
118 * @param tagN type of dependency
119 * @param Flags comparison flags
120 * @return new dependency set
123 rpmds rpmdsThis(Header h, rpmTag tagN, int_32 Flags)
127 * Create, load and initialize a dependency set of size 1.
128 * @param tagN type of dependency
130 * @param EVR epoch:version-release
131 * @param Flags comparison flags
132 * @return new dependency set
135 rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * EVR, int_32 Flags)
139 * Return dependency set count.
140 * @param ds dependency set
141 * @return current count
143 int rpmdsCount(/*@null@*/ const rpmds ds)
147 * Return dependency set index.
148 * @param ds dependency set
149 * @return current index
151 int rpmdsIx(/*@null@*/ const rpmds ds)
155 * Set dependency set index.
156 * @param ds dependency set
157 * @param ix new index
158 * @return current index
160 int rpmdsSetIx(/*@null@*/ rpmds ds, int ix)
164 * Return current formatted dependency string.
165 * @param ds dependency set
166 * @return current dependency DNEVR, NULL on invalid
168 /*@observer@*/ /*@null@*/
169 extern const char * rpmdsDNEVR(/*@null@*/ const rpmds ds)
173 * Return current dependency name.
174 * @param ds dependency set
175 * @return current dependency name, NULL on invalid
177 /*@observer@*/ /*@null@*/
178 extern const char * rpmdsN(/*@null@*/ const rpmds ds)
182 * Return current dependency epoch-version-release.
183 * @param ds dependency set
184 * @return current dependency EVR, NULL on invalid
186 /*@observer@*/ /*@null@*/
187 extern const char * rpmdsEVR(/*@null@*/ const rpmds ds)
191 * Return current dependency flags.
192 * @param ds dependency set
193 * @return current dependency flags, 0 on invalid
195 int_32 rpmdsFlags(/*@null@*/ const rpmds ds)
199 * Return current dependency type.
200 * @param ds dependency set
201 * @return current dependency type, 0 on invalid
203 rpmTag rpmdsTagN(/*@null@*/ const rpmds ds)
207 * Notify of results of dependency match.
208 * @param ds dependency set
209 * @param where where dependency was resolved (or NULL)
210 * @param rc 0 == YES, otherwise NO
212 /*@-globuse@*/ /* FIX: rpmMessage annotation is a lie */
213 void rpmdsNotify(/*@null@*/ rpmds ds, /*@null@*/ const char * where, int rc)
214 /*@globals fileSystem @*/
215 /*@modifies fileSystem @*/;
219 * Return next dependency set iterator index.
220 * @param ds dependency set
221 * @return dependency set iterator index, -1 on termination
223 int rpmdsNext(/*@null@*/ rpmds ds)
227 * Initialize dependency set iterator.
228 * @param ds dependency set
229 * @return dependency set
232 rpmds rpmdsInit(/*@null@*/ rpmds ds)
236 * Compare two versioned dependency ranges, looking for overlap.
237 * @param A 1st dependency
238 * @param B 2nd dependency
239 * @return 1 if dependencies overlap, 0 otherwise
241 int rpmdsCompare(const rpmds A, const rpmds B)
245 * Report a Requires: or Conflicts: dependency problem.
246 * @param ps transaction set problems
247 * @param pkgNEVR package name/epoch/version/release
248 * @param ds dependency set
249 * @param suggestedKeys filename or python object address
250 * @param adding dependency problem is from added package set?
252 void rpmdsProblem(/*@null@*/ rpmps ps, const char * pkgNEVR, const rpmds ds,
253 /*@only@*/ /*@null@*/ const fnpyKey * suggestedKeys,
258 * Compare package provides dependencies from header with a single dependency.
260 * @param req dependency set
262 int rangeMatchesDepFlags (Header h, const rpmds req)
266 * Compare package name-version-release from header with a single dependency.
267 * @deprecated Remove from API when obsoletes is correctly implemented.
269 * @param req dependency
270 * @return 1 if dependency overlaps, 0 otherwise
272 int headerMatchesDepFlags(const Header h, const rpmds req)