From 1582ca88cb056d84a93cd40731d362083dad8cd4 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 28 Jun 2019 11:17:37 +0200 Subject: Add basic support for the GNU tar format Signed-off-by: David Oberhollenzer --- include/tar.h | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/tar.h b/include/tar.h index 3b7c8eb..4da04f5 100644 --- a/include/tar.h +++ b/include/tar.h @@ -29,8 +29,27 @@ typedef struct { char gname[32]; char devmajor[8]; char devminor[8]; - char prefix[155]; - char padding[12]; + union { + struct { + char prefix[155]; + char padding[12]; + } posix; + + struct { + char atime[12]; + char ctime[12]; + char offset[12]; + char deprecated[4]; + char unused; + struct { + char offset[12]; + char numbytes[12]; + } sparse[4]; + char isextended; + char realsize[12]; + char padding[17]; + } gnu; + } tail; } tar_header_t; typedef struct { @@ -48,6 +67,9 @@ typedef struct { #define TAR_TYPE_DIR '5' #define TAR_TYPE_FIFO '6' +#define TAR_TYPE_GNU_SLINK 'K' +#define TAR_TYPE_GNU_PATH 'L' + #define TAR_TYPE_PAX 'x' #define TAR_MAGIC "ustar" -- cgit v1.2.3