aboutsummaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-06-21 18:16:47 +0200
committerCharles <sircharlesaze@gmail.com>2020-06-21 18:16:47 +0200
commit3f37f1c9bf64866de90ec418adcfe31b634231c2 (patch)
tree79c12d6255f54ec1049b0b5863c8d6662345518e /inc
parent0fa3308034c7776b6c078e493f3b758f0a0bf7e6 (diff)
downloadtar-3f37f1c9bf64866de90ec418adcfe31b634231c2.tar.gz
tar-3f37f1c9bf64866de90ec418adcfe31b634231c2.tar.bz2
tar-3f37f1c9bf64866de90ec418adcfe31b634231c2.zip
Added archive_write, archive_read draft
Diffstat (limited to 'inc')
-rw-r--r--inc/tar.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/inc/tar.h b/inc/tar.h
index 1dc382f..dbeca6d 100644
--- a/inc/tar.h
+++ b/inc/tar.h
@@ -45,7 +45,7 @@ typedef struct
char user_id[8];
char group_id[8];
char file_size[12];
- char last_time[12];
+ char last_time[12]; // utime
char checksum[8];
char file_type[1];
char link_file_name[100];
@@ -58,13 +58,25 @@ typedef struct
char file_name_prefix[155];
} t_header;
-// header.c
-int record_write(int fd, char *s, size_t size);
-int header_write(int fd, char *file_name, struct stat *statbuf);
+typedef enum
+{
+ FLAG_CREATE = 1 << 0,
+ FLAG_VERBOSE = 1 << 0,
+ FLAG_LIST = 1 << 0,
+} t_flags;
+
+// utils.c
+int record_write(int fd, char *s, size_t size);
+int record_write_blank(int fd, size_t count);
+int header_write(int fd, char *file_name, struct stat *statbuf);
// fs.c
-int file_content_write(int fd, int file_fd, struct stat *statbuf);
-int file_write(int fd, char file_name[PATH_MAX]);
-int directory_write(int fd, char dir_name[PATH_MAX]);
+int file_content_write(int fd, int file_fd, struct stat *statbuf);
+int file_write(int fd, char file_name[PATH_MAX]);
+int directory_write(int fd, char dir_name[PATH_MAX]);
+
+// archive.c
+int archive_write(char *archive_file_name, char **files);
+int archive_read(char *archive_file_name);
#endif // TAR_H