File: hsiconv.c

package info (click to toggle)
haskell-iconv 0.4.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 108 kB
  • sloc: haskell: 510; ansic: 18; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "hsiconv.h"

/* On some platforms (notably darwin) the iconv functions are defined as
 * a macro rather than a real C function. Doh! That means we need these
 * wrappers to get a real C functions we can import via the Haskell FFI.
 */

iconv_t hs_wrap_iconv_open(const char *tocode, const char *fromcode) {
  return iconv_open(tocode, fromcode);
}

size_t hs_wrap_iconv(iconv_t cd,
                     char **inbuf, size_t *inbytesleft,
                     char **outbuf, size_t *outbytesleft) {
  return iconv(cd, inbuf, inbytesleft, outbuf, outbytesleft);
}

int hs_wrap_iconv_close(iconv_t cd) {
  return iconv_close(cd);
}