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.
This commit is contained in:
Glenn L McGrath
2003-11-15 23:19:05 +00:00
parent 54ac057c00
commit 5699b8525e
16 changed files with 156 additions and 284 deletions

View File

@@ -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