rpm 4.8.1
|
00001 #ifndef _H_SPEC_ 00002 #define _H_SPEC_ 00003 00009 #include <rpm/rpmstring.h> /* StringBuf */ 00010 #include <rpm/rpmcli.h> /* for QVA_t */ 00011 00012 #ifdef __cplusplus 00013 extern "C" { 00014 #endif 00015 00018 typedef struct Package_s * Package; 00019 00022 struct TriggerFileEntry { 00023 int index; 00024 char * fileName; 00025 char * script; 00026 char * prog; 00027 struct TriggerFileEntry * next; 00028 }; 00029 00030 #define RPMBUILD_ISSOURCE (1 << 0) 00031 #define RPMBUILD_ISPATCH (1 << 1) 00032 #define RPMBUILD_ISICON (1 << 2) 00033 #define RPMBUILD_ISNO (1 << 3) 00034 00035 #define RPMBUILD_DEFAULT_LANG "C" 00036 00039 struct Source { 00040 char * fullSource; 00041 char * source; /* Pointer into fullSource */ 00042 int flags; 00043 uint32_t num; 00044 struct Source * next; 00045 }; 00046 00049 typedef struct ReadLevelEntry { 00050 int reading; 00051 struct ReadLevelEntry * next; 00052 } RLE_t; 00053 00056 typedef struct OpenFileInfo { 00057 char * fileName; 00058 FILE *fp; 00059 int lineNum; 00060 char readBuf[BUFSIZ]; 00061 char * readPtr; 00062 struct OpenFileInfo * next; 00063 } OFI_t; 00064 00067 typedef struct spectag_s { 00068 int t_tag; 00069 int t_startx; 00070 int t_nlines; 00071 char * t_lang; 00072 char * t_msgid; 00073 } * spectag; 00074 00077 typedef struct spectags_s { 00078 spectag st_t; 00079 int st_nalloc; 00080 int st_ntags; 00081 } * spectags; 00082 00085 typedef struct speclines_s { 00086 char **sl_lines; 00087 int sl_nalloc; 00088 int sl_nlines; 00089 } * speclines; 00090 00094 struct rpmSpec_s { 00095 char * specFile; 00096 char * buildRoot; 00097 char * buildSubdir; 00098 char * rootDir; 00099 00100 speclines sl; 00101 spectags st; 00102 00103 struct OpenFileInfo * fileStack; 00104 char lbuf[10*BUFSIZ]; 00105 char *lbufPtr; 00106 char nextpeekc; 00107 char * nextline; 00108 char * line; 00109 int lineNum; 00110 00111 struct ReadLevelEntry * readStack; 00112 00113 Header buildRestrictions; 00114 rpmSpec * BASpecs; 00115 const char ** BANames; 00116 int BACount; 00117 int recursing; 00119 int force; 00120 int anyarch; 00121 00122 char * passPhrase; 00123 int timeCheck; 00124 char * cookie; 00125 00126 struct Source * sources; 00127 int numSources; 00128 int noSource; 00129 00130 char * sourceRpmName; 00131 unsigned char * sourcePkgId; 00132 Header sourceHeader; 00133 rpmfi sourceCpioList; 00134 00135 rpmMacroContext macros; 00136 00137 StringBuf prep; 00138 StringBuf build; 00139 StringBuf install; 00140 StringBuf check; 00141 StringBuf clean; 00143 Package packages; 00144 }; 00145 00149 struct Package_s { 00150 Header header; 00151 rpmds ds; 00152 rpmfi cpioList; 00153 00154 struct Source * icon; 00155 00156 int autoReq; 00157 int autoProv; 00158 00159 char * preInFile; 00160 char * postInFile; 00161 char * preUnFile; 00162 char * postUnFile; 00163 char * preTransFile; 00164 char * postTransFile; 00165 char * verifyFile; 00167 StringBuf specialDoc; 00168 char *specialDocDir; 00169 00170 struct TriggerFileEntry * triggerFiles; 00171 00172 StringBuf fileFile; 00173 StringBuf fileList; /* If NULL, package will not be written */ 00174 00175 Package next; 00176 }; 00177 00182 rpmSpec newSpec(void); 00183 00189 rpmSpec freeSpec(rpmSpec spec); 00190 00198 int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg); 00199 00202 struct OpenFileInfo * newOpenFileInfo(void); 00203 00211 spectag stashSt(rpmSpec spec, Header h, rpmTag tag, const char * lang); 00212 00220 int addSource(rpmSpec spec, Package pkg, const char * field, rpmTag tag); 00221 00228 int parseNoSource(rpmSpec spec, const char * field, rpmTag tag); 00229 00230 #ifdef __cplusplus 00231 } 00232 #endif 00233 00234 #endif /* _H_SPEC_ */