[Haskell-cafe] FFI: Creating a Storable for a C-struct composed of char arrays

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Fri May 9 09:52:01 EDT 2008

On 2008 May 9, at 9:42, Olivier Boudry wrote:

> Of course it won't work as HArrayStruct in file HArrayStruct.hs uses  
> Strings and String is not an instance of Storable.
> Ideally I would need some sort of Storable array of char. Is  
> Data.Storable.Array the type I'm looking for? Could someone point me  
> to some code using the same kind of structures?

You want CString (Foreign.C.String).

brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080509/2ccf8e14/attachment.htm

More information about the Haskell-Cafe mailing list