From eb03e5da9d2a2918aff4004597205b36a32f7f6e Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Fri, 13 Dec 2002 22:49:09 +0000 Subject: [PATCH 01/16] r3626: external format fixes --- debian/changelog | 12 ++++++++++++ src/primitives.lisp | 11 +++++++---- src/strings.lisp | 6 +++--- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1df933a..909f9d2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +cl-uffi (1.2.3-1) unstable; urgency=low + + * More external format changes for lispworks (thanks Marc Battyani) + + -- Kevin M. Rosenberg Fri, 13 Dec 2002 15:46:23 -0700 + +cl-uffi (1.2.2-1) unstable; urgency=low + + * Add external format parameters to lispworks to avoid translating stringsl + + -- Kevin M. Rosenberg Fri, 13 Dec 2002 14:26:17 -0700 + cl-uffi (1.2.1-1) unstable; urgency=low * Add uncompression test diff --git a/src/primitives.lisp b/src/primitives.lisp index 8ba2ba6..06dd030 100644 --- a/src/primitives.lisp +++ b/src/primitives.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: primitives.lisp,v 1.6 2002/11/23 18:01:57 kevin Exp $ +;;;; $Id: primitives.lisp,v 1.7 2002/12/13 22:49:09 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -179,9 +179,12 @@ supports takes advantage of this optimization." '((* . :pointer) (:void . :void) (:short . :short) (:pointer-void . (:pointer :void)) - (: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)) + (:cstring . (:reference-pass (:ef-mb-string :external-format + (:latin-1 :eol-style :lf) + :allow-null t)) + (:cstring-returning . (:reference (:ef-mb-string :external-format + (:latin-1 :eol-style :lf) + :allow-null t)) (:byte . :byte) (:unsigned-byte . (:unsigned :byte)) (:char . :char) diff --git a/src/strings.lisp b/src/strings.lisp index 02ae84b..2712a73 100644 --- a/src/strings.lisp +++ b/src/strings.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: strings.lisp,v 1.4 2002/10/16 11:56:43 kevin Exp $ +;;;; $Id: strings.lisp,v 1.5 2002/12/13 22:49:09 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -97,8 +97,8 @@ that LW/CMU automatically converts strings from c-calls." (defmacro convert-to-foreign-string (obj) #+lispworks `(if (null ,obj) - +null-cstring-pointer+ - (fli:convert-to-foreign-string ,obj)) + +null-cstring-pointer+ + (fli:convert-to-foreign-string ,obj :external-format '(:latin-1 :eol-style :lf))) #+allegro `(if (null ,obj) 0 -- 2.34.1 From 944a7d156be31efb1c01b9dfc49a5661a825eced Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sat, 14 Dec 2002 03:20:14 +0000 Subject: [PATCH 02/16] r3628: *** empty log message *** --- src/.cvsignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/.cvsignore b/src/.cvsignore index ca8d09f..469a95c 100755 --- a/src/.cvsignore +++ b/src/.cvsignore @@ -1 +1,9 @@ .bin +*.fasl* +*.dfsl +*.pfsl +*.ufsl +*.fas +*.x86f +*.sparcf +*.cfsl -- 2.34.1 From 02b663aaba3227e4541572337b3d4105a30c1768 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sun, 15 Dec 2002 17:11:08 +0000 Subject: [PATCH 03/16] r3631: *** empty log message *** --- debian/changelog | 6 ++++++ src/primitives.lisp | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 909f9d2..df12f9e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-uffi (1.2.4-1) unstable; urgency=low + + * Fix syntax error from last version + + -- Kevin M. Rosenberg Fri, 13 Dec 2002 18:54:41 -0700 + cl-uffi (1.2.3-1) unstable; urgency=low * More external format changes for lispworks (thanks Marc Battyani) diff --git a/src/primitives.lisp b/src/primitives.lisp index 06dd030..0353066 100644 --- a/src/primitives.lisp +++ b/src/primitives.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: primitives.lisp,v 1.7 2002/12/13 22:49:09 kevin Exp $ +;;;; $Id: primitives.lisp,v 1.8 2002/12/15 17:11:08 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -180,11 +180,11 @@ supports takes advantage of this optimization." (:short . :short) (:pointer-void . (:pointer :void)) (:cstring . (:reference-pass (:ef-mb-string :external-format - (:latin-1 :eol-style :lf) - :allow-null t)) + (:latin-1 :eol-style :lf)) + :allow-null t)) (:cstring-returning . (:reference (:ef-mb-string :external-format - (:latin-1 :eol-style :lf) - :allow-null t)) + (:latin-1 :eol-style :lf)) + :allow-null t)) (:byte . :byte) (:unsigned-byte . (:unsigned :byte)) (:char . :char) -- 2.34.1 From 24d382afbccd5c9a3676c598378c6259c97b213d Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sat, 21 Dec 2002 17:09:27 +0000 Subject: [PATCH 04/16] r3639: *** empty log message *** --- examples/.cvsignore | 2 ++ tests/.cvsignore | 2 ++ 2 files changed, 4 insertions(+) diff --git a/examples/.cvsignore b/examples/.cvsignore index 0411d27..e6e3933 100755 --- a/examples/.cvsignore +++ b/examples/.cvsignore @@ -1,3 +1,5 @@ c-test-fns.lib c-test-fns.dll +c-test-fns.dylib +z.dylib diff --git a/tests/.cvsignore b/tests/.cvsignore index 0411d27..e6e3933 100755 --- a/tests/.cvsignore +++ b/tests/.cvsignore @@ -1,3 +1,5 @@ c-test-fns.lib c-test-fns.dll +c-test-fns.dylib +z.dylib -- 2.34.1 From 1e1e3631aa2f7f3f0927e05bc1f2d9866c20c685 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 30 Dec 2002 20:39:25 +0000 Subject: [PATCH 05/16] r3704: *** empty log message *** --- debian/changelog | 6 ++++++ debian/cl-uffi.doc-base | 4 ++-- src/objects.lisp | 14 +++++++------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index df12f9e..9bb90db 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-uffi (1.2.5-1) unstable; urgency=low + + * Rework allocate-foreign-array to evaluate type + + -- Kevin M. Rosenberg Sat, 28 Dec 2002 01:12:30 -0700 + cl-uffi (1.2.4-1) unstable; urgency=low * Fix syntax error from last version diff --git a/debian/cl-uffi.doc-base b/debian/cl-uffi.doc-base index add1e0c..49e1aed 100644 --- a/debian/cl-uffi.doc-base +++ b/debian/cl-uffi.doc-base @@ -3,8 +3,8 @@ Title: UFFI Manual Author: Kevin M. Rosenberg Abstract: This manual describes the use the UFFI (Universal Foreign Function Interface) - Common Lisp library. This library supports CMUCL, - AllegroCL, Lispworks, and MCL. + Common Lisp library. This library supports CMUCL, SBCL, + AllegroCL, Lispworks, SCL, OpenMCL, and MCL. Section: programming Format: postscript diff --git a/src/objects.lisp b/src/objects.lisp index 0265259..740b684 100644 --- a/src/objects.lisp +++ b/src/objects.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: objects.lisp,v 1.8 2002/12/03 06:58:39 kevin Exp $ +;;;; $Id: objects.lisp,v 1.9 2002/12/30 20:39:22 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -44,11 +44,11 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated." #+sbcl `(sb-alien:make-alien ,(convert-from-uffi-type (eval type) :allocation)) #+lispworks - `(fli:allocate-foreign-object :type ',(convert-from-uffi-type type :allocate)) + `(fli:allocate-foreign-object :type ',(convert-from-uffi-type (eval type) :allocate)) #+allegro - `(ff:allocate-fobject ',(convert-from-uffi-type type :allocate) :c) + `(ff:allocate-fobject ',(convert-from-uffi-type (eval type) :allocate) :c) #+mcl - `(new-ptr ,(size-of-foreign-type (convert-from-uffi-type type :allocation))) + `(new-ptr ,(size-of-foreign-type (convert-from-uffi-type (eval type) :allocation))) ) (progn #+(or cmu scl) @@ -56,11 +56,11 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated." #+sbcl `(sb-alien:make-alien ,(convert-from-uffi-type (eval type) :allocation) ,size) #+lispworks - `(fli:allocate-foreign-object :type ',(convert-from-uffi-type type :allocate) :nelems ,size) + `(fli:allocate-foreign-object :type ',(convert-from-uffi-type (eval type) :allocate) :nelems ,size) #+allegro - `(ff:allocate-fobject (list :array (quote ,(convert-from-uffi-type type :allocate)) ,size) :c) + `(ff:allocate-fobject (list :array (quote ,(convert-from-uffi-type (eval type) :allocate)) ,size) :c) #+mcl - `(new-ptr (* ,size ,(size-of-foreign-type (convert-from-uffi-type type :allocation)))) + `(new-ptr (* ,size ,(size-of-foreign-type (convert-from-uffi-type (eval type) :allocation)))) ))) (defmacro free-foreign-object (obj) -- 2.34.1 From f1de6d7be49f73be92691828678aeafe98ddee99 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 30 Dec 2002 20:49:12 +0000 Subject: [PATCH 06/16] r3705: revert changes --- src/objects.lisp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/objects.lisp b/src/objects.lisp index 740b684..0881539 100644 --- a/src/objects.lisp +++ b/src/objects.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: objects.lisp,v 1.9 2002/12/30 20:39:22 kevin Exp $ +;;;; $Id: objects.lisp,v 1.10 2002/12/30 20:49:12 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -44,11 +44,11 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated." #+sbcl `(sb-alien:make-alien ,(convert-from-uffi-type (eval type) :allocation)) #+lispworks - `(fli:allocate-foreign-object :type ',(convert-from-uffi-type (eval type) :allocate)) + `(fli:allocate-foreign-object :type ',(convert-from-uffi-type type :allocate)) #+allegro - `(ff:allocate-fobject ',(convert-from-uffi-type (eval type) :allocate) :c) + `(ff:allocate-fobject ',(convert-from-uffi-type type :allocate) :c) #+mcl - `(new-ptr ,(size-of-foreign-type (convert-from-uffi-type (eval type) :allocation))) + `(new-ptr ,(size-of-foreign-type (convert-from-uffi-type type :allocation))) ) (progn #+(or cmu scl) @@ -56,11 +56,11 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated." #+sbcl `(sb-alien:make-alien ,(convert-from-uffi-type (eval type) :allocation) ,size) #+lispworks - `(fli:allocate-foreign-object :type ',(convert-from-uffi-type (eval type) :allocate) :nelems ,size) + `(fli:allocate-foreign-object :type ',(convert-from-uffi-type type :allocate) :nelems ,size) #+allegro - `(ff:allocate-fobject (list :array (quote ,(convert-from-uffi-type (eval type) :allocate)) ,size) :c) + `(ff:allocate-fobject (list :array (quote ,(convert-from-uffi-type type :allocate)) ,size) :c) #+mcl - `(new-ptr (* ,size ,(size-of-foreign-type (convert-from-uffi-type (eval type) :allocation)))) + `(new-ptr (* ,size ,(size-of-foreign-type (convert-from-uffi-type type :allocation)))) ))) (defmacro free-foreign-object (obj) -- 2.34.1 From c21ea91d9d4f421f6541df17b03700cbaf87ba5c Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Tue, 14 Jan 2003 06:05:14 +0000 Subject: [PATCH 07/16] r3759: fix type --- debian/copyright | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/copyright b/debian/copyright index f4c77a6..9aebf9a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -13,7 +13,7 @@ UFFI is written and Copyright (c) 2002 by Kevin M. Rosenberg. UFFI is licensed under the terms of the Lisp Lesser GNU Public License, known as the LLGPL. The LLGPL consists of a preamble (see below) and the Lessor GNU Public License 2.1 (LGPL-2.1). Where these -conflict, the preamble takes precedence. CLSQL is referenced in the +conflict, the preamble takes precedence. UFFI is referenced in the preamble as the "LIBRARY." The LGPL-2.1 is stored on a Debian system in the file /usr/share/common-licenses/LGPL-2.1. -- 2.34.1 From 3dc00d0c4f7d59f610746a053f72fbe9d1a80fab Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Thu, 6 Feb 2003 06:54:22 +0000 Subject: [PATCH 08/16] r3958: Automatic commit for debian_version_1_2_6-1 --- debian/changelog | 6 ++++++ src/functions.lisp | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 9bb90db..b740810 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-uffi (1.2.6-1) unstable; urgency=low + + * Add :language :ansi-c for Lispworks def-function + + -- Kevin M. Rosenberg Wed, 5 Feb 2003 23:54:12 -0700 + cl-uffi (1.2.5-1) unstable; urgency=low * Rework allocate-foreign-array to evaluate type diff --git a/src/functions.lisp b/src/functions.lisp index ea87b2e..600603d 100644 --- a/src/functions.lisp +++ b/src/functions.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: functions.lisp,v 1.6 2002/11/20 21:01:31 kevin Exp $ +;;;; $Id: functions.lisp,v 1.7 2003/02/06 06:54:22 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -94,6 +94,7 @@ ,function-args ,@(if module (list :module module) (values)) :result-type ,result-type + :language :ansi-c :calling-convention :cdecl) #+(and mcl (not openmcl)) `(eval-when (:compile-toplevel :load-toplevel :execute) -- 2.34.1 From a17713050ecbdd286fa24463cb6e28e280b06ae0 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Wed, 19 Feb 2003 21:56:22 +0000 Subject: [PATCH 09/16] r4081: Auto commit for Debian build --- debian/changelog | 6 ++++++ uffi.asd | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index b740810..77cf13b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-uffi (1.2.7-1) unstable; urgency=low + + * Remove reference to obsolete Corman module in uffi.asd + + -- Kevin M. Rosenberg Wed, 19 Feb 2003 14:56:15 -0700 + cl-uffi (1.2.6-1) unstable; urgency=low * Add :language :ansi-c for Lispworks def-function diff --git a/uffi.asd b/uffi.asd index 8d7d3f8..d48db11 100644 --- a/uffi.asd +++ b/uffi.asd @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: uffi.asd,v 1.21 2002/11/08 16:51:50 kevin Exp $ +;;;; $Id: uffi.asd,v 1.22 2003/02/19 21:56:22 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -44,9 +44,5 @@ (:file "functions" :depends-on ("primitives")) (:file "libraries" :depends-on ("package")) (:file "os" :depends-on ("package")))) - #+cormanlisp - (:module :src-corman - :components - ((:file "uffi-corman"))) )) -- 2.34.1 From 35ddd15fad42a60b445284900020d5b5a7edad8c Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 10 Mar 2003 17:37:05 +0000 Subject: [PATCH 10/16] r4176: *** empty log message *** --- debian/changelog | 6 ++ examples/compress.lisp | 239 ++++++++++++++++++++--------------------- tests/compress.lisp | 239 ++++++++++++++++++++--------------------- 3 files changed, 244 insertions(+), 240 deletions(-) diff --git a/debian/changelog b/debian/changelog index 77cf13b..7924e70 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-uffi (1.2.8-1) unstable; urgency=low + + * Change output on compress.lisp example + + -- Kevin M. Rosenberg Mon, 10 Mar 2003 10:37:00 -0700 + cl-uffi (1.2.7-1) unstable; urgency=low * Remove reference to obsolete Corman module in uffi.asd diff --git a/examples/compress.lisp b/examples/compress.lisp index 1229be5..02c8cd2 100644 --- a/examples/compress.lisp +++ b/examples/compress.lisp @@ -1,120 +1,119 @@ -;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ************************************************************************* -;;;; FILE IDENTIFICATION -;;;; -;;;; Name: compress.cl -;;;; Purpose: UFFI Example file for zlib compression -;;;; Programmer: Kevin M. Rosenberg -;;;; Date Started: Feb 2002 -;;;; -;;;; $Id: compress.lisp,v 1.3 2002/12/09 16:30:20 kevin Exp $ -;;;; -;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg -;;;; -;;;; UFFI users are granted the rights to distribute and use this software -;;;; as governed by the terms of the Lisp Lesser GNU Public License -;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. -;;;; ************************************************************************* - -(in-package :cl-user) - -(eval-when (:load-toplevel :execute) - (unless (uffi:load-foreign-library - #-(or macosx darwin) - (uffi:find-foreign-library - "libz" - '("/usr/local/lib/" "/usr/lib/" "/zlib/") - :types '("so" "a")) - #+(or macosx darwin) - (uffi:find-foreign-library "z" - `(,(pathname-directory *load-pathname*))) - :module "zlib" - :supporting-libraries '("c")) - (warn "Unable to load zlib"))) - -(uffi:def-function ("compress" c-compress) - ((dest (* :unsigned-char)) - (destlen (* :long)) - (source :cstring) - (source-len :long)) - :returning :int - :module "zlib") - -(defun compress (source) - "Returns two values: array of bytes containing the compressed data - and the numbe of compressed bytes" - (let* ((sourcelen (length source)) - (destsize (+ 12 (ceiling (* sourcelen 1.01)))) - (dest (uffi:allocate-foreign-string destsize :unsigned t)) - (destlen (uffi:allocate-foreign-object :long))) - (setf (uffi:deref-pointer destlen :long) destsize) - (uffi:with-cstring (source-native source) - (let ((result (c-compress dest destlen source-native sourcelen)) - (newdestlen (uffi:deref-pointer destlen :long))) - (unwind-protect - (if (zerop result) - (values (uffi:convert-from-foreign-string - dest - :length newdestlen - :null-terminated-p nil) - newdestlen) - (error "zlib error, code ~D" result)) - (progn - (uffi:free-foreign-object destlen) - (uffi:free-foreign-object dest))))))) - -(uffi:def-function ("uncompress" c-uncompress) - ((dest (* :unsigned-char)) - (destlen (* :long)) - (source :cstring) - (source-len :long)) - :returning :int - :module "zlib") - -(defun uncompress (source) - (let* ((sourcelen (length source)) - (destsize 200000) ;adjust as needed - (dest (uffi:allocate-foreign-string destsize :unsigned t)) - (destlen (uffi:allocate-foreign-object :long))) - (setf (uffi:deref-pointer destlen :long) destsize) - (uffi:with-cstring (source-native source) - (let ((result (c-uncompress dest destlen source-native sourcelen)) - (newdestlen (uffi:deref-pointer destlen :long))) - (unwind-protect - (if (zerop result) - (uffi:convert-from-foreign-string - dest - :length newdestlen - :null-terminated-p nil) - (error "zlib error, code ~D" result)) - (progn - (uffi:free-foreign-object destlen) - (uffi:free-foreign-object dest))))))) - -#+examples-uffi -(progn - (flet ((print-results (str) - (multiple-value-bind (compressed len) (compress str) - (format t "~&(compress ~S) => " str) - (dotimes (i len) - (format t "~X" (char-code (char compressed i)))) - (format t ",~D" len)))) - (print-results "") - (print-results "test") - (print-results "test2"))) - -#+test-uffi -(progn - (flet ((test-compress (str) - (multiple-value-bind (compressed len) (compress str) - (multiple-value-bind (uncompressed len2) (uncompress compressed) - (util.test:test str uncompressed :test #'string= - :fail-info "Error uncompressing a compressed string"))))) - (test-compress "") - (test-compress "test") - (test-compress "test2"))) - -;; Results of the above on my system: -;; (compress "") => 789c300001,8 -;; (compress "test") => 789c2b492d2e1045d1c1,12 -;; (compress "test2") => 789c2b492d2e31206501f3,13 +;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION +;;;; +;;;; Name: compress.cl +;;;; Purpose: UFFI Example file for zlib compression +;;;; Programmer: Kevin M. Rosenberg +;;;; Date Started: Feb 2002 +;;;; +;;;; $Id: compress.lisp,v 1.4 2003/03/10 17:37:05 kevin Exp $ +;;;; +;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg +;;;; +;;;; UFFI users are granted the rights to distribute and use this software +;;;; as governed by the terms of the Lisp Lesser GNU Public License +;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. +;;;; ************************************************************************* + +(in-package :cl-user) + +(eval-when (:load-toplevel :execute) + (unless (uffi:load-foreign-library + #-(or macosx darwin) + (uffi:find-foreign-library + "libz" + '("/usr/local/lib/" "/usr/lib/" "/zlib/") + :types '("so" "a")) + #+(or macosx darwin) + (uffi:find-foreign-library "z" + `(,(pathname-directory *load-pathname*))) + :module "zlib" + :supporting-libraries '("c")) + (warn "Unable to load zlib"))) + +(uffi:def-function ("compress" c-compress) + ((dest (* :unsigned-char)) + (destlen (* :long)) + (source :cstring) + (source-len :long)) + :returning :int + :module "zlib") + +(defun compress (source) + "Returns two values: array of bytes containing the compressed data + and the numbe of compressed bytes" + (let* ((sourcelen (length source)) + (destsize (+ 12 (ceiling (* sourcelen 1.01)))) + (dest (uffi:allocate-foreign-string destsize :unsigned t)) + (destlen (uffi:allocate-foreign-object :long))) + (setf (uffi:deref-pointer destlen :long) destsize) + (uffi:with-cstring (source-native source) + (let ((result (c-compress dest destlen source-native sourcelen)) + (newdestlen (uffi:deref-pointer destlen :long))) + (unwind-protect + (if (zerop result) + (values (uffi:convert-from-foreign-string + dest + :length newdestlen + :null-terminated-p nil) + newdestlen) + (error "zlib error, code ~D" result)) + (progn + (uffi:free-foreign-object destlen) + (uffi:free-foreign-object dest))))))) + +(uffi:def-function ("uncompress" c-uncompress) + ((dest (* :unsigned-char)) + (destlen (* :long)) + (source :cstring) + (source-len :long)) + :returning :int + :module "zlib") + +(defun uncompress (source) + (let* ((sourcelen (length source)) + (destsize 200000) ;adjust as needed + (dest (uffi:allocate-foreign-string destsize :unsigned t)) + (destlen (uffi:allocate-foreign-object :long))) + (setf (uffi:deref-pointer destlen :long) destsize) + (uffi:with-cstring (source-native source) + (let ((result (c-uncompress dest destlen source-native sourcelen)) + (newdestlen (uffi:deref-pointer destlen :long))) + (unwind-protect + (if (zerop result) + (uffi:convert-from-foreign-string + dest + :length newdestlen + :null-terminated-p nil) + (error "zlib error, code ~D" result)) + (progn + (uffi:free-foreign-object destlen) + (uffi:free-foreign-object dest))))))) + +#+examples-uffi +(progn + (flet ((print-results (str) + (multiple-value-bind (compressed len) (compress str) + (let ((*print-length* nil)) + (format t "~&(compress ~S) => " str) + (format t "~S~%" (map 'list #'char-code compressed)))))) + (print-results "") + (print-results "test") + (print-results "test2"))) + +#+test-uffi +(progn + (flet ((test-compress (str) + (multiple-value-bind (compressed len) (compress str) + (multiple-value-bind (uncompressed len2) (uncompress compressed) + (util.test:test str uncompressed :test #'string= + :fail-info "Error uncompressing a compressed string"))))) + (test-compress "") + (test-compress "test") + (test-compress "test2"))) + +;; Results of the above on my system: +;; (compress "") => 789c300001,8 +;; (compress "test") => 789c2b492d2e1045d1c1,12 +;; (compress "test2") => 789c2b492d2e31206501f3,13 diff --git a/tests/compress.lisp b/tests/compress.lisp index 1229be5..02c8cd2 100644 --- a/tests/compress.lisp +++ b/tests/compress.lisp @@ -1,120 +1,119 @@ -;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ************************************************************************* -;;;; FILE IDENTIFICATION -;;;; -;;;; Name: compress.cl -;;;; Purpose: UFFI Example file for zlib compression -;;;; Programmer: Kevin M. Rosenberg -;;;; Date Started: Feb 2002 -;;;; -;;;; $Id: compress.lisp,v 1.3 2002/12/09 16:30:20 kevin Exp $ -;;;; -;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg -;;;; -;;;; UFFI users are granted the rights to distribute and use this software -;;;; as governed by the terms of the Lisp Lesser GNU Public License -;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. -;;;; ************************************************************************* - -(in-package :cl-user) - -(eval-when (:load-toplevel :execute) - (unless (uffi:load-foreign-library - #-(or macosx darwin) - (uffi:find-foreign-library - "libz" - '("/usr/local/lib/" "/usr/lib/" "/zlib/") - :types '("so" "a")) - #+(or macosx darwin) - (uffi:find-foreign-library "z" - `(,(pathname-directory *load-pathname*))) - :module "zlib" - :supporting-libraries '("c")) - (warn "Unable to load zlib"))) - -(uffi:def-function ("compress" c-compress) - ((dest (* :unsigned-char)) - (destlen (* :long)) - (source :cstring) - (source-len :long)) - :returning :int - :module "zlib") - -(defun compress (source) - "Returns two values: array of bytes containing the compressed data - and the numbe of compressed bytes" - (let* ((sourcelen (length source)) - (destsize (+ 12 (ceiling (* sourcelen 1.01)))) - (dest (uffi:allocate-foreign-string destsize :unsigned t)) - (destlen (uffi:allocate-foreign-object :long))) - (setf (uffi:deref-pointer destlen :long) destsize) - (uffi:with-cstring (source-native source) - (let ((result (c-compress dest destlen source-native sourcelen)) - (newdestlen (uffi:deref-pointer destlen :long))) - (unwind-protect - (if (zerop result) - (values (uffi:convert-from-foreign-string - dest - :length newdestlen - :null-terminated-p nil) - newdestlen) - (error "zlib error, code ~D" result)) - (progn - (uffi:free-foreign-object destlen) - (uffi:free-foreign-object dest))))))) - -(uffi:def-function ("uncompress" c-uncompress) - ((dest (* :unsigned-char)) - (destlen (* :long)) - (source :cstring) - (source-len :long)) - :returning :int - :module "zlib") - -(defun uncompress (source) - (let* ((sourcelen (length source)) - (destsize 200000) ;adjust as needed - (dest (uffi:allocate-foreign-string destsize :unsigned t)) - (destlen (uffi:allocate-foreign-object :long))) - (setf (uffi:deref-pointer destlen :long) destsize) - (uffi:with-cstring (source-native source) - (let ((result (c-uncompress dest destlen source-native sourcelen)) - (newdestlen (uffi:deref-pointer destlen :long))) - (unwind-protect - (if (zerop result) - (uffi:convert-from-foreign-string - dest - :length newdestlen - :null-terminated-p nil) - (error "zlib error, code ~D" result)) - (progn - (uffi:free-foreign-object destlen) - (uffi:free-foreign-object dest))))))) - -#+examples-uffi -(progn - (flet ((print-results (str) - (multiple-value-bind (compressed len) (compress str) - (format t "~&(compress ~S) => " str) - (dotimes (i len) - (format t "~X" (char-code (char compressed i)))) - (format t ",~D" len)))) - (print-results "") - (print-results "test") - (print-results "test2"))) - -#+test-uffi -(progn - (flet ((test-compress (str) - (multiple-value-bind (compressed len) (compress str) - (multiple-value-bind (uncompressed len2) (uncompress compressed) - (util.test:test str uncompressed :test #'string= - :fail-info "Error uncompressing a compressed string"))))) - (test-compress "") - (test-compress "test") - (test-compress "test2"))) - -;; Results of the above on my system: -;; (compress "") => 789c300001,8 -;; (compress "test") => 789c2b492d2e1045d1c1,12 -;; (compress "test2") => 789c2b492d2e31206501f3,13 +;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION +;;;; +;;;; Name: compress.cl +;;;; Purpose: UFFI Example file for zlib compression +;;;; Programmer: Kevin M. Rosenberg +;;;; Date Started: Feb 2002 +;;;; +;;;; $Id: compress.lisp,v 1.4 2003/03/10 17:37:05 kevin Exp $ +;;;; +;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg +;;;; +;;;; UFFI users are granted the rights to distribute and use this software +;;;; as governed by the terms of the Lisp Lesser GNU Public License +;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. +;;;; ************************************************************************* + +(in-package :cl-user) + +(eval-when (:load-toplevel :execute) + (unless (uffi:load-foreign-library + #-(or macosx darwin) + (uffi:find-foreign-library + "libz" + '("/usr/local/lib/" "/usr/lib/" "/zlib/") + :types '("so" "a")) + #+(or macosx darwin) + (uffi:find-foreign-library "z" + `(,(pathname-directory *load-pathname*))) + :module "zlib" + :supporting-libraries '("c")) + (warn "Unable to load zlib"))) + +(uffi:def-function ("compress" c-compress) + ((dest (* :unsigned-char)) + (destlen (* :long)) + (source :cstring) + (source-len :long)) + :returning :int + :module "zlib") + +(defun compress (source) + "Returns two values: array of bytes containing the compressed data + and the numbe of compressed bytes" + (let* ((sourcelen (length source)) + (destsize (+ 12 (ceiling (* sourcelen 1.01)))) + (dest (uffi:allocate-foreign-string destsize :unsigned t)) + (destlen (uffi:allocate-foreign-object :long))) + (setf (uffi:deref-pointer destlen :long) destsize) + (uffi:with-cstring (source-native source) + (let ((result (c-compress dest destlen source-native sourcelen)) + (newdestlen (uffi:deref-pointer destlen :long))) + (unwind-protect + (if (zerop result) + (values (uffi:convert-from-foreign-string + dest + :length newdestlen + :null-terminated-p nil) + newdestlen) + (error "zlib error, code ~D" result)) + (progn + (uffi:free-foreign-object destlen) + (uffi:free-foreign-object dest))))))) + +(uffi:def-function ("uncompress" c-uncompress) + ((dest (* :unsigned-char)) + (destlen (* :long)) + (source :cstring) + (source-len :long)) + :returning :int + :module "zlib") + +(defun uncompress (source) + (let* ((sourcelen (length source)) + (destsize 200000) ;adjust as needed + (dest (uffi:allocate-foreign-string destsize :unsigned t)) + (destlen (uffi:allocate-foreign-object :long))) + (setf (uffi:deref-pointer destlen :long) destsize) + (uffi:with-cstring (source-native source) + (let ((result (c-uncompress dest destlen source-native sourcelen)) + (newdestlen (uffi:deref-pointer destlen :long))) + (unwind-protect + (if (zerop result) + (uffi:convert-from-foreign-string + dest + :length newdestlen + :null-terminated-p nil) + (error "zlib error, code ~D" result)) + (progn + (uffi:free-foreign-object destlen) + (uffi:free-foreign-object dest))))))) + +#+examples-uffi +(progn + (flet ((print-results (str) + (multiple-value-bind (compressed len) (compress str) + (let ((*print-length* nil)) + (format t "~&(compress ~S) => " str) + (format t "~S~%" (map 'list #'char-code compressed)))))) + (print-results "") + (print-results "test") + (print-results "test2"))) + +#+test-uffi +(progn + (flet ((test-compress (str) + (multiple-value-bind (compressed len) (compress str) + (multiple-value-bind (uncompressed len2) (uncompress compressed) + (util.test:test str uncompressed :test #'string= + :fail-info "Error uncompressing a compressed string"))))) + (test-compress "") + (test-compress "test") + (test-compress "test2"))) + +;; Results of the above on my system: +;; (compress "") => 789c300001,8 +;; (compress "test") => 789c2b492d2e1045d1c1,12 +;; (compress "test2") => 789c2b492d2e31206501f3,13 -- 2.34.1 From 7257bec0054cabeb29c253942fac968efa0277c4 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Wed, 12 Mar 2003 21:13:18 +0000 Subject: [PATCH 11/16] r4190: *** empty log message *** --- debian/changelog | 6 ++++++ debian/upload.sh | 2 +- src/strings.lisp | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7924e70..656f996 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-uffi (1.2.9-1) unstable; urgency=low + + * change ccl:%put-cstring to ccl::%put-cstring for openmcl + + -- Kevin M. Rosenberg Wed, 12 Mar 2003 14:12:03 -0700 + cl-uffi (1.2.8-1) unstable; urgency=low * Change output on compress.lisp example diff --git a/debian/upload.sh b/debian/upload.sh index 2c43417..7ddfa0d 100755 --- a/debian/upload.sh +++ b/debian/upload.sh @@ -1,4 +1,4 @@ #!/bin/bash -e -dup uffi -Uftp.med-info.com -D/home/ftp/uffi -C"(cd /opt/apache/htdocs/uffi.med-info.com; make install)" -su $* +dup uffi -Uftp.med-info.com -D/home/ftp/uffi -C"(cd /opt/apache/htdocs/uffi; make install)" -su $* diff --git a/src/strings.lisp b/src/strings.lisp index 2712a73..8d768e6 100644 --- a/src/strings.lisp +++ b/src/strings.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: strings.lisp,v 1.5 2002/12/13 22:49:09 kevin Exp $ +;;;; $Id: strings.lisp,v 1.6 2003/03/12 21:13:18 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -55,7 +55,7 @@ that LW/CMU automatically converts strings from c-calls." `(if (null ,obj) +null-cstring-pointer+ (let ((ptr (new-ptr (1+ (length ,obj))))) - (ccl:%put-cstring ptr ,obj) + (ccl::%put-cstring ptr ,obj) ptr)) ) @@ -143,7 +143,7 @@ that LW/CMU automatically converts strings from c-calls." `(if (null ,obj) +null-cstring-pointer+ (let ((ptr (new-ptr (1+ (length ,obj))))) - (ccl:%put-cstring ptr ,obj) + (ccl::%put-cstring ptr ,obj) ptr)) ) -- 2.34.1 From c78e4fee922511e939b7afb7d2d4a93d78032fd4 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Wed, 12 Mar 2003 21:13:30 +0000 Subject: [PATCH 12/16] r4191: Automatic commit for debian_version_1_2_9-1 --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 2e81ad5..52b040e 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: devel Priority: optional Maintainer: Kevin M. Rosenberg Build-Depends-Indep: debhelper (>= 4.0.0) -Standards-Version: 3.5.8.0 +Standards-Version: 3.5.9.0 Package: cl-uffi Architecture: all -- 2.34.1 From 6c6ce0383c021a161278435ba068f1e291191bac Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Fri, 28 Mar 2003 19:58:18 +0000 Subject: [PATCH 13/16] r4271: Auto commit for Debian build --- debian/changelog | 6 ++++++ src/strings.lisp | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 656f996..00e03ce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-uffi (1.2.10-1) unstable; urgency=low + + * Fix allegro free-cstring bug + + -- Kevin M. Rosenberg Fri, 28 Mar 2003 12:58:08 -0700 + cl-uffi (1.2.9-1) unstable; urgency=low * change ccl:%put-cstring to ccl::%put-cstring for openmcl diff --git a/src/strings.lisp b/src/strings.lisp index 8d768e6..28ff372 100644 --- a/src/strings.lisp +++ b/src/strings.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: strings.lisp,v 1.6 2003/03/12 21:13:18 kevin Exp $ +;;;; $Id: strings.lisp,v 1.7 2003/03/28 19:58:18 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -62,7 +62,7 @@ that LW/CMU automatically converts strings from c-calls." (defmacro free-cstring (obj) #+(or cmu sbcl scl lispworks) (declare (ignore obj)) #+allegro - `(unless (zerop obj) + `(unless (zerop ,obj) (ff:free-fobject ,obj)) #+mcl `(unless (ccl:%null-ptr-p ,obj) -- 2.34.1 From f7a5481c4ede7cf15256922861088e8601313ac8 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 31 Mar 2003 19:22:24 +0000 Subject: [PATCH 14/16] r4302: *** empty log message *** --- src/objects.lisp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/objects.lisp b/src/objects.lisp index 0881539..02928bd 100644 --- a/src/objects.lisp +++ b/src/objects.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: objects.lisp,v 1.10 2002/12/30 20:49:12 kevin Exp $ +;;;; $Id: objects.lisp,v 1.11 2003/03/31 19:22:24 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -135,6 +135,11 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated." (defmacro ensure-char-integer (obj) obj) +;; Returns the numeric value of a byte at a pointer +;; Highly optimized +(defmacro byte-value-at-pointer (ptr) + ) + (defmacro pointer-address (obj) #+(or cmu scl) `(system:sap-int (alien:alien-sap ,obj)) -- 2.34.1 From 0fd4491dbbe35c43abecd56549d8efd59760c73d Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Thu, 3 Apr 2003 17:02:36 +0000 Subject: [PATCH 15/16] r4363: *** empty log message *** --- uffi.asd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uffi.asd b/uffi.asd index d48db11..33adcb0 100644 --- a/uffi.asd +++ b/uffi.asd @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: uffi.asd,v 1.22 2003/02/19 21:56:22 kevin Exp $ +;;;; $Id: uffi.asd,v 1.23 2003/04/03 17:02:36 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -22,7 +22,7 @@ #+(or allegro lispworks cmu mcl cormanlisp sbcl scl) (defsystem uffi :name "cl-uffi" - :author "Kevin M. Rosenberg " + :author "Kevin M. Rosenberg " :version "1.0.0" :maintainer "Kevin M. Rosenberg " :licence "Lessor Lisp General Public License" -- 2.34.1 From 8dc332f588e5fab803cfdcf94507744e6ef057df Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Tue, 29 Apr 2003 12:09:36 +0000 Subject: [PATCH 16/16] r4699: *** empty log message *** --- debian/control | 15 +++++++++++++-- debian/rules | 38 +++++++++++++++++++++----------------- uffi-tests.asd | 25 +++++++++++++++++++++++++ uffi.asd | 25 ++++++++++++++----------- 4 files changed, 73 insertions(+), 30 deletions(-) create mode 100644 uffi-tests.asd diff --git a/debian/control b/debian/control index 52b040e..7730ed7 100644 --- a/debian/control +++ b/debian/control @@ -3,11 +3,22 @@ Section: devel Priority: optional Maintainer: Kevin M. Rosenberg Build-Depends-Indep: debhelper (>= 4.0.0) +Build-Depends: zlib1g-dev Standards-Version: 3.5.9.0 Package: cl-uffi Architecture: all Depends: common-lisp-controller (>= 3.37) +Recommends: cl-uffi-tests Description: Universal Foreign Function Library for Common Lisp - UFFI provides a universal foreign function interface (FFI) for Common Lisp. - UFFI supports CMUCL, Lispworks, and AllegroCL. + UFFI provides a universal foreign function interface (FFI) for + Common Lisp. + UFFI supports AllegroCL, CMUCL, Lispworks, MCL, OpenMCL, + SBCL, and SCL. + +Package: cl-uffi-tests +Architecture: any +Depends: common-lisp-controller (>= 3.37), cl-uffi, zlib1g +Description: Regression tests for UFFI Common Lisp Library + This is a test of regression tests for UFFI. Besides providing + testing for UFI, they serve as an example of UFFI usage. diff --git a/debian/rules b/debian/rules index f561721..36ea0d7 100755 --- a/debian/rules +++ b/debian/rules @@ -1,23 +1,22 @@ #!/usr/bin/make -f -export DH_COMPAT=4 - -pkg := uffi -debpkg := cl-uffi +pkg := uffi +pkg-tests := $(pkg)-tests +debpkg := cl-$(pkg) +debpkg-tests := $(debpkg)-tests clc-source := usr/share/common-lisp/source clc-systems := usr/share/common-lisp/systems -clc-uffi := $(clc-source)/$(pkg) - +clc-files := $(clc-source)/$(pkg) +clc-tests := $(clc-source)/$(pkg-tests) doc-dir := usr/share/doc/$(debpkg) - +lib-dir := usr/lib configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package. - touch configure-stamp @@ -25,20 +24,19 @@ build: build-stamp build-stamp: configure-stamp dh_testdir - # Add here commands to compile the package. - + (cd examples; make linux) touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp - # Add here commands to clean up after the build process. -$(MAKE) clean - rm -f debian/cl-uffi.postinst.* debian/cl-uffi.prerm.* - + cd examples + make clean + rm -f debian/$(debpkg).postinst.* debian/$(debpkg).prerm.* dh_clean install: build @@ -46,12 +44,18 @@ install: build dh_testroot dh_clean -k dh_installdirs --all $(clc-systems) $(clc-source) - dh_installdirs -p $(debpkg) $(doc-dir) $(clc-uffi)/src + dh_installdirs -p $(debpkg) $(doc-dir) $(clc-files)/src # Add here commands to install the package into debian/uffi. - dh_install uffi.asd $(clc-uffi) - dh_install "src/*.lisp" $(clc-uffi)/src - dh_link $(clc-uffi)/uffi.asd $(clc-systems)/uffi.asd + dh_install $(pkg).asd $(clc-files) + dh_install "src/*.lisp" $(clc-files)/src + dh_link $(clc-files)/$(pkg).asd $(clc-systems)/$(pkg).asd + + dh_installdirs -p $(debpkg-tests) $(clc-tests)/tests $(lib-dir) + dh_install $(debpkg-tests) $(pkg-tests).asd $(clc-tests) + dh_install $(debpkg-tests) "examples/*.lisp" $(clc-tests)/tests + dh_install $(debpkg-tests) "examples/c-test-fns.so" $(lib-dir) + dh_link $(debpkg-tests) $(clc-tests)/$(pkg-tests).asd $(clc-systems)/$(clc-tests).$(pkg-tests)asd rm -rf doc/html (cd doc; tar xzf html.tar.gz; cd ..) diff --git a/uffi-tests.asd b/uffi-tests.asd new file mode 100644 index 0000000..37a3e9f --- /dev/null +++ b/uffi-tests.asd @@ -0,0 +1,25 @@ +;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION +;;;; +;;;; Name: uffi-tests.asd +;;;; Purpose: ASDF system definitionf for uffi testing package +;;;; Author: Kevin M. Rosenberg +;;;; Date Started: Apr 2003 +;;;; +;;;; $Id: uffi-tests.asd,v 1.1 2003/04/29 12:09:36 kevin Exp $ +;;;; ************************************************************************* + +(defpackage #:uffi-tests-system + (:use #:asdf #:cl)) +(in-package #:uffi-tests-system) + +(defsystem uffi-tests + :depends-on (:rt :uffi) + :components ((:file "tests"))) + +(defmethod perform ((o test-op) (c (eql (find-system :uffi-tests)))) + (or (funcall (intern (symbol-name '#:do-tests) + (find-package '#:regression-test))) + (error "test-op failed"))) + diff --git a/uffi.asd b/uffi.asd index 33adcb0..40eb5be 100644 --- a/uffi.asd +++ b/uffi.asd @@ -4,10 +4,10 @@ ;;;; ;;;; Name: uffi.asd ;;;; Purpose: ASDF system definition file for UFFI package -;;;; Programmer: Kevin M. Rosenberg +;;;; Author: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: uffi.asd,v 1.23 2003/04/03 17:02:36 kevin Exp $ +;;;; $Id: uffi.asd,v 1.24 2003/04/29 12:09:36 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -16,22 +16,19 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) -(in-package :asdf) +(defpackage #:uffi-system (:use #:asdf #:cl)) +(in-package #:uffi-system) #+(or allegro lispworks cmu mcl cormanlisp sbcl scl) (defsystem uffi - :name "cl-uffi" - :author "Kevin M. Rosenberg " - :version "1.0.0" + :name "uffi" + :author "Kevin Rosenberg " + :version "1.2.x" :maintainer "Kevin M. Rosenberg " :licence "Lessor Lisp General Public License" :description "Universal Foreign Function Library for Common Lisp" :long-description "UFFI provides a universal foreign function interface (FFI) for Common Lisp. UFFI supports CMUCL, Lispworks, and AllegroCL." - :perform (load-op :after (op uffi) - (pushnew :uffi cl:*features*)) - :components ((:module :src :components @@ -44,5 +41,11 @@ (:file "functions" :depends-on ("primitives")) (:file "libraries" :depends-on ("package")) (:file "os" :depends-on ("package")))) - )) + )) + +#+(or allegro lispworks cmu mcl cormanlisp sbcl scl) +(defmethod perform ((o test-op) (c (eql (find-system :uffi)))) + (oos 'load-op 'uffi-tests) + (oos 'test-op 'uffi-tests)) + -- 2.34.1