00001 #ifndef _RPMTAG_H
00002 #define _RPMTAG_H
00003
00004 #include <rpm/rpmtypes.h>
00005
00006 #ifdef __cplusplus
00007 extern "C" {
00008 #endif
00009
00013 #define RPMDBI_PACKAGES 0
00014 #define RPMDBI_DEPENDS 1
00015 #define RPMDBI_LABEL 2
00016 #define RPMDBI_ADDED 3
00017 #define RPMDBI_REMOVED 4
00018 #define RPMDBI_AVAILABLE 5
00019 #define RPMDBI_HDLIST 6
00020 #define RPMDBI_ARGLIST 7
00021 #define RPMDBI_FTSWALK 8
00022
00027 #define HEADER_IMAGE 61
00028 #define HEADER_SIGNATURES 62
00029 #define HEADER_IMMUTABLE 63
00030 #define HEADER_REGIONS 64
00031 #define HEADER_I18NTABLE 100
00032 #define HEADER_SIGBASE 256
00033 #define HEADER_TAGBASE 1000
00034
00040 typedef enum rpmTag_e {
00041
00042 RPMTAG_HEADERIMAGE = HEADER_IMAGE,
00043 RPMTAG_HEADERSIGNATURES = HEADER_SIGNATURES,
00044 RPMTAG_HEADERIMMUTABLE = HEADER_IMMUTABLE,
00045 RPMTAG_HEADERREGIONS = HEADER_REGIONS,
00047 RPMTAG_HEADERI18NTABLE = HEADER_I18NTABLE,
00048
00049
00050
00051
00052 RPMTAG_SIG_BASE = HEADER_SIGBASE,
00053 RPMTAG_SIGSIZE = RPMTAG_SIG_BASE+1,
00054 RPMTAG_SIGLEMD5_1 = RPMTAG_SIG_BASE+2,
00055 RPMTAG_SIGPGP = RPMTAG_SIG_BASE+3,
00056 RPMTAG_SIGLEMD5_2 = RPMTAG_SIG_BASE+4,
00057 RPMTAG_SIGMD5 = RPMTAG_SIG_BASE+5,
00058 #define RPMTAG_PKGID RPMTAG_SIGMD5
00059 RPMTAG_SIGGPG = RPMTAG_SIG_BASE+6,
00060 RPMTAG_SIGPGP5 = RPMTAG_SIG_BASE+7,
00061
00062 RPMTAG_BADSHA1_1 = RPMTAG_SIG_BASE+8,
00063 RPMTAG_BADSHA1_2 = RPMTAG_SIG_BASE+9,
00064 RPMTAG_PUBKEYS = RPMTAG_SIG_BASE+10,
00065 RPMTAG_DSAHEADER = RPMTAG_SIG_BASE+11,
00066 RPMTAG_RSAHEADER = RPMTAG_SIG_BASE+12,
00067 RPMTAG_SHA1HEADER = RPMTAG_SIG_BASE+13,
00068 #define RPMTAG_HDRID RPMTAG_SHA1HEADER
00069 RPMTAG_LONGSIGSIZE = RPMTAG_SIG_BASE+14,
00070 RPMTAG_LONGARCHIVESIZE = RPMTAG_SIG_BASE+15,
00071
00072 RPMTAG_NAME = 1000,
00073 #define RPMTAG_N RPMTAG_NAME
00074 RPMTAG_VERSION = 1001,
00075 #define RPMTAG_V RPMTAG_VERSION
00076 RPMTAG_RELEASE = 1002,
00077 #define RPMTAG_R RPMTAG_RELEASE
00078 RPMTAG_EPOCH = 1003,
00079 #define RPMTAG_E RPMTAG_EPOCH
00080 RPMTAG_SUMMARY = 1004,
00081 RPMTAG_DESCRIPTION = 1005,
00082 RPMTAG_BUILDTIME = 1006,
00083 RPMTAG_BUILDHOST = 1007,
00084 RPMTAG_INSTALLTIME = 1008,
00085 RPMTAG_SIZE = 1009,
00086 RPMTAG_DISTRIBUTION = 1010,
00087 RPMTAG_VENDOR = 1011,
00088 RPMTAG_GIF = 1012,
00089 RPMTAG_XPM = 1013,
00090 RPMTAG_LICENSE = 1014,
00091 RPMTAG_PACKAGER = 1015,
00092 RPMTAG_GROUP = 1016,
00093 RPMTAG_CHANGELOG = 1017,
00094 RPMTAG_SOURCE = 1018,
00095 RPMTAG_PATCH = 1019,
00096 RPMTAG_URL = 1020,
00097 RPMTAG_OS = 1021,
00098 RPMTAG_ARCH = 1022,
00099 RPMTAG_PREIN = 1023,
00100 RPMTAG_POSTIN = 1024,
00101 RPMTAG_PREUN = 1025,
00102 RPMTAG_POSTUN = 1026,
00103 RPMTAG_OLDFILENAMES = 1027,
00104 RPMTAG_FILESIZES = 1028,
00105 RPMTAG_FILESTATES = 1029,
00106 RPMTAG_FILEMODES = 1030,
00107 RPMTAG_FILEUIDS = 1031,
00108 RPMTAG_FILEGIDS = 1032,
00109 RPMTAG_FILERDEVS = 1033,
00110 RPMTAG_FILEMTIMES = 1034,
00111 RPMTAG_FILEDIGESTS = 1035,
00112 #define RPMTAG_FILEMD5S RPMTAG_FILEDIGESTS
00113 RPMTAG_FILELINKTOS = 1036,
00114 RPMTAG_FILEFLAGS = 1037,
00115 RPMTAG_ROOT = 1038,
00116 RPMTAG_FILEUSERNAME = 1039,
00117 RPMTAG_FILEGROUPNAME = 1040,
00118 RPMTAG_EXCLUDE = 1041,
00119 RPMTAG_EXCLUSIVE = 1042,
00120 RPMTAG_ICON = 1043,
00121 RPMTAG_SOURCERPM = 1044,
00122 RPMTAG_FILEVERIFYFLAGS = 1045,
00123 RPMTAG_ARCHIVESIZE = 1046,
00124 RPMTAG_PROVIDENAME = 1047,
00125 #define RPMTAG_PROVIDES RPMTAG_PROVIDENAME
00126 #define RPMTAG_P RPMTAG_PROVIDENAME
00127 RPMTAG_REQUIREFLAGS = 1048,
00128 RPMTAG_REQUIRENAME = 1049,
00129 #define RPMTAG_REQUIRES RPMTAG_REQUIRENAME
00130 RPMTAG_REQUIREVERSION = 1050,
00131 RPMTAG_NOSOURCE = 1051,
00132 RPMTAG_NOPATCH = 1052,
00133 RPMTAG_CONFLICTFLAGS = 1053,
00134 RPMTAG_CONFLICTNAME = 1054,
00135 #define RPMTAG_CONFLICTS RPMTAG_CONFLICTNAME
00136 #define RPMTAG_C RPMTAG_CONFLICTNAME
00137 RPMTAG_CONFLICTVERSION = 1055,
00138 RPMTAG_DEFAULTPREFIX = 1056,
00139 RPMTAG_BUILDROOT = 1057,
00140 RPMTAG_INSTALLPREFIX = 1058,
00141 RPMTAG_EXCLUDEARCH = 1059,
00142 RPMTAG_EXCLUDEOS = 1060,
00143 RPMTAG_EXCLUSIVEARCH = 1061,
00144 RPMTAG_EXCLUSIVEOS = 1062,
00145 RPMTAG_AUTOREQPROV = 1063,
00146 RPMTAG_RPMVERSION = 1064,
00147 RPMTAG_TRIGGERSCRIPTS = 1065,
00148 RPMTAG_TRIGGERNAME = 1066,
00149 RPMTAG_TRIGGERVERSION = 1067,
00150 RPMTAG_TRIGGERFLAGS = 1068,
00151 RPMTAG_TRIGGERINDEX = 1069,
00152 RPMTAG_VERIFYSCRIPT = 1079,
00153 RPMTAG_CHANGELOGTIME = 1080,
00154 RPMTAG_CHANGELOGNAME = 1081,
00155 RPMTAG_CHANGELOGTEXT = 1082,
00156 RPMTAG_BROKENMD5 = 1083,
00157 RPMTAG_PREREQ = 1084,
00158 RPMTAG_PREINPROG = 1085,
00159 RPMTAG_POSTINPROG = 1086,
00160 RPMTAG_PREUNPROG = 1087,
00161 RPMTAG_POSTUNPROG = 1088,
00162 RPMTAG_BUILDARCHS = 1089,
00163 RPMTAG_OBSOLETENAME = 1090,
00164 #define RPMTAG_OBSOLETES RPMTAG_OBSOLETENAME
00165 #define RPMTAG_O RPMTAG_OBSOLETENAME
00166 RPMTAG_VERIFYSCRIPTPROG = 1091,
00167 RPMTAG_TRIGGERSCRIPTPROG = 1092,
00168 RPMTAG_DOCDIR = 1093,
00169 RPMTAG_COOKIE = 1094,
00170 RPMTAG_FILEDEVICES = 1095,
00171 RPMTAG_FILEINODES = 1096,
00172 RPMTAG_FILELANGS = 1097,
00173 RPMTAG_PREFIXES = 1098,
00174 RPMTAG_INSTPREFIXES = 1099,
00175 RPMTAG_TRIGGERIN = 1100,
00176 RPMTAG_TRIGGERUN = 1101,
00177 RPMTAG_TRIGGERPOSTUN = 1102,
00178 RPMTAG_AUTOREQ = 1103,
00179 RPMTAG_AUTOPROV = 1104,
00180 RPMTAG_CAPABILITY = 1105,
00181 RPMTAG_SOURCEPACKAGE = 1106,
00182 RPMTAG_OLDORIGFILENAMES = 1107,
00183 RPMTAG_BUILDPREREQ = 1108,
00184 RPMTAG_BUILDREQUIRES = 1109,
00185 RPMTAG_BUILDCONFLICTS = 1110,
00186 RPMTAG_BUILDMACROS = 1111,
00187 RPMTAG_PROVIDEFLAGS = 1112,
00188 RPMTAG_PROVIDEVERSION = 1113,
00189 RPMTAG_OBSOLETEFLAGS = 1114,
00190 RPMTAG_OBSOLETEVERSION = 1115,
00191 RPMTAG_DIRINDEXES = 1116,
00192 RPMTAG_BASENAMES = 1117,
00193 RPMTAG_DIRNAMES = 1118,
00194 RPMTAG_ORIGDIRINDEXES = 1119,
00195 RPMTAG_ORIGBASENAMES = 1120,
00196 RPMTAG_ORIGDIRNAMES = 1121,
00197 RPMTAG_OPTFLAGS = 1122,
00198 RPMTAG_DISTURL = 1123,
00199 RPMTAG_PAYLOADFORMAT = 1124,
00200 RPMTAG_PAYLOADCOMPRESSOR = 1125,
00201 RPMTAG_PAYLOADFLAGS = 1126,
00202 RPMTAG_INSTALLCOLOR = 1127,
00203 RPMTAG_INSTALLTID = 1128,
00204 RPMTAG_REMOVETID = 1129,
00205 RPMTAG_SHA1RHN = 1130,
00206 RPMTAG_RHNPLATFORM = 1131,
00207 RPMTAG_PLATFORM = 1132,
00208 RPMTAG_PATCHESNAME = 1133,
00209 RPMTAG_PATCHESFLAGS = 1134,
00210 RPMTAG_PATCHESVERSION = 1135,
00211 RPMTAG_CACHECTIME = 1136,
00212 RPMTAG_CACHEPKGPATH = 1137,
00213 RPMTAG_CACHEPKGSIZE = 1138,
00214 RPMTAG_CACHEPKGMTIME = 1139,
00215 RPMTAG_FILECOLORS = 1140,
00216 RPMTAG_FILECLASS = 1141,
00217 RPMTAG_CLASSDICT = 1142,
00218 RPMTAG_FILEDEPENDSX = 1143,
00219 RPMTAG_FILEDEPENDSN = 1144,
00220 RPMTAG_DEPENDSDICT = 1145,
00221 RPMTAG_SOURCEPKGID = 1146,
00222 RPMTAG_FILECONTEXTS = 1147,
00223 RPMTAG_FSCONTEXTS = 1148,
00224 RPMTAG_RECONTEXTS = 1149,
00225 RPMTAG_POLICIES = 1150,
00226 RPMTAG_PRETRANS = 1151,
00227 RPMTAG_POSTTRANS = 1152,
00228 RPMTAG_PRETRANSPROG = 1153,
00229 RPMTAG_POSTTRANSPROG = 1154,
00230 RPMTAG_DISTTAG = 1155,
00231 RPMTAG_SUGGESTSNAME = 1156,
00232 #define RPMTAG_SUGGESTS RPMTAG_SUGGESTSNAME
00233 RPMTAG_SUGGESTSVERSION = 1157,
00234 RPMTAG_SUGGESTSFLAGS = 1158,
00235 RPMTAG_ENHANCESNAME = 1159,
00236 #define RPMTAG_ENHANCES RPMTAG_ENHANCESNAME
00237 RPMTAG_ENHANCESVERSION = 1160,
00238 RPMTAG_ENHANCESFLAGS = 1161,
00239 RPMTAG_PRIORITY = 1162,
00240 RPMTAG_CVSID = 1163,
00241 #define RPMTAG_SVNID RPMTAG_CVSID
00242 RPMTAG_BLINKPKGID = 1164,
00243 RPMTAG_BLINKHDRID = 1165,
00244 RPMTAG_BLINKNEVRA = 1166,
00245 RPMTAG_FLINKPKGID = 1167,
00246 RPMTAG_FLINKHDRID = 1168,
00247 RPMTAG_FLINKNEVRA = 1169,
00248 RPMTAG_PACKAGEORIGIN = 1170,
00249 RPMTAG_TRIGGERPREIN = 1171,
00250 RPMTAG_BUILDSUGGESTS = 1172,
00251 RPMTAG_BUILDENHANCES = 1173,
00252 RPMTAG_SCRIPTSTATES = 1174,
00253 RPMTAG_SCRIPTMETRICS = 1175,
00254 RPMTAG_BUILDCPUCLOCK = 1176,
00255 RPMTAG_FILEDIGESTALGO = 1177,
00256 RPMTAG_VARIANTS = 1178,
00257 RPMTAG_XMAJOR = 1179,
00258 RPMTAG_XMINOR = 1180,
00259 RPMTAG_REPOTAG = 1181,
00260 RPMTAG_KEYWORDS = 1182,
00261 RPMTAG_BUILDPLATFORMS = 1183,
00262 RPMTAG_PACKAGECOLOR = 1184,
00263 RPMTAG_PACKAGEPREFCOLOR = 1185,
00264 RPMTAG_XATTRSDICT = 1186,
00265 RPMTAG_FILEXATTRSX = 1187,
00266 RPMTAG_DEPATTRSDICT = 1188,
00267 RPMTAG_CONFLICTATTRSX = 1189,
00268 RPMTAG_OBSOLETEATTRSX = 1190,
00269 RPMTAG_PROVIDEATTRSX = 1191,
00270 RPMTAG_REQUIREATTRSX = 1192,
00271 RPMTAG_BUILDPROVIDES = 1193,
00272 RPMTAG_BUILDOBSOLETES = 1194,
00273 RPMTAG_FILENAMES = 5000,
00274 RPMTAG_FILEPROVIDE = 5001,
00275 RPMTAG_FILEREQUIRE = 5002,
00276 RPMTAG_FSNAMES = 5003,
00277 RPMTAG_FSSIZES = 5004,
00278 RPMTAG_TRIGGERCONDS = 5005,
00279 RPMTAG_TRIGGERTYPE = 5006,
00280 RPMTAG_ORIGFILENAMES = 5007,
00281 RPMTAG_LONGFILESIZES = 5008,
00282 RPMTAG_LONGSIZE = 5009,
00283
00284 RPMTAG_FIRSTFREE_TAG
00285 } rpmTag;
00286
00287 #define RPMTAG_EXTERNAL_TAG 1000000
00288 #define RPMTAG_NOT_FOUND -1
00289
00293 typedef enum rpmSigTag_e {
00294 RPMSIGTAG_SIZE = 1000,
00295 RPMSIGTAG_LEMD5_1 = 1001,
00296 RPMSIGTAG_PGP = 1002,
00297 RPMSIGTAG_LEMD5_2 = 1003,
00298 RPMSIGTAG_MD5 = 1004,
00299 RPMSIGTAG_GPG = 1005,
00300 RPMSIGTAG_PGP5 = 1006,
00301 RPMSIGTAG_PAYLOADSIZE = 1007,
00302 RPMSIGTAG_BADSHA1_1 = RPMTAG_BADSHA1_1,
00303 RPMSIGTAG_BADSHA1_2 = RPMTAG_BADSHA1_2,
00304 RPMSIGTAG_SHA1 = RPMTAG_SHA1HEADER,
00305 RPMSIGTAG_DSA = RPMTAG_DSAHEADER,
00306 RPMSIGTAG_RSA = RPMTAG_RSAHEADER,
00307 RPMSIGTAG_LONGSIZE = RPMTAG_LONGSIGSIZE,
00308 RPMSIGTAG_LONGARCHIVESIZE = RPMTAG_LONGARCHIVESIZE,
00309 } rpmSigTag;
00310
00311
00315 typedef enum rpmTagType_e {
00316 #define RPM_MIN_TYPE 0
00317 RPM_NULL_TYPE = 0,
00318 RPM_CHAR_TYPE = 1,
00319 RPM_INT8_TYPE = 2,
00320 RPM_INT16_TYPE = 3,
00321 RPM_INT32_TYPE = 4,
00322 RPM_INT64_TYPE = 5,
00323 RPM_STRING_TYPE = 6,
00324 RPM_BIN_TYPE = 7,
00325 RPM_STRING_ARRAY_TYPE = 8,
00326 RPM_I18NSTRING_TYPE = 9,
00327 #define RPM_MAX_TYPE 9
00328 #define RPM_FORCEFREE_TYPE 0xff
00329 #define RPM_MASK_TYPE 0x0000ffff
00330 } rpmTagType;
00331
00335 typedef enum rpmTagClass_e {
00336 RPM_NULL_CLASS = 0,
00337 RPM_NUMERIC_CLASS = 1,
00338 RPM_STRING_CLASS = 2,
00339 RPM_BINARY_CLASS = 3,
00340 } rpmTagClass;
00341
00350 typedef enum rpmSubTagType_e {
00351 RPM_REGION_TYPE = -10,
00352 RPM_BIN_ARRAY_TYPE = -11,
00355 RPM_XREF_TYPE = -12
00358 } rpmSubTagType;
00359
00363 typedef enum rpmTagReturnType_e {
00364 RPM_ANY_RETURN_TYPE = 0,
00365 RPM_SCALAR_RETURN_TYPE = 0x00010000,
00366 RPM_ARRAY_RETURN_TYPE = 0x00020000,
00367 RPM_MAPPING_RETURN_TYPE = 0x00040000,
00368 RPM_MASK_RETURN_TYPE = 0xffff0000
00369 } rpmTagReturnType;
00370
00376 const char * rpmTagGetName(rpmTag tag);
00377
00383 rpmTagType rpmTagGetType(rpmTag tag);
00384
00390 rpmTagClass rpmTagGetClass(rpmTag tag);
00391
00397 rpmTag rpmTagGetValue(const char * tagstr);
00398
00405 int rpmTagGetNames(rpmtd tagnames, int fullname);
00406
00407 #ifdef __cplusplus
00408 }
00409 #endif
00410
00411 #endif