rpm  5.4.14
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_DESKTOP_FILE = (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 } 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  int tracked;
80  size_t brlen;
82  ARGV_t fn;
83  ARGI_t fcolor;
84  ARGI_t fcdictx;
85  ARGI_t fddictx;
86  ARGI_t fddictn;
87  ARGV_t cdict;
88  ARGV_t ddict;
89  ARGI_t ddictx;
91 /*@relnull@*/
92  rpmds provides;
93 /*@relnull@*/
94  rpmds requires;
96  rpmiob iob_java;
97  rpmiob iob_perl;
98  rpmiob iob_python;
99  rpmiob iob_php;
101 /*@null@*/
102  void * Pmires;
103  int Pnmire;
104 /*@null@*/
105  void * PFmires;
106  int PFnmire;
107 /*@null@*/
108  void * Rmires;
109  int Rnmire;
110 /*@null@*/
111  void * RFmires;
112  int RFnmire;
113 
114 };
115 
118 struct rpmfcTokens_s {
119 /*@observer@*/
120  const char * token;
121  int colors;
122 };
123 #endif
124 
125 #ifdef __cplusplus
126 extern "C" {
127 #endif
128 
136 int rpmfcExec(const char ** av, rpmiob iob_stdin, /*@out@*/ rpmiob * iob_stdoutp,
137  int failnonzero)
138  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
139  /*@modifies *iob_stdoutp, rpmGlobalMacroContext,
140  fileSystem, internalState @*/
141  /*@requires maxSet(iob_stdoutp) >= 0 @*/;
142 
148 /*@-exportlocal@*/
149 int rpmfcColoring(const char * fmstr)
150  /*@*/;
151 /*@=exportlocal@*/
152 
160 /*@-exportlocal@*/
161 void rpmfcPrint(/*@null@*/ const char * msg, rpmfc fc, /*@null@*/ FILE * fp)
162  /*@globals fileSystem @*/
163  /*@modifies *fp, fc, fileSystem @*/;
164 /*@=exportlocal@*/
165 
173 /*@-exportlocal@*/
174 rpmRC rpmfcClassify(rpmfc fc, const char ** argv, /*@null@*/ rpmuint16_t * fmode)
175  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
176  /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/;
177 /*@=exportlocal@*/
178 
184 /*@-exportlocal@*/
186  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
187  /*@modifies fc, rpmGlobalMacroContext, internalState @*/;
188 /*@=exportlocal@*/
189 
196 rpmRC rpmfcGenerateDepends(void * _spec, void * _pkg)
197  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
198  /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
199 
205 /*@unused@*/ /*@null@*/
206 rpmfc rpmfcUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmfc fc)
207  /*@modifies fc @*/;
208 #define rpmfcUnlink(_fc) \
209  ((rpmfc)rpmioUnlinkPoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__))
210 
216 /*@unused@*/ /*@newref@*/ /*@null@*/
217 rpmfc rpmfcLink (/*@null@*/ rpmfc fc)
218  /*@modifies fc @*/;
219 #define rpmfcLink(_fc) \
220  ((rpmfc)rpmioLinkPoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__))
221 
227 /*@null@*/
228 rpmfc rpmfcFree(/*@only@*/ /*@null@*/ rpmfc fc)
229  /*@modifies fc @*/;
230 #define rpmfcFree(_fc) \
231  ((rpmfc)rpmioFreePoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__))
232 
237 /*@-exportlocal@*/
238 rpmfc rpmfcNew(void)
239  /*@*/;
240 /*@=exportlocal@*/
241 
242 #ifdef __cplusplus
243 }
244 #endif
245 
246 #endif /* _H_RPMFC_ */
unsigned short rpmuint16_t
Definition: rpmiotypes.h:27
rpmRC rpmfcApply(rpmfc fc)
Build file/package dependency dictionary and mappings.
Definition: rpmfc.c:1092
argv
Definition: rpmmtree.c:3679
struct rpmiob_s * rpmiob
Definition: rpmiotypes.h:60
enum FCOLOR_e FCOLOR_t
enum rpmRC_e rpmRC
RPM return codes.
Definition: signature.c:616
#define rpmfcLink(_fc)
Definition: rpmfc.h:219
int ix
Definition: rpmps-py.c:174
#define rpmfcUnlink(_fc)
Definition: rpmfc.h:208
int _rpmfc_debug
Definition: poptALL.c:122
int rpmfcExec(ARGV_t av, rpmiob iob_stdin, rpmiob *iob_stdoutp, int failnonzero)
Definition: rpmfc.c:229
void rpmfcPrint(const char *msg, rpmfc fc, FILE *fp)
Print results of file classification.
Definition: rpmfc.c:694
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:679
rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpmuint16_t *fmode)
Definition: rpmfc.c:1311
const char * msg
Definition: rpmts-py.c:976
struct rpmfcTokens_s * rpmfcToken
Definition: rpmfc.h:15
#define rpmfcFree(_fc)
Definition: rpmfc.h:230
rpmRC rpmfcGenerateDepends(void *_spec, void *_pkg)
Generate package dependencies.
Definition: rpmfc.c:1882
ARGstr_t * ARGV_t
Definition: argv.h:12
Definition: argv.h:16
const char ** av
Definition: rpmts-py.c:788
FCOLOR_e
Definition: rpmfc.h:19
struct rpmfc_s * rpmfc
Definition: rpmfc.h:11
size_t fn
Definition: macro.c:1698
rpmfc rpmfcNew(void)
Create a file classifier.
Definition: rpmfc.c:2197
#define RPMFC_ELF
Definition: rpmfc.h:24