rpm 6.1.90
The RPM Package Manager
Loading...
Searching...
No Matches
rpmspec.h
Go to the documentation of this file.
1#ifndef _H_SPEC_
2#define _H_SPEC_
3
8
9#include <rpm/rpmstring.h> /* StringBuf */
10#include <rpm/rpmcli.h> /* for QVA_t */
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
18typedef struct Package_s * rpmSpecPkg;
19typedef struct Source * rpmSpecSrc;
20typedef struct rpmSpecIter_s * rpmSpecPkgIter;
21typedef struct rpmSpecIter_s * rpmSpecSrcIter;
22
23enum rpmSourceFlags_e {
24 RPMBUILD_ISSOURCE = (1 << 0),
25 RPMBUILD_ISPATCH = (1 << 1),
26 RPMBUILD_ISICON = (1 << 2),
27 RPMBUILD_ISNO = (1 << 3),
28};
29
30typedef rpmFlags rpmSourceFlags;
31
32#define RPMBUILD_DEFAULT_LANG "C"
33
34enum 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 RPMSPEC_NOFINALIZE = (1 << 4),
41};
42
43typedef rpmFlags rpmSpecFlags;
44
50RPM_PUBLIC_API
51rpmSpec rpmSpecFree(rpmSpec spec);
52
53/* Iterator for spec packages */
54RPM_PUBLIC_API
55rpmSpecPkgIter rpmSpecPkgIterInit(rpmSpec spec);
56RPM_PUBLIC_API
57rpmSpecPkg rpmSpecPkgIterNext(rpmSpecPkgIter iter);
58RPM_PUBLIC_API
59rpmSpecPkgIter rpmSpecPkgIterFree(rpmSpecPkgIter iter);
60
61/* Getters for spec package attributes */
62RPM_PUBLIC_API
63Header rpmSpecPkgHeader(rpmSpecPkg pkg);
64
65/*
66 * Retrieve package specific parsed spec script section (RPMBUILD_FILE_LIST,
67 * RPMBUILD_FILE_FILE, RPMBUILD_POLICY) as a malloc'ed string.
68 */
69RPM_PUBLIC_API
70char * rpmSpecPkgGetSection(rpmSpecPkg pkg, int section);
71
72
73/* Iterator for spec sources */
74RPM_PUBLIC_API
75rpmSpecSrcIter rpmSpecSrcIterInit(rpmSpec spec);
76RPM_PUBLIC_API
77rpmSpecSrc rpmSpecSrcIterNext(rpmSpecSrcIter iter);
78RPM_PUBLIC_API
79rpmSpecSrcIter rpmSpecSrcIterFree(rpmSpecSrcIter iter);
80
81/* Getters for spec source attributes */
82RPM_PUBLIC_API
83rpmSourceFlags rpmSpecSrcFlags(rpmSpecSrc src);
84RPM_PUBLIC_API
85int rpmSpecSrcNum(rpmSpecSrc src);
86RPM_PUBLIC_API
87const char * rpmSpecSrcFilename(rpmSpecSrc src, int full);
88
89/*
90 * Retrieve parsed spec script section (RPMBUILD_PREP, RPMBUILD_BUILD etc).
91 * As a special case, RPMBUILD_NONE as section returns the entire spec in
92 * preprocessed (macros expanded etc) format.
93 */
94RPM_PUBLIC_API
95const char * rpmSpecGetSection(rpmSpec spec, int section);
96
104RPM_PUBLIC_API
105int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg);
106
107#ifdef __cplusplus
108}
109#endif
110
111#endif /* _H_SPEC_ */
RPM_PUBLIC_API int rpmspecQuery(rpmts ts, QVA_t qva, const char *arg)
RPM_PUBLIC_API rpmSpec rpmSpecFree(rpmSpec spec)
struct rpmts_s * rpmts
Definition rpmtypes.h:63
struct headerToken_s * Header
Definition rpmtypes.h:24