Lines Matching refs:stream

43 …GET_CTX_OPT(stream, wrapper, name, val) (PHP_STREAM_CONTEXT(stream) && NULL != (val = php_stream_c…  argument
108 php_stream *stream = NULL; in PHP_FUNCTION() local
162 stream = php_stream_xport_create(ZSTR_VAL(host), ZSTR_LEN(host), REPORT_ERRORS, in PHP_FUNCTION()
168 if (stream == NULL) { in PHP_FUNCTION()
180 if (stream == NULL) { in PHP_FUNCTION()
196 php_stream_to_zval(stream, return_value); in PHP_FUNCTION()
207 php_stream *stream = NULL; in PHP_FUNCTION() local
233 stream = php_stream_xport_create(host, host_len, REPORT_ERRORS, in PHP_FUNCTION()
237 if (stream == NULL) { in PHP_FUNCTION()
241 if (stream == NULL) { in PHP_FUNCTION()
257 php_stream_to_zval(stream, return_value); in PHP_FUNCTION()
270 php_stream *stream = NULL, *clistream = NULL; in PHP_FUNCTION() local
288 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
306 if (0 == php_stream_xport_accept(stream, &clistream, in PHP_FUNCTION()
333 php_stream *stream; in PHP_FUNCTION() local
343 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
345 if (0 != php_stream_xport_get_name(stream, want_peer, in PHP_FUNCTION()
364 php_stream *stream; in PHP_FUNCTION() local
379 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
389 …RETURN_LONG(php_stream_xport_sendto(stream, data, datalen, (int)flags, target_addr_len ? &sa : NUL… in PHP_FUNCTION()
396 php_stream *stream; in PHP_FUNCTION() local
412 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
425 recvd = php_stream_xport_recvfrom(stream, ZSTR_VAL(read_buf), to_read, (int)flags, NULL, NULL, in PHP_FUNCTION()
446 php_stream *stream; in PHP_FUNCTION() local
466 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
472 position = php_stream_tell(stream); in PHP_FUNCTION()
475 seek_res = php_stream_seek(stream, desiredpos - position, SEEK_CUR); in PHP_FUNCTION()
478 seek_res = php_stream_seek(stream, desiredpos, SEEK_SET); in PHP_FUNCTION()
488 if ((contents = php_stream_copy_to_mem(stream, maxlen, 0))) { in PHP_FUNCTION()
539 php_stream *stream; in PHP_FUNCTION() local
545 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
549 if (!php_stream_populate_meta_data(stream, return_value)) { in PHP_FUNCTION()
552 add_assoc_bool(return_value, "eof", php_stream_eof(stream)); in PHP_FUNCTION()
555 if (!Z_ISUNDEF(stream->wrapperdata)) { in PHP_FUNCTION()
556 Z_ADDREF_P(&stream->wrapperdata); in PHP_FUNCTION()
557 add_assoc_zval(return_value, "wrapper_data", &stream->wrapperdata); in PHP_FUNCTION()
559 if (stream->wrapper) { in PHP_FUNCTION()
560 add_assoc_string(return_value, "wrapper_type", (char *)stream->wrapper->wops->label); in PHP_FUNCTION()
562 add_assoc_string(return_value, "stream_type", (char *)stream->ops->label); in PHP_FUNCTION()
564 add_assoc_string(return_value, "mode", stream->mode); in PHP_FUNCTION()
567 if (stream->filterhead) { in PHP_FUNCTION()
573 for (filter = stream->filterhead; filter != NULL; filter = filter->next) { in PHP_FUNCTION()
581 add_assoc_long(return_value, "unread_bytes", stream->writepos - stream->readpos); in PHP_FUNCTION()
583 …add_assoc_bool(return_value, "seekable", (stream->ops->seek) && (stream->flags & PHP_STREAM_FLAG_N… in PHP_FUNCTION()
584 if (stream->orig_path) { in PHP_FUNCTION()
585 add_assoc_string(return_value, "uri", stream->orig_path); in PHP_FUNCTION()
630 php_stream *stream; in stream_array_to_fd_set() local
644 php_stream_from_zval_no_verify(stream, elem); in stream_array_to_fd_set()
645 if (stream == NULL) { in stream_array_to_fd_set()
653 …if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (vo… in stream_array_to_fd_set()
670 php_stream *stream; in stream_array_from_fd_set() local
684 php_stream_from_zval_no_verify(stream, elem); in stream_array_from_fd_set()
685 if (stream == NULL) { in stream_array_from_fd_set()
693 …if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (vo… in stream_array_from_fd_set()
719 php_stream *stream; in stream_array_emulate_read_fd_set() local
731 php_stream_from_zval_no_verify(stream, elem); in stream_array_emulate_read_fd_set()
732 if (stream == NULL) { in stream_array_emulate_read_fd_set()
735 if ((stream->writepos - stream->readpos) > 0) { in stream_array_emulate_read_fd_set()
978 php_stream *stream; in decode_context_param() local
980stream = zend_fetch_resource2_ex(contextresource, NULL, php_file_le_stream(), php_file_le_pstream(… in decode_context_param()
982 if (stream) { in decode_context_param()
983 context = PHP_STREAM_CONTEXT(stream); in decode_context_param()
990 stream->ctx = context->res; in decode_context_param()
1219 php_stream *stream; in apply_filter_to_stream() local
1235 php_stream_from_zval(stream, zstream); in apply_filter_to_stream()
1243 if (strchr(stream->mode, 'r') || strchr(stream->mode, '+')) { in apply_filter_to_stream()
1246 if (strchr(stream->mode, 'w') || strchr(stream->mode, '+') || strchr(stream->mode, 'a')) { in apply_filter_to_stream()
1252 filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream)); in apply_filter_to_stream()
1258 ret = php_stream_filter_append_ex(&stream->readfilters, filter); in apply_filter_to_stream()
1260 ret = php_stream_filter_prepend_ex(&stream->readfilters, filter); in apply_filter_to_stream()
1269 filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream)); in apply_filter_to_stream()
1275 ret = php_stream_filter_append_ex(&stream->writefilters, filter); in apply_filter_to_stream()
1277 ret = php_stream_filter_prepend_ex(&stream->writefilters, filter); in apply_filter_to_stream()
1343 php_stream *stream; in PHP_FUNCTION() local
1360 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1362 if ((buf = php_stream_get_record(stream, max_length, str, str_len))) { in PHP_FUNCTION()
1376 php_stream *stream; in PHP_FUNCTION() local
1383 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1385 if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, block, NULL) == -1) { in PHP_FUNCTION()
1401 php_stream *stream; in PHP_FUNCTION() local
1411 php_stream_from_zval(stream, socket); in PHP_FUNCTION()
1433 …if (PHP_STREAM_OPTION_RETURN_OK == php_stream_set_option(stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0… in PHP_FUNCTION()
1449 php_stream *stream; in PHP_FUNCTION() local
1456 php_stream_from_zval(stream, arg1); in PHP_FUNCTION()
1462 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_WRITE_BUFFER, PHP_STREAM_BUFFER_NONE, NULL); in PHP_FUNCTION()
1464 …ret = php_stream_set_option(stream, PHP_STREAM_OPTION_WRITE_BUFFER, PHP_STREAM_BUFFER_FULL, &buff); in PHP_FUNCTION()
1477 php_stream *stream; in PHP_FUNCTION() local
1497 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1499 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_SET_CHUNK_SIZE, (int)csize, NULL); in PHP_FUNCTION()
1512 php_stream *stream; in PHP_FUNCTION() local
1519 php_stream_from_zval(stream, arg1); in PHP_FUNCTION()
1525 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_READ_BUFFER, PHP_STREAM_BUFFER_NONE, NULL); in PHP_FUNCTION()
1527 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_READ_BUFFER, PHP_STREAM_BUFFER_FULL, &buff); in PHP_FUNCTION()
1539 php_stream *stream, *sessstream = NULL; in PHP_FUNCTION() local
1551 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1557 if (!GET_CTX_OPT(stream, "ssl", "crypto_method", val)) { in PHP_FUNCTION()
1569 if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream) < 0) { in PHP_FUNCTION()
1574 ret = php_stream_xport_crypto_enable(stream, enable); in PHP_FUNCTION()
1611 php_stream *stream = NULL; in PHP_FUNCTION() local
1619 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1620 if (stream == NULL) { in PHP_FUNCTION()
1623 wrapper = stream->wrapper; in PHP_FUNCTION()
1643 php_stream *stream; in PHP_FUNCTION() local
1650 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1652 if (!php_stream_supports_lock(stream)) { in PHP_FUNCTION()
1663 php_stream *stream; in PHP_FUNCTION() local
1670 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1676 …if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL) == SUCCESS… in PHP_FUNCTION()
1677 …php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&fileno, 0); in PHP_FUNCTION()
1678 } else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_INTERNAL) == SUCCESS) { in PHP_FUNCTION()
1679 php_stream_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_INTERNAL, (void*)&fileno, 0); in PHP_FUNCTION()
1705 php_stream *stream; in PHP_FUNCTION() local
1715 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1721 …if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL) == SUCCESS… in PHP_FUNCTION()
1722 …php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&fileno, 0); in PHP_FUNCTION()
1723 } else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_INTERNAL) == SUCCESS) { in PHP_FUNCTION()
1724 php_stream_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_INTERNAL, (void*)&fileno, 0); in PHP_FUNCTION()
1772 php_stream *stream; in PHP_FUNCTION() local
1786 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1788 RETURN_BOOL(php_stream_xport_shutdown(stream, (stream_shutdown_t)how) == 0); in PHP_FUNCTION()