rpm 5.2.1

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

- File List
- Globals

rpmtag.h
Go to the documentation of this file.
1 #ifndef H_RPMTAG
2 #define H_RPMTAG
3
8 #include <rpmiotypes.h>
9 #include <rpmsw.h>
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
17 typedef const char * errmsg_t;
18
21 typedef /*@abstract@*/ /*@refcounted@*/ struct headerToken_s * Header;
22
26 enum rpmTagType_e {
27 /* RPM_NULL_TYPE = 0 - never been used. */
28 /* RPM_CHAR_TYPE = 1 - never been used, same as RPM_UINT8_TYPE. */
29 RPM_UINT8_TYPE = 2,
30 RPM_UINT16_TYPE = 3,
31 RPM_UINT32_TYPE = 4,
32 RPM_UINT64_TYPE = 5,
33 RPM_STRING_TYPE = 6,
34 RPM_BIN_TYPE = 7,
35 RPM_STRING_ARRAY_TYPE = 8,
36 RPM_I18NSTRING_TYPE = 9
37 /* RPM_ASN1_TYPE = 10 - never been used. */
38 /* RPM_OPENPGP_TYPE= 11 - never been used. */
39 };
40 #define RPM_MIN_TYPE 2
41 #define RPM_MAX_TYPE 9
42 #define RPM_MASK_TYPE 0x0000ffff
43
46 typedef enum rpmTagType_e rpmTagType;
50 typedef union rpmDataType_u rpmTagData;
54 typedef rpmuint32_t rpmTagCount;
58 typedef struct _HE_s * HE_t;
62 /*@-typeuse -fielduse@*/
63 #if !defined(SWIG)
64 union rpmDataType_u {
65 /*@null@*/
66 void * ptr;
67 rpmuint8_t * ui8p;
68 rpmuint16_t * ui16p;
69 rpmuint32_t * ui32p;
70 rpmuint64_t * ui64p;
71 /*@relnull@*/
72 const char * str;
73 unsigned char * blob;
74 const char ** argv;
75 HE_t he;
76 };
77 #endif
78 /*@=typeuse =fielduse@*/
79
80 /*@=typeuse =fielduse@*/
83 /*@-enummemuse -typeuse @*/
84 typedef enum rpmSubTagType_e {
85 RPM_REGION_TYPE = -10,
86 RPM_BIN_ARRAY_TYPE = -11,
87 RPM_XREF_TYPE = -12
88 } rpmSubTagType;
89 /*@=enummemuse =typeuse @*/
90
94 /*@-enummemuse -typeuse @*/
95 typedef enum rpmTagReturnType_e {
96 RPM_ANY_RETURN_TYPE = 0,
97 RPM_SCALAR_RETURN_TYPE = 0x00010000,
98 RPM_ARRAY_RETURN_TYPE = 0x00020000,
99 RPM_MAPPING_RETURN_TYPE = 0x00040000,
100 /* 0x00080000 */
101 RPM_PROBE_RETURN_TYPE = 0x00100000,
102 RPM_TREE_RETURN_TYPE = 0x00200000,
103 RPM_OPENPGP_RETURN_TYPE = 0x00400000,
104 RPM_X509_RETURN_TYPE = 0x00800000,
105 RPM_ASN1_RETURN_TYPE = 0x01000000,
106 RPM_OPAQUE_RETURN_TYPE = 0x10000000,
107 RPM_MASK_RETURN_TYPE = 0xffff0000
108 } rpmTagReturnType;
109 /*@=enummemuse =typeuse @*/
110
115 #define HEADER_IMAGE 61
116 #define HEADER_SIGNATURES 62
117 #define HEADER_IMMUTABLE 63
118 #define HEADER_REGIONS 64
119 #define HEADER_I18NTABLE 100
120 #define HEADER_SIGBASE 256
121 #define HEADER_TAGBASE 1000
122
125 typedef /*@abstract@*/ struct headerIterator_s * HeaderIterator;
126
129 typedef /*@abstract@*/ struct headerTagIndices_s * headerTagIndices;
130
133 typedef /*@abstract@*/ const struct headerSprintfExtension_s * headerSprintfExtension;
134
138 #define RPMDBI_PACKAGES 0 /* Installed package headers. */
139 #define RPMDBI_DEPENDS 1 /* Dependency resolution cache. */
140 #define RPMDBI_LABEL 2 /* Fingerprint search marker. */
141 #define RPMDBI_ADDED 3 /* Added package headers. */
142 #define RPMDBI_REMOVED 4 /* Removed package headers. */
143 #define RPMDBI_AVAILABLE 5 /* Available package headers. */
144 #define RPMDBI_HDLIST 6 /* (rpmgi) Header list. */
145 #define RPMDBI_ARGLIST 7 /* (rpmgi) Argument list. */
146 #define RPMDBI_FTSWALK 8 /* (rpmgi) File tree walk. */
147
152 enum rpmTag_e {
153
154 RPMTAG_HEADERIMAGE = HEADER_IMAGE,
155 RPMTAG_HEADERSIGNATURES = HEADER_SIGNATURES,
156 RPMTAG_HEADERIMMUTABLE = HEADER_IMMUTABLE,
157 /*@-enummemuse@*/
158 RPMTAG_HEADERREGIONS = HEADER_REGIONS,
160 RPMTAG_HEADERI18NTABLE = HEADER_I18NTABLE,
161 /*@=enummemuse@*/
162
163 /* Retrofit (and uniqify) signature tags for use by tagName() and rpmQuery. */
164 /* the md5 sum was broken *twice* on big endian machines */
165 /* XXX 2nd underscore prevents tagTable generation */
166 RPMTAG_SIG_BASE = HEADER_SIGBASE,
167 RPMTAG_SIGSIZE = RPMTAG_SIG_BASE+1, /* i */
168 RPMTAG_SIGLEMD5_1 = RPMTAG_SIG_BASE+2, /* internal - obsolete */
169 RPMTAG_SIGPGP = RPMTAG_SIG_BASE+3, /* x */
170 RPMTAG_SIGLEMD5_2 = RPMTAG_SIG_BASE+4, /* x internal - obsolete */
171 RPMTAG_SIGMD5 = RPMTAG_SIG_BASE+5, /* x */
172 #define RPMTAG_PKGID RPMTAG_SIGMD5 /* x */
173 RPMTAG_SIGGPG = RPMTAG_SIG_BASE+6, /* x */
174 RPMTAG_SIGPGP5 = RPMTAG_SIG_BASE+7, /* internal - obsolete */
175
176 RPMTAG_BADSHA1_1 = RPMTAG_SIG_BASE+8, /* internal - obsolete */
177 RPMTAG_BADSHA1_2 = RPMTAG_SIG_BASE+9, /* internal - obsolete */
178 RPMTAG_PUBKEYS = RPMTAG_SIG_BASE+10, /* s[] */
179 RPMTAG_DSAHEADER = RPMTAG_SIG_BASE+11, /* x */
180 RPMTAG_RSAHEADER = RPMTAG_SIG_BASE+12, /* x */
181 RPMTAG_SHA1HEADER = RPMTAG_SIG_BASE+13, /* s */
182 #define RPMTAG_HDRID RPMTAG_SHA1HEADER /* s */
183
184 RPMTAG_NAME = 1000, /* s */
185 #define RPMTAG_N RPMTAG_NAME /* s */
186 RPMTAG_VERSION = 1001, /* s */
187 #define RPMTAG_V RPMTAG_VERSION /* s */
188 RPMTAG_RELEASE = 1002, /* s */
189 #define RPMTAG_R RPMTAG_RELEASE /* s */
190 RPMTAG_EPOCH = 1003, /* i */
191 #define RPMTAG_E RPMTAG_EPOCH /* i */
192 RPMTAG_SUMMARY = 1004, /* s{} */
193 RPMTAG_DESCRIPTION = 1005, /* s{} */
194 RPMTAG_BUILDTIME = 1006, /* i */
195 RPMTAG_BUILDHOST = 1007, /* s */
196 RPMTAG_INSTALLTIME = 1008, /* i[] */
197 RPMTAG_SIZE = 1009, /* i */
198 RPMTAG_DISTRIBUTION = 1010, /* s */
199 RPMTAG_VENDOR = 1011, /* s */
200 RPMTAG_GIF = 1012, /* x */
201 RPMTAG_XPM = 1013, /* x */
202 RPMTAG_LICENSE = 1014, /* s */
203 RPMTAG_PACKAGER = 1015, /* s */
204 RPMTAG_GROUP = 1016, /* s{} */
205 /*@-enummemuse@*/
206 RPMTAG_CHANGELOG = 1017, /* s[] internal */
207 /*@=enummemuse@*/
208 RPMTAG_SOURCE = 1018, /* s[] */
209 RPMTAG_PATCH = 1019, /* s[] */
210 RPMTAG_URL = 1020, /* s */
211 RPMTAG_OS = 1021, /* s legacy used int */
212 RPMTAG_ARCH = 1022, /* s legacy used int */
213 RPMTAG_PREIN = 1023, /* s */
214 RPMTAG_POSTIN = 1024, /* s */
215 RPMTAG_PREUN = 1025, /* s */
216 RPMTAG_POSTUN = 1026, /* s */
217 RPMTAG_OLDFILENAMES = 1027, /* s[] obsolete */
218 RPMTAG_FILESIZES = 1028, /* i[] */
219 RPMTAG_FILESTATES = 1029, /* c[] */
220 RPMTAG_FILEMODES = 1030, /* h[] */
221 RPMTAG_FILEUIDS = 1031, /* i[] internal */
222 RPMTAG_FILEGIDS = 1032, /* i[] internal */
223 RPMTAG_FILERDEVS = 1033, /* h[] */
224 RPMTAG_FILEMTIMES = 1034, /* i[] */
225 RPMTAG_FILEDIGESTS = 1035, /* s[] */
226 #define RPMTAG_FILEMD5S RPMTAG_FILEDIGESTS /* s[] */
227 RPMTAG_FILELINKTOS = 1036, /* s[] */
228 RPMTAG_FILEFLAGS = 1037, /* i[] */
229 /*@-enummemuse@*/
230 RPMTAG_ROOT = 1038, /* internal - obsolete */
231 /*@=enummemuse@*/
232 RPMTAG_FILEUSERNAME = 1039, /* s[] */
233 RPMTAG_FILEGROUPNAME = 1040, /* s[] */
234 /*@-enummemuse@*/
235 RPMTAG_EXCLUDE = 1041, /* internal - obsolete */
236 RPMTAG_EXCLUSIVE = 1042, /* internal - obsolete */
237 /*@=enummemuse@*/
238 RPMTAG_ICON = 1043, /* x */
239 RPMTAG_SOURCERPM = 1044, /* s */
240 RPMTAG_FILEVERIFYFLAGS = 1045, /* i[] */
241 RPMTAG_ARCHIVESIZE = 1046, /* i */
242 RPMTAG_PROVIDENAME = 1047, /* s[] */
243 #define RPMTAG_PROVIDES RPMTAG_PROVIDENAME /* s[] */
244 #define RPMTAG_P RPMTAG_PROVIDENAME /* s[] */
245 RPMTAG_REQUIREFLAGS = 1048, /* i[] */
246 RPMTAG_REQUIRENAME = 1049, /* s[] */
247 #define RPMTAG_REQUIRES RPMTAG_REQUIRENAME /* s[] */
248 RPMTAG_REQUIREVERSION = 1050, /* s[] */
249 RPMTAG_NOSOURCE = 1051, /* i internal */
250 RPMTAG_NOPATCH = 1052, /* i internal */
251 RPMTAG_CONFLICTFLAGS = 1053, /* i[] */
252 RPMTAG_CONFLICTNAME = 1054, /* s[] */
253 #define RPMTAG_CONFLICTS RPMTAG_CONFLICTNAME /* s[] */
254 #define RPMTAG_C RPMTAG_CONFLICTNAME /* s[] */
255 RPMTAG_CONFLICTVERSION = 1055, /* s[] */
256 RPMTAG_DEFAULTPREFIX = 1056, /* s internal - deprecated */
257 RPMTAG_BUILDROOT = 1057, /* s internal */
258 RPMTAG_INSTALLPREFIX = 1058, /* s internal - deprecated */
259 RPMTAG_EXCLUDEARCH = 1059, /* s[] */
260 RPMTAG_EXCLUDEOS = 1060, /* s[] */
261 RPMTAG_EXCLUSIVEARCH = 1061, /* s[] */
262 RPMTAG_EXCLUSIVEOS = 1062, /* s[] */
263 RPMTAG_AUTOREQPROV = 1063, /* s internal */
264 RPMTAG_RPMVERSION = 1064, /* s */
265 RPMTAG_TRIGGERSCRIPTS = 1065, /* s[] */
266 RPMTAG_TRIGGERNAME = 1066, /* s[] */
267 RPMTAG_TRIGGERVERSION = 1067, /* s[] */
268 RPMTAG_TRIGGERFLAGS = 1068, /* i[] */
269 RPMTAG_TRIGGERINDEX = 1069, /* i[] */
270 RPMTAG_VERIFYSCRIPT = 1079, /* s */
271 RPMTAG_CHANGELOGTIME = 1080, /* i[] */
272 RPMTAG_CHANGELOGNAME = 1081, /* s[] */
273 RPMTAG_CHANGELOGTEXT = 1082, /* s[] */
274 /*@-enummemuse@*/
275 RPMTAG_BROKENMD5 = 1083, /* internal - obsolete */
276 /*@=enummemuse@*/
277 RPMTAG_PREREQ = 1084, /* internal */
278 RPMTAG_PREINPROG = 1085, /* s */
279 RPMTAG_POSTINPROG = 1086, /* s */
280 RPMTAG_PREUNPROG = 1087, /* s */
281 RPMTAG_POSTUNPROG = 1088, /* s */
282 RPMTAG_BUILDARCHS = 1089, /* s[] */
283 RPMTAG_OBSOLETENAME = 1090, /* s[] */
284 #define RPMTAG_OBSOLETES RPMTAG_OBSOLETENAME /* s[] */
285 #define RPMTAG_O RPMTAG_OBSOLETENAME /* s[] */
286 RPMTAG_VERIFYSCRIPTPROG = 1091, /* s */
287 RPMTAG_TRIGGERSCRIPTPROG = 1092, /* s[] */
288 RPMTAG_DOCDIR = 1093, /* internal */
289 RPMTAG_COOKIE = 1094, /* s */
290 RPMTAG_FILEDEVICES = 1095, /* i[] */
291 RPMTAG_FILEINODES = 1096, /* i[] */
292 RPMTAG_FILELANGS = 1097, /* s[] */
293 RPMTAG_PREFIXES = 1098, /* s[] */
294 RPMTAG_INSTPREFIXES = 1099, /* s[] */
295 RPMTAG_TRIGGERIN = 1100, /* internal */
296 RPMTAG_TRIGGERUN = 1101, /* internal */
297 RPMTAG_TRIGGERPOSTUN = 1102, /* internal */
298 RPMTAG_AUTOREQ = 1103, /* internal */
299 RPMTAG_AUTOPROV = 1104, /* internal */
300 /*@-enummemuse@*/
301 RPMTAG_CAPABILITY = 1105, /* i legacy - obsolete */
302 /*@=enummemuse@*/
303 RPMTAG_SOURCEPACKAGE = 1106, /* i legacy - obsolete */
304 /*@-enummemuse@*/
305 RPMTAG_OLDORIGFILENAMES = 1107, /* internal - obsolete */
306 /*@=enummemuse@*/
307 RPMTAG_BUILDPREREQ = 1108, /* internal */
308 RPMTAG_BUILDREQUIRES = 1109, /* internal */
309 RPMTAG_BUILDCONFLICTS = 1110, /* internal */
310 /*@-enummemuse@*/
311 RPMTAG_BUILDMACROS = 1111, /* s[] srpms only */
312 /*@=enummemuse@*/
313 RPMTAG_PROVIDEFLAGS = 1112, /* i[] */
314 RPMTAG_PROVIDEVERSION = 1113, /* s[] */
315 RPMTAG_OBSOLETEFLAGS = 1114, /* i[] */
316 RPMTAG_OBSOLETEVERSION = 1115, /* s[] */
317 RPMTAG_DIRINDEXES = 1116, /* i[] */
318 RPMTAG_BASENAMES = 1117, /* s[] */
319 RPMTAG_DIRNAMES = 1118, /* s[] */
320 RPMTAG_ORIGDIRINDEXES = 1119, /* i[] relocation */
321 RPMTAG_ORIGBASENAMES = 1120, /* s[] relocation */
322 RPMTAG_ORIGDIRNAMES = 1121, /* s[] relocation */
323 RPMTAG_OPTFLAGS = 1122, /* s */
324 RPMTAG_DISTURL = 1123, /* s */
325 RPMTAG_PAYLOADFORMAT = 1124, /* s */
326 RPMTAG_PAYLOADCOMPRESSOR = 1125, /* s */
327 RPMTAG_PAYLOADFLAGS = 1126, /* s */
328 RPMTAG_INSTALLCOLOR = 1127, /* i transaction color when installed */
329 RPMTAG_INSTALLTID = 1128, /* i[] */
330 RPMTAG_REMOVETID = 1129, /* i[] */
331 /*@-enummemuse@*/
332 RPMTAG_SHA1RHN = 1130, /* internal - obsolete */
333 /*@=enummemuse@*/
334 RPMTAG_RHNPLATFORM = 1131, /* s deprecated */
335 RPMTAG_PLATFORM = 1132, /* s */
336 RPMTAG_PATCHESNAME = 1133, /* s[] deprecated placeholder (SuSE) */
337 RPMTAG_PATCHESFLAGS = 1134, /* i[] deprecated placeholder (SuSE) */
338 RPMTAG_PATCHESVERSION = 1135, /* s[] deprecated placeholder (SuSE) */
339 RPMTAG_CACHECTIME = 1136, /* i rpmcache(8) only */
340 RPMTAG_CACHEPKGPATH = 1137, /* s rpmcache(8) only */
341 RPMTAG_CACHEPKGSIZE = 1138, /* i rpmcache(8) only */
342 RPMTAG_CACHEPKGMTIME = 1139, /* i rpmcache(8) only */
343 RPMTAG_FILECOLORS = 1140, /* i[] */
344 RPMTAG_FILECLASS = 1141, /* i[] */
345 RPMTAG_CLASSDICT = 1142, /* s[] */
346 RPMTAG_FILEDEPENDSX = 1143, /* i[] */
347 RPMTAG_FILEDEPENDSN = 1144, /* i[] */
348 RPMTAG_DEPENDSDICT = 1145, /* i[] */
349 RPMTAG_SOURCEPKGID = 1146, /* x */
350 RPMTAG_FILECONTEXTS = 1147, /* s[] */
351 RPMTAG_FSCONTEXTS = 1148, /* s[] extension */
352 RPMTAG_RECONTEXTS = 1149, /* s[] extension */
353 RPMTAG_POLICIES = 1150, /* s[] selinux *.te policy file. */
354 RPMTAG_PRETRANS = 1151, /* s */
355 RPMTAG_POSTTRANS = 1152, /* s */
356 RPMTAG_PRETRANSPROG = 1153, /* s */
357 RPMTAG_POSTTRANSPROG = 1154, /* s */
358 RPMTAG_DISTTAG = 1155, /* s */
359 RPMTAG_SUGGESTSNAME = 1156, /* s[] extension */
360 #define RPMTAG_SUGGESTS RPMTAG_SUGGESTSNAME /* s[] */
361 RPMTAG_SUGGESTSVERSION = 1157, /* s[] extension */
362 RPMTAG_SUGGESTSFLAGS = 1158, /* i[] extension */
363 RPMTAG_ENHANCESNAME = 1159, /* s[] extension placeholder */
364 #define RPMTAG_ENHANCES RPMTAG_ENHANCESNAME /* s[] */
365 RPMTAG_ENHANCESVERSION = 1160, /* s[] extension placeholder */
366 RPMTAG_ENHANCESFLAGS = 1161, /* i[] extension placeholder */
367 RPMTAG_PRIORITY = 1162, /* i[] extension placeholder */
368 RPMTAG_CVSID = 1163, /* s */
369 #define RPMTAG_SVNID RPMTAG_CVSID /* s */
370 RPMTAG_BLINKPKGID = 1164, /* s[] */
371 RPMTAG_BLINKHDRID = 1165, /* s[] */
372 RPMTAG_BLINKNEVRA = 1166, /* s[] */
373 RPMTAG_FLINKPKGID = 1167, /* s[] */
374 RPMTAG_FLINKHDRID = 1168, /* s[] */
375 RPMTAG_FLINKNEVRA = 1169, /* s[] */
376 RPMTAG_PACKAGEORIGIN = 1170, /* s */
377 RPMTAG_TRIGGERPREIN = 1171, /* internal */
378 RPMTAG_BUILDSUGGESTS = 1172, /* internal */
379 RPMTAG_BUILDENHANCES = 1173, /* internal */
380 RPMTAG_SCRIPTSTATES = 1174, /* i[] scriptlet exit codes */
381 RPMTAG_SCRIPTMETRICS = 1175, /* i[] scriptlet execution times */
382 RPMTAG_BUILDCPUCLOCK = 1176, /* i */
383 RPMTAG_FILEDIGESTALGOS = 1177, /* i[] */
384 RPMTAG_VARIANTS = 1178, /* s[] */
385 RPMTAG_XMAJOR = 1179, /* i */
386 RPMTAG_XMINOR = 1180, /* i */
387 RPMTAG_REPOTAG = 1181, /* s */
388 RPMTAG_KEYWORDS = 1182, /* s[] */
389 RPMTAG_BUILDPLATFORMS = 1183, /* s[] */
390 RPMTAG_PACKAGECOLOR = 1184, /* i */
391 RPMTAG_PACKAGEPREFCOLOR = 1185, /* i (unimplemented) */
392 RPMTAG_XATTRSDICT = 1186, /* s[] (unimplemented) */
393 RPMTAG_FILEXATTRSX = 1187, /* i[] (unimplemented) */
394 RPMTAG_DEPATTRSDICT = 1188, /* s[] (unimplemented) */
395 RPMTAG_CONFLICTATTRSX = 1189, /* i[] (unimplemented) */
396 RPMTAG_OBSOLETEATTRSX = 1190, /* i[] (unimplemented) */
397 RPMTAG_PROVIDEATTRSX = 1191, /* i[] (unimplemented) */
398 RPMTAG_REQUIREATTRSX = 1192, /* i[] (unimplemented) */
399 RPMTAG_BUILDPROVIDES = 1193, /* internal */
400 RPMTAG_BUILDOBSOLETES = 1194, /* internal */
401 RPMTAG_DBINSTANCE = 1195, /* i */
402 RPMTAG_NVRA = 1196, /* s */
403 RPMTAG_FILEPATHS = 1197, /* s[] */
404 RPMTAG_ORIGPATHS = 1198, /* s[] */
405 RPMTAG_RPMLIBVERSION = 1199, /* i */
406 RPMTAG_RPMLIBTIMESTAMP = 1200, /* i */
407 RPMTAG_RPMLIBVENDOR = 1201, /* i */
408 RPMTAG_CLASS = 1202, /* s arbitrary */
409 RPMTAG_TRACK = 1203, /* s internal arbitrary */
410 RPMTAG_TRACKPROG = 1204, /* s internal arbitrary */
411 RPMTAG_SANITYCHECK = 1205, /* s */
412 RPMTAG_SANITYCHECKPROG = 1206, /* s */
413 RPMTAG_FILESTAT = 1207, /* s[] stat(2) from metadata extension*/
414 RPMTAG_STAT = 1208, /* s[] stat(2) from disk extension */
415 RPMTAG_ORIGINTID = 1209, /* i[] */
416 RPMTAG_ORIGINTIME = 1210, /* i[] */
417 RPMTAG_HEADERSTARTOFF = 1211, /* l */
418 RPMTAG_HEADERENDOFF = 1212, /* l */
419 RPMTAG_PACKAGETIME = 1213, /* l */
420 RPMTAG_PACKAGESIZE = 1214, /* l */
421 RPMTAG_PACKAGEDIGEST = 1215, /* s */
422 RPMTAG_PACKAGESTAT = 1216, /* x */
423 RPMTAG_PACKAGEBASEURL = 1217, /* s */
424 RPMTAG_DISTEPOCH = 1218, /* s */
425 #define RPMTAG_D RPMTAG_DISTEPOCH /* s */
426
427 RPMTAG_FILEDIGESTALGO = 5011, /* i file checksum algorithm */
428
429 /*@-enummemuse@*/
430 RPMTAG_FIRSTFREE_TAG,
431 /*@=enummemuse@*/
432
433 RPMTAG_PACKAGETRANSFLAGS = 0x4efaafd9, /* s[] arbitrary */
434 RPMTAG_PACKAGEDEPFLAGS = 0x748a8314, /* s[] arbitrary */
435
436 RPMTAG_BUILDPREPPROG = 0x4ba37c9e, /* s[] arbitrary */
437 RPMTAG_BUILDPREP = 0x799c0b4d, /* s[] arbitrary */
438 RPMTAG_BUILDBUILDPROG = 0x6fb46014, /* s[] arbitrary */
439 RPMTAG_BUILDBUILD = 0x5bae1a5a, /* s[] arbitrary */
440 RPMTAG_BUILDINSTALLPROG = 0x70d4ab6f, /* s[] arbitrary */
441 RPMTAG_BUILDINSTALL = 0x567f5983, /* s[] arbitrary */
442 RPMTAG_BUILDCHECKPROG = 0x488a60ce, /* s[] arbitrary */
443 RPMTAG_BUILDCHECK = 0x7f3b97b5, /* s[] arbitrary */
444 RPMTAG_BUILDCLEANPROG = 0x42c93d41, /* s[] arbitrary */
445 RPMTAG_BUILDCLEAN = 0x566042bf, /* s[] arbitrary */
446
447 RPMTAG_LASTARBITRARY_TAG = 0x80000000
448 };
449
450 #define RPMTAG_EXTERNAL_TAG 1000000
451
455 enum rpmSigTag_e {
456 RPMSIGTAG_SIZE = 1000,
457 RPMSIGTAG_LEMD5_1 = 1001,
458 RPMSIGTAG_PGP = 1002,
459 RPMSIGTAG_LEMD5_2 = 1003,
460 RPMSIGTAG_MD5 = 1004,
461 RPMSIGTAG_GPG = 1005,
462 RPMSIGTAG_PGP5 = 1006,
463 RPMSIGTAG_PAYLOADSIZE = 1007,
464 RPMSIGTAG_BADSHA1_1 = RPMTAG_BADSHA1_1,
465 RPMSIGTAG_BADSHA1_2 = RPMTAG_BADSHA1_2,
466 RPMSIGTAG_SHA1 = RPMTAG_SHA1HEADER,
467 RPMSIGTAG_DSA = RPMTAG_DSAHEADER,
468 RPMSIGTAG_RSA = RPMTAG_RSAHEADER,
469 RPMSIGTAG_PADDING = 0x3fffffff
470 };
471
474 typedef enum rpmTag_e rpmTag;
475
478 typedef enum rpmSigTag_e rpmSigTag;
479
482 /*@-typeuse -fielduse@*/
483 #if !defined(SWIG)
484 struct _HE_s {
485 rpmTag tag;
486 rpmTagType t;
487 /*@owned@*/ /*@null@*/
488 rpmTagData p;
489 rpmTagCount c;
490 int ix;
491 unsigned int freeData : 1;
492 unsigned int avail : 1;
493 unsigned int append : 1;
494 };
495 #endif
496
499 typedef struct _HE_s HE_s;
500
503 typedef struct tagStore_s * tagStore_t;
504
507 typedef /*@abstract@*/ const struct headerTagTableEntry_s * headerTagTableEntry;
508
509 #if defined(_RPMTAG_INTERNAL)
510
515 #if !defined(SWIG)
516 struct headerTagTableEntry_s {
517 /*@observer@*/ /*@relnull@*/
518 const char * name;
519 rpmTag val;
520 rpmTagType type;
521 };
522 #endif
523
526 struct tagStore_s {
527 /*@only@*/
528 const char * str;
529 rpmTag tag;
530 rpmiob iob;
531 };
532 #endif /* _RPMTAG_INTERNAL */
533
537 /*@-redecl@*/
538 /*@observer@*/ /*@unchecked@*/
539 extern headerTagTableEntry rpmTagTable;
540 /*@=redecl@*/
541
545 /*@-redecl@*/
546 /*@unchecked@*/
547 extern int rpmTagTableSize;
548
549 /*@unchecked@*/
550 extern headerTagIndices rpmTags;
551 /*@=redecl@*/
552
553 #if defined(_RPMTAG_INTERNAL)
554
556 #if !defined(SWIG)
557 struct headerTagIndices_s {
558 /*@relnull@*/
559 int (*loadIndex) (headerTagTableEntry ** ipp, size_t * np,
560 int (*cmp) (const void * avp, const void * bvp))
561 /*@ modifies *ipp, *np */;
562 /*@relnull@*/
563 headerTagTableEntry * byName;
564 size_t byNameSize;
565 int (*byNameCmp) (const void * avp, const void * bvp)
566 /*@*/;
567 rpmTag (*tagValue) (const char * name)
568 /*@*/;
569 /*@relnull@*/
570 headerTagTableEntry * byValue;
571 size_t byValueSize;
572 int (*byValueCmp) (const void * avp, const void * bvp)
573 /*@*/;
574 const char * (*tagName) (rpmTag value)
575 /*@*/;
576 rpmTag (*tagType) (rpmTag value)
577 /*@*/;
578 size_t nameBufLen;
579 /*@relnull@*/
580 const char ** aTags;
581 /*@owned@*/ /*@null@*/
582 char * nameBuf; /* Name buffer. */
583 /*@only@*/
584 char * (*tagCanonicalize) (const char * s)
585 /*@*/;
586 rpmTag (*tagGenerate) (const char * s)
587 /*@*/;
588 };
589 #endif
590 #endif /* _RPMTAG_INTERNAL */
591
597 /*@observer@*/
598 const char * tagName(rpmTag tag)
599 /*@*/;
600
607 unsigned int tagType(rpmTag tag)
608 /*@*/;
609
615 rpmTag tagValue(const char * tagstr)
616 /*@*/;
617
623 /*@only@*/
624 char * tagCanonicalize(const char * s)
625 /*@*/;
626
632 rpmTag tagGenerate(const char * s)
633 /*@*/;
634
639 void tagClean(/*@null@*/ headerTagIndices _rpmTags)
640 /*@globals rpmTags @*/
641 /*@modifies _rpmTags, rpmTags @*/;
642
649 /*@null@*/
650 tagStore_t tagStoreFree(/*@only@*//*@null@*/tagStore_t dbiTags, size_t dbiNTags)
651 /*@modifies dbiTags @*/;
652
653 #if defined(_RPMTAG_INTERNAL)
654
656 typedef enum headerSprintfExtensionType_e {
657 HEADER_EXT_LAST = 0,
658 HEADER_EXT_FORMAT,
659 HEADER_EXT_MORE,
660 HEADER_EXT_TAG
661 } headerSprintfExtensionType;
662
670 typedef /*only@*/ char * (*headerTagFormatFunction) (HE_t he, /*@null@*/ const char ** av)
671 /*@modifies he @*/;
672
681 typedef int (*headerTagTagFunction) (Header h, HE_t he)
682 /*@modifies he @*/;
683
687 #if !defined(SWIG)
688 struct headerSprintfExtension_s {
689 headerSprintfExtensionType type;
690 /*@observer@*/ /*@null@*/
691 const char * name;
692 union {
693 /*@observer@*/ /*@null@*/
694 void * generic;
695 headerTagFormatFunction fmtFunction;
696 headerTagTagFunction tagFunction;
697 headerSprintfExtension * more;
698 } u;
699 };
700 #endif
701 #endif /* _RPMTAG_INTERNAL */
702
706 /*@unchecked@*/ /*@observer@*/
707 extern headerSprintfExtension headerDefaultFormats;
708
712 /*@unchecked@*/ /*@observer@*/
713 extern headerSprintfExtension headerCompoundFormats;
714
721 void rpmDisplayQueryTags(/*@null@*/ FILE * fp,
722 /*@null@*/ headerTagTableEntry _rpmTagTable,
723 /*@null@*/ headerSprintfExtension _rpmHeaderFormats)
724 /*@globals fileSystem, internalState @*/
725 /*@modifies *fp, fileSystem, internalState @*/;
726
738 /*@only@*/ /*@null@*/
739 char * headerSprintf(Header h, const char * fmt,
740 /*@null@*/ headerTagTableEntry tags,
741 /*@null@*/ headerSprintfExtension exts,
742 /*@null@*/ /*@out@*/ errmsg_t * errmsg)
743 /*@globals headerCompoundFormats, fileSystem, internalState @*/
744 /*@modifies h, *errmsg, fileSystem, internalState @*/;
745
754 int headerGet(Header h, HE_t he, unsigned int flags)
755 /*@globals internalState @*/
756 /*@modifies he, internalState @*/;
757 #define HEADERGET_NOEXTENSION (1 << 0)
758 #define HEADERGET_NOI18NSTRING (1 << 1)
768 /*@mayexit@*/
769 int headerPut(Header h, HE_t he, /*@unused@*/ unsigned int flags)
770 /*@modifies h @*/;
771
780 /*@mayexit@*/
781 int headerDel(Header h, HE_t he, /*@unused@*/ unsigned int flags)
782 /*@modifies h @*/;
783
792 int headerMod(Header h, HE_t he, /*@unused@*/ unsigned int flags)
793 /*@modifies h @*/;
794
800 /*@null@*/
801 HeaderIterator headerFini(/*@only@*/ HeaderIterator hi)
802 /*@globals fileSystem @*/
803 /*@modifies hi, fileSystem */;
804
810 HeaderIterator headerInit(Header h)
811 /*@globals fileSystem @*/
812 /*@modifies h, fileSystem */;
813
821 int headerNext(HeaderIterator hi, HE_t he, /*@unused@*/ unsigned int flags)
822 /*@globals internalState @*/
823 /*@modifies hi, he, internalState @*/;
824
830 Header headerLink(Header h)
831 /*@modifies h @*/;
832 #define headerLink(_h) \
833 ((Header)rpmioLinkPoolItem((rpmioItem)(_h), __FUNCTION__, __FILE__, __LINE__))
834
840 /*@null@*/
841 Header headerUnlink(/*@killref@*/ /*@null@*/ Header h)
842 /*@modifies h @*/;
843 #define headerUnlink(_h) \
844 ((Header)rpmioUnlinkPoolItem((rpmioItem)(_h), __FUNCTION__, __FILE__, __LINE__))
845
851 /*@null@*/
852 Header headerFree(/*@killref@*/ /*@null@*/ Header h)
853 /*@modifies h @*/;
854 #define headerFree(_h) \
855 ((Header)rpmioFreePoolItem((rpmioItem)(_h), __FUNCTION__, __FILE__, __LINE__))
856
861 Header headerNew(void)
862 /*@globals fileSystem @*/
863 /*@modifies fileSystem @*/;
864
870 size_t headerSizeof(/*@null@*/ Header h)
871 /*@modifies h @*/;
872
879 /*@only@*/ /*@null@*/
880 void * headerUnload(Header h, /*@out@*/ /*@null@*/ size_t * lenp)
881 /*@globals internalState @*/
882 /*@modifies h, *lenp, internalState @*/;
883
892 /*@null@*/
893 Header headerReload(/*@only@*/ Header h, int tag)
894 /*@globals fileSystem, internalState @*/
895 /*@modifies h, fileSystem, internalState @*/;
896
902 /*@null@*/
903 Header headerCopy(Header h)
904 /*@globals fileSystem, internalState @*/
905 /*@modifies h, fileSystem, internalState @*/;
906
912 /*@null@*/
913 Header headerLoad(/*@kept@*/ void * uh)
914 /*@globals fileSystem, internalState @*/
915 /*@modifies uh, fileSystem, internalState @*/;
916
922 /*@null@*/
923 Header headerCopyLoad(const void * uh)
924 /*@globals fileSystem, internalState @*/
925 /*@modifies fileSystem, internalState @*/;
926
933 int headerIsEntry(/*@null@*/ Header h, rpmTag tag)
934 /*@*/;
935
956 int headerAddI18NString(Header h, rpmTag tag, const char * string,
957 const char * lang)
958 /*@modifies h @*/;
959
966 void headerCopyTags(Header headerFrom, Header headerTo, rpmTag * tagstocopy)
967 /*@globals internalState @*/
968 /*@modifies headerTo, internalState @*/;
969
977 int headerGetMagic(/*@null@*/ Header h, unsigned char **magicp, size_t *nmagicp)
978 /*@modifies *magicp, *nmagicp @*/;
979
987 int headerSetMagic(/*@null@*/ Header h, unsigned char * magic, size_t nmagic)
988 /*@modifies h @*/;
989
995 /*@observer@*/ /*@null@*/
996 const char * headerGetOrigin(/*@null@*/ Header h)
997 /*@*/;
998
1005 int headerSetOrigin(/*@null@*/ Header h, const char * origin)
1006 /*@modifies h @*/;
1007
1013 /*@observer@*/ /*@null@*/
1014 const char * headerGetBaseURL(/*@null@*/ Header h)
1015 /*@*/;
1016
1023 int headerSetBaseURL(/*@null@*/ Header h, const char * baseurl)
1024 /*@modifies h @*/;
1025
1031 struct stat * headerGetStatbuf(/*@null@*/ Header h)
1032 /*@*/;
1033
1040 int headerSetStatbuf(/*@null@*/ Header h, struct stat * st)
1041 /*@modifies h @*/;
1042
1048 /*@null@*/
1049 const char * headerGetDigest(/*@null@*/ Header h)
1050 /*@*/;
1051
1058 int headerSetDigest(/*@null@*/ Header h, const char * digest)
1059 /*@modifies h @*/;
1060
1066 /*@null@*/
1067 void * headerGetRpmdb(/*@null@*/ Header h)
1068 /*@*/;
1069
1076 /*@null@*/
1077 void * headerSetRpmdb(/*@null@*/ Header h, /*@null@*/ void * rpmdb)
1078 /*@modifies h @*/;
1079
1085 rpmuint32_t headerGetInstance(/*@null@*/ Header h)
1086 /*@*/;
1087
1094 rpmuint32_t headerSetInstance(/*@null@*/ Header h, rpmuint32_t instance)
1095 /*@modifies h @*/;
1096
1102 rpmuint32_t headerGetStartOff(/*@null@*/ Header h)
1103 /*@*/;
1104
1111 rpmuint32_t headerSetStartOff(/*@null@*/ Header h, rpmuint32_t startoff)
1112 /*@modifies h @*/;
1113
1119 rpmuint32_t headerGetEndOff(/*@null@*/ Header h)
1120 /*@*/;
1121
1128 rpmuint32_t headerSetEndOff(/*@null@*/ Header h, rpmuint32_t endoff)
1129 /*@modifies h @*/;
1130
1137 /*@null@*/
1138 void * headerGetStats(Header h, int opx)
1139 /*@*/;
1140
1146 int headerMacrosLoad(Header h)
1147 /*@globals internalState @*/
1148 /*@modifies internalState @*/;
1149
1155 int headerMacrosUnload(Header h)
1156 /*@globals internalState @*/
1157 /*@modifies internalState @*/;
1158
1169 int headerNEVRA(Header h,
1170 /*@null@*/ /*@out@*/ const char ** np,
1171 /*@null@*/ /*@out@*/ /*@unused@*/ const char ** ep,
1172 /*@null@*/ /*@out@*/ const char ** vp,
1173 /*@null@*/ /*@out@*/ const char ** rp,
1174 /*@null@*/ /*@out@*/ const char ** ap)
1175 /*@globals internalState @*/
1176 /*@modifies h, *np, *vp, *rp, *ap, internalState @*/;
1177
1183 rpmuint32_t hGetColor(Header h)
1184 /*@globals internalState @*/
1185 /*@modifies h, internalState @*/;
1186
1193 void headerMergeLegacySigs(Header h, const Header sigh)
1194 /*@globals fileSystem, internalState @*/
1195 /*@modifies h, sigh, fileSystem, internalState @*/;
1196
1204 Header headerRegenSigHeader(const Header h, int noArchiveSize)
1205 /*@globals fileSystem, internalState @*/
1206 /*@modifies h, fileSystem, internalState @*/;
1207
1208 #ifdef __cplusplus
1209 }
1210 #endif
1211
1212 #endif /* H_RPMTAG */