From 5699b8525e855a0e851725980964e8755e365f5b Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Sat, 15 Nov 2003 23:19:05 +0000 Subject: Move from read_gz to the pipe()+fork() method. open_transformer(), common code for pipe+fork. Function pointer for read() no longer needed. Allow inflate to be initialised with a specified buffer size to avoid over-reading. Reset static variables in inflate_get_next_window to fix a bug where only the first file in a .zip would be be extracted. --- include/unarchive.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/unarchive.h b/include/unarchive.h index 9f1331338..fa7233743 100644 --- a/include/unarchive.h +++ b/include/unarchive.h @@ -50,9 +50,6 @@ typedef struct archive_handle_s { /* Count the number of bytes processed */ off_t offset; - /* Function that reads data: read or read_bz */ - ssize_t (*read)(int fd, void *buf, size_t count); - /* Function that skips data: read_by_char or read_by_skip */ void (*seek)(const struct archive_handle_s *archive_handle, const unsigned int amount); @@ -83,7 +80,6 @@ extern void header_list(const file_header_t *file_header); extern void header_verbose_list(const file_header_t *file_header); extern void check_header_gzip(int src_fd); -extern void check_trailer_gzip(int src_fd); extern char get_header_ar(archive_handle_t *archive_handle); extern char get_header_cpio(archive_handle_t *archive_handle); @@ -103,14 +99,12 @@ extern void data_align(archive_handle_t *archive_handle, const unsigned short bo extern void archive_copy_file(const archive_handle_t *archive_handle, const int dst_fd); extern const llist_t *find_list_entry(const llist_t *list, const char *filename); -extern ssize_t read_bz2(int fd, void *buf, size_t count); -extern void BZ2_bzReadOpen(int fd, void *unused, int nUnused); -extern void BZ2_bzReadClose(void); -extern unsigned char uncompressStream(int src_fd, int dst_fd); +extern int uncompressStream(int src_fd, int dst_fd); +extern void inflate_init(unsigned int bufsize); +extern int inflate_unzip(int in, int out); +extern int inflate_gunzip(int in, int out); + +extern int open_transformer(int src_fd, int (*transformer)(int src_fd, int dst_fd)); -extern ssize_t read_gz(int fd, void *buf, size_t count); -extern void GZ_gzReadOpen(int fd, void *unused, int nUnused); -extern void GZ_gzReadClose(void); -extern int inflate(int in, int out); #endif -- cgit v1.2.3