From c7be7b55d1c2f9a1765daf470195a6be647f96ee Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 25 Aug 2002 10:26:58 +0000 Subject: Add a "closing" parameter for filters to determine if a flush is the last flush before the stream is closed. This allows filters to finish a chunk and write footers etc. --- main/php_streams.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index 94bc0c363a..9745105d65 100755 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -182,7 +182,7 @@ typedef struct _php_stream_filter_ops { const char *buf, size_t count TSRMLS_DC); size_t (*read)(php_stream *stream, php_stream_filter *thisfilter, char *buf, size_t count TSRMLS_DC); - int (*flush)(php_stream *stream, php_stream_filter *thisfilter TSRMLS_DC); + int (*flush)(php_stream *stream, php_stream_filter *thisfilter, int closing TSRMLS_DC); int (*eof)(php_stream *stream, php_stream_filter *thisfilter TSRMLS_DC); void (*dtor)(php_stream_filter *thisfilter TSRMLS_DC); const char *label; @@ -205,8 +205,8 @@ struct _php_stream_filter { (thisfilter)->next ? (thisfilter)->next->fops->read((stream), (thisfilter)->next, (buf), (size) TSRMLS_CC) \ : (stream)->ops->read((stream), (buf), (size) TSRMLS_CC) -#define php_stream_filter_flush_next(stream, thisfilter) \ - (thisfilter)->next ? (thisfilter)->next->fops->flush((stream), (thisfilter) TSRMLS_CC) \ +#define php_stream_filter_flush_next(stream, thisfilter, closing) \ + (thisfilter)->next ? (thisfilter)->next->fops->flush((stream), (thisfilter), (closing) TSRMLS_CC) \ : (stream)->ops->flush((stream) TSRMLS_CC) #define php_stream_filter_eof_next(stream, thisfilter) \ @@ -321,8 +321,8 @@ PHPAPI int _php_stream_getc(php_stream *stream TSRMLS_DC); PHPAPI int _php_stream_putc(php_stream *stream, int c TSRMLS_DC); #define php_stream_putc(stream, c) _php_stream_putc((stream), (c) TSRMLS_CC) -PHPAPI int _php_stream_flush(php_stream *stream TSRMLS_DC); -#define php_stream_flush(stream) _php_stream_flush((stream) TSRMLS_CC) +PHPAPI int _php_stream_flush(php_stream *stream, int closing TSRMLS_DC); +#define php_stream_flush(stream) _php_stream_flush((stream), 0 TSRMLS_CC) PHPAPI char *_php_stream_gets(php_stream *stream, char *buf, size_t maxlen TSRMLS_DC); #define php_stream_gets(stream, buf, maxlen) _php_stream_gets((stream), (buf), (maxlen) TSRMLS_CC) -- cgit v1.2.1