Lines Matching refs:stream

45 …GET_CTX_OPT(stream, wrapper, name, val) (PHP_STREAM_CONTEXT(stream) && NULL != (val = php_stream_c…  argument
99 php_stream *stream = NULL; in PHP_FUNCTION() local
139 stream = php_stream_xport_create(ZSTR_VAL(host), ZSTR_LEN(host), REPORT_ERRORS, in PHP_FUNCTION()
145 if (stream == NULL) { in PHP_FUNCTION()
157 if (stream == NULL) { in PHP_FUNCTION()
173 php_stream_to_zval(stream, return_value); in PHP_FUNCTION()
185 php_stream *stream = NULL; in PHP_FUNCTION() local
215 stream = php_stream_xport_create(host, host_len, REPORT_ERRORS, in PHP_FUNCTION()
219 if (stream == NULL) { in PHP_FUNCTION()
223 if (stream == NULL) { in PHP_FUNCTION()
239 php_stream_to_zval(stream, return_value); in PHP_FUNCTION()
252 php_stream *stream = NULL, *clistream = NULL; in PHP_FUNCTION() local
263 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
275 if (0 == php_stream_xport_accept(stream, &clistream, in PHP_FUNCTION()
303 php_stream *stream; in PHP_FUNCTION() local
313 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
315 if (0 != php_stream_xport_get_name(stream, want_peer, in PHP_FUNCTION()
335 php_stream *stream; in PHP_FUNCTION() local
350 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
360 …RETURN_LONG(php_stream_xport_sendto(stream, data, datalen, (int)flags, target_addr_len ? &sa : NUL… in PHP_FUNCTION()
368 php_stream *stream; in PHP_FUNCTION() local
384 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
397 recvd = php_stream_xport_recvfrom(stream, ZSTR_VAL(read_buf), to_read, (int)flags, NULL, NULL, in PHP_FUNCTION()
419 php_stream *stream; in PHP_FUNCTION() local
437 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
443 position = php_stream_tell(stream); in PHP_FUNCTION()
446 seek_res = php_stream_seek(stream, desiredpos - position, SEEK_CUR); in PHP_FUNCTION()
449 seek_res = php_stream_seek(stream, desiredpos, SEEK_SET); in PHP_FUNCTION()
459 if ((contents = php_stream_copy_to_mem(stream, maxlen, 0))) { in PHP_FUNCTION()
507 php_stream *stream; in PHP_FUNCTION() local
513 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
517 if (!php_stream_populate_meta_data(stream, return_value)) { in PHP_FUNCTION()
520 add_assoc_bool(return_value, "eof", php_stream_eof(stream)); in PHP_FUNCTION()
523 if (!Z_ISUNDEF(stream->wrapperdata)) { in PHP_FUNCTION()
524 Z_ADDREF_P(&stream->wrapperdata); in PHP_FUNCTION()
525 add_assoc_zval(return_value, "wrapper_data", &stream->wrapperdata); in PHP_FUNCTION()
527 if (stream->wrapper) { in PHP_FUNCTION()
528 add_assoc_string(return_value, "wrapper_type", (char *)stream->wrapper->wops->label); in PHP_FUNCTION()
530 add_assoc_string(return_value, "stream_type", (char *)stream->ops->label); in PHP_FUNCTION()
532 add_assoc_string(return_value, "mode", stream->mode); in PHP_FUNCTION()
535 if (stream->filterhead) { in PHP_FUNCTION()
541 for (filter = stream->filterhead; filter != NULL; filter = filter->next) { in PHP_FUNCTION()
549 add_assoc_long(return_value, "unread_bytes", stream->writepos - stream->readpos); in PHP_FUNCTION()
551 …add_assoc_bool(return_value, "seekable", (stream->ops->seek) && (stream->flags & PHP_STREAM_FLAG_N… in PHP_FUNCTION()
552 if (stream->orig_path) { in PHP_FUNCTION()
553 add_assoc_string(return_value, "uri", stream->orig_path); in PHP_FUNCTION()
610 php_stream *stream; in stream_array_to_fd_set() local
624 php_stream_from_zval_no_verify(stream, elem); in stream_array_to_fd_set()
625 if (stream == NULL) { in stream_array_to_fd_set()
633 …if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (vo… in stream_array_to_fd_set()
650 php_stream *stream; in stream_array_from_fd_set() local
664 php_stream_from_zval_no_verify(stream, elem); in stream_array_from_fd_set()
665 if (stream == NULL) { in stream_array_from_fd_set()
673 …if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (vo… in stream_array_from_fd_set()
699 php_stream *stream; in stream_array_emulate_read_fd_set() local
711 php_stream_from_zval_no_verify(stream, elem); in stream_array_emulate_read_fd_set()
712 if (stream == NULL) { in stream_array_emulate_read_fd_set()
715 if ((stream->writepos - stream->readpos) > 0) { in stream_array_emulate_read_fd_set()
945 php_stream *stream; in decode_context_param() local
947stream = zend_fetch_resource2_ex(contextresource, NULL, php_file_le_stream(), php_file_le_pstream(… in decode_context_param()
949 if (stream) { in decode_context_param()
950 context = PHP_STREAM_CONTEXT(stream); in decode_context_param()
957 stream->ctx = context->res; in decode_context_param()
1159 php_stream *stream; in apply_filter_to_stream() local
1175 php_stream_from_zval(stream, zstream); in apply_filter_to_stream()
1183 if (strchr(stream->mode, 'r') || strchr(stream->mode, '+')) { in apply_filter_to_stream()
1186 if (strchr(stream->mode, 'w') || strchr(stream->mode, '+') || strchr(stream->mode, 'a')) { in apply_filter_to_stream()
1192 filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream)); in apply_filter_to_stream()
1198 ret = php_stream_filter_append_ex(&stream->readfilters, filter); in apply_filter_to_stream()
1200 ret = php_stream_filter_prepend_ex(&stream->readfilters, filter); in apply_filter_to_stream()
1209 filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream)); in apply_filter_to_stream()
1215 ret = php_stream_filter_append_ex(&stream->writefilters, filter); in apply_filter_to_stream()
1217 ret = php_stream_filter_prepend_ex(&stream->writefilters, filter); in apply_filter_to_stream()
1292 php_stream *stream; in PHP_FUNCTION() local
1309 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1311 if ((buf = php_stream_get_record(stream, max_length, str, str_len))) { in PHP_FUNCTION()
1326 php_stream *stream; in PHP_FUNCTION() local
1333 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1335 if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, block, NULL) == -1) { in PHP_FUNCTION()
1352 php_stream *stream; in PHP_FUNCTION() local
1362 php_stream_from_zval(stream, socket); in PHP_FUNCTION()
1384 …if (PHP_STREAM_OPTION_RETURN_OK == php_stream_set_option(stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0… in PHP_FUNCTION()
1401 php_stream *stream; in PHP_FUNCTION() local
1408 php_stream_from_zval(stream, arg1); in PHP_FUNCTION()
1414 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_WRITE_BUFFER, PHP_STREAM_BUFFER_NONE, NULL); in PHP_FUNCTION()
1416 …ret = php_stream_set_option(stream, PHP_STREAM_OPTION_WRITE_BUFFER, PHP_STREAM_BUFFER_FULL, &buff); in PHP_FUNCTION()
1430 php_stream *stream; in PHP_FUNCTION() local
1450 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1452 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_SET_CHUNK_SIZE, (int)csize, NULL); in PHP_FUNCTION()
1466 php_stream *stream; in PHP_FUNCTION() local
1473 php_stream_from_zval(stream, arg1); in PHP_FUNCTION()
1479 ret = php_stream_set_option(stream, PHP_STREAM_OPTION_READ_BUFFER, PHP_STREAM_BUFFER_NONE, NULL); in PHP_FUNCTION()
1481 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()
1569 php_stream *stream = NULL; in PHP_FUNCTION() local
1577 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1578 if (stream == NULL) { in PHP_FUNCTION()
1581 wrapper = stream->wrapper; in PHP_FUNCTION()
1602 php_stream *stream; in PHP_FUNCTION() local
1609 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1611 if (!php_stream_supports_lock(stream)) { in PHP_FUNCTION()
1624 php_stream *stream; in PHP_FUNCTION() local
1631 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1633 if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) { in PHP_FUNCTION()
1634 php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void*)&fileno, 0); in PHP_FUNCTION()
1635 } else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) { in PHP_FUNCTION()
1636 php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0); in PHP_FUNCTION()
1663 php_stream *stream; in PHP_FUNCTION() local
1675 php_stream_from_zval(stream, zsrc); in PHP_FUNCTION()
1677 if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) { in PHP_FUNCTION()
1678 php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void*)&fileno, 0); in PHP_FUNCTION()
1680 else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) { in PHP_FUNCTION()
1681 php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0); in PHP_FUNCTION()
1729 php_stream *stream; in PHP_FUNCTION() local
1743 php_stream_from_zval(stream, zstream); in PHP_FUNCTION()
1745 RETURN_BOOL(php_stream_xport_shutdown(stream, (stream_shutdown_t)how) == 0); in PHP_FUNCTION()