Lines Matching refs:ts
371 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_write() local
372 assert(ts != NULL); in php_stream_temp_write()
374 if (!ts->innerstream) { in php_stream_temp_write()
377 if (php_stream_is(ts->innerstream, PHP_STREAM_IS_MEMORY)) { in php_stream_temp_write()
378 zend_off_t pos = php_stream_tell(ts->innerstream); in php_stream_temp_write()
380 if (pos + count >= ts->smax) { in php_stream_temp_write()
382 char *membuf = php_stream_memory_get_buffer(ts->innerstream, &memsize); in php_stream_temp_write()
383 php_stream *file = php_stream_fopen_temporary_file(ts->tmpdir, "php", NULL); in php_stream_temp_write()
389 php_stream_free_enclosed(ts->innerstream, PHP_STREAM_FREE_CLOSE); in php_stream_temp_write()
390 ts->innerstream = file; in php_stream_temp_write()
391 php_stream_encloses(stream, ts->innerstream); in php_stream_temp_write()
392 php_stream_seek(ts->innerstream, pos, SEEK_SET); in php_stream_temp_write()
395 return php_stream_write(ts->innerstream, buf, count); in php_stream_temp_write()
403 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_read() local
406 assert(ts != NULL); in php_stream_temp_read()
408 if (!ts->innerstream) { in php_stream_temp_read()
412 got = php_stream_read(ts->innerstream, buf, count); in php_stream_temp_read()
414 stream->eof = ts->innerstream->eof; in php_stream_temp_read()
424 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_close() local
427 assert(ts != NULL); in php_stream_temp_close()
429 if (ts->innerstream) { in php_stream_temp_close()
430 …ret = php_stream_free_enclosed(ts->innerstream, PHP_STREAM_FREE_CLOSE | (close_handle ? 0 : PHP_ST… in php_stream_temp_close()
435 zval_ptr_dtor(&ts->meta); in php_stream_temp_close()
437 if (ts->tmpdir) { in php_stream_temp_close()
438 efree(ts->tmpdir); in php_stream_temp_close()
441 efree(ts); in php_stream_temp_close()
451 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_flush() local
452 assert(ts != NULL); in php_stream_temp_flush()
454 return ts->innerstream ? php_stream_flush(ts->innerstream) : -1; in php_stream_temp_flush()
462 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_seek() local
465 assert(ts != NULL); in php_stream_temp_seek()
467 if (!ts->innerstream) { in php_stream_temp_seek()
471 ret = php_stream_seek(ts->innerstream, offset, whence); in php_stream_temp_seek()
472 *newoffs = php_stream_tell(ts->innerstream); in php_stream_temp_seek()
473 stream->eof = ts->innerstream->eof; in php_stream_temp_seek()
482 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_cast() local
488 assert(ts != NULL); in php_stream_temp_cast()
490 if (!ts->innerstream) { in php_stream_temp_cast()
493 if (php_stream_is(ts->innerstream, PHP_STREAM_IS_STDIO)) { in php_stream_temp_cast()
494 return php_stream_cast(ts->innerstream, castas, ret, 0); in php_stream_temp_cast()
518 membuf = php_stream_memory_get_buffer(ts->innerstream, &memsize); in php_stream_temp_cast()
520 pos = php_stream_tell(ts->innerstream); in php_stream_temp_cast()
522 php_stream_free_enclosed(ts->innerstream, PHP_STREAM_FREE_CLOSE); in php_stream_temp_cast()
523 ts->innerstream = file; in php_stream_temp_cast()
524 php_stream_encloses(stream, ts->innerstream); in php_stream_temp_cast()
525 php_stream_seek(ts->innerstream, pos, SEEK_SET); in php_stream_temp_cast()
527 return php_stream_cast(ts->innerstream, castas, ret, 1); in php_stream_temp_cast()
533 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_stat() local
535 if (!ts || !ts->innerstream) { in php_stream_temp_stat()
538 return php_stream_stat(ts->innerstream, ssb); in php_stream_temp_stat()
544 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_set_option() local
548 if (Z_TYPE(ts->meta) != IS_UNDEF) { in php_stream_temp_set_option()
549 zend_hash_copy(Z_ARRVAL_P((zval*)ptrparam), Z_ARRVAL(ts->meta), zval_add_ref); in php_stream_temp_set_option()
553 if (ts->innerstream) { in php_stream_temp_set_option()
554 return php_stream_set_option(ts->innerstream, option, value, ptrparam); in php_stream_temp_set_option()
606 php_stream_temp_data *ts; in _php_stream_temp_open() local
615 ts = (php_stream_temp_data*)stream->abstract; in _php_stream_temp_open()
616 assert(ts != NULL); in _php_stream_temp_open()
617 ts->mode = mode; in _php_stream_temp_open()
638 php_stream_temp_data *ts; in php_stream_url_wrap_rfc2397() local
759 ts = (php_stream_temp_data*)stream->abstract; in php_stream_url_wrap_rfc2397()
760 assert(ts != NULL); in php_stream_url_wrap_rfc2397()
761 ts->mode = mode && mode[0] == 'r' && mode[1] != '+' ? TEMP_STREAM_READONLY : 0; in php_stream_url_wrap_rfc2397()
762 ZVAL_COPY_VALUE(&ts->meta, &meta); in php_stream_url_wrap_rfc2397()