Hi, 

I have:

(defun load-and-open-module (pathname)
  (let ((lib (cffi:load-foreign-library pathname)))
    (if lib
        (progn
          (format t "~%LOAD-AND-OPEN-MODULE: ~s LOADED." lib)
          (let ((handle (cffi:foreign-funcall `("open" :library ,lib) 
:pointer))) ;; <<--- Here's the challenge ...
            (if (not (eql handle (cffi:null-pointer)))
                (let ((module (make-instance 'pib-module
                                             :lib (c-in lib)
                                             :handle (c-in handle))))
                  (format t "~%LOAD-AND-OPEN-MODULE: module = ~s." module)
                  module)
                nil)
          nil)))))

The marked line should load the "open" function in the just loaded foreign lib. 
As I intend to load multiple so-called modules where each module has an "open" 
function I /think/ I need to say which open() function to call (the loaded libs 
are C DLLs, mostly).

How do I name a certain foreign lib in the call to foreign-funcall when the 
library given is not evaluated ?

Thanks for any hints!

Cheers
    Frank


_______________________________________________
cffi-devel mailing list
cffi-devel@common-lisp.net
http://lists.common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel

Reply via email to