add GHC.HetMet.{hetmet_kappa,hetmet_kappa_app}
[ghc-base.git] / cbits / iconv.c
1 #ifndef __MINGW32__
2
3 #include <stdlib.h>
4 #include <iconv.h>
5
6 iconv_t hs_iconv_open(const char* tocode,
7                       const char* fromcode)
8 {
9         return iconv_open(tocode, fromcode);
10 }
11
12 size_t hs_iconv(iconv_t cd,
13                 const char* * inbuf, size_t * inbytesleft,
14                 char* * outbuf, size_t * outbytesleft)
15 {
16     // (void*) cast avoids a warning.  Some iconvs use (const
17     // char**inbuf), other use (char **inbuf).
18     return iconv(cd, (void*)inbuf, inbytesleft, outbuf, outbytesleft);
19 }
20
21 int hs_iconv_close(iconv_t cd) {
22         return iconv_close(cd);
23 }
24
25 #endif