Mercurial > hg > xemacs-beta
comparison src/mule-charset.c @ 398:74fd4e045ea6 r21-2-29
Import from CVS: tag r21-2-29
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:13:30 +0200 |
parents | 6719134a07c2 |
children | a86b2b5e0111 |
comparison
equal
deleted
inserted
replaced
397:f4aeb21a5bad | 398:74fd4e045ea6 |
---|---|
17 You should have received a copy of the GNU General Public License | 17 You should have received a copy of the GNU General Public License |
18 along with XEmacs; see the file COPYING. If not, write to | 18 along with XEmacs; see the file COPYING. If not, write to |
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 Boston, MA 02111-1307, USA. */ | 20 Boston, MA 02111-1307, USA. */ |
21 | 21 |
22 /* Synched up with: Mule 2.3. Not in FSF. */ | 22 /* Synched up with: FSF 20.3. Not in FSF. */ |
23 | 23 |
24 /* Rewritten by Ben Wing <ben@xemacs.org>. */ | 24 /* Rewritten by Ben Wing <ben@xemacs.org>. */ |
25 | 25 |
26 #include <config.h> | 26 #include <config.h> |
27 #include "lisp.h" | 27 #include "lisp.h" |
30 #include "chartab.h" | 30 #include "chartab.h" |
31 #include "elhash.h" | 31 #include "elhash.h" |
32 #include "lstream.h" | 32 #include "lstream.h" |
33 #include "device.h" | 33 #include "device.h" |
34 #include "faces.h" | 34 #include "faces.h" |
35 #include "mule-ccl.h" | |
35 | 36 |
36 /* The various pre-defined charsets. */ | 37 /* The various pre-defined charsets. */ |
37 | 38 |
38 Lisp_Object Vcharset_ascii; | 39 Lisp_Object Vcharset_ascii; |
39 Lisp_Object Vcharset_control_1; | 40 Lisp_Object Vcharset_control_1; |
40 Lisp_Object Vcharset_latin_iso8859_1; | 41 Lisp_Object Vcharset_latin_iso8859_1; |
41 Lisp_Object Vcharset_latin_iso8859_2; | 42 Lisp_Object Vcharset_latin_iso8859_2; |
42 Lisp_Object Vcharset_latin_iso8859_3; | 43 Lisp_Object Vcharset_latin_iso8859_3; |
43 Lisp_Object Vcharset_latin_iso8859_4; | 44 Lisp_Object Vcharset_latin_iso8859_4; |
44 Lisp_Object Vcharset_cyrillic_iso8859_5; | 45 Lisp_Object Vcharset_thai_tis620; |
46 Lisp_Object Vcharset_greek_iso8859_7; | |
45 Lisp_Object Vcharset_arabic_iso8859_6; | 47 Lisp_Object Vcharset_arabic_iso8859_6; |
46 Lisp_Object Vcharset_greek_iso8859_7; | |
47 Lisp_Object Vcharset_hebrew_iso8859_8; | 48 Lisp_Object Vcharset_hebrew_iso8859_8; |
48 Lisp_Object Vcharset_latin_iso8859_9; | |
49 Lisp_Object Vcharset_thai_tis620; | |
50 Lisp_Object Vcharset_katakana_jisx0201; | 49 Lisp_Object Vcharset_katakana_jisx0201; |
51 Lisp_Object Vcharset_latin_jisx0201; | 50 Lisp_Object Vcharset_latin_jisx0201; |
51 Lisp_Object Vcharset_cyrillic_iso8859_5; | |
52 Lisp_Object Vcharset_latin_iso8859_9; | |
52 Lisp_Object Vcharset_japanese_jisx0208_1978; | 53 Lisp_Object Vcharset_japanese_jisx0208_1978; |
54 Lisp_Object Vcharset_chinese_gb2312; | |
53 Lisp_Object Vcharset_japanese_jisx0208; | 55 Lisp_Object Vcharset_japanese_jisx0208; |
56 Lisp_Object Vcharset_korean_ksc5601; | |
54 Lisp_Object Vcharset_japanese_jisx0212; | 57 Lisp_Object Vcharset_japanese_jisx0212; |
55 Lisp_Object Vcharset_chinese_gb2312; | 58 Lisp_Object Vcharset_chinese_cns11643_1; |
59 Lisp_Object Vcharset_chinese_cns11643_2; | |
56 Lisp_Object Vcharset_chinese_big5_1; | 60 Lisp_Object Vcharset_chinese_big5_1; |
57 Lisp_Object Vcharset_chinese_big5_2; | 61 Lisp_Object Vcharset_chinese_big5_2; |
58 Lisp_Object Vcharset_chinese_cns11643_1; | |
59 Lisp_Object Vcharset_chinese_cns11643_2; | |
60 Lisp_Object Vcharset_korean_ksc5601; | |
61 | 62 |
62 #ifdef ENABLE_COMPOSITE_CHARS | 63 #ifdef ENABLE_COMPOSITE_CHARS |
63 Lisp_Object Vcharset_composite; | 64 Lisp_Object Vcharset_composite; |
64 | 65 |
65 /* Hash tables for composite chars. One maps string representing | 66 /* Hash tables for composite chars. One maps string representing |
71 static int composite_char_row_next; | 72 static int composite_char_row_next; |
72 static int composite_char_col_next; | 73 static int composite_char_col_next; |
73 | 74 |
74 #endif /* ENABLE_COMPOSITE_CHARS */ | 75 #endif /* ENABLE_COMPOSITE_CHARS */ |
75 | 76 |
76 /* Table of charsets indexed by leading byte. */ | 77 struct charset_lookup *chlook; |
77 Lisp_Object charset_by_leading_byte[128]; | 78 |
78 | 79 static const struct lrecord_description charset_lookup_description_1[] = { |
79 /* Table of charsets indexed by type/final-byte/direction. */ | 80 { XD_LISP_OBJECT_ARRAY, offsetof (struct charset_lookup, charset_by_leading_byte), 128+4*128*2 }, |
80 Lisp_Object charset_by_attributes[4][128][2]; | 81 { XD_END } |
82 }; | |
83 | |
84 static const struct struct_description charset_lookup_description = { | |
85 sizeof (struct charset_lookup), | |
86 charset_lookup_description_1 | |
87 }; | |
81 | 88 |
82 /* Table of number of bytes in the string representation of a character | 89 /* Table of number of bytes in the string representation of a character |
83 indexed by the first byte of that representation. | 90 indexed by the first byte of that representation. |
84 | 91 |
85 rep_bytes_by_first_byte(c) is more efficient than the equivalent | 92 rep_bytes_by_first_byte(c) is more efficient than the equivalent |
86 canonical computation: | 93 canonical computation: |
87 | 94 |
88 (BYTE_ASCII_P (c) ? 1 : XCHARSET_REP_BYTES (CHARSET_BY_LEADING_BYTE (c))) */ | 95 XCHARSET_REP_BYTES (CHARSET_BY_LEADING_BYTE (c)) */ |
89 | 96 |
90 Bytecount rep_bytes_by_first_byte[0xA0] = | 97 const Bytecount rep_bytes_by_first_byte[0xA0] = |
91 { /* 0x00 - 0x7f are for straight ASCII */ | 98 { /* 0x00 - 0x7f are for straight ASCII */ |
92 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | 99 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
93 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | 100 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
94 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | 101 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
95 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | 102 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
109 | 116 |
110 /* Qdoc_string, Qdimension, Qchars defined in general.c */ | 117 /* Qdoc_string, Qdimension, Qchars defined in general.c */ |
111 Lisp_Object Qregistry, Qfinal, Qgraphic; | 118 Lisp_Object Qregistry, Qfinal, Qgraphic; |
112 Lisp_Object Qdirection; | 119 Lisp_Object Qdirection; |
113 Lisp_Object Qreverse_direction_charset; | 120 Lisp_Object Qreverse_direction_charset; |
114 Lisp_Object Qccl_program; | |
115 Lisp_Object Qleading_byte; | 121 Lisp_Object Qleading_byte; |
116 | 122 Lisp_Object Qshort_name, Qlong_name; |
117 Lisp_Object Qascii, Qcontrol_1, | 123 |
118 | 124 Lisp_Object Qascii, |
125 Qcontrol_1, | |
119 Qlatin_iso8859_1, | 126 Qlatin_iso8859_1, |
120 Qlatin_iso8859_2, | 127 Qlatin_iso8859_2, |
121 Qlatin_iso8859_3, | 128 Qlatin_iso8859_3, |
122 Qlatin_iso8859_4, | 129 Qlatin_iso8859_4, |
130 Qthai_tis620, | |
131 Qgreek_iso8859_7, | |
132 Qarabic_iso8859_6, | |
133 Qhebrew_iso8859_8, | |
134 Qkatakana_jisx0201, | |
135 Qlatin_jisx0201, | |
123 Qcyrillic_iso8859_5, | 136 Qcyrillic_iso8859_5, |
124 Qarabic_iso8859_6, | |
125 Qgreek_iso8859_7, | |
126 Qhebrew_iso8859_8, | |
127 Qlatin_iso8859_9, | 137 Qlatin_iso8859_9, |
128 | |
129 Qthai_tis620, | |
130 | |
131 Qkatakana_jisx0201, Qlatin_jisx0201, | |
132 Qjapanese_jisx0208_1978, | 138 Qjapanese_jisx0208_1978, |
139 Qchinese_gb2312, | |
133 Qjapanese_jisx0208, | 140 Qjapanese_jisx0208, |
141 Qkorean_ksc5601, | |
134 Qjapanese_jisx0212, | 142 Qjapanese_jisx0212, |
135 | 143 Qchinese_cns11643_1, |
136 Qchinese_gb2312, | 144 Qchinese_cns11643_2, |
137 Qchinese_big5_1, Qchinese_big5_2, | 145 Qchinese_big5_1, |
138 Qchinese_cns11643_1, Qchinese_cns11643_2, | 146 Qchinese_big5_2, |
139 | 147 Qcomposite; |
140 Qkorean_ksc5601, Qcomposite; | |
141 | 148 |
142 Lisp_Object Ql2r, Qr2l; | 149 Lisp_Object Ql2r, Qr2l; |
143 | 150 |
144 Lisp_Object Vcharset_hash_table; | 151 Lisp_Object Vcharset_hash_table; |
145 | 152 |
211 /* Return the first character from a Mule-encoded string in STR, | 218 /* Return the first character from a Mule-encoded string in STR, |
212 assuming it's non-ASCII. Do not call this directly. | 219 assuming it's non-ASCII. Do not call this directly. |
213 Use the macro charptr_emchar() instead. */ | 220 Use the macro charptr_emchar() instead. */ |
214 | 221 |
215 Emchar | 222 Emchar |
216 non_ascii_charptr_emchar (CONST Bufbyte *str) | 223 non_ascii_charptr_emchar (const Bufbyte *str) |
217 { | 224 { |
218 Bufbyte i0 = *str, i1, i2 = 0; | 225 Bufbyte i0 = *str, i1, i2 = 0; |
219 Lisp_Object charset; | 226 Lisp_Object charset; |
220 | 227 |
221 if (i0 == LEADING_BYTE_CONTROL_1) | 228 if (i0 == LEADING_BYTE_CONTROL_1) |
258 f2 > MAX_CHAR_FIELD2_PRIVATE) | 265 f2 > MAX_CHAR_FIELD2_PRIVATE) |
259 return 0; | 266 return 0; |
260 if (f3 < 0x20) | 267 if (f3 < 0x20) |
261 return 0; | 268 return 0; |
262 | 269 |
263 if (f3 != 0x20 && f3 != 0x7F) | 270 if (f3 != 0x20 && f3 != 0x7F && !(f2 >= MIN_CHAR_FIELD2_PRIVATE && |
271 f2 <= MAX_CHAR_FIELD2_PRIVATE)) | |
264 return 1; | 272 return 1; |
265 | 273 |
266 /* | 274 /* |
267 NOTE: This takes advantage of the fact that | 275 NOTE: This takes advantage of the fact that |
268 FIELD2_TO_OFFICIAL_LEADING_BYTE and | 276 FIELD2_TO_OFFICIAL_LEADING_BYTE and |
269 FIELD2_TO_PRIVATE_LEADING_BYTE are the same. | 277 FIELD2_TO_PRIVATE_LEADING_BYTE are the same. |
270 */ | 278 */ |
271 charset = CHARSET_BY_LEADING_BYTE (f2 + FIELD2_TO_OFFICIAL_LEADING_BYTE); | 279 charset = CHARSET_BY_LEADING_BYTE (f2 + FIELD2_TO_OFFICIAL_LEADING_BYTE); |
280 if (EQ (charset, Qnil)) | |
281 return 0; | |
272 return (XCHARSET_CHARS (charset) == 96); | 282 return (XCHARSET_CHARS (charset) == 96); |
273 } | 283 } |
274 else | 284 else |
275 { | 285 { |
276 Lisp_Object charset; | 286 Lisp_Object charset; |
291 return 0; | 301 return 0; |
292 return 1; | 302 return 1; |
293 } | 303 } |
294 #endif /* ENABLE_COMPOSITE_CHARS */ | 304 #endif /* ENABLE_COMPOSITE_CHARS */ |
295 | 305 |
296 if (f2 != 0x20 && f2 != 0x7F && f3 != 0x20 && f3 != 0x7F) | 306 if (f2 != 0x20 && f2 != 0x7F && f3 != 0x20 && f3 != 0x7F |
307 && !(f1 >= MIN_CHAR_FIELD1_PRIVATE && f1 <= MAX_CHAR_FIELD1_PRIVATE)) | |
297 return 1; | 308 return 1; |
298 | 309 |
299 if (f1 <= MAX_CHAR_FIELD1_OFFICIAL) | 310 if (f1 <= MAX_CHAR_FIELD1_OFFICIAL) |
300 charset = | 311 charset = |
301 CHARSET_BY_LEADING_BYTE (f1 + FIELD1_TO_OFFICIAL_LEADING_BYTE); | 312 CHARSET_BY_LEADING_BYTE (f1 + FIELD1_TO_OFFICIAL_LEADING_BYTE); |
302 else | 313 else |
303 charset = | 314 charset = |
304 CHARSET_BY_LEADING_BYTE (f1 + FIELD1_TO_PRIVATE_LEADING_BYTE); | 315 CHARSET_BY_LEADING_BYTE (f1 + FIELD1_TO_PRIVATE_LEADING_BYTE); |
305 | 316 |
317 if (EQ (charset, Qnil)) | |
318 return 0; | |
306 return (XCHARSET_CHARS (charset) == 96); | 319 return (XCHARSET_CHARS (charset) == 96); |
307 } | 320 } |
308 } | 321 } |
309 | 322 |
310 | 323 |
315 /* Copy the character pointed to by PTR into STR, assuming it's | 328 /* Copy the character pointed to by PTR into STR, assuming it's |
316 non-ASCII. Do not call this directly. Use the macro | 329 non-ASCII. Do not call this directly. Use the macro |
317 charptr_copy_char() instead. */ | 330 charptr_copy_char() instead. */ |
318 | 331 |
319 Bytecount | 332 Bytecount |
320 non_ascii_charptr_copy_char (CONST Bufbyte *ptr, Bufbyte *str) | 333 non_ascii_charptr_copy_char (const Bufbyte *ptr, Bufbyte *str) |
321 { | 334 { |
322 Bufbyte *strptr = str; | 335 Bufbyte *strptr = str; |
323 *strptr = *ptr++; | 336 *strptr = *ptr++; |
324 switch (REP_BYTES_BY_FIRST_BYTE (*strptr)) | 337 switch (REP_BYTES_BY_FIRST_BYTE (*strptr)) |
325 { | 338 { |
392 /************************************************************************/ | 405 /************************************************************************/ |
393 /* charset object */ | 406 /* charset object */ |
394 /************************************************************************/ | 407 /************************************************************************/ |
395 | 408 |
396 static Lisp_Object | 409 static Lisp_Object |
397 mark_charset (Lisp_Object obj, void (*markobj) (Lisp_Object)) | 410 mark_charset (Lisp_Object obj) |
398 { | 411 { |
399 struct Lisp_Charset *cs = XCHARSET (obj); | 412 Lisp_Charset *cs = XCHARSET (obj); |
400 | 413 |
401 markobj (cs->doc_string); | 414 mark_object (cs->short_name); |
402 markobj (cs->registry); | 415 mark_object (cs->long_name); |
403 markobj (cs->ccl_program); | 416 mark_object (cs->doc_string); |
417 mark_object (cs->registry); | |
418 mark_object (cs->ccl_program); | |
404 return cs->name; | 419 return cs->name; |
405 } | 420 } |
406 | 421 |
407 static void | 422 static void |
408 print_charset (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) | 423 print_charset (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) |
409 { | 424 { |
410 struct Lisp_Charset *cs = XCHARSET (obj); | 425 Lisp_Charset *cs = XCHARSET (obj); |
411 char buf[200]; | 426 char buf[200]; |
412 | 427 |
413 if (print_readably) | 428 if (print_readably) |
414 error ("printing unreadable object #<charset %s 0x%x>", | 429 error ("printing unreadable object #<charset %s 0x%x>", |
415 string_data (XSYMBOL (CHARSET_NAME (cs))->name), | 430 string_data (XSYMBOL (CHARSET_NAME (cs))->name), |
416 cs->header.uid); | 431 cs->header.uid); |
417 | 432 |
418 write_c_string ("#<charset ", printcharfun); | 433 write_c_string ("#<charset ", printcharfun); |
419 print_internal (CHARSET_NAME (cs), printcharfun, 0); | 434 print_internal (CHARSET_NAME (cs), printcharfun, 0); |
435 write_c_string (" ", printcharfun); | |
436 print_internal (CHARSET_SHORT_NAME (cs), printcharfun, 1); | |
437 write_c_string (" ", printcharfun); | |
438 print_internal (CHARSET_LONG_NAME (cs), printcharfun, 1); | |
420 write_c_string (" ", printcharfun); | 439 write_c_string (" ", printcharfun); |
421 print_internal (CHARSET_DOC_STRING (cs), printcharfun, 1); | 440 print_internal (CHARSET_DOC_STRING (cs), printcharfun, 1); |
422 sprintf (buf, " %s %s cols=%d g%d final='%c' reg=", | 441 sprintf (buf, " %s %s cols=%d g%d final='%c' reg=", |
423 CHARSET_TYPE (cs) == CHARSET_TYPE_94 ? "94" : | 442 CHARSET_TYPE (cs) == CHARSET_TYPE_94 ? "94" : |
424 CHARSET_TYPE (cs) == CHARSET_TYPE_96 ? "96" : | 443 CHARSET_TYPE (cs) == CHARSET_TYPE_96 ? "96" : |
432 print_internal (CHARSET_REGISTRY (cs), printcharfun, 0); | 451 print_internal (CHARSET_REGISTRY (cs), printcharfun, 0); |
433 sprintf (buf, " 0x%x>", cs->header.uid); | 452 sprintf (buf, " 0x%x>", cs->header.uid); |
434 write_c_string (buf, printcharfun); | 453 write_c_string (buf, printcharfun); |
435 } | 454 } |
436 | 455 |
456 static const struct lrecord_description charset_description[] = { | |
457 { XD_LISP_OBJECT, offsetof (Lisp_Charset, name) }, | |
458 { XD_LISP_OBJECT, offsetof (Lisp_Charset, doc_string) }, | |
459 { XD_LISP_OBJECT, offsetof (Lisp_Charset, registry) }, | |
460 { XD_LISP_OBJECT, offsetof (Lisp_Charset, short_name) }, | |
461 { XD_LISP_OBJECT, offsetof (Lisp_Charset, long_name) }, | |
462 { XD_LISP_OBJECT, offsetof (Lisp_Charset, reverse_direction_charset) }, | |
463 { XD_LISP_OBJECT, offsetof (Lisp_Charset, ccl_program) }, | |
464 { XD_END } | |
465 }; | |
466 | |
437 DEFINE_LRECORD_IMPLEMENTATION ("charset", charset, | 467 DEFINE_LRECORD_IMPLEMENTATION ("charset", charset, |
438 mark_charset, print_charset, 0, 0, 0, | 468 mark_charset, print_charset, 0, 0, 0, charset_description, |
439 struct Lisp_Charset); | 469 Lisp_Charset); |
440 /* Make a new charset. */ | 470 /* Make a new charset. */ |
441 | 471 |
442 static Lisp_Object | 472 static Lisp_Object |
443 make_charset (int id, Lisp_Object name, Bufbyte leading_byte, unsigned char rep_bytes, | 473 make_charset (int id, Lisp_Object name, unsigned char rep_bytes, |
444 unsigned char type, unsigned char columns, unsigned char graphic, | 474 unsigned char type, unsigned char columns, unsigned char graphic, |
445 Bufbyte final, unsigned char direction, Lisp_Object doc, | 475 Bufbyte final, unsigned char direction, Lisp_Object short_name, |
476 Lisp_Object long_name, Lisp_Object doc, | |
446 Lisp_Object reg) | 477 Lisp_Object reg) |
447 { | 478 { |
448 Lisp_Object obj; | 479 Lisp_Object obj; |
449 struct Lisp_Charset *cs = | 480 Lisp_Charset *cs = alloc_lcrecord_type (Lisp_Charset, &lrecord_charset); |
450 alloc_lcrecord_type (struct Lisp_Charset, lrecord_charset); | 481 |
482 zero_lcrecord (cs); | |
483 | |
451 XSETCHARSET (obj, cs); | 484 XSETCHARSET (obj, cs); |
452 | 485 |
453 CHARSET_ID (cs) = id; | 486 CHARSET_ID (cs) = id; |
454 CHARSET_NAME (cs) = name; | 487 CHARSET_NAME (cs) = name; |
455 CHARSET_LEADING_BYTE (cs) = leading_byte; | 488 CHARSET_SHORT_NAME (cs) = short_name; |
489 CHARSET_LONG_NAME (cs) = long_name; | |
456 CHARSET_REP_BYTES (cs) = rep_bytes; | 490 CHARSET_REP_BYTES (cs) = rep_bytes; |
457 CHARSET_DIRECTION (cs) = direction; | 491 CHARSET_DIRECTION (cs) = direction; |
458 CHARSET_TYPE (cs) = type; | 492 CHARSET_TYPE (cs) = type; |
459 CHARSET_COLUMNS (cs) = columns; | 493 CHARSET_COLUMNS (cs) = columns; |
460 CHARSET_GRAPHIC (cs) = graphic; | 494 CHARSET_GRAPHIC (cs) = graphic; |
472 if (final) | 506 if (final) |
473 { | 507 { |
474 /* some charsets do not have final characters. This includes | 508 /* some charsets do not have final characters. This includes |
475 ASCII, Control-1, Composite, and the two faux private | 509 ASCII, Control-1, Composite, and the two faux private |
476 charsets. */ | 510 charsets. */ |
477 assert (NILP (charset_by_attributes[type][final][direction])); | 511 assert (NILP (chlook->charset_by_attributes[type][final][direction])); |
478 charset_by_attributes[type][final][direction] = obj; | 512 chlook->charset_by_attributes[type][final][direction] = obj; |
479 } | 513 } |
480 | 514 |
481 assert (NILP (charset_by_leading_byte[leading_byte - 128])); | 515 assert (NILP (chlook->charset_by_leading_byte[id - 128])); |
482 charset_by_leading_byte[leading_byte - 128] = obj; | 516 chlook->charset_by_leading_byte[id - 128] = obj; |
483 if (leading_byte < 0xA0) | |
484 /* official leading byte */ | |
485 rep_bytes_by_first_byte[leading_byte] = rep_bytes; | |
486 | 517 |
487 /* Some charsets are "faux" and don't have names or really exist at | 518 /* Some charsets are "faux" and don't have names or really exist at |
488 all except in the leading-byte table. */ | 519 all except in the leading-byte table. */ |
489 if (!NILP (name)) | 520 if (!NILP (name)) |
490 Fputhash (name, obj, Vcharset_hash_table); | 521 Fputhash (name, obj, Vcharset_hash_table); |
614 NAME is a symbol, the name by which the character set is normally referred. | 645 NAME is a symbol, the name by which the character set is normally referred. |
615 DOC-STRING is a string describing the character set. | 646 DOC-STRING is a string describing the character set. |
616 PROPS is a property list, describing the specific nature of the | 647 PROPS is a property list, describing the specific nature of the |
617 character set. Recognized properties are: | 648 character set. Recognized properties are: |
618 | 649 |
650 'short-name Short version of the charset name (ex: Latin-1) | |
651 'long-name Long version of the charset name (ex: ISO8859-1 (Latin-1)) | |
619 'registry A regular expression matching the font registry field for | 652 'registry A regular expression matching the font registry field for |
620 this character set. | 653 this character set. |
621 'dimension Number of octets used to index a character in this charset. | 654 'dimension Number of octets used to index a character in this charset. |
622 Either 1 or 2. Defaults to 1. | 655 Either 1 or 2. Defaults to 1. |
623 'columns Number of columns used to display a character in this charset. | 656 'columns Number of columns used to display a character in this charset. |
653 bit cleared and set depending upon whether the value | 686 bit cleared and set depending upon whether the value |
654 of the 'graphic property is 0 or 1. | 687 of the 'graphic property is 0 or 1. |
655 */ | 688 */ |
656 (name, doc_string, props)) | 689 (name, doc_string, props)) |
657 { | 690 { |
658 int lb, dimension = 1, chars = 94, graphic = 0, final = 0, columns = -1; | 691 int id, dimension = 1, chars = 94, graphic = 0, final = 0, columns = -1; |
659 int direction = CHARSET_LEFT_TO_RIGHT; | 692 int direction = CHARSET_LEFT_TO_RIGHT; |
660 int type; | 693 int type; |
661 Lisp_Object registry = Qnil; | 694 Lisp_Object registry = Qnil; |
662 Lisp_Object charset; | 695 Lisp_Object charset; |
663 Lisp_Object rest, keyword, value; | 696 Lisp_Object rest, keyword, value; |
664 Lisp_Object ccl_program = Qnil; | 697 Lisp_Object ccl_program = Qnil; |
698 Lisp_Object short_name = Qnil, long_name = Qnil; | |
665 | 699 |
666 CHECK_SYMBOL (name); | 700 CHECK_SYMBOL (name); |
667 if (!NILP (doc_string)) | 701 if (!NILP (doc_string)) |
668 CHECK_STRING (doc_string); | 702 CHECK_STRING (doc_string); |
669 | 703 |
671 if (!NILP (charset)) | 705 if (!NILP (charset)) |
672 signal_simple_error ("Cannot redefine existing charset", name); | 706 signal_simple_error ("Cannot redefine existing charset", name); |
673 | 707 |
674 EXTERNAL_PROPERTY_LIST_LOOP (rest, keyword, value, props) | 708 EXTERNAL_PROPERTY_LIST_LOOP (rest, keyword, value, props) |
675 { | 709 { |
676 if (EQ (keyword, Qdimension)) | 710 if (EQ (keyword, Qshort_name)) |
711 { | |
712 CHECK_STRING (value); | |
713 short_name = value; | |
714 } | |
715 | |
716 if (EQ (keyword, Qlong_name)) | |
717 { | |
718 CHECK_STRING (value); | |
719 long_name = value; | |
720 } | |
721 | |
722 else if (EQ (keyword, Qdimension)) | |
677 { | 723 { |
678 CHECK_INT (value); | 724 CHECK_INT (value); |
679 dimension = XINT (value); | 725 dimension = XINT (value); |
680 if (dimension < 1 || dimension > 2) | 726 if (dimension < 1 || dimension > 2) |
681 signal_simple_error ("Invalid value for 'dimension", value); | 727 signal_simple_error ("Invalid value for 'dimension", value); |
754 if (!NILP (CHARSET_BY_ATTRIBUTES (type, final, CHARSET_LEFT_TO_RIGHT)) || | 800 if (!NILP (CHARSET_BY_ATTRIBUTES (type, final, CHARSET_LEFT_TO_RIGHT)) || |
755 !NILP (CHARSET_BY_ATTRIBUTES (type, final, CHARSET_RIGHT_TO_LEFT))) | 801 !NILP (CHARSET_BY_ATTRIBUTES (type, final, CHARSET_RIGHT_TO_LEFT))) |
756 error | 802 error |
757 ("Character set already defined for this DIMENSION/CHARS/FINAL combo"); | 803 ("Character set already defined for this DIMENSION/CHARS/FINAL combo"); |
758 | 804 |
759 lb = get_unallocated_leading_byte (dimension); | 805 id = get_unallocated_leading_byte (dimension); |
760 | 806 |
761 if (NILP (doc_string)) | 807 if (NILP (doc_string)) |
762 doc_string = build_string (""); | 808 doc_string = build_string (""); |
763 | 809 |
764 if (NILP (registry)) | 810 if (NILP (registry)) |
765 registry = build_string (""); | 811 registry = build_string (""); |
766 | 812 |
813 if (NILP (short_name)) | |
814 XSETSTRING (short_name, XSYMBOL (name)->name); | |
815 | |
816 if (NILP (long_name)) | |
817 long_name = doc_string; | |
818 | |
767 if (columns == -1) | 819 if (columns == -1) |
768 columns = dimension; | 820 columns = dimension; |
769 charset = make_charset (-1, name, lb, dimension + 2, type, columns, graphic, | 821 charset = make_charset (id, name, dimension + 2, type, columns, graphic, |
770 final, direction, doc_string, registry); | 822 final, direction, short_name, long_name, doc_string, registry); |
771 if (!NILP (ccl_program)) | 823 if (!NILP (ccl_program)) |
772 XCHARSET_CCL_PROGRAM (charset) = ccl_program; | 824 XCHARSET_CCL_PROGRAM (charset) = ccl_program; |
773 return charset; | 825 return charset; |
774 } | 826 } |
775 | 827 |
779 NEW-NAME is the name of the new charset. Return the new charset. | 831 NEW-NAME is the name of the new charset. Return the new charset. |
780 */ | 832 */ |
781 (charset, new_name)) | 833 (charset, new_name)) |
782 { | 834 { |
783 Lisp_Object new_charset = Qnil; | 835 Lisp_Object new_charset = Qnil; |
784 int lb, dimension, columns, graphic, final; | 836 int id, dimension, columns, graphic, final; |
785 int direction, type; | 837 int direction, type; |
786 Lisp_Object registry, doc_string; | 838 Lisp_Object registry, doc_string, short_name, long_name; |
787 struct Lisp_Charset *cs; | 839 Lisp_Charset *cs; |
788 | 840 |
789 charset = Fget_charset (charset); | 841 charset = Fget_charset (charset); |
790 if (!NILP (XCHARSET_REVERSE_DIRECTION_CHARSET (charset))) | 842 if (!NILP (XCHARSET_REVERSE_DIRECTION_CHARSET (charset))) |
791 signal_simple_error ("Charset already has reverse-direction charset", | 843 signal_simple_error ("Charset already has reverse-direction charset", |
792 charset); | 844 charset); |
798 cs = XCHARSET (charset); | 850 cs = XCHARSET (charset); |
799 | 851 |
800 type = CHARSET_TYPE (cs); | 852 type = CHARSET_TYPE (cs); |
801 columns = CHARSET_COLUMNS (cs); | 853 columns = CHARSET_COLUMNS (cs); |
802 dimension = CHARSET_DIMENSION (cs); | 854 dimension = CHARSET_DIMENSION (cs); |
803 lb = get_unallocated_leading_byte (dimension); | 855 id = get_unallocated_leading_byte (dimension); |
804 | 856 |
805 graphic = CHARSET_GRAPHIC (cs); | 857 graphic = CHARSET_GRAPHIC (cs); |
806 final = CHARSET_FINAL (cs); | 858 final = CHARSET_FINAL (cs); |
807 direction = CHARSET_RIGHT_TO_LEFT; | 859 direction = CHARSET_RIGHT_TO_LEFT; |
808 if (CHARSET_DIRECTION (cs) == CHARSET_RIGHT_TO_LEFT) | 860 if (CHARSET_DIRECTION (cs) == CHARSET_RIGHT_TO_LEFT) |
809 direction = CHARSET_LEFT_TO_RIGHT; | 861 direction = CHARSET_LEFT_TO_RIGHT; |
810 doc_string = CHARSET_DOC_STRING (cs); | 862 doc_string = CHARSET_DOC_STRING (cs); |
863 short_name = CHARSET_SHORT_NAME (cs); | |
864 long_name = CHARSET_LONG_NAME (cs); | |
811 registry = CHARSET_REGISTRY (cs); | 865 registry = CHARSET_REGISTRY (cs); |
812 | 866 |
813 new_charset = make_charset (-1, new_name, lb, dimension + 2, type, columns, | 867 new_charset = make_charset (id, new_name, dimension + 2, type, columns, |
814 graphic, final, direction, doc_string, registry); | 868 graphic, final, direction, short_name, long_name, |
869 doc_string, registry); | |
815 | 870 |
816 CHARSET_REVERSE_DIRECTION_CHARSET (cs) = new_charset; | 871 CHARSET_REVERSE_DIRECTION_CHARSET (cs) = new_charset; |
817 XCHARSET_REVERSE_DIRECTION_CHARSET (new_charset) = charset; | 872 XCHARSET_REVERSE_DIRECTION_CHARSET (new_charset) = charset; |
818 | 873 |
819 return new_charset; | 874 return new_charset; |
889 if (CHARSETP (obj)) | 944 if (CHARSETP (obj)) |
890 return XCHARSET_NAME (obj); | 945 return XCHARSET_NAME (obj); |
891 return obj; | 946 return obj; |
892 } | 947 } |
893 | 948 |
894 DEFUN ("charset-doc-string", Fcharset_doc_string, 1, 1, 0, /* | 949 DEFUN ("charset-short-name", Fcharset_short_name, 1, 1, 0, /* |
895 Return doc string of CHARSET. | 950 Return short name of CHARSET. |
951 */ | |
952 (charset)) | |
953 { | |
954 return XCHARSET_SHORT_NAME (Fget_charset (charset)); | |
955 } | |
956 | |
957 DEFUN ("charset-long-name", Fcharset_long_name, 1, 1, 0, /* | |
958 Return long name of CHARSET. | |
959 */ | |
960 (charset)) | |
961 { | |
962 return XCHARSET_LONG_NAME (Fget_charset (charset)); | |
963 } | |
964 | |
965 DEFUN ("charset-description", Fcharset_description, 1, 1, 0, /* | |
966 Return description of CHARSET. | |
896 */ | 967 */ |
897 (charset)) | 968 (charset)) |
898 { | 969 { |
899 return XCHARSET_DOC_STRING (Fget_charset (charset)); | 970 return XCHARSET_DOC_STRING (Fget_charset (charset)); |
900 } | 971 } |
912 Recognized properties are those listed in `make-charset', as well as | 983 Recognized properties are those listed in `make-charset', as well as |
913 'name and 'doc-string. | 984 'name and 'doc-string. |
914 */ | 985 */ |
915 (charset, prop)) | 986 (charset, prop)) |
916 { | 987 { |
917 struct Lisp_Charset *cs; | 988 Lisp_Charset *cs; |
918 | 989 |
919 charset = Fget_charset (charset); | 990 charset = Fget_charset (charset); |
920 cs = XCHARSET (charset); | 991 cs = XCHARSET (charset); |
921 | 992 |
922 CHECK_SYMBOL (prop); | 993 CHECK_SYMBOL (prop); |
923 if (EQ (prop, Qname)) return CHARSET_NAME (cs); | 994 if (EQ (prop, Qname)) return CHARSET_NAME (cs); |
995 if (EQ (prop, Qshort_name)) return CHARSET_SHORT_NAME (cs); | |
996 if (EQ (prop, Qlong_name)) return CHARSET_LONG_NAME (cs); | |
924 if (EQ (prop, Qdoc_string)) return CHARSET_DOC_STRING (cs); | 997 if (EQ (prop, Qdoc_string)) return CHARSET_DOC_STRING (cs); |
925 if (EQ (prop, Qdimension)) return make_int (CHARSET_DIMENSION (cs)); | 998 if (EQ (prop, Qdimension)) return make_int (CHARSET_DIMENSION (cs)); |
926 if (EQ (prop, Qcolumns)) return make_int (CHARSET_COLUMNS (cs)); | 999 if (EQ (prop, Qcolumns)) return make_int (CHARSET_COLUMNS (cs)); |
927 if (EQ (prop, Qgraphic)) return make_int (CHARSET_GRAPHIC (cs)); | 1000 if (EQ (prop, Qgraphic)) return make_int (CHARSET_GRAPHIC (cs)); |
928 if (EQ (prop, Qfinal)) return make_char (CHARSET_FINAL (cs)); | 1001 if (EQ (prop, Qfinal)) return make_char (CHARSET_FINAL (cs)); |
929 if (EQ (prop, Qchars)) return make_int (CHARSET_CHARS (cs)); | 1002 if (EQ (prop, Qchars)) return make_int (CHARSET_CHARS (cs)); |
930 if (EQ (prop, Qregistry)) return CHARSET_REGISTRY (cs); | 1003 if (EQ (prop, Qregistry)) return CHARSET_REGISTRY (cs); |
931 if (EQ (prop, Qccl_program)) return CHARSET_CCL_PROGRAM (cs); | 1004 if (EQ (prop, Qccl_program)) return CHARSET_CCL_PROGRAM (cs); |
932 if (EQ (prop, Qleading_byte)) return make_char (CHARSET_LEADING_BYTE (cs)); | |
933 if (EQ (prop, Qdirection)) | 1005 if (EQ (prop, Qdirection)) |
934 return CHARSET_DIRECTION (cs) == CHARSET_LEFT_TO_RIGHT ? Ql2r : Qr2l; | 1006 return CHARSET_DIRECTION (cs) == CHARSET_LEFT_TO_RIGHT ? Ql2r : Qr2l; |
935 if (EQ (prop, Qreverse_direction_charset)) | 1007 if (EQ (prop, Qreverse_direction_charset)) |
936 { | 1008 { |
937 Lisp_Object obj = CHARSET_REVERSE_DIRECTION_CHARSET (cs); | 1009 Lisp_Object obj = CHARSET_REVERSE_DIRECTION_CHARSET (cs); |
947 DEFUN ("charset-id", Fcharset_id, 1, 1, 0, /* | 1019 DEFUN ("charset-id", Fcharset_id, 1, 1, 0, /* |
948 Return charset identification number of CHARSET. | 1020 Return charset identification number of CHARSET. |
949 */ | 1021 */ |
950 (charset)) | 1022 (charset)) |
951 { | 1023 { |
952 return make_int(XCHARSET_ID (Fget_charset (charset))); | 1024 return make_int(XCHARSET_LEADING_BYTE (Fget_charset (charset))); |
953 } | 1025 } |
954 | 1026 |
955 /* #### We need to figure out which properties we really want to | 1027 /* #### We need to figure out which properties we really want to |
956 allow to be set. */ | 1028 allow to be set. */ |
957 | 1029 |
998 /************************************************************************/ | 1070 /************************************************************************/ |
999 /* Lisp primitives for working with characters */ | 1071 /* Lisp primitives for working with characters */ |
1000 /************************************************************************/ | 1072 /************************************************************************/ |
1001 | 1073 |
1002 DEFUN ("make-char", Fmake_char, 2, 3, 0, /* | 1074 DEFUN ("make-char", Fmake_char, 2, 3, 0, /* |
1003 Make a multi-byte character from CHARSET and octets ARG1 and ARG2. | 1075 Make a character from CHARSET and octets ARG1 and ARG2. |
1076 ARG2 is required only for characters from two-dimensional charsets. | |
1077 For example, (make-char 'latin-iso8859-2 185) will return the Latin 2 | |
1078 character s with caron. | |
1004 */ | 1079 */ |
1005 (charset, arg1, arg2)) | 1080 (charset, arg1, arg2)) |
1006 { | 1081 { |
1007 struct Lisp_Charset *cs; | 1082 Lisp_Charset *cs; |
1008 int a1, a2; | 1083 int a1, a2; |
1009 int lowlim, highlim; | 1084 int lowlim, highlim; |
1010 | 1085 |
1011 charset = Fget_charset (charset); | 1086 charset = Fget_charset (charset); |
1012 cs = XCHARSET (charset); | 1087 cs = XCHARSET (charset); |
1015 else if (EQ (charset, Vcharset_control_1)) lowlim = 0, highlim = 31; | 1090 else if (EQ (charset, Vcharset_control_1)) lowlim = 0, highlim = 31; |
1016 else if (CHARSET_CHARS (cs) == 94) lowlim = 33, highlim = 126; | 1091 else if (CHARSET_CHARS (cs) == 94) lowlim = 33, highlim = 126; |
1017 else /* CHARSET_CHARS (cs) == 96) */ lowlim = 32, highlim = 127; | 1092 else /* CHARSET_CHARS (cs) == 96) */ lowlim = 32, highlim = 127; |
1018 | 1093 |
1019 CHECK_INT (arg1); | 1094 CHECK_INT (arg1); |
1020 a1 = XINT (arg1); | 1095 /* It is useful (and safe, according to Olivier Galibert) to strip |
1096 the 8th bit off ARG1 and ARG2 becaue it allows programmers to | |
1097 write (make-char 'latin-iso8859-2 CODE) where code is the actual | |
1098 Latin 2 code of the character. */ | |
1099 a1 = XINT (arg1) & 0x7f; | |
1021 if (a1 < lowlim || a1 > highlim) | 1100 if (a1 < lowlim || a1 > highlim) |
1022 args_out_of_range_3 (arg1, make_int (lowlim), make_int (highlim)); | 1101 args_out_of_range_3 (arg1, make_int (lowlim), make_int (highlim)); |
1023 | 1102 |
1024 if (CHARSET_DIMENSION (cs) == 1) | 1103 if (CHARSET_DIMENSION (cs) == 1) |
1025 { | 1104 { |
1028 ("Charset is of dimension one; second octet must be nil", arg2); | 1107 ("Charset is of dimension one; second octet must be nil", arg2); |
1029 return make_char (MAKE_CHAR (charset, a1, 0)); | 1108 return make_char (MAKE_CHAR (charset, a1, 0)); |
1030 } | 1109 } |
1031 | 1110 |
1032 CHECK_INT (arg2); | 1111 CHECK_INT (arg2); |
1033 a2 = XINT (arg2); | 1112 a2 = XINT (arg2) & 0x7f; |
1034 if (a2 < lowlim || a2 > highlim) | 1113 if (a2 < lowlim || a2 > highlim) |
1035 args_out_of_range_3 (arg2, make_int (lowlim), make_int (highlim)); | 1114 args_out_of_range_3 (arg2, make_int (lowlim), make_int (highlim)); |
1036 | 1115 |
1037 return make_char (MAKE_CHAR (charset, a1, a2)); | 1116 return make_char (MAKE_CHAR (charset, a1, a2)); |
1038 } | 1117 } |
1053 N defaults to 0 if omitted. | 1132 N defaults to 0 if omitted. |
1054 */ | 1133 */ |
1055 (ch, n)) | 1134 (ch, n)) |
1056 { | 1135 { |
1057 Lisp_Object charset; | 1136 Lisp_Object charset; |
1058 int c1, c2, int_n; | 1137 int octet0, octet1; |
1059 | 1138 |
1060 CHECK_CHAR_COERCE_INT (ch); | 1139 CHECK_CHAR_COERCE_INT (ch); |
1061 if (NILP (n)) | 1140 |
1062 int_n = 0; | 1141 BREAKUP_CHAR (XCHAR (ch), charset, octet0, octet1); |
1142 | |
1143 if (NILP (n) || EQ (n, Qzero)) | |
1144 return make_int (octet0); | |
1145 else if (EQ (n, make_int (1))) | |
1146 return make_int (octet1); | |
1147 else | |
1148 signal_simple_error ("Octet number must be 0 or 1", n); | |
1149 } | |
1150 | |
1151 DEFUN ("split-char", Fsplit_char, 1, 1, 0, /* | |
1152 Return list of charset and one or two position-codes of CHAR. | |
1153 */ | |
1154 (character)) | |
1155 { | |
1156 /* This function can GC */ | |
1157 struct gcpro gcpro1, gcpro2; | |
1158 Lisp_Object charset = Qnil; | |
1159 Lisp_Object rc = Qnil; | |
1160 int c1, c2; | |
1161 | |
1162 GCPRO2 (charset, rc); | |
1163 CHECK_CHAR_COERCE_INT (character); | |
1164 | |
1165 BREAKUP_CHAR (XCHAR (character), charset, c1, c2); | |
1166 | |
1167 if (XCHARSET_DIMENSION (Fget_charset (charset)) == 2) | |
1168 { | |
1169 rc = list3 (XCHARSET_NAME (charset), make_int (c1), make_int (c2)); | |
1170 } | |
1063 else | 1171 else |
1064 { | 1172 { |
1065 CHECK_INT (n); | 1173 rc = list2 (XCHARSET_NAME (charset), make_int (c1)); |
1066 int_n = XINT (n); | |
1067 if (int_n != 0 && int_n != 1) | |
1068 signal_simple_error ("Octet number must be 0 or 1", n); | |
1069 } | 1174 } |
1070 BREAKUP_CHAR (XCHAR (ch), charset, c1, c2); | 1175 UNGCPRO; |
1071 return make_int (int_n == 0 ? c1 : c2); | 1176 |
1177 return rc; | |
1072 } | 1178 } |
1073 | 1179 |
1074 | 1180 |
1075 #ifdef ENABLE_COMPOSITE_CHARS | 1181 #ifdef ENABLE_COMPOSITE_CHARS |
1076 /************************************************************************/ | 1182 /************************************************************************/ |
1160 DEFSUBR (Fcharset_name); | 1266 DEFSUBR (Fcharset_name); |
1161 DEFSUBR (Fmake_charset); | 1267 DEFSUBR (Fmake_charset); |
1162 DEFSUBR (Fmake_reverse_direction_charset); | 1268 DEFSUBR (Fmake_reverse_direction_charset); |
1163 /* DEFSUBR (Freverse_direction_charset); */ | 1269 /* DEFSUBR (Freverse_direction_charset); */ |
1164 DEFSUBR (Fcharset_from_attributes); | 1270 DEFSUBR (Fcharset_from_attributes); |
1165 DEFSUBR (Fcharset_doc_string); | 1271 DEFSUBR (Fcharset_short_name); |
1272 DEFSUBR (Fcharset_long_name); | |
1273 DEFSUBR (Fcharset_description); | |
1166 DEFSUBR (Fcharset_dimension); | 1274 DEFSUBR (Fcharset_dimension); |
1167 DEFSUBR (Fcharset_property); | 1275 DEFSUBR (Fcharset_property); |
1168 DEFSUBR (Fcharset_id); | 1276 DEFSUBR (Fcharset_id); |
1169 DEFSUBR (Fset_charset_ccl_program); | 1277 DEFSUBR (Fset_charset_ccl_program); |
1170 DEFSUBR (Fset_charset_registry); | 1278 DEFSUBR (Fset_charset_registry); |
1171 | 1279 |
1172 DEFSUBR (Fmake_char); | 1280 DEFSUBR (Fmake_char); |
1173 DEFSUBR (Fchar_charset); | 1281 DEFSUBR (Fchar_charset); |
1174 DEFSUBR (Fchar_octet); | 1282 DEFSUBR (Fchar_octet); |
1283 DEFSUBR (Fsplit_char); | |
1175 | 1284 |
1176 #ifdef ENABLE_COMPOSITE_CHARS | 1285 #ifdef ENABLE_COMPOSITE_CHARS |
1177 DEFSUBR (Fmake_composite_char); | 1286 DEFSUBR (Fmake_composite_char); |
1178 DEFSUBR (Fcomposite_char_string); | 1287 DEFSUBR (Fcomposite_char_string); |
1179 #endif | 1288 #endif |
1182 defsymbol (&Qregistry, "registry"); | 1291 defsymbol (&Qregistry, "registry"); |
1183 defsymbol (&Qfinal, "final"); | 1292 defsymbol (&Qfinal, "final"); |
1184 defsymbol (&Qgraphic, "graphic"); | 1293 defsymbol (&Qgraphic, "graphic"); |
1185 defsymbol (&Qdirection, "direction"); | 1294 defsymbol (&Qdirection, "direction"); |
1186 defsymbol (&Qreverse_direction_charset, "reverse-direction-charset"); | 1295 defsymbol (&Qreverse_direction_charset, "reverse-direction-charset"); |
1187 defsymbol (&Qccl_program, "ccl-program"); | 1296 defsymbol (&Qshort_name, "short-name"); |
1188 defsymbol (&Qleading_byte, "leading-byte"); | 1297 defsymbol (&Qlong_name, "long-name"); |
1189 | 1298 |
1190 defsymbol (&Ql2r, "l2r"); | 1299 defsymbol (&Ql2r, "l2r"); |
1191 defsymbol (&Qr2l, "r2l"); | 1300 defsymbol (&Qr2l, "r2l"); |
1192 | 1301 |
1193 /* Charsets, compatible with Emacs/Mule 19.33-delta | 1302 /* Charsets, compatible with FSF 20.3 |
1194 Naming convention is Script-Charset[-Edition] */ | 1303 Naming convention is Script-Charset[-Edition] */ |
1195 defsymbol (&Qascii, "ascii"); | 1304 defsymbol (&Qascii, "ascii"); |
1196 defsymbol (&Qcontrol_1, "control-1"); | 1305 defsymbol (&Qcontrol_1, "control-1"); |
1197 defsymbol (&Qlatin_iso8859_1, "latin-iso8859-1"); | 1306 defsymbol (&Qlatin_iso8859_1, "latin-iso8859-1"); |
1198 defsymbol (&Qlatin_iso8859_2, "latin-iso8859-2"); | 1307 defsymbol (&Qlatin_iso8859_2, "latin-iso8859-2"); |
1199 defsymbol (&Qlatin_iso8859_3, "latin-iso8859-3"); | 1308 defsymbol (&Qlatin_iso8859_3, "latin-iso8859-3"); |
1200 defsymbol (&Qlatin_iso8859_4, "latin-iso8859-4"); | 1309 defsymbol (&Qlatin_iso8859_4, "latin-iso8859-4"); |
1201 defsymbol (&Qcyrillic_iso8859_5, "cyrillic-iso8859-5"); | 1310 defsymbol (&Qthai_tis620, "thai-tis620"); |
1311 defsymbol (&Qgreek_iso8859_7, "greek-iso8859-7"); | |
1202 defsymbol (&Qarabic_iso8859_6, "arabic-iso8859-6"); | 1312 defsymbol (&Qarabic_iso8859_6, "arabic-iso8859-6"); |
1203 defsymbol (&Qgreek_iso8859_7, "greek-iso8859-7"); | |
1204 defsymbol (&Qhebrew_iso8859_8, "hebrew-iso8859-8"); | 1313 defsymbol (&Qhebrew_iso8859_8, "hebrew-iso8859-8"); |
1205 defsymbol (&Qlatin_iso8859_9, "latin-iso8859-9"); | |
1206 defsymbol (&Qthai_tis620, "thai-tis620"); | |
1207 | |
1208 defsymbol (&Qkatakana_jisx0201, "katakana-jisx0201"); | 1314 defsymbol (&Qkatakana_jisx0201, "katakana-jisx0201"); |
1209 defsymbol (&Qlatin_jisx0201, "latin-jisx0201"); | 1315 defsymbol (&Qlatin_jisx0201, "latin-jisx0201"); |
1316 defsymbol (&Qcyrillic_iso8859_5, "cyrillic-iso8859-5"); | |
1317 defsymbol (&Qlatin_iso8859_9, "latin-iso8859-9"); | |
1210 defsymbol (&Qjapanese_jisx0208_1978, "japanese-jisx0208-1978"); | 1318 defsymbol (&Qjapanese_jisx0208_1978, "japanese-jisx0208-1978"); |
1319 defsymbol (&Qchinese_gb2312, "chinese-gb2312"); | |
1211 defsymbol (&Qjapanese_jisx0208, "japanese-jisx0208"); | 1320 defsymbol (&Qjapanese_jisx0208, "japanese-jisx0208"); |
1321 defsymbol (&Qkorean_ksc5601, "korean-ksc5601"); | |
1212 defsymbol (&Qjapanese_jisx0212, "japanese-jisx0212"); | 1322 defsymbol (&Qjapanese_jisx0212, "japanese-jisx0212"); |
1213 | 1323 defsymbol (&Qchinese_cns11643_1, "chinese-cns11643-1"); |
1214 defsymbol (&Qchinese_gb2312, "chinese-gb2312"); | 1324 defsymbol (&Qchinese_cns11643_2, "chinese-cns11643-2"); |
1215 defsymbol (&Qchinese_big5_1, "chinese-big5-1"); | 1325 defsymbol (&Qchinese_big5_1, "chinese-big5-1"); |
1216 defsymbol (&Qchinese_big5_2, "chinese-big5-2"); | 1326 defsymbol (&Qchinese_big5_2, "chinese-big5-2"); |
1217 defsymbol (&Qchinese_cns11643_1, "chinese-cns11643-1"); | 1327 |
1218 defsymbol (&Qchinese_cns11643_2, "chinese-cns11643-2"); | |
1219 | |
1220 defsymbol (&Qkorean_ksc5601, "korean-ksc5601"); | |
1221 defsymbol (&Qcomposite, "composite"); | 1328 defsymbol (&Qcomposite, "composite"); |
1222 } | 1329 } |
1223 | 1330 |
1224 void | 1331 void |
1225 vars_of_mule_charset (void) | 1332 vars_of_mule_charset (void) |
1226 { | 1333 { |
1227 int i, j, k; | 1334 int i, j, k; |
1228 | 1335 |
1336 chlook = xnew (struct charset_lookup); | |
1337 dumpstruct (&chlook, &charset_lookup_description); | |
1338 | |
1229 /* Table of charsets indexed by leading byte. */ | 1339 /* Table of charsets indexed by leading byte. */ |
1230 for (i = 0; i < countof (charset_by_leading_byte); i++) | 1340 for (i = 0; i < countof (chlook->charset_by_leading_byte); i++) |
1231 charset_by_leading_byte[i] = Qnil; | 1341 chlook->charset_by_leading_byte[i] = Qnil; |
1232 | 1342 |
1233 /* Table of charsets indexed by type/final-byte/direction. */ | 1343 /* Table of charsets indexed by type/final-byte/direction. */ |
1234 for (i = 0; i < countof (charset_by_attributes); i++) | 1344 for (i = 0; i < countof (chlook->charset_by_attributes); i++) |
1235 for (j = 0; j < countof (charset_by_attributes[0]); j++) | 1345 for (j = 0; j < countof (chlook->charset_by_attributes[0]); j++) |
1236 for (k = 0; k < countof (charset_by_attributes[0][0]); k++) | 1346 for (k = 0; k < countof (chlook->charset_by_attributes[0][0]); k++) |
1237 charset_by_attributes[i][j][k] = Qnil; | 1347 chlook->charset_by_attributes[i][j][k] = Qnil; |
1238 | 1348 |
1239 next_allocated_1_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_1; | 1349 next_allocated_1_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_1; |
1240 next_allocated_2_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_2; | 1350 next_allocated_2_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_2; |
1241 } | 1351 } |
1242 | 1352 |
1248 make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); | 1358 make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); |
1249 | 1359 |
1250 /* Predefined character sets. We store them into variables for | 1360 /* Predefined character sets. We store them into variables for |
1251 ease of access. */ | 1361 ease of access. */ |
1252 | 1362 |
1363 staticpro (&Vcharset_ascii); | |
1253 Vcharset_ascii = | 1364 Vcharset_ascii = |
1254 make_charset (0, Qascii, LEADING_BYTE_ASCII, 1, | 1365 make_charset (LEADING_BYTE_ASCII, Qascii, 1, |
1255 CHARSET_TYPE_94, 1, 0, 'B', | 1366 CHARSET_TYPE_94, 1, 0, 'B', |
1256 CHARSET_LEFT_TO_RIGHT, | 1367 CHARSET_LEFT_TO_RIGHT, |
1257 build_string ("ASCII (ISO 646 IRV)"), | 1368 build_string ("ASCII"), |
1369 build_string ("ASCII)"), | |
1370 build_string ("ASCII (ISO646 IRV)"), | |
1371 build_string ("\\(iso8859-[0-9]*\\|-ascii\\)")); | |
1372 staticpro (&Vcharset_control_1); | |
1373 Vcharset_control_1 = | |
1374 make_charset (LEADING_BYTE_CONTROL_1, Qcontrol_1, 2, | |
1375 CHARSET_TYPE_94, 1, 1, 0, | |
1376 CHARSET_LEFT_TO_RIGHT, | |
1377 build_string ("C1"), | |
1378 build_string ("Control characters"), | |
1379 build_string ("Control characters 128-191"), | |
1380 build_string ("")); | |
1381 staticpro (&Vcharset_latin_iso8859_1); | |
1382 Vcharset_latin_iso8859_1 = | |
1383 make_charset (LEADING_BYTE_LATIN_ISO8859_1, Qlatin_iso8859_1, 2, | |
1384 CHARSET_TYPE_96, 1, 1, 'A', | |
1385 CHARSET_LEFT_TO_RIGHT, | |
1386 build_string ("Latin-1"), | |
1387 build_string ("ISO8859-1 (Latin-1)"), | |
1388 build_string ("ISO8859-1 (Latin-1)"), | |
1258 build_string ("iso8859-1")); | 1389 build_string ("iso8859-1")); |
1259 Vcharset_control_1 = | 1390 staticpro (&Vcharset_latin_iso8859_2); |
1260 make_charset (-1, Qcontrol_1, LEADING_BYTE_CONTROL_1, 2, | |
1261 CHARSET_TYPE_94, 1, 1, 0, | |
1262 CHARSET_LEFT_TO_RIGHT, | |
1263 build_string ("Control characters"), | |
1264 build_string ("")); | |
1265 Vcharset_latin_iso8859_1 = | |
1266 make_charset (129, Qlatin_iso8859_1, LEADING_BYTE_LATIN_ISO8859_1, 2, | |
1267 CHARSET_TYPE_96, 1, 1, 'A', | |
1268 CHARSET_LEFT_TO_RIGHT, | |
1269 build_string ("ISO 8859-1 (Latin-1)"), | |
1270 build_string ("iso8859-1")); | |
1271 Vcharset_latin_iso8859_2 = | 1391 Vcharset_latin_iso8859_2 = |
1272 make_charset (130, Qlatin_iso8859_2, LEADING_BYTE_LATIN_ISO8859_2, 2, | 1392 make_charset (LEADING_BYTE_LATIN_ISO8859_2, Qlatin_iso8859_2, 2, |
1273 CHARSET_TYPE_96, 1, 1, 'B', | 1393 CHARSET_TYPE_96, 1, 1, 'B', |
1274 CHARSET_LEFT_TO_RIGHT, | 1394 CHARSET_LEFT_TO_RIGHT, |
1275 build_string ("ISO 8859-2 (Latin-2)"), | 1395 build_string ("Latin-2"), |
1396 build_string ("ISO8859-2 (Latin-2)"), | |
1397 build_string ("ISO8859-2 (Latin-2)"), | |
1276 build_string ("iso8859-2")); | 1398 build_string ("iso8859-2")); |
1399 staticpro (&Vcharset_latin_iso8859_3); | |
1277 Vcharset_latin_iso8859_3 = | 1400 Vcharset_latin_iso8859_3 = |
1278 make_charset (131, Qlatin_iso8859_3, LEADING_BYTE_LATIN_ISO8859_3, 2, | 1401 make_charset (LEADING_BYTE_LATIN_ISO8859_3, Qlatin_iso8859_3, 2, |
1279 CHARSET_TYPE_96, 1, 1, 'C', | 1402 CHARSET_TYPE_96, 1, 1, 'C', |
1280 CHARSET_LEFT_TO_RIGHT, | 1403 CHARSET_LEFT_TO_RIGHT, |
1281 build_string ("ISO 8859-3 (Latin-3)"), | 1404 build_string ("Latin-3"), |
1405 build_string ("ISO8859-3 (Latin-3)"), | |
1406 build_string ("ISO8859-3 (Latin-3)"), | |
1282 build_string ("iso8859-3")); | 1407 build_string ("iso8859-3")); |
1408 staticpro (&Vcharset_latin_iso8859_4); | |
1283 Vcharset_latin_iso8859_4 = | 1409 Vcharset_latin_iso8859_4 = |
1284 make_charset (132, Qlatin_iso8859_4, LEADING_BYTE_LATIN_ISO8859_4, 2, | 1410 make_charset (LEADING_BYTE_LATIN_ISO8859_4, Qlatin_iso8859_4, 2, |
1285 CHARSET_TYPE_96, 1, 1, 'D', | 1411 CHARSET_TYPE_96, 1, 1, 'D', |
1286 CHARSET_LEFT_TO_RIGHT, | 1412 CHARSET_LEFT_TO_RIGHT, |
1287 build_string ("ISO 8859-4 (Latin-4)"), | 1413 build_string ("Latin-4"), |
1414 build_string ("ISO8859-4 (Latin-4)"), | |
1415 build_string ("ISO8859-4 (Latin-4)"), | |
1288 build_string ("iso8859-4")); | 1416 build_string ("iso8859-4")); |
1289 Vcharset_cyrillic_iso8859_5 = | 1417 staticpro (&Vcharset_thai_tis620); |
1290 make_charset (140, Qcyrillic_iso8859_5, LEADING_BYTE_CYRILLIC_ISO8859_5, 2, | 1418 Vcharset_thai_tis620 = |
1291 CHARSET_TYPE_96, 1, 1, 'L', | 1419 make_charset (LEADING_BYTE_THAI_TIS620, Qthai_tis620, 2, |
1292 CHARSET_LEFT_TO_RIGHT, | 1420 CHARSET_TYPE_96, 1, 1, 'T', |
1293 build_string ("ISO 8859-5 (Cyrillic)"), | 1421 CHARSET_LEFT_TO_RIGHT, |
1294 build_string ("iso8859-5")); | 1422 build_string ("TIS620"), |
1423 build_string ("TIS620 (Thai)"), | |
1424 build_string ("TIS620.2529 (Thai)"), | |
1425 build_string ("tis620")); | |
1426 staticpro (&Vcharset_greek_iso8859_7); | |
1427 Vcharset_greek_iso8859_7 = | |
1428 make_charset (LEADING_BYTE_GREEK_ISO8859_7, Qgreek_iso8859_7, 2, | |
1429 CHARSET_TYPE_96, 1, 1, 'F', | |
1430 CHARSET_LEFT_TO_RIGHT, | |
1431 build_string ("ISO8859-7"), | |
1432 build_string ("ISO8859-7 (Greek)"), | |
1433 build_string ("ISO8859-7 (Greek)"), | |
1434 build_string ("iso8859-7")); | |
1435 staticpro (&Vcharset_arabic_iso8859_6); | |
1295 Vcharset_arabic_iso8859_6 = | 1436 Vcharset_arabic_iso8859_6 = |
1296 make_charset (135, Qarabic_iso8859_6, LEADING_BYTE_ARABIC_ISO8859_6, 2, | 1437 make_charset (LEADING_BYTE_ARABIC_ISO8859_6, Qarabic_iso8859_6, 2, |
1297 CHARSET_TYPE_96, 1, 1, 'G', | 1438 CHARSET_TYPE_96, 1, 1, 'G', |
1298 CHARSET_RIGHT_TO_LEFT, | 1439 CHARSET_RIGHT_TO_LEFT, |
1299 build_string ("ISO 8859-6 (Arabic)"), | 1440 build_string ("ISO8859-6"), |
1441 build_string ("ISO8859-6 (Arabic)"), | |
1442 build_string ("ISO8859-6 (Arabic)"), | |
1300 build_string ("iso8859-6")); | 1443 build_string ("iso8859-6")); |
1301 Vcharset_greek_iso8859_7 = | 1444 staticpro (&Vcharset_hebrew_iso8859_8); |
1302 make_charset (134, Qgreek_iso8859_7, LEADING_BYTE_GREEK_ISO8859_7, 2, | |
1303 CHARSET_TYPE_96, 1, 1, 'F', | |
1304 CHARSET_LEFT_TO_RIGHT, | |
1305 build_string ("ISO 8859-7 (Greek)"), | |
1306 build_string ("iso8859-7")); | |
1307 Vcharset_hebrew_iso8859_8 = | 1445 Vcharset_hebrew_iso8859_8 = |
1308 make_charset (136, Qhebrew_iso8859_8, LEADING_BYTE_HEBREW_ISO8859_8, 2, | 1446 make_charset (LEADING_BYTE_HEBREW_ISO8859_8, Qhebrew_iso8859_8, 2, |
1309 CHARSET_TYPE_96, 1, 1, 'H', | 1447 CHARSET_TYPE_96, 1, 1, 'H', |
1310 CHARSET_RIGHT_TO_LEFT, | 1448 CHARSET_RIGHT_TO_LEFT, |
1311 build_string ("ISO 8859-8 (Hebrew)"), | 1449 build_string ("ISO8859-8"), |
1450 build_string ("ISO8859-8 (Hebrew)"), | |
1451 build_string ("ISO8859-8 (Hebrew)"), | |
1312 build_string ("iso8859-8")); | 1452 build_string ("iso8859-8")); |
1453 staticpro (&Vcharset_katakana_jisx0201); | |
1454 Vcharset_katakana_jisx0201 = | |
1455 make_charset (LEADING_BYTE_KATAKANA_JISX0201, Qkatakana_jisx0201, 2, | |
1456 CHARSET_TYPE_94, 1, 1, 'I', | |
1457 CHARSET_LEFT_TO_RIGHT, | |
1458 build_string ("JISX0201 Kana"), | |
1459 build_string ("JISX0201.1976 (Japanese Kana)"), | |
1460 build_string ("JISX0201.1976 Japanese Kana"), | |
1461 build_string ("jisx0201.1976")); | |
1462 staticpro (&Vcharset_latin_jisx0201); | |
1463 Vcharset_latin_jisx0201 = | |
1464 make_charset (LEADING_BYTE_LATIN_JISX0201, Qlatin_jisx0201, 2, | |
1465 CHARSET_TYPE_94, 1, 0, 'J', | |
1466 CHARSET_LEFT_TO_RIGHT, | |
1467 build_string ("JISX0201 Roman"), | |
1468 build_string ("JISX0201.1976 (Japanese Roman)"), | |
1469 build_string ("JISX0201.1976 Japanese Roman"), | |
1470 build_string ("jisx0201.1976")); | |
1471 staticpro (&Vcharset_cyrillic_iso8859_5); | |
1472 Vcharset_cyrillic_iso8859_5 = | |
1473 make_charset (LEADING_BYTE_CYRILLIC_ISO8859_5, Qcyrillic_iso8859_5, 2, | |
1474 CHARSET_TYPE_96, 1, 1, 'L', | |
1475 CHARSET_LEFT_TO_RIGHT, | |
1476 build_string ("ISO8859-5"), | |
1477 build_string ("ISO8859-5 (Cyrillic)"), | |
1478 build_string ("ISO8859-5 (Cyrillic)"), | |
1479 build_string ("iso8859-5")); | |
1480 staticpro (&Vcharset_latin_iso8859_9); | |
1313 Vcharset_latin_iso8859_9 = | 1481 Vcharset_latin_iso8859_9 = |
1314 make_charset (141, Qlatin_iso8859_9, LEADING_BYTE_LATIN_ISO8859_9, 2, | 1482 make_charset (LEADING_BYTE_LATIN_ISO8859_9, Qlatin_iso8859_9, 2, |
1315 CHARSET_TYPE_96, 1, 1, 'M', | 1483 CHARSET_TYPE_96, 1, 1, 'M', |
1316 CHARSET_LEFT_TO_RIGHT, | 1484 CHARSET_LEFT_TO_RIGHT, |
1317 build_string ("ISO 8859-9 (Latin-5)"), | 1485 build_string ("Latin-5"), |
1486 build_string ("ISO8859-9 (Latin-5)"), | |
1487 build_string ("ISO8859-9 (Latin-5)"), | |
1318 build_string ("iso8859-9")); | 1488 build_string ("iso8859-9")); |
1319 Vcharset_thai_tis620 = | 1489 staticpro (&Vcharset_japanese_jisx0208_1978); |
1320 make_charset (133, Qthai_tis620, LEADING_BYTE_THAI_TIS620, 2, | |
1321 CHARSET_TYPE_96, 1, 1, 'T', | |
1322 CHARSET_LEFT_TO_RIGHT, | |
1323 build_string ("TIS 620.2529 (Thai)"), | |
1324 build_string ("tis620")); | |
1325 | |
1326 /* Japanese */ | |
1327 Vcharset_katakana_jisx0201 = | |
1328 make_charset (137, Qkatakana_jisx0201, | |
1329 LEADING_BYTE_KATAKANA_JISX0201, 2, | |
1330 CHARSET_TYPE_94, 1, 1, 'I', | |
1331 CHARSET_LEFT_TO_RIGHT, | |
1332 build_string ("JIS X0201-Katakana"), | |
1333 build_string ("jisx0201.1976")); | |
1334 Vcharset_latin_jisx0201 = | |
1335 make_charset (138, Qlatin_jisx0201, | |
1336 LEADING_BYTE_LATIN_JISX0201, 2, | |
1337 CHARSET_TYPE_94, 1, 0, 'J', | |
1338 CHARSET_LEFT_TO_RIGHT, | |
1339 build_string ("JIS X0201-Latin"), | |
1340 build_string ("jisx0201.1976")); | |
1341 Vcharset_japanese_jisx0208_1978 = | 1490 Vcharset_japanese_jisx0208_1978 = |
1342 make_charset (144, Qjapanese_jisx0208_1978, | 1491 make_charset (LEADING_BYTE_JAPANESE_JISX0208_1978, Qjapanese_jisx0208_1978, 3, |
1343 LEADING_BYTE_JAPANESE_JISX0208_1978, 3, | |
1344 CHARSET_TYPE_94X94, 2, 0, '@', | 1492 CHARSET_TYPE_94X94, 2, 0, '@', |
1345 CHARSET_LEFT_TO_RIGHT, | 1493 CHARSET_LEFT_TO_RIGHT, |
1494 build_string ("JISX0208.1978"), | |
1495 build_string ("JISX0208.1978 (Japanese)"), | |
1346 build_string | 1496 build_string |
1347 ("JIS X0208-1978 (Japanese Kanji; Old Version)"), | 1497 ("JISX0208.1978 Japanese Kanji (so called \"old JIS\")"), |
1348 build_string ("\\(jisx0208\\|jisc6226\\).19")); | 1498 build_string ("\\(jisx0208\\|jisc6226\\)\\.1978")); |
1499 staticpro (&Vcharset_chinese_gb2312); | |
1500 Vcharset_chinese_gb2312 = | |
1501 make_charset (LEADING_BYTE_CHINESE_GB2312, Qchinese_gb2312, 3, | |
1502 CHARSET_TYPE_94X94, 2, 0, 'A', | |
1503 CHARSET_LEFT_TO_RIGHT, | |
1504 build_string ("GB2312"), | |
1505 build_string ("GB2312)"), | |
1506 build_string ("GB2312 Chinese simplified"), | |
1507 build_string ("gb2312")); | |
1508 staticpro (&Vcharset_japanese_jisx0208); | |
1349 Vcharset_japanese_jisx0208 = | 1509 Vcharset_japanese_jisx0208 = |
1350 make_charset (146, Qjapanese_jisx0208, | 1510 make_charset (LEADING_BYTE_JAPANESE_JISX0208, Qjapanese_jisx0208, 3, |
1351 LEADING_BYTE_JAPANESE_JISX0208, 3, | |
1352 CHARSET_TYPE_94X94, 2, 0, 'B', | 1511 CHARSET_TYPE_94X94, 2, 0, 'B', |
1353 CHARSET_LEFT_TO_RIGHT, | 1512 CHARSET_LEFT_TO_RIGHT, |
1354 build_string ("JIS X0208-1983 (Japanese Kanji)"), | 1513 build_string ("JISX0208"), |
1514 build_string ("JISX0208.1983/1990 (Japanese)"), | |
1515 build_string ("JISX0208.1983/1990 Japanese Kanji"), | |
1355 build_string ("jisx0208.19\\(83\\|90\\)")); | 1516 build_string ("jisx0208.19\\(83\\|90\\)")); |
1517 staticpro (&Vcharset_korean_ksc5601); | |
1518 Vcharset_korean_ksc5601 = | |
1519 make_charset (LEADING_BYTE_KOREAN_KSC5601, Qkorean_ksc5601, 3, | |
1520 CHARSET_TYPE_94X94, 2, 0, 'C', | |
1521 CHARSET_LEFT_TO_RIGHT, | |
1522 build_string ("KSC5601"), | |
1523 build_string ("KSC5601 (Korean"), | |
1524 build_string ("KSC5601 Korean Hangul and Hanja"), | |
1525 build_string ("ksc5601")); | |
1526 staticpro (&Vcharset_japanese_jisx0212); | |
1356 Vcharset_japanese_jisx0212 = | 1527 Vcharset_japanese_jisx0212 = |
1357 make_charset (148, Qjapanese_jisx0212, | 1528 make_charset (LEADING_BYTE_JAPANESE_JISX0212, Qjapanese_jisx0212, 3, |
1358 LEADING_BYTE_JAPANESE_JISX0212, 3, | |
1359 CHARSET_TYPE_94X94, 2, 0, 'D', | 1529 CHARSET_TYPE_94X94, 2, 0, 'D', |
1360 CHARSET_LEFT_TO_RIGHT, | 1530 CHARSET_LEFT_TO_RIGHT, |
1361 build_string ("JIS X0212 (Japanese Supplement)"), | 1531 build_string ("JISX0212"), |
1532 build_string ("JISX0212 (Japanese)"), | |
1533 build_string ("JISX0212 Japanese Supplement"), | |
1362 build_string ("jisx0212")); | 1534 build_string ("jisx0212")); |
1363 | 1535 |
1364 /* Chinese */ | |
1365 Vcharset_chinese_gb2312 = | |
1366 make_charset (145, Qchinese_gb2312, LEADING_BYTE_CHINESE_GB2312, 3, | |
1367 CHARSET_TYPE_94X94, 2, 0, 'A', | |
1368 CHARSET_LEFT_TO_RIGHT, | |
1369 build_string ("GB 2312 (Simplified Chinese)"), | |
1370 build_string ("gb2312")); | |
1371 #define CHINESE_CNS_PLANE_RE(n) "cns11643[.-]\\(.*[.-]\\)?" n "$" | 1536 #define CHINESE_CNS_PLANE_RE(n) "cns11643[.-]\\(.*[.-]\\)?" n "$" |
1537 staticpro (&Vcharset_chinese_cns11643_1); | |
1372 Vcharset_chinese_cns11643_1 = | 1538 Vcharset_chinese_cns11643_1 = |
1373 make_charset (149, Qchinese_cns11643_1, | 1539 make_charset (LEADING_BYTE_CHINESE_CNS11643_1, Qchinese_cns11643_1, 3, |
1374 LEADING_BYTE_CHINESE_CNS11643_1, 3, | |
1375 CHARSET_TYPE_94X94, 2, 0, 'G', | 1540 CHARSET_TYPE_94X94, 2, 0, 'G', |
1376 CHARSET_LEFT_TO_RIGHT, | 1541 CHARSET_LEFT_TO_RIGHT, |
1542 build_string ("CNS11643-1"), | |
1543 build_string ("CNS11643-1 (Chinese traditional)"), | |
1377 build_string | 1544 build_string |
1378 ("CNS 11643 Plane 1 (Traditional Chinese for daily use)"), | 1545 ("CNS 11643 Plane 1 Chinese traditional"), |
1379 build_string (CHINESE_CNS_PLANE_RE("1"))); | 1546 build_string (CHINESE_CNS_PLANE_RE("1"))); |
1547 staticpro (&Vcharset_chinese_cns11643_2); | |
1380 Vcharset_chinese_cns11643_2 = | 1548 Vcharset_chinese_cns11643_2 = |
1381 make_charset (150, Qchinese_cns11643_2, | 1549 make_charset (LEADING_BYTE_CHINESE_CNS11643_2, Qchinese_cns11643_2, 3, |
1382 LEADING_BYTE_CHINESE_CNS11643_2, 3, | |
1383 CHARSET_TYPE_94X94, 2, 0, 'H', | 1550 CHARSET_TYPE_94X94, 2, 0, 'H', |
1384 CHARSET_LEFT_TO_RIGHT, | 1551 CHARSET_LEFT_TO_RIGHT, |
1552 build_string ("CNS11643-2"), | |
1553 build_string ("CNS11643-2 (Chinese traditional)"), | |
1385 build_string | 1554 build_string |
1386 ("CNS 11643 Plane 2 (Traditional Chinese for daily use)"), | 1555 ("CNS 11643 Plane 2 Chinese traditional"), |
1387 build_string (CHINESE_CNS_PLANE_RE("2"))); | 1556 build_string (CHINESE_CNS_PLANE_RE("2"))); |
1557 staticpro (&Vcharset_chinese_big5_1); | |
1388 Vcharset_chinese_big5_1 = | 1558 Vcharset_chinese_big5_1 = |
1389 make_charset (152, Qchinese_big5_1, LEADING_BYTE_CHINESE_BIG5_1, 3, | 1559 make_charset (LEADING_BYTE_CHINESE_BIG5_1, Qchinese_big5_1, 3, |
1390 CHARSET_TYPE_94X94, 2, 0, '0', | 1560 CHARSET_TYPE_94X94, 2, 0, '0', |
1391 CHARSET_LEFT_TO_RIGHT, | 1561 CHARSET_LEFT_TO_RIGHT, |
1562 build_string ("Big5"), | |
1563 build_string ("Big5 (Level-1)"), | |
1392 build_string | 1564 build_string |
1393 ("Big5 Level 1 (Traditional Chinese for daily use)"), | 1565 ("Big5 Level-1 Chinese traditional"), |
1394 build_string ("big5")); | 1566 build_string ("big5")); |
1567 staticpro (&Vcharset_chinese_big5_2); | |
1395 Vcharset_chinese_big5_2 = | 1568 Vcharset_chinese_big5_2 = |
1396 make_charset (153, Qchinese_big5_2, LEADING_BYTE_CHINESE_BIG5_2, 3, | 1569 make_charset (LEADING_BYTE_CHINESE_BIG5_2, Qchinese_big5_2, 3, |
1397 CHARSET_TYPE_94X94, 2, 0, '1', | 1570 CHARSET_TYPE_94X94, 2, 0, '1', |
1398 CHARSET_LEFT_TO_RIGHT, | 1571 CHARSET_LEFT_TO_RIGHT, |
1572 build_string ("Big5"), | |
1573 build_string ("Big5 (Level-2)"), | |
1399 build_string | 1574 build_string |
1400 ("Big5 Level 2 (Traditional Chinese for daily use)"), | 1575 ("Big5 Level-2 Chinese traditional"), |
1401 build_string ("big5")); | 1576 build_string ("big5")); |
1402 | 1577 |
1403 Vcharset_korean_ksc5601 = | |
1404 make_charset (147, Qkorean_ksc5601, LEADING_BYTE_KOREAN_KSC5601, 3, | |
1405 CHARSET_TYPE_94X94, 2, 0, 'C', | |
1406 CHARSET_LEFT_TO_RIGHT, | |
1407 build_string ("KS C5601 (Hangul and Korean Hanja)"), | |
1408 build_string ("ksc5601")); | |
1409 | 1578 |
1410 #ifdef ENABLE_COMPOSITE_CHARS | 1579 #ifdef ENABLE_COMPOSITE_CHARS |
1411 /* #### For simplicity, we put composite chars into a 96x96 charset. | 1580 /* #### For simplicity, we put composite chars into a 96x96 charset. |
1412 This is going to lead to problems because you can run out of | 1581 This is going to lead to problems because you can run out of |
1413 room, esp. as we don't yet recycle numbers. */ | 1582 room, esp. as we don't yet recycle numbers. */ |
1583 staticpro (&Vcharset_composite); | |
1414 Vcharset_composite = | 1584 Vcharset_composite = |
1415 make_charset (-1, Qcomposite, LEADING_BYTE_COMPOSITE, 3, | 1585 make_charset (LEADING_BYTE_COMPOSITE, Qcomposite, 3, |
1416 CHARSET_TYPE_96X96, 2, 0, 0, | 1586 CHARSET_TYPE_96X96, 2, 0, 0, |
1417 CHARSET_LEFT_TO_RIGHT, | 1587 CHARSET_LEFT_TO_RIGHT, |
1588 build_string ("Composite"), | |
1589 build_string ("Composite characters"), | |
1418 build_string ("Composite characters"), | 1590 build_string ("Composite characters"), |
1419 build_string ("")); | 1591 build_string ("")); |
1420 | 1592 |
1593 /* #### not dumped properly */ | |
1421 composite_char_row_next = 32; | 1594 composite_char_row_next = 32; |
1422 composite_char_col_next = 32; | 1595 composite_char_col_next = 32; |
1423 | 1596 |
1424 Vcomposite_char_string2char_hash_table = | 1597 Vcomposite_char_string2char_hash_table = |
1425 make_lisp_hash_table (500, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL); | 1598 make_lisp_hash_table (500, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL); |