rpm  5.2.1
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 
17 typedef struct Source * SpecSource;
18 
22  int index;
23 /*@only@*/
24  char * fileName;
25 /*@only@*/
26  char * script;
27 /*@only@*/
28  char * prog;
29 /*@owned@*/
31 };
32 
33 #define RPMBUILD_DEFAULT_LANG "C"
34 
37 struct Source {
38 /*@owned@*/
39  const char * fullSource;
40 /*@dependent@*/ /*@relnull@*/
41  const char * source; /* Pointer into fullSource */
42  int flags;
44 /*@owned@*/
45  struct Source * next;
46 };
47 
50 /*@-typeuse@*/
51 typedef struct ReadLevelEntry {
52  int reading;
53 /*@dependent@*/
54  struct ReadLevelEntry * next;
55 } RLE_t;
56 /*@=typeuse@*/
57 
60 typedef struct OpenFileInfo {
61 /*@only@*/
62  const char * fileName;
63 /*@relnull@*/
65  int lineNum;
66  char readBuf[BUFSIZ];
67 /*@dependent@*/
68  char * readPtr;
69 /*@owned@*/
70  struct OpenFileInfo * next;
71 } OFI_t;
72 
75 typedef struct spectag_s {
76  int t_tag;
77  int t_startx;
78  int t_nlines;
79 /*@only@*/
80  const char * t_lang;
81 /*@only@*/
82  const char * t_msgid;
83 } * spectag;
84 
87 typedef struct spectags_s {
88 /*@owned@*/
90  int st_nalloc;
91  int st_ntags;
92 } * spectags;
93 
96 typedef struct speclines_s {
97 /*@only@*/
98  char **sl_lines;
99  int sl_nalloc;
101 } * speclines;
102 
106 struct Spec_s {
107 /*@only@*/
108  const char * specFile;
109 /*@only@*/
110  const char * buildSubdir;
111 /*@only@*/
112  const char * rootURL;
113 
114 /*@owned@*/ /*@null@*/
116 /*@owned@*/ /*@null@*/
118 
119 /*@owned@*/
121 /*@owned@*/
122  char *lbuf;
123  size_t lbuf_len;
124 /*@dependent@*/
125  char *lbufPtr;
126  char nextpeekc;
127 /*@dependent@*/
128  char * nextline;
129 /*@dependent@*/
130  char * line;
131  int lineNum;
132 
133 /*@owned@*/
135 
136 /*@owned@*/ /*@null@*/
138 /*@only@*/ /*@null@*/
139  const char ** BANames;
140  int BACount;
141  int recursing;
142  int toplevel;
143 
144  int force;
145  int anyarch;
146 
147 /*@null@*/
148  char * passPhrase;
150 /*@null@*/
151  const char * cookie;
152 
153 /*@owned@*/
154  struct Source * sources;
156  int noSource;
157 
158 /*@only@*/
159  const char * sourceRpmName;
160 /*@only@*/
161  unsigned char * sourcePkgId;
162 /*@refcounted@*/
164 /*@refcounted@*/
167 
168 /*@dependent@*/ /*@null@*/
170 
171  rpmRC (*_parseRCPOT) (Spec spec, Package pkg, const char *field, rpmTag tagN,
172  rpmuint32_t index, rpmsenseFlags tagflags);
173 
174 /*@only@*/
176 /*@only@*/
178 /*@only@*/
180 /*@only@*/
182 /*@only@*/
185  size_t nfoo;
186 /*@only@*/ /*@relnull@*/
188 
189 /*@owned@*/
190  Package packages;
191 };
192 
196 struct Package_s {
197 /*@refcounted@*/
199 /*@refcounted@*/
201 /*@refcounted@*/
203 
204  int autoReq;
205  int autoProv;
206  int noarch;
207 
208 /*@only@*/
209  const char * preInFile;
210 /*@only@*/
211  const char * postInFile;
212 /*@only@*/
213  const char * preUnFile;
214 /*@only@*/
215  const char * postUnFile;
216 /*@only@*/
217  const char * preTransFile;
218 /*@only@*/
219  const char * postTransFile;
220 /*@only@*/
221  const char * verifyFile;
222 /*@only@*/
223  const char * sanityCheckFile;
225 /*@only@*/
227 
228 /*@only@*/
230 
231 /*@only@*/
232  const char * fileFile;
233 /*@only@*/
234  rpmiob fileList; /* If NULL, package will not be written */
235 
236 /*@dependent@*/
237  Package next;
238 };
239 
240 #ifdef __cplusplus
241 extern "C" {
242 #endif
243 
248 /*@only@*/
249 Spec newSpec(void)
250  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
251  /*@modifies rpmGlobalMacroContext, internalState @*/;
252 
258 /*@null@*/
259 Spec freeSpec(/*@only@*/ /*@null@*/ Spec spec)
260  /*@globals fileSystem, internalState @*/
261  /*@modifies spec, fileSystem, internalState @*/;
262 
270 int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg)
271  /*@globals rpmCLIMacroContext,
272  rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
273  /*@modifies ts, qva, rpmCLIMacroContext, rpmGlobalMacroContext,
274  fileSystem, internalState @*/;
275 
278 struct OpenFileInfo * newOpenFileInfo(void)
279  /*@*/;
280 
289 spectag stashSt(Spec spec, Header h, rpmTag tag, const char * lang)
290  /*@globals internalState @*/
291  /*@modifies spec->st, internalState @*/;
292 
301 int addSource(Spec spec, Package pkg, const char * field, rpmTag tag)
302  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
303  /*@modifies spec->sources, spec->numSources,
304  spec->st, spec->macros,
305  rpmGlobalMacroContext, fileSystem, internalState @*/;
306 
314 int parseNoSource(Spec spec, const char * field, rpmTag tag)
315  /*@*/;
316 
322 int SpecSourceCount(Spec spec)
323  /*@*/;
324 
331 SpecSource getSource(Spec spec, int num)
332  /*@*/;
333 
339 /*@exposed@*/
340 const char * specSourceName(SpecSource source)
341  /*@*/;
342 
348 /*@exposed@*/
349 const char * specFullSourceName(SpecSource source)
350  /*@*/;
351 
357 int specSourceNum(SpecSource source)
358  /*@*/;
359 
365 int specSourceFlags(SpecSource source)
366  /*@*/;
367 
373 /*@null@*/
374 #if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */
375 const char * getSourceDir(rpmfileAttrs attr, const char *filename)
376 #else
377 const char * getSourceDir(rpmfileAttrs attr)
378 #endif
379  /*@*/;
380 
381 #ifdef __cplusplus
382 }
383 #endif
384 
385 #endif /* _H_SPEC_ */