• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

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 /*@-matchfields@*/
00026 typedef enum evrFlags_e {
00027 #if defined(_RPMEVR_INTERNAL)
00028     RPMSENSE_ANY        = 0,
00029 /*@-enummemuse@*/
00030     RPMSENSE_SERIAL     = (1 << 0),     
00031 /*@=enummemuse@*/
00032 #endif
00033     RPMSENSE_LESS       = (1 << 1),
00034     RPMSENSE_GREATER    = (1 << 2),
00035     RPMSENSE_EQUAL      = (1 << 3),
00036 #if defined(_RPMEVR_INTERNAL)
00037     RPMSENSE_PROVIDES   = (1 << 4), /* only used internally by builds */
00038     RPMSENSE_CONFLICTS  = (1 << 5), /* only used internally by builds */
00039 #endif
00040     RPMSENSE_PREREQ     = (1 << 6),     
00041 #if defined(_RPMEVR_INTERNAL)
00042     RPMSENSE_OBSOLETES  = (1 << 7), /* only used internally by builds */
00043     RPMSENSE_INTERP     = (1 << 8),     
00044     RPMSENSE_SCRIPT_PRE = (1 << 9),     
00045     RPMSENSE_SCRIPT_POST = (1 << 10),   
00046     RPMSENSE_SCRIPT_PREUN = (1 << 11),  
00047     RPMSENSE_SCRIPT_POSTUN = (1 << 12), 
00048     RPMSENSE_SCRIPT_VERIFY = (1 << 13), 
00049     RPMSENSE_FIND_REQUIRES = (1 << 14), 
00050     RPMSENSE_FIND_PROVIDES = (1 << 15), 
00052     RPMSENSE_TRIGGERIN  = (1 << 16),    
00053     RPMSENSE_TRIGGERUN  = (1 << 17),    
00054     RPMSENSE_TRIGGERPOSTUN = (1 << 18), 
00055     RPMSENSE_MISSINGOK  = (1 << 19),    
00056     RPMSENSE_SCRIPT_PREP = (1 << 20),   
00057     RPMSENSE_SCRIPT_BUILD = (1 << 21),  
00058     RPMSENSE_SCRIPT_INSTALL = (1 << 22),
00059     RPMSENSE_SCRIPT_CLEAN = (1 << 23),  
00060     RPMSENSE_RPMLIB = (1 << 24),        
00061     RPMSENSE_TRIGGERPREIN = (1 << 25),  
00062     RPMSENSE_KEYRING    = (1 << 26),
00063     RPMSENSE_STRONG     = (1 << 27),    
00064     RPMSENSE_CONFIG     = (1 << 28),
00065     RPMSENSE_PROBE      = (1 << 29),
00066     RPMSENSE_PACKAGE    = (1 << 30),
00067     RPMSENSE_SCRIPT_SANITYCHECK = (1 << 31) 
00068 #endif
00069 } evrFlags;
00070 /*@=matchfields@*/
00071 
00072 typedef enum evrFlags_e rpmsenseFlags;
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 Nov 29 2010 05:18:44 for rpm by  doxygen 1.7.2