1999-07-16 21:13:16 +08:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| PHP version 4.0 |
|
|
|
|
+----------------------------------------------------------------------+
|
2000-01-01 09:32:05 +08:00
|
|
|
| Copyright (c) 1997, 1998, 1999, 2000 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
|
|
|
|
|
|
|
#include "php.h"
|
|
|
|
|
1999-12-02 06:59:45 +08:00
|
|
|
PHPAPI void php_output_startup(void);
|
1999-10-28 02:30:41 +08:00
|
|
|
PHPAPI int php_body_write(const char *str, uint str_length);
|
|
|
|
PHPAPI int php_header_write(const char *str, uint str_length);
|
2000-11-24 02:43:18 +08:00
|
|
|
PHPAPI int php_start_ob_buffer(zval *output_handler, int chunk_size);
|
2000-07-29 22:46:09 +08:00
|
|
|
PHPAPI void php_end_ob_buffer(int send_buffer);
|
|
|
|
PHPAPI void php_end_ob_buffers(int send_buffer);
|
2000-01-14 01:37:25 +08:00
|
|
|
PHPAPI int php_ob_get_buffer(pval *p);
|
2000-08-25 11:10:42 +08:00
|
|
|
PHPAPI int php_ob_get_length(pval *p);
|
2000-03-19 18:56:40 +08:00
|
|
|
PHPAPI void php_start_implicit_flush(void);
|
|
|
|
PHPAPI void php_end_implicit_flush(void);
|
|
|
|
PHPAPI char *php_get_output_start_filename(void);
|
|
|
|
PHPAPI int php_get_output_start_lineno(void);
|
1999-04-08 05:05:13 +08:00
|
|
|
|
2000-03-07 04:37:11 +08:00
|
|
|
PHP_FUNCTION(ob_start);
|
|
|
|
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);
|
2000-03-07 04:37:11 +08:00
|
|
|
PHP_FUNCTION(ob_implicit_flush);
|
|
|
|
|
|
|
|
PHP_GINIT_FUNCTION(output);
|
1999-04-08 05:05:13 +08:00
|
|
|
|
2000-07-29 22:46:09 +08:00
|
|
|
typedef struct _php_ob_buffer {
|
|
|
|
char *buffer;
|
|
|
|
uint size;
|
|
|
|
uint text_length;
|
|
|
|
int block_size;
|
2000-09-03 02:03:58 +08:00
|
|
|
zval *output_handler;
|
2000-11-24 02:43:18 +08:00
|
|
|
int chunk_size;
|
2000-07-29 22:46:09 +08:00
|
|
|
} php_ob_buffer;
|
|
|
|
|
|
|
|
typedef struct _php_output_globals {
|
2000-06-24 21:27:34 +08:00
|
|
|
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 */
|
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;
|
|
|
|
int nesting_level;
|
2000-09-03 02:03:58 +08:00
|
|
|
zend_bool lock;
|
2000-06-24 21:27:34 +08:00
|
|
|
} php_output_globals;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ZTS
|
|
|
|
#define OLS_D php_output_globals *output_globals
|
|
|
|
#define OLS_C output_globals
|
|
|
|
#define OG(v) (output_globals->v)
|
|
|
|
#define OLS_FETCH() php_output_globals *output_globals = ts_resource(output_globals_id)
|
|
|
|
ZEND_API extern int output_globals_id;
|
|
|
|
#else
|
|
|
|
#define OLS_D void
|
|
|
|
#define OLS_C
|
|
|
|
#define OG(v) (output_globals.v)
|
|
|
|
#define OLS_FETCH()
|
|
|
|
ZEND_API extern php_output_globals output_globals;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2000-07-03 08:41:19 +08:00
|
|
|
#endif /* PHP_OUTPUT_H */
|