rpm 5.3.12
|
00001 #ifndef H_RPMGI 00002 #define H_RPMGI 00003 00008 #include <fts.h> 00009 #include <argv.h> 00010 #include <rpmtypes.h> 00011 #include <rpmds.h> 00012 #include <rpmte.h> 00013 #include <rpmts.h> 00014 00017 /*@-exportlocal@*/ 00018 /*@unchecked@*/ 00019 extern int _rpmgi_debug; 00020 /*@=exportlocal@*/ 00021 00024 typedef enum rpmgiFlags_e { 00025 RPMGI_NONE = 0, 00026 RPMGI_TSADD = (1 << 0), 00027 RPMGI_TSORDER = (1 << 1), 00028 RPMGI_NOGLOB = (1 << 2), 00029 RPMGI_NOMANIFEST = (1 << 3), 00030 RPMGI_NOHEADER = (1 << 4), 00031 RPMGI_ERASING = (1 << 5) 00032 } rpmgiFlags; 00033 00036 /*@unchecked@*/ 00037 extern rpmgiFlags giFlags; 00038 00039 #if defined(_RPMGI_INTERNAL) 00040 00042 struct rpmgi_s { 00043 struct rpmioItem_s _item; 00044 /*@refcounted@*/ 00045 rpmts ts; 00046 int (*tsOrder) (rpmts ts); 00047 rpmTag tag; 00048 /*@kept@*/ /*@relnull@*/ 00049 const void * keyp; 00050 size_t keylen; 00052 rpmgiFlags flags; 00053 int active; 00054 int i; 00055 /*@null@*/ 00056 const char * hdrPath; 00057 /*@refcounted@*/ /*@null@*/ 00058 Header h; 00059 int rc; 00061 /*@null@*/ 00062 rpmtsi tsi; 00063 00064 /*@null@*/ 00065 rpmmi mi; 00066 00067 /*@refcounted@*/ /*@relnull@*/ 00068 FD_t fd; 00069 00070 ARGV_t argv; 00071 int argc; 00072 00073 int ftsOpts; 00074 /*@null@*/ 00075 FTS * ftsp; 00076 /*@relnull@*/ 00077 FTSENT * fts; 00078 /*@null@*/ 00079 rpmRC (*walkPathFilter) (rpmgi gi); 00080 /*@null@*/ 00081 rpmRC (*stash) (rpmgi gi, Header h); 00082 00083 #if defined(__LCLINT__) 00084 /*@refs@*/ 00085 int nrefs; 00086 #endif 00087 }; 00088 #endif 00089 00090 #ifdef __cplusplus 00091 extern "C" { 00092 #endif 00093 00096 00103 /*@unused@*/ /*@null@*/ 00104 rpmgi rpmgiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi, 00105 /*@null@*/ const char * msg) 00106 /*@modifies gi @*/; 00107 #define rpmgiUnlink(_gi, _msg) \ 00108 ((rpmgi)rpmioUnlinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__)) 00109 00116 /*@unused@*/ /*@newref@*/ /*@null@*/ 00117 rpmgi rpmgiLink (/*@null@*/ rpmgi gi, /*@null@*/ const char * msg) 00118 /*@modifies gi @*/; 00119 #define rpmgiLink(_gi, _msg) \ 00120 ((rpmgi)rpmioLinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__)) 00121 00126 /*@null@*/ 00127 rpmgi rpmgiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi) 00128 /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ 00129 /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/; 00130 #define rpmgiFree(_gi) \ 00131 ((rpmgi)rpmioFreePoolItem((rpmioItem)(_gi), __FUNCTION__, __FILE__, __LINE__)) 00132 00141 /*@null@*/ 00142 rpmgi rpmgiNew(rpmts ts, int tag, /*@kept@*/ /*@null@*/ const void * keyp, 00143 size_t keylen) 00144 /*@globals internalState @*/ 00145 /*@modifies ts, internalState @*/; 00146 00152 rpmRC rpmgiNext(/*@null@*/ rpmgi gi) 00153 /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ 00154 /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/; 00155 00161 rpmgiFlags rpmgiGetFlags(/*@null@*/ rpmgi gi) 00162 /*@*/; 00163 00169 /*@observer@*/ /*@null@*/ 00170 const char * rpmgiHdrPath(/*@null@*/ rpmgi gi) 00171 /*@*/; 00172 00178 /*@null@*/ 00179 Header rpmgiHeader(/*@null@*/ rpmgi gi) 00180 /*@*/; 00181 00187 /*@null@*/ 00188 rpmts rpmgiTs(/*@null@*/ rpmgi gi) 00189 /*@*/; 00190 00196 /*@null@*/ 00197 int rpmgiRc(/*@null@*/ rpmgi gi) 00198 /*@*/; 00199 00205 const char * rpmgiEscapeSpaces(const char * s) 00206 /*@*/; 00207 00216 rpmRC rpmgiSetArgs(/*@null@*/ rpmgi gi, /*@null@*/ ARGV_t argv, 00217 int ftsOpts, rpmgiFlags flags) 00218 /*@globals internalState @*/ 00219 /*@modifies gi, internalState @*/; 00220 00227 /*@null@*/ 00228 Header rpmgiReadHeader(rpmgi gi, const char * path) 00229 /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ 00230 /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/; 00231 00234 #ifdef __cplusplus 00235 } 00236 #endif 00237 00238 #endif /* H_RPMGI */