rpm  5.4.10
rpmfc.h
Go to the documentation of this file.
1 #ifndef _H_RPMFC_
2 #define _H_RPMFC_
3 
4 /*@-exportlocal@*/
5 /*@unchecked@*/
6 extern int _rpmfc_debug;
7 /*@=exportlocal@*/
8 
11 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmfc_s * rpmfc;
12 
15 typedef struct rpmfcTokens_s * rpmfcToken;
16 
19 typedef enum FCOLOR_e {
21  RPMFC_ELF32 = (1 << 0),
22  RPMFC_ELF64 = (1 << 1),
23  RPMFC_ELFMIPSN32 = (1 << 2),
25  /* (1 << 3) leaks into package headers, reserved */
26 
27  /* bit 4 unused */
28  RPMFC_TYPELIB = (1 << 5),
29  RPMFC_HASKELL = (1 << 6),
30  RPMFC_RUBY = (1 << 7),
31  RPMFC_PKGCONFIG = (1 << 8),
32  RPMFC_LIBTOOL = (1 << 9),
33  RPMFC_BOURNE = (1 << 10),
34  RPMFC_MONO = (1 << 11),
35 
36  RPMFC_SCRIPT = (1 << 12),
37  RPMFC_STATIC = (1 << 13),
38  RPMFC_NOTSTRIPPED = (1 << 14),
39  /* bit 15 unused */
40 
41  /* bits 16-19 are enumerated, not bits */
42  RPMFC_DIRECTORY = (1 << 16),
43  RPMFC_SYMLINK = (2 << 16),
44  RPMFC_DEVICE = (3 << 16),
45  RPMFC_LIBRARY = (4 << 16),
46  RPMFC_FONT = (5 << 16),
47  RPMFC_IMAGE = (6 << 16),
48  RPMFC_MANPAGE = (7 << 16),
49  RPMFC_TEXT = (8 << 16),
50  RPMFC_DOCUMENT = (9 << 16),
51 
52  RPMFC_ARCHIVE = (1 << 20),
53  RPMFC_COMPRESSED = (1 << 21),
54  RPMFC_MODULE = (1 << 22),
55  RPMFC_EXECUTABLE = (1 << 23),
56 
57  RPMFC_PERL = (1 << 24),
58  RPMFC_JAVA = (1 << 25),
59  RPMFC_PYTHON = (1 << 26),
60  RPMFC_PHP = (1 << 27),
61  RPMFC_TCL = (1 << 28),
62 
63  RPMFC_WHITE = (1 << 29),
64  RPMFC_INCLUDE = (1 << 30),
65  RPMFC_ERROR = (1 << 31)
66 } FCOLOR_t;
67 
68 #if defined(_RPMFC_INTERNAL)
69 
71 struct rpmfc_s {
72  struct rpmioItem_s _item;
73  size_t nfiles;
74  size_t fknown;
75  size_t fwhite;
76  size_t ix;
77  int skipProv;
78  int skipReq;
79  size_t brlen;
81  ARGV_t fn;
82  ARGI_t fcolor;
83  ARGI_t fcdictx;
84  ARGI_t fddictx;
85  ARGI_t fddictn;
86  ARGV_t cdict;
87  ARGV_t ddict;
88  ARGI_t ddictx;
90 /*@relnull@*/
91  rpmds provides;
92 /*@relnull@*/
93  rpmds requires;
95  rpmiob iob_java;
96  rpmiob iob_perl;
97  rpmiob iob_python;
98  rpmiob iob_php;
100 /*@null@*/
101  void * Pmires;
102  int Pnmire;
103 /*@null@*/
104  void * PFmires;
105  int PFnmire;
106 /*@null@*/
107  void * Rmires;
108  int Rnmire;
109 /*@null@*/
110  void * RFmires;
111  int RFnmire;
112 
113 };
114 
117 struct rpmfcTokens_s {
118 /*@observer@*/
119  const char * token;
120  int colors;
121 };
122 #endif
123 
124 #ifdef __cplusplus
125 extern "C" {
126 #endif
127 
135 int rpmfcExec(const char ** av, rpmiob iob_stdin, /*@out@*/ rpmiob * iob_stdoutp,
136  int failnonzero)
137  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
138  /*@modifies *iob_stdoutp, rpmGlobalMacroContext,
139  fileSystem, internalState @*/
140  /*@requires maxSet(iob_stdoutp) >= 0 @*/;
141 
147 /*@-exportlocal@*/
148 int rpmfcColoring(const char * fmstr)
149  /*@*/;
150 /*@=exportlocal@*/
151 
159 /*@-exportlocal@*/
160 void rpmfcPrint(/*@null@*/ const char * msg, rpmfc fc, /*@null@*/ FILE * fp)
161  /*@globals fileSystem @*/
162  /*@modifies *fp, fc, fileSystem @*/;
163 /*@=exportlocal@*/
164 
172 /*@-exportlocal@*/
173 rpmRC rpmfcClassify(rpmfc fc, const char ** argv, /*@null@*/ rpmuint16_t * fmode)
174  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
175  /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/;
176 /*@=exportlocal@*/
177 
183 /*@-exportlocal@*/
185  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
186  /*@modifies fc, rpmGlobalMacroContext, internalState @*/;
187 /*@=exportlocal@*/
188 
195 rpmRC rpmfcGenerateDepends(void * _spec, void * _pkg)
196  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
197  /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
198 
204 /*@unused@*/ /*@null@*/
205 rpmfc rpmfcUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmfc fc)
206  /*@modifies fc @*/;
207 #define rpmfcUnlink(_fc) \
208  ((rpmfc)rpmioUnlinkPoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__))
209 
215 /*@unused@*/ /*@newref@*/ /*@null@*/
216 rpmfc rpmfcLink (/*@null@*/ rpmfc fc)
217  /*@modifies fc @*/;
218 #define rpmfcLink(_fc) \
219  ((rpmfc)rpmioLinkPoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__))
220 
226 /*@null@*/
227 rpmfc rpmfcFree(/*@only@*/ /*@null@*/ rpmfc fc)
228  /*@modifies fc @*/;
229 #define rpmfcFree(_fc) \
230  ((rpmfc)rpmioFreePoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__))
231 
236 /*@-exportlocal@*/
237 rpmfc rpmfcNew(void)
238  /*@*/;
239 /*@=exportlocal@*/
240 
241 #ifdef __cplusplus
242 }
243 #endif
244 
245 #endif /* _H_RPMFC_ */