From 7b4983c8f82c4f361df787f58c6f5cf88d5def0b Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Fri, 20 Oct 2000 18:25:16 +0000 Subject: Mega-patch to get better resource information for modules. * Fixed a bug in zend_rsrc_list_get_rsrc_type() * Switched register_list_destructors() to use zend_register_list_destructors_ex() instead * Updated all relevant modules to provide the resource type name to register_list_destructors() call * Updated var_dump() to output resource type name instead of number @- Made resource type names visible, e.g. var_dump() and @ get_resource_type() display "file" for file resources. (Andrei) --- ext/sablot/sablot.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ext/sablot/sablot.c') diff --git a/ext/sablot/sablot.c b/ext/sablot/sablot.c index 44c72adb70..747efaef53 100644 --- a/ext/sablot/sablot.c +++ b/ext/sablot/sablot.c @@ -32,7 +32,7 @@ #include "php_sablot.h" /* Functions related to PHP's list handling */ -static void _php_sablot_free_processor(php_sablot *); +static void _php_sablot_free_processor(zend_rsrc_list_entry *rsrc); /* SAX Handlers */ static void _php_sablot_handler_pair(php_sablot *, zval **, zval **, zval **); @@ -140,7 +140,7 @@ ZEND_GET_MODULE(sablot) PHP_MINIT_FUNCTION(sablot) { SABLOTLS_FETCH(); - SABLOTG(le_sablot) = register_list_destructors(_php_sablot_free_processor, NULL); + SABLOTG(le_sablot) = register_list_destructors(_php_sablot_free_processor, NULL, "sablotron"); return SUCCESS; } @@ -1058,8 +1058,9 @@ static MH_ERROR _php_sablot_error(void *userData, SablotHandle p, MH_ERROR code, /* {{{ _php_sablot_free_processor() Free a Sablot handle */ -static void _php_sablot_free_processor(php_sablot *handle) +static void _php_sablot_free_processor(zend_rsrc_list_entry *rsrc) { + php_sablot *handle = (php_sablot *)rsrc->ptr; if (handle->p) { SablotUnregHandler(handle->p, HLR_MESSAGE, NULL, NULL); SablotUnregHandler(handle->p, HLR_SAX, NULL, NULL); -- cgit v1.2.1