php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
php_output.h File Reference

Go to the source code of this file.

Data Structures

struct  _php_output_buffer
 
struct  _php_output_context
 
struct  _php_output_handler_user_func_t
 
struct  _php_output_handler
 

Macros

#define PHP_OUTPUT_NEWAPI   1
 
#define PHP_OUTPUT_HANDLER_WRITE   0x00 /* standard passthru */
 
#define PHP_OUTPUT_HANDLER_START   0x01 /* start */
 
#define PHP_OUTPUT_HANDLER_CLEAN   0x02 /* restart */
 
#define PHP_OUTPUT_HANDLER_FLUSH   0x04 /* pass along as much as possible */
 
#define PHP_OUTPUT_HANDLER_FINAL   0x08 /* finalize */
 
#define PHP_OUTPUT_HANDLER_CONT   PHP_OUTPUT_HANDLER_WRITE
 
#define PHP_OUTPUT_HANDLER_END   PHP_OUTPUT_HANDLER_FINAL
 
#define PHP_OUTPUT_HANDLER_INTERNAL   0x0000
 
#define PHP_OUTPUT_HANDLER_USER   0x0001
 
#define PHP_OUTPUT_HANDLER_CLEANABLE   0x0010
 
#define PHP_OUTPUT_HANDLER_FLUSHABLE   0x0020
 
#define PHP_OUTPUT_HANDLER_REMOVABLE   0x0040
 
#define PHP_OUTPUT_HANDLER_STDFLAGS   0x0070
 
#define PHP_OUTPUT_HANDLER_STARTED   0x1000
 
#define PHP_OUTPUT_HANDLER_DISABLED   0x2000
 
#define PHP_OUTPUT_HANDLER_PROCESSED   0x4000
 
#define PHP_OUTPUT_HANDLER_ABILITY_FLAGS(bitmask)
 
#define PHP_OUTPUT_POP_TRY   0x000
 
#define PHP_OUTPUT_POP_FORCE   0x001
 
#define PHP_OUTPUT_POP_DISCARD   0x010
 
#define PHP_OUTPUT_POP_SILENT   0x100
 
#define PHP_OUTPUT_IMPLICITFLUSH   0x01
 
#define PHP_OUTPUT_DISABLED   0x02
 
#define PHP_OUTPUT_WRITTEN   0x04
 
#define PHP_OUTPUT_SENT   0x08
 
#define PHP_OUTPUT_ACTIVE   0x10
 
#define PHP_OUTPUT_LOCKED   0x20
 
#define PHP_OUTPUT_ACTIVATED   0x100000
 
#define PHP_OUTPUT_HANDLER_INITBUF_SIZE(s)
 
#define PHP_OUTPUT_HANDLER_ALIGNTO_SIZE   0x1000
 
#define PHP_OUTPUT_HANDLER_DEFAULT_SIZE   0x4000
 
#define OG(v)
 
#define PHPWRITE(str, str_len)
 
#define PHPWRITE_H(str, str_len)
 
#define PUTC(c)
 
#define PUTC_H(c)
 
#define PUTS(str)
 
#define PUTS_H(str)
 
#define php_output_tearup()
 
#define php_output_teardown()
 

Typedefs

typedef enum _php_output_handler_status_t php_output_handler_status_t
 
typedef enum _php_output_handler_hook_t php_output_handler_hook_t
 
typedef struct _php_output_buffer php_output_buffer
 
typedef struct _php_output_context php_output_context
 
typedef void(* php_output_handler_func_t) (char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode)
 
typedef zend_result(* php_output_handler_context_func_t) (void **handler_context, php_output_context *output_context)
 
typedef void(* php_output_handler_context_dtor_t) (void *opaq)
 
typedef zend_result(* php_output_handler_conflict_check_t) (const char *handler_name, size_t handler_name_len)
 
typedef struct _php_output_handler *(* php_output_handler_alias_ctor_t) (const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags)
 
typedef struct _php_output_handler_user_func_t php_output_handler_user_func_t
 
typedef struct _php_output_handler php_output_handler
 

Enumerations

enum  _php_output_handler_status_t { PHP_OUTPUT_HANDLER_FAILURE , PHP_OUTPUT_HANDLER_SUCCESS , PHP_OUTPUT_HANDLER_NO_DATA }
 
enum  _php_output_handler_hook_t {
  PHP_OUTPUT_HANDLER_HOOK_GET_OPAQ , PHP_OUTPUT_HANDLER_HOOK_GET_FLAGS , PHP_OUTPUT_HANDLER_HOOK_GET_LEVEL , PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE ,
  PHP_OUTPUT_HANDLER_HOOK_DISABLE , PHP_OUTPUT_HANDLER_HOOK_LAST
}
 

Functions

PHPAPI ZEND_EXTERN_MODULE_GLOBALS (output) extern const char php_output_default_handler_name[sizeof("default output handler")]
 
PHPAPI void php_output_startup (void)
 
PHPAPI void php_output_shutdown (void)
 
PHPAPI int php_output_activate (void)
 
PHPAPI void php_output_deactivate (void)
 
PHPAPI void php_output_set_status (int status)
 
PHPAPI int php_output_get_status (void)
 
PHPAPI void php_output_set_implicit_flush (int flush)
 
PHPAPI const char * php_output_get_start_filename (void)
 
PHPAPI int php_output_get_start_lineno (void)
 
PHPAPI size_t php_output_write_unbuffered (const char *str, size_t len)
 
PHPAPI size_t php_output_write (const char *str, size_t len)
 
PHPAPI zend_result php_output_flush (void)
 
PHPAPI void php_output_flush_all (void)
 
PHPAPI zend_result php_output_clean (void)
 
PHPAPI void php_output_clean_all (void)
 
PHPAPI zend_result php_output_end (void)
 
PHPAPI void php_output_end_all (void)
 
PHPAPI zend_result php_output_discard (void)
 
PHPAPI void php_output_discard_all (void)
 
PHPAPI zend_result php_output_get_contents (zval *p)
 
PHPAPI zend_result php_output_get_length (zval *p)
 
PHPAPI int php_output_get_level (void)
 
PHPAPI php_output_handlerphp_output_get_active_handler (void)
 
PHPAPI zend_result php_output_start_default (void)
 
PHPAPI zend_result php_output_start_devnull (void)
 
PHPAPI zend_result php_output_start_user (zval *output_handler, size_t chunk_size, int flags)
 
PHPAPI zend_result php_output_start_internal (const char *name, size_t name_len, php_output_handler_func_t output_handler, size_t chunk_size, int flags)
 
PHPAPI php_output_handlerphp_output_handler_create_user (zval *handler, size_t chunk_size, int flags)
 
PHPAPI php_output_handlerphp_output_handler_create_internal (const char *name, size_t name_len, php_output_handler_context_func_t handler, size_t chunk_size, int flags)
 
PHPAPI void php_output_handler_set_context (php_output_handler *handler, void *opaq, void(*dtor)(void *))
 
PHPAPI zend_result php_output_handler_start (php_output_handler *handler)
 
PHPAPI bool php_output_handler_started (const char *name, size_t name_len)
 
PHPAPI zend_result php_output_handler_hook (php_output_handler_hook_t type, void *arg)
 
PHPAPI void php_output_handler_dtor (php_output_handler *handler)
 
PHPAPI void php_output_handler_free (php_output_handler **handler)
 
PHPAPI bool php_output_handler_conflict (const char *handler_new, size_t handler_new_len, const char *handler_set, size_t handler_set_len)
 
PHPAPI zend_result php_output_handler_conflict_register (const char *handler_name, size_t handler_name_len, php_output_handler_conflict_check_t check_func)
 
PHPAPI zend_result php_output_handler_reverse_conflict_register (const char *handler_name, size_t handler_name_len, php_output_handler_conflict_check_t check_func)
 
PHPAPI php_output_handler_alias_ctor_t php_output_handler_alias (const char *handler_name, size_t handler_name_len)
 
PHPAPI zend_result php_output_handler_alias_register (const char *handler_name, size_t handler_name_len, php_output_handler_alias_ctor_t func)
 

Variables

zend_stack handlers
 
php_output_handleractive
 
php_output_handlerrunning
 
zend_stringoutput_start_filename
 
int output_start_lineno
 
int flags
 
const char php_output_devnull_handler_name [sizeof("null output handler")]
 

Macro Definition Documentation

◆ OG

#define OG ( v)
Value:
(output_globals.v)

◆ PHP_OUTPUT_ACTIVATED

#define PHP_OUTPUT_ACTIVATED   0x100000

Definition at line 70 of file php_output.h.

◆ PHP_OUTPUT_ACTIVE

#define PHP_OUTPUT_ACTIVE   0x10

Definition at line 67 of file php_output.h.

◆ PHP_OUTPUT_DISABLED

#define PHP_OUTPUT_DISABLED   0x02

Definition at line 63 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_ABILITY_FLAGS

#define PHP_OUTPUT_HANDLER_ABILITY_FLAGS ( bitmask)
Value:
((bitmask) & ~0xf00f)
#define bitmask(b)
Definition minilua.c:563

Definition at line 46 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_ALIGNTO_SIZE

#define PHP_OUTPUT_HANDLER_ALIGNTO_SIZE   0x1000

Definition at line 88 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_CLEAN

#define PHP_OUTPUT_HANDLER_CLEAN   0x02 /* restart */

Definition at line 25 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_CLEANABLE

#define PHP_OUTPUT_HANDLER_CLEANABLE   0x0010

Definition at line 36 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_CONT

#define PHP_OUTPUT_HANDLER_CONT   PHP_OUTPUT_HANDLER_WRITE

Definition at line 28 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_DEFAULT_SIZE

#define PHP_OUTPUT_HANDLER_DEFAULT_SIZE   0x4000

Definition at line 89 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_DISABLED

#define PHP_OUTPUT_HANDLER_DISABLED   0x2000

Definition at line 43 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_END

#define PHP_OUTPUT_HANDLER_END   PHP_OUTPUT_HANDLER_FINAL

Definition at line 29 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_FINAL

#define PHP_OUTPUT_HANDLER_FINAL   0x08 /* finalize */

Definition at line 27 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_FLUSH

#define PHP_OUTPUT_HANDLER_FLUSH   0x04 /* pass along as much as possible */

Definition at line 26 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_FLUSHABLE

#define PHP_OUTPUT_HANDLER_FLUSHABLE   0x0020

Definition at line 37 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_INITBUF_SIZE

#define PHP_OUTPUT_HANDLER_INITBUF_SIZE ( s)
Value:
( ((s) > 1) ? \
)
char s[4]
Definition cdf.c:77
#define PHP_OUTPUT_HANDLER_ALIGNTO_SIZE
Definition php_output.h:88
#define PHP_OUTPUT_HANDLER_DEFAULT_SIZE
Definition php_output.h:89

Definition at line 83 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_INTERNAL

#define PHP_OUTPUT_HANDLER_INTERNAL   0x0000

Definition at line 32 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_PROCESSED

#define PHP_OUTPUT_HANDLER_PROCESSED   0x4000

Definition at line 44 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_REMOVABLE

#define PHP_OUTPUT_HANDLER_REMOVABLE   0x0040

Definition at line 38 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_START

#define PHP_OUTPUT_HANDLER_START   0x01 /* start */

Definition at line 24 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_STARTED

#define PHP_OUTPUT_HANDLER_STARTED   0x1000

Definition at line 42 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_STDFLAGS

#define PHP_OUTPUT_HANDLER_STDFLAGS   0x0070

Definition at line 39 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_USER

#define PHP_OUTPUT_HANDLER_USER   0x0001

Definition at line 33 of file php_output.h.

◆ PHP_OUTPUT_HANDLER_WRITE

#define PHP_OUTPUT_HANDLER_WRITE   0x00 /* standard passthru */

Definition at line 23 of file php_output.h.

◆ PHP_OUTPUT_IMPLICITFLUSH

#define PHP_OUTPUT_IMPLICITFLUSH   0x01

Definition at line 62 of file php_output.h.

◆ PHP_OUTPUT_LOCKED

#define PHP_OUTPUT_LOCKED   0x20

Definition at line 68 of file php_output.h.

◆ PHP_OUTPUT_NEWAPI

#define PHP_OUTPUT_NEWAPI   1

Definition at line 20 of file php_output.h.

◆ PHP_OUTPUT_POP_DISCARD

#define PHP_OUTPUT_POP_DISCARD   0x010

Definition at line 58 of file php_output.h.

◆ PHP_OUTPUT_POP_FORCE

#define PHP_OUTPUT_POP_FORCE   0x001

Definition at line 57 of file php_output.h.

◆ PHP_OUTPUT_POP_SILENT

#define PHP_OUTPUT_POP_SILENT   0x100

Definition at line 59 of file php_output.h.

◆ PHP_OUTPUT_POP_TRY

#define PHP_OUTPUT_POP_TRY   0x000

Definition at line 56 of file php_output.h.

◆ PHP_OUTPUT_SENT

#define PHP_OUTPUT_SENT   0x08

Definition at line 65 of file php_output.h.

◆ php_output_teardown

#define php_output_teardown ( )
Value:
php_output_deactivate(); \
php_output_shutdown()
PHPAPI void php_output_end_all(void)
Definition output.c:322

Definition at line 181 of file php_output.h.

◆ php_output_tearup

#define php_output_tearup ( )
Value:
php_output_activate()
PHPAPI void php_output_startup(void)
Definition output.c:136

Definition at line 178 of file php_output.h.

◆ PHP_OUTPUT_WRITTEN

#define PHP_OUTPUT_WRITTEN   0x04

Definition at line 64 of file php_output.h.

◆ PHPWRITE

#define PHPWRITE ( str,
str_len )
Value:
php_output_write((str), (str_len))
PHPAPI size_t php_output_write(const char *str, size_t len)
Definition output.c:237

◆ PHPWRITE_H

#define PHPWRITE_H ( str,
str_len )
Value:
php_output_write_unbuffered((str), (str_len))
PHPAPI size_t php_output_write_unbuffered(const char *str, size_t len)
Definition output.c:226

◆ PUTC

#define PUTC ( c)
Value:
php_output_write((const char *) &(c), 1)

◆ PUTC_H

#define PUTC_H ( c)
Value:
php_output_write_unbuffered((const char *) &(c), 1)

◆ PUTS

#define PUTS ( str)
Value:
do { \
const char *__str = (str); \
php_output_write(__str, strlen(__str)); \
} while (0)
strlen(string $string)

◆ PUTS_H

#define PUTS_H ( str)
Value:
do { \
const char *__str = (str); \
php_output_write_unbuffered(__str, strlen(__str)); \
} while (0)

Typedef Documentation

◆ php_output_buffer

◆ php_output_context

◆ php_output_handler

◆ php_output_handler_alias_ctor_t

typedef struct _php_output_handler *(* php_output_handler_alias_ctor_t) (const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags)

Definition at line 112 of file php_output.h.

◆ php_output_handler_conflict_check_t

typedef zend_result(* php_output_handler_conflict_check_t) (const char *handler_name, size_t handler_name_len)

Definition at line 112 of file php_output.h.

◆ php_output_handler_context_dtor_t

typedef void(* php_output_handler_context_dtor_t) (void *opaq)

Definition at line 110 of file php_output.h.

◆ php_output_handler_context_func_t

typedef zend_result(* php_output_handler_context_func_t) (void **handler_context, php_output_context *output_context)

Definition at line 108 of file php_output.h.

◆ php_output_handler_func_t

typedef void(* php_output_handler_func_t) (char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode)

Definition at line 106 of file php_output.h.

◆ php_output_handler_hook_t

◆ php_output_handler_status_t

◆ php_output_handler_user_func_t

Enumeration Type Documentation

◆ _php_output_handler_hook_t

Enumerator
PHP_OUTPUT_HANDLER_HOOK_GET_OPAQ 
PHP_OUTPUT_HANDLER_HOOK_GET_FLAGS 
PHP_OUTPUT_HANDLER_HOOK_GET_LEVEL 
PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE 
PHP_OUTPUT_HANDLER_HOOK_DISABLE 
PHP_OUTPUT_HANDLER_HOOK_LAST 

Definition at line 73 of file php_output.h.

◆ _php_output_handler_status_t

Enumerator
PHP_OUTPUT_HANDLER_FAILURE 
PHP_OUTPUT_HANDLER_SUCCESS 
PHP_OUTPUT_HANDLER_NO_DATA 

Definition at line 49 of file php_output.h.

Function Documentation

◆ php_output_activate()

PHPAPI int php_output_activate ( void )

Definition at line 159 of file output.c.

◆ php_output_clean()

PHPAPI zend_result php_output_clean ( void )

Definition at line 283 of file output.c.

◆ php_output_clean_all()

PHPAPI void php_output_clean_all ( void )

Definition at line 299 of file output.c.

◆ php_output_deactivate()

PHPAPI void php_output_deactivate ( void )

Definition at line 176 of file output.c.

◆ php_output_discard()

PHPAPI zend_result php_output_discard ( void )

Definition at line 330 of file output.c.

◆ php_output_discard_all()

PHPAPI void php_output_discard_all ( void )

Definition at line 341 of file output.c.

◆ php_output_end()

PHPAPI zend_result php_output_end ( void )

Definition at line 311 of file output.c.

◆ php_output_end_all()

PHPAPI void php_output_end_all ( void )

Definition at line 322 of file output.c.

◆ php_output_flush()

PHPAPI zend_result php_output_flush ( void )

Definition at line 252 of file output.c.

◆ php_output_flush_all()

PHPAPI void php_output_flush_all ( void )

Definition at line 273 of file output.c.

◆ php_output_get_active_handler()

PHPAPI php_output_handler * php_output_get_active_handler ( void )

Definition at line 390 of file output.c.

◆ php_output_get_contents()

PHPAPI zend_result php_output_get_contents ( zval * p)

Definition at line 359 of file output.c.

◆ php_output_get_length()

PHPAPI zend_result php_output_get_length ( zval * p)

Definition at line 376 of file output.c.

◆ php_output_get_level()

PHPAPI int php_output_get_level ( void )

Definition at line 351 of file output.c.

◆ php_output_get_start_filename()

PHPAPI const char * php_output_get_start_filename ( void )

Definition at line 743 of file output.c.

◆ php_output_get_start_lineno()

PHPAPI int php_output_get_start_lineno ( void )

Definition at line 751 of file output.c.

◆ php_output_get_status()

PHPAPI int php_output_get_status ( void )

Definition at line 214 of file output.c.

◆ php_output_handler_alias()

PHPAPI php_output_handler_alias_ctor_t php_output_handler_alias ( const char * handler_name,
size_t handler_name_len )

Definition at line 644 of file output.c.

◆ php_output_handler_alias_register()

PHPAPI zend_result php_output_handler_alias_register ( const char * handler_name,
size_t handler_name_len,
php_output_handler_alias_ctor_t func )

Definition at line 652 of file output.c.

◆ php_output_handler_conflict()

PHPAPI bool php_output_handler_conflict ( const char * handler_new,
size_t handler_new_len,
const char * handler_set,
size_t handler_set_len )

Definition at line 582 of file output.c.

◆ php_output_handler_conflict_register()

PHPAPI zend_result php_output_handler_conflict_register ( const char * handler_name,
size_t handler_name_len,
php_output_handler_conflict_check_t check_func )

Definition at line 598 of file output.c.

◆ php_output_handler_create_internal()

PHPAPI php_output_handler * php_output_handler_create_internal ( const char * name,
size_t name_len,
php_output_handler_context_func_t handler,
size_t chunk_size,
int flags )

Definition at line 505 of file output.c.

◆ php_output_handler_create_user()

PHPAPI php_output_handler * php_output_handler_create_user ( zval * handler,
size_t chunk_size,
int flags )

Definition at line 463 of file output.c.

◆ php_output_handler_dtor()

PHPAPI void php_output_handler_dtor ( php_output_handler * handler)

Definition at line 698 of file output.c.

◆ php_output_handler_free()

PHPAPI void php_output_handler_free ( php_output_handler ** handler)

Definition at line 719 of file output.c.

◆ php_output_handler_hook()

PHPAPI zend_result php_output_handler_hook ( php_output_handler_hook_t type,
void * arg )

Definition at line 669 of file output.c.

◆ php_output_handler_reverse_conflict_register()

PHPAPI zend_result php_output_handler_reverse_conflict_register ( const char * handler_name,
size_t handler_name_len,
php_output_handler_conflict_check_t check_func )

Definition at line 615 of file output.c.

◆ php_output_handler_set_context()

PHPAPI void php_output_handler_set_context ( php_output_handler * handler,
void * opaq,
void(* dtor )(void *) )

Definition at line 520 of file output.c.

◆ php_output_handler_start()

PHPAPI zend_result php_output_handler_start ( php_output_handler * handler)

Definition at line 532 of file output.c.

◆ php_output_handler_started()

PHPAPI bool php_output_handler_started ( const char * name,
size_t name_len )

Definition at line 561 of file output.c.

◆ php_output_set_implicit_flush()

PHPAPI void php_output_set_implicit_flush ( int flush)

Definition at line 731 of file output.c.

◆ php_output_set_status()

PHPAPI void php_output_set_status ( int status)

Definition at line 206 of file output.c.

◆ php_output_shutdown()

PHPAPI void php_output_shutdown ( void )

Definition at line 148 of file output.c.

◆ php_output_start_default()

PHPAPI zend_result php_output_start_default ( void )

Definition at line 398 of file output.c.

◆ php_output_start_devnull()

PHPAPI zend_result php_output_start_devnull ( void )

Definition at line 413 of file output.c.

◆ php_output_start_internal()

PHPAPI zend_result php_output_start_internal ( const char * name,
size_t name_len,
php_output_handler_func_t output_handler,
size_t chunk_size,
int flags )

Definition at line 447 of file output.c.

◆ php_output_start_user()

PHPAPI zend_result php_output_start_user ( zval * output_handler,
size_t chunk_size,
int flags )

Definition at line 428 of file output.c.

◆ php_output_startup()

PHPAPI void php_output_startup ( void )

Definition at line 136 of file output.c.

◆ php_output_write()

PHPAPI size_t php_output_write ( const char * str,
size_t len )

Definition at line 237 of file output.c.

◆ php_output_write_unbuffered()

PHPAPI size_t php_output_write_unbuffered ( const char * str,
size_t len )

Definition at line 226 of file output.c.

◆ ZEND_EXTERN_MODULE_GLOBALS()

PHPAPI ZEND_EXTERN_MODULE_GLOBALS ( output ) const

Variable Documentation

◆ active

Definition at line 140 of file php_output.h.

◆ flags

int flags

Definition at line 144 of file php_output.h.

◆ handlers

zend_stack handlers

Definition at line 139 of file php_output.h.

◆ output_start_filename

zend_string* output_start_filename

Definition at line 142 of file php_output.h.

◆ output_start_lineno

int output_start_lineno

Definition at line 143 of file php_output.h.

◆ php_output_devnull_handler_name

const char php_output_devnull_handler_name[sizeof("null output handler")]
extern

◆ running

Definition at line 141 of file php_output.h.