diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/unarchive.h | 33 | ||||
-rw-r--r-- | include/usage.src.h | 48 |
2 files changed, 33 insertions, 48 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 { diff --git a/include/usage.src.h b/include/usage.src.h index f30edbc..f84bb93 100644 --- a/include/usage.src.h +++ b/include/usage.src.h @@ -4273,54 +4273,6 @@ INSERT #define tac_full_usage "\n\n" \ "Concatenate FILEs and print them in reverse" -#define tar_trivial_usage \ - "-[" IF_FEATURE_TAR_CREATE("c") "xt" IF_FEATURE_SEAMLESS_GZ("z") \ - IF_FEATURE_SEAMLESS_BZ2("j") IF_FEATURE_SEAMLESS_LZMA("a") \ - IF_FEATURE_SEAMLESS_Z("Z") IF_FEATURE_TAR_NOPRESERVE_TIME("m") "vO] " \ - IF_FEATURE_TAR_FROM("[-X FILE] ") \ - "[-f TARFILE] [-C DIR] [FILE]..." -#define tar_full_usage "\n\n" \ - IF_FEATURE_TAR_CREATE("Create, extract, ") \ - IF_NOT_FEATURE_TAR_CREATE("Extract ") \ - "or list files from a tar file\n" \ - "\nOptions:" \ - IF_FEATURE_TAR_CREATE( \ - "\n c Create" \ - ) \ - "\n x Extract" \ - "\n t List" \ - "\nArchive format selection:" \ - IF_FEATURE_SEAMLESS_GZ( \ - "\n z Filter the archive through gzip" \ - ) \ - IF_FEATURE_SEAMLESS_BZ2( \ - "\n j Filter the archive through bzip2" \ - ) \ - IF_FEATURE_SEAMLESS_LZMA( \ - "\n a Filter the archive through lzma" \ - ) \ - IF_FEATURE_SEAMLESS_Z( \ - "\n Z Filter the archive through compress" \ - ) \ - IF_FEATURE_TAR_NOPRESERVE_TIME( \ - "\n m Do not restore mtime" \ - ) \ - "\nFile selection:" \ - "\n f Name of TARFILE or \"-\" for stdin" \ - "\n O Extract to stdout" \ - IF_FEATURE_TAR_FROM( \ - IF_FEATURE_TAR_LONG_OPTIONS( \ - "\n exclude File to exclude" \ - ) \ - "\n X File with names to exclude" \ - ) \ - "\n C Change to DIR before operation" \ - "\n v Verbose" \ - -#define tar_example_usage \ - "$ zcat /tmp/tarball.tar.gz | tar -xf -\n" \ - "$ tar -cf /tmp/tarball.tar /usr/local\n" - #define taskset_trivial_usage \ "[-p] [MASK] [PID | PROG ARGS]" #define taskset_full_usage "\n\n" \ |