rpm 5.3.12
lib/rpmfc.h
Go to the documentation of this file.
00001 #ifndef _H_RPMFC_
00002 #define _H_RPMFC_
00003 
00004 /*@-exportlocal@*/
00005 /*@unchecked@*/
00006 extern int _rpmfc_debug;
00007 /*@=exportlocal@*/
00008 
00011 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmfc_s * rpmfc;
00012 
00015 typedef struct rpmfcTokens_s * rpmfcToken;
00016 
00019 typedef enum FCOLOR_e {
00020     RPMFC_BLACK                 = 0,
00021     RPMFC_ELF32                 = (1 <<  0),
00022     RPMFC_ELF64                 = (1 <<  1),
00023     RPMFC_ELFMIPSN32            = (1 <<  2),
00024 #define RPMFC_ELF       (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)
00025         /* (1 << 3) leaks into package headers, reserved */
00026 
00027         /* bits 4-6 unused */
00028     RPMFC_RUBY                  = (1 <<  7),
00029     RPMFC_PKGCONFIG             = (1 <<  8),
00030     RPMFC_LIBTOOL               = (1 <<  9),
00031     RPMFC_BOURNE                = (1 << 10),
00032     RPMFC_MONO                  = (1 << 11),
00033 
00034     RPMFC_SCRIPT                = (1 << 12),
00035     RPMFC_STATIC                = (1 << 13),
00036     RPMFC_NOTSTRIPPED           = (1 << 14),
00037         /* bit 15 unused */
00038 
00039         /* bits 16-19 are enumerated, not bits */
00040     RPMFC_DIRECTORY             = (1 << 16),
00041     RPMFC_SYMLINK               = (2 << 16),
00042     RPMFC_DEVICE                = (3 << 16),
00043     RPMFC_LIBRARY               = (4 << 16),
00044     RPMFC_FONT                  = (5 << 16),
00045     RPMFC_IMAGE                 = (6 << 16),
00046     RPMFC_MANPAGE               = (7 << 16),
00047     RPMFC_TEXT                  = (8 << 16),
00048     RPMFC_DOCUMENT              = (9 << 16),
00049 
00050     RPMFC_ARCHIVE               = (1 << 20),
00051     RPMFC_COMPRESSED            = (1 << 21),
00052     RPMFC_MODULE                = (1 << 22),
00053     RPMFC_EXECUTABLE            = (1 << 23),
00054 
00055     RPMFC_PERL                  = (1 << 24),
00056     RPMFC_JAVA                  = (1 << 25),
00057     RPMFC_PYTHON                = (1 << 26),
00058     RPMFC_PHP                   = (1 << 27),
00059     RPMFC_TCL                   = (1 << 28),
00060 
00061     RPMFC_WHITE                 = (1 << 29),
00062     RPMFC_INCLUDE               = (1 << 30),
00063     RPMFC_ERROR                 = (1 << 31)
00064 } FCOLOR_t;
00065 
00066 #if defined(_RPMFC_INTERNAL)
00067 
00069 struct rpmfc_s {
00070     struct rpmioItem_s _item;   
00071     size_t nfiles;      
00072     size_t fknown;      
00073     size_t fwhite;      
00074     size_t ix;          
00075     int skipProv;       
00076     int skipReq;        
00077     int tracked;        
00078     size_t brlen;       
00080     ARGV_t fn;          
00081     ARGI_t fcolor;      
00082     ARGI_t fcdictx;     
00083     ARGI_t fddictx;     
00084     ARGI_t fddictn;     
00085     ARGV_t cdict;       
00086     ARGV_t ddict;       
00087     ARGI_t ddictx;      
00089 /*@relnull@*/
00090     rpmds provides;     
00091 /*@relnull@*/
00092     rpmds requires;     
00094     rpmiob iob_java;    
00095     rpmiob iob_perl;    
00096     rpmiob iob_python;  
00097     rpmiob iob_php;     
00099 /*@null@*/
00100     void * Pmires;      
00101     int Pnmire;
00102 /*@null@*/
00103     void * PFmires;     
00104     int PFnmire;
00105 /*@null@*/
00106     void * Rmires;      
00107     int Rnmire;
00108 /*@null@*/
00109     void * RFmires;     
00110     int RFnmire;
00111 
00112 };
00113 
00116 struct rpmfcTokens_s {
00117 /*@observer@*/
00118     const char * token;
00119     int colors;
00120 };
00121 #endif
00122 
00123 #ifdef __cplusplus
00124 extern "C" {
00125 #endif
00126 
00134 int rpmfcExec(const char ** av, rpmiob iob_stdin, /*@out@*/ rpmiob * iob_stdoutp,
00135                 int failnonzero)
00136         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00137         /*@modifies *iob_stdoutp, rpmGlobalMacroContext,
00138                 fileSystem, internalState @*/
00139         /*@requires maxSet(iob_stdoutp) >= 0 @*/;
00140 
00146 /*@-exportlocal@*/
00147 int rpmfcColoring(const char * fmstr)
00148         /*@*/;
00149 /*@=exportlocal@*/
00150 
00158 /*@-exportlocal@*/
00159 void rpmfcPrint(/*@null@*/ const char * msg, rpmfc fc, /*@null@*/ FILE * fp)
00160         /*@globals fileSystem @*/
00161         /*@modifies *fp, fc, fileSystem @*/;
00162 /*@=exportlocal@*/
00163 
00171 /*@-exportlocal@*/
00172 rpmRC rpmfcClassify(rpmfc fc, const char ** argv, /*@null@*/ rpmuint16_t * fmode)
00173         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00174         /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/;
00175 /*@=exportlocal@*/
00176 
00182 /*@-exportlocal@*/
00183 rpmRC rpmfcApply(rpmfc fc)
00184         /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
00185         /*@modifies fc, rpmGlobalMacroContext, internalState @*/;
00186 /*@=exportlocal@*/
00187 
00194 rpmRC rpmfcGenerateDepends(void * specp, void * pkgp)
00195         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00196         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
00197 
00203 /*@unused@*/ /*@null@*/
00204 rpmfc rpmfcUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmfc fc)
00205         /*@modifies fc @*/;
00206 #define rpmfcUnlink(_fc)        \
00207         ((rpmfc)rpmioUnlinkPoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__))
00208 
00214 /*@unused@*/ /*@newref@*/ /*@null@*/
00215 rpmfc rpmfcLink (/*@null@*/ rpmfc fc)
00216         /*@modifies fc @*/;
00217 #define rpmfcLink(_fc)  \
00218         ((rpmfc)rpmioLinkPoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__))
00219 
00225 /*@null@*/
00226 rpmfc rpmfcFree(/*@only@*/ /*@null@*/ rpmfc fc)
00227         /*@modifies fc @*/;
00228 #define rpmfcFree(_fc)  \
00229         ((rpmfc)rpmioFreePoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__))
00230 
00235 /*@-exportlocal@*/
00236 rpmfc rpmfcNew(void)
00237         /*@*/;
00238 /*@=exportlocal@*/
00239 
00240 #ifdef __cplusplus
00241 }
00242 #endif
00243 
00244 #endif /* _H_RPMFC_ */