Lines Matching refs:stream
83 php_stream *stream = (php_stream*)cookie; in stream_cookie_closer() local
86 stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE; in stream_cookie_closer()
87 return php_stream_free(stream, in stream_cookie_closer()
126 php_stream *stream = (php_stream*)cookie; in stream_cookie_closer() local
129 stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE; in stream_cookie_closer()
130 return php_stream_free(stream, in stream_cookie_closer()
148 void php_stream_mode_sanitize_fdopen_fopencookie(php_stream *stream, char *result) in php_stream_mode_sanitize_fdopen_fopencookie() argument
152 const char *cur_mode = stream->mode; in php_stream_mode_sanitize_fdopen_fopencookie()
191 PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err) in _php_stream_cast() argument
198 php_stream_flush(stream); in _php_stream_cast()
199 if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { in _php_stream_cast()
202 stream->ops->seek(stream, stream->position, SEEK_SET, &dummy); in _php_stream_cast()
203 stream->readpos = stream->writepos = 0; in _php_stream_cast()
210 if (stream->stdiocast) { in _php_stream_cast()
212 *(FILE**)ret = stream->stdiocast; in _php_stream_cast()
219 if (php_stream_is(stream, PHP_STREAM_IS_STDIO) && in _php_stream_cast()
220 stream->ops->cast && in _php_stream_cast()
221 !php_stream_is_filtered(stream) && in _php_stream_cast()
222 stream->ops->cast(stream, castas, ret) == SUCCESS in _php_stream_cast()
235 php_stream_mode_sanitize_fdopen_fopencookie(stream, fixed_mode); in _php_stream_cast()
236 *(FILE**)ret = fopencookie(stream, fixed_mode, PHP_STREAM_COOKIE_FUNCTIONS); in _php_stream_cast()
242 stream->fclose_stdiocast = PHP_STREAM_FCLOSE_FOPENCOOKIE; in _php_stream_cast()
246 pos = php_stream_tell(stream); in _php_stream_cast()
263 …if (!php_stream_is_filtered(stream) && stream->ops->cast && stream->ops->cast(stream, castas, NULL… in _php_stream_cast()
264 if (FAILURE == stream->ops->cast(stream, castas, ret)) { in _php_stream_cast()
273 int retcopy = php_stream_copy_to_stream_ex(stream, newstream, PHP_STREAM_COPY_ALL, NULL); in _php_stream_cast()
286 php_stream_free(stream, PHP_STREAM_FREE_CLOSE_CASTED); in _php_stream_cast()
297 if (php_stream_is_filtered(stream)) { in _php_stream_cast()
302 } else if (stream->ops->cast && stream->ops->cast(stream, castas, ret) == SUCCESS) { in _php_stream_cast()
315 …php_error_docref(NULL, E_WARNING, "cannot represent a stream of type %s as a %s", stream->ops->lab… in _php_stream_cast()
322 if ((stream->writepos - stream->readpos) > 0 && in _php_stream_cast()
323 stream->fclose_stdiocast != PHP_STREAM_FCLOSE_FOPENCOOKIE && in _php_stream_cast()
330 …s of buffered data lost during stream conversion!", (zend_long)(stream->writepos - stream->readpos… in _php_stream_cast()
334 stream->stdiocast = *(FILE**)ret; in _php_stream_cast()
338 php_stream_free(stream, PHP_STREAM_FREE_CLOSE_CASTED); in _php_stream_cast()
350 php_stream *stream = NULL; in _php_stream_open_wrapper_as_file() local
352 stream = php_stream_open_wrapper_rel(path, mode, options|STREAM_WILL_CAST, opened_path); in _php_stream_open_wrapper_as_file()
354 if (stream == NULL) { in _php_stream_open_wrapper_as_file()
358 …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()
359 php_stream_close(stream); in _php_stream_open_wrapper_as_file()