rpm 5.2.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

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 typedef struct Source * SpecSource;
    00018
    00021 struct TriggerFileEntry {
    00022     int index;
    00023 /*@only@*/
    00024     char * fileName;
    00025 /*@only@*/
    00026     char * script;
    00027 /*@only@*/
    00028     char * prog;
    00029 /*@owned@*/
    00030     struct TriggerFileEntry * next;
    00031 };
    00032
    00033 #define RPMBUILD_DEFAULT_LANG "C"
    00034
    00037 struct Source {
    00038 /*@owned@*/
    00039     const char * fullSource;
    00040 /*@dependent@*/ /*@relnull@*/
    00041     const char * source;        /* Pointer into fullSource */
    00042     int flags;
    00043     rpmuint32_t num;
    00044 /*@owned@*/
    00045     struct Source * next;
    00046 };
    00047
    00050 /*@-typeuse@*/
    00051 typedef struct ReadLevelEntry {
    00052     int reading;
    00053 /*@dependent@*/
    00054     struct ReadLevelEntry * next;
    00055 } RLE_t;
    00056 /*@=typeuse@*/
    00057
    00060 typedef struct OpenFileInfo {
    00061 /*@only@*/
    00062     const char * fileName;
    00063 /*@relnull@*/
    00064     FD_t fd;
    00065     int lineNum;
    00066     char readBuf[BUFSIZ];
    00067 /*@dependent@*/
    00068     char * readPtr;
    00069 /*@owned@*/
    00070     struct OpenFileInfo * next;
    00071 } OFI_t;
    00072
    00075 typedef struct spectag_s {
    00076     int t_tag;
    00077     int t_startx;
    00078     int t_nlines;
    00079 /*@only@*/
    00080     const char * t_lang;
    00081 /*@only@*/
    00082     const char * t_msgid;
    00083 } * spectag;
    00084
    00087 typedef struct spectags_s {
    00088 /*@owned@*/
    00089     spectag st_t;
    00090     int st_nalloc;
    00091     int st_ntags;
    00092 } * spectags;
    00093
    00096 typedef struct speclines_s {
    00097 /*@only@*/
    00098     char **sl_lines;
    00099     int sl_nalloc;
    00100     int sl_nlines;
    00101 } * speclines;
    00102
    00106 struct Spec_s {
    00107 /*@only@*/
    00108     const char * specFile;
    00109 /*@only@*/
    00110     const char * buildSubdir;
    00111 /*@only@*/
    00112     const char * rootURL;
    00113
    00114 /*@owned@*/ /*@null@*/
    00115     speclines sl;
    00116 /*@owned@*/ /*@null@*/
    00117     spectags st;
    00118
    00119 /*@owned@*/
    00120     struct OpenFileInfo * fileStack;
    00121 /*@owned@*/
    00122     char *lbuf;
    00123     size_t lbuf_len;
    00124 /*@dependent@*/
    00125     char *lbufPtr;
    00126     char nextpeekc;
    00127 /*@dependent@*/
    00128     char * nextline;
    00129 /*@dependent@*/
    00130     char * line;
    00131     int lineNum;
    00132
    00133 /*@owned@*/
    00134     struct ReadLevelEntry * readStack;
    00135
    00136 /*@owned@*/ /*@null@*/
    00137     Spec * BASpecs;
    00138 /*@only@*/ /*@null@*/
    00139     const char ** BANames;
    00140     int BACount;
    00141     int recursing;
    00142     int toplevel;
    00143
    00144     int force;
    00145     int anyarch;
    00146
    00147 /*@null@*/
    00148     char * passPhrase;
    00149     int timeCheck;
    00150 /*@null@*/
    00151     const char * cookie;
    00152
    00153 /*@owned@*/
    00154     struct Source * sources;
    00155     int numSources;
    00156     int noSource;
    00157
    00158 /*@only@*/
    00159     const char * sourceRpmName;
    00160 /*@only@*/
    00161     unsigned char * sourcePkgId;
    00162 /*@refcounted@*/
    00163     Header sourceHeader;
    00164 /*@refcounted@*/
    00165     rpmfi sourceCpioList;
    00166     int sourceHdrInit;
    00167
    00168 /*@dependent@*/ /*@null@*/
    00169     MacroContext macros;
    00170
    00171     rpmRC (*_parseRCPOT) (Spec spec, Package pkg, const char *field, rpmTag tagN,
    00172                rpmuint32_t index, rpmsenseFlags tagflags);
    00173
    00174 /*@only@*/
    00175     rpmiob prep;
    00176 /*@only@*/
    00177     rpmiob build;
    00178 /*@only@*/
    00179     rpmiob install;
    00180 /*@only@*/
    00181     rpmiob check;
    00182 /*@only@*/
    00183     rpmiob clean;
    00185     size_t nfoo;
    00186 /*@only@*/ /*@relnull@*/
    00187     tagStore_t foo;
    00188
    00189 /*@owned@*/
    00190     Package packages;
    00191 };
    00192
    00196 struct Package_s {
    00197 /*@refcounted@*/
    00198     Header header;
    00199 /*@refcounted@*/
    00200     rpmds ds;
    00201 /*@refcounted@*/
    00202     rpmfi cpioList;
    00203
    00204     int autoReq;
    00205     int autoProv;
    00206     int noarch;
    00207
    00208 /*@only@*/
    00209     const char * preInFile;
    00210 /*@only@*/
    00211     const char * postInFile;
    00212 /*@only@*/
    00213     const char * preUnFile;
    00214 /*@only@*/
    00215     const char * postUnFile;
    00216 /*@only@*/
    00217     const char * preTransFile;
    00218 /*@only@*/
    00219     const char * postTransFile;
    00220 /*@only@*/
    00221     const char * verifyFile;
    00222 /*@only@*/
    00223     const char * sanityCheckFile;
    00225 /*@only@*/
    00226     rpmiob specialDoc;
    00227
    00228 /*@only@*/
    00229     struct TriggerFileEntry * triggerFiles;
    00230
    00231 /*@only@*/
    00232     const char * fileFile;
    00233 /*@only@*/
    00234     rpmiob fileList;            /* If NULL, package will not be written */
    00235
    00236 /*@dependent@*/
    00237     Package next;
    00238 };
    00239
    00240 #ifdef __cplusplus
    00241 extern "C" {
    00242 #endif
    00243
    00248 /*@only@*/
    00249 Spec newSpec(void)
    00250         /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
    00251         /*@modifies rpmGlobalMacroContext, internalState @*/;
    00252
    00258 /*@null@*/
    00259 Spec freeSpec(/*@only@*/ /*@null@*/ Spec spec)
    00260         /*@globals fileSystem, internalState @*/
    00261         /*@modifies spec, fileSystem, internalState @*/;
    00262
    00270 int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg)
    00271         /*@globals rpmCLIMacroContext,
    00272                 rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
    00273         /*@modifies ts, qva, rpmCLIMacroContext, rpmGlobalMacroContext,
    00274                 fileSystem, internalState @*/;
    00275
    00278 struct OpenFileInfo * newOpenFileInfo(void)
    00279         /*@*/;
    00280
    00289 spectag stashSt(Spec spec, Header h, rpmTag tag, const char * lang)
    00290         /*@globals internalState @*/
    00291         /*@modifies spec->st, internalState @*/;
    00292
    00301 int addSource(Spec spec, Package pkg, const char * field, rpmTag tag)
    00302         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
    00303         /*@modifies spec->sources, spec->numSources,
    00304                 spec->st, spec->macros,
    00305                 rpmGlobalMacroContext, fileSystem, internalState @*/;
    00306
    00314 int parseNoSource(Spec spec, const char * field, rpmTag tag)
    00315         /*@*/;
    00316
    00322 int SpecSourceCount(Spec spec)
    00323         /*@*/;
    00324
    00331 SpecSource getSource(Spec spec, int num)
    00332         /*@*/;
    00333
    00339 /*@exposed@*/
    00340 const char * specSourceName(SpecSource source)
    00341         /*@*/;
    00342
    00348 /*@exposed@*/
    00349 const char * specFullSourceName(SpecSource source)
    00350         /*@*/;
    00351
    00357 int specSourceNum(SpecSource source)
    00358         /*@*/;
    00359
    00365 int specSourceFlags(SpecSource source)
    00366         /*@*/;
    00367
    00373 /*@null@*/
    00374 #if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */
    00375 const char * getSourceDir(rpmfileAttrs attr, const char *filename)
    00376 #else
    00377 const char * getSourceDir(rpmfileAttrs attr)
    00378 #endif
    00379         /*@*/;
    00380
    00381 #ifdef __cplusplus
    00382 }
    00383 #endif
    00384
    00385 #endif /* _H_SPEC_ */