mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
-defined php_stream_temp_new() for standard temp streams
This commit is contained in:
@@ -21,11 +21,17 @@
|
||||
|
||||
#include "php_streams.h"
|
||||
|
||||
#define PHP_STREAM_MAX_MEM 2 * 1024 * 1024
|
||||
|
||||
#define TEMP_STREAM_DEFAULT 0
|
||||
#define TEMP_STREAM_READONLY 1
|
||||
|
||||
#define php_stream_memory_create(mode) _php_stream_memory_create((mode) STREAMS_CC TSRMLS_CC)
|
||||
#define php_stream_memory_create_rel(mode) _php_stream_memory_create((mode) STREAMS_REL_CC TSRMLS_CC)
|
||||
#define php_stream_memory_open(mode, buf, length) _php_stream_memory_open((mode), (buf), (length) STREAMS_CC TSRMLS_CC)
|
||||
#define php_stream_memory_get_buffer(stream, length) _php_stream_memory_get_buffer((stream), (length) STREAMS_CC TSRMLS_CC)
|
||||
|
||||
#define php_stream_temp_new() php_stream_temp_create(TEMP_STREAM_DEFAULT, PHP_STREAM_MAX_MEM)
|
||||
#define php_stream_temp_create(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_CC TSRMLS_CC)
|
||||
#define php_stream_temp_create_rel(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_REL_CC TSRMLS_CC)
|
||||
#define php_stream_temp_open(mode, max_memory_usage, buf, length) _php_stream_temp_open((mode), (max_memory_usage), (buf), (length) STREAMS_CC TSRMLS_CC)
|
||||
@@ -38,9 +44,6 @@ PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length ST
|
||||
PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC TSRMLS_DC);
|
||||
PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC TSRMLS_DC);
|
||||
|
||||
#define TEMP_STREAM_DEFAULT 0
|
||||
#define TEMP_STREAM_READONLY 1
|
||||
|
||||
extern php_stream_ops php_stream_memory_ops;
|
||||
extern php_stream_ops php_stream_temp_ops;
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#endif
|
||||
|
||||
#define CHUNK_SIZE 8192
|
||||
#define PHP_STREAM_MAX_MEM 2 * 1024 * 1024
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
@@ -1161,7 +1160,7 @@ PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream **newstr
|
||||
if (flags & PHP_STREAM_PREFER_STDIO)
|
||||
*newstream = php_stream_fopen_tmpfile();
|
||||
else
|
||||
*newstream = php_stream_temp_create(TEMP_STREAM_DEFAULT, PHP_STREAM_MAX_MEM);
|
||||
*newstream = php_stream_temp_new();
|
||||
|
||||
if (*newstream == NULL)
|
||||
return PHP_STREAM_FAILED;
|
||||
|
||||
Reference in New Issue
Block a user