2 * Copyright (c) 1992, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 1992, 1993, 1994, 1995, 1996
5 * Keith Bostic. All rights reserved.
6 * Copyright (c) 2011, 2012
7 * Zhihao Yuan. All rights reserved.
9 * See the LICENSE file for redistribution information.
14 #ifdef ICONV_TRADITIONAL
15 typedef char ** iconv_src_t;
17 typedef char const ** iconv_src_t;
25 * We can not use MB_CUR_MAX here, since UTF-8 may report it as 6, but
26 * a sequence longer than 4 is deprecated by RFC 3629.
28 #define KEY_NEEDSWIDE(sp, ch) \
29 (INTISWIDE(ch) && KEY_LEN(sp, ch) <= 4)
30 #define KEY_COL(sp, ch) \
31 (KEY_NEEDSWIDE(sp, ch) ? CHAR_WIDTH(sp, ch) : KEY_LEN(sp, ch))
33 enum { IC_FE_CHAR2INT, IC_FE_INT2CHAR, IC_IE_CHAR2INT, IC_IE_TO_UTF16 };
43 typedef int (*char2wchar_t)
44 (SCR *, const char *, ssize_t, struct _conv_win *, size_t *, CHAR_T **);
45 typedef int (*wchar2char_t)
46 (SCR *, const CHAR_T *, ssize_t, struct _conv_win *, size_t *, char **);
51 char2wchar_t file2int;
52 wchar2char_t int2file;
53 char2wchar_t input2int;
54 iconv_t id[IC_IE_TO_UTF16 + 1];