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
974 …stream = 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()
1193 php_stream *stream; in apply_filter_to_stream() local
1209 php_stream_from_zval(stream, zstream); in apply_filter_to_stream()
1217 if (strchr(stream->mode, 'r') || strchr(stream->mode, '+')) { in apply_filter_to_stream()
1220 if (strchr(stream->mode, 'w') || strchr(stream->mode, '+') || strchr(stream->mode, 'a')) { in apply_filter_to_stream()
1226 filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream)); in apply_filter_to_stream()
1232 ret = php_stream_filter_append_ex(&stream->readfilters, filter); in apply_filter_to_stream()
1234 ret = php_stream_filter_prepend_ex(&stream->readfilters, filter); in apply_filter_to_stream()
1243 filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream)); in apply_filter_to_stream()
1249 ret = php_stream_filter_append_ex(&stream->writefilters, filter); in apply_filter_to_stream()
1251 ret = php_stream_filter_prepend_ex(&stream->writefilters, filter); in apply_filter_to_stream()
1317 php_stream *stream; in PHP_FUNCTION() local
1334 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1336 if ((buf = php_stream_get_record(stream, max_length, str, str_len))) { in PHP_FUNCTION()
1350 php_stream *stream; in PHP_FUNCTION() local
1357 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1359 if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, block, NULL) == -1) { in PHP_FUNCTION()
1375 php_stream *stream; in PHP_FUNCTION() local
1385 php_stream_from_zval(stream, socket); in PHP_FUNCTION()
1407 …if (PHP_STREAM_OPTION_RETURN_OK == php_stream_set_option(stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0… in PHP_FUNCTION()
1423 php_stream *stream; in PHP_FUNCTION() local
1430 php_stream_from_zval(stream, arg1); in PHP_FUNCTION()
1436 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_WRITE_BUFFER, PHP_STREAM_BUFFER_NONE, NULL); in PHP_FUNCTION()
1438 …ret = php_stream_set_option(stream, PHP_STREAM_OPTION_WRITE_BUFFER, PHP_STREAM_BUFFER_FULL, &buff); in PHP_FUNCTION()
1451 php_stream *stream; in PHP_FUNCTION() local
1471 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1473 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_SET_CHUNK_SIZE, (int)csize, NULL); in PHP_FUNCTION()
1486 php_stream *stream; in PHP_FUNCTION() local
1493 php_stream_from_zval(stream, arg1); in PHP_FUNCTION()
1499 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_READ_BUFFER, PHP_STREAM_BUFFER_NONE, NULL); in PHP_FUNCTION()
1501 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_READ_BUFFER, PHP_STREAM_BUFFER_FULL, &buff); in PHP_FUNCTION()
1513 php_stream *stream, *sessstream = NULL; in PHP_FUNCTION() local
1525 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1531 if (!GET_CTX_OPT(stream, "ssl", "crypto_method", val)) { in PHP_FUNCTION()
1543 if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream) < 0) { in PHP_FUNCTION()
1548 ret = php_stream_xport_crypto_enable(stream, enable); in PHP_FUNCTION()
1585 php_stream *stream = NULL; in PHP_FUNCTION() local
1593 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1594 if (stream == NULL) { in PHP_FUNCTION()
1597 wrapper = stream->wrapper; in PHP_FUNCTION()
1617 php_stream *stream; in PHP_FUNCTION() local
1624 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1626 if (!php_stream_supports_lock(stream)) { in PHP_FUNCTION()
1637 php_stream *stream; in PHP_FUNCTION() local
1644 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1646 if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) { in PHP_FUNCTION()
1647 php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void*)&fileno, 0); in PHP_FUNCTION()
1648 } else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) { in PHP_FUNCTION()
1649 php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0); in PHP_FUNCTION()
1675 php_stream *stream; in PHP_FUNCTION() local
1685 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1687 if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) { in PHP_FUNCTION()
1688 php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void*)&fileno, 0); in PHP_FUNCTION()
1690 else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) { in PHP_FUNCTION()
1691 php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0); in PHP_FUNCTION()
1740 php_stream *stream; in PHP_FUNCTION() local
1754 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1756 RETURN_BOOL(php_stream_xport_shutdown(stream, (stream_shutdown_t)how) == 0); in PHP_FUNCTION()