Commit a5ee738b authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(struct coding_system): Add member common_flags, delete

member require_flushing.
(CODING_REQUIRE_FLUSHING_MASK, CODING_REQUIRE_DECODING_MASK,
CODING_REQUIRE_ENCODING_MASK, CODING_REQUIRE_DETECTION_MASK): New
macros.
(CODING_REQUIRE_NO_CONVERSION, CODING_MAY_REQUIRE_NO_CONVERSION):
These macros deleted.
(CODING_REQUIRE_FLUSHING, CODING_REQUIRE_DECODING,
CODING_REQUIRE_ENCODING, CODING_REQUIRE_DETECTION): New macros.
parent 1a283a4c
...@@ -274,9 +274,9 @@ struct coding_system ...@@ -274,9 +274,9 @@ struct coding_system
/* Type of the coding system. */ /* Type of the coding system. */
enum coding_type type; enum coding_type type;
/* If the coding system requires specific code to be attached at the /* Flag bits of the coding system. The meaning of each bit is common
tail of converted text, this value should be set to `1'. */ to any type of coding systems. */
int require_flushing; unsigned int common_flags;
/* Flag bits of the coding system. The meaning of each bit depends /* Flag bits of the coding system. The meaning of each bit depends
on the type of the coding system. */ on the type of the coding system. */
...@@ -340,21 +340,31 @@ struct coding_system ...@@ -340,21 +340,31 @@ struct coding_system
int carryover_size; int carryover_size;
}; };
/* Return 1 if coding system CODING never requires any code conversion. */ #define CODING_REQUIRE_FLUSHING_MASK 1
#define CODING_REQUIRE_NO_CONVERSION(coding) \ #define CODING_REQUIRE_DECODING_MASK 2
((coding)->type == coding_type_no_conversion \ #define CODING_REQUIRE_ENCODING_MASK 4
|| (((coding)->type == coding_type_emacs_mule \ #define CODING_REQUIRE_DETECTION_MASK 8
|| (coding)->type == coding_type_raw_text) \
&& (coding)->eol_type == CODING_EOL_LF)) /* Return 1 if the coding system CODING requires specific code to be
attached at the tail of converted text. */
/* Return 1 if coding system CODING may not require code conversion. */ #define CODING_REQUIRE_FLUSHING(coding) \
#define CODING_MAY_REQUIRE_NO_CONVERSION(coding) \ ((coding)->common_flags & CODING_REQUIRE_FLUSHING_MASK)
((coding)->type == coding_type_no_conversion \
|| (((coding)->type == coding_type_emacs_mule \ /* Return 1 if the coding system CODING requires code conversion on
|| (coding)->type == coding_type_undecided \ decoding. */
|| (coding)->type == coding_type_raw_text) \ #define CODING_REQUIRE_DECODING(coding) \
&& ((coding)->eol_type == CODING_EOL_LF \ ((coding)->common_flags & CODING_REQUIRE_DECODING_MASK)
|| (coding)->eol_type == CODING_EOL_UNDECIDED)))
/* Return 1 if the coding system CODING requires code conversion on
encoding. */
#define CODING_REQUIRE_ENCODING(coding) \
((coding)->common_flags & CODING_REQUIRE_ENCODING_MASK)
/* Return 1 if the coding system CODING requires some kind of code
detection. */
#define CODING_REQUIRE_DETECTION(coding) \
((coding)->common_flags & CODING_REQUIRE_DETECTION_MASK)
/* Index for each coding category in `coding_category_table' */ /* Index for each coding category in `coding_category_table' */
#define CODING_CATEGORY_IDX_EMACS_MULE 0 #define CODING_CATEGORY_IDX_EMACS_MULE 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment