More C interfacing issues

Simon Marlow simonmar at microsoft.com
Wed Jul 3 05:51:20 EDT 2002


> > What's wrong with just doing this in the plain FFI?
> 
> >   foreign import ccall "getyx" getyx 
> >          :: Ptr Window -> Ptr CInt -> Ptr CInt -> IO ()
> 
> > Have I missed something?
> 
> You need at least one wrapper because getyx is a macro.  Note that the
> arguments are ints _not_ int*s.  

Aha! :-)

Then I would probably write a C wrapper with the above type.

Curious: how does green card know that getxy is a macro and that x and y
are out parameters... do you have to tell it?

Cheers,
	Simon



More information about the FFI mailing list