Haskell and Maple FFI

Rafael Martinez Torres rmartine at fdi.ucm.es
Thu Oct 21 04:53:06 EDT 2004


>
> B)  When passing char *string on C, should I use
> the CString or the Ptr CChar marhalling type from FFI ?
>

Ok. I see. Definition for CSTring is

type CString = Ptr CChar


C) CInt, CDouble are available...but, concerning Storable class.

Given:
typedef struct _foostruct {
    int a;
    double b;
} fooStruct, *fooStructPtr;

How to do to marshall  it to Haskell ?

type CFooStruct = ???

instance Storable CFooStruct where
   sizeOf _ = ???
   peekElement _ = ????

-- Next is certainly OK, provided well defined CFooStruct
type CFoosStructPtr = Ptr CFooStruct


I need it to marshall the Maple kernel handle into Haskell...



> _______________________________________________
> FFI mailing list
> FFI at haskell.org
> http://www.haskell.org/mailman/listinfo/ffi
>



More information about the FFI mailing list