diff options
author | Gustavo André dos Santos Lopes <cataphract@php.net> | 2010-11-15 03:05:32 +0000 |
---|---|---|
committer | Gustavo André dos Santos Lopes <cataphract@php.net> | 2010-11-15 03:05:32 +0000 |
commit | 3a02cfb675da68e81c40226135ac4121e72f1378 (patch) | |
tree | 5b12179631cac1861db37b75fd3ff75e00671661 /main/php_streams.h | |
parent | 24636a7e1c54015d916fff82b2c55074f74238fc (diff) | |
download | php-git-3a02cfb675da68e81c40226135ac4121e72f1378.tar.gz |
- Added leak_variable() function.
- Added mechanism to force outer streams to be closed before their inner ones.
- Fixed temp:// streams only handling correctly (through an ad hoc mechanism) reverse closing order
when the inner stream is of type memory.
Diffstat (limited to 'main/php_streams.h')
-rwxr-xr-x | main/php_streams.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/main/php_streams.h b/main/php_streams.h index 99a75473f4..87da9bc95a 100755 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -225,9 +225,11 @@ struct _php_stream { int eof; #if ZEND_DEBUG - char *open_filename; + const char *open_filename; uint open_lineno; #endif + + struct _php_stream *enclosing_stream; /* this is a private stream owned by enclosing_stream */ }; /* php_stream */ /* state definitions when closing down; these are private to streams.c */ @@ -259,6 +261,10 @@ END_EXTERN_C() #define php_stream_from_zval_no_verify(xstr, ppzval) (xstr) = (php_stream*)zend_fetch_resource((ppzval) TSRMLS_CC, -1, "stream", NULL, 2, php_file_le_stream(), php_file_le_pstream()) BEGIN_EXTERN_C() +PHPAPI php_stream *php_stream_encloses(php_stream *enclosing, php_stream *enclosed); +#define php_stream_free_enclosed(stream_enclosed, close_options) _php_stream_free_enclosed((stream_enclosed), (close_options) TSRMLS_CC) +PHPAPI int _php_stream_free_enclosed(php_stream *stream_enclosed, int close_options TSRMLS_DC); + PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream **stream TSRMLS_DC); #define PHP_STREAM_PERSISTENT_SUCCESS 0 /* id exists */ #define PHP_STREAM_PERSISTENT_FAILURE 1 /* id exists but is not a stream! */ @@ -269,6 +275,7 @@ PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream * #define PHP_STREAM_FREE_PRESERVE_HANDLE 4 /* tell ops->close to not close it's underlying handle */ #define PHP_STREAM_FREE_RSRC_DTOR 8 /* called from the resource list dtor */ #define PHP_STREAM_FREE_PERSISTENT 16 /* manually freeing a persistent connection */ +#define PHP_STREAM_FREE_IGNORE_ENCLOSING 32 /* don't close the enclosing stream instead */ #define PHP_STREAM_FREE_CLOSE (PHP_STREAM_FREE_CALL_DTOR | PHP_STREAM_FREE_RELEASE_STREAM) #define PHP_STREAM_FREE_CLOSE_CASTED (PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_PRESERVE_HANDLE) #define PHP_STREAM_FREE_CLOSE_PERSISTENT (PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_PERSISTENT) |