lib/rpmfc.h

Go to the documentation of this file.
00001 #ifndef _H_RPMFC_
00002 #define _H_RPMFC_
00003 
00004 #include <regex.h>
00005 #undef  FILE_RCSID
00006 #include "magic.h"
00007 
00008 /*@-exportlocal@*/
00009 /*@unchecked@*/
00010 extern int _rpmfc_debug;
00011 /*@=exportlocal@*/
00012 
00015 typedef /*@abstract@*/ struct rpmfc_s * rpmfc;
00016 
00019 typedef enum FCOLOR_e FCOLOR_t;
00020 
00023 typedef struct rpmfcTokens_s * rpmfcToken;
00024 
00027 enum FCOLOR_e {
00028     RPMFC_BLACK                 = 0,
00029     RPMFC_ELF32                 = (1 <<  0),
00030     RPMFC_ELF64                 = (1 <<  1),
00031     RPMFC_ELFMIPSN32            = (1 <<  2),
00032 #define RPMFC_ELF       (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)
00033 
00034     RPMFC_PKGCONFIG             = (1 <<  4),
00035     RPMFC_LIBTOOL               = (1 <<  5),
00036     RPMFC_BOURNE                = (1 <<  6),
00037 
00038     RPMFC_MODULE                = (1 <<  7),
00039     RPMFC_EXECUTABLE            = (1 <<  8),
00040     RPMFC_SCRIPT                = (1 <<  9),
00041     RPMFC_TEXT                  = (1 << 10),
00042     RPMFC_DATA                  = (1 << 11),    /* XXX unused */
00043     RPMFC_DOCUMENT              = (1 << 12),
00044     RPMFC_STATIC                = (1 << 13),
00045     RPMFC_NOTSTRIPPED           = (1 << 14),
00046     RPMFC_COMPRESSED            = (1 << 15),
00047 
00048     RPMFC_DIRECTORY             = (1 << 16),
00049     RPMFC_SYMLINK               = (1 << 17),
00050     RPMFC_DEVICE                = (1 << 18),
00051     RPMFC_LIBRARY               = (1 << 19),
00052     RPMFC_ARCHIVE               = (1 << 20),
00053     RPMFC_FONT                  = (1 << 21),
00054     RPMFC_IMAGE                 = (1 << 22),
00055     RPMFC_MANPAGE               = (1 << 23),
00056 
00057     RPMFC_PERL                  = (1 << 24),
00058     RPMFC_JAVA                  = (1 << 25),
00059     RPMFC_PYTHON                = (1 << 26),
00060     RPMFC_PHP                   = (1 << 27),
00061     RPMFC_TCL                   = (1 << 28),
00062     RPMFC_MONO                  = (1 <<  6),
00063 
00064     RPMFC_WHITE                 = (1 << 29),
00065     RPMFC_INCLUDE               = (1 << 30),
00066     RPMFC_ERROR                 = (1 << 31)
00067 };
00068 
00069 #if defined(_RPMFC_INTERNAL)
00070 
00072 struct rpmfc_s {
00073     int nfiles;         
00074     int fknown;         
00075     int fwhite;         
00076     int ix;             
00077     int skipProv;       
00078     int skipReq;        
00079     int tracked;        
00080     size_t brlen;       
00082     ARGV_t fn;          
00083     ARGI_t fcolor;      
00084     ARGI_t fcdictx;     
00085     ARGI_t fddictx;     
00086     ARGI_t fddictn;     
00087     ARGV_t cdict;       
00088     ARGV_t ddict;       
00089     ARGI_t ddictx;      
00091 /*@relnull@*/
00092     rpmds provides;     
00093 /*@relnull@*/
00094     rpmds requires;     
00096     StringBuf sb_java;  
00097     StringBuf sb_perl;  
00098     StringBuf sb_python;
00099     StringBuf sb_php;   
00101     int findprov, findreq;
00102     regex_t *noautoprov;
00103     int noautoprov_c;
00104     regex_t *noautoreq;
00105     int noautoreq_c;
00106 };
00107 
00110 struct rpmfcTokens_s {
00111 /*@observer@*/
00112     const char * token;
00113     int colors;
00114 };
00115 #endif
00116 
00117 #ifdef __cplusplus
00118 extern "C" {
00119 #endif
00120 
00128 int rpmfcExec(ARGV_t av, StringBuf sb_stdin, /*@out@*/ StringBuf * sb_stdoutp,
00129                 int failnonzero)
00130         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00131         /*@modifies *sb_stdoutp, rpmGlobalMacroContext,
00132                 fileSystem, internalState @*/
00133         /*@requires maxSet(sb_stdoutp) >= 0 @*/;
00134 
00140 /*@-exportlocal@*/
00141 int rpmfcColoring(const char * fmstr)
00142         /*@*/;
00143 /*@=exportlocal@*/
00144 
00152 /*@-exportlocal@*/
00153 void rpmfcPrint(/*@null@*/ const char * msg, rpmfc fc, /*@null@*/ FILE * fp)
00154         /*@globals fileSystem @*/
00155         /*@modifies *fp, fc, fileSystem @*/;
00156 /*@=exportlocal@*/
00157 
00163 /*@-exportlocal@*/
00164 /*@null@*/
00165 rpmfc rpmfcFree(/*@only@*/ /*@null@*/ rpmfc fc)
00166         /*@modifies fc @*/;
00167 /*@=exportlocal@*/
00168 
00173 /*@-exportlocal@*/
00174 rpmfc rpmfcNew(void)
00175         /*@*/;
00176 /*@=exportlocal@*/
00177 
00185 /*@-exportlocal@*/
00186 int rpmfcClassify(rpmfc fc, ARGV_t argv, /*@null@*/ int16_t * fmode)
00187         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00188         /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/;
00189 /*@=exportlocal@*/
00190 
00196 /*@-exportlocal@*/
00197 int rpmfcApply(rpmfc fc)
00198         /*@modifies fc @*/;
00199 /*@=exportlocal@*/
00200 
00207 int rpmfcGenerateDepends(void * specp, void * pkgp)
00208         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00209         /*@modifies *pkgp,
00210                 rpmGlobalMacroContext, fileSystem, internalState @*/;
00211 
00212 #ifdef __cplusplus
00213 }
00214 #endif
00215 
00216 #endif /* _H_RPMFC_ */

Generated on Wed Feb 6 22:31:48 2008 for rpm by  doxygen 1.5.1