rpm  5.4.10
rpmgi.h
Go to the documentation of this file.
1 #ifndef H_RPMGI
2 #define H_RPMGI
3 
8 #include <fts.h>
9 #include <argv.h>
10 #include <rpmtypes.h>
11 #include <rpmds.h>
12 #include <rpmte.h>
13 #include <rpmts.h>
14 
17 /*@-exportlocal@*/
18 /*@unchecked@*/
19 extern int _rpmgi_debug;
20 /*@=exportlocal@*/
21 
24 typedef enum rpmgiFlags_e {
26  RPMGI_TSADD = (1 << 0),
27  RPMGI_TSORDER = (1 << 1),
28  RPMGI_NOGLOB = (1 << 2),
29  RPMGI_NOMANIFEST = (1 << 3),
30  RPMGI_NOHEADER = (1 << 4),
31  RPMGI_ERASING = (1 << 5)
32 } rpmgiFlags;
33 
36 /*@unchecked@*/
37 extern rpmgiFlags giFlags;
38 
39 #if defined(_RPMGI_INTERNAL)
40 
42 struct rpmgi_s {
43  struct rpmioItem_s _item;
44 /*@refcounted@*/
45  rpmts ts;
46  int (*tsOrder) (rpmts ts);
47  rpmTag tag;
48 /*@kept@*/ /*@relnull@*/
49  const void * keyp;
50  size_t keylen;
52  rpmgiFlags flags;
53  int active;
54  int i;
55 /*@null@*/
56  const char * hdrPath;
57 /*@refcounted@*/ /*@null@*/
58  Header h;
59  int rc;
61 /*@null@*/
62  rpmtsi tsi;
63 
64 /*@null@*/
65  rpmmi mi;
66 
67 /*@refcounted@*/ /*@relnull@*/
68  FD_t fd;
69 
70  ARGV_t argv;
71  int argc;
72 
73  int ftsOpts;
74 /*@null@*/
75  FTS * ftsp;
76 /*@relnull@*/
77  FTSENT * fts;
78 /*@null@*/
79  rpmRC (*walkPathFilter) (rpmgi gi);
80 /*@null@*/
81  rpmRC (*stash) (rpmgi gi, Header h);
82 
83 #if defined(__LCLINT__)
84 /*@refs@*/
85  int nrefs;
86 #endif
87 };
88 #endif
89 
90 #ifdef __cplusplus
91 extern "C" {
92 #endif
93 
96 
103 /*@unused@*/ /*@null@*/
104 rpmgi rpmgiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi,
105  /*@null@*/ const char * msg)
106  /*@modifies gi @*/;
107 #define rpmgiUnlink(_gi, _msg) \
108  ((rpmgi)rpmioUnlinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__))
109 
116 /*@unused@*/ /*@newref@*/ /*@null@*/
117 rpmgi rpmgiLink (/*@null@*/ rpmgi gi, /*@null@*/ const char * msg)
118  /*@modifies gi @*/;
119 #define rpmgiLink(_gi, _msg) \
120  ((rpmgi)rpmioLinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__))
121 
126 /*@null@*/
127 rpmgi rpmgiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi)
128  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
129  /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/;
130 #define rpmgiFree(_gi) \
131  ((rpmgi)rpmioFreePoolItem((rpmioItem)(_gi), __FUNCTION__, __FILE__, __LINE__))
132 
141 /*@null@*/
142 rpmgi rpmgiNew(rpmts ts, int tag, /*@kept@*/ /*@null@*/ const void * keyp,
143  size_t keylen)
144  /*@globals internalState @*/
145  /*@modifies ts, internalState @*/;
146 
152 rpmRC rpmgiNext(/*@null@*/ rpmgi gi)
153  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
154  /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/;
155 
161 rpmgiFlags rpmgiGetFlags(/*@null@*/ rpmgi gi)
162  /*@*/;
163 
169 /*@observer@*/ /*@null@*/
170 const char * rpmgiHdrPath(/*@null@*/ rpmgi gi)
171  /*@*/;
172 
178 /*@null@*/
179 Header rpmgiHeader(/*@null@*/ rpmgi gi)
180  /*@*/;
181 
187 /*@null@*/
188 rpmts rpmgiTs(/*@null@*/ rpmgi gi)
189  /*@*/;
190 
196 /*@null@*/
197 int rpmgiRc(/*@null@*/ rpmgi gi)
198  /*@*/;
199 
205 const char * rpmgiEscapeSpaces(const char * s)
206  /*@*/;
207 
216 rpmRC rpmgiSetArgs(/*@null@*/ rpmgi gi, /*@null@*/ ARGV_t argv,
217  int ftsOpts, rpmgiFlags flags)
218  /*@globals internalState @*/
219  /*@modifies gi, internalState @*/;
220 
227 /*@null@*/
228 Header rpmgiReadHeader(rpmgi gi, const char * path)
229  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
230  /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/;
231 
234 #ifdef __cplusplus
235 }
236 #endif
237 
238 #endif /* H_RPMGI */