70
|
1 /* Functions to handle multilingual characters.
|
|
2 Copyright (C) 1992, 1995 Free Software Foundation, Inc.
|
|
3 Copyright (C) 1995 Sun Microsystems, Inc.
|
|
4
|
|
5 This file is part of XEmacs.
|
|
6
|
|
7 XEmacs is free software; you can redistribute it and/or modify it
|
|
8 under the terms of the GNU General Public License as published by the
|
|
9 Free Software Foundation; either version 2, or (at your option) any
|
|
10 later version.
|
|
11
|
|
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
15 for more details.
|
|
16
|
|
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
|
|
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
20 Boston, MA 02111-1307, USA. */
|
|
21
|
|
22 /* Synched up with: Mule 2.3. Not in FSF. */
|
|
23
|
|
24 /* Rewritten by Ben Wing <wing@666.com>. */
|
|
25
|
|
26 #include <config.h>
|
|
27 #include "lisp.h"
|
|
28
|
|
29 #include "buffer.h"
|
|
30 #include "chartab.h"
|
|
31 #include "elhash.h"
|
|
32 #include "lstream.h"
|
|
33 #include "device.h"
|
|
34 #include "faces.h"
|
|
35
|
|
36 /* The various pre-defined charsets. */
|
|
37
|
|
38 Lisp_Object Vcharset_ascii;
|
|
39 Lisp_Object Vcharset_control_1;
|
74
|
40 Lisp_Object Vcharset_latin_iso8859_1;
|
|
41 Lisp_Object Vcharset_latin_iso8859_2;
|
|
42 Lisp_Object Vcharset_latin_iso8859_3;
|
|
43 Lisp_Object Vcharset_latin_iso8859_4;
|
|
44 Lisp_Object Vcharset_cyrillic_iso8859_5;
|
|
45 Lisp_Object Vcharset_arabic_iso8859_6;
|
|
46 Lisp_Object Vcharset_greek_iso8859_7;
|
|
47 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;
|
|
51 Lisp_Object Vcharset_latin_jisx0201;
|
70
|
52 Lisp_Object Vcharset_japanese_jisx0208_1978;
|
|
53 Lisp_Object Vcharset_japanese_jisx0208;
|
|
54 Lisp_Object Vcharset_japanese_jisx0212;
|
74
|
55 Lisp_Object Vcharset_chinese_gb2312;
|
70
|
56 Lisp_Object Vcharset_chinese_big5_1;
|
|
57 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 Lisp_Object Vcharset_composite;
|
|
62
|
|
63 /* Hashtables for composite chars. One maps string representing
|
|
64 composed chars to their equivalent chars; one goes the
|
|
65 other way. */
|
|
66 Lisp_Object Vcomposite_char_char2string_hashtable;
|
|
67 Lisp_Object Vcomposite_char_string2char_hashtable;
|
|
68
|
|
69 /* Table of charsets indexed by leading byte. */
|
|
70 Lisp_Object charset_by_leading_byte[128];
|
|
71
|
|
72 /* Table of charsets indexed by type/final-byte/direction. */
|
|
73 Lisp_Object charset_by_attributes[4][128][2];
|
|
74
|
|
75 static int composite_char_row_next;
|
|
76 static int composite_char_col_next;
|
|
77
|
|
78 /* Table of number of bytes in the string representation of a character
|
|
79 indexed by the first byte of that representation.
|
|
80
|
183
|
81 rep_bytes_by_first_byte(c) is more efficient than the equivalent
|
|
82 canonical computation:
|
70
|
83
|
183
|
84 (BYTE_ASCII_P (c) ? 1 : XCHARSET_REP_BYTES (CHARSET_BY_LEADING_BYTE (c))) */
|
70
|
85
|
|
86 Bytecount rep_bytes_by_first_byte[0xA0] =
|
183
|
87 { /* 0x00 - 0x7f are for straight ASCII */
|
70
|
88 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
89 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
90 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
91 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
92 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,
|
|
94 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,
|
183
|
96 /* 0x80 - 0x8f are for Dimension-1 official charsets */
|
70
|
97 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
183
|
98 /* 0x90 - 0x9d are for Dimension-2 official charsets */
|
|
99 /* 0x9e is for Dimension-1 private charsets */
|
|
100 /* 0x9f is for Dimension-2 private charsets */
|
70
|
101 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4
|
|
102 };
|
|
103
|
|
104 Lisp_Object Qcharsetp;
|
|
105
|
|
106 /* Qdoc_string, Qdimension, Qchars defined in general.c */
|
|
107 Lisp_Object Qregistry, Qfinal, Qgraphic;
|
|
108 Lisp_Object Qdirection;
|
|
109 Lisp_Object Qreverse_direction_charset;
|
|
110 Lisp_Object Qccl_program;
|
|
111
|
74
|
112 Lisp_Object Qascii, Qcontrol_1,
|
183
|
113
|
74
|
114 Qlatin_iso8859_1,
|
|
115 Qlatin_iso8859_2,
|
|
116 Qlatin_iso8859_3,
|
|
117 Qlatin_iso8859_4,
|
|
118 Qcyrillic_iso8859_5,
|
|
119 Qarabic_iso8859_6,
|
|
120 Qgreek_iso8859_7,
|
|
121 Qhebrew_iso8859_8,
|
|
122 Qlatin_iso8859_9,
|
183
|
123
|
74
|
124 Qthai_tis620,
|
183
|
125
|
74
|
126 Qkatakana_jisx0201, Qlatin_jisx0201,
|
70
|
127 Qjapanese_jisx0208_1978,
|
|
128 Qjapanese_jisx0208,
|
|
129 Qjapanese_jisx0212,
|
183
|
130
|
74
|
131 Qchinese_gb2312,
|
|
132 Qchinese_big5_1, Qchinese_big5_2,
|
70
|
133 Qchinese_cns11643_1, Qchinese_cns11643_2,
|
183
|
134
|
70
|
135 Qkorean_ksc5601, Qcomposite;
|
|
136
|
|
137 Lisp_Object Ql2r, Qr2l;
|
|
138
|
|
139 Lisp_Object Vcharset_hashtable;
|
|
140
|
|
141 static Bufbyte next_allocated_1_byte_leading_byte;
|
|
142 static Bufbyte next_allocated_2_byte_leading_byte;
|
|
143
|
|
144 /* Composite characters are characters constructed by overstriking two
|
|
145 or more regular characters.
|
|
146
|
|
147 1) The old Mule implementation involves storing composite characters
|
|
148 in a buffer as a tag followed by all of the actual characters
|
|
149 used to make up the composite character. I think this is a bad
|
|
150 idea; it greatly complicates code that wants to handle strings
|
|
151 one character at a time because it has to deal with the possibility
|
|
152 of great big ungainly characters. It's much more reasonable to
|
|
153 simply store an index into a table of composite characters.
|
|
154
|
|
155 2) The current implementation only allows for 16,384 separate
|
|
156 composite characters over the lifetime of the XEmacs process.
|
|
157 This could become a potential problem if the user
|
|
158 edited lots of different files that use composite characters.
|
|
159 Due to FSF bogosity, increasing the number of allowable
|
|
160 composite characters under Mule would decrease the number
|
|
161 of possible faces that can exist. Mule already has shrunk
|
|
162 this to 2048, and further shrinkage would become uncomfortable.
|
|
163 No such problems exist in XEmacs.
|
|
164
|
|
165 Composite characters could be represented as 0x80 C1 C2 C3,
|
|
166 where each C[1-3] is in the range 0xA0 - 0xFF. This allows
|
|
167 for slightly under 2^20 (one million) composite characters
|
|
168 over the XEmacs process lifetime, and you only need to
|
|
169 increase the size of a Mule character from 19 to 21 bits.
|
|
170 Or you could use 0x80 C1 C2 C3 C4, allowing for about
|
|
171 85 million (slightly over 2^26) composite characters. */
|
|
172
|
|
173
|
|
174 /************************************************************************/
|
|
175 /* Basic Emchar functions */
|
|
176 /************************************************************************/
|
|
177
|
|
178 /* Convert a non-ASCII Mule character C into a one-character Mule-encoded
|
|
179 string in STR. Returns the number of bytes stored.
|
|
180 Do not call this directly. Use the macro set_charptr_emchar() instead.
|
|
181 */
|
|
182
|
|
183 Bytecount
|
|
184 non_ascii_set_charptr_emchar (Bufbyte *str, Emchar c)
|
|
185 {
|
|
186 Bufbyte *p;
|
|
187 Bufbyte lb;
|
|
188 int c1, c2;
|
|
189 Lisp_Object charset;
|
|
190
|
|
191 p = str;
|
|
192 BREAKUP_CHAR (c, charset, c1, c2);
|
|
193 lb = CHAR_LEADING_BYTE (c);
|
|
194 if (LEADING_BYTE_PRIVATE_P (lb))
|
|
195 *p++ = PRIVATE_LEADING_BYTE_PREFIX (lb);
|
|
196 *p++ = lb;
|
|
197 if (EQ (charset, Vcharset_control_1))
|
|
198 c1 += 0x20;
|
|
199 *p++ = c1 | 0x80;
|
|
200 if (c2)
|
|
201 *p++ = c2 | 0x80;
|
|
202
|
|
203 return (p - str);
|
|
204 }
|
|
205
|
|
206 /* Return the first character from a Mule-encoded string in STR,
|
|
207 assuming it's non-ASCII. Do not call this directly.
|
|
208 Use the macro charptr_emchar() instead. */
|
|
209
|
|
210 Emchar
|
|
211 non_ascii_charptr_emchar (CONST Bufbyte *str)
|
|
212 {
|
|
213 Bufbyte i0 = *str, i1, i2 = 0;
|
|
214 Lisp_Object charset;
|
|
215
|
|
216 if (i0 == LEADING_BYTE_CONTROL_1)
|
|
217 return (Emchar) (*++str - 0x20);
|
|
218
|
|
219 if (LEADING_BYTE_PREFIX_P (i0))
|
|
220 i0 = *++str;
|
|
221
|
|
222 i1 = *++str & 0x7F;
|
|
223
|
|
224 charset = CHARSET_BY_LEADING_BYTE (i0);
|
|
225 if (XCHARSET_DIMENSION (charset) == 2)
|
|
226 i2 = *++str & 0x7F;
|
|
227
|
|
228 return MAKE_CHAR (charset, i1, i2);
|
|
229 }
|
|
230
|
|
231 /* Return whether CH is a valid Emchar, assuming it's non-ASCII.
|
|
232 Do not call this directly. Use the macro valid_char_p() instead. */
|
|
233
|
|
234 int
|
|
235 non_ascii_valid_char_p (Emchar ch)
|
|
236 {
|
|
237 int f1, f2, f3;
|
|
238
|
|
239 /* Must have only lowest 19 bits set */
|
|
240 if (ch & ~0x7FFFF)
|
|
241 return 0;
|
|
242
|
|
243 f1 = CHAR_FIELD1 (ch);
|
|
244 f2 = CHAR_FIELD2 (ch);
|
|
245 f3 = CHAR_FIELD3 (ch);
|
|
246
|
|
247 if (f1 == 0)
|
|
248 {
|
|
249 Lisp_Object charset;
|
|
250
|
|
251 if (f2 < MIN_CHAR_FIELD2_OFFICIAL ||
|
|
252 (f2 > MAX_CHAR_FIELD2_OFFICIAL && f2 < MIN_CHAR_FIELD2_PRIVATE) ||
|
|
253 f2 > MAX_CHAR_FIELD2_PRIVATE)
|
|
254 return 0;
|
|
255 if (f3 < 0x20)
|
|
256 return 0;
|
|
257
|
|
258 if (f3 != 0x20 && f3 != 0x7F)
|
|
259 return 1;
|
|
260
|
|
261 /*
|
|
262 NOTE: This takes advantage of the fact that
|
|
263 FIELD2_TO_OFFICIAL_LEADING_BYTE and
|
|
264 FIELD2_TO_PRIVATE_LEADING_BYTE are the same.
|
|
265 */
|
|
266 charset = CHARSET_BY_LEADING_BYTE (f2 + FIELD2_TO_OFFICIAL_LEADING_BYTE);
|
|
267 return (XCHARSET_CHARS (charset) == 96);
|
|
268 }
|
|
269 else
|
|
270 {
|
|
271 Lisp_Object charset;
|
|
272
|
|
273 if (f1 < MIN_CHAR_FIELD1_OFFICIAL ||
|
|
274 (f1 > MAX_CHAR_FIELD1_OFFICIAL && f1 < MIN_CHAR_FIELD1_PRIVATE) ||
|
|
275 f1 > MAX_CHAR_FIELD1_PRIVATE)
|
|
276 return 0;
|
|
277 if (f2 < 0x20 || f3 < 0x20)
|
|
278 return 0;
|
|
279
|
|
280 if (f1 + FIELD1_TO_OFFICIAL_LEADING_BYTE == LEADING_BYTE_COMPOSITE)
|
|
281 {
|
|
282 if (UNBOUNDP (Fgethash (make_int (ch),
|
|
283 Vcomposite_char_char2string_hashtable,
|
|
284 Qunbound)))
|
|
285 return 0;
|
|
286 return 1;
|
|
287 }
|
|
288
|
|
289 if (f2 != 0x20 && f2 != 0x7F && f3 != 0x20 && f3 != 0x7F)
|
|
290 return 1;
|
|
291
|
|
292 if (f1 <= MAX_CHAR_FIELD1_OFFICIAL)
|
|
293 charset =
|
|
294 CHARSET_BY_LEADING_BYTE (f1 + FIELD1_TO_OFFICIAL_LEADING_BYTE);
|
|
295 else
|
|
296 charset =
|
|
297 CHARSET_BY_LEADING_BYTE (f1 + FIELD1_TO_PRIVATE_LEADING_BYTE);
|
|
298
|
|
299 return (XCHARSET_CHARS (charset) == 96);
|
|
300 }
|
|
301 }
|
|
302
|
|
303
|
|
304 /************************************************************************/
|
|
305 /* Basic string functions */
|
|
306 /************************************************************************/
|
|
307
|
|
308 /* Copy the character pointed to by PTR into STR, assuming it's
|
|
309 non-ASCII. Do not call this directly. Use the macro
|
|
310 charptr_copy_char() instead. */
|
|
311
|
|
312 Bytecount
|
|
313 non_ascii_charptr_copy_char (CONST Bufbyte *ptr, Bufbyte *str)
|
|
314 {
|
|
315 Bufbyte *strptr = str;
|
|
316 *strptr = *ptr++;
|
|
317 switch (REP_BYTES_BY_FIRST_BYTE (*strptr))
|
|
318 {
|
|
319 /* Notice fallthrough. */
|
|
320 case 4: *++strptr = *ptr++;
|
|
321 case 3: *++strptr = *ptr++;
|
|
322 case 2: *++strptr = *ptr;
|
|
323 break;
|
|
324 default:
|
|
325 abort ();
|
|
326 }
|
|
327 return strptr + 1 - str;
|
|
328 }
|
|
329
|
|
330
|
|
331 /************************************************************************/
|
|
332 /* streams of Emchars */
|
|
333 /************************************************************************/
|
|
334
|
|
335 /* Treat a stream as a stream of Emchar's rather than a stream of bytes.
|
|
336 The functions below are not meant to be called directly; use
|
|
337 the macros in insdel.h. */
|
|
338
|
|
339 Emchar
|
|
340 Lstream_get_emchar_1 (Lstream *stream, int ch)
|
|
341 {
|
|
342 Bufbyte str[MAX_EMCHAR_LEN];
|
|
343 Bufbyte *strptr = str;
|
|
344
|
|
345 str[0] = (Bufbyte) ch;
|
|
346 switch (REP_BYTES_BY_FIRST_BYTE (ch))
|
|
347 {
|
|
348 /* Notice fallthrough. */
|
|
349 case 4:
|
|
350 ch = Lstream_getc (stream);
|
|
351 assert (ch >= 0);
|
|
352 *++strptr = (Bufbyte) ch;
|
|
353 case 3:
|
|
354 ch = Lstream_getc (stream);
|
|
355 assert (ch >= 0);
|
|
356 *++strptr = (Bufbyte) ch;
|
|
357 case 2:
|
|
358 ch = Lstream_getc (stream);
|
|
359 assert (ch >= 0);
|
|
360 *++strptr = (Bufbyte) ch;
|
|
361 break;
|
|
362 default:
|
|
363 abort ();
|
|
364 }
|
|
365 return charptr_emchar (str);
|
|
366 }
|
|
367
|
|
368 int
|
|
369 Lstream_fput_emchar (Lstream *stream, Emchar ch)
|
|
370 {
|
|
371 Bufbyte str[MAX_EMCHAR_LEN];
|
|
372 Bytecount len = set_charptr_emchar (str, ch);
|
|
373 return Lstream_write (stream, str, len);
|
|
374 }
|
|
375
|
|
376 void
|
|
377 Lstream_funget_emchar (Lstream *stream, Emchar ch)
|
|
378 {
|
|
379 Bufbyte str[MAX_EMCHAR_LEN];
|
|
380 Bytecount len = set_charptr_emchar (str, ch);
|
|
381 Lstream_unread (stream, str, len);
|
|
382 }
|
|
383
|
|
384
|
|
385 /************************************************************************/
|
|
386 /* charset object */
|
|
387 /************************************************************************/
|
|
388
|
|
389 static Lisp_Object mark_charset (Lisp_Object, void (*) (Lisp_Object));
|
|
390 static void print_charset (Lisp_Object, Lisp_Object, int);
|
|
391 DEFINE_LRECORD_IMPLEMENTATION ("charset", charset,
|
|
392 mark_charset, print_charset, 0, 0, 0,
|
|
393 struct Lisp_Charset);
|
|
394
|
|
395 static Lisp_Object
|
|
396 mark_charset (Lisp_Object obj, void (*markobj) (Lisp_Object))
|
|
397 {
|
|
398 struct Lisp_Charset *cs = XCHARSET (obj);
|
|
399
|
|
400 (markobj) (cs->doc_string);
|
|
401 (markobj) (cs->registry);
|
|
402 (markobj) (cs->ccl_program);
|
|
403 return cs->name;
|
|
404 }
|
|
405
|
|
406 static void
|
|
407 print_charset (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
|
|
408 {
|
|
409 struct Lisp_Charset *cs = XCHARSET (obj);
|
|
410 char buf[200];
|
183
|
411
|
70
|
412 if (print_readably)
|
|
413 error ("printing unreadable object #<charset %s 0x%x>",
|
|
414 string_data (XSYMBOL (CHARSET_NAME (cs))->name),
|
|
415 cs->header.uid);
|
|
416
|
|
417 write_c_string ("#<charset ", printcharfun);
|
|
418 print_internal (CHARSET_NAME (cs), printcharfun, 0);
|
|
419 write_c_string (" ", printcharfun);
|
|
420 print_internal (CHARSET_DOC_STRING (cs), printcharfun, 1);
|
|
421 sprintf (buf, " %s %s cols=%d g%d final='%c' reg=",
|
|
422 CHARSET_TYPE (cs) == CHARSET_TYPE_94 ? "94" :
|
|
423 CHARSET_TYPE (cs) == CHARSET_TYPE_96 ? "96" :
|
|
424 CHARSET_TYPE (cs) == CHARSET_TYPE_94X94 ? "94x94" :
|
|
425 "96x96",
|
|
426 CHARSET_DIRECTION (cs) == CHARSET_LEFT_TO_RIGHT ? "l2r" : "r2l",
|
|
427 CHARSET_COLUMNS (cs),
|
|
428 CHARSET_GRAPHIC (cs),
|
|
429 CHARSET_FINAL (cs));
|
|
430 write_c_string (buf, printcharfun);
|
|
431 print_internal (CHARSET_REGISTRY (cs), printcharfun, 0);
|
|
432 sprintf (buf, " 0x%x>", cs->header.uid);
|
|
433 write_c_string (buf, printcharfun);
|
|
434 }
|
|
435
|
|
436 /* Make a new charset. */
|
|
437
|
|
438 static Lisp_Object
|
213
|
439 make_charset (int id, Lisp_Object name, Bufbyte leading_byte, unsigned char rep_bytes,
|
70
|
440 unsigned char type, unsigned char columns, unsigned char graphic,
|
|
441 Bufbyte final, unsigned char direction, Lisp_Object doc,
|
|
442 Lisp_Object reg)
|
|
443 {
|
|
444 struct Lisp_Charset *cs;
|
|
445 Lisp_Object obj = Qnil;
|
|
446
|
185
|
447 cs = alloc_lcrecord_type (struct Lisp_Charset, lrecord_charset);
|
70
|
448 XSETCHARSET (obj, cs);
|
|
449
|
213
|
450 CHARSET_ID (cs) = id;
|
70
|
451 CHARSET_NAME (cs) = name;
|
|
452 CHARSET_LEADING_BYTE (cs) = leading_byte;
|
|
453 CHARSET_REP_BYTES (cs) = rep_bytes;
|
|
454 CHARSET_DIRECTION (cs) = direction;
|
|
455 CHARSET_TYPE (cs) = type;
|
|
456 CHARSET_COLUMNS (cs) = columns;
|
|
457 CHARSET_GRAPHIC (cs) = graphic;
|
|
458 CHARSET_FINAL (cs) = final;
|
|
459 CHARSET_DOC_STRING (cs) = doc;
|
|
460 CHARSET_REGISTRY (cs) = reg;
|
|
461 CHARSET_CCL_PROGRAM (cs) = Qnil;
|
|
462 CHARSET_REVERSE_DIRECTION_CHARSET (cs) = Qnil;
|
|
463
|
|
464 if (final)
|
|
465 {
|
|
466 /* some charsets do not have final characters. This includes
|
|
467 ASCII, Control-1, Composite, and the two faux private
|
|
468 charsets. */
|
|
469 assert (NILP (charset_by_attributes[type][final][direction]));
|
|
470 charset_by_attributes[type][final][direction] = obj;
|
|
471 }
|
|
472
|
|
473 assert (NILP (charset_by_leading_byte[leading_byte - 128]));
|
|
474 charset_by_leading_byte[leading_byte - 128] = obj;
|
|
475 if (leading_byte < 0xA0)
|
|
476 /* official leading byte */
|
|
477 rep_bytes_by_first_byte[leading_byte] = rep_bytes;
|
183
|
478
|
70
|
479 /* Some charsets are "faux" and don't have names or really exist at
|
|
480 all except in the leading-byte table. */
|
|
481 if (!NILP (name))
|
|
482 Fputhash (name, obj, Vcharset_hashtable);
|
|
483 return obj;
|
|
484 }
|
|
485
|
|
486 static int
|
|
487 get_unallocated_leading_byte (int dimension)
|
|
488 {
|
|
489 int lb;
|
|
490
|
|
491 if (dimension == 1)
|
|
492 {
|
|
493 if (next_allocated_1_byte_leading_byte > MAX_LEADING_BYTE_PRIVATE_1)
|
|
494 lb = 0;
|
|
495 else
|
|
496 lb = next_allocated_1_byte_leading_byte++;
|
|
497 }
|
|
498 else
|
|
499 {
|
|
500 if (next_allocated_2_byte_leading_byte > MAX_LEADING_BYTE_PRIVATE_2)
|
|
501 lb = 0;
|
|
502 else
|
|
503 lb = next_allocated_2_byte_leading_byte++;
|
|
504 }
|
|
505
|
|
506 if (!lb)
|
|
507 signal_simple_error
|
|
508 ("No more character sets free for this dimension",
|
|
509 make_int (dimension));
|
|
510
|
|
511 return lb;
|
|
512 }
|
|
513
|
|
514
|
|
515 /************************************************************************/
|
|
516 /* Basic charset Lisp functions */
|
|
517 /************************************************************************/
|
|
518
|
|
519 DEFUN ("charsetp", Fcharsetp, 1, 1, 0, /*
|
|
520 Return non-nil if OBJECT is a charset.
|
|
521 */
|
|
522 (object))
|
|
523 {
|
|
524 return (CHARSETP (object) ? Qt : Qnil);
|
|
525 }
|
|
526
|
|
527 DEFUN ("find-charset", Ffind_charset, 1, 1, 0, /*
|
|
528 Retrieve the charset of the given name.
|
|
529 If CHARSET-OR-NAME is a charset object, it is simply returned.
|
|
530 Otherwise, CHARSET-OR-NAME should be a symbol. If there is no such charset,
|
|
531 nil is returned. Otherwise the associated charset object is returned.
|
|
532 */
|
|
533 (charset_or_name))
|
|
534 {
|
|
535 if (CHARSETP (charset_or_name))
|
|
536 return charset_or_name;
|
|
537 CHECK_SYMBOL (charset_or_name);
|
|
538
|
|
539 return Fgethash (charset_or_name, Vcharset_hashtable, Qnil);
|
|
540 }
|
|
541
|
|
542 DEFUN ("get-charset", Fget_charset, 1, 1, 0, /*
|
|
543 Retrieve the charset of the given name.
|
|
544 Same as `find-charset' except an error is signalled if there is no such
|
|
545 charset instead of returning nil.
|
|
546 */
|
|
547 (name))
|
|
548 {
|
|
549 Lisp_Object charset = Ffind_charset (name);
|
|
550
|
|
551 if (NILP (charset))
|
|
552 signal_simple_error ("No such charset", name);
|
|
553 return charset;
|
|
554 }
|
|
555
|
|
556 /* We store the charsets in hash tables with the names as the key and the
|
|
557 actual charset object as the value. Occasionally we need to use them
|
|
558 in a list format. These routines provide us with that. */
|
|
559 struct charset_list_closure
|
|
560 {
|
|
561 Lisp_Object *charset_list;
|
|
562 };
|
|
563
|
|
564 static void
|
|
565 add_charset_to_list_mapper (CONST void *hash_key, void *hash_contents,
|
|
566 void *charset_list_closure)
|
|
567 {
|
|
568 /* This function can GC */
|
|
569 Lisp_Object key, contents;
|
|
570 Lisp_Object *charset_list;
|
185
|
571 struct charset_list_closure *chcl =
|
|
572 (struct charset_list_closure*) charset_list_closure;
|
70
|
573 CVOID_TO_LISP (key, hash_key);
|
|
574 VOID_TO_LISP (contents, hash_contents);
|
|
575 charset_list = chcl->charset_list;
|
|
576
|
|
577 *charset_list = Fcons (XCHARSET_NAME (contents), *charset_list);
|
|
578 }
|
|
579
|
|
580 DEFUN ("charset-list", Fcharset_list, 0, 0, 0, /*
|
|
581 Return a list of the names of all defined charsets.
|
|
582 */
|
|
583 ())
|
|
584 {
|
|
585 Lisp_Object charset_list = Qnil;
|
|
586 struct gcpro gcpro1;
|
|
587 struct charset_list_closure charset_list_closure;
|
|
588
|
|
589 GCPRO1 (charset_list);
|
|
590 charset_list_closure.charset_list = &charset_list;
|
|
591 elisp_maphash (add_charset_to_list_mapper, Vcharset_hashtable,
|
|
592 &charset_list_closure);
|
|
593 UNGCPRO;
|
|
594
|
|
595 return charset_list;
|
|
596 }
|
|
597
|
|
598 DEFUN ("charset-name", Fcharset_name, 1, 1, 0, /*
|
|
599 Return the name of the given charset.
|
|
600 */
|
|
601 (charset))
|
|
602 {
|
|
603 return (XCHARSET_NAME (Fget_charset (charset)));
|
|
604 }
|
|
605
|
|
606 DEFUN ("make-charset", Fmake_charset, 3, 3, 0, /*
|
|
607 Define a new character set.
|
|
608 This function is for use with Mule support.
|
|
609 NAME is a symbol, the name by which the character set is normally referred.
|
|
610 DOC-STRING is a string describing the character set.
|
|
611 PROPS is a property list, describing the specific nature of the
|
|
612 character set. Recognized properties are:
|
|
613
|
|
614 'registry A regular expression matching the font registry field for
|
|
615 this character set.
|
|
616 'dimension Number of octets used to index a character in this charset.
|
|
617 Either 1 or 2. Defaults to 1.
|
|
618 'columns Number of columns used to display a character in this charset.
|
|
619 Only used in TTY mode. (Under X, the actual width of a
|
|
620 character can be derived from the font used to display the
|
|
621 characters.) If unspecified, defaults to the dimension
|
|
622 (this is almost always the correct value).
|
|
623 'chars Number of characters in each dimension (94 or 96).
|
|
624 Defaults to 94. Note that if the dimension is 2, the
|
|
625 character set thus described is 94x94 or 96x96.
|
|
626 'final Final byte of ISO 2022 escape sequence. Must be
|
|
627 supplied. Each combination of (DIMENSION, CHARS) defines a
|
|
628 separate namespace for final bytes. Note that ISO
|
|
629 2022 restricts the final byte to the range
|
|
630 0x30 - 0x7E if dimension == 1, and 0x30 - 0x5F if
|
|
631 dimension == 2. Note also that final bytes in the range
|
|
632 0x30 - 0x3F are reserved for user-defined (not official)
|
|
633 character sets.
|
|
634 'graphic 0 (use left half of font on output) or 1 (use right half
|
|
635 of font on output). Defaults to 0. For example, for
|
|
636 a font whose registry is ISO8859-1, the left half
|
|
637 (octets 0x20 - 0x7F) is the `ascii' character set, while
|
|
638 the right half (octets 0xA0 - 0xFF) is the `latin-1'
|
|
639 character set. With 'graphic set to 0, the octets
|
|
640 will have their high bit cleared; with it set to 1,
|
|
641 the octets will have their high bit set.
|
|
642 'direction 'l2r (left-to-right) or 'r2l (right-to-left).
|
|
643 Defaults to 'l2r.
|
|
644 'ccl-program A compiled CCL program used to convert a character in
|
|
645 this charset into an index into the font. This is in
|
|
646 addition to the 'graphic property. The CCL program
|
|
647 is passed the octets of the character, with the high
|
|
648 bit cleared and set depending upon whether the value
|
|
649 of the 'graphic property is 0 or 1.
|
|
650 */
|
|
651 (name, doc_string, props))
|
|
652 {
|
|
653 int lb, dimension = 1, chars = 94, graphic = 0, final = 0, columns = -1;
|
|
654 int direction = CHARSET_LEFT_TO_RIGHT;
|
|
655 int type;
|
|
656 Lisp_Object registry = Qnil;
|
|
657 Lisp_Object charset;
|
|
658 Lisp_Object rest, keyword, value;
|
|
659 Lisp_Object ccl_program = Qnil;
|
|
660
|
|
661 CHECK_SYMBOL (name);
|
|
662 if (!NILP (doc_string))
|
|
663 CHECK_STRING (doc_string);
|
|
664
|
|
665 charset = Ffind_charset (name);
|
|
666 if (!NILP (charset))
|
|
667 signal_simple_error ("Cannot redefine existing charset", name);
|
|
668
|
|
669 EXTERNAL_PROPERTY_LIST_LOOP (rest, keyword, value, props)
|
|
670 {
|
|
671 if (EQ (keyword, Qdimension))
|
|
672 {
|
|
673 CHECK_INT (value);
|
|
674 dimension = XINT (value);
|
|
675 if (dimension < 1 || dimension > 2)
|
|
676 signal_simple_error ("Invalid value for 'dimension", value);
|
|
677 }
|
|
678
|
|
679 else if (EQ (keyword, Qchars))
|
|
680 {
|
|
681 CHECK_INT (value);
|
|
682 chars = XINT (value);
|
|
683 if (chars != 94 && chars != 96)
|
|
684 signal_simple_error ("Invalid value for 'chars", value);
|
|
685 }
|
|
686
|
|
687 else if (EQ (keyword, Qcolumns))
|
|
688 {
|
|
689 CHECK_INT (value);
|
|
690 columns = XINT (value);
|
|
691 if (columns != 1 && columns != 2)
|
|
692 signal_simple_error ("Invalid value for 'columns", value);
|
|
693 }
|
|
694
|
|
695 else if (EQ (keyword, Qgraphic))
|
|
696 {
|
|
697 CHECK_INT (value);
|
|
698 graphic = XINT (value);
|
|
699 if (graphic < 0 || graphic > 1)
|
|
700 signal_simple_error ("Invalid value for 'graphic", value);
|
|
701 }
|
|
702
|
|
703 else if (EQ (keyword, Qregistry))
|
|
704 {
|
|
705 CHECK_STRING (value);
|
|
706 registry = value;
|
|
707 }
|
|
708
|
|
709 else if (EQ (keyword, Qdirection))
|
|
710 {
|
|
711 if (EQ (value, Ql2r))
|
|
712 direction = CHARSET_LEFT_TO_RIGHT;
|
|
713 else if (EQ (value, Qr2l))
|
|
714 direction = CHARSET_RIGHT_TO_LEFT;
|
|
715 else
|
|
716 signal_simple_error ("Invalid value for 'direction", value);
|
|
717 }
|
|
718
|
|
719 else if (EQ (keyword, Qfinal))
|
|
720 {
|
|
721 CHECK_CHAR_COERCE_INT (value);
|
|
722 final = XCHAR (value);
|
|
723 if (final < '0' || final > '~')
|
|
724 signal_simple_error ("Invalid value for 'final", value);
|
|
725 }
|
|
726
|
|
727 else if (EQ (keyword, Qccl_program))
|
|
728 {
|
|
729 CHECK_VECTOR (value);
|
|
730 ccl_program = value;
|
|
731 }
|
|
732
|
|
733 else
|
|
734 signal_simple_error ("Unrecognized property", keyword);
|
|
735 }
|
|
736
|
|
737 if (!final)
|
|
738 error ("'final must be specified");
|
|
739 if (dimension == 2 && final > 0x5F)
|
|
740 signal_simple_error
|
|
741 ("Final must be in the range 0x30 - 0x5F for dimension == 2",
|
|
742 make_char (final));
|
|
743
|
|
744 if (dimension == 1)
|
|
745 type = (chars == 94) ? CHARSET_TYPE_94 : CHARSET_TYPE_96;
|
|
746 else
|
|
747 type = (chars == 94) ? CHARSET_TYPE_94X94 : CHARSET_TYPE_96X96;
|
|
748
|
|
749 if (!NILP (CHARSET_BY_ATTRIBUTES (type, final, CHARSET_LEFT_TO_RIGHT)) ||
|
|
750 !NILP (CHARSET_BY_ATTRIBUTES (type, final, CHARSET_RIGHT_TO_LEFT)))
|
|
751 error
|
|
752 ("Character set already defined for this DIMENSION/CHARS/FINAL combo");
|
|
753
|
|
754 lb = get_unallocated_leading_byte (dimension);
|
|
755
|
|
756 if (NILP (doc_string))
|
|
757 doc_string = build_string ("");
|
|
758
|
|
759 if (NILP (registry))
|
|
760 registry = build_string ("");
|
|
761
|
|
762 if (columns == -1)
|
|
763 columns = dimension;
|
213
|
764 charset = make_charset (-1, name, lb, dimension + 2, type, columns, graphic,
|
70
|
765 final, direction, doc_string, registry);
|
|
766 if (!NILP (ccl_program))
|
|
767 XCHARSET_CCL_PROGRAM (charset) = ccl_program;
|
|
768 return charset;
|
|
769 }
|
|
770
|
|
771 DEFUN ("make-reverse-direction-charset",
|
|
772 Fmake_reverse_direction_charset, 2, 2, 0, /*
|
|
773 Make a charset equivalent to CHARSET but which goes in the opposite direction.
|
|
774 NEW-NAME is the name of the new charset. Return the new charset.
|
|
775 */
|
|
776 (charset, new_name))
|
|
777 {
|
|
778 Lisp_Object new_charset = Qnil;
|
|
779 int lb, dimension, columns, graphic, final;
|
|
780 int direction, type;
|
|
781 Lisp_Object registry, doc_string;
|
|
782 struct Lisp_Charset *cs;
|
|
783
|
|
784 charset = Fget_charset (charset);
|
|
785 if (!NILP (XCHARSET_REVERSE_DIRECTION_CHARSET (charset)))
|
|
786 signal_simple_error ("Charset already has reverse-direction charset",
|
|
787 charset);
|
|
788
|
|
789 CHECK_SYMBOL (new_name);
|
|
790 if (!NILP (Ffind_charset (new_name)))
|
|
791 signal_simple_error ("Cannot redefine existing charset", new_name);
|
|
792
|
|
793 cs = XCHARSET (charset);
|
183
|
794
|
70
|
795 type = CHARSET_TYPE (cs);
|
|
796 columns = CHARSET_COLUMNS (cs);
|
|
797 dimension = CHARSET_DIMENSION (cs);
|
|
798 lb = get_unallocated_leading_byte (dimension);
|
|
799
|
|
800 graphic = CHARSET_GRAPHIC (cs);
|
|
801 final = CHARSET_FINAL (cs);
|
|
802 direction = CHARSET_RIGHT_TO_LEFT;
|
|
803 if (CHARSET_DIRECTION (cs) == CHARSET_RIGHT_TO_LEFT)
|
|
804 direction = CHARSET_LEFT_TO_RIGHT;
|
|
805 doc_string = CHARSET_DOC_STRING (cs);
|
|
806 registry = CHARSET_REGISTRY (cs);
|
|
807
|
213
|
808 new_charset = make_charset (-1, new_name, lb, dimension + 2, type, columns,
|
70
|
809 graphic, final, direction, doc_string, registry);
|
|
810
|
|
811 CHARSET_REVERSE_DIRECTION_CHARSET (cs) = new_charset;
|
|
812 XCHARSET_REVERSE_DIRECTION_CHARSET (new_charset) = charset;
|
|
813
|
|
814 return new_charset;
|
|
815 }
|
|
816
|
|
817 /* #### The defsubr for this is commented out at the moment but no
|
|
818 reason why is given. */
|
|
819 #if 0
|
|
820 DEFUN ("charset-reverse-direction-charset",
|
|
821 Fcharset_reverse_direction_charset, 1, 1, 0, /*
|
|
822 Return the reverse-direction charset parallel to CHARSET, if any.
|
|
823 This is the charset with the same properties (in particular, the same
|
|
824 dimension, number of characters per dimension, and final byte) as
|
|
825 CHARSET but whose characters are displayed in the opposite direction.
|
|
826 */
|
|
827 (charset))
|
|
828 {
|
|
829 charset = Fget_charset (charset);
|
|
830 return XCHARSET_REVERSE_DIRECTION_CHARSET (charset);
|
|
831 }
|
|
832 #endif
|
|
833
|
|
834 DEFUN ("charset-from-attributes", Fcharset_from_attributes, 3, 4, 0, /*
|
|
835 Return a charset with the given DIMENSION, CHARS, FINAL, and DIRECTION.
|
|
836 If DIRECTION is omitted, both directions will be checked (left-to-right
|
|
837 will be returned if character sets exist for both directions).
|
|
838 */
|
|
839 (dimension, chars, final, direction))
|
|
840 {
|
|
841 int dm, ch, fi, di = -1;
|
|
842 int type;
|
|
843 Lisp_Object obj = Qnil;
|
|
844
|
|
845 CHECK_INT (dimension);
|
|
846 dm = XINT (dimension);
|
|
847 if (dm < 1 || dm > 2)
|
|
848 signal_simple_error ("Invalid value for DIMENSION", dimension);
|
|
849
|
|
850 CHECK_INT (chars);
|
|
851 ch = XINT (chars);
|
|
852 if (ch != 94 && ch != 96)
|
|
853 signal_simple_error ("Invalid value for CHARS", chars);
|
|
854
|
|
855 CHECK_CHAR_COERCE_INT (final);
|
|
856 fi = XCHAR (final);
|
|
857 if (fi < '0' || fi > '~')
|
|
858 signal_simple_error ("Invalid value for FINAL", final);
|
|
859
|
|
860 if (EQ (direction, Ql2r))
|
|
861 di = CHARSET_LEFT_TO_RIGHT;
|
|
862 else if (EQ (direction, Qr2l))
|
|
863 di = CHARSET_RIGHT_TO_LEFT;
|
|
864 else if (!NILP (direction))
|
|
865 signal_simple_error ("Invalid value for DIRECTION", direction);
|
|
866
|
|
867 if (dm == 2 && fi > 0x5F)
|
|
868 signal_simple_error
|
|
869 ("Final must be in the range 0x30 - 0x5F for dimension == 2", final);
|
|
870
|
|
871 if (dm == 1)
|
|
872 type = (ch == 94) ? CHARSET_TYPE_94 : CHARSET_TYPE_96;
|
|
873 else
|
|
874 type = (ch == 94) ? CHARSET_TYPE_94X94 : CHARSET_TYPE_96X96;
|
|
875
|
|
876 if (di == -1)
|
|
877 {
|
|
878 obj = CHARSET_BY_ATTRIBUTES (type, fi, CHARSET_LEFT_TO_RIGHT);
|
|
879 if (NILP (obj))
|
|
880 obj = CHARSET_BY_ATTRIBUTES (type, fi, CHARSET_RIGHT_TO_LEFT);
|
|
881 }
|
|
882 else
|
|
883 obj = CHARSET_BY_ATTRIBUTES (type, fi, di);
|
|
884
|
|
885 if (CHARSETP (obj))
|
|
886 return XCHARSET_NAME (obj);
|
|
887 return obj;
|
|
888 }
|
|
889
|
|
890 DEFUN ("charset-doc-string", Fcharset_doc_string, 1, 1, 0, /*
|
|
891 Return doc string of CHARSET.
|
|
892 */
|
|
893 (charset))
|
|
894 {
|
|
895 return XCHARSET_DOC_STRING (Fget_charset (charset));
|
|
896 }
|
|
897
|
|
898 DEFUN ("charset-dimension", Fcharset_dimension, 1, 1, 0, /*
|
|
899 Return dimension of CHARSET.
|
|
900 */
|
|
901 (charset))
|
|
902 {
|
|
903 return make_int (XCHARSET_DIMENSION (Fget_charset (charset)));
|
|
904 }
|
|
905
|
|
906 DEFUN ("charset-property", Fcharset_property, 2, 2, 0, /*
|
|
907 Return property PROP of CHARSET.
|
|
908 Recognized properties are those listed in `make-charset', as well as
|
|
909 'name and 'doc-string.
|
|
910 */
|
|
911 (charset, prop))
|
|
912 {
|
|
913 struct Lisp_Charset *cs;
|
|
914
|
|
915 charset = Fget_charset (charset);
|
|
916 cs = XCHARSET (charset);
|
|
917
|
|
918 CHECK_SYMBOL (prop);
|
|
919 if (EQ (prop, Qname)) return CHARSET_NAME (cs);
|
|
920 if (EQ (prop, Qdoc_string)) return CHARSET_DOC_STRING (cs);
|
|
921 if (EQ (prop, Qdimension)) return make_int (CHARSET_DIMENSION (cs));
|
|
922 if (EQ (prop, Qcolumns)) return make_int (CHARSET_COLUMNS (cs));
|
|
923 if (EQ (prop, Qgraphic)) return make_int (CHARSET_GRAPHIC (cs));
|
|
924 if (EQ (prop, Qfinal)) return make_char (CHARSET_FINAL (cs));
|
|
925 if (EQ (prop, Qchars)) return make_int (CHARSET_CHARS (cs));
|
|
926 if (EQ (prop, Qregistry)) return CHARSET_REGISTRY (cs);
|
|
927 if (EQ (prop, Qccl_program)) return CHARSET_CCL_PROGRAM (cs);
|
|
928 if (EQ (prop, Qdirection))
|
|
929 return (CHARSET_DIRECTION (cs) == CHARSET_LEFT_TO_RIGHT ? Ql2r : Qr2l);
|
|
930 if (EQ (prop, Qreverse_direction_charset))
|
|
931 {
|
|
932 Lisp_Object obj = CHARSET_REVERSE_DIRECTION_CHARSET (cs);
|
|
933 if (NILP (obj))
|
|
934 return Qnil;
|
|
935 else
|
|
936 return XCHARSET_NAME (obj);
|
|
937 }
|
|
938 signal_simple_error ("Unrecognized charset property name", prop);
|
|
939 return Qnil; /* not reached */
|
|
940 }
|
|
941
|
213
|
942 DEFUN ("charset-id", Fcharset_id, 1, 1, 0, /*
|
|
943 Return charset identification number of CHARSET.
|
|
944 */
|
|
945 (charset))
|
|
946 {
|
|
947 return make_int(XCHARSET_ID (Fget_charset (charset)));
|
|
948 }
|
|
949
|
70
|
950 /* #### We need to figure out which properties we really want to
|
|
951 allow to be set. */
|
|
952
|
|
953 DEFUN ("set-charset-ccl-program", Fset_charset_ccl_program, 2, 2, 0, /*
|
|
954 Set the 'ccl-program property of CHARSET to CCL-PROGRAM.
|
|
955 */
|
|
956 (charset, ccl_program))
|
|
957 {
|
|
958 charset = Fget_charset (charset);
|
|
959 CHECK_VECTOR (ccl_program);
|
|
960 XCHARSET_CCL_PROGRAM (charset) = ccl_program;
|
|
961 return Qnil;
|
|
962 }
|
|
963
|
|
964 static void
|
|
965 invalidate_charset_font_caches (Lisp_Object charset)
|
|
966 {
|
|
967 /* Invalidate font cache entries for charset on all devices. */
|
|
968 Lisp_Object devcons, concons, hashtab;
|
|
969 DEVICE_LOOP_NO_BREAK (devcons, concons)
|
|
970 {
|
|
971 struct device *d = XDEVICE (XCAR (devcons));
|
|
972 hashtab = Fgethash (charset, d->charset_font_cache, Qunbound);
|
|
973 if (!UNBOUNDP (hashtab))
|
|
974 Fclrhash (hashtab);
|
|
975 }
|
|
976 }
|
|
977
|
|
978 /* Japanese folks may want to (set-charset-registry 'ascii "jisx0201") */
|
|
979 DEFUN ("set-charset-registry", Fset_charset_registry, 2, 2, 0, /*
|
|
980 Set the 'registry property of CHARSET to REGISTRY.
|
|
981 */
|
|
982 (charset, registry))
|
|
983 {
|
|
984 charset = Fget_charset (charset);
|
|
985 CHECK_STRING (registry);
|
|
986 XCHARSET_REGISTRY (charset) = registry;
|
|
987 invalidate_charset_font_caches (charset);
|
|
988 face_property_was_changed (Vdefault_face, Qfont, Qglobal);
|
|
989 return Qnil;
|
|
990 }
|
183
|
991
|
70
|
992
|
|
993 /************************************************************************/
|
|
994 /* Lisp primitives for working with characters */
|
|
995 /************************************************************************/
|
|
996
|
|
997 DEFUN ("make-char", Fmake_char, 2, 3, 0, /*
|
|
998 Make a multi-byte character from CHARSET and octets ARG1 and ARG2.
|
|
999 */
|
|
1000 (charset, arg1, arg2))
|
|
1001 {
|
|
1002 struct Lisp_Charset *cs;
|
|
1003 int a1, a2;
|
|
1004 int lowlim, highlim;
|
|
1005
|
|
1006 charset = Fget_charset (charset);
|
|
1007 cs = XCHARSET (charset);
|
|
1008
|
|
1009 if (EQ (charset, Vcharset_ascii)) lowlim = 0, highlim = 127;
|
|
1010 else if (EQ (charset, Vcharset_control_1)) lowlim = 0, highlim = 31;
|
|
1011 else if (CHARSET_CHARS (cs) == 94) lowlim = 33, highlim = 126;
|
|
1012 else /* CHARSET_CHARS (cs) == 96) */ lowlim = 32, highlim = 127;
|
|
1013
|
|
1014 CHECK_INT (arg1);
|
|
1015 a1 = XINT (arg1);
|
|
1016 if (a1 < lowlim || a1 > highlim)
|
|
1017 args_out_of_range_3 (arg1, make_int (lowlim), make_int (highlim));
|
|
1018
|
|
1019 if (CHARSET_DIMENSION (cs) == 1)
|
|
1020 {
|
|
1021 if (!NILP (arg2))
|
|
1022 signal_simple_error
|
|
1023 ("Charset is of dimension one; second octet must be nil", arg2);
|
|
1024 return make_char (MAKE_CHAR (charset, a1, 0));
|
|
1025 }
|
|
1026
|
|
1027 CHECK_INT (arg2);
|
|
1028 a2 = XINT (arg2);
|
|
1029 if (a2 < lowlim || a2 > highlim)
|
|
1030 args_out_of_range_3 (arg2, make_int (lowlim), make_int (highlim));
|
|
1031
|
|
1032 return make_char (MAKE_CHAR (charset, a1, a2));
|
|
1033 }
|
|
1034
|
|
1035 DEFUN ("char-charset", Fchar_charset, 1, 1, 0, /*
|
|
1036 Return the character set of char CH.
|
|
1037 */
|
|
1038 (ch))
|
|
1039 {
|
|
1040 CHECK_CHAR_COERCE_INT (ch);
|
|
1041
|
|
1042 return XCHARSET_NAME (CHARSET_BY_LEADING_BYTE
|
|
1043 (CHAR_LEADING_BYTE (XCHAR (ch))));
|
|
1044 }
|
|
1045
|
|
1046 DEFUN ("char-octet", Fchar_octet, 1, 2, 0, /*
|
|
1047 Return the octet numbered N (should be 0 or 1) of char CH.
|
|
1048 N defaults to 0 if omitted.
|
|
1049 */
|
|
1050 (ch, n))
|
|
1051 {
|
|
1052 Lisp_Object charset;
|
183
|
1053 int c1, c2, int_n;
|
70
|
1054
|
|
1055 CHECK_CHAR_COERCE_INT (ch);
|
|
1056 if (NILP (n))
|
183
|
1057 int_n = 0;
|
70
|
1058 else
|
|
1059 {
|
|
1060 CHECK_INT (n);
|
183
|
1061 int_n = XINT (n);
|
|
1062 if (int_n != 0 && int_n != 1)
|
70
|
1063 signal_simple_error ("Octet number must be 0 or 1", n);
|
|
1064 }
|
|
1065 BREAKUP_CHAR (XCHAR (ch), charset, c1, c2);
|
183
|
1066 return make_int (int_n == 0 ? c1 : c2);
|
70
|
1067 }
|
|
1068
|
|
1069
|
|
1070 /************************************************************************/
|
|
1071 /* composite character functions */
|
|
1072 /************************************************************************/
|
|
1073
|
|
1074 Emchar
|
|
1075 lookup_composite_char (Bufbyte *str, int len)
|
|
1076 {
|
|
1077 Lisp_Object lispstr = make_string (str, len);
|
|
1078 Lisp_Object ch = Fgethash (lispstr,
|
|
1079 Vcomposite_char_string2char_hashtable,
|
|
1080 Qunbound);
|
|
1081 Emchar emch;
|
|
1082
|
|
1083 if (UNBOUNDP (ch))
|
|
1084 {
|
|
1085 if (composite_char_row_next >= 128)
|
|
1086 signal_simple_error ("No more composite chars available", lispstr);
|
|
1087 emch = MAKE_CHAR (Vcharset_composite, composite_char_row_next,
|
|
1088 composite_char_col_next);
|
|
1089 Fputhash (make_char (emch), lispstr,
|
|
1090 Vcomposite_char_char2string_hashtable);
|
|
1091 Fputhash (lispstr, make_char (emch),
|
|
1092 Vcomposite_char_string2char_hashtable);
|
|
1093 composite_char_col_next++;
|
|
1094 if (composite_char_col_next >= 128)
|
|
1095 {
|
|
1096 composite_char_col_next = 32;
|
|
1097 composite_char_row_next++;
|
|
1098 }
|
|
1099 }
|
|
1100 else
|
|
1101 emch = XCHAR (ch);
|
|
1102 return emch;
|
|
1103 }
|
|
1104
|
|
1105 Lisp_Object
|
|
1106 composite_char_string (Emchar ch)
|
|
1107 {
|
|
1108 Lisp_Object str = Fgethash (make_char (ch),
|
|
1109 Vcomposite_char_char2string_hashtable,
|
|
1110 Qunbound);
|
|
1111 assert (!UNBOUNDP (str));
|
|
1112 return str;
|
|
1113 }
|
|
1114
|
|
1115 DEFUN ("make-composite-char", Fmake_composite_char, 1, 1, 0, /*
|
|
1116 Convert a string into a single composite character.
|
|
1117 The character is the result of overstriking all the characters in
|
|
1118 the string.
|
|
1119 */
|
|
1120 (string))
|
|
1121 {
|
|
1122 CHECK_STRING (string);
|
|
1123 return make_char (lookup_composite_char (XSTRING_DATA (string),
|
|
1124 XSTRING_LENGTH (string)));
|
|
1125 }
|
|
1126
|
|
1127 DEFUN ("composite-char-string", Fcomposite_char_string, 1, 1, 0, /*
|
|
1128 Return a string of the characters comprising a composite character.
|
|
1129 */
|
|
1130 (ch))
|
|
1131 {
|
|
1132 Emchar emch;
|
|
1133
|
|
1134 CHECK_CHAR (ch);
|
|
1135 emch = XCHAR (ch);
|
|
1136 if (CHAR_LEADING_BYTE (emch) != LEADING_BYTE_COMPOSITE)
|
|
1137 signal_simple_error ("Must be composite char", ch);
|
|
1138 return composite_char_string (emch);
|
|
1139 }
|
|
1140
|
|
1141
|
|
1142 /************************************************************************/
|
|
1143 /* initialization */
|
|
1144 /************************************************************************/
|
|
1145
|
|
1146 void
|
|
1147 syms_of_mule_charset (void)
|
|
1148 {
|
|
1149 DEFSUBR (Fcharsetp);
|
|
1150 DEFSUBR (Ffind_charset);
|
|
1151 DEFSUBR (Fget_charset);
|
|
1152 DEFSUBR (Fcharset_list);
|
|
1153 DEFSUBR (Fcharset_name);
|
|
1154 DEFSUBR (Fmake_charset);
|
|
1155 DEFSUBR (Fmake_reverse_direction_charset);
|
|
1156 /* DEFSUBR (Freverse_direction_charset); */
|
|
1157 DEFSUBR (Fcharset_from_attributes);
|
|
1158 DEFSUBR (Fcharset_doc_string);
|
|
1159 DEFSUBR (Fcharset_dimension);
|
|
1160 DEFSUBR (Fcharset_property);
|
213
|
1161 DEFSUBR (Fcharset_id);
|
70
|
1162 DEFSUBR (Fset_charset_ccl_program);
|
|
1163 DEFSUBR (Fset_charset_registry);
|
|
1164
|
|
1165 DEFSUBR (Fmake_char);
|
|
1166 DEFSUBR (Fchar_charset);
|
|
1167 DEFSUBR (Fchar_octet);
|
|
1168
|
|
1169 DEFSUBR (Fmake_composite_char);
|
|
1170 DEFSUBR (Fcomposite_char_string);
|
|
1171
|
|
1172 defsymbol (&Qcharsetp, "charsetp");
|
|
1173 defsymbol (&Qregistry, "registry");
|
|
1174 defsymbol (&Qfinal, "final");
|
|
1175 defsymbol (&Qgraphic, "graphic");
|
|
1176 defsymbol (&Qdirection, "direction");
|
|
1177 defsymbol (&Qreverse_direction_charset, "reverse-direction-charset");
|
|
1178 defsymbol (&Qccl_program, "ccl-program");
|
|
1179
|
|
1180 defsymbol (&Ql2r, "l2r");
|
|
1181 defsymbol (&Qr2l, "r2l");
|
|
1182
|
74
|
1183 /* Charsets, compatible with Emacs/Mule 19.33-delta
|
|
1184 Naming convention is Script-Charset[-Edition] */
|
|
1185 defsymbol (&Qascii, "ascii");
|
|
1186 defsymbol (&Qcontrol_1, "control-1");
|
|
1187 defsymbol (&Qlatin_iso8859_1, "latin-iso8859-1");
|
|
1188 defsymbol (&Qlatin_iso8859_2, "latin-iso8859-2");
|
|
1189 defsymbol (&Qlatin_iso8859_3, "latin-iso8859-3");
|
|
1190 defsymbol (&Qlatin_iso8859_4, "latin-iso8859-4");
|
|
1191 defsymbol (&Qcyrillic_iso8859_5, "cyrillic-iso8859-5");
|
|
1192 defsymbol (&Qarabic_iso8859_6, "arabic-iso8859-6");
|
|
1193 defsymbol (&Qgreek_iso8859_7, "greek-iso8859-7");
|
|
1194 defsymbol (&Qhebrew_iso8859_8, "hebrew-iso8859-8");
|
|
1195 defsymbol (&Qlatin_iso8859_9, "latin-iso8859-9");
|
|
1196 defsymbol (&Qthai_tis620, "thai-tis620");
|
183
|
1197
|
74
|
1198 defsymbol (&Qkatakana_jisx0201, "katakana-jisx0201");
|
|
1199 defsymbol (&Qlatin_jisx0201, "latin-jisx0201");
|
70
|
1200 defsymbol (&Qjapanese_jisx0208_1978, "japanese-jisx0208-1978");
|
|
1201 defsymbol (&Qjapanese_jisx0208, "japanese-jisx0208");
|
|
1202 defsymbol (&Qjapanese_jisx0212, "japanese-jisx0212");
|
183
|
1203
|
74
|
1204 defsymbol (&Qchinese_gb2312, "chinese-gb2312");
|
|
1205 defsymbol (&Qchinese_big5_1, "chinese-big5-1");
|
|
1206 defsymbol (&Qchinese_big5_2, "chinese-big5-2");
|
|
1207 defsymbol (&Qchinese_cns11643_1, "chinese-cns11643-1");
|
|
1208 defsymbol (&Qchinese_cns11643_2, "chinese-cns11643-2");
|
183
|
1209
|
74
|
1210 defsymbol (&Qkorean_ksc5601, "korean-ksc5601");
|
|
1211 defsymbol (&Qcomposite, "composite");
|
70
|
1212 }
|
|
1213
|
|
1214 void
|
|
1215 vars_of_mule_charset (void)
|
|
1216 {
|
|
1217 int i, j, k;
|
|
1218
|
183
|
1219 /* Table of charsets indexed by leading byte. */
|
|
1220 for (i = 0; i < countof (charset_by_leading_byte); i++)
|
70
|
1221 charset_by_leading_byte[i] = Qnil;
|
183
|
1222
|
|
1223 /* Table of charsets indexed by type/final-byte/direction. */
|
|
1224 for (i = 0; i < countof (charset_by_attributes); i++)
|
|
1225 for (j = 0; j < countof (charset_by_attributes[0]); j++)
|
|
1226 for (k = 0; k < countof (charset_by_attributes[0][0]); k++)
|
70
|
1227 charset_by_attributes[i][j][k] = Qnil;
|
|
1228
|
|
1229 next_allocated_1_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_1;
|
|
1230 next_allocated_2_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_2;
|
|
1231 }
|
|
1232
|
|
1233 void
|
|
1234 complex_vars_of_mule_charset (void)
|
|
1235 {
|
|
1236 staticpro (&Vcharset_hashtable);
|
|
1237 Vcharset_hashtable = make_lisp_hashtable (50, HASHTABLE_NONWEAK,
|
|
1238 HASHTABLE_EQ);
|
183
|
1239
|
70
|
1240 /* Predefined character sets. We store them into variables for
|
|
1241 ease of access. */
|
|
1242
|
|
1243 Vcharset_ascii =
|
213
|
1244 make_charset (0, Qascii, LEADING_BYTE_ASCII, 1,
|
70
|
1245 CHARSET_TYPE_94, 1, 0, 'B',
|
|
1246 CHARSET_LEFT_TO_RIGHT,
|
167
|
1247 build_string ("ASCII (ISO 646 IRV)"),
|
78
|
1248 build_string ("iso8859-1"));
|
70
|
1249 Vcharset_control_1 =
|
213
|
1250 make_charset (-1, Qcontrol_1, LEADING_BYTE_CONTROL_1, 2,
|
70
|
1251 CHARSET_TYPE_94, 1, 0, 0,
|
|
1252 CHARSET_LEFT_TO_RIGHT,
|
|
1253 build_string ("Control characters"),
|
|
1254 build_string (""));
|
74
|
1255 Vcharset_latin_iso8859_1 =
|
213
|
1256 make_charset (129, Qlatin_iso8859_1, LEADING_BYTE_LATIN_ISO8859_1, 2,
|
70
|
1257 CHARSET_TYPE_96, 1, 1, 'A',
|
|
1258 CHARSET_LEFT_TO_RIGHT,
|
167
|
1259 build_string ("ISO 8859-1 (Latin-1)"),
|
78
|
1260 build_string ("iso8859-1"));
|
74
|
1261 Vcharset_latin_iso8859_2 =
|
213
|
1262 make_charset (130, Qlatin_iso8859_2, LEADING_BYTE_LATIN_ISO8859_2, 2,
|
70
|
1263 CHARSET_TYPE_96, 1, 1, 'B',
|
|
1264 CHARSET_LEFT_TO_RIGHT,
|
167
|
1265 build_string ("ISO 8859-2 (Latin-2)"),
|
78
|
1266 build_string ("iso8859-2"));
|
74
|
1267 Vcharset_latin_iso8859_3 =
|
213
|
1268 make_charset (131, Qlatin_iso8859_3, LEADING_BYTE_LATIN_ISO8859_3, 2,
|
70
|
1269 CHARSET_TYPE_96, 1, 1, 'C',
|
|
1270 CHARSET_LEFT_TO_RIGHT,
|
167
|
1271 build_string ("ISO 8859-3 (Latin-3)"),
|
78
|
1272 build_string ("iso8859-3"));
|
74
|
1273 Vcharset_latin_iso8859_4 =
|
213
|
1274 make_charset (132, Qlatin_iso8859_4, LEADING_BYTE_LATIN_ISO8859_4, 2,
|
70
|
1275 CHARSET_TYPE_96, 1, 1, 'D',
|
|
1276 CHARSET_LEFT_TO_RIGHT,
|
167
|
1277 build_string ("ISO 8859-4 (Latin-4)"),
|
78
|
1278 build_string ("iso8859-4"));
|
74
|
1279 Vcharset_cyrillic_iso8859_5 =
|
213
|
1280 make_charset (140, Qcyrillic_iso8859_5, LEADING_BYTE_CYRILLIC_ISO8859_5, 2,
|
70
|
1281 CHARSET_TYPE_96, 1, 1, 'L',
|
|
1282 CHARSET_LEFT_TO_RIGHT,
|
167
|
1283 build_string ("ISO 8859-5 (Cyrillic)"),
|
78
|
1284 build_string ("iso8859-5"));
|
74
|
1285 Vcharset_arabic_iso8859_6 =
|
213
|
1286 make_charset (135, Qarabic_iso8859_6, LEADING_BYTE_ARABIC_ISO8859_6, 2,
|
70
|
1287 CHARSET_TYPE_96, 1, 1, 'G',
|
|
1288 CHARSET_RIGHT_TO_LEFT,
|
167
|
1289 build_string ("ISO 8859-6 (Arabic)"),
|
78
|
1290 build_string ("iso8859-6"));
|
74
|
1291 Vcharset_greek_iso8859_7 =
|
213
|
1292 make_charset (134, Qgreek_iso8859_7, LEADING_BYTE_GREEK_ISO8859_7, 2,
|
70
|
1293 CHARSET_TYPE_96, 1, 1, 'F',
|
|
1294 CHARSET_LEFT_TO_RIGHT,
|
167
|
1295 build_string ("ISO 8859-7 (Greek)"),
|
78
|
1296 build_string ("iso8859-7"));
|
74
|
1297 Vcharset_hebrew_iso8859_8 =
|
213
|
1298 make_charset (136, Qhebrew_iso8859_8, LEADING_BYTE_HEBREW_ISO8859_8, 2,
|
70
|
1299 CHARSET_TYPE_96, 1, 1, 'H',
|
|
1300 CHARSET_RIGHT_TO_LEFT,
|
167
|
1301 build_string ("ISO 8859-8 (Hebrew)"),
|
78
|
1302 build_string ("iso8859-8"));
|
74
|
1303 Vcharset_latin_iso8859_9 =
|
213
|
1304 make_charset (141, Qlatin_iso8859_9, LEADING_BYTE_LATIN_ISO8859_9, 2,
|
70
|
1305 CHARSET_TYPE_96, 1, 1, 'M',
|
|
1306 CHARSET_LEFT_TO_RIGHT,
|
167
|
1307 build_string ("ISO 8859-9 (Latin-5)"),
|
78
|
1308 build_string ("iso8859-9"));
|
74
|
1309 Vcharset_thai_tis620 =
|
213
|
1310 make_charset (133, Qthai_tis620, LEADING_BYTE_THAI_TIS620, 2,
|
70
|
1311 CHARSET_TYPE_96, 1, 1, 'T',
|
|
1312 CHARSET_LEFT_TO_RIGHT,
|
167
|
1313 build_string ("TIS 620.2529 (Thai)"),
|
78
|
1314 build_string ("tis620"));
|
70
|
1315
|
|
1316 /* Japanese */
|
74
|
1317 Vcharset_katakana_jisx0201 =
|
213
|
1318 make_charset (137, Qkatakana_jisx0201,
|
74
|
1319 LEADING_BYTE_KATAKANA_JISX0201, 2,
|
70
|
1320 CHARSET_TYPE_94, 1, 1, 'I',
|
|
1321 CHARSET_LEFT_TO_RIGHT,
|
167
|
1322 build_string ("JIS X0201-Katakana"),
|
78
|
1323 build_string ("jisx0201.1976"));
|
74
|
1324 Vcharset_latin_jisx0201 =
|
213
|
1325 make_charset (138, Qlatin_jisx0201,
|
74
|
1326 LEADING_BYTE_LATIN_JISX0201, 2,
|
70
|
1327 CHARSET_TYPE_94, 1, 0, 'J',
|
|
1328 CHARSET_LEFT_TO_RIGHT,
|
167
|
1329 build_string ("JIS X0201-Latin"),
|
78
|
1330 build_string ("jisx0201.1976"));
|
70
|
1331 Vcharset_japanese_jisx0208_1978 =
|
213
|
1332 make_charset (144, Qjapanese_jisx0208_1978,
|
70
|
1333 LEADING_BYTE_JAPANESE_JISX0208_1978, 3,
|
|
1334 CHARSET_TYPE_94X94, 2, 0, '@',
|
|
1335 CHARSET_LEFT_TO_RIGHT,
|
167
|
1336 build_string
|
|
1337 ("JIS X0208-1978 (Japanese Kanji; Old Version)"),
|
78
|
1338 build_string ("\\(jisx0208\\|jisc6226\\).19"));
|
70
|
1339 Vcharset_japanese_jisx0208 =
|
213
|
1340 make_charset (146, Qjapanese_jisx0208,
|
70
|
1341 LEADING_BYTE_JAPANESE_JISX0208, 3,
|
|
1342 CHARSET_TYPE_94X94, 2, 0, 'B',
|
|
1343 CHARSET_LEFT_TO_RIGHT,
|
167
|
1344 build_string ("JIS X0208-1983 (Japanese Kanji)"),
|
78
|
1345 build_string ("jisx0208.19\\(83\\|90\\)"));
|
70
|
1346 Vcharset_japanese_jisx0212 =
|
213
|
1347 make_charset (148, Qjapanese_jisx0212,
|
70
|
1348 LEADING_BYTE_JAPANESE_JISX0212, 3,
|
|
1349 CHARSET_TYPE_94X94, 2, 0, 'D',
|
|
1350 CHARSET_LEFT_TO_RIGHT,
|
167
|
1351 build_string ("JIS X0212 (Japanese Supplement)"),
|
78
|
1352 build_string ("jisx0212"));
|
70
|
1353
|
|
1354 /* Chinese */
|
74
|
1355 Vcharset_chinese_gb2312 =
|
213
|
1356 make_charset (145, Qchinese_gb2312, LEADING_BYTE_CHINESE_GB2312, 3,
|
70
|
1357 CHARSET_TYPE_94X94, 2, 0, 'A',
|
|
1358 CHARSET_LEFT_TO_RIGHT,
|
167
|
1359 build_string ("GB 2312 (Simplified Chinese)"),
|
78
|
1360 build_string ("gb2312"));
|
|
1361 #define CHINESE_CNS_PLANE_RE(n) "cns11643[.-]\\(.*[.-]\\)?" n "$"
|
70
|
1362 Vcharset_chinese_cns11643_1 =
|
213
|
1363 make_charset (149, Qchinese_cns11643_1,
|
70
|
1364 LEADING_BYTE_CHINESE_CNS11643_1, 3,
|
|
1365 CHARSET_TYPE_94X94, 2, 0, 'G',
|
|
1366 CHARSET_LEFT_TO_RIGHT,
|
167
|
1367 build_string
|
|
1368 ("CNS 11643 Plane 1 (Traditional Chinese for daily use)"),
|
70
|
1369 build_string (CHINESE_CNS_PLANE_RE("1")));
|
|
1370 Vcharset_chinese_cns11643_2 =
|
213
|
1371 make_charset (150, Qchinese_cns11643_2,
|
70
|
1372 LEADING_BYTE_CHINESE_CNS11643_2, 3,
|
|
1373 CHARSET_TYPE_94X94, 2, 0, 'H',
|
|
1374 CHARSET_LEFT_TO_RIGHT,
|
167
|
1375 build_string
|
|
1376 ("CNS 11643 Plane 2 (Traditional Chinese for daily use)"),
|
70
|
1377 build_string (CHINESE_CNS_PLANE_RE("2")));
|
|
1378 Vcharset_chinese_big5_1 =
|
213
|
1379 make_charset (152, Qchinese_big5_1, LEADING_BYTE_CHINESE_BIG5_1, 3,
|
70
|
1380 CHARSET_TYPE_94X94, 2, 0, '0',
|
|
1381 CHARSET_LEFT_TO_RIGHT,
|
167
|
1382 build_string
|
|
1383 ("Big5 Level 1 (Traditional Chinese for daily use)"),
|
78
|
1384 build_string ("big5"));
|
70
|
1385 Vcharset_chinese_big5_2 =
|
213
|
1386 make_charset (153, Qchinese_big5_2, LEADING_BYTE_CHINESE_BIG5_2, 3,
|
70
|
1387 CHARSET_TYPE_94X94, 2, 0, '1',
|
|
1388 CHARSET_LEFT_TO_RIGHT,
|
167
|
1389 build_string
|
|
1390 ("Big5 Level 2 (Traditional Chinese for daily use)"),
|
78
|
1391 build_string ("big5"));
|
70
|
1392
|
|
1393 Vcharset_korean_ksc5601 =
|
213
|
1394 make_charset (147, Qkorean_ksc5601, LEADING_BYTE_KOREAN_KSC5601, 3,
|
70
|
1395 CHARSET_TYPE_94X94, 2, 0, 'C',
|
|
1396 CHARSET_LEFT_TO_RIGHT,
|
167
|
1397 build_string ("KS C5601 (Hangul and Korean Hanja)"),
|
78
|
1398 build_string ("ksc5601"));
|
70
|
1399 /* #### For simplicity, we put composite chars into a 96x96 charset.
|
|
1400 This is going to lead to problems because you can run out of
|
|
1401 room, esp. as we don't yet recycle numbers. */
|
|
1402 Vcharset_composite =
|
213
|
1403 make_charset (-1, Qcomposite, LEADING_BYTE_COMPOSITE, 3,
|
70
|
1404 CHARSET_TYPE_96X96, 2, 0, 0,
|
|
1405 CHARSET_LEFT_TO_RIGHT,
|
|
1406 build_string ("Composite characters"),
|
|
1407 build_string (""));
|
|
1408
|
|
1409 composite_char_row_next = 32;
|
|
1410 composite_char_col_next = 32;
|
|
1411
|
|
1412 Vcomposite_char_string2char_hashtable =
|
183
|
1413 make_lisp_hashtable (500, HASHTABLE_NONWEAK, HASHTABLE_EQUAL);
|
70
|
1414 Vcomposite_char_char2string_hashtable =
|
183
|
1415 make_lisp_hashtable (500, HASHTABLE_NONWEAK, HASHTABLE_EQ);
|
70
|
1416 staticpro (&Vcomposite_char_string2char_hashtable);
|
|
1417 staticpro (&Vcomposite_char_char2string_hashtable);
|
|
1418
|
|
1419 }
|