From 29b7163fa98cfa8e8c4b0d5027737d92f91346c4 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 25 May 1998 20:28:28 +0000 Subject: [PATCH] (CHAR_TABLE_TRANSLATE): New macro. --- src/lisp.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lisp.h b/src/lisp.h index 17f5ef9fb95..2831f8ed346 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -647,6 +647,19 @@ struct Lisp_Vector : 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) \ -- 2.39.2