From: Kevin M. Rosenberg Date: Sun, 7 Sep 2003 06:34:45 +0000 (+0000) Subject: r7061: initial property settings X-Git-Tag: v1.6.1~178 X-Git-Url: http://git.kpe.io/?p=uffi.git;a=commitdiff_plain;h=ebedde4e67b858b1f65c5eb4dc7bc45978ed1e40 r7061: initial property settings --- diff --git a/Makefile b/Makefile index 524c6bd..595ea92 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ # Programer: Kevin M. Rosenberg, M.D. # Date Started: Mar 2002 # -# CVS Id: $Id: Makefile,v 1.51 2002/10/01 17:05:29 kevin Exp $ +# CVS Id: $Id$ # # This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg # diff --git a/benchmarks/allocation.lisp b/benchmarks/allocation.lisp index 4b24bc7..dbdaa23 100644 --- a/benchmarks/allocation.lisp +++ b/benchmarks/allocation.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: allocation.lisp,v 1.2 2003/04/29 19:51:20 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/doc/Makefile b/doc/Makefile index 73c3af4..5952375 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -5,7 +5,7 @@ # Programer: Kevin M. Rosenberg # Date Started: Mar 2002 # -# CVS Id: $Id: Makefile,v 1.29 2002/08/02 14:39:44 kevin Exp $ +# CVS Id: $Id$ # # This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg # diff --git a/examples/Makefile b/examples/Makefile index 530655a..cce6380 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -5,7 +5,7 @@ # Programer: Kevin M. Rosenberg # Date Started: Mar 2002 # -# CVS Id: $Id: Makefile,v 1.18 2002/12/03 06:58:39 kevin Exp $ +# CVS Id: $Id$ # # This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg # diff --git a/examples/acl-compat-tester.lisp b/examples/acl-compat-tester.lisp index d777311..3b408d1 100644 --- a/examples/acl-compat-tester.lisp +++ b/examples/acl-compat-tester.lisp @@ -24,7 +24,7 @@ ;; Place, Suite 330, Boston, MA 02111-1307 USA ;; ;;;; from the original ACL 6.1 sources: -;; $Id: acl-compat-tester.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $ +;; $Id$ (defpackage :util.test diff --git a/examples/arrays.lisp b/examples/arrays.lisp index 1bc438f..ed80462 100644 --- a/examples/arrays.lisp +++ b/examples/arrays.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: arrays.lisp,v 1.2 2002/12/03 06:58:39 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/examples/atoifl.lisp b/examples/atoifl.lisp index 47c194c..7ea944d 100644 --- a/examples/atoifl.lisp +++ b/examples/atoifl.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: atoifl.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/examples/c-test-fns.c b/examples/c-test-fns.c index 20a5c2f..fdc17b8 100644 --- a/examples/c-test-fns.c +++ b/examples/c-test-fns.c @@ -6,7 +6,7 @@ * Programer: Kevin M. Rosenberg * Date Started: Mar 2002 * - * CVS Id: $Id: c-test-fns.c,v 1.5 2002/03/21 10:06:52 kevin Exp $ + * CVS Id: $Id$ * * This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg * diff --git a/examples/c-test-fns.lisp b/examples/c-test-fns.lisp index 4ff8fb9..f24d5cc 100644 --- a/examples/c-test-fns.lisp +++ b/examples/c-test-fns.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: c-test-fns.lisp,v 1.4 2002/11/18 04:53:31 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/examples/compress.lisp b/examples/compress.lisp index 02c8cd2..10634a3 100644 --- a/examples/compress.lisp +++ b/examples/compress.lisp @@ -1,119 +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.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 +;;;; -*- 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$ +;;;; +;;;; 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/examples/file-socket.lisp b/examples/file-socket.lisp index 67fe886..58ef17c 100644 --- a/examples/file-socket.lisp +++ b/examples/file-socket.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Jul 2002 ;;;; -;;;; $Id: file-socket.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/examples/getenv.lisp b/examples/getenv.lisp index 17d2758..72201e2 100644 --- a/examples/getenv.lisp +++ b/examples/getenv.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: getenv.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/examples/gethostname.lisp b/examples/gethostname.lisp index a6e1b0e..2f9a261 100644 --- a/examples/gethostname.lisp +++ b/examples/gethostname.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: gethostname.lisp,v 1.3 2002/12/02 13:21:43 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/examples/getshells.lisp b/examples/getshells.lisp index 1b05d10..c282706 100644 --- a/examples/getshells.lisp +++ b/examples/getshells.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: getshells.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/examples/gettime.lisp b/examples/gettime.lisp index 37461ff..7707f64 100644 --- a/examples/gettime.lisp +++ b/examples/gettime.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: gettime.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/examples/run-examples.lisp b/examples/run-examples.lisp index 7e80a3f..c6414e8 100644 --- a/examples/run-examples.lisp +++ b/examples/run-examples.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: run-examples.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/examples/strtol.lisp b/examples/strtol.lisp index c2956e3..2d54b8b 100644 --- a/examples/strtol.lisp +++ b/examples/strtol.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: strtol.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/examples/test-examples.lisp b/examples/test-examples.lisp index 5f780d4..1115941 100644 --- a/examples/test-examples.lisp +++ b/examples/test-examples.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: test-examples.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/examples/union.lisp b/examples/union.lisp index 2e186d8..df2507b 100644 --- a/examples/union.lisp +++ b/examples/union.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: union.lisp,v 1.3 2002/12/09 16:30:20 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/src/aggregates.lisp b/src/aggregates.lisp index cea43e6..3fcb410 100644 --- a/src/aggregates.lisp +++ b/src/aggregates.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: aggregates.lisp,v 1.9 2003/08/26 13:29:31 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/src/corman/getenv-ccl.lisp b/src/corman/getenv-ccl.lisp index fa32861..25cdfab 100644 --- a/src/corman/getenv-ccl.lisp +++ b/src/corman/getenv-ccl.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: "Joe Marshall" ;;;; Date Started: Feb 2002 ;;;; -`;;;; $Id: getenv-ccl.lisp,v 1.1 2002/10/01 17:05:29 kevin Exp $ +`;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/src/functions.lisp b/src/functions.lisp index 9469945..7f0939d 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.8 2003/06/06 21:59:18 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/src/libraries.lisp b/src/libraries.lisp index 592f08c..8fa6612 100644 --- a/src/libraries.lisp +++ b/src/libraries.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: libraries.lisp,v 1.13 2003/08/27 20:02:59 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/src/objects.lisp b/src/objects.lisp index 62f153e..dc382f5 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.20 2003/08/23 01:05:53 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/src/os.lisp b/src/os.lisp index 3e3a60b..a95bb61 100644 --- a/src/os.lisp +++ b/src/os.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Sep 2002 ;;;; -;;;; $Id: os.lisp,v 1.5 2003/06/06 21:59:18 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg. ;;;; Much of this code was taken from other open source project and copyright diff --git a/src/primitives.lisp b/src/primitives.lisp index 73027ef..007355c 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.12 2003/08/15 02:34:34 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/src/readmacros-mcl.lisp b/src/readmacros-mcl.lisp index 4eeffb2..89f3551 100644 --- a/src/readmacros-mcl.lisp +++ b/src/readmacros-mcl.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg/John Desoi ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: readmacros-mcl.lisp,v 1.4 2003/06/06 21:59:18 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/src/strings.lisp b/src/strings.lisp index a8cbf8b..250df2e 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.10 2003/07/18 21:33:26 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/tests/Makefile b/tests/Makefile index fe0bae1..09e6e39 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -5,7 +5,7 @@ # Programer: Kevin M. Rosenberg # Date Started: Mar 2002 # -# CVS Id: $Id: Makefile,v 1.24 2003/09/01 02:45:39 kevin Exp $ +# CVS Id: $Id$ # # This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg # diff --git a/tests/arrays.lisp b/tests/arrays.lisp index 641996c..e018083 100644 --- a/tests/arrays.lisp +++ b/tests/arrays.lisp @@ -7,7 +7,7 @@ ;;;; Author: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: arrays.lisp,v 1.5 2003/08/13 18:53:42 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002-2003 by Kevin M. Rosenberg ;;;; diff --git a/tests/atoifl.lisp b/tests/atoifl.lisp index b5cc75b..8d65aa5 100644 --- a/tests/atoifl.lisp +++ b/tests/atoifl.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: atoifl.lisp,v 1.3 2003/08/13 18:53:42 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002-2003 by Kevin M. Rosenberg ;;;; diff --git a/tests/casts.lisp b/tests/casts.lisp index ae5ece4..a665459 100644 --- a/tests/casts.lisp +++ b/tests/casts.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg / Edi Weitz ;;;; Date Started: Aug 2003 ;;;; -;;;; $Id: casts.lisp,v 1.2 2003/08/14 21:40:13 kevin Exp $ +;;;; $Id$ ;;;; ;;;; ************************************************************************* diff --git a/tests/compress.lisp b/tests/compress.lisp index 5bb6e3d..173d3e8 100644 --- a/tests/compress.lisp +++ b/tests/compress.lisp @@ -1,94 +1,94 @@ -;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ************************************************************************* -;;;; FILE IDENTIFICATION -;;;; -;;;; Name: compress.lisp -;;;; Purpose: UFFI Example file for zlib compression -;;;; Author: Kevin M. Rosenberg -;;;; Date Started: Feb 2002 -;;;; -;;;; $Id: compress.lisp,v 1.12 2003/08/13 18:53:42 kevin Exp $ -;;;; -;;;; This file, part of UFFI, is Copyright (c) 2002-2003 by Kevin M. Rosenberg -;;;; -;;;; ************************************************************************* - -(in-package #:uffi-tests) - -(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))))))) - -(deftest compress.1 (map 'list #'char-code (compress "")) - (120 156 3 0 0 0 0 1)) -(deftest compress.2 (map 'list #'char-code (compress "test")) - (120 156 43 73 45 46 1 0 4 93 1 193)) -(deftest compress.3 (map 'list #'char-code (compress "test2")) - (120 156 43 73 45 46 49 2 0 6 80 1 243)) - -(defun compress-uncompress (str) - (multiple-value-bind (compressed len) (compress str) - (declare (ignore len)) - (multiple-value-bind (uncompressed len2) (uncompress compressed) - (declare (ignore len2)) - uncompressed))) - - -(deftest uncompress.1 "" "") -(deftest uncompress.2 "test" "test") -(deftest uncompress.3 "test2" "test2") +;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION +;;;; +;;;; Name: compress.lisp +;;;; Purpose: UFFI Example file for zlib compression +;;;; Author: Kevin M. Rosenberg +;;;; Date Started: Feb 2002 +;;;; +;;;; $Id$ +;;;; +;;;; This file, part of UFFI, is Copyright (c) 2002-2003 by Kevin M. Rosenberg +;;;; +;;;; ************************************************************************* + +(in-package #:uffi-tests) + +(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))))))) + +(deftest compress.1 (map 'list #'char-code (compress "")) + (120 156 3 0 0 0 0 1)) +(deftest compress.2 (map 'list #'char-code (compress "test")) + (120 156 43 73 45 46 1 0 4 93 1 193)) +(deftest compress.3 (map 'list #'char-code (compress "test2")) + (120 156 43 73 45 46 49 2 0 6 80 1 243)) + +(defun compress-uncompress (str) + (multiple-value-bind (compressed len) (compress str) + (declare (ignore len)) + (multiple-value-bind (uncompressed len2) (uncompress compressed) + (declare (ignore len2)) + uncompressed))) + + +(deftest uncompress.1 "" "") +(deftest uncompress.2 "test" "test") +(deftest uncompress.3 "test2" "test2") diff --git a/tests/foreign-loader.lisp b/tests/foreign-loader.lisp index 68fe923..a611f88 100644 --- a/tests/foreign-loader.lisp +++ b/tests/foreign-loader.lisp @@ -7,7 +7,7 @@ ;;;; Author: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: foreign-loader.lisp,v 1.7 2003/08/27 19:58:25 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/tests/foreign-var.lisp b/tests/foreign-var.lisp index af072c4..ee9bd22 100644 --- a/tests/foreign-var.lisp +++ b/tests/foreign-var.lisp @@ -7,7 +7,7 @@ ;;;; Authors: Kevin M. Rosenberg and Edi Weitz ;;;; Date Started: Aug 2003 ;;;; -;;;; $Id: foreign-var.lisp,v 1.4 2003/08/15 02:50:24 kevin Exp $ +;;;; $Id$ ;;;; ;;;; ************************************************************************* diff --git a/tests/getenv.lisp b/tests/getenv.lisp index aba9b6e..19fe193 100644 --- a/tests/getenv.lisp +++ b/tests/getenv.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: getenv.lisp,v 1.4 2003/08/13 18:53:42 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002-2003 by Kevin M. Rosenberg ;;;; diff --git a/tests/gethostname.lisp b/tests/gethostname.lisp index d05e2ea..ec019da 100644 --- a/tests/gethostname.lisp +++ b/tests/gethostname.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: gethostname.lisp,v 1.6 2003/08/13 18:53:42 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002-2003 by Kevin M. Rosenberg ;;;; diff --git a/tests/package.lisp b/tests/package.lisp index 97f56a5..04c3b81 100644 --- a/tests/package.lisp +++ b/tests/package.lisp @@ -7,7 +7,7 @@ ;;;; Author: Kevin M. Rosenberg ;;;; Date Started: Apr 2003 ;;;; -;;;; $Id: package.lisp,v 1.2 2003/04/29 12:57:10 kevin Exp $ +;;;; $Id$ ;;;; ************************************************************************* (defpackage #:uffi-tests diff --git a/tests/pointers.lisp b/tests/pointers.lisp index 9f704ff..6af7f79 100644 --- a/tests/pointers.lisp +++ b/tests/pointers.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2003 ;;;; -;;;; $Id: pointers.lisp,v 1.1 2003/08/14 19:35:05 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2003 by Kevin M. Rosenberg ;;;; diff --git a/tests/strtol.lisp b/tests/strtol.lisp index 0167dbf..c3bfe13 100644 --- a/tests/strtol.lisp +++ b/tests/strtol.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: strtol.lisp,v 1.3 2003/08/13 18:53:42 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002-2003 by Kevin M. Rosenberg ;;;; diff --git a/tests/structs.lisp b/tests/structs.lisp index 8518eec..6eb7577 100644 --- a/tests/structs.lisp +++ b/tests/structs.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: structs.lisp,v 1.2 2003/08/14 19:35:05 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002-2003 by Kevin M. Rosenberg ;;;; diff --git a/tests/time.lisp b/tests/time.lisp index 410d14c..279dee0 100644 --- a/tests/time.lisp +++ b/tests/time.lisp @@ -7,7 +7,7 @@ ;;;; Author: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: time.lisp,v 1.3 2003/08/23 12:36:59 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; diff --git a/tests/uffi-c-test-lib.c b/tests/uffi-c-test-lib.c index 26884c6..ee1ab3a 100644 --- a/tests/uffi-c-test-lib.c +++ b/tests/uffi-c-test-lib.c @@ -6,7 +6,7 @@ * Programer: Kevin M. Rosenberg * Date Started: Mar 2002 * - * CVS Id: $Id: uffi-c-test-lib.c,v 1.4 2003/08/15 02:34:34 kevin Exp $ + * CVS Id: $Id$ * * This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg * diff --git a/tests/uffi-c-test-lib.lisp b/tests/uffi-c-test-lib.lisp index 928b073..14bca31 100644 --- a/tests/uffi-c-test-lib.lisp +++ b/tests/uffi-c-test-lib.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: uffi-c-test-lib.lisp,v 1.3 2003/08/13 18:53:42 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002-2003 by Kevin M. Rosenberg ;;;; diff --git a/tests/union.lisp b/tests/union.lisp index 7c4dc33..4268b91 100644 --- a/tests/union.lisp +++ b/tests/union.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: union.lisp,v 1.5 2003/08/13 18:53:42 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002-2003 by Kevin M. Rosenberg ;;;; diff --git a/uffi-tests.asd b/uffi-tests.asd index ebfa88e..4b8417b 100644 --- a/uffi-tests.asd +++ b/uffi-tests.asd @@ -7,7 +7,7 @@ ;;;; Author: Kevin M. Rosenberg ;;;; Date Started: Apr 2003 ;;;; -;;;; $Id: uffi-tests.asd,v 1.10 2003/08/14 21:40:13 kevin Exp $ +;;;; $Id$ ;;;; ************************************************************************* (defpackage #:uffi-tests-system diff --git a/uffi.asd b/uffi.asd index 84ae54d..7acf7c0 100644 --- a/uffi.asd +++ b/uffi.asd @@ -7,7 +7,7 @@ ;;;; Author: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: uffi.asd,v 1.28 2003/08/14 19:35:05 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;;