X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fchar-1byte.h;h=d31c89c3b825d339b1387330b7fe1417969fac2e;hb=c8ef7e5f09e40bc537785e77b6163622a1d66d6d;hp=7a3724273d221e382b716b4a221e27e37f6f546f;hpb=fc9aa002e3cfea376b53836fccc1f0232fd83807;p=chise%2Fxemacs-chise.git- diff --git a/src/char-1byte.h b/src/char-1byte.h index 7a37242..d31c89c 100644 --- a/src/char-1byte.h +++ b/src/char-1byte.h @@ -1,6 +1,5 @@ -/* Header for UCS-4 character representation. - Copyright (C) 1999 Electrotechnical Laboratory, JAPAN. - Licensed to the Free Software Foundation. +/* Header for 1-byte character representation. + Copyright (C) 1999,2000 MORIOKA Tomohiko This file is part of XEmacs. @@ -26,4 +25,85 @@ Boston, MA 02111-1307, USA. */ #define valid_char_p(ch) ((unsigned int) (ch) <= 0xff) + +/************************************************************************/ +/* Definition of leading bytes */ +/************************************************************************/ + +typedef unsigned char Charset_ID; + +#define MIN_LEADING_BYTE 0x80 +#define LEADING_BYTE_ASCII 0x80 +#define NUM_LEADING_BYTES 1 + +#define Vcharset_ascii Qnil +#define Vcharset_control_1 Qnil +#define Vcharset_latin_iso8859_1 Qnil + + +/************************************************************************/ +/* Information about a particular character set */ +/************************************************************************/ + +#define CHARSETP(cs) 1 +#define CHARSET_BY_LEADING_BYTE(lb) Vcharset_ascii +#define XCHARSET_LEADING_BYTE(cs) LEADING_BYTE_ASCII +#define XCHARSET_GRAPHIC(cs) -1 +#define XCHARSET_COLUMNS(cs) 1 +#define XCHARSET_DIMENSION(cs) 1 + + +/************************************************************************/ +/* Dealing with characters */ +/************************************************************************/ + +INLINE_HEADER Emchar DECODE_CHAR (Lisp_Object charset, int code_point); +INLINE_HEADER Emchar +DECODE_CHAR (Lisp_Object charset, int code_point) +{ + return code_point; +} + +INLINE_HEADER int encode_char_1 (Emchar ch, Lisp_Object* charset); +INLINE_HEADER int +encode_char_1 (Emchar ch, Lisp_Object* charset) +{ + *charset = Vcharset_ascii; + return ch; +} + +#define ENCODE_CHAR(ch, charset) encode_char_1 (ch, &(charset)) + +#define CHAR_CHARSET(ch) Vcharset_ascii +#define CHAR_LEADING_BYTE(ch) LEADING_BYTE_ASCII + +#define BREAKUP_CHAR(ch, charset, byte1, byte2) do { \ + (charset) = Vcharset_ascii; \ + (byte1) = (ch); \ + (byte2) = 0; \ +} while (0) + + +typedef struct Charc +{ + Lisp_Object charset; + unsigned char code_point; +} Charc; + +INLINE_HEADER Charc CHAR_TO_CHARC (Emchar ch); +INLINE_HEADER Charc +CHAR_TO_CHARC (Emchar ch) +{ + Charc cc; + + cc.charset = Vcharset_ascii; + cc.code_point = ch; + return cc; +} + + +/************************************************************************/ +/* Exported functions */ +/************************************************************************/ + #endif /* _XEMACS_CHAR_1BYTE_H */