170626.1.1 · 2ec37825e589591e01d17a01673b4d2ac2da980c
Fix #896 - Stream decompress zipped files
Use the POSIX fopencookie(3) mechanism to produce a FILE object, and then treat them the same as other non-mmapable streams (i.e., FIFOs).
Since some supported platforms do not support fopencookie(3) (Mac OS X, maybe Cygwin, older BSDs), retain non-streaming zip file support.
reading declarations
Changes to src/decompress.h. All files
@@ -1,6 +1,8 @@ #ifndef DECOMPRESS_H #define DECOMPRESS_H +#include <stdio.h>+ #include "config.h" #include "log.h" #include "options.h"@@ -16,4 +18,9 @@ typedef enum { ag_compression_type is_zipped(const void *buf, const int buf_len); void *decompress(const ag_compression_type zip_type, const void *buf, const int buf_len, const char *dir_full_path, int *new_buf_len);++#if HAVE_FOPENCOOKIE+FILE *decompress_open(int fd, const char *mode, ag_compression_type ctype);+#endif+ #endif