1 /* Header for UCS-4 character representation.
2 Copyright (C) 1999 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation.
5 This file is part of XEmacs.
7 XEmacs is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2, or (at your option) any
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with XEmacs; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* Rewritten by MORIOKA Tomohiko <tomo@m17n.org>. */
24 #ifndef _XEMACS_CHARACTER_H
25 #define _XEMACS_CHARACTER_H
28 #include "mule-charset.h"
31 /************************************************************************/
32 /* Definition of leading bytes */
33 /************************************************************************/
35 #define MIN_LEADING_BYTE 0x80
36 /* These need special treatment in a string and/or character */
37 #define LEADING_BYTE_ASCII 0x8E /* Omitted in a buffer */
38 #define LEADING_BYTE_CONTROL_1 0x8F /* represent normal 80-9F */
40 /** The following are for 1-byte characters in an official charset. **/
42 #define LEADING_BYTE_LATIN_ISO8859_1 0x81 /* Right half of ISO 8859-1 */
43 #define LEADING_BYTE_LATIN_ISO8859_2 0x82 /* Right half of ISO 8859-2 */
44 #define LEADING_BYTE_LATIN_ISO8859_3 0x83 /* Right half of ISO 8859-3 */
45 #define LEADING_BYTE_LATIN_ISO8859_4 0x84 /* Right half of ISO 8859-4 */
46 #define LEADING_BYTE_THAI_TIS620 0x85 /* TIS620-2533 */
47 #define LEADING_BYTE_GREEK_ISO8859_7 0x86 /* Right half of ISO 8859-7 */
48 #define LEADING_BYTE_ARABIC_ISO8859_6 0x87 /* Right half of ISO 8859-6 */
49 #define LEADING_BYTE_HEBREW_ISO8859_8 0x88 /* Right half of ISO 8859-8 */
50 #define LEADING_BYTE_KATAKANA_JISX0201 0x89 /* Right half of JIS X0201-1976 */
51 #define LEADING_BYTE_LATIN_JISX0201 0x8A /* Left half of JIS X0201-1976 */
52 #define LEADING_BYTE_CYRILLIC_ISO8859_5 0x8C /* Right half of ISO 8859-5 */
53 #define LEADING_BYTE_LATIN_ISO8859_9 0x8D /* Right half of ISO 8859-9 */
55 #define MIN_LEADING_BYTE_OFFICIAL_1 LEADING_BYTE_LATIN_ISO8859_1
56 #define MAX_LEADING_BYTE_OFFICIAL_1 LEADING_BYTE_LATIN_ISO8859_9
58 #define LEADING_BYTE_CHINESE_BIG5_1 0xB0 /* Big5 Level 1 */
59 #define LEADING_BYTE_CHINESE_BIG5_2 0xB1 /* Big5 Level 2 */
60 #define MIN_LEADING_BYTE_PRIVATE_2 0xB0
61 #define MAX_LEADING_BYTE_PRIVATE_2 0xBF
63 /** The following are for 2-byte characters in an official charset. **/
65 #define LEADING_BYTE_JAPANESE_JISX0208_1978 0xC0/* Japanese JIS X0208-1978 */
66 #define LEADING_BYTE_CHINESE_GB2312 0xC1 /* Chinese Hanzi GB2312-1980 */
67 #define LEADING_BYTE_JAPANESE_JISX0208 0xC2 /* Japanese JIS X0208-1983 */
68 #define LEADING_BYTE_KOREAN_KSC5601 0xC3 /* Hangul KS C5601-1987 */
69 #define LEADING_BYTE_JAPANESE_JISX0212 0xC4 /* Japanese JIS X0212-1990 */
70 #define LEADING_BYTE_CHINESE_CCITT_GB 0xC5 /* CCITT Extended GB */
71 #define LEADING_BYTE_CHINESE_CNS11643_1 0xC7 /* Chinese CNS11643 Set 1 */
72 #define LEADING_BYTE_CHINESE_CNS11643_2 0xC8 /* Chinese CNS11643 Set 2 */
73 #define LEADING_BYTE_CHINESE_CNS11643_3 0xC9 /* Chinese CNS11643 Set 3 */
74 #define LEADING_BYTE_CHINESE_CNS11643_4 0xCA /* Chinese CNS11643 Set 4 */
75 #define LEADING_BYTE_CHINESE_CNS11643_5 0xCB /* Chinese CNS11643 Set 5 */
76 #define LEADING_BYTE_CHINESE_CNS11643_6 0xCC /* Chinese CNS11643 Set 6 */
77 #define LEADING_BYTE_CHINESE_CNS11643_7 0xCD /* Chinese CNS11643 Set 7 */
78 #define LEADING_BYTE_KOREAN_KPS9566 0xCE /* DPRK Hangul KPS 9566-1997 */
80 #define MIN_LEADING_BYTE_OFFICIAL_2 LEADING_BYTE_JAPANESE_JISX0208_1978
81 #define MAX_LEADING_BYTE_OFFICIAL_2 LEADING_BYTE_KOREAN_KPS9566
83 /** The following are for 1- and 2-byte characters in a private charset. **/
85 #define PRE_LEADING_BYTE_PRIVATE_1 0x120 /* 1-byte char-set */
86 #define PRE_LEADING_BYTE_PRIVATE_2 0x121 /* 2-byte char-set */
88 #define MIN_LEADING_BYTE_PRIVATE_1 0x0D0
89 #define MAX_LEADING_BYTE_PRIVATE_1 0x11f
91 #define NUM_LEADING_BYTES 256
94 /************************************************************************/
95 /* Operations on individual bytes */
97 /************************************************************************/
99 /* Argument `c' should be (unsigned int) or (unsigned char). */
100 /* Note that SP and DEL are not included. */
102 #define BYTE_ASCII_P(c) ((c) < 0x80)
103 #define BYTE_C0_P(c) ((c) < 0x20)
104 /* Do some forced casting just to make *sure* things are gotten right. */
105 #define BYTE_C1_P(c) ((unsigned int) ((unsigned int) (c) - 0x80) < 0x20)
108 /************************************************************************/
109 /* Operations on individual bytes */
110 /* in a Mule-formatted string */
111 /************************************************************************/
113 /* Does this byte represent the first byte of a character? */
116 BUFBYTE_FIRST_BYTE_P(Bufbyte c)
118 return (c <= 0x7f) || (0xc0 <= c);
122 /************************************************************************/
123 /* Information about a particular character set */
124 /************************************************************************/
128 struct lcrecord_header header;
132 Lisp_Object doc_string, registry, short_name, long_name;
134 Lisp_Object reverse_direction_charset;
136 Lisp_Object ccl_program;
138 /* Final byte of this character set in ISO2022 designating escape sequence */
141 /* Number of bytes (1 - 4) required in the internal representation
142 for characters in this character set. This is *not* the
143 same as the dimension of the character set). */
144 unsigned int rep_bytes;
146 /* Number of columns a character in this charset takes up, on TTY
147 devices. Not used for X devices. */
148 unsigned int columns;
150 /* Direction of this character set */
151 unsigned int direction;
153 /* Type of this character set (94, 96, 94x94, 96x96) */
156 /* Number of bytes used in encoding of this character set (1 or 2) */
157 unsigned int dimension;
159 /* Number of chars in each dimension (usually 94 or 96) */
162 /* Which half of font to be used to display this character set */
163 unsigned int graphic;
166 DECLARE_LRECORD (charset, struct Lisp_Charset);
167 #define XCHARSET(x) XRECORD (x, charset, struct Lisp_Charset)
168 #define XSETCHARSET(x, p) XSETRECORD (x, p, charset)
169 #define CHARSETP(x) RECORDP (x, charset)
170 #define GC_CHARSETP(x) GC_RECORDP (x, charset)
171 #define CHECK_CHARSET(x) CHECK_RECORD (x, charset)
172 #define CONCHECK_CHARSET(x) CONCHECK_RECORD (x, charset)
174 #define CHARSET_TYPE_94 0 /* This charset includes 94 characters. */
175 #define CHARSET_TYPE_96 1 /* This charset includes 96 characters. */
176 #define CHARSET_TYPE_94X94 2 /* This charset includes 94x94 characters. */
177 #define CHARSET_TYPE_96X96 3 /* This charset includes 96x96 characters. */
179 #define CHARSET_LEFT_TO_RIGHT 0
180 #define CHARSET_RIGHT_TO_LEFT 1
182 /* Leading byte and id have been regrouped. -- OG */
183 #define CHARSET_ID(cs) ((cs)->id)
184 #define CHARSET_LEADING_BYTE(cs) ((Bufbyte)(CHARSET_ID(cs)))
185 #define CHARSET_NAME(cs) ((cs)->name)
186 #define CHARSET_SHORT_NAME(cs) ((cs)->short_name)
187 #define CHARSET_LONG_NAME(cs) ((cs)->long_name)
188 #define CHARSET_REP_BYTES(cs) ((cs)->rep_bytes)
189 #define CHARSET_COLUMNS(cs) ((cs)->columns)
190 #define CHARSET_GRAPHIC(cs) ((cs)->graphic)
191 #define CHARSET_TYPE(cs) ((cs)->type)
192 #define CHARSET_DIRECTION(cs) ((cs)->direction)
193 #define CHARSET_FINAL(cs) ((cs)->final)
194 #define CHARSET_DOC_STRING(cs) ((cs)->doc_string)
195 #define CHARSET_REGISTRY(cs) ((cs)->registry)
196 #define CHARSET_CCL_PROGRAM(cs) ((cs)->ccl_program)
197 #define CHARSET_DIMENSION(cs) ((cs)->dimension)
198 #define CHARSET_CHARS(cs) ((cs)->chars)
199 #define CHARSET_REVERSE_DIRECTION_CHARSET(cs) ((cs)->reverse_direction_charset)
202 #define XCHARSET_ID(cs) CHARSET_ID (XCHARSET (cs))
203 #define XCHARSET_NAME(cs) CHARSET_NAME (XCHARSET (cs))
204 #define XCHARSET_SHORT_NAME(cs) CHARSET_SHORT_NAME (XCHARSET (cs))
205 #define XCHARSET_LONG_NAME(cs) CHARSET_LONG_NAME (XCHARSET (cs))
206 #define XCHARSET_REP_BYTES(cs) CHARSET_REP_BYTES (XCHARSET (cs))
207 #define XCHARSET_COLUMNS(cs) CHARSET_COLUMNS (XCHARSET (cs))
208 #define XCHARSET_GRAPHIC(cs) CHARSET_GRAPHIC (XCHARSET (cs))
209 #define XCHARSET_TYPE(cs) CHARSET_TYPE (XCHARSET (cs))
210 #define XCHARSET_DIRECTION(cs) CHARSET_DIRECTION (XCHARSET (cs))
211 #define XCHARSET_FINAL(cs) CHARSET_FINAL (XCHARSET (cs))
212 #define XCHARSET_DOC_STRING(cs) CHARSET_DOC_STRING (XCHARSET (cs))
213 #define XCHARSET_REGISTRY(cs) CHARSET_REGISTRY (XCHARSET (cs))
214 #define XCHARSET_LEADING_BYTE(cs) CHARSET_LEADING_BYTE (XCHARSET (cs))
215 #define XCHARSET_CCL_PROGRAM(cs) CHARSET_CCL_PROGRAM (XCHARSET (cs))
216 #define XCHARSET_DIMENSION(cs) CHARSET_DIMENSION (XCHARSET (cs))
217 #define XCHARSET_CHARS(cs) CHARSET_CHARS (XCHARSET (cs))
218 #ifdef CHARSET_PRIVATE_P
219 #define XCHARSET_PRIVATE_P(cs) CHARSET_PRIVATE_P (XCHARSET (cs))
221 #define XCHARSET_REVERSE_DIRECTION_CHARSET(cs) \
222 CHARSET_REVERSE_DIRECTION_CHARSET (XCHARSET (cs))
224 /* Table of charsets indexed by (leading byte - 128). */
225 extern Lisp_Object charset_by_leading_byte[NUM_LEADING_BYTES];
227 /* Table of charsets indexed by type/final-byte/direction. */
228 extern Lisp_Object charset_by_attributes[4][128][2];
230 #ifdef ERROR_CHECK_TYPECHECK
231 /* int not Bufbyte even though that is the actual type of a leading byte.
232 This way, out-ot-range values will get caught rather than automatically
234 INLINE Lisp_Object CHARSET_BY_LEADING_BYTE (int lb);
236 CHARSET_BY_LEADING_BYTE (int lb)
238 assert (lb >= MIN_LEADING_BYTE &&
239 lb < (MIN_LEADING_BYTE + NUM_LEADING_BYTES));
240 return charset_by_leading_byte[lb - MIN_LEADING_BYTE];
245 #define CHARSET_BY_LEADING_BYTE(lb) \
246 (charset_by_leading_byte[(lb) - MIN_LEADING_BYTE])
250 #define CHARSET_BY_ATTRIBUTES(type, final, dir) \
251 (charset_by_attributes[type][final][dir])
253 INLINE int REP_BYTES_BY_FIRST_BYTE (int fb);
255 REP_BYTES_BY_FIRST_BYTE (int fb)
259 else if ( fb < 0xe0 )
261 else if ( fb < 0xf0 )
263 else if ( fb < 0xf8 )
265 else if ( fb < 0xfc )
272 /************************************************************************/
273 /* Dealing with characters */
274 /************************************************************************/
276 /* Is this character represented by more than one byte in a string? */
278 #define CHAR_MULTIBYTE_P(c) ((c) >= 0x80)
280 #define CHAR_ASCII_P(c) (!CHAR_MULTIBYTE_P (c))
282 /* The bit fields of character are divided into 3 parts:
283 FIELD1(5bits):FIELD2(7bits):FIELD3(7bits) */
285 #define CHAR_FIELD1_MASK (0x7F << 14)
286 #define CHAR_FIELD2_MASK (0x7F << 7)
287 #define CHAR_FIELD3_MASK 0x7F
289 #define MIN_CHAR_GREEK 0x0370
290 #define MAX_CHAR_GREEK 0x03CF
292 #define MIN_CHAR_CYRILLIC 0x0400
293 #define MAX_CHAR_CYRILLIC 0x045F
295 #define MIN_CHAR_HEBREW 0x0590
296 #define MAX_CHAR_HEBREW 0x05EF
298 #define MIN_CHAR_THAI 0x0E00
299 #define MAX_CHAR_THAI 0x0E5F
301 #define MIN_CHAR_HALFWIDTH_KATAKANA 0xFF60
302 #define MAX_CHAR_HALFWIDTH_KATAKANA 0xFF9F
304 /* Macros to access each field of a character code of C. */
306 #define CHAR_FIELD1(c) (((c) & CHAR_FIELD1_MASK) >> 14)
307 #define CHAR_FIELD2_INTERNAL(c) (((c) & CHAR_FIELD2_MASK) >> 7)
308 #define CHAR_FIELD3_INTERNAL(c) ((c) & CHAR_FIELD3_MASK)
310 /* Field 1, if non-zero, usually holds a leading byte for a
311 dimension-2 charset. Field 2, if non-zero, usually holds a leading
312 byte for a dimension-1 charset. */
314 /* Converting between field values and leading bytes. */
316 #define FIELD1_TO_PRIVATE_LEADING_BYTE 0x80
317 #define FIELD1_TO_OFFICIAL_LEADING_BYTE 0x80
318 #define FIELD2_TO_PRIVATE_LEADING_BYTE 0xb0
319 #define FIELD2_TO_OFFICIAL_LEADING_BYTE 0x80
321 /* Minimum and maximum allowed values for the fields. */
323 #define MIN_CHAR_FIELD2_OFFICIAL \
324 (MIN_LEADING_BYTE_OFFICIAL_1 - FIELD2_TO_OFFICIAL_LEADING_BYTE)
325 #define MAX_CHAR_FIELD2_OFFICIAL \
326 (MAX_LEADING_BYTE_OFFICIAL_1 - FIELD2_TO_OFFICIAL_LEADING_BYTE)
328 #define MIN_CHAR_FIELD1_OFFICIAL \
329 (MIN_LEADING_BYTE_OFFICIAL_2 - FIELD1_TO_OFFICIAL_LEADING_BYTE)
330 #define MAX_CHAR_FIELD1_OFFICIAL \
331 (MAX_LEADING_BYTE_OFFICIAL_2 - FIELD1_TO_OFFICIAL_LEADING_BYTE)
333 #define MIN_CHAR_FIELD2_PRIVATE \
334 (MIN_LEADING_BYTE_PRIVATE_1 - FIELD2_TO_PRIVATE_LEADING_BYTE)
335 #define MAX_CHAR_FIELD2_PRIVATE \
336 (MAX_LEADING_BYTE_PRIVATE_1 - FIELD2_TO_PRIVATE_LEADING_BYTE)
338 #define MIN_CHAR_FIELD1_PRIVATE \
339 (MIN_LEADING_BYTE_PRIVATE_2 - FIELD1_TO_PRIVATE_LEADING_BYTE)
340 #define MAX_CHAR_FIELD1_PRIVATE \
341 (MAX_LEADING_BYTE_PRIVATE_2 - FIELD1_TO_PRIVATE_LEADING_BYTE)
343 /* Minimum character code of each <type> character. */
345 #define MULE_CHAR_PRIVATE_OFFSET (0xe0 << 16)
347 #define MIN_CHAR_OFFICIAL_TYPE9N \
348 (MULE_CHAR_PRIVATE_OFFSET | (MIN_CHAR_FIELD2_OFFICIAL << 7))
349 #define MIN_CHAR_PRIVATE_TYPE9N \
350 (MULE_CHAR_PRIVATE_OFFSET | (MIN_CHAR_FIELD2_PRIVATE << 7))
351 #define MIN_CHAR_PRIVATE_TYPE9NX9N \
352 (MULE_CHAR_PRIVATE_OFFSET | (MIN_CHAR_FIELD1_PRIVATE << 14))
353 #define MIN_CHAR_OFFICIAL_TYPE9NX9N \
354 (MULE_CHAR_PRIVATE_OFFSET | (MIN_CHAR_FIELD1_OFFICIAL << 14))
355 #define MIN_CHAR_COMPOSITION \
356 (MULE_CHAR_PRIVATE_OFFSET | (0x7f << 14))
358 /* Return a character whose charset is CHARSET and position-codes
359 are C1 and C2. TYPE9N character ignores C2.
361 NOTE: This takes advantage of the fact that
362 FIELD2_TO_OFFICIAL_LEADING_BYTE and
363 FIELD2_TO_PRIVATE_LEADING_BYTE are the same.
366 INLINE Emchar MAKE_CHAR (Lisp_Object charset, int c1, int c2);
368 MAKE_CHAR (Lisp_Object charset, int c1, int c2)
370 if (EQ (charset, Vcharset_ascii))
372 else if (EQ (charset, Vcharset_control_1))
374 else if (EQ (charset, Vcharset_latin_iso8859_1))
376 else if (EQ (charset, Vcharset_greek_iso8859_7))
377 return c1 + MIN_CHAR_GREEK - 0x20;
378 else if (EQ (charset, Vcharset_cyrillic_iso8859_5))
379 return c1 + MIN_CHAR_CYRILLIC - 0x20;
380 else if (EQ (charset, Vcharset_hebrew_iso8859_8))
381 return c1 + MIN_CHAR_HEBREW - 0x20;
382 else if (EQ (charset, Vcharset_thai_tis620))
383 return c1 + MIN_CHAR_THAI - 0x20;
384 else if (EQ (charset, Vcharset_katakana_jisx0201))
386 return c1 + MIN_CHAR_HALFWIDTH_KATAKANA - 0x20;
389 #ifdef ENABLE_COMPOSITE_CHARS
390 else if (EQ (charset, Vcharset_composite))
391 return (0x1F << 14) | ((c1) << 7) | (c2);
393 else if (XCHARSET_DIMENSION (charset) == 1)
394 return MULE_CHAR_PRIVATE_OFFSET
395 | ((XCHARSET_LEADING_BYTE (charset) -
396 FIELD2_TO_OFFICIAL_LEADING_BYTE) << 7) | (c1);
398 return MULE_CHAR_PRIVATE_OFFSET
399 | ((XCHARSET_LEADING_BYTE (charset) -
400 FIELD1_TO_PRIVATE_LEADING_BYTE) << 14) | ((c1) << 7) | (c2);
403 INLINE void breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2);
405 breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2)
407 if (CHAR_ASCII_P (c))
409 *charset = Vcharset_ascii;
415 *charset = Vcharset_control_1;
416 *c1 = CHAR_FIELD3_INTERNAL (c);
421 *charset = Vcharset_latin_iso8859_1;
422 *c1 = CHAR_FIELD3_INTERNAL (c);
425 else if (c < MIN_CHAR_GREEK)
429 else if (c <= MAX_CHAR_GREEK)
431 *charset = Vcharset_greek_iso8859_7;
432 *c1 = c - MIN_CHAR_GREEK + 0x20;
435 else if (c < MIN_CHAR_CYRILLIC)
439 else if (c <= MAX_CHAR_CYRILLIC)
441 *charset = Vcharset_cyrillic_iso8859_5;
442 *c1 = c - MIN_CHAR_CYRILLIC + 0x20;
445 else if (c < MIN_CHAR_HEBREW)
449 else if (c <= MAX_CHAR_HEBREW)
451 *charset = Vcharset_hebrew_iso8859_8;
452 *c1 = c - MIN_CHAR_HEBREW + 0x20;
455 else if (c < MIN_CHAR_THAI)
459 else if (c <= MAX_CHAR_THAI)
461 *charset = Vcharset_thai_tis620;
462 *c1 = c - MIN_CHAR_THAI + 0x20;
465 else if (c < MIN_CHAR_HALFWIDTH_KATAKANA)
469 else if (c <= MAX_CHAR_HALFWIDTH_KATAKANA)
471 *charset = Vcharset_katakana_jisx0201;
472 *c1 = c - MIN_CHAR_HALFWIDTH_KATAKANA + 0x20;
475 else if (c < MIN_CHAR_PRIVATE_TYPE9NX9N)
478 = CHARSET_BY_LEADING_BYTE (CHAR_FIELD2_INTERNAL (c) +
479 FIELD2_TO_OFFICIAL_LEADING_BYTE);
480 *c1 = CHAR_FIELD3_INTERNAL(c);
483 else if (c < MIN_CHAR_COMPOSITION)
486 = CHARSET_BY_LEADING_BYTE (CHAR_FIELD1 (c) +
487 FIELD1_TO_OFFICIAL_LEADING_BYTE);
488 *c1 = CHAR_FIELD2_INTERNAL(c);
489 *c2 = CHAR_FIELD3_INTERNAL(c);
493 #ifdef ENABLE_COMPOSITE_CHARS
494 return LEADING_BYTE_COMPOSITE;
498 #endif /* ENABLE_COMPOSITE_CHARS */
502 #define BREAKUP_CHAR(c, charset, c1, c2) \
503 breakup_char_1 (c, &(charset), &(c1), &(c2))
505 INLINE Lisp_Object CHAR_CHARSET (Emchar c);
507 CHAR_CHARSET (Emchar c)
512 BREAKUP_CHAR(c, charset, c1, c2);
516 #define CHAR_LEADING_BYTE(c) (XCHARSET_LEADING_BYTE(CHAR_CHARSET(c)))
519 #ifdef ENABLE_COMPOSITE_CHARS
520 /************************************************************************/
521 /* Composite characters */
522 /************************************************************************/
524 Emchar lookup_composite_char (Bufbyte *str, int len);
525 Lisp_Object composite_char_string (Emchar ch);
526 #endif /* ENABLE_COMPOSITE_CHARS */
529 /************************************************************************/
530 /* Exported functions */
531 /************************************************************************/
533 EXFUN (Ffind_charset, 1);
534 EXFUN (Fget_charset, 1);
536 extern Lisp_Object Vcharset_chinese_big5_1;
537 extern Lisp_Object Vcharset_chinese_big5_2;
538 extern Lisp_Object Vcharset_japanese_jisx0208;
540 Emchar Lstream_get_emchar_1 (Lstream *stream, int first_char);
541 int Lstream_fput_emchar (Lstream *stream, Emchar ch);
542 void Lstream_funget_emchar (Lstream *stream, Emchar ch);
544 int copy_internal_to_external (CONST Bufbyte *internal, Bytecount len,
545 unsigned char *external);
546 Bytecount copy_external_to_internal (CONST unsigned char *external,
547 int len, Bufbyte *internal);
549 #endif /* CHAR_IS_UCS4 */
550 #endif /* _XEMACS_CHARACTER_H */