Lines Matching refs:stream

45 …GET_CTX_OPT(stream, wrapper, name, val) (PHP_STREAM_CONTEXT(stream) && NULL != (val = php_stream_c…  argument
110 php_stream *stream = NULL; in PHP_FUNCTION() local
161 stream = php_stream_xport_create(ZSTR_VAL(host), ZSTR_LEN(host), REPORT_ERRORS, in PHP_FUNCTION()
167 if (stream == NULL) { in PHP_FUNCTION()
179 if (stream == NULL) { in PHP_FUNCTION()
195 php_stream_to_zval(stream, return_value); in PHP_FUNCTION()
206 php_stream *stream = NULL; in PHP_FUNCTION() local
232 stream = php_stream_xport_create(host, host_len, REPORT_ERRORS, in PHP_FUNCTION()
236 if (stream == NULL) { in PHP_FUNCTION()
240 if (stream == NULL) { in PHP_FUNCTION()
256 php_stream_to_zval(stream, return_value); in PHP_FUNCTION()
269 php_stream *stream = NULL, *clistream = NULL; in PHP_FUNCTION() local
284 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
302 if (0 == php_stream_xport_accept(stream, &clistream, in PHP_FUNCTION()
329 php_stream *stream; in PHP_FUNCTION() local
339 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
341 if (0 != php_stream_xport_get_name(stream, want_peer, in PHP_FUNCTION()
360 php_stream *stream; in PHP_FUNCTION() local
375 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
385 …RETURN_LONG(php_stream_xport_sendto(stream, data, datalen, (int)flags, target_addr_len ? &sa : NUL… in PHP_FUNCTION()
392 php_stream *stream; in PHP_FUNCTION() local
408 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
421 recvd = php_stream_xport_recvfrom(stream, ZSTR_VAL(read_buf), to_read, (int)flags, NULL, NULL, in PHP_FUNCTION()
442 php_stream *stream; in PHP_FUNCTION() local
462 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
468 position = php_stream_tell(stream); in PHP_FUNCTION()
471 seek_res = php_stream_seek(stream, desiredpos - position, SEEK_CUR); in PHP_FUNCTION()
474 seek_res = php_stream_seek(stream, desiredpos, SEEK_SET); in PHP_FUNCTION()
484 if ((contents = php_stream_copy_to_mem(stream, maxlen, 0))) { in PHP_FUNCTION()
535 php_stream *stream; in PHP_FUNCTION() local
541 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
545 if (!php_stream_populate_meta_data(stream, return_value)) { in PHP_FUNCTION()
548 add_assoc_bool(return_value, "eof", php_stream_eof(stream)); in PHP_FUNCTION()
551 if (!Z_ISUNDEF(stream->wrapperdata)) { in PHP_FUNCTION()
552 Z_ADDREF_P(&stream->wrapperdata); in PHP_FUNCTION()
553 add_assoc_zval(return_value, "wrapper_data", &stream->wrapperdata); in PHP_FUNCTION()
555 if (stream->wrapper) { in PHP_FUNCTION()
556 add_assoc_string(return_value, "wrapper_type", (char *)stream->wrapper->wops->label); in PHP_FUNCTION()
558 add_assoc_string(return_value, "stream_type", (char *)stream->ops->label); in PHP_FUNCTION()
560 add_assoc_string(return_value, "mode", stream->mode); in PHP_FUNCTION()
563 if (stream->filterhead) { in PHP_FUNCTION()
569 for (filter = stream->filterhead; filter != NULL; filter = filter->next) { in PHP_FUNCTION()
577 add_assoc_long(return_value, "unread_bytes", stream->writepos - stream->readpos); in PHP_FUNCTION()
579 …add_assoc_bool(return_value, "seekable", (stream->ops->seek) && (stream->flags & PHP_STREAM_FLAG_N… in PHP_FUNCTION()
580 if (stream->orig_path) { in PHP_FUNCTION()
581 add_assoc_string(return_value, "uri", stream->orig_path); in PHP_FUNCTION()
626 php_stream *stream; in stream_array_to_fd_set() local
640 php_stream_from_zval_no_verify(stream, elem); in stream_array_to_fd_set()
641 if (stream == NULL) { in stream_array_to_fd_set()
649 …if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (vo… in stream_array_to_fd_set()
666 php_stream *stream; in stream_array_from_fd_set() local
680 php_stream_from_zval_no_verify(stream, elem); in stream_array_from_fd_set()
681 if (stream == NULL) { in stream_array_from_fd_set()
689 …if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (vo… in stream_array_from_fd_set()
715 php_stream *stream; in stream_array_emulate_read_fd_set() local
727 php_stream_from_zval_no_verify(stream, elem); in stream_array_emulate_read_fd_set()
728 if (stream == NULL) { in stream_array_emulate_read_fd_set()
731 if ((stream->writepos - stream->readpos) > 0) { in stream_array_emulate_read_fd_set()
972 php_stream *stream; in decode_context_param() local
974stream = zend_fetch_resource2_ex(contextresource, NULL, php_file_le_stream(), php_file_le_pstream(… in decode_context_param()
976 if (stream) { in decode_context_param()
977 context = PHP_STREAM_CONTEXT(stream); in decode_context_param()
984 stream->ctx = context->res; in decode_context_param()
1238 php_stream *stream; in apply_filter_to_stream() local
1254 php_stream_from_zval(stream, zstream); in apply_filter_to_stream()
1262 if (strchr(stream->mode, 'r') || strchr(stream->mode, '+')) { in apply_filter_to_stream()
1265 if (strchr(stream->mode, 'w') || strchr(stream->mode, '+') || strchr(stream->mode, 'a')) { in apply_filter_to_stream()
1271 filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream)); in apply_filter_to_stream()
1277 ret = php_stream_filter_append_ex(&stream->readfilters, filter); in apply_filter_to_stream()
1279 ret = php_stream_filter_prepend_ex(&stream->readfilters, filter); in apply_filter_to_stream()
1288 filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream)); in apply_filter_to_stream()
1294 ret = php_stream_filter_append_ex(&stream->writefilters, filter); in apply_filter_to_stream()
1296 ret = php_stream_filter_prepend_ex(&stream->writefilters, filter); in apply_filter_to_stream()
1362 php_stream *stream; in PHP_FUNCTION() local
1379 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1381 if ((buf = php_stream_get_record(stream, max_length, str, str_len))) { in PHP_FUNCTION()
1395 php_stream *stream; in PHP_FUNCTION() local
1402 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1404 if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, block, NULL) == -1) { in PHP_FUNCTION()
1420 php_stream *stream; in PHP_FUNCTION() local
1430 php_stream_from_zval(stream, socket); in PHP_FUNCTION()
1452 …if (PHP_STREAM_OPTION_RETURN_OK == php_stream_set_option(stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0… in PHP_FUNCTION()
1468 php_stream *stream; in PHP_FUNCTION() local
1475 php_stream_from_zval(stream, arg1); in PHP_FUNCTION()
1481 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_WRITE_BUFFER, PHP_STREAM_BUFFER_NONE, NULL); in PHP_FUNCTION()
1483 …ret = php_stream_set_option(stream, PHP_STREAM_OPTION_WRITE_BUFFER, PHP_STREAM_BUFFER_FULL, &buff); in PHP_FUNCTION()
1496 php_stream *stream; in PHP_FUNCTION() local
1516 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1518 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_SET_CHUNK_SIZE, (int)csize, NULL); in PHP_FUNCTION()
1531 php_stream *stream; in PHP_FUNCTION() local
1538 php_stream_from_zval(stream, arg1); in PHP_FUNCTION()
1544 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_READ_BUFFER, PHP_STREAM_BUFFER_NONE, NULL); in PHP_FUNCTION()
1546 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_READ_BUFFER, PHP_STREAM_BUFFER_FULL, &buff); in PHP_FUNCTION()
1558 php_stream *stream, *sessstream = NULL; in PHP_FUNCTION() local
1570 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1576 if (!GET_CTX_OPT(stream, "ssl", "crypto_method", val)) { in PHP_FUNCTION()
1588 if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream) < 0) { in PHP_FUNCTION()
1593 ret = php_stream_xport_crypto_enable(stream, enable); in PHP_FUNCTION()
1630 php_stream *stream = NULL; in PHP_FUNCTION() local
1638 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1639 wrapper = stream->wrapper; in PHP_FUNCTION()
1659 php_stream *stream; in PHP_FUNCTION() local
1666 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1668 if (!php_stream_supports_lock(stream)) { in PHP_FUNCTION()
1679 php_stream *stream; in PHP_FUNCTION() local
1686 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1692 …if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL) == SUCCESS… in PHP_FUNCTION()
1693 …php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&fileno, 0); in PHP_FUNCTION()
1694 } else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_INTERNAL) == SUCCESS) { in PHP_FUNCTION()
1695 php_stream_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_INTERNAL, (void*)&fileno, 0); in PHP_FUNCTION()
1721 php_stream *stream; in PHP_FUNCTION() local
1731 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1737 …if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL) == SUCCESS… in PHP_FUNCTION()
1738 …php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&fileno, 0); in PHP_FUNCTION()
1739 } else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_INTERNAL) == SUCCESS) { in PHP_FUNCTION()
1740 php_stream_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_INTERNAL, (void*)&fileno, 0); in PHP_FUNCTION()
1788 php_stream *stream; in PHP_FUNCTION() local
1802 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1804 RETURN_BOOL(php_stream_xport_shutdown(stream, (stream_shutdown_t)how) == 0); in PHP_FUNCTION()