From: Dan Kalowsky Date: Fri, 17 Nov 2000 15:09:46 +0000 (+0000) Subject: Corrected the spelling of verion to version, and cleaned the configuration X-Git-Tag: php-4.0.4RC3~173 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3e2ddd1edf98404a462af810e8e51a0994c45771;p=php Corrected the spelling of verion to version, and cleaned the configuration code up a bit. Also added in much better (read: tested) support for Solid 3.0. Credit for almost all of the patch goes to Eric Veldhuyzen, minor modifications done (by me) to make it non-linux specific. This commit also creates the HAVE_SOLID_30 define @ Fixed/created support for Solid 3.0 databases (kalowsky) @ Fixed support for Solid 2.3 databases (kalowsky) --- diff --git a/ext/odbc/config.m4 b/ext/odbc/config.m4 index 5a18d76847..44a48abe24 100644 --- a/ext/odbc/config.m4 +++ b/ext/odbc/config.m4 @@ -28,7 +28,7 @@ AC_DEFUN(AC_FIND_SOLID_LIBS,[ esac if test -f $1/scl${ac_solid_os}30.a; then - ac_solid_verion=30 + ac_solid_version=30 ac_solid_prefix=scl elif test -f $1/scl${ac_solid_os}23.a; then ac_solid_version=23 @@ -40,17 +40,8 @@ AC_DEFUN(AC_FIND_SOLID_LIBS,[ ODBC_LIBS=`echo $1/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so | cut -d' ' -f1` if test ! -f $ODBC_LIBS; then - echo $ODBC_LIBS ODBC_LIBS=`echo $1/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a | cut -d' ' -f1` fi - if test ! -f $ODBC_LIBS; then - echo $ODBC_LIBS - ODBC_LIBS=`echo $1/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so| cut -d' ' -f1` - fi - if test ! -f $ODBC_LIBS; then - $ODBC_LIBS - ODBC_LIBS=`echo $1/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a | cut -d' ' -f1` - fi if test ! -f $ODBC_LIBS; then ODBC_LIBS=`echo $1/bcl${ac_solid_os}*.so | cut -d' ' -f1` fi @@ -146,9 +137,13 @@ AC_ARG_WITH(solid, ODBC_LIBDIR=$withval/lib ODBC_INCLUDE=-I$ODBC_INCDIR ODBC_TYPE=solid - if test -f $ODBC_LIBDIR/libsolodbc.a; then + if test -f $ODBC_LIBDIR/soc*35.a; then AC_DEFINE(HAVE_SOLID_35,1,[ ]) - else + fi + if test -f $ODBC_LIBDIR/scl*30.a; then + AC_DEFINE(HAVE_SOLID_30,1,[ ]) + fi + if test -f $ODBC_LIBDIR/scl*23.a; then AC_DEFINE(HAVE_SOLID,1,[ ]) fi AC_MSG_RESULT(yes) diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 90a2a05d41..e37603aa07 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -100,11 +100,11 @@ function_entry odbc_functions[] = { PHP_FE(odbc_columns, NULL) PHP_FE(odbc_gettypeinfo, NULL) PHP_FE(odbc_primarykeys, NULL) -#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) /* not supported now */ +#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) &&!defined(HAVE_SOLID_35) /* not supported now */ PHP_FE(odbc_columnprivileges, NULL) PHP_FE(odbc_tableprivileges, NULL) #endif -#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) /* not supported */ +#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) /* not supported */ PHP_FE(odbc_foreignkeys, NULL) PHP_FE(odbc_procedures, NULL) PHP_FE(odbc_procedurecolumns, NULL) @@ -152,7 +152,7 @@ static void _free_odbc_result(zend_rsrc_list_entry *rsrc) res->values = NULL; } if (res->stmt) { -#if defined(HAVE_SOLID) || defined(HAVE_SOLID_35) +#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_SOLID_35) SQLTransact(res->conn_ptr->henv, res->conn_ptr->hdbc, (UWORD)SQL_COMMIT); #endif @@ -610,12 +610,12 @@ static int _close_pconn_with_id(list_entry *le, int *id) void odbc_column_lengths(INTERNAL_FUNCTION_PARAMETERS, int type) { odbc_result *result; -#if defined HAVE_SOLID - /* this seems to be necessary for Solid2.3 tested by tammy@synchronis.com - * Solid 2.3 does not seem to declare a SQLINTEGER, but it does declare - * a SQL_INTEGER which does not work (despite being the same type as a - * SDWORD. It is unknown if this is the same behavior for Solid3.0. - * Solid 3.5 does not have this problem. +#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) + /* this seems to be necessary for Solid2.3 ( tested by + * tammy@synchronis.com) and Solid 3.0 (tested by eric@terra.telemediair.nl) + * Solid does not seem to declare a SQLINTEGER, but it does declare a + * SQL_INTEGER which does not work (despite being the same type as a SDWORD. + * Solid 3.5 does not have this issue. */ SDWORD len; #else @@ -1427,7 +1427,7 @@ PHP_FUNCTION(odbc_fetch_into) } /* }}} */ -#if defined(HAVE_SOLID) || defined(HAVE_SOLID_35) +#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_SOLID_35) PHP_FUNCTION(solid_fetch_prev) { odbc_result *result; @@ -2599,7 +2599,7 @@ PHP_FUNCTION(odbc_columns) } /* }}} */ -#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) +#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) /* {{{ proto int odbc_columnprivileges(int connection_id, string catalog, string schema, string table, string column) Returns a result identifier that can be used to fetch a list of columns and associated privileges for the specified table */ PHP_FUNCTION(odbc_columnprivileges) @@ -2679,7 +2679,7 @@ PHP_FUNCTION(odbc_columnprivileges) /* }}} */ #endif /* HAVE_DBMAKER || HAVE_SOLID*/ -#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) +#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) /* {{{ proto int odbc_foreignkeys(int connection_id, string pk_qualifier, string pk_owner, string pk_table, string fk_qualifier, string fk_owner, string fk_table) Returns a result identifier to either a list of foreign keys in the specified table or a list of foreign keys in other tables that refer to the primary key in the specified table */ PHP_FUNCTION(odbc_foreignkeys) @@ -2926,7 +2926,7 @@ PHP_FUNCTION(odbc_primarykeys) } /* }}} */ -#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) +#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) /* {{{ proto int odbc_procedurecolumns(int connection_id [, string qualifier, string owner, string proc, string column]) Returns a result identifier containing the list of input and output parameters, as well as the columns that make up the result set for the specified procedures */ PHP_FUNCTION(odbc_procedurecolumns) @@ -3010,7 +3010,7 @@ PHP_FUNCTION(odbc_procedurecolumns) /* }}} */ #endif /* HAVE_SOLID */ -#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) +#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) /* {{{ proto int odbc_procedures(int connection_id [, string qualifier, string owner, string name]) Returns a result identifier containg the list of procedure names in a datasource */ PHP_FUNCTION(odbc_procedures) @@ -3263,7 +3263,7 @@ PHP_FUNCTION(odbc_statistics) } /* }}} */ -#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) +#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) /* {{{ proto int odbc_tableprivileges(int connection_id, string qualifier, string owner, string name) Returns a result identifier containing a list of tables and the privileges associated with each table */ PHP_FUNCTION(odbc_tableprivileges) diff --git a/ext/odbc/php_odbc.h b/ext/odbc/php_odbc.h index 4baf6a954a..9132c934eb 100644 --- a/ext/odbc/php_odbc.h +++ b/ext/odbc/php_odbc.h @@ -40,17 +40,20 @@ #if defined(HAVE_SOLID) #include #include - /*the following help for SOLID 3.0 */ + #include +#elif defined(HAVE_SOLID_30) + #include + #include #include #elif defined(HAVE_SOLID_35) #if !defined(PHP_WIN32) #include - #endif + #endif /* end: #if !defined(PHP_WIN32) */ #include #include #include #include -#endif +#endif /* end: #if defined(HAVE_SOLID) */ #undef HAVE_SQL_EXTENDED_FETCH PHP_FUNCTION(solid_fetch_prev); #define SQLSMALLINT SWORD