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  RPMFC_QML = (1 << 4),
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 
67  RPMFC_NODEJS = (1 << 11)
68 } FCOLOR_t;
69 
70 #if defined(_RPMFC_INTERNAL)
71 
73 struct rpmfc_s {
74  struct rpmioItem_s _item;
75  size_t nfiles;
76  size_t fknown;
77  size_t fwhite;
78  size_t ix;
79  int skipProv;
80  int skipReq;
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 * _spec, void * _pkg)
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_ */
rpmRC rpmfcApply(rpmfc fc)
Build file/package dependency dictionary and mappings.
Definition: rpmfc.c:1163
int rpmfcExec(const char **av, rpmiob iob_stdin, rpmiob *iob_stdoutp, int failnonzero)
Return helper output.
rpmRC rpmfcGenerateDepends(void *_spec, void *_pkg)
Generate package dependencies.
Definition: rpmfc.c:1992
rpmRC rpmfcClassify(rpmfc fc, const char **argv, rpmuint16_t *fmode)
Build file class dictionary and mappings.
unsigned short rpmuint16_t
Definition: rpmiotypes.h:24
struct rpmds_s * rpmds
Dependency tag sets from a header, so that a header can be discarded early.
Definition: rpmtypes.h:28
int rpmfcColoring(const char *fmstr)
Return file color given file(1) string.
Definition: rpmfc.c:720
enum FCOLOR_e FCOLOR_t
#define rpmfcLink(_fc)
Definition: rpmfc.h:220
#define rpmfcUnlink(_fc)
Definition: rpmfc.h:209
int _rpmfc_debug
Definition: poptALL.c:122
rpmfc rpmfcNew(void)
Create a file classifier.
Definition: rpmfc.c:2306
void rpmfcPrint(const char *msg, rpmfc fc, FILE *fp)
Print results of file classification.
Definition: rpmfc.c:735
enum rpmRC_e rpmRC
RPM return codes.
struct rpmiob_s * rpmiob
Definition: rpmiotypes.h:57
struct rpmfcTokens_s * rpmfcToken
Definition: rpmfc.h:15
#define rpmfcFree(_fc)
Definition: rpmfc.h:231
ARGstr_t * ARGV_t
Definition: argv.h:9
Definition: argv.h:13
FCOLOR_e
Definition: rpmfc.h:19
struct rpmfc_s * rpmfc
Definition: rpmfc.h:11
#define RPMFC_ELF
Definition: rpmfc.h:24