summaryrefslogtreecommitdiff
path: root/ext/interbase
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>2000-10-20 18:25:16 +0000
committerAndrei Zmievski <andrei@php.net>2000-10-20 18:25:16 +0000
commit7b4983c8f82c4f361df787f58c6f5cf88d5def0b (patch)
treee38e8ffceb65a0f2492b28e2b07c8668fcddeda4 /ext/interbase
parenta0cfab65ea72963f81a3440a3587d11bd7800337 (diff)
downloadphp-git-7b4983c8f82c4f361df787f58c6f5cf88d5def0b.tar.gz
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)
Diffstat (limited to 'ext/interbase')
-rw-r--r--ext/interbase/interbase.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index c248b012bf..f7dd013f7d 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -332,10 +332,16 @@ static void _php_ibase_commit_link(ibase_db_link *link)
}
/* }}} */
+static void php_ibase_commit_link_rsrc(zend_rsrc_list_entry *rsrc)
+{
+ ibase_db_link *link = (ibase_db_link *)rsrc->ptr;
+ _php_ibase_commit_link(link);
+}
/* {{{ _php_ibase_close_link() */
-static void _php_ibase_close_link(ibase_db_link *link)
+static void _php_ibase_close_link(zend_rsrc_list_entry *rsrc)
{
+ ibase_db_link *link = (ibase_db_link *)rsrc->ptr;
IBLS_FETCH();
_php_ibase_commit_link(link);
@@ -348,8 +354,9 @@ static void _php_ibase_close_link(ibase_db_link *link)
/* {{{ _php_ibase_close_plink() */
-static void _php_ibase_close_plink(ibase_db_link *link)
+static void _php_ibase_close_plink(zend_rsrc_list_entry *rsrc)
{
+ ibase_db_link *link = (ibase_db_link *)rsrc->ptr;
IBLS_FETCH();
_php_ibase_commit_link(link);
@@ -363,8 +370,9 @@ static void _php_ibase_close_plink(ibase_db_link *link)
/* {{{ _php_ibase_free_result() */
-static void _php_ibase_free_result(ibase_result *ib_result)
+static void _php_ibase_free_result(zend_rsrc_list_entry *rsrc)
{
+ ibase_result *ib_result = (ibase_result *)rsrc->ptr;
IBLS_FETCH();
IBDEBUG("Freeing result...");
@@ -426,10 +434,16 @@ static void _php_ibase_free_query(ibase_query *ib_query)
}
/* }}} */
+static void php_ibase_free_query_rsrc(zend_rsrc_list_entry *rsrc)
+{
+ ibase_query *query = (ibase_auery *)rsrc->ptr;
+ _php_ibase_free_query(query);
+}
/* {{{ _php_ibase_free_blob() */
-static void _php_ibase_free_blob(ibase_blob_handle *ib_blob)
+static void _php_ibase_free_blob(zend_rsrc_list_entry *rsrc)
{
+ ibase_blob_handle *ib_blob = (ibase_blob_handle *)rsrc->ptr;
IBLS_FETCH();
if (ib_blob->bl_handle != NULL) { /* blob open*/
@@ -443,8 +457,9 @@ static void _php_ibase_free_blob(ibase_blob_handle *ib_blob)
/* {{{ _php_ibase_free_trans() */
-static void _php_ibase_free_trans(ibase_tr_link *ib_trans)
+static void _php_ibase_free_trans(zend_rsrc_list_entry *rsrc)
{
+ ibase_tr_link *ib_trans = (ibase_tr_link *)rsrc->ptr;
ibase_db_link *ib_link;
IBLS_FETCH();
@@ -494,12 +509,12 @@ PHP_MINIT_FUNCTION(ibase)
REGISTER_INI_ENTRIES();
- le_result = register_list_destructors(_php_ibase_free_result, NULL);
- le_query = register_list_destructors(_php_ibase_free_query, NULL);
- le_blob = register_list_destructors(_php_ibase_free_blob, NULL);
- le_link = register_list_destructors(_php_ibase_close_link, NULL);
- le_plink = register_list_destructors(_php_ibase_commit_link, _php_ibase_close_plink);
- le_trans = register_list_destructors(_php_ibase_free_trans, NULL);
+ le_result = register_list_destructors(_php_ibase_free_result, NULL, "interbase result");
+ le_query = register_list_destructors(php_ibase_free_query_rsrc, NULL, "interbase query");
+ le_blob = register_list_destructors(_php_ibase_free_blob, NULL, "interbase blob");
+ le_link = register_list_destructors(_php_ibase_close_link, NULL, "interbase link");
+ le_plink = register_list_destructors(php_ibase_commit_link_rsrc, _php_ibase_close_plink, "interbase link persistent");
+ le_trans = register_list_destructors(_php_ibase_free_trans, NULL, "interbase transaction");
REGISTER_LONG_CONSTANT("IBASE_DEFAULT", PHP_IBASE_DEFAULT, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_TEXT", PHP_IBASE_TEXT, CONST_PERSISTENT);