lib/rpmevr.h

Go to the documentation of this file.
00001 #ifndef H_RPMEVR
00002 #define H_RPMEVR
00003 
00009 #ifdef __cplusplus
00010 extern "C" {
00011 #endif
00012 
00015 /*@-exportlocal@*/
00016 /*@unchecked@*/
00017 extern int _rpmevr_debug;
00018 /*@=exportlocal@*/
00019 
00020 typedef /*@abstract@*/ struct EVR_s * EVR_t;
00021 
00025 typedef enum evrFlags_e rpmsenseFlags;
00026 typedef enum evrFlags_e evrFlags;
00027 
00028 /*@-matchfields@*/
00029 enum evrFlags_e {
00030     RPMSENSE_ANY        = 0,
00031 #if defined(_RPMEVR_INTERNAL)
00032 /*@-enummemuse@*/
00033     RPMSENSE_SERIAL     = (1 << 0),     
00034 /*@=enummemuse@*/
00035 #endif
00036     RPMSENSE_LESS       = (1 << 1),
00037     RPMSENSE_GREATER    = (1 << 2),
00038     RPMSENSE_EQUAL      = (1 << 3),
00039 #if defined(_RPMEVR_INTERNAL)
00040     RPMSENSE_PROVIDES   = (1 << 4), /* only used internally by builds */
00041     RPMSENSE_CONFLICTS  = (1 << 5), /* only used internally by builds */
00042 #endif
00043     RPMSENSE_PREREQ     = (1 << 6),     
00044 #if defined(_RPMEVR_INTERNAL)
00045     RPMSENSE_OBSOLETES  = (1 << 7), /* only used internally by builds */
00046     RPMSENSE_INTERP     = (1 << 8),     
00047     RPMSENSE_SCRIPT_PRE = (1 << 9),     
00048     RPMSENSE_SCRIPT_POST = (1 << 10),   
00049     RPMSENSE_SCRIPT_PREUN = (1 << 11),  
00050     RPMSENSE_SCRIPT_POSTUN = (1 << 12), 
00051     RPMSENSE_SCRIPT_VERIFY = (1 << 13), 
00052     RPMSENSE_FIND_REQUIRES = (1 << 14), 
00053     RPMSENSE_FIND_PROVIDES = (1 << 15), 
00055     RPMSENSE_TRIGGERIN  = (1 << 16),    
00056     RPMSENSE_TRIGGERUN  = (1 << 17),    
00057     RPMSENSE_TRIGGERPOSTUN = (1 << 18), 
00058     RPMSENSE_MISSINGOK  = (1 << 19),    
00059     RPMSENSE_SCRIPT_PREP = (1 << 20),   
00060     RPMSENSE_SCRIPT_BUILD = (1 << 21),  
00061     RPMSENSE_SCRIPT_INSTALL = (1 << 22),
00062     RPMSENSE_SCRIPT_CLEAN = (1 << 23),  
00063     RPMSENSE_RPMLIB = (1 << 24),        
00064     RPMSENSE_TRIGGERPREIN = (1 << 25),  
00065     RPMSENSE_KEYRING    = (1 << 26),
00066     RPMSENSE_STRONG     = (1 << 27),    
00067     RPMSENSE_CONFIG     = (1 << 28),
00068     RPMSENSE_PROBE      = (1 << 29),
00069     RPMSENSE_PACKAGE    = (1 << 30)
00070 #endif
00071 };
00072 /*@=matchfields@*/
00073 
00074 #define RPMSENSE_SENSEMASK      0x0e     /* Mask to get senses, ie serial, */
00075                                          /* less, greater, equal.          */
00076 #define RPMSENSE_NOTEQUAL       (RPMSENSE_EQUAL ^ RPMSENSE_SENSEMASK)
00077 
00078 #if defined(_RPMEVR_INTERNAL)
00079 
00082 struct EVR_s {
00083     const char * str;           
00084 /*@observer@*/ /*@null@*/
00085     const char * E;             
00086     unsigned long Elong;
00087 /*@observer@*/ /*@null@*/
00088     const char * V;             
00089 /*@observer@*/ /*@null@*/
00090     const char * R;             
00091     evrFlags Flags;             
00092 };
00093 
00094 #define RPMSENSE_TRIGGER        \
00095         (RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN)
00096 
00097 #define _ALL_REQUIRES_MASK      (\
00098     RPMSENSE_INTERP | \
00099     RPMSENSE_SCRIPT_PRE | \
00100     RPMSENSE_SCRIPT_POST | \
00101     RPMSENSE_SCRIPT_PREUN | \
00102     RPMSENSE_SCRIPT_POSTUN | \
00103     RPMSENSE_SCRIPT_VERIFY | \
00104     RPMSENSE_FIND_REQUIRES | \
00105     RPMSENSE_MISSINGOK | \
00106     RPMSENSE_SCRIPT_PREP | \
00107     RPMSENSE_SCRIPT_BUILD | \
00108     RPMSENSE_SCRIPT_INSTALL | \
00109     RPMSENSE_SCRIPT_CLEAN | \
00110     RPMSENSE_RPMLIB | \
00111     RPMSENSE_KEYRING | \
00112     RPMSENSE_PACKAGE )
00113 
00114 #define _notpre(_x)             ((_x) & ~RPMSENSE_PREREQ)
00115 #define _INSTALL_ONLY_MASK \
00116     _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING)
00117 #define _ERASE_ONLY_MASK  \
00118     _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
00119 
00120 #define isInstallPreReq(_x)     ((_x) & _INSTALL_ONLY_MASK)
00121 #define isErasePreReq(_x)       ((_x) & _ERASE_ONLY_MASK)
00122 #endif  /* _RPMEVR_INTERNAL */
00123 
00130 int rpmEVRcmp(const char *a, const char *b)
00131         /*@*/;
00132 
00139 int rpmEVRparse(const char * evrstr, EVR_t evr)
00140         /*@modifies evrstr, evr @*/;
00141 
00148 int rpmEVRcompare(const EVR_t a, const EVR_t b)
00149         /*@*/;
00150 
00157 extern int (*rpmvercmp)(const char *a, const char *b)
00158         /*@*/;
00159 
00166 rpmsenseFlags rpmEVRflags(/*@null@*/const char *op, /*@null@*/const char **end)
00167         /*@modifies *end @*/;
00168 
00169 #ifdef __cplusplus
00170 }
00171 #endif
00172 
00173 #endif  /* H_RPMEVR */

Generated on Mon Aug 23 10:43:21 2010 for rpm by  doxygen 1.5.1