1 /* Header for 1-byte character representation.
2 Copyright (C) 1999,2000 MORIOKA Tomohiko
4 This file is part of XEmacs.
6 XEmacs is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with XEmacs; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* Rewritten by MORIOKA Tomohiko <tomo@m17n.org>. */
23 #ifndef _XEMACS_CHAR_1BYTE_H
24 #define _XEMACS_CHAR_1BYTE_H
26 #define valid_char_p(ch) ((unsigned int) (ch) <= 0xff)
29 /************************************************************************/
30 /* Definition of leading bytes */
31 /************************************************************************/
33 typedef unsigned char Charset_ID;
35 #define MIN_LEADING_BYTE 0x80
36 #define LEADING_BYTE_ASCII 0x80
37 #define NUM_LEADING_BYTES 1
39 #define Vcharset_ascii Qnil
40 #define Vcharset_control_1 Qnil
41 #define Vcharset_latin_iso8859_1 Qnil
44 /************************************************************************/
45 /* Information about a particular character set */
46 /************************************************************************/
48 #define CHARSETP(cs) 1
49 #define CHARSET_BY_LEADING_BYTE(lb) Vcharset_ascii
50 #define XCHARSET_LEADING_BYTE(cs) LEADING_BYTE_ASCII
51 #define XCHARSET_GRAPHIC(cs) -1
52 #define XCHARSET_COLUMNS(cs) 1
53 #define XCHARSET_DIMENSION(cs) 1
56 /************************************************************************/
57 /* Dealing with characters */
58 /************************************************************************/
60 INLINE_HEADER Emchar DECODE_CHAR (Lisp_Object charset, int code_point);
62 DECODE_CHAR (Lisp_Object charset, int code_point)
67 INLINE_HEADER int encode_char_1 (Emchar ch, Lisp_Object* charset);
69 encode_char_1 (Emchar ch, Lisp_Object* charset)
71 *charset = Vcharset_ascii;
75 #define ENCODE_CHAR(ch, charset) encode_char_1 (ch, &(charset))
77 #define CHAR_CHARSET(ch) Vcharset_ascii
78 #define CHAR_LEADING_BYTE(ch) LEADING_BYTE_ASCII
80 #define BREAKUP_CHAR(ch, charset, byte1, byte2) do { \
81 (charset) = Vcharset_ascii; \
90 unsigned char code_point;
93 INLINE_HEADER Charc CHAR_TO_CHARC (Emchar ch);
95 CHAR_TO_CHARC (Emchar ch)
99 cc.charset = Vcharset_ascii;
105 /************************************************************************/
106 /* Exported functions */
107 /************************************************************************/
109 #endif /* _XEMACS_CHAR_1BYTE_H */