00001 #ifndef _H_SPEC_ 00002 #define _H_SPEC_ 00003 00011 typedef struct SpecStruct *Spec; 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 SpecStruct { 00093 /*@only@*/ const char * specFile; 00094 /*@only@*/ const char * sourceRpmName; 00095 /*@only@*/ const char * buildRootURL; 00096 /*@only@*/ const char * buildSubdir; 00097 /*@only@*/ const char * rootURL; 00098 00099 /*@owned@*/ /*@null@*/ speclines sl; 00100 /*@owned@*/ /*@null@*/ spectags st; 00101 00102 /*@owned@*/ struct OpenFileInfo * fileStack; 00103 char lbuf[4*BUFSIZ]; 00104 char nextpeekc; 00105 /*@dependent@*/ char * nextline; 00106 /*@dependent@*/ char * line; 00107 int lineNum; 00108 00109 /*@owned@*/ struct ReadLevelEntry * readStack; 00110 00111 /*@refcounted@*/ Header buildRestrictions; 00112 /*@owned@*/ /*@null@*/ struct SpecStruct ** BASpecs; 00113 /*@only@*/ /*@null@*/ const char ** BANames; 00114 int BACount; 00115 int recursing; 00117 int force; 00118 int anyarch; 00119 00120 int gotBuildRootURL; 00121 00122 /*@null@*/ char * passPhrase; 00123 int timeCheck; 00124 /*@null@*/ const char * cookie; 00125 00126 /*@owned@*/ struct Source * sources; 00127 int numSources; 00128 int noSource; 00129 00130 /*@refcounted@*/ 00131 Header sourceHeader; 00132 rpmfi sourceCpioList; 00133 00134 /*@dependent@*/ /*@null@*/ MacroContext macros; 00135 00136 /*@only@*/ StringBuf prep; 00137 /*@only@*/ StringBuf build; 00138 /*@only@*/ StringBuf install; 00139 /*@only@*/ StringBuf clean; 00141 /*@owned@*/ struct PackageStruct * packages; 00142 }; 00143 00147 struct PackageStruct { 00148 /*@refcounted@*/ 00149 Header header; 00150 rpmfi cpioList; 00151 00152 /*@owned@*/ struct Source * icon; 00153 00154 int autoReq; 00155 int autoProv; 00156 00157 /*@only@*/ const char * preInFile; 00158 /*@only@*/ const char * postInFile; 00159 /*@only@*/ const char * preUnFile; 00160 /*@only@*/ const char * postUnFile; 00161 /*@only@*/ const char * verifyFile; 00163 /*@only@*/ StringBuf specialDoc; 00164 00165 /*@only@*/ struct TriggerFileEntry * triggerFiles; 00166 00167 /*@only@*/ const char * fileFile; 00168 /*@only@*/ StringBuf fileList; /* If NULL, package will not be written */ 00169 00170 /*@dependent@*/ struct PackageStruct * next; 00171 }; 00172 00175 typedef struct PackageStruct * Package; 00176 00177 #ifdef __cplusplus 00178 extern "C" { 00179 #endif 00180 00185 /*@only@*/ Spec newSpec(void) 00186 /*@globals rpmGlobalMacroContext @*/ 00187 /*@modifies rpmGlobalMacroContext @*/; 00188 00194 /*@null@*/ Spec freeSpec(/*@only@*/ /*@null@*/ Spec spec) 00195 /*@globals fileSystem, internalState @*/ 00196 /*@modifies spec, fileSystem, internalState @*/; 00197 00202 /*@-declundef@*/ 00203 extern /*@null@*/ Spec (*freeSpecVec) (Spec spec) /* XXX FIXME */ 00204 /*@globals fileSystem, internalState @*/ 00205 /*@modifies spec, fileSystem, internalState @*/; 00206 /*@=declundef@*/ 00207 00210 struct OpenFileInfo * newOpenFileInfo(void) /*@*/; 00211 00218 spectag stashSt(Spec spec, Header h, int tag, const char * lang) 00219 /*@modifies spec->st @*/; 00220 00227 int addSource(Spec spec, Package pkg, const char * field, int tag) 00228 /*@globals rpmGlobalMacroContext @*/ 00229 /*@modifies spec->sources, spec->numSources, 00230 spec->st, spec->macros, 00231 pkg->icon, 00232 rpmGlobalMacroContext @*/; 00233 00239 int parseNoSource(Spec spec, const char * field, int tag) 00240 /*@modifies nothing @*/; 00241 00242 #ifdef __cplusplus 00243 } 00244 #endif 00245 00246 #endif /* _H_SPEC_ */