rpm  5.2.1
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;
60 /*@null@*/
61  rpmtsi tsi;
62 
63 /*@null@*/
64  rpmmi mi;
65 
66 /*@refcounted@*/ /*@relnull@*/
67  FD_t fd;
68 
69  ARGV_t argv;
70  int argc;
71 
72  int ftsOpts;
73 /*@null@*/
74  FTS * ftsp;
75 /*@relnull@*/
76  FTSENT * fts;
77 /*@null@*/
78  rpmRC (*walkPathFilter) (rpmgi gi);
79 /*@null@*/
80  rpmRC (*stash) (rpmgi gi, Header h);
81 
82 #if defined(__LCLINT__)
83 /*@refs@*/
84  int nrefs;
85 #endif
86 };
87 #endif
88 
89 #ifdef __cplusplus
90 extern "C" {
91 #endif
92 
95 
102 /*@unused@*/ /*@null@*/
103 rpmgi rpmgiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi,
104  /*@null@*/ const char * msg)
105  /*@modifies gi @*/;
106 #define rpmgiUnlink(_gi, _msg) \
107  ((rpmgi)rpmioUnlinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__))
108 
115 /*@unused@*/ /*@newref@*/ /*@null@*/
116 rpmgi rpmgiLink (/*@null@*/ rpmgi gi, /*@null@*/ const char * msg)
117  /*@modifies gi @*/;
118 #define rpmgiLink(_gi, _msg) \
119  ((rpmgi)rpmioLinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__))
120 
125 /*@null@*/
126 rpmgi rpmgiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi)
127  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
128  /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/;
129 #define rpmgiFree(_gi) \
130  ((rpmgi)rpmioFreePoolItem((rpmioItem)(_gi), __FUNCTION__, __FILE__, __LINE__))
131 
140 /*@null@*/
141 rpmgi rpmgiNew(rpmts ts, int tag, /*@kept@*/ /*@null@*/ const void * keyp,
142  size_t keylen)
143  /*@globals internalState @*/
144  /*@modifies ts, internalState @*/;
145 
151 rpmRC rpmgiNext(/*@null@*/ rpmgi gi)
152  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
153  /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/;
154 
160 rpmgiFlags rpmgiGetFlags(/*@null@*/ rpmgi gi)
161  /*@*/;
162 
168 /*@observer@*/ /*@null@*/
169 const char * rpmgiHdrPath(/*@null@*/ rpmgi gi)
170  /*@*/;
171 
177 /*@null@*/
178 Header rpmgiHeader(/*@null@*/ rpmgi gi)
179  /*@*/;
180 
186 /*@null@*/
187 rpmts rpmgiTs(/*@null@*/ rpmgi gi)
188  /*@*/;
189 
195 const char * rpmgiEscapeSpaces(const char * s)
196  /*@*/;
197 
206 rpmRC rpmgiSetArgs(/*@null@*/ rpmgi gi, /*@null@*/ ARGV_t argv,
207  int ftsOpts, rpmgiFlags flags)
208  /*@globals internalState @*/
209  /*@modifies gi, internalState @*/;
210 
217 /*@null@*/
218 Header rpmgiReadHeader(rpmgi gi, const char * path)
219  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
220  /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/;
221 
224 #ifdef __cplusplus
225 }
226 #endif
227 
228 #endif /* H_RPMGI */