*** empty log message ***
[bpt/emacs.git] / src / charset.h
index 6db0165..a8e162d 100644 (file)
@@ -1,8 +1,8 @@
 /* Header for charset handler.
    Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN.
-   Licensed to the Free Software Foundation.
+     Licensed to the Free Software Foundation.
    Copyright (C) 2001 Free Software Foundation, Inc.
-   Copyright (C) 2001, 2002
+   Copyright (C) 2003
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H13PRO009
 
@@ -110,8 +110,8 @@ enum charset_attr_index
     charset_unify_map,
 
     /* If characters in the charset must be unified Unicode, the value
-       is a char table that maps a character code in the charset to
-       the corresponding Unicode character.  */
+       is a char table that maps a unified Unicode character code to
+       the non-unified character code in the charset.  */
     charset_deunifier,
 
     /* The length of the charset attribute vector.  */
@@ -245,7 +245,6 @@ extern Lisp_Object Vcharset_hash_table;
 
 /* Table of struct charset.  */
 extern struct charset *charset_table;
-extern int charset_table_used;
 
 #define CHARSET_FROM_ID(id) (charset_table + (id))
 
@@ -413,6 +412,15 @@ extern Lisp_Object Vchar_charset_set;
    : decode_char ((charset), (code)))
 
 
+/* If CHARSET is a simple offset base charset, return it's offset,
+   otherwise return -1.  */
+#define CHARSET_OFFSET(charset)                                \
+  (((charset)->method == CHARSET_METHOD_OFFSET         \
+    && (charset)->code_linear_p                                \
+    && ! (charset)->unified_p)                         \
+   ? (charset)->code_offset - (charset)->min_code      \
+   : -1)
+
 extern Lisp_Object charset_work;
 
 /* Return a code point of CHAR in CHARSET.
@@ -485,7 +493,9 @@ extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL];
 /* 1 iff CHARSET may contain the character C.  */
 #define CHAR_CHARSET_P(c, charset)                                      \
   ((ASCII_CHAR_P (c) && (charset)->ascii_compatible_p)                  \
-   || (CHARSET_UNIFIED_P (charset)                                      \
+   || ((CHARSET_UNIFIED_P (charset)                                     \
+       || (charset)->method == CHARSET_METHOD_SUBSET                    \
+       || (charset)->method == CHARSET_METHOD_SUPERSET)                 \
        ? encode_char ((charset), (c)) != (charset)->invalid_code        \
        : (CHARSET_FAST_MAP_REF ((c), (charset)->fast_map)               \
          && ((charset)->method == CHARSET_METHOD_OFFSET                 \
@@ -513,6 +523,7 @@ extern Lisp_Object Qcharsetp;
 extern Lisp_Object Qascii, Qunicode;
 extern int charset_ascii, charset_eight_bit;
 extern int charset_iso_8859_1;
+extern int charset_unicode;
 extern int charset_jisx0201_roman;
 extern int charset_jisx0208_1978;
 extern int charset_jisx0208;