build/rpmspec.h

Go to the documentation of this file.
00001 #ifndef _H_RPMSPEC_
00002 #define _H_RPMSPEC_
00003 
00009 #include <rpmevr.h>
00010 
00013 typedef struct Package_s * Package;
00014 
00017 struct TriggerFileEntry {
00018     int index;
00019 /*@only@*/
00020     char * fileName;
00021 /*@only@*/
00022     char * script;
00023 /*@only@*/
00024     char * prog;
00025 /*@owned@*/
00026     struct TriggerFileEntry * next;
00027 };
00028 
00029 #define RPMBUILD_DEFAULT_LANG "C"
00030 
00033 struct Source {
00034 /*@owned@*/
00035     const char * fullSource;
00036 /*@dependent@*/
00037     const char * source;        /* Pointer into fullSource */
00038     int flags;
00039     int num;
00040 /*@owned@*/
00041     struct Source * next;
00042 };
00043 
00046 /*@-typeuse@*/
00047 typedef struct ReadLevelEntry {
00048     int reading;
00049 /*@dependent@*/
00050     struct ReadLevelEntry * next;
00051 } RLE_t;
00052 /*@=typeuse@*/
00053 
00056 typedef struct OpenFileInfo {
00057 /*@only@*/
00058     const char * fileName;
00059     FD_t fd;
00060     int lineNum;
00061     char readBuf[BUFSIZ];
00062 /*@dependent@*/
00063     char * readPtr;
00064 /*@owned@*/
00065     struct OpenFileInfo * next;
00066 } OFI_t;
00067 
00070 typedef struct spectag_s {
00071     int t_tag;
00072     int t_startx;
00073     int t_nlines;
00074 /*@only@*/
00075     const char * t_lang;
00076 /*@only@*/
00077     const char * t_msgid;
00078 } * spectag;
00079 
00082 typedef struct spectags_s {
00083 /*@owned@*/
00084     spectag st_t;
00085     int st_nalloc;
00086     int st_ntags;
00087 } * spectags;
00088 
00091 typedef struct speclines_s {
00092 /*@only@*/
00093     char **sl_lines;
00094     int sl_nalloc;
00095     int sl_nlines;
00096 } * speclines;
00097 
00101 struct Spec_s {
00102 /*@only@*/
00103     const char * specFile;      
00104 /*@only@*/
00105     const char * buildSubdir;
00106 /*@only@*/
00107     const char * rootURL;
00108 
00109 /*@owned@*/ /*@null@*/
00110     speclines sl;
00111 /*@owned@*/ /*@null@*/
00112     spectags st;
00113 
00114 /*@owned@*/
00115     struct OpenFileInfo * fileStack;
00116     char lbuf[10*BUFSIZ];
00117 /*@dependent@*/
00118     char *lbufPtr;
00119     char nextpeekc;
00120 /*@dependent@*/
00121     char * nextline;
00122 /*@dependent@*/
00123     char * line;
00124     int lineNum;
00125 
00126 /*@owned@*/
00127     struct ReadLevelEntry * readStack;
00128 
00129 /*@owned@*/ /*@null@*/
00130     Spec * BASpecs;
00131 /*@only@*/ /*@null@*/
00132     const char ** BANames;
00133     int BACount;
00134     int recursing;              
00136     int force;
00137     int anyarch;
00138 
00139 /*@null@*/
00140     char * passPhrase;
00141     int timeCheck;
00142 /*@null@*/
00143     const char * cookie;
00144 
00145 /*@owned@*/
00146     struct Source * sources;
00147     int numSources;
00148     int noSource;
00149 
00150 /*@only@*/
00151     const char * sourceRpmName;
00152 /*@only@*/
00153     unsigned char * sourcePkgId;
00154 /*@refcounted@*/
00155     Header sourceHeader;
00156 /*@refcounted@*/
00157     rpmfi sourceCpioList;
00158     int sourceHdrInit;
00159 
00160 /*@dependent@*/ /*@null@*/
00161     MacroContext macros;
00162 
00163     int (*_parseRCPOT) (Spec spec, Package pkg, const char *field, rpmTag tagN,
00164                int index, rpmsenseFlags tagflags);
00165 
00166 /*@only@*/
00167     StringBuf prep;             
00168 /*@only@*/
00169     StringBuf build;            
00170 /*@only@*/
00171     StringBuf install;          
00172 /*@only@*/
00173     StringBuf check;            
00174 /*@only@*/
00175     StringBuf clean;            
00177 /*@owned@*/
00178     Package packages;           
00179 };
00180 
00184 struct Package_s {
00185 /*@refcounted@*/
00186     Header header;
00187 /*@refcounted@*/
00188     rpmds ds;                   
00189 /*@refcounted@*/
00190     rpmfi cpioList;
00191 
00192     int autoReq;
00193     int autoProv;
00194 
00195 /*@only@*/
00196     const char * preInFile;     
00197 /*@only@*/
00198     const char * postInFile;    
00199 /*@only@*/
00200     const char * preUnFile;     
00201 /*@only@*/
00202     const char * postUnFile;    
00203 /*@only@*/
00204     const char * preTransFile;  
00205 /*@only@*/
00206     const char * postTransFile; 
00207 /*@only@*/
00208     const char * verifyFile;    
00210 /*@only@*/
00211     StringBuf specialDoc;
00212 
00213 /*@only@*/
00214     struct TriggerFileEntry * triggerFiles;
00215 
00216 /*@only@*/
00217     const char * fileFile;
00218 /*@only@*/
00219     StringBuf fileList;         /* If NULL, package will not be written */
00220 
00221 /*@dependent@*/
00222     Package next;
00223 };
00224 
00225 #ifdef __cplusplus
00226 extern "C" {
00227 #endif
00228 
00233 /*@only@*/ Spec newSpec(void)
00234         /*@globals rpmGlobalMacroContext @*/
00235         /*@modifies rpmGlobalMacroContext @*/;
00236 
00242 /*@null@*/ Spec freeSpec(/*@only@*/ /*@null@*/ Spec spec)
00243         /*@globals fileSystem, internalState @*/
00244         /*@modifies spec, fileSystem, internalState @*/;
00245 
00253 int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg)
00254         /*@globals rpmRcfiles, rpmCLIMacroContext,
00255                 rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00256         /*@modifies ts, qva, rpmCLIMacroContext, rpmGlobalMacroContext,
00257                 fileSystem, internalState @*/;
00258 
00261 struct OpenFileInfo * newOpenFileInfo(void)
00262         /*@*/;
00263 
00270 spectag stashSt(Spec spec, Header h, int tag, const char * lang)
00271         /*@modifies spec->st @*/;
00272 
00279 int addSource(Spec spec, Package pkg, const char * field, int tag)
00280         /*@globals rpmGlobalMacroContext, h_errno @*/
00281         /*@modifies spec->sources, spec->numSources,
00282                 spec->st, spec->macros,
00283                 rpmGlobalMacroContext @*/;
00284 
00290 int parseNoSource(Spec spec, const char * field, int tag)
00291         /*@modifies nothing @*/;
00292 
00293 #ifdef __cplusplus
00294 }
00295 #endif
00296 
00297 #endif /* _H_SPEC_ */

Generated on Fri May 25 21:18:11 2007 for rpm by  doxygen 1.5.2