> -------------
> A) The H98 Foreign Function Interface remakrs the next example to import
> from C.
>
> foreign import ccall "string.h strlen" cstrlen:: Ptr CChar -> IO CSize
>
> but trying
>
> foreign import ccall "maplec.h MapleKernelOptions" mapleKernelOptions ::
> MKernelVector ->  CString -> IO(ALGEB)
>
> gives a failure. (ghc-5.02.3)
> [EMAIL PROTECTED]:~/OpenMaple> ghc -cpp -fglasgow-exts -c maplec.hs -package lang
>
> maplec.hs:82:
>     `maplec.h MapleKernelOptions' is not a valid C identifier
>     When checking declaration:
>       foreign import __ccall_GC maplec.h MapleKernelOptions mapleKernelOptions :: 
> MKernelVector
>                                                                                   -> 
> CString
>                                                                                      
> -> IO ALGEB

Done. Upgrading ghc-6.0.1 solves it.

Still waiting for answer C) on how marshalling C structures...
_______________________________________________
FFI mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/ffi

Reply via email to