[Haskell-cafe] A function callable from C

John Ky newhoggy at gmail.com
Mon Feb 5 20:40:38 EST 2007


Hi Stefan,

In that case, how do I marshall [String] to Ptr (Ptr CChar)?

Thanks

-John

On 2/6/07, Stefan O'Rear <stefanor at cox.net> wrote:
>
> You have to use a type that C's tiny brain understains. IANAWP
> but I'm guessing you want:
>
> type ServiceMainClosure = DWORD -> Ptr (Ptr CChar) -> IO ()
>
> foreign import ccall "wrapper"
>   mkServiceMainClosure :: ServiceMainClosure -> IO (FunPtr
> ServiceMainClosure)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070206/39595551/attachment.htm


More information about the Haskell-Cafe mailing list