[Openmcl-devel] foreign variables

Eric Blood eblood at winkywooster.org
Wed Aug 4 09:18:38 PDT 2004


I want to dynamically access a variable in a shared library, and this 
is what I have at the moment:

    (in-package :ccl)
    (open-shared-library "foo.dylib")
    (setf foo-val (load-fv "_testval" :unsigned-char))
    (extract-foreign-value (fv.addr foo-val) 0
		       (info-foreign-type-definition :unsigned-char))
    (deposit-foreign-value (fv.addr foo-val) 0
		       (info-foreign-type-definition :unsigned-char) 101)

Is this even the right way to go?  I have poked around the cdb stuff, 
and didn't see an (easy?) way to inject type information so that I 
could use #?.

-- 
eblood




More information about the Openmcl-devel mailing list