-;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; Package: UFFI -*-
;;;; *************************************************************************
;;;; FILE IDENTIFICATION
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: primitives.cl,v 1.15 2002/04/06 19:45:14 kevin Exp $
+;;;; $Id: primitives.cl,v 1.20 2002/06/27 14:35:24 kevin Exp $
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
(defconstant +cmu-def-type-list+
'((:char . (alien:signed 8))
(:unsigned-char . (alien:unsigned 8))
- (:byte . (alien:unsigned 8))
+ (:byte . (alien:signed 8))
+ (:unsigned-byte . (alien:unsigned 8))
(:short . (alien:signed 16))
(:unsigned-short . (alien:unsigned 16))
(:int . (alien:signed 32))
)
"Conversions in CMUCL or def-foreign-type are different thatn in def-function")
+(defparameter +type-conversion-list+ nil)
#+cmu
-(defconstant +type-conversion-list+
+(setq +type-conversion-list+
'((* . *) (:void . c-call:void)
(:short . c-call:short)
(:pointer-void . (* t))
(:cstring . c-call:c-string)
(:char . c-call:char)
(:unsigned-char . (alien:unsigned 8))
- (:byte . (alien:unsigned 8))
+ (:byte . (alien:signed 8))
+ (:unsigned-byte . (alien:unsigned 8))
(:short . c-call:unsigned-short)
(:unsigned-short . c-call:unsigned-short)
(:int . alien:integer) (:unsigned-int . c-call:unsigned-int)
(:float . c-call:float) (:double . c-call:double)
(:array . alien:array)))
#+allegro
-(defconstant +type-conversion-list+
+(setq +type-conversion-list+
'((* . *) (:void . :void)
(:short . :short)
(:pointer-void . (* :void))
(:cstring . (* :unsigned-char))
+ (:byte . :char)
+ (:unsigned-byte . :unsigned-byte)
(:char . :char)
(:unsigned-char . :unsigned-char)
- (:byte . :byte)
(:int . :int) (:unsigned-int . :unsigned-int)
(:long . :long) (:unsigned-long . :unsigned-long)
(:float . :float) (:double . :double)
(:array . :array)))
#+lispworks
-(defconstant +type-conversion-list+
+(setq +type-conversion-list+
'((* . :pointer) (:void . :void)
(:short . :short)
(:pointer-void . (:pointer :void))
- (:cstring . (:reference-pass :ef-mb-string :allow-null t))
- (:cstring-returning . (:reference :ef-mb-string :allow-null t))
+ (:cstring . (:reference-pass (:ef-mb-string :external-format :latin-1)
+ :allow-null t))
+ (:cstring-returning . (:reference (:ef-mb-string :external-format :latin-1) :allow-null t))
+ (:byte . :byte)
+ (:unsigned-byte . (:unsigned :byte))
(:char . :char)
- (:byte :byte)
(:unsigned-char . (:unsigned :char))
(:int . :int) (:unsigned-int . (:unsigned :int))
(:long . :long) (:unsigned-long . (:unsigned :long))