CVS update: php3/functions

From: Date: Wed, 19 May 1999 18:49:11 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-5798@lists.php.net to get a copy of this message
Date: Wednesday May 19, 1999 @ 14:49 Author: rasmus Update of /repository/php3/functions In directory php:/tmp/cvs-serv25530/functions Modified Files: head.c head.h Log Message: Add headers_sent() function Index: php3/functions/head.c diff -u php3/functions/head.c:1.117 php3/functions/head.c:1.118 --- php3/functions/head.c:1.117 Wed Apr 14 07:53:20 1999 +++ php3/functions/head.c Wed May 19 14:49:11 1999 @@ -26,7 +26,7 @@ | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: head.c,v 1.117 1999/04/14 11:53:20 fmk Exp $ */ +/* $Id: head.c,v 1.118 1999/05/19 18:49:11 rasmus Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif @@ -75,6 +75,16 @@ return SUCCESS; } +/* {{{ proto int headers_sent(void) + Return true if headers have already been sent, false otherwise */ +void php3_Headers_Sent(INTERNAL_FUNCTION_PARAMETERS) { + if (GLOBAL(php3_HeaderPrinted)) { + RETURN_TRUE; + } + RETURN_FALSE; +} +/* }}} */ + void php3_noheader(void) { TLS_VARS; @@ -577,6 +587,7 @@ function_entry php3_header_functions[] = { {"setcookie", php3_SetCookie, NULL}, {"header", php3_Header, NULL}, + {"headers_sent", php3_Headers_Sent, NULL}, {NULL, NULL, NULL} }; Index: php3/functions/head.h diff -u php3/functions/head.h:1.26 php3/functions/head.h:1.27 --- php3/functions/head.h:1.26 Tue Apr 13 10:50:59 1999 +++ php3/functions/head.h Wed May 19 14:49:11 1999 @@ -27,7 +27,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: head.h,v 1.26 1999/04/13 14:50:59 fmk Exp $ */ +/* $Id: head.h,v 1.27 1999/05/19 18:49:11 rasmus Exp $ */ #ifndef _HEAD_H #define _HEAD_H @@ -56,6 +56,7 @@ #define php3_header_module_ptr &php3_header_module_entry extern int php3_init_head(INIT_FUNC_ARGS); +extern void php3_Headers_Sent(INTERNAL_FUNCTION_PARAMETERS); extern void php3_Header(INTERNAL_FUNCTION_PARAMETERS); extern PHPAPI void _php3_SetCookie(char * name, char * value, time_t expires, char * path, char * domain, int secure); extern void php3_SetCookie(INTERNAL_FUNCTION_PARAMETERS); -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#5798) next »