X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fchar-ucs.h;h=9a5e4cae42bd3f266613141782dc2bb96738bb64;hb=af38928b3ca88709a473780697477466c6ab7c5d;hp=82b1af84cc62913f22b257a9cf2baed2a58928be;hpb=b1291290711ae46668096bf51b16e699617bc297;p=chise%2Fxemacs-chise.git- diff --git a/src/char-ucs.h b/src/char-ucs.h index 82b1af8..9a5e4ca 100644 --- a/src/char-ucs.h +++ b/src/char-ucs.h @@ -21,84 +21,12 @@ Boston, MA 02111-1307, USA. */ #ifndef INCLUDED_char_ucs_h_ #define INCLUDED_char_ucs_h_ +#include "chartab.h" + #define valid_char_p(ch) 1 #define CHAR_ASCII_P(ch) ((ch) <= 0x7F) - -struct Lisp_Uint8_Byte_Table -{ - struct lcrecord_header header; - - unsigned char property[256]; -}; -typedef struct Lisp_Uint8_Byte_Table Lisp_Uint8_Byte_Table; - -DECLARE_LRECORD (uint8_byte_table, Lisp_Uint8_Byte_Table); -#define XUINT8_BYTE_TABLE(x) \ - XRECORD (x, uint8_byte_table, Lisp_Uint8_Byte_Table) -#define XSETUINT8_BYTE_TABLE(x, p) XSETRECORD (x, p, uint8_byte_table) -#define UINT8_BYTE_TABLE_P(x) RECORDP (x, uint8_byte_table) -#define GC_UINT8_BYTE_TABLE_P(x) GC_RECORDP (x, uint8_byte_table) -/* #define CHECK_UINT8_BYTE_TABLE(x) CHECK_RECORD (x, uint8_byte_table) - char table entries should never escape to Lisp */ - - -struct Lisp_Uint16_Byte_Table -{ - struct lcrecord_header header; - - unsigned short property[256]; -}; -typedef struct Lisp_Uint16_Byte_Table Lisp_Uint16_Byte_Table; - -DECLARE_LRECORD (uint16_byte_table, Lisp_Uint16_Byte_Table); -#define XUINT16_BYTE_TABLE(x) \ - XRECORD (x, uint16_byte_table, Lisp_Uint16_Byte_Table) -#define XSETUINT16_BYTE_TABLE(x, p) XSETRECORD (x, p, uint16_byte_table) -#define UINT16_BYTE_TABLE_P(x) RECORDP (x, uint16_byte_table) -#define GC_UINT16_BYTE_TABLE_P(x) GC_RECORDP (x, uint16_byte_table) -/* #define CHECK_UINT16_BYTE_TABLE(x) CHECK_RECORD (x, uint16_byte_table) - char table entries should never escape to Lisp */ - - -struct Lisp_Byte_Table -{ - struct lcrecord_header header; - - Lisp_Object property[256]; -}; -typedef struct Lisp_Byte_Table Lisp_Byte_Table; - -DECLARE_LRECORD (byte_table, Lisp_Byte_Table); -#define XBYTE_TABLE(x) XRECORD (x, byte_table, Lisp_Byte_Table) -#define XSETBYTE_TABLE(x, p) XSETRECORD (x, p, byte_table) -#define BYTE_TABLE_P(x) RECORDP (x, byte_table) -#define GC_BYTE_TABLE_P(x) GC_RECORDP (x, byte_table) -/* #define CHECK_BYTE_TABLE(x) CHECK_RECORD (x, byte_table) - char table entries should never escape to Lisp */ - - -struct Lisp_Char_ID_Table -{ - struct lcrecord_header header; - - Lisp_Object table; -}; -typedef struct Lisp_Char_ID_Table Lisp_Char_ID_Table; - -DECLARE_LRECORD (char_id_table, Lisp_Char_ID_Table); -#define XCHAR_ID_TABLE(x) XRECORD (x, char_id_table, Lisp_Char_ID_Table) -#define XSETCHAR_ID_TABLE(x, p) XSETRECORD (x, p, char_id_table) -#define CHAR_ID_TABLE_P(x) RECORDP (x, char_id_table) -#define GC_CHAR_ID_TABLE_P(x) GC_RECORDP (x, char_id_table) -/* #define CHECK_CHAR_ID_TABLE(x) CHECK_RECORD (x, char_id_table) - char table entries should never escape to Lisp */ - - -Lisp_Object get_char_id_table (Emchar ch, Lisp_Object table); - - extern Lisp_Object Vcharset_mojikyo; extern Lisp_Object Vcharset_mojikyo_2022_1; extern Lisp_Object Vcharset_latin_jisx0201; @@ -110,7 +38,7 @@ extern Lisp_Object Vcharset_latin_jisx0201; typedef short Charset_ID; -#define MIN_LEADING_BYTE -0x70 +#define MIN_LEADING_BYTE -0x100 #define CHARSET_ID_OFFSET 0x00 /* ISO/IEC 10646 */ @@ -201,8 +129,10 @@ typedef short Charset_ID; #define LEADING_BYTE_MOJIKYO_PJ_20 (CHARSET_ID_OFFSET - 70) #define LEADING_BYTE_MOJIKYO_PJ_21 (CHARSET_ID_OFFSET - 71) +#define LEADING_BYTE_JEF_CHINA3 (CHARSET_ID_OFFSET - 72) + #define MIN_LEADING_BYTE_PRIVATE MIN_LEADING_BYTE -#define MAX_LEADING_BYTE_PRIVATE (CHARSET_ID_OFFSET - 72) +#define MAX_LEADING_BYTE_PRIVATE (CHARSET_ID_OFFSET - 73) /* #define CHARSET_ID_OFFSET_94 (CHARSET_ID_OFFSET - '0') */ @@ -517,6 +447,8 @@ CHARSET_BY_ATTRIBUTES (int chars, int dimension, int final, int dir) #define MAX_CHAR_MOJIKYO (MIN_CHAR_MOJIKYO + 94 * 60 * 22) #define MIN_CHAR_GT 0x61000000 #define MAX_CHAR_GT (MIN_CHAR_GT + 66773) +#define MIN_CHAR_JEF_CHINA3 0x62000000 +#define MAX_CHAR_JEF_CHINA3 (MIN_CHAR_JEF_CHINA3 + 65535) Emchar decode_builtin_char (Lisp_Object charset, int code_point); @@ -618,7 +550,7 @@ DECODE_CHAR (Lisp_Object charset, int code_point) { int plane = LEADING_BYTE_MOJIKYO_PJ_1 - XCHARSET_ID (charset); - if ( (0 <= plane) && (plane <= 21) ) + if ( (0 <= plane) && (plane < 21) ) { int m = DECODE_MOJIKYO_2022 (plane + 33, code_point >> 8, @@ -658,8 +590,9 @@ charset_code_point (Lisp_Object charset, Emchar ch) Lisp_Object encoding_table = XCHARSET_ENCODING_TABLE (charset); Lisp_Object ret; - if ( CHAR_ID_TABLE_P (encoding_table) - && INTP (ret = get_char_id_table (ch, encoding_table)) ) + if ( CHAR_TABLEP (encoding_table) + && INTP (ret = get_char_id_table (XCHAR_TABLE(encoding_table), + ch)) ) return XINT (ret); else return range_charset_code_point (charset, ch); @@ -682,8 +615,10 @@ encode_char_1 (Emchar ch, Lisp_Object* charset) Lisp_Object encoding_table = XCHARSET_ENCODING_TABLE (*charset); Lisp_Object ret; - if ( CHAR_ID_TABLE_P (encoding_table) - && INTP (ret = get_char_id_table (ch, encoding_table)) ) + if ( CHAR_TABLEP (encoding_table) + && INTP (ret + = get_char_id_table (XCHAR_TABLE(encoding_table), + ch)) ) return XINT (ret); else { @@ -785,8 +720,14 @@ CHAR_TO_CHARC (Emchar ch) EXFUN (Fget_charset, 1); +extern Lisp_Object Qucs; + extern Lisp_Object Vcharset_japanese_jisx0208; extern Lisp_Object Vcharset_japanese_jisx0208_1990; extern Lisp_Object Vcharset_japanese_jisx0212; +Lisp_Object put_char_ccs_code_point (Lisp_Object character, + Lisp_Object ccs, Lisp_Object value); +Lisp_Object remove_char_ccs (Lisp_Object character, Lisp_Object ccs); + #endif /* INCLUDED_char_ucs_h_ */