diff options
Diffstat (limited to 'include/unarchive.h')
-rw-r--r-- | include/unarchive.h | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/include/unarchive.h b/include/unarchive.h index 7926dccf5..b13388b54 100644 --- a/include/unarchive.h +++ b/include/unarchive.h | |||
@@ -7,14 +7,8 @@ | |||
7 | #define ARCHIVE_EXTRACT_QUIET 8 | 7 | #define ARCHIVE_EXTRACT_QUIET 8 |
8 | 8 | ||
9 | #include <sys/types.h> | 9 | #include <sys/types.h> |
10 | #include <stdio.h> | ||
11 | 10 | ||
12 | typedef struct gunzip_s { | 11 | #include <stdio.h> |
13 | unsigned short buffer_count; | ||
14 | unsigned char *buffer; | ||
15 | unsigned int crc; | ||
16 | unsigned int count; | ||
17 | } gunzip_t; | ||
18 | 12 | ||
19 | typedef struct file_headers_s { | 13 | typedef struct file_headers_s { |
20 | char *name; | 14 | char *name; |
@@ -58,6 +52,12 @@ typedef struct archive_handle_s { | |||
58 | /* Count the number of bytes processed */ | 52 | /* Count the number of bytes processed */ |
59 | off_t offset; | 53 | off_t offset; |
60 | 54 | ||
55 | /* Function that reads data: read or read_bz */ | ||
56 | ssize_t (*read)(int fd, void *buf, size_t count); | ||
57 | |||
58 | /* Function that skips data: read_by_char or read_by_skip */ | ||
59 | void (*seek)(const struct archive_handle_s *archive_handle, const unsigned int amount); | ||
60 | |||
61 | /* Temperary storage */ | 61 | /* Temperary storage */ |
62 | char *buffer; | 62 | char *buffer; |
63 | 63 | ||
@@ -90,11 +90,21 @@ extern char get_header_ar(archive_handle_t *archive_handle); | |||
90 | extern char get_header_tar(archive_handle_t *archive_handle); | 90 | extern char get_header_tar(archive_handle_t *archive_handle); |
91 | extern char get_header_tar_gz(archive_handle_t *archive_handle); | 91 | extern char get_header_tar_gz(archive_handle_t *archive_handle); |
92 | 92 | ||
93 | extern unsigned char uncompressStream(FILE *zStream, FILE *stream); | 93 | extern void seek_by_jump(const archive_handle_t *archive_handle, const unsigned int amount); |
94 | extern void seek_by_char(const archive_handle_t *archive_handle, const unsigned int amount); | ||
94 | 95 | ||
95 | extern void seek_sub_file(int src_fd, unsigned int amount); | 96 | extern unsigned char archive_xread_char(const archive_handle_t *archive_handle); |
96 | extern const unsigned short data_align(const int src_fd, const unsigned int offset, const unsigned short align_to); | 97 | extern ssize_t archive_xread(const archive_handle_t *archive_handle, unsigned char *buf, const size_t count); |
98 | extern void archive_xread_all(const archive_handle_t *archive_handle, void *buf, const size_t count); | ||
99 | extern ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, unsigned char *buf, size_t count); | ||
100 | |||
101 | extern void data_align(archive_handle_t *archive_handle, const unsigned short boundary); | ||
97 | extern const llist_t *add_to_list(const llist_t *old_head, const char *new_item); | 102 | extern const llist_t *add_to_list(const llist_t *old_head, const char *new_item); |
98 | extern int copy_file_chunk_fd(int src_fd, int dst_fd, unsigned long long chunksize); | 103 | extern void archive_copy_file(const archive_handle_t *archive_handle, const int dst_fd); |
99 | extern const llist_t *find_list_entry(const llist_t *list, const char *filename); | 104 | extern const llist_t *find_list_entry(const llist_t *list, const char *filename); |
105 | |||
106 | extern ssize_t read_bz2(int fd, void *buf, size_t count); | ||
107 | extern void BZ2_bzReadOpen(int fd, void *unused, int nUnused); | ||
108 | extern unsigned char uncompressStream(int src_fd, int dst_fd); | ||
109 | |||
100 | #endif | 110 | #endif |