diff options
author | Zeev Suraski <zeev@php.net> | 2000-07-29 14:46:09 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2000-07-29 14:46:09 +0000 |
commit | 52ff887db511cd393b04468e2b0a4b77859f5bd5 (patch) | |
tree | ea043e7551c9262b3ee22ee295d6b9b1e3f0808d /main/php_output.h | |
parent | d8a4278ab498ae49f342f246b6a1634d4809143b (diff) | |
download | php-git-52ff887db511cd393b04468e2b0a4b77859f5bd5.tar.gz |
Made ob_start() and friends reentrant. It's now possible to implement this
long-requested functionality, now that output buffering is re-entrant:
function eval_ret($code)
{
ob_start();
eval($code);
$retval = ob_get_contents();
ob_end_clean();
return $retval;
}
Diffstat (limited to 'main/php_output.h')
-rw-r--r-- | main/php_output.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/main/php_output.h b/main/php_output.h index 022715a056..966d6dbe35 100644 --- a/main/php_output.h +++ b/main/php_output.h @@ -26,8 +26,9 @@ PHPAPI void php_output_startup(void); PHPAPI int php_body_write(const char *str, uint str_length); PHPAPI int php_header_write(const char *str, uint str_length); -PHPAPI void php_start_ob_buffering(void); -PHPAPI void php_end_ob_buffering(int send_buffer); +PHPAPI void php_start_ob_buffer(void); +PHPAPI void php_end_ob_buffer(int send_buffer); +PHPAPI void php_end_ob_buffers(int send_buffer); PHPAPI int php_ob_get_buffer(pval *p); PHPAPI void php_start_implicit_flush(void); PHPAPI void php_end_implicit_flush(void); @@ -42,16 +43,22 @@ PHP_FUNCTION(ob_implicit_flush); PHP_GINIT_FUNCTION(output); -typedef struct { +typedef struct _php_ob_buffer { + char *buffer; + uint size; + uint text_length; + int block_size; +} php_ob_buffer; + +typedef struct _php_output_globals { int (*php_body_write)(const char *str, uint str_length); /* string output */ int (*php_header_write)(const char *str, uint str_length); /* unbuffer string output */ - char *ob_buffer; - uint ob_size; - uint ob_block_size; - uint ob_text_length; + php_ob_buffer active_ob_buffer; unsigned char implicit_flush; char *output_start_filename; int output_start_lineno; + zend_stack ob_buffers; + int nesting_level; } php_output_globals; |