rpm
4.5
|
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 /* bits 4-7 unused */ 00035 RPMFC_DESKTOP_FILE = (1 << 7), /* XXX */ 00036 00037 RPMFC_PKGCONFIG = (1 << 8), 00038 RPMFC_LIBTOOL = (1 << 9), 00039 RPMFC_BOURNE = (1 << 10), 00040 RPMFC_MONO = (1 << 11), 00041 00042 RPMFC_SCRIPT = (1 << 12), 00043 RPMFC_STATIC = (1 << 13), 00044 RPMFC_NOTSTRIPPED = (1 << 14), 00045 /* bit 15 unused */ 00046 00047 /* bits 16-19 are enumerated, not bits */ 00048 RPMFC_DIRECTORY = (1 << 16), 00049 RPMFC_SYMLINK = (2 << 16), 00050 RPMFC_DEVICE = (3 << 16), 00051 RPMFC_LIBRARY = (4 << 16), 00052 RPMFC_FONT = (5 << 16), 00053 RPMFC_IMAGE = (6 << 16), 00054 RPMFC_MANPAGE = (7 << 16), 00055 RPMFC_TEXT = (8 << 16), 00056 RPMFC_DOCUMENT = (9 << 16), 00057 00058 RPMFC_ARCHIVE = (1 << 20), 00059 RPMFC_COMPRESSED = (1 << 21), 00060 RPMFC_MODULE = (1 << 22), 00061 RPMFC_EXECUTABLE = (1 << 23), 00062 00063 RPMFC_PERL = (1 << 24), 00064 RPMFC_JAVA = (1 << 25), 00065 RPMFC_PYTHON = (1 << 26), 00066 RPMFC_PHP = (1 << 27), 00067 RPMFC_TCL = (1 << 28), 00068 00069 RPMFC_WHITE = (1 << 29), 00070 RPMFC_INCLUDE = (1 << 30), 00071 RPMFC_ERROR = (1 << 31) 00072 }; 00073 00074 #if defined(_RPMFC_INTERNAL) 00075 00077 struct rpmfc_s { 00078 int nfiles; 00079 int fknown; 00080 int fwhite; 00081 int ix; 00082 int skipProv; 00083 int skipReq; 00084 int tracked; 00085 size_t brlen; 00087 ARGV_t fn; 00088 ARGI_t fcolor; 00089 ARGI_t fcdictx; 00090 ARGI_t fddictx; 00091 ARGI_t fddictn; 00092 ARGV_t cdict; 00093 ARGV_t ddict; 00094 ARGI_t ddictx; 00096 /*@relnull@*/ 00097 rpmds provides; 00098 /*@relnull@*/ 00099 rpmds requires; 00101 StringBuf sb_java; 00102 StringBuf sb_perl; 00103 StringBuf sb_python; 00104 StringBuf sb_php; 00106 int findprov, findreq; 00107 regex_t *noautoprov; 00108 int noautoprov_c; 00109 regex_t *noautoreq; 00110 int noautoreq_c; 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(ARGV_t av, StringBuf sb_stdin, /*@out@*/ StringBuf * sb_stdoutp, 00134 int failnonzero) 00135 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 00136 /*@modifies *sb_stdoutp, rpmGlobalMacroContext, 00137 fileSystem, internalState @*/ 00138 /*@requires maxSet(sb_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 00168 /*@-exportlocal@*/ 00169 /*@null@*/ 00170 rpmfc rpmfcFree(/*@only@*/ /*@null@*/ rpmfc fc) 00171 /*@modifies fc @*/; 00172 /*@=exportlocal@*/ 00173 00178 /*@-exportlocal@*/ 00179 rpmfc rpmfcNew(void) 00180 /*@*/; 00181 /*@=exportlocal@*/ 00182 00190 /*@-exportlocal@*/ 00191 int rpmfcClassify(rpmfc fc, ARGV_t argv, /*@null@*/ int16_t * fmode) 00192 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 00193 /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/; 00194 /*@=exportlocal@*/ 00195 00201 /*@-exportlocal@*/ 00202 int rpmfcApply(rpmfc fc) 00203 /*@modifies fc @*/; 00204 /*@=exportlocal@*/ 00205 00212 int rpmfcGenerateDepends(void * specp, void * pkgp) 00213 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 00214 /*@modifies *pkgp, 00215 rpmGlobalMacroContext, fileSystem, internalState @*/; 00216 00217 #ifdef __cplusplus 00218 } 00219 #endif 00220 00221 #endif /* _H_RPMFC_ */