/* Header for coding system handler.
- Copyright (C) 2002, 2003, 2004, 2005,
- 2006 Free Software Foundation, Inc.
- Copyright (C) 1995, 1997, 1998, 2000
+ Copyright (C) 2001, 2002, 2003, 2004, 2005,
+ 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006, 2007
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
Lisp_Object translation_table_for_encode;
};
-#define CODING_REQUIRE_FLUSHING_MASK 1
-#define CODING_REQUIRE_DECODING_MASK 2
-#define CODING_REQUIRE_ENCODING_MASK 4
-#define CODING_REQUIRE_DETECTION_MASK 8
+/* Mask bits for (struct coding_system *)->common_flags. */
+#define CODING_REQUIRE_FLUSHING_MASK 0x01
+#define CODING_REQUIRE_DECODING_MASK 0x02
+#define CODING_REQUIRE_ENCODING_MASK 0x04
+#define CODING_REQUIRE_DETECTION_MASK 0x08
+#define CODING_ASCII_INCOMPATIBLE_MASK 0x10
/* Return 1 if the coding system CODING requires specific code to be
attached at the tail of converted text. */
|| (coding)->common_flags & CODING_REQUIRE_DECODING_MASK)
/* Return 1 if the coding system CODING requires code conversion on
- encoding. */
+ encoding.
+ The non-multibyte part of the condition is to support encoding of
+ unibyte strings/buffers generated by string-as-unibyte or
+ (set-buffer-multibyte nil) from multibyte strings/buffers. */
#define CODING_REQUIRE_ENCODING(coding) \
((coding)->src_multibyte \
|| (coding)->common_flags & CODING_REQUIRE_ENCODING_MASK)