AW: Exposing Haskell functions with string arguments in a DLL

Lescher Christian christian.lescher@icn.siemens.de
Mon, 16 Oct 2000 13:20:28 +0200


Thanks!! What about the other direction? (Haskell function with string =
result)

Christian

> -----Urspr> =FCngliche Nachricht-----
> Von:	Simon Marlow [SMTP:fldrsimonmar@microsoft.com]
> Gesendet am:	Montag, 16. Oktober 2000 13:07
> An:	'Lescher Christian'; 'glasgow-haskell-users@haskell.org'
> Betreff:	RE: Exposing Haskell functions with string arguments in a =
DLL
>=20
>=20
> > How can I convert string arguments (null-terminated strings)=20
> > to Haskell's [Char]? I saw there is some CString module in=20
> > package lang of GHC, but I didn't found any documentation=20
> > about it (e.g. packStringIO...?).
>=20
> For converting a static null-terminated C string to a Haskell String, =
use
> CString.unpackCString.  If you need to free the memory used by the =
original
> C string afterwards, use CString.unpackCStringIO.
>=20
> Cheers,
> 	Simon