From e9fc78157043a07adae6ed39939e269b6b3524d0 Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Thu, 25 Oct 2001 14:57:14 +0000 Subject: libunarchive, and recovery from my previous commit --- include/unarchive.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 include/unarchive.h (limited to 'include/unarchive.h') diff --git a/include/unarchive.h b/include/unarchive.h new file mode 100644 index 000000000..c4400981d --- /dev/null +++ b/include/unarchive.h @@ -0,0 +1,42 @@ +#include // for off_t + +enum extract_functions_e { + extract_verbose_list = 1, + extract_list = 2, + extract_one_to_buffer = 4, + extract_to_stdout = 8, + extract_all_to_fs = 16, + extract_preserve_date = 32, + extract_data_tar_gz = 64, + extract_control_tar_gz = 128, + extract_unzip_only = 256, + extract_unconditional = 512, + extract_create_leading_dirs = 1024, + extract_quiet = 2048, + extract_exclude_list = 4096 +}; + +typedef struct file_headers_s { + char *name; + char *link_name; + off_t size; + uid_t uid; + gid_t gid; + mode_t mode; + time_t mtime; + dev_t device; +} file_header_t; + +file_header_t *get_header_ar(FILE *in_file); +file_header_t *get_header_cpio(FILE *src_stream); +file_header_t *get_header_tar(FILE *tar_stream); + +void seek_sub_file(FILE *src_stream, const int count); + +extern off_t archive_offset; + +char *unarchive(FILE *src_stream, FILE *out_stream, file_header_t *(*get_headers)(FILE *), + const int extract_function, const char *prefix, char **include_name, char **exclude_name); + +char *deb_extract(const char *package_filename, FILE *out_stream, const int extract_function, + const char *prefix, const char *filename); -- cgit v1.2.3