+16 Mar
+ * Fixed return value in load-foreign-library (Thanks Erik Winkels),
+ modified routine to accept pathnames as well as strings.
+ * Fix documention with :pointer-void (Again, Erik Winkels)
+ * Added missing type specifiers for CMUCL (Thanks a bunch, Erik!)
+
15 Mar 2002
* Finished basic skeleton of documentation.
14 Mar 2002
* Changed license to more liberal Lisp Lessor GNU Public License
- * Fixed problem with including uffi.system in distribution (Thanks John DeSoi)
+ * Fixed problem with uffi.system absent from in distribution
+ (Thanks John DeSoi)
* Fixed compiler warnings
<sect1>
<title>Purpose</title>
<para> This reference guide describes
- &uffi;, a Lisp package that provides persistent cross-implementation
- support of C-language compatible libraries.
+ &uffi;, a package that provides a cross-implementation
+ interface from Common Lisp to C-language compatible libraries.
</para>
</sect1>
<para>
Every Common Lisp implementation has
a method for interfacing to C-language compatible
- libraries. Unfortunately, these method vary widely amongst
- implementations. Currently, to support multiple implementations,
- developers must write a different interface library for each Common
- Lisp implementation.
+ libraries. These methods are often termed a
+ <emphasis>Foreign Function Library Interface</emphasis>
+ (&ffi;). Unfortunately, these methods vary widely
+ amongst
+ implementations, thus preventing the writing of a portable FFI to a
+particular C-library.
</para>
<para>
&uffi; gathers a common subset of functionality between Common Lisp
<refsect1>
<title>Examples</title>
<programlisting>
-(def-foreign-type my-generic-pointer (* :void))
+(def-foreign-type my-generic-pointer :pointer-void)
(def-foreign-type a-double-float :double-float)
(def-foreign-type char-ptr (* :char))
</programlisting>
<!DOCTYPE BOOK PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
<!ENTITY uffi "<application><emphasis>UFFI</emphasis></application>">
+<!ENTITY ffi "<acronym>FFI</acronym>">
<!ENTITY cmucl "<application>CMUCL</application>">
<!ENTITY lw "<application>Lispworks</application>">
<!ENTITY acl "<application>AllegroCL</application>">
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: libraries.cl,v 1.3 2002/03/14 21:03:12 kevin Exp $
+;;;; $Id: libraries.cl,v 1.4 2002/03/16 22:54:06 kevin Exp $
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
#+cmu (declare (ignore module))
(when (and filename (probe-file filename))
+ (if (pathnamep filename) ;; ensure filename is a string to check if
+ (setq filename (namestring filename))) ; already loaded
+
(if (find filename *loaded-libraries* :test #'string-equal)
t ;; return T, but don't reload library
(progn
:real-name filename)
#+allegro (load filename)
- (push filename *loaded-libraries*))))
+ (push filename *loaded-libraries*)
+ t)))
)
(defun convert-supporting-libraries-to-string (libs)
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: primitives.cl,v 1.6 2002/03/15 11:38:13 kevin Exp $
+;;;; $Id: primitives.cl,v 1.7 2002/03/16 22:54:06 kevin Exp $
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
(:char . c-call:char)
(:unsigned-char . (alien:unsigned 8))
(:byte . (alien:unsigned 8))
+ (:short . c-call:unsigned-short) (:unsigned-short c-call:unsigned-short)
(:int . alien:integer) (:unsigned-int . c-call:unsigned-int)
(:long . c-call:long) (:unsigned-long . c-call:unsigned-long)
(:float . c-call:float) (:double . c-call:double)
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: test-examples.cl,v 1.2 2002/03/14 21:03:12 kevin Exp $
+;;;; $Id: test-examples.cl,v 1.3 2002/03/16 22:54:06 kevin Exp $
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
:type "cl"
:directory '(:relative "examples"))
*load-truename*))))
-
+
(load-test "strtol")
(load-test "gettime")
(load-test "getenv")