00001 #ifndef __RPMVERSION_H__
00002 #define __RPMVERSION_H__
00003
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007
00008
00009 extern const char * RPMVERSION;
00010
00011
00012 extern const char * rpmNAME;
00013
00014
00015 extern const char * rpmEVR;
00016
00017
00018 extern int rpmFLAGS;
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 extern uint32_t rpmlibVersion(void)
00074 ;
00075 extern uint32_t rpmlibTimestamp(void)
00076 ;
00077 extern uint32_t rpmlibVendor(void)
00078 ;
00079
00080
00081 #define RPMLIB_VERSION RPMLIB_VERSION_ENCODE(5,2,r,1,0,_)
00082 #define RPMLIB_TIMESTAMP RPMLIB_TIMESTAMP_ENCODE(2009,0,0,0,0)
00083 #define RPMLIB_VENDOR RPMLIB_VENDOR_ENCODE('R','P','M','5')
00084
00085
00086 #define RPMLIB_VERSION_ENCODE(major,minor,type,micro,revision,snap) \
00087 ( RPMLIB_BITFIELD_SET(31,27,(major)) \
00088 | RPMLIB_BITFIELD_SET(26,21,(minor)) \
00089 | RPMLIB_BITFIELD_SET(20,18,RPMLIB_VERSION_ENCODE_T(type)) \
00090 | RPMLIB_BITFIELD_SET(17,10,(micro)) \
00091 | RPMLIB_BITFIELD_SET(9,1,(revision)) \
00092 | RPMLIB_BITFIELD_SET(0,0,RPMLIB_VERSION_ENCODE_S(snap)))
00093 #define RPMLIB_VERSION_ENCODE_T(type) RPMLIB_VERSION_ENCODE_T_##type
00094 #define RPMLIB_VERSION_ENCODE_T__ 0
00095 #define RPMLIB_VERSION_ENCODE_T_a 1
00096 #define RPMLIB_VERSION_ENCODE_T_b 2
00097 #define RPMLIB_VERSION_ENCODE_T_c 3
00098 #define RPMLIB_VERSION_ENCODE_T_r 4
00099 #define RPMLIB_VERSION_ENCODE_S(snap) RPMLIB_VERSION_ENCODE_S_##snap
00100 #define RPMLIB_VERSION_ENCODE_S__ 0
00101 #define RPMLIB_VERSION_ENCODE_S_s 1
00102
00103
00104 #define RPMLIB_TIMESTAMP_ENCODE(year,month,date,hour,minute) \
00105 ( RPMLIB_BITFIELD_SET(31,20,(year)) \
00106 | RPMLIB_BITFIELD_SET(19,16,(month)) \
00107 | RPMLIB_BITFIELD_SET(15,11,(date)) \
00108 | RPMLIB_BITFIELD_SET(10,6,(hour)) \
00109 | RPMLIB_BITFIELD_SET(5,0,(minute)))
00110
00111
00112 #define RPMLIB_VENDOR_ENCODE(c1,c2,c3,c4) \
00113 ( RPMLIB_BITFIELD_SET(31,24,(c1)) \
00114 | RPMLIB_BITFIELD_SET(23,16,(c2)) \
00115 | RPMLIB_BITFIELD_SET(15,8,(c3)) \
00116 | RPMLIB_BITFIELD_SET(7,0,(c4)))
00117
00118
00119 #define RPMLIB_VERSION_LT(major,minor,type,micro,revision,snap) \
00120 (RPMLIB_VERSION < RPMLIB_VERSION_ENCODE((major),(minor),(type),(micro),(revision),(snap)))
00121 #define RPMLIB_VERSION_LE(major,minor,type,micro,revision,snap) \
00122 (RPMLIB_VERSION <= RPMLIB_VERSION_ENCODE((major),(minor),(type),(micro),(revision),(snap)))
00123 #define RPMLIB_VERSION_EQ(major,minor,type,micro,revision,snap) \
00124 (RPMLIB_VERSION == RPMLIB_VERSION_ENCODE((major),(minor),(type),(micro),(revision),(snap)))
00125 #define RPMLIB_VERSION_GE(major,minor,type,micro,revision,snap) \
00126 (RPMLIB_VERSION >= RPMLIB_VERSION_ENCODE((major),(minor),(type),(micro),(revision),(snap)))
00127 #define RPMLIB_VERSION_GT(major,minor,type,micro,revision,snap) \
00128 (RPMLIB_VERSION > RPMLIB_VERSION_ENCODE((major),(minor),(type),(micro),(revision),(snap)))
00129
00130
00131 #define RPMLIB_TIMESTAMP_LT(year,month,date,hour,minute) \
00132 (RPMLIB_TIMESTAMP < RPMLIB_TIMESTAMP_ENCODE((year),(month),(date),(hour),(minute)))
00133 #define RPMLIB_TIMESTAMP_LE(major,minor,type,micro,revision) \
00134 (RPMLIB_TIMESTAMP <= RPMLIB_TIMESTAMP_ENCODE((year),(month),(date),(hour),(minute)))
00135 #define RPMLIB_TIMESTAMP_EQ(major,minor,type,micro,revision) \
00136 (RPMLIB_TIMESTAMP == RPMLIB_TIMESTAMP_ENCODE((year),(month),(date),(hour),(minute)))
00137 #define RPMLIB_TIMESTAMP_GE(major,minor,type,micro,revision) \
00138 (RPMLIB_TIMESTAMP >= RPMLIB_TIMESTAMP_ENCODE((year),(month),(date),(hour),(minute)))
00139 #define RPMLIB_TIMESTAMP_GT(major,minor,type,micro,revision) \
00140 (RPMLIB_TIMESTAMP > RPMLIB_TIMESTAMP_ENCODE((year),(month),(date),(hour),(minute)))
00141
00142
00143 #define RPMLIB_VENDOR_EQ(c1,c2,c3,c4) \
00144 (RPMLIB_VENDOR == RPMLIB_VENDOR_ENCODE((c1),(c2),(c3),(c4)))
00145
00146
00147 #define RPMLIB_BITFIELD_SET(l,r,n) \
00148 (((n) & ((1<<(((l)-(r))+1))-1) ) << (r))
00149
00150 #ifdef __cplusplus
00151 }
00152 #endif
00153
00154 #endif