Ignore:
Timestamp:
08/23/2008 11:23:53 AM (18 years ago)
Author:
raverkamp
revision id:
svn-v3-trunk1:1c22b0a8-4d0b-0410-a296-af6a2e6f35e3:plain-odbc%2Ftrunk:14
Message:

support for CFFI-0.10 and 0.9.2
dummy test for postgresql integrated
moved string handling to ffi-support
sql-server tests work, nothing else (driver<->clisp interaction problems?)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/src/odbc/ffi-support.lisp

    r5 r8  
    44
    55
    6 (defun get-string (ptr length)
    7   (cffi:foreign-string-to-lisp ptr length nil)
    8   )
     6(defmacro cffi-0.10-or-0.9 (form-0.10 form-0.9)
     7  (if (BOUNDP 'cffi::*foreign-string-mappings*)
     8      form-0.10
     9    form-0.9))
    910
    10 (defun get-string-nts (ptr)
    11   (cffi:foreign-string-to-lisp ptr MOST-POSITIVE-FIXNUM t))
     11(cffi-0.10-or-0.9
     12 (defun get-string (ptr length)
     13   (cffi:foreign-string-to-lisp ptr :count length :encoding :iso-8859-1)
     14   )
     15 (defun get-string (ptr length)
     16   (cffi:foreign-string-to-lisp ptr length nil)
     17   )
     18 )
     19 
     20(cffi-0.10-or-0.9
     21 (defun get-string-nts (ptr)
     22   (cffi:foreign-string-to-lisp ptr :max-chars MOST-POSITIVE-FIXNUM :encoding :iso-8859-1))
     23 (defun get-string-nts (ptr)
     24   (cffi:foreign-string-to-lisp ptr MOST-POSITIVE-FIXNUM t)))
    1225
    13 (defun put-string (ptr vector)
    14   (cffi:lisp-string-to-foreign vector ptr (1+ (length vector))))
     26(cffi-0.10-or-0.9
     27 (defun put-string (ptr vector)
     28   (cffi:lisp-string-to-foreign vector ptr (1+ (length vector)) :encoding :iso-8859-1))
     29 (defun put-string (ptr vector)
     30   (cffi:lisp-string-to-foreign vector ptr (1+ (length vector)))))
    1531
    1632(defun %null-ptr ()
    1733  (cffi:null-pointer))
     34
     35
     36(cffi-0.10-or-0.9
     37 (defmacro with-foreign-string-alloc ((ptr text) &body body)
     38   `(cffi:with-foreign-string (,ptr ,text :encoding :iso-8859-1)
     39                              ,@body))
     40 
     41 (defmacro with-foreign-string-alloc ((ptr text) &body body)
     42   `(cffi:with-foreign-string (,ptr ,text)
     43                              ,@body)))
     44                           
    1845
    1946(defun get-byte-vector (ptr length)
Note: See TracChangeset for help on using the changeset viewer.