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.
11 * $Id: conv.h,v 2.32 2013/03/11 01:20:53 zy Exp $
16 #ifdef ICONV_TRADITIONAL
17 typedef char ** iconv_src_t
;
19 typedef char const ** iconv_src_t
;
27 * We can not use MB_CUR_MAX here, since UTF-8 may report it as 6, but
28 * a sequence longer than 4 is deprecated by RFC 3629.
30 #define KEY_NEEDSWIDE(sp, ch) \
31 (INTISWIDE(ch) && KEY_LEN(sp, ch) <= 4)
32 #define KEY_COL(sp, ch) \
33 (KEY_NEEDSWIDE(sp, ch) ? CHAR_WIDTH(sp, ch) : KEY_LEN(sp, ch))
35 enum { IC_FE_CHAR2INT
, IC_FE_INT2CHAR
, IC_IE_CHAR2INT
, IC_IE_TO_UTF16
};
45 typedef int (*char2wchar_t
)
46 (SCR
*, const char *, ssize_t
, struct _conv_win
*, size_t *, CHAR_T
**);
47 typedef int (*wchar2char_t
)
48 (SCR
*, const CHAR_T
*, ssize_t
, struct _conv_win
*, size_t *, char **);
53 char2wchar_t file2int
;
54 wchar2char_t int2file
;
55 char2wchar_t input2int
;
56 iconv_t id
[IC_IE_TO_UTF16
+ 1];