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 int preprocess_mode; 00120 00121 int gotBuildRootURL; 00122 00123 /*@null@*/ char * passPhrase; 00124 int timeCheck; 00125 /*@null@*/ const char * cookie; 00126 00127 /*@owned@*/ struct Source * sources; 00128 int numSources; 00129 int noSource; 00130 00131 /*@refcounted@*/ 00132 Header sourceHeader; 00133 /*@owned@*/ 00134 void * sourceCpioList; 00135 00136 /*@dependent@*/ /*@null@*/ MacroContext macros; 00137 00138 /*@only@*/ StringBuf prep; 00139 /*@only@*/ StringBuf build; 00140 /*@only@*/ StringBuf install; 00141 /*@only@*/ StringBuf clean; 00143 /*@owned@*/ struct PackageStruct * packages; 00144 }; 00145 00149 struct PackageStruct { 00150 /*@refcounted@*/ 00151 Header header; 00152 00153 /*@owned@*/ 00154 void * cpioList; 00155 00156 /*@owned@*/ struct Source * icon; 00157 00158 const char *autoReq; 00159 const char *autoProv; 00160 00161 /*@only@*/ const char * preInFile; 00162 /*@only@*/ const char * postInFile; 00163 /*@only@*/ const char * preUnFile; 00164 /*@only@*/ const char * postUnFile; 00165 /*@only@*/ const char * verifyFile; 00167 /*@only@*/ StringBuf specialDoc; 00168 00169 /*@only@*/ struct TriggerFileEntry * triggerFiles; 00170 00171 /*@only@*/ const char * fileFile; 00172 /*@only@*/ StringBuf fileList; /* If NULL, package will not be written */ 00173 00174 /*@dependent@*/ struct PackageStruct * next; 00175 }; 00176 00179 typedef struct PackageStruct * Package; 00180 00181 #ifdef __cplusplus 00182 extern "C" { 00183 #endif 00184 00189 /*@only@*/ Spec newSpec(void) 00190 /*@globals rpmGlobalMacroContext @*/ 00191 /*@modifies rpmGlobalMacroContext @*/; 00192 00198 /*@null@*/ Spec freeSpec(/*@only@*/ /*@null@*/ Spec spec) 00199 /*@globals fileSystem @*/ 00200 /*@modifies spec, fileSystem @*/; 00201 00206 /*@-declundef@*/ 00207 extern /*@null@*/ Spec (*freeSpecVec) (Spec spec) /* XXX FIXME */ 00208 /*@globals fileSystem @*/ 00209 /*@modifies spec, fileSystem @*/; 00210 /*@=declundef@*/ 00211 00214 struct OpenFileInfo * newOpenFileInfo(void) /*@*/; 00215 00222 spectag stashSt(Spec spec, Header h, int tag, const char * lang) 00223 /*@modifies spec->st @*/; 00224 00231 int addSource(Spec spec, Package pkg, const char * field, int tag) 00232 /*@globals rpmGlobalMacroContext @*/ 00233 /*@modifies spec->sources, spec->numSources, 00234 spec->st, spec->macros, 00235 pkg->icon, 00236 rpmGlobalMacroContext @*/; 00237 00243 int parseNoSource(Spec spec, const char * field, int tag) 00244 /*@modifies nothing @*/; 00245 00246 #ifdef __cplusplus 00247 } 00248 #endif 00249 00250 #endif /* _H_SPEC_ */
1.2.18