rpm  5.2.1
rpmsx.h
Go to the documentation of this file.
1 #ifndef H_RPMSX
2 #define H_RPMSX
3 
9 #if defined(WITH_PCRE) && defined(WITH_PCRE_POSIX)
10 #include <pcreposix.h>
11 #else
12 #include <regex.h>
13 #endif
14 
17 /*@-exportlocal@*/
18 /*@unchecked@*/
19 extern int _rpmsx_debug;
20 /*@=exportlocal@*/
21 
24 /*@-exportlocal@*/
25 /*@unchecked@*/
26 extern int _rpmsx_nopromote;
27 /*@=exportlocal@*/
28 
29 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmsx_s * rpmsx;
30 typedef struct rpmsxp_s * rpmsxp;
31 typedef struct rpmsxs_s * rpmsxs;
32 
33 #if defined(_RPMSX_INTERNAL)
34 
37 struct rpmsxp_s {
38 /*@only@*/ /*@relnull@*/
39  const char * pattern;
40 /*@only@*/ /*@relnull@*/
41  const char * type;
42 /*@only@*/ /*@relnull@*/
43  const char * context;
44 /*@only@*/ /*@relnull@*/
45  regex_t * preg;
46  mode_t fmode;
47  int matches;
48  int hasMetaChars;
49  int fstem;
50 };
51 
55 struct rpmsxs_s {
56 /*@only@*/ /*@relnull@*/
57  const char * stem;
58  size_t len;
59 };
60 
64 struct rpmsx_s {
65  struct rpmioItem_s _item;
66 /*@only@*/ /*@relnull@*/
67  rpmsxp sxp;
68  int Count;
69  int i;
70 /*@only@*/ /*@relnull@*/
71  rpmsxs sxs;
72  int nsxs;
73  int maxsxs;
74  int reverse;
75 #if defined(__LCLINT__)
76 /*@refs@*/
77  int nrefs;
78 #endif
79 };
80 #endif /* defined(_RPMSX_INTERNAL) */
81 
82 #ifdef __cplusplus
83 extern "C" {
84 #endif
85 
92 /*@unused@*/ /*@null@*/
93 rpmsx rpmsxUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmsx sx,
94  /*@null@*/ const char * msg)
95  /*@modifies sx @*/;
96 #define rpmsxUnlink(_sx, _msg) \
97  ((rpmsx)rpmioUnlinkPoolItem((rpmioItem)(_sx), _msg, __FILE__, __LINE__))
98 
105 /*@unused@*/ /*@newref@*/ /*@null@*/
106 rpmsx rpmsxLink (/*@null@*/ rpmsx sx, /*@null@*/ const char * msg)
107  /*@modifies sx @*/;
108 #define rpmsxLink(_sx, _msg) \
109  ((rpmsx)rpmioLinkPoolItem((rpmioItem)(_sx), _msg, __FILE__, __LINE__))
110 
116 /*@null@*/
117 rpmsx rpmsxFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmsx sx)
118  /*@modifies sx@*/;
119 #define rpmsxFree(_sx) \
120  ((rpmsx)rpmioFreePoolItem((rpmioItem)(_sx), __FUNCTION__, __FILE__, __LINE__))
121 
128 /*@-exportlocal@*/
129 int rpmsxParse(rpmsx sx, /*@null@*/ const char *fn)
130  /*@globals rpmGlobalMacroContext, h_errno,
131  fileSystem, internalState @*/
132  /*@modifies sx, rpmGlobalMacroContext, h_errno,
133  fileSystem, internalState @*/;
134 /*@=exportlocal@*/
135 
141 /*@null@*/
142 rpmsx rpmsxNew(const char * fn)
143  /*@globals rpmGlobalMacroContext, h_errno,
144  fileSystem, internalState @*/
145  /*@modifies rpmGlobalMacroContext, h_errno,
146  fileSystem, internalState @*/;
147 
153 int rpmsxCount(/*@null@*/ const rpmsx sx)
154  /*@*/;
155 
161 int rpmsxIx(/*@null@*/ const rpmsx sx)
162  /*@*/;
163 
170 int rpmsxSetIx(/*@null@*/ rpmsx sx, int ix)
171  /*@modifies sx @*/;
172 
178 /*@-exportlocal@*/
179 /*@observer@*/ /*@null@*/
180 extern const char * rpmsxPattern(/*@null@*/ const rpmsx sx)
181  /*@*/;
182 /*@=exportlocal@*/
183 
189 /*@-exportlocal@*/
190 /*@observer@*/ /*@null@*/
191 extern const char * rpmsxType(/*@null@*/ const rpmsx sx)
192  /*@*/;
193 /*@=exportlocal@*/
194 
200 /*@-exportlocal@*/
201 /*@observer@*/ /*@null@*/
202 extern const char * rpmsxContext(/*@null@*/ const rpmsx sx)
203  /*@*/;
204 /*@=exportlocal@*/
205 
211 /*@-exportlocal@*/
212 /*@observer@*/ /*@null@*/
213 extern regex_t * rpmsxRE(/*@null@*/ const rpmsx sx)
214  /*@*/;
215 /*@=exportlocal@*/
216 
222 /*@-exportlocal@*/
223 extern mode_t rpmsxFMode(/*@null@*/ const rpmsx sx)
224  /*@*/;
225 /*@=exportlocal@*/
226 
232 /*@-exportlocal@*/
233 extern int rpmsxFStem(/*@null@*/ const rpmsx sx)
234  /*@*/;
235 /*@=exportlocal@*/
236 
242 /*@-exportlocal@*/
243 int rpmsxNext(/*@null@*/ rpmsx sx)
244  /*@modifies sx @*/;
245 /*@=exportlocal@*/
246 
253 /*@-exportlocal@*/
254 /*@null@*/
255 rpmsx rpmsxInit(/*@null@*/ rpmsx sx, int reverse)
256  /*@modifies sx @*/;
257 /*@=exportlocal@*/
258 
266 /*@owned@*/ /*@null@*/
267 const char * rpmsxFContext(/*@null@*/ rpmsx sx, const char * fn, mode_t fmode)
268  /*@modifies sx @*/;
269 
270 #ifdef __cplusplus
271 }
272 #endif
273 
274 #endif /* H_RPMSX */