comparison src/coding.h @ 17835:f36ffb6f1208

Name change through the code: coding-category-internal => coding-category-emacs-mule, XXX_coding_internal => XXX_coding_emacs_mule, coding_type_internal => coding_type_emacs_mule, coding_type_automatic => coding_type_undecided, CODING_CATEGORY_MASK_INTERNAL => CODING_CATEGORY_MASK_EMACS_MULE, CODING_CATEGORY_IDX_INTERNAL => CODING_CATEGORY_IDX_EMACS_MULE, CODING_EOL_AUTOMATIC => CODING_EOL_UNDECIDED.
author Kenichi Handa <handa@m17n.org>
date Fri, 16 May 1997 00:43:29 +0000
parents 545c2f09f14d
children e7f0ba5c198c
comparison
equal deleted inserted replaced
17834:e154b943bbba 17835:f36ffb6f1208
25 25
26 #ifndef _CCL_H 26 #ifndef _CCL_H
27 #include "../src/ccl.h" 27 #include "../src/ccl.h"
28 #endif 28 #endif
29 29
30 /*** EMACS' INTERNAL FORMAT section ***/ 30 /*** EMACS' INTERNAL FORMAT (emacs-mule) section ***/
31 31
32 /* All code (1-byte) of Emacs' internal format is classified into one 32 /* All code (1-byte) of Emacs' internal format is classified into one
33 of the followings. See also `charset.h'. */ 33 of the followings. See also `charset.h'. */
34 enum emacs_code_class_type 34 enum emacs_code_class_type
35 { 35 {
197 enum coding_type 197 enum coding_type
198 { 198 {
199 coding_type_no_conversion, /* A coding system which requires no 199 coding_type_no_conversion, /* A coding system which requires no
200 conversion for reading and writing 200 conversion for reading and writing
201 including end-of-line format. */ 201 including end-of-line format. */
202 coding_type_internal, /* A coding system used in Emacs' 202 coding_type_emacs_mule, /* A coding system used in Emacs'
203 buffer and string. Requires no 203 buffer and string. Requires no
204 conversion for reading and writing 204 conversion for reading and writing
205 except for end-of-line format. */ 205 except for end-of-line format. */
206 coding_type_automatic, /* A coding system which requires 206 coding_type_undecided, /* A coding system which requires
207 automatic detection of a real 207 automatic detection of a real
208 coding system. */ 208 coding system. */
209 coding_type_sjis, /* SJIS coding system for Japanese. */ 209 coding_type_sjis, /* SJIS coding system for Japanese. */
210 coding_type_iso2022, /* Any coding system of ISO2022 210 coding_type_iso2022, /* Any coding system of ISO2022
211 variants. */ 211 variants. */
218 #define CODING_EOL_LF 0 /* Line-feed only, same as Emacs' 218 #define CODING_EOL_LF 0 /* Line-feed only, same as Emacs'
219 internal format. */ 219 internal format. */
220 #define CODING_EOL_CRLF 1 /* Sequence of carriage-return and 220 #define CODING_EOL_CRLF 1 /* Sequence of carriage-return and
221 line-feed. */ 221 line-feed. */
222 #define CODING_EOL_CR 2 /* Carriage-return only. */ 222 #define CODING_EOL_CR 2 /* Carriage-return only. */
223 #define CODING_EOL_AUTOMATIC 3 /* This value is used to denote the 223 #define CODING_EOL_UNDECIDED 3 /* This value is used to denote the
224 eol-type is not yet decided. */ 224 eol-type is not yet decided. */
225 225
226 /* Character composition status while encoding/decoding. */ 226 /* Character composition status while encoding/decoding. */
227 #define COMPOSING_NO 0 /* not composing */ 227 #define COMPOSING_NO 0 /* not composing */
228 #define COMPOSING_WITH_RULE_HEAD 1 /* 1st char of with-rule composing follow */ 228 #define COMPOSING_WITH_RULE_HEAD 1 /* 1st char of with-rule composing follow */
305 305
306 /* Return 1 if the coding-system CODING requires conversion of 306 /* Return 1 if the coding-system CODING requires conversion of
307 representation of a visible character (text). */ 307 representation of a visible character (text). */
308 #define CODING_REQUIRE_TEXT_CONVERSION(coding) \ 308 #define CODING_REQUIRE_TEXT_CONVERSION(coding) \
309 ((coding)->type != coding_type_no_conversion \ 309 ((coding)->type != coding_type_no_conversion \
310 && (coding)->type != coding_type_internal) 310 && (coding)->type != coding_type_emacs_mule)
311 311
312 /* Return 1 if the coding-system CODING requires conversion of the 312 /* Return 1 if the coding-system CODING requires conversion of the
313 format of end-of-line. */ 313 format of end-of-line. */
314 #define CODING_REQUIRE_EOL_CONVERSION(coding) \ 314 #define CODING_REQUIRE_EOL_CONVERSION(coding) \
315 ((coding)->eol_type != CODING_EOL_AUTOMATIC \ 315 ((coding)->eol_type != CODING_EOL_UNDECIDED \
316 && (coding)->eol_type != CODING_EOL_LF) 316 && (coding)->eol_type != CODING_EOL_LF)
317 317
318 /* Return 1 if the coding-system CODING requires some conversion. */ 318 /* Return 1 if the coding-system CODING requires some conversion. */
319 #define CODING_REQUIRE_CONVERSION(coding) \ 319 #define CODING_REQUIRE_CONVERSION(coding) \
320 (CODING_REQUIRE_TEXT_CONVERSION (coding) \ 320 (CODING_REQUIRE_TEXT_CONVERSION (coding) \
321 || CODING_REQUIRE_EOL_CONVERSION (coding)) 321 || CODING_REQUIRE_EOL_CONVERSION (coding))
322 322
323 /* Index for each coding category in `coding_category_table' */ 323 /* Index for each coding category in `coding_category_table' */
324 #define CODING_CATEGORY_IDX_INTERNAL 0 324 #define CODING_CATEGORY_IDX_EMACS_MULE 0
325 #define CODING_CATEGORY_IDX_SJIS 1 325 #define CODING_CATEGORY_IDX_SJIS 1
326 #define CODING_CATEGORY_IDX_ISO_7 2 326 #define CODING_CATEGORY_IDX_ISO_7 2
327 #define CODING_CATEGORY_IDX_ISO_8_1 3 327 #define CODING_CATEGORY_IDX_ISO_8_1 3
328 #define CODING_CATEGORY_IDX_ISO_8_2 4 328 #define CODING_CATEGORY_IDX_ISO_8_2 4
329 #define CODING_CATEGORY_IDX_ISO_ELSE 5 329 #define CODING_CATEGORY_IDX_ISO_ELSE 5
331 #define CODING_CATEGORY_IDX_BINARY 7 331 #define CODING_CATEGORY_IDX_BINARY 7
332 #define CODING_CATEGORY_IDX_MAX 8 332 #define CODING_CATEGORY_IDX_MAX 8
333 333
334 /* Definitions of flag bits returned by the function 334 /* Definitions of flag bits returned by the function
335 detect_coding_mask (). */ 335 detect_coding_mask (). */
336 #define CODING_CATEGORY_MASK_INTERNAL (1 << CODING_CATEGORY_IDX_INTERNAL) 336 #define CODING_CATEGORY_MASK_EMACS_MULE (1 << CODING_CATEGORY_IDX_EMACS_MULE)
337 #define CODING_CATEGORY_MASK_SJIS (1 << CODING_CATEGORY_IDX_SJIS) 337 #define CODING_CATEGORY_MASK_SJIS (1 << CODING_CATEGORY_IDX_SJIS)
338 #define CODING_CATEGORY_MASK_ISO_7 (1 << CODING_CATEGORY_IDX_ISO_7) 338 #define CODING_CATEGORY_MASK_ISO_7 (1 << CODING_CATEGORY_IDX_ISO_7)
339 #define CODING_CATEGORY_MASK_ISO_8_1 (1 << CODING_CATEGORY_IDX_ISO_8_1) 339 #define CODING_CATEGORY_MASK_ISO_8_1 (1 << CODING_CATEGORY_IDX_ISO_8_1)
340 #define CODING_CATEGORY_MASK_ISO_8_2 (1 << CODING_CATEGORY_IDX_ISO_8_2) 340 #define CODING_CATEGORY_MASK_ISO_8_2 (1 << CODING_CATEGORY_IDX_ISO_8_2)
341 #define CODING_CATEGORY_MASK_ISO_ELSE (1 << CODING_CATEGORY_IDX_ISO_ELSE) 341 #define CODING_CATEGORY_MASK_ISO_ELSE (1 << CODING_CATEGORY_IDX_ISO_ELSE)
342 #define CODING_CATEGORY_MASK_BIG5 (1 << CODING_CATEGORY_IDX_BIG5) 342 #define CODING_CATEGORY_MASK_BIG5 (1 << CODING_CATEGORY_IDX_BIG5)
343 343
344 /* This value is returned if detect_coding_mask () find nothing other 344 /* This value is returned if detect_coding_mask () find nothing other
345 than ASCII characters. */ 345 than ASCII characters. */
346 #define CODING_CATEGORY_MASK_ANY \ 346 #define CODING_CATEGORY_MASK_ANY \
347 ( CODING_CATEGORY_MASK_INTERNAL \ 347 ( CODING_CATEGORY_MASK_EMACS_MULE \
348 | CODING_CATEGORY_MASK_SJIS \ 348 | CODING_CATEGORY_MASK_SJIS \
349 | CODING_CATEGORY_MASK_ISO_7 \ 349 | CODING_CATEGORY_MASK_ISO_7 \
350 | CODING_CATEGORY_MASK_ISO_8_1 \ 350 | CODING_CATEGORY_MASK_ISO_8_1 \
351 | CODING_CATEGORY_MASK_ISO_8_2 \ 351 | CODING_CATEGORY_MASK_ISO_8_2 \
352 | CODING_CATEGORY_MASK_ISO_ELSE \ 352 | CODING_CATEGORY_MASK_ISO_ELSE \