2 * Copyright (c) 2004 Michael Schroeder (mls@suse.de)
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
9 #define TAG_VERSION 1001
10 #define TAG_RELEASE 1002
11 #define TAG_EPOCH 1003
13 #define TAG_FILENAMES 1027
14 #define TAG_FILESIZES 1028
15 #define TAG_FILEMODES 1030
16 #define TAG_FILERDEVS 1033
17 #define TAG_FILEMTIMES 1034
18 #define TAG_FILEMD5S 1035
19 #define TAG_FILELINKTOS 1036
20 #define TAG_FILEFLAGS 1037
21 #define TAG_SOURCERPM 1044
22 #define TAG_FILEVERIFY 1045
23 #define TAG_NOSOURCE 1051
24 #define TAG_NOPATCH 1052
25 #define TAG_DIRINDEXES 1116
26 #define TAG_BASENAMES 1117
27 #define TAG_DIRNAMES 1118
28 #define TAG_PAYLOADFORMAT 1124
29 #define TAG_PAYLOADCOMPRESSOR 1125
30 #define TAG_PAYLOADFLAGS 1126
31 #define TAG_FILECOLORS 1140
32 #define TAG_FILEDIGESTALGO 5011
34 #define SIGTAG_SIZE 1000
35 #define SIGTAG_MD5 1004
36 #define SIGTAG_GPG 1005
37 #define SIGTAG_PAYLOADSIZE 1007
38 #define SIGTAG_SHA1 269
40 #define FILE_CONFIG (1 << 0)
41 #define FILE_MISSINGOK (1 << 3)
42 #define FILE_GHOST (1 << 6)
43 #define FILE_UNPATCHED (1 << 10)
45 #define VERIFY_MD5 (1 << 0)
46 #define VERIFY_FILESIZE (1 << 1)
48 #define RPMFC_ELF32 (1 << 0)
49 #define RPMFC_ELF64 (1 << 1)
51 #define devmajor(rdev) (((rdev) >> 8) & 0xfff)
52 #define devminor(rdev) (((rdev) & 0xff) | (((rdev) >> 12) & 0xfff00))
59 unsigned char intro[16];
60 unsigned char data[1];
63 extern struct rpmhead *readhead(int fd, int pad);
64 extern struct rpmhead *readhead_buf(unsigned char *buf, int len, int pad);
65 unsigned int *headint32(struct rpmhead *h, int tag, int *cnt);
66 unsigned int *headint16(struct rpmhead *h, int tag, int *cnt);
67 char *headstring(struct rpmhead *h, int tag);
68 unsigned char *headbin(struct rpmhead *h, int tag, int len);
69 char **headstringarray(struct rpmhead *h, int tag, int *cnt);
70 char **headexpandfilelist(struct rpmhead *h, int *cnt);
71 char *headtonevr(struct rpmhead *h);
72 int headtagtype(struct rpmhead *h, int tag);