changeset 22239:0a666cecb85d

(CHAR_TABLE_TRANSLATE): New macro.
author Richard M. Stallman <rms@gnu.org>
date Mon, 25 May 1998 20:28:28 +0000
parents fd2b7dede9cd
children 4e4c377f3310
files src/lisp.h
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lisp.h	Mon May 25 20:15:45 1998 +0000
+++ b/src/lisp.h	Mon May 25 20:28:28 1998 +0000
@@ -647,6 +647,19 @@
       : XCHAR_TABLE (CT)->defalt)			\
    : Faref (CT, make_number (IDX)))
 
+/* Almost equivalent to Faref (CT, IDX) with optimization for ASCII
+   and 8-bit Europeans characters.  However, if the result is nil,
+   return IDX.
+
+   For these characters, do not check validity of CT
+   and do not follow parent.  */
+#define CHAR_TABLE_TRANSLATE(CT, IDX)			\
+  ((IDX) < CHAR_TABLE_SINGLE_BYTE_SLOTS			\
+   ? (!NILP (XCHAR_TABLE (CT)->contents[IDX])		\
+      ? XINT (XCHAR_TABLE (CT)->contents[IDX])		\
+      : IDX)						\
+   : char_table_translate (CT, IDX))
+
 /* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and
    8-bit Europeans characters.  Do not check validity of CT.  */
 #define CHAR_TABLE_SET(CT, IDX, VAL)			\