aboutsummaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-06-20 14:07:46 +0200
committerCharles <sircharlesaze@gmail.com>2020-06-20 14:07:46 +0200
commit95e1552a898078b4dec1eae3fcf975b392cfad6d (patch)
treed19e2277a7e94c4004290eddc84529c7e3f66b8f /inc
parente1f3547e236671697c66e27ba02b6a151e59af04 (diff)
downloadtar-95e1552a898078b4dec1eae3fcf975b392cfad6d.tar.gz
tar-95e1552a898078b4dec1eae3fcf975b392cfad6d.tar.bz2
tar-95e1552a898078b4dec1eae3fcf975b392cfad6d.zip
Writting header and files
Diffstat (limited to 'inc')
-rw-r--r--inc/tar.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/inc/tar.h b/inc/tar.h
index 29bea4b..8663926 100644
--- a/inc/tar.h
+++ b/inc/tar.h
@@ -1,12 +1,27 @@
#ifndef TAR_H
# define TAR_H
-# include <stdio.h>
-# include <stdlib.h>
-# include <stdbool.h>
+# include <sys/types.h>
+# include <sys/stat.h>
+
+# ifndef S_IFDIR
+# define S_IFDIR __S_IFDIR
+# endif
+# ifndef S_IFMT
+# define S_IFMT __S_IFMT
+# endif
+
# include <unistd.h>
+# include <stdbool.h>
# include <getopt.h>
# include <fcntl.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <strings.h>
+# include <string.h>
+
+
+// # define FILE_NAME_MAX 100
// https://en.wikipedia.org/wiki/Tar_(computing)?oldformat=true#Header
typedef struct
@@ -18,8 +33,15 @@ typedef struct
char file_size[12];
char last_time[12];
char checksum[8];
- char link_indicator[1];
+ char file_type[1];
char link_file_name[100];
+ char ustar[6];
+ char ustar_version[2];
+ char user_name[32];
+ char group_name[32];
+ char device_major_number[8];
+ char device_minor_number[8];
+ char file_name_prefix[155];
} t_header;