rpm  4.5
rpmgi.h
Go to the documentation of this file.
1 #ifndef H_RPMGI
2 #define H_RPMGI
3 
8 #include <rpmlib.h>
9 #include <rpmds.h>
10 #include <rpmte.h>
11 #include <rpmts.h>
12 #include <fts.h>
13 #include <argv.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 /*@refcounted@*/
44  rpmts ts;
45  int (*tsOrder) (rpmts ts);
46  int tag;
47 /*@kept@*/ /*@relnull@*/
48  const void * keyp;
49  size_t keylen;
51  rpmgiFlags flags;
52  int active;
53  int i;
54 /*@null@*/
55  const char * hdrPath;
56 /*@refcounted@*/ /*@null@*/
57  Header h;
59 /*@null@*/
60  rpmtsi tsi;
61 
62 /*@null@*/
64 
65 /*@refcounted@*/
66  FD_t fd;
67 
68  ARGV_t argv;
69  int argc;
70 
71  int ftsOpts;
72 /*@null@*/
73  FTS * ftsp;
74 /*@relnull@*/
75  FTSENT * fts;
76 /*@null@*/
77  rpmRC (*walkPathFilter) (rpmgi gi);
78 /*@null@*/
79  rpmRC (*stash) (rpmgi gi, Header h);
80 
81 /*@refs@*/
82  int nrefs;
83 };
84 #endif
85 
86 #ifdef __cplusplus
87 extern "C" {
88 #endif
89 
92 
99 /*@unused@*/ /*@null@*/
100 rpmgi rpmgiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi,
101  /*@null@*/ const char * msg)
102  /*@modifies gi @*/;
103 
105 /*@-exportlocal@*/
106 /*@null@*/
107 rpmgi XrpmgiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi,
108  /*@null@*/ const char * msg, const char * fn, unsigned ln)
109  /*@modifies gi @*/;
110 /*@=exportlocal@*/
111 #define rpmgiUnlink(_gi, _msg) XrpmgiUnlink(_gi, _msg, __FILE__, __LINE__)
112 
119 /*@unused@*/ /*@newref@*/ /*@null@*/
120 rpmgi rpmgiLink (/*@null@*/ rpmgi gi, /*@null@*/ const char * msg)
121  /*@modifies gi @*/;
122 
124 /*@-exportlocal@*/
125 /*@newref@*/ /*@null@*/
126 rpmgi XrpmgiLink (/*@null@*/ rpmgi gi, /*@null@*/ const char * msg,
127  const char * fn, unsigned ln)
128  /*@modifies gi @*/;
129 /*@=exportlocal@*/
130 #define rpmgiLink(_gi, _msg) XrpmgiLink(_gi, _msg, __FILE__, __LINE__)
131 
136 /*@null@*/
137 rpmgi rpmgiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi)
138  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
139  /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/;
140 
149 /*@null@*/
150 rpmgi rpmgiNew(rpmts ts, int tag, /*@kept@*/ /*@null@*/ const void * keyp,
151  size_t keylen)
152  /*@globals internalState @*/
153  /*@modifies ts, internalState @*/;
154 
160 rpmRC rpmgiNext(/*@null@*/ rpmgi gi)
161  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
162  /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/;
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 const char * rpmgiEscapeSpaces(const char * s)
197  /*@*/;
198 
207 rpmRC rpmgiSetArgs(/*@null@*/ rpmgi gi, /*@null@*/ ARGV_t argv,
208  int ftsOpts, rpmgiFlags flags)
209  /*@globals internalState @*/
210  /*@modifies gi, internalState @*/;
211 
214 #ifdef __cplusplus
215 }
216 #endif
217 
218 #endif /* H_RPMGI */