1 /* Header for multibyte character handler.
2 Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation.
4 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
5 National Institute of Advanced Industrial Science and Technology (AIST)
6 Registration Number H13PRO009
8 This file is part of GNU Emacs.
10 GNU Emacs is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
15 GNU Emacs is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23 #ifndef EMACS_CHARACTER_H
24 #define EMACS_CHARACTER_H
28 /* character code 1st byte byte sequence
29 -------------- -------- -------------
31 80-7FF C2..DF 110xxxxx 10xxxxxx
32 800-FFFF E0..EF 1110xxxx 10xxxxxx 10xxxxxx
33 10000-1FFFFF F0..F7 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
34 200000-3FFF7F F8 11111000 1000xxxx 10xxxxxx 10xxxxxx 10xxxxxx
35 3FFF80-3FFFFF C0..C1 1100000x 10xxxxxx (for eight-bit-char)
38 invalid 1st byte 80..BF 10xxxxxx
39 F9..FF 11111xxx (xxx != 000)
42 /* Maximum character code ((1 << CHARACTERBITS) - 1). */
43 #define MAX_CHAR 0x3FFFFF
45 /* Maximum Unicode character code. */
46 #define MAX_UNICODE_CHAR 0x10FFFF
48 /* Maximum N-byte character codes. */
49 #define MAX_1_BYTE_CHAR 0x7F
50 #define MAX_2_BYTE_CHAR 0x7FF
51 #define MAX_3_BYTE_CHAR 0xFFFF
52 #define MAX_4_BYTE_CHAR 0x1FFFFF
53 #define MAX_5_BYTE_CHAR 0x3FFF7F
55 /* Minimum leading code of multibyte characters. */
56 #define MIN_MULTIBYTE_LEADING_CODE 0xC0
57 /* Maximum leading code of multibyte characters. */
58 #define MAX_MULTIBYTE_LEADING_CODE 0xF8
60 /* Nonzero iff C is a character that corresponds to a raw 8-bit
62 #define CHAR_BYTE8_P(c) ((c) > MAX_5_BYTE_CHAR)
64 /* Return the character code for raw 8-bit byte BYTE. */
65 #define BYTE8_TO_CHAR(byte) ((byte) + 0x3FFF00)
67 #define UNIBYTE_TO_CHAR(byte) \
68 (ASCII_BYTE_P (byte) ? (byte) : BYTE8_TO_CHAR (byte))
70 /* Return the raw 8-bit byte for character C. */
71 #define CHAR_TO_BYTE8(c) \
74 : multibyte_char_to_unibyte (c))
76 /* Return the raw 8-bit byte for character C,
77 or -1 if C doesn't correspond to a byte. */
78 #define CHAR_TO_BYTE_SAFE(c) \
81 : multibyte_char_to_unibyte_safe (c))
83 /* Nonzero iff BYTE is the 1st byte of a multibyte form of a character
84 that corresponds to a raw 8-bit byte. */
85 #define CHAR_BYTE8_HEAD_P(byte) ((byte) == 0xC0 || (byte) == 0xC1)
87 /* If C is not ASCII, make it unibyte. */
88 #define MAKE_CHAR_UNIBYTE(c) \
90 if (! ASCII_CHAR_P (c)) \
91 c = CHAR_TO_BYTE8 (c); \
95 /* If C is not ASCII, make it multibyte. Assumes C < 256. */
96 #define MAKE_CHAR_MULTIBYTE(c) \
97 (eassert ((c) >= 0 && (c) < 256), (c) = UNIBYTE_TO_CHAR (c))
99 /* This is the maximum byte length of multibyte form. */
100 #define MAX_MULTIBYTE_LENGTH 5
102 /* Return a Lisp character whose character code is C. Assumes C is
103 a valid character code. */
104 #define make_char(c) make_number (c)
106 /* Nonzero iff C is an ASCII byte. */
107 #define ASCII_BYTE_P(c) UNSIGNED_CMP (c, <, 0x80)
109 /* Nonzero iff X is a character. */
110 #define CHARACTERP(x) (NATNUMP (x) && XFASTINT (x) <= MAX_CHAR)
112 /* Nonzero iff C is valid as a character code. */
113 #define CHAR_VALID_P(c) UNSIGNED_CMP (c, <=, MAX_CHAR)
115 /* Check if Lisp object X is a character or not. */
116 #define CHECK_CHARACTER(x) \
117 CHECK_TYPE (CHARACTERP (x), Qcharacterp, x)
119 #define CHECK_CHARACTER_CAR(x) \
121 Lisp_Object tmp = XCAR (x); \
122 CHECK_CHARACTER (tmp); \
123 XSETCAR ((x), tmp); \
126 #define CHECK_CHARACTER_CDR(x) \
128 Lisp_Object tmp = XCDR (x); \
129 CHECK_CHARACTER (tmp); \
130 XSETCDR ((x), tmp); \
133 /* Nonzero iff C is a character of code less than 0x100. */
134 #define SINGLE_BYTE_CHAR_P(c) UNSIGNED_CMP (c, <, 0x100)
136 /* Nonzero if character C has a printable glyph. */
137 #define CHAR_PRINTABLE_P(c) \
138 (((c) >= 32 && (c) < 127) \
139 || ! NILP (CHAR_TABLE_REF (Vprintable_chars, (c))))
141 /* Return byte length of multibyte form for character C. */
142 #define CHAR_BYTES(c) \
143 ( (c) <= MAX_1_BYTE_CHAR ? 1 \
144 : (c) <= MAX_2_BYTE_CHAR ? 2 \
145 : (c) <= MAX_3_BYTE_CHAR ? 3 \
146 : (c) <= MAX_4_BYTE_CHAR ? 4 \
147 : (c) <= MAX_5_BYTE_CHAR ? 5 \
151 /* Return the leading code of multibyte form of C. */
152 #define CHAR_LEADING_CODE(c) \
153 ((c) <= MAX_1_BYTE_CHAR ? c \
154 : (c) <= MAX_2_BYTE_CHAR ? (0xC0 | ((c) >> 6)) \
155 : (c) <= MAX_3_BYTE_CHAR ? (0xE0 | ((c) >> 12)) \
156 : (c) <= MAX_4_BYTE_CHAR ? (0xF0 | ((c) >> 18)) \
157 : (c) <= MAX_5_BYTE_CHAR ? 0xF8 \
158 : (0xC0 | (((c) >> 6) & 0x01)))
161 /* Store multibyte form of the character C in P. The caller should
162 allocate at least MAX_MULTIBYTE_LENGTH bytes area at P in advance.
163 Returns the length of the multibyte form. */
165 #define CHAR_STRING(c, p) \
166 (UNSIGNED_CMP (c, <=, MAX_1_BYTE_CHAR) \
169 : UNSIGNED_CMP (c, <=, MAX_2_BYTE_CHAR) \
170 ? ((p)[0] = (0xC0 | ((c) >> 6)), \
171 (p)[1] = (0x80 | ((c) & 0x3F)), \
173 : UNSIGNED_CMP (c, <=, MAX_3_BYTE_CHAR) \
174 ? ((p)[0] = (0xE0 | ((c) >> 12)), \
175 (p)[1] = (0x80 | (((c) >> 6) & 0x3F)), \
176 (p)[2] = (0x80 | ((c) & 0x3F)), \
178 : verify_expr (sizeof (c) <= sizeof (unsigned), char_string (c, p)))
180 /* Store multibyte form of byte B in P. The caller should allocate at
181 least MAX_MULTIBYTE_LENGTH bytes area at P in advance. Returns the
182 length of the multibyte form. */
184 #define BYTE8_STRING(b, p) \
185 ((p)[0] = (0xC0 | (((b) >> 6) & 0x01)), \
186 (p)[1] = (0x80 | ((b) & 0x3F)), \
190 /* Store multibyte form of the character C in P and advance P to the
191 end of the multibyte form. The caller should allocate at least
192 MAX_MULTIBYTE_LENGTH bytes area at P in advance. */
194 #define CHAR_STRING_ADVANCE(c, p) \
196 if ((c) <= MAX_1_BYTE_CHAR) \
198 else if ((c) <= MAX_2_BYTE_CHAR) \
199 *(p)++ = (0xC0 | ((c) >> 6)), \
200 *(p)++ = (0x80 | ((c) & 0x3F)); \
201 else if ((c) <= MAX_3_BYTE_CHAR) \
202 *(p)++ = (0xE0 | ((c) >> 12)), \
203 *(p)++ = (0x80 | (((c) >> 6) & 0x3F)), \
204 *(p)++ = (0x80 | ((c) & 0x3F)); \
207 verify (sizeof (c) <= sizeof (unsigned)); \
208 (p) += char_string (c, p); \
213 /* Nonzero iff BYTE starts a non-ASCII character in a multibyte
215 #define LEADING_CODE_P(byte) (((byte) & 0xC0) == 0xC0)
217 /* Nonzero iff BYTE is a trailing code of a non-ASCII character in a
219 #define TRAILING_CODE_P(byte) (((byte) & 0xC0) == 0x80)
221 /* Nonzero iff BYTE starts a character in a multibyte form.
222 This is equivalent to:
223 (ASCII_BYTE_P (byte) || LEADING_CODE_P (byte)) */
224 #define CHAR_HEAD_P(byte) (((byte) & 0xC0) != 0x80)
226 /* How many bytes a character that starts with BYTE occupies in a
228 #define BYTES_BY_CHAR_HEAD(byte) \
229 (!((byte) & 0x80) ? 1 \
230 : !((byte) & 0x20) ? 2 \
231 : !((byte) & 0x10) ? 3 \
232 : !((byte) & 0x08) ? 4 \
236 /* The byte length of multibyte form at unibyte string P ending at
237 PEND. If STR doesn't point to a valid multibyte form, return 0. */
239 #define MULTIBYTE_LENGTH(p, pend) \
241 : !((p)[0] & 0x80) ? 1 \
242 : ((p + 1 >= pend) || (((p)[1] & 0xC0) != 0x80)) ? 0 \
243 : ((p)[0] & 0xE0) == 0xC0 ? 2 \
244 : ((p + 2 >= pend) || (((p)[2] & 0xC0) != 0x80)) ? 0 \
245 : ((p)[0] & 0xF0) == 0xE0 ? 3 \
246 : ((p + 3 >= pend) || (((p)[3] & 0xC0) != 0x80)) ? 0 \
247 : ((p)[0] & 0xF8) == 0xF0 ? 4 \
248 : ((p + 4 >= pend) || (((p)[4] & 0xC0) != 0x80)) ? 0 \
249 : (p)[0] == 0xF8 && ((p)[1] & 0xF0) == 0x80 ? 5 \
253 /* Like MULTIBYTE_LENGTH, but don't check the ending address. */
255 #define MULTIBYTE_LENGTH_NO_CHECK(p) \
256 (!((p)[0] & 0x80) ? 1 \
257 : ((p)[1] & 0xC0) != 0x80 ? 0 \
258 : ((p)[0] & 0xE0) == 0xC0 ? 2 \
259 : ((p)[2] & 0xC0) != 0x80 ? 0 \
260 : ((p)[0] & 0xF0) == 0xE0 ? 3 \
261 : ((p)[3] & 0xC0) != 0x80 ? 0 \
262 : ((p)[0] & 0xF8) == 0xF0 ? 4 \
263 : ((p)[4] & 0xC0) != 0x80 ? 0 \
264 : (p)[0] == 0xF8 && ((p)[1] & 0xF0) == 0x80 ? 5 \
267 /* If P is before LIMIT, advance P to the next character boundary.
268 Assumes that P is already at a character boundary of the same
269 multibyte form whose end address is LIMIT. */
271 #define NEXT_CHAR_BOUNDARY(p, limit) \
274 (p) += BYTES_BY_CHAR_HEAD (*(p)); \
278 /* If P is after LIMIT, advance P to the previous character boundary.
279 Assumes that P is already at a character boundary of the same
280 multibyte form whose beginning address is LIMIT. */
282 #define PREV_CHAR_BOUNDARY(p, limit) \
286 const unsigned char *chp = (p); \
289 } while (chp >= limit && ! CHAR_HEAD_P (*chp)); \
290 (p) = (BYTES_BY_CHAR_HEAD (*chp) == (p) - chp) ? chp : (p) - 1; \
294 /* Return the character code of character whose multibyte form is at
295 P. Note that this macro unifies CJK characters whose codepoints
296 are in the Private Use Areas (PUAs), so it might return a different
297 codepoint from the one actually stored at P. */
299 #define STRING_CHAR(p) \
302 : ! ((p)[0] & 0x20) \
303 ? (((((p)[0] & 0x1F) << 6) \
305 + (((unsigned char) (p)[0]) < 0xC2 ? 0x3FFF80 : 0)) \
306 : ! ((p)[0] & 0x10) \
307 ? ((((p)[0] & 0x0F) << 12) \
308 | (((p)[1] & 0x3F) << 6) \
310 : string_char ((p), NULL, NULL))
313 /* Like STRING_CHAR, but set ACTUAL_LEN to the length of multibyte
316 Note: This macro returns the actual length of the character's
317 multibyte sequence as it is stored in a buffer or string. The
318 character it returns might have a different codepoint that has a
319 different multibyte sequence of a different length, due to possible
320 unification of CJK characters inside string_char. Therefore do NOT
321 assume that the length returned by this macro is identical to the
322 length of the multibyte sequence of the character it returns. */
324 #define STRING_CHAR_AND_LENGTH(p, actual_len) \
326 ? ((actual_len) = 1, (p)[0]) \
327 : ! ((p)[0] & 0x20) \
328 ? ((actual_len) = 2, \
329 (((((p)[0] & 0x1F) << 6) \
331 + (((unsigned char) (p)[0]) < 0xC2 ? 0x3FFF80 : 0))) \
332 : ! ((p)[0] & 0x10) \
333 ? ((actual_len) = 3, \
334 ((((p)[0] & 0x0F) << 12) \
335 | (((p)[1] & 0x3F) << 6) \
336 | ((p)[2] & 0x3F))) \
337 : string_char ((p), NULL, &actual_len))
340 /* Like STRING_CHAR, but advance P to the end of multibyte form. */
342 #define STRING_CHAR_ADVANCE(p) \
345 : ! ((p)[0] & 0x20) \
347 ((((p)[-2] & 0x1F) << 6) \
349 | ((unsigned char) ((p)[-2]) < 0xC2 ? 0x3FFF80 : 0))) \
350 : ! ((p)[0] & 0x10) \
352 ((((p)[-3] & 0x0F) << 12) \
353 | (((p)[-2] & 0x3F) << 6) \
354 | ((p)[-1] & 0x3F))) \
355 : string_char ((p), &(p), NULL))
358 /* Fetch the "next" character from Lisp string STRING at byte position
359 BYTEIDX, character position CHARIDX. Store it into OUTPUT.
361 All the args must be side-effect-free.
362 BYTEIDX and CHARIDX must be lvalues;
363 we increment them past the character fetched. */
365 #define FETCH_STRING_CHAR_ADVANCE(OUTPUT, STRING, CHARIDX, BYTEIDX) \
369 if (STRING_MULTIBYTE (STRING)) \
371 unsigned char *chp = &SDATA (STRING)[BYTEIDX]; \
374 OUTPUT = STRING_CHAR_AND_LENGTH (chp, chlen); \
379 OUTPUT = SREF (STRING, BYTEIDX); \
385 /* Like FETCH_STRING_CHAR_ADVANCE, but return a multibyte character
386 even if STRING is unibyte. */
388 #define FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE(OUTPUT, STRING, CHARIDX, BYTEIDX) \
392 if (STRING_MULTIBYTE (STRING)) \
394 unsigned char *chp = &SDATA (STRING)[BYTEIDX]; \
397 OUTPUT = STRING_CHAR_AND_LENGTH (chp, chlen); \
402 OUTPUT = SREF (STRING, BYTEIDX); \
404 MAKE_CHAR_MULTIBYTE (OUTPUT); \
410 /* Like FETCH_STRING_CHAR_ADVANCE, but assumes STRING is multibyte. */
412 #define FETCH_STRING_CHAR_ADVANCE_NO_CHECK(OUTPUT, STRING, CHARIDX, BYTEIDX) \
415 unsigned char *fetch_ptr = &SDATA (STRING)[BYTEIDX]; \
418 OUTPUT = STRING_CHAR_AND_LENGTH (fetch_ptr, fetch_len); \
419 BYTEIDX += fetch_len; \
425 /* Like FETCH_STRING_CHAR_ADVANCE, but fetch character from the current
428 #define FETCH_CHAR_ADVANCE(OUTPUT, CHARIDX, BYTEIDX) \
432 if (!NILP (BVAR (current_buffer, enable_multibyte_characters))) \
434 unsigned char *chp = BYTE_POS_ADDR (BYTEIDX); \
437 OUTPUT = STRING_CHAR_AND_LENGTH (chp, chlen); \
442 OUTPUT = *(BYTE_POS_ADDR (BYTEIDX)); \
449 /* Like FETCH_CHAR_ADVANCE, but assumes the current buffer is multibyte. */
451 #define FETCH_CHAR_ADVANCE_NO_CHECK(OUTPUT, CHARIDX, BYTEIDX) \
454 unsigned char *chp = BYTE_POS_ADDR (BYTEIDX); \
457 OUTPUT = STRING_CHAR_AND_LENGTH (chp, chlen); \
464 /* Increment the buffer byte position POS_BYTE of the current buffer to
465 the next character boundary. No range checking of POS. */
467 #define INC_POS(pos_byte) \
469 unsigned char *chp = BYTE_POS_ADDR (pos_byte); \
470 pos_byte += BYTES_BY_CHAR_HEAD (*chp); \
474 /* Decrement the buffer byte position POS_BYTE of the current buffer to
475 the previous character boundary. No range checking of POS. */
477 #define DEC_POS(pos_byte) \
479 unsigned char *chp; \
482 if (pos_byte < GPT_BYTE) \
483 chp = BEG_ADDR + pos_byte - BEG_BYTE; \
485 chp = BEG_ADDR + GAP_SIZE + pos_byte - BEG_BYTE; \
486 while (!CHAR_HEAD_P (*chp)) \
493 /* Increment both CHARPOS and BYTEPOS, each in the appropriate way. */
495 #define INC_BOTH(charpos, bytepos) \
499 if (NILP (BVAR (current_buffer, enable_multibyte_characters))) \
502 INC_POS ((bytepos)); \
507 /* Decrement both CHARPOS and BYTEPOS, each in the appropriate way. */
509 #define DEC_BOTH(charpos, bytepos) \
513 if (NILP (BVAR (current_buffer, enable_multibyte_characters))) \
516 DEC_POS ((bytepos)); \
521 /* Increment the buffer byte position POS_BYTE of the current buffer to
522 the next character boundary. This macro relies on the fact that
523 *GPT_ADDR and *Z_ADDR are always accessible and the values are
524 '\0'. No range checking of POS_BYTE. */
526 #define BUF_INC_POS(buf, pos_byte) \
528 unsigned char *chp = BUF_BYTE_ADDRESS (buf, pos_byte); \
529 pos_byte += BYTES_BY_CHAR_HEAD (*chp); \
533 /* Decrement the buffer byte position POS_BYTE of the current buffer to
534 the previous character boundary. No range checking of POS_BYTE. */
536 #define BUF_DEC_POS(buf, pos_byte) \
538 unsigned char *chp; \
540 if (pos_byte < BUF_GPT_BYTE (buf)) \
541 chp = BUF_BEG_ADDR (buf) + pos_byte - BEG_BYTE; \
543 chp = BUF_BEG_ADDR (buf) + BUF_GAP_SIZE (buf) + pos_byte - BEG_BYTE;\
544 while (!CHAR_HEAD_P (*chp)) \
552 /* If C is a character to be unified with a Unicode character, return
553 the unified Unicode character. */
555 #define MAYBE_UNIFY_CHAR(c) \
557 if (c > MAX_UNICODE_CHAR && c <= MAX_5_BYTE_CHAR) \
560 val = CHAR_TABLE_REF (Vchar_unify_table, c); \
561 if (INTEGERP (val)) \
562 c = XFASTINT (val); \
563 else if (! NILP (val)) \
564 c = maybe_unify_char (c, val); \
569 /* Return a non-outlandish value for the tab width. */
571 #define SANE_TAB_WIDTH(buf) \
572 sanitize_tab_width (XFASTINT (BVAR (buf, tab_width)))
574 sanitize_tab_width (EMACS_INT width
)
576 return 0 < width
&& width
<= 1000 ? width
: 8;
579 /* Return the width of ASCII character C. The width is measured by
580 how many columns C will occupy on the screen when displayed in the
583 #define ASCII_CHAR_WIDTH(c) \
586 ? SANE_TAB_WIDTH (current_buffer) \
587 : (c == '\n' ? 0 : (NILP (BVAR (current_buffer, ctl_arrow)) ? 4 : 2))) \
590 : ((NILP (BVAR (current_buffer, ctl_arrow)) ? 4 : 2))))
592 /* Return a non-outlandish value for a character width. */
595 sanitize_char_width (EMACS_INT width
)
597 return 0 <= width
&& width
<= 1000 ? width
: 1000;
600 /* Return the width of character C. The width is measured by how many
601 columns C will occupy on the screen when displayed in the current
604 #define CHAR_WIDTH(c) \
606 ? ASCII_CHAR_WIDTH (c) \
607 : sanitize_char_width (XINT (CHAR_TABLE_REF (Vchar_width_table, c))))
609 /* If C is a variation selector, return the index of the
610 variation selector (1..256). Otherwise, return 0. */
612 #define CHAR_VARIATION_SELECTOR_P(c) \
614 : (c) <= 0xFE0F ? (c) - 0xFE00 + 1 \
615 : (c) < 0xE0100 ? 0 \
616 : (c) <= 0xE01EF ? (c) - 0xE0100 + 17 \
619 /* If C is a high surrogate, return 1. If C is a low surrogate,
620 return 0. Otherwise, return 0. */
622 #define CHAR_SURROGATE_PAIR_P(c) \
624 : (c) <= 0xDBFF ? 1 \
625 : (c) <= 0xDFFF ? 2 \
628 /* Data type for Unicode general category.
630 The order of members must be in sync with the 8th element of the
631 member of unidata-prop-alist (in admin/unidata/unidata-getn.el) for
632 Unicode character property `general-category'. */
635 UNICODE_CATEGORY_UNKNOWN
= 0,
666 } unicode_category_t
;
668 extern EMACS_INT
char_resolve_modifier_mask (EMACS_INT
);
669 extern int char_string (unsigned, unsigned char *);
670 extern int string_char (const unsigned char *,
671 const unsigned char **, int *);
673 extern int translate_char (Lisp_Object
, int c
);
674 extern int char_printable_p (int c
);
675 extern void parse_str_as_multibyte (const unsigned char *,
676 ptrdiff_t, ptrdiff_t *, ptrdiff_t *);
677 extern ptrdiff_t count_size_as_multibyte (const unsigned char *, ptrdiff_t);
678 extern ptrdiff_t str_as_multibyte (unsigned char *, ptrdiff_t, ptrdiff_t,
680 extern ptrdiff_t str_to_multibyte (unsigned char *, ptrdiff_t, ptrdiff_t);
681 extern ptrdiff_t str_as_unibyte (unsigned char *, ptrdiff_t);
682 extern ptrdiff_t str_to_unibyte (const unsigned char *, unsigned char *,
684 extern ptrdiff_t strwidth (const char *, ptrdiff_t);
685 extern ptrdiff_t c_string_width (const unsigned char *, ptrdiff_t, int,
686 ptrdiff_t *, ptrdiff_t *);
687 extern ptrdiff_t lisp_string_width (Lisp_Object
, ptrdiff_t,
688 ptrdiff_t *, ptrdiff_t *);
690 extern Lisp_Object Qcharacterp
;
691 extern Lisp_Object Vchar_unify_table
;
692 extern Lisp_Object
string_escape_byte8 (Lisp_Object
);
694 /* Return a translation table of id number ID. */
695 #define GET_TRANSLATION_TABLE(id) \
696 (XCDR(XVECTOR(Vtranslation_table_vector)->contents[(id)]))
698 #endif /* EMACS_CHARACTER_H */