summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-27 14:21:54 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-27 16:54:21 +0200
commit154532d71c447e73c70ec06d26628bb6919b9a5a (patch)
treea9f0bbd95d1f1e4bec4406f2c8e742bd320ac04a /include
parente87a6a28cffac4044f365b90af9f11a8acb5f83c (diff)
Relax tar header parser to accept pre-posix formats
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/tar.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/tar.h b/include/tar.h
index a39d7c9..3b7c8eb 100644
--- a/include/tar.h
+++ b/include/tar.h
@@ -6,6 +6,13 @@
#include <stdbool.h>
#include <stdint.h>
+typedef enum {
+ ETV_UNKNOWN = 0,
+ ETV_V7_UNIX,
+ ETV_PRE_POSIX,
+ ETV_POSIX,
+} E_TAR_VERSION;
+
typedef struct {
char name[100];
char mode[8];
@@ -46,6 +53,9 @@ typedef struct {
#define TAR_MAGIC "ustar"
#define TAR_VERSION "00"
+#define TAR_MAGIC_OLD "ustar "
+#define TAR_VERSION_OLD " "
+
/*
Returns < 0 on failure, > 0 if cannot encode, 0 on success.
Prints error/warning messages to stderr.