]> granicus.if.org Git - php/commitdiff
restore API compatibility
authorMichael Wallner <mike@php.net>
Wed, 2 Jul 2014 13:41:59 +0000 (15:41 +0200)
committerMichael Wallner <mike@php.net>
Thu, 3 Jul 2014 18:40:41 +0000 (20:40 +0200)
main/php_memory_streams.h
main/streams/memory.c
main/streams/php_stream_plain_wrapper.h
main/streams/plain_wrapper.c

index 689d9f280a8f6f30b59b4ac600d8926474d11f81..229ed1902e50857359b798a5d375262ac0c3986d 100644 (file)
@@ -35,9 +35,9 @@
 #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_ex((mode), (max_memory_usage), NULL)
+#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_ex(mode, max_memory_usage, tmpdir) _php_stream_temp_create_ex((mode), (max_memory_usage), (tmpdir) STREAMS_CC TSRMLS_CC)
-#define php_stream_temp_create_rel(mode, max_memory_usage) _php_stream_temp_create_ex((mode), (max_memory_usage), NULL STREAMS_REL_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)
 
 BEGIN_EXTERN_C()
@@ -45,6 +45,7 @@ PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC TSRMLS_DC);
 PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length STREAMS_DC TSRMLS_DC);
 PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC TSRMLS_DC);
 
+PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC TSRMLS_DC);
 PHPAPI php_stream *_php_stream_temp_create_ex(int mode, size_t max_memory_usage, const char *tmpdir 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);
 END_EXTERN_C()
index 1f6bfbde04d7343d26613f13de93b413d0705a4b..09421ea49de5ab4b03162c137c46df02020207fa 100644 (file)
@@ -357,7 +357,6 @@ typedef struct {
 
 
 /* {{{ */
-
 static size_t php_stream_temp_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
 {
        php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
@@ -574,6 +573,12 @@ PHPAPI php_stream *_php_stream_temp_create_ex(int mode, size_t max_memory_usage,
 }
 /* }}} */
 
+/* {{{ _php_stream_temp_create */
+PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC TSRMLS_DC)
+{
+       return php_stream_temp_create_ex(mode, max_memory_usage, NULL);
+}
+/* }}} */
 
 /* {{{ _php_stream_temp_open */
 PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC TSRMLS_DC)
index d185e7487127275a920a1da33ab89ffba58a59a9..4370867995cbaa29c28c3a8e94d10d3ba3684c5d 100644 (file)
@@ -42,9 +42,11 @@ PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const cha
 PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STREAMS_DC TSRMLS_DC);
 #define php_stream_fopen_from_pipe(file, mode) _php_stream_fopen_from_pipe((file), (mode) STREAMS_CC TSRMLS_CC)
 
+PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC TSRMLS_DC);
+#define php_stream_fopen_tmpfile()     _php_stream_fopen_tmpfile(0 STREAMS_CC TSRMLS_CC)
+
 PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char *pfx, char **opened_path STREAMS_DC TSRMLS_DC);
 #define php_stream_fopen_temporary_file(dir, pfx, opened_path) _php_stream_fopen_temporary_file((dir), (pfx), (opened_path) STREAMS_CC TSRMLS_CC)
-#define php_stream_fopen_tmpfile() _php_stream_fopen_temporary_file(NULL, "php", NULL STREAMS_CC TSRMLS_CC)
 
 /* This is a utility API for extensions that are opening a stream, converting it
  * to a FILE* and then closing it again.  Be warned that fileno() on the result
index d7d25f2c8523feb031a5156c1b13584d4686ac9c..87312b9ef825aa056123dc08ca23ec54aa4c6a2e 100644 (file)
@@ -216,6 +216,11 @@ PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char
        return NULL;
 }
 
+PHPAPI php_stream *_php_stream_fopen_tmpfile(int dummy STREAMS_DC TSRMLS_DC)
+{
+       return php_stream_fopen_temporary_file(NULL, "php", NULL);
+}
+
 PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const char *persistent_id STREAMS_DC TSRMLS_DC)
 {
        php_stream *stream = php_stream_fopen_from_fd_int_rel(fd, mode, persistent_id);