Re: Evaluating types in function definitions

John DeSoi <[email protected]> Mon, 1 Apr 2002 14:55:06 -0500
Newsgroups gmane.lisp.uffi.devel
Message-ID <p04330104b8ce4d67830c@[192.168.1.6]>
Kevin,


>
>That's a interesting idea. It can likely be implemented. It is unusual
>since none of the supported native FFI's evaluate these. However,
>that doesn't mean that UFFI should not.
>
>How about a simpler solution? If you don't need to do dereference
>the pointer, why not use a return value of :void-pointer?
>Or, if you do need to dereference the pointer, you can use the following:
>#+apple (def-foreign-type :fsspecptr (* fsspec))
>#-apple (def-foreign-type :fsspecptr :cstring)

Yes, I think you are right. Let me try def-foreign-type again. I 
tried using it in MCL, but what I need to do there is a bit more 
complicated. I found some internal function to do a typedef 
operation, but it generates an error if you don't provide some kind 
of MAKE-LOAD-FORM. In the example I'm talking about, what you propose 
would work because I don't need to do anything if using MCL. But I 
still need to resolve the def-foreign-type issue to have complete 
support for UFFI.

BTW, everything seems to be going pretty well. I have the Valentina 
API with about 140 foreign functions and everything seems to work 
fine between MCL and LispWorks. After I resolve def-foreign-type and 
do the implementation for structs, the MCL version should be read to 
go.

Thanks for the feedback.

John DeSoi, Ph.D.