r10077: * multiple: Apply patch from Joerg Hoehle with multiple
[clsql.git] / db-odbc / odbc-ff-interface.lisp
index 6df89376f55fb384164b157c7a9eaccfeb5088d7..a7153c8660600a5d7260a967d060a6aee1cbc8ea 100644 (file)
@@ -6,7 +6,7 @@
 ;;;; Purpose:  Function definitions for UFFI interface to ODBC
 ;;;; Author:   Kevin M. Rosenberg
 ;;;;
-;;;; $Id: odbc-package.lisp 7061 2003-09-07 06:34:45Z kevin $
+;;;; $Id$
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2004 by Kevin M. Rosenberg
 ;;;; and Copyright (C) Paul Meurer 1999 - 2001. All rights reserved.
 (in-package #:odbc)
 
 (def-foreign-type sql-handle :pointer-void)
-(def-foreign-type sql-handle-ptr '(* sql-handle))
-(def-foreign-type string-ptr '(* :unsigned-char))
-(def-type long-ptr-type '(* #.$ODBC-LONG-TYPE))
+(def-foreign-type sql-handle-ptr (* sql-handle))
+(def-foreign-type string-ptr (* :unsigned-char))
+(def-type long-ptr-type (* #.$ODBC-LONG-TYPE))
 
+;; odbc v3
+(def-function "SQLAllocHandle"
+    ((handle-type :short)
+     (input-handle sql-handle)
+     (*phenv sql-handle-ptr))
+  :module "odbc"
+  :returning :short)
 
+;; deprecated
 (def-function "SQLAllocEnv"
     ((*phenv sql-handle-ptr)    ; HENV   FAR *phenv
      )
   :module "odbc"
   :returning :short)              ; RETCODE_SQL_API
 
+;; deprecated
 (def-function "SQLAllocConnect"
     ((henv sql-handle)          ; HENV        henv
      (*phdbc sql-handle-ptr)    ; HDBC   FAR *phdbc
@@ -67,6 +76,7 @@
   :module "odbc"
   :returning :short)              ; RETCODE_SQL_API
   
+;; deprecated
 (def-function "SQLAllocStmt"
     ((hdbc sql-handle)          ; HDBC        hdbc
      (*phstmt sql-handle-ptr)   ; HSTMT  FAR *phstmt
      (cbColNameMax :short)      ; SWORD       cbColNameMax
      (*pcbColName (* :short))         ; SWORD  FAR *pcbColName
      (*pfSqlType (* :short))          ; SWORD  FAR *pfSqlType
-     (*pcbColDef (* :unsigned-int))          ; UDWORD FAR *pcbColDef
+     (*pcbColDef (* #.$ODBC-ULONG-TYPE))          ; UDWORD FAR *pcbColDef
      (*pibScale (* :short))           ; SWORD  FAR *pibScale
      (*pfNullable (* :short))         ; SWORD  FAR *pfNullable
      )
      (*value :pointer-void)
      (szLength :int))
   :module "odbc"
-  :returning :int)
+  :returning :short)
+
+(def-function "SQLGetEnvAttr"
+    ((henv sql-handle)          ; HENV        henv
+     (attr :int)
+     (*value :pointer-void)
+     (szLength :int)
+     (string-length-ptr (* :int)))
+  :module "odbc"
+  :returning :short)
 
 (def-function "SQLTables"
     ((hstmt :pointer-void)
      (table-name :pointer-void)
      (table-name-length :short)
      (table-type-name :pointer-void)
-     (table-type-name-length :short))
+     (table-type-name-length :short)
+     (unique :short)
+     (reserved :short))
+  :module "odbc"
   :returning :short)
 
 
      (table-name-length :short)
      (unique :short)
      (reserved :short))
+  :module "odbc"
   :returning :short)