diff options
| author | Kenichi Handa | 2000-05-19 23:56:15 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2000-05-19 23:56:15 +0000 |
| commit | 811ea086322950df8ce1ef58d3bd9298c3fc5df6 (patch) | |
| tree | 0ff8b10c5d7c7b3544aa3ae9caa4b6e0e295c483 /src/coding.h | |
| parent | b73bfc1c35bb780ed78f88d9fdbc144cfc949fee (diff) | |
| download | emacs-811ea086322950df8ce1ef58d3bd9298c3fc5df6.tar.gz emacs-811ea086322950df8ce1ef58d3bd9298c3fc5df6.zip | |
(enum iso_code_class_type): Member ISO_control_code is
devided into ISO_control_0 and ISO_control_1.
(struct coding_system): New members src_multibyte, dst_multibyte,
errors, and result. Delete member fake_multibyte.
(CODING_REQUIRE_DECODING): Return 1 if coding->dst_multibyte is
nonzero.
(CODING_REQUIRE_ENCODING): Return 1 if coding->src_multibyte is
nonzero.
Diffstat (limited to 'src/coding.h')
| -rw-r--r-- | src/coding.h | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/coding.h b/src/coding.h index 12c14da4d02..b12802e5dcc 100644 --- a/src/coding.h +++ b/src/coding.h | |||
| @@ -72,15 +72,17 @@ extern enum emacs_code_class_type emacs_code_class[256]; | |||
| 72 | followings. */ | 72 | followings. */ |
| 73 | enum iso_code_class_type | 73 | enum iso_code_class_type |
| 74 | { | 74 | { |
| 75 | ISO_control_code, /* Control codes in the range | 75 | ISO_control_0, /* Control codes in the range |
| 76 | 0x00..0x1F, 0x7F, and 0x80..0x9F, | 76 | 0x00..0x1F and 0x7F, except for the |
| 77 | except for the following seven | 77 | following 5 codes. */ |
| 78 | codes. */ | ||
| 79 | ISO_carriage_return, /* ISO_CODE_CR (0x0D) */ | 78 | ISO_carriage_return, /* ISO_CODE_CR (0x0D) */ |
| 80 | ISO_shift_out, /* ISO_CODE_SO (0x0E) */ | 79 | ISO_shift_out, /* ISO_CODE_SO (0x0E) */ |
| 81 | ISO_shift_in, /* ISO_CODE_SI (0x0F) */ | 80 | ISO_shift_in, /* ISO_CODE_SI (0x0F) */ |
| 82 | ISO_single_shift_2_7, /* ISO_CODE_SS2_7 (0x19) */ | 81 | ISO_single_shift_2_7, /* ISO_CODE_SS2_7 (0x19) */ |
| 83 | ISO_escape, /* ISO_CODE_SO (0x1B) */ | 82 | ISO_escape, /* ISO_CODE_SO (0x1B) */ |
| 83 | ISO_control_1, /* Control codes in the range | ||
| 84 | 0x80..0x9F, except for the | ||
| 85 | following 3 codes. */ | ||
| 84 | ISO_single_shift_2, /* ISO_CODE_SS2 (0x8E) */ | 86 | ISO_single_shift_2, /* ISO_CODE_SS2 (0x8E) */ |
| 85 | ISO_single_shift_3, /* ISO_CODE_SS3 (0x8F) */ | 87 | ISO_single_shift_3, /* ISO_CODE_SS3 (0x8F) */ |
| 86 | ISO_control_sequence_introducer, /* ISO_CODE_CSI (0x9B) */ | 88 | ISO_control_sequence_introducer, /* ISO_CODE_CSI (0x9B) */ |
| @@ -395,6 +397,9 @@ struct coding_system | |||
| 395 | /* Index number of coding category of the coding system. */ | 397 | /* Index number of coding category of the coding system. */ |
| 396 | int category_idx; | 398 | int category_idx; |
| 397 | 399 | ||
| 400 | unsigned src_multibyte : 1; | ||
| 401 | unsigned dst_multibyte : 1; | ||
| 402 | |||
| 398 | /* How may heading bytes we can skip for decoding. This is set to | 403 | /* How may heading bytes we can skip for decoding. This is set to |
| 399 | -1 in setup_coding_system, and updated by detect_coding. So, | 404 | -1 in setup_coding_system, and updated by detect_coding. So, |
| 400 | when this is equal to the byte length of the text being | 405 | when this is equal to the byte length of the text being |
| @@ -404,11 +409,12 @@ struct coding_system | |||
| 404 | /* The following members are set by encoding/decoding routine. */ | 409 | /* The following members are set by encoding/decoding routine. */ |
| 405 | int produced, produced_char, consumed, consumed_char; | 410 | int produced, produced_char, consumed, consumed_char; |
| 406 | 411 | ||
| 407 | /* Encoding routines set this to 1 when they produce a byte sequence | 412 | /* Number of error source data found in a decoding routine. */ |
| 408 | which can be parsed as a multibyte character. Decoding routines | 413 | int errors; |
| 409 | set this to 1 when they encounter an invalid code and, as the | 414 | |
| 410 | result, produce an unexpected multibyte character. */ | 415 | /* Finish status of code conversion. It should be one of macros |
| 411 | int fake_multibyte; | 416 | CODING_FINISH_XXXX. */ |
| 417 | int result; | ||
| 412 | 418 | ||
| 413 | /* The following members are all Lisp symbols. We don't have to | 419 | /* The following members are all Lisp symbols. We don't have to |
| 414 | protect them from GC because the current garbage collection | 420 | protect them from GC because the current garbage collection |
| @@ -444,21 +450,25 @@ struct coding_system | |||
| 444 | /* Return 1 if the coding system CODING requires code conversion on | 450 | /* Return 1 if the coding system CODING requires code conversion on |
| 445 | decoding. */ | 451 | decoding. */ |
| 446 | #define CODING_REQUIRE_DECODING(coding) \ | 452 | #define CODING_REQUIRE_DECODING(coding) \ |
| 447 | ((coding)->common_flags & CODING_REQUIRE_DECODING_MASK) | 453 | ((coding)->dst_multibyte \ |
| 454 | || (coding)->common_flags & CODING_REQUIRE_DECODING_MASK) | ||
| 448 | 455 | ||
| 449 | /* Return 1 if the coding system CODING requires code conversion on | 456 | /* Return 1 if the coding system CODING requires code conversion on |
| 450 | encoding. */ | 457 | encoding. */ |
| 451 | #define CODING_REQUIRE_ENCODING(coding) \ | 458 | #define CODING_REQUIRE_ENCODING(coding) \ |
| 452 | ((coding)->common_flags & CODING_REQUIRE_ENCODING_MASK) | 459 | ((coding)->src_multibyte \ |
| 460 | || (coding)->common_flags & CODING_REQUIRE_ENCODING_MASK) | ||
| 453 | 461 | ||
| 454 | /* Return 1 if the coding system CODING requires some kind of code | 462 | /* Return 1 if the coding system CODING requires some kind of code |
| 455 | detection. */ | 463 | detection. */ |
| 456 | #define CODING_REQUIRE_DETECTION(coding) \ | 464 | #define CODING_REQUIRE_DETECTION(coding) \ |
| 457 | ((coding)->common_flags & CODING_REQUIRE_DETECTION_MASK) | 465 | ((coding)->common_flags & CODING_REQUIRE_DETECTION_MASK) |
| 458 | 466 | ||
| 467 | /* Return 1 if the coding system CODING requires code conversion on | ||
| 468 | decoding or some kind of code detection. */ | ||
| 459 | #define CODING_MAY_REQUIRE_DECODING(coding) \ | 469 | #define CODING_MAY_REQUIRE_DECODING(coding) \ |
| 460 | ((coding)->common_flags \ | 470 | (CODING_REQUIRE_DECODING (coding) \ |
| 461 | & (CODING_REQUIRE_DETECTION_MASK | CODING_REQUIRE_DECODING_MASK)) | 471 | || CODING_REQUIRE_DETECTION (coding)) |
| 462 | 472 | ||
| 463 | /* Index for each coding category in `coding_category_table' */ | 473 | /* Index for each coding category in `coding_category_table' */ |
| 464 | #define CODING_CATEGORY_IDX_EMACS_MULE 0 | 474 | #define CODING_CATEGORY_IDX_EMACS_MULE 0 |