Lines Matching refs:stream
133 php_stream *stream; member
138 static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count) in php_bz2iop_read() argument
140 struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; in php_bz2iop_read()
152 stream->eof = 1; in php_bz2iop_read()
165 static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count) in php_bz2iop_write() argument
168 struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; in php_bz2iop_write()
189 static int php_bz2iop_close(php_stream *stream, int close_handle) in php_bz2iop_close() argument
191 struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; in php_bz2iop_close()
198 if (self->stream) { in php_bz2iop_close()
199 …php_stream_free(self->stream, PHP_STREAM_FREE_CLOSE | (close_handle == 0 ? PHP_STREAM_FREE_PRESERV… in php_bz2iop_close()
207 static int php_bz2iop_flush(php_stream *stream) in php_bz2iop_flush() argument
209 struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; in php_bz2iop_flush()
232 self->stream = innerstream; in _php_stream_bz2open_from_BZFILE()
248 php_stream *retstream = NULL, *stream = NULL; in _php_stream_bz2open() local
285 stream = php_stream_open_wrapper(path, mode, options | STREAM_WILL_CAST, opened_path); in _php_stream_bz2open()
287 if (stream) { in _php_stream_bz2open()
289 if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) { in _php_stream_bz2open()
303 retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC); in _php_stream_bz2open()
311 if (stream) { in _php_stream_bz2open()
312 php_stream_close(stream); in _php_stream_bz2open()
372 php_stream *stream; in PHP_FUNCTION() local
379 php_stream_from_zval(stream, bz); in PHP_FUNCTION()
386 ZSTR_LEN(data) = php_stream_read(stream, ZSTR_VAL(data), ZSTR_LEN(data)); in PHP_FUNCTION()
402 php_stream *stream = NULL; in PHP_FUNCTION() local
424 stream = php_stream_bz2open(NULL, Z_STRVAL_P(file), mode, REPORT_ERRORS, NULL); in PHP_FUNCTION()
430 php_stream_from_zval(stream, file); in PHP_FUNCTION()
431 stream_mode_len = strlen(stream->mode); in PHP_FUNCTION()
433 if (stream_mode_len != 1 && !(stream_mode_len == 2 && memchr(stream->mode, 'b', 2))) { in PHP_FUNCTION()
434 php_error_docref(NULL, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode); in PHP_FUNCTION()
436 … else if (stream_mode_len == 1 && stream->mode[0] != 'r' && stream->mode[0] != 'w' && stream->mode… in PHP_FUNCTION()
437 php_error_docref(NULL, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode); in PHP_FUNCTION()
444 if (stream->mode[0] != mode[0] && !(stream_mode_len == 2 && stream->mode[1] != mode[0])) { in PHP_FUNCTION()
451 if (stream->mode[0] != mode[0] && !(stream_mode_len == 2 && stream->mode[1] != mode[0]) in PHP_FUNCTION()
452 && stream->mode[0] != 'a' && !(stream_mode_len == 2 && stream->mode[1] != 'a') in PHP_FUNCTION()
453 && stream->mode[0] != 'x' && !(stream_mode_len == 2 && stream->mode[1] != 'x')) { in PHP_FUNCTION()
463 if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_FD, (void *) &fd, REPORT_ERRORS)) { in PHP_FUNCTION()
469 stream = php_stream_bz2open_from_BZFILE(bz, mode, stream); in PHP_FUNCTION()
475 if (stream) { in PHP_FUNCTION()
476 php_stream_to_zval(stream, return_value); in PHP_FUNCTION()
638 php_stream *stream; in php_bz2_error() local
647 php_stream_from_zval(stream, bzp); in php_bz2_error()
649 if (!php_stream_is(stream, PHP_STREAM_IS_BZIP2)) { in php_bz2_error()
653 self = (struct php_bz2_stream_data_t *) stream->abstract; in php_bz2_error()