Lines Matching refs:stream
63 php_stream *stream; member
68 static ssize_t php_bz2iop_read(php_stream *stream, char *buf, size_t count) in php_bz2iop_read() argument
70 struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; in php_bz2iop_read()
82 stream->eof = 1; in php_bz2iop_read()
98 static ssize_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count) in php_bz2iop_write() argument
101 struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; in php_bz2iop_write()
126 static int php_bz2iop_close(php_stream *stream, int close_handle) in php_bz2iop_close() argument
128 struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; in php_bz2iop_close()
135 if (self->stream) { in php_bz2iop_close()
136 …php_stream_free(self->stream, PHP_STREAM_FREE_CLOSE | (close_handle == 0 ? PHP_STREAM_FREE_PRESERV… in php_bz2iop_close()
144 static int php_bz2iop_flush(php_stream *stream) in php_bz2iop_flush() argument
146 struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; in php_bz2iop_flush()
169 self->stream = innerstream; in _php_stream_bz2open_from_BZFILE()
185 php_stream *retstream = NULL, *stream = NULL; in _php_stream_bz2open() local
222 stream = php_stream_open_wrapper(path, mode, options | STREAM_WILL_CAST, opened_path); in _php_stream_bz2open()
224 if (stream) { in _php_stream_bz2open()
226 if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) { in _php_stream_bz2open()
240 retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC); in _php_stream_bz2open()
248 if (stream) { in _php_stream_bz2open()
249 php_stream_close(stream); in _php_stream_bz2open()
309 php_stream *stream; in PHP_FUNCTION() local
316 php_stream_from_zval(stream, bz); in PHP_FUNCTION()
323 data = php_stream_read_to_str(stream, len); in PHP_FUNCTION()
339 php_stream *stream = NULL; in PHP_FUNCTION() local
362 stream = php_stream_bz2open(NULL, Z_STRVAL_P(file), mode, REPORT_ERRORS, NULL); in PHP_FUNCTION()
368 php_stream_from_zval(stream, file); in PHP_FUNCTION()
369 stream_mode_len = strlen(stream->mode); in PHP_FUNCTION()
371 if (stream_mode_len != 1 && !(stream_mode_len == 2 && memchr(stream->mode, 'b', 2))) { in PHP_FUNCTION()
372 php_error_docref(NULL, E_WARNING, "Cannot use stream opened in mode '%s'", stream->mode); in PHP_FUNCTION()
374 … else if (stream_mode_len == 1 && stream->mode[0] != 'r' && stream->mode[0] != 'w' && stream->mode… in PHP_FUNCTION()
375 php_error_docref(NULL, E_WARNING, "Cannot use stream opened in mode '%s'", stream->mode); in PHP_FUNCTION()
382 if (stream->mode[0] != mode[0] && !(stream_mode_len == 2 && stream->mode[1] != mode[0])) { in PHP_FUNCTION()
389 if (stream->mode[0] != mode[0] && !(stream_mode_len == 2 && stream->mode[1] != mode[0]) in PHP_FUNCTION()
390 && stream->mode[0] != 'a' && !(stream_mode_len == 2 && stream->mode[1] != 'a') in PHP_FUNCTION()
391 && stream->mode[0] != 'x' && !(stream_mode_len == 2 && stream->mode[1] != 'x')) { in PHP_FUNCTION()
401 if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_FD, (void *) &fd, REPORT_ERRORS)) { in PHP_FUNCTION()
407 stream = php_stream_bz2open_from_BZFILE(bz, mode, stream); in PHP_FUNCTION()
413 if (stream) { in PHP_FUNCTION()
414 php_stream_to_zval(stream, return_value); in PHP_FUNCTION()
569 php_stream *stream; in php_bz2_error() local
578 php_stream_from_zval(stream, bzp); in php_bz2_error()
580 if (!php_stream_is(stream, PHP_STREAM_IS_BZIP2)) { in php_bz2_error()
585 self = (struct php_bz2_stream_data_t *) stream->abstract; in php_bz2_error()