(U-0002195D): Add `ideographic-structure'; add `sound@ja/on'; add
[chise/xemacs-chise.git.1] / src / char-1byte.h
1 /* Header for 1-byte character representation.
2    Copyright (C) 1999,2000 MORIOKA Tomohiko
3
4 This file is part of XEmacs.
5
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
9 later version.
10
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
14 for more details.
15
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.  */
20
21 /* Rewritten by MORIOKA Tomohiko <tomo@m17n.org>. */
22
23 #ifndef _XEMACS_CHAR_1BYTE_H
24 #define _XEMACS_CHAR_1BYTE_H
25
26 #define valid_char_p(ch) ((unsigned int) (ch) <= 0xff)
27
28 \f
29 /************************************************************************/
30 /*                    Definition of leading bytes                       */
31 /************************************************************************/
32
33 typedef unsigned char Charset_ID;
34
35 #define MIN_LEADING_BYTE 0x80
36 #define LEADING_BYTE_ASCII 0x80
37 #define NUM_LEADING_BYTES 1
38
39 #define Vcharset_ascii Qnil
40 #define Vcharset_control_1 Qnil
41 #define Vcharset_latin_iso8859_1 Qnil
42
43 \f
44 /************************************************************************/
45 /*            Information about a particular character set              */
46 /************************************************************************/
47
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
54
55 \f
56 /************************************************************************/
57 /*                        Dealing with characters                       */
58 /************************************************************************/
59
60 INLINE_HEADER Emchar DECODE_CHAR (Lisp_Object charset, int code_point);
61 INLINE_HEADER Emchar
62 DECODE_CHAR (Lisp_Object charset, int code_point)
63 {
64   return code_point;
65 }
66
67 INLINE_HEADER int encode_char_1 (Emchar ch, Lisp_Object* charset);
68 INLINE_HEADER int
69 encode_char_1 (Emchar ch, Lisp_Object* charset)
70 {
71   *charset = Vcharset_ascii;
72   return  ch;
73 }
74
75 #define ENCODE_CHAR(ch, charset)        encode_char_1 (ch, &(charset))
76
77 #define CHAR_CHARSET(ch) Vcharset_ascii
78 #define CHAR_LEADING_BYTE(ch) LEADING_BYTE_ASCII
79
80 #define BREAKUP_CHAR(ch, charset, byte1, byte2) do {    \
81   (charset) = Vcharset_ascii;                           \
82   (byte1) = (ch);                                       \
83   (byte2) = 0;                                          \
84 } while (0)
85
86
87 typedef struct Charc
88 {
89   Lisp_Object charset;
90   unsigned char code_point;
91 } Charc;
92
93 INLINE_HEADER Charc CHAR_TO_CHARC (Emchar ch);
94 INLINE_HEADER Charc
95 CHAR_TO_CHARC (Emchar ch)
96 {
97   Charc cc;
98
99   cc.charset = Vcharset_ascii;
100   cc.code_point = ch;
101   return cc;
102 }
103
104 \f
105 /************************************************************************/
106 /*                            Exported functions                        */
107 /************************************************************************/
108
109 #endif /* _XEMACS_CHAR_1BYTE_H */