rpm
4.5
|
00001 #ifndef H_RPMGI 00002 #define H_RPMGI 00003 00008 #include <rpmlib.h> 00009 #include <rpmds.h> 00010 #include <rpmte.h> 00011 #include <rpmts.h> 00012 #include <fts.h> 00013 #include <argv.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 /*@refcounted@*/ 00044 rpmts ts; 00045 int (*tsOrder) (rpmts ts); 00046 int tag; 00047 /*@kept@*/ /*@relnull@*/ 00048 const void * keyp; 00049 size_t keylen; 00051 rpmgiFlags flags; 00052 int active; 00053 int i; 00054 /*@null@*/ 00055 const char * hdrPath; 00056 /*@refcounted@*/ /*@null@*/ 00057 Header h; 00059 /*@null@*/ 00060 rpmtsi tsi; 00061 00062 /*@null@*/ 00063 rpmdbMatchIterator mi; 00064 00065 /*@refcounted@*/ 00066 FD_t fd; 00067 00068 ARGV_t argv; 00069 int argc; 00070 00071 int ftsOpts; 00072 /*@null@*/ 00073 FTS * ftsp; 00074 /*@relnull@*/ 00075 FTSENT * fts; 00076 /*@null@*/ 00077 rpmRC (*walkPathFilter) (rpmgi gi); 00078 /*@null@*/ 00079 rpmRC (*stash) (rpmgi gi, Header h); 00080 00081 /*@refs@*/ 00082 int nrefs; 00083 }; 00084 #endif 00085 00086 #ifdef __cplusplus 00087 extern "C" { 00088 #endif 00089 00092 00099 /*@unused@*/ /*@null@*/ 00100 rpmgi rpmgiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi, 00101 /*@null@*/ const char * msg) 00102 /*@modifies gi @*/; 00103 00105 /*@-exportlocal@*/ 00106 /*@null@*/ 00107 rpmgi XrpmgiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi, 00108 /*@null@*/ const char * msg, const char * fn, unsigned ln) 00109 /*@modifies gi @*/; 00110 /*@=exportlocal@*/ 00111 #define rpmgiUnlink(_gi, _msg) XrpmgiUnlink(_gi, _msg, __FILE__, __LINE__) 00112 00119 /*@unused@*/ /*@newref@*/ /*@null@*/ 00120 rpmgi rpmgiLink (/*@null@*/ rpmgi gi, /*@null@*/ const char * msg) 00121 /*@modifies gi @*/; 00122 00124 /*@-exportlocal@*/ 00125 /*@newref@*/ /*@null@*/ 00126 rpmgi XrpmgiLink (/*@null@*/ rpmgi gi, /*@null@*/ const char * msg, 00127 const char * fn, unsigned ln) 00128 /*@modifies gi @*/; 00129 /*@=exportlocal@*/ 00130 #define rpmgiLink(_gi, _msg) XrpmgiLink(_gi, _msg, __FILE__, __LINE__) 00131 00136 /*@null@*/ 00137 rpmgi rpmgiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi) 00138 /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ 00139 /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/; 00140 00149 /*@null@*/ 00150 rpmgi rpmgiNew(rpmts ts, int tag, /*@kept@*/ /*@null@*/ const void * keyp, 00151 size_t keylen) 00152 /*@globals internalState @*/ 00153 /*@modifies ts, internalState @*/; 00154 00160 rpmRC rpmgiNext(/*@null@*/ rpmgi gi) 00161 /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ 00162 /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/; 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 const char * rpmgiEscapeSpaces(const char * s) 00197 /*@*/; 00198 00207 rpmRC rpmgiSetArgs(/*@null@*/ rpmgi gi, /*@null@*/ ARGV_t argv, 00208 int ftsOpts, rpmgiFlags flags) 00209 /*@globals internalState @*/ 00210 /*@modifies gi, internalState @*/; 00211 00214 #ifdef __cplusplus 00215 } 00216 #endif 00217 00218 #endif /* H_RPMGI */