[Haskell-cafe] FFI and pointers to pointers

Simon Marlow simonmar at microsoft.com
Mon Apr 25 07:57:08 EDT 2005


On 25 April 2005 12:51, Simon Marlow wrote:

> On 22 April 2005 16:18, Dimitry Golubovsky wrote:
> 
>> I am trying to generalize my knowledge about FFI declarations when
>> dealing with pointers to pointers (import from C to Haskell). Maybe
>> these are silly questions, but It seems to me, I am missing some
>> understanding. 
>> 
>> Per the FFI Addendum:
>> 
>> For a variable, we use "&" import:
>> 
>> int bar;
>> 
>> foreign import ccall "&" bar :: Ptr CInt
> 
> The syntax you want is
> 
>   foreign import ccall "&bar" :: Ptr CInt

oops, never mind.  Your version was fine.

Cheers,
	Simon


More information about the Haskell-Cafe mailing list