Mercurial > hg > xemacs-beta
comparison src/mule-charset.h @ 404:2f8bb876ab1d r21-2-32
Import from CVS: tag r21-2-32
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:16:07 +0200 |
parents | 74fd4e045ea6 |
children | b8cc9ab3f761 |
comparison
equal
deleted
inserted
replaced
403:9f011ab08d48 | 404:2f8bb876ab1d |
---|---|
399 | 399 |
400 #define LEADING_BYTE_PRIVATE_P(lb) ((lb) >= MIN_LEADING_BYTE_PRIVATE_1) | 400 #define LEADING_BYTE_PRIVATE_P(lb) ((lb) >= MIN_LEADING_BYTE_PRIVATE_1) |
401 | 401 |
402 /* Is this a prefix for a private leading byte? */ | 402 /* Is this a prefix for a private leading byte? */ |
403 | 403 |
404 INLINE int LEADING_BYTE_PREFIX_P (unsigned char lb); | 404 INLINE_HEADER int LEADING_BYTE_PREFIX_P (unsigned char lb); |
405 INLINE int | 405 INLINE_HEADER int |
406 LEADING_BYTE_PREFIX_P (unsigned char lb) | 406 LEADING_BYTE_PREFIX_P (unsigned char lb) |
407 { | 407 { |
408 return (lb == PRE_LEADING_BYTE_PRIVATE_1 || | 408 return (lb == PRE_LEADING_BYTE_PRIVATE_1 || |
409 lb == PRE_LEADING_BYTE_PRIVATE_2); | 409 lb == PRE_LEADING_BYTE_PRIVATE_2); |
410 } | 410 } |
563 | 563 |
564 #ifdef ERROR_CHECK_TYPECHECK | 564 #ifdef ERROR_CHECK_TYPECHECK |
565 /* int not Bufbyte even though that is the actual type of a leading byte. | 565 /* int not Bufbyte even though that is the actual type of a leading byte. |
566 This way, out-ot-range values will get caught rather than automatically | 566 This way, out-ot-range values will get caught rather than automatically |
567 truncated. */ | 567 truncated. */ |
568 INLINE Lisp_Object CHARSET_BY_LEADING_BYTE (int lb); | 568 INLINE_HEADER Lisp_Object CHARSET_BY_LEADING_BYTE (int lb); |
569 INLINE Lisp_Object | 569 INLINE_HEADER Lisp_Object |
570 CHARSET_BY_LEADING_BYTE (int lb) | 570 CHARSET_BY_LEADING_BYTE (int lb) |
571 { | 571 { |
572 assert (lb >= 0x80 && lb <= 0xFF); | 572 assert (lb >= 0x80 && lb <= 0xFF); |
573 return chlook->charset_by_leading_byte[lb - 128]; | 573 return chlook->charset_by_leading_byte[lb - 128]; |
574 } | 574 } |
590 XCHARSET_REP_BYTES (CHARSET_BY_LEADING_BYTE (first_byte)) | 590 XCHARSET_REP_BYTES (CHARSET_BY_LEADING_BYTE (first_byte)) |
591 but it's faster this way. */ | 591 but it's faster this way. */ |
592 extern const Bytecount rep_bytes_by_first_byte[0xA0]; | 592 extern const Bytecount rep_bytes_by_first_byte[0xA0]; |
593 | 593 |
594 /* Number of bytes in the string representation of a character. */ | 594 /* Number of bytes in the string representation of a character. */ |
595 INLINE int REP_BYTES_BY_FIRST_BYTE (int fb); | 595 INLINE_HEADER int REP_BYTES_BY_FIRST_BYTE (int fb); |
596 INLINE int | 596 INLINE_HEADER int |
597 REP_BYTES_BY_FIRST_BYTE (int fb) | 597 REP_BYTES_BY_FIRST_BYTE (int fb) |
598 { | 598 { |
599 #ifdef ERROR_CHECK_TYPECHECK | 599 #ifdef ERROR_CHECK_TYPECHECK |
600 assert (0 <= fb && fb < 0xA0); | 600 assert (0 <= fb && fb < 0xA0); |
601 #endif | 601 #endif |
673 NOTE: This takes advantage of the fact that | 673 NOTE: This takes advantage of the fact that |
674 FIELD2_TO_OFFICIAL_LEADING_BYTE and | 674 FIELD2_TO_OFFICIAL_LEADING_BYTE and |
675 FIELD2_TO_PRIVATE_LEADING_BYTE are the same. | 675 FIELD2_TO_PRIVATE_LEADING_BYTE are the same. |
676 */ | 676 */ |
677 | 677 |
678 INLINE Bufbyte CHAR_LEADING_BYTE (Emchar c); | 678 INLINE_HEADER Bufbyte CHAR_LEADING_BYTE (Emchar c); |
679 INLINE Bufbyte | 679 INLINE_HEADER Bufbyte |
680 CHAR_LEADING_BYTE (Emchar c) | 680 CHAR_LEADING_BYTE (Emchar c) |
681 { | 681 { |
682 if (CHAR_ASCII_P (c)) | 682 if (CHAR_ASCII_P (c)) |
683 return LEADING_BYTE_ASCII; | 683 return LEADING_BYTE_ASCII; |
684 else if (c < 0xA0) | 684 else if (c < 0xA0) |
708 NOTE: This takes advantage of the fact that | 708 NOTE: This takes advantage of the fact that |
709 FIELD2_TO_OFFICIAL_LEADING_BYTE and | 709 FIELD2_TO_OFFICIAL_LEADING_BYTE and |
710 FIELD2_TO_PRIVATE_LEADING_BYTE are the same. | 710 FIELD2_TO_PRIVATE_LEADING_BYTE are the same. |
711 */ | 711 */ |
712 | 712 |
713 INLINE Emchar MAKE_CHAR (Lisp_Object charset, int c1, int c2); | 713 INLINE_HEADER Emchar MAKE_CHAR (Lisp_Object charset, int c1, int c2); |
714 INLINE Emchar | 714 INLINE_HEADER Emchar |
715 MAKE_CHAR (Lisp_Object charset, int c1, int c2) | 715 MAKE_CHAR (Lisp_Object charset, int c1, int c2) |
716 { | 716 { |
717 if (EQ (charset, Vcharset_ascii)) | 717 if (EQ (charset, Vcharset_ascii)) |
718 return c1; | 718 return c1; |
719 else if (EQ (charset, Vcharset_control_1)) | 719 else if (EQ (charset, Vcharset_control_1)) |
746 XCHARSET_DIMENSION (charset) == 1 \ | 746 XCHARSET_DIMENSION (charset) == 1 \ |
747 ? ((c1) = CHAR_FIELD3 (c), (c2) = 0) \ | 747 ? ((c1) = CHAR_FIELD3 (c), (c2) = 0) \ |
748 : ((c1) = CHAR_FIELD2 (c), \ | 748 : ((c1) = CHAR_FIELD2 (c), \ |
749 (c2) = CHAR_FIELD3 (c)) | 749 (c2) = CHAR_FIELD3 (c)) |
750 | 750 |
751 INLINE void breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2); | 751 INLINE_HEADER void breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2); |
752 INLINE void | 752 INLINE_HEADER void |
753 breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2) | 753 breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2) |
754 { | 754 { |
755 *charset = CHAR_CHARSET (c); | 755 *charset = CHAR_CHARSET (c); |
756 BREAKUP_CHAR_1_UNSAFE (c, *charset, *c1, *c2); | 756 BREAKUP_CHAR_1_UNSAFE (c, *charset, *c1, *c2); |
757 } | 757 } |