Mercurial > hg > xemacs-beta
annotate src/mule-charset.c @ 5895:b2709239b1f6
Update Postgresql module for 2015 and MacPorts reality.
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Mon, 04 May 2015 14:32:22 +0900 |
parents | 56144c8593a8 |
children |
rev | line source |
---|---|
428 | 1 /* Functions to handle multilingual characters. |
2 Copyright (C) 1992, 1995 Free Software Foundation, Inc. | |
3 Copyright (C) 1995 Sun Microsystems, Inc. | |
5127
a9c41067dd88
more cleanups, terminology clarification, lots of doc work
Ben Wing <ben@xemacs.org>
parents:
5125
diff
changeset
|
4 Copyright (C) 2001, 2002, 2004, 2005, 2010 Ben Wing. |
428 | 5 |
6 This file is part of XEmacs. | |
7 | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5191
diff
changeset
|
8 XEmacs is free software: you can redistribute it and/or modify it |
428 | 9 under the terms of the GNU General Public License as published by the |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5191
diff
changeset
|
10 Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5191
diff
changeset
|
11 option) any later version. |
428 | 12 |
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5191
diff
changeset
|
19 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */ |
428 | 20 |
21 /* Synched up with: FSF 20.3. Not in FSF. */ | |
22 | |
23 /* Rewritten by Ben Wing <ben@xemacs.org>. */ | |
24 | |
25 #include <config.h> | |
26 #include "lisp.h" | |
27 | |
28 #include "buffer.h" | |
29 #include "chartab.h" | |
30 #include "elhash.h" | |
31 #include "device.h" | |
32 #include "faces.h" | |
771 | 33 #include "lstream.h" |
428 | 34 #include "mule-ccl.h" |
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4953
diff
changeset
|
35 #include "fontcolor.h" |
3659 | 36 #include "specifier.h" |
428 | 37 |
38 /* The various pre-defined charsets. */ | |
39 | |
40 Lisp_Object Vcharset_ascii; | |
41 Lisp_Object Vcharset_control_1; | |
42 Lisp_Object Vcharset_latin_iso8859_1; | |
43 Lisp_Object Vcharset_latin_iso8859_2; | |
44 Lisp_Object Vcharset_latin_iso8859_3; | |
45 Lisp_Object Vcharset_latin_iso8859_4; | |
46 Lisp_Object Vcharset_thai_tis620; | |
47 Lisp_Object Vcharset_greek_iso8859_7; | |
4805
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
48 Lisp_Object Vcharset_arabic_iso8859_6; |
428 | 49 Lisp_Object Vcharset_hebrew_iso8859_8; |
50 Lisp_Object Vcharset_katakana_jisx0201; | |
51 Lisp_Object Vcharset_latin_jisx0201; | |
52 Lisp_Object Vcharset_cyrillic_iso8859_5; | |
53 Lisp_Object Vcharset_latin_iso8859_9; | |
728 | 54 Lisp_Object Vcharset_latin_iso8859_15; |
428 | 55 Lisp_Object Vcharset_japanese_jisx0208_1978; |
56 Lisp_Object Vcharset_chinese_gb2312; | |
57 Lisp_Object Vcharset_japanese_jisx0208; | |
58 Lisp_Object Vcharset_korean_ksc5601; | |
59 Lisp_Object Vcharset_japanese_jisx0212; | |
60 Lisp_Object Vcharset_chinese_cns11643_1; | |
61 Lisp_Object Vcharset_chinese_cns11643_2; | |
62 Lisp_Object Vcharset_chinese_big5_1; | |
63 Lisp_Object Vcharset_chinese_big5_2; | |
64 Lisp_Object Vcharset_composite; | |
65 | |
66 struct charset_lookup *chlook; | |
67 | |
1204 | 68 static const struct memory_description charset_lookup_description_1[] = { |
771 | 69 { XD_LISP_OBJECT_ARRAY, offsetof (struct charset_lookup, charset_by_leading_byte), NUM_LEADING_BYTES+4*128*2 }, |
428 | 70 { XD_END } |
71 }; | |
72 | |
1204 | 73 static const struct sized_memory_description charset_lookup_description = { |
440 | 74 sizeof (struct charset_lookup), |
428 | 75 charset_lookup_description_1 |
76 }; | |
77 | |
78 Lisp_Object Qcharsetp; | |
79 | |
3664 | 80 /* Qdoc_string, Qdimension, Qchars, Qfinal defined in general.c */ |
81 Lisp_Object Qregistries, Qgraphic, Qregistry; | |
428 | 82 Lisp_Object Qdirection; |
83 Lisp_Object Qreverse_direction_charset; | |
84 Lisp_Object Qshort_name, Qlong_name; | |
85 | |
4691
3ba90c659d01
Move Qfrom_unicode to general-slots.h, fix the native Win32 build.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4491
diff
changeset
|
86 Lisp_Object Qto_unicode; |
771 | 87 |
88 Lisp_Object | |
428 | 89 Qlatin_iso8859_1, |
90 Qlatin_iso8859_2, | |
91 Qlatin_iso8859_3, | |
92 Qlatin_iso8859_4, | |
93 Qthai_tis620, | |
94 Qgreek_iso8859_7, | |
4805
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
95 Qarabic_iso8859_6, |
428 | 96 Qhebrew_iso8859_8, |
97 Qkatakana_jisx0201, | |
98 Qlatin_jisx0201, | |
99 Qcyrillic_iso8859_5, | |
100 Qlatin_iso8859_9, | |
728 | 101 Qlatin_iso8859_15, |
428 | 102 Qjapanese_jisx0208_1978, |
103 Qchinese_gb2312, | |
104 Qjapanese_jisx0208, | |
105 Qkorean_ksc5601, | |
106 Qjapanese_jisx0212, | |
107 Qchinese_cns11643_1, | |
108 Qchinese_cns11643_2, | |
109 Qchinese_big5_1, | |
110 Qchinese_big5_2, | |
111 Qcomposite; | |
112 | |
113 Lisp_Object Ql2r, Qr2l; | |
114 | |
115 Lisp_Object Vcharset_hash_table; | |
116 | |
117 | |
118 /************************************************************************/ | |
119 /* charset object */ | |
120 /************************************************************************/ | |
121 | |
122 static Lisp_Object | |
123 mark_charset (Lisp_Object obj) | |
124 { | |
440 | 125 Lisp_Charset *cs = XCHARSET (obj); |
428 | 126 |
127 mark_object (cs->short_name); | |
128 mark_object (cs->long_name); | |
129 mark_object (cs->doc_string); | |
3659 | 130 mark_object (cs->registries); |
428 | 131 mark_object (cs->ccl_program); |
132 return cs->name; | |
133 } | |
134 | |
135 static void | |
2286 | 136 print_charset (Lisp_Object obj, Lisp_Object printcharfun, |
137 int UNUSED (escapeflag)) | |
428 | 138 { |
440 | 139 Lisp_Charset *cs = XCHARSET (obj); |
428 | 140 |
141 if (print_readably) | |
5142
f965e31a35f0
reduce lcrecord headers to 2 words, rename printing_unreadable_object
Ben Wing <ben@xemacs.org>
parents:
5127
diff
changeset
|
142 printing_unreadable_lisp_object |
4846 | 143 (obj, XSTRING_DATA (XSYMBOL (XCHARSET_NAME (obj))->name)); |
428 | 144 |
771 | 145 write_fmt_string_lisp (printcharfun, "#<charset %s %S %S %S", 4, |
146 CHARSET_NAME (cs), CHARSET_SHORT_NAME (cs), | |
147 CHARSET_LONG_NAME (cs), CHARSET_DOC_STRING (cs)); | |
148 write_fmt_string (printcharfun, " %s %s cols=%d g%d final='%c' reg=", | |
149 CHARSET_TYPE (cs) == CHARSET_TYPE_94 ? "94" : | |
150 CHARSET_TYPE (cs) == CHARSET_TYPE_96 ? "96" : | |
151 CHARSET_TYPE (cs) == CHARSET_TYPE_94X94 ? "94x94" : | |
152 "96x96", | |
153 CHARSET_DIRECTION (cs) == CHARSET_LEFT_TO_RIGHT ? "l2r" : | |
154 "r2l", | |
155 CHARSET_COLUMNS (cs), | |
156 CHARSET_GRAPHIC (cs), | |
157 CHARSET_FINAL (cs)); | |
3659 | 158 print_internal (CHARSET_REGISTRIES (cs), printcharfun, 0); |
5146
88bd4f3ef8e4
make lrecord UID's have a separate UID space for each object, resurrect debug SOE code in extents.c
Ben Wing <ben@xemacs.org>
parents:
5142
diff
changeset
|
159 write_fmt_string (printcharfun, " 0x%x>", LISP_OBJECT_UID (obj)); |
771 | 160 } |
161 | |
1204 | 162 static const struct memory_description charset_description[] = { |
163 { XD_INT, offsetof (Lisp_Charset, dimension) }, | |
164 { XD_INT, offsetof (Lisp_Charset, from_unicode_levels) }, | |
440 | 165 { XD_LISP_OBJECT, offsetof (Lisp_Charset, name) }, |
166 { XD_LISP_OBJECT, offsetof (Lisp_Charset, doc_string) }, | |
3659 | 167 { XD_LISP_OBJECT, offsetof (Lisp_Charset, registries) }, |
440 | 168 { XD_LISP_OBJECT, offsetof (Lisp_Charset, short_name) }, |
169 { XD_LISP_OBJECT, offsetof (Lisp_Charset, long_name) }, | |
170 { XD_LISP_OBJECT, offsetof (Lisp_Charset, reverse_direction_charset) }, | |
171 { XD_LISP_OBJECT, offsetof (Lisp_Charset, ccl_program) }, | |
771 | 172 { XD_UNION, offsetof (Lisp_Charset, to_unicode_table), |
2775 | 173 XD_INDIRECT (0, 0), { &to_unicode_description }, XD_FLAG_NO_KKCC }, |
771 | 174 { XD_UNION, offsetof (Lisp_Charset, from_unicode_table), |
2775 | 175 XD_INDIRECT (1, 0), { &from_unicode_description }, XD_FLAG_NO_KKCC }, |
428 | 176 { XD_END } |
177 }; | |
178 | |
5118
e0db3c197671
merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
diff
changeset
|
179 DEFINE_DUMPABLE_LISP_OBJECT ("charset", charset, |
5124
623d57b7fbe8
separate regular and disksave finalization, print method fixes.
Ben Wing <ben@xemacs.org>
parents:
5120
diff
changeset
|
180 mark_charset, print_charset, 0, |
623d57b7fbe8
separate regular and disksave finalization, print method fixes.
Ben Wing <ben@xemacs.org>
parents:
5120
diff
changeset
|
181 0, 0, charset_description, Lisp_Charset); |
428 | 182 /* Make a new charset. */ |
446 | 183 /* #### SJT Should generic properties be allowed? */ |
428 | 184 static Lisp_Object |
771 | 185 make_charset (int id, Lisp_Object name, int rep_bytes, |
186 int type, int columns, int graphic, | |
867 | 187 Ibyte final, int direction, Lisp_Object short_name, |
428 | 188 Lisp_Object long_name, Lisp_Object doc, |
3439 | 189 Lisp_Object reg, int overwrite, int encode_as_utf_8) |
428 | 190 { |
191 Lisp_Object obj; | |
771 | 192 Lisp_Charset *cs; |
193 | |
194 if (!overwrite) | |
195 { | |
5127
a9c41067dd88
more cleanups, terminology clarification, lots of doc work
Ben Wing <ben@xemacs.org>
parents:
5125
diff
changeset
|
196 obj = ALLOC_NORMAL_LISP_OBJECT (charset); |
5117
3742ea8250b5
Checking in final CVS version of workspace 'ben-lisp-object'
Ben Wing <ben@xemacs.org>
parents:
3025
diff
changeset
|
197 cs = XCHARSET (obj); |
771 | 198 |
199 if (final) | |
200 { | |
201 /* some charsets do not have final characters. This includes | |
202 ASCII, Control-1, Composite, and the two faux private | |
203 charsets. */ | |
204 assert (NILP (chlook-> | |
205 charset_by_attributes[type][final][direction])); | |
206 chlook->charset_by_attributes[type][final][direction] = obj; | |
207 } | |
440 | 208 |
771 | 209 assert (NILP (chlook->charset_by_leading_byte[id - MIN_LEADING_BYTE])); |
210 chlook->charset_by_leading_byte[id - MIN_LEADING_BYTE] = obj; | |
211 } | |
212 else | |
213 { | |
214 Lisp_Object ret; | |
215 /* Actually overwrite the properties of the existing charset. | |
216 We do this because until now charsets could never be "deleted", | |
217 so parts of the code don't bother to GC charsets. */ | |
218 obj = chlook->charset_by_leading_byte[id - MIN_LEADING_BYTE]; | |
219 cs = XCHARSET (obj); | |
220 assert (EQ (chlook->charset_by_attributes[type][final][direction], | |
221 obj)); | |
222 | |
223 ret = Fremhash (XCHARSET_NAME (obj), Vcharset_hash_table); | |
224 assert (!NILP (ret)); | |
225 } | |
428 | 226 |
227 CHARSET_ID (cs) = id; | |
228 CHARSET_NAME (cs) = name; | |
229 CHARSET_SHORT_NAME (cs) = short_name; | |
230 CHARSET_LONG_NAME (cs) = long_name; | |
231 CHARSET_REP_BYTES (cs) = rep_bytes; | |
232 CHARSET_DIRECTION (cs) = direction; | |
233 CHARSET_TYPE (cs) = type; | |
234 CHARSET_COLUMNS (cs) = columns; | |
235 CHARSET_GRAPHIC (cs) = graphic; | |
236 CHARSET_FINAL (cs) = final; | |
237 CHARSET_DOC_STRING (cs) = doc; | |
3659 | 238 CHECK_VECTOR(reg); |
239 CHARSET_REGISTRIES (cs) = reg; | |
3439 | 240 CHARSET_ENCODE_AS_UTF_8 (cs) = encode_as_utf_8 ? 1 : 0; |
428 | 241 CHARSET_CCL_PROGRAM (cs) = Qnil; |
242 CHARSET_REVERSE_DIRECTION_CHARSET (cs) = Qnil; | |
243 | |
771 | 244 CHARSET_DIMENSION (cs) = (CHARSET_TYPE (cs) == CHARSET_TYPE_94 || |
245 CHARSET_TYPE (cs) == CHARSET_TYPE_96) ? 1 : 2; | |
246 CHARSET_CHARS (cs) = (CHARSET_TYPE (cs) == CHARSET_TYPE_94 || | |
247 CHARSET_TYPE (cs) == CHARSET_TYPE_94X94) ? 94 : 96; | |
428 | 248 |
771 | 249 if (id == LEADING_BYTE_ASCII || id == LEADING_BYTE_CONTROL_1 |
250 #ifdef ENABLE_COMPOSITE_CHARS | |
251 || id == LEADING_BYTE_COMPOSITE | |
252 #endif | |
253 ) | |
254 assert (!overwrite); | |
255 else | |
428 | 256 { |
771 | 257 if (overwrite) |
258 free_charset_unicode_tables (obj); | |
259 init_charset_unicode_tables (obj); | |
428 | 260 } |
261 | |
262 /* Some charsets are "faux" and don't have names or really exist at | |
263 all except in the leading-byte table. */ | |
264 if (!NILP (name)) | |
771 | 265 { |
266 assert (NILP (Fgethash (name, Vcharset_hash_table, Qnil))); | |
267 Fputhash (name, obj, Vcharset_hash_table); | |
268 } | |
269 | |
270 recalculate_unicode_precedence (); | |
3659 | 271 setup_charset_initial_specifier_tags (obj); |
272 | |
428 | 273 return obj; |
274 } | |
275 | |
276 static int | |
277 get_unallocated_leading_byte (int dimension) | |
278 { | |
279 int lb; | |
280 | |
281 if (dimension == 1) | |
282 { | |
771 | 283 if (chlook->next_allocated_1_byte_leading_byte > |
284 MAX_LEADING_BYTE_PRIVATE_1) | |
428 | 285 lb = 0; |
286 else | |
442 | 287 lb = chlook->next_allocated_1_byte_leading_byte++; |
428 | 288 } |
289 else | |
290 { | |
1747 | 291 /* awfully fragile, but correct */ |
292 #if MAX_LEADING_BYTE_PRIVATE_2 == 255 | |
293 if (chlook->next_allocated_2_byte_leading_byte == 0) | |
1749 | 294 #else |
771 | 295 if (chlook->next_allocated_2_byte_leading_byte > |
296 MAX_LEADING_BYTE_PRIVATE_2) | |
1747 | 297 #endif |
428 | 298 lb = 0; |
299 else | |
442 | 300 lb = chlook->next_allocated_2_byte_leading_byte++; |
428 | 301 } |
302 | |
303 if (!lb) | |
563 | 304 invalid_operation |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
305 ("No more character sets free for this dimension", make_fixnum (dimension)); |
428 | 306 |
307 return lb; | |
308 } | |
309 | |
310 | |
311 /************************************************************************/ | |
312 /* Basic charset Lisp functions */ | |
313 /************************************************************************/ | |
314 | |
788 | 315 void |
316 get_charset_limits (Lisp_Object charset, int *low, int *high) | |
317 { | |
318 Lisp_Charset *cs = XCHARSET (charset); | |
319 | |
320 if (EQ (charset, Vcharset_ascii)) *low = 0, *high = 127; | |
321 else if (EQ (charset, Vcharset_control_1)) *low = 0, *high = 31; | |
322 else if (CHARSET_CHARS (cs) == 94) *low = 33, *high = 126; | |
323 else /* CHARSET_CHARS (cs) == 96) */ *low = 32, *high = 127; | |
324 } | |
325 | |
428 | 326 DEFUN ("charsetp", Fcharsetp, 1, 1, 0, /* |
327 Return non-nil if OBJECT is a charset. | |
328 */ | |
329 (object)) | |
330 { | |
331 return CHARSETP (object) ? Qt : Qnil; | |
332 } | |
333 | |
334 DEFUN ("find-charset", Ffind_charset, 1, 1, 0, /* | |
335 Retrieve the charset of the given name. | |
336 If CHARSET-OR-NAME is a charset object, it is simply returned. | |
337 Otherwise, CHARSET-OR-NAME should be a symbol. If there is no such charset, | |
338 nil is returned. Otherwise the associated charset object is returned. | |
339 */ | |
340 (charset_or_name)) | |
341 { | |
342 if (CHARSETP (charset_or_name)) | |
343 return charset_or_name; | |
344 | |
345 CHECK_SYMBOL (charset_or_name); | |
346 return Fgethash (charset_or_name, Vcharset_hash_table, Qnil); | |
347 } | |
348 | |
349 DEFUN ("get-charset", Fget_charset, 1, 1, 0, /* | |
350 Retrieve the charset of the given name. | |
351 Same as `find-charset' except an error is signalled if there is no such | |
352 charset instead of returning nil. | |
353 */ | |
354 (name)) | |
355 { | |
356 Lisp_Object charset = Ffind_charset (name); | |
357 | |
358 if (NILP (charset)) | |
563 | 359 invalid_argument ("No such charset", name); |
428 | 360 return charset; |
361 } | |
362 | |
363 /* We store the charsets in hash tables with the names as the key and the | |
364 actual charset object as the value. Occasionally we need to use them | |
365 in a list format. These routines provide us with that. */ | |
366 struct charset_list_closure | |
367 { | |
368 Lisp_Object *charset_list; | |
369 }; | |
370 | |
371 static int | |
2286 | 372 add_charset_to_list_mapper (Lisp_Object UNUSED (key), Lisp_Object value, |
428 | 373 void *charset_list_closure) |
374 { | |
375 /* This function can GC */ | |
376 struct charset_list_closure *chcl = | |
377 (struct charset_list_closure*) charset_list_closure; | |
378 Lisp_Object *charset_list = chcl->charset_list; | |
379 | |
380 *charset_list = Fcons (XCHARSET_NAME (value), *charset_list); | |
381 return 0; | |
382 } | |
383 | |
384 DEFUN ("charset-list", Fcharset_list, 0, 0, 0, /* | |
385 Return a list of the names of all defined charsets. | |
386 */ | |
387 ()) | |
388 { | |
389 Lisp_Object charset_list = Qnil; | |
390 struct gcpro gcpro1; | |
391 struct charset_list_closure charset_list_closure; | |
392 | |
393 GCPRO1 (charset_list); | |
394 charset_list_closure.charset_list = &charset_list; | |
395 elisp_maphash (add_charset_to_list_mapper, Vcharset_hash_table, | |
396 &charset_list_closure); | |
397 UNGCPRO; | |
398 | |
399 return charset_list; | |
400 } | |
401 | |
402 DEFUN ("charset-name", Fcharset_name, 1, 1, 0, /* | |
444 | 403 Return the name of charset CHARSET. |
428 | 404 */ |
405 (charset)) | |
406 { | |
407 return XCHARSET_NAME (Fget_charset (charset)); | |
408 } | |
409 | |
446 | 410 /* #### SJT Should generic properties be allowed? */ |
428 | 411 DEFUN ("make-charset", Fmake_charset, 3, 3, 0, /* |
412 Define a new character set. | |
413 This function is for use with Mule support. | |
414 NAME is a symbol, the name by which the character set is normally referred. | |
415 DOC-STRING is a string describing the character set. | |
416 PROPS is a property list, describing the specific nature of the | |
417 character set. Recognized properties are: | |
418 | |
3025 | 419 `short-name' Short version of the charset name (ex: Latin-1) |
420 `long-name' Long version of the charset name (ex: ISO8859-1 (Latin-1)) | |
3659 | 421 `registries' A vector of possible XLFD REGISTRY-ENCODING combinations for |
422 this character set. Note that this is not a regular expression. | |
3025 | 423 `dimension' Number of octets used to index a character in this charset. |
428 | 424 Either 1 or 2. Defaults to 1. |
3025 | 425 `columns' Number of columns used to display a character in this charset. |
428 | 426 Only used in TTY mode. (Under X, the actual width of a |
427 character can be derived from the font used to display the | |
428 characters.) If unspecified, defaults to the dimension | |
429 (this is almost always the correct value). | |
3025 | 430 `chars' Number of characters in each dimension (94 or 96). |
428 | 431 Defaults to 94. Note that if the dimension is 2, the |
432 character set thus described is 94x94 or 96x96. | |
3025 | 433 `final' Final byte of ISO 2022 escape sequence. Must be |
428 | 434 supplied. Each combination of (DIMENSION, CHARS) defines a |
435 separate namespace for final bytes. Note that ISO | |
436 2022 restricts the final byte to the range | |
437 0x30 - 0x7E if dimension == 1, and 0x30 - 0x5F if | |
438 dimension == 2. Note also that final bytes in the range | |
439 0x30 - 0x3F are reserved for user-defined (not official) | |
440 character sets. | |
3025 | 441 `graphic' 0 (use left half of font on output) or 1 (use right half |
428 | 442 of font on output). Defaults to 0. For example, for |
443 a font whose registry is ISO8859-1, the left half | |
444 (octets 0x20 - 0x7F) is the `ascii' character set, while | |
445 the right half (octets 0xA0 - 0xFF) is the `latin-1' | |
3025 | 446 character set. With `graphic' set to 0, the octets |
428 | 447 will have their high bit cleared; with it set to 1, |
448 the octets will have their high bit set. | |
3025 | 449 `direction' `l2r' (left-to-right) or `r2l' (right-to-left). |
450 Defaults to `l2r'. | |
451 `ccl-program' A compiled CCL program used to convert a character in | |
428 | 452 this charset into an index into the font. This is in |
3025 | 453 addition to the `graphic' property. The CCL program |
428 | 454 is passed the octets of the character, with the high |
455 bit cleared and set depending upon whether the value | |
3025 | 456 of the `graphic' property is 0 or 1. |
3439 | 457 `encode-as-utf-8' |
458 If non-nil, the charset will be written out using the UTF-8 | |
459 escape syntax in ISO 2022-oriented coding systems. Used for | |
460 supporting characters we know are part of Unicode but not of | |
461 any other known character set in escape-quoted and compound | |
462 text. | |
428 | 463 */ |
464 (name, doc_string, props)) | |
465 { | |
771 | 466 int id, dimension = 1, chars = 94, graphic = 0, columns = -1; |
867 | 467 Ibyte final = 0; |
428 | 468 int direction = CHARSET_LEFT_TO_RIGHT; |
469 int type; | |
3659 | 470 Lisp_Object registries = Qnil; |
771 | 471 Lisp_Object charset = Qnil; |
428 | 472 Lisp_Object ccl_program = Qnil; |
473 Lisp_Object short_name = Qnil, long_name = Qnil; | |
3439 | 474 int encode_as_utf_8 = 0; |
771 | 475 Lisp_Object existing_charset; |
476 int temporary = UNBOUNDP (name); | |
428 | 477 |
771 | 478 /* NOTE: name == Qunbound is a directive from the iso2022 code to |
479 create a temporary charset for an unknown final. We allow the final | |
480 to be overwritten with a real charset later on. */ | |
481 | |
428 | 482 if (!NILP (doc_string)) |
483 CHECK_STRING (doc_string); | |
771 | 484 if (!UNBOUNDP (name)) |
485 { | |
486 CHECK_SYMBOL (name); | |
428 | 487 |
771 | 488 charset = Ffind_charset (name); |
489 if (!NILP (charset)) | |
490 invalid_operation ("Cannot redefine existing charset", name); | |
491 } | |
428 | 492 |
442 | 493 { |
494 EXTERNAL_PROPERTY_LIST_LOOP_3 (keyword, value, props) | |
495 { | |
496 if (EQ (keyword, Qshort_name)) | |
497 { | |
498 CHECK_STRING (value); | |
499 short_name = value; | |
500 } | |
428 | 501 |
519 | 502 else if (EQ (keyword, Qlong_name)) |
442 | 503 { |
504 CHECK_STRING (value); | |
505 long_name = value; | |
506 } | |
428 | 507 |
442 | 508 else if (EQ (keyword, Qdimension)) |
509 { | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
510 CHECK_FIXNUM (value); |
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
511 dimension = XFIXNUM (value); |
442 | 512 if (dimension < 1 || dimension > 2) |
3025 | 513 invalid_constant ("Invalid value for `dimension'", value); |
442 | 514 } |
428 | 515 |
442 | 516 else if (EQ (keyword, Qchars)) |
517 { | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
518 CHECK_FIXNUM (value); |
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
519 chars = XFIXNUM (value); |
442 | 520 if (chars != 94 && chars != 96) |
3025 | 521 invalid_constant ("Invalid value for `chars'", value); |
442 | 522 } |
428 | 523 |
442 | 524 else if (EQ (keyword, Qcolumns)) |
525 { | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
526 CHECK_FIXNUM (value); |
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
527 columns = XFIXNUM (value); |
442 | 528 if (columns != 1 && columns != 2) |
3025 | 529 invalid_constant ("Invalid value for `columns'", value); |
442 | 530 } |
428 | 531 |
442 | 532 else if (EQ (keyword, Qgraphic)) |
533 { | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
534 CHECK_FIXNUM (value); |
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
535 graphic = XFIXNUM (value); |
442 | 536 if (graphic < 0 || graphic > 1) |
3025 | 537 invalid_constant ("Invalid value for `graphic'", value); |
442 | 538 } |
428 | 539 |
3659 | 540 else if (EQ (keyword, Qregistries)) |
541 { | |
542 CHECK_VECTOR (value); | |
543 registries = value; | |
544 } | |
545 | |
442 | 546 else if (EQ (keyword, Qregistry)) |
547 { | |
3659 | 548 Lisp_Object quoted_registry; |
549 | |
442 | 550 CHECK_STRING (value); |
3659 | 551 quoted_registry = Fregexp_quote(value); |
3662 | 552 if (qxestrcmp(XSTRING_DATA(quoted_registry), |
3659 | 553 XSTRING_DATA(value))) |
554 { | |
555 warn_when_safe | |
556 (Qregistry, Qwarning, | |
557 "Regexps no longer allowed for charset-registry. " | |
558 "Treating %s as string", XSTRING_DATA(value)); | |
559 } | |
560 registries = vector1(value); | |
442 | 561 } |
428 | 562 |
442 | 563 else if (EQ (keyword, Qdirection)) |
564 { | |
565 if (EQ (value, Ql2r)) | |
566 direction = CHARSET_LEFT_TO_RIGHT; | |
567 else if (EQ (value, Qr2l)) | |
568 direction = CHARSET_RIGHT_TO_LEFT; | |
569 else | |
3025 | 570 invalid_constant ("Invalid value for `direction'", value); |
442 | 571 } |
428 | 572 |
3439 | 573 else if (EQ (keyword, Qencode_as_utf_8)) |
574 { | |
575 encode_as_utf_8 = NILP (value) ? 0 : 1; | |
576 } | |
577 | |
442 | 578 else if (EQ (keyword, Qfinal)) |
579 { | |
580 CHECK_CHAR_COERCE_INT (value); | |
581 final = XCHAR (value); | |
582 if (final < '0' || final > '~') | |
3025 | 583 invalid_constant ("Invalid value for `final'", value); |
442 | 584 } |
585 else if (EQ (keyword, Qccl_program)) | |
586 { | |
4745
0c54de4c4b9d
Resolve the unregistered-CCL-programs-get-garbage-collected problem correctly
Aidan Kehoe <kehoea@parhasard.net>
parents:
4691
diff
changeset
|
587 /* This errors if VALUE is not a valid CCL program. */ |
0c54de4c4b9d
Resolve the unregistered-CCL-programs-get-garbage-collected problem correctly
Aidan Kehoe <kehoea@parhasard.net>
parents:
4691
diff
changeset
|
588 ccl_program = get_ccl_program (value); |
442 | 589 } |
590 else | |
563 | 591 invalid_constant ("Unrecognized property", keyword); |
442 | 592 } |
593 } | |
428 | 594 |
595 if (!final) | |
3025 | 596 invalid_argument ("`final' must be specified", Qunbound); |
428 | 597 if (dimension == 2 && final > 0x5F) |
563 | 598 invalid_constant |
428 | 599 ("Final must be in the range 0x30 - 0x5F for dimension == 2", |
600 make_char (final)); | |
601 | |
602 if (dimension == 1) | |
603 type = (chars == 94) ? CHARSET_TYPE_94 : CHARSET_TYPE_96; | |
604 else | |
605 type = (chars == 94) ? CHARSET_TYPE_94X94 : CHARSET_TYPE_96X96; | |
606 | |
826 | 607 existing_charset = charset_by_attributes (type, final, direction); |
771 | 608 |
609 if (!NILP (existing_charset) && !XCHARSET (existing_charset)->temporary) | |
578 | 610 invalid_argument |
793 | 611 ("Character set already defined for this DIMENSION/CHARS/FINAL/DIRECTION combo", |
771 | 612 existing_charset); |
613 | |
614 if (!NILP (existing_charset)) | |
615 /* Reuse same leading byte */ | |
616 id = XCHARSET_ID (existing_charset); | |
617 else | |
618 id = get_unallocated_leading_byte (dimension); | |
428 | 619 |
771 | 620 if (temporary) |
621 { | |
867 | 622 Ibyte tempname[80]; |
428 | 623 |
771 | 624 qxesprintf (tempname, "___temporary___%d__", id); |
4953
304aebb79cd3
function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents:
4952
diff
changeset
|
625 name = Fmake_symbol (build_istring (tempname)); /* Uninterned. */ |
771 | 626 } |
428 | 627 if (NILP (doc_string)) |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
628 doc_string = build_ascstring (""); |
3659 | 629 if (NILP (registries)) |
630 registries = make_vector(0, Qnil); | |
428 | 631 if (NILP (short_name)) |
793 | 632 short_name = XSYMBOL (name)->name; |
428 | 633 if (NILP (long_name)) |
634 long_name = doc_string; | |
635 if (columns == -1) | |
636 columns = dimension; | |
771 | 637 |
428 | 638 charset = make_charset (id, name, dimension + 2, type, columns, graphic, |
771 | 639 final, direction, short_name, long_name, |
3659 | 640 doc_string, registries, !NILP (existing_charset), |
3439 | 641 encode_as_utf_8); |
771 | 642 |
643 XCHARSET (charset)->temporary = temporary; | |
428 | 644 if (!NILP (ccl_program)) |
645 XCHARSET_CCL_PROGRAM (charset) = ccl_program; | |
771 | 646 |
793 | 647 { |
648 Lisp_Object revdircs = | |
826 | 649 charset_by_attributes (type, final, |
793 | 650 direction == CHARSET_LEFT_TO_RIGHT ? |
651 CHARSET_RIGHT_TO_LEFT : CHARSET_LEFT_TO_RIGHT); | |
652 if (!NILP (revdircs)) | |
653 { | |
654 XCHARSET_REVERSE_DIRECTION_CHARSET (revdircs) = charset; | |
655 XCHARSET_REVERSE_DIRECTION_CHARSET (charset) = revdircs; | |
656 } | |
657 } | |
658 | |
428 | 659 return charset; |
660 } | |
661 | |
662 DEFUN ("make-reverse-direction-charset", Fmake_reverse_direction_charset, | |
663 2, 2, 0, /* | |
664 Make a charset equivalent to CHARSET but which goes in the opposite direction. | |
665 NEW-NAME is the name of the new charset. Return the new charset. | |
666 */ | |
667 (charset, new_name)) | |
668 { | |
669 Lisp_Object new_charset = Qnil; | |
3439 | 670 int id, dimension, columns, graphic, encode_as_utf_8; |
867 | 671 Ibyte final; |
428 | 672 int direction, type; |
3659 | 673 Lisp_Object registries, doc_string, short_name, long_name; |
440 | 674 Lisp_Charset *cs; |
428 | 675 |
676 charset = Fget_charset (charset); | |
677 if (!NILP (XCHARSET_REVERSE_DIRECTION_CHARSET (charset))) | |
563 | 678 invalid_operation ("Charset already has reverse-direction charset", |
793 | 679 charset); |
428 | 680 |
681 CHECK_SYMBOL (new_name); | |
682 if (!NILP (Ffind_charset (new_name))) | |
563 | 683 invalid_operation ("Cannot redefine existing charset", new_name); |
428 | 684 |
685 cs = XCHARSET (charset); | |
686 | |
687 type = CHARSET_TYPE (cs); | |
688 columns = CHARSET_COLUMNS (cs); | |
689 dimension = CHARSET_DIMENSION (cs); | |
690 id = get_unallocated_leading_byte (dimension); | |
691 | |
692 graphic = CHARSET_GRAPHIC (cs); | |
693 final = CHARSET_FINAL (cs); | |
694 direction = CHARSET_RIGHT_TO_LEFT; | |
695 if (CHARSET_DIRECTION (cs) == CHARSET_RIGHT_TO_LEFT) | |
696 direction = CHARSET_LEFT_TO_RIGHT; | |
697 doc_string = CHARSET_DOC_STRING (cs); | |
698 short_name = CHARSET_SHORT_NAME (cs); | |
699 long_name = CHARSET_LONG_NAME (cs); | |
3659 | 700 registries = CHARSET_REGISTRIES (cs); |
3439 | 701 encode_as_utf_8 = CHARSET_ENCODE_AS_UTF_8 (cs); |
428 | 702 |
703 new_charset = make_charset (id, new_name, dimension + 2, type, columns, | |
704 graphic, final, direction, short_name, long_name, | |
3659 | 705 doc_string, registries, 0, encode_as_utf_8); |
428 | 706 |
707 CHARSET_REVERSE_DIRECTION_CHARSET (cs) = new_charset; | |
708 XCHARSET_REVERSE_DIRECTION_CHARSET (new_charset) = charset; | |
709 | |
710 return new_charset; | |
711 } | |
712 | |
713 DEFUN ("charset-reverse-direction-charset", Fcharset_reverse_direction_charset, | |
714 1, 1, 0, /* | |
715 Return the reverse-direction charset parallel to CHARSET, if any. | |
716 This is the charset with the same properties (in particular, the same | |
717 dimension, number of characters per dimension, and final byte) as | |
718 CHARSET but whose characters are displayed in the opposite direction. | |
719 */ | |
720 (charset)) | |
721 { | |
722 charset = Fget_charset (charset); | |
723 return XCHARSET_REVERSE_DIRECTION_CHARSET (charset); | |
724 } | |
725 | |
726 DEFUN ("charset-from-attributes", Fcharset_from_attributes, 3, 4, 0, /* | |
727 Return a charset with the given DIMENSION, CHARS, FINAL, and DIRECTION. | |
728 If DIRECTION is omitted, both directions will be checked (left-to-right | |
729 will be returned if character sets exist for both directions). | |
730 */ | |
731 (dimension, chars, final, direction)) | |
732 { | |
733 int dm, ch, fi, di = -1; | |
734 int type; | |
735 Lisp_Object obj = Qnil; | |
736 | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
737 CHECK_FIXNUM (dimension); |
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
738 dm = XFIXNUM (dimension); |
428 | 739 if (dm < 1 || dm > 2) |
563 | 740 invalid_constant ("Invalid value for DIMENSION", dimension); |
428 | 741 |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
742 CHECK_FIXNUM (chars); |
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
743 ch = XFIXNUM (chars); |
428 | 744 if (ch != 94 && ch != 96) |
563 | 745 invalid_constant ("Invalid value for CHARS", chars); |
428 | 746 |
747 CHECK_CHAR_COERCE_INT (final); | |
748 fi = XCHAR (final); | |
749 if (fi < '0' || fi > '~') | |
563 | 750 invalid_constant ("Invalid value for FINAL", final); |
428 | 751 |
752 if (EQ (direction, Ql2r)) | |
753 di = CHARSET_LEFT_TO_RIGHT; | |
754 else if (EQ (direction, Qr2l)) | |
755 di = CHARSET_RIGHT_TO_LEFT; | |
756 else if (!NILP (direction)) | |
563 | 757 invalid_constant ("Invalid value for DIRECTION", direction); |
428 | 758 |
759 if (dm == 2 && fi > 0x5F) | |
563 | 760 invalid_constant |
428 | 761 ("Final must be in the range 0x30 - 0x5F for dimension == 2", final); |
762 | |
763 if (dm == 1) | |
764 type = (ch == 94) ? CHARSET_TYPE_94 : CHARSET_TYPE_96; | |
765 else | |
766 type = (ch == 94) ? CHARSET_TYPE_94X94 : CHARSET_TYPE_96X96; | |
767 | |
768 if (di == -1) | |
769 { | |
826 | 770 obj = charset_by_attributes (type, fi, CHARSET_LEFT_TO_RIGHT); |
428 | 771 if (NILP (obj)) |
826 | 772 obj = charset_by_attributes (type, fi, CHARSET_RIGHT_TO_LEFT); |
428 | 773 } |
774 else | |
826 | 775 obj = charset_by_attributes (type, fi, di); |
428 | 776 |
777 if (CHARSETP (obj)) | |
778 return XCHARSET_NAME (obj); | |
779 return obj; | |
780 } | |
781 | |
782 DEFUN ("charset-short-name", Fcharset_short_name, 1, 1, 0, /* | |
783 Return short name of CHARSET. | |
784 */ | |
785 (charset)) | |
786 { | |
787 return XCHARSET_SHORT_NAME (Fget_charset (charset)); | |
788 } | |
789 | |
790 DEFUN ("charset-long-name", Fcharset_long_name, 1, 1, 0, /* | |
791 Return long name of CHARSET. | |
792 */ | |
793 (charset)) | |
794 { | |
795 return XCHARSET_LONG_NAME (Fget_charset (charset)); | |
796 } | |
797 | |
798 DEFUN ("charset-description", Fcharset_description, 1, 1, 0, /* | |
799 Return description of CHARSET. | |
800 */ | |
801 (charset)) | |
802 { | |
803 return XCHARSET_DOC_STRING (Fget_charset (charset)); | |
804 } | |
805 | |
806 DEFUN ("charset-dimension", Fcharset_dimension, 1, 1, 0, /* | |
807 Return dimension of CHARSET. | |
808 */ | |
809 (charset)) | |
810 { | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
811 return make_fixnum (XCHARSET_DIMENSION (Fget_charset (charset))); |
428 | 812 } |
813 | |
814 DEFUN ("charset-property", Fcharset_property, 2, 2, 0, /* | |
446 | 815 Return property PROP of CHARSET, a charset object or symbol naming a charset. |
428 | 816 Recognized properties are those listed in `make-charset', as well as |
3025 | 817 `name' and `doc-string'. |
428 | 818 */ |
819 (charset, prop)) | |
820 { | |
440 | 821 Lisp_Charset *cs; |
428 | 822 |
823 charset = Fget_charset (charset); | |
824 cs = XCHARSET (charset); | |
825 | |
826 CHECK_SYMBOL (prop); | |
827 if (EQ (prop, Qname)) return CHARSET_NAME (cs); | |
828 if (EQ (prop, Qshort_name)) return CHARSET_SHORT_NAME (cs); | |
829 if (EQ (prop, Qlong_name)) return CHARSET_LONG_NAME (cs); | |
830 if (EQ (prop, Qdoc_string)) return CHARSET_DOC_STRING (cs); | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
831 if (EQ (prop, Qdimension)) return make_fixnum (CHARSET_DIMENSION (cs)); |
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
832 if (EQ (prop, Qcolumns)) return make_fixnum (CHARSET_COLUMNS (cs)); |
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
833 if (EQ (prop, Qgraphic)) return make_fixnum (CHARSET_GRAPHIC (cs)); |
428 | 834 if (EQ (prop, Qfinal)) return make_char (CHARSET_FINAL (cs)); |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
835 if (EQ (prop, Qchars)) return make_fixnum (CHARSET_CHARS (cs)); |
3659 | 836 if (EQ (prop, Qregistries)) return CHARSET_REGISTRIES (cs); |
3439 | 837 if (EQ (prop, Qencode_as_utf_8)) |
838 return CHARSET_ENCODE_AS_UTF_8 (cs) ? Qt : Qnil; | |
428 | 839 if (EQ (prop, Qccl_program)) return CHARSET_CCL_PROGRAM (cs); |
840 if (EQ (prop, Qdirection)) | |
841 return CHARSET_DIRECTION (cs) == CHARSET_LEFT_TO_RIGHT ? Ql2r : Qr2l; | |
842 if (EQ (prop, Qreverse_direction_charset)) | |
843 { | |
844 Lisp_Object obj = CHARSET_REVERSE_DIRECTION_CHARSET (cs); | |
446 | 845 /* #### Is this translation OK? If so, error checking sufficient? */ |
846 return CHARSETP (obj) ? XCHARSET_NAME (obj) : obj; | |
428 | 847 } |
563 | 848 invalid_constant ("Unrecognized charset property name", prop); |
1204 | 849 RETURN_NOT_REACHED (Qnil); |
428 | 850 } |
851 | |
852 DEFUN ("charset-id", Fcharset_id, 1, 1, 0, /* | |
853 Return charset identification number of CHARSET. | |
854 */ | |
855 (charset)) | |
856 { | |
5581
56144c8593a8
Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5402
diff
changeset
|
857 return make_fixnum (XCHARSET_LEADING_BYTE (Fget_charset (charset))); |
428 | 858 } |
859 | |
860 /* #### We need to figure out which properties we really want to | |
861 allow to be set. */ | |
862 | |
863 DEFUN ("set-charset-ccl-program", Fset_charset_ccl_program, 2, 2, 0, /* | |
3025 | 864 Set the `ccl-program' property of CHARSET to CCL-PROGRAM. |
428 | 865 */ |
866 (charset, ccl_program)) | |
867 { | |
868 charset = Fget_charset (charset); | |
4745
0c54de4c4b9d
Resolve the unregistered-CCL-programs-get-garbage-collected problem correctly
Aidan Kehoe <kehoea@parhasard.net>
parents:
4691
diff
changeset
|
869 XCHARSET_CCL_PROGRAM (charset) = get_ccl_program (ccl_program); |
0c54de4c4b9d
Resolve the unregistered-CCL-programs-get-garbage-collected problem correctly
Aidan Kehoe <kehoea@parhasard.net>
parents:
4691
diff
changeset
|
870 |
510 | 871 face_property_was_changed (Vdefault_face, Qfont, Qglobal); |
428 | 872 return Qnil; |
873 } | |
874 | |
3676 | 875 void |
876 set_charset_registries(Lisp_Object charset, Lisp_Object registries) | |
877 { | |
878 XCHARSET_REGISTRIES (charset) = registries; | |
879 invalidate_charset_font_caches (charset); | |
880 face_property_was_changed (Vdefault_face, Qfont, Qglobal); | |
881 } | |
882 | |
3711 | 883 DEFUN ("set-charset-registries", Fset_charset_registries, 2, 3, 0, /* |
3659 | 884 Set the `registries' property of CHARSET to REGISTRIES. |
885 | |
886 REGISTRIES is an ordered vector of strings that describe the X11 | |
887 CHARSET_REGISTRY and the CHARSET_ENCODINGs appropriate for this charset. | |
888 Separate each registry from the corresponding encoding with a dash. The | |
889 strings are not regular expressions, in contrast to the old behavior of | |
890 the `charset-registry' property. | |
891 | |
892 One reason to call this function might be if you're in Japan and you'd | |
893 prefer the backslash to display as a Yen sign; the corresponding syntax | |
894 would be: | |
895 | |
896 (set-charset-registries 'ascii ["jisx0201.1976-0"]) | |
897 | |
3711 | 898 If optional argument FORCE is non-nil, avoid sanity-checking the elements of |
899 REGISTRIES. Normally the strings are checked to make sure they contain no | |
900 XLFD wild cards and that they contain at least one hyphen; the only context | |
901 in which one might want not to do this is in order to use a font which | |
902 doesn't have a full XLFD--and thus, an effective | |
903 CHARSET_REGISTRY-CHARSET_ENCODING of ""--to display ASCII. | |
904 | |
905 We recommend strongly that you specify a full XLFD, since this makes | |
906 multilingual and variant font handling work much better. To get the full | |
907 XLFD of any font, start xfd with the short name as the pattern argument: | |
908 | |
909 xfd -fn 8x16kana | |
910 | |
911 and use the text that appears at the top of the window. | |
428 | 912 */ |
3711 | 913 (charset, registries, force)) |
428 | 914 { |
3659 | 915 int i; |
428 | 916 charset = Fget_charset (charset); |
3659 | 917 CHECK_VECTOR (registries); |
918 | |
919 for (i = 0; i < XVECTOR_LENGTH(registries); ++i) | |
920 { | |
921 CHECK_STRING (XVECTOR_DATA(registries)[i]); | |
3711 | 922 |
923 if (!NILP(force)) | |
924 { | |
925 continue; | |
926 } | |
927 | |
3659 | 928 if (NULL == qxestrchr(XSTRING_DATA(XVECTOR_DATA(registries)[i]), '-')) |
929 { | |
930 invalid_argument("Not an X11 REGISTRY-ENCODING combination", | |
931 XVECTOR_DATA(registries)[i]); | |
932 } | |
3676 | 933 |
934 if (qxestrchr(XSTRING_DATA(XVECTOR_DATA(registries)[i]), '*') || | |
935 qxestrchr(XSTRING_DATA(XVECTOR_DATA(registries)[i]), '?')) | |
936 { | |
937 invalid_argument | |
938 ("XLFD wildcards not allowed in charset-registries", | |
939 XVECTOR_DATA(registries)[i]); | |
940 | |
941 } | |
3659 | 942 } |
943 | |
3676 | 944 set_charset_registries(charset, registries); |
945 | |
428 | 946 return Qnil; |
947 } | |
948 | |
3681 | 949 DEFUN ("charsets-in-region", Fcharsets_in_region, 2, 3, 0, /* |
950 Return a list of the charsets in the region between START and END. | |
951 BUFFER defaults to the current buffer if omitted. | |
952 */ | |
953 (start, end, buffer)) | |
954 { | |
955 /* This function can GC */ | |
956 struct buffer *buf = decode_buffer (buffer, 1); | |
957 Charbpos pos, stop; /* Limits of the region. */ | |
958 Lisp_Object res = Qnil; | |
959 int charsets[NUM_LEADING_BYTES]; | |
960 Ibyte lb; | |
961 struct gcpro gcpro1; | |
962 | |
963 memset(charsets, 0, sizeof(charsets)); | |
964 get_buffer_range_char (buf, start, end, &pos, &stop, 0); | |
965 | |
966 GCPRO1 (res); | |
967 while (pos < stop) | |
968 { | |
969 lb = ichar_leading_byte(BUF_FETCH_CHAR (buf, pos)); | |
970 if (0 == charsets[lb - MIN_LEADING_BYTE]) | |
971 { | |
972 charsets[lb - MIN_LEADING_BYTE] = 1; | |
973 res = Fcons (XCHARSET_NAME(charset_by_leading_byte(lb)), res); | |
974 } | |
975 ++pos; | |
976 } | |
977 UNGCPRO; | |
978 | |
979 return res; | |
980 } | |
981 | |
428 | 982 |
983 /************************************************************************/ | |
771 | 984 /* memory usage */ |
428 | 985 /************************************************************************/ |
986 | |
771 | 987 #ifdef MEMORY_USAGE_STATS |
428 | 988 |
771 | 989 struct charset_stats |
990 { | |
5157
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
991 struct usage_stats u; |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
992 Bytecount from_unicode; |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
993 Bytecount to_unicode; |
771 | 994 }; |
428 | 995 |
771 | 996 static void |
997 compute_charset_usage (Lisp_Object charset, struct charset_stats *stats, | |
5157
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
998 struct usage_stats *ustats) |
428 | 999 { |
5157
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1000 stats->from_unicode += compute_from_unicode_table_size (charset, ustats); |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1001 stats->to_unicode += compute_to_unicode_table_size (charset, ustats); |
438 | 1002 } |
1003 | |
5157
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1004 static void |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1005 charset_memory_usage (Lisp_Object charset, struct generic_usage_stats *gustats) |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1006 { |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1007 struct charset_stats *stats = (struct charset_stats *) gustats; |
428 | 1008 |
5157
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1009 compute_charset_usage (charset, stats, &stats->u); |
428 | 1010 } |
1011 | |
771 | 1012 #endif /* MEMORY_USAGE_STATS */ |
428 | 1013 |
1014 | |
1015 /************************************************************************/ | |
1016 /* initialization */ | |
1017 /************************************************************************/ | |
1018 | |
1019 void | |
5157
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1020 mule_charset_objects_create (void) |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1021 { |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1022 #ifdef MEMORY_USAGE_STATS |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1023 OBJECT_HAS_METHOD (charset, memory_usage); |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1024 #endif |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1025 } |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1026 |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1027 void |
428 | 1028 syms_of_mule_charset (void) |
1029 { | |
5117
3742ea8250b5
Checking in final CVS version of workspace 'ben-lisp-object'
Ben Wing <ben@xemacs.org>
parents:
3025
diff
changeset
|
1030 INIT_LISP_OBJECT (charset); |
442 | 1031 |
428 | 1032 DEFSUBR (Fcharsetp); |
1033 DEFSUBR (Ffind_charset); | |
1034 DEFSUBR (Fget_charset); | |
1035 DEFSUBR (Fcharset_list); | |
1036 DEFSUBR (Fcharset_name); | |
1037 DEFSUBR (Fmake_charset); | |
1038 DEFSUBR (Fmake_reverse_direction_charset); | |
793 | 1039 DEFSUBR (Fcharset_reverse_direction_charset); |
428 | 1040 DEFSUBR (Fcharset_from_attributes); |
1041 DEFSUBR (Fcharset_short_name); | |
1042 DEFSUBR (Fcharset_long_name); | |
1043 DEFSUBR (Fcharset_description); | |
1044 DEFSUBR (Fcharset_dimension); | |
1045 DEFSUBR (Fcharset_property); | |
1046 DEFSUBR (Fcharset_id); | |
1047 DEFSUBR (Fset_charset_ccl_program); | |
3659 | 1048 DEFSUBR (Fset_charset_registries); |
3681 | 1049 DEFSUBR (Fcharsets_in_region); |
428 | 1050 |
563 | 1051 DEFSYMBOL (Qcharsetp); |
3659 | 1052 DEFSYMBOL (Qregistries); |
563 | 1053 DEFSYMBOL (Qfinal); |
1054 DEFSYMBOL (Qgraphic); | |
3659 | 1055 DEFSYMBOL (Qregistry); |
563 | 1056 DEFSYMBOL (Qdirection); |
1057 DEFSYMBOL (Qreverse_direction_charset); | |
1058 DEFSYMBOL (Qshort_name); | |
1059 DEFSYMBOL (Qlong_name); | |
428 | 1060 |
771 | 1061 DEFSYMBOL (Qto_unicode); |
1062 | |
563 | 1063 DEFSYMBOL (Ql2r); |
1064 DEFSYMBOL (Qr2l); | |
428 | 1065 |
1066 /* Charsets, compatible with FSF 20.3 | |
1067 Naming convention is Script-Charset[-Edition] */ | |
563 | 1068 DEFSYMBOL (Qlatin_iso8859_1); |
1069 DEFSYMBOL (Qlatin_iso8859_2); | |
1070 DEFSYMBOL (Qlatin_iso8859_3); | |
1071 DEFSYMBOL (Qlatin_iso8859_4); | |
1072 DEFSYMBOL (Qthai_tis620); | |
1073 DEFSYMBOL (Qgreek_iso8859_7); | |
4805
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
1074 DEFSYMBOL (Qarabic_iso8859_6); |
563 | 1075 DEFSYMBOL (Qhebrew_iso8859_8); |
1076 DEFSYMBOL (Qkatakana_jisx0201); | |
1077 DEFSYMBOL (Qlatin_jisx0201); | |
1078 DEFSYMBOL (Qcyrillic_iso8859_5); | |
1079 DEFSYMBOL (Qlatin_iso8859_9); | |
728 | 1080 DEFSYMBOL (Qlatin_iso8859_15); |
563 | 1081 DEFSYMBOL (Qjapanese_jisx0208_1978); |
1082 DEFSYMBOL (Qchinese_gb2312); | |
1083 DEFSYMBOL (Qjapanese_jisx0208); | |
1084 DEFSYMBOL (Qkorean_ksc5601); | |
1085 DEFSYMBOL (Qjapanese_jisx0212); | |
1086 DEFSYMBOL (Qchinese_cns11643_1); | |
1087 DEFSYMBOL (Qchinese_cns11643_2); | |
1088 DEFSYMBOL (Qchinese_big5_1); | |
1089 DEFSYMBOL (Qchinese_big5_2); | |
428 | 1090 |
563 | 1091 DEFSYMBOL (Qcomposite); |
428 | 1092 } |
1093 | |
1094 void | |
1095 vars_of_mule_charset (void) | |
1096 { | |
1097 int i, j, k; | |
1098 | |
5157
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1099 #ifdef MEMORY_USAGE_STATS |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1100 OBJECT_HAS_PROPERTY |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1101 (charset, memusage_stats_list, list2 (Qfrom_unicode, Qto_unicode)); |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1102 #endif /* MEMORY_USAGE_STATS */ |
1fae11d56ad2
redo memory-usage mechanism, add way of dynamically initializing Lisp objects
Ben Wing <ben@xemacs.org>
parents:
5146
diff
changeset
|
1103 |
452 | 1104 chlook = xnew_and_zero (struct charset_lookup); /* zero for Purify. */ |
2367 | 1105 dump_add_root_block_ptr (&chlook, &charset_lookup_description); |
428 | 1106 |
1107 /* Table of charsets indexed by leading byte. */ | |
1108 for (i = 0; i < countof (chlook->charset_by_leading_byte); i++) | |
1109 chlook->charset_by_leading_byte[i] = Qnil; | |
1110 | |
1111 /* Table of charsets indexed by type/final-byte/direction. */ | |
1112 for (i = 0; i < countof (chlook->charset_by_attributes); i++) | |
1113 for (j = 0; j < countof (chlook->charset_by_attributes[0]); j++) | |
1114 for (k = 0; k < countof (chlook->charset_by_attributes[0][0]); k++) | |
1115 chlook->charset_by_attributes[i][j][k] = Qnil; | |
1116 | |
442 | 1117 chlook->next_allocated_1_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_1; |
1118 chlook->next_allocated_2_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_2; | |
771 | 1119 |
1120 staticpro (&Vcharset_hash_table); | |
1121 Vcharset_hash_table = | |
5191
71ee43b8a74d
Add #'equalp as a hash test by default; add #'define-hash-table-test, GNU API
Aidan Kehoe <kehoea@parhasard.net>
parents:
5178
diff
changeset
|
1122 make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, Qeq); |
428 | 1123 } |
1124 | |
1125 void | |
1126 complex_vars_of_mule_charset (void) | |
1127 { | |
1128 /* Predefined character sets. We store them into variables for | |
1129 ease of access. */ | |
1130 | |
1131 staticpro (&Vcharset_ascii); | |
1132 Vcharset_ascii = | |
1133 make_charset (LEADING_BYTE_ASCII, Qascii, 1, | |
1134 CHARSET_TYPE_94, 1, 0, 'B', | |
1135 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1136 build_ascstring ("ASCII"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1137 build_defer_string ("ASCII"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1138 build_defer_string ("ASCII (ISO646 IRV)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1139 vector1(build_ascstring("iso8859-1")), 0, 0); |
428 | 1140 staticpro (&Vcharset_control_1); |
1141 Vcharset_control_1 = | |
1142 make_charset (LEADING_BYTE_CONTROL_1, Qcontrol_1, 2, | |
1143 CHARSET_TYPE_94, 1, 1, 0, | |
1144 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1145 build_ascstring ("C1"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1146 build_defer_string ("Control characters"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1147 build_defer_string ("Control characters 128-191"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1148 vector1(build_ascstring("iso8859-1")), 0, 0); |
428 | 1149 staticpro (&Vcharset_latin_iso8859_1); |
1150 Vcharset_latin_iso8859_1 = | |
1151 make_charset (LEADING_BYTE_LATIN_ISO8859_1, Qlatin_iso8859_1, 2, | |
1152 CHARSET_TYPE_96, 1, 1, 'A', | |
1153 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1154 build_ascstring ("Latin-1"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1155 build_defer_string ("ISO8859-1 (Latin-1)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1156 build_defer_string ("ISO8859-1 (Latin-1)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1157 vector1(build_ascstring("iso8859-1")), 0, 0); |
428 | 1158 staticpro (&Vcharset_latin_iso8859_2); |
1159 Vcharset_latin_iso8859_2 = | |
1160 make_charset (LEADING_BYTE_LATIN_ISO8859_2, Qlatin_iso8859_2, 2, | |
1161 CHARSET_TYPE_96, 1, 1, 'B', | |
1162 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1163 build_ascstring ("Latin-2"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1164 build_defer_string ("ISO8859-2 (Latin-2)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1165 build_defer_string ("ISO8859-2 (Latin-2)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1166 vector1(build_ascstring("iso8859-2")), 0, 0); |
428 | 1167 staticpro (&Vcharset_latin_iso8859_3); |
1168 Vcharset_latin_iso8859_3 = | |
1169 make_charset (LEADING_BYTE_LATIN_ISO8859_3, Qlatin_iso8859_3, 2, | |
1170 CHARSET_TYPE_96, 1, 1, 'C', | |
1171 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1172 build_ascstring ("Latin-3"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1173 build_defer_string ("ISO8859-3 (Latin-3)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1174 build_defer_string ("ISO8859-3 (Latin-3)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1175 vector1(build_ascstring("iso8859-3")), 0, 0); |
428 | 1176 staticpro (&Vcharset_latin_iso8859_4); |
1177 Vcharset_latin_iso8859_4 = | |
1178 make_charset (LEADING_BYTE_LATIN_ISO8859_4, Qlatin_iso8859_4, 2, | |
1179 CHARSET_TYPE_96, 1, 1, 'D', | |
1180 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1181 build_ascstring ("Latin-4"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1182 build_defer_string ("ISO8859-4 (Latin-4)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1183 build_defer_string ("ISO8859-4 (Latin-4)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1184 vector1(build_ascstring("iso8859-4")), 0, 0); |
428 | 1185 staticpro (&Vcharset_thai_tis620); |
1186 Vcharset_thai_tis620 = | |
1187 make_charset (LEADING_BYTE_THAI_TIS620, Qthai_tis620, 2, | |
1188 CHARSET_TYPE_96, 1, 1, 'T', | |
1189 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1190 build_ascstring ("TIS620"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1191 build_defer_string ("TIS620 (Thai)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1192 build_defer_string ("TIS620.2529 (Thai)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1193 vector1(build_ascstring("tis620.2529-1")), 0, 0); |
428 | 1194 staticpro (&Vcharset_greek_iso8859_7); |
1195 Vcharset_greek_iso8859_7 = | |
1196 make_charset (LEADING_BYTE_GREEK_ISO8859_7, Qgreek_iso8859_7, 2, | |
1197 CHARSET_TYPE_96, 1, 1, 'F', | |
1198 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1199 build_ascstring ("ISO8859-7"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1200 build_defer_string ("ISO8859-7 (Greek)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1201 build_defer_string ("ISO8859-7 (Greek)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1202 vector1(build_ascstring("iso8859-7")), 0, 0); |
4805
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
1203 staticpro (&Vcharset_arabic_iso8859_6); |
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
1204 Vcharset_arabic_iso8859_6 = |
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
1205 make_charset (LEADING_BYTE_ARABIC_ISO8859_6, Qarabic_iso8859_6, 2, |
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
1206 CHARSET_TYPE_96, 1, 1, 'G', |
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
1207 CHARSET_RIGHT_TO_LEFT, |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1208 build_ascstring ("ISO8859-6"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1209 build_defer_string ("ISO8859-6 (Arabic)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1210 build_defer_string ("ISO8859-6 (Arabic)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1211 vector1(build_ascstring ("iso8859-6")), 0, 0); |
428 | 1212 staticpro (&Vcharset_hebrew_iso8859_8); |
1213 Vcharset_hebrew_iso8859_8 = | |
1214 make_charset (LEADING_BYTE_HEBREW_ISO8859_8, Qhebrew_iso8859_8, 2, | |
1215 CHARSET_TYPE_96, 1, 1, 'H', | |
1216 CHARSET_RIGHT_TO_LEFT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1217 build_ascstring ("ISO8859-8"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1218 build_defer_string ("ISO8859-8 (Hebrew)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1219 build_defer_string ("ISO8859-8 (Hebrew)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1220 vector1(build_ascstring ("iso8859-8")), 0, 0); |
428 | 1221 staticpro (&Vcharset_katakana_jisx0201); |
1222 Vcharset_katakana_jisx0201 = | |
1223 make_charset (LEADING_BYTE_KATAKANA_JISX0201, Qkatakana_jisx0201, 2, | |
1224 CHARSET_TYPE_94, 1, 1, 'I', | |
1225 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1226 build_ascstring ("JISX0201 Kana"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1227 build_defer_string ("JISX0201.1976 (Japanese Kana)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1228 build_defer_string ("JISX0201.1976 Japanese Kana"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1229 vector1(build_ascstring ("jisx0201.1976-0")), 0, 0); |
428 | 1230 staticpro (&Vcharset_latin_jisx0201); |
1231 Vcharset_latin_jisx0201 = | |
1232 make_charset (LEADING_BYTE_LATIN_JISX0201, Qlatin_jisx0201, 2, | |
1233 CHARSET_TYPE_94, 1, 0, 'J', | |
1234 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1235 build_ascstring ("JISX0201 Roman"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1236 build_defer_string ("JISX0201.1976 (Japanese Roman)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1237 build_defer_string ("JISX0201.1976 Japanese Roman"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1238 vector1(build_ascstring ("jisx0201.1976-0")), 0, 0); |
428 | 1239 staticpro (&Vcharset_cyrillic_iso8859_5); |
1240 Vcharset_cyrillic_iso8859_5 = | |
1241 make_charset (LEADING_BYTE_CYRILLIC_ISO8859_5, Qcyrillic_iso8859_5, 2, | |
1242 CHARSET_TYPE_96, 1, 1, 'L', | |
1243 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1244 build_ascstring ("ISO8859-5"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1245 build_defer_string ("ISO8859-5 (Cyrillic)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1246 build_defer_string ("ISO8859-5 (Cyrillic)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1247 vector1(build_ascstring ("iso8859-5")), 0, 0); |
428 | 1248 staticpro (&Vcharset_latin_iso8859_9); |
1249 Vcharset_latin_iso8859_9 = | |
1250 make_charset (LEADING_BYTE_LATIN_ISO8859_9, Qlatin_iso8859_9, 2, | |
1251 CHARSET_TYPE_96, 1, 1, 'M', | |
1252 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1253 build_ascstring ("Latin-5"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1254 build_defer_string ("ISO8859-9 (Latin-5)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1255 build_defer_string ("ISO8859-9 (Latin-5)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1256 vector1(build_ascstring ("iso8859-9")), 0, 0); |
728 | 1257 staticpro (&Vcharset_latin_iso8859_15); |
1258 Vcharset_latin_iso8859_15 = | |
1259 make_charset (LEADING_BYTE_LATIN_ISO8859_15, Qlatin_iso8859_15, 2, | |
1260 CHARSET_TYPE_96, 1, 1, 'b', | |
1261 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1262 build_ascstring ("Latin-9"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1263 build_defer_string ("ISO8859-15 (Latin-9)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1264 build_defer_string ("ISO8859-15 (Latin-9)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1265 vector1(build_ascstring ("iso8859-15")), 0, 0); |
428 | 1266 staticpro (&Vcharset_japanese_jisx0208_1978); |
1267 Vcharset_japanese_jisx0208_1978 = | |
1268 make_charset (LEADING_BYTE_JAPANESE_JISX0208_1978, Qjapanese_jisx0208_1978, 3, | |
1269 CHARSET_TYPE_94X94, 2, 0, '@', | |
1270 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1271 build_ascstring ("JISX0208.1978"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1272 build_defer_string ("JISX0208.1978 (Japanese)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1273 build_defer_string |
428 | 1274 ("JISX0208.1978 Japanese Kanji (so called \"old JIS\")"), |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1275 vector2(build_ascstring("jisx0208.1978-0"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1276 build_ascstring("jisc6226.1978-0")), 0, 0); |
428 | 1277 staticpro (&Vcharset_chinese_gb2312); |
1278 Vcharset_chinese_gb2312 = | |
1279 make_charset (LEADING_BYTE_CHINESE_GB2312, Qchinese_gb2312, 3, | |
1280 CHARSET_TYPE_94X94, 2, 0, 'A', | |
1281 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1282 build_ascstring ("GB2312"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1283 build_defer_string ("GB2312)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1284 build_defer_string ("GB2312 Chinese simplified"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1285 vector2(build_ascstring("gb2312.1980-0"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1286 build_ascstring("gb2312.80&gb8565.88-0")), 0, 0); |
428 | 1287 staticpro (&Vcharset_japanese_jisx0208); |
1288 Vcharset_japanese_jisx0208 = | |
1289 make_charset (LEADING_BYTE_JAPANESE_JISX0208, Qjapanese_jisx0208, 3, | |
1290 CHARSET_TYPE_94X94, 2, 0, 'B', | |
1291 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1292 build_ascstring ("JISX0208"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1293 build_defer_string ("JISX0208.1983/1990 (Japanese)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1294 build_defer_string ("JISX0208.1983/1990 Japanese Kanji"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1295 vector2(build_ascstring("jisx0208.1983-0"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1296 build_ascstring("jisx0208.1990-0")), 0, 0); |
428 | 1297 staticpro (&Vcharset_korean_ksc5601); |
1298 Vcharset_korean_ksc5601 = | |
1299 make_charset (LEADING_BYTE_KOREAN_KSC5601, Qkorean_ksc5601, 3, | |
1300 CHARSET_TYPE_94X94, 2, 0, 'C', | |
1301 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1302 build_ascstring ("KSC5601"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1303 build_defer_string ("KSC5601 (Korean"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1304 build_defer_string ("KSC5601 Korean Hangul and Hanja"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1305 vector1(build_ascstring("ksc5601.1987-0")), 0, 0); |
428 | 1306 staticpro (&Vcharset_japanese_jisx0212); |
1307 Vcharset_japanese_jisx0212 = | |
1308 make_charset (LEADING_BYTE_JAPANESE_JISX0212, Qjapanese_jisx0212, 3, | |
1309 CHARSET_TYPE_94X94, 2, 0, 'D', | |
1310 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1311 build_ascstring ("JISX0212"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1312 build_defer_string ("JISX0212 (Japanese)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1313 build_defer_string ("JISX0212 Japanese Supplement"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1314 vector1(build_ascstring("jisx0212.1990-0")), 0, 0); |
428 | 1315 |
3659 | 1316 #define CHINESE_CNS_PLANE(n) "cns11643.1992-" n |
428 | 1317 staticpro (&Vcharset_chinese_cns11643_1); |
1318 Vcharset_chinese_cns11643_1 = | |
1319 make_charset (LEADING_BYTE_CHINESE_CNS11643_1, Qchinese_cns11643_1, 3, | |
1320 CHARSET_TYPE_94X94, 2, 0, 'G', | |
1321 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1322 build_ascstring ("CNS11643-1"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1323 build_defer_string ("CNS11643-1 (Chinese traditional)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1324 build_defer_string |
428 | 1325 ("CNS 11643 Plane 1 Chinese traditional"), |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1326 vector1(build_ascstring (CHINESE_CNS_PLANE("1"))), 0, 0); |
428 | 1327 staticpro (&Vcharset_chinese_cns11643_2); |
1328 Vcharset_chinese_cns11643_2 = | |
1329 make_charset (LEADING_BYTE_CHINESE_CNS11643_2, Qchinese_cns11643_2, 3, | |
1330 CHARSET_TYPE_94X94, 2, 0, 'H', | |
1331 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1332 build_ascstring ("CNS11643-2"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1333 build_defer_string ("CNS11643-2 (Chinese traditional)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1334 build_defer_string |
428 | 1335 ("CNS 11643 Plane 2 Chinese traditional"), |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1336 vector1(build_ascstring (CHINESE_CNS_PLANE("2"))), 0, 0); |
428 | 1337 staticpro (&Vcharset_chinese_big5_1); |
1338 Vcharset_chinese_big5_1 = | |
1339 make_charset (LEADING_BYTE_CHINESE_BIG5_1, Qchinese_big5_1, 3, | |
1340 CHARSET_TYPE_94X94, 2, 0, '0', | |
1341 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1342 build_ascstring ("Big5"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1343 build_defer_string ("Big5 (Level-1)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1344 build_defer_string |
428 | 1345 ("Big5 Level-1 Chinese traditional"), |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1346 vector1(build_ascstring ("big5.eten-0")), 0, 0); |
428 | 1347 staticpro (&Vcharset_chinese_big5_2); |
1348 Vcharset_chinese_big5_2 = | |
1349 make_charset (LEADING_BYTE_CHINESE_BIG5_2, Qchinese_big5_2, 3, | |
1350 CHARSET_TYPE_94X94, 2, 0, '1', | |
1351 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1352 build_ascstring ("Big5"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1353 build_defer_string ("Big5 (Level-2)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1354 build_defer_string |
428 | 1355 ("Big5 Level-2 Chinese traditional"), |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1356 vector1(build_ascstring ("big5.eten-0")), 0, 0); |
428 | 1357 |
1358 | |
1359 #ifdef ENABLE_COMPOSITE_CHARS | |
1360 /* #### For simplicity, we put composite chars into a 96x96 charset. | |
1361 This is going to lead to problems because you can run out of | |
1362 room, esp. as we don't yet recycle numbers. */ | |
1363 staticpro (&Vcharset_composite); | |
1364 Vcharset_composite = | |
1365 make_charset (LEADING_BYTE_COMPOSITE, Qcomposite, 3, | |
1366 CHARSET_TYPE_96X96, 2, 0, 0, | |
1367 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1368 build_ascstring ("Composite"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1369 build_defer_string ("Composite characters"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1370 build_defer_string ("Composite characters"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1371 vector1(build_ascstring ("")), 0, 0); |
771 | 1372 #else |
1373 /* We create a hack so that we have a way of storing ESC 0 and ESC 1 | |
1374 sequences as "characters", so that they will be output correctly. */ | |
1375 staticpro (&Vcharset_composite); | |
1376 Vcharset_composite = | |
1377 make_charset (LEADING_BYTE_COMPOSITE_REPLACEMENT, Qcomposite, 2, | |
1378 CHARSET_TYPE_96, 1, 1, '|', | |
1379 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1380 build_ascstring ("Composite hack"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1381 build_defer_string ("Composite characters hack"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1382 build_defer_string ("Composite characters hack"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1383 vector1(build_ascstring ("")), 0, 0); |
428 | 1384 #endif /* ENABLE_COMPOSITE_CHARS */ |
1385 } |