rpm 5.3.7
|
00001 #ifndef _H_RPMSPEC_ 00002 #define _H_RPMSPEC_ 00003 00009 #include <rpmevr.h> 00010 #include <rpmfi.h> /* XXX rpmfi typedef */ 00011 #include <rpmcli.h> /* XXX QVA_t typedef */ 00012 00015 typedef /*@abstract@*/ /*@refcounted@*/ struct Package_s * Package; 00016 00019 typedef struct Source * SpecSource; 00020 00023 struct TriggerFileEntry { 00024 int index; 00025 /*@only@*/ 00026 char * fileName; 00027 /*@only@*/ 00028 char * script; 00029 /*@only@*/ 00030 char * prog; 00031 /*@owned@*/ 00032 struct TriggerFileEntry * next; 00033 }; 00034 00035 #define RPMBUILD_DEFAULT_LANG "C" 00036 00039 struct Source { 00040 /*@owned@*/ 00041 const char * fullSource; 00042 /*@dependent@*/ /*@relnull@*/ 00043 const char * source; /* Pointer into fullSource */ 00044 int flags; 00045 rpmuint32_t num; 00046 /*@owned@*/ 00047 struct Source * next; 00048 }; 00049 00052 /*@-typeuse@*/ 00053 typedef struct ReadLevelEntry { 00054 int reading; 00055 /*@dependent@*/ 00056 struct ReadLevelEntry * next; 00057 } RLE_t; 00058 /*@=typeuse@*/ 00059 00062 typedef struct OpenFileInfo { 00063 /*@only@*/ 00064 const char * fileName; 00065 /*@relnull@*/ 00066 FD_t fd; 00067 int lineNum; 00068 char readBuf[BUFSIZ]; 00069 /*@dependent@*/ 00070 char * readPtr; 00071 /*@owned@*/ 00072 struct OpenFileInfo * next; 00073 } OFI_t; 00074 00077 typedef struct spectag_s { 00078 int t_tag; 00079 int t_startx; 00080 int t_nlines; 00081 /*@only@*/ 00082 const char * t_lang; 00083 /*@only@*/ 00084 const char * t_msgid; 00085 } * spectag; 00086 00089 typedef struct spectags_s { 00090 /*@owned@*/ 00091 spectag st_t; 00092 int st_nalloc; 00093 int st_ntags; 00094 } * spectags; 00095 00098 typedef struct speclines_s { 00099 /*@only@*/ 00100 char **sl_lines; 00101 int sl_nalloc; 00102 int sl_nlines; 00103 } * speclines; 00104 00108 struct Spec_s { 00109 struct rpmioItem_s _item; 00110 /*@only@*/ 00111 const char * specFile; 00112 /*@only@*/ 00113 const char * buildSubdir; 00114 /*@only@*/ 00115 const char * rootURL; 00116 00117 /*@owned@*/ /*@null@*/ 00118 speclines sl; 00119 /*@owned@*/ /*@null@*/ 00120 spectags st; 00121 00122 /*@owned@*/ 00123 struct OpenFileInfo * fileStack; 00124 /*@owned@*/ 00125 char *lbuf; 00126 size_t lbuf_len; 00127 /*@dependent@*/ 00128 char *lbufPtr; 00129 char nextpeekc; 00130 /*@dependent@*/ 00131 char * nextline; 00132 /*@dependent@*/ 00133 char * line; 00134 int lineNum; 00135 00136 /*@owned@*/ 00137 struct ReadLevelEntry * readStack; 00138 00139 /*@owned@*/ /*@null@*/ 00140 Spec * BASpecs; 00141 /*@only@*/ /*@null@*/ 00142 const char ** BANames; 00143 int BACount; 00144 int recursing; 00145 int toplevel; 00146 00147 int force; 00148 int anyarch; 00149 00150 /*@null@*/ 00151 char * passPhrase; 00152 int timeCheck; 00153 /*@null@*/ 00154 const char * cookie; 00155 00156 /*@owned@*/ 00157 struct Source * sources; 00158 int numSources; 00159 int noSource; 00160 00161 /*@only@*/ 00162 const char * sourceRpmName; 00163 /*@only@*/ 00164 unsigned char * sourcePkgId; 00165 /*@refcounted@*/ 00166 Header sourceHeader; 00167 /*@refcounted@*/ 00168 rpmfi fi; 00169 int sourceHdrInit; 00170 00171 /*@dependent@*/ /*@null@*/ 00172 MacroContext macros; 00173 00174 rpmRC (*_parseRCPOT) (Spec spec, Package pkg, const char *field, rpmTag tagN, 00175 rpmuint32_t index, rpmsenseFlags tagflags); 00176 00177 rpmuint32_t sstates[RPMSCRIPT_MAX]; 00178 rpmuint32_t smetrics[RPMSCRIPT_MAX]; 00180 /*@only@*/ 00181 rpmiob prep; 00182 /*@only@*/ 00183 rpmiob build; 00184 /*@only@*/ 00185 rpmiob install; 00186 /*@only@*/ 00187 rpmiob check; 00188 /*@only@*/ 00189 rpmiob clean; 00191 size_t nfoo; 00192 /*@only@*/ /*@relnull@*/ 00193 tagStore_t foo; 00194 00195 void * dig; 00197 Package packages; 00198 #if defined(__LCLINT__) 00199 /*@refs@*/ 00200 int nrefs; 00201 #endif 00202 }; 00203 00207 struct Package_s { 00208 struct rpmioItem_s _item; 00209 /*@refcounted@*/ 00210 Header header; 00211 /*@refcounted@*/ 00212 rpmds ds; 00213 /*@refcounted@*/ 00214 rpmfi fi; 00215 00216 int autoReq; 00217 int autoProv; 00218 int noarch; 00219 00220 /*@only@*/ 00221 const char * preInFile; 00222 /*@only@*/ 00223 const char * postInFile; 00224 /*@only@*/ 00225 const char * preUnFile; 00226 /*@only@*/ 00227 const char * postUnFile; 00228 /*@only@*/ 00229 const char * preTransFile; 00230 /*@only@*/ 00231 const char * postTransFile; 00232 /*@only@*/ 00233 const char * verifyFile; 00234 /*@only@*/ 00235 const char * sanityCheckFile; 00237 /*@only@*/ 00238 rpmiob specialDoc; 00239 00240 /*@only@*/ 00241 struct TriggerFileEntry * triggerFiles; 00242 00243 /*@only@*/ 00244 const char * fileFile; 00245 /*@only@*/ 00246 rpmiob fileList; /* If NULL, package will not be written */ 00247 00248 Package next; 00249 #if defined(__LCLINT__) 00250 /*@refs@*/ 00251 int nrefs; 00252 #endif 00253 }; 00254 00255 #ifdef __cplusplus 00256 extern "C" { 00257 #endif 00258 00265 /*@null@*/ 00266 Spec freeSpec(/*@killref@*/ /*@null@*/ Spec spec) 00267 /*@globals fileSystem, internalState @*/ 00268 /*@modifies spec, fileSystem, internalState @*/; 00269 #define freeSpec(_spec) \ 00270 ((Spec)rpmioFreePoolItem((rpmioItem)(_spec), __FUNCTION__, __FILE__, __LINE__)) 00271 00276 /*@only@*/ 00277 Spec newSpec(void) 00278 /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ 00279 /*@modifies rpmGlobalMacroContext, internalState @*/; 00280 00288 int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg) 00289 /*@globals rpmCLIMacroContext, 00290 rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 00291 /*@modifies ts, qva, rpmCLIMacroContext, rpmGlobalMacroContext, 00292 fileSystem, internalState @*/; 00293 00296 struct OpenFileInfo * newOpenFileInfo(void) 00297 /*@*/; 00298 00307 spectag stashSt(Spec spec, Header h, rpmTag tag, const char * lang) 00308 /*@globals internalState @*/ 00309 /*@modifies spec->st, internalState @*/; 00310 00319 int addSource(Spec spec, Package pkg, const char * field, rpmTag tag) 00320 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 00321 /*@modifies spec->sources, spec->numSources, 00322 spec->st, spec->macros, 00323 rpmGlobalMacroContext, fileSystem, internalState @*/; 00324 00332 int parseNoSource(Spec spec, const char * field, rpmTag tag) 00333 /*@*/; 00334 00340 int SpecSourceCount(Spec spec) 00341 /*@*/; 00342 00349 SpecSource getSource(Spec spec, int num) 00350 /*@*/; 00351 00357 /*@exposed@*/ 00358 const char * specSourceName(SpecSource source) 00359 /*@*/; 00360 00366 /*@exposed@*/ 00367 const char * specFullSourceName(SpecSource source) 00368 /*@*/; 00369 00375 int specSourceNum(SpecSource source) 00376 /*@*/; 00377 00383 int specSourceFlags(SpecSource source) 00384 /*@*/; 00385 00391 /*@null@*/ 00392 #if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ 00393 const char * getSourceDir(rpmfileAttrs attr, const char *filename) 00394 #else 00395 const char * getSourceDir(rpmfileAttrs attr) 00396 #endif 00397 /*@*/; 00398 00399 #ifdef __cplusplus 00400 } 00401 #endif 00402 00403 #endif /* _H_SPEC_ */