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 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 { |
diff --git a/include/usage.src.h b/include/usage.src.h index f30edbc54..f84bb93c7 100644 --- a/include/usage.src.h +++ b/include/usage.src.h | |||
@@ -4273,54 +4273,6 @@ INSERT | |||
4273 | #define tac_full_usage "\n\n" \ | 4273 | #define tac_full_usage "\n\n" \ |
4274 | "Concatenate FILEs and print them in reverse" | 4274 | "Concatenate FILEs and print them in reverse" |
4275 | 4275 | ||
4276 | #define tar_trivial_usage \ | ||
4277 | "-[" IF_FEATURE_TAR_CREATE("c") "xt" IF_FEATURE_SEAMLESS_GZ("z") \ | ||
4278 | IF_FEATURE_SEAMLESS_BZ2("j") IF_FEATURE_SEAMLESS_LZMA("a") \ | ||
4279 | IF_FEATURE_SEAMLESS_Z("Z") IF_FEATURE_TAR_NOPRESERVE_TIME("m") "vO] " \ | ||
4280 | IF_FEATURE_TAR_FROM("[-X FILE] ") \ | ||
4281 | "[-f TARFILE] [-C DIR] [FILE]..." | ||
4282 | #define tar_full_usage "\n\n" \ | ||
4283 | IF_FEATURE_TAR_CREATE("Create, extract, ") \ | ||
4284 | IF_NOT_FEATURE_TAR_CREATE("Extract ") \ | ||
4285 | "or list files from a tar file\n" \ | ||
4286 | "\nOptions:" \ | ||
4287 | IF_FEATURE_TAR_CREATE( \ | ||
4288 | "\n c Create" \ | ||
4289 | ) \ | ||
4290 | "\n x Extract" \ | ||
4291 | "\n t List" \ | ||
4292 | "\nArchive format selection:" \ | ||
4293 | IF_FEATURE_SEAMLESS_GZ( \ | ||
4294 | "\n z Filter the archive through gzip" \ | ||
4295 | ) \ | ||
4296 | IF_FEATURE_SEAMLESS_BZ2( \ | ||
4297 | "\n j Filter the archive through bzip2" \ | ||
4298 | ) \ | ||
4299 | IF_FEATURE_SEAMLESS_LZMA( \ | ||
4300 | "\n a Filter the archive through lzma" \ | ||
4301 | ) \ | ||
4302 | IF_FEATURE_SEAMLESS_Z( \ | ||
4303 | "\n Z Filter the archive through compress" \ | ||
4304 | ) \ | ||
4305 | IF_FEATURE_TAR_NOPRESERVE_TIME( \ | ||
4306 | "\n m Do not restore mtime" \ | ||
4307 | ) \ | ||
4308 | "\nFile selection:" \ | ||
4309 | "\n f Name of TARFILE or \"-\" for stdin" \ | ||
4310 | "\n O Extract to stdout" \ | ||
4311 | IF_FEATURE_TAR_FROM( \ | ||
4312 | IF_FEATURE_TAR_LONG_OPTIONS( \ | ||
4313 | "\n exclude File to exclude" \ | ||
4314 | ) \ | ||
4315 | "\n X File with names to exclude" \ | ||
4316 | ) \ | ||
4317 | "\n C Change to DIR before operation" \ | ||
4318 | "\n v Verbose" \ | ||
4319 | |||
4320 | #define tar_example_usage \ | ||
4321 | "$ zcat /tmp/tarball.tar.gz | tar -xf -\n" \ | ||
4322 | "$ tar -cf /tmp/tarball.tar /usr/local\n" | ||
4323 | |||
4324 | #define taskset_trivial_usage \ | 4276 | #define taskset_trivial_usage \ |
4325 | "[-p] [MASK] [PID | PROG ARGS]" | 4277 | "[-p] [MASK] [PID | PROG ARGS]" |
4326 | #define taskset_full_usage "\n\n" \ | 4278 | #define taskset_full_usage "\n\n" \ |