rpm  5.2.1
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 enum FCOLOR_e FCOLOR_t;
16 
19 typedef struct rpmfcTokens_s * rpmfcToken;
20 
23 enum FCOLOR_e {
25  RPMFC_ELF32 = (1 << 0),
26  RPMFC_ELF64 = (1 << 1),
27  RPMFC_ELFMIPSN32 = (1 << 2),
29  /* (1 << 3) leaks into package headers, reserved */
30 
31  /* bits 4-7 unused */
32  RPMFC_PKGCONFIG = (1 << 8),
33  RPMFC_LIBTOOL = (1 << 9),
34  RPMFC_BOURNE = (1 << 10),
35  RPMFC_MONO = (1 << 11),
36 
37  RPMFC_SCRIPT = (1 << 12),
38  RPMFC_STATIC = (1 << 13),
39  RPMFC_NOTSTRIPPED = (1 << 14),
40  /* bit 15 unused */
41 
42  /* bits 16-19 are enumerated, not bits */
43  RPMFC_DIRECTORY = (1 << 16),
44  RPMFC_SYMLINK = (2 << 16),
45  RPMFC_DEVICE = (3 << 16),
46  RPMFC_LIBRARY = (4 << 16),
47  RPMFC_FONT = (5 << 16),
48  RPMFC_IMAGE = (6 << 16),
49  RPMFC_MANPAGE = (7 << 16),
50  RPMFC_TEXT = (8 << 16),
51  RPMFC_DOCUMENT = (9 << 16),
52 
53  RPMFC_ARCHIVE = (1 << 20),
54  RPMFC_COMPRESSED = (1 << 21),
55  RPMFC_MODULE = (1 << 22),
56  RPMFC_EXECUTABLE = (1 << 23),
57 
58  RPMFC_PERL = (1 << 24),
59  RPMFC_JAVA = (1 << 25),
60  RPMFC_PYTHON = (1 << 26),
61  RPMFC_PHP = (1 << 27),
62  RPMFC_TCL = (1 << 28),
63 
64  RPMFC_WHITE = (1 << 29),
65  RPMFC_INCLUDE = (1 << 30),
66  RPMFC_ERROR = (1 << 31)
67 };
68 
69 #if defined(_RPMFC_INTERNAL)
70 
72 struct rpmfc_s {
73  struct rpmioItem_s _item;
74  size_t nfiles;
75  size_t fknown;
76  size_t fwhite;
77  size_t ix;
78  int skipProv;
79  int skipReq;
80  int tracked;
81  size_t brlen;
83  ARGV_t fn;
84  ARGI_t fcolor;
85  ARGI_t fcdictx;
86  ARGI_t fddictx;
87  ARGI_t fddictn;
88  ARGV_t cdict;
89  ARGV_t ddict;
90  ARGI_t ddictx;
92 /*@relnull@*/
93  rpmds provides;
94 /*@relnull@*/
95  rpmds requires;
97  rpmiob iob_java;
98  rpmiob iob_perl;
99  rpmiob iob_python;
100  rpmiob iob_php;
102 /*@null@*/
103  void * Pmires;
104  int Pnmire;
105 /*@null@*/
106  void * PFmires;
107  int PFnmire;
108 /*@null@*/
109  void * Rmires;
110  int Rnmire;
111 /*@null@*/
112  void * RFmires;
113  int RFnmire;
114 
115 };
116 
119 struct rpmfcTokens_s {
120 /*@observer@*/
121  const char * token;
122  int colors;
123 };
124 #endif
125 
126 #ifdef __cplusplus
127 extern "C" {
128 #endif
129 
137 int rpmfcExec(const char ** av, rpmiob iob_stdin, /*@out@*/ rpmiob * iob_stdoutp,
138  int failnonzero)
139  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
140  /*@modifies *iob_stdoutp, rpmGlobalMacroContext,
141  fileSystem, internalState @*/
142  /*@requires maxSet(iob_stdoutp) >= 0 @*/;
143 
149 /*@-exportlocal@*/
150 int rpmfcColoring(const char * fmstr)
151  /*@*/;
152 /*@=exportlocal@*/
153 
161 /*@-exportlocal@*/
162 void rpmfcPrint(/*@null@*/ const char * msg, rpmfc fc, /*@null@*/ FILE * fp)
163  /*@globals fileSystem @*/
164  /*@modifies *fp, fc, fileSystem @*/;
165 /*@=exportlocal@*/
166 
174 /*@-exportlocal@*/
175 rpmRC rpmfcClassify(rpmfc fc, const char ** argv, /*@null@*/ rpmuint16_t * fmode)
176  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
177  /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/;
178 /*@=exportlocal@*/
179 
185 /*@-exportlocal@*/
187  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
188  /*@modifies fc, rpmGlobalMacroContext, internalState @*/;
189 /*@=exportlocal@*/
190 
197 rpmRC rpmfcGenerateDepends(void * specp, void * pkgp)
198  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
199  /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
200 
206 /*@unused@*/ /*@null@*/
207 rpmfc rpmfcUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmfc fc)
208  /*@modifies fc @*/;
209 #define rpmfcUnlink(_fc) \
210  ((rpmfc)rpmioUnlinkPoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__))
211 
217 /*@unused@*/ /*@newref@*/ /*@null@*/
218 rpmfc rpmfcLink (/*@null@*/ rpmfc fc)
219  /*@modifies fc @*/;
220 #define rpmfcLink(_fc) \
221  ((rpmfc)rpmioLinkPoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__))
222 
228 /*@null@*/
229 rpmfc rpmfcFree(/*@only@*/ /*@null@*/ rpmfc fc)
230  /*@modifies fc @*/;
231 #define rpmfcFree(_fc) \
232  ((rpmfc)rpmioFreePoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__))
233 
238 /*@-exportlocal@*/
239 rpmfc rpmfcNew(void)
240  /*@*/;
241 /*@=exportlocal@*/
242 
243 #ifdef __cplusplus
244 }
245 #endif
246 
247 #endif /* _H_RPMFC_ */