~ubuntu-branches/ubuntu/precise/ghc/precise

« back to all changes in this revision

Viewing changes to libraries/base/cbits/iconv.c

  • Committer: Bazaar Package Importer
  • Author(s): Joachim Breitner
  • Date: 2011-01-17 12:49:24 UTC
  • Revision ID: james.westby@ubuntu.com-20110117124924-do1pym1jlf5o636m
Tags: upstream-7.0.1
ImportĀ upstreamĀ versionĀ 7.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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