Mercurial > emacs
comparison src/coding.h @ 20226:549826cf2952
(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.
| author | Kenichi Handa <handa@m17n.org> |
|---|---|
| date | Sat, 08 Nov 1997 03:05:44 +0000 |
| parents | b804a783ceec |
| children | 8d520e3dcb86 |
comparison
equal
deleted
inserted
replaced
| 20225:ca258a32a122 | 20226:549826cf2952 |
|---|---|
| 272 struct coding_system | 272 struct coding_system |
| 273 { | 273 { |
| 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. */ |
| 283 unsigned int flags; | 283 unsigned int flags; |
| 284 | 284 |
| 338 | 338 |
| 339 /* Actual data length in the above array. */ | 339 /* Actual data length in the above array. */ |
| 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 |
| 361 #define CODING_CATEGORY_IDX_SJIS 1 | 371 #define CODING_CATEGORY_IDX_SJIS 1 |
| 362 #define CODING_CATEGORY_IDX_ISO_7 2 | 372 #define CODING_CATEGORY_IDX_ISO_7 2 |
