CVS update: php3/functions
| From: | fmk | Date: | Sun, 01 Nov 1998 23:23:26 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-2114@lists.php.net to get a copy of this message | ||
Date: Sunday November 1, 1998 @ 18:23
Author: fmk
Update of /repository/php3/functions
In directory asf:/u2/tmp/cvs-serv14933
Modified Files:
unified_odbc.c php3_unified_odbc.h
Log Message:
Adding support for IBM DB/2 UDB databases (CLI access)
Index: php3/functions/unified_odbc.c
diff -c php3/functions/unified_odbc.c:1.84 php3/functions/unified_odbc.c:1.85
*** php3/functions/unified_odbc.c:1.84 Thu Oct 29 00:53:51 1998
--- php3/functions/unified_odbc.c Sun Nov 1 18:23:25 1998
***************
*** 25,30 ****
--- 25,31 ----
+----------------------------------------------------------------------+
| Authors: Stig Sæther Bakken <ssb@guardian.no> |
| Andreas Karajannis <Andreas.Karajannis@gmd.de> |
+ | Frank M. Kromann <fmk@businessnet.dk> Support for DB/2 CLI |
+----------------------------------------------------------------------+
*/
***************
*** 55,61 ****
#include "head.h"
#include "snprintf.h"
! #if HAVE_UODBC
#ifdef THREAD_SAFE
--- 56,62 ----
#include "head.h"
#include "snprintf.h"
! #if HAVE_UODBC || HAVE_DB2
#ifdef THREAD_SAFE
***************
*** 158,164 ****
--- 159,167 ----
(UWORD)SQL_COMMIT);
#endif
SQLFreeStmt(res->stmt,SQL_DROP);
+ #if !HAVE_DB2
res->stmt = NULL;
+ #endif
}
efree(res);
}
***************
*** 172,178 ****
--- 175,183 ----
UODBC_CONNECTION *conn = ((UODBC_RESULT *) le->ptr)->conn_ptr;
if (!conn->open && ((UODBC_RESULT *) le->ptr)->stmt){
SQLFreeStmt(((UODBC_RESULT *) le->ptr)->stmt,SQL_DROP);
+ #if !HAVE_DB2
((UODBC_RESULT *) le->ptr)->stmt = NULL;
+ #endif
}
}
return 0;
***************
*** 379,386 ****
-
-
/*
* List management functions
*/
--- 384,389 ----
***************
*** 468,474 ****
--- 471,481 ----
return NULL;
}
+ #if HAVE_DB2
+ void UODBC_SQL_ERROR(SQLHANDLE conn, SQLHANDLE stmt, char *func)
+ #else
void UODBC_SQL_ERROR(HDBC conn, HSTMT stmt, char *func)
+ #endif
{
char state[6]; /* Not used */
SDWORD error; /* Not used */
Index: php3/functions/php3_unified_odbc.h
diff -c php3/functions/php3_unified_odbc.h:1.34 php3/functions/php3_unified_odbc.h:1.35
*** php3/functions/php3_unified_odbc.h:1.34 Thu Oct 29 00:53:50 1998
--- php3/functions/php3_unified_odbc.h Sun Nov 1 18:23:26 1998
***************
*** 25,40 ****
+----------------------------------------------------------------------+
| Authors: Stig Sæther Bakken <ssb@guardian.no> |
| Andreas Karajannis <Andreas.Karajannis@gmd.de> |
+----------------------------------------------------------------------+
*/
! /* $Id: php3_unified_odbc.h,v 1.34 1998/10/29 05:53:50 shane Exp $ */
#ifndef _UNIFIED_ODBC_H
#define _UNIFIED_ODBC_H
! #if HAVE_UODBC
/* ODBC_UNIQUE_NAMES should be defined in config.h if you are
* compiling more than one of any of the uodbc databases
* this will give each module unique function names
--- 25,48 ----
+----------------------------------------------------------------------+
| Authors: Stig Sæther Bakken <ssb@guardian.no> |
| Andreas Karajannis <Andreas.Karajannis@gmd.de> |
+ | Frank M. Kromann <fmk@businessnet.dk> Support for DB/2 CLI |
+----------------------------------------------------------------------+
*/
! /* $Id: php3_unified_odbc.h,v 1.35 1998/11/01 23:23:26 fmk Exp $ */
#ifndef _UNIFIED_ODBC_H
#define _UNIFIED_ODBC_H
! /* Support for IBM DB/2 UDB on Windows NT, OS/2 and AIX
! * define HAVE_DB2 in config.h or config.w32.h
! * add sqllib/include to the include path (IBM files)
! * link with db2cli.lib
! *
! * /
+ #if HAVE_UODBC || HAVE_DB2
+
/* ODBC_UNIQUE_NAMES should be defined in config.h if you are
* compiling more than one of any of the uodbc databases
* this will give each module unique function names
***************
*** 128,133 ****
--- 136,160 ----
# define ODBC_INI_VAR(a) ODBC_INI_VAR_NAME(codbc.##a)
# endif
+ #elif HAVE_DB2
+ # define HAVE_SQL_EXTENDED_FETCH 1
+ # include <sqlcli1.h>
+ # ifdef DB268K
+ /* Need to include ASLM for 68K applications */
+ # include <LibraryManager.h>
+ # endif
+ # if defined(UODBC_UNIQUE_NAMES)
+ # define UODBC_TYPE db2
+ # define UODBC_FE(name, arg_types) UODBC_NAMED_FE(db2_##name, php3_db2_##name, arg_types)
+ # define UODBC_FUNCTION(name) UODBC_NAMED_FUNCTION(php3_db2_##name)
+ # define UODBC_FNAME(name) php3i_db2_##name
+ # define ODBC_INI_VAR_NAME(name) #name
+ # define ODBC_INI_VAR(a) ODBC_INI_VAR_NAME(db2.##a)
+ # define UODBC_VAR_NAME(name) name
+ # define UODBC_VAR(a) UODBC_VAR_NAME(db2_##a)
+ # define PHP3_UODBC_VAR(a) UODBC_VAR_NAME(php3_db2_##a)
+ # endif
+
# else /* MS ODBC */
# define HAVE_SQL_EXTENDED_FETCH 1
# include <WINDOWS.H>
***************
*** 241,247 ****
--- 268,278 ----
extern UODBC_FUNCTION(longreadlen);
typedef struct UODBC_CONNECTION {
+ #if HAVE_DB2
+ SQLHANDLE hdbc;
+ #else
HDBC hdbc;
+ #endif
int open;
} UODBC_CONNECTION;
***************
*** 253,259 ****
--- 284,294 ----
} UODBC_RESULT_VALUE;
typedef struct UODBC_RESULT {
+ #if HAVE_DB2
+ SQLHANDLE stmt;
+ #else
HSTMT stmt;
+ #endif
UODBC_RESULT_VALUE *values;
SWORD numcols;
SWORD numparams;
***************
*** 267,273 ****
--- 302,312 ----
} UODBC_RESULT;
typedef struct {
+ #if HAVE_DB2
+ SQLHANDLE henv;
+ #else
HENV henv;
+ #endif
char *defDB;
char *defUser;
char *defPW;
***************
*** 294,300 ****
--- 333,343 ----
int UODBC_ADD_CONN(HashTable *list, HDBC conn);
UODBC_CONNECTION *UODBC_GET_CONN(HashTable *list, int count);
void UODBC_DEL_CONN(HashTable *list, int ind);
+ #if HAVE_DB2
+ void UODBC_SQL_ERROR(SQLHANDLE conn, SQLHANDLE stmt, char *func);
+ #else
void UODBC_SQL_ERROR(HDBC conn, HSTMT stmt, char *func);
+ #endif
int UODBC_BINDCOLS(UODBC_RESULT *result);
#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR)
***************
*** 303,309 ****
#else
# define uodbc_module_ptr NULL
! #endif /* HAVE_UODBC */
#endif /* _UNIFIED_ODBC_H */
--- 346,352 ----
#else
# define uodbc_module_ptr NULL
! #endif /* HAVE_UODBC || HAVE_DB2 */
#endif /* _UNIFIED_ODBC_H */
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net