rpmspec.h
Go to the documentation of this file.
#ifndef _H_SPEC_
#define _H_SPEC_
#include <rpm/rpmstring.h> /* StringBuf */
#include <rpm/rpmcli.h> /* for QVA_t */
#ifdef __cplusplus
extern "C" {
#endif
typedef struct Package_s * rpmSpecPkg;
typedef struct Source * rpmSpecSrc;
typedef struct rpmSpecIter_s * rpmSpecPkgIter;
typedef struct rpmSpecIter_s * rpmSpecSrcIter;
enum rpmSourceFlags_e {
RPMBUILD_ISSOURCE = (1 << 0),
RPMBUILD_ISPATCH = (1 << 1),
RPMBUILD_ISICON = (1 << 2),
RPMBUILD_ISNO = (1 << 3),
};
typedef rpmFlags rpmSourceFlags;
#define RPMBUILD_DEFAULT_LANG "C"
enum rpmSpecFlags_e {
RPMSPEC_NONE = 0,
RPMSPEC_ANYARCH = (1 << 0),
RPMSPEC_FORCE = (1 << 1),
RPMSPEC_NOLANG = (1 << 2),
RPMSPEC_NOUTF8 = (1 << 3),
};
typedef rpmFlags rpmSpecFlags;
rpmSpec rpmSpecFree(rpmSpec spec);
/* Iterator for spec packages */
rpmSpecPkgIter rpmSpecPkgIterInit(rpmSpec spec);
rpmSpecPkg rpmSpecPkgIterNext(rpmSpecPkgIter iter);
rpmSpecPkgIter rpmSpecPkgIterFree(rpmSpecPkgIter iter);
/* Getters for spec package attributes */
Header rpmSpecPkgHeader(rpmSpecPkg pkg);
/*
* Retrieve package specific parsed spec script section (RPMBUILD_FILE_LIST,
* RPMBUILD_FILE_FILE, RPMBUILD_POLICY) as a malloc'ed string.
*/
char * rpmSpecPkgGetSection(rpmSpecPkg pkg, int section);
/* Iterator for spec sources */
rpmSpecSrcIter rpmSpecSrcIterInit(rpmSpec spec);
rpmSpecSrc rpmSpecSrcIterNext(rpmSpecSrcIter iter);
rpmSpecSrcIter rpmSpecSrcIterFree(rpmSpecSrcIter iter);
/* Getters for spec source attributes */
rpmSourceFlags rpmSpecSrcFlags(rpmSpecSrc src);
int rpmSpecSrcNum(rpmSpecSrc src);
const char * rpmSpecSrcFilename(rpmSpecSrc src, int full);
/*
* Retrieve parsed spec script section (RPMBUILD_PREP, RPMBUILD_BUILD etc).
* As a special case, RPMBUILD_NONE as section returns the entire spec in
* preprocessed (macros expanded etc) format.
*/
const char * rpmSpecGetSection(rpmSpec spec, int section);
int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg);
#ifdef __cplusplus
}
#endif
#endif /* _H_SPEC_ */
rpmSourceFlags
rpmFlags rpmSourceFlags
Definition: rpmspec.h:30
RPMBUILD_ISPATCH
Definition: rpmspec.h:25
rpmspecQuery
int rpmspecQuery(rpmts ts, QVA_t qva, const char *arg)
Function to query spec file(s).
RPMSPEC_FORCE
Definition: rpmspec.h:37
rpmSpecPkgIterNext
rpmSpecPkg rpmSpecPkgIterNext(rpmSpecPkgIter iter)
rpmSpecPkgHeader
Header rpmSpecPkgHeader(rpmSpecPkg pkg)
rpmSpecPkg
struct Package_s * rpmSpecPkg
Definition: rpmspec.h:18
rpmts
struct rpmts_s * rpmts
The main types involved in transaction manipulation.
Definition: rpmtypes.h:63
rpmSpecPkgGetSection
char * rpmSpecPkgGetSection(rpmSpecPkg pkg, int section)
rpmQVKArguments_s
Describe query/verify/signature command line operation.
Definition: rpmcli.h:164
RPMBUILD_ISSOURCE
Definition: rpmspec.h:24
rpmSpecSrcIterInit
rpmSpecSrcIter rpmSpecSrcIterInit(rpmSpec spec)
rpmSpecFree
rpmSpec rpmSpecFree(rpmSpec spec)
Destroy Spec structure.
rpmFlags
uint32_t rpmFlags
Definition: rpmtypes.h:42
RPMSPEC_NONE
Definition: rpmspec.h:35
rpmSpecPkgIterInit
rpmSpecPkgIter rpmSpecPkgIterInit(rpmSpec spec)
rpmSpecSrcIter
struct rpmSpecIter_s * rpmSpecSrcIter
Definition: rpmspec.h:21
rpmSpecSrcFilename
const char * rpmSpecSrcFilename(rpmSpecSrc src, int full)
Header
struct headerToken_s * Header
RPM header and data retrieval types.
Definition: rpmtypes.h:24
rpmSourceFlags_e
rpmSourceFlags_e
Definition: rpmspec.h:23
rpmSpecSrcIterFree
rpmSpecSrcIter rpmSpecSrcIterFree(rpmSpecSrcIter iter)
RPMSPEC_ANYARCH
Definition: rpmspec.h:36
rpmSpecSrc
struct Source * rpmSpecSrc
Definition: rpmspec.h:19
rpmSpecSrcIterNext
rpmSpecSrc rpmSpecSrcIterNext(rpmSpecSrcIter iter)
rpmSpecGetSection
const char * rpmSpecGetSection(rpmSpec spec, int section)
RPMBUILD_ISNO
Definition: rpmspec.h:27
rpmSpecFlags
rpmFlags rpmSpecFlags
Definition: rpmspec.h:42
rpmSpecPkgIter
struct rpmSpecIter_s * rpmSpecPkgIter
Definition: rpmspec.h:20
RPMBUILD_ISICON
Definition: rpmspec.h:26
rpmSpecPkgIterFree
rpmSpecPkgIter rpmSpecPkgIterFree(rpmSpecPkgIter iter)
rpmSpecSrcFlags
rpmSourceFlags rpmSpecSrcFlags(rpmSpecSrc src)
RPMSPEC_NOUTF8
Definition: rpmspec.h:39
RPMSPEC_NOLANG
Definition: rpmspec.h:38
rpmSpecSrcNum
int rpmSpecSrcNum(rpmSpecSrc src)
rpmSpecFlags_e
rpmSpecFlags_e
Definition: rpmspec.h:34
rpmSpec
struct rpmSpec_s * rpmSpec
Definition: rpmtypes.h:90