rpm 5.2.1

lib/rpmgi.h

Go to the documentation of this file.
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;                   
00060 /*@null@*/
00061     rpmtsi tsi;
00062 
00063 /*@null@*/
00064     rpmmi mi;
00065 
00066 /*@refcounted@*/ /*@relnull@*/
00067     FD_t fd;
00068 
00069     ARGV_t argv;
00070     int argc;
00071 
00072     int ftsOpts;
00073 /*@null@*/
00074     FTS * ftsp;
00075 /*@relnull@*/
00076     FTSENT * fts;
00077 /*@null@*/
00078     rpmRC (*walkPathFilter) (rpmgi gi);
00079 /*@null@*/
00080     rpmRC (*stash) (rpmgi gi, Header h);
00081 
00082 #if defined(__LCLINT__)
00083 /*@refs@*/
00084     int nrefs;                  
00085 #endif
00086 };
00087 #endif
00088 
00089 #ifdef __cplusplus
00090 extern "C" {
00091 #endif
00092 
00095 
00102 /*@unused@*/ /*@null@*/
00103 rpmgi rpmgiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi,
00104                 /*@null@*/ const char * msg)
00105         /*@modifies gi @*/;
00106 #define rpmgiUnlink(_gi, _msg)  \
00107     ((rpmgi)rpmioUnlinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__))
00108 
00115 /*@unused@*/ /*@newref@*/ /*@null@*/
00116 rpmgi rpmgiLink (/*@null@*/ rpmgi gi, /*@null@*/ const char * msg)
00117         /*@modifies gi @*/;
00118 #define rpmgiLink(_gi, _msg)    \
00119     ((rpmgi)rpmioLinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__))
00120 
00125 /*@null@*/
00126 rpmgi rpmgiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi)
00127         /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
00128         /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/;
00129 #define rpmgiFree(_gi)  \
00130     ((rpmgi)rpmioFreePoolItem((rpmioItem)(_gi), __FUNCTION__, __FILE__, __LINE__))
00131 
00140 /*@null@*/
00141 rpmgi rpmgiNew(rpmts ts, int tag, /*@kept@*/ /*@null@*/ const void * keyp,
00142                 size_t keylen)
00143         /*@globals internalState @*/
00144         /*@modifies ts, internalState @*/;
00145 
00151 rpmRC rpmgiNext(/*@null@*/ rpmgi gi)
00152         /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
00153         /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/;
00154 
00160 rpmgiFlags rpmgiGetFlags(/*@null@*/ rpmgi gi)
00161         /*@*/;
00162 
00168 /*@observer@*/ /*@null@*/
00169 const char * rpmgiHdrPath(/*@null@*/ rpmgi gi)
00170         /*@*/;
00171 
00177 /*@null@*/
00178 Header rpmgiHeader(/*@null@*/ rpmgi gi)
00179         /*@*/;
00180 
00186 /*@null@*/
00187 rpmts rpmgiTs(/*@null@*/ rpmgi gi)
00188         /*@*/;
00189 
00195 const char * rpmgiEscapeSpaces(const char * s)
00196         /*@*/;
00197 
00206 rpmRC rpmgiSetArgs(/*@null@*/ rpmgi gi, /*@null@*/ ARGV_t argv,
00207                 int ftsOpts, rpmgiFlags flags)
00208         /*@globals internalState @*/
00209         /*@modifies gi, internalState @*/;
00210 
00217 /*@null@*/
00218 Header rpmgiReadHeader(rpmgi gi, const char * path)
00219         /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
00220         /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/;
00221 
00224 #ifdef __cplusplus
00225 }
00226 #endif
00227 
00228 #endif  /* H_RPMGI */