rpm  4.8.1
rpmfc.h
Go to the documentation of this file.
1 #ifndef _H_RPMFC_
2 #define _H_RPMFC_
3 
9 #include <rpm/rpmtypes.h>
10 #include <rpm/argv.h> /* for ARGV_t */
11 #include <rpm/rpmstring.h> /* for StringBuf */
12 #include <rpm/rpmspec.h> /* for Package */
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 extern int _rpmfc_debug;
19 
22 typedef struct rpmfc_s * rpmfc;
23 
26 enum FCOLOR_e {
28  RPMFC_ELF32 = (1 << 0),
29  RPMFC_ELF64 = (1 << 1),
30  RPMFC_ELFMIPSN32 = (1 << 2),
32  /* (1 << 3) leaks into package headers, reserved */
33 
34  /* bits 4-5 unused */
35  RPMFC_PSDRIVER = (1 << 6),
36  RPMFC_OCAML = (1 << 7),
37  RPMFC_PKGCONFIG = (1 << 8),
38  RPMFC_LIBTOOL = (1 << 9),
39  RPMFC_BOURNE = (1 << 10),
40  RPMFC_MONO = (1 << 11),
41 
42  RPMFC_SCRIPT = (1 << 12),
43  RPMFC_STATIC = (1 << 13),
44  RPMFC_NOTSTRIPPED = (1 << 14),
45  /* bit 15 unused */
46 
47  /* bits 16-19 are enumerated, not bits */
48  RPMFC_DIRECTORY = (1 << 16),
49  RPMFC_SYMLINK = (2 << 16),
50  RPMFC_DEVICE = (3 << 16),
51  RPMFC_LIBRARY = (4 << 16),
52  RPMFC_FONT = (5 << 16),
53  RPMFC_IMAGE = (6 << 16),
54  RPMFC_MANPAGE = (7 << 16),
55  RPMFC_TEXT = (8 << 16),
56  RPMFC_DOCUMENT = (9 << 16),
57  RPMFC_PPD = (10 << 16),
58 
59  RPMFC_ARCHIVE = (1 << 20),
60  RPMFC_COMPRESSED = (1 << 21),
61  RPMFC_MODULE = (1 << 22),
62  RPMFC_EXECUTABLE = (1 << 23),
63 
64  RPMFC_PERL = (1 << 24),
65  RPMFC_JAVA = (1 << 25),
66  RPMFC_PYTHON = (1 << 26),
67  RPMFC_PHP = (1 << 27),
68  RPMFC_TCL = (1 << 28),
69 
70  RPMFC_WHITE = (1 << 29),
71  RPMFC_INCLUDE = (1 << 30),
72  RPMFC_ERROR = (1 << 31)
73 };
74 
77 typedef enum FCOLOR_e FCOLOR_t;
78 
81 typedef const struct rpmfcTokens_s * rpmfcToken;
82 
90 int rpmfcExec(ARGV_const_t av, StringBuf sb_stdin, StringBuf * sb_stdoutp,
91  int failnonzero);
92 
98 int rpmfcColoring(const char * fmstr);
99 
107 void rpmfcPrint(const char * msg, rpmfc fc, FILE * fp);
108 
114 rpmfc rpmfcFree(rpmfc fc);
115 
120 rpmfc rpmfcNew(void);
121 
129 rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode);
130 
136 rpmRC rpmfcApply(rpmfc fc);
137 
144 rpmRC rpmfcGenerateDepends(const rpmSpec spec, Package pkg);
145 
151 rpmds rpmfcProvides(rpmfc fc);
152 
158 rpmds rpmfcRequires(rpmfc fc);
159 
160 #ifdef __cplusplus
161 }
162 #endif
163 
164 #endif /* _H_RPMFC_ */
rpmRC rpmfcApply(rpmfc fc)
Build file/package dependency dictionary and mappings.
rpmds rpmfcProvides(rpmfc fc)
Retrieve file classification provides.
enum FCOLOR_e FCOLOR_t
Definition: rpmfc.h:77
char ** ARGV_t
Definition: argv.h:14
const struct rpmfcTokens_s * rpmfcToken
Definition: rpmfc.h:81
struct rpmds_s * rpmds
Definition: rpmtypes.h:61
int rpmfcColoring(const char *fmstr)
Return file color given file(1) string.
The structure used to store values parsed from a spec file.
Definition: rpmspec.h:94
rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t *fmode)
Build file class dictionary and mappings.
int rpmfcExec(ARGV_const_t av, StringBuf sb_stdin, StringBuf *sb_stdoutp, int failnonzero)
Return helper output.
rpmfc rpmfcFree(rpmfc fc)
Destroy a file classifier.
int _rpmfc_debug
rpmfc rpmfcNew(void)
Create a file classifier.
void rpmfcPrint(const char *msg, rpmfc fc, FILE *fp)
Print results of file classification.
struct StringBufRec * StringBuf
Definition: rpmstring.h:185
rpmRC rpmfcGenerateDepends(const rpmSpec spec, Package pkg)
Generate package dependencies.
rpmds rpmfcRequires(rpmfc fc)
Retrieve file classification requires.
char *const * ARGV_const_t
Definition: argv.h:15
The structure used to store values for a package.
Definition: rpmspec.h:149
enum rpmRC_e rpmRC
Package read return codes.
FCOLOR_e
Definition: rpmfc.h:26
struct rpmfc_s * rpmfc
Definition: rpmfc.h:22
#define RPMFC_ELF
Definition: rpmfc.h:31
uint16_t rpm_mode_t
Definition: rpmtypes.h:49