From: Kevin M. Rosenberg Date: Sat, 16 Mar 2002 22:54:06 +0000 (+0000) Subject: r1579: *** empty log message *** X-Git-Tag: v1.6.1~585 X-Git-Url: http://git.kpe.io/?p=uffi.git;a=commitdiff_plain;h=76ae1bdbadaaf87603ebbe987e59dd1a105f1872 r1579: *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index fc82cfb..c8e9e1d 100644 --- 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 diff --git a/doc/intro.sgml b/doc/intro.sgml index 23b4c7c..df58ab6 100644 --- a/doc/intro.sgml +++ b/doc/intro.sgml @@ -5,8 +5,8 @@ Purpose 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. @@ -16,10 +16,12 @@ 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 + Foreign Function Library Interface + (&ffi;). Unfortunately, these methods vary widely + amongst + implementations, thus preventing the writing of a portable FFI to a +particular C-library. &uffi; gathers a common subset of functionality between Common Lisp diff --git a/doc/ref.sgml b/doc/ref.sgml index 252bdc5..46f91a5 100644 --- a/doc/ref.sgml +++ b/doc/ref.sgml @@ -240,7 +240,7 @@ foreign type. Examples -(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)) diff --git a/doc/uffi.sgml b/doc/uffi.sgml index 0f82436..9cf9c07 100644 --- a/doc/uffi.sgml +++ b/doc/uffi.sgml @@ -2,6 +2,7 @@ UFFI"> +FFI"> CMUCL"> Lispworks"> AllegroCL"> diff --git a/src/libraries.cl b/src/libraries.cl index fa7f88b..8943587 100644 --- a/src/libraries.cl +++ b/src/libraries.cl @@ -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) diff --git a/src/primitives.cl b/src/primitives.cl index 294dcdc..2555b4c 100644 --- a/src/primitives.cl +++ b/src/primitives.cl @@ -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) diff --git a/test-examples.cl b/test-examples.cl index 83a1dee..0c33bb2 100644 --- a/test-examples.cl +++ b/test-examples.cl @@ -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")