Lines Matching refs:stream
88 php_stream *stream = (php_stream*)cookie; in stream_cookie_closer() local
92 stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE; in stream_cookie_closer()
93 return php_stream_close(stream); in stream_cookie_closer()
135 php_stream *stream = (php_stream*)cookie; in stream_cookie_closer() local
139 stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE; in stream_cookie_closer()
140 return php_stream_close(stream); in stream_cookie_closer()
157 void php_stream_mode_sanitize_fdopen_fopencookie(php_stream *stream, char *result) in php_stream_mode_sanitize_fdopen_fopencookie() argument
161 const char *cur_mode = stream->mode; in php_stream_mode_sanitize_fdopen_fopencookie()
200 PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err TSRMLS_DC) in _php_stream_cast() argument
207 php_stream_flush(stream); in _php_stream_cast()
208 if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { in _php_stream_cast()
211 stream->ops->seek(stream, stream->position, SEEK_SET, &dummy TSRMLS_CC); in _php_stream_cast()
212 stream->readpos = stream->writepos = 0; in _php_stream_cast()
219 if (stream->stdiocast) { in _php_stream_cast()
221 *(FILE**)ret = stream->stdiocast; in _php_stream_cast()
228 if (php_stream_is(stream, PHP_STREAM_IS_STDIO) && in _php_stream_cast()
229 stream->ops->cast && in _php_stream_cast()
230 !php_stream_is_filtered(stream) && in _php_stream_cast()
231 stream->ops->cast(stream, castas, ret TSRMLS_CC) == SUCCESS in _php_stream_cast()
244 php_stream_mode_sanitize_fdopen_fopencookie(stream, fixed_mode); in _php_stream_cast()
245 *(FILE**)ret = fopencookie(stream, fixed_mode, PHP_STREAM_COOKIE_FUNCTIONS); in _php_stream_cast()
251 stream->fclose_stdiocast = PHP_STREAM_FCLOSE_FOPENCOOKIE; in _php_stream_cast()
255 pos = php_stream_tell(stream); in _php_stream_cast()
272 …if (!php_stream_is_filtered(stream) && stream->ops->cast && stream->ops->cast(stream, castas, NULL… in _php_stream_cast()
273 if (FAILURE == stream->ops->cast(stream, castas, ret TSRMLS_CC)) { in _php_stream_cast()
282 int retcopy = php_stream_copy_to_stream_ex(stream, newstream, PHP_STREAM_COPY_ALL, NULL); in _php_stream_cast()
295 php_stream_free(stream, PHP_STREAM_FREE_CLOSE_CASTED); in _php_stream_cast()
306 if (php_stream_is_filtered(stream)) { in _php_stream_cast()
309 } else if (stream->ops->cast && stream->ops->cast(stream, castas, ret TSRMLS_CC) == SUCCESS) { in _php_stream_cast()
322 …LL TSRMLS_CC, E_WARNING, "cannot represent a stream of type %s as a %s", stream->ops->label, cast_… in _php_stream_cast()
329 if ((stream->writepos - stream->readpos) > 0 && in _php_stream_cast()
330 stream->fclose_stdiocast != PHP_STREAM_FCLOSE_FOPENCOOKIE && in _php_stream_cast()
337 … bytes of buffered data lost during stream conversion!", (long)(stream->writepos - stream->readpos… in _php_stream_cast()
341 stream->stdiocast = *(FILE**)ret; in _php_stream_cast()
345 php_stream_free(stream, PHP_STREAM_FREE_CLOSE_CASTED); in _php_stream_cast()
357 php_stream *stream = NULL; in _php_stream_open_wrapper_as_file() local
359 stream = php_stream_open_wrapper_rel(path, mode, options|STREAM_WILL_CAST, opened_path); in _php_stream_open_wrapper_as_file()
361 if (stream == NULL) { in _php_stream_open_wrapper_as_file()
365 …if (php_stream_cast(stream, PHP_STREAM_AS_STDIO|PHP_STREAM_CAST_TRY_HARD|PHP_STREAM_CAST_RELEASE, … in _php_stream_open_wrapper_as_file()
366 php_stream_close(stream); in _php_stream_open_wrapper_as_file()