From: David Richards

Subject: Foreign Function interface and foreign types

Date: 2001-2-26 23:53

Hello Everybody,
   I'm struggling a bit with Allegro's foreign function interface and 
foreign types interface. For example, suppose I defined a foreign type 
in the following way:

(ff:def-foreign-type foo (:struct (x :int) (y :int) (str (:array :char 
20))))

So now I have a composite type named foo (assuming of course that I have 
allocated an object and initialed it)- And I want to pass this struct to 
a 'C' function. What is baffling me is how to define the lisp function 
to do it. For example, the following obviously won't work:

(ff:def-foreign-call (tst-func "tst_func") ((obj (* :foo)) )
  :returning ((* : char)))

I have examined the syntax grammar for the foreign function call 
interface and can't quite figure out how to express my new composite 
type in a way that lisp won't complain. I'd appreciate any help on this 
subject...
Many thanks
Dave