diff options
Diffstat (limited to 'include/unarchive.h')
-rw-r--r-- | include/unarchive.h | 42 |
1 files changed, 42 insertions, 0 deletions
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 @@ | |||
1 | #include <stdio.h> // for off_t | ||
2 | |||
3 | enum extract_functions_e { | ||
4 | extract_verbose_list = 1, | ||
5 | extract_list = 2, | ||
6 | extract_one_to_buffer = 4, | ||
7 | extract_to_stdout = 8, | ||
8 | extract_all_to_fs = 16, | ||
9 | extract_preserve_date = 32, | ||
10 | extract_data_tar_gz = 64, | ||
11 | extract_control_tar_gz = 128, | ||
12 | extract_unzip_only = 256, | ||
13 | extract_unconditional = 512, | ||
14 | extract_create_leading_dirs = 1024, | ||
15 | extract_quiet = 2048, | ||
16 | extract_exclude_list = 4096 | ||
17 | }; | ||
18 | |||
19 | typedef struct file_headers_s { | ||
20 | char *name; | ||
21 | char *link_name; | ||
22 | off_t size; | ||
23 | uid_t uid; | ||
24 | gid_t gid; | ||
25 | mode_t mode; | ||
26 | time_t mtime; | ||
27 | dev_t device; | ||
28 | } file_header_t; | ||
29 | |||
30 | file_header_t *get_header_ar(FILE *in_file); | ||
31 | file_header_t *get_header_cpio(FILE *src_stream); | ||
32 | file_header_t *get_header_tar(FILE *tar_stream); | ||
33 | |||
34 | void seek_sub_file(FILE *src_stream, const int count); | ||
35 | |||
36 | extern off_t archive_offset; | ||
37 | |||
38 | char *unarchive(FILE *src_stream, FILE *out_stream, file_header_t *(*get_headers)(FILE *), | ||
39 | const int extract_function, const char *prefix, char **include_name, char **exclude_name); | ||
40 | |||
41 | char *deb_extract(const char *package_filename, FILE *out_stream, const int extract_function, | ||
42 | const char *prefix, const char *filename); | ||