]> granicus.if.org Git - php/commitdiff
more tsrm cleanup
authorSascha Schumann <sas@php.net>
Sun, 5 Aug 2001 15:29:47 +0000 (15:29 +0000)
committerSascha Schumann <sas@php.net>
Sun, 5 Aug 2001 15:29:47 +0000 (15:29 +0000)
25 files changed:
ext/sablot/sablot.c
ext/session/php_session.h
ext/session/session.c
ext/zlib/php_zlib.h
ext/zlib/zlib.c
main/SAPI.c
main/SAPI.h
main/main.c
main/output.c
main/php_output.h
sapi/aolserver/aolserver.c
sapi/apache/mod_php4.c
sapi/apache/php_apache.c
sapi/apache2filter/sapi_apache2.c
sapi/caudium/caudium.c
sapi/cgi/cgi_main.c
sapi/fastcgi/fastcgi.c
sapi/isapi/php4isapi.c
sapi/nsapi/nsapi.c
sapi/phttpd/phttpd.c
sapi/pi3web/pi3web_sapi.c
sapi/roxen/roxen.c
sapi/servlet/servlet.c
sapi/thttpd/thttpd.c
sapi/tux/php_tux.c

index f3b3f8520d5c747fec05f528936dbdb14fdd3037..6547f9050e55b5d544b1e4128f4a96ea22bc2f02 100644 (file)
@@ -282,7 +282,7 @@ PHP_FUNCTION(xslt_output_begintransform)
      * Start output buffering, NULL signifies that no "user-space" output function
      * will be used.  The 0 disables chunking
      */
-    php_start_ob_buffer(NULL, 0);
+    php_start_ob_buffer(NULL, 0 TSRMLS_CC);
 }
 /* }}} */
 
@@ -345,7 +345,7 @@ PHP_FUNCTION(xslt_output_endtransform)
      * current output buffer (so we don't send data twice) 
      */
     if (tRes)
-        php_end_ob_buffer(0, 0);
+        php_end_ob_buffer(0, 0 TSRMLS_CC);
     
     PUTS(tRes);
     
@@ -360,7 +360,7 @@ PHP_FUNCTION(xslt_output_endtransform)
     if (tRes)
         SablotFree(tRes);
     else
-        php_end_ob_buffer(1, 0);
+        php_end_ob_buffer(1, 0 TSRMLS_CC);
 }
 /* }}} */
 
index 70ad99076d8c992807b6e45b733490585c8273a4..8c3ce17208723da058b87b4d6a1436f88744f8e6 100644 (file)
@@ -146,7 +146,7 @@ typedef struct ps_serializer_struct {
 #ifdef TRANS_SID
 void session_adapt_uris(const char *, size_t, char **, size_t * TSRMLS_DC);
 void session_adapt_url(const char *, size_t, char **, size_t * TSRMLS_DC);
-void session_adapt_flush(int (*)(const char *, uint));
+void session_adapt_flush(int (*)(const char *, uint) TSRMLS_DC);
 #else
 #define session_adapt_uris(a,b,c,d) do { } while(0)
 #define session_adapt_url(a,b,c,d) do { } while(0)
index e41897793a47dbffd54c713656f04c27672ec917..7e753261b6e57040f5b9467c8095d5ed7b3d7d71 100644 (file)
@@ -658,8 +658,8 @@ static int php_session_cache_limiter(TSRMLS_D)
        php_session_cache_limiter_t *lim;
 
        if (SG(headers_sent)) {
-               char *output_start_filename = php_get_output_start_filename();
-               int output_start_lineno = php_get_output_start_lineno();
+               char *output_start_filename = php_get_output_start_filename(TSRMLS_C);
+               int output_start_lineno = php_get_output_start_lineno(TSRMLS_C);
 
                if (output_start_filename) {
                        php_error(E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)",
@@ -692,8 +692,8 @@ static void php_session_send_cookie(TSRMLS_D)
        char *date_fmt = NULL;
 
        if (SG(headers_sent)) {
-               char *output_start_filename = php_get_output_start_filename();
-               int output_start_lineno = php_get_output_start_lineno();
+               char *output_start_filename = php_get_output_start_filename(TSRMLS_C);
+               int output_start_lineno = php_get_output_start_lineno(TSRMLS_C);
 
                if (output_start_filename) {
                        php_error(E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)",
@@ -1280,13 +1280,13 @@ void session_adapt_url(const char *url, size_t urllen, char **new, size_t *newle
                *new = url_adapt_single_url(url, urllen, PS(session_name), PS(id), newlen);
 }
 
-void session_adapt_flush(int (*write)(const char *, uint))
+void session_adapt_flush(int (*write)(const char *, uint TSRMLS_DC) TSRMLS_DC)
 {
        char *str;
        size_t len;
        
        str = url_adapt_flush(&len);
-       if (str) write(str, len);
+       if (str) write(str, len TSRMLS_CC);
 }
 
 #endif
index 22432c4a1b3b3c93569df524f9b9e6da2355b8ce..8fd808024e6c659809a74d54a5465a8f0f7c01b9 100644 (file)
@@ -65,7 +65,7 @@ PHP_FUNCTION(gzencode);
 PHP_FUNCTION(ob_gzhandler);
 
 FILE *zlib_fopen_wrapper(const char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC);
-int php_enable_output_compression(int buffer_size);
+int php_enable_output_compression(int buffer_size TSRMLS_DC);
 
 
 #ifdef ZTS
index 45dee373647159b7167e4bafd4a7803202542ffc..a0137878d520d9e7a35a23145b8c5c7ca3bcf450 100644 (file)
@@ -187,10 +187,10 @@ PHP_RINIT_FUNCTION(zlib)
                case 0:
                        break;
                case 1:
-                       php_enable_output_compression(4096);
+                       php_enable_output_compression(4096 TSRMLS_CC);
                        break;
                default:
-                       php_enable_output_compression(ZLIBG(output_compression));
+                       php_enable_output_compression(ZLIBG(output_compression) TSRMLS_CC);
        }
        return SUCCESS;
 }
@@ -1025,10 +1025,9 @@ static int php_do_deflate(uint str_length, Bytef **p_buffer, uint *p_buffer_len,
 
 /* {{{ php_deflate_string
  */
-int php_deflate_string(const char *str, uint str_length, char **newstr, uint *new_length, int coding, zend_bool do_start, zend_bool do_end)
+int php_deflate_string(const char *str, uint str_length, char **newstr, uint *new_length, int coding, zend_bool do_start, zend_bool do_end TSRMLS_DC)
 {
        int err;
-       TSRMLS_FETCH();
 
        ZLIBG(compression_coding) = coding;
 
@@ -1127,7 +1126,7 @@ PHP_FUNCTION(gzencode)
                        ZEND_WRONG_PARAM_COUNT();
                        break;
        }
-       if (php_deflate_string(Z_STRVAL_PP(zv_string), Z_STRLEN_PP(zv_string), &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), coding, 1, 1)==SUCCESS) {
+       if (php_deflate_string(Z_STRVAL_PP(zv_string), Z_STRLEN_PP(zv_string), &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), coding, 1, 1 TSRMLS_CC)==SUCCESS) {
                Z_TYPE_P(return_value) = IS_STRING;
        } else {
                RETURN_FALSE;
@@ -1173,7 +1172,7 @@ PHP_FUNCTION(ob_gzhandler)
        do_end = ((Z_LVAL_PP(zv_mode) & PHP_OUTPUT_HANDLER_END) ? 1 : 0);
        Z_STRVAL_P(return_value) = NULL;
        Z_STRLEN_P(return_value) = 0;
-       if (php_deflate_string(Z_STRVAL_PP(zv_string), Z_STRLEN_PP(zv_string), &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), coding, do_start, do_end)==SUCCESS) {
+       if (php_deflate_string(Z_STRVAL_PP(zv_string), Z_STRLEN_PP(zv_string), &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), coding, do_start, do_end TSRMLS_CC)==SUCCESS) {
                Z_TYPE_P(return_value) = IS_STRING;
                if (do_start) {
                        switch (coding) {
@@ -1223,14 +1222,13 @@ PHP_FUNCTION(ob_gzhandler)
 
 /* {{{ php_gzip_output_handler
  */
-static void php_gzip_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode)
+static void php_gzip_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC)
 {
        zend_bool do_start, do_end;
-       TSRMLS_FETCH();
 
        do_start = (mode & PHP_OUTPUT_HANDLER_START ? 1 : 0);
        do_end = (mode & PHP_OUTPUT_HANDLER_END ? 1 : 0);
-       if (php_deflate_string(output, output_len, handled_output, handled_output_len, ZLIBG(ob_gzip_coding), do_start, do_end)!=SUCCESS) {
+       if (php_deflate_string(output, output_len, handled_output, handled_output_len, ZLIBG(ob_gzip_coding), do_start, do_end TSRMLS_CC)!=SUCCESS) {
                zend_error(E_ERROR, "Compression failed");
        }
 }
@@ -1238,10 +1236,9 @@ static void php_gzip_output_handler(char *output, uint output_len, char **handle
 
 /* {{{ php_enable_output_compression
  */
-int php_enable_output_compression(int buffer_size)
+int php_enable_output_compression(int buffer_size TSRMLS_DC)
 {
        zval **a_encoding, **data;
-       TSRMLS_FETCH();
 
        if (zend_hash_find(&EG(symbol_table), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), (void **) &data)==FAILURE
                || Z_TYPE_PP(data)!=IS_ARRAY
@@ -1263,8 +1260,8 @@ int php_enable_output_compression(int buffer_size)
                return FAILURE;
        }
        
-       php_start_ob_buffer(NULL, buffer_size);
-       php_ob_set_internal_handler(php_gzip_output_handler, buffer_size*1.5);
+       php_start_ob_buffer(NULL, buffer_size TSRMLS_CC);
+       php_ob_set_internal_handler(php_gzip_output_handler, buffer_size*1.5 TSRMLS_CC);
        return SUCCESS;
 }
 /* }}} */
index b38fd1edb52ef22ae19e40d686bf24d5717dade7..ac082fb6d38460d9ba022ce8fca715be81c1df73 100644 (file)
@@ -373,8 +373,8 @@ SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bo
        char *colon_offset;
 
        if (SG(headers_sent) && !SG(request_info).no_headers) {
-               char *output_start_filename = php_get_output_start_filename();
-               int output_start_lineno = php_get_output_start_lineno();
+               char *output_start_filename = php_get_output_start_filename(TSRMLS_C);
+               int output_start_lineno = php_get_output_start_lineno(TSRMLS_C);
 
                if (output_start_filename) {
                        sapi_module.sapi_error(E_WARNING, "Cannot add header information - headers already sent by (output started at %s:%d)",
index def26a08f307b491b50de64d595ff0ab4540832d..d1e8a3de1940607a33e8efef01aa774693908da5 100644 (file)
@@ -160,7 +160,7 @@ struct _sapi_module_struct {
        int (*activate)(TSRMLS_D);
        int (*deactivate)(TSRMLS_D);
 
-       int (*ub_write)(const char *str, unsigned int str_length);
+       int (*ub_write)(const char *str, unsigned int str_length TSRMLS_DC);
        void (*flush)(void *server_context);
        struct stat *(*get_stat)(TSRMLS_D);
        char *(*getenv)(char *name, size_t name_len TSRMLS_DC);
index ae64e8c91147f1410c8f0a8ecf3f2ae8c7187b16..c55ada3a33b3cbe89d46951bcf222a4fccf704f3 100644 (file)
@@ -622,7 +622,7 @@ int php_request_startup(TSRMLS_D)
        zend_try {
                PG(during_request_startup) = 1;
                
-               php_output_activate();
+               php_output_activate(TSRMLS_C);
 
                /* initialize global variables */
                PG(modules_activated) = 0;
@@ -645,11 +645,11 @@ int php_request_startup(TSRMLS_D)
                        Z_STRLEN_P(output_handler) = strlen(PG(output_handler));        /* this can be optimized */
                        Z_STRVAL_P(output_handler) = estrndup(PG(output_handler), Z_STRLEN_P(output_handler));
                        Z_TYPE_P(output_handler) = IS_STRING;
-                       php_start_ob_buffer(output_handler, 0);
+                       php_start_ob_buffer(output_handler, 0 TSRMLS_CC);
                } else if (PG(output_buffering)) {
-                       php_start_ob_buffer(NULL, 0);
+                       php_start_ob_buffer(NULL, 0 TSRMLS_CC);
                } else if (PG(implicit_flush)) {
-                       php_start_implicit_flush();
+                       php_start_implicit_flush(TSRMLS_C);
                }
 
                /* We turn this off in php_execute_script() */
@@ -683,7 +683,7 @@ void php_request_shutdown(void *dummy)
        TSRMLS_FETCH();
 
        zend_try {
-               php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1));
+               php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1) TSRMLS_CC);
        } zend_end_try();
 
        zend_try {
@@ -800,7 +800,7 @@ int php_module_startup(sapi_module_struct *sf)
        sapi_module = *sf;
 
        php_output_startup();
-       php_output_activate();
+       php_output_activate(TSRMLS_C);
 
        zuf.error_function = php_error_cb;
        zuf.printf_function = php_printf;
@@ -883,7 +883,7 @@ int php_module_startup(sapi_module_struct *sf)
        REGISTER_MAIN_STRINGL_CONSTANT("PHP_SYSCONFDIR", PHP_SYSCONFDIR, sizeof(PHP_SYSCONFDIR)-1, CONST_PERSISTENT | CONST_CS);
        REGISTER_MAIN_STRINGL_CONSTANT("PHP_LOCALSTATEDIR", PHP_LOCALSTATEDIR, sizeof(PHP_LOCALSTATEDIR)-1, CONST_PERSISTENT | CONST_CS);
        REGISTER_MAIN_STRINGL_CONSTANT("PHP_CONFIG_FILE_PATH", PHP_CONFIG_FILE_PATH, sizeof(PHP_CONFIG_FILE_PATH)-1, CONST_PERSISTENT | CONST_CS);
-       php_output_register_constants();
+       php_output_register_constants(TSRMLS_C);
 
        if (php_startup_ticks(TSRMLS_C) == FAILURE) {
                php_printf("Unable to start PHP ticks\n");
@@ -1249,7 +1249,7 @@ PHPAPI void php_handle_aborted_connection(void)
        TSRMLS_FETCH();
 
        PG(connection_status) = PHP_CONNECTION_ABORTED;
-       php_output_set_status(0);
+       php_output_set_status(0 TSRMLS_CC);
 
        if (!PG(ignore_user_abort)) {
                zend_bailout();
index 8d1c9d0369776b5123d3ef54e253936098e91a6c..7d4e1fa2cbae00142d34c7272a46adb4d2b8975e 100644 (file)
 #include "SAPI.h"
 
 /* output functions */
-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);
+static int php_ub_body_write(const char *str, uint str_length TSRMLS_DC);
+static int php_ub_body_write_no_header(const char *str, uint str_length TSRMLS_DC);
+static int php_b_body_write(const char *str, uint str_length TSRMLS_DC);
 
-static void php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size);
-static void php_ob_append(const char *text, uint text_length);
+static void php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size TSRMLS_DC);
+static void php_ob_append(const char *text, uint text_length TSRMLS_DC);
 #if 0
 static void php_ob_prepend(const char *text, uint text_length);
 #endif
@@ -43,7 +43,7 @@ int output_globals_id;
 php_output_globals output_globals;
 #endif
 
-static int php_default_output_func(const char *str, uint str_len)
+static int php_default_output_func(const char *str, uint str_len TSRMLS_DC)
 {
        fwrite(str, 1, str_len, stderr);
        return str_len;
@@ -71,10 +71,8 @@ PHPAPI void php_output_startup(void)
 }
 
 
-PHPAPI void php_output_activate(void)
+PHPAPI void php_output_activate(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
        OG(php_body_write) = php_ub_body_write;
        OG(php_header_write) = sapi_module.ub_write;
        OG(ob_nesting_level) = 0;
@@ -83,18 +81,14 @@ PHPAPI void php_output_activate(void)
 }
 
 
-PHPAPI void php_output_set_status(zend_bool status)
+PHPAPI void php_output_set_status(zend_bool status TSRMLS_DC)
 {
-       TSRMLS_FETCH();
-
        OG(disable_output) = !status;
 }
 
 
-void php_output_register_constants()
+void php_output_register_constants(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
        REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_START", PHP_OUTPUT_HANDLER_START, CONST_CS | CONST_PERSISTENT);
        REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_CONT", PHP_OUTPUT_HANDLER_CONT, CONST_CS | CONST_PERSISTENT);
        REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_END", PHP_OUTPUT_HANDLER_END, CONST_CS | CONST_PERSISTENT);
@@ -104,7 +98,7 @@ void php_output_register_constants()
 PHPAPI int php_body_write(const char *str, uint str_length)
 {
        TSRMLS_FETCH();
-       return OG(php_body_write)(str, str_length);     
+       return OG(php_body_write)(str, str_length TSRMLS_CC);   
 }
 
 PHPAPI int php_header_write(const char *str, uint str_length)
@@ -113,23 +107,21 @@ PHPAPI int php_header_write(const char *str, uint str_length)
        if (OG(disable_output)) {
                return 0;
        } else {
-               return OG(php_header_write)(str, str_length);
+               return OG(php_header_write)(str, str_length TSRMLS_CC);
        }
 }
 
 /* {{{ php_start_ob_buffer
  * Start output buffering */
-PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size)
+PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size TSRMLS_DC)
 {
-       TSRMLS_FETCH();
-
        if (OG(ob_lock)) {
                return FAILURE;
        }
        if (chunk_size) {
-               php_ob_init((chunk_size*3/2), chunk_size/2, output_handler, chunk_size);
+               php_ob_init((chunk_size*3/2), chunk_size/2, output_handler, chunk_size TSRMLS_CC);
        } else {
-               php_ob_init(40*1024, 10*1024, output_handler, chunk_size);
+               php_ob_init(40*1024, 10*1024, output_handler, chunk_size TSRMLS_CC);
        }
        OG(php_body_write) = php_b_body_write;
        return SUCCESS;
@@ -138,7 +130,7 @@ PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size)
 
 /* {{{ php_end_ob_buffer
  * End output buffering (one level) */
-PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush)
+PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS_DC)
 {
        char *final_buffer=NULL;
        int final_buffer_length=0;
@@ -146,7 +138,6 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush)
        char *to_be_destroyed_buffer;
        char *to_be_destroyed_handled_output[2] = { 0, 0 };
        int status;
-       TSRMLS_FETCH();
 
        if (OG(ob_nesting_level)==0) {
                return;
@@ -165,12 +156,11 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush)
        if (OG(active_ob_buffer).internal_output_handler) {
                final_buffer = OG(active_ob_buffer).internal_output_handler_buffer;
                final_buffer_length = OG(active_ob_buffer).internal_output_handler_buffer_size;
-               OG(active_ob_buffer).internal_output_handler(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, &final_buffer, &final_buffer_length, status);
+               OG(active_ob_buffer).internal_output_handler(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, &final_buffer, &final_buffer_length, status TSRMLS_CC);
        } else if (OG(active_ob_buffer).output_handler) {
                zval **params[2];
                zval *orig_buffer;
                zval *z_status;
-               TSRMLS_FETCH();
 
                ALLOC_INIT_ZVAL(orig_buffer);
                ZVAL_STRINGL(orig_buffer, OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, 0);
@@ -235,7 +225,7 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush)
        }
 
        if (send_buffer) {
-               OG(php_body_write)(final_buffer, final_buffer_length);
+               OG(php_body_write)(final_buffer, final_buffer_length TSRMLS_CC);
        }
 
        if (alternate_buffer) {
@@ -260,47 +250,39 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush)
 
 /* {{{ php_end_ob_buffers
  * End output buffering (all buffers) */
-PHPAPI void php_end_ob_buffers(zend_bool send_buffer)
+PHPAPI void php_end_ob_buffers(zend_bool send_buffer TSRMLS_DC)
 {
-       TSRMLS_FETCH();
-
        while (OG(ob_nesting_level)!=0) {
-               php_end_ob_buffer(send_buffer, 0);
+               php_end_ob_buffer(send_buffer, 0 TSRMLS_CC);
        }
 
        if (!OG(disable_output) && send_buffer && BG(use_trans_sid)) {
-               session_adapt_flush(OG(php_header_write));
+               session_adapt_flush(OG(php_header_write) TSRMLS_CC);
        }
 }
 /* }}} */
 
 /* {{{ php_start_implicit_flush
  */
-PHPAPI void php_start_implicit_flush()
+PHPAPI void php_start_implicit_flush(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
-       php_end_ob_buffer(1, 0);                /* Switch out of output buffering if we're in it */
+       php_end_ob_buffer(1, 0 TSRMLS_CC);              /* Switch out of output buffering if we're in it */
        OG(implicit_flush)=1;
 }
 /* }}} */
 
 /* {{{ php_end_implicit_flush
  */
-PHPAPI void php_end_implicit_flush()
+PHPAPI void php_end_implicit_flush(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
        OG(implicit_flush)=0;
 }
 /* }}} */
 
 /* {{{ php_ob_set_internal_handler
  */
-PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size)
+PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size TSRMLS_DC)
 {
-       TSRMLS_FETCH();
-
        if (OG(ob_nesting_level)==0) {
                return;
        }
@@ -317,10 +299,8 @@ PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_outpu
 
 /* {{{ php_ob_allocate
  */
-static inline void php_ob_allocate(void)
+static inline void php_ob_allocate(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
        if (OG(active_ob_buffer).size<OG(active_ob_buffer).text_length) {
                while (OG(active_ob_buffer).size <= OG(active_ob_buffer).text_length) {
                        OG(active_ob_buffer).size+=OG(active_ob_buffer).block_size;
@@ -333,10 +313,8 @@ static inline void php_ob_allocate(void)
 
 /* {{{ php_ob_init
  */
-static void php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size)
+static void php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size TSRMLS_DC)
 {
-       TSRMLS_FETCH();
-
        if (OG(ob_nesting_level)>0) {
                if (OG(ob_nesting_level)==1) { /* initialize stack */
                        zend_stack_init(&OG(ob_buffers));
@@ -357,16 +335,15 @@ static void php_ob_init(uint initial_size, uint block_size, zval *output_handler
 
 /* {{{ php_ob_append
  */
-static void php_ob_append(const char *text, uint text_length)
+static void php_ob_append(const char *text, uint text_length TSRMLS_DC)
 {
        char *target;
        int original_ob_text_length;
-       TSRMLS_FETCH();
 
        original_ob_text_length=OG(active_ob_buffer).text_length;
        OG(active_ob_buffer).text_length = OG(active_ob_buffer).text_length + text_length;
 
-       php_ob_allocate();
+       php_ob_allocate(TSRMLS_C);
        target = OG(active_ob_buffer).buffer+original_ob_text_length;
        memcpy(target, text, text_length);
        target[text_length]=0;
@@ -378,7 +355,7 @@ static void php_ob_append(const char *text, uint text_length)
                if (output_handler) {
                        output_handler->refcount++;
                }
-               php_end_ob_buffer(1, 1);
+               php_end_ob_buffer(1, 1 TSRMLS_CC);
                return;
        }
 }
@@ -391,7 +368,7 @@ static void php_ob_prepend(const char *text, uint text_length)
        TSRMLS_FETCH();
 
        OG(active_ob_buffer).text_length += text_length;
-       php_ob_allocate();
+       php_ob_allocate(TSRMLS_C);
 
        /* php_ob_allocate() may change OG(ob_buffer), so we can't initialize p&start earlier */
        p = OG(ob_buffer)+OG(ob_text_length);
@@ -408,10 +385,8 @@ static void php_ob_prepend(const char *text, uint text_length)
 
 /* {{{ php_ob_get_buffer
  * Return the current output buffer */
-int php_ob_get_buffer(pval *p)
+int php_ob_get_buffer(pval *p TSRMLS_DC)
 {
-       TSRMLS_FETCH();
-
        if (OG(ob_nesting_level)==0) {
                return FAILURE;
        }
@@ -422,10 +397,8 @@ int php_ob_get_buffer(pval *p)
 
 /* {{{ php_ob_get_length
  * Return the size of the current output buffer */
-int php_ob_get_length(pval *p)
+int php_ob_get_length(pval *p TSRMLS_DC)
 {
-       TSRMLS_FETCH();
-
        if (OG(ob_nesting_level) == 0) {
                return FAILURE;
        }
@@ -440,20 +413,19 @@ int php_ob_get_length(pval *p)
 
 
 /* buffered output function */
-static int php_b_body_write(const char *str, uint str_length)
+static int php_b_body_write(const char *str, uint str_length TSRMLS_DC)
 {
-       php_ob_append(str, str_length);
+       php_ob_append(str, str_length TSRMLS_CC);
        return str_length;
 }
 
 /* {{{ php_ub_body_write_no_header
  */
-static int php_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 TSRMLS_DC)
 {
        char *newstr = NULL;
        size_t new_length=0;
        int result;
-       TSRMLS_FETCH();
 
        if (OG(disable_output)) {
                return 0;
@@ -467,7 +439,7 @@ static int php_ub_body_write_no_header(const char *str, uint str_length)
                str_length = new_length;
        }
 
-       result = OG(php_header_write)(str, str_length);
+       result = OG(php_header_write)(str, str_length TSRMLS_CC);
 
        if (OG(implicit_flush)) {
                sapi_flush(TSRMLS_C);
@@ -479,10 +451,9 @@ static int php_ub_body_write_no_header(const char *str, uint str_length)
 
 /* {{{ php_ub_body_write
  */
-static int php_ub_body_write(const char *str, uint str_length)
+static int php_ub_body_write(const char *str, uint str_length TSRMLS_DC)
 {
        int result = 0;
-       TSRMLS_FETCH();
 
        if (SG(request_info).headers_only) {
                php_header();
@@ -498,7 +469,7 @@ static int php_ub_body_write(const char *str, uint str_length)
                }
 
                OG(php_body_write) = php_ub_body_write_no_header;
-               result = php_ub_body_write_no_header(str, str_length);
+               result = php_ub_body_write_no_header(str, str_length TSRMLS_CC);
        }
 
        return result;
@@ -548,9 +519,7 @@ PHP_FUNCTION(ob_start)
                        ZEND_WRONG_PARAM_COUNT();
                        break;
        }
-       if (php_start_ob_buffer(output_handler, chunk_size)==FAILURE) {
-               TSRMLS_FETCH();
-
+       if (php_start_ob_buffer(output_handler, chunk_size TSRMLS_CC)==FAILURE) {
                if (SG(headers_sent) && !SG(request_info).headers_only) {
                        OG(php_body_write) = php_ub_body_write_no_header;
                } else {
@@ -568,7 +537,7 @@ PHP_FUNCTION(ob_start)
    Flush (send) the output buffer, and turn off output buffering */
 PHP_FUNCTION(ob_end_flush)
 {
-       php_end_ob_buffer(1, 0);
+       php_end_ob_buffer(1, 0 TSRMLS_CC);
 }
 /* }}} */
 
@@ -576,7 +545,7 @@ PHP_FUNCTION(ob_end_flush)
    Clean (erase) the output buffer, and turn off output buffering */
 PHP_FUNCTION(ob_end_clean)
 {
-       php_end_ob_buffer(0, 0);
+       php_end_ob_buffer(0, 0 TSRMLS_CC);
 }
 /* }}} */
 
@@ -584,7 +553,7 @@ PHP_FUNCTION(ob_end_clean)
    Return the contents of the output buffer */
 PHP_FUNCTION(ob_get_contents)
 {
-       if (php_ob_get_buffer(return_value)==FAILURE) {
+       if (php_ob_get_buffer(return_value TSRMLS_CC)==FAILURE) {
                RETURN_FALSE;
        }
 }
@@ -594,7 +563,7 @@ PHP_FUNCTION(ob_get_contents)
    Return the length of the output buffer */
 PHP_FUNCTION(ob_get_length)
 {
-       if (php_ob_get_length(return_value)==FAILURE) {
+       if (php_ob_get_length(return_value TSRMLS_CC)==FAILURE) {
                RETURN_FALSE;
        }
 }
@@ -623,25 +592,21 @@ PHP_FUNCTION(ob_implicit_flush)
                        break;
        }
        if (flag) {
-               php_start_implicit_flush();
+               php_start_implicit_flush(TSRMLS_C);
        } else {
-               php_end_implicit_flush();
+               php_end_implicit_flush(TSRMLS_C);
        }
 }
 /* }}} */
 
-PHPAPI char *php_get_output_start_filename()
+PHPAPI char *php_get_output_start_filename(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
        return OG(output_start_filename);
 }
 
 
-PHPAPI int php_get_output_start_lineno()
+PHPAPI int php_get_output_start_lineno(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
        return OG(output_start_lineno);
 }
 
index 38211a522297ce014b6da47009957f3fa3f255b9..1521a7319aff51f4a9af386cb7eb10f0c1099244 100644 (file)
 
 #include "php.h"
 
-typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode);
+typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC);
 
 PHPAPI void php_output_startup(void);
-PHPAPI void php_output_activate(void);
-PHPAPI void php_output_set_status(zend_bool status);
-void php_output_register_constants(void);
+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);
 PHPAPI int  php_body_write(const char *str, uint str_length);
 PHPAPI int  php_header_write(const char *str, uint str_length);
-PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size);
-PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush);
-PHPAPI void php_end_ob_buffers(zend_bool send_buffer);
-PHPAPI int php_ob_get_buffer(pval *p);
-PHPAPI int php_ob_get_length(pval *p);
-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);
-PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size);
+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);
 
 PHP_FUNCTION(ob_start);
 PHP_FUNCTION(ob_end_flush);
@@ -63,8 +63,8 @@ typedef struct _php_ob_buffer {
 } php_ob_buffer;
 
 typedef struct _php_output_globals {
-       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 */
+       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 */
        php_ob_buffer active_ob_buffer;
        unsigned char implicit_flush;
        char *output_start_filename;
index 7e3271be64bc6a3f26ad46ee2a1dcc6aa1cb5a57..3d2f0164f0d3df0bbcf1a52c13d9af0268c9939a 100644 (file)
@@ -86,11 +86,10 @@ static void php_ns_config(php_ns_context *ctx, char global);
  */
 
 static int
-php_ns_sapi_ub_write(const char *str, uint str_length)
+php_ns_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
 {
        int n;
        uint sent = 0;
-       TSRMLS_FETCH();
 
        while (str_length > 0) {
                n = Ns_ConnWrite(NSG(conn), (void *) str, str_length);
index 4265f4aa6ada1bb598aea0e61c83cd09ec05a2ee..1321c5cb1bcca1d8a431dbd6202b920ce77c9a51 100644 (file)
@@ -124,10 +124,9 @@ void php_save_umask(void)
 
 /* {{{ sapi_apache_ub_write
  */
-static int sapi_apache_ub_write(const char *str, uint str_length)
+static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC)
 {
        int ret=0;
-       TSRMLS_FETCH();
                
        if (SG(server_context)) {
                ret = rwrite(str, str_length, (request_rec *) SG(server_context));
@@ -311,7 +310,7 @@ static void php_apache_request_shutdown(void *dummy)
 {
        TSRMLS_FETCH();
 
-       php_output_set_status(0);
+       php_output_set_status(0 TSRMLS_CC);
        SG(server_context) = NULL; /* The server context (request) is invalid by the time run_cleanups() is called */
        if (AP(in_request)) {
                AP(in_request) = 0;
index 6b141c52b427e4fa7072d4df9b09192a0361762d..0f14f904213592ba463fd353e5fdc433ae273d7a 100644 (file)
@@ -302,7 +302,6 @@ PHP_FUNCTION(virtual)
 {
        pval **filename;
        request_rec *rr = NULL;
-       TSRMLS_FETCH();
 
        if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) {
                WRONG_PARAM_COUNT;
@@ -321,7 +320,7 @@ PHP_FUNCTION(virtual)
                RETURN_FALSE;
        }
 
-       php_end_ob_buffers(1);
+       php_end_ob_buffers(1 TSRMLS_CC);
        php_header();
 
        if (run_sub_req(rr)) {
index 15fab6a1cca8db4f26da26128e381a06cfc7a321..cca75156bfc26b0108258723fee4f0bd3c6adc16 100644 (file)
 #include "php_apache.h"
 
 static int
-php_apache_sapi_ub_write(const char *str, uint str_length)
+php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
 {
        apr_bucket *b;
        apr_bucket_brigade *bb;
        php_struct *ctx;
        uint now;
-       TSRMLS_FETCH();
 
        ctx = SG(server_context);
 
index caae71b2dd0cb34049601e3f26640d0422ff32cd..962b9acc9256f41e1602da0b64e55b85d043dae9 100644 (file)
@@ -204,10 +204,9 @@ INLINE static int lookup_integer_header(char *headername, int default_value)
  */
 
 INLINE static int
-php_caudium_low_ub_write(const char *str, uint str_length) {
+php_caudium_low_ub_write(const char *str, uint str_length TSRMLS_DC) {
   int sent_bytes = 0;
   struct pike_string *to_write = NULL;
-  TSRMLS_FETCH();
   GET_THIS();
   if(!MY_FD_OBJ->prog) {
     PG(connection_status) = PHP_CONNECTION_ABORTED;
@@ -235,9 +234,8 @@ php_caudium_low_ub_write(const char *str, uint str_length) {
  */
 
 static int
-php_caudium_sapi_ub_write(const char *str, uint str_length)
+php_caudium_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
 {
-  TSRMLS_FETCH();
   GET_THIS();
   int sent_bytes = 0, fd = MY_FD;
   if(fd)
@@ -266,7 +264,7 @@ php_caudium_sapi_ub_write(const char *str, uint str_length)
     }
     THIS->written += sent_bytes;
   } else {
-    THREAD_SAFE_RUN(sent_bytes = php_caudium_low_ub_write(str, str_length),
+    THREAD_SAFE_RUN(sent_bytes = php_caudium_low_ub_write(str, str_length TSRMLS_CC),
                    "write");
   }
   return sent_bytes;
index 52b9e6ccdd9c65a3dd49ac7c40f3aa498637ccc1..5e09d5a6948cec28dceb67c9cc704c509dadf9a1 100644 (file)
@@ -108,7 +108,7 @@ static inline size_t sapi_cgibin_single_write(const char *str, uint str_length)
 #endif
 }
 
-static int sapi_cgibin_ub_write(const char *str, uint str_length)
+static int sapi_cgibin_ub_write(const char *str, uint str_length TSRMLS_DC)
 {
        const char *ptr = str;
        uint remaining = str_length;
@@ -493,10 +493,10 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
                                        case '?':
                                                no_headers = 1;
                                                php_output_startup();
-                                               php_output_activate();
+                                               php_output_activate(TSRMLS_C);
                                                SG(headers_sent) = 1;
                                                php_cgi_usage(argv[0]);
-                                               php_end_ob_buffers(1);
+                                               php_end_ob_buffers(1 TSRMLS_CC);
                                                exit(1);
                                                break;
                                }
@@ -554,10 +554,10 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
                                        case '?':
                                                no_headers = 1;  
                                                php_output_startup();
-                                               php_output_activate();
+                                               php_output_activate(TSRMLS_C);
                                                SG(headers_sent) = 1;
                                                php_cgi_usage(argv[0]);
-                                               php_end_ob_buffers(1);
+                                               php_end_ob_buffers(1 TSRMLS_CC);
                                                exit(1);
                                                break;
 
@@ -581,7 +581,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
 
                                case 'm': /* list compiled in modules */
                                        php_output_startup();
-                                       php_output_activate();
+                                       php_output_activate(TSRMLS_C);
                                        SG(headers_sent) = 1;
                                        php_printf("Running PHP %s\n%s\n", PHP_VERSION , get_zend_version());
                                        php_printf("[PHP Modules]\n");
@@ -590,7 +590,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
                                        /* zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) _print_module_info, NULL TSRMLS_CC); */
                                        php_printf("Not Implemented\n");
                                        php_printf("\n");
-                                       php_end_ob_buffers(1);
+                                       php_end_ob_buffers(1 TSRMLS_CC);
                                        exit(1);
                                        break;
 
@@ -619,7 +619,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
                                                        SG(request_info).no_headers = 1;
                                                }
                                                php_printf("%s\n", PHP_VERSION);
-                                               php_end_ob_buffers(1);
+                                               php_end_ob_buffers(1 TSRMLS_CC);
                                                exit(1);
                                                break;
 
index 0984dabe845af4e42ff57700a8ff42122fa73c0e..e0a3fe73841ff1aebae9ce1f0febcd307b5e565a 100644 (file)
@@ -91,7 +91,7 @@ static int parent = 1;
 static pid_t pgroup;
 
 
-static int sapi_fastcgi_ub_write(const char *str, uint str_length)
+static int sapi_fastcgi_ub_write(const char *str, uint str_length TSRMLS_DC)
 {
        uint sent = FCGX_PutStr( str, str_length, out );
        return sent;
index da0c303ebc10d505f75a4d7d8021b44c745f7a51..b272bd4ff8a54efa36c0dba26f3c08eedf30c93b 100644 (file)
@@ -199,11 +199,10 @@ static zend_module_entry php_isapi_module = {
 };
 
 
-static int sapi_isapi_ub_write(const char *str, uint str_length)
+static int sapi_isapi_ub_write(const char *str, uint str_length TSRMLS_DC)
 {
        DWORD num_bytes = str_length;
        LPEXTENSION_CONTROL_BLOCK ecb;
-       TSRMLS_FETCH();
        
        ecb = (LPEXTENSION_CONTROL_BLOCK) SG(server_context);
        if (ecb->WriteClient(ecb->ConnID, (char *) str, &num_bytes, HSE_IO_SYNC ) == FALSE) {
index e7633f07b61d0ffc1591f0473f6e5dbd37ac3f7d..9465db50769bd86f49afbdb53dc49adc49e6e385 100644 (file)
@@ -135,12 +135,11 @@ static nsapi_equiv nsapi_client[] = {
 static size_t nsapi_client_size = sizeof(nsapi_client)/sizeof(nsapi_client[0]);
 
 static int
-sapi_nsapi_ub_write(const char *str, unsigned int str_length)
+sapi_nsapi_ub_write(const char *str, unsigned int str_length TSRMLS_DC)
 {
        int retval;
        nsapi_request_context *rc;
 
-       TSRMLS_FETCH();
        rc = (nsapi_request_context *)SG(server_context);
        retval = net_write(rc->sn->csd, (char *)str, str_length);
        if (retval == IO_ERROR /*-1*/ || retval == IO_EOF /*0*/)
index c3aec39e9312d1eb9168f2e146343b922e7190cb..ff5cc6677ccdb75082698ecad454ce58eee555ec 100644 (file)
@@ -57,10 +57,9 @@ php_phttpd_startup(sapi_module_struct *sapi_module)
 }
 
 static int
-php_phttpd_sapi_ub_write(const char *str, uint str_length)
+php_phttpd_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
 {
     int sent_bytes;
-       TSRMLS_FETCH();
 
        sent_bytes = fd_write(PHG(cip)->fd, str, str_length);
 
index cba147a7c2cca38f77d543de3f9ec8bd00fb867c..1e94b161a2416a4068a0c823d238a32803a5aed9 100644 (file)
@@ -133,11 +133,10 @@ static zend_module_entry php_pi3web_module = {
 };
 
 
-static int zend_pi3web_ub_write(const char *str, uint str_length)
+static int zend_pi3web_ub_write(const char *str, uint str_length TSRMLS_DC)
 {
        DWORD num_bytes = str_length;
        LPCONTROL_BLOCK cb;
-       TSRMLS_FETCH();
        
        cb = (LPCONTROL_BLOCK) SG(server_context);
 
index 9dd8708e8696b3ec8fbc725490a97656cb20d03d..81f67c43d088c29e53536e9f04cfd475ffeaebb9 100644 (file)
@@ -211,13 +211,12 @@ INLINE static int lookup_integer_header(char *headername, int default_value)
  */
 
 static int
-php_roxen_low_ub_write(const char *str, uint str_length) {
+php_roxen_low_ub_write(const char *str, uint str_length TSRMLS_DC) {
   int sent_bytes = 0;
   struct pike_string *to_write = NULL;
 #ifdef ROXEN_USE_ZTS
   GET_THIS();
 #endif
-  TSRMLS_FETCH();
 
   if(!MY_FD_OBJ->prog) {
     PG(connection_status) = PHP_CONNECTION_ABORTED;
@@ -243,12 +242,11 @@ php_roxen_low_ub_write(const char *str, uint str_length) {
  */
 
 static int
-php_roxen_sapi_ub_write(const char *str, uint str_length)
+php_roxen_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
 {
 #ifdef ROXEN_USE_ZTS
   GET_THIS();
 #endif
-  TSRMLS_FETCH();
 
   int sent_bytes = 0, fd = MY_FD;
   if(fd)
@@ -276,7 +274,7 @@ php_roxen_sapi_ub_write(const char *str, uint str_length)
       }
     }
   } else {
-    THREAD_SAFE_RUN(sent_bytes = php_roxen_low_ub_write(str, str_length),
+    THREAD_SAFE_RUN(sent_bytes = php_roxen_low_ub_write(str, str_length TSRMLS_CC),
                    "write");
   }
   return sent_bytes;
index edfce72b81cec42d820b248fafc2fd642c448089..aaf4589b3fce92e38764e50d095acd120e54c775 100644 (file)
@@ -114,9 +114,8 @@ void ThrowServletException (JNIEnv *jenv, char *msg) {
  * sapi callbacks
  */
 
-static int sapi_servlet_ub_write(const char *str, uint str_length)
+static int sapi_servlet_ub_write(const char *str, uint str_length TSRMLS_DC)
 {
-       TSRMLS_FETCH();
        if (!SG(server_context)) {
                fprintf(stderr, str);
                return 0;
index 969836ceecb6dd80c3d4ffb756417dd26d1a003e..d14325db94d4e49a5dcb999dce6990f97f7a1c85 100644 (file)
@@ -43,11 +43,10 @@ static php_thttpd_globals thttpd_globals;
 #define TG(v) (thttpd_globals.v)
 #endif
 
-static int sapi_thttpd_ub_write(const char *str, uint str_length)
+static int sapi_thttpd_ub_write(const char *str, uint str_length TSRMLS_DC)
 {
        int n;
        uint sent = 0;  
-       TSRMLS_FETCH();
        
        while (str_length > 0) {
                n = send(TG(hc)->conn_fd, str, str_length, 0);
index 70199750fdb9c0ec0eec8901a9d8968283276a91..4d44b40728b9a83777eadacf0c0f2f9b8e446c9c 100644 (file)
@@ -49,11 +49,10 @@ static php_tux_globals tux_globals;
 
 #define TG(v) (tux_globals.v)
 
-static int sapi_tux_ub_write(const char *str, uint str_length)
+static int sapi_tux_ub_write(const char *str, uint str_length TSRMLS_DC)
 {
        int n;
        uint sent = 0;  
-       TSRMLS_FETCH();
        
        /* combine headers and body */
        if (TG(number_vec)) {