Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

build/rpmspec.h

Go to the documentation of this file.
00001 #ifndef _H_SPEC_
00002 #define _H_SPEC_
00003 
00011 typedef struct Package_s * Package;
00012 
00015 struct TriggerFileEntry {
00016     int index;
00017 /*@only@*/ char * fileName;
00018 /*@only@*/ char * script;
00019 /*@only@*/ char * prog;
00020 /*@owned@*/ struct TriggerFileEntry * next;
00021 };
00022 
00023 #define RPMBUILD_ISSOURCE       (1 << 0)
00024 #define RPMBUILD_ISPATCH        (1 << 1)
00025 #define RPMBUILD_ISICON         (1 << 2)
00026 #define RPMBUILD_ISNO           (1 << 3)
00027 
00028 #define RPMBUILD_DEFAULT_LANG "C"
00029 
00032 struct Source {
00033 /*@owned@*/ char * fullSource;
00034 /*@dependent@*/ char * source;     /* Pointer into fullSource */
00035     int flags;
00036     int num;
00037 /*@owned@*/ struct Source * next;
00038 };
00039 
00042 /*@-typeuse@*/
00043 typedef struct ReadLevelEntry {
00044     int reading;
00045 /*@dependent@*/
00046     struct ReadLevelEntry * next;
00047 } RLE_t;
00048 /*@=typeuse@*/
00049 
00052 typedef struct OpenFileInfo {
00053 /*@only@*/ const char * fileName;
00054     FD_t fd;
00055     int lineNum;
00056     char readBuf[BUFSIZ];
00057 /*@dependent@*/
00058     char * readPtr;
00059 /*@owned@*/
00060     struct OpenFileInfo * next;
00061 } OFI_t;
00062 
00065 typedef struct spectag_s {
00066     int t_tag;
00067     int t_startx;
00068     int t_nlines;
00069 /*@only@*/ const char * t_lang;
00070 /*@only@*/ const char * t_msgid;
00071 } * spectag;
00072 
00075 typedef struct spectags_s {
00076 /*@owned@*/ spectag st_t;
00077     int st_nalloc;
00078     int st_ntags;
00079 } * spectags;
00080 
00083 typedef struct speclines_s {
00084 /*@only@*/ char **sl_lines;
00085     int sl_nalloc;
00086     int sl_nlines;
00087 } * speclines;
00088 
00092 struct Spec_s {
00093 /*@only@*/
00094     const char * specFile;      
00095 /*@only@*/
00096     const char * buildRootURL;
00097 /*@only@*/
00098     const char * buildSubdir;
00099 /*@only@*/
00100     const char * rootURL;
00101 
00102 /*@owned@*/ /*@null@*/
00103     speclines sl;
00104 /*@owned@*/ /*@null@*/
00105     spectags st;
00106 
00107 /*@owned@*/
00108     struct OpenFileInfo * fileStack;
00109     char lbuf[4*BUFSIZ];
00110     char nextpeekc;
00111 /*@dependent@*/
00112     char * nextline;
00113 /*@dependent@*/
00114     char * line;
00115     int lineNum;
00116 
00117 /*@owned@*/
00118     struct ReadLevelEntry * readStack;
00119 
00120 /*@refcounted@*/
00121     Header buildRestrictions;
00122 /*@owned@*/ /*@null@*/
00123     Spec * BASpecs;
00124 /*@only@*/ /*@null@*/
00125     const char ** BANames;
00126     int BACount;
00127     int recursing;              
00129     int force;
00130     int anyarch;
00131 
00132     int gotBuildRootURL;
00133 
00134 /*@null@*/
00135     char * passPhrase;
00136     int timeCheck;
00137 /*@null@*/
00138     const char * cookie;
00139 
00140 /*@owned@*/
00141     struct Source * sources;
00142     int numSources;
00143     int noSource;
00144 
00145 /*@only@*/
00146     const char * sourceRpmName;
00147 /*@only@*/
00148     unsigned char * sourcePkgId;
00149 /*@refcounted@*/
00150     Header sourceHeader;
00151 /*@refcounted@*/
00152     rpmfi sourceCpioList;
00153 
00154 /*@dependent@*/ /*@null@*/
00155     MacroContext macros;
00156 
00157 /*@only@*/
00158     StringBuf prep;             
00159 /*@only@*/
00160     StringBuf build;            
00161 /*@only@*/
00162     StringBuf install;          
00163 /*@only@*/
00164     StringBuf check;            
00165 /*@only@*/
00166     StringBuf clean;            
00168 /*@owned@*/
00169     Package packages;           
00170 };
00171 
00175 struct Package_s {
00176 /*@refcounted@*/
00177     Header header;
00178 /*@refcounted@*/
00179     rpmds ds;                   
00180 /*@refcounted@*/
00181     rpmfi cpioList;
00182 
00183 /*@owned@*/
00184     struct Source * icon;
00185 
00186     int autoReq;
00187     int autoProv;
00188 
00189 /*@only@*/
00190     const char * preInFile;     
00191 /*@only@*/
00192     const char * postInFile;    
00193 /*@only@*/
00194     const char * preUnFile;     
00195 /*@only@*/
00196     const char * postUnFile;    
00197 /*@only@*/
00198     const char * verifyFile;    
00200 /*@only@*/
00201     StringBuf specialDoc;
00202 
00203 /*@only@*/
00204     struct TriggerFileEntry * triggerFiles;
00205 
00206 /*@only@*/
00207     const char * fileFile;
00208 /*@only@*/
00209     StringBuf fileList;         /* If NULL, package will not be written */
00210 
00211 /*@dependent@*/
00212     Package next;
00213 };
00214 
00215 #ifdef __cplusplus
00216 extern "C" {
00217 #endif
00218 
00223 /*@only@*/ Spec newSpec(void)
00224         /*@globals rpmGlobalMacroContext @*/
00225         /*@modifies rpmGlobalMacroContext @*/;
00226 
00232 /*@null@*/ Spec freeSpec(/*@only@*/ /*@null@*/ Spec spec)
00233         /*@globals fileSystem, internalState @*/
00234         /*@modifies spec, fileSystem, internalState @*/;
00235 
00243 int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg)
00244         /*@globals rpmGlobalMacroContext,
00245                 fileSystem, internalState @*/
00246         /*@modifies ts, qva, rpmGlobalMacroContext,
00247                 fileSystem, internalState @*/;
00248 
00251 struct OpenFileInfo * newOpenFileInfo(void)
00252         /*@*/;
00253 
00260 spectag stashSt(Spec spec, Header h, int tag, const char * lang)
00261         /*@modifies spec->st @*/;
00262 
00269 int addSource(Spec spec, Package pkg, const char * field, int tag)
00270         /*@globals rpmGlobalMacroContext @*/
00271         /*@modifies spec->sources, spec->numSources,
00272                 spec->st, spec->macros,
00273                 pkg->icon,
00274                 rpmGlobalMacroContext @*/;
00275 
00281 int parseNoSource(Spec spec, const char * field, int tag)
00282         /*@modifies nothing @*/;
00283 
00284 #ifdef __cplusplus
00285 }
00286 #endif
00287 
00288 #endif /* _H_SPEC_ */

Generated on Sun Oct 26 13:01:57 2003 for rpm by doxygen1.2.18