- no more "Unknown" resources. All resources have names now

pp [2005-01-09 23:32:11]
- no more "Unknown" resources. All resources have names now
- maintainer notice added


git-svn-id: https://siedziba.pl:790/svn/repos/php-imlib/trunk@96 455248ca-bdda-0310-9134-f4ebb693071a
Filename
php_imlib.c
php_imlib.h
diff --git a/php_imlib.c b/php_imlib.c
index 5f19195..07a3e0a 100644
--- a/php_imlib.c
+++ b/php_imlib.c
@@ -12,7 +12,8 @@
    | obtain it through the world-wide-web, please send a note to          |
    | license@php.net so we can mail you a copy immediately.               |
    +----------------------------------------------------------------------+
-   | Authors: Matt McClanahan <cardinal@dodds.net>                        |
+   | Original author: Matt McClanahan <cardinal@dodds.net>                |
+   | Current maintainer: Piotr Pawlow <pp@siedziba.pl>                    |
    +----------------------------------------------------------------------+
  */

@@ -209,41 +210,39 @@ PHP_INI_MH(OnUpdateFontCacheSize)
     }
 }

-static void _php_imlib_free_cm(PHP_Imlib_Color_Modifier mod)
+static void _php_imlib_free_cm(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
-   imlib_context_set_color_modifier(mod->cm);
+   imlib_context_set_color_modifier(rsrc->ptr);
    imlib_free_color_modifier();
-   efree(mod);
 }

-static void _php_imlib_free_filter(Imlib_Filter fil)
+static void _php_imlib_free_filter(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
-   imlib_context_set_filter(fil);
+   imlib_context_set_filter(rsrc->ptr);
    imlib_free_filter();
 }

-static void _php_imlib_free_cr(Imlib_Color_Range cr)
+static void _php_imlib_free_cr(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
-   imlib_context_set_color_range(cr);
+   imlib_context_set_color_range(rsrc->ptr);
    imlib_free_color_range();
 }

-static void _php_imlib_free_font(PHP_Imlib_Font fn)
+static void _php_imlib_free_font(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
-   imlib_context_set_font(fn->font);
+   imlib_context_set_font(rsrc->ptr);
    imlib_free_font();
-   efree(fn);
 }

-static void _php_imlib_free_img(Imlib_Image im)
+static void _php_imlib_free_img(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
-   imlib_context_set_image(im);
+   imlib_context_set_image(rsrc->ptr);
    imlib_free_image();
 }

-static void _php_imlib_free_poly(ImlibPolygon poly)
+static void _php_imlib_free_poly(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
-   imlib_polygon_free(poly);
+   imlib_polygon_free(rsrc->ptr);
 }

 void _php_imlib_set_cache_size(int size TSRMLS_DC)
@@ -583,12 +582,12 @@ ZEND_MODULE_STARTUP_D(imlib)
 {
 	ZEND_INIT_MODULE_GLOBALS(imlib, php_imlib_init_globals, NULL);

-	le_imlib_cr = register_list_destructors(_php_imlib_free_cr,NULL);
-	le_imlib_font = register_list_destructors(_php_imlib_free_font,NULL);
-	le_imlib_img = register_list_destructors(_php_imlib_free_img,NULL);
-	le_imlib_poly = register_list_destructors(_php_imlib_free_poly,NULL);
-	le_imlib_filter = register_list_destructors(_php_imlib_free_filter,NULL);
-	le_imlib_cm = register_list_destructors(_php_imlib_free_cm,NULL);
+	le_imlib_cr = zend_register_list_destructors_ex(_php_imlib_free_cr,NULL,"imlib color range",module_number);
+	le_imlib_font = zend_register_list_destructors_ex(_php_imlib_free_font,NULL,"imlib font",module_number);
+	le_imlib_img = zend_register_list_destructors_ex(_php_imlib_free_img,NULL,"imlib image",module_number);
+	le_imlib_poly = zend_register_list_destructors_ex(_php_imlib_free_poly,NULL,"imlib polygon",module_number);
+	le_imlib_filter = zend_register_list_destructors_ex(_php_imlib_free_filter,NULL,"imlib filter",module_number);
+	le_imlib_cm = zend_register_list_destructors_ex(_php_imlib_free_cm,NULL,"imlib color modifier",module_number);
 #if HAVE_LIBT1
         T1_SetBitmapPad(8);
         T1_InitLib(NO_LOGFILE|IGNORE_CONFIGFILE|IGNORE_FONTDATABASE);
diff --git a/php_imlib.h b/php_imlib.h
index 0d188ed..5f66094 100644
--- a/php_imlib.h
+++ b/php_imlib.h
@@ -12,7 +12,8 @@
    | obtain it through the world-wide-web, please send a note to          |
    | license@php.net so we can mail you a copy immediately.               |
    +----------------------------------------------------------------------+
-   | Authors: Matt McClanahan <cardinal@dodds.net>                        |
+   | Original author: Matt McClanahan <cardinal@dodds.net>                |
+   | Current maintainer: Piotr Pawlow <pp@siedziba.pl>                    |
    +----------------------------------------------------------------------+
  */
ViewGit