diff options
author | Zeev Suraski <zeev@php.net> | 2001-07-31 04:53:54 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2001-07-31 04:53:54 +0000 |
commit | d76cf1da183f79711d7699a2ff85f743da3f9dd2 (patch) | |
tree | 8342fd3406696bc32b81deb28d6771336fb6fe36 /sapi | |
parent | 7bc71f442d7ddfecf43871b394c14100baa391b3 (diff) | |
download | php-git-d76cf1da183f79711d7699a2ff85f743da3f9dd2.tar.gz |
More TSRMLS_FETCH work
Diffstat (limited to 'sapi')
-rw-r--r-- | sapi/apache/mod_php4.c | 6 | ||||
-rw-r--r-- | sapi/cgi/cgi_main.c | 17 | ||||
-rw-r--r-- | sapi/fastcgi/fastcgi.c | 2 | ||||
-rw-r--r-- | sapi/isapi/php4isapi.c | 12 | ||||
-rw-r--r-- | sapi/pi3web/pi3web_sapi.c | 10 | ||||
-rw-r--r-- | sapi/servlet/servlet.c | 3 |
6 files changed, 24 insertions, 26 deletions
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c index 9c2a86ddbc..52a65fd9c3 100644 --- a/sapi/apache/mod_php4.c +++ b/sapi/apache/mod_php4.c @@ -459,7 +459,7 @@ static void init_request_info(TSRMLS_D) /* {{{ php_apache_alter_ini_entries */ -static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry) +static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_DC) { zend_alter_ini_entry(per_dir_entry->key, per_dir_entry->key_length+1, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, PHP_INI_STAGE_ACTIVATE); return 0; @@ -493,8 +493,6 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) int retval; HashTable *per_dir_conf; TSRMLS_FETCH(); - TSRMLS_FETCH(); - TSRMLS_FETCH(); if (AP(in_request)) { zend_file_handle fh; @@ -521,7 +519,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php4_module); if (per_dir_conf) { - zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries); + zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); } /* If PHP parser engine has been turned off with an "engine off" diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 08ff40ce37..633576ea67 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -82,7 +82,8 @@ extern int ap_php_optind; #define OPTSTRING "aCc:d:ef:g:hilmnqs?vz:" -static int _print_module_info ( zend_module_entry *module, void *arg ) { +static int _print_module_info(zend_module_entry *module, void *arg TSRMLS_DC) +{ php_printf("%s\n", module->name); return 0; } @@ -135,7 +136,7 @@ static void sapi_cgibin_flush(void *server_context) } -static void sapi_cgi_send_header(sapi_header_struct *sapi_header, void *server_context) +static void sapi_cgi_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) { if (sapi_header) { PHPWRITE_H(sapi_header->header, sapi_header->header_len); @@ -344,10 +345,9 @@ static void define_command_line_ini_entry(char *arg) } -static void php_register_command_line_global_vars(char **arg) +static void php_register_command_line_global_vars(char **arg TSRMLS_DC) { char *var, *val; - TSRMLS_FETCH(); var = *arg; val = strchr(var, '='); @@ -585,9 +585,10 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine SG(headers_sent) = 1; php_printf("Running PHP %s\n%s\n", PHP_VERSION , get_zend_version()); php_printf("[PHP Modules]\n"); - zend_hash_apply_with_argument(&module_registry, (int (*)(void *, void *)) _print_module_info, NULL); - php_printf("\n[Zend Modules]\n"); - zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) _print_module_info, NULL); + zend_hash_apply_with_argument(&module_registry, (apply_func_arg_t) _print_module_info, NULL TSRMLS_CC); + php_printf("\n[Zend Modules]\n"); + /* 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); exit(1); @@ -681,7 +682,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine file_handle.free_filename = 0; /* This actually destructs the elements of the list - ugly hack */ - zend_llist_apply(&global_vars, (llist_apply_func_t) php_register_command_line_global_vars); + zend_llist_apply(&global_vars, (llist_apply_func_t) php_register_command_line_global_vars TSRMLS_CC); zend_llist_destroy(&global_vars); if (!cgi) { diff --git a/sapi/fastcgi/fastcgi.c b/sapi/fastcgi/fastcgi.c index c6f1e5bb84..3050bcd6ac 100644 --- a/sapi/fastcgi/fastcgi.c +++ b/sapi/fastcgi/fastcgi.c @@ -106,7 +106,7 @@ static void sapi_fastcgi_flush( void *server_context ) } -static void sapi_fastcgi_send_header(sapi_header_struct *sapi_header, void *server_context) +static void sapi_fastcgi_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) { if( sapi_header ) { #ifdef DEBUG_FASTCGI diff --git a/sapi/isapi/php4isapi.c b/sapi/isapi/php4isapi.c index 6bfaafd586..145e45cd26 100644 --- a/sapi/isapi/php4isapi.c +++ b/sapi/isapi/php4isapi.c @@ -220,13 +220,13 @@ static int sapi_isapi_header_handler(sapi_header_struct *sapi_header, sapi_heade -static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length) +static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length TSRMLS_DC) { *total_length += sapi_header->header_len+2; } -static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr) +static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr TSRMLS_DC) { memcpy(*combined_headers_ptr, sapi_header->header, sapi_header->header_len); *combined_headers_ptr += sapi_header->header_len; @@ -249,18 +249,18 @@ static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* Obtain headers length */ if (SG(sapi_headers).send_default_content_type) { sapi_get_default_content_type_header(&default_content_type TSRMLS_CC); - accumulate_header_length(&default_content_type, (void *) &total_length); + accumulate_header_length(&default_content_type, (void *) &total_length TSRMLS_CC); } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (void (*)(void *, void *)) accumulate_header_length, (void *) &total_length); + zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length TSRMLS_CC); /* Generate headers */ combined_headers = (char *) emalloc(total_length+1); combined_headers_ptr = combined_headers; if (SG(sapi_headers).send_default_content_type) { - concat_header(&default_content_type, (void *) &combined_headers_ptr); + concat_header(&default_content_type, (void *) &combined_headers_ptr TSRMLS_CC); sapi_free_header(&default_content_type); /* we no longer need it */ } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (void (*)(void *, void *)) concat_header, (void *) &combined_headers_ptr); + zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr TSRMLS_CC); *combined_headers_ptr++ = '\r'; *combined_headers_ptr++ = '\n'; *combined_headers_ptr = 0; diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c index 25f6b3f079..66c5be1783 100644 --- a/sapi/pi3web/pi3web_sapi.c +++ b/sapi/pi3web/pi3web_sapi.c @@ -157,13 +157,13 @@ static int sapi_pi3web_header_handler(sapi_header_struct *sapi_header, sapi_head -static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length) +static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length TSRMLS_DC) { *total_length += sapi_header->header_len+2; } -static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr) +static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr TSRMLS_DC) { memcpy(*combined_headers_ptr, sapi_header->header, sapi_header->header_len); *combined_headers_ptr += sapi_header->header_len; @@ -187,9 +187,9 @@ static int sapi_pi3web_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) if (SG(sapi_headers).send_default_content_type) { sapi_get_default_content_type_header(&default_content_type TSRMLS_CC); - accumulate_header_length(&default_content_type, (void *) &total_length); + accumulate_header_length(&default_content_type, (void *) &total_length TSRMLS_CC); } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (void (*)(void *, void *)) accumulate_header_length, (void *) &total_length); + zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length TSRMLS_CC); /* Generate headers */ combined_headers = (char *) emalloc(total_length+1); @@ -198,7 +198,7 @@ static int sapi_pi3web_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) concat_header(&default_content_type, (void *) &combined_headers_ptr); sapi_free_header(&default_content_type); /* we no longer need it */ } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (void (*)(void *, void *)) concat_header, (void *) &combined_headers_ptr); + zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr TSRMLS_CC); *combined_headers_ptr++ = '\r'; *combined_headers_ptr++ = '\n'; *combined_headers_ptr = 0; diff --git a/sapi/servlet/servlet.c b/sapi/servlet/servlet.c index d0c29fb23c..364d0c51b2 100644 --- a/sapi/servlet/servlet.c +++ b/sapi/servlet/servlet.c @@ -142,9 +142,8 @@ static int sapi_servlet_ub_write(const char *str, uint str_length) } -static void sapi_servlet_send_header(sapi_header_struct *sapi_header, void *server_context) +static void sapi_servlet_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) { - TSRMLS_FETCH(); if (!sapi_header) return; if (!SG(server_context)) return; |