/* Header for charset handler.
Copyright (C) 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008 Free Software Foundation, Inc.
+ 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008
+ 2005, 2006, 2007, 2008, 2009, 2010
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
/* Property list of the charset. */
charset_plist,
- /* If the method of the charset is `MAP_DEFERRED', the value is a
- mapping vector or a file name that contains mapping vector.
- Otherwise, nil. */
+ /* If the method of the charset is `MAP', the value is a mapping
+ vector or a file name that contains mapping vector. Otherwise,
+ nil. */
charset_map,
/* If the method of the charset is `MAP', the value is a vector
(CHARSET-ID . OFFSET)
- CHARSET-IDs are ID numbers of parent charsets. OFFSET is an
- integer value to add to a code point of the parent charset to
- get the corresponding code point of this charset. */
+ CHARSET-IDs are ID numbers of parent charsets. OFFSET is an
+ integer value to add to a code point of the parent charset to
+ get the corresponding code point of this charset. */
charset_superset,
/* The value is a mapping vector or a file name that contains the
conversion. */
CHARSET_METHOD_MAP,
- /* Same as above but decoder and encoder are loaded from a file on
- demand. Once loaded, the method is changed to
- CHARSET_METHOD_MAP. */
- CHARSET_METHOD_MAP_DEFERRED,
-
/* A charset of this method is a subset of another charset. */
CHARSET_METHOD_SUBSET,
} while (0)
-/* Lookup Vcharset_order_list and return the first charset that
+/* Lookup Vcharset_ordered_list and return the first charset that
contains the character C. */
#define CHAR_CHARSET(c) \
((c) < 0x80 ? CHARSET_FROM_ID (charset_ascii) \
? (code) - (charset)->min_code + (charset)->code_offset \
: decode_char ((charset), (code))) \
: (charset)->method == CHARSET_METHOD_MAP \
- ? ((charset)->code_linear_p \
+ ? (((charset)->code_linear_p \
+ && VECTORP (CHARSET_DECODER (charset))) \
? XINT (AREF (CHARSET_DECODER (charset), \
- (code) - (charset)->min_code)) \
+ (code) - (charset)->min_code)) \
: decode_char ((charset), (code))) \
: decode_char ((charset), (code)))
? (c) - (charset)->code_offset + (charset)->min_code \
: encode_char ((charset), (c))) \
: (charset)->method == CHARSET_METHOD_MAP \
- ? ((charset)->compact_codes_p \
+ ? (((charset)->compact_codes_p \
+ && CHAR_TABLE_P (CHARSET_ENCODER (charset))) \
? (charset_work = CHAR_TABLE_REF (CHARSET_ENCODER (charset), (c)), \
(NILP (charset_work) \
? (charset)->invalid_code \
&& ((charset)->method == CHARSET_METHOD_OFFSET \
? (c) >= (charset)->min_char && (c) <= (charset)->max_char \
: ((charset)->method == CHARSET_METHOD_MAP \
- && (charset)->compact_codes_p) \
+ && (charset)->compact_codes_p \
+ && CHAR_TABLE_P (CHARSET_ENCODER (charset))) \
? ! NILP (CHAR_TABLE_REF (CHARSET_ENCODER (charset), (c))) \
: encode_char ((charset), (c)) != (charset)->invalid_code))))
extern int charset_jisx0201_roman;
extern int charset_jisx0208_1978;
extern int charset_jisx0208;
+extern int charset_ksc5601;
extern int charset_unibyte;
extern struct charset *char_charset P_ ((int, Lisp_Object, unsigned *));
extern Lisp_Object charset_attributes P_ ((int));
+extern int maybe_unify_char P_ ((int, Lisp_Object));
extern int decode_char P_ ((struct charset *, unsigned));
extern unsigned encode_char P_ ((struct charset *, int));
extern int string_xstring_p P_ ((Lisp_Object));