cvs: php4 /main php_memory_streams.h streams.c

From: Date: Sat, 23 Mar 2002 17:51:20 +0000
Subject: cvs: php4 /main php_memory_streams.h streams.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-10617@lists.php.net to get a copy of this message
helly Sat Mar 23 12:51:20 2002 EDT Modified files: /php4/main php_memory_streams.h streams.c Log: -defined php_stream_temp_new() for standard temp streams Index: php4/main/php_memory_streams.h diff -u php4/main/php_memory_streams.h:1.5 php4/main/php_memory_streams.h:1.6 --- php4/main/php_memory_streams.h:1.5 Mon Mar 18 13:54:32 2002 +++ php4/main/php_memory_streams.h Sat Mar 23 12:51:20 2002 @@ -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) @@ -37,9 +43,6 @@ 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; Index: php4/main/streams.c diff -u php4/main/streams.c:1.41 php4/main/streams.c:1.42 --- php4/main/streams.c:1.41 Thu Mar 21 17:35:02 2002 +++ php4/main/streams.c Sat Mar 23 12:51:20 2002 @@ -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 @@ 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;

« previous php.cvs (#10617) next »