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
980 …stream = 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()
1199 php_stream *stream; in apply_filter_to_stream() local
1215 php_stream_from_zval(stream, zstream); in apply_filter_to_stream()
1223 if (strchr(stream->mode, 'r') || strchr(stream->mode, '+')) { in apply_filter_to_stream()
1226 if (strchr(stream->mode, 'w') || strchr(stream->mode, '+') || strchr(stream->mode, 'a')) { in apply_filter_to_stream()
1232 filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream)); in apply_filter_to_stream()
1238 ret = php_stream_filter_append_ex(&stream->readfilters, filter); in apply_filter_to_stream()
1240 ret = php_stream_filter_prepend_ex(&stream->readfilters, filter); in apply_filter_to_stream()
1249 filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream)); in apply_filter_to_stream()
1255 ret = php_stream_filter_append_ex(&stream->writefilters, filter); in apply_filter_to_stream()
1257 ret = php_stream_filter_prepend_ex(&stream->writefilters, filter); in apply_filter_to_stream()
1323 php_stream *stream; in PHP_FUNCTION() local
1340 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1342 if ((buf = php_stream_get_record(stream, max_length, str, str_len))) { in PHP_FUNCTION()
1356 php_stream *stream; in PHP_FUNCTION() local
1363 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1365 if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, block, NULL) == -1) { in PHP_FUNCTION()
1381 php_stream *stream; in PHP_FUNCTION() local
1391 php_stream_from_zval(stream, socket); in PHP_FUNCTION()
1413 …if (PHP_STREAM_OPTION_RETURN_OK == php_stream_set_option(stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0… in PHP_FUNCTION()
1429 php_stream *stream; in PHP_FUNCTION() local
1436 php_stream_from_zval(stream, arg1); in PHP_FUNCTION()
1442 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_WRITE_BUFFER, PHP_STREAM_BUFFER_NONE, NULL); in PHP_FUNCTION()
1444 …ret = php_stream_set_option(stream, PHP_STREAM_OPTION_WRITE_BUFFER, PHP_STREAM_BUFFER_FULL, &buff); in PHP_FUNCTION()
1457 php_stream *stream; in PHP_FUNCTION() local
1477 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1479 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_SET_CHUNK_SIZE, (int)csize, NULL); in PHP_FUNCTION()
1492 php_stream *stream; in PHP_FUNCTION() local
1499 php_stream_from_zval(stream, arg1); in PHP_FUNCTION()
1505 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_READ_BUFFER, PHP_STREAM_BUFFER_NONE, NULL); in PHP_FUNCTION()
1507 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_READ_BUFFER, PHP_STREAM_BUFFER_FULL, &buff); in PHP_FUNCTION()
1519 php_stream *stream, *sessstream = NULL; in PHP_FUNCTION() local
1531 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1537 if (!GET_CTX_OPT(stream, "ssl", "crypto_method", val)) { in PHP_FUNCTION()
1549 if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream) < 0) { in PHP_FUNCTION()
1554 ret = php_stream_xport_crypto_enable(stream, enable); in PHP_FUNCTION()
1591 php_stream *stream = NULL; in PHP_FUNCTION() local
1599 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1600 if (stream == NULL) { in PHP_FUNCTION()
1603 wrapper = stream->wrapper; in PHP_FUNCTION()
1623 php_stream *stream; in PHP_FUNCTION() local
1630 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1632 if (!php_stream_supports_lock(stream)) { 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_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) { in PHP_FUNCTION()
1653 php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void*)&fileno, 0); in PHP_FUNCTION()
1654 } else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) { in PHP_FUNCTION()
1655 php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0); in PHP_FUNCTION()
1681 php_stream *stream; in PHP_FUNCTION() local
1691 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1693 if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) { in PHP_FUNCTION()
1694 php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void*)&fileno, 0); in PHP_FUNCTION()
1696 else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) { in PHP_FUNCTION()
1697 php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0); in PHP_FUNCTION()
1746 php_stream *stream; in PHP_FUNCTION() local
1760 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1762 RETURN_BOOL(php_stream_xport_shutdown(stream, (stream_shutdown_t)how) == 0); in PHP_FUNCTION()