cvs: php-gtk /main php_gtk.c php_gtk.h php_gtk_object.c php_gtk_util.c

[email protected] ("Frank M. Kromann")
Newsgroups php.gtk
Message-ID <cvsfmk996539938@cvsserver>
fmk		Mon Jul 30 20:38:58 2001 EDT

  Modified files:              
    /php-gtk/main	php_gtk_util.c php_gtk_object.c php_gtk.h php_gtk.c 
  Log:
  Fixing ZTS compilation
fmk-20010730203858.txt (text/plain, 8.7 KB)
Index: php-gtk/main/php_gtk_util.c
diff -u php-gtk/main/php_gtk_util.c:1.19 php-gtk/main/php_gtk_util.c:1.20
--- php-gtk/main/php_gtk_util.c:1.19	Mon Jul 30 15:13:14 2001
+++ php-gtk/main/php_gtk_util.c	Mon Jul 30 20:38:58 2001
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-/* $Id: php_gtk_util.c,v 1.19 2001/07/30 19:13:14 andrei Exp $ */
+/* $Id: php_gtk_util.c,v 1.20 2001/07/31 00:38:58 fmk Exp $ */
 
 #include "php_gtk.h"
 
@@ -229,12 +229,13 @@
 	char buf[1024];
 	char errorbuf[1024];
 	char objtype[1024];
+	TSRMLS_FETCH();
 
 	expected_type = parse_arg_impl(arg, va, spec, errorbuf);
 	if (expected_type) {
 		if (!quiet) {
 			sprintf(buf, "%s() expects argument %d to be %s, %s given",
-					get_active_function_name(), arg_num, expected_type,
+					get_active_function_name(TSRMLS_C), arg_num, expected_type,
 					php_gtk_zval_type_name(*arg));
 			php_error(E_WARNING, buf);
 		}
@@ -251,6 +252,7 @@
 	int c, i;
 	int min_argc = -1;
 	int max_argc = 0;
+	TSRMLS_FETCH();
 
 	/*
 	 * First we check that the number of arguments matches the number specified
@@ -287,7 +289,7 @@
 	if (argc < min_argc || argc > max_argc) {
 		if (!quiet) {
 			sprintf(buf, "%s() requires %s %d argument%s, %d given",
-					get_active_function_name(),
+					get_active_function_name(TSRMLS_C),
 					min_argc == max_argc ? "exactly" : argc < min_argc ? "at least" : "at most",
 					argc < min_argc ? min_argc : max_argc,
 					(argc < min_argc ? min_argc : max_argc) == 1 ? "" : "s",
@@ -311,12 +313,13 @@
 {
 	zval ***args;
 	int retval;
+	TSRMLS_FETCH();
 
 	args = (zval ***)emalloc(argc * sizeof(zval **));
 
 	if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
 		php_error(E_WARNING, "Could not obtain arguments for parsing in %s",
-				  get_active_function_name());
+				  get_active_function_name(TSRMLS_C));
 		efree(args);
 		return 0;
 	}
@@ -493,12 +496,13 @@
 zval ***php_gtk_func_args(int argc)
 {
 	zval ***args;
+	TSRMLS_FETCH();
 
 	args = (zval ***)emalloc(argc * sizeof(zval **));
 
 	if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
 		php_error(E_WARNING, "Could not obtain arguments in %s",
-				  get_active_function_name());
+				  get_active_function_name(TSRMLS_C));
 		efree(args);
 		return NULL;
 	}
@@ -510,12 +514,13 @@
 {
 	zval ***args;
 	zval *hash;
+	TSRMLS_FETCH();
 
 	args = (zval ***)emalloc(argc * sizeof(zval **));
 
 	if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
 		php_error(E_WARNING, "Could not obtain arguments in %s",
-				  get_active_function_name());
+				  get_active_function_name(TSRMLS_C));
 		efree(args);
 		return NULL;
 	}
@@ -573,10 +578,12 @@
 {
 	int count = 0;
 	int level = 0;
+	TSRMLS_FETCH();
+
 	while (level > 0 || *format != endchar) {
 		switch (*format) {
 			case '\0':
-				php_error(E_WARNING, "%s(): internal error: unmatched parenthesis in format", get_active_function_name());
+				php_error(E_WARNING, "%s(): internal error: unmatched parenthesis in format", get_active_function_name(TSRMLS_C));
 				return -1;
 
 			case '(':
@@ -614,6 +621,7 @@
 static zval *php_gtk_build_single(char **format, va_list *va)
 {
 	zval *result;
+	TSRMLS_FETCH();
 
 	for (;;) {
 		switch (*(*format)++) {
@@ -678,7 +686,7 @@
 				break;
 
 			default:
-				php_error(E_WARNING, "%s(): internal error: bad format spec while building value", get_active_function_name());
+				php_error(E_WARNING, "%s(): internal error: bad format spec while building value", get_active_function_name(TSRMLS_C));
 				return NULL;
 		}
 	}
@@ -689,6 +697,7 @@
 	zval *result;
 	zval *single;
 	int i;
+	TSRMLS_FETCH();
 
 	if (count < 0)
 		return NULL;
@@ -734,7 +743,7 @@
 	}
 	if (**format != endchar) {
 		zval_ptr_dtor(&result);
-		php_error(E_WARNING, "%s(): internal error: unmatched parenthesis in format", get_active_function_name());
+		php_error(E_WARNING, "%s(): internal error: unmatched parenthesis in format", get_active_function_name(TSRMLS_C));
 		return NULL;
 	} else if (endchar)
 		++*format;
Index: php-gtk/main/php_gtk_object.c
diff -u php-gtk/main/php_gtk_object.c:1.43 php-gtk/main/php_gtk_object.c:1.44
--- php-gtk/main/php_gtk_object.c:1.43	Mon Jul 30 15:13:14 2001
+++ php-gtk/main/php_gtk_object.c	Mon Jul 30 20:38:58 2001
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-/* $Id: php_gtk_object.c,v 1.43 2001/07/30 19:13:14 andrei Exp $ */
+/* $Id: php_gtk_object.c,v 1.44 2001/07/31 00:38:58 fmk Exp $ */
 
 #include "php_gtk.h"
 
@@ -62,6 +62,7 @@
 	void *obj;
 	zval **handle;
 	int type;
+	TSRMLS_FETCH();
 	
 	if (Z_TYPE_P(wrapper) != IS_OBJECT) {
 		php_error(E_ERROR, "Wrapper is not an object");
@@ -217,7 +218,7 @@
 	
 	signal_args = php_gtk_hash_as_array(params);
 
-	call_user_function_ex(EG(function_table), NULL, *callback, &retval, zend_hash_num_elements(Z_ARRVAL_P(params)), signal_args, 1, NULL);
+	call_user_function_ex(EG(function_table), NULL, *callback, &retval, zend_hash_num_elements(Z_ARRVAL_P(params)), signal_args, 1, NULL TSRMLS_CC);
 
 	if (retval) {
 		if (args)
@@ -255,7 +256,7 @@
 	handler_args = php_gtk_hash_as_array(*extra);
 	num_handler_args = zend_hash_num_elements(Z_ARRVAL_PP(extra));
 
-	call_user_function_ex(EG(function_table), NULL, *callback, &retval, num_handler_args, handler_args, 1, NULL);
+	call_user_function_ex(EG(function_table), NULL, *callback, &retval, num_handler_args, handler_args, 1, NULL TSRMLS_CC);
 
 	*GTK_RETLOC_BOOL(args[0]) = FALSE;
 	if (retval) {
@@ -296,7 +297,7 @@
 		php_array_merge(Z_ARRVAL_P(params), Z_ARRVAL_PP(extra), 0);
 	input_args = php_gtk_hash_as_array(params);
 
-	call_user_function_ex(EG(function_table), NULL, *callback, &retval, zend_hash_num_elements(Z_ARRVAL_P(params)), input_args, 1, NULL);
+	call_user_function_ex(EG(function_table), NULL, *callback, &retval, zend_hash_num_elements(Z_ARRVAL_P(params)), input_args, 1, NULL TSRMLS_CC);
 	if (retval)
 		zval_ptr_dtor(&retval);
 	efree(input_args);
@@ -438,6 +439,7 @@
 zval *php_gtk_arg_as_value(GtkArg *arg)
 {
 	zval *value;
+	TSRMLS_FETCH();
 
 	switch (GTK_FUNDAMENTAL_TYPE(arg->type)) {
 		case GTK_TYPE_INVALID:
@@ -508,7 +510,7 @@
 
 		case GTK_TYPE_POINTER:
 			php_error(E_WARNING, "%s(): internal error: GTK_TYPE_POINTER unsupported",
-					  get_active_function_name());
+					  get_active_function_name(TSRMLS_C));
 			return NULL;
 
 		case GTK_TYPE_BOXED:
@@ -730,6 +732,7 @@
 zval *php_gtk_ret_as_value(GtkArg *ret)
 {
 	zval *value;
+	TSRMLS_FETCH();
 
 	switch (GTK_FUNDAMENTAL_TYPE(ret->type)) {
 		case GTK_TYPE_INVALID:
@@ -798,7 +801,7 @@
 
 		case GTK_TYPE_POINTER:
 			php_error(E_WARNING, "%s(): internal error: GTK_TYPE_POINTER unsupported",
-					  get_active_function_name());
+					  get_active_function_name(TSRMLS_C));
 			return NULL;
 
 		case GTK_TYPE_BOXED:
Index: php-gtk/main/php_gtk.h
diff -u php-gtk/main/php_gtk.h:1.45 php-gtk/main/php_gtk.h:1.46
--- php-gtk/main/php_gtk.h:1.45	Mon Jul 30 15:13:14 2001
+++ php-gtk/main/php_gtk.h	Mon Jul 30 20:38:58 2001
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
  
-/* $Id: php_gtk.h,v 1.45 2001/07/30 19:13:14 andrei Exp $: */
+/* $Id: php_gtk.h,v 1.46 2001/07/31 00:38:58 fmk Exp $: */
 
 #ifndef _PHP_GTK_H
 #define _PHP_GTK_H
@@ -118,7 +118,7 @@
 
 #define NOT_STATIC_METHOD() \
 	if (!this_ptr) { \
-		php_error(E_WARNING, "%s() is not a static method", get_active_function_name()); \
+		php_error(E_WARNING, "%s() is not a static method", get_active_function_name(TSRMLS_C)); \
 		return; \
 	}
 
Index: php-gtk/main/php_gtk.c
diff -u php-gtk/main/php_gtk.c:1.15 php-gtk/main/php_gtk.c:1.16
--- php-gtk/main/php_gtk.c:1.15	Mon Jul 30 15:13:14 2001
+++ php-gtk/main/php_gtk.c	Mon Jul 30 20:38:58 2001
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
  
-/* $Id: php_gtk.c,v 1.15 2001/07/30 19:13:14 andrei Exp $: */
+/* $Id: php_gtk.c,v 1.16 2001/07/31 00:38:58 fmk Exp $: */
 
 #include "php_gtk.h"
 #include "SAPI.h"
@@ -85,7 +85,7 @@
 	zend_hash_init_ex(&php_gtk_rsrc_hash, 50, NULL, NULL, 1, 0);
 	zend_hash_init_ex(&php_gtk_type_hash, 50, NULL, NULL, 1, 0);
 	
-	zend_unset_timeout();
+	zend_unset_timeout(TSRMLS_C);
 	zend_set_timeout(0);
 
 	if (php_gtk_startup_all_extensions(module_number) == FAILURE) {
@@ -126,13 +126,13 @@
 
 PHP_FUNCTION(wrap_no_constructor)
 {
- 	php_error(E_WARNING, "%s: An abstract or unimplemented class", get_active_function_name());
+ 	php_error(E_WARNING, "%s: An abstract or unimplemented class", get_active_function_name(TSRMLS_C));
 	php_gtk_invalidate(this_ptr);
 }
 
 PHP_FUNCTION(wrap_no_direct_constructor)
 {
-	php_error(E_WARNING, "Class %s cannot be constructed directly", get_active_function_name());
+	php_error(E_WARNING, "Class %s cannot be constructed directly", get_active_function_name(TSRMLS_C));
 	php_gtk_invalidate(this_ptr);
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.