[Haskell-cafe] Is c2hs able to generate FunPtr rather than just
bulat.ziganshin at gmail.com
Mon Oct 5 03:36:43 EDT 2009
Monday, October 5, 2009, 9:18:30 AM, you wrote:
> Is there a neat way to have c2hs generate the FunPtr version for me?
from my program:
-- |My callback function type
type CALLBACK_FUNC = Ptr CChar -> IO CInt
foreign import ccall threadsafe "wrapper"
mkCALL_BACK :: CALLBACK_FUNC -> IO (FunPtr CALLBACK_FUNC)
key word here is "wrapper" in foreign import statement. read FFI specs
Bulat mailto:Bulat.Ziganshin at gmail.com
More information about the Haskell-Cafe