Skip to content
Snippets Groups Projects
Commit da934dc4 authored by tomo's avatar tomo
Browse files

(encode_char_2): New inline function.

(CHAR_TO_CHARC): Use `encode_char_2' instead of `encode_char_1'.
parent 382f7e92
Branches
Tags
No related merge requests found
/* Header for UCS-4 character representation.
Copyright (C) 1999,2000,2001,2002,2003 MORIOKA Tomohiko
Copyright (C) 1999,2000,2001,2002,2003,2004 MORIOKA Tomohiko
This file is part of XEmacs.
......@@ -703,6 +703,30 @@ encode_char_1 (Emchar ch, Lisp_Object* charset)
return encode_builtin_char_1 (ch, charset);
}
INLINE_HEADER int encode_char_2 (Emchar ch, Lisp_Object* charset);
INLINE_HEADER int
encode_char_2 (Emchar ch, Lisp_Object* charset)
{
Lisp_Object charsets = Vdefault_coded_charset_priority_list;
while (!NILP (charsets))
{
*charset = Ffind_charset (Fcar (charsets));
if ( !NILP (*charset)
&& (XCHARSET_DIMENSION (*charset) <= 2) )
{
int code_point = charset_code_point (*charset, ch, 0);
if (code_point >= 0)
return code_point;
}
charsets = Fcdr (charsets);
}
/* otherwise --- maybe for bootstrap */
return encode_builtin_char_1 (ch, charset);
}
#define ENCODE_CHAR(ch, charset) encode_char_1 (ch, &(charset))
INLINE_HEADER void
......@@ -761,7 +785,7 @@ CHAR_TO_CHARC (Emchar ch)
{
Charc cc;
cc.code_point = encode_char_1 (ch, &cc.charset);
cc.code_point = encode_char_2 (ch, &cc.charset);
return cc;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment