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
44 /*@unused@*/ /*@null@*/
45 rpmDepSet rpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmDepSet ds,
46 /*@null@*/ const char * msg)
49 /** @todo Remove debugging entry from the ABI. */
52 rpmDepSet XrpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmDepSet ds,
53 /*@null@*/ const char * msg, const char * fn, unsigned ln)
56 #define rpmdsUnlink(_ds, _msg) XrpmdsUnlink(_ds, _msg, __FILE__, __LINE__)
59 * Reference a dependency set instance.
60 * @param ds dependency set
61 * @return new dependency set reference
64 rpmDepSet rpmdsLink (/*@null@*/ rpmDepSet ds, /*@null@*/ const char * msg)
67 /** @todo Remove debugging entry from the ABI. */
68 rpmDepSet XrpmdsLink (/*@null@*/ rpmDepSet ds, /*@null@*/ const char * msg,
69 const char * fn, unsigned ln)
71 #define rpmdsLink(_ds, _msg) XrpmdsLink(_ds, _msg, __FILE__, __LINE__)
74 * Destroy a dependency set.
75 * @param ds dependency set
79 rpmDepSet dsFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmDepSet ds)
82 * Create and load a dependency set.
84 * @param tagN type of dependency
85 * @param scareMem Use pointers to refcounted header memory?
86 * @return new dependency set
89 rpmDepSet dsNew(Header h, rpmTag tagN, int scareMem)
93 * Return new formatted dependency string.
94 * @param dspfx formatted dependency string prefix
95 * @param ds dependency set
96 * @return new formatted dependency (malloc'ed)
99 char * dsDNEVR(const char * dspfx, const rpmDepSet ds)
103 * Create, load and initialize a dependency for this header.
105 * @param tagN type of dependency
106 * @param Flags comparison flags
107 * @return new dependency set
110 rpmDepSet dsThis(Header h, rpmTag tagN, int_32 Flags)
114 * Create, load and initialize a dependency set of size 1.
115 * @param tagN type of dependency
117 * @param EVR epoch:version-release
118 * @param Flags comparison flags
119 * @return new dependency set
122 rpmDepSet dsSingle(rpmTag tagN, const char * N, const char * EVR, int_32 Flags)
126 * Return dependency set count.
127 * @param ds dependency set
128 * @return current count
130 int dsiGetCount(/*@null@*/ rpmDepSet ds)
134 * Return dependency set index.
135 * @param ds dependency set
136 * @return current index
138 int dsiGetIx(/*@null@*/ rpmDepSet ds)
142 * Set dependency set index.
143 * @param ds dependency set
144 * @param ix new index
145 * @return current index
147 int dsiSetIx(/*@null@*/ rpmDepSet ds, int ix)
151 * Return current formatted dependency string.
152 * @param ds dependency set
153 * @return current dependency DNEVR, NULL on invalid
156 const char * dsiGetDNEVR(/*@null@*/ rpmDepSet ds)
160 * Return current dependency name.
161 * @param ds dependency set
162 * @return current dependency name, NULL on invalid
165 const char * dsiGetN(/*@null@*/ rpmDepSet ds)
169 * Return current dependency epoch-version-release.
170 * @param ds dependency set
171 * @return current dependency EVR, NULL on invalid
174 const char * dsiGetEVR(/*@null@*/ rpmDepSet ds)
178 * Return current dependency flags.
179 * @param ds dependency set
180 * @return current dependency flags, 0 on invalid
182 int_32 dsiGetFlags(/*@null@*/ rpmDepSet ds)
186 * Notify of results of dependency match.
187 * @param ds dependency set
188 * @param where where dependency was resolved (or NULL)
189 * @param rc 0 == YES, otherwise NO
191 /*@-globuse@*/ /* FIX: rpmMessage annotation is a lie */
192 void dsiNotify(/*@null@*/ rpmDepSet ds, /*@null@*/ const char * where, int rc)
193 /*@globals fileSystem @*/
194 /*@modifies fileSystem @*/;
198 * Return next dependency set iterator index.
199 * @param ds dependency set
200 * @return dependency set iterator index, -1 on termination
202 int dsiNext(/*@null@*/ rpmDepSet ds)
206 * Initialize dependency set iterator.
207 * @param ds dependency set
208 * @return dependency set
211 rpmDepSet dsiInit(/*@null@*/ rpmDepSet ds)
215 * Compare two versioned dependency ranges, looking for overlap.
216 * @param A 1st dependency
217 * @param B 2nd dependency
218 * @return 1 if dependencies overlap, 0 otherwise
220 int dsCompare(const rpmDepSet A, const rpmDepSet B)
224 * Report a Requires: or Conflicts: dependency problem.
226 void dsProblem(/*@null@*/ rpmProblemSet tsprobs,
227 const char * pkgNEVR, const rpmDepSet ds,
228 /*@only@*/ /*@null@*/ const fnpyKey * suggestedKeys)
229 /*@modifies tsprobs @*/;
232 * Compare package provides dependencies from header with a single dependency.
234 * @param ds dependency set
236 int rangeMatchesDepFlags (Header h, const rpmDepSet req)
240 * Compare package name-version-release from header with a single dependency.
241 * @deprecated Remove from API when obsoletes is correctly implemented.
243 * @param req dependency
244 * @return 1 if dependency overlaps, 0 otherwise
246 int headerMatchesDepFlags(const Header h, const rpmDepSet req)