X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fmule-charset.c;h=0991fe132401eba5e04a2f8af901a368e60b3998;hb=59ca45fb82208b9758b0eb17b9ba670e5e53c240;hp=b83166db2f17a54a03d1d650fc590135f2601aee;hpb=02276b8e7e7b7e647493d52f77beb00d64951836;p=chise%2Fxemacs-chise.git- diff --git a/src/mule-charset.c b/src/mule-charset.c index b83166d..0991fe1 100644 --- a/src/mule-charset.c +++ b/src/mule-charset.c @@ -1,6 +1,7 @@ /* Functions to handle multilingual characters. Copyright (C) 1992, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. + Copyright (C) 1999,2000 MORIOKA Tomohiko This file is part of XEmacs. @@ -53,6 +54,7 @@ Lisp_Object Vcharset_latin_iso8859_9; Lisp_Object Vcharset_japanese_jisx0208_1978; Lisp_Object Vcharset_chinese_gb2312; Lisp_Object Vcharset_japanese_jisx0208; +Lisp_Object Vcharset_japanese_jisx0208_1990; Lisp_Object Vcharset_korean_ksc5601; Lisp_Object Vcharset_japanese_jisx0212; Lisp_Object Vcharset_chinese_cns11643_1; @@ -62,9 +64,29 @@ Lisp_Object Vcharset_ucs_bmp; Lisp_Object Vcharset_latin_viscii; Lisp_Object Vcharset_latin_viscii_lower; Lisp_Object Vcharset_latin_viscii_upper; +Lisp_Object Vcharset_ideograph_daikanwa; +Lisp_Object Vcharset_mojikyo_pj_1; +Lisp_Object Vcharset_mojikyo_pj_2; +Lisp_Object Vcharset_mojikyo_pj_3; +Lisp_Object Vcharset_mojikyo_pj_4; +Lisp_Object Vcharset_mojikyo_pj_5; +Lisp_Object Vcharset_mojikyo_pj_6; +Lisp_Object Vcharset_mojikyo_pj_7; +Lisp_Object Vcharset_mojikyo_pj_8; +Lisp_Object Vcharset_mojikyo_pj_9; +Lisp_Object Vcharset_mojikyo_pj_10; +Lisp_Object Vcharset_mojikyo_pj_11; +Lisp_Object Vcharset_mojikyo_pj_12; +Lisp_Object Vcharset_mojikyo_pj_13; +Lisp_Object Vcharset_mojikyo_pj_14; +Lisp_Object Vcharset_mojikyo_pj_15; +Lisp_Object Vcharset_mojikyo_pj_16; +Lisp_Object Vcharset_mojikyo_pj_17; +Lisp_Object Vcharset_mojikyo_pj_18; +Lisp_Object Vcharset_mojikyo_pj_19; +Lisp_Object Vcharset_mojikyo_pj_20; +Lisp_Object Vcharset_mojikyo_pj_21; Lisp_Object Vcharset_ethiopic_ucs; -Lisp_Object Vcharset_hiragana_jisx0208; -Lisp_Object Vcharset_katakana_jisx0208; #endif Lisp_Object Vcharset_chinese_big5_1; Lisp_Object Vcharset_chinese_big5_2; @@ -83,15 +105,22 @@ static int composite_char_col_next; #endif /* ENABLE_COMPOSITE_CHARS */ -/* Table of charsets indexed by leading byte. */ -Lisp_Object charset_by_leading_byte[NUM_LEADING_BYTES]; +struct charset_lookup *chlook; -/* Table of charsets indexed by type/final-byte/direction. */ +static const struct lrecord_description charset_lookup_description_1[] = { + { XD_LISP_OBJECT, offsetof(struct charset_lookup, charset_by_leading_byte), #ifdef UTF2000 -Lisp_Object charset_by_attributes[4][128]; + 128+4*128 #else -Lisp_Object charset_by_attributes[4][128][2]; + 128+4*128*2 #endif + }, { XD_END } +}; + +static const struct struct_description charset_lookup_description = { + sizeof(struct charset_lookup), + charset_lookup_description_1 +}; #ifndef UTF2000 /* Table of number of bytes in the string representation of a character @@ -100,9 +129,9 @@ Lisp_Object charset_by_attributes[4][128][2]; rep_bytes_by_first_byte(c) is more efficient than the equivalent canonical computation: - (BYTE_ASCII_P (c) ? 1 : XCHARSET_REP_BYTES (CHARSET_BY_LEADING_BYTE (c))) */ + XCHARSET_REP_BYTES (CHARSET_BY_LEADING_BYTE (c)) */ -Bytecount rep_bytes_by_first_byte[0xA0] = +const Bytecount rep_bytes_by_first_byte[0xA0] = { /* 0x00 - 0x7f are for straight ASCII */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -128,14 +157,14 @@ Bytecount rep_bytes_by_first_byte[0xA0] = #ifdef UTF2000 static Lisp_Object -mark_char_byte_table (Lisp_Object obj, void (*markobj) (Lisp_Object)) +mark_char_byte_table (Lisp_Object obj) { struct Lisp_Char_Byte_Table *cte = XCHAR_BYTE_TABLE (obj); int i; for (i = 0; i < 256; i++) { - markobj (cte->property[i]); + mark_object (cte->property[i]); } return Qnil; } @@ -227,7 +256,7 @@ copy_char_byte_table (Lisp_Object entry) static Lisp_Object -mark_char_code_table (Lisp_Object obj, void (*markobj) (Lisp_Object)) +mark_char_code_table (Lisp_Object obj) { struct Lisp_Char_Code_Table *cte = XCHAR_CODE_TABLE (obj); @@ -386,6 +415,11 @@ Lisp_Object Vcharacter_variant_table; Lisp_Object Q_decomposition; Lisp_Object Q_ucs; Lisp_Object Qcompat; +Lisp_Object Qisolated; +Lisp_Object Qinitial; +Lisp_Object Qmedial; +Lisp_Object Qfinal; +Lisp_Object Qvertical; Lisp_Object QnoBreak; Lisp_Object Qfraction; Lisp_Object Qsuper; @@ -394,6 +428,7 @@ Lisp_Object Qcircle; Lisp_Object Qsquare; Lisp_Object Qwide; Lisp_Object Qnarrow; +Lisp_Object Qsmall; Lisp_Object Qfont; Emchar @@ -405,24 +440,36 @@ to_char_code (Lisp_Object v, char* err_msg, Lisp_Object err_arg) return XCHAR (v); else if (EQ (v, Qcompat)) return -1; - else if (EQ (v, QnoBreak)) + else if (EQ (v, Qisolated)) return -2; - else if (EQ (v, Qfraction)) + else if (EQ (v, Qinitial)) return -3; - else if (EQ (v, Qsuper)) + else if (EQ (v, Qmedial)) return -4; - else if (EQ (v, Qsub)) + else if (EQ (v, Qfinal)) return -5; - else if (EQ (v, Qcircle)) + else if (EQ (v, Qvertical)) return -6; - else if (EQ (v, Qsquare)) + else if (EQ (v, QnoBreak)) return -7; - else if (EQ (v, Qwide)) + else if (EQ (v, Qfraction)) return -8; - else if (EQ (v, Qnarrow)) + else if (EQ (v, Qsuper)) return -9; - else if (EQ (v, Qfont)) + else if (EQ (v, Qsub)) return -10; + else if (EQ (v, Qcircle)) + return -11; + else if (EQ (v, Qsquare)) + return -12; + else if (EQ (v, Qwide)) + return -13; + else if (EQ (v, Qnarrow)) + return -14; + else if (EQ (v, Qsmall)) + return -15; + else if (EQ (v, Qfont)) + return -16; else signal_simple_error (err_msg, err_arg); } @@ -486,10 +533,12 @@ Return the value of CHARACTER's ATTRIBUTE. */ (character, attribute)) { - Lisp_Object ret - = get_char_code_table (XCHAR (character), Vcharacter_attribute_table); + Lisp_Object ret; Lisp_Object ccs; + CHECK_CHAR (character); + ret = get_char_code_table (XCHAR (character), + Vcharacter_attribute_table); if (EQ (ret, Qnil)) return Qnil; @@ -529,15 +578,18 @@ Store CHARACTER's ATTRIBUTE with VALUE. { Lisp_Object ccs; + CHECK_CHAR (character); ccs = Ffind_charset (attribute); if (!NILP (ccs)) { - Lisp_Object rest; + Lisp_Object cpos, rest; Lisp_Object v = XCHARSET_DECODING_TABLE (ccs); Lisp_Object nv; int i = -1; int ccs_len; - + int dim; + int code_point; + /* ad-hoc method for `ascii' */ if ((XCHARSET_CHARS (ccs) == 94) && (XCHARSET_BYTE_OFFSET (ccs) != 33)) @@ -545,26 +597,58 @@ Store CHARACTER's ATTRIBUTE with VALUE. else ccs_len = XCHARSET_CHARS (ccs); - if (!CONSP (value)) - signal_simple_error ("Invalid value for coded-charset", - value); + if (CONSP (value)) + { + Lisp_Object ret = Fcar (value); + + if (!INTP (ret)) + signal_simple_error ("Invalid value for coded-charset", value); + code_point = XINT (ret); + if (XCHARSET_GRAPHIC (ccs) == 1) + code_point &= 0x7F; + rest = Fcdr (value); + while (!NILP (rest)) + { + int i; + + if (!CONSP (rest)) + signal_simple_error ("Invalid value for coded-charset", value); + ret = Fcar (rest); + if (!INTP (ret)) + signal_simple_error ("Invalid value for coded-charset", value); + i = XINT (ret); + if (XCHARSET_GRAPHIC (ccs) == 1) + i &= 0x7F; + code_point = (code_point << 8) | i; + rest = Fcdr (rest); + } + value = make_int (code_point); + } + else if (INTP (value)) + { + if (XCHARSET_GRAPHIC (ccs) == 1) + value = make_int (XINT (value) & 0x7F7F7F7F); + } + else + signal_simple_error ("Invalid value for coded-charset", value); attribute = ccs; - rest = Fget_char_attribute (character, attribute); + cpos = Fget_char_attribute (character, attribute); if (VECTORP (v)) { - if (!NILP (rest)) + if (!NILP (cpos)) { - while (!NILP (rest)) + dim = XCHARSET_DIMENSION (ccs); + code_point = XINT (cpos); + while (dim > 0) { - Lisp_Object ei = Fcar (rest); - - i = XINT (ei) - XCHARSET_BYTE_OFFSET (ccs); + dim--; + i = ((code_point >> (8 * dim)) & 255) + - XCHARSET_BYTE_OFFSET (ccs); nv = XVECTOR_DATA(v)[i]; if (!VECTORP (nv)) break; v = nv; - rest = Fcdr (rest); } if (i >= 0) XVECTOR_DATA(v)[i] = Qnil; @@ -576,33 +660,18 @@ Store CHARACTER's ATTRIBUTE with VALUE. XCHARSET_DECODING_TABLE (ccs) = v = make_vector (ccs_len, Qnil); } - if (XCHARSET_GRAPHIC (ccs) == 1) - value = Fcopy_list (value); - rest = value; + dim = XCHARSET_DIMENSION (ccs); + code_point = XINT (value); i = -1; - while (CONSP (rest)) + while (dim > 0) { - Lisp_Object ei = Fcar (rest); - - if (!INTP (ei)) - signal_simple_error ("Invalid value for coded-charset", value); - i = XINT (ei); - if ((i < 0) || (255 < i)) - signal_simple_error ("Invalid value for coded-charset", value); - if (XCHARSET_GRAPHIC (ccs) == 1) - { - i &= 0x7F; - Fsetcar (rest, make_int (i)); - } - i -= XCHARSET_BYTE_OFFSET (ccs); + dim--; + i = ((code_point >> (8 * dim)) & 255) - XCHARSET_BYTE_OFFSET (ccs); nv = XVECTOR_DATA(v)[i]; - rest = Fcdr (rest); - if (CONSP (rest)) + if (dim > 0) { if (!VECTORP (nv)) - { - nv = (XVECTOR_DATA(v)[i] = make_vector (ccs_len, Qnil)); - } + nv = (XVECTOR_DATA(v)[i] = make_vector (ccs_len, Qnil)); v = nv; } else @@ -666,6 +735,8 @@ Store CHARACTER's ATTRIBUTE with VALUE. Lisp_Object Qucs; +EXFUN (Fmake_char, 3); + DEFUN ("define-char", Fdefine_char, 1, 1, 0, /* Store character's ATTRIBUTES. */ @@ -684,71 +755,23 @@ Store character's ATTRIBUTES. if (!LISTP (cell)) signal_simple_error ("Invalid argument", attributes); - if (!NILP (ccs = Ffind_charset (Fcar (cell))) - && XCHARSET_FINAL (ccs)) + if (!NILP (ccs = Ffind_charset (Fcar (cell)))) { - Emchar code; - - if (XCHARSET_DIMENSION (ccs) == 1) - { - Lisp_Object eb1 = Fcar (Fcdr (cell)); - int b1; - - if (!INTP (eb1)) - signal_simple_error ("Invalid argument", attributes); - b1 = XINT (eb1); - switch (XCHARSET_CHARS (ccs)) - { - case 94: - code = MIN_CHAR_94 - + (XCHARSET_FINAL (ccs) - '0') * 94 + (b1 - 33); - break; - case 96: - code = MIN_CHAR_96 - + (XCHARSET_FINAL (ccs) - '0') * 96 + (b1 - 32); - break; - default: - abort (); - } - } - else if (XCHARSET_DIMENSION (ccs) == 2) - { - Lisp_Object eb1 = Fcar (Fcdr (cell)); - Lisp_Object eb2 = Fcar (Fcdr (Fcdr (cell))); - int b1, b2; - - if (!INTP (eb1)) - signal_simple_error ("Invalid argument", attributes); - b1 = XINT (eb1); - if (!INTP (eb2)) - signal_simple_error ("Invalid argument", attributes); - b2 = XINT (eb2); - switch (XCHARSET_CHARS (ccs)) - { - case 94: - code = MIN_CHAR_94x94 - + (XCHARSET_FINAL (ccs) - '0') * 94 * 94 - + (b1 - 33) * 94 + (b2 - 33); - break; - case 96: - code = MIN_CHAR_96x96 - + (XCHARSET_FINAL (ccs) - '0') * 96 * 96 - + (b1 - 32) * 96 + (b2 - 32); - break; - default: - abort (); - } - } - else - { - rest = Fcdr (rest); - continue; - } - character = make_char (code); + cell = Fcdr (cell); + character = Fmake_char (ccs, Fcar (cell), + Fcar (Fcdr (cell))); goto setup_attributes; } rest = Fcdr (rest); } + if (!NILP (code = Fcdr (Fassq (Q_ucs, attributes)))) + { + if (!INTP (code)) + signal_simple_error ("Invalid argument", attributes); + else + character = make_char (XINT (code) + 0x100000); + goto setup_attributes; + } return Qnil; } else if (!INTP (code)) @@ -804,6 +827,7 @@ Lisp_Object Qascii, Qjapanese_jisx0208_1978, Qchinese_gb2312, Qjapanese_jisx0208, + Qjapanese_jisx0208_1990, Qkorean_ksc5601, Qjapanese_jisx0212, Qchinese_cns11643_1, @@ -815,9 +839,29 @@ Lisp_Object Qascii, Qlatin_viscii_upper, Qvietnamese_viscii_lower, Qvietnamese_viscii_upper, + Qideograph_daikanwa, + Qmojikyo_pj_1, + Qmojikyo_pj_2, + Qmojikyo_pj_3, + Qmojikyo_pj_4, + Qmojikyo_pj_5, + Qmojikyo_pj_6, + Qmojikyo_pj_7, + Qmojikyo_pj_8, + Qmojikyo_pj_9, + Qmojikyo_pj_10, + Qmojikyo_pj_11, + Qmojikyo_pj_12, + Qmojikyo_pj_13, + Qmojikyo_pj_14, + Qmojikyo_pj_15, + Qmojikyo_pj_16, + Qmojikyo_pj_17, + Qmojikyo_pj_18, + Qmojikyo_pj_19, + Qmojikyo_pj_20, + Qmojikyo_pj_21, Qethiopic_ucs, - Qhiragana_jisx0208, - Qkatakana_jisx0208, #endif Qchinese_big5_1, Qchinese_big5_2, @@ -1036,7 +1080,8 @@ non_ascii_valid_char_p (Emchar ch) if (f3 < 0x20) return 0; - if (f3 != 0x20 && f3 != 0x7F) + if (f3 != 0x20 && f3 != 0x7F && !(f2 >= MIN_CHAR_FIELD2_PRIVATE && + f2 <= MAX_CHAR_FIELD2_PRIVATE)) return 1; /* @@ -1045,6 +1090,8 @@ non_ascii_valid_char_p (Emchar ch) FIELD2_TO_PRIVATE_LEADING_BYTE are the same. */ charset = CHARSET_BY_LEADING_BYTE (f2 + FIELD2_TO_OFFICIAL_LEADING_BYTE); + if (EQ (charset, Qnil)) + return 0; return (XCHARSET_CHARS (charset) == 96); } else @@ -1069,7 +1116,8 @@ non_ascii_valid_char_p (Emchar ch) } #endif /* ENABLE_COMPOSITE_CHARS */ - if (f2 != 0x20 && f2 != 0x7F && f3 != 0x20 && f3 != 0x7F) + if (f2 != 0x20 && f2 != 0x7F && f3 != 0x20 && f3 != 0x7F + && !(f1 >= MIN_CHAR_FIELD1_PRIVATE && f1 <= MAX_CHAR_FIELD1_PRIVATE)) return 1; if (f1 <= MAX_CHAR_FIELD1_OFFICIAL) @@ -1079,6 +1127,8 @@ non_ascii_valid_char_p (Emchar ch) charset = CHARSET_BY_LEADING_BYTE (f1 + FIELD1_TO_PRIVATE_LEADING_BYTE); + if (EQ (charset, Qnil)) + return 0; return (XCHARSET_CHARS (charset) == 96); } } @@ -1185,17 +1235,17 @@ Lstream_funget_emchar (Lstream *stream, Emchar ch) /************************************************************************/ static Lisp_Object -mark_charset (Lisp_Object obj, void (*markobj) (Lisp_Object)) +mark_charset (Lisp_Object obj) { struct Lisp_Charset *cs = XCHARSET (obj); - markobj (cs->short_name); - markobj (cs->long_name); - markobj (cs->doc_string); - markobj (cs->registry); - markobj (cs->ccl_program); + mark_object (cs->short_name); + mark_object (cs->long_name); + mark_object (cs->doc_string); + mark_object (cs->registry); + mark_object (cs->ccl_program); #ifdef UTF2000 - markobj (cs->decoding_table); + mark_object (cs->decoding_table); #endif return cs->name; } @@ -1246,7 +1296,6 @@ DEFINE_LRECORD_IMPLEMENTATION ("charset", charset, mark_charset, print_charset, 0, 0, 0, charset_description, struct Lisp_Charset); - /* Make a new charset. */ static Lisp_Object @@ -1331,7 +1380,7 @@ make_charset (Charset_ID id, Lisp_Object name, else CHARSET_REP_BYTES (cs) = CHARSET_DIMENSION (cs) + 2; #endif - + if (final) { /* some charsets do not have final characters. This includes @@ -1340,22 +1389,17 @@ make_charset (Charset_ID id, Lisp_Object name, #if UTF2000 if (code_offset == 0) { - assert (NILP (charset_by_attributes[type][final])); - charset_by_attributes[type][final] = obj; + assert (NILP (chlook->charset_by_attributes[type][final])); + chlook->charset_by_attributes[type][final] = obj; } #else - assert (NILP (charset_by_attributes[type][final][direction])); - charset_by_attributes[type][final][direction] = obj; + assert (NILP (chlook->charset_by_attributes[type][final][direction])); + chlook->charset_by_attributes[type][final][direction] = obj; #endif } - assert (NILP (charset_by_leading_byte[id - MIN_LEADING_BYTE])); - charset_by_leading_byte[id - MIN_LEADING_BYTE] = obj; -#ifndef UTF2000 - if (id < 0xA0) - /* official leading byte */ - rep_bytes_by_first_byte[id] = CHARSET_REP_BYTES (cs); -#endif + assert (NILP (chlook->charset_by_leading_byte[id - MIN_LEADING_BYTE])); + chlook->charset_by_leading_byte[id - MIN_LEADING_BYTE] = obj; /* Some charsets are "faux" and don't have names or really exist at all except in the leading-byte table. */ @@ -1400,7 +1444,7 @@ get_unallocated_leading_byte (int dimension) } #ifdef UTF2000 -Lisp_Object +int range_charset_code_point (Lisp_Object charset, Emchar ch) { int d; @@ -1411,35 +1455,31 @@ range_charset_code_point (Lisp_Object charset, Emchar ch) d = ch - XCHARSET_UCS_MIN (charset) + XCHARSET_CODE_OFFSET (charset); if (XCHARSET_DIMENSION (charset) == 1) - return list1 (make_int (d + XCHARSET_BYTE_OFFSET (charset))); + return d + XCHARSET_BYTE_OFFSET (charset); else if (XCHARSET_DIMENSION (charset) == 2) - return list2 (make_int (d / XCHARSET_CHARS (charset) - + XCHARSET_BYTE_OFFSET (charset)), - make_int (d % XCHARSET_CHARS (charset) - + XCHARSET_BYTE_OFFSET (charset))); + return + ((d / XCHARSET_CHARS (charset) + + XCHARSET_BYTE_OFFSET (charset)) << 8) + | (d % XCHARSET_CHARS (charset) + XCHARSET_BYTE_OFFSET (charset)); else if (XCHARSET_DIMENSION (charset) == 3) - return list3 (make_int (d / (XCHARSET_CHARS (charset) - * XCHARSET_CHARS (charset)) - + XCHARSET_BYTE_OFFSET (charset)), - make_int (d / XCHARSET_CHARS (charset) - % XCHARSET_CHARS (charset) - + XCHARSET_BYTE_OFFSET (charset)), - make_int (d % XCHARSET_CHARS (charset) - + XCHARSET_BYTE_OFFSET (charset))); + return + ((d / (XCHARSET_CHARS (charset) * XCHARSET_CHARS (charset)) + + XCHARSET_BYTE_OFFSET (charset)) << 16) + | ((d / XCHARSET_CHARS (charset) + % XCHARSET_CHARS (charset) + + XCHARSET_BYTE_OFFSET (charset)) << 8) + | (d % XCHARSET_CHARS (charset) + XCHARSET_BYTE_OFFSET (charset)); else /* if (XCHARSET_DIMENSION (charset) == 4) */ - return list4 (make_int (d / (XCHARSET_CHARS (charset) - * XCHARSET_CHARS (charset) - * XCHARSET_CHARS (charset)) - + XCHARSET_BYTE_OFFSET (charset)), - make_int (d / (XCHARSET_CHARS (charset) - * XCHARSET_CHARS (charset)) - % XCHARSET_CHARS (charset) - + XCHARSET_BYTE_OFFSET (charset)), - make_int (d / XCHARSET_CHARS (charset) - % XCHARSET_CHARS (charset) - + XCHARSET_BYTE_OFFSET (charset)), - make_int (d % XCHARSET_CHARS (charset) - + XCHARSET_BYTE_OFFSET (charset))); + return + ((d / (XCHARSET_CHARS (charset) + * XCHARSET_CHARS (charset) * XCHARSET_CHARS (charset)) + + XCHARSET_BYTE_OFFSET (charset)) << 24) + | ((d / (XCHARSET_CHARS (charset) * XCHARSET_CHARS (charset)) + % XCHARSET_CHARS (charset) + + XCHARSET_BYTE_OFFSET (charset)) << 16) + | ((d / XCHARSET_CHARS (charset) % XCHARSET_CHARS (charset) + + XCHARSET_BYTE_OFFSET (charset)) << 8) + | (d % XCHARSET_CHARS (charset) + XCHARSET_BYTE_OFFSET (charset)); } else if (XCHARSET_CODE_OFFSET (charset) == 0) { @@ -1450,17 +1490,17 @@ range_charset_code_point (Lisp_Object charset, Emchar ch) if (((d = ch - (MIN_CHAR_94 + (XCHARSET_FINAL (charset) - '0') * 94)) >= 0) && (d < 94)) - return list1 (make_int (d + 33)); + return d + 33; } else if (XCHARSET_CHARS (charset) == 96) { if (((d = ch - (MIN_CHAR_96 + (XCHARSET_FINAL (charset) - '0') * 96)) >= 0) && (d < 96)) - return list1 (make_int (d + 32)); + return d + 32; } else - return Qnil; + return -1; } else if (XCHARSET_DIMENSION (charset) == 2) { @@ -1470,8 +1510,7 @@ range_charset_code_point (Lisp_Object charset, Emchar ch) + (XCHARSET_FINAL (charset) - '0') * 94 * 94)) >= 0) && (d < 94 * 94)) - return list2 (make_int ((d / 94) + 33), - make_int (d % 94 + 33)); + return (((d / 94) + 33) << 8) | (d % 94 + 33); } else if (XCHARSET_CHARS (charset) == 96) { @@ -1479,121 +1518,122 @@ range_charset_code_point (Lisp_Object charset, Emchar ch) + (XCHARSET_FINAL (charset) - '0') * 96 * 96)) >= 0) && (d < 96 * 96)) - return list2 (make_int ((d / 96) + 32), - make_int (d % 96 + 32)); + return (((d / 96) + 32) << 8) | (d % 96 + 32); } + else + return -1; } } - return Qnil; + return -1; } -Lisp_Object -split_builtin_char (Emchar c) +int +encode_builtin_char_1 (Emchar c, Lisp_Object* charset) { - if (c < MIN_CHAR_OBS_94x94) + if (c <= MAX_CHAR_BASIC_LATIN) { - if (c <= MAX_CHAR_BASIC_LATIN) - { - return list2 (Vcharset_ascii, make_int (c)); - } - else if (c < 0xA0) - { - return list2 (Vcharset_control_1, make_int (c & 0x7F)); - } - else if (c <= 0xff) - { - return list2 (Vcharset_latin_iso8859_1, make_int (c & 0x7F)); - } - else if ((MIN_CHAR_GREEK <= c) && (c <= MAX_CHAR_GREEK)) - { - return list2 (Vcharset_greek_iso8859_7, - make_int (c - MIN_CHAR_GREEK + 0x20)); - } - else if ((MIN_CHAR_CYRILLIC <= c) && (c <= MAX_CHAR_CYRILLIC)) - { - return list2 (Vcharset_cyrillic_iso8859_5, - make_int (c - MIN_CHAR_CYRILLIC + 0x20)); - } - else if ((MIN_CHAR_HEBREW <= c) && (c <= MAX_CHAR_HEBREW)) - { - return list2 (Vcharset_hebrew_iso8859_8, - make_int (c - MIN_CHAR_HEBREW + 0x20)); - } - else if ((MIN_CHAR_THAI <= c) && (c <= MAX_CHAR_THAI)) - { - return list2 (Vcharset_thai_tis620, - make_int (c - MIN_CHAR_THAI + 0x20)); - } - else if ((MIN_CHAR_HALFWIDTH_KATAKANA <= c) - && (c <= MAX_CHAR_HALFWIDTH_KATAKANA)) - { - return list2 (Vcharset_katakana_jisx0201, - make_int (c - MIN_CHAR_HALFWIDTH_KATAKANA + 33)); - } - else - { - return list3 (Vcharset_ucs_bmp, - make_int (c >> 8), make_int (c & 0xff)); - } + *charset = Vcharset_ascii; + return c; + } + else if (c < 0xA0) + { + *charset = Vcharset_control_1; + return c & 0x7F; + } + else if (c <= 0xff) + { + *charset = Vcharset_latin_iso8859_1; + return c & 0x7F; + } + else if ((MIN_CHAR_GREEK <= c) && (c <= MAX_CHAR_GREEK)) + { + *charset = Vcharset_greek_iso8859_7; + return c - MIN_CHAR_GREEK + 0x20; } - else if (c <= MAX_CHAR_OBS_94x94) + /* + else if ((MIN_CHAR_CYRILLIC <= c) && (c <= MAX_CHAR_CYRILLIC)) { - return list3 (CHARSET_BY_ATTRIBUTES - (CHARSET_TYPE_94X94, - ((c - MIN_CHAR_OBS_94x94) / (94 * 94)) + '@', - CHARSET_LEFT_TO_RIGHT), - make_int ((((c - MIN_CHAR_OBS_94x94) / 94) % 94) + 33), - make_int (((c - MIN_CHAR_OBS_94x94) % 94) + 33)); + *charset = Vcharset_cyrillic_iso8859_5; + return c - MIN_CHAR_CYRILLIC + 0x20; + } + */ + else if ((MIN_CHAR_HEBREW <= c) && (c <= MAX_CHAR_HEBREW)) + { + *charset = Vcharset_hebrew_iso8859_8; + return c - MIN_CHAR_HEBREW + 0x20; + } + else if ((MIN_CHAR_THAI <= c) && (c <= MAX_CHAR_THAI)) + { + *charset = Vcharset_thai_tis620; + return c - MIN_CHAR_THAI + 0x20; + } + /* + else if ((MIN_CHAR_HALFWIDTH_KATAKANA <= c) + && (c <= MAX_CHAR_HALFWIDTH_KATAKANA)) + { + return list2 (Vcharset_katakana_jisx0201, + make_int (c - MIN_CHAR_HALFWIDTH_KATAKANA + 33)); + } + */ + else if (c <= MAX_CHAR_BMP) + { + *charset = Vcharset_ucs_bmp; + return c & 0xFFFF; + } + else if ((MIN_CHAR_DAIKANWA <= c) && (c <= MAX_CHAR_DAIKANWA)) + { + *charset = Vcharset_ideograph_daikanwa; + return c - MIN_CHAR_DAIKANWA; } else if (c <= MAX_CHAR_94) { - return list2 (CHARSET_BY_ATTRIBUTES (CHARSET_TYPE_94, - ((c - MIN_CHAR_94) / 94) + '0', - CHARSET_LEFT_TO_RIGHT), - make_int (((c - MIN_CHAR_94) % 94) + 33)); + *charset = CHARSET_BY_ATTRIBUTES (CHARSET_TYPE_94, + ((c - MIN_CHAR_94) / 94) + '0', + CHARSET_LEFT_TO_RIGHT); + return ((c - MIN_CHAR_94) % 94) + 33; } else if (c <= MAX_CHAR_96) { - return list2 (CHARSET_BY_ATTRIBUTES (CHARSET_TYPE_96, - ((c - MIN_CHAR_96) / 96) + '0', - CHARSET_LEFT_TO_RIGHT), - make_int (((c - MIN_CHAR_96) % 96) + 32)); + *charset = CHARSET_BY_ATTRIBUTES (CHARSET_TYPE_96, + ((c - MIN_CHAR_96) / 96) + '0', + CHARSET_LEFT_TO_RIGHT); + return ((c - MIN_CHAR_96) % 96) + 32; } else if (c <= MAX_CHAR_94x94) { - return list3 (CHARSET_BY_ATTRIBUTES - (CHARSET_TYPE_94X94, - ((c - MIN_CHAR_94x94) / (94 * 94)) + '0', - CHARSET_LEFT_TO_RIGHT), - make_int ((((c - MIN_CHAR_94x94) / 94) % 94) + 33), - make_int (((c - MIN_CHAR_94x94) % 94) + 33)); + *charset + = CHARSET_BY_ATTRIBUTES (CHARSET_TYPE_94X94, + ((c - MIN_CHAR_94x94) / (94 * 94)) + '0', + CHARSET_LEFT_TO_RIGHT); + return (((((c - MIN_CHAR_94x94) / 94) % 94) + 33) << 8) + | (((c - MIN_CHAR_94x94) % 94) + 33); } else if (c <= MAX_CHAR_96x96) { - return list3 (CHARSET_BY_ATTRIBUTES - (CHARSET_TYPE_96X96, - ((c - MIN_CHAR_96x96) / (96 * 96)) + '0', - CHARSET_LEFT_TO_RIGHT), - make_int ((((c - MIN_CHAR_96x96) / 96) % 96) + 32), - make_int (((c - MIN_CHAR_96x96) % 96) + 32)); + *charset + = CHARSET_BY_ATTRIBUTES (CHARSET_TYPE_96X96, + ((c - MIN_CHAR_96x96) / (96 * 96)) + '0', + CHARSET_LEFT_TO_RIGHT); + return ((((c - MIN_CHAR_96x96) / 96) % 96) + 32) << 8 + | (((c - MIN_CHAR_96x96) % 96) + 32); } else { - return Qnil; + return -1; } } -Lisp_Object +int charset_code_point (Lisp_Object charset, Emchar ch) { Lisp_Object cdef = get_char_code_table (ch, Vcharacter_attribute_table); - if (!EQ (cdef, Qnil)) + if (!NILP (cdef)) { Lisp_Object field = Fassq (charset, cdef); - if (!EQ (field, Qnil)) - return Fcdr (field); + if (!NILP (field)) + return XINT (Fcdr (field)); } return range_charset_code_point (charset, ch); } @@ -2328,6 +2368,27 @@ Return the character set of char CH. return XCHARSET_NAME (CHAR_CHARSET (XCHAR (ch))); } +DEFUN ("char-octet", Fchar_octet, 1, 2, 0, /* +Return the octet numbered N (should be 0 or 1) of char CH. +N defaults to 0 if omitted. +*/ + (ch, n)) +{ + Lisp_Object charset; + int octet0, octet1; + + CHECK_CHAR_COERCE_INT (ch); + + BREAKUP_CHAR (XCHAR (ch), charset, octet0, octet1); + + if (NILP (n) || EQ (n, Qzero)) + return make_int (octet0); + else if (EQ (n, make_int (1))) + return make_int (octet1); + else + signal_simple_error ("Octet number must be 0 or 1", n); +} + DEFUN ("split-char", Fsplit_char, 1, 1, 0, /* Return list of charset and one or two position-codes of CHAR. */ @@ -2470,6 +2531,7 @@ syms_of_mule_charset (void) DEFSUBR (Fmake_char); DEFSUBR (Fchar_charset); + DEFSUBR (Fchar_octet); DEFSUBR (Fsplit_char); #ifdef ENABLE_COMPOSITE_CHARS @@ -2508,6 +2570,7 @@ syms_of_mule_charset (void) defsymbol (&Qjapanese_jisx0208_1978, "japanese-jisx0208-1978"); defsymbol (&Qchinese_gb2312, "chinese-gb2312"); defsymbol (&Qjapanese_jisx0208, "japanese-jisx0208"); + defsymbol (&Qjapanese_jisx0208_1990, "japanese-jisx0208-1990"); defsymbol (&Qkorean_ksc5601, "korean-ksc5601"); defsymbol (&Qjapanese_jisx0212, "japanese-jisx0212"); defsymbol (&Qchinese_cns11643_1, "chinese-cns11643-1"); @@ -2516,6 +2579,11 @@ syms_of_mule_charset (void) defsymbol (&Q_ucs, "->ucs"); defsymbol (&Q_decomposition, "->decomposition"); defsymbol (&Qcompat, "compat"); + defsymbol (&Qisolated, "isolated"); + defsymbol (&Qinitial, "initial"); + defsymbol (&Qmedial, "medial"); + defsymbol (&Qfinal, "final"); + defsymbol (&Qvertical, "vertical"); defsymbol (&QnoBreak, "noBreak"); defsymbol (&Qfraction, "fraction"); defsymbol (&Qsuper, "super"); @@ -2524,6 +2592,7 @@ syms_of_mule_charset (void) defsymbol (&Qsquare, "square"); defsymbol (&Qwide, "wide"); defsymbol (&Qnarrow, "narrow"); + defsymbol (&Qsmall, "small"); defsymbol (&Qfont, "font"); defsymbol (&Qucs, "ucs"); defsymbol (&Qucs_bmp, "ucs-bmp"); @@ -2532,9 +2601,29 @@ syms_of_mule_charset (void) defsymbol (&Qlatin_viscii_upper, "latin-viscii-upper"); defsymbol (&Qvietnamese_viscii_lower, "vietnamese-viscii-lower"); defsymbol (&Qvietnamese_viscii_upper, "vietnamese-viscii-upper"); + defsymbol (&Qideograph_daikanwa, "ideograph-daikanwa"); + defsymbol (&Qmojikyo_pj_1, "mojikyo-pj-1"); + defsymbol (&Qmojikyo_pj_2, "mojikyo-pj-2"); + defsymbol (&Qmojikyo_pj_3, "mojikyo-pj-3"); + defsymbol (&Qmojikyo_pj_4, "mojikyo-pj-4"); + defsymbol (&Qmojikyo_pj_5, "mojikyo-pj-5"); + defsymbol (&Qmojikyo_pj_6, "mojikyo-pj-6"); + defsymbol (&Qmojikyo_pj_7, "mojikyo-pj-7"); + defsymbol (&Qmojikyo_pj_8, "mojikyo-pj-8"); + defsymbol (&Qmojikyo_pj_9, "mojikyo-pj-9"); + defsymbol (&Qmojikyo_pj_10, "mojikyo-pj-10"); + defsymbol (&Qmojikyo_pj_11, "mojikyo-pj-11"); + defsymbol (&Qmojikyo_pj_12, "mojikyo-pj-12"); + defsymbol (&Qmojikyo_pj_13, "mojikyo-pj-13"); + defsymbol (&Qmojikyo_pj_14, "mojikyo-pj-14"); + defsymbol (&Qmojikyo_pj_15, "mojikyo-pj-15"); + defsymbol (&Qmojikyo_pj_16, "mojikyo-pj-16"); + defsymbol (&Qmojikyo_pj_17, "mojikyo-pj-17"); + defsymbol (&Qmojikyo_pj_18, "mojikyo-pj-18"); + defsymbol (&Qmojikyo_pj_19, "mojikyo-pj-19"); + defsymbol (&Qmojikyo_pj_20, "mojikyo-pj-20"); + defsymbol (&Qmojikyo_pj_21, "mojikyo-pj-21"); defsymbol (&Qethiopic_ucs, "ethiopic-ucs"); - defsymbol (&Qhiragana_jisx0208, "hiragana-jisx0208"); - defsymbol (&Qkatakana_jisx0208, "katakana-jisx0208"); #endif defsymbol (&Qchinese_big5_1, "chinese-big5-1"); defsymbol (&Qchinese_big5_2, "chinese-big5-2"); @@ -2550,21 +2639,24 @@ vars_of_mule_charset (void) int k; #endif + chlook = xnew (struct charset_lookup); + dumpstruct (&chlook, &charset_lookup_description); + /* Table of charsets indexed by leading byte. */ - for (i = 0; i < countof (charset_by_leading_byte); i++) - charset_by_leading_byte[i] = Qnil; + for (i = 0; i < countof (chlook->charset_by_leading_byte); i++) + chlook->charset_by_leading_byte[i] = Qnil; #ifdef UTF2000 /* Table of charsets indexed by type/final-byte. */ - for (i = 0; i < countof (charset_by_attributes); i++) - for (j = 0; j < countof (charset_by_attributes[0]); j++) - charset_by_attributes[i][j] = Qnil; + for (i = 0; i < countof (chlook->charset_by_attributes); i++) + for (j = 0; j < countof (chlook->charset_by_attributes[0]); j++) + chlook->charset_by_attributes[i][j] = Qnil; #else /* Table of charsets indexed by type/final-byte/direction. */ - for (i = 0; i < countof (charset_by_attributes); i++) - for (j = 0; j < countof (charset_by_attributes[0]); j++) - for (k = 0; k < countof (charset_by_attributes[0][0]); k++) - charset_by_attributes[i][j][k] = Qnil; + for (i = 0; i < countof (chlook->charset_by_attributes); i++) + for (j = 0; j < countof (chlook->charset_by_attributes[0]); j++) + for (k = 0; k < countof (chlook->charset_by_attributes[0][0]); k++) + chlook->charset_by_attributes[i][j][k] = Qnil; #endif #ifdef UTF2000 @@ -2583,7 +2675,7 @@ Leading-code of private TYPE9N charset of column-width 1. #endif #ifdef UTF2000 - Vutf_2000_version = build_string("0.12 (Kashiwara)"); + Vutf_2000_version = build_string("0.14 (Kawachi-Katakami)"); DEFVAR_LISP ("utf-2000-version", &Vutf_2000_version /* Version number of UTF-2000. */ ); @@ -2616,6 +2708,7 @@ complex_vars_of_mule_charset (void) ease of access. */ #ifdef UTF2000 + staticpro (&Vcharset_ucs_bmp); Vcharset_ucs_bmp = make_charset (LEADING_BYTE_UCS_BMP, Qucs_bmp, CHARSET_TYPE_256X256, 1, 2, 0, @@ -2637,6 +2730,7 @@ complex_vars_of_mule_charset (void) # define MIN_CHAR_CYRILLIC 0 # define MAX_CHAR_CYRILLIC 0 #endif + staticpro (&Vcharset_ascii); Vcharset_ascii = make_charset (LEADING_BYTE_ASCII, Qascii, CHARSET_TYPE_94, 1, 0, 'B', @@ -2646,6 +2740,7 @@ complex_vars_of_mule_charset (void) build_string ("ASCII (ISO646 IRV)"), build_string ("\\(iso8859-[0-9]*\\|-ascii\\)"), Qnil, 0, 0x7F, 0, 0); + staticpro (&Vcharset_control_1); Vcharset_control_1 = make_charset (LEADING_BYTE_CONTROL_1, Qcontrol_1, CHARSET_TYPE_94, 1, 1, 0, @@ -2655,6 +2750,7 @@ complex_vars_of_mule_charset (void) build_string ("Control characters 128-191"), build_string (""), Qnil, 0x80, 0x9F, 0, 0); + staticpro (&Vcharset_latin_iso8859_1); Vcharset_latin_iso8859_1 = make_charset (LEADING_BYTE_LATIN_ISO8859_1, Qlatin_iso8859_1, CHARSET_TYPE_96, 1, 1, 'A', @@ -2664,6 +2760,7 @@ complex_vars_of_mule_charset (void) build_string ("ISO8859-1 (Latin-1)"), build_string ("iso8859-1"), Qnil, 0xA0, 0xFF, 0, 32); + staticpro (&Vcharset_latin_iso8859_2); Vcharset_latin_iso8859_2 = make_charset (LEADING_BYTE_LATIN_ISO8859_2, Qlatin_iso8859_2, CHARSET_TYPE_96, 1, 1, 'B', @@ -2673,6 +2770,7 @@ complex_vars_of_mule_charset (void) build_string ("ISO8859-2 (Latin-2)"), build_string ("iso8859-2"), Qnil, 0, 0, 0, 32); + staticpro (&Vcharset_latin_iso8859_3); Vcharset_latin_iso8859_3 = make_charset (LEADING_BYTE_LATIN_ISO8859_3, Qlatin_iso8859_3, CHARSET_TYPE_96, 1, 1, 'C', @@ -2682,6 +2780,7 @@ complex_vars_of_mule_charset (void) build_string ("ISO8859-3 (Latin-3)"), build_string ("iso8859-3"), Qnil, 0, 0, 0, 32); + staticpro (&Vcharset_latin_iso8859_4); Vcharset_latin_iso8859_4 = make_charset (LEADING_BYTE_LATIN_ISO8859_4, Qlatin_iso8859_4, CHARSET_TYPE_96, 1, 1, 'D', @@ -2691,6 +2790,7 @@ complex_vars_of_mule_charset (void) build_string ("ISO8859-4 (Latin-4)"), build_string ("iso8859-4"), Qnil, 0, 0, 0, 32); + staticpro (&Vcharset_thai_tis620); Vcharset_thai_tis620 = make_charset (LEADING_BYTE_THAI_TIS620, Qthai_tis620, CHARSET_TYPE_96, 1, 1, 'T', @@ -2700,6 +2800,7 @@ complex_vars_of_mule_charset (void) build_string ("TIS620.2529 (Thai)"), build_string ("tis620"), Qnil, MIN_CHAR_THAI, MAX_CHAR_THAI, 0, 32); + staticpro (&Vcharset_greek_iso8859_7); Vcharset_greek_iso8859_7 = make_charset (LEADING_BYTE_GREEK_ISO8859_7, Qgreek_iso8859_7, CHARSET_TYPE_96, 1, 1, 'F', @@ -2709,6 +2810,7 @@ complex_vars_of_mule_charset (void) build_string ("ISO8859-7 (Greek)"), build_string ("iso8859-7"), Qnil, MIN_CHAR_GREEK, MAX_CHAR_GREEK, 0, 32); + staticpro (&Vcharset_arabic_iso8859_6); Vcharset_arabic_iso8859_6 = make_charset (LEADING_BYTE_ARABIC_ISO8859_6, Qarabic_iso8859_6, CHARSET_TYPE_96, 1, 1, 'G', @@ -2718,6 +2820,7 @@ complex_vars_of_mule_charset (void) build_string ("ISO8859-6 (Arabic)"), build_string ("iso8859-6"), Qnil, 0, 0, 0, 32); + staticpro (&Vcharset_hebrew_iso8859_8); Vcharset_hebrew_iso8859_8 = make_charset (LEADING_BYTE_HEBREW_ISO8859_8, Qhebrew_iso8859_8, CHARSET_TYPE_96, 1, 1, 'H', @@ -2727,6 +2830,7 @@ complex_vars_of_mule_charset (void) build_string ("ISO8859-8 (Hebrew)"), build_string ("iso8859-8"), Qnil, MIN_CHAR_HEBREW, MAX_CHAR_HEBREW, 0, 32); + staticpro (&Vcharset_katakana_jisx0201); Vcharset_katakana_jisx0201 = make_charset (LEADING_BYTE_KATAKANA_JISX0201, Qkatakana_jisx0201, CHARSET_TYPE_94, 1, 1, 'I', @@ -2735,9 +2839,8 @@ complex_vars_of_mule_charset (void) build_string ("JISX0201.1976 (Japanese Kana)"), build_string ("JISX0201.1976 Japanese Kana"), build_string ("jisx0201\\.1976"), - Qnil, - MIN_CHAR_HALFWIDTH_KATAKANA, - MAX_CHAR_HALFWIDTH_KATAKANA, 0, 33); + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_latin_jisx0201); Vcharset_latin_jisx0201 = make_charset (LEADING_BYTE_LATIN_JISX0201, Qlatin_jisx0201, CHARSET_TYPE_94, 1, 0, 'J', @@ -2747,6 +2850,7 @@ complex_vars_of_mule_charset (void) build_string ("JISX0201.1976 Japanese Roman"), build_string ("jisx0201\\.1976"), Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_cyrillic_iso8859_5); Vcharset_cyrillic_iso8859_5 = make_charset (LEADING_BYTE_CYRILLIC_ISO8859_5, Qcyrillic_iso8859_5, CHARSET_TYPE_96, 1, 1, 'L', @@ -2756,6 +2860,7 @@ complex_vars_of_mule_charset (void) build_string ("ISO8859-5 (Cyrillic)"), build_string ("iso8859-5"), Qnil, MIN_CHAR_CYRILLIC, MAX_CHAR_CYRILLIC, 0, 32); + staticpro (&Vcharset_latin_iso8859_9); Vcharset_latin_iso8859_9 = make_charset (LEADING_BYTE_LATIN_ISO8859_9, Qlatin_iso8859_9, CHARSET_TYPE_96, 1, 1, 'M', @@ -2765,6 +2870,7 @@ complex_vars_of_mule_charset (void) build_string ("ISO8859-9 (Latin-5)"), build_string ("iso8859-9"), Qnil, 0, 0, 0, 32); + staticpro (&Vcharset_japanese_jisx0208_1978); Vcharset_japanese_jisx0208_1978 = make_charset (LEADING_BYTE_JAPANESE_JISX0208_1978, Qjapanese_jisx0208_1978, CHARSET_TYPE_94X94, 2, 0, '@', @@ -2775,6 +2881,7 @@ complex_vars_of_mule_charset (void) ("JIS X0208:1978 Japanese Kanji (so called \"old JIS\")"), build_string ("\\(jisx0208\\|jisc6226\\)\\.1978"), Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_chinese_gb2312); Vcharset_chinese_gb2312 = make_charset (LEADING_BYTE_CHINESE_GB2312, Qchinese_gb2312, CHARSET_TYPE_94X94, 2, 0, 'A', @@ -2784,6 +2891,7 @@ complex_vars_of_mule_charset (void) build_string ("GB2312 Chinese simplified"), build_string ("gb2312"), Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_japanese_jisx0208); Vcharset_japanese_jisx0208 = make_charset (LEADING_BYTE_JAPANESE_JISX0208, Qjapanese_jisx0208, CHARSET_TYPE_94X94, 2, 0, 'B', @@ -2793,6 +2901,22 @@ complex_vars_of_mule_charset (void) build_string ("JIS X0208:1983 Japanese Kanji"), build_string ("jisx0208\\.1983"), Qnil, 0, 0, 0, 33); +#ifdef UTF2000 + staticpro (&Vcharset_japanese_jisx0208_1990); + Vcharset_japanese_jisx0208_1990 = + make_charset (LEADING_BYTE_JAPANESE_JISX0208_1990, + Qjapanese_jisx0208_1990, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("JISX0208-1990"), + build_string ("JIS X0208:1990 (Japanese)"), + build_string ("JIS X0208:1990 Japanese Kanji"), + build_string ("jisx0208\\.1990"), + Qnil, + MIN_CHAR_JIS_X0208_1990, + MAX_CHAR_JIS_X0208_1990, 0, 33); +#endif + staticpro (&Vcharset_korean_ksc5601); Vcharset_korean_ksc5601 = make_charset (LEADING_BYTE_KOREAN_KSC5601, Qkorean_ksc5601, CHARSET_TYPE_94X94, 2, 0, 'C', @@ -2802,6 +2926,7 @@ complex_vars_of_mule_charset (void) build_string ("KSC5601 Korean Hangul and Hanja"), build_string ("ksc5601"), Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_japanese_jisx0212); Vcharset_japanese_jisx0212 = make_charset (LEADING_BYTE_JAPANESE_JISX0212, Qjapanese_jisx0212, CHARSET_TYPE_94X94, 2, 0, 'D', @@ -2813,6 +2938,7 @@ complex_vars_of_mule_charset (void) Qnil, 0, 0, 0, 33); #define CHINESE_CNS_PLANE_RE(n) "cns11643[.-]\\(.*[.-]\\)?" n "$" + staticpro (&Vcharset_chinese_cns11643_1); Vcharset_chinese_cns11643_1 = make_charset (LEADING_BYTE_CHINESE_CNS11643_1, Qchinese_cns11643_1, CHARSET_TYPE_94X94, 2, 0, 'G', @@ -2823,6 +2949,7 @@ complex_vars_of_mule_charset (void) ("CNS 11643 Plane 1 Chinese traditional"), build_string (CHINESE_CNS_PLANE_RE("1")), Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_chinese_cns11643_2); Vcharset_chinese_cns11643_2 = make_charset (LEADING_BYTE_CHINESE_CNS11643_2, Qchinese_cns11643_2, CHARSET_TYPE_94X94, 2, 0, 'H', @@ -2834,6 +2961,7 @@ complex_vars_of_mule_charset (void) build_string (CHINESE_CNS_PLANE_RE("2")), Qnil, 0, 0, 0, 33); #ifdef UTF2000 + staticpro (&Vcharset_latin_viscii_lower); Vcharset_latin_viscii_lower = make_charset (LEADING_BYTE_LATIN_VISCII_LOWER, Qlatin_viscii_lower, CHARSET_TYPE_96, 1, 1, '1', @@ -2843,6 +2971,7 @@ complex_vars_of_mule_charset (void) build_string ("VISCII lower (Vietnamese)"), build_string ("MULEVISCII-LOWER"), Qnil, 0, 0, 0, 32); + staticpro (&Vcharset_latin_viscii_upper); Vcharset_latin_viscii_upper = make_charset (LEADING_BYTE_LATIN_VISCII_UPPER, Qlatin_viscii_upper, CHARSET_TYPE_96, 1, 1, '2', @@ -2852,6 +2981,7 @@ complex_vars_of_mule_charset (void) build_string ("VISCII upper (Vietnamese)"), build_string ("MULEVISCII-UPPER"), Qnil, 0, 0, 0, 32); + staticpro (&Vcharset_latin_viscii); Vcharset_latin_viscii = make_charset (LEADING_BYTE_LATIN_VISCII, Qlatin_viscii, CHARSET_TYPE_256, 1, 2, 0, @@ -2861,6 +2991,248 @@ complex_vars_of_mule_charset (void) build_string ("VISCII 1.1 (Vietnamese)"), build_string ("VISCII1\\.1"), Qnil, 0, 0, 0, 0); + staticpro (&Vcharset_ideograph_daikanwa); + Vcharset_ideograph_daikanwa = + make_charset (LEADING_BYTE_DAIKANWA, Qideograph_daikanwa, + CHARSET_TYPE_256X256, 2, 2, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Daikanwa"), + build_string ("Morohashi's Daikanwa"), + build_string ("Daikanwa dictionary by MOROHASHI Tetsuji"), + build_string ("Daikanwa"), + Qnil, MIN_CHAR_DAIKANWA, MAX_CHAR_DAIKANWA, 0, 0); + staticpro (&Vcharset_mojikyo_pj_1); + Vcharset_mojikyo_pj_1 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_1, Qmojikyo_pj_1, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-1"), + build_string ("Mojikyo (pseudo JIS encoding) part 1"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 1"), + build_string ("jisx0208\\.Mojikyo-1$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_2); + Vcharset_mojikyo_pj_2 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_2, Qmojikyo_pj_2, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-2"), + build_string ("Mojikyo (pseudo JIS encoding) part 2"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 2"), + build_string ("jisx0208\\.Mojikyo-2$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_3); + Vcharset_mojikyo_pj_3 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_3, Qmojikyo_pj_3, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-3"), + build_string ("Mojikyo (pseudo JIS encoding) part 3"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 3"), + build_string ("jisx0208\\.Mojikyo-3$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_4); + Vcharset_mojikyo_pj_4 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_4, Qmojikyo_pj_4, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-4"), + build_string ("Mojikyo (pseudo JIS encoding) part 4"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 4"), + build_string ("jisx0208\\.Mojikyo-4$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_5); + Vcharset_mojikyo_pj_5 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_5, Qmojikyo_pj_5, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-5"), + build_string ("Mojikyo (pseudo JIS encoding) part 5"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 5"), + build_string ("jisx0208\\.Mojikyo-5$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_6); + Vcharset_mojikyo_pj_6 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_6, Qmojikyo_pj_6, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-6"), + build_string ("Mojikyo (pseudo JIS encoding) part 6"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 6"), + build_string ("jisx0208\\.Mojikyo-6$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_7); + Vcharset_mojikyo_pj_7 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_7, Qmojikyo_pj_7, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-7"), + build_string ("Mojikyo (pseudo JIS encoding) part 7"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 7"), + build_string ("jisx0208\\.Mojikyo-7$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_8); + Vcharset_mojikyo_pj_8 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_8, Qmojikyo_pj_8, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-8"), + build_string ("Mojikyo (pseudo JIS encoding) part 8"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 8"), + build_string ("jisx0208\\.Mojikyo-8$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_9); + Vcharset_mojikyo_pj_9 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_9, Qmojikyo_pj_9, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-9"), + build_string ("Mojikyo (pseudo JIS encoding) part 9"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 9"), + build_string ("jisx0208\\.Mojikyo-9$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_10); + Vcharset_mojikyo_pj_10 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_10, Qmojikyo_pj_10, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-10"), + build_string ("Mojikyo (pseudo JIS encoding) part 10"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 10"), + build_string ("jisx0208\\.Mojikyo-10$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_11); + Vcharset_mojikyo_pj_11 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_11, Qmojikyo_pj_11, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-11"), + build_string ("Mojikyo (pseudo JIS encoding) part 11"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 11"), + build_string ("jisx0208\\.Mojikyo-11$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_12); + Vcharset_mojikyo_pj_12 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_12, Qmojikyo_pj_12, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-12"), + build_string ("Mojikyo (pseudo JIS encoding) part 12"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 12"), + build_string ("jisx0208\\.Mojikyo-12$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_13); + Vcharset_mojikyo_pj_13 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_13, Qmojikyo_pj_13, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-13"), + build_string ("Mojikyo (pseudo JIS encoding) part 13"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 13"), + build_string ("jisx0208\\.Mojikyo-13$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_14); + Vcharset_mojikyo_pj_14 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_14, Qmojikyo_pj_14, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-14"), + build_string ("Mojikyo (pseudo JIS encoding) part 14"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 14"), + build_string ("jisx0208\\.Mojikyo-14$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_15); + Vcharset_mojikyo_pj_15 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_15, Qmojikyo_pj_15, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-15"), + build_string ("Mojikyo (pseudo JIS encoding) part 15"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 15"), + build_string ("jisx0208\\.Mojikyo-15$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_16); + Vcharset_mojikyo_pj_16 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_16, Qmojikyo_pj_16, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-16"), + build_string ("Mojikyo (pseudo JIS encoding) part 16"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 16"), + build_string ("jisx0208\\.Mojikyo-16$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_17); + Vcharset_mojikyo_pj_17 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_17, Qmojikyo_pj_17, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-17"), + build_string ("Mojikyo (pseudo JIS encoding) part 17"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 17"), + build_string ("jisx0208\\.Mojikyo-17$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_18); + Vcharset_mojikyo_pj_18 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_18, Qmojikyo_pj_18, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-18"), + build_string ("Mojikyo (pseudo JIS encoding) part 18"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 18"), + build_string ("jisx0208\\.Mojikyo-18$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_19); + Vcharset_mojikyo_pj_19 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_19, Qmojikyo_pj_19, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-19"), + build_string ("Mojikyo (pseudo JIS encoding) part 19"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 19"), + build_string ("jisx0208\\.Mojikyo-19$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_20); + Vcharset_mojikyo_pj_20 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_20, Qmojikyo_pj_20, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-20"), + build_string ("Mojikyo (pseudo JIS encoding) part 20"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 20"), + build_string ("jisx0208\\.Mojikyo-20$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_mojikyo_pj_21); + Vcharset_mojikyo_pj_21 = + make_charset (LEADING_BYTE_MOJIKYO_PJ_21, Qmojikyo_pj_21, + CHARSET_TYPE_94X94, 2, 0, 0, + CHARSET_LEFT_TO_RIGHT, + build_string ("Mojikyo-PJ-21"), + build_string ("Mojikyo (pseudo JIS encoding) part 21"), + build_string + ("Konjaku-Mojikyo (pseudo JIS encoding) part 21"), + build_string ("jisx0208\\.Mojikyo-21$"), + Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_ethiopic_ucs); Vcharset_ethiopic_ucs = make_charset (LEADING_BYTE_ETHIOPIC_UCS, Qethiopic_ucs, CHARSET_TYPE_256X256, 2, 2, 0, @@ -2870,27 +3242,8 @@ complex_vars_of_mule_charset (void) build_string ("Ethiopic of UCS"), build_string ("Ethiopic-Unicode"), Qnil, 0x1200, 0x137F, 0x1200, 0); - Vcharset_hiragana_jisx0208 = - make_charset (LEADING_BYTE_HIRAGANA_JISX0208, Qhiragana_jisx0208, - CHARSET_TYPE_94X94, 2, 0, 'B', - CHARSET_LEFT_TO_RIGHT, - build_string ("Hiragana"), - build_string ("Hiragana of JIS X0208"), - build_string ("Japanese Hiragana of JIS X0208"), - build_string ("jisx0208\\.19\\(78\\|83\\|90\\)"), - Qnil, MIN_CHAR_HIRAGANA, MAX_CHAR_HIRAGANA, - (0x24 - 33) * 94 + (0x21 - 33), 33); - Vcharset_katakana_jisx0208 = - make_charset (LEADING_BYTE_KATAKANA_JISX0208, Qkatakana_jisx0208, - CHARSET_TYPE_94X94, 2, 0, 'B', - CHARSET_LEFT_TO_RIGHT, - build_string ("Katakana"), - build_string ("Katakana of JIS X0208"), - build_string ("Japanese Katakana of JIS X0208"), - build_string ("jisx0208\\.19\\(78\\|83\\|90\\)"), - Qnil, MIN_CHAR_KATAKANA, MAX_CHAR_KATAKANA, - (0x25 - 33) * 94 + (0x21 - 33), 33); #endif + staticpro (&Vcharset_chinese_big5_1); Vcharset_chinese_big5_1 = make_charset (LEADING_BYTE_CHINESE_BIG5_1, Qchinese_big5_1, CHARSET_TYPE_94X94, 2, 0, '0', @@ -2901,6 +3254,7 @@ complex_vars_of_mule_charset (void) ("Big5 Level-1 Chinese traditional"), build_string ("big5"), Qnil, 0, 0, 0, 33); + staticpro (&Vcharset_chinese_big5_2); Vcharset_chinese_big5_2 = make_charset (LEADING_BYTE_CHINESE_BIG5_2, Qchinese_big5_2, CHARSET_TYPE_94X94, 2, 0, '1', @@ -2916,6 +3270,7 @@ complex_vars_of_mule_charset (void) /* #### For simplicity, we put composite chars into a 96x96 charset. This is going to lead to problems because you can run out of room, esp. as we don't yet recycle numbers. */ + staticpro (&Vcharset_composite); Vcharset_composite = make_charset (LEADING_BYTE_COMPOSITE, Qcomposite, CHARSET_TYPE_96X96, 2, 0, 0, @@ -2925,6 +3280,7 @@ complex_vars_of_mule_charset (void) build_string ("Composite characters"), build_string ("")); + /* #### not dumped properly */ composite_char_row_next = 32; composite_char_col_next = 32;