diff options
Diffstat (limited to 'include/unarchive.h')
-rw-r--r-- | include/unarchive.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/unarchive.h b/include/unarchive.h index f3aa05d09..b4cf16082 100644 --- a/include/unarchive.h +++ b/include/unarchive.h | |||
@@ -113,6 +113,39 @@ typedef struct archive_handle_t { | |||
113 | #define ARCHIVE_O_TRUNC (1 << 8) | 113 | #define ARCHIVE_O_TRUNC (1 << 8) |
114 | 114 | ||
115 | 115 | ||
116 | /* POSIX tar Header Block, from POSIX 1003.1-1990 */ | ||
117 | #define TAR_BLOCK_SIZE 512 | ||
118 | #define NAME_SIZE 100 | ||
119 | #define NAME_SIZE_STR "100" | ||
120 | typedef struct tar_header_t { /* byte offset */ | ||
121 | char name[NAME_SIZE]; /* 0-99 */ | ||
122 | char mode[8]; /* 100-107 */ | ||
123 | char uid[8]; /* 108-115 */ | ||
124 | char gid[8]; /* 116-123 */ | ||
125 | char size[12]; /* 124-135 */ | ||
126 | char mtime[12]; /* 136-147 */ | ||
127 | char chksum[8]; /* 148-155 */ | ||
128 | char typeflag; /* 156-156 */ | ||
129 | char linkname[NAME_SIZE]; /* 157-256 */ | ||
130 | /* POSIX: "ustar" NUL "00" */ | ||
131 | /* GNU tar: "ustar " NUL */ | ||
132 | /* Normally it's defined as magic[6] followed by | ||
133 | * version[2], but we put them together to save code. | ||
134 | */ | ||
135 | char magic[8]; /* 257-264 */ | ||
136 | char uname[32]; /* 265-296 */ | ||
137 | char gname[32]; /* 297-328 */ | ||
138 | char devmajor[8]; /* 329-336 */ | ||
139 | char devminor[8]; /* 337-344 */ | ||
140 | char prefix[155]; /* 345-499 */ | ||
141 | char padding[12]; /* 500-512 (pad to exactly TAR_BLOCK_SIZE) */ | ||
142 | } tar_header_t; | ||
143 | struct BUG_tar_header { | ||
144 | char c[sizeof(tar_header_t) == TAR_BLOCK_SIZE ? 1 : -1]; | ||
145 | }; | ||
146 | |||
147 | |||
148 | |||
116 | /* Info struct unpackers can fill out to inform users of thing like | 149 | /* Info struct unpackers can fill out to inform users of thing like |
117 | * timestamps of unpacked files */ | 150 | * timestamps of unpacked files */ |
118 | typedef struct unpack_info_t { | 151 | typedef struct unpack_info_t { |