aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-29 02:26:11 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-29 02:26:57 +0200
commit8c449c503f4c37f72089a0dc50e00631a22ed12a (patch)
treee280aabfca0b5c12cafde614883aa05a17fa719e /include
parentd2f27dc653767f36885916d9ecd7b059673d26d8 (diff)
Add support for reading old style GNU sparse tar file format
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/tar.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/tar.h b/include/tar.h
index 4da04f5..6fdb22d 100644
--- a/include/tar.h
+++ b/include/tar.h
@@ -53,9 +53,25 @@ typedef struct {
} tar_header_t;
typedef struct {
+ struct {
+ char offset[12];
+ char numbytes[12];
+ } sparse[21];
+ char isextended;
+ char padding[7];
+} gnu_sparse_t;
+
+typedef struct tar_sparse_data_t {
+ struct tar_sparse_data_t *next;
+ uint64_t offset;
+ uint64_t count;
+} tar_sparse_data_t;
+
+typedef struct {
struct stat sb;
char *name;
char *link_target;
+ tar_sparse_data_t *sparse;
bool unknown_record;
} tar_header_decoded_t;
@@ -69,6 +85,7 @@ typedef struct {
#define TAR_TYPE_GNU_SLINK 'K'
#define TAR_TYPE_GNU_PATH 'L'
+#define TAR_TYPE_GNU_SPARSE 'S'
#define TAR_TYPE_PAX 'x'