diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-06-20 14:07:46 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-06-20 14:07:46 +0200 |
| commit | 95e1552a898078b4dec1eae3fcf975b392cfad6d (patch) | |
| tree | d19e2277a7e94c4004290eddc84529c7e3f66b8f /inc/tar.h | |
| parent | e1f3547e236671697c66e27ba02b6a151e59af04 (diff) | |
| download | tar-95e1552a898078b4dec1eae3fcf975b392cfad6d.tar.gz tar-95e1552a898078b4dec1eae3fcf975b392cfad6d.tar.bz2 tar-95e1552a898078b4dec1eae3fcf975b392cfad6d.zip | |
Writting header and files
Diffstat (limited to 'inc/tar.h')
| -rw-r--r-- | inc/tar.h | 30 |
1 files changed, 26 insertions, 4 deletions
@@ -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; |
