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

2008-05-09 Thread Olivier Boudry
Hi all, I'm trying to make RFC calls to SAP using the nwsaprfc library. Some structs defined in the library contains arrays (byte or word arrays). For example: typedef struct _RFC_ATTRIBUTES { SAP_UC dest[64+1]; /* RFC destination */ SAP_UC host[100+1];

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

2008-05-09 Thread Brandon S. Allbery KF8NH
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

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

2008-05-09 Thread Olivier Boudry
Hi Brandon, Thanks for your help, CString will work great for Char arrays, but what about the 16bit-Word arrays? I was not clear in my previous post but the structures used in the nwrfcsdk library can use 8bit or 16 bit chars depending on a #define (#define SAPwithUNICODE). Reading another post

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

2008-05-09 Thread Bulat Ziganshin
Hello Olivier, Friday, May 9, 2008, 6:28:38 PM, you wrote: Thanks for your help, CString will work great for Char arrays, but what about the 16bit-Word arrays? TString. they are used a lot for interfacing with Win32 API -- Best regards, Bulatmailto:[EMAIL