1 /*******************************************************************************
3 D binding for the POSIX iconv library.
5 Defines external functions required to use iconv codeset conversion
8 iconv_open(3) Allocates the descriptor for code conversion
9 iconv(3) Performs the conversion
10 iconvctl(3) Control iconv behavior
11 iconv_close(3) Deallocates allocated resources
13 Copyright: Copyright (c) 2016 Sociomantic Labs. All rights reserved.
14 License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
15 Authors: Nemanja Boric
16 Standards: POSIX.1-2001, POSIX.1-2008
18 http://pubs.opengroup.org/onlinepubs/009695399/functions/iconv_open.html
20 *******************************************************************************/
22 module core.sys.posix.iconv;
26 ICONV_TRIVIALP = 0, /* int *argument */
27 ICONV_GET_TRANSLITERATE = 1, /* int *argument */
28 ICONV_SET_TRANSLITERATE = 2, /* const int *argument */
29 ICONV_GET_DISCARD_ILSEQ = 3, /* int *argument */
30 ICONV_SET_DISCARD_ILSEQ = 4, /* const int *argument */
41 /// Allocate descriptor for code conversion from codeset FROMCODE to
43 iconv_t iconv_open (in char* tocode, in char* fromcode);
45 /// Convert at most *INBYTESLEFT bytes from *INBUF according to the
46 /// code conversion algorithm specified by CD and place up to
47 /// *OUTBYTESLEFT bytes in buffer at *OUTBUF.
48 size_t iconv (iconv_t cd, in char** inbuf,
51 size_t* outbytesleft);
53 /// iconvctl queries or adjusts the behavior of the iconv function,
54 /// when invoked with the specified conversion descriptor,
55 /// depending on the request value.
56 int iconvctl (iconv_t cd, int request, void* argument);
58 /// Free resources allocated for descriptor CD for code conversion.
59 int iconv_close (iconv_t cd);