[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/src character.h
From: |
Kenichi Handa |
Subject: |
[Emacs-diffs] emacs/src character.h |
Date: |
Tue, 30 Dec 2008 23:42:15 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Kenichi Handa <handa> 08/12/30 23:42:15
Modified files:
src : character.h
Log message:
(CHAR_VARIATION_SELECTOR_P): New macro.
(CHAR_SURROGATE_PAIR_P): New macro.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/character.h?cvsroot=emacs&r1=1.13&r2=1.14
Patches:
Index: character.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/character.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- character.h 27 Nov 2008 07:59:35 -0000 1.13
+++ character.h 30 Dec 2008 23:42:15 -0000 1.14
@@ -610,6 +610,26 @@
? ASCII_CHAR_WIDTH (c) \
: XINT (CHAR_TABLE_REF (Vchar_width_table, c)))
+/* If C is a variation selector, return the index numnber of the
+ variation selector (1..256). Otherwise, return 0. */
+
+#define CHAR_VARIATION_SELECTOR_P(c) \
+ ((c) < 0xFE00 ? 0 \
+ : (c) <= 0xFE0F ? (c) - 0xFE00 + 1 \
+ : (c) < 0xE0100 ? 0 \
+ : (c) <= 0xE01EF ? (c) - 0xE0100 + 17 \
+ : 0)
+
+/* If C is a high surrogate, return 1. If C is a low surrogate,
+ return 0. Otherwise, return 0. */
+
+#define CHAR_SURROGATE_PAIR_P(c) \
+ ((c) < 0xD800 ? 0 \
+ : (c) <= 0xDBFF ? 1 \
+ : (c) <= 0xDFFF ? 2 \
+ : 0)
+
+
extern int char_resolve_modifier_mask P_ ((int));
extern int char_string P_ ((unsigned, unsigned char *));
extern int string_char P_ ((const unsigned char *,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs/src character.h,
Kenichi Handa <=