X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fchar-1byte.h;h=d31c89c3b825d339b1387330b7fe1417969fac2e;hb=98f1518a09e923a4f8b14b6a637cc283f02719bd;hp=98aefa5c42cec353aecd6f183ea5408ae0c2f9fe;hpb=0508e898c39759a4426f55f2f3aefc7e14c6d3e7;p=chise%2Fxemacs-chise.git- diff --git a/src/char-1byte.h b/src/char-1byte.h index 98aefa5..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. @@ -31,12 +30,16 @@ Boston, MA 02111-1307, USA. */ /* Definition of leading bytes */ /************************************************************************/ -typedef int Charset_ID; +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 */ @@ -54,6 +57,23 @@ typedef int Charset_ID; /* 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 @@ -63,11 +83,27 @@ typedef int Charset_ID; (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 */ /************************************************************************/ -#define Vcharset_ascii Qnil - #endif /* _XEMACS_CHAR_1BYTE_H */