summaryrefslogtreecommitdiff
path: root/ext/odbc
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:36:21 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:36:21 -0400
commitd29a4fd2dd3b5d4cf6e80b602544d7b71d794e76 (patch)
treeb38e2e5c6974b9a15f103e5cf884cba9fff90ef4 /ext/odbc
parenta88a88d0986a4a32288c102cdbfebd78d7e91d99 (diff)
downloadphp-d29a4fd2dd3b5d4cf6e80b602544d7b71d794e76.tar.gz
Imported Upstream version 5.2.0upstream/5.2.0
Diffstat (limited to 'ext/odbc')
-rw-r--r--ext/odbc/php_odbc.c47
-rw-r--r--ext/odbc/php_odbc_includes.h10
2 files changed, 25 insertions, 32 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 83f18c839..b843b3da0 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_odbc.c,v 1.189.2.4 2006/01/01 12:50:10 sniper Exp $ */
+/* $Id: php_odbc.c,v 1.189.2.4.2.1 2006/06/15 18:33:08 dmitry Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -130,6 +130,9 @@ zend_function_entry odbc_functions[] = {
};
/* }}} */
+ZEND_DECLARE_MODULE_GLOBALS(odbc);
+static PHP_GINIT_FUNCTION(odbc);
+
/* {{{ odbc_module_entry
*/
zend_module_entry odbc_module_entry = {
@@ -142,16 +145,14 @@ zend_module_entry odbc_module_entry = {
PHP_RSHUTDOWN(odbc),
PHP_MINFO(odbc),
"1.0",
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(odbc),
+ PHP_GINIT(odbc),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
-#ifdef ZTS
-int odbc_globals_id;
-#else
-ZEND_API php_odbc_globals odbc_globals;
-#endif
-
#ifdef COMPILE_DL_ODBC
ZEND_GET_MODULE(odbc)
# ifdef PHP_WIN32
@@ -383,32 +384,30 @@ static PHP_INI_DISP(display_lrl)
*/
PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("odbc.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateLong,
- allow_persistent, php_odbc_globals, odbc_globals)
+ allow_persistent, zend_odbc_globals, odbc_globals)
STD_PHP_INI_ENTRY_EX("odbc.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong,
- max_persistent, php_odbc_globals, odbc_globals, display_link_nums)
+ max_persistent, zend_odbc_globals, odbc_globals, display_link_nums)
STD_PHP_INI_ENTRY_EX("odbc.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong,
- max_links, php_odbc_globals, odbc_globals, display_link_nums)
+ max_links, zend_odbc_globals, odbc_globals, display_link_nums)
STD_PHP_INI_ENTRY("odbc.default_db", NULL, PHP_INI_ALL, OnUpdateString,
- defDB, php_odbc_globals, odbc_globals)
+ defDB, zend_odbc_globals, odbc_globals)
STD_PHP_INI_ENTRY("odbc.default_user", NULL, PHP_INI_ALL, OnUpdateString,
- defUser, php_odbc_globals, odbc_globals)
+ defUser, zend_odbc_globals, odbc_globals)
STD_PHP_INI_ENTRY_EX("odbc.default_pw", NULL, PHP_INI_ALL, OnUpdateString,
- defPW, php_odbc_globals, odbc_globals, display_defPW)
+ defPW, zend_odbc_globals, odbc_globals, display_defPW)
STD_PHP_INI_ENTRY_EX("odbc.defaultlrl", "4096", PHP_INI_ALL, OnUpdateLong,
- defaultlrl, php_odbc_globals, odbc_globals, display_lrl)
+ defaultlrl, zend_odbc_globals, odbc_globals, display_lrl)
STD_PHP_INI_ENTRY_EX("odbc.defaultbinmode", "1", PHP_INI_ALL, OnUpdateLong,
- defaultbinmode, php_odbc_globals, odbc_globals, display_binmode)
+ defaultbinmode, zend_odbc_globals, odbc_globals, display_binmode)
STD_PHP_INI_BOOLEAN("odbc.check_persistent", "1", PHP_INI_SYSTEM, OnUpdateLong,
- check_persistent, php_odbc_globals, odbc_globals)
+ check_persistent, zend_odbc_globals, odbc_globals)
PHP_INI_END()
/* }}} */
-#ifdef ZTS
-static void php_odbc_init_globals(php_odbc_globals *odbc_globals_p TSRMLS_DC)
+static PHP_GINIT_FUNCTION(odbc)
{
- ODBCG(num_persistent) = 0;
+ odbc_globals->num_persistent = 0;
}
-#endif
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(odbc)
@@ -418,12 +417,6 @@ PHP_MINIT_FUNCTION(odbc)
RETCODE rc;
#endif
-#ifdef ZTS
- ts_allocate_id(&odbc_globals_id, sizeof(php_odbc_globals), php_odbc_init_globals, NULL);
-#else
- ODBCG(num_persistent) = 0;
-#endif
-
REGISTER_INI_ENTRIES();
le_result = zend_register_list_destructors_ex(_free_odbc_result, NULL, "odbc result", module_number);
le_conn = zend_register_list_destructors_ex(_close_odbc_conn, NULL, "odbc link", module_number);
diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h
index 2bec71a2e..f35a1c417 100644
--- a/ext/odbc/php_odbc_includes.h
+++ b/ext/odbc/php_odbc_includes.h
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_odbc_includes.h,v 1.12.2.1 2006/01/01 12:50:10 sniper Exp $ */
+/* $Id: php_odbc_includes.h,v 1.12.2.1.2.2 2006/06/19 16:13:15 tony2001 Exp $ */
#ifndef PHP_ODBC_INCLUDES_H
#define PHP_ODBC_INCLUDES_H
@@ -249,7 +249,7 @@ typedef struct odbc_result {
odbc_connection *conn_ptr;
} odbc_result;
-typedef struct {
+ZEND_BEGIN_MODULE_GLOBALS(odbc)
char *defDB;
char *defUser;
char *defPW;
@@ -266,7 +266,7 @@ typedef struct {
char lasterrormsg[SQL_MAX_MESSAGE_LENGTH];
HashTable *resource_list;
HashTable *resource_plist;
-} php_odbc_globals;
+ZEND_END_MODULE_GLOBALS(odbc)
int odbc_add_result(HashTable *list, odbc_result *result);
odbc_result *odbc_get_result(HashTable *list, int count);
@@ -284,10 +284,10 @@ void odbc_sql_error(ODBC_SQL_ERROR_PARAMS);
#define IS_SQL_BINARY(x) (x == SQL_BINARY || x == SQL_VARBINARY || x == SQL_LONGVARBINARY)
#ifdef ZTS
-# define ODBCG(v) TSRMG(odbc_globals_id, php_odbc_globals *, v)
+# define ODBCG(v) TSRMG(odbc_globals_id, zend_odbc_globals *, v)
#else
# define ODBCG(v) (odbc_globals.v)
-extern ZEND_API php_odbc_globals odbc_globals;
+extern ZEND_API zend_odbc_globals odbc_globals;
#endif
#endif /* HAVE_UODBC */