cvs: /php4 cgi_main.c main.c output.c output.h php.h /php4/ext/standard basic_functions.c

From: Date: Sun, 12 Sep 1999 03:25:32 +0000
Subject: cvs: /php4 cgi_main.c main.c output.c output.h php.h /php4/ext/standard basic_functions.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-4358@lists.php.net to get a copy of this message
zeev Sat Sep 11 23:25:32 1999 EDT Modified files: /php4 cgi_main.c main.c output.c output.h php.h /php4/ext/standard basic_functions.c Log: Time to do that - rename the output layer prefix Index: php4/cgi_main.c diff -u php4/cgi_main.c:1.29 php4/cgi_main.c:1.30 --- php4/cgi_main.c:1.29 Sat Sep 11 10:09:29 1999 +++ php4/cgi_main.c Sat Sep 11 23:25:02 1999 @@ -372,7 +372,7 @@ break; case 'h': case '?': - zend_output_startup(); + php_output_startup(); SG(headers_sent) = 1; php_cgi_usage(argv[0]); exit(1); Index: php4/main.c diff -u php4/main.c:1.120 php4/main.c:1.121 --- php4/main.c:1.120 Sat Sep 11 16:36:47 1999 +++ php4/main.c Sat Sep 11 23:25:02 1999 @@ -19,7 +19,7 @@ */ -/* $Id: main.c,v 1.120 1999/09/11 20:36:47 andrey Exp $ */ +/* $Id: main.c,v 1.121 1999/09/12 03:25:02 zeev Exp $ */ #include <stdio.h> @@ -654,10 +654,10 @@ int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC) { - zend_output_startup(); + php_output_startup(); if (PG(output_buffering)) { - zend_start_ob_buffering(); + php_start_ob_buffering(); } #if APACHE /* @@ -732,7 +732,7 @@ SLS_FETCH(); sapi_send_headers(); - zend_end_ob_buffering(SG(request_info).headers_only?0:1); + php_end_ob_buffering(SG(request_info).headers_only?0:1); php3_call_shutdown_functions(); @@ -771,9 +771,9 @@ } -static int zend_body_write_wrapper(const char *str, uint str_length) +static int php_body_write_wrapper(const char *str, uint str_length) { - return zend_body_write(str, str_length); + return php_body_write(str, str_length); } #ifdef ZTS @@ -825,11 +825,11 @@ sapi_module = *sf; - zend_output_startup(); + php_output_startup(); zuf.error_function = php_error; zuf.printf_function = php_printf; - zuf.write_function = zend_body_write_wrapper; + zuf.write_function = php_body_write_wrapper; zuf.fopen_function = php_fopen_wrapper_for_zend; zuf.message_handler = php_message_handler_for_zend; zuf.block_interruptions = BLOCK_INTERRUPTIONS; @@ -1210,7 +1210,7 @@ } php3_header(); /* Make sure headers have been sent */ - zend_end_ob_buffering(1); + php_end_ob_buffering(1); return (OK); } #endif /* APACHE */ Index: php4/output.c diff -u php4/output.c:1.17 php4/output.c:1.18 --- php4/output.c:1.17 Sat Sep 11 23:08:29 1999 +++ php4/output.c Sat Sep 11 23:25:02 1999 @@ -24,22 +24,22 @@ #include "SAPI.h" /* output functions */ -PHPAPI int (*zend_body_write)(const char *str, uint str_length); /* string output */ -PHPAPI int (*zend_header_write)(const char *str, uint str_length); /* unbuffer string output */ -static int zend_ub_body_write(const char *str, uint str_length); -static int zend_ub_body_write_no_header(const char *str, uint str_length); -static int zend_b_body_write(const char *str, uint str_length); +PHPAPI int (*php_body_write)(const char *str, uint str_length); /* string output */ +PHPAPI int (*php_header_write)(const char *str, uint str_length); /* unbuffer string output */ +static int php_ub_body_write(const char *str, uint str_length); +static int php_ub_body_write_no_header(const char *str, uint str_length); +static int php_b_body_write(const char *str, uint str_length); /* output buffering */ static char *ob_buffer; static uint ob_buffer_size; static uint ob_block_size; static uint ob_text_length; -static void zend_ob_init(uint initial_size, uint block_size); -static void zend_ob_destroy(); -static void zend_ob_append(const char *text, uint text_length); -static void zend_ob_prepend(const char *text, uint text_length); -static inline void zend_ob_send(); +static void php_ob_init(uint initial_size, uint block_size); +static void php_ob_destroy(); +static void php_ob_append(const char *text, uint text_length); +static void php_ob_prepend(const char *text, uint text_length); +static inline void php_ob_send(); /* @@ -47,24 +47,24 @@ */ /* Start output layer */ -PHPAPI void zend_output_startup() +PHPAPI void php_output_startup() { ob_buffer = NULL; - zend_body_write = zend_ub_body_write; - zend_header_write = sapi_module.ub_write; + php_body_write = php_ub_body_write; + php_header_write = sapi_module.ub_write; } /* Start output buffering */ -void zend_start_ob_buffering() +void php_start_ob_buffering() { - zend_ob_init(4096, 1024); - zend_body_write = zend_b_body_write; + php_ob_init(4096, 1024); + php_body_write = php_b_body_write; } /* End output buffering */ -void zend_end_ob_buffering(int send_buffer) +void php_end_ob_buffering(int send_buffer) { SLS_FETCH(); @@ -72,14 +72,14 @@ return; } if (SG(headers_sent) && !SG(request_info).headers_only) { - zend_body_write = zend_ub_body_write_no_header; + php_body_write = php_ub_body_write_no_header; } else { - zend_body_write = zend_ub_body_write; + php_body_write = php_ub_body_write; } if (send_buffer) { - zend_ob_send(); + php_ob_send(); } - zend_ob_destroy(); + php_ob_destroy(); } @@ -87,7 +87,7 @@ * Output buffering - implementation */ -static inline void zend_ob_allocate() +static inline void php_ob_allocate() { if (ob_buffer_size<ob_text_length) { while ((ob_buffer_size+=ob_block_size) < ob_text_length); @@ -96,7 +96,7 @@ } -static void zend_ob_init(uint initial_size, uint block_size) +static void php_ob_init(uint initial_size, uint block_size) { if (ob_buffer) { return; @@ -108,7 +108,7 @@ } -static void zend_ob_destroy() +static void php_ob_destroy() { if (ob_buffer) { efree(ob_buffer); @@ -117,27 +117,27 @@ } -static void zend_ob_append(const char *text, uint text_length) +static void php_ob_append(const char *text, uint text_length) { char *target; int original_ob_text_length=ob_text_length; ob_text_length += text_length; - zend_ob_allocate(); + php_ob_allocate(); target = ob_buffer+original_ob_text_length; memcpy(target, text, text_length); target[text_length]=0; } -static void zend_ob_prepend(const char *text, uint text_length) +static void php_ob_prepend(const char *text, uint text_length) { char *p, *start; ob_text_length += text_length; - zend_ob_allocate(); + php_ob_allocate(); - /* zend_ob_allocate() may change ob_buffer, so we can't initialize p&start earlier */ + /* php_ob_allocate() may change ob_buffer, so we can't initialize p&start earlier */ p = ob_buffer+ob_text_length; start = ob_buffer; @@ -149,15 +149,15 @@ } -static inline void zend_ob_send() +static inline void php_ob_send() { /* header_write is a simple, unbuffered output function */ - zend_body_write(ob_buffer, ob_text_length); + php_body_write(ob_buffer, ob_text_length); } /* Return the current output buffer */ -int zend_ob_get_buffer(pval *p) +int php_ob_get_buffer(pval *p) { if (!ob_buffer) { return FAILURE; @@ -175,20 +175,20 @@ /* buffered output function */ -static int zend_b_body_write(const char *str, uint str_length) +static int php_b_body_write(const char *str, uint str_length) { - zend_ob_append(str, str_length); + php_ob_append(str, str_length); return str_length; } -static int zend_ub_body_write_no_header(const char *str, uint str_length) +static int php_ub_body_write_no_header(const char *str, uint str_length) { - return zend_header_write(str, str_length); + return php_header_write(str, str_length); } -static int zend_ub_body_write(const char *str, uint str_length) +static int php_ub_body_write(const char *str, uint str_length) { char *newstr = NULL; uint new_length; @@ -206,8 +206,8 @@ str_length = new_length; } - zend_body_write = zend_ub_body_write_no_header; - result = zend_ub_body_write_no_header(str, str_length); + php_body_write = php_ub_body_write_no_header; + result = php_ub_body_write_no_header(str, str_length); if (newstr) { free(newstr); Index: php4/output.h diff -u php4/output.h:1.4 php4/output.h:1.5 --- php4/output.h:1.4 Fri Jul 16 09:12:42 1999 +++ php4/output.h Sat Sep 11 23:25:02 1999 @@ -22,14 +22,14 @@ #include "php.h" -PHPAPI void zend_output_startup(); +PHPAPI void php_output_startup(); /* exported output functions */ -PHPAPI int (*zend_body_write)(const char *str, uint str_length); /* string output */ -PHPAPI int (*zend_header_write)(const char *str, uint str_length); /* unbuffer string output */ -void zend_start_ob_buffering(); -void zend_end_ob_buffering(int send_buffer); -int zend_ob_get_buffer(pval *p); +PHPAPI int (*php_body_write)(const char *str, uint str_length); /* string output */ +PHPAPI int (*php_header_write)(const char *str, uint str_length); /* unbuffer string output */ +void php_start_ob_buffering(); +void php_end_ob_buffering(int send_buffer); +int php_ob_get_buffer(pval *p); /* HEAD support */ void set_header_request(int value); Index: php4/php.h diff -u php4/php.h:1.31 php4/php.h:1.32 --- php4/php.h:1.31 Sat Sep 4 18:18:43 1999 +++ php4/php.h Sat Sep 11 23:25:02 1999 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php.h,v 1.31 1999/09/04 22:18:43 rasmus Exp $ */ +/* $Id: php.h,v 1.32 1999/09/12 03:25:02 zeev Exp $ */ #ifndef _PHP_H #define _PHP_H @@ -312,12 +312,12 @@ /* Output support */ #include "output.h" -#define PHPWRITE(str, str_len) zend_body_write((str), (str_len)) -#define PUTS(str) zend_body_write((str), strlen((str))) -#define PUTC(c) (zend_body_write(&(c), 1), (c)) -#define PHPWRITE_H(str, str_len) zend_header_write((str), (str_len)) -#define PUTS_H(str) zend_header_write((str), strlen((str))) -#define PUTC_H(c) (zend_header_write(&(c), 1), (c)) +#define PHPWRITE(str, str_len) php_body_write((str), (str_len)) +#define PUTS(str) php_body_write((str), strlen((str))) +#define PUTC(c) (php_body_write(&(c), 1), (c)) +#define PHPWRITE_H(str, str_len) php_header_write((str), (str_len)) +#define PUTS_H(str) php_header_write((str), strlen((str))) +#define PUTC_H(c) (php_header_write(&(c), 1), (c)) #include "zend_operators.h" Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.82 php4/ext/standard/basic_functions.c:1.83 --- php4/ext/standard/basic_functions.c:1.82 Tue Sep 7 15:41:28 1999 +++ php4/ext/standard/basic_functions.c Sat Sep 11 23:25:02 1999 @@ -2175,25 +2175,25 @@ PHP_FUNCTION(ob_start) { - zend_start_ob_buffering(); + php_start_ob_buffering(); } PHP_FUNCTION(ob_end_flush) { - zend_end_ob_buffering(1); + php_end_ob_buffering(1); } PHP_FUNCTION(ob_end_clean) { - zend_end_ob_buffering(0); + php_end_ob_buffering(0); } PHP_FUNCTION(ob_get_contents) { - if (zend_ob_get_buffer(return_value)==FAILURE) { + if (php_ob_get_buffer(return_value)==FAILURE) { RETURN_FALSE; } }

« previous php.version4 (#4358) next »