4 /** \ingroup rpmdep rpmtrans
6 * Structure used for handling a dependency set.
10 * A package filename set.
13 int i; /*!< File index. */
16 const char * Type; /*!< Tag name. */
18 rpmTag tagN; /*!< Header tag. */
19 /*@refcounted@*/ /*@null@*/
20 Header h; /*!< Header for file name set (or NULL) */
23 const char ** bnl; /*!< Base name(s) (from header) */
25 const char ** dnl; /*!< Directory name(s) (from header) */
28 const char ** fmd5s; /*!< File MD5 sum(s) (from header) */
30 const char ** flinks; /*!< File link(s) (from header) */
32 const char ** flangs; /*!< File lang(s) */
35 const uint_32 * dil; /*!< Directory indice(s) (from header) */
37 const uint_32 * fflags; /*!< File flag(s) (from header) */
39 const uint_32 * fsizes; /*!< File size(s) (from header) */
41 const uint_32 * fmtimes; /*!< File modification time(s) (from header) */
43 const uint_16 * fmodes; /*!< File mode(s) (from header) */
45 const uint_16 * frdevs; /*!< File rdev(s) (from header) */
48 const char ** fuser; /*!< File owner(s) */
50 const char ** fgroup; /*!< File group(s) */
52 uid_t * fuids; /*!< File uid(s) */
54 gid_t * fgids; /*!< File gid(s) */
57 char * fstates; /*!< File state(s) (from header) */
59 int_32 dc; /*!< No. of directories. */
60 int_32 fc; /*!< No. of files. */
61 /*@refs@*/ int nrefs; /*!< Reference count. */
65 * A package dependency set.
68 int i; /*!< Element index. */
71 const char * Type; /*!< Tag name. */
73 const char * DNEVR; /*!< Formatted dependency string. */
75 rpmTag tagN; /*!< Header tag. */
76 /*@refcounted@*/ /*@null@*/
77 Header h; /*!< Header for dependency set (or NULL) */
80 const char ** N; /*!< Name. */
82 const char ** EVR; /*!< Epoch-Version-Release. */
84 const int_32 * Flags; /*!< Flags identifying context/comparison. */
85 rpmTagType Nt, EVRt, Ft; /*!< Tag data types. */
86 int_32 Count; /*!< No. of elements */
87 /*@refs@*/ int nrefs; /*!< Reference count. */
95 * Unreference a file info set instance.
96 * @param fns file info set
99 /*@unused@*/ /*@null@*/
100 rpmFNSet rpmfnsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmFNSet fns,
104 /** @todo Remove debugging entry from the ABI. */
107 rpmFNSet XrpmfnsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmFNSet fns,
108 const char * msg, const char * fn, unsigned ln)
111 #define rpmfnsUnlink(_fns, _msg) XrpmfnsUnlink(_fns, _msg, __FILE__, __LINE__)
114 * Reference a file info set instance.
115 * @param fns file info set
116 * @return new file info set reference
119 rpmFNSet rpmfnsLink (/*@null@*/ rpmFNSet fns, const char * msg)
122 /** @todo Remove debugging entry from the ABI. */
123 rpmFNSet XrpmfnsLink (/*@null@*/ rpmFNSet fns, const char * msg,
124 const char * fn, unsigned ln)
126 #define rpmfnsLink(_fns, _msg) XrpmfnsLink(_fns, _msg, __FILE__, __LINE__)
129 * Destroy a file name set.
130 * @param ds file name set
131 * @return NULL always
134 rpmFNSet fnsFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmFNSet fns)
138 * Create and load a file name set.
140 * @param tagN RPMTAG_BASENAMES
141 * @param scareMem Use pointers to refcounted header memory?
142 * @return new file name set
145 rpmFNSet fnsNew(Header h, rpmTag tagN, int scareMem)
149 * Unreference a dependency set instance.
150 * @param ds dependency set
151 * @return NULL always
153 /*@unused@*/ /*@null@*/
154 rpmDepSet rpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmDepSet ds,
158 /** @todo Remove debugging entry from the ABI. */
161 rpmDepSet XrpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmDepSet ds,
162 const char * msg, const char * fn, unsigned ln)
165 #define rpmdsUnlink(_ds, _msg) XrpmdsUnlink(_ds, _msg, __FILE__, __LINE__)
168 * Reference a dependency set instance.
169 * @param ds dependency set
170 * @return new dependency set reference
173 rpmDepSet rpmdsLink (/*@null@*/ rpmDepSet ds, const char * msg)
176 /** @todo Remove debugging entry from the ABI. */
177 rpmDepSet XrpmdsLink (/*@null@*/ rpmDepSet ds, const char * msg,
178 const char * fn, unsigned ln)
180 #define rpmdsLink(_ds, _msg) XrpmdsLink(_ds, _msg, __FILE__, __LINE__)
183 * Destroy a dependency set.
184 * @param ds dependency set
185 * @return NULL always
188 rpmDepSet dsFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmDepSet ds)
191 * Create and load a dependency set.
193 * @param tagN type of dependency
194 * @param scareMem Use pointers to refcounted header memory?
195 * @return new dependency set
198 rpmDepSet dsNew(Header h, rpmTag tagN, int scareMem)
202 * Return new formatted dependency string.
203 * @param dspfx formatted dependency string prefix
204 * @param ds dependency set
205 * @return new formatted dependency (malloc'ed)
208 char * dsDNEVR(const char * dspfx, const rpmDepSet ds)
212 * Return dependency set count.
213 * @param ds dependency set
214 * @return current count
216 int dsiGetCount(/*@null@*/ rpmDepSet ds)
220 * Return dependency set index.
221 * @param ds dependency set
222 * @return current index
224 int dsiGetIx(/*@null@*/ rpmDepSet ds)
228 * Set dependency set index.
229 * @param ds dependency set
230 * @param ix new index
231 * @return current index
233 int dsiSetIx(/*@null@*/ rpmDepSet ds, int ix)
237 * Return current formatted dependency string.
238 * @param ds dependency set
239 * @return current dependency DNEVR, NULL on invalid
242 const char * dsiGetDNEVR(/*@null@*/ rpmDepSet ds)
246 * Return current dependency name.
247 * @param ds dependency set
248 * @return current dependency name, NULL on invalid
251 const char * dsiGetN(/*@null@*/ rpmDepSet ds)
255 * Return current dependency epoch-version-release.
256 * @param ds dependency set
257 * @return current dependency EVR, NULL on invalid
260 const char * dsiGetEVR(/*@null@*/ rpmDepSet ds)
264 * Return current dependency Flags.
265 * @param ds dependency set
266 * @return current dependency EVR, 0 on invalid
268 int_32 dsiGetFlags(/*@null@*/ rpmDepSet ds)
272 * Notify of results of dependency match;
273 * @param ds dependency set
274 * @param where where dependency was resolved (or NULL)
275 * @param rc 0 == YES, otherwise NO
277 /*@-globuse@*/ /* FIX: rpmMessage annotation is a lie */
278 void dsiNotify(/*@null@*/ rpmDepSet ds, /*@null@*/ const char * where, int rc)
279 /*@globals fileSystem @*/
280 /*@modifies fileSystem @*/;
284 * Return next dependency set iterator index.
285 * @param ds dependency set
286 * @return dependency set iterator index, -1 on termination
288 int dsiNext(/*@null@*/ rpmDepSet ds)
292 * Initialize dependency set iterator.
293 * @param ds dependency set
294 * @return dependency set
297 rpmDepSet dsiInit(/*@returned@*/ /*@null@*/ rpmDepSet ds)
301 * Compare two versioned dependency ranges, looking for overlap.
302 * @param A 1st dependency
303 * @param B 2nd dependency
304 * @return 1 if dependencies overlap, 0 otherwise
306 int dsCompare(const rpmDepSet A, const rpmDepSet B)
310 * Report a Requires: or Conflicts: dependency problem.
312 void dsProblem(/*@null@*/ rpmProblemSet tsprobs, Header h, const rpmDepSet ds,
313 /*@only@*/ /*@null@*/ const fnpyKey * suggestedKeys)
314 /*@modifies tsprobs, h @*/;
317 * Compare package provides dependencies from header with a single dependency.
319 * @param ds dependency set
321 int rangeMatchesDepFlags (Header h, const rpmDepSet req)
325 * Compare package name-version-release from header with a single dependency.
326 * @deprecated Remove from API when obsoletes is correctly implemented.
328 * @param req dependency
329 * @return 1 if dependency overlaps, 0 otherwise
331 int headerMatchesDepFlags(Header h, const rpmDepSet req)