#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)
-PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC);
-#define php_stream_free(stream, close_options) _php_stream_free((stream), (close_options) TSRMLS_CC)
-#define php_stream_close(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE TSRMLS_CC)
-#define php_stream_pclose(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE_PERSISTENT TSRMLS_CC)
+PHPAPI int _php_stream_free(php_stream *stream, int close_options);
+#define php_stream_free(stream, close_options) _php_stream_free((stream), (close_options))
+#define php_stream_close(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE)
+#define php_stream_pclose(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE_PERSISTENT)
-PHPAPI int _php_stream_seek(php_stream *stream, off_t offset, int whence TSRMLS_DC);
-#define php_stream_rewind(stream) _php_stream_seek((stream), 0L, SEEK_SET TSRMLS_CC)
-#define php_stream_seek(stream, offset, whence) _php_stream_seek((stream), (offset), (whence) TSRMLS_CC)
+PHPAPI int _php_stream_seek(php_stream *stream, zend_off_t offset, int whence);
+#define php_stream_rewind(stream) _php_stream_seek((stream), 0L, SEEK_SET)
+#define php_stream_seek(stream, offset, whence) _php_stream_seek((stream), (offset), (whence))
-PHPAPI off_t _php_stream_tell(php_stream *stream TSRMLS_DC);
-#define php_stream_tell(stream) _php_stream_tell((stream) TSRMLS_CC)
+PHPAPI zend_off_t _php_stream_tell(php_stream *stream);
+#define php_stream_tell(stream) _php_stream_tell((stream))
-PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC);
-#define php_stream_read(stream, buf, count) _php_stream_read((stream), (buf), (count) TSRMLS_CC)
+PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t count);
+#define php_stream_read(stream, buf, count) _php_stream_read((stream), (buf), (count))
-PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC);
-#define php_stream_write_string(stream, str) _php_stream_write(stream, str, strlen(str) TSRMLS_CC)
-#define php_stream_write(stream, buf, count) _php_stream_write(stream, (buf), (count) TSRMLS_CC)
+PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t count);
+#define php_stream_write_string(stream, str) _php_stream_write(stream, str, strlen(str))
+#define php_stream_write(stream, buf, count) _php_stream_write(stream, (buf), (count))
-PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_DC);
-#define php_stream_fill_read_buffer(stream, size) _php_stream_fill_read_buffer((stream), (size) TSRMLS_CC)
++PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size);
++#define php_stream_fill_read_buffer(stream, size) _php_stream_fill_read_buffer((stream), (size))
+
#ifdef ZTS
-PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
+PHPAPI size_t _php_stream_printf(php_stream *stream, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
#else
-PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
+PHPAPI size_t _php_stream_printf(php_stream *stream, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
#endif
-/* php_stream_printf macro & function require TSRMLS_CC */
+/* php_stream_printf macro & function require */
#define php_stream_printf _php_stream_printf
-PHPAPI int _php_stream_eof(php_stream *stream TSRMLS_DC);
-#define php_stream_eof(stream) _php_stream_eof((stream) TSRMLS_CC)
+PHPAPI int _php_stream_eof(php_stream *stream);
+#define php_stream_eof(stream) _php_stream_eof((stream))
-PHPAPI int _php_stream_getc(php_stream *stream TSRMLS_DC);
-#define php_stream_getc(stream) _php_stream_getc((stream) TSRMLS_CC)
+PHPAPI int _php_stream_getc(php_stream *stream);
+#define php_stream_getc(stream) _php_stream_getc((stream))
-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_putc(php_stream *stream, int c);
+#define php_stream_putc(stream, c) _php_stream_putc((stream), (c))
-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 int _php_stream_flush(php_stream *stream, int closing);
+#define php_stream_flush(stream) _php_stream_flush((stream), 0)
-PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, size_t *returned_len TSRMLS_DC);
-#define php_stream_gets(stream, buf, maxlen) _php_stream_get_line((stream), (buf), (maxlen), NULL TSRMLS_CC)
+PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, size_t *returned_len);
+#define php_stream_gets(stream, buf, maxlen) _php_stream_get_line((stream), (buf), (maxlen), NULL)
-#define php_stream_get_line(stream, buf, maxlen, retlen) _php_stream_get_line((stream), (buf), (maxlen), (retlen) TSRMLS_CC)
-PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *returned_len, const char *delim, size_t delim_len TSRMLS_DC);
+#define php_stream_get_line(stream, buf, maxlen, retlen) _php_stream_get_line((stream), (buf), (maxlen), (retlen))
+PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, const char *delim, size_t delim_len);
/* CAREFUL! this is equivalent to puts NOT fputs! */
-PHPAPI int _php_stream_puts(php_stream *stream, const char *buf TSRMLS_DC);
-#define php_stream_puts(stream, buf) _php_stream_puts((stream), (buf) TSRMLS_CC)
+PHPAPI int _php_stream_puts(php_stream *stream, const char *buf);
+#define php_stream_puts(stream, buf) _php_stream_puts((stream), (buf))
-PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC);
-#define php_stream_stat(stream, ssb) _php_stream_stat((stream), (ssb) TSRMLS_CC)
+PHPAPI int _php_stream_stat(php_stream *stream, php_stream_statbuf *ssb);
+#define php_stream_stat(stream, ssb) _php_stream_stat((stream), (ssb))
-PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC);
-#define php_stream_stat_path(path, ssb) _php_stream_stat_path((path), 0, (ssb), NULL TSRMLS_CC)
-#define php_stream_stat_path_ex(path, flags, ssb, context) _php_stream_stat_path((path), (flags), (ssb), (context) TSRMLS_CC)
+PHPAPI int _php_stream_stat_path(const char *path, int flags, php_stream_statbuf *ssb, php_stream_context *context);
+#define php_stream_stat_path(path, ssb) _php_stream_stat_path((path), 0, (ssb), NULL)
+#define php_stream_stat_path_ex(path, flags, ssb, context) _php_stream_stat_path((path), (flags), (ssb), (context))
-PHPAPI int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context TSRMLS_DC);
-#define php_stream_mkdir(path, mode, options, context) _php_stream_mkdir(path, mode, options, context TSRMLS_CC)
+PHPAPI int _php_stream_mkdir(const char *path, int mode, int options, php_stream_context *context);
+#define php_stream_mkdir(path, mode, options, context) _php_stream_mkdir(path, mode, options, context)
-PHPAPI int _php_stream_rmdir(const char *path, int options, php_stream_context *context TSRMLS_DC);
-#define php_stream_rmdir(path, options, context) _php_stream_rmdir(path, options, context TSRMLS_CC)
+PHPAPI int _php_stream_rmdir(const char *path, int options, php_stream_context *context);
+#define php_stream_rmdir(path, options, context) _php_stream_rmdir(path, options, context)
-PHPAPI php_stream *_php_stream_opendir(const char *path, int options, php_stream_context *context STREAMS_DC TSRMLS_DC);
-#define php_stream_opendir(path, options, context) _php_stream_opendir((path), (options), (context) STREAMS_CC TSRMLS_CC)
-PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent TSRMLS_DC);
-#define php_stream_readdir(dirstream, dirent) _php_stream_readdir((dirstream), (dirent) TSRMLS_CC)
+PHPAPI php_stream *_php_stream_opendir(const char *path, int options, php_stream_context *context STREAMS_DC);
+#define php_stream_opendir(path, options, context) _php_stream_opendir((path), (options), (context) STREAMS_CC)
+PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, php_stream_dirent *ent);
+#define php_stream_readdir(dirstream, dirent) _php_stream_readdir((dirstream), (dirent))
#define php_stream_closedir(dirstream) php_stream_close((dirstream))
#define php_stream_rewinddir(dirstream) php_stream_rewind((dirstream))