rpm 4.15.1

rpmspec.h
Go to the documentation of this file.
1 #ifndef _H_SPEC_
2 #define _H_SPEC_
3
9 #include <rpm/rpmstring.h> /* StringBuf */
10 #include <rpm/rpmcli.h> /* for QVA_t */
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
18 typedef struct Package_s * rpmSpecPkg;
19 typedef struct Source * rpmSpecSrc;
20 typedef struct rpmSpecIter_s * rpmSpecPkgIter;
21 typedef struct rpmSpecIter_s * rpmSpecSrcIter;
22
23 enum rpmSourceFlags_e {
24 RPMBUILD_ISSOURCE = (1 << 0),
25 RPMBUILD_ISPATCH = (1 << 1),
26 RPMBUILD_ISICON = (1 << 2),
27 RPMBUILD_ISNO = (1 << 3),
28 };
29
30 typedef rpmFlags rpmSourceFlags;
31
32 #define RPMBUILD_DEFAULT_LANG "C"
33
34 enum rpmSpecFlags_e {
35 RPMSPEC_NONE = 0,
36 RPMSPEC_ANYARCH = (1 << 0),
37 RPMSPEC_FORCE = (1 << 1),
38 RPMSPEC_NOLANG = (1 << 2),
39 RPMSPEC_NOUTF8 = (1 << 3),
40 };
41
42 typedef rpmFlags rpmSpecFlags;
43
49 rpmSpec rpmSpecFree(rpmSpec spec);
50
51 /* Iterator for spec packages */
52 rpmSpecPkgIter rpmSpecPkgIterInit(rpmSpec spec);
53 rpmSpecPkg rpmSpecPkgIterNext(rpmSpecPkgIter iter);
54 rpmSpecPkgIter rpmSpecPkgIterFree(rpmSpecPkgIter iter);
55
56 /* Getters for spec package attributes */
57 Header rpmSpecPkgHeader(rpmSpecPkg pkg);
58
59 /*
60 * Retrieve package specific parsed spec script section (RPMBUILD_FILE_LIST,
61 * RPMBUILD_FILE_FILE, RPMBUILD_POLICY) as a malloc'ed string.
62 */
63 char * rpmSpecPkgGetSection(rpmSpecPkg pkg, int section);
64
65
66 /* Iterator for spec sources */
67 rpmSpecSrcIter rpmSpecSrcIterInit(rpmSpec spec);
68 rpmSpecSrc rpmSpecSrcIterNext(rpmSpecSrcIter iter);
69 rpmSpecSrcIter rpmSpecSrcIterFree(rpmSpecSrcIter iter);
70
71 /* Getters for spec source attributes */
72 rpmSourceFlags rpmSpecSrcFlags(rpmSpecSrc src);
73 int rpmSpecSrcNum(rpmSpecSrc src);
74 const char * rpmSpecSrcFilename(rpmSpecSrc src, int full);
75
76 /*
77 * Retrieve parsed spec script section (RPMBUILD_PREP, RPMBUILD_BUILD etc).
78 * As a special case, RPMBUILD_NONE as section returns the entire spec in
79 * preprocessed (macros expanded etc) format.
80 */
81 const char * rpmSpecGetSection(rpmSpec spec, int section);
82
90 int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg);
91
92 #ifdef __cplusplus
93 }
94 #endif
95
96 #endif /* _H_SPEC_ */
rpmFlags
uint32_t rpmFlags
Definition: rpmtypes.h:42
rpmts
struct rpmts_s * rpmts
Definition: rpmtypes.h:63
rpmSourceFlags
rpmFlags rpmSourceFlags
Definition: rpmspec.h:30
rpmSpec
struct rpmSpec_s * rpmSpec
Definition: rpmtypes.h:90
RPMSPEC_NOUTF8
@ RPMSPEC_NOUTF8
Definition: rpmspec.h:39
rpmspecQuery
int rpmspecQuery(rpmts ts, QVA_t qva, const char *arg)
RPMSPEC_ANYARCH
@ RPMSPEC_ANYARCH
Definition: rpmspec.h:36
rpmSpecPkgGetSection
char * rpmSpecPkgGetSection(rpmSpecPkg pkg, int section)
rpmSpecPkgHeader
Header rpmSpecPkgHeader(rpmSpecPkg pkg)
rpmSpecPkg
struct Package_s * rpmSpecPkg
Definition: rpmspec.h:18
rpmSpecFree
rpmSpec rpmSpecFree(rpmSpec spec)
rpmSpecPkgIterNext
rpmSpecPkg rpmSpecPkgIterNext(rpmSpecPkgIter iter)
rpmSpecSrcFilename
const char * rpmSpecSrcFilename(rpmSpecSrc src, int full)
rpmSourceFlags_e
rpmSourceFlags_e
Definition: rpmspec.h:23
rpmQVKArguments_s
Definition: rpmcli.h:164
rpmSpecSrcIterInit
rpmSpecSrcIter rpmSpecSrcIterInit(rpmSpec spec)
rpmSpecGetSection
const char * rpmSpecGetSection(rpmSpec spec, int section)
rpmSpecSrcIter
struct rpmSpecIter_s * rpmSpecSrcIter
Definition: rpmspec.h:21
RPMSPEC_NOLANG
@ RPMSPEC_NOLANG
Definition: rpmspec.h:38
rpmSpecSrcIterNext
rpmSpecSrc rpmSpecSrcIterNext(rpmSpecSrcIter iter)
rpmSpecSrc
struct Source * rpmSpecSrc
Definition: rpmspec.h:19
rpmSpecPkgIterInit
rpmSpecPkgIter rpmSpecPkgIterInit(rpmSpec spec)
rpmSpecPkgIterFree
rpmSpecPkgIter rpmSpecPkgIterFree(rpmSpecPkgIter iter)
rpmSpecSrcIterFree
rpmSpecSrcIter rpmSpecSrcIterFree(rpmSpecSrcIter iter)
rpmSpecFlags
rpmFlags rpmSpecFlags
Definition: rpmspec.h:42
RPMSPEC_NONE
@ RPMSPEC_NONE
Definition: rpmspec.h:35
RPMSPEC_FORCE
@ RPMSPEC_FORCE
Definition: rpmspec.h:37
rpmSpecPkgIter
struct rpmSpecIter_s * rpmSpecPkgIter
Definition: rpmspec.h:20
rpmSpecSrcNum
int rpmSpecSrcNum(rpmSpecSrc src)
rpmSpecFlags_e
rpmSpecFlags_e
Definition: rpmspec.h:34
RPMBUILD_ISPATCH
@ RPMBUILD_ISPATCH
Definition: rpmspec.h:25
RPMBUILD_ISICON
@ RPMBUILD_ISICON
Definition: rpmspec.h:26
RPMBUILD_ISSOURCE
@ RPMBUILD_ISSOURCE
Definition: rpmspec.h:24
RPMBUILD_ISNO
@ RPMBUILD_ISNO
Definition: rpmspec.h:27
Header
struct headerToken_s * Header
Definition: rpmtypes.h:24
rpmSpecSrcFlags
rpmSourceFlags rpmSpecSrcFlags(rpmSpecSrc src)