annotate src/mule-charset.c @ 844:047d37eb70d7

[xemacs-hg @ 2002-05-16 13:30:23 by ben] ui fixes for things that were bothering me bytecode.c, editfns.c, lisp.h, lread.c: Fix save-restriction to use markers rather than pseudo-markers (integers representing the amount of text on either side of the region). That way, all inserts are handled correctly, not just those inside old restriction. Add buffer argument to save_restriction_save(). process.c: Clean up very dirty and kludgy code that outputs into a buffer -- use proper unwind protects, etc. font-lock.c: Do save-restriction/widen around the function -- otherwise, incorrect results will ensue when a buffer has been narrowed before a call to e.g. `buffer-syntactic-context' -- something that happens quite often. fileio.c: Look for a handler for make-temp-name. window.c, winslots.h: Try to solve this annoying problem: have two frames displaying the buffer, in different places; in one, temporarily switch away to another buffer and then back -- and you've lost your position; it's reset to the other one in the other frame. My current solution involves window-level caches of buffers and points (also a cache for window-start); when set-window-buffer is called, it looks to see if the buffer was previously visited in the window, and if so, uses the most recent point at that time. (It's a marker, so it handles changes.) #### Note: It could be argued that doing it on the frame level would be better -- e.g. if you visit a buffer temporarily through a grep, and then go back to that buffer, you presumably want the grep's position rather than some previous position provided everything was in the same frame, even though the grep was in another window in the frame. However, doing it on the frame level fails when you have two windows on the same frame. Perhaps we keep both a window and a frame cache, and use the frame cache if there are no other windows on the frame showing the buffer, else the window's cache? This is probably something to be configurable using a specifier. Suggestions please please please? window.c: Clean up a bit code that deals with the annoyance of window-point vs. point. dialog.el: Function to ask a multiple-choice question, automatically choosing a dialog box or minibuffer representation as necessary. Generalized version of yes-or-no-p, y-or-n-p. files.el: Use get-user-response to ask "yes/no/diff" question when recovering. "diff" means that a diff is displayed between the current file and the autosave. (Converts/deconverts escape-quoted as necessary. No more complaints from you, Mr. Turnbull!) One known problem: when a dialog is used, it's modal, so you can't scroll the diff. Will fix soon. lisp-mode.el: If we're filling a string, don't treat semicolon as a comment, which would give very unfriendly results. Uses `buffer-syntactic-context'. simple.el: all changes back to the beginning. (Useful if you've saved the file in the middle of the changes.) simple.el: Add option kill-word-into-kill-ring, which controls whether words deleted with kill-word, backward-kill-word, etc. are "cut" into the kill ring, or "cleared" into nothingness. (My preference is the latter, by far. I'd almost go so far as suggesting we make it the default, as you can always select a word and then cut it if you want it cut.) menubar-items.el: Add option corresponding to kill-word-into-kill-ring.
author ben
date Thu, 16 May 2002 13:30:58 +0000
parents 6728e641994e
children 804517e16990
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* Functions to handle multilingual characters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1992, 1995 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 Copyright (C) 1995 Sun Microsystems, Inc.
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
4 Copyright (C) 2001, 2002 Ben Wing.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 /* Synched up with: FSF 20.3. Not in FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 /* Rewritten by Ben Wing <ben@xemacs.org>. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 #include <config.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 #include "lisp.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 #include "buffer.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 #include "chartab.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 #include "elhash.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 #include "device.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 #include "faces.h"
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
35 #include "lstream.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 #include "mule-ccl.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 /* The various pre-defined charsets. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 Lisp_Object Vcharset_ascii;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 Lisp_Object Vcharset_control_1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 Lisp_Object Vcharset_latin_iso8859_1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 Lisp_Object Vcharset_latin_iso8859_2;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 Lisp_Object Vcharset_latin_iso8859_3;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 Lisp_Object Vcharset_latin_iso8859_4;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 Lisp_Object Vcharset_thai_tis620;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 Lisp_Object Vcharset_greek_iso8859_7;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 Lisp_Object Vcharset_arabic_iso8859_6;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 Lisp_Object Vcharset_hebrew_iso8859_8;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 Lisp_Object Vcharset_katakana_jisx0201;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 Lisp_Object Vcharset_latin_jisx0201;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 Lisp_Object Vcharset_cyrillic_iso8859_5;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 Lisp_Object Vcharset_latin_iso8859_9;
728
4d00488244c1 [xemacs-hg @ 2002-01-10 09:50:43 by stephent]
stephent
parents: 665
diff changeset
54 Lisp_Object Vcharset_latin_iso8859_15;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 Lisp_Object Vcharset_japanese_jisx0208_1978;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 Lisp_Object Vcharset_chinese_gb2312;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 Lisp_Object Vcharset_japanese_jisx0208;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 Lisp_Object Vcharset_korean_ksc5601;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 Lisp_Object Vcharset_japanese_jisx0212;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 Lisp_Object Vcharset_chinese_cns11643_1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 Lisp_Object Vcharset_chinese_cns11643_2;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 Lisp_Object Vcharset_chinese_big5_1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 Lisp_Object Vcharset_chinese_big5_2;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 Lisp_Object Vcharset_composite;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 struct charset_lookup *chlook;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 static const struct lrecord_description charset_lookup_description_1[] = {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
69 { XD_LISP_OBJECT_ARRAY, offsetof (struct charset_lookup, charset_by_leading_byte), NUM_LEADING_BYTES+4*128*2 },
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 { XD_END }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 static const struct struct_description charset_lookup_description = {
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
74 sizeof (struct charset_lookup),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 charset_lookup_description_1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 Lisp_Object Qcharsetp;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 /* Qdoc_string, Qdimension, Qchars defined in general.c */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 Lisp_Object Qregistry, Qfinal, Qgraphic;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 Lisp_Object Qdirection;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 Lisp_Object Qreverse_direction_charset;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 Lisp_Object Qshort_name, Qlong_name;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
86 Lisp_Object Qfrom_unicode, Qto_unicode;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
87
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
88 Lisp_Object
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 Qlatin_iso8859_1,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 Qlatin_iso8859_2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 Qlatin_iso8859_3,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 Qlatin_iso8859_4,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 Qthai_tis620,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 Qgreek_iso8859_7,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 Qarabic_iso8859_6,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 Qhebrew_iso8859_8,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 Qkatakana_jisx0201,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 Qlatin_jisx0201,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 Qcyrillic_iso8859_5,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 Qlatin_iso8859_9,
728
4d00488244c1 [xemacs-hg @ 2002-01-10 09:50:43 by stephent]
stephent
parents: 665
diff changeset
101 Qlatin_iso8859_15,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 Qjapanese_jisx0208_1978,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 Qchinese_gb2312,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 Qjapanese_jisx0208,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 Qkorean_ksc5601,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 Qjapanese_jisx0212,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 Qchinese_cns11643_1,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 Qchinese_cns11643_2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 Qchinese_big5_1,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 Qchinese_big5_2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 Qcomposite;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 Lisp_Object Ql2r, Qr2l;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 Lisp_Object Vcharset_hash_table;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 /* charset object */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 static Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 mark_charset (Lisp_Object obj)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 {
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
125 Lisp_Charset *cs = XCHARSET (obj);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 mark_object (cs->short_name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 mark_object (cs->long_name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 mark_object (cs->doc_string);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 mark_object (cs->registry);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 mark_object (cs->ccl_program);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 return cs->name;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 print_charset (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 {
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
138 Lisp_Charset *cs = XCHARSET (obj);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 if (print_readably)
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
141 printing_unreadable_object ("#<charset %s 0x%x>",
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
142 XSTRING_DATA (XSYMBOL (CHARSET_NAME (cs))->
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
143 name),
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
144 cs->header.uid);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
146 write_fmt_string_lisp (printcharfun, "#<charset %s %S %S %S", 4,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
147 CHARSET_NAME (cs), CHARSET_SHORT_NAME (cs),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
148 CHARSET_LONG_NAME (cs), CHARSET_DOC_STRING (cs));
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
149 write_fmt_string (printcharfun, " %s %s cols=%d g%d final='%c' reg=",
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
150 CHARSET_TYPE (cs) == CHARSET_TYPE_94 ? "94" :
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
151 CHARSET_TYPE (cs) == CHARSET_TYPE_96 ? "96" :
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
152 CHARSET_TYPE (cs) == CHARSET_TYPE_94X94 ? "94x94" :
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
153 "96x96",
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
154 CHARSET_DIRECTION (cs) == CHARSET_LEFT_TO_RIGHT ? "l2r" :
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
155 "r2l",
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
156 CHARSET_COLUMNS (cs),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
157 CHARSET_GRAPHIC (cs),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
158 CHARSET_FINAL (cs));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 print_internal (CHARSET_REGISTRY (cs), printcharfun, 0);
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
160 write_fmt_string (printcharfun, " 0x%x>", cs->header.uid);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
161 }
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
162
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
163 static void
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
164 finalize_charset (void *header, int for_disksave)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
165 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
166 /* See mule-charset.h, definition of Lisp_Charset. */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
167 Lisp_Object charset = wrap_charset ((Lisp_Charset *) header);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
168 if (for_disksave && XCHARSET_TO_UNICODE_TABLE (charset))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
169 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
170 /* Control-1, ASCII, Composite don't have tables */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
171 free_charset_unicode_tables (charset);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
172 XCHARSET_TO_UNICODE_TABLE (charset) = 0;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
173 XCHARSET_FROM_UNICODE_TABLE (charset) = 0;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
174 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 static const struct lrecord_description charset_description[] = {
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
178 { XD_LISP_OBJECT, offsetof (Lisp_Charset, name) },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
179 { XD_LISP_OBJECT, offsetof (Lisp_Charset, doc_string) },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
180 { XD_LISP_OBJECT, offsetof (Lisp_Charset, registry) },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
181 { XD_LISP_OBJECT, offsetof (Lisp_Charset, short_name) },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
182 { XD_LISP_OBJECT, offsetof (Lisp_Charset, long_name) },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
183 { XD_LISP_OBJECT, offsetof (Lisp_Charset, reverse_direction_charset) },
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
184 { XD_LISP_OBJECT, offsetof (Lisp_Charset, ccl_program) },
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
185 #if 0
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
186 /* #### XD_UNION not yet implemented! pdump version of XEmacs will
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
187 not work! */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
188 { XD_UNION, offsetof (Lisp_Charset, to_unicode_table),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
189 XD_INDIRECT (offsetof (Lisp_Charset, dimension), 0),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
190 to_unicode_description },
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
191 { XD_UNION, offsetof (Lisp_Charset, from_unicode_table),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
192 XD_INDIRECT (offsetof (Lisp_Charset, from_unicode_levels), 0),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
193 from_unicode_description },
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
194 #endif
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 { XD_END }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 DEFINE_LRECORD_IMPLEMENTATION ("charset", charset,
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
199 mark_charset, print_charset, finalize_charset,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
200 0, 0, charset_description, Lisp_Charset);
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
201
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 /* Make a new charset. */
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
203 /* #### SJT Should generic properties be allowed? */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 static Lisp_Object
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
205 make_charset (int id, Lisp_Object name, int rep_bytes,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
206 int type, int columns, int graphic,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
207 Intbyte final, int direction, Lisp_Object short_name,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 Lisp_Object long_name, Lisp_Object doc,
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
209 Lisp_Object reg, int overwrite)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 Lisp_Object obj;
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
212 Lisp_Charset *cs;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
213
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
214 if (!overwrite)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
215 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
216 cs = alloc_lcrecord_type (Lisp_Charset, &lrecord_charset);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
217 zero_lcrecord (cs);
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
218 obj = wrap_charset (cs);
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
219
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
220 if (final)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
221 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
222 /* some charsets do not have final characters. This includes
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
223 ASCII, Control-1, Composite, and the two faux private
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
224 charsets. */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
225 assert (NILP (chlook->
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
226 charset_by_attributes[type][final][direction]));
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
227 chlook->charset_by_attributes[type][final][direction] = obj;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
228 }
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
229
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
230 assert (NILP (chlook->charset_by_leading_byte[id - MIN_LEADING_BYTE]));
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
231 chlook->charset_by_leading_byte[id - MIN_LEADING_BYTE] = obj;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
232 }
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
233 else
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
234 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
235 Lisp_Object ret;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
236 /* Actually overwrite the properties of the existing charset.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
237 We do this because until now charsets could never be "deleted",
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
238 so parts of the code don't bother to GC charsets. */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
239 obj = chlook->charset_by_leading_byte[id - MIN_LEADING_BYTE];
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
240 cs = XCHARSET (obj);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
241 assert (EQ (chlook->charset_by_attributes[type][final][direction],
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
242 obj));
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
243
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
244 ret = Fremhash (XCHARSET_NAME (obj), Vcharset_hash_table);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
245 assert (!NILP (ret));
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
246 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 CHARSET_ID (cs) = id;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 CHARSET_NAME (cs) = name;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 CHARSET_SHORT_NAME (cs) = short_name;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 CHARSET_LONG_NAME (cs) = long_name;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 CHARSET_REP_BYTES (cs) = rep_bytes;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 CHARSET_DIRECTION (cs) = direction;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 CHARSET_TYPE (cs) = type;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 CHARSET_COLUMNS (cs) = columns;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 CHARSET_GRAPHIC (cs) = graphic;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 CHARSET_FINAL (cs) = final;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 CHARSET_DOC_STRING (cs) = doc;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 CHARSET_REGISTRY (cs) = reg;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 CHARSET_CCL_PROGRAM (cs) = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 CHARSET_REVERSE_DIRECTION_CHARSET (cs) = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
263 CHARSET_DIMENSION (cs) = (CHARSET_TYPE (cs) == CHARSET_TYPE_94 ||
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
264 CHARSET_TYPE (cs) == CHARSET_TYPE_96) ? 1 : 2;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
265 CHARSET_CHARS (cs) = (CHARSET_TYPE (cs) == CHARSET_TYPE_94 ||
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
266 CHARSET_TYPE (cs) == CHARSET_TYPE_94X94) ? 94 : 96;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
268 if (id == LEADING_BYTE_ASCII || id == LEADING_BYTE_CONTROL_1
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
269 #ifdef ENABLE_COMPOSITE_CHARS
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
270 || id == LEADING_BYTE_COMPOSITE
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
271 #endif
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
272 )
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
273 assert (!overwrite);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
274 else
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
276 if (overwrite)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
277 free_charset_unicode_tables (obj);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
278 init_charset_unicode_tables (obj);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 /* Some charsets are "faux" and don't have names or really exist at
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 all except in the leading-byte table. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 if (!NILP (name))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
284 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
285 assert (NILP (Fgethash (name, Vcharset_hash_table, Qnil)));
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
286 Fputhash (name, obj, Vcharset_hash_table);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
287 }
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
288
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
289 recalculate_unicode_precedence ();
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 return obj;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 static int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 get_unallocated_leading_byte (int dimension)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 int lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 if (dimension == 1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
300 if (chlook->next_allocated_1_byte_leading_byte >
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
301 MAX_LEADING_BYTE_PRIVATE_1)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 lb = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 else
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
304 lb = chlook->next_allocated_1_byte_leading_byte++;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
308 if (chlook->next_allocated_2_byte_leading_byte >
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
309 MAX_LEADING_BYTE_PRIVATE_2)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 lb = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 else
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
312 lb = chlook->next_allocated_2_byte_leading_byte++;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 if (!lb)
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
316 invalid_operation
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
317 ("No more character sets free for this dimension", make_int (dimension));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 return lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 /* Basic charset Lisp functions */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326
788
026c5bf9c134 [xemacs-hg @ 2002-03-21 07:29:57 by ben]
ben
parents: 771
diff changeset
327 void
026c5bf9c134 [xemacs-hg @ 2002-03-21 07:29:57 by ben]
ben
parents: 771
diff changeset
328 get_charset_limits (Lisp_Object charset, int *low, int *high)
026c5bf9c134 [xemacs-hg @ 2002-03-21 07:29:57 by ben]
ben
parents: 771
diff changeset
329 {
026c5bf9c134 [xemacs-hg @ 2002-03-21 07:29:57 by ben]
ben
parents: 771
diff changeset
330 Lisp_Charset *cs = XCHARSET (charset);
026c5bf9c134 [xemacs-hg @ 2002-03-21 07:29:57 by ben]
ben
parents: 771
diff changeset
331
026c5bf9c134 [xemacs-hg @ 2002-03-21 07:29:57 by ben]
ben
parents: 771
diff changeset
332 if (EQ (charset, Vcharset_ascii)) *low = 0, *high = 127;
026c5bf9c134 [xemacs-hg @ 2002-03-21 07:29:57 by ben]
ben
parents: 771
diff changeset
333 else if (EQ (charset, Vcharset_control_1)) *low = 0, *high = 31;
026c5bf9c134 [xemacs-hg @ 2002-03-21 07:29:57 by ben]
ben
parents: 771
diff changeset
334 else if (CHARSET_CHARS (cs) == 94) *low = 33, *high = 126;
026c5bf9c134 [xemacs-hg @ 2002-03-21 07:29:57 by ben]
ben
parents: 771
diff changeset
335 else /* CHARSET_CHARS (cs) == 96) */ *low = 32, *high = 127;
026c5bf9c134 [xemacs-hg @ 2002-03-21 07:29:57 by ben]
ben
parents: 771
diff changeset
336 }
026c5bf9c134 [xemacs-hg @ 2002-03-21 07:29:57 by ben]
ben
parents: 771
diff changeset
337
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 DEFUN ("charsetp", Fcharsetp, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 Return non-nil if OBJECT is a charset.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341 (object))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 return CHARSETP (object) ? Qt : Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 DEFUN ("find-charset", Ffind_charset, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 Retrieve the charset of the given name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 If CHARSET-OR-NAME is a charset object, it is simply returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 Otherwise, CHARSET-OR-NAME should be a symbol. If there is no such charset,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350 nil is returned. Otherwise the associated charset object is returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 (charset_or_name))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 if (CHARSETP (charset_or_name))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 return charset_or_name;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 CHECK_SYMBOL (charset_or_name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 return Fgethash (charset_or_name, Vcharset_hash_table, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 DEFUN ("get-charset", Fget_charset, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 Retrieve the charset of the given name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 Same as `find-charset' except an error is signalled if there is no such
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 charset instead of returning nil.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 (name))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368 Lisp_Object charset = Ffind_charset (name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 if (NILP (charset))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
371 invalid_argument ("No such charset", name);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 return charset;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 /* We store the charsets in hash tables with the names as the key and the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 actual charset object as the value. Occasionally we need to use them
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 in a list format. These routines provide us with that. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 struct charset_list_closure
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 Lisp_Object *charset_list;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383 static int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384 add_charset_to_list_mapper (Lisp_Object key, Lisp_Object value,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385 void *charset_list_closure)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387 /* This function can GC */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
388 struct charset_list_closure *chcl =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 (struct charset_list_closure*) charset_list_closure;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390 Lisp_Object *charset_list = chcl->charset_list;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 *charset_list = Fcons (XCHARSET_NAME (value), *charset_list);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393 return 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
395
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396 DEFUN ("charset-list", Fcharset_list, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 Return a list of the names of all defined charsets.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 Lisp_Object charset_list = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402 struct gcpro gcpro1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 struct charset_list_closure charset_list_closure;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 GCPRO1 (charset_list);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406 charset_list_closure.charset_list = &charset_list;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 elisp_maphash (add_charset_to_list_mapper, Vcharset_hash_table,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 &charset_list_closure);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
409 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
411 return charset_list;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
413
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
414 DEFUN ("charset-name", Fcharset_name, 1, 1, 0, /*
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
415 Return the name of charset CHARSET.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
416 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
417 (charset))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
418 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
419 return XCHARSET_NAME (Fget_charset (charset));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
420 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
421
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
422 /* #### SJT Should generic properties be allowed? */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
423 DEFUN ("make-charset", Fmake_charset, 3, 3, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
424 Define a new character set.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
425 This function is for use with Mule support.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
426 NAME is a symbol, the name by which the character set is normally referred.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
427 DOC-STRING is a string describing the character set.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
428 PROPS is a property list, describing the specific nature of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429 character set. Recognized properties are:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
430
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 'short-name Short version of the charset name (ex: Latin-1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432 'long-name Long version of the charset name (ex: ISO8859-1 (Latin-1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
433 'registry A regular expression matching the font registry field for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 this character set.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 'dimension Number of octets used to index a character in this charset.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 Either 1 or 2. Defaults to 1.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437 'columns Number of columns used to display a character in this charset.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 Only used in TTY mode. (Under X, the actual width of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
439 character can be derived from the font used to display the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440 characters.) If unspecified, defaults to the dimension
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441 (this is almost always the correct value).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
442 'chars Number of characters in each dimension (94 or 96).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
443 Defaults to 94. Note that if the dimension is 2, the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
444 character set thus described is 94x94 or 96x96.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445 'final Final byte of ISO 2022 escape sequence. Must be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446 supplied. Each combination of (DIMENSION, CHARS) defines a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447 separate namespace for final bytes. Note that ISO
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448 2022 restricts the final byte to the range
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
449 0x30 - 0x7E if dimension == 1, and 0x30 - 0x5F if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
450 dimension == 2. Note also that final bytes in the range
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
451 0x30 - 0x3F are reserved for user-defined (not official)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
452 character sets.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453 'graphic 0 (use left half of font on output) or 1 (use right half
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
454 of font on output). Defaults to 0. For example, for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
455 a font whose registry is ISO8859-1, the left half
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
456 (octets 0x20 - 0x7F) is the `ascii' character set, while
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
457 the right half (octets 0xA0 - 0xFF) is the `latin-1'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
458 character set. With 'graphic set to 0, the octets
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459 will have their high bit cleared; with it set to 1,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
460 the octets will have their high bit set.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461 'direction 'l2r (left-to-right) or 'r2l (right-to-left).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
462 Defaults to 'l2r.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
463 'ccl-program A compiled CCL program used to convert a character in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464 this charset into an index into the font. This is in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465 addition to the 'graphic property. The CCL program
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466 is passed the octets of the character, with the high
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 bit cleared and set depending upon whether the value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468 of the 'graphic property is 0 or 1.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 (name, doc_string, props))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471 {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
472 int id, dimension = 1, chars = 94, graphic = 0, columns = -1;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
473 Intbyte final = 0;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
474 int direction = CHARSET_LEFT_TO_RIGHT;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
475 int type;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476 Lisp_Object registry = Qnil;
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
477 Lisp_Object charset = Qnil;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478 Lisp_Object ccl_program = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479 Lisp_Object short_name = Qnil, long_name = Qnil;
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
480 Lisp_Object existing_charset;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
481 int temporary = UNBOUNDP (name);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
482
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
483 /* NOTE: name == Qunbound is a directive from the iso2022 code to
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
484 create a temporary charset for an unknown final. We allow the final
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
485 to be overwritten with a real charset later on. */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
486
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 if (!NILP (doc_string))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488 CHECK_STRING (doc_string);
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
489 if (!UNBOUNDP (name))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
490 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
491 CHECK_SYMBOL (name);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
493 charset = Ffind_charset (name);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
494 if (!NILP (charset))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
495 invalid_operation ("Cannot redefine existing charset", name);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
496 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
498 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
499 EXTERNAL_PROPERTY_LIST_LOOP_3 (keyword, value, props)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
500 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
501 if (EQ (keyword, Qshort_name))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
502 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
503 CHECK_STRING (value);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
504 short_name = value;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
505 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506
519
1c3b60121364 [xemacs-hg @ 2001-05-08 06:00:32 by martinb]
martinb
parents: 510
diff changeset
507 else if (EQ (keyword, Qlong_name))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
508 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
509 CHECK_STRING (value);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
510 long_name = value;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
511 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
513 else if (EQ (keyword, Qdimension))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
514 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
515 CHECK_INT (value);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
516 dimension = XINT (value);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
517 if (dimension < 1 || dimension > 2)
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
518 invalid_constant ("Invalid value for 'dimension", value);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
519 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
520
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
521 else if (EQ (keyword, Qchars))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
522 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
523 CHECK_INT (value);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
524 chars = XINT (value);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
525 if (chars != 94 && chars != 96)
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
526 invalid_constant ("Invalid value for 'chars", value);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
527 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
529 else if (EQ (keyword, Qcolumns))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
530 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
531 CHECK_INT (value);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
532 columns = XINT (value);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
533 if (columns != 1 && columns != 2)
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
534 invalid_constant ("Invalid value for 'columns", value);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
535 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
537 else if (EQ (keyword, Qgraphic))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
538 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
539 CHECK_INT (value);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
540 graphic = XINT (value);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
541 if (graphic < 0 || graphic > 1)
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
542 invalid_constant ("Invalid value for 'graphic", value);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
543 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
544
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
545 else if (EQ (keyword, Qregistry))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
546 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
547 CHECK_STRING (value);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
548 registry = value;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
549 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
550
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
551 else if (EQ (keyword, Qdirection))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
552 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
553 if (EQ (value, Ql2r))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
554 direction = CHARSET_LEFT_TO_RIGHT;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
555 else if (EQ (value, Qr2l))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
556 direction = CHARSET_RIGHT_TO_LEFT;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
557 else
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
558 invalid_constant ("Invalid value for 'direction", value);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
559 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
560
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
561 else if (EQ (keyword, Qfinal))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
562 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
563 CHECK_CHAR_COERCE_INT (value);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
564 final = XCHAR (value);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
565 if (final < '0' || final > '~')
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
566 invalid_constant ("Invalid value for 'final", value);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
567 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
568
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
569 else if (EQ (keyword, Qccl_program))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
570 {
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
571 struct ccl_program test_ccl;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
572
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
573 if (setup_ccl_program (&test_ccl, value) < 0)
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
574 invalid_argument ("Invalid value for 'ccl-program", value);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
575 ccl_program = value;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
576 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
577 else
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
578 invalid_constant ("Unrecognized property", keyword);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
579 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
580 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
581
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
582 if (!final)
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
583 invalid_argument ("'final must be specified", Qunbound);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
584 if (dimension == 2 && final > 0x5F)
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
585 invalid_constant
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
586 ("Final must be in the range 0x30 - 0x5F for dimension == 2",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
587 make_char (final));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
588
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
589 if (dimension == 1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
590 type = (chars == 94) ? CHARSET_TYPE_94 : CHARSET_TYPE_96;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
591 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
592 type = (chars == 94) ? CHARSET_TYPE_94X94 : CHARSET_TYPE_96X96;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
593
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 801
diff changeset
594 existing_charset = charset_by_attributes (type, final, direction);
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
595
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
596 if (!NILP (existing_charset) && !XCHARSET (existing_charset)->temporary)
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 565
diff changeset
597 invalid_argument
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
598 ("Character set already defined for this DIMENSION/CHARS/FINAL/DIRECTION combo",
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
599 existing_charset);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
600
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
601 if (!NILP (existing_charset))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
602 /* Reuse same leading byte */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
603 id = XCHARSET_ID (existing_charset);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
604 else
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
605 id = get_unallocated_leading_byte (dimension);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
606
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
607 if (temporary)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
608 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
609 Intbyte tempname[80];
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
610
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
611 qxesprintf (tempname, "___temporary___%d__", id);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
612 name = intern_int (tempname);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
613 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
614 if (NILP (doc_string))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
615 doc_string = build_string ("");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
616 if (NILP (registry))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
617 registry = build_string ("");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
618 if (NILP (short_name))
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
619 short_name = XSYMBOL (name)->name;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
620 if (NILP (long_name))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
621 long_name = doc_string;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
622 if (columns == -1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
623 columns = dimension;
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
624
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
625 charset = make_charset (id, name, dimension + 2, type, columns, graphic,
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
626 final, direction, short_name, long_name,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
627 doc_string, registry, !NILP (existing_charset));
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
628
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
629 XCHARSET (charset)->temporary = temporary;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
630 if (!NILP (ccl_program))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
631 XCHARSET_CCL_PROGRAM (charset) = ccl_program;
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
632
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
633 {
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
634 Lisp_Object revdircs =
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 801
diff changeset
635 charset_by_attributes (type, final,
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
636 direction == CHARSET_LEFT_TO_RIGHT ?
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
637 CHARSET_RIGHT_TO_LEFT : CHARSET_LEFT_TO_RIGHT);
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
638 if (!NILP (revdircs))
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
639 {
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
640 XCHARSET_REVERSE_DIRECTION_CHARSET (revdircs) = charset;
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
641 XCHARSET_REVERSE_DIRECTION_CHARSET (charset) = revdircs;
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
642 }
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
643 }
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
644
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
645 return charset;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
646 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
647
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
648 DEFUN ("make-reverse-direction-charset", Fmake_reverse_direction_charset,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
649 2, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
650 Make a charset equivalent to CHARSET but which goes in the opposite direction.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
651 NEW-NAME is the name of the new charset. Return the new charset.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
652 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
653 (charset, new_name))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
654 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
655 Lisp_Object new_charset = Qnil;
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
656 int id, dimension, columns, graphic;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
657 Intbyte final;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
658 int direction, type;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
659 Lisp_Object registry, doc_string, short_name, long_name;
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
660 Lisp_Charset *cs;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
661
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
662 charset = Fget_charset (charset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
663 if (!NILP (XCHARSET_REVERSE_DIRECTION_CHARSET (charset)))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
664 invalid_operation ("Charset already has reverse-direction charset",
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
665 charset);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
666
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
667 CHECK_SYMBOL (new_name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
668 if (!NILP (Ffind_charset (new_name)))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
669 invalid_operation ("Cannot redefine existing charset", new_name);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
670
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
671 cs = XCHARSET (charset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
672
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
673 type = CHARSET_TYPE (cs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
674 columns = CHARSET_COLUMNS (cs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
675 dimension = CHARSET_DIMENSION (cs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
676 id = get_unallocated_leading_byte (dimension);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
677
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
678 graphic = CHARSET_GRAPHIC (cs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
679 final = CHARSET_FINAL (cs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
680 direction = CHARSET_RIGHT_TO_LEFT;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
681 if (CHARSET_DIRECTION (cs) == CHARSET_RIGHT_TO_LEFT)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
682 direction = CHARSET_LEFT_TO_RIGHT;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
683 doc_string = CHARSET_DOC_STRING (cs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
684 short_name = CHARSET_SHORT_NAME (cs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
685 long_name = CHARSET_LONG_NAME (cs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
686 registry = CHARSET_REGISTRY (cs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
687
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
688 new_charset = make_charset (id, new_name, dimension + 2, type, columns,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
689 graphic, final, direction, short_name, long_name,
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
690 doc_string, registry, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
691
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
692 CHARSET_REVERSE_DIRECTION_CHARSET (cs) = new_charset;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
693 XCHARSET_REVERSE_DIRECTION_CHARSET (new_charset) = charset;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
694
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
695 return new_charset;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
696 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
697
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
698 DEFUN ("charset-reverse-direction-charset", Fcharset_reverse_direction_charset,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
699 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
700 Return the reverse-direction charset parallel to CHARSET, if any.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
701 This is the charset with the same properties (in particular, the same
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
702 dimension, number of characters per dimension, and final byte) as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
703 CHARSET but whose characters are displayed in the opposite direction.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
704 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
705 (charset))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
706 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
707 charset = Fget_charset (charset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
708 return XCHARSET_REVERSE_DIRECTION_CHARSET (charset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
709 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
710
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
711 DEFUN ("charset-from-attributes", Fcharset_from_attributes, 3, 4, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
712 Return a charset with the given DIMENSION, CHARS, FINAL, and DIRECTION.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
713 If DIRECTION is omitted, both directions will be checked (left-to-right
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
714 will be returned if character sets exist for both directions).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
715 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
716 (dimension, chars, final, direction))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
717 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
718 int dm, ch, fi, di = -1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
719 int type;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
720 Lisp_Object obj = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
721
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
722 CHECK_INT (dimension);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
723 dm = XINT (dimension);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
724 if (dm < 1 || dm > 2)
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
725 invalid_constant ("Invalid value for DIMENSION", dimension);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
726
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
727 CHECK_INT (chars);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
728 ch = XINT (chars);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
729 if (ch != 94 && ch != 96)
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
730 invalid_constant ("Invalid value for CHARS", chars);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
731
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
732 CHECK_CHAR_COERCE_INT (final);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
733 fi = XCHAR (final);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
734 if (fi < '0' || fi > '~')
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
735 invalid_constant ("Invalid value for FINAL", final);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
736
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
737 if (EQ (direction, Ql2r))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
738 di = CHARSET_LEFT_TO_RIGHT;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
739 else if (EQ (direction, Qr2l))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
740 di = CHARSET_RIGHT_TO_LEFT;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
741 else if (!NILP (direction))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
742 invalid_constant ("Invalid value for DIRECTION", direction);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
743
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
744 if (dm == 2 && fi > 0x5F)
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
745 invalid_constant
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
746 ("Final must be in the range 0x30 - 0x5F for dimension == 2", final);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
747
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
748 if (dm == 1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
749 type = (ch == 94) ? CHARSET_TYPE_94 : CHARSET_TYPE_96;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
750 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
751 type = (ch == 94) ? CHARSET_TYPE_94X94 : CHARSET_TYPE_96X96;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
752
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
753 if (di == -1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
754 {
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 801
diff changeset
755 obj = charset_by_attributes (type, fi, CHARSET_LEFT_TO_RIGHT);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
756 if (NILP (obj))
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 801
diff changeset
757 obj = charset_by_attributes (type, fi, CHARSET_RIGHT_TO_LEFT);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
758 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
759 else
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 801
diff changeset
760 obj = charset_by_attributes (type, fi, di);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
761
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
762 if (CHARSETP (obj))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
763 return XCHARSET_NAME (obj);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
764 return obj;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
765 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
766
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
767 DEFUN ("charset-short-name", Fcharset_short_name, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
768 Return short name of CHARSET.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
769 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
770 (charset))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
771 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
772 return XCHARSET_SHORT_NAME (Fget_charset (charset));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
773 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
774
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
775 DEFUN ("charset-long-name", Fcharset_long_name, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
776 Return long name of CHARSET.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
777 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
778 (charset))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
779 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
780 return XCHARSET_LONG_NAME (Fget_charset (charset));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
781 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
782
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
783 DEFUN ("charset-description", Fcharset_description, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
784 Return description of CHARSET.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
785 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
786 (charset))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
787 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
788 return XCHARSET_DOC_STRING (Fget_charset (charset));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
789 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
790
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
791 DEFUN ("charset-dimension", Fcharset_dimension, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
792 Return dimension of CHARSET.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
793 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
794 (charset))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
795 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
796 return make_int (XCHARSET_DIMENSION (Fget_charset (charset)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
797 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
798
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
799 DEFUN ("charset-property", Fcharset_property, 2, 2, 0, /*
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
800 Return property PROP of CHARSET, a charset object or symbol naming a charset.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
801 Recognized properties are those listed in `make-charset', as well as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
802 'name and 'doc-string.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
803 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
804 (charset, prop))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
805 {
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
806 Lisp_Charset *cs;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
807
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
808 charset = Fget_charset (charset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
809 cs = XCHARSET (charset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
810
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
811 CHECK_SYMBOL (prop);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
812 if (EQ (prop, Qname)) return CHARSET_NAME (cs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
813 if (EQ (prop, Qshort_name)) return CHARSET_SHORT_NAME (cs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
814 if (EQ (prop, Qlong_name)) return CHARSET_LONG_NAME (cs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
815 if (EQ (prop, Qdoc_string)) return CHARSET_DOC_STRING (cs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
816 if (EQ (prop, Qdimension)) return make_int (CHARSET_DIMENSION (cs));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
817 if (EQ (prop, Qcolumns)) return make_int (CHARSET_COLUMNS (cs));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
818 if (EQ (prop, Qgraphic)) return make_int (CHARSET_GRAPHIC (cs));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
819 if (EQ (prop, Qfinal)) return make_char (CHARSET_FINAL (cs));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
820 if (EQ (prop, Qchars)) return make_int (CHARSET_CHARS (cs));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
821 if (EQ (prop, Qregistry)) return CHARSET_REGISTRY (cs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
822 if (EQ (prop, Qccl_program)) return CHARSET_CCL_PROGRAM (cs);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
823 if (EQ (prop, Qdirection))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
824 return CHARSET_DIRECTION (cs) == CHARSET_LEFT_TO_RIGHT ? Ql2r : Qr2l;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
825 if (EQ (prop, Qreverse_direction_charset))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
826 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
827 Lisp_Object obj = CHARSET_REVERSE_DIRECTION_CHARSET (cs);
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
828 /* #### Is this translation OK? If so, error checking sufficient? */
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 444
diff changeset
829 return CHARSETP (obj) ? XCHARSET_NAME (obj) : obj;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
830 }
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
831 invalid_constant ("Unrecognized charset property name", prop);
801
2b676dc88c66 [xemacs-hg @ 2002-04-01 03:58:02 by ben]
ben
parents: 793
diff changeset
832 RETURN_NOT_REACHED (Qnil)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
833 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
834
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
835 DEFUN ("charset-id", Fcharset_id, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
836 Return charset identification number of CHARSET.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
837 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
838 (charset))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
839 {
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
840 return make_int (XCHARSET_LEADING_BYTE (Fget_charset (charset)));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
841 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
842
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
843 /* #### We need to figure out which properties we really want to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
844 allow to be set. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
845
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
846 DEFUN ("set-charset-ccl-program", Fset_charset_ccl_program, 2, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
847 Set the 'ccl-program property of CHARSET to CCL-PROGRAM.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
848 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
849 (charset, ccl_program))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
850 {
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
851 struct ccl_program test_ccl;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
852
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
853 charset = Fget_charset (charset);
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
854 if (setup_ccl_program (&test_ccl, ccl_program) < 0)
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
855 invalid_argument ("Invalid ccl-program", ccl_program);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
856 XCHARSET_CCL_PROGRAM (charset) = ccl_program;
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 452
diff changeset
857 face_property_was_changed (Vdefault_face, Qfont, Qglobal);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
858 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
859 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
860
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
861 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
862 invalidate_charset_font_caches (Lisp_Object charset)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
863 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
864 /* Invalidate font cache entries for charset on all devices. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
865 Lisp_Object devcons, concons, hash_table;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
866 DEVICE_LOOP_NO_BREAK (devcons, concons)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
867 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
868 struct device *d = XDEVICE (XCAR (devcons));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
869 hash_table = Fgethash (charset, d->charset_font_cache, Qunbound);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
870 if (!UNBOUNDP (hash_table))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
871 Fclrhash (hash_table);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
872 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
873 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
874
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
875 /* Japanese folks may want to (set-charset-registry 'ascii "jisx0201") */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
876 DEFUN ("set-charset-registry", Fset_charset_registry, 2, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
877 Set the 'registry property of CHARSET to REGISTRY.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
878 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
879 (charset, registry))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
880 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
881 charset = Fget_charset (charset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
882 CHECK_STRING (registry);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
883 XCHARSET_REGISTRY (charset) = registry;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
884 invalidate_charset_font_caches (charset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
885 face_property_was_changed (Vdefault_face, Qfont, Qglobal);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
886 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
887 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
888
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
889
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
890 /************************************************************************/
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
891 /* memory usage */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
892 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
893
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
894 #ifdef MEMORY_USAGE_STATS
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
895
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
896 struct charset_stats
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
897 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
898 int from_unicode;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
899 int to_unicode;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
900 int other;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
901 };
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
902
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
903 static void
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
904 compute_charset_usage (Lisp_Object charset, struct charset_stats *stats,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
905 struct overhead_stats *ovstats)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
906 {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
907 struct Lisp_Charset *c = XCHARSET (charset);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
908 xzero (*stats);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
909 stats->other += malloced_storage_size (c, sizeof (*c), ovstats);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
910 stats->from_unicode += compute_from_unicode_table_size (charset, ovstats);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
911 stats->to_unicode += compute_to_unicode_table_size (charset, ovstats);
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
912 }
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
913
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
914 DEFUN ("charset-memory-usage", Fcharset_memory_usage, 1, 1, 0, /*
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
915 Return stats about the memory usage of charset CHARSET.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
916 The values returned are in the form of an alist of usage types and
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
917 byte counts. The byte counts attempt to encompass all the memory used
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
918 by the charset (separate from the memory logically associated with a
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
919 charset or frame), including internal structures and any malloc()
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
920 overhead associated with them. In practice, the byte counts are
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
921 underestimated for various reasons, e.g. because certain memory usage
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
922 is very hard to determine \(e.g. the amount of memory used inside the
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
923 Xt library or inside the X server).
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
924
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
925 Multiple slices of the total memory usage may be returned, separated
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
926 by a nil. Each slice represents a particular view of the memory, a
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
927 particular way of partitioning it into groups. Within a slice, there
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
928 is no overlap between the groups of memory, and each slice collectively
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
929 represents all the memory concerned.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
930 */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
931 (charset))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
932 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
933 struct charset_stats stats;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
934 struct overhead_stats ovstats;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
935 Lisp_Object val = Qnil;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
936
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
937 charset = Fget_charset (charset);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
938 xzero (ovstats);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
939 compute_charset_usage (charset, &stats, &ovstats);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
940
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
941 val = acons (Qfrom_unicode, make_int (stats.from_unicode), val);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
942 val = acons (Qto_unicode, make_int (stats.to_unicode), val);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
943 val = Fcons (Qnil, val);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
944 val = acons (Qactually_requested, make_int (ovstats.was_requested), val);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
945 val = acons (Qmalloc_overhead, make_int (ovstats.malloc_overhead), val);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
946 val = acons (Qgap_overhead, make_int (ovstats.gap_overhead), val);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
947 val = acons (Qdynarr_overhead, make_int (ovstats.dynarr_overhead), val);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
948
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
949 return Fnreverse (val);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
950 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
951
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
952 #endif /* MEMORY_USAGE_STATS */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
953
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
954
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
955 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
956 /* initialization */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
957 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
958
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
959 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
960 syms_of_mule_charset (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
961 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
962 INIT_LRECORD_IMPLEMENTATION (charset);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
963
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
964 DEFSUBR (Fcharsetp);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
965 DEFSUBR (Ffind_charset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
966 DEFSUBR (Fget_charset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
967 DEFSUBR (Fcharset_list);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
968 DEFSUBR (Fcharset_name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
969 DEFSUBR (Fmake_charset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
970 DEFSUBR (Fmake_reverse_direction_charset);
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 788
diff changeset
971 DEFSUBR (Fcharset_reverse_direction_charset);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
972 DEFSUBR (Fcharset_from_attributes);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
973 DEFSUBR (Fcharset_short_name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
974 DEFSUBR (Fcharset_long_name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
975 DEFSUBR (Fcharset_description);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
976 DEFSUBR (Fcharset_dimension);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
977 DEFSUBR (Fcharset_property);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
978 DEFSUBR (Fcharset_id);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
979 DEFSUBR (Fset_charset_ccl_program);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
980 DEFSUBR (Fset_charset_registry);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
981
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
982 #ifdef MEMORY_USAGE_STATS
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
983 DEFSUBR (Fcharset_memory_usage);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
984 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
985
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
986 DEFSYMBOL (Qcharsetp);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
987 DEFSYMBOL (Qregistry);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
988 DEFSYMBOL (Qfinal);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
989 DEFSYMBOL (Qgraphic);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
990 DEFSYMBOL (Qdirection);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
991 DEFSYMBOL (Qreverse_direction_charset);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
992 DEFSYMBOL (Qshort_name);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
993 DEFSYMBOL (Qlong_name);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
994
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
995 DEFSYMBOL (Qfrom_unicode);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
996 DEFSYMBOL (Qto_unicode);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
997
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
998 DEFSYMBOL (Ql2r);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
999 DEFSYMBOL (Qr2l);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1001 /* Charsets, compatible with FSF 20.3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1002 Naming convention is Script-Charset[-Edition] */
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1003 DEFSYMBOL (Qlatin_iso8859_1);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1004 DEFSYMBOL (Qlatin_iso8859_2);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1005 DEFSYMBOL (Qlatin_iso8859_3);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1006 DEFSYMBOL (Qlatin_iso8859_4);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1007 DEFSYMBOL (Qthai_tis620);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1008 DEFSYMBOL (Qgreek_iso8859_7);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1009 DEFSYMBOL (Qarabic_iso8859_6);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1010 DEFSYMBOL (Qhebrew_iso8859_8);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1011 DEFSYMBOL (Qkatakana_jisx0201);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1012 DEFSYMBOL (Qlatin_jisx0201);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1013 DEFSYMBOL (Qcyrillic_iso8859_5);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1014 DEFSYMBOL (Qlatin_iso8859_9);
728
4d00488244c1 [xemacs-hg @ 2002-01-10 09:50:43 by stephent]
stephent
parents: 665
diff changeset
1015 DEFSYMBOL (Qlatin_iso8859_15);
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1016 DEFSYMBOL (Qjapanese_jisx0208_1978);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1017 DEFSYMBOL (Qchinese_gb2312);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1018 DEFSYMBOL (Qjapanese_jisx0208);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1019 DEFSYMBOL (Qkorean_ksc5601);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1020 DEFSYMBOL (Qjapanese_jisx0212);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1021 DEFSYMBOL (Qchinese_cns11643_1);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1022 DEFSYMBOL (Qchinese_cns11643_2);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1023 DEFSYMBOL (Qchinese_big5_1);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1024 DEFSYMBOL (Qchinese_big5_2);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1025
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 519
diff changeset
1026 DEFSYMBOL (Qcomposite);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1027 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1028
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1029 static int
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1030 init_charset_unicode_tables_mapper (Lisp_Object key, Lisp_Object value,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1031 void *closure)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1032 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1033 init_charset_unicode_tables (value);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1034 return 0;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1035 }
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1036
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1037 void
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1038 init_mule_charset (void)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1039 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1040 /* See mule-charset.h, definition of Lisp_Charset. */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1041 if (initialized)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1042 elisp_maphash (init_charset_unicode_tables_mapper, Vcharset_hash_table,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1043 0);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1044 }
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1045
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1046 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1047 vars_of_mule_charset (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1048 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1049 int i, j, k;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1050
452
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
1051 chlook = xnew_and_zero (struct charset_lookup); /* zero for Purify. */
3d3049ae1304 Import from CVS: tag r21-2-41
cvs
parents: 446
diff changeset
1052 dump_add_root_struct_ptr (&chlook, &charset_lookup_description);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1053
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1054 /* Table of charsets indexed by leading byte. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1055 for (i = 0; i < countof (chlook->charset_by_leading_byte); i++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1056 chlook->charset_by_leading_byte[i] = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1057
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1058 /* Table of charsets indexed by type/final-byte/direction. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1059 for (i = 0; i < countof (chlook->charset_by_attributes); i++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1060 for (j = 0; j < countof (chlook->charset_by_attributes[0]); j++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1061 for (k = 0; k < countof (chlook->charset_by_attributes[0][0]); k++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1062 chlook->charset_by_attributes[i][j][k] = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1063
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1064 chlook->next_allocated_1_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_1;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1065 chlook->next_allocated_2_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_2;
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1066
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1067 staticpro (&Vcharset_hash_table);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1068 Vcharset_hash_table =
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1069 make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1070 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1071
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1072 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1073 complex_vars_of_mule_charset (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1074 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1075 /* Predefined character sets. We store them into variables for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1076 ease of access. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1077
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1078 staticpro (&Vcharset_ascii);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1079 Vcharset_ascii =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1080 make_charset (LEADING_BYTE_ASCII, Qascii, 1,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1081 CHARSET_TYPE_94, 1, 0, 'B',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1082 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1083 build_string ("ASCII"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1084 build_msg_string ("ASCII"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1085 build_msg_string ("ASCII (ISO646 IRV)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1086 build_string ("\\(iso8859-[0-9]*\\|-ascii\\)"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1087 staticpro (&Vcharset_control_1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1088 Vcharset_control_1 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1089 make_charset (LEADING_BYTE_CONTROL_1, Qcontrol_1, 2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1090 CHARSET_TYPE_94, 1, 1, 0,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1091 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1092 build_string ("C1"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1093 build_msg_string ("Control characters"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1094 build_msg_string ("Control characters 128-191"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1095 build_string (""), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1096 staticpro (&Vcharset_latin_iso8859_1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1097 Vcharset_latin_iso8859_1 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1098 make_charset (LEADING_BYTE_LATIN_ISO8859_1, Qlatin_iso8859_1, 2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1099 CHARSET_TYPE_96, 1, 1, 'A',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1100 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1101 build_string ("Latin-1"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1102 build_msg_string ("ISO8859-1 (Latin-1)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1103 build_msg_string ("ISO8859-1 (Latin-1)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1104 build_string ("iso8859-1"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1105 staticpro (&Vcharset_latin_iso8859_2);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1106 Vcharset_latin_iso8859_2 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1107 make_charset (LEADING_BYTE_LATIN_ISO8859_2, Qlatin_iso8859_2, 2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1108 CHARSET_TYPE_96, 1, 1, 'B',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1109 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1110 build_string ("Latin-2"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1111 build_msg_string ("ISO8859-2 (Latin-2)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1112 build_msg_string ("ISO8859-2 (Latin-2)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1113 build_string ("iso8859-2"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1114 staticpro (&Vcharset_latin_iso8859_3);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1115 Vcharset_latin_iso8859_3 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1116 make_charset (LEADING_BYTE_LATIN_ISO8859_3, Qlatin_iso8859_3, 2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1117 CHARSET_TYPE_96, 1, 1, 'C',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1118 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1119 build_string ("Latin-3"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1120 build_msg_string ("ISO8859-3 (Latin-3)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1121 build_msg_string ("ISO8859-3 (Latin-3)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1122 build_string ("iso8859-3"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1123 staticpro (&Vcharset_latin_iso8859_4);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1124 Vcharset_latin_iso8859_4 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1125 make_charset (LEADING_BYTE_LATIN_ISO8859_4, Qlatin_iso8859_4, 2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1126 CHARSET_TYPE_96, 1, 1, 'D',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1127 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1128 build_string ("Latin-4"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1129 build_msg_string ("ISO8859-4 (Latin-4)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1130 build_msg_string ("ISO8859-4 (Latin-4)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1131 build_string ("iso8859-4"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1132 staticpro (&Vcharset_thai_tis620);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1133 Vcharset_thai_tis620 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1134 make_charset (LEADING_BYTE_THAI_TIS620, Qthai_tis620, 2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1135 CHARSET_TYPE_96, 1, 1, 'T',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1136 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1137 build_string ("TIS620"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1138 build_msg_string ("TIS620 (Thai)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1139 build_msg_string ("TIS620.2529 (Thai)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1140 build_string ("tis620"),0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1141 staticpro (&Vcharset_greek_iso8859_7);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1142 Vcharset_greek_iso8859_7 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1143 make_charset (LEADING_BYTE_GREEK_ISO8859_7, Qgreek_iso8859_7, 2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1144 CHARSET_TYPE_96, 1, 1, 'F',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1145 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1146 build_string ("ISO8859-7"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1147 build_msg_string ("ISO8859-7 (Greek)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1148 build_msg_string ("ISO8859-7 (Greek)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1149 build_string ("iso8859-7"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1150 staticpro (&Vcharset_arabic_iso8859_6);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1151 Vcharset_arabic_iso8859_6 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1152 make_charset (LEADING_BYTE_ARABIC_ISO8859_6, Qarabic_iso8859_6, 2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1153 CHARSET_TYPE_96, 1, 1, 'G',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1154 CHARSET_RIGHT_TO_LEFT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1155 build_string ("ISO8859-6"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1156 build_msg_string ("ISO8859-6 (Arabic)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1157 build_msg_string ("ISO8859-6 (Arabic)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1158 build_string ("iso8859-6"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1159 staticpro (&Vcharset_hebrew_iso8859_8);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1160 Vcharset_hebrew_iso8859_8 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1161 make_charset (LEADING_BYTE_HEBREW_ISO8859_8, Qhebrew_iso8859_8, 2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1162 CHARSET_TYPE_96, 1, 1, 'H',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1163 CHARSET_RIGHT_TO_LEFT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1164 build_string ("ISO8859-8"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1165 build_msg_string ("ISO8859-8 (Hebrew)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1166 build_msg_string ("ISO8859-8 (Hebrew)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1167 build_string ("iso8859-8"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1168 staticpro (&Vcharset_katakana_jisx0201);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1169 Vcharset_katakana_jisx0201 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1170 make_charset (LEADING_BYTE_KATAKANA_JISX0201, Qkatakana_jisx0201, 2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1171 CHARSET_TYPE_94, 1, 1, 'I',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1172 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1173 build_string ("JISX0201 Kana"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1174 build_msg_string ("JISX0201.1976 (Japanese Kana)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1175 build_msg_string ("JISX0201.1976 Japanese Kana"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1176 build_string ("jisx0201.1976"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1177 staticpro (&Vcharset_latin_jisx0201);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1178 Vcharset_latin_jisx0201 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1179 make_charset (LEADING_BYTE_LATIN_JISX0201, Qlatin_jisx0201, 2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1180 CHARSET_TYPE_94, 1, 0, 'J',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1181 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1182 build_string ("JISX0201 Roman"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1183 build_msg_string ("JISX0201.1976 (Japanese Roman)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1184 build_msg_string ("JISX0201.1976 Japanese Roman"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1185 build_string ("jisx0201.1976"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1186 staticpro (&Vcharset_cyrillic_iso8859_5);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1187 Vcharset_cyrillic_iso8859_5 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1188 make_charset (LEADING_BYTE_CYRILLIC_ISO8859_5, Qcyrillic_iso8859_5, 2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1189 CHARSET_TYPE_96, 1, 1, 'L',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1190 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1191 build_string ("ISO8859-5"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1192 build_msg_string ("ISO8859-5 (Cyrillic)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1193 build_msg_string ("ISO8859-5 (Cyrillic)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1194 build_string ("iso8859-5"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1195 staticpro (&Vcharset_latin_iso8859_9);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1196 Vcharset_latin_iso8859_9 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1197 make_charset (LEADING_BYTE_LATIN_ISO8859_9, Qlatin_iso8859_9, 2,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1198 CHARSET_TYPE_96, 1, 1, 'M',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1199 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1200 build_string ("Latin-5"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1201 build_msg_string ("ISO8859-9 (Latin-5)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1202 build_msg_string ("ISO8859-9 (Latin-5)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1203 build_string ("iso8859-9"), 0);
728
4d00488244c1 [xemacs-hg @ 2002-01-10 09:50:43 by stephent]
stephent
parents: 665
diff changeset
1204 staticpro (&Vcharset_latin_iso8859_15);
4d00488244c1 [xemacs-hg @ 2002-01-10 09:50:43 by stephent]
stephent
parents: 665
diff changeset
1205 Vcharset_latin_iso8859_15 =
4d00488244c1 [xemacs-hg @ 2002-01-10 09:50:43 by stephent]
stephent
parents: 665
diff changeset
1206 make_charset (LEADING_BYTE_LATIN_ISO8859_15, Qlatin_iso8859_15, 2,
4d00488244c1 [xemacs-hg @ 2002-01-10 09:50:43 by stephent]
stephent
parents: 665
diff changeset
1207 CHARSET_TYPE_96, 1, 1, 'b',
4d00488244c1 [xemacs-hg @ 2002-01-10 09:50:43 by stephent]
stephent
parents: 665
diff changeset
1208 CHARSET_LEFT_TO_RIGHT,
4d00488244c1 [xemacs-hg @ 2002-01-10 09:50:43 by stephent]
stephent
parents: 665
diff changeset
1209 build_string ("Latin-9"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1210 build_msg_string ("ISO8859-15 (Latin-9)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1211 build_msg_string ("ISO8859-15 (Latin-9)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1212 build_string ("iso8859-15"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1213 staticpro (&Vcharset_japanese_jisx0208_1978);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1214 Vcharset_japanese_jisx0208_1978 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1215 make_charset (LEADING_BYTE_JAPANESE_JISX0208_1978, Qjapanese_jisx0208_1978, 3,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1216 CHARSET_TYPE_94X94, 2, 0, '@',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1217 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1218 build_string ("JISX0208.1978"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1219 build_msg_string ("JISX0208.1978 (Japanese)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1220 build_msg_string
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1221 ("JISX0208.1978 Japanese Kanji (so called \"old JIS\")"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1222 build_string ("\\(jisx0208\\|jisc6226\\)\\.1978"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1223 staticpro (&Vcharset_chinese_gb2312);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1224 Vcharset_chinese_gb2312 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1225 make_charset (LEADING_BYTE_CHINESE_GB2312, Qchinese_gb2312, 3,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1226 CHARSET_TYPE_94X94, 2, 0, 'A',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1227 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1228 build_string ("GB2312"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1229 build_msg_string ("GB2312)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1230 build_msg_string ("GB2312 Chinese simplified"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1231 build_string ("gb2312"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1232 staticpro (&Vcharset_japanese_jisx0208);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1233 Vcharset_japanese_jisx0208 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1234 make_charset (LEADING_BYTE_JAPANESE_JISX0208, Qjapanese_jisx0208, 3,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1235 CHARSET_TYPE_94X94, 2, 0, 'B',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1236 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1237 build_string ("JISX0208"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1238 build_msg_string ("JISX0208.1983/1990 (Japanese)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1239 build_msg_string ("JISX0208.1983/1990 Japanese Kanji"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1240 build_string ("jisx0208.19\\(83\\|90\\)"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1241 staticpro (&Vcharset_korean_ksc5601);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1242 Vcharset_korean_ksc5601 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1243 make_charset (LEADING_BYTE_KOREAN_KSC5601, Qkorean_ksc5601, 3,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1244 CHARSET_TYPE_94X94, 2, 0, 'C',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1245 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1246 build_string ("KSC5601"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1247 build_msg_string ("KSC5601 (Korean"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1248 build_msg_string ("KSC5601 Korean Hangul and Hanja"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1249 build_string ("ksc5601"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1250 staticpro (&Vcharset_japanese_jisx0212);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1251 Vcharset_japanese_jisx0212 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1252 make_charset (LEADING_BYTE_JAPANESE_JISX0212, Qjapanese_jisx0212, 3,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1253 CHARSET_TYPE_94X94, 2, 0, 'D',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1254 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1255 build_string ("JISX0212"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1256 build_msg_string ("JISX0212 (Japanese)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1257 build_msg_string ("JISX0212 Japanese Supplement"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1258 build_string ("jisx0212"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1259
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1260 #define CHINESE_CNS_PLANE_RE(n) "cns11643[.-]\\(.*[.-]\\)?" n "$"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1261 staticpro (&Vcharset_chinese_cns11643_1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1262 Vcharset_chinese_cns11643_1 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1263 make_charset (LEADING_BYTE_CHINESE_CNS11643_1, Qchinese_cns11643_1, 3,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1264 CHARSET_TYPE_94X94, 2, 0, 'G',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1265 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1266 build_string ("CNS11643-1"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1267 build_msg_string ("CNS11643-1 (Chinese traditional)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1268 build_msg_string
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1269 ("CNS 11643 Plane 1 Chinese traditional"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1270 build_string (CHINESE_CNS_PLANE_RE("1")), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1271 staticpro (&Vcharset_chinese_cns11643_2);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1272 Vcharset_chinese_cns11643_2 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1273 make_charset (LEADING_BYTE_CHINESE_CNS11643_2, Qchinese_cns11643_2, 3,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1274 CHARSET_TYPE_94X94, 2, 0, 'H',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1275 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1276 build_string ("CNS11643-2"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1277 build_msg_string ("CNS11643-2 (Chinese traditional)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1278 build_msg_string
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1279 ("CNS 11643 Plane 2 Chinese traditional"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1280 build_string (CHINESE_CNS_PLANE_RE("2")), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1281 staticpro (&Vcharset_chinese_big5_1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1282 Vcharset_chinese_big5_1 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1283 make_charset (LEADING_BYTE_CHINESE_BIG5_1, Qchinese_big5_1, 3,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1284 CHARSET_TYPE_94X94, 2, 0, '0',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1285 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1286 build_string ("Big5"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1287 build_msg_string ("Big5 (Level-1)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1288 build_msg_string
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1289 ("Big5 Level-1 Chinese traditional"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1290 build_string ("big5"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1291 staticpro (&Vcharset_chinese_big5_2);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1292 Vcharset_chinese_big5_2 =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1293 make_charset (LEADING_BYTE_CHINESE_BIG5_2, Qchinese_big5_2, 3,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1294 CHARSET_TYPE_94X94, 2, 0, '1',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1295 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1296 build_string ("Big5"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1297 build_msg_string ("Big5 (Level-2)"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1298 build_msg_string
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1299 ("Big5 Level-2 Chinese traditional"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1300 build_string ("big5"), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1301
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1302
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1303 #ifdef ENABLE_COMPOSITE_CHARS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1304 /* #### For simplicity, we put composite chars into a 96x96 charset.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1305 This is going to lead to problems because you can run out of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1306 room, esp. as we don't yet recycle numbers. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1307 staticpro (&Vcharset_composite);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1308 Vcharset_composite =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1309 make_charset (LEADING_BYTE_COMPOSITE, Qcomposite, 3,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1310 CHARSET_TYPE_96X96, 2, 0, 0,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1311 CHARSET_LEFT_TO_RIGHT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1312 build_string ("Composite"),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1313 build_msg_string ("Composite characters"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1314 build_msg_string ("Composite characters"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1315 build_string (""), 0);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1316 #else
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1317 /* We create a hack so that we have a way of storing ESC 0 and ESC 1
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1318 sequences as "characters", so that they will be output correctly. */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1319 staticpro (&Vcharset_composite);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1320 Vcharset_composite =
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1321 make_charset (LEADING_BYTE_COMPOSITE_REPLACEMENT, Qcomposite, 2,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1322 CHARSET_TYPE_96, 1, 1, '|',
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1323 CHARSET_LEFT_TO_RIGHT,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1324 build_string ("Composite hack"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1325 build_msg_string ("Composite characters hack"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1326 build_msg_string ("Composite characters hack"),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 728
diff changeset
1327 build_string (""), 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1328 #endif /* ENABLE_COMPOSITE_CHARS */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1329 }