diff options
author | Sara Golemon <pollita@php.net> | 2006-03-13 04:40:11 +0000 |
---|---|---|
committer | Sara Golemon <pollita@php.net> | 2006-03-13 04:40:11 +0000 |
commit | 48798021b5cfb75c7336326c0583a61e9aace350 (patch) | |
tree | 104ee8d15635677646ac53a984d1947eebd52aa4 /ext/bz2 | |
parent | fe2842d21b529d3e5e26000ae3889267c28bdb00 (diff) | |
download | php-git-48798021b5cfb75c7336326c0583a61e9aace350.tar.gz |
Refactor streams layer for PHP6.
Don't be frightened by the size of this commit.
A significant portion of it is restoring the read buffer semantics back
to what PHP4/5 use. (Or a close aproximation thereof).
See main/streams/streams.c and ext/standard/file.c for a set of
UTODO comments covering work yet to be done.
Diffstat (limited to 'ext/bz2')
-rw-r--r-- | ext/bz2/bz2_filter.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c index 70b4bc2fd3..37daa9ff8a 100644 --- a/ext/bz2/bz2_filter.c +++ b/ext/bz2/bz2_filter.c @@ -82,18 +82,18 @@ static php_stream_filter_status_t php_bz2_decompress_filter( bucket = buckets_in->head; - if (bucket->is_unicode) { + if (bucket->buf_type == IS_UNICODE) { /* decompression not allowed for unicode data */ return PSFS_ERR_FATAL; } bucket = php_stream_bucket_make_writeable(bucket TSRMLS_CC); - while (bin < bucket->buf.str.len) { - desired = bucket->buf.str.len - bin; + while (bin < bucket->buflen) { + desired = bucket->buflen - bin; if (desired > data->inbuf_len) { desired = data->inbuf_len; } - memcpy(data->strm.next_in, bucket->buf.str.val + bin, desired); + memcpy(data->strm.next_in, bucket->buf.s + bin, desired); data->strm.avail_in = desired; status = BZ2_bzDecompress(&(data->strm)); @@ -195,19 +195,19 @@ static php_stream_filter_status_t php_bz2_compress_filter( bucket = buckets_in->head; - if (bucket->is_unicode) { + if (bucket->buf_type == IS_UNICODE) { /* compression not allowed for unicode data */ return PSFS_ERR_FATAL; } bucket = php_stream_bucket_make_writeable(bucket TSRMLS_CC); - while (bin < bucket->buf.str.len) { - desired = bucket->buf.str.len - bin; + while (bin < bucket->buflen) { + desired = bucket->buflen - bin; if (desired > data->inbuf_len) { desired = data->inbuf_len; } - memcpy(data->strm.next_in, bucket->buf.str.val + bin, desired); + memcpy(data->strm.next_in, bucket->buf.s + bin, desired); data->strm.avail_in = desired; status = BZ2_bzCompress(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? BZ_FINISH : (flags & PSFS_FLAG_FLUSH_INC ? BZ_FLUSH : BZ_RUN)); |