diff options
author | Denys Vlasenko | 2010-06-26 18:21:36 +0200 |
---|---|---|
committer | Denys Vlasenko | 2010-06-26 18:21:36 +0200 |
commit | 52827e3ebcd80f634f990030ee697254a0ae517d (patch) | |
tree | 61cb4b3f65587301b1f2774a42c228d2f221d24e /include/unarchive.h | |
parent | d0a8a0d31243f2ac798531ced2cca45ddf1fea42 (diff) | |
download | busybox-52827e3ebcd80f634f990030ee697254a0ae517d.zip busybox-52827e3ebcd80f634f990030ee697254a0ae517d.tar.gz |
*: tar-related cleanups: move struct to unarchive.h; move help to tar.c
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
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 f3aa05d..b4cf160 100644 --- a/include/unarchive.h +++ b/include/unarchive.h @@ -113,6 +113,39 @@ typedef struct archive_handle_t { #define ARCHIVE_O_TRUNC (1 << 8) +/* POSIX tar Header Block, from POSIX 1003.1-1990 */ +#define TAR_BLOCK_SIZE 512 +#define NAME_SIZE 100 +#define NAME_SIZE_STR "100" +typedef struct tar_header_t { /* byte offset */ + char name[NAME_SIZE]; /* 0-99 */ + char mode[8]; /* 100-107 */ + char uid[8]; /* 108-115 */ + char gid[8]; /* 116-123 */ + char size[12]; /* 124-135 */ + char mtime[12]; /* 136-147 */ + char chksum[8]; /* 148-155 */ + char typeflag; /* 156-156 */ + char linkname[NAME_SIZE]; /* 157-256 */ + /* POSIX: "ustar" NUL "00" */ + /* GNU tar: "ustar " NUL */ + /* Normally it's defined as magic[6] followed by + * version[2], but we put them together to save code. + */ + char magic[8]; /* 257-264 */ + char uname[32]; /* 265-296 */ + char gname[32]; /* 297-328 */ + char devmajor[8]; /* 329-336 */ + char devminor[8]; /* 337-344 */ + char prefix[155]; /* 345-499 */ + char padding[12]; /* 500-512 (pad to exactly TAR_BLOCK_SIZE) */ +} tar_header_t; +struct BUG_tar_header { + char c[sizeof(tar_header_t) == TAR_BLOCK_SIZE ? 1 : -1]; +}; + + + /* Info struct unpackers can fill out to inform users of thing like * timestamps of unpacked files */ typedef struct unpack_info_t { |