cvs: php4 /main php_streams.h
| From: | Sara Golemon | Date: | Thu, 17 Apr 2003 00:00:34 +0000 |
| Subject: | cvs: php4 /main php_streams.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20349@lists.php.net to get a copy of this message | ||
pollita Wed Apr 16 20:00:34 2003 EDT
Modified files:
/php4/main php_streams.h
Log:
Macro: php_stream_get_from_zval(php_stream *stream, zval **zstream, char *mode, int options, char
**opened_path, php_stream_context *context) Z_TYPE_PP(zstream) can be either IS_RESOURCE (An
already opened stream) or IS_STRING (a path to a stream to be opened)
Index: php4/main/php_streams.h
diff -u php4/main/php_streams.h:1.77 php4/main/php_streams.h:1.78
--- php4/main/php_streams.h:1.77 Tue Mar 18 18:37:54 2003
+++ php4/main/php_streams.h Wed Apr 16 20:00:34 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_streams.h,v 1.77 2003/03/18 23:37:54 wez Exp $ */
+/* $Id: php_streams.h,v 1.78 2003/04/17 00:00:34 pollita Exp $ */
#ifndef PHP_STREAMS_H
#define PHP_STREAMS_H
@@ -455,6 +455,12 @@
#define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper_ex((path),
(mode), (options), (opened), NULL STREAMS_CC TSRMLS_CC)
#define php_stream_open_wrapper_ex(path, mode, options, opened,
context) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), (context) STREAMS_CC
TSRMLS_CC)
+
+#define php_stream_get_from_zval(stream, zstream, mode, options, opened, context) \
+ if (Z_TYPE_PP((zstream)) == IS_RESOURCE) { \
+ php_stream_from_zval((stream), (zstream)); \
+ } else (stream) = Z_TYPE_PP((zstream)) == IS_STRING ? \
+ php_stream_open_wrapper_ex(Z_STRVAL_PP((zstream)), (mode), (options), (opened), (context)) :
NULL
/* pushes an error message onto the stack for a wrapper instance */
PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const
char *fmt, ...);