summaryrefslogtreecommitdiff
path: root/include/unarchive.h
diff options
context:
space:
mode:
authorGlenn L McGrath2001-10-25 14:57:14 +0000
committerGlenn L McGrath2001-10-25 14:57:14 +0000
commite9fc78157043a07adae6ed39939e269b6b3524d0 (patch)
tree9507853496d8e563687a06a99a37f4bab704e2f3 /include/unarchive.h
parent633f153808c3ec316f023cdb72b98c4e5a929bca (diff)
downloadbusybox-e9fc78157043a07adae6ed39939e269b6b3524d0.zip
busybox-e9fc78157043a07adae6ed39939e269b6b3524d0.tar.gz
libunarchive, and recovery from my previous commit
Diffstat (limited to 'include/unarchive.h')
-rw-r--r--include/unarchive.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/unarchive.h b/include/unarchive.h
new file mode 100644
index 0000000..c440098
--- /dev/null
+++ b/include/unarchive.h
@@ -0,0 +1,42 @@
+#include <stdio.h> // 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);