summaryrefslogtreecommitdiff
path: root/src/coding.h
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>1997-08-28 10:51:12 +0000
committerKenichi Handa <handa@m17n.org>1997-08-28 10:51:12 +0000
commite80de6b18fbc4102b28a86d0169c6f06ce12e9da (patch)
tree983dacca9cc7e83cf013b2f268e4272a2d6bc165 /src/coding.h
parent93f4fb59647a66591fd556f93c905f00fb30b63a (diff)
downloademacs-e80de6b18fbc4102b28a86d0169c6f06ce12e9da.tar.gz
(coding_type): New member coding_type_raw_text.
(CODING_EOL_INCONSISTENT): New macro. (CODING_REQUIRE_NO_CONVERSION): Check also coding_type_raw_text. (CODING_MAY_REQUIRE_NO_CONVERSION): Likewise. (CODING_CATEGORY_IDX_RAW_TEXT): New macro. (CODING_CATEGORY_MASK_RAW_TEXT): New macro.
Diffstat (limited to 'src/coding.h')
-rw-r--r--src/coding.h33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/coding.h b/src/coding.h
index 6aa9a45e714..5f851be9b52 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -234,8 +234,12 @@ enum coding_type
coding_type_iso2022, /* Any coding system of ISO2022
variants. */
coding_type_big5, /* BIG5 coding system for Chinese. */
- coding_type_ccl /* The coding system of which decoder
+ coding_type_ccl, /* The coding system of which decoder
and encoder are written in CCL. */
+ coding_type_raw_text /* A coding system for a text
+ containing ramdom 8-bit code which
+ does not require code conversion
+ except for end-of-line format. */
};
/* Formats of end-of-line. */
@@ -246,6 +250,9 @@ enum coding_type
#define CODING_EOL_CR 2 /* Carriage-return only. */
#define CODING_EOL_UNDECIDED 3 /* This value is used to denote the
eol-type is not yet decided. */
+#define CODING_EOL_INCONSISTENT 4 /* This value is used to denote the
+ eol-type is not consistent
+ through the file. */
/* Character composition status while encoding/decoding. */
#define COMPOSING_NO 0 /* not composing */
@@ -330,17 +337,19 @@ struct coding_system
/* Return 1 if coding system CODING never requires any code conversion. */
#define CODING_REQUIRE_NO_CONVERSION(coding) \
- (((coding)->type == coding_type_no_conversion \
- || (coding)->type == coding_type_emacs_mule) \
- && (coding)->eol_type == CODING_EOL_LF)
+ ((coding)->type == coding_type_no_conversion \
+ || (((coding)->type == coding_type_emacs_mule \
+ || (coding)->type == coding_type_raw_text) \
+ && (coding)->eol_type == CODING_EOL_LF))
/* Return 1 if coding system CODING may not require code conversion. */
#define CODING_MAY_REQUIRE_NO_CONVERSION(coding) \
- (((coding)->type == coding_type_no_conversion \
- || (coding)->type == coding_type_emacs_mule \
- || (coding)->type == coding_type_undecided) \
- && ((coding)->eol_type == CODING_EOL_LF \
- || (coding)->eol_type == CODING_EOL_UNDECIDED))
+ ((coding)->type == coding_type_no_conversion \
+ || (((coding)->type == coding_type_emacs_mule \
+ || (coding)->type == coding_type_undecided \
+ || (coding)->type == coding_type_raw_text) \
+ && ((coding)->eol_type == CODING_EOL_LF \
+ || (coding)->eol_type == CODING_EOL_UNDECIDED)))
/* Index for each coding category in `coding_category_table' */
#define CODING_CATEGORY_IDX_EMACS_MULE 0
@@ -351,8 +360,9 @@ struct coding_system
#define CODING_CATEGORY_IDX_ISO_7_ELSE 5
#define CODING_CATEGORY_IDX_ISO_8_ELSE 6
#define CODING_CATEGORY_IDX_BIG5 7
-#define CODING_CATEGORY_IDX_BINARY 8
-#define CODING_CATEGORY_IDX_MAX 9
+#define CODING_CATEGORY_IDX_RAW_TEXT 8
+#define CODING_CATEGORY_IDX_BINARY 9
+#define CODING_CATEGORY_IDX_MAX 10
/* Definitions of flag bits returned by the function
detect_coding_mask (). */
@@ -363,6 +373,7 @@ struct coding_system
#define CODING_CATEGORY_MASK_ISO_8_2 (1 << CODING_CATEGORY_IDX_ISO_8_2)
#define CODING_CATEGORY_MASK_ISO_7_ELSE (1 << CODING_CATEGORY_IDX_ISO_7_ELSE)
#define CODING_CATEGORY_MASK_ISO_8_ELSE (1 << CODING_CATEGORY_IDX_ISO_8_ELSE)
+#define CODING_CATEGORY_MASK_RAW_TEXT (1 << CODING_CATEGORY_IDX_RAW_TEXT)
#define CODING_CATEGORY_MASK_BIG5 (1 << CODING_CATEGORY_IDX_BIG5)
#define CODING_CATEGORY_MASK_BINARY (1 << CODING_CATEGORY_IDX_BINARY)