r1579: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 16 Mar 2002 22:54:06 +0000 (22:54 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 16 Mar 2002 22:54:06 +0000 (22:54 +0000)
ChangeLog
doc/intro.sgml
doc/ref.sgml
doc/uffi.sgml
src/libraries.cl
src/primitives.cl
test-examples.cl

index fc82cfbefd1ba8762e73027e532ea322eb6788fd..c8e9e1d59adf3476f6d805b22947f3fa1d8f24bb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,16 @@
+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
        
 
index 23b4c7c8c27f51f02d7a6ab5afabc62e53be6f1d..df58ab6683625a9f0144e945f97ab212b7cbd7f5 100644 (file)
@@ -5,8 +5,8 @@
   <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
index 252bdc53c8894657887f6150a7155758dedb99de..46f91a5f40fbc037a1ef6b5f35c6df46dabd3bbd 100644 (file)
@@ -240,7 +240,7 @@ foreign type.
       <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>
index 0f82436192d8bcc6dd83bf5af3e883dc84d2d8f2..9cf9c07dadaa1a8621fdb68cecf704b6903b9d0b 100644 (file)
@@ -2,6 +2,7 @@
 
 <!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>">
index fa7f88b47c4457691bc7087ef462dca2a2862a47..8943587db1197e6d4d55907529a672a4f9818383 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; 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
 ;;;;
@@ -28,6 +28,9 @@
   #+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
@@ -40,7 +43,8 @@
                                         :real-name filename)
        #+allegro (load filename)
        
-       (push filename *loaded-libraries*))))
+       (push filename *loaded-libraries*)
+       t)))
   )
 
 (defun convert-supporting-libraries-to-string (libs)
index 294dcdc9b784a35f6efe09bab73cdd790f217cc1..2555b4c5b0f2d28a9a1dae588c9b2f2897a0dc38 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; 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
 ;;;;
@@ -84,6 +84,7 @@ supports takes advantage of this optimization."
       (: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)
index 83a1deec0fc4797eeaf411338c9fea8d221df386..0c33bb2639fb9e5193542e0d1e1c9b2cd7db78f3 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; 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
 ;;;;
@@ -26,7 +26,7 @@
                               :type "cl"
                               :directory '(:relative "examples"))
                *load-truename*))))
-       
+  
   (load-test "strtol")
   (load-test "gettime")
   (load-test "getenv")