cvs: php4 /ext/odbc config.m4 php_odbc.c php_odbc.h

From: Date: Fri, 17 Nov 2000 15:09:46 +0000
Subject: cvs: php4 /ext/odbc config.m4 php_odbc.c php_odbc.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-2658@lists.php.net to get a copy of this message
kalowsky Fri Nov 17 07:09:46 2000 EDT Modified files: /php4/ext/odbc config.m4 php_odbc.c php_odbc.h Log: 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) Index: php4/ext/odbc/config.m4 diff -u php4/ext/odbc/config.m4:1.29 php4/ext/odbc/config.m4:1.30 --- php4/ext/odbc/config.m4:1.29 Sat Oct 21 04:11:11 2000 +++ php4/ext/odbc/config.m4 Fri Nov 17 07:09:46 2000 @@ -28,7 +28,7 @@ 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 @@ 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 @@ 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) Index: php4/ext/odbc/php_odbc.c diff -u php4/ext/odbc/php_odbc.c:1.63 php4/ext/odbc/php_odbc.c:1.64 --- php4/ext/odbc/php_odbc.c:1.63 Wed Oct 25 10:43:58 2000 +++ php4/ext/odbc/php_odbc.c Fri Nov 17 07:09:46 2000 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.c,v 1.63 2000/10/25 17:43:58 andrei Exp $ */ +/* $Id: php_odbc.c,v 1.64 2000/11/17 15:09:46 kalowsky Exp $ */ #include "php.h" #include "php_globals.h" @@ -100,11 +100,11 @@ 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 @@ 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 @@ 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 @@ } /* }}} */ -#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 @@ } /* }}} */ -#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 @@ /* }}} */ #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 @@ } /* }}} */ -#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 @@ /* }}} */ #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 @@ } /* }}} */ -#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) Index: php4/ext/odbc/php_odbc.h diff -u php4/ext/odbc/php_odbc.h:1.29 php4/ext/odbc/php_odbc.h:1.30 --- php4/ext/odbc/php_odbc.h:1.29 Mon Oct 30 10:00:58 2000 +++ php4/ext/odbc/php_odbc.h Fri Nov 17 07:09:46 2000 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.h,v 1.29 2000/10/30 18:00:58 derick Exp $ */ +/* $Id: php_odbc.h,v 1.30 2000/11/17 15:09:46 kalowsky Exp $ */ #ifndef PHP_ODBC_H #define PHP_ODBC_H @@ -40,17 +40,20 @@ #if defined(HAVE_SOLID) #include <cli0core.h> #include <cli0ext1.h> - /*the following help for SOLID 3.0 */ #include <cli0env.h> +#elif defined(HAVE_SOLID_30) + #include <cli0cli.h> + #include <cli0defs.h> + #include <cli0env.h> #elif defined(HAVE_SOLID_35) #if !defined(PHP_WIN32) #include <sqlunix.h> - #endif + #endif /* end: #if !defined(PHP_WIN32) */ #include <sqltypes.h> #include <sqlucode.h> #include <sqlext.h> #include <sql.h> -#endif +#endif /* end: #if defined(HAVE_SOLID) */ #undef HAVE_SQL_EXTENDED_FETCH PHP_FUNCTION(solid_fetch_prev); #define SQLSMALLINT SWORD

« previous php.cvs (#2658) next »