rpm  4.5
rpmsx.h
Go to the documentation of this file.
1 #ifndef H_RPMSX
2 #define H_RPMSX
3 
9 #include <regex.h>
10 
13 /*@-exportlocal@*/
14 /*@unchecked@*/
15 extern int _rpmsx_debug;
16 /*@=exportlocal@*/
17 
20 /*@-exportlocal@*/
21 /*@unchecked@*/
22 extern int _rpmsx_nopromote;
23 /*@=exportlocal@*/
24 
25 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmsx_s * rpmsx;
26 typedef struct rpmsxp_s * rpmsxp;
27 typedef struct rpmsxs_s * rpmsxs;
28 
29 #if defined(_RPMSX_INTERNAL)
30 
33 struct rpmsxp_s {
34 /*@only@*/ /*@relnull@*/
35  const char * pattern;
36 /*@only@*/ /*@relnull@*/
37  const char * type;
38 /*@only@*/ /*@relnull@*/
39  const char * context;
40 /*@only@*/ /*@relnull@*/
41  regex_t * preg;
42  mode_t fmode;
43  int matches;
44  int hasMetaChars;
45  int fstem;
46 };
47 
51 struct rpmsxs_s {
52 /*@only@*/ /*@relnull@*/
53  const char * stem;
54  int len;
55 };
56 
60 struct rpmsx_s {
61 /*@only@*/ /*@relnull@*/
62  rpmsxp sxp;
63  int Count;
64  int i;
65 /*@only@*/ /*@relnull@*/
66  rpmsxs sxs;
67  int nsxs;
68  int maxsxs;
69  int reverse;
70 /*@refs@*/
71  int nrefs;
72 };
73 #endif /* defined(_RPMSX_INTERNAL) */
74 
75 #ifdef __cplusplus
76 extern "C" {
77 #endif
78 
85 /*@unused@*/ /*@null@*/
86 rpmsx rpmsxUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmsx sx,
87  /*@null@*/ const char * msg)
88  /*@modifies sx @*/;
89 
91 /*@-exportlocal@*/
92 /*@null@*/
93 rpmsx XrpmsxUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmsx sx,
94  /*@null@*/ const char * msg, const char * fn, unsigned ln)
95  /*@modifies sx @*/;
96 /*@=exportlocal@*/
97 #define rpmsxUnlink(_sx, _msg) XrpmsxUnlink(_sx, _msg, __FILE__, __LINE__)
98 
105 /*@-exportlocal@*/
106 /*@unused@*/ /*@newref@*/ /*@null@*/
107 rpmsx rpmsxLink (/*@null@*/ rpmsx sx, /*@null@*/ const char * msg)
108  /*@modifies sx @*/;
109 
111 /*@newref@*/ /*@null@*/
112 rpmsx XrpmsxLink (/*@null@*/ rpmsx sx, /*@null@*/ const char * msg,
113  const char * fn, unsigned ln)
114  /*@modifies sx @*/;
115 /*@=exportlocal@*/
116 #define rpmsxLink(_sx, _msg) XrpmsxLink(_sx, _msg, __FILE__, __LINE__)
117 
123 /*@-exportlocal@*/
124 /*@null@*/
125 rpmsx rpmsxFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmsx sx)
126  /*@modifies sx@*/;
127 /*@=exportlocal@*/
128 
135 /*@-exportlocal@*/
136 int rpmsxParse(rpmsx sx, /*@null@*/ const char *fn)
137  /*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/
138  /*@modifies sx, rpmGlobalMacroContext, h_errno, fileSystem @*/;
139 /*@=exportlocal@*/
140 
146 /*@null@*/
147 rpmsx rpmsxNew(const char * fn)
148  /*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/
149  /*@modifies rpmGlobalMacroContext, h_errno, fileSystem @*/;
150 
156 int rpmsxCount(/*@null@*/ const rpmsx sx)
157  /*@*/;
158 
164 int rpmsxIx(/*@null@*/ const rpmsx sx)
165  /*@*/;
166 
173 int rpmsxSetIx(/*@null@*/ rpmsx sx, int ix)
174  /*@modifies sx @*/;
175 
181 /*@-exportlocal@*/
182 /*@observer@*/ /*@null@*/
183 extern const char * rpmsxPattern(/*@null@*/ const rpmsx sx)
184  /*@*/;
185 /*@=exportlocal@*/
186 
192 /*@-exportlocal@*/
193 /*@observer@*/ /*@null@*/
194 extern const char * rpmsxType(/*@null@*/ const rpmsx sx)
195  /*@*/;
196 /*@=exportlocal@*/
197 
203 /*@-exportlocal@*/
204 /*@observer@*/ /*@null@*/
205 extern const char * rpmsxContext(/*@null@*/ const rpmsx sx)
206  /*@*/;
207 /*@=exportlocal@*/
208 
214 /*@-exportlocal@*/
215 /*@observer@*/ /*@null@*/
216 extern regex_t * rpmsxRE(/*@null@*/ const rpmsx sx)
217  /*@*/;
218 /*@=exportlocal@*/
219 
225 /*@-exportlocal@*/
226 extern mode_t rpmsxFMode(/*@null@*/ const rpmsx sx)
227  /*@*/;
228 /*@=exportlocal@*/
229 
235 /*@-exportlocal@*/
236 extern int rpmsxFStem(/*@null@*/ const rpmsx sx)
237  /*@*/;
238 /*@=exportlocal@*/
239 
245 /*@-exportlocal@*/
246 int rpmsxNext(/*@null@*/ rpmsx sx)
247  /*@modifies sx @*/;
248 /*@=exportlocal@*/
249 
256 /*@-exportlocal@*/
257 /*@null@*/
258 rpmsx rpmsxInit(/*@null@*/ rpmsx sx, int reverse)
259  /*@modifies sx @*/;
260 /*@=exportlocal@*/
261 
269 /*@owned@*/ /*@null@*/
270 const char * rpmsxFContext(/*@null@*/ rpmsx sx, const char * fn, mode_t fmode)
271  /*@modifies sx @*/;
272 
273 #ifdef __cplusplus
274 }
275 #endif
276 
277 #endif /* H_RPMSX */