diff options
author | Wez Furlong <wez@php.net> | 2002-03-21 02:27:41 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-03-21 02:27:41 +0000 |
commit | c0e39dfa9c061de3db311698dda8aca7a8bef0ef (patch) | |
tree | 53018419d3346ce92b9f67f358c7f0ece29ac379 /ext/zlib/zlib_fopen_wrapper.c | |
parent | 8da009393583366bd1d2712c17a7e3a2da824a95 (diff) | |
download | php-git-c0e39dfa9c061de3db311698dda8aca7a8bef0ef.tar.gz |
Implement bz2 streams and bz2: wrapper.
You can now do this:
copy("zlib:src.gz", "bz2:dest.bz2");
As with zlib, most of the functions with counterparts
in file.c are now aliases to those functions.
Diffstat (limited to 'ext/zlib/zlib_fopen_wrapper.c')
-rw-r--r-- | ext/zlib/zlib_fopen_wrapper.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c index d2acfa0e27..a12abf1996 100644 --- a/ext/zlib/zlib_fopen_wrapper.c +++ b/ext/zlib/zlib_fopen_wrapper.c @@ -78,10 +78,16 @@ static int php_gziop_close(php_stream *stream, int close_handle TSRMLS_DC) return ret; } +static int php_gziop_flush(php_stream *stream TSRMLS_DC) +{ + struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *)stream->abstract; + return gzflush(self->gz_file, Z_SYNC_FLUSH); +} + php_stream_ops php_stream_gzio_ops = { php_gziop_write, php_gziop_read, - php_gziop_close, NULL, + php_gziop_close, php_gziop_flush, php_gziop_seek, php_gziop_gets, NULL, "ZLIB" }; @@ -122,6 +128,7 @@ php_stream *php_stream_gzopen(char *path, char *mode, int options, char **opened php_stream_wrapper php_stream_gzip_wrapper = { php_stream_gzopen, + NULL, NULL }; |