diff options
author | Andrei Zmievski <andrei@php.net> | 2000-10-20 18:25:16 +0000 |
---|---|---|
committer | Andrei Zmievski <andrei@php.net> | 2000-10-20 18:25:16 +0000 |
commit | 7b4983c8f82c4f361df787f58c6f5cf88d5def0b (patch) | |
tree | e38e8ffceb65a0f2492b28e2b07c8668fcddeda4 /ext/ingres_ii | |
parent | a0cfab65ea72963f81a3440a3587d11bd7800337 (diff) | |
download | php-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/ingres_ii')
-rw-r--r-- | ext/ingres_ii/ii.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/ext/ingres_ii/ii.c b/ext/ingres_ii/ii.c index 0a37691cf2..d7871f1e07 100644 --- a/ext/ingres_ii/ii.c +++ b/ext/ingres_ii/ii.c @@ -138,11 +138,7 @@ static int _rollback_transaction(II_LINK *link) return 0; } -/* closes the given link, actually disconnecting from server - and releasing associated resources after rolling back the - active transaction (if any) -*/ -static void _close_ii_link(II_LINK *link) +static void close_ii_link(II_LINK *link) { IIAPI_DISCONNPARM disconnParm; IILS_FETCH(); @@ -162,13 +158,25 @@ static void _close_ii_link(II_LINK *link) IIG(num_links)--; } +/* closes the given link, actually disconnecting from server + and releasing associated resources after rolling back the + active transaction (if any) +*/ +static void php_close_ii_link(zend_rsrc_list_entry *rsrc) +{ + II_LINK *link = (II_LINK *)rsrc->ptr; + close_ii_link(link); +} + + /* closes the given persistent link, see _close_ii_link */ -static void _close_ii_plink(II_LINK *link) +static void _close_ii_plink(zend_rsrc_list_entry *rsrc) { + II_LINK *link = (II_LINK *)rsrc->ptr; IILS_FETCH(); - _close_ii_link(link); + close_ii_link(link); IIG(num_persistent)--; } @@ -176,8 +184,9 @@ static void _close_ii_plink(II_LINK *link) used when the request ends to 'refresh' the link for use by the next request */ -static void _clean_ii_plink(II_LINK *link) +static void _clean_ii_plink(zend_rsrc_list_entry *rsrc) { + II_LINK *link = (II_LINK *)rsrc->ptr; IIAPI_AUTOPARM autoParm; IILS_FETCH(); @@ -247,8 +256,8 @@ PHP_MINIT_FUNCTION(ii) REGISTER_INI_ENTRIES(); - le_ii_link = register_list_destructors(_close_ii_link,NULL); - le_ii_plink = register_list_destructors(_clean_ii_plink,_close_ii_plink); + le_ii_link = register_list_destructors(php_close_ii_link,NULL,"ingres"); + le_ii_plink = register_list_destructors(_clean_ii_plink,php_close_ii_plink,"ingres persistent"); IIG(num_persistent) = 0; |