X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=db-odbc%2Fodbc-ff-interface.lisp;h=2ae944d76a8b41f947e8bc7f0f21fc2d6c3fc853;hp=ba3362e9b3e2c49690ad570f30605ece7bdc5a52;hb=e567409d9fff3f7231c2a0bb69b345e19de2b246;hpb=f3c9127216b9fbea4f49ec6f9316929da64bf177 diff --git a/db-odbc/odbc-ff-interface.lisp b/db-odbc/odbc-ff-interface.lisp index ba3362e..2ae944d 100644 --- a/db-odbc/odbc-ff-interface.lisp +++ b/db-odbc/odbc-ff-interface.lisp @@ -19,17 +19,26 @@ (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 @@ -41,7 +50,7 @@ ((hdbc sql-handle) ; HDBC hdbc (*szDSN :cstring) ; UCHAR FAR *szDSN (cbDSN :short) ; SWORD cbDSN - (*szUID :cstring) ; UCHAR FAR *szUID + (*szUID :cstring) ; UCHAR FAR *szUID (cbUID :short) ; SWORD cbUID (*szAuthStr :cstring) ; UCHAR FAR *szAuthStr (cbAuthStr :short) ; SWORD cbAuthStr @@ -52,7 +61,7 @@ (def-function "SQLDriverConnect" ((hdbc sql-handle) ; HDBC hdbc (hwnd sql-handle) ; SQLHWND hwnd - (*szConnStrIn string-ptr) ; UCHAR FAR *szConnStrIn + (*szConnStrIn :cstring) ; UCHAR FAR *szConnStrIn (cbConnStrIn :short) ; SWORD cbConnStrIn (*szConnStrOut string-ptr) ; UCHAR FAR *szConnStrOut (cbConnStrOutMax :short) ; SWORD cbConnStrOutMax @@ -66,7 +75,8 @@ ((hdbc sql-handle)) ; HDBC hdbc :module "odbc" :returning :short) ; RETCODE_SQL_API - + +;; deprecated (def-function "SQLAllocStmt" ((hdbc sql-handle) ; HDBC hdbc (*phstmt sql-handle-ptr) ; HSTMT FAR *phstmt @@ -290,7 +300,7 @@ :module "odbc" :returning :short) ; RETCODE_SQL_API - ; level 2 + ; level 2 (def-function "SQLExtendedFetch" ((hstmt sql-handle) ; HSTMT hstmt (fFetchType :short) ; UWORD fFetchType @@ -323,11 +333,11 @@ ;;; foreign type definitions -;;(defmacro %sql-len-data-at-exec (length) +;;(defmacro %sql-len-data-at-exec (length) ;; `(- $SQL_LEN_DATA_AT_EXEC_OFFSET ,length)) -(def-struct sql-c-time +(def-struct sql-c-time (hour :short) (minute :short) (second :short)) @@ -336,7 +346,7 @@ (year :short) (month :short) (day :short)) - + (def-struct sql-c-timestamp (year :short) (month :short) @@ -356,6 +366,15 @@ :module "odbc" :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) (catalog-name :pointer-void) @@ -366,6 +385,7 @@ (table-name-length :short) (table-type-name :pointer-void) (table-type-name-length :short)) + :module "odbc" :returning :short) @@ -379,6 +399,7 @@ (table-name-length :short) (unique :short) (reserved :short)) + :module "odbc" :returning :short)