4 /** \ingroup rpmdep rpmtrans
6 * Structure used for handling a dependency set.
11 typedef /*@abstract@*/ struct rpmFNSet_s * rpmFNSet;
14 * A package filename set.
17 int i; /*!< File index. */
20 const char * Type; /*!< Tag name. */
22 rpmTag tagN; /*!< Header tag. */
23 /*@refcounted@*/ /*@null@*/
24 Header h; /*!< Header for file name set (or NULL) */
27 const char ** BN; /*!< File base name(s). */
29 const int_32 * DI; /*!< File directory index. */
31 const uint_32 * Flags; /*!< File flags. */
33 const char ** DN; /*!< Directory name(s). */
34 int_32 DCount; /*!< No. of directories. */
35 rpmTagType BNt, DIt, Ft, DNt; /*!< Tag data types. */
36 int_32 Count; /*!< No. of files. */
40 * A package dependency set.
43 int i; /*!< Element index. */
46 const char * Type; /*!< Tag name. */
48 const char * DNEVR; /*!< Formatted dependency string. */
50 rpmTag tagN; /*!< Header tag. */
51 /*@refcounted@*/ /*@null@*/
52 Header h; /*!< Header for dependency set (or NULL) */
55 const char ** N; /*!< Name. */
57 const char ** EVR; /*!< Epoch-Version-Release. */
59 const int_32 * Flags; /*!< Flags identifying context/comparison. */
60 rpmTagType Nt, EVRt, Ft; /*!< Tag data types. */
61 int_32 Count; /*!< No. of elements */
69 * Destroy a file name set.
70 * @param ds file name set
74 rpmFNSet fnsFree(/*@only@*/ /*@null@*/ rpmFNSet fns)
77 * Create and load a file name set.
79 * @param tagN RPMTAG_BASENAMES
80 * @param scareMem Use pointers to refcounted header memory?
81 * @return new file name set
84 rpmFNSet fnsNew(Header h, rpmTag tagN, int scareMem)
88 * Destroy a dependency set.
89 * @param ds dependency set
93 rpmDepSet dsFree(/*@only@*/ /*@null@*/ rpmDepSet ds)
96 * Create and load a dependency set.
98 * @param tagN type of dependency
99 * @param scareMem Use pointers to refcounted header memory?
100 * @return new dependency set
102 /*@only@*/ /*@null@*/
103 rpmDepSet dsNew(Header h, rpmTag tagN, int scareMem)
107 * Return new formatted dependency string.
108 * @param dspfx formatted dependency string prefix
109 * @param ds dependency set
110 * @return new formatted dependency (malloc'ed)
113 char * dsDNEVR(const char * dspfx, const rpmDepSet ds)
117 * Return dependency set count.
118 * @param ds dependency set
119 * @return current count
121 int dsiGetCount(/*@null@*/ rpmDepSet ds)
125 * Return dependency set index.
126 * @param ds dependency set
127 * @return current index
129 int dsiGetIx(/*@null@*/ rpmDepSet ds)
133 * Set dependency set index.
134 * @param ds dependency set
135 * @param ix new index
136 * @return current index
138 int dsiSetIx(/*@null@*/ rpmDepSet ds, int ix)
142 * Return current formatted dependency string.
143 * @param ds dependency set
144 * @return current dependency DNEVR, NULL on invalid
147 const char * dsiGetDNEVR(/*@null@*/ rpmDepSet ds)
151 * Return current dependency name.
152 * @param ds dependency set
153 * @return current dependency name, NULL on invalid
156 const char * dsiGetN(/*@null@*/ rpmDepSet ds)
160 * Return current dependency epoch-version-release.
161 * @param ds dependency set
162 * @return current dependency EVR, NULL on invalid
165 const char * dsiGetEVR(/*@null@*/ rpmDepSet ds)
169 * Return current dependency Flags.
170 * @param ds dependency set
171 * @return current dependency EVR, 0 on invalid
173 int_32 dsiGetFlags(/*@null@*/ rpmDepSet ds)
177 * Notify of results of dependency match;
178 * @param ds dependency set
179 * @param where where dependency was resolved (or NULL)
180 * @param rc 0 == YES, otherwise NO
182 /*@-globuse@*/ /* FIX: rpmMessage annotation is a lie */
183 void dsiNotify(/*@null@*/ rpmDepSet ds, /*@null@*/ const char * where, int rc)
184 /*@globals fileSystem @*/
185 /*@modifies fileSystem @*/;
189 * Return next dependency set iterator index.
190 * @param ds dependency set
191 * @return dependency set iterator index, -1 on termination
193 int dsiNext(/*@null@*/ rpmDepSet ds)
197 * Initialize dependency set iterator.
198 * @param ds dependency set
199 * @return dependency set
202 rpmDepSet dsiInit(/*@returned@*/ /*@null@*/ rpmDepSet ds)
206 * Compare two versioned dependency ranges, looking for overlap.
207 * @param A 1st dependency
208 * @param B 2nd dependency
209 * @return 1 if dependencies overlap, 0 otherwise
211 int dsCompare(const rpmDepSet A, const rpmDepSet B)
215 * Report a Requires: or Conflicts: dependency problem.
217 void dsProblem(/*@null@*/ rpmProblemSet tsprobs, Header h, const rpmDepSet ds,
218 /*@only@*/ /*@null@*/ const fnpyKey * suggestedKeys)
219 /*@modifies tsprobs, h @*/;
222 * Compare package provides dependencies from header with a single dependency.
224 * @param ds dependency set
226 int rangeMatchesDepFlags (Header h, const rpmDepSet req)
230 * Compare package name-version-release from header with a single dependency.
231 * @deprecated Remove from API when obsoletes is correctly implemented.
233 * @param req dependency
234 * @return 1 if dependency overlaps, 0 otherwise
236 int headerMatchesDepFlags(Header h, const rpmDepSet req)