1999-07-16 21:13:16 +08:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2001-12-11 23:32:16 +08:00
|
|
|
| PHP Version 4 |
|
1999-07-16 21:13:16 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2001-12-11 23:32:16 +08:00
|
|
|
| Copyright (c) 1997-2002 The PHP Group |
|
1999-07-16 21:13:16 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2000-05-18 23:34:45 +08:00
|
|
|
| This source file is subject to version 2.02 of the PHP license, |
|
1999-07-16 21:13:16 +08:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
|
|
| available at through the world-wide-web at |
|
2000-05-18 23:34:45 +08:00
|
|
|
| http://www.php.net/license/2_02.txt. |
|
1999-07-16 21:13:16 +08:00
|
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@php.net so we can mail you a copy immediately. |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Authors: Zeev Suraski <zeev@zend.com> |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
2000-07-24 09:40:02 +08:00
|
|
|
/* $Id$ */
|
1999-07-16 21:13:16 +08:00
|
|
|
|
2000-07-03 08:41:19 +08:00
|
|
|
#ifndef PHP_OUTPUT_H
|
|
|
|
#define PHP_OUTPUT_H
|
1999-04-08 05:05:13 +08:00
|
|
|
|
2001-08-05 23:29:47 +08:00
|
|
|
typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC);
|
2001-03-06 23:54:49 +08:00
|
|
|
|
1999-12-02 06:59:45 +08:00
|
|
|
PHPAPI void php_output_startup(void);
|
2001-08-05 23:29:47 +08:00
|
|
|
PHPAPI void php_output_activate(TSRMLS_D);
|
|
|
|
PHPAPI void php_output_set_status(zend_bool status TSRMLS_DC);
|
|
|
|
void php_output_register_constants(TSRMLS_D);
|
2001-08-05 23:55:43 +08:00
|
|
|
PHPAPI int php_body_write(const char *str, uint str_length TSRMLS_DC);
|
|
|
|
PHPAPI int php_header_write(const char *str, uint str_length TSRMLS_DC);
|
2001-08-05 23:29:47 +08:00
|
|
|
PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size TSRMLS_DC);
|
|
|
|
PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS_DC);
|
|
|
|
PHPAPI void php_end_ob_buffers(zend_bool send_buffer TSRMLS_DC);
|
|
|
|
PHPAPI int php_ob_get_buffer(zval *p TSRMLS_DC);
|
|
|
|
PHPAPI int php_ob_get_length(zval *p TSRMLS_DC);
|
|
|
|
PHPAPI void php_start_implicit_flush(TSRMLS_D);
|
|
|
|
PHPAPI void php_end_implicit_flush(TSRMLS_D);
|
|
|
|
PHPAPI char *php_get_output_start_filename(TSRMLS_D);
|
|
|
|
PHPAPI int php_get_output_start_lineno(TSRMLS_D);
|
|
|
|
PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size TSRMLS_DC);
|
1999-04-08 05:05:13 +08:00
|
|
|
|
2000-03-07 04:37:11 +08:00
|
|
|
PHP_FUNCTION(ob_start);
|
2001-11-30 18:48:38 +08:00
|
|
|
PHP_FUNCTION(ob_flush);
|
|
|
|
PHP_FUNCTION(ob_clean);
|
2000-03-07 04:37:11 +08:00
|
|
|
PHP_FUNCTION(ob_end_flush);
|
|
|
|
PHP_FUNCTION(ob_end_clean);
|
|
|
|
PHP_FUNCTION(ob_get_contents);
|
2000-08-25 11:10:42 +08:00
|
|
|
PHP_FUNCTION(ob_get_length);
|
2001-12-03 15:43:53 +08:00
|
|
|
PHP_FUNCTION(ob_get_level);
|
2000-03-07 04:37:11 +08:00
|
|
|
PHP_FUNCTION(ob_implicit_flush);
|
|
|
|
|
2000-07-29 22:46:09 +08:00
|
|
|
typedef struct _php_ob_buffer {
|
|
|
|
char *buffer;
|
|
|
|
uint size;
|
|
|
|
uint text_length;
|
|
|
|
int block_size;
|
2001-02-27 08:09:14 +08:00
|
|
|
uint chunk_size;
|
2001-03-04 09:09:36 +08:00
|
|
|
int status;
|
2001-03-06 23:54:49 +08:00
|
|
|
zval *output_handler;
|
|
|
|
php_output_handler_func_t internal_output_handler;
|
|
|
|
char *internal_output_handler_buffer;
|
|
|
|
uint internal_output_handler_buffer_size;
|
2000-07-29 22:46:09 +08:00
|
|
|
} php_ob_buffer;
|
|
|
|
|
|
|
|
typedef struct _php_output_globals {
|
2001-08-05 23:29:47 +08:00
|
|
|
int (*php_body_write)(const char *str, uint str_length TSRMLS_DC); /* string output */
|
|
|
|
int (*php_header_write)(const char *str, uint str_length TSRMLS_DC); /* unbuffer string output */
|
2000-07-29 22:46:09 +08:00
|
|
|
php_ob_buffer active_ob_buffer;
|
2000-06-24 21:27:34 +08:00
|
|
|
unsigned char implicit_flush;
|
|
|
|
char *output_start_filename;
|
|
|
|
int output_start_lineno;
|
2000-07-29 22:46:09 +08:00
|
|
|
zend_stack ob_buffers;
|
2001-07-20 21:59:00 +08:00
|
|
|
int ob_nesting_level;
|
|
|
|
zend_bool ob_lock;
|
|
|
|
zend_bool disable_output;
|
2000-06-24 21:27:34 +08:00
|
|
|
} php_output_globals;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ZTS
|
2001-07-28 19:36:37 +08:00
|
|
|
#define OG(v) TSRMG(output_globals_id, php_output_globals *, v)
|
2000-06-24 21:27:34 +08:00
|
|
|
ZEND_API extern int output_globals_id;
|
|
|
|
#else
|
|
|
|
#define OG(v) (output_globals.v)
|
|
|
|
ZEND_API extern php_output_globals output_globals;
|
|
|
|
#endif
|
|
|
|
|
2001-03-04 09:09:36 +08:00
|
|
|
#define PHP_OUTPUT_HANDLER_START (1<<0)
|
|
|
|
#define PHP_OUTPUT_HANDLER_CONT (1<<1)
|
|
|
|
#define PHP_OUTPUT_HANDLER_END (1<<2)
|
2000-06-24 21:27:34 +08:00
|
|
|
|
2000-07-03 08:41:19 +08:00
|
|
|
#endif /* PHP_OUTPUT_H */
|