#define CHAR96(ft,b) (MIN_CHAR_96 + (ft - '0') * 96 + (b & 0x7f) - 32)
-Emchar_to_byte_table* ucs_to_latin_jisx0201;
-
Emchar latin_jisx0201_to_ucs[94] =
{
0x0021 /* 0x21 EXCLAMATION MARK */,
0x203E /* 0x7E OVERLINE */
};
-
-Emchar_to_byte_table* ucs_to_latin_iso8859_2;
-
Emchar latin_iso8859_2_to_ucs[96] =
{
0x00A0 /* 0xA0 NO-BREAK SPACE */,
0x02D9 /* 0xFF DOT ABOVE */
};
-Emchar_to_byte_table* ucs_to_latin_iso8859_3;
-
Emchar latin_iso8859_3_to_ucs[96] =
{
0x00A0 /* 0xA0 NO-BREAK SPACE */,
0x02D9 /* 0xFF DOT ABOVE */
};
-Emchar_to_byte_table* ucs_to_latin_iso8859_4;
-
Emchar latin_iso8859_4_to_ucs[96] =
{
0x00A0 /* 0xA0 NO-BREAK SPACE */,
0x02D9 /* 0xFF DOT ABOVE */
};
-Emchar_to_byte_table* ucs_to_latin_iso8859_9;
-
Emchar latin_iso8859_9_to_ucs[96] =
{
0x00A0 /* 0xA0 NO-BREAK SPACE */,
0x00FF /* 0xFF LATIN SMALL LETTER Y WITH DIAERESIS */,
};
-Emchar_to_byte_table* ucs_to_latin_viscii_lower;
-
Emchar latin_viscii_lower_to_ucs[96] =
{
CHAR96('1', 0x20),
CHAR96('1', 0x7F)
};
-Emchar_to_byte_table* ucs_to_latin_viscii_upper;
-
Emchar latin_viscii_upper_to_ucs[96] =
{
CHAR96('2', 0x20),
CHAR96('2', 0x7f)
};
-
-Emchar_to_byte_table* ucs_to_latin_tcvn5712;
-
Emchar latin_tcvn5712_to_ucs[96] =
{
0x00A0 /* 0xA0 NO-BREAK SPACE */,
};
DEFINE_LRECORD_IMPLEMENTATION ("charset", charset,
- mark_charset, print_charset, 0, 0, 0, charset_description,
+ mark_charset, print_charset, 0, 0, 0,
+ charset_description,
struct Lisp_Charset);
/* Make a new charset. */
static Lisp_Object
make_charset (Charset_ID id, Lisp_Object name,
unsigned char type, unsigned char columns, unsigned char graphic,
- Bufbyte final, unsigned char direction, Lisp_Object short_name,
+ Bufbyte final, unsigned char direction, Lisp_Object short_name,
Lisp_Object long_name, Lisp_Object doc,
- Lisp_Object reg)
+ Lisp_Object reg,
+ Emchar* decoding_table)
{
Lisp_Object obj;
struct Lisp_Charset *cs =
CHARSET_REGISTRY (cs) = reg;
CHARSET_CCL_PROGRAM (cs) = Qnil;
CHARSET_REVERSE_DIRECTION_CHARSET (cs) = Qnil;
+#ifdef UTF2000
+ CHARSET_DECODING_TABLE(cs) = decoding_table;
+#endif
switch ( CHARSET_TYPE (cs) )
{
case CHARSET_TYPE_94:
CHARSET_DIMENSION (cs) = 1;
CHARSET_CHARS (cs) = 94;
+#ifdef UTF2000
+ if (decoding_table != NULL)
+ {
+ size_t i;
+ CHARSET_TO_BYTE1_TABLE(cs) = make_byte_from_character_table();
+ for (i = 0; i < 94; i++)
+ {
+ Emchar c = decoding_table[i];
+
+ if (c <= 0xffff)
+ put_byte_from_character_table (c, i + 33,
+ CHARSET_TO_BYTE1_TABLE(cs));
+ }
+ }
+#endif
break;
case CHARSET_TYPE_96:
CHARSET_DIMENSION (cs) = 1;
CHARSET_CHARS (cs) = 96;
+ if (decoding_table != NULL)
+ {
+ size_t i;
+ CHARSET_TO_BYTE1_TABLE(cs) = make_byte_from_character_table();
+ for (i = 0; i < 96; i++)
+ {
+ Emchar c = decoding_table[i];
+
+ if (c <= 0xffff)
+ put_byte_from_character_table (c, i + 32,
+ CHARSET_TO_BYTE1_TABLE(cs));
+ }
+ }
break;
case CHARSET_TYPE_94X94:
CHARSET_DIMENSION (cs) = 2;
columns = dimension;
charset = make_charset (id, name, type, columns, graphic,
final, direction, short_name, long_name,
- doc_string, registry);
+ doc_string, registry,
+ NULL);
if (!NILP (ccl_program))
XCHARSET_CCL_PROGRAM (charset) = ccl_program;
return charset;
new_charset = make_charset (id, new_name, type, columns,
graphic, final, direction, short_name, long_name,
- doc_string, registry);
+ doc_string, registry,
+ NULL);
CHARSET_REVERSE_DIRECTION_CHARSET (cs) = new_charset;
XCHARSET_REVERSE_DIRECTION_CHARSET (new_charset) = charset;
build_string ("BMP"),
build_string ("BMP"),
build_string ("BMP"),
- build_string (""));
+ build_string (""),
+ NULL);
#endif
Vcharset_ascii =
make_charset (LEADING_BYTE_ASCII, Qascii,
build_string ("ASCII"),
build_string ("ASCII)"),
build_string ("ASCII (ISO646 IRV)"),
- build_string ("\\(iso8859-[0-9]*\\|-ascii\\)"));
+ build_string ("\\(iso8859-[0-9]*\\|-ascii\\)"),
+ NULL);
Vcharset_control_1 =
make_charset (LEADING_BYTE_CONTROL_1, Qcontrol_1,
CHARSET_TYPE_94, 1, 1, 0,
build_string ("C1"),
build_string ("Control characters"),
build_string ("Control characters 128-191"),
- build_string (""));
+ build_string (""),
+ NULL);
Vcharset_latin_iso8859_1 =
make_charset (LEADING_BYTE_LATIN_ISO8859_1, Qlatin_iso8859_1,
CHARSET_TYPE_96, 1, 1, 'A',
build_string ("Latin-1"),
build_string ("ISO8859-1 (Latin-1)"),
build_string ("ISO8859-1 (Latin-1)"),
- build_string ("iso8859-1"));
+ build_string ("iso8859-1"),
+ NULL);
Vcharset_latin_iso8859_2 =
make_charset (LEADING_BYTE_LATIN_ISO8859_2, Qlatin_iso8859_2,
CHARSET_TYPE_96, 1, 1, 'B',
build_string ("Latin-2"),
build_string ("ISO8859-2 (Latin-2)"),
build_string ("ISO8859-2 (Latin-2)"),
- build_string ("iso8859-2"));
+ build_string ("iso8859-2"),
+ latin_iso8859_2_to_ucs);
Vcharset_latin_iso8859_3 =
make_charset (LEADING_BYTE_LATIN_ISO8859_3, Qlatin_iso8859_3,
CHARSET_TYPE_96, 1, 1, 'C',
build_string ("Latin-3"),
build_string ("ISO8859-3 (Latin-3)"),
build_string ("ISO8859-3 (Latin-3)"),
- build_string ("iso8859-3"));
+ build_string ("iso8859-3"),
+ latin_iso8859_3_to_ucs);
Vcharset_latin_iso8859_4 =
make_charset (LEADING_BYTE_LATIN_ISO8859_4, Qlatin_iso8859_4,
CHARSET_TYPE_96, 1, 1, 'D',
build_string ("Latin-4"),
build_string ("ISO8859-4 (Latin-4)"),
build_string ("ISO8859-4 (Latin-4)"),
- build_string ("iso8859-4"));
+ build_string ("iso8859-4"),
+ latin_iso8859_4_to_ucs);
Vcharset_thai_tis620 =
make_charset (LEADING_BYTE_THAI_TIS620, Qthai_tis620,
CHARSET_TYPE_96, 1, 1, 'T',
build_string ("TIS620"),
build_string ("TIS620 (Thai)"),
build_string ("TIS620.2529 (Thai)"),
- build_string ("tis620"));
+ build_string ("tis620"),
+ NULL);
Vcharset_greek_iso8859_7 =
make_charset (LEADING_BYTE_GREEK_ISO8859_7, Qgreek_iso8859_7,
CHARSET_TYPE_96, 1, 1, 'F',
build_string ("ISO8859-7"),
build_string ("ISO8859-7 (Greek)"),
build_string ("ISO8859-7 (Greek)"),
- build_string ("iso8859-7"));
+ build_string ("iso8859-7"),
+ NULL);
Vcharset_arabic_iso8859_6 =
make_charset (LEADING_BYTE_ARABIC_ISO8859_6, Qarabic_iso8859_6,
CHARSET_TYPE_96, 1, 1, 'G',
build_string ("ISO8859-6"),
build_string ("ISO8859-6 (Arabic)"),
build_string ("ISO8859-6 (Arabic)"),
- build_string ("iso8859-6"));
+ build_string ("iso8859-6"),
+ NULL);
Vcharset_hebrew_iso8859_8 =
make_charset (LEADING_BYTE_HEBREW_ISO8859_8, Qhebrew_iso8859_8,
CHARSET_TYPE_96, 1, 1, 'H',
build_string ("ISO8859-8"),
build_string ("ISO8859-8 (Hebrew)"),
build_string ("ISO8859-8 (Hebrew)"),
- build_string ("iso8859-8"));
+ build_string ("iso8859-8"),
+ NULL);
Vcharset_katakana_jisx0201 =
make_charset (LEADING_BYTE_KATAKANA_JISX0201, Qkatakana_jisx0201,
CHARSET_TYPE_94, 1, 1, 'I',
build_string ("JISX0201 Kana"),
build_string ("JISX0201.1976 (Japanese Kana)"),
build_string ("JISX0201.1976 Japanese Kana"),
- build_string ("jisx0201.1976"));
+ build_string ("jisx0201.1976"),
+ NULL);
Vcharset_latin_jisx0201 =
make_charset (LEADING_BYTE_LATIN_JISX0201, Qlatin_jisx0201,
CHARSET_TYPE_94, 1, 0, 'J',
build_string ("JISX0201 Roman"),
build_string ("JISX0201.1976 (Japanese Roman)"),
build_string ("JISX0201.1976 Japanese Roman"),
- build_string ("jisx0201.1976"));
+ build_string ("jisx0201.1976"),
+ latin_jisx0201_to_ucs);
Vcharset_cyrillic_iso8859_5 =
make_charset (LEADING_BYTE_CYRILLIC_ISO8859_5, Qcyrillic_iso8859_5,
CHARSET_TYPE_96, 1, 1, 'L',
build_string ("ISO8859-5"),
build_string ("ISO8859-5 (Cyrillic)"),
build_string ("ISO8859-5 (Cyrillic)"),
- build_string ("iso8859-5"));
+ build_string ("iso8859-5"),
+ NULL);
Vcharset_latin_iso8859_9 =
make_charset (LEADING_BYTE_LATIN_ISO8859_9, Qlatin_iso8859_9,
CHARSET_TYPE_96, 1, 1, 'M',
build_string ("Latin-5"),
build_string ("ISO8859-9 (Latin-5)"),
build_string ("ISO8859-9 (Latin-5)"),
- build_string ("iso8859-9"));
+ build_string ("iso8859-9"),
+ latin_iso8859_9_to_ucs);
Vcharset_japanese_jisx0208_1978 =
make_charset (LEADING_BYTE_JAPANESE_JISX0208_1978, Qjapanese_jisx0208_1978,
CHARSET_TYPE_94X94, 2, 0, '@',
build_string ("JISX0208.1978 (Japanese)"),
build_string
("JISX0208.1978 Japanese Kanji (so called \"old JIS\")"),
- build_string ("\\(jisx0208\\|jisc6226\\)\\.1978"));
+ build_string ("\\(jisx0208\\|jisc6226\\)\\.1978"),
+ NULL);
Vcharset_chinese_gb2312 =
make_charset (LEADING_BYTE_CHINESE_GB2312, Qchinese_gb2312,
CHARSET_TYPE_94X94, 2, 0, 'A',
build_string ("GB2312"),
build_string ("GB2312)"),
build_string ("GB2312 Chinese simplified"),
- build_string ("gb2312"));
+ build_string ("gb2312"),
+ NULL);
Vcharset_japanese_jisx0208 =
make_charset (LEADING_BYTE_JAPANESE_JISX0208, Qjapanese_jisx0208,
CHARSET_TYPE_94X94, 2, 0, 'B',
build_string ("JISX0208"),
build_string ("JISX0208.1983/1990 (Japanese)"),
build_string ("JISX0208.1983/1990 Japanese Kanji"),
- build_string ("jisx0208.19\\(83\\|90\\)"));
+ build_string ("jisx0208.19\\(83\\|90\\)"),
+ NULL);
Vcharset_korean_ksc5601 =
make_charset (LEADING_BYTE_KOREAN_KSC5601, Qkorean_ksc5601,
CHARSET_TYPE_94X94, 2, 0, 'C',
build_string ("KSC5601"),
build_string ("KSC5601 (Korean"),
build_string ("KSC5601 Korean Hangul and Hanja"),
- build_string ("ksc5601"));
+ build_string ("ksc5601"),
+ NULL);
Vcharset_japanese_jisx0212 =
make_charset (LEADING_BYTE_JAPANESE_JISX0212, Qjapanese_jisx0212,
CHARSET_TYPE_94X94, 2, 0, 'D',
build_string ("JISX0212"),
build_string ("JISX0212 (Japanese)"),
build_string ("JISX0212 Japanese Supplement"),
- build_string ("jisx0212"));
+ build_string ("jisx0212"),
+ NULL);
#define CHINESE_CNS_PLANE_RE(n) "cns11643[.-]\\(.*[.-]\\)?" n "$"
Vcharset_chinese_cns11643_1 =
build_string ("CNS11643-1 (Chinese traditional)"),
build_string
("CNS 11643 Plane 1 Chinese traditional"),
- build_string (CHINESE_CNS_PLANE_RE("1")));
+ build_string (CHINESE_CNS_PLANE_RE("1")),
+ NULL);
Vcharset_chinese_cns11643_2 =
make_charset (LEADING_BYTE_CHINESE_CNS11643_2, Qchinese_cns11643_2,
CHARSET_TYPE_94X94, 2, 0, 'H',
build_string ("CNS11643-2 (Chinese traditional)"),
build_string
("CNS 11643 Plane 2 Chinese traditional"),
- build_string (CHINESE_CNS_PLANE_RE("2")));
+ build_string (CHINESE_CNS_PLANE_RE("2")),
+ NULL);
#ifdef UTF2000
Vcharset_chinese_cns11643_3 =
make_charset (LEADING_BYTE_CHINESE_CNS11643_3, Qchinese_cns11643_3,
build_string ("CNS11643-3 (Chinese traditional)"),
build_string
("CNS 11643 Plane 3 Chinese traditional"),
- build_string (CHINESE_CNS_PLANE_RE("3")));
+ build_string (CHINESE_CNS_PLANE_RE("3")),
+ NULL);
Vcharset_chinese_cns11643_4 =
make_charset (LEADING_BYTE_CHINESE_CNS11643_4, Qchinese_cns11643_4,
CHARSET_TYPE_94X94, 2, 0, 'J',
build_string ("CNS11643-4 (Chinese traditional)"),
build_string
("CNS 11643 Plane 4 Chinese traditional"),
- build_string (CHINESE_CNS_PLANE_RE("4")));
+ build_string (CHINESE_CNS_PLANE_RE("4")),
+ NULL);
Vcharset_chinese_cns11643_5 =
make_charset (LEADING_BYTE_CHINESE_CNS11643_5, Qchinese_cns11643_5,
CHARSET_TYPE_94X94, 2, 0, 'K',
build_string ("CNS11643-5 (Chinese traditional)"),
build_string
("CNS 11643 Plane 5 Chinese traditional"),
- build_string (CHINESE_CNS_PLANE_RE("5")));
+ build_string (CHINESE_CNS_PLANE_RE("5")),
+ NULL);
Vcharset_chinese_cns11643_6 =
make_charset (LEADING_BYTE_CHINESE_CNS11643_6, Qchinese_cns11643_6,
CHARSET_TYPE_94X94, 2, 0, 'L',
build_string ("CNS11643-6 (Chinese traditional)"),
build_string
("CNS 11643 Plane 6 Chinese traditional"),
- build_string (CHINESE_CNS_PLANE_RE("6")));
+ build_string (CHINESE_CNS_PLANE_RE("6")),
+ NULL);
Vcharset_chinese_cns11643_7 =
make_charset (LEADING_BYTE_CHINESE_CNS11643_7, Qchinese_cns11643_7,
CHARSET_TYPE_94X94, 2, 0, 'M',
build_string ("CNS11643-7 (Chinese traditional)"),
build_string
("CNS 11643 Plane 7 Chinese traditional"),
- build_string (CHINESE_CNS_PLANE_RE("7")));
+ build_string (CHINESE_CNS_PLANE_RE("7")),
+ NULL);
Vcharset_latin_viscii_lower =
make_charset (LEADING_BYTE_LATIN_VISCII_LOWER, Qlatin_viscii_lower,
CHARSET_TYPE_96, 1, 1, '1',
build_string ("VISCII lower"),
build_string ("VISCII lower (Vietnamese)"),
build_string ("VISCII lower (Vietnamese)"),
- build_string ("VISCII1.1"));
+ build_string ("VISCII1.1"),
+ latin_viscii_lower_to_ucs);
Vcharset_latin_viscii_upper =
make_charset (LEADING_BYTE_LATIN_VISCII_UPPER, Qlatin_viscii_upper,
CHARSET_TYPE_96, 1, 1, '2',
build_string ("VISCII upper"),
build_string ("VISCII upper (Vietnamese)"),
build_string ("VISCII upper (Vietnamese)"),
- build_string ("VISCII1.1"));
+ build_string ("VISCII1.1"),
+ latin_viscii_upper_to_ucs);
#endif
Vcharset_chinese_big5_1 =
make_charset (LEADING_BYTE_CHINESE_BIG5_1, Qchinese_big5_1,
build_string ("Big5 (Level-1)"),
build_string
("Big5 Level-1 Chinese traditional"),
- build_string ("big5"));
+ build_string ("big5"),
+ NULL);
Vcharset_chinese_big5_2 =
make_charset (LEADING_BYTE_CHINESE_BIG5_2, Qchinese_big5_2,
CHARSET_TYPE_94X94, 2, 0, '1',
build_string ("Big5 (Level-2)"),
build_string
("Big5 Level-2 Chinese traditional"),
- build_string ("big5"));
-
-#ifdef UTF2000
-#define GENERATE_94_SET(name) \
- { \
- size_t i; \
- ucs_to_##name = make_byte_from_character_table(); \
- for (i = 0; i < 94; i++) \
- { \
- Emchar c = name##_to_ucs[i]; \
- if (c <= 0xffff) \
- put_byte_from_character_table (c, \
- i + 33, ucs_to_##name); \
- } \
- }
-#define GENERATE_96_SET(name) \
- { \
- size_t i; \
- ucs_to_##name = make_byte_from_character_table(); \
- for (i = 0; i < 96; i++) \
- { \
- Emchar c = name##_to_ucs[i]; \
- if (c <= 0xffff) \
- put_byte_from_character_table (c, \
- i + 32, ucs_to_##name); \
- } \
- }
-
- GENERATE_94_SET (latin_jisx0201);
-
- GENERATE_96_SET (latin_iso8859_2);
- GENERATE_96_SET (latin_iso8859_3);
- GENERATE_96_SET (latin_iso8859_4);
- GENERATE_96_SET (latin_iso8859_9);
- GENERATE_96_SET (latin_viscii_lower);
- GENERATE_96_SET (latin_viscii_upper);
-#endif
+ build_string ("big5"),
+ NULL);
#ifdef ENABLE_COMPOSITE_CHARS
/* #### For simplicity, we put composite chars into a 96x96 charset.