X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Flibraries.cl;h=e5bb757ba1029780c30b08995d544341678f19b9;hb=79cd30e5bb24c5a8d2eea188e15109e544f8638b;hp=7194c6bf874545ff87be1522a63d923b69f9f4fd;hpb=ab96e211bb083d1e1ea4edca83d4f6d47b41c84b;p=uffi.git diff --git a/src/libraries.cl b/src/libraries.cl index 7194c6b..e5bb757 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.8 2002/04/01 04:40:08 kevin Exp $ +;;;; $Id: libraries.cl,v 1.11 2002/04/01 20:40:36 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -25,15 +25,16 @@ (defun default-foreign-library-type () "Returns string naming default library type for platform" #+(or win32 mswindows) "dll" - #+freebsd "a" - #+linux "so") + #-(or win32 mswindows) "so") -(defun find-foreign-library (names directories &key type drive-letters) +(defun find-foreign-library (names directories &key types drive-letters) "Looks for a foreign library. directories can be a single string or a list of strings of candidate directories. Use default library type if type is not specified." - (unless type - (setq type (default-foreign-library-type))) + (unless types + (setq types (default-foreign-library-type))) + (unless (listp types) + (setq types (list types))) (unless (listp names) (setq names (list names))) (unless (listp directories) @@ -46,25 +47,25 @@ library type if type is not specified." (dolist (drive-letter drive-letters) (dolist (name names) (dolist (dir directories) - (let ((path (make-pathname - #+lispworks :host - #+lispworks (when drive-letter drive-letter) - #-lispworks :device - #-lispworks (when drive-letter drive-letter) - :name name - :type type - :directory - (etypecase dir - (pathname - (pathname-directory dir)) - (list - dir) - (string - (pathname-directory - (parse-namestring dir))))))) - (print path) - (when (probe-file path) - (return-from find-foreign-library path)))))) + (dolist (type types) + (let ((path (make-pathname + #+lispworks :host + #+lispworks (when drive-letter drive-letter) + #-lispworks :device + #-lispworks (when drive-letter drive-letter) + :name name + :type type + :directory + (etypecase dir + (pathname + (pathname-directory dir)) + (list + dir) + (string + (pathname-directory + (parse-namestring dir))))))) + (when (probe-file path) + (return-from find-foreign-library path))))))) nil)