Mercurial > hg > xemacs-beta
diff src/charset.h @ 5200:70ed8a0d8da8
port Mule-ization of mule-wnnfns.c from ben-unicode-internal
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-04-12 Ben Wing <ben@xemacs.org>
* charset.h:
* lisp.h:
* lisp.h (XREALLOC_ARRAY):
* text.h:
Port charset_codepoint_to_itext(), buffer_itext_to_charset_codepoint(),
EXTBYTE_STRING_TO_ALLOCA(), `enum converr' from ben-unicode-internal,
for use with the mule-wnnfns.c changes.
* mule-wnnfns.c:
* mule-wnnfns.c (Fwnn_open):
* mule-wnnfns.c (Fwnn_dict_add):
* mule-wnnfns.c (Fwnn_dict_list):
* mule-wnnfns.c (Fwnn_get_zenkouho):
* mule-wnnfns.c (Fwnn_inspect):
* mule-wnnfns.c (Fwnn_bunsetu_kanji):
* mule-wnnfns.c (Fwnn_bunsetu_yomi):
* mule-wnnfns.c (Fwnn_word_info):
* mule-wnnfns.c (Fwnn_dict_search):
* mule-wnnfns.c (Fwnn_get_msg):
* mule-wnnfns.c (Fwnn_fuzokugo_set):
* mule-wnnfns.c (Fwnn_fuzokugo_get):
* mule-wnnfns.c (Fwnn_hinsi_list):
* mule-wnnfns.c (Fwnn_fisys_dict_add):
* mule-wnnfns.c (Fwnn_fiusr_dict_add):
* mule-wnnfns.c (Fwnn_notrans_dict_add):
* mule-wnnfns.c (Fwnn_bmodify_dict_add):
* mule-wnnfns.c (reinit_vars_of_mule_wnn):
* mule-wnnfns.c (vars_of_mule_wnn):
* mule-wnnfns.c (w2m):
* mule-wnnfns.c (m2w):
* mule-wnnfns.c (yes_or_no):
* mule-wnnfns.c (puts2):
* mule-wnnfns.c (check_wnn_server_type):
Mule-ize, borrowed from ben-unicode-internal.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 12 Apr 2010 00:55:04 -0500 |
parents | a9c41067dd88 |
children | 308d34e9f07d |
line wrap: on
line diff
--- a/src/charset.h Mon Apr 12 00:53:18 2010 -0500 +++ b/src/charset.h Mon Apr 12 00:55:04 2010 -0500 @@ -1,7 +1,7 @@ /* Header for charsets. Copyright (C) 1992, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2001, 2002 Ben Wing. + Copyright (C) 2001, 2002, 2010 Ben Wing. This file is part of XEmacs. @@ -555,6 +555,46 @@ #define BREAKUP_ICHAR(c, charset, c1, c2) \ breakup_ichar_1 (c, &(charset), &(c1), &(c2)) +/* Forward compatibility from ben-unicode-internal: Convert a charset + codepoint into a character in the internal string representation. + Return number of bytes written out. FAIL controls failure mode when + charset conversion to Unicode is not possible (unused as of yet). */ +DECLARE_INLINE_HEADER ( +Bytecount +charset_codepoint_to_itext (Lisp_Object charset, int c1, int c2, Ibyte *ptr, + enum converr UNUSED (fail)) +) +{ + Ichar ch; + + if (EQ (charset, Vcharset_ascii)) + { + ptr[0] = (Ibyte) c2; + return 1; + } + + ch = make_ichar (charset, c1, c2); + + /* We can't rely on the converted character being non-ASCII. For + example, JISX0208 codepoint (33, 64) == Unicode 0x5C (ASCII + backslash). */ + return set_itext_ichar (ptr, ch); +} + +/* Forward compatibility from ben-unicode-internal */ + +DECLARE_INLINE_HEADER ( +void +buffer_itext_to_charset_codepoint (const Ibyte *ptr, + struct buffer *UNUSED (buf), + Lisp_Object *charset, int *c1, int *c2, + enum converr UNUSED (fail)) +) +{ + Ichar ch = itext_ichar (ptr); + breakup_ichar_1 (ch, charset, c1, c2); +} + void get_charset_limits (Lisp_Object charset, int *low, int *high); int ichar_to_unicode (Ichar chr);