rpm
4.9.1.3
|
00001 #ifndef _H_SPEC_ 00002 #define _H_SPEC_ 00003 00009 #include <rpm/rpmstring.h> /* StringBuf */ 00010 #include <rpm/rpmcli.h> /* for QVA_t */ 00011 00012 #ifdef __cplusplus 00013 extern "C" { 00014 #endif 00015 00018 typedef struct Package_s * rpmSpecPkg; 00019 typedef struct Source * rpmSpecSrc; 00020 typedef struct rpmSpecIter_s * rpmSpecPkgIter; 00021 typedef struct rpmSpecIter_s * rpmSpecSrcIter; 00022 00023 enum rpmSourceFlags_e { 00024 RPMBUILD_ISSOURCE = (1 << 0), 00025 RPMBUILD_ISPATCH = (1 << 1), 00026 RPMBUILD_ISICON = (1 << 2), 00027 RPMBUILD_ISNO = (1 << 3), 00028 }; 00029 00030 typedef rpmFlags rpmSourceFlags; 00031 00032 #define RPMBUILD_DEFAULT_LANG "C" 00033 00034 enum rpmSpecFlags_e { 00035 RPMSPEC_NONE = 0, 00036 RPMSPEC_ANYARCH = (1 << 0), 00037 RPMSPEC_FORCE = (1 << 1), 00038 RPMSPEC_NOLANG = (1 << 2), 00039 }; 00040 00041 typedef rpmFlags rpmSpecFlags; 00042 00048 rpmSpec rpmSpecFree(rpmSpec spec); 00049 00050 /* Iterator for spec packages */ 00051 rpmSpecPkgIter rpmSpecPkgIterInit(rpmSpec spec); 00052 rpmSpecPkg rpmSpecPkgIterNext(rpmSpecPkgIter iter); 00053 rpmSpecPkgIter rpmSpecPkgIterFree(rpmSpecPkgIter iter); 00054 00055 /* Getters for spec package attributes */ 00056 Header rpmSpecPkgHeader(rpmSpecPkg pkg); 00057 00058 /* Iterator for spec sources */ 00059 rpmSpecSrcIter rpmSpecSrcIterInit(rpmSpec spec); 00060 rpmSpecSrc rpmSpecSrcIterNext(rpmSpecSrcIter iter); 00061 rpmSpecSrcIter rpmSpecSrcIterFree(rpmSpecSrcIter iter); 00062 00063 /* Getters for spec source attributes */ 00064 rpmSourceFlags rpmSpecSrcFlags(rpmSpecSrc src); 00065 int rpmSpecSrcNum(rpmSpecSrc src); 00066 const char * rpmSpecSrcFilename(rpmSpecSrc src, int full); 00067 00068 /* 00069 * Retrieve parsed spec script section (RPMBUILD_PREP, RPMBUILD_BUILD etc). 00070 * As a special case, RPMBUILD_NONE as section returns the entire spec in 00071 * preprocessed (macros expanded etc) format. 00072 */ 00073 const char * rpmSpecGetSection(rpmSpec spec, int section); 00074 00082 int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg); 00083 00084 #ifdef __cplusplus 00085 } 00086 #endif 00087 00088 #endif /* _H_SPEC_ */