Lines Matching refs:stream
70 php_stream *stream; in forget_persistent_resource_id_numbers() local
77 stream = (php_stream*)rsrc->ptr; in forget_persistent_resource_id_numbers()
80 fprintf(stderr, "forget_persistent: %s:%p\n", stream->ops->label, stream); in forget_persistent_resource_id_numbers()
83 stream->res = NULL; in forget_persistent_resource_id_numbers()
85 if (stream->ctx) { in forget_persistent_resource_id_numbers()
86 zend_list_delete(stream->ctx); in forget_persistent_resource_id_numbers()
87 stream->ctx = NULL; in forget_persistent_resource_id_numbers()
108 PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream **stream) in php_stream_from_persistent_id() argument
114 if (stream) { in php_stream_from_persistent_id()
120 *stream = (php_stream*)le->ptr; in php_stream_from_persistent_id()
124 (*stream)->res = regentry; in php_stream_from_persistent_id()
129 (*stream)->res = zend_register_resource(*stream, le_pstream); in php_stream_from_persistent_id()
277 ret->readfilters.stream = ret; in _php_stream_alloc()
278 ret->writefilters.stream = ret; in _php_stream_alloc()
361 PHPAPI int _php_stream_free(php_stream *stream, int close_options) /* {{{ */ in _php_stream_free() argument
372 context = PHP_STREAM_CONTEXT(stream); in _php_stream_free()
375 if (stream->flags & PHP_STREAM_FLAG_NO_CLOSE) { in _php_stream_free()
383 …stream->ops->label, stream, stream->orig_path, stream->in_free, _php_stream_pretty_free_options(cl… in _php_stream_free()
388 if (stream->in_free) { in _php_stream_free()
390 …if ((stream->in_free == 1) && (close_options & PHP_STREAM_FREE_IGNORE_ENCLOSING) && (stream->enclo… in _php_stream_free()
397 stream->in_free++; in _php_stream_free()
404 (stream->enclosing_stream != NULL)) { in _php_stream_free()
405 php_stream *enclosing_stream = stream->enclosing_stream; in _php_stream_free()
406 stream->enclosing_stream = NULL; in _php_stream_free()
420 if (stream->fclose_stdiocast == PHP_STREAM_FCLOSE_FOPENCOOKIE) { in _php_stream_free()
424 php_stream_auto_cleanup(stream); in _php_stream_free()
425 stream->in_free--; in _php_stream_free()
434 stream->ops->label, stream, stream->orig_path, preserve_handle, release_cast, in _php_stream_free()
438 if (stream->flags & PHP_STREAM_FLAG_WAS_WRITTEN) { in _php_stream_free()
440 _php_stream_flush(stream, 1); in _php_stream_free()
444 if ((close_options & PHP_STREAM_FREE_RSRC_DTOR) == 0 && stream->res) { in _php_stream_free()
446 zend_list_close(stream->res); in _php_stream_free()
449 zend_list_delete(stream->res); in _php_stream_free()
450 stream->res = NULL; in _php_stream_free()
455 if (release_cast && stream->fclose_stdiocast == PHP_STREAM_FCLOSE_FOPENCOOKIE) { in _php_stream_free()
463 stream->in_free = 0; in _php_stream_free()
464 return fclose(stream->stdiocast); in _php_stream_free()
467 ret = stream->ops->close(stream, preserve_handle ? 0 : 1); in _php_stream_free()
468 stream->abstract = NULL; in _php_stream_free()
471 if (release_cast && stream->fclose_stdiocast == PHP_STREAM_FCLOSE_FDOPEN && stream->stdiocast) { in _php_stream_free()
472 fclose(stream->stdiocast); in _php_stream_free()
473 stream->stdiocast = NULL; in _php_stream_free()
474 stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE; in _php_stream_free()
479 while (stream->readfilters.head) { in _php_stream_free()
480 php_stream_filter_remove(stream->readfilters.head, 1); in _php_stream_free()
482 while (stream->writefilters.head) { in _php_stream_free()
483 php_stream_filter_remove(stream->writefilters.head, 1); in _php_stream_free()
486 if (stream->wrapper && stream->wrapper->wops && stream->wrapper->wops->stream_closer) { in _php_stream_free()
487 stream->wrapper->wops->stream_closer(stream->wrapper, stream); in _php_stream_free()
488 stream->wrapper = NULL; in _php_stream_free()
491 if (Z_TYPE(stream->wrapperdata) != IS_UNDEF) { in _php_stream_free()
492 zval_ptr_dtor(&stream->wrapperdata); in _php_stream_free()
493 ZVAL_UNDEF(&stream->wrapperdata); in _php_stream_free()
496 if (stream->readbuf) { in _php_stream_free()
497 pefree(stream->readbuf, stream->is_persistent); in _php_stream_free()
498 stream->readbuf = NULL; in _php_stream_free()
501 if (stream->is_persistent && (close_options & PHP_STREAM_FREE_PERSISTENT)) { in _php_stream_free()
503 zend_hash_apply_with_argument(&EG(persistent_list), _php_stream_free_persistent, stream); in _php_stream_free()
506 …if ((close_options & PHP_STREAM_FREE_RSRC_DTOR) && (stream->__exposed == 0) && (EG(error_reporting… in _php_stream_free()
512 …eam of type '%s' %p (path:%s) was not closed\n", __LINE__, stream->ops->label, stream, stream->ori… in _php_stream_free()
514 if (stream->orig_path) { in _php_stream_free()
515 pefree(stream->orig_path, stream->is_persistent); in _php_stream_free()
516 stream->orig_path = NULL; in _php_stream_free()
527 if (stream->orig_path) { in _php_stream_free()
528 pefree(stream->orig_path, stream->is_persistent); in _php_stream_free()
529 stream->orig_path = NULL; in _php_stream_free()
532 pefree(stream, stream->is_persistent); in _php_stream_free()
535 if (stream->orig_path) { in _php_stream_free()
536 pefree(stream->orig_path, stream->is_persistent); in _php_stream_free()
537 stream->orig_path = NULL; in _php_stream_free()
540 pefree(stream, stream->is_persistent); in _php_stream_free()
554 PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size) in _php_stream_fill_read_buffer() argument
558 if (stream->readfilters.head) { in _php_stream_fill_read_buffer()
566 stream->writepos = stream->readpos = 0; in _php_stream_fill_read_buffer()
569 chunk_buf = emalloc(stream->chunk_size); in _php_stream_fill_read_buffer()
571 while (!stream->eof && !err_flag && (stream->writepos - stream->readpos < (zend_off_t)size)) { in _php_stream_fill_read_buffer()
579 justread = stream->ops->read(stream, chunk_buf, stream->chunk_size); in _php_stream_fill_read_buffer()
581 bucket = php_stream_bucket_new(stream, chunk_buf, justread, 0, 0); in _php_stream_fill_read_buffer()
588 flags = stream->eof ? PSFS_FLAG_FLUSH_CLOSE : PSFS_FLAG_FLUSH_INC; in _php_stream_fill_read_buffer()
592 for (filter = stream->readfilters.head; filter; filter = filter->next) { in _php_stream_fill_read_buffer()
593 status = filter->fops->filter(stream, filter, brig_inp, brig_outp, NULL, flags); in _php_stream_fill_read_buffer()
617 if (stream->readbuflen - stream->writepos < bucket->buflen) { in _php_stream_fill_read_buffer()
618 stream->readbuflen += bucket->buflen; in _php_stream_fill_read_buffer()
619 stream->readbuf = perealloc(stream->readbuf, stream->readbuflen, in _php_stream_fill_read_buffer()
620 stream->is_persistent); in _php_stream_fill_read_buffer()
622 memcpy(stream->readbuf + stream->writepos, bucket->buf, bucket->buflen); in _php_stream_fill_read_buffer()
623 stream->writepos += bucket->buflen; in _php_stream_fill_read_buffer()
657 if (stream->writepos - stream->readpos < (zend_off_t)size) { in _php_stream_fill_read_buffer()
661 if (stream->readbuf && stream->readbuflen - stream->writepos < stream->chunk_size) { in _php_stream_fill_read_buffer()
662 … memmove(stream->readbuf, stream->readbuf + stream->readpos, stream->readbuflen - stream->readpos); in _php_stream_fill_read_buffer()
663 stream->writepos -= stream->readpos; in _php_stream_fill_read_buffer()
664 stream->readpos = 0; in _php_stream_fill_read_buffer()
669 if (stream->readbuflen - stream->writepos < stream->chunk_size) { in _php_stream_fill_read_buffer()
670 stream->readbuflen += stream->chunk_size; in _php_stream_fill_read_buffer()
671 stream->readbuf = perealloc(stream->readbuf, stream->readbuflen, in _php_stream_fill_read_buffer()
672 stream->is_persistent); in _php_stream_fill_read_buffer()
675 justread = stream->ops->read(stream, (char*)stream->readbuf + stream->writepos, in _php_stream_fill_read_buffer()
676 stream->readbuflen - stream->writepos in _php_stream_fill_read_buffer()
680 stream->writepos += justread; in _php_stream_fill_read_buffer()
686 PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size) in _php_stream_read() argument
696 if (stream->writepos > stream->readpos) { in _php_stream_read()
698 toread = stream->writepos - stream->readpos; in _php_stream_read()
703 memcpy(buf, stream->readbuf + stream->readpos, toread); in _php_stream_read()
704 stream->readpos += toread; in _php_stream_read()
715 …if (!stream->readfilters.head && (stream->flags & PHP_STREAM_FLAG_NO_BUFFER || stream->chunk_size … in _php_stream_read()
716 toread = stream->ops->read(stream, buf, size); in _php_stream_read()
722 php_stream_fill_read_buffer(stream, size); in _php_stream_read()
724 toread = stream->writepos - stream->readpos; in _php_stream_read()
730 memcpy(buf, stream->readbuf + stream->readpos, toread); in _php_stream_read()
731 stream->readpos += toread; in _php_stream_read()
744 if (stream->wrapper != &php_plain_files_wrapper) { in _php_stream_read()
750 stream->position += didread; in _php_stream_read()
756 PHPAPI int _php_stream_eof(php_stream *stream) in _php_stream_eof() argument
759 if (stream->writepos - stream->readpos > 0) { in _php_stream_eof()
764 if (!stream->eof && PHP_STREAM_OPTION_RETURN_ERR == in _php_stream_eof()
765 php_stream_set_option(stream, PHP_STREAM_OPTION_CHECK_LIVENESS, in _php_stream_eof()
767 stream->eof = 1; in _php_stream_eof()
770 return stream->eof; in _php_stream_eof()
773 PHPAPI int _php_stream_putc(php_stream *stream, int c) in _php_stream_putc() argument
777 if (php_stream_write(stream, (char*)&buf, 1) > 0) { in _php_stream_putc()
783 PHPAPI int _php_stream_getc(php_stream *stream) in _php_stream_getc() argument
787 if (php_stream_read(stream, &buf, 1) > 0) { in _php_stream_getc()
793 PHPAPI int _php_stream_puts(php_stream *stream, const char *buf) in _php_stream_puts() argument
799 if (len > 0 && php_stream_write(stream, buf, len) && php_stream_write(stream, newline, 1)) { in _php_stream_puts()
805 PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb) in _php_stream_stat() argument
810 if (stream->wrapper && stream->wrapper->wops->stream_stat != NULL) { in _php_stream_stat()
811 return stream->wrapper->wops->stream_stat(stream->wrapper, stream, ssb); in _php_stream_stat()
818 if (stream->ops->stat == NULL) { in _php_stream_stat()
822 return (stream->ops->stat)(stream, ssb); in _php_stream_stat()
825 PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf) in php_stream_locate_eol() argument
832 readptr = (char*)stream->readbuf + stream->readpos; in php_stream_locate_eol()
833 avail = stream->writepos - stream->readpos; in php_stream_locate_eol()
840 if (stream->flags & PHP_STREAM_FLAG_DETECT_EOL) { in php_stream_locate_eol()
846 stream->flags ^= PHP_STREAM_FLAG_DETECT_EOL; in php_stream_locate_eol()
847 stream->flags |= PHP_STREAM_FLAG_EOL_MAC; in php_stream_locate_eol()
851 stream->flags ^= PHP_STREAM_FLAG_DETECT_EOL; in php_stream_locate_eol()
854 } else if (stream->flags & PHP_STREAM_FLAG_EOL_MAC) { in php_stream_locate_eol()
867 PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, in _php_stream_get_line() argument
896 avail = stream->writepos - stream->readpos; in _php_stream_get_line()
904 readptr = (char*)stream->readbuf + stream->readpos; in _php_stream_get_line()
905 eol = php_stream_locate_eol(stream, NULL); in _php_stream_get_line()
934 stream->position += cpysz; in _php_stream_get_line()
935 stream->readpos += cpysz; in _php_stream_get_line()
943 } else if (stream->eof) { in _php_stream_get_line()
950 toread = stream->chunk_size; in _php_stream_get_line()
953 if (toread > stream->chunk_size) { in _php_stream_get_line()
954 toread = stream->chunk_size; in _php_stream_get_line()
958 php_stream_fill_read_buffer(stream, toread); in _php_stream_get_line()
960 if (stream->writepos - stream->readpos == 0) { in _php_stream_get_line()
981 #define STREAM_BUFFERED_AMOUNT(stream) \ argument
982 ((size_t)(((stream)->writepos) - (stream)->readpos))
984 static const char *_php_stream_search_delim(php_stream *stream, in _php_stream_search_delim() argument
993 seek_len = MIN(STREAM_BUFFERED_AMOUNT(stream), maxlen); in _php_stream_search_delim()
999 return memchr(&stream->readbuf[stream->readpos + skiplen], in _php_stream_search_delim()
1002 return php_memnstr((char*)&stream->readbuf[stream->readpos + skiplen], in _php_stream_search_delim()
1004 (char*)&stream->readbuf[stream->readpos + seek_len]); in _php_stream_search_delim()
1008 PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, siz… in php_stream_get_record() argument
1022 stream, maxlen, 0, delim, delim_len); in php_stream_get_record()
1025 buffered_len = STREAM_BUFFERED_AMOUNT(stream); in php_stream_get_record()
1031 to_read_now = MIN(maxlen - buffered_len, stream->chunk_size); in php_stream_get_record()
1033 php_stream_fill_read_buffer(stream, buffered_len + to_read_now); in php_stream_get_record()
1035 just_read = STREAM_BUFFERED_AMOUNT(stream) - buffered_len; in php_stream_get_record()
1051 stream, maxlen, in php_stream_get_record()
1064 tent_ret_len = found_delim - (char*)&stream->readbuf[stream->readpos]; in php_stream_get_record()
1065 } else if (!has_delim && STREAM_BUFFERED_AMOUNT(stream) >= maxlen) { in php_stream_get_record()
1072 if (STREAM_BUFFERED_AMOUNT(stream) < maxlen && !stream->eof) { in php_stream_get_record()
1074 } else if (STREAM_BUFFERED_AMOUNT(stream) == 0 && stream->eof) { in php_stream_get_record()
1079 tent_ret_len = MIN(STREAM_BUFFERED_AMOUNT(stream), maxlen); in php_stream_get_record()
1086 ZSTR_LEN(ret_buf) = php_stream_read(stream, ZSTR_VAL(ret_buf), tent_ret_len); in php_stream_get_record()
1089 stream->readpos += delim_len; in php_stream_get_record()
1090 stream->position += delim_len; in php_stream_get_record()
1097 static size_t _php_stream_write_buffer(php_stream *stream, const char *buf, size_t count) in _php_stream_write_buffer() argument
1104 …if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0 && stream->readpos != stre… in _php_stream_write_buffer()
1105 stream->readpos = stream->writepos = 0; in _php_stream_write_buffer()
1107 stream->ops->seek(stream, stream->position, SEEK_SET, &stream->position); in _php_stream_write_buffer()
1113 if (towrite > stream->chunk_size) in _php_stream_write_buffer()
1114 towrite = stream->chunk_size; in _php_stream_write_buffer()
1116 justwrote = stream->ops->write(stream, buf, towrite); in _php_stream_write_buffer()
1126 if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { in _php_stream_write_buffer()
1127 stream->position += justwrote; in _php_stream_write_buffer()
1142 static size_t _php_stream_write_filtered(php_stream *stream, const char *buf, size_t count, int fla… in _php_stream_write_filtered() argument
1152 bucket = php_stream_bucket_new(stream, (char *)buf, count, 0, 0); in _php_stream_write_filtered()
1156 for (filter = stream->writefilters.head; filter; filter = filter->next) { in _php_stream_write_filtered()
1159 status = filter->fops->filter(stream, filter, brig_inp, brig_outp, in _php_stream_write_filtered()
1160 filter == stream->writefilters.head ? &consumed : NULL, flags); in _php_stream_write_filtered()
1180 _php_stream_write_buffer(stream, bucket->buf, bucket->buflen); in _php_stream_write_filtered()
1203 PHPAPI int _php_stream_flush(php_stream *stream, int closing) in _php_stream_flush() argument
1207 if (stream->writefilters.head) { in _php_stream_flush()
1208 …_php_stream_write_filtered(stream, NULL, 0, closing ? PSFS_FLAG_FLUSH_CLOSE : PSFS_FLAG_FLUSH_INC … in _php_stream_flush()
1211 stream->flags &= ~PHP_STREAM_FLAG_WAS_WRITTEN; in _php_stream_flush()
1213 if (stream->ops->flush) { in _php_stream_flush()
1214 ret = stream->ops->flush(stream); in _php_stream_flush()
1220 PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t count) in _php_stream_write() argument
1224 if (buf == NULL || count == 0 || stream->ops->write == NULL) { in _php_stream_write()
1228 if (stream->writefilters.head) { in _php_stream_write()
1229 bytes = _php_stream_write_filtered(stream, buf, count, PSFS_FLAG_NORMAL); in _php_stream_write()
1231 bytes = _php_stream_write_buffer(stream, buf, count); in _php_stream_write()
1235 stream->flags |= PHP_STREAM_FLAG_WAS_WRITTEN; in _php_stream_write()
1241 PHPAPI size_t _php_stream_printf(php_stream *stream, const char *fmt, ...) in _php_stream_printf() argument
1255 count = php_stream_write(stream, buf, count); in _php_stream_printf()
1261 PHPAPI zend_off_t _php_stream_tell(php_stream *stream) in _php_stream_tell() argument
1263 return stream->position; in _php_stream_tell()
1266 PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence) in _php_stream_seek() argument
1268 if (stream->fclose_stdiocast == PHP_STREAM_FCLOSE_FOPENCOOKIE) { in _php_stream_seek()
1270 fflush(stream->stdiocast); in _php_stream_seek()
1274 if ((stream->flags & PHP_STREAM_FLAG_NO_BUFFER) == 0) { in _php_stream_seek()
1277 if (offset > 0 && offset <= stream->writepos - stream->readpos) { in _php_stream_seek()
1278 stream->readpos += offset; /* if offset = ..., then readpos = writepos */ in _php_stream_seek()
1279 stream->position += offset; in _php_stream_seek()
1280 stream->eof = 0; in _php_stream_seek()
1285 if (offset > stream->position && in _php_stream_seek()
1286 offset <= stream->position + stream->writepos - stream->readpos) { in _php_stream_seek()
1287 stream->readpos += offset - stream->position; in _php_stream_seek()
1288 stream->position = offset; in _php_stream_seek()
1289 stream->eof = 0; in _php_stream_seek()
1297 if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { in _php_stream_seek()
1300 if (stream->writefilters.head) { in _php_stream_seek()
1301 _php_stream_flush(stream, 0); in _php_stream_seek()
1306 offset = stream->position + offset; in _php_stream_seek()
1310 ret = stream->ops->seek(stream, offset, whence, &stream->position); in _php_stream_seek()
1312 if (((stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) || ret == 0) { in _php_stream_seek()
1314 stream->eof = 0; in _php_stream_seek()
1318 stream->readpos = stream->writepos = 0; in _php_stream_seek()
1331 if ((didread = php_stream_read(stream, tmp, MIN(offset, sizeof(tmp)))) == 0) { in _php_stream_seek()
1336 stream->eof = 0; in _php_stream_seek()
1345 PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, void *ptrparam) in _php_stream_set_option() argument
1349 if (stream->ops->set_option) { in _php_stream_set_option()
1350 ret = stream->ops->set_option(stream, option, value, ptrparam); in _php_stream_set_option()
1357 ret = stream->chunk_size > INT_MAX ? INT_MAX : (int)stream->chunk_size; in _php_stream_set_option()
1358 stream->chunk_size = value; in _php_stream_set_option()
1364 stream->flags |= PHP_STREAM_FLAG_NO_BUFFER; in _php_stream_set_option()
1365 } else if (stream->flags & PHP_STREAM_FLAG_NO_BUFFER) { in _php_stream_set_option()
1366 stream->flags ^= PHP_STREAM_FLAG_NO_BUFFER; in _php_stream_set_option()
1379 PHPAPI int _php_stream_truncate_set_size(php_stream *stream, size_t newsize) in _php_stream_truncate_set_size() argument
1381 …return php_stream_set_option(stream, PHP_STREAM_OPTION_TRUNCATE_API, PHP_STREAM_TRUNCATE_SET_SIZE,… in _php_stream_truncate_set_size()
1384 PHPAPI size_t _php_stream_passthru(php_stream * stream STREAMS_DC) in _php_stream_passthru()
1390 if (php_stream_mmap_possible(stream)) { in _php_stream_passthru()
1394 …p = php_stream_mmap_range(stream, php_stream_tell(stream), PHP_STREAM_MMAP_ALL, PHP_STREAM_MAP_MOD… in _php_stream_passthru()
1404 php_stream_mmap_unmap_ex(stream, mapped); in _php_stream_passthru()
1410 while ((b = php_stream_read(stream, buf, sizeof(buf))) > 0) { in _php_stream_passthru()
1617 php_stream *stream = (php_stream*)rsrc->ptr; in stream_resource_regular_dtor() local
1619 FG(pclose_ret) = php_stream_free(stream, PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_RSRC_DTOR); in stream_resource_regular_dtor()
1624 php_stream *stream = (php_stream*)rsrc->ptr; in stream_resource_persistent_dtor() local
1625 FG(pclose_ret) = php_stream_free(stream, PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_RSRC_DTOR); in stream_resource_persistent_dtor()
1964 php_stream *stream = NULL; local
1977 stream = wrapper->wops->dir_opener(wrapper,
1981 if (stream) {
1982 stream->wrapper = wrapper;
1983 stream->flags |= PHP_STREAM_FLAG_NO_BUFFER | PHP_STREAM_FLAG_IS_DIR;
1988 if (stream == NULL && (options & REPORT_ERRORS)) {
1993 return stream;
2013 php_stream *stream = NULL; local
2055 stream = wrapper->wops->stream_opener(wrapper,
2062 if (stream && (options & STREAM_OPEN_PERSISTENT) && !stream->is_persistent) {
2065 php_stream_close(stream);
2066 stream = NULL;
2069 if (stream) {
2070 stream->wrapper = wrapper;
2074 if (stream) {
2079 if (stream->orig_path) {
2080 pefree(stream->orig_path, persistent);
2083 stream->orig_path = copy_of_path;
2085 stream->open_filename = __zend_orig_filename ? __zend_orig_filename : __zend_filename;
2086 stream->open_lineno = __zend_orig_lineno ? __zend_orig_lineno : __zend_lineno;
2090 if (stream != NULL && (options & STREAM_MUST_SEEK)) {
2093 switch(php_stream_make_seekable_rel(stream, &newstream,
2100 return stream;
2111 php_stream_close(stream);
2112 stream = NULL;
2125 …if (stream && stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0 && strchr(mode, …
2129 if (0 == stream->ops->seek(stream, 0, SEEK_CUR, &newpos)) {
2130 stream->position = newpos;
2134 if (stream == NULL && (options & REPORT_ERRORS)) {
2143 if (stream == NULL && copy_of_path != NULL) {
2150 return stream;
2155 PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context) argument
2157 php_stream_context *oldcontext = PHP_STREAM_CONTEXT(stream);
2160 stream->ctx = context->res;
2163 stream->ctx = NULL;
2271 php_stream *stream; local
2281 stream = php_stream_opendir(dirname, REPORT_ERRORS, context);
2282 if (!stream) {
2286 while (php_stream_readdir(stream, &sdp)) {
2293 php_stream_closedir(stream);
2307 php_stream_closedir(stream);
2312 php_stream_closedir(stream);