rpm 5.3.7

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-7 unused */
00028     RPMFC_PKGCONFIG             = (1 <<  8),
00029     RPMFC_LIBTOOL               = (1 <<  9),
00030     RPMFC_BOURNE                = (1 << 10),
00031     RPMFC_MONO                  = (1 << 11),
00032 
00033     RPMFC_SCRIPT                = (1 << 12),
00034     RPMFC_STATIC                = (1 << 13),
00035     RPMFC_NOTSTRIPPED           = (1 << 14),
00036         /* bit 15 unused */
00037 
00038         /* bits 16-19 are enumerated, not bits */
00039     RPMFC_DIRECTORY             = (1 << 16),
00040     RPMFC_SYMLINK               = (2 << 16),
00041     RPMFC_DEVICE                = (3 << 16),
00042     RPMFC_LIBRARY               = (4 << 16),
00043     RPMFC_FONT                  = (5 << 16),
00044     RPMFC_IMAGE                 = (6 << 16),
00045     RPMFC_MANPAGE               = (7 << 16),
00046     RPMFC_TEXT                  = (8 << 16),
00047     RPMFC_DOCUMENT              = (9 << 16),
00048 
00049     RPMFC_ARCHIVE               = (1 << 20),
00050     RPMFC_COMPRESSED            = (1 << 21),
00051     RPMFC_MODULE                = (1 << 22),
00052     RPMFC_EXECUTABLE            = (1 << 23),
00053 
00054     RPMFC_PERL                  = (1 << 24),
00055     RPMFC_JAVA                  = (1 << 25),
00056     RPMFC_PYTHON                = (1 << 26),
00057     RPMFC_PHP                   = (1 << 27),
00058     RPMFC_TCL                   = (1 << 28),
00059 
00060     RPMFC_WHITE                 = (1 << 29),
00061     RPMFC_INCLUDE               = (1 << 30),
00062     RPMFC_ERROR                 = (1 << 31)
00063 } FCOLOR_t;
00064 
00065 #if defined(_RPMFC_INTERNAL)
00066 
00068 struct rpmfc_s {
00069     struct rpmioItem_s _item;   
00070     size_t nfiles;      
00071     size_t fknown;      
00072     size_t fwhite;      
00073     size_t ix;          
00074     int skipProv;       
00075     int skipReq;        
00076     int tracked;        
00077     size_t brlen;       
00079     ARGV_t fn;          
00080     ARGI_t fcolor;      
00081     ARGI_t fcdictx;     
00082     ARGI_t fddictx;     
00083     ARGI_t fddictn;     
00084     ARGV_t cdict;       
00085     ARGV_t ddict;       
00086     ARGI_t ddictx;      
00088 /*@relnull@*/
00089     rpmds provides;     
00090 /*@relnull@*/
00091     rpmds requires;     
00093     rpmiob iob_java;    
00094     rpmiob iob_perl;    
00095     rpmiob iob_python;  
00096     rpmiob iob_php;     
00098 /*@null@*/
00099     void * Pmires;      
00100     int Pnmire;
00101 /*@null@*/
00102     void * PFmires;     
00103     int PFnmire;
00104 /*@null@*/
00105     void * Rmires;      
00106     int Rnmire;
00107 /*@null@*/
00108     void * RFmires;     
00109     int RFnmire;
00110 
00111 };
00112 
00115 struct rpmfcTokens_s {
00116 /*@observer@*/
00117     const char * token;
00118     int colors;
00119 };
00120 #endif
00121 
00122 #ifdef __cplusplus
00123 extern "C" {
00124 #endif
00125 
00133 int rpmfcExec(const char ** av, rpmiob iob_stdin, /*@out@*/ rpmiob * iob_stdoutp,
00134                 int failnonzero)
00135         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00136         /*@modifies *iob_stdoutp, rpmGlobalMacroContext,
00137                 fileSystem, internalState @*/
00138         /*@requires maxSet(iob_stdoutp) >= 0 @*/;
00139 
00145 /*@-exportlocal@*/
00146 int rpmfcColoring(const char * fmstr)
00147         /*@*/;
00148 /*@=exportlocal@*/
00149 
00157 /*@-exportlocal@*/
00158 void rpmfcPrint(/*@null@*/ const char * msg, rpmfc fc, /*@null@*/ FILE * fp)
00159         /*@globals fileSystem @*/
00160         /*@modifies *fp, fc, fileSystem @*/;
00161 /*@=exportlocal@*/
00162 
00170 /*@-exportlocal@*/
00171 rpmRC rpmfcClassify(rpmfc fc, const char ** argv, /*@null@*/ rpmuint16_t * fmode)
00172         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00173         /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/;
00174 /*@=exportlocal@*/
00175 
00181 /*@-exportlocal@*/
00182 rpmRC rpmfcApply(rpmfc fc)
00183         /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
00184         /*@modifies fc, rpmGlobalMacroContext, internalState @*/;
00185 /*@=exportlocal@*/
00186 
00193 rpmRC rpmfcGenerateDepends(void * specp, void * pkgp)
00194         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00195         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
00196 
00202 /*@unused@*/ /*@null@*/
00203 rpmfc rpmfcUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmfc fc)
00204         /*@modifies fc @*/;
00205 #define rpmfcUnlink(_fc)        \
00206         ((rpmfc)rpmioUnlinkPoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__))
00207 
00213 /*@unused@*/ /*@newref@*/ /*@null@*/
00214 rpmfc rpmfcLink (/*@null@*/ rpmfc fc)
00215         /*@modifies fc @*/;
00216 #define rpmfcLink(_fc)  \
00217         ((rpmfc)rpmioLinkPoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__))
00218 
00224 /*@null@*/
00225 rpmfc rpmfcFree(/*@only@*/ /*@null@*/ rpmfc fc)
00226         /*@modifies fc @*/;
00227 #define rpmfcFree(_fc)  \
00228         ((rpmfc)rpmioFreePoolItem((rpmioItem)(_fc), __FUNCTION__, __FILE__, __LINE__))
00229 
00234 /*@-exportlocal@*/
00235 rpmfc rpmfcNew(void)
00236         /*@*/;
00237 /*@=exportlocal@*/
00238 
00239 #ifdef __cplusplus
00240 }
00241 #endif
00242 
00243 #endif /* _H_RPMFC_ */