diff options
author | Dmitry Stogov <dmitry@php.net> | 2006-06-15 18:33:09 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2006-06-15 18:33:09 +0000 |
commit | 1dbaae2795b756a3875c53da00b277f241cc04b8 (patch) | |
tree | fd516b57354eb9480e89dcd0503fa990d3cc2068 /ext/pdo_dblib/pdo_dblib.c | |
parent | c3ed91477a011e494559d6f65301ef6b2e38cd22 (diff) | |
download | php-git-1dbaae2795b756a3875c53da00b277f241cc04b8.tar.gz |
Added automatic module globals management
Diffstat (limited to 'ext/pdo_dblib/pdo_dblib.c')
-rw-r--r-- | ext/pdo_dblib/pdo_dblib.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c index eb2e886ce8..68f3da8c7e 100644 --- a/ext/pdo_dblib/pdo_dblib.c +++ b/ext/pdo_dblib/pdo_dblib.c @@ -33,6 +33,7 @@ #include "zend_exceptions.h" ZEND_DECLARE_MODULE_GLOBALS(dblib) +static PHP_GINIT_FUNCTION(dblib) zend_function_entry pdo_dblib_functions[] = { {NULL, NULL, NULL} @@ -66,7 +67,11 @@ zend_module_entry pdo_dblib_module_entry = { PHP_RSHUTDOWN(pdo_dblib), PHP_MINFO(pdo_dblib), "1.0.1", - STANDARD_MODULE_PROPERTIES + PHP_MODULE_GLOBASLS(dblib), + PHP_GINIT(dblib), + NULL, + NULL, + STANDARD_MODULE_PROPERTIES_EX }; #if defined(COMPILE_DL_PDO_DBLIB) || defined(COMPILE_DL_PDO_MSSQL) @@ -146,11 +151,10 @@ int msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, return 0; } -static int init_dblib_globals(zend_dblib_globals *g) +static PHP_GINIT_FUNCTION(dblib) { - memset(g, 0, sizeof(*g)); - g->err.sqlstate = g->sqlstate; - return SUCCESS; + memset(dblib_globals, 0, sizeof(*dblib_globals)); + dblib_globals->err.sqlstate = dblib_globals->sqlstate; } PHP_RSHUTDOWN_FUNCTION(pdo_dblib) @@ -180,8 +184,6 @@ PHP_MINIT_FUNCTION(pdo_dblib) return FAILURE; } - ZEND_INIT_MODULE_GLOBALS(dblib, init_dblib_globals, NULL); - /* TODO: dbsetifile() |