comparison 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
comparison
equal deleted inserted replaced
5199:49e931565616 5200:70ed8a0d8da8
1 /* Header for charsets. 1 /* Header for charsets.
2 Copyright (C) 1992, 1995 Free Software Foundation, Inc. 2 Copyright (C) 1992, 1995 Free Software Foundation, Inc.
3 Copyright (C) 1995 Sun Microsystems, Inc. 3 Copyright (C) 1995 Sun Microsystems, Inc.
4 Copyright (C) 2001, 2002 Ben Wing. 4 Copyright (C) 2001, 2002, 2010 Ben Wing.
5 5
6 This file is part of XEmacs. 6 This file is part of XEmacs.
7 7
8 XEmacs is free software; you can redistribute it and/or modify it 8 XEmacs is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the 9 under the terms of the GNU General Public License as published by the
553 and C2. C2 of TYPE9N character is 0. */ 553 and C2. C2 of TYPE9N character is 0. */
554 554
555 #define BREAKUP_ICHAR(c, charset, c1, c2) \ 555 #define BREAKUP_ICHAR(c, charset, c1, c2) \
556 breakup_ichar_1 (c, &(charset), &(c1), &(c2)) 556 breakup_ichar_1 (c, &(charset), &(c1), &(c2))
557 557
558 /* Forward compatibility from ben-unicode-internal: Convert a charset
559 codepoint into a character in the internal string representation.
560 Return number of bytes written out. FAIL controls failure mode when
561 charset conversion to Unicode is not possible (unused as of yet). */
562 DECLARE_INLINE_HEADER (
563 Bytecount
564 charset_codepoint_to_itext (Lisp_Object charset, int c1, int c2, Ibyte *ptr,
565 enum converr UNUSED (fail))
566 )
567 {
568 Ichar ch;
569
570 if (EQ (charset, Vcharset_ascii))
571 {
572 ptr[0] = (Ibyte) c2;
573 return 1;
574 }
575
576 ch = make_ichar (charset, c1, c2);
577
578 /* We can't rely on the converted character being non-ASCII. For
579 example, JISX0208 codepoint (33, 64) == Unicode 0x5C (ASCII
580 backslash). */
581 return set_itext_ichar (ptr, ch);
582 }
583
584 /* Forward compatibility from ben-unicode-internal */
585
586 DECLARE_INLINE_HEADER (
587 void
588 buffer_itext_to_charset_codepoint (const Ibyte *ptr,
589 struct buffer *UNUSED (buf),
590 Lisp_Object *charset, int *c1, int *c2,
591 enum converr UNUSED (fail))
592 )
593 {
594 Ichar ch = itext_ichar (ptr);
595 breakup_ichar_1 (ch, charset, c1, c2);
596 }
597
558 void get_charset_limits (Lisp_Object charset, int *low, int *high); 598 void get_charset_limits (Lisp_Object charset, int *low, int *high);
559 int ichar_to_unicode (Ichar chr); 599 int ichar_to_unicode (Ichar chr);
560 600
561 EXFUN (Fcharset_name, 1); 601 EXFUN (Fcharset_name, 1);
562 602