Re: Haskell and Maple FFI
Rafael Martinez Torres <[email protected]> Thu, 21 Oct 2004 10:53:06 +0200 (CEST)
| Newsgroups | gmane.comp.lang.haskell.ffi |
|---|---|
| Message-ID | <[email protected]> |
>
> 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
> [email protected]
> http://www.haskell.org/mailman/listinfo/ffi
>