rpmspec.h
Go to the documentation of this file.
#ifndef _H_RPMSPEC_
#define _H_RPMSPEC_
#include <rpmevr.h>
typedef struct Package_s * Package;
typedef struct Source * SpecSource;
struct TriggerFileEntry {
int index;
/*@only@*/
char * fileName;
/*@only@*/
char * script;
/*@only@*/
char * prog;
/*@owned@*/
struct TriggerFileEntry * next;
};
#define RPMBUILD_DEFAULT_LANG "C"
struct Source {
/*@owned@*/
const char * fullSource;
/*@dependent@*/ /*@relnull@*/
const char * source; /* Pointer into fullSource */
int flags;
rpmuint32_t num;
/*@owned@*/
struct Source * next;
};
/*@-typeuse@*/
typedef struct ReadLevelEntry {
int reading;
/*@dependent@*/
struct ReadLevelEntry * next;
} RLE_t;
/*@=typeuse@*/
typedef struct OpenFileInfo {
/*@only@*/
const char * fileName;
/*@relnull@*/
FD_t fd;
int lineNum;
char readBuf[BUFSIZ];
/*@dependent@*/
char * readPtr;
/*@owned@*/
struct OpenFileInfo * next;
} OFI_t;
typedef struct spectag_s {
int t_tag;
int t_startx;
int t_nlines;
/*@only@*/
const char * t_lang;
/*@only@*/
const char * t_msgid;
} * spectag;
typedef struct spectags_s {
/*@owned@*/
spectag st_t;
int st_nalloc;
int st_ntags;
} * spectags;
typedef struct speclines_s {
/*@only@*/
char **sl_lines;
int sl_nalloc;
int sl_nlines;
} * speclines;
struct Spec_s {
/*@only@*/
const char * specFile;
/*@only@*/
const char * buildSubdir;
/*@only@*/
const char * rootURL;
/*@owned@*/ /*@null@*/
speclines sl;
/*@owned@*/ /*@null@*/
spectags st;
/*@owned@*/
struct OpenFileInfo * fileStack;
/*@owned@*/
char *lbuf;
size_t lbuf_len;
/*@dependent@*/
char *lbufPtr;
char nextpeekc;
/*@dependent@*/
char * nextline;
/*@dependent@*/
char * line;
int lineNum;
/*@owned@*/
struct ReadLevelEntry * readStack;
/*@owned@*/ /*@null@*/
Spec * BASpecs;
/*@only@*/ /*@null@*/
const char ** BANames;
int BACount;
int recursing;
int toplevel;
int force;
int anyarch;
/*@null@*/
char * passPhrase;
int timeCheck;
/*@null@*/
const char * cookie;
/*@owned@*/
struct Source * sources;
int numSources;
int noSource;
/*@only@*/
const char * sourceRpmName;
/*@only@*/
unsigned char * sourcePkgId;
/*@refcounted@*/
Header sourceHeader;
/*@refcounted@*/
rpmfi sourceCpioList;
int sourceHdrInit;
/*@dependent@*/ /*@null@*/
MacroContext macros;
rpmRC (*_parseRCPOT) (Spec spec, Package pkg, const char *field, rpmTag tagN,
rpmuint32_t index, rpmsenseFlags tagflags);
/*@only@*/
rpmiob prep;
/*@only@*/
rpmiob build;
/*@only@*/
rpmiob install;
/*@only@*/
rpmiob check;
/*@only@*/
rpmiob clean;
size_t nfoo;
/*@only@*/ /*@relnull@*/
tagStore_t foo;
/*@owned@*/
Package packages;
};
struct Package_s {
/*@refcounted@*/
Header header;
/*@refcounted@*/
rpmds ds;
/*@refcounted@*/
rpmfi cpioList;
int autoReq;
int autoProv;
int noarch;
/*@only@*/
const char * preInFile;
/*@only@*/
const char * postInFile;
/*@only@*/
const char * preUnFile;
/*@only@*/
const char * postUnFile;
/*@only@*/
const char * preTransFile;
/*@only@*/
const char * postTransFile;
/*@only@*/
const char * verifyFile;
/*@only@*/
const char * sanityCheckFile;
/*@only@*/
rpmiob specialDoc;
/*@only@*/
struct TriggerFileEntry * triggerFiles;
/*@only@*/
const char * fileFile;
/*@only@*/
rpmiob fileList; /* If NULL, package will not be written */
/*@dependent@*/
Package next;
};
#ifdef __cplusplus
extern "C" {
#endif
/*@only@*/
Spec newSpec(void)
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies rpmGlobalMacroContext, internalState @*/;
/*@null@*/
Spec freeSpec(/*@only@*/ /*@null@*/ Spec spec)
/*@globals fileSystem, internalState @*/
/*@modifies spec, fileSystem, internalState @*/;
int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg)
/*@globals rpmCLIMacroContext,
rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, qva, rpmCLIMacroContext, rpmGlobalMacroContext,
fileSystem, internalState @*/;
struct OpenFileInfo * newOpenFileInfo(void)
/*@*/;
spectag stashSt(Spec spec, Header h, rpmTag tag, const char * lang)
/*@globals internalState @*/
/*@modifies spec->st, internalState @*/;
int addSource(Spec spec, Package pkg, const char * field, rpmTag tag)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies spec->sources, spec->numSources,
spec->st, spec->macros,
rpmGlobalMacroContext, fileSystem, internalState @*/;
int parseNoSource(Spec spec, const char * field, rpmTag tag)
/*@*/;
int SpecSourceCount(Spec spec)
/*@*/;
SpecSource getSource(Spec spec, int num)
/*@*/;
/*@exposed@*/
const char * specSourceName(SpecSource source)
/*@*/;
/*@exposed@*/
const char * specFullSourceName(SpecSource source)
/*@*/;
int specSourceNum(SpecSource source)
/*@*/;
int specSourceFlags(SpecSource source)
/*@*/;
/*@null@*/
#if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */
const char * getSourceDir(rpmfileAttrs attr, const char *filename)
#else
const char * getSourceDir(rpmfileAttrs attr)
#endif
/*@*/;
#ifdef __cplusplus
}
#endif
#endif /* _H_SPEC_ */