r1710: *** empty log message ***
[uffi.git] / src / libraries.cl
index 38e2f22f16e985954370104ef642c5e5eca45fe7..f88a20720be8a86e4c620b62e9adf5eaf418590d 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: libraries.cl,v 1.6 2002/03/31 23:45:34 kevin Exp $
+;;;; $Id: libraries.cl,v 1.7 2002/04/01 00:52:07 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
   #+freebsd "a"
   #+linux "so")
 
-  
+(defun find-foreign-library (name &key directories type)  
+  "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 (listp directories)
+    (setq directories (list directories)))
+  (dolist (dir directories)
+    (let ((path (make-pathname :name :type type :directory directory)))
+      (when (probe-file path)
+       (return path))))
+  nil)
+
+
 (defun load-foreign-library (filename &key module supporting-libraries
                                           force-load)
   #+allegro (declare (ignore module supporting-libraries))