Lines Matching refs:ts
347 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_write() local
348 assert(ts != NULL); in php_stream_temp_write()
350 if (!ts->innerstream) { in php_stream_temp_write()
353 if (php_stream_is(ts->innerstream, PHP_STREAM_IS_MEMORY)) { in php_stream_temp_write()
354 zend_off_t pos = php_stream_tell(ts->innerstream); in php_stream_temp_write()
356 if (pos + count >= ts->smax) { in php_stream_temp_write()
357 zend_string *membuf = php_stream_memory_get_buffer(ts->innerstream); in php_stream_temp_write()
358 php_stream *file = php_stream_fopen_temporary_file(ts->tmpdir, "php", NULL); in php_stream_temp_write()
364 php_stream_free_enclosed(ts->innerstream, PHP_STREAM_FREE_CLOSE); in php_stream_temp_write()
365 ts->innerstream = file; in php_stream_temp_write()
366 php_stream_encloses(stream, ts->innerstream); in php_stream_temp_write()
367 php_stream_seek(ts->innerstream, pos, SEEK_SET); in php_stream_temp_write()
370 return php_stream_write(ts->innerstream, buf, count); in php_stream_temp_write()
378 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_read() local
381 assert(ts != NULL); in php_stream_temp_read()
383 if (!ts->innerstream) { in php_stream_temp_read()
387 got = php_stream_read(ts->innerstream, buf, count); in php_stream_temp_read()
389 stream->eof = ts->innerstream->eof; in php_stream_temp_read()
399 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_close() local
402 assert(ts != NULL); in php_stream_temp_close()
404 if (ts->innerstream) { in php_stream_temp_close()
405 …ret = php_stream_free_enclosed(ts->innerstream, PHP_STREAM_FREE_CLOSE | (close_handle ? 0 : PHP_ST… in php_stream_temp_close()
410 zval_ptr_dtor(&ts->meta); in php_stream_temp_close()
412 if (ts->tmpdir) { in php_stream_temp_close()
413 efree(ts->tmpdir); in php_stream_temp_close()
416 efree(ts); in php_stream_temp_close()
426 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_flush() local
427 assert(ts != NULL); in php_stream_temp_flush()
429 return ts->innerstream ? php_stream_flush(ts->innerstream) : -1; in php_stream_temp_flush()
437 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_seek() local
440 assert(ts != NULL); in php_stream_temp_seek()
442 if (!ts->innerstream) { in php_stream_temp_seek()
446 ret = php_stream_seek(ts->innerstream, offset, whence); in php_stream_temp_seek()
447 *newoffs = php_stream_tell(ts->innerstream); in php_stream_temp_seek()
448 stream->eof = ts->innerstream->eof; in php_stream_temp_seek()
457 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_cast() local
462 assert(ts != NULL); in php_stream_temp_cast()
464 if (!ts->innerstream) { in php_stream_temp_cast()
467 if (php_stream_is(ts->innerstream, PHP_STREAM_IS_STDIO)) { in php_stream_temp_cast()
468 return php_stream_cast(ts->innerstream, castas, ret, 0); in php_stream_temp_cast()
492 membuf = php_stream_memory_get_buffer(ts->innerstream); in php_stream_temp_cast()
494 pos = php_stream_tell(ts->innerstream); in php_stream_temp_cast()
496 php_stream_free_enclosed(ts->innerstream, PHP_STREAM_FREE_CLOSE); in php_stream_temp_cast()
497 ts->innerstream = file; in php_stream_temp_cast()
498 php_stream_encloses(stream, ts->innerstream); in php_stream_temp_cast()
499 php_stream_seek(ts->innerstream, pos, SEEK_SET); in php_stream_temp_cast()
501 return php_stream_cast(ts->innerstream, castas, ret, 1); in php_stream_temp_cast()
507 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_stat() local
509 if (!ts || !ts->innerstream) { in php_stream_temp_stat()
512 return php_stream_stat(ts->innerstream, ssb); in php_stream_temp_stat()
518 php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; in php_stream_temp_set_option() local
522 if (Z_TYPE(ts->meta) != IS_UNDEF) { in php_stream_temp_set_option()
523 zend_hash_copy(Z_ARRVAL_P((zval*)ptrparam), Z_ARRVAL(ts->meta), zval_add_ref); in php_stream_temp_set_option()
527 if (ts->innerstream) { in php_stream_temp_set_option()
528 return php_stream_set_option(ts->innerstream, option, value, ptrparam); in php_stream_temp_set_option()
580 php_stream_temp_data *ts; in _php_stream_temp_open() local
589 ts = (php_stream_temp_data*)stream->abstract; in _php_stream_temp_open()
590 assert(ts != NULL); in _php_stream_temp_open()
591 ts->mode = mode; in _php_stream_temp_open()
612 php_stream_temp_data *ts; in php_stream_url_wrap_rfc2397() local
735 ts = (php_stream_temp_data*)stream->abstract; in php_stream_url_wrap_rfc2397()
736 assert(ts != NULL); in php_stream_url_wrap_rfc2397()
737 ts->mode = mode[0] == 'r' && mode[1] != '+' ? TEMP_STREAM_READONLY : 0; in php_stream_url_wrap_rfc2397()
738 ZVAL_COPY_VALUE(&ts->meta, &meta); in php_stream_url_wrap_rfc2397()