rpm  4.5
rpmspec.h
Go to the documentation of this file.
1 #ifndef _H_RPMSPEC_
2 #define _H_RPMSPEC_
3 
9 #include <rpmevr.h>
10 
13 typedef struct Package_s * Package;
14 
18  int index;
19 /*@only@*/
20  char * fileName;
21 /*@only@*/
22  char * script;
23 /*@only@*/
24  char * prog;
25 /*@owned@*/
27 };
28 
29 #define RPMBUILD_DEFAULT_LANG "C"
30 
33 struct Source {
34 /*@owned@*/
35  const char * fullSource;
36 /*@dependent@*/
37  const char * source; /* Pointer into fullSource */
38  int flags;
39  int num;
40 /*@owned@*/
41  struct Source * next;
42 };
43 
46 /*@-typeuse@*/
47 typedef struct ReadLevelEntry {
48  int reading;
49 /*@dependent@*/
50  struct ReadLevelEntry * next;
51 } RLE_t;
52 /*@=typeuse@*/
53 
56 typedef struct OpenFileInfo {
57 /*@only@*/
58  const char * fileName;
60  int lineNum;
61  char readBuf[BUFSIZ];
62 /*@dependent@*/
63  char * readPtr;
64 /*@owned@*/
65  struct OpenFileInfo * next;
66 } OFI_t;
67 
70 typedef struct spectag_s {
71  int t_tag;
72  int t_startx;
73  int t_nlines;
74 /*@only@*/
75  const char * t_lang;
76 /*@only@*/
77  const char * t_msgid;
78 } * spectag;
79 
82 typedef struct spectags_s {
83 /*@owned@*/
85  int st_nalloc;
86  int st_ntags;
87 } * spectags;
88 
91 typedef struct speclines_s {
92 /*@only@*/
93  char **sl_lines;
94  int sl_nalloc;
95  int sl_nlines;
96 } * speclines;
97 
101 struct Spec_s {
102 /*@only@*/
103  const char * specFile;
104 /*@only@*/
105  const char * buildSubdir;
106 /*@only@*/
107  const char * rootURL;
108 
109 /*@owned@*/ /*@null@*/
111 /*@owned@*/ /*@null@*/
113 
114 /*@owned@*/
116  char lbuf[10*BUFSIZ];
117 /*@dependent@*/
118  char *lbufPtr;
119  char nextpeekc;
120 /*@dependent@*/
121  char * nextline;
122 /*@dependent@*/
123  char * line;
124  int lineNum;
125 
126 /*@owned@*/
128 
129 /*@owned@*/ /*@null@*/
131 /*@only@*/ /*@null@*/
132  const char ** BANames;
133  int BACount;
134  int recursing;
136  int force;
137  int anyarch;
138 
139 /*@null@*/
140  char * passPhrase;
142 /*@null@*/
143  const char * cookie;
144 
145 /*@owned@*/
146  struct Source * sources;
148  int noSource;
149 
150 /*@only@*/
151  const char * sourceRpmName;
152 /*@only@*/
153  unsigned char * sourcePkgId;
154 /*@refcounted@*/
156 /*@refcounted@*/
159 
160 /*@dependent@*/ /*@null@*/
162 
163  int (*_parseRCPOT) (Spec spec, Package pkg, const char *field, rpmTag tagN,
164  int index, rpmsenseFlags tagflags);
165 
166 /*@only@*/
168 /*@only@*/
170 /*@only@*/
172 /*@only@*/
174 /*@only@*/
177 /*@owned@*/
178  Package packages;
179 };
180 
184 struct Package_s {
185 /*@refcounted@*/
187 /*@refcounted@*/
189 /*@refcounted@*/
191 
192  int autoReq;
193  int autoProv;
194 
195 /*@only@*/
196  const char * preInFile;
197 /*@only@*/
198  const char * postInFile;
199 /*@only@*/
200  const char * preUnFile;
201 /*@only@*/
202  const char * postUnFile;
203 /*@only@*/
204  const char * preTransFile;
205 /*@only@*/
206  const char * postTransFile;
207 /*@only@*/
208  const char * verifyFile;
210 /*@only@*/
212 
213 /*@only@*/
215 
216 /*@only@*/
217  const char * fileFile;
218 /*@only@*/
219  StringBuf fileList; /* If NULL, package will not be written */
220 
221 /*@dependent@*/
222  Package next;
223 };
224 
225 #ifdef __cplusplus
226 extern "C" {
227 #endif
228 
233 /*@only@*/ Spec newSpec(void)
234  /*@globals rpmGlobalMacroContext @*/
235  /*@modifies rpmGlobalMacroContext @*/;
236 
242 /*@null@*/ Spec freeSpec(/*@only@*/ /*@null@*/ Spec spec)
243  /*@globals fileSystem, internalState @*/
244  /*@modifies spec, fileSystem, internalState @*/;
245 
253 int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg)
254  /*@globals rpmRcfiles, rpmCLIMacroContext,
255  rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
256  /*@modifies ts, qva, rpmCLIMacroContext, rpmGlobalMacroContext,
257  fileSystem, internalState @*/;
258 
261 struct OpenFileInfo * newOpenFileInfo(void)
262  /*@*/;
263 
270 spectag stashSt(Spec spec, Header h, int tag, const char * lang)
271  /*@modifies spec->st @*/;
272 
279 int addSource(Spec spec, Package pkg, const char * field, int tag)
280  /*@globals rpmGlobalMacroContext, h_errno @*/
281  /*@modifies spec->sources, spec->numSources,
282  spec->st, spec->macros,
283  rpmGlobalMacroContext @*/;
284 
290 int parseNoSource(Spec spec, const char * field, int tag)
291  /*@modifies nothing @*/;
292 
293 #ifdef __cplusplus
294 }
295 #endif
296 
297 #endif /* _H_SPEC_ */