Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

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     RPMFC_DESKTOP_FILE          = (1 << 11),
00057 
00058     RPMFC_PERL                  = (1 << 24),
00059     RPMFC_JAVA                  = (1 << 25),
00060     RPMFC_PYTHON                = (1 << 26),
00061     RPMFC_PHP                   = (1 << 27),
00062     RPMFC_TCL                   = (1 << 28),
00063     RPMFC_MONO                  = (1 <<  6),
00064 
00065     RPMFC_WHITE                 = (1 << 29),
00066     RPMFC_INCLUDE               = (1 << 30),
00067     RPMFC_ERROR                 = (1 << 31)
00068 };
00069 
00070 #if defined(_RPMFC_INTERNAL)
00071 
00073 struct rpmfc_s {
00074     int nfiles;         
00075     int fknown;         
00076     int fwhite;         
00077     int ix;             
00078     int skipProv;       
00079     int skipReq;        
00080     int tracked;        
00081     size_t brlen;       
00083     ARGV_t fn;          
00084     ARGI_t fcolor;      
00085     ARGI_t fcdictx;     
00086     ARGI_t fddictx;     
00087     ARGI_t fddictn;     
00088     ARGV_t cdict;       
00089     ARGV_t ddict;       
00090     ARGI_t ddictx;      
00092 /*@relnull@*/
00093     rpmds provides;     
00094 /*@relnull@*/
00095     rpmds requires;     
00097     StringBuf sb_java;  
00098     StringBuf sb_perl;  
00099     StringBuf sb_python;
00100     StringBuf sb_php;   
00102     int findprov, findreq;
00103     regex_t *noautoprov;
00104     int noautoprov_c;
00105     regex_t *noautoreq;
00106     int noautoreq_c;
00107 };
00108 
00111 struct rpmfcTokens_s {
00112 /*@observer@*/
00113     const char * token;
00114     int colors;
00115 };
00116 #endif
00117 
00118 #ifdef __cplusplus
00119 extern "C" {
00120 #endif
00121 
00129 int rpmfcExec(ARGV_t av, StringBuf sb_stdin, /*@out@*/ StringBuf * sb_stdoutp,
00130                 int failnonzero)
00131         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00132         /*@modifies *sb_stdoutp, rpmGlobalMacroContext,
00133                 fileSystem, internalState @*/
00134         /*@requires maxSet(sb_stdoutp) >= 0 @*/;
00135 
00141 /*@-exportlocal@*/
00142 int rpmfcColoring(const char * fmstr)
00143         /*@*/;
00144 /*@=exportlocal@*/
00145 
00153 /*@-exportlocal@*/
00154 void rpmfcPrint(/*@null@*/ const char * msg, rpmfc fc, /*@null@*/ FILE * fp)
00155         /*@globals fileSystem @*/
00156         /*@modifies *fp, fc, fileSystem @*/;
00157 /*@=exportlocal@*/
00158 
00164 /*@-exportlocal@*/
00165 /*@null@*/
00166 rpmfc rpmfcFree(/*@only@*/ /*@null@*/ rpmfc fc)
00167         /*@modifies fc @*/;
00168 /*@=exportlocal@*/
00169 
00174 /*@-exportlocal@*/
00175 rpmfc rpmfcNew(void)
00176         /*@*/;
00177 /*@=exportlocal@*/
00178 
00186 /*@-exportlocal@*/
00187 int rpmfcClassify(rpmfc fc, ARGV_t argv, /*@null@*/ int16_t * fmode)
00188         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00189         /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/;
00190 /*@=exportlocal@*/
00191 
00197 /*@-exportlocal@*/
00198 int rpmfcApply(rpmfc fc)
00199         /*@modifies fc @*/;
00200 /*@=exportlocal@*/
00201 
00208 int rpmfcGenerateDepends(void * specp, void * pkgp)
00209         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00210         /*@modifies *pkgp,
00211                 rpmGlobalMacroContext, fileSystem, internalState @*/;
00212 
00213 #ifdef __cplusplus
00214 }
00215 #endif
00216 
00217 #endif /* _H_RPMFC_ */

Generated on Sat Oct 1 21:46:11 2011 for rpm by  doxygen 1.4.4