From: tomo Date: Sun, 10 Oct 1999 06:03:29 +0000 (+0000) Subject: (char_byte_table): New type. X-Git-Tag: r21-2-19-utf-2000-0_9-0~32 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=bdb0aef1492adb300b688ed4a88cc582a909ecbf;p=chise%2Fxemacs-chise.git (char_byte_table): New type. (XCHAR_BYTE_TABLE): New macro. (XSETCHAR_BYTE_TABLE): New macro. (CHAR_BYTE_TABLE_P): New macro. (GC_CHAR_BYTE_TABLE_P): New macro. (struct Lisp_Char_Byte_Table): New structure. (get_char_code_table): New interface. (Emchar_to_byte_table): Deleted. (get_byte_from_character_table): Deleted. (struct Lisp_Charset): Add `encoding_table'; delete `to_byte1_table' and `to_byte2_table'. (CHARSET_ENCODING_TABLE): New macro. (CHARSET_TO_BYTE1_TABLE): Deleted. (CHARSET_TO_BYTE2_TABLE): Deleted. (XCHARSET_ENCODING_TABLE): New macro. (XCHARSET_TO_BYTE1_TABLE): Deleted. (XCHARSET_TO_BYTE2_TABLE): Deleted. --- diff --git a/src/char-ucs.h b/src/char-ucs.h index 395cf6c..afbda53 100644 --- a/src/char-ucs.h +++ b/src/char-ucs.h @@ -29,15 +29,23 @@ Boston, MA 02111-1307, USA. */ #define CHAR_ASCII_P(ch) ((ch) <= 0x7F) -typedef struct +DECLARE_LRECORD (char_byte_table, struct Lisp_Char_Byte_Table); +#define XCHAR_BYTE_TABLE(x) \ + XRECORD (x, char_byte_table, struct Lisp_Char_Byte_Table) +#define XSETCHAR_BYTE_TABLE(x, p) XSETRECORD (x, p, char_byte_table) +#define CHAR_BYTE_TABLE_P(x) RECORDP (x, char_byte_table) +#define GC_CHAR_BYTE_TABLE_P(x) GC_RECORDP (x, char_byte_table) +/* #define CHECK_CHAR_BYTE_TABLE(x) CHECK_RECORD (x, char_byte_table) + char table entries should never escape to Lisp */ + +struct Lisp_Char_Byte_Table { - unsigned char *base; - size_t offset; - size_t size; -} Emchar_to_byte_table; + struct lcrecord_header header; + + Lisp_Object property[256]; +}; -unsigned char -get_byte_from_character_table (Emchar ch, Emchar_to_byte_table* table); +Lisp_Object get_char_code_table (Emchar ch, Lisp_Object table); extern Lisp_Object Vcharset_ucs_bmp; @@ -221,8 +229,7 @@ struct Lisp_Charset Lisp_Object decoding_table; /* Character->byte mapping table */ - Emchar_to_byte_table* to_byte1_table; - Emchar_to_byte_table* to_byte2_table; + Lisp_Object encoding_table; /* Range of character code */ Emchar ucs_min, ucs_max; @@ -270,8 +277,7 @@ DECLARE_LRECORD (charset, struct Lisp_Charset); #define CHARSET_CHARS(cs) ((cs)->chars) #define CHARSET_REVERSE_DIRECTION_CHARSET(cs) ((cs)->reverse_direction_charset) #define CHARSET_DECODING_TABLE(cs) ((cs)->decoding_table) -#define CHARSET_TO_BYTE1_TABLE(cs) ((cs)->to_byte1_table) -#define CHARSET_TO_BYTE2_TABLE(cs) ((cs)->to_byte2_table) +#define CHARSET_ENCODING_TABLE(cs) ((cs)->encoding_table) #define CHARSET_UCS_MIN(cs) ((cs)->ucs_min) #define CHARSET_UCS_MAX(cs) ((cs)->ucs_max) #define CHARSET_CODE_OFFSET(cs) ((cs)->code_offset) @@ -295,8 +301,7 @@ DECLARE_LRECORD (charset, struct Lisp_Charset); #define XCHARSET_REVERSE_DIRECTION_CHARSET(cs) \ CHARSET_REVERSE_DIRECTION_CHARSET (XCHARSET (cs)) #define XCHARSET_DECODING_TABLE(cs) CHARSET_DECODING_TABLE(XCHARSET(cs)) -#define XCHARSET_TO_BYTE1_TABLE(cs) CHARSET_TO_BYTE1_TABLE(XCHARSET(cs)) -#define XCHARSET_TO_BYTE2_TABLE(cs) CHARSET_TO_BYTE2_TABLE(XCHARSET(cs)) +#define XCHARSET_ENCODING_TABLE(cs) CHARSET_ENCODING_TABLE(XCHARSET(cs)) #define XCHARSET_UCS_MIN(cs) CHARSET_UCS_MIN(XCHARSET(cs)) #define XCHARSET_UCS_MAX(cs) CHARSET_UCS_MAX(XCHARSET(cs)) #define XCHARSET_CODE_OFFSET(cs) CHARSET_CODE_OFFSET(XCHARSET(cs))