comparison src/character.h @ 88873:7d441bc35e9b

(TRAILING_CODE_P): New macro. (MAYBE_UNIFY_CHAR): Adjusted for the change of Funify_charset. (string_char_with_unification): Fix prototype. (Vscript_alist): Extern it.
author Kenichi Handa <handa@m17n.org>
date Mon, 22 Jul 2002 06:30:30 +0000
parents 1918306a80b1
children 94184802d0cc
comparison
equal deleted inserted replaced
88872:6d6ec38a31ac 88873:7d441bc35e9b
154 } while (0) 154 } while (0)
155 155
156 /* Nonzero iff BYTE starts a non-ASCII character in a multibyte 156 /* Nonzero iff BYTE starts a non-ASCII character in a multibyte
157 form. */ 157 form. */
158 #define LEADING_CODE_P(byte) (((byte) & 0xC0) == 0xC0) 158 #define LEADING_CODE_P(byte) (((byte) & 0xC0) == 0xC0)
159
160 /* Nonzero iff BYTE is a trailing code of a non-ASCII character in a
161 multibyte form. */
162 #define TRAILING_CODE_P(byte) (((byte) & 0xC0) == 0x80)
159 163
160 /* Nonzero iff BYTE starts a character in a multibyte form. 164 /* Nonzero iff BYTE starts a character in a multibyte form.
161 This is equivalent to: 165 This is equivalent to:
162 (ASCII_BYTE_P (byte) || LEADING_CODE_P (byte)) */ 166 (ASCII_BYTE_P (byte) || LEADING_CODE_P (byte)) */
163 #define CHAR_HEAD_P(byte) (((byte) & 0xC0) != 0x80) 167 #define CHAR_HEAD_P(byte) (((byte) & 0xC0) != 0x80)
457 val = CHAR_TABLE_REF (Vchar_unify_table, c); \ 461 val = CHAR_TABLE_REF (Vchar_unify_table, c); \
458 if (! NILP (val)) \ 462 if (! NILP (val)) \
459 { \ 463 { \
460 if (SYMBOLP (val)) \ 464 if (SYMBOLP (val)) \
461 { \ 465 { \
462 Funify_charset (val, Qnil); \ 466 Funify_charset (val, Qnil, Qnil); \
463 val = CHAR_TABLE_REF (Vchar_unify_table, c); \ 467 val = CHAR_TABLE_REF (Vchar_unify_table, c); \
464 } \ 468 } \
465 if ((unified = XINT (val)) >= 0) \ 469 if ((unified = XINT (val)) >= 0) \
466 c = unified; \ 470 c = unified; \
467 } \ 471 } \
490 (ASCII_CHAR_P (c) \ 494 (ASCII_CHAR_P (c) \
491 ? ASCII_CHAR_WIDTH (c) \ 495 ? ASCII_CHAR_WIDTH (c) \
492 : XINT (CHAR_TABLE_REF (Vchar_width_table, c))) 496 : XINT (CHAR_TABLE_REF (Vchar_width_table, c)))
493 497
494 extern int char_string_with_unification P_ ((int, unsigned char *)); 498 extern int char_string_with_unification P_ ((int, unsigned char *));
495 extern int string_char_with_unification P_ ((unsigned char *, 499 extern int string_char_with_unification P_ ((const unsigned char *,
496 unsigned char **, int *)); 500 const unsigned char **, int *));
497 501
498 extern int translate_char P_ ((Lisp_Object, int c)); 502 extern int translate_char P_ ((Lisp_Object, int c));
499 extern int char_printable_p P_ ((int c)); 503 extern int char_printable_p P_ ((int c));
500 extern void parse_str_as_multibyte P_ ((unsigned char *, int, int *, int *)); 504 extern void parse_str_as_multibyte P_ ((unsigned char *, int, int *, int *));
501 extern int parse_str_to_multibyte P_ ((unsigned char *, int)); 505 extern int parse_str_to_multibyte P_ ((unsigned char *, int));
521 (XCDR(XVECTOR(Vtranslation_table_vector)->contents[(id)])) 525 (XCDR(XVECTOR(Vtranslation_table_vector)->contents[(id)]))
522 526
523 /* A char-table for characters which may invoke auto-filling. */ 527 /* A char-table for characters which may invoke auto-filling. */
524 extern Lisp_Object Vauto_fill_chars; 528 extern Lisp_Object Vauto_fill_chars;
525 529
530 extern Lisp_Object Vscript_alist;
531
526 /* Copy LEN bytes from FROM to TO. This macro should be used only 532 /* Copy LEN bytes from FROM to TO. This macro should be used only
527 when a caller knows that LEN is short and the obvious copy loop is 533 when a caller knows that LEN is short and the obvious copy loop is
528 faster than calling bcopy which has some overhead. Copying a 534 faster than calling bcopy which has some overhead. Copying a
529 multibyte sequence of a character is the typical case. */ 535 multibyte sequence of a character is the typical case. */
530 536