/* 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
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. */
/* Table of struct charset. */
extern struct charset *charset_table;
-extern int charset_table_used;
#define CHARSET_FROM_ID(id) (charset_table + (id))
: 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.
/* 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 \
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;