cvs: php4 /ext/sablot php_sablot.h sablot.c /main php.h
| From: | Rasmus Lerdorf | Date: | Fri, 10 Aug 2001 09:48:48 +0000 |
| Subject: | cvs: php4 /ext/sablot php_sablot.h sablot.c /main php.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6693@lists.php.net to get a copy of this message | ||
rasmus Fri Aug 10 05:48:48 2001 EDT
Modified files:
/php4/ext/sablot php_sablot.h sablot.c
/php4/main php.h
Log:
Sablot extension cleanup - it compiles again now
Index: php4/ext/sablot/php_sablot.h
diff -u php4/ext/sablot/php_sablot.h:1.16 php4/ext/sablot/php_sablot.h:1.17
--- php4/ext/sablot/php_sablot.h:1.16 Sat Jul 28 07:36:11 2001
+++ php4/ext/sablot/php_sablot.h Fri Aug 10 05:48:47 2001
@@ -108,7 +108,7 @@
/* Sablotron Globals */
-typedef struct {
+typedef struct _php_sablot_globals {
zval *errorHandler;
php_sablot_error *errors;
php_sablot_error errors_start;
Index: php4/ext/sablot/sablot.c
diff -u php4/ext/sablot/sablot.c:1.48 php4/ext/sablot/sablot.c:1.49
--- php4/ext/sablot/sablot.c:1.48 Sun Aug 5 11:29:37 2001
+++ php4/ext/sablot/sablot.c Fri Aug 10 05:48:47 2001
@@ -166,12 +166,7 @@
_php_sablot_sh_close
};
-#ifdef ZTS
-int sablot_globals_id;
-#else
-php_sablot_globals sablot_globals;
-#endif
-
+PHP_DECLARE_MODULE_GLOBALS(sablot)
static unsigned char sixth_arg_force_ref[] = { 6, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_NONE,
BYREF_NONE, BYREF_FORCE };
static unsigned char third_arg_force_ref[] = { 4, BYREF_NONE, BYREF_NONE, BYREF_FORCE, BYREF_NONE
};
@@ -214,12 +209,12 @@
ZEND_GET_MODULE(sablot)
#endif
-static void php_sablot_init_globals(php_sablot_init_globals *sablot_init_globals_p TSRMLS_DC)
+static void php_sablot_init_globals(php_sablot_globals *sablot_globals)
{
- SABLOTG(processor) = NULL;
- SABLOTG(errors) = NULL;
- SABLOTG(errorHandler) = NULL;
- SABLOTG(output_transform_file) = NULL;
+ sablot_globals->processor = NULL;
+ sablot_globals->errors = NULL;
+ sablot_globals->errorHandler = NULL;
+ sablot_globals->output_transform_file = NULL;
}
@@ -248,7 +243,9 @@
PHP_RSHUTDOWN_FUNCTION(sablot)
{
+ /*
SABLOT_FREE_ERROR_HANDLE(SABLOTG_HANDLE);
+ */
return SUCCESS;
}
@@ -1349,7 +1346,9 @@
TSRMLS_FETCH();
if (userData == NULL) {
+ /* **FIXME** SABLOTG_HANDLE is not defined anywhere -RL
SABLOT_FREE_ERROR_HANDLE(SABLOTG_HANDLE);
+ */
SABLOTG(errors_start).next = NULL;
SABLOTG(errors) = &SABLOTG(errors_start);
Index: php4/main/php.h
diff -u php4/main/php.h:1.148 php4/main/php.h:1.149
--- php4/main/php.h:1.148 Sun Aug 5 12:21:32 2001
+++ php4/main/php.h Fri Aug 10 05:48:48 2001
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php.h,v 1.148 2001/08/05 16:21:32 sas Exp $ */
+/* $Id: php.h,v 1.149 2001/08/10 09:48:48 rasmus Exp $ */
#ifndef PHP_H
#define PHP_H
@@ -228,6 +228,30 @@
#define PHP_RSHUTDOWN_FUNCTION(module) int PHP_RSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS)
#define PHP_MINFO_FUNCTION(module) void PHP_MINFO(module)(ZEND_MODULE_INFO_FUNC_ARGS)
+#define PHP_BEGIN_MODULE_GLOBALS(module_name) \
+ typedef struct _php_##module_name##_globals {
+#define PHP_END_MODULE_GLOBALS(module_name) \
+ } php_##module_name##_globals;
+
+#ifdef ZTS
+
+#define PHP_DECLARE_MODULE_GLOBALS(module_name) \
+ ts_rsrc_id module_name##_globals_id;
+#define PHP_EXTERN_MODULE_GLOBALS(module_name) \
+ extern ts_rsrc_id module_name##_globals_id;
+#define PHP_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
+ ts_allocate_id(&module_name##_globals_id, sizeof(php_##module_name##_globals),
(ts_allocate_ctor) globals_ctor, (ts_allocate_dtor) globals_dtor);
+
+#else
+
+#define PHP_DECLARE_MODULE_GLOBALS(module_name) \
+ php_##module_name##_globals module_name##_globals;
+#define PHP_EXTERN_MODULE_GLOBALS(module_name) \
+ extern php_##module_name##_globals module_name##_globals;
+#define PHP_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
+ globals_ctor(&module_name##_globals);
+
+#endif
/* global variables */
extern pval *data;