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
152 stream = php_stream_xport_create(ZSTR_VAL(host), ZSTR_LEN(host), REPORT_ERRORS, in PHP_FUNCTION()
158 if (stream == NULL) { in PHP_FUNCTION()
170 if (stream == NULL) { in PHP_FUNCTION()
186 php_stream_to_zval(stream, return_value); in PHP_FUNCTION()
197 php_stream *stream = NULL; in PHP_FUNCTION() local
227 stream = php_stream_xport_create(host, host_len, REPORT_ERRORS, in PHP_FUNCTION()
231 if (stream == NULL) { in PHP_FUNCTION()
235 if (stream == NULL) { in PHP_FUNCTION()
251 php_stream_to_zval(stream, return_value); in PHP_FUNCTION()
264 php_stream *stream = NULL, *clistream = NULL; in PHP_FUNCTION() local
279 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
291 if (0 == php_stream_xport_accept(stream, &clistream, in PHP_FUNCTION()
318 php_stream *stream; in PHP_FUNCTION() local
328 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
330 if (0 != php_stream_xport_get_name(stream, want_peer, in PHP_FUNCTION()
349 php_stream *stream; in PHP_FUNCTION() local
364 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
374 …RETURN_LONG(php_stream_xport_sendto(stream, data, datalen, (int)flags, target_addr_len ? &sa : NUL… in PHP_FUNCTION()
381 php_stream *stream; in PHP_FUNCTION() local
397 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
410 recvd = php_stream_xport_recvfrom(stream, ZSTR_VAL(read_buf), to_read, (int)flags, NULL, NULL, in PHP_FUNCTION()
431 php_stream *stream; in PHP_FUNCTION() local
451 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
457 position = php_stream_tell(stream); in PHP_FUNCTION()
460 seek_res = php_stream_seek(stream, desiredpos - position, SEEK_CUR); in PHP_FUNCTION()
463 seek_res = php_stream_seek(stream, desiredpos, SEEK_SET); in PHP_FUNCTION()
473 if ((contents = php_stream_copy_to_mem(stream, maxlen, 0))) { in PHP_FUNCTION()
524 php_stream *stream; in PHP_FUNCTION() local
530 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
534 if (!php_stream_populate_meta_data(stream, return_value)) { in PHP_FUNCTION()
537 add_assoc_bool(return_value, "eof", php_stream_eof(stream)); in PHP_FUNCTION()
540 if (!Z_ISUNDEF(stream->wrapperdata)) { in PHP_FUNCTION()
541 Z_ADDREF_P(&stream->wrapperdata); in PHP_FUNCTION()
542 add_assoc_zval(return_value, "wrapper_data", &stream->wrapperdata); in PHP_FUNCTION()
544 if (stream->wrapper) { in PHP_FUNCTION()
545 add_assoc_string(return_value, "wrapper_type", (char *)stream->wrapper->wops->label); in PHP_FUNCTION()
547 add_assoc_string(return_value, "stream_type", (char *)stream->ops->label); in PHP_FUNCTION()
549 add_assoc_string(return_value, "mode", stream->mode); in PHP_FUNCTION()
552 if (stream->filterhead) { in PHP_FUNCTION()
558 for (filter = stream->filterhead; filter != NULL; filter = filter->next) { in PHP_FUNCTION()
566 add_assoc_long(return_value, "unread_bytes", stream->writepos - stream->readpos); in PHP_FUNCTION()
568 …add_assoc_bool(return_value, "seekable", (stream->ops->seek) && (stream->flags & PHP_STREAM_FLAG_N… in PHP_FUNCTION()
569 if (stream->orig_path) { in PHP_FUNCTION()
570 add_assoc_string(return_value, "uri", stream->orig_path); in PHP_FUNCTION()
615 php_stream *stream; in stream_array_to_fd_set() local
629 php_stream_from_zval_no_verify(stream, elem); in stream_array_to_fd_set()
630 if (stream == NULL) { in stream_array_to_fd_set()
638 …if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (vo… in stream_array_to_fd_set()
655 php_stream *stream; in stream_array_from_fd_set() local
669 php_stream_from_zval_no_verify(stream, elem); in stream_array_from_fd_set()
670 if (stream == NULL) { in stream_array_from_fd_set()
678 …if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (vo… in stream_array_from_fd_set()
704 php_stream *stream; in stream_array_emulate_read_fd_set() local
716 php_stream_from_zval_no_verify(stream, elem); in stream_array_emulate_read_fd_set()
717 if (stream == NULL) { in stream_array_emulate_read_fd_set()
720 if ((stream->writepos - stream->readpos) > 0) { in stream_array_emulate_read_fd_set()
953 php_stream *stream; in decode_context_param() local
955 …stream = zend_fetch_resource2_ex(contextresource, NULL, php_file_le_stream(), php_file_le_pstream(… in decode_context_param()
957 if (stream) { in decode_context_param()
958 context = PHP_STREAM_CONTEXT(stream); in decode_context_param()
965 stream->ctx = context->res; in decode_context_param()
1174 php_stream *stream; in apply_filter_to_stream() local
1190 php_stream_from_zval(stream, zstream); in apply_filter_to_stream()
1198 if (strchr(stream->mode, 'r') || strchr(stream->mode, '+')) { in apply_filter_to_stream()
1201 if (strchr(stream->mode, 'w') || strchr(stream->mode, '+') || strchr(stream->mode, 'a')) { in apply_filter_to_stream()
1207 filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream)); in apply_filter_to_stream()
1213 ret = php_stream_filter_append_ex(&stream->readfilters, filter); in apply_filter_to_stream()
1215 ret = php_stream_filter_prepend_ex(&stream->readfilters, filter); in apply_filter_to_stream()
1224 filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream)); in apply_filter_to_stream()
1230 ret = php_stream_filter_append_ex(&stream->writefilters, filter); in apply_filter_to_stream()
1232 ret = php_stream_filter_prepend_ex(&stream->writefilters, filter); in apply_filter_to_stream()
1298 php_stream *stream; in PHP_FUNCTION() local
1315 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1317 if ((buf = php_stream_get_record(stream, max_length, str, str_len))) { in PHP_FUNCTION()
1331 php_stream *stream; in PHP_FUNCTION() local
1338 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1340 if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, block, NULL) == -1) { in PHP_FUNCTION()
1356 php_stream *stream; in PHP_FUNCTION() local
1366 php_stream_from_zval(stream, socket); in PHP_FUNCTION()
1388 …if (PHP_STREAM_OPTION_RETURN_OK == php_stream_set_option(stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0… in PHP_FUNCTION()
1404 php_stream *stream; in PHP_FUNCTION() local
1411 php_stream_from_zval(stream, arg1); in PHP_FUNCTION()
1417 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_WRITE_BUFFER, PHP_STREAM_BUFFER_NONE, NULL); in PHP_FUNCTION()
1419 …ret = php_stream_set_option(stream, PHP_STREAM_OPTION_WRITE_BUFFER, PHP_STREAM_BUFFER_FULL, &buff); in PHP_FUNCTION()
1432 php_stream *stream; in PHP_FUNCTION() local
1452 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1454 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_SET_CHUNK_SIZE, (int)csize, NULL); in PHP_FUNCTION()
1467 php_stream *stream; in PHP_FUNCTION() local
1474 php_stream_from_zval(stream, arg1); in PHP_FUNCTION()
1480 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_READ_BUFFER, PHP_STREAM_BUFFER_NONE, NULL); in PHP_FUNCTION()
1482 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_READ_BUFFER, PHP_STREAM_BUFFER_FULL, &buff); in PHP_FUNCTION()
1494 php_stream *stream, *sessstream = NULL; in PHP_FUNCTION() local
1506 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1512 if (!GET_CTX_OPT(stream, "ssl", "crypto_method", val)) { in PHP_FUNCTION()
1524 if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream) < 0) { in PHP_FUNCTION()
1529 ret = php_stream_xport_crypto_enable(stream, enable); in PHP_FUNCTION()
1567 php_stream *stream = NULL; in PHP_FUNCTION() local
1575 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1576 if (stream == NULL) { in PHP_FUNCTION()
1579 wrapper = stream->wrapper; in PHP_FUNCTION()
1599 php_stream *stream; in PHP_FUNCTION() local
1606 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1608 if (!php_stream_supports_lock(stream)) { in PHP_FUNCTION()
1619 php_stream *stream; in PHP_FUNCTION() local
1626 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1628 if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) { in PHP_FUNCTION()
1629 php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void*)&fileno, 0); in PHP_FUNCTION()
1630 } else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) { in PHP_FUNCTION()
1631 php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0); in PHP_FUNCTION()
1657 php_stream *stream; in PHP_FUNCTION() local
1667 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1669 if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) { in PHP_FUNCTION()
1670 php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void*)&fileno, 0); in PHP_FUNCTION()
1672 else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) { in PHP_FUNCTION()
1673 php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0); in PHP_FUNCTION()
1722 php_stream *stream; in PHP_FUNCTION() local
1736 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1738 RETURN_BOOL(php_stream_xport_shutdown(stream, (stream_shutdown_t)how) == 0); in PHP_FUNCTION()