rpm 5.2.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

rpmfi.h
Go to the documentation of this file.
1 #ifndef H_RPMFI
2 #define H_RPMFI
3
9 /*@-exportlocal@*/
10 /*@unchecked@*/
11 extern int _rpmfi_debug;
12 /*@=exportlocal@*/
13
21 typedef enum rpmFileTypes_e {
22 PIPE = 1,
23 CDEV = 2,
24 XDIR = 4,
25 BDEV = 6,
26 REG = 8,
27 LINK = 10,
28 SOCK = 12
29 } rpmFileTypes;
30
34 typedef enum rpmfileState_e {
35 RPMFILE_STATE_NORMAL = 0,
36 RPMFILE_STATE_REPLACED = 1,
37 RPMFILE_STATE_NOTINSTALLED = 2,
38 RPMFILE_STATE_NETSHARED = 3,
39 RPMFILE_STATE_WRONGCOLOR = 4
40 } rpmfileState;
41 #define RPMFILE_STATE_MISSING -1 /* XXX used for unavailable data */
42
46 typedef enum rpmfileAttrs_e {
47 /*@-enummemuse@*/
48 RPMFILE_NONE = 0,
49 /*@=enummemuse@*/
50 RPMFILE_CONFIG = (1 << 0),
51 RPMFILE_DOC = (1 << 1),
52 RPMFILE_ICON = (1 << 2),
53 RPMFILE_MISSINGOK = (1 << 3),
54 RPMFILE_NOREPLACE = (1 << 4),
55 RPMFILE_SPECFILE = (1 << 5),
56 RPMFILE_GHOST = (1 << 6),
57 RPMFILE_LICENSE = (1 << 7),
58 RPMFILE_README = (1 << 8),
59 RPMFILE_EXCLUDE = (1 << 9),
60 RPMFILE_UNPATCHED = (1 << 10),
61 RPMFILE_PUBKEY = (1 << 11),
62 RPMFILE_POLICY = (1 << 12),
63 RPMFILE_EXISTS = (1 << 13),
64 RPMFILE_SPARSE = (1 << 14),
65 RPMFILE_TYPED = (1 << 15),
66 RPMFILE_SOURCE = (1 << 16),
67 RPMFILE_PATCH = (1 << 17),
68 RPMFILE_OPTIONAL = (1 << 18),
69 RPMFILE_REMOVE = (1 << 19)
70 } rpmfileAttrs;
71
72 #define RPMFILE_SPOOK (RPMFILE_GHOST|RPMFILE_TYPED)
73 #define RPMFILE_ALL ~(RPMFILE_NONE)
74
78 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmfi_s * rpmfi;
79
80 #if defined(_RPMFI_INTERNAL)
81
82 #include "mire.h"
83
87 struct rpmfi_s {
88 struct rpmioItem_s _item;
89 int i;
90 int j;
92 /*@observer@*/
93 const char * Type;
95 rpmTag tagN;
96 /*@refcounted@*/ /*@null@*/
97 Header h;
99 /*@only@*/ /*@relnull@*/
100 const char ** bnl;
101 /*@only@*/ /*@relnull@*/
102 const char ** dnl;
104 /*@only@*/ /*@relnull@*/
105 const char ** fdigests;
106 /*@only@*/ /*@null@*/
107 rpmuint32_t * fdigestalgos;
108 /*@only@*/ /*@relnull@*/
109 const char ** flinks;
110 /*@only@*/ /*@null@*/
111 const char ** flangs;
113 /*@only@*/ /*@relnull@*/
114 rpmuint32_t * dil;
115 /*@only@*/ /*@relnull@*/
116 const rpmuint32_t * fflags;
117 /*@only@*/ /*@relnull@*/
118 const rpmuint32_t * fsizes;
119 /*@only@*/ /*@relnull@*/
120 const rpmuint32_t * fmtimes;
121 /*@only@*/ /*@relnull@*/
122 rpmuint16_t * fmodes;
123 /*@only@*/ /*@relnull@*/
124 const rpmuint16_t * frdevs;
125 /*@only@*/ /*@relnull@*/
126 const rpmuint32_t * finodes;
128 /*@only@*/ /*@null@*/
129 const char ** fuser;
130 /*@only@*/ /*@null@*/
131 const char ** fgroup;
133 /*@only@*/ /*@null@*/
134 rpmuint8_t * fstates;
136 /*@only@*/ /*@null@*/
137 const rpmuint32_t * fcolors;
139 /*@only@*/ /*@null@*/
140 const char ** fcaps;
142 /*@only@*/ /*@null@*/
143 const char ** fcontexts;
145 /*@only@*/ /*@null@*/
146 const char ** cdict;
147 rpmuint32_t ncdict;
148 /*@only@*/ /*@null@*/
149 const rpmuint32_t * fcdictx;
151 /*@only@*/ /*@null@*/
152 const rpmuint32_t * ddict;
153 rpmuint32_t nddict;
154 /*@only@*/ /*@null@*/
155 const rpmuint32_t * fddictx;
156 /*@only@*/ /*@null@*/
157 const rpmuint32_t * fddictn;
159 /*@only@*/ /*@relnull@*/
160 const rpmuint32_t * vflags;
162 rpmuint32_t dc;
163 rpmuint32_t fc;
165 /*=============================*/
166 /*@dependent@*/ /*@relnull@*/
167 void * te;
168
169 /*@only@*/ /*@null@*/
170 miRE exclude;
171 int nexclude;
172 /*@only@*/ /*@null@*/
173 miRE include;
174 int ninclude;
176 /*-----------------------------*/
177 uid_t uid;
178 gid_t gid;
179 rpmuint32_t flags;
180 int action;
181 /*@owned@*/ /*@relnull@*/
182 int * actions;
183 /*@owned@*/
184 struct fingerPrint_s * fps;
185 /*@owned@*/
186 const char ** obnl;
187 /*@owned@*/
188 const char ** odnl;
189 /*@unused@*/
190 rpmuint32_t * odil;
192 /*@only@*/ /*@relnull@*/
193 unsigned char * digests;
194 rpmuint32_t digestalgo;
195 rpmuint32_t digestlen;
197 /*@only@*/ /*@relnull@*/
198 const char * pretrans;
199 /*@only@*/ /*@relnull@*/
200 const char * pretransprog;
201 /*@only@*/ /*@relnull@*/
202 const char * posttrans;
203 /*@only@*/ /*@relnull@*/
204 const char * posttransprog;
205 /*@only@*/ /*@relnull@*/
206 const char * verifyscript;
207 /*@only@*/ /*@relnull@*/
208 const char * verifyscriptprog;
209
210 /*@only@*/ /*@null@*/
211 char * fn;
212 size_t fnlen;
214 size_t astriplen;
215 size_t striplen;
216 unsigned long long archivePos;
217 unsigned long long archiveSize;
218 mode_t dperms;
219 mode_t fperms;
220 /*@only@*/ /*@null@*/
221 const char ** apath;
222 int mapflags;
223 /*@owned@*/ /*@null@*/
224 int * fmapflags;
225 /*@owned@*/
226 void * fsm;
227 rpmuint32_t color;
229 int isSource;
231 /*@owned@*/
232 rpmuint32_t * replacedSizes;
234 unsigned int record;
235 int magic;
236 #define RPMFIMAGIC 0x09697923
237 /*=============================*/
238 #if defined(__LCLINT__)
239 /*@refs@*/
240 int nrefs;
241 #endif
242 };
243
244 #endif /* _RPMFI_INTERNAL */
245
246 #ifdef __cplusplus
247 extern "C" {
248 #endif
249
250 #if !defined(_RPMFI_NOMETHODS)
251
253
260 /*@unused@*/ /*@null@*/
261 rpmfi rpmfiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmfi fi,
262 /*@null@*/ const char * msg)
263 /*@modifies fi @*/;
264 #define rpmfiUnlink(_fi, _msg) \
265 ((rpmfi) rpmioUnlinkPoolItem((rpmioItem)(_fi), _msg, __FILE__, __LINE__))
266
273 /*@unused@*/ /*@null@*/
274 rpmfi rpmfiLink (/*@null@*/ rpmfi fi, /*@null@*/ const char * msg)
275 /*@modifies fi @*/;
276 #define rpmfiLink(_fi, _msg) \
277 ((rpmfi) rpmioLinkPoolItem((rpmioItem)(_fi), _msg, __FILE__, __LINE__))
278
284 int rpmfiFC(/*@null@*/ rpmfi fi)
285 /*@*/;
286
292 /*@unused@*/
293 int rpmfiFX(/*@null@*/ rpmfi fi)
294 /*@*/;
295
302 /*@unused@*/
303 int rpmfiSetFX(/*@null@*/ rpmfi fi, int fx)
304 /*@modifies fi @*/;
305
311 int rpmfiDC(/*@null@*/ rpmfi fi)
312 /*@*/;
313
319 int rpmfiDX(/*@null@*/ rpmfi fi)
320 /*@*/;
321
328 int rpmfiSetDX(/*@null@*/ rpmfi fi, int dx)
329 /*@modifies fi @*/;
330
336 int rpmfiIsSource(/*@null@*/ rpmfi fi)
337 /*@*/;
338
344 /*@observer@*/ /*@null@*/
345 extern const char * rpmfiBN(/*@null@*/ rpmfi fi)
346 /*@*/;
347
353 /*@observer@*/ /*@null@*/
354 extern const char * rpmfiDN(/*@null@*/ rpmfi fi)
355 /*@*/;
356
362 /*@observer@*/
363 extern const char * rpmfiFN(/*@null@*/ rpmfi fi)
364 /*@modifies fi @*/;
365
371 extern size_t rpmfiFNMaxLen(/*@null@*/ rpmfi fi)
372 /*@*/;
373
379 rpmuint32_t rpmfiFFlags(/*@null@*/ rpmfi fi)
380 /*@*/;
381
388 rpmuint32_t rpmfiSetFFlags(/*@null@*/ rpmfi fi, rpmuint32_t FFlags)
389 /*@modifies fi @*/;
390
396 rpmuint32_t rpmfiVFlags(/*@null@*/ rpmfi fi)
397 /*@*/;
398
405 rpmuint32_t rpmfiSetVFlags(/*@null@*/ rpmfi fi, rpmuint32_t VFlags)
406 /*@modifies fi @*/;
407
413 rpmuint16_t rpmfiFMode(/*@null@*/ rpmfi fi)
414 /*@*/;
415
421 rpmfileState rpmfiFState(/*@null@*/ rpmfi fi)
422 /*@*/;
423
430 rpmfileState rpmfiSetFState(/*@null@*/ rpmfi fi, rpmfileState fstate)
431 /*@modifies fi @*/;
432
440 /*@observer@*/ /*@null@*/
441 extern const unsigned char * rpmfiDigest(/*@null@*/ rpmfi fi,
442 /*@out@*/ /*@null@*/ int * algop,
443 /*@out@*/ /*@null@*/ size_t * lenp)
444 /*@modifies *algop, *lenp @*/;
445
451 /*@observer@*/ /*@null@*/
452 extern const char * rpmfiFLink(/*@null@*/ rpmfi fi)
453 /*@*/;
454
460 rpmuint32_t rpmfiFSize(/*@null@*/ rpmfi fi)
461 /*@*/;
462
468 rpmuint16_t rpmfiFRdev(/*@null@*/ rpmfi fi)
469 /*@*/;
470
476 rpmuint32_t rpmfiFInode(/*@null@*/ rpmfi fi)
477 /*@*/;
478
484 rpmuint32_t rpmfiColor(/*@null@*/ rpmfi fi)
485 /*@*/;
486
492 rpmuint32_t rpmfiFColor(/*@null@*/ rpmfi fi)
493 /*@*/;
494
500 /*@-exportlocal@*/
501 /*@observer@*/ /*@null@*/
502 extern const char * rpmfiFClass(/*@null@*/ rpmfi fi)
503 /*@*/;
504 /*@=exportlocal@*/
505
511 /*@-exportlocal@*/
512 /*@observer@*/ /*@null@*/
513 extern const char * rpmfiFContext(/*@null@*/ rpmfi fi)
514 /*@*/;
515 /*@=exportlocal@*/
516
523 rpmuint32_t rpmfiFDepends(/*@null@*/ rpmfi fi,
524 /*@out@*/ /*@null@*/ const rpmuint32_t ** fddictp)
525 /*@modifies *fddictp @*/;
526
532 rpmuint32_t rpmfiFNlink(/*@null@*/ rpmfi fi)
533 /*@*/;
534
540 rpmuint32_t rpmfiFMtime(/*@null@*/ rpmfi fi)
541 /*@*/;
542
548 /*@observer@*/ /*@null@*/
549 extern const char * rpmfiFUser(/*@null@*/ rpmfi fi)
550 /*@*/;
551
557 /*@observer@*/ /*@null@*/
558 extern const char * rpmfiFGroup(/*@null@*/ rpmfi fi)
559 /*@*/;
560
566 /*@null@*/
567 void * rpmfiExclude(/*@null@*/ const rpmfi fi)
568 /*@*/;
569
575 int rpmfiNExclude(/*@null@*/ const rpmfi fi)
576 /*@*/;
577
583 /*@null@*/
584 void * rpmfiInclude(/*@null@*/ const rpmfi fi)
585 /*@*/;
586
592 int rpmfiNInclude(/*@null@*/ const rpmfi fi)
593 /*@*/;
594
600 int rpmfiNext(/*@null@*/ rpmfi fi)
601 /*@modifies fi @*/;
602
609 /*@null@*/
610 rpmfi rpmfiInit(/*@null@*/ rpmfi fi, int fx)
611 /*@modifies fi @*/;
612
618 /*@unused@*/
619 int rpmfiNextD(/*@null@*/ rpmfi fi)
620 /*@modifies fi @*/;
621
628 /*@unused@*/ /*@null@*/
629 rpmfi rpmfiInitD(/*@null@*/ rpmfi fi, int dx)
630 /*@modifies fi @*/;
631
638 int rpmfiSetHeader(rpmfi fi, /*@null@*/ Header h)
639 /*@modifies fi, h @*/;
640
646 /*@null@*/
647 rpmfi rpmfiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmfi fi)
648 /*@globals fileSystem @*/
649 /*@modifies fi, fileSystem @*/;
650 #define rpmfiFree(_fi) \
651 ((rpmfi) rpmioFreePoolItem((rpmioItem)(_fi), __FUNCTION__, __FILE__, __LINE__))
652
661 /*@null@*/
662 rpmfi rpmfiNew(/*@null@*/ const void * _ts, Header h, rpmTag tagN, int flags)
663 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
664 /*@modifies _ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/;
665
672 int rpmfiFStat(rpmfi fi, /*@out@*/ struct stat * st)
673 /*@modifies *st @*/;
674
682 int rpmfiStat(rpmfi fi, const char * path, /*@out@*/ struct stat * st)
683 /*@modifies fi, *st @*/;
684
691 /*@null@*/
692 DIR * rpmfiOpendir(rpmfi fi, const char * name)
693 /*@globals fileSystem, internalState @*/
694 /*@modifies fi, fileSystem, internalState @*/;
695
705 void rpmfiBuildFClasses(Header h,
706 /*@out@*/ const char *** fclassp, /*@out@*/ rpmuint32_t * fcp)
707 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
708 /*@modifies h, *fclassp, *fcp, rpmGlobalMacroContext,
709 fileSystem, internalState @*/;
710
720 void rpmfiBuildFContexts(Header h,
721 /*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp)
722 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
723 /*@modifies h, *fcontextp, *fcp, rpmGlobalMacroContext,
724 fileSystem, internalState @*/;
725
735 void rpmfiBuildFSContexts(Header h,
736 /*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp)
737 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
738 /*@modifies h, *fcontextp, *fcp, rpmGlobalMacroContext,
739 fileSystem, internalState @*/;
740
750 void rpmfiBuildREContexts(Header h,
751 /*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp)
752 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
753 /*@modifies h, *fcontextp, *fcp, rpmGlobalMacroContext,
754 fileSystem, internalState @*/;
755
766 void rpmfiBuildFDeps(Header h, rpmTag tagN,
767 /*@out@*/ const char *** fdepsp, /*@out@*/ rpmuint32_t * fcp)
768 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
769 /*@modifies h, *fdepsp, *fcp,
770 rpmGlobalMacroContext, fileSystem, internalState @*/;
771
778 int rpmfiCompare(const rpmfi afi, const rpmfi bfi)
779 /*@*/;
780
788 int rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing)
789 /*@globals h_errno, fileSystem, internalState @*/
790 /*@modifies nfi, fileSystem, internalState @*/;
791
797 /*@-redef@*/
798 /*@observer@*/
799 const char * rpmfiTypeString(rpmfi fi)
800 /*@*/;
801 /*@=redef@*/
802
808 /*@null@*/
809 rpmRelocation rpmfiFreeRelocations(/*@only@*/ rpmRelocation relocs)
810 /*@modifies relocs@*/;
811
818 /*@only@*/ /*@null@*/
819 rpmRelocation rpmfiDupeRelocations(rpmRelocation relocs, int * nrelocsp)
820 /*@modifies *nrelocsp @*/;
821
830 int rpmfiAddRelocation(rpmRelocation * relp, int * nrelp,
831 const char * oldPath, const char * newPath)
832 /*@modifies *relp, *nrelp @*/;
833
835 #endif /* _RPMFI_NOMETHODS */
836
837 #ifdef __cplusplus
838 }
839 #endif
840
841 #endif /* H_RPMDS */