[cffi-devel] def-foreign-type and with-foreign-object
odbc-ff-interface.lisp: (in-package #:odbc) (def-foreign-type sql-handle :pointer-void) ... odbc-api.lisp: ... (defun %new-db-connection-handle (henv) (with-foreign-object (phdbc 'sql-handle) (setf (deref-pointer phdbc sql-handle) +null-handle-ptr+) (with-error-handling (:henv henv) (SQLAllocHandle $SQL_HANDLE_DBC henv phdbc) (deref-pointer phdbc 'sql-handle)))) result: *** - ODBC::%NEW-DB-CONNECTION-HANDLE-1: symbol ODBC::SQL-HANDLE has no value [4]> (describe 'ODBC::SQL-HANDLE) ODBC::SQL-HANDLE is the symbol ODBC::SQL-HANDLE, lies in #<PACKAGE ODBC>, is accessible in 1 package ODBC. #<PACKAGE ODBC> is the package named ODBC. It imports the external symbols of 2 packages COMMON-LISP, CFFI-UFFI-COMPAT and exports 43 symbols to 1 package ODBC-DBI. [5]> (apropos "SQL-HANDLE" :ODBC) ODBC::SQL-HANDLE ODBC::SQL-HANDLE-PTR Thanks! -- WBR, Yaroslav Kavenchuk.
Hello again, :-) On 4/nov/2005, at 12:05, Yaroslav Kavenchuk wrote:
(defun %new-db-connection-handle (henv) (with-foreign-object (phdbc 'sql-handle) (setf (deref-pointer phdbc sql-handle) +null-handle-ptr+)
This is clearly a bug in this clsql code. That should be (deref-pointer phdbc 'sql-handle), note the missing quote.
(with-error-handling (:henv henv) (SQLAllocHandle $SQL_HANDLE_DBC henv phdbc) (deref-pointer phdbc 'sql-handle))))
-- Luís Oliveira http://student.dei.uc.pt/~lmoliv/ Equipa Portuguesa do Translation Project http://www.iro.umontreal.ca/translation/registry.cgi?team=pt
participants (2)
-
Luis Oliveira
-
Yaroslav Kavenchuk