diff options
| author | Kenichi Handa | 1997-11-08 03:05:44 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1997-11-08 03:05:44 +0000 |
| commit | a5ee738b6363e2a8f89a7e6e87017f507ab6349f (patch) | |
| tree | bbefea961396eec19755c044403d723e66c46f1f /src/coding.h | |
| parent | 1a283a4c9e720c25cf526a573261a6ab141f1d73 (diff) | |
| download | emacs-a5ee738b6363e2a8f89a7e6e87017f507ab6349f.tar.gz emacs-a5ee738b6363e2a8f89a7e6e87017f507ab6349f.zip | |
(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.
Diffstat (limited to 'src/coding.h')
| -rw-r--r-- | src/coding.h | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/src/coding.h b/src/coding.h index ed641650381..baccd92032e 100644 --- a/src/coding.h +++ b/src/coding.h | |||
| @@ -274,9 +274,9 @@ struct coding_system | |||
| 274 | /* Type of the coding system. */ | 274 | /* Type of the coding system. */ |
| 275 | enum coding_type type; | 275 | enum coding_type type; |
| 276 | 276 | ||
| 277 | /* If the coding system requires specific code to be attached at the | 277 | /* Flag bits of the coding system. The meaning of each bit is common |
| 278 | tail of converted text, this value should be set to `1'. */ | 278 | to any type of coding systems. */ |
| 279 | int require_flushing; | 279 | unsigned int common_flags; |
| 280 | 280 | ||
| 281 | /* Flag bits of the coding system. The meaning of each bit depends | 281 | /* Flag bits of the coding system. The meaning of each bit depends |
| 282 | on the type of the coding system. */ | 282 | on the type of the coding system. */ |
| @@ -340,21 +340,31 @@ struct coding_system | |||
| 340 | int carryover_size; | 340 | int carryover_size; |
| 341 | }; | 341 | }; |
| 342 | 342 | ||
| 343 | /* Return 1 if coding system CODING never requires any code conversion. */ | 343 | #define CODING_REQUIRE_FLUSHING_MASK 1 |
| 344 | #define CODING_REQUIRE_NO_CONVERSION(coding) \ | 344 | #define CODING_REQUIRE_DECODING_MASK 2 |
| 345 | ((coding)->type == coding_type_no_conversion \ | 345 | #define CODING_REQUIRE_ENCODING_MASK 4 |
| 346 | || (((coding)->type == coding_type_emacs_mule \ | 346 | #define CODING_REQUIRE_DETECTION_MASK 8 |
| 347 | || (coding)->type == coding_type_raw_text) \ | 347 | |
| 348 | && (coding)->eol_type == CODING_EOL_LF)) | 348 | /* Return 1 if the coding system CODING requires specific code to be |
| 349 | 349 | attached at the tail of converted text. */ | |
| 350 | /* Return 1 if coding system CODING may not require code conversion. */ | 350 | #define CODING_REQUIRE_FLUSHING(coding) \ |
| 351 | #define CODING_MAY_REQUIRE_NO_CONVERSION(coding) \ | 351 | ((coding)->common_flags & CODING_REQUIRE_FLUSHING_MASK) |
| 352 | ((coding)->type == coding_type_no_conversion \ | 352 | |
| 353 | || (((coding)->type == coding_type_emacs_mule \ | 353 | /* Return 1 if the coding system CODING requires code conversion on |
| 354 | || (coding)->type == coding_type_undecided \ | 354 | decoding. */ |
| 355 | || (coding)->type == coding_type_raw_text) \ | 355 | #define CODING_REQUIRE_DECODING(coding) \ |
| 356 | && ((coding)->eol_type == CODING_EOL_LF \ | 356 | ((coding)->common_flags & CODING_REQUIRE_DECODING_MASK) |
| 357 | || (coding)->eol_type == CODING_EOL_UNDECIDED))) | 357 | |
| 358 | /* Return 1 if the coding system CODING requires code conversion on | ||
| 359 | encoding. */ | ||
| 360 | #define CODING_REQUIRE_ENCODING(coding) \ | ||
| 361 | ((coding)->common_flags & CODING_REQUIRE_ENCODING_MASK) | ||
| 362 | |||
| 363 | /* Return 1 if the coding system CODING requires some kind of code | ||
| 364 | detection. */ | ||
| 365 | #define CODING_REQUIRE_DETECTION(coding) \ | ||
| 366 | ((coding)->common_flags & CODING_REQUIRE_DETECTION_MASK) | ||
| 367 | |||
| 358 | 368 | ||
| 359 | /* Index for each coding category in `coding_category_table' */ | 369 | /* Index for each coding category in `coding_category_table' */ |
| 360 | #define CODING_CATEGORY_IDX_EMACS_MULE 0 | 370 | #define CODING_CATEGORY_IDX_EMACS_MULE 0 |