comparison src/charset.c @ 20720:f084bb8d535f

(min_composite_char): New variable. (Vcharacter_unification_table_vector): New variable. (syms_of_charset): Declare it as a Lisp symbol. Declare a Lisp variable min-composite-char. (unify_char): Delete unnecessary codes.
author Kenichi Handa <handa@m17n.org>
date Thu, 22 Jan 1998 01:26:45 +0000
parents a949dc65fbea
children cf404f800d2c
comparison
equal deleted inserted replaced
20719:78d95f2a9d92 20720:f084bb8d535f
58 int charset_katakana_jisx0201; /* JISX0201.Kana (Japanese Katakana) */ 58 int charset_katakana_jisx0201; /* JISX0201.Kana (Japanese Katakana) */
59 int charset_latin_jisx0201; /* JISX0201.Roman (Japanese Roman) */ 59 int charset_latin_jisx0201; /* JISX0201.Roman (Japanese Roman) */
60 int charset_big5_1; /* Big5 Level 1 (Chinese Traditional) */ 60 int charset_big5_1; /* Big5 Level 1 (Chinese Traditional) */
61 int charset_big5_2; /* Big5 Level 2 (Chinese Traditional) */ 61 int charset_big5_2; /* Big5 Level 2 (Chinese Traditional) */
62 62
63 int min_composite_char;
64
63 Lisp_Object Qcharset_table; 65 Lisp_Object Qcharset_table;
64 66
65 /* A char-table containing information of each character set. */ 67 /* A char-table containing information of each character set. */
66 Lisp_Object Vcharset_table; 68 Lisp_Object Vcharset_table;
67 69
69 only for returning charset symbol from C functions. */ 71 only for returning charset symbol from C functions. */
70 Lisp_Object Vcharset_symbol_table; 72 Lisp_Object Vcharset_symbol_table;
71 73
72 /* A list of charset symbols ever defined. */ 74 /* A list of charset symbols ever defined. */
73 Lisp_Object Vcharset_list; 75 Lisp_Object Vcharset_list;
76
77 /* Vector of unification table ever defined.
78 An ID of a unification table is an index of this vector. */
79 Lisp_Object Vcharacter_unification_table_vector;
74 80
75 /* Tables used by macros BYTES_BY_CHAR_HEAD and WIDTH_BY_CHAR_HEAD. */ 81 /* Tables used by macros BYTES_BY_CHAR_HEAD and WIDTH_BY_CHAR_HEAD. */
76 int bytes_by_char_head[256]; 82 int bytes_by_char_head[256];
77 int width_by_char_head[256]; 83 int width_by_char_head[256];
78 84
263 if (charset < 0) 269 if (charset < 0)
264 SPLIT_CHAR (c, charset, c1, c2); 270 SPLIT_CHAR (c, charset, c1, c2);
265 if (dimension != CHARSET_DIMENSION (charset)) 271 if (dimension != CHARSET_DIMENSION (charset))
266 /* We can't make such a character because of dimension mismatch. */ 272 /* We can't make such a character because of dimension mismatch. */
267 return c; 273 return c;
268 if (!alt_c1) alt_c1 = c1;
269 if (!alt_c2) alt_c2 = c2;
270 return MAKE_CHAR (alt_charset, c1, c2); 274 return MAKE_CHAR (alt_charset, c1, c2);
271 } 275 }
272 276
273 #define DEFAULT_NONASCII_INSERT_OFFSET 0x800 277 #define DEFAULT_NONASCII_INSERT_OFFSET 0x800
274 278
442 else 446 else
443 { 447 {
444 if (width == 1) 448 if (width == 1)
445 from = LEADING_CODE_EXT_21, to = LEADING_CODE_EXT_22; 449 from = LEADING_CODE_EXT_21, to = LEADING_CODE_EXT_22;
446 else 450 else
447 from = LEADING_CODE_EXT_22, to = LEADING_CODE_EXT_MAX - 1; 451 from = LEADING_CODE_EXT_22, to = LEADING_CODE_EXT_MAX + 1;
448 } 452 }
449 453
450 for (charset = from; charset < to; charset++) 454 for (charset = from; charset < to; charset++)
451 if (!CHARSET_DEFINED_P (charset)) break; 455 if (!CHARSET_DEFINED_P (charset)) break;
452 456
1100 { 1104 {
1101 int c, len; 1105 int c, len;
1102 unsigned char *str; 1106 unsigned char *str;
1103 1107
1104 if (!INTEGERP (args[i])) 1108 if (!INTEGERP (args[i]))
1105 { 1109 CHECK_NUMBER (args[i], 0);
1106 free (buf);
1107 CHECK_NUMBER (args[i], 0);
1108 }
1109 c = XINT (args[i]); 1110 c = XINT (args[i]);
1110 len = CHAR_STRING (c, p, str); 1111 len = CHAR_STRING (c, p, str);
1111 if (p != str) 1112 if (p != str)
1112 /* C is a composite character. */ 1113 /* C is a composite character. */
1113 bcopy (str, p, len); 1114 bcopy (str, p, len);
1666 1667
1667 DEFVAR_LISP ("charset-list", &Vcharset_list, 1668 DEFVAR_LISP ("charset-list", &Vcharset_list,
1668 "List of charsets ever defined."); 1669 "List of charsets ever defined.");
1669 Vcharset_list = Fcons (Qascii, Qnil); 1670 Vcharset_list = Fcons (Qascii, Qnil);
1670 1671
1672 DEFVAR_LISP ("character-unification-table-vector",
1673 &Vcharacter_unification_table_vector,
1674 "Vector of cons cell of a symbol and unification table ever defined.\n\
1675 An ID of a unification table is an index of this vector.");
1676 Vcharacter_unification_table_vector = Fmake_vector (make_number (16), Qnil);
1677
1671 DEFVAR_INT ("leading-code-composition", &leading_code_composition, 1678 DEFVAR_INT ("leading-code-composition", &leading_code_composition,
1672 "Leading-code of composite characters."); 1679 "Leading-code of composite characters.");
1673 leading_code_composition = LEADING_CODE_COMPOSITION; 1680 leading_code_composition = LEADING_CODE_COMPOSITION;
1674 1681
1675 DEFVAR_INT ("leading-code-private-11", &leading_code_private_11, 1682 DEFVAR_INT ("leading-code-private-11", &leading_code_private_11,
1692 "Offset to add to a non-ascii code 0200...0377 when inserting it.\n\ 1699 "Offset to add to a non-ascii code 0200...0377 when inserting it.\n\
1693 This applies only when multibyte characters are enabled, and it serves\n\ 1700 This applies only when multibyte characters are enabled, and it serves\n\
1694 to convert a Latin-1 or similar 8-bit character code to the corresponding\n\ 1701 to convert a Latin-1 or similar 8-bit character code to the corresponding\n\
1695 Emacs character code."); 1702 Emacs character code.");
1696 nonascii_insert_offset = 0; 1703 nonascii_insert_offset = 0;
1704
1705 DEFVAR_INT ("min-composite-char", &min_composite_char,
1706 "Minimum character code of a composite character.");
1707 min_composite_char = MIN_CHAR_COMPOSITION;
1697 } 1708 }
1698 1709
1699 #endif /* emacs */ 1710 #endif /* emacs */