- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

# rpmdb/rpmtag.h

Go to the documentation of this file.

    00001 #ifndef H_RPMTAG
    00002 #define H_RPMTAG
    00003
    00008 #include <rpmsw.h>
    00009 #include <stringbuf.h>
    00010
    00011 #ifdef __cplusplus
    00012 extern "C" {
    00013 #endif
    00014
    00017 typedef const char *    errmsg_t;
    00018
    00021 typedef /*@abstract@*/ /*@refcounted@*/ struct headerToken_s * Header;
    00022
    00026 enum rpmTagType_e {
    00027         /* RPM_NULL_TYPE =  0   - never been used. */
    00028         /* RPM_CHAR_TYPE =  1   - never been used, same as RPM_UINT8_TYPE. */
    00029     RPM_UINT8_TYPE              =  2,
    00030     RPM_UINT16_TYPE             =  3,
    00031     RPM_UINT32_TYPE             =  4,
    00032     RPM_UINT64_TYPE             =  5,
    00033     RPM_STRING_TYPE             =  6,
    00034     RPM_BIN_TYPE                =  7,
    00035     RPM_STRING_ARRAY_TYPE       =  8,
    00036     RPM_I18NSTRING_TYPE         =  9
    00037         /* RPM_ASN1_TYPE = 10   - never been used. */
    00038         /* RPM_OPENPGP_TYPE= 11 - never been used. */
    00039 };
    00040 #define RPM_MIN_TYPE            2
    00041 #define RPM_MAX_TYPE            9
    00042 #define RPM_MASK_TYPE           0x0000ffff
    00043
    00046 typedef enum rpmTagType_e rpmTagType;
    00050 typedef union rpmDataType_u rpmTagData;
    00054 typedef uint32_t rpmTagCount;
    00058 typedef struct _HE_s * HE_t;
    00062 /*@-typeuse -fielduse@*/
    00063 #if !defined(SWIG)
    00064 union rpmDataType_u {
    00065 /*@null@*/
    00066     void * ptr;
    00067     uint8_t * ui8p;
    00068     uint16_t * ui16p;
    00069     uint32_t * ui32p;
    00070     uint64_t * ui64p;
    00071 /*@relnull@*/
    00072     const char * str;
    00073     unsigned char * blob;
    00074     const char ** argv;
    00075     HE_t he;
    00076 };
    00077 #endif
    00078 /*@=typeuse =fielduse@*/
    00079
    00080 /*@=typeuse =fielduse@*/
    00083 /*@-enummemuse -typeuse @*/
    00084 typedef enum rpmSubTagType_e {
    00085     RPM_REGION_TYPE             = -10,
    00086     RPM_BIN_ARRAY_TYPE          = -11,
    00087     RPM_XREF_TYPE               = -12
    00088 } rpmSubTagType;
    00089 /*@=enummemuse =typeuse @*/
    00090
    00094 /*@-enummemuse -typeuse @*/
    00095 typedef enum rpmTagReturnType_e {
    00096     RPM_ANY_RETURN_TYPE         = 0,
    00097     RPM_SCALAR_RETURN_TYPE      = 0x00010000,
    00098     RPM_ARRAY_RETURN_TYPE       = 0x00020000,
    00099     RPM_MAPPING_RETURN_TYPE     = 0x00040000,
    00100         /* 0x00080000 */
    00101     RPM_PROBE_RETURN_TYPE       = 0x00100000,
    00102     RPM_TREE_RETURN_TYPE        = 0x00200000,
    00103     RPM_OPENPGP_RETURN_TYPE     = 0x00400000,
    00104     RPM_X509_RETURN_TYPE        = 0x00800000,
    00105     RPM_ASN1_RETURN_TYPE        = 0x01000000,
    00106     RPM_OPAQUE_RETURN_TYPE      = 0x10000000,
    00107     RPM_MASK_RETURN_TYPE        = 0xffff0000
    00108 } rpmTagReturnType;
    00109 /*@=enummemuse =typeuse @*/
    00110
    00115 #define HEADER_IMAGE            61
    00116 #define HEADER_SIGNATURES       62
    00117 #define HEADER_IMMUTABLE        63
    00118 #define HEADER_REGIONS          64
    00119 #define HEADER_I18NTABLE        100
    00120 #define HEADER_SIGBASE          256
    00121 #define HEADER_TAGBASE          1000
    00122
    00125 typedef /*@abstract@*/ struct headerIterator_s * HeaderIterator;
    00126
    00129 typedef /*@abstract@*/ struct headerTagIndices_s * headerTagIndices;
    00130
    00133 typedef /*@abstract@*/ const struct headerSprintfExtension_s * headerSprintfExtension;
    00134
    00138 #define RPMDBI_PACKAGES         0       /* Installed package headers. */
    00139 #define RPMDBI_DEPENDS          1       /* Dependency resolution cache. */
    00140 #define RPMDBI_LABEL            2       /* Fingerprint search marker. */
    00141 #define RPMDBI_ADDED            3       /* Added package headers. */
    00142 #define RPMDBI_REMOVED          4       /* Removed package headers. */
    00143 #define RPMDBI_AVAILABLE        5       /* Available package headers. */
    00144 #define RPMDBI_HDLIST           6       /* (rpmgi) Header list. */
    00145 #define RPMDBI_ARGLIST          7       /* (rpmgi) Argument list. */
    00146 #define RPMDBI_FTSWALK          8       /* (rpmgi) File tree  walk. */
    00147
    00152 enum rpmTag_e {
    00153
    00154     RPMTAG_HEADERIMAGE          = HEADER_IMAGE,
    00155     RPMTAG_HEADERSIGNATURES     = HEADER_SIGNATURES,
    00156     RPMTAG_HEADERIMMUTABLE      = HEADER_IMMUTABLE,
    00157 /*@-enummemuse@*/
    00158     RPMTAG_HEADERREGIONS        = HEADER_REGIONS,
    00160     RPMTAG_HEADERI18NTABLE      = HEADER_I18NTABLE,
    00161 /*@=enummemuse@*/
    00162
    00163 /* Retrofit (and uniqify) signature tags for use by tagName() and rpmQuery. */
    00164 /* the md5 sum was broken *twice* on big endian machines */
    00165 /* XXX 2nd underscore prevents tagTable generation */
    00166     RPMTAG_SIG_BASE             = HEADER_SIGBASE,
    00167     RPMTAG_SIGSIZE              = RPMTAG_SIG_BASE+1,    /* i */
    00168     RPMTAG_SIGLEMD5_1           = RPMTAG_SIG_BASE+2,    /* internal - obsolete */
    00169     RPMTAG_SIGPGP               = RPMTAG_SIG_BASE+3,    /* x */
    00170     RPMTAG_SIGLEMD5_2           = RPMTAG_SIG_BASE+4,    /* x internal - obsolete */
    00171     RPMTAG_SIGMD5               = RPMTAG_SIG_BASE+5,    /* x */
    00172 #define RPMTAG_PKGID    RPMTAG_SIGMD5                   /* x */
    00173     RPMTAG_SIGGPG               = RPMTAG_SIG_BASE+6,    /* x */
    00174     RPMTAG_SIGPGP5              = RPMTAG_SIG_BASE+7,    /* internal - obsolete */
    00175
    00176     RPMTAG_BADSHA1_1            = RPMTAG_SIG_BASE+8,    /* internal - obsolete */
    00177     RPMTAG_BADSHA1_2            = RPMTAG_SIG_BASE+9,    /* internal - obsolete */
    00178     RPMTAG_PUBKEYS              = RPMTAG_SIG_BASE+10,   /* s[] */
    00179     RPMTAG_DSAHEADER            = RPMTAG_SIG_BASE+11,   /* x */
    00180     RPMTAG_RSAHEADER            = RPMTAG_SIG_BASE+12,   /* x */
    00181     RPMTAG_SHA1HEADER           = RPMTAG_SIG_BASE+13,   /* s */
    00182 #define RPMTAG_HDRID    RPMTAG_SHA1HEADER       /* s */
    00183
    00184     RPMTAG_NAME                 = 1000, /* s */
    00185 #define RPMTAG_N        RPMTAG_NAME     /* s */
    00186     RPMTAG_VERSION              = 1001, /* s */
    00187 #define RPMTAG_V        RPMTAG_VERSION  /* s */
    00188     RPMTAG_RELEASE              = 1002, /* s */
    00189 #define RPMTAG_R        RPMTAG_RELEASE  /* s */
    00190     RPMTAG_EPOCH                = 1003, /* i */
    00191 #define RPMTAG_E        RPMTAG_EPOCH    /* i */
    00192     RPMTAG_SUMMARY              = 1004, /* s{} */
    00193     RPMTAG_DESCRIPTION          = 1005, /* s{} */
    00194     RPMTAG_BUILDTIME            = 1006, /* i */
    00195     RPMTAG_BUILDHOST            = 1007, /* s */
    00196     RPMTAG_INSTALLTIME          = 1008, /* i */
    00197     RPMTAG_SIZE                 = 1009, /* i */
    00198     RPMTAG_DISTRIBUTION         = 1010, /* s */
    00199     RPMTAG_VENDOR               = 1011, /* s */
    00200     RPMTAG_GIF                  = 1012, /* x */
    00201     RPMTAG_XPM                  = 1013, /* x */
    00202     RPMTAG_LICENSE              = 1014, /* s */
    00203     RPMTAG_PACKAGER             = 1015, /* s */
    00204     RPMTAG_GROUP                = 1016, /* s{} */
    00205 /*@-enummemuse@*/
    00206     RPMTAG_CHANGELOG            = 1017, /* s[] internal */
    00207 /*@=enummemuse@*/
    00208     RPMTAG_SOURCE               = 1018, /* s[] */
    00209     RPMTAG_PATCH                = 1019, /* s[] */
    00210     RPMTAG_URL                  = 1020, /* s */
    00211     RPMTAG_OS                   = 1021, /* s legacy used int */
    00212     RPMTAG_ARCH                 = 1022, /* s legacy used int */
    00213     RPMTAG_PREIN                = 1023, /* s */
    00214     RPMTAG_POSTIN               = 1024, /* s */
    00215     RPMTAG_PREUN                = 1025, /* s */
    00216     RPMTAG_POSTUN               = 1026, /* s */
    00217     RPMTAG_OLDFILENAMES         = 1027, /* s[] obsolete */
    00218     RPMTAG_FILESIZES            = 1028, /* i[] */
    00219     RPMTAG_FILESTATES           = 1029, /* c[] */
    00220     RPMTAG_FILEMODES            = 1030, /* h[] */
    00221     RPMTAG_FILEUIDS             = 1031, /* i[] internal */
    00222     RPMTAG_FILEGIDS             = 1032, /* i[] internal */
    00223     RPMTAG_FILERDEVS            = 1033, /* h[] */
    00224     RPMTAG_FILEMTIMES           = 1034, /* i[] */
    00225     RPMTAG_FILEDIGESTS          = 1035, /* s[] */
    00226 #define RPMTAG_FILEMD5S RPMTAG_FILEDIGESTS /* s[] */
    00227     RPMTAG_FILELINKTOS          = 1036, /* s[] */
    00228     RPMTAG_FILEFLAGS            = 1037, /* i[] */
    00229 /*@-enummemuse@*/
    00230     RPMTAG_ROOT                 = 1038, /* internal - obsolete */
    00231 /*@=enummemuse@*/
    00232     RPMTAG_FILEUSERNAME         = 1039, /* s[] */
    00233     RPMTAG_FILEGROUPNAME        = 1040, /* s[] */
    00234 /*@-enummemuse@*/
    00235     RPMTAG_EXCLUDE              = 1041, /* internal - obsolete */
    00236     RPMTAG_EXCLUSIVE            = 1042, /* internal - obsolete */
    00237 /*@=enummemuse@*/
    00238     RPMTAG_ICON                 = 1043, /* x */
    00239     RPMTAG_SOURCERPM            = 1044, /* s */
    00240     RPMTAG_FILEVERIFYFLAGS      = 1045, /* i[] */
    00241     RPMTAG_ARCHIVESIZE          = 1046, /* i */
    00242     RPMTAG_PROVIDENAME          = 1047, /* s[] */
    00243 #define RPMTAG_PROVIDES RPMTAG_PROVIDENAME      /* s[] */
    00244 #define RPMTAG_P        RPMTAG_PROVIDENAME      /* s[] */
    00245     RPMTAG_REQUIREFLAGS         = 1048, /* i[] */
    00246     RPMTAG_REQUIRENAME          = 1049, /* s[] */
    00247 #define RPMTAG_REQUIRES RPMTAG_REQUIRENAME      /* s[] */
    00248     RPMTAG_REQUIREVERSION       = 1050, /* s[] */
    00249     RPMTAG_NOSOURCE             = 1051, /* i internal */
    00250     RPMTAG_NOPATCH              = 1052, /* i internal */
    00251     RPMTAG_CONFLICTFLAGS        = 1053, /* i[] */
    00252     RPMTAG_CONFLICTNAME         = 1054, /* s[] */
    00253 #define RPMTAG_CONFLICTS RPMTAG_CONFLICTNAME    /* s[] */
    00254 #define RPMTAG_C        RPMTAG_CONFLICTNAME     /* s[] */
    00255     RPMTAG_CONFLICTVERSION      = 1055, /* s[] */
    00256     RPMTAG_DEFAULTPREFIX        = 1056, /* s internal - deprecated */
    00257     RPMTAG_BUILDROOT            = 1057, /* s internal */
    00258     RPMTAG_INSTALLPREFIX        = 1058, /* s internal - deprecated */
    00259     RPMTAG_EXCLUDEARCH          = 1059, /* s[] */
    00260     RPMTAG_EXCLUDEOS            = 1060, /* s[] */
    00261     RPMTAG_EXCLUSIVEARCH        = 1061, /* s[] */
    00262     RPMTAG_EXCLUSIVEOS          = 1062, /* s[] */
    00263     RPMTAG_AUTOREQPROV          = 1063, /* s internal */
    00264     RPMTAG_RPMVERSION           = 1064, /* s */
    00265     RPMTAG_TRIGGERSCRIPTS       = 1065, /* s[] */
    00266     RPMTAG_TRIGGERNAME          = 1066, /* s[] */
    00267     RPMTAG_TRIGGERVERSION       = 1067, /* s[] */
    00268     RPMTAG_TRIGGERFLAGS         = 1068, /* i[] */
    00269     RPMTAG_TRIGGERINDEX         = 1069, /* i[] */
    00270     RPMTAG_VERIFYSCRIPT         = 1079, /* s */
    00271     RPMTAG_CHANGELOGTIME        = 1080, /* i[] */
    00272     RPMTAG_CHANGELOGNAME        = 1081, /* s[] */
    00273     RPMTAG_CHANGELOGTEXT        = 1082, /* s[] */
    00274 /*@-enummemuse@*/
    00275     RPMTAG_BROKENMD5            = 1083, /* internal - obsolete */
    00276 /*@=enummemuse@*/
    00277     RPMTAG_PREREQ               = 1084, /* internal */
    00278     RPMTAG_PREINPROG            = 1085, /* s */
    00279     RPMTAG_POSTINPROG           = 1086, /* s */
    00280     RPMTAG_PREUNPROG            = 1087, /* s */
    00281     RPMTAG_POSTUNPROG           = 1088, /* s */
    00282     RPMTAG_BUILDARCHS           = 1089, /* s[] */
    00283     RPMTAG_OBSOLETENAME         = 1090, /* s[] */
    00284 #define RPMTAG_OBSOLETES RPMTAG_OBSOLETENAME    /* s[] */
    00285 #define RPMTAG_O        RPMTAG_OBSOLETENAME     /* s[] */
    00286     RPMTAG_VERIFYSCRIPTPROG     = 1091, /* s */
    00287     RPMTAG_TRIGGERSCRIPTPROG    = 1092, /* s[] */
    00288     RPMTAG_DOCDIR               = 1093, /* internal */
    00289     RPMTAG_COOKIE               = 1094, /* s */
    00290     RPMTAG_FILEDEVICES          = 1095, /* i[] */
    00291     RPMTAG_FILEINODES           = 1096, /* i[] */
    00292     RPMTAG_FILELANGS            = 1097, /* s[] */
    00293     RPMTAG_PREFIXES             = 1098, /* s[] */
    00294     RPMTAG_INSTPREFIXES         = 1099, /* s[] */
    00295     RPMTAG_TRIGGERIN            = 1100, /* internal */
    00296     RPMTAG_TRIGGERUN            = 1101, /* internal */
    00297     RPMTAG_TRIGGERPOSTUN        = 1102, /* internal */
    00298     RPMTAG_AUTOREQ              = 1103, /* internal */
    00299     RPMTAG_AUTOPROV             = 1104, /* internal */
    00300 /*@-enummemuse@*/
    00301     RPMTAG_CAPABILITY           = 1105, /* i legacy - obsolete */
    00302 /*@=enummemuse@*/
    00303     RPMTAG_SOURCEPACKAGE        = 1106, /* i legacy - obsolete */
    00304 /*@-enummemuse@*/
    00305     RPMTAG_OLDORIGFILENAMES     = 1107, /* internal - obsolete */
    00306 /*@=enummemuse@*/
    00307     RPMTAG_BUILDPREREQ          = 1108, /* internal */
    00308     RPMTAG_BUILDREQUIRES        = 1109, /* internal */
    00309     RPMTAG_BUILDCONFLICTS       = 1110, /* internal */
    00310 /*@-enummemuse@*/
    00311     RPMTAG_BUILDMACROS          = 1111, /* s[] srpms only */
    00312 /*@=enummemuse@*/
    00313     RPMTAG_PROVIDEFLAGS         = 1112, /* i[] */
    00314     RPMTAG_PROVIDEVERSION       = 1113, /* s[] */
    00315     RPMTAG_OBSOLETEFLAGS        = 1114, /* i[] */
    00316     RPMTAG_OBSOLETEVERSION      = 1115, /* s[] */
    00317     RPMTAG_DIRINDEXES           = 1116, /* i[] */
    00318     RPMTAG_BASENAMES            = 1117, /* s[] */
    00319     RPMTAG_DIRNAMES             = 1118, /* s[] */
    00320     RPMTAG_ORIGDIRINDEXES       = 1119, /* i[] relocation */
    00321     RPMTAG_ORIGBASENAMES        = 1120, /* s[] relocation */
    00322     RPMTAG_ORIGDIRNAMES         = 1121, /* s[] relocation */
    00323     RPMTAG_OPTFLAGS             = 1122, /* s */
    00324     RPMTAG_DISTURL              = 1123, /* s */
    00325     RPMTAG_PAYLOADFORMAT        = 1124, /* s */
    00326     RPMTAG_PAYLOADCOMPRESSOR    = 1125, /* s */
    00327     RPMTAG_PAYLOADFLAGS         = 1126, /* s */
    00328     RPMTAG_INSTALLCOLOR         = 1127, /* i transaction color when installed */
    00329     RPMTAG_INSTALLTID           = 1128, /* i */
    00330     RPMTAG_REMOVETID            = 1129, /* i */
    00331 /*@-enummemuse@*/
    00332     RPMTAG_SHA1RHN              = 1130, /* internal - obsolete */
    00333 /*@=enummemuse@*/
    00334     RPMTAG_RHNPLATFORM          = 1131, /* s deprecated */
    00335     RPMTAG_PLATFORM             = 1132, /* s */
    00336     RPMTAG_PATCHESNAME          = 1133, /* s[] deprecated placeholder (SuSE) */
    00337     RPMTAG_PATCHESFLAGS         = 1134, /* i[] deprecated placeholder (SuSE) */
    00338     RPMTAG_PATCHESVERSION       = 1135, /* s[] deprecated placeholder (SuSE) */
    00339     RPMTAG_CACHECTIME           = 1136, /* i rpmcache(8) only */
    00340     RPMTAG_CACHEPKGPATH         = 1137, /* s rpmcache(8) only */
    00341     RPMTAG_CACHEPKGSIZE         = 1138, /* i rpmcache(8) only */
    00342     RPMTAG_CACHEPKGMTIME        = 1139, /* i rpmcache(8) only */
    00343     RPMTAG_FILECOLORS           = 1140, /* i[] */
    00344     RPMTAG_FILECLASS            = 1141, /* i[] */
    00345     RPMTAG_CLASSDICT            = 1142, /* s[] */
    00346     RPMTAG_FILEDEPENDSX         = 1143, /* i[] */
    00347     RPMTAG_FILEDEPENDSN         = 1144, /* i[] */
    00348     RPMTAG_DEPENDSDICT          = 1145, /* i[] */
    00349     RPMTAG_SOURCEPKGID          = 1146, /* x */
    00350     RPMTAG_FILECONTEXTS         = 1147, /* s[] */
    00351     RPMTAG_FSCONTEXTS           = 1148, /* s[] extension */
    00352     RPMTAG_RECONTEXTS           = 1149, /* s[] extension */
    00353     RPMTAG_POLICIES             = 1150, /* s[] selinux *.te policy file. */
    00354     RPMTAG_PRETRANS             = 1151, /* s */
    00355     RPMTAG_POSTTRANS            = 1152, /* s */
    00356     RPMTAG_PRETRANSPROG         = 1153, /* s */
    00357     RPMTAG_POSTTRANSPROG        = 1154, /* s */
    00358     RPMTAG_DISTTAG              = 1155, /* s */
    00359     RPMTAG_SUGGESTSNAME         = 1156, /* s[] extension */
    00360 #define RPMTAG_SUGGESTS RPMTAG_SUGGESTSNAME     /* s[] */
    00361     RPMTAG_SUGGESTSVERSION      = 1157, /* s[] extension */
    00362     RPMTAG_SUGGESTSFLAGS        = 1158, /* i[] extension */
    00363     RPMTAG_ENHANCESNAME         = 1159, /* s[] extension placeholder */
    00364 #define RPMTAG_ENHANCES RPMTAG_ENHANCESNAME     /* s[] */
    00365     RPMTAG_ENHANCESVERSION      = 1160, /* s[] extension placeholder */
    00366     RPMTAG_ENHANCESFLAGS        = 1161, /* i[] extension placeholder */
    00367     RPMTAG_PRIORITY             = 1162, /* i[] extension placeholder */
    00368     RPMTAG_CVSID                = 1163, /* s */
    00369 #define RPMTAG_SVNID    RPMTAG_CVSID    /* s */
    00370     RPMTAG_BLINKPKGID           = 1164, /* s[] */
    00371     RPMTAG_BLINKHDRID           = 1165, /* s[] */
    00372     RPMTAG_BLINKNEVRA           = 1166, /* s[] */
    00373     RPMTAG_FLINKPKGID           = 1167, /* s[] */
    00374     RPMTAG_FLINKHDRID           = 1168, /* s[] */
    00375     RPMTAG_FLINKNEVRA           = 1169, /* s[] */
    00376     RPMTAG_PACKAGEORIGIN        = 1170, /* s */
    00377     RPMTAG_TRIGGERPREIN         = 1171, /* internal */
    00378     RPMTAG_BUILDSUGGESTS        = 1172, /* internal */
    00379     RPMTAG_BUILDENHANCES        = 1173, /* internal */
    00380     RPMTAG_SCRIPTSTATES         = 1174, /* i[] scriptlet exit codes */
    00381     RPMTAG_SCRIPTMETRICS        = 1175, /* i[] scriptlet execution times */
    00382     RPMTAG_BUILDCPUCLOCK        = 1176, /* i */
    00383     RPMTAG_FILEDIGESTALGOS      = 1177, /* i[] */
    00384     RPMTAG_VARIANTS             = 1178, /* s[] */
    00385     RPMTAG_XMAJOR               = 1179, /* i */
    00386     RPMTAG_XMINOR               = 1180, /* i */
    00387     RPMTAG_REPOTAG              = 1181, /* s */
    00388     RPMTAG_KEYWORDS             = 1182, /* s[] */
    00389     RPMTAG_BUILDPLATFORMS       = 1183, /* s[] */
    00390     RPMTAG_PACKAGECOLOR         = 1184, /* i */
    00391     RPMTAG_PACKAGEPREFCOLOR     = 1185, /* i (unimplemented) */
    00392     RPMTAG_XATTRSDICT           = 1186, /* s[] (unimplemented) */
    00393     RPMTAG_FILEXATTRSX          = 1187, /* i[] (unimplemented) */
    00394     RPMTAG_DEPATTRSDICT         = 1188, /* s[] (unimplemented) */
    00395     RPMTAG_CONFLICTATTRSX       = 1189, /* i[] (unimplemented) */
    00396     RPMTAG_OBSOLETEATTRSX       = 1190, /* i[] (unimplemented) */
    00397     RPMTAG_PROVIDEATTRSX        = 1191, /* i[] (unimplemented) */
    00398     RPMTAG_REQUIREATTRSX        = 1192, /* i[] (unimplemented) */
    00399     RPMTAG_BUILDPROVIDES        = 1193, /* internal */
    00400     RPMTAG_BUILDOBSOLETES       = 1194, /* internal */
    00401     RPMTAG_DBINSTANCE           = 1195, /* i */
    00402     RPMTAG_NVRA                 = 1196, /* s */
    00403     RPMTAG_FILEPATHS            = 1197, /* s[] */
    00404     RPMTAG_ORIGPATHS            = 1198, /* s[] */
    00405     RPMTAG_RPMLIBVERSION        = 1199, /* i */
    00406     RPMTAG_RPMLIBTIMESTAMP      = 1200, /* i */
    00407     RPMTAG_RPMLIBVENDOR         = 1201, /* i */
    00408     RPMTAG_CLASS                = 1202, /* s */
    00409     RPMTAG_TRACK                = 1203, /* s internal arbitrary */
    00410     RPMTAG_TRACKPROG            = 1204, /* s internal arbitrary */
    00411     RPMTAG_SANITYCHECK          = 1205, /* s */
    00412     RPMTAG_SANITYCHECKPROG      = 1206, /* s */
    00413
    00414 /*@-enummemuse@*/
    00415     RPMTAG_FIRSTFREE_TAG
    00416 /*@=enummemuse@*/
    00417 };
    00418
    00419 #define RPMTAG_EXTERNAL_TAG             1000000
    00420
    00424 enum rpmSigTag_e {
    00425     RPMSIGTAG_SIZE      = 1000,
    00426     RPMSIGTAG_LEMD5_1   = 1001,
    00427     RPMSIGTAG_PGP       = 1002,
    00428     RPMSIGTAG_LEMD5_2   = 1003,
    00429     RPMSIGTAG_MD5       = 1004,
    00430     RPMSIGTAG_GPG       = 1005,
    00431     RPMSIGTAG_PGP5      = 1006,
    00432     RPMSIGTAG_PAYLOADSIZE = 1007,
    00433     RPMSIGTAG_BADSHA1_1 = RPMTAG_BADSHA1_1,
    00434     RPMSIGTAG_BADSHA1_2 = RPMTAG_BADSHA1_2,
    00435     RPMSIGTAG_SHA1      = RPMTAG_SHA1HEADER,
    00436     RPMSIGTAG_DSA       = RPMTAG_DSAHEADER,
    00437     RPMSIGTAG_RSA       = RPMTAG_RSAHEADER
    00438 };
    00439
    00442 typedef enum rpmTag_e rpmTag;
    00443
    00446 typedef enum rpmSigTag_e rpmSigTag;
    00447
    00450 /*@-typeuse -fielduse@*/
    00451 #if !defined(SWIG)
    00452 struct _HE_s {
    00453     rpmTag tag;
    00454     rpmTagType t;
    00455 /*@owned@*/ /*@null@*/
    00456     rpmTagData p;
    00457     rpmTagCount c;
    00458     int ix;
    00459     unsigned int freeData       : 1;
    00460     unsigned int avail          : 1;
    00461     unsigned int append         : 1;
    00462 };
    00463 #endif
    00464
    00467 typedef struct _HE_s HE_s;
    00468
    00471 typedef struct tagStore_s * tagStore_t;
    00472
    00475 typedef /*@abstract@*/ const struct headerTagTableEntry_s * headerTagTableEntry;
    00476
    00477 #if defined(_RPMTAG_INTERNAL)
    00478
    00483 #if !defined(SWIG)
    00484 struct headerTagTableEntry_s {
    00485 /*@observer@*/ /*@relnull@*/
    00486     const char * name;
    00487     rpmTag val;
    00488     rpmTagType type;
    00489 };
    00490 #endif
    00491
    00494 struct tagStore_s {
    00495 /*@only@*/
    00496     const char * str;
    00497     rpmTag tag;
    00498     StringBuf val;
    00499 };
    00500 #endif  /* _RPMTAG_INTERNAL */
    00501
    00505 /*@-redecl@*/
    00506 /*@observer@*/ /*@unchecked@*/
    00507 extern headerTagTableEntry rpmTagTable;
    00508 /*@=redecl@*/
    00509
    00513 /*@-redecl@*/
    00514 /*@unchecked@*/
    00515 extern int rpmTagTableSize;
    00516
    00517 /*@unchecked@*/
    00518 extern headerTagIndices rpmTags;
    00519 /*@=redecl@*/
    00520
    00521 #if defined(_RPMTAG_INTERNAL)
    00522
    00524 #if !defined(SWIG)
    00525 struct headerTagIndices_s {
    00526 /*@relnull@*/
    00527     int (*loadIndex) (headerTagTableEntry ** ipp, size_t * np,
    00528                 int (*cmp) (const void * avp, const void * bvp))
    00529         /*@ modifies *ipp, *np */;
    00530 /*@relnull@*/
    00531     headerTagTableEntry * byName;
    00532     size_t byNameSize;
    00533     int (*byNameCmp) (const void * avp, const void * bvp)
    00534         /*@*/;
    00535     rpmTag (*tagValue) (const char * name)
    00536         /*@*/;
    00537 /*@relnull@*/
    00538     headerTagTableEntry * byValue;
    00539     size_t byValueSize;
    00540     int (*byValueCmp) (const void * avp, const void * bvp)
    00541         /*@*/;
    00542     const char * (*tagName) (rpmTag value)
    00543         /*@*/;
    00544     rpmTag (*tagType) (rpmTag value)
    00545         /*@*/;
    00546     size_t nameBufLen;
    00547 /*@relnull@*/
    00548     const char ** aTags;
    00549 /*@owned@*/ /*@null@*/
    00550     char * nameBuf;                     /* Name buffer. */
    00551 /*@only@*/
    00552     char * (*tagCanonicalize) (const char * s)
    00553         /*@*/;
    00554     rpmTag (*tagGenerate) (const char * s)
    00555         /*@*/;
    00556 };
    00557 #endif
    00558 #endif  /* _RPMTAG_INTERNAL */
    00559
    00565 /*@observer@*/
    00566 const char * tagName(rpmTag tag)
    00567         /*@*/;
    00568
    00575 unsigned int tagType(rpmTag tag)
    00576         /*@*/;
    00577
    00583 rpmTag tagValue(const char * tagstr)
    00584         /*@*/;
    00585
    00591 /*@only@*/
    00592 char * tagCanonicalize(const char * s)
    00593         /*@*/;
    00594
    00600 rpmTag tagGenerate(const char * s)
    00601         /*@*/;
    00602
    00607 void tagClean(/*@null@*/ headerTagIndices _rpmTags)
    00608         /*@globals rpmTags @*/
    00609         /*@modifies _rpmTags, rpmTags @*/;
    00610
    00617 /*@null@*/
    00618 tagStore_t tagStoreFree(/*@only@*/ tagStore_t dbiTags, size_t dbiNTags)
    00619         /*@modifies dbiTags @*/;
    00620
    00621 #if defined(_RPMTAG_INTERNAL)
    00622
    00624 typedef enum headerSprintfExtensionType_e {
    00625     HEADER_EXT_LAST = 0,
    00626     HEADER_EXT_FORMAT,
    00627     HEADER_EXT_MORE,
    00628     HEADER_EXT_TAG
    00629 } headerSprintfExtensionType;
    00630
    00637 typedef /*only@*/ char * (*headerTagFormatFunction) (HE_t he)
    00638         /*@modifies he @*/;
    00639
    00648 typedef int (*headerTagTagFunction) (Header h, HE_t he)
    00649         /*@modifies he @*/;
    00650
    00654 #if !defined(SWIG)
    00655 struct headerSprintfExtension_s {
    00656     headerSprintfExtensionType type;
    00657 /*@observer@*/ /*@null@*/
    00658     const char * name;
    00659     union {
    00660 /*@observer@*/ /*@null@*/
    00661         void * generic;
    00662         headerTagFormatFunction fmtFunction;
    00663         headerTagTagFunction tagFunction;
    00664         headerSprintfExtension * more;
    00665     } u;
    00666 };
    00667 #endif
    00668 #endif  /* _RPMTAG_INTERNAL */
    00669
    00673 /*@unchecked@*/ /*@observer@*/
    00674 extern headerSprintfExtension headerDefaultFormats;
    00675
    00679 /*@unchecked@*/ /*@observer@*/
    00680 extern headerSprintfExtension headerCompoundFormats;
    00681
    00688 void rpmDisplayQueryTags(/*@null@*/ FILE * fp,
    00689                 /*@null@*/ headerTagTableEntry _rpmTagTable,
    00690                 /*@null@*/ headerSprintfExtension _rpmHeaderFormats)
    00691         /*@globals fileSystem, internalState @*/
    00692         /*@modifies *fp, fileSystem, internalState @*/;
    00693
    00705 /*@only@*/ /*@null@*/
    00706 char * headerSprintf(Header h, const char * fmt,
    00707                 /*@null@*/ headerTagTableEntry tags,
    00708                 /*@null@*/ headerSprintfExtension exts,
    00709                 /*@null@*/ /*@out@*/ errmsg_t * errmsg)
    00710         /*@globals headerCompoundFormats @*/
    00711         /*@modifies h, *errmsg @*/
    00712         /*@requires maxSet(errmsg) >= 0 @*/;
    00713
    00722 int headerGet(Header h, HE_t he, unsigned int flags)
    00723         /*@modifies he @*/;
    00724 #define HEADERGET_NOEXTENSION   (1 << 0)
    00725 #define HEADERGET_NOI18NSTRING  (1 << 1)
    00735 /*@mayexit@*/
    00736 int headerPut(Header h, HE_t he, /*@unused@*/ unsigned int flags)
    00737         /*@modifies h @*/;
    00738
    00747 /*@mayexit@*/
    00748 int headerDel(Header h, HE_t he, /*@unused@*/ unsigned int flags)
    00749         /*@modifies h @*/;
    00750
    00759 int headerMod(Header h, HE_t he, /*@unused@*/ unsigned int flags)
    00760         /*@modifies h @*/;
    00761
    00767 /*@null@*/
    00768 HeaderIterator headerFini(/*@only@*/ HeaderIterator hi)
    00769         /*@modifies hi @*/;
    00770
    00776 HeaderIterator headerInit(Header h)
    00777         /*@modifies h */;
    00778
    00786 int headerNext(HeaderIterator hi, HE_t he, /*@unused@*/ unsigned int flags)
    00787         /*@modifies hi, he @*/;
    00788
    00794 Header headerLink(Header h)
    00795         /*@modifies h @*/;
    00796
    00802 Header headerUnlink(/*@killref@*/ /*@null@*/ Header h)
    00803         /*@modifies h @*/;
    00804
    00810 /*@null@*/
    00811 Header headerFree(/*@killref@*/ /*@null@*/ Header h)
    00812         /*@modifies h @*/;
    00813
    00818 Header headerNew(void)
    00819         /*@*/;
    00820
    00826 size_t headerSizeof(/*@null@*/ Header h)
    00827         /*@modifies h @*/;
    00828
    00834 /*@only@*/ /*@null@*/
    00835 void * headerUnload(Header h, /*@out@*/ /*@null@*/ size_t * lenp)
    00836         /*@modifies h, *lenp @*/;
    00837
    00845 /*@null@*/
    00846 Header headerReload(/*@only@*/ Header h, int tag)
    00847         /*@modifies h @*/;
    00848
    00854 /*@null@*/
    00855 Header headerCopy(Header h)
    00856         /*@modifies h @*/;
    00857
    00863 /*@null@*/
    00864 Header headerLoad(/*@kept@*/ void * uh)
    00865         /*@modifies uh @*/;
    00866
    00872 /*@null@*/
    00873 Header headerCopyLoad(const void * uh)
    00874         /*@*/;
    00875
    00882 int headerIsEntry(/*@null@*/ Header h, rpmTag tag)
    00883         /*@*/;
    00884
    00905 int headerAddI18NString(Header h, rpmTag tag, const char * string,
    00906                 const char * lang)
    00907         /*@modifies h @*/;
    00908
    00915 void headerCopyTags(Header headerFrom, Header headerTo, rpmTag * tagstocopy)
    00916         /*@modifies headerTo @*/;
    00917
    00925 int headerGetMagic(/*@null@*/ Header h, unsigned char **magicp, size_t *nmagicp)
    00926         /*@modifies *magicp, *nmagicp @*/;
    00927
    00935 int headerSetMagic(/*@null@*/ Header h, unsigned char * magic, size_t nmagic)
    00936         /*@modifies h @*/;
    00937
    00943 /*@observer@*/ /*@null@*/
    00944 const char * headerGetOrigin(/*@null@*/ Header h)
    00945         /*@*/;
    00946
    00953 int headerSetOrigin(/*@null@*/ Header h, const char * origin)
    00954         /*@modifies h @*/;
    00955
    00961 uint32_t headerGetInstance(/*@null@*/ Header h)
    00962         /*@*/;
    00963
    00970 uint32_t headerSetInstance(/*@null@*/ Header h, uint32_t instance)
    00971         /*@modifies h @*/;
    00972
    00979 /*@null@*/
    00980 void * headerGetStats(Header h, int opx)
    00981         /*@*/;
    00982
    00988 int headerMacrosLoad(Header h)
    00989         /*@globals internalState @*/
    00990         /*@modifies internalState @*/;
    00991
    00997 int headerMacrosUnload(Header h)
    00998         /*@globals internalState @*/
    00999         /*@modifies internalState @*/;
    01000
    01011 int headerNEVRA(Header h,
    01012                 /*@null@*/ /*@out@*/ const char ** np,
    01013                 /*@null@*/ /*@out@*/ /*@unused@*/ const char ** ep,
    01014                 /*@null@*/ /*@out@*/ const char ** vp,
    01015                 /*@null@*/ /*@out@*/ const char ** rp,
    01016                 /*@null@*/ /*@out@*/ const char ** ap)
    01017         /*@modifies h, *np, *vp, *rp, *ap @*/;
    01018
    01024 uint32_t hGetColor(Header h)
    01025         /*@modifies h @*/;
    01026
    01033 void headerMergeLegacySigs(Header h, const Header sigh)
    01034         /*@modifies h, sigh @*/;
    01035
    01043 Header headerRegenSigHeader(const Header h, int noArchiveSize)
    01044         /*@modifies h @*/;
    01045 #ifdef __cplusplus
    01046 }
    01047 #endif
    01048
    01049 #endif  /* H_RPMTAG */