diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-06-21 18:16:47 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-06-21 18:16:47 +0200 |
| commit | 3f37f1c9bf64866de90ec418adcfe31b634231c2 (patch) | |
| tree | 79c12d6255f54ec1049b0b5863c8d6662345518e /inc/tar.h | |
| parent | 0fa3308034c7776b6c078e493f3b758f0a0bf7e6 (diff) | |
| download | tar-3f37f1c9bf64866de90ec418adcfe31b634231c2.tar.gz tar-3f37f1c9bf64866de90ec418adcfe31b634231c2.tar.bz2 tar-3f37f1c9bf64866de90ec418adcfe31b634231c2.zip | |
Added archive_write, archive_read draft
Diffstat (limited to 'inc/tar.h')
| -rw-r--r-- | inc/tar.h | 26 |
1 files changed, 19 insertions, 7 deletions
@@ -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 |
