Add support for global LDFLAGS
[platform/upstream/rpm.git] / build / rpmfc.h
1 #ifndef _H_RPMFC_
2 #define _H_RPMFC_
3
4 /** \ingroup rpmfc rpmbuild
5  * \file build/rpmfc.h
6  * Structures and methods for build-time file classification.
7  */
8
9 #include <rpm/rpmtypes.h>
10 #include <rpm/argv.h>   /* for ARGV_t */
11 #include <rpm/rpmspec.h>        /* for Package */
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17 extern int _rpmfc_debug;
18
19 /** \ingroup rpmfc
20  */
21 typedef struct rpmfc_s * rpmfc;
22
23 /** \ingroup rpmfc
24  */
25 enum FCOLOR_e {
26     RPMFC_BLACK                 = 0,
27     RPMFC_ELF32                 = (1 <<  0),
28     RPMFC_ELF64                 = (1 <<  1),
29     RPMFC_ELFMIPSN32            = (1 <<  2),
30 #define RPMFC_ELF       (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)
31         /* (1 << 3) leaks into package headers, reserved */
32
33     RPMFC_WHITE                 = (1 << 29),
34     RPMFC_INCLUDE               = (1 << 30),
35     RPMFC_ERROR                 = (1 << 31)
36 };
37
38 /** \ingroup rpmfc
39  */
40 typedef rpmFlags FCOLOR_t;
41
42 /** \ingroup rpmfc
43  */
44 typedef const struct rpmfcTokens_s * rpmfcToken;
45
46 /** \ingroup rpmfc
47  * Print results of file classification.
48  * @todo Remove debugging routine.
49  * @param msg           message prefix (NULL for none)
50  * @param fc            file classifier
51  * @param fp            output file handle (NULL for stderr)
52  */
53 void rpmfcPrint(const char * msg, rpmfc fc, FILE * fp);
54
55 /** \ingroup rpmfc
56  * Destroy a file classifier.
57  * @param fc            file classifier
58  * @return              NULL always
59  */
60 rpmfc rpmfcFree(rpmfc fc);
61
62 /** \ingroup rpmfc
63  * Create a file classifier.
64  * @param rootDir       (build) root directory
65  * @param flags         (unused)
66  * @return              new file classifier
67  */
68 rpmfc rpmfcCreate(const char *rootDir, rpmFlags flags);
69
70 /** \ingroup rpmfc
71  * @deprecated
72  * Create a file classifier.
73  * @return              new file classifier
74  */
75 RPM_GNUC_DEPRECATED
76 rpmfc rpmfcNew(void);
77
78
79 /** \ingroup rpmfc
80  * Build file class dictionary and mappings.
81  * @param fc            file classifier
82  * @param argv          files to classify
83  * @param fmode         files mode_t array (or NULL)
84  * @return              RPMRC_OK on success
85  */
86 rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode);
87
88 /** \ingroup rpmfc
89  * Build file/package dependency dictionary and mappings.
90  * @param fc            file classifier
91  * @return              RPMRC_OK on success
92  */
93 rpmRC rpmfcApply(rpmfc fc);
94
95 /** \ingroup rpmfc
96  * Retrieve file classification provides
97  * @param fc            file classifier
98  * @return              rpmds dependency set of fc provides
99  */
100 rpmds rpmfcProvides(rpmfc fc);
101
102 /** \ingroup rpmfc
103  * Retrieve file classification requires
104  * @param fc            file classifier
105  * @return              rpmds dependency set of fc requires
106  */
107 rpmds rpmfcRequires(rpmfc fc);
108
109 /** \ingroup rpmfc
110  * Retrieve file classification supplements
111  * @param fc            file classifier
112  * @return              rpmds dependency set of fc requires
113  */
114 rpmds rpmfcSupplements(rpmfc fc);
115
116 #ifdef __cplusplus
117 }
118 #endif
119
120 #endif /* _H_RPMFC_ */