comparison src/file-coding.h @ 337:fbbf69b4e8a7 r21-0-66

Import from CVS: tag r21-0-66
author cvs
date Mon, 13 Aug 2007 10:51:02 +0200
parents 70ad99077275
children a4f53d9b3154
comparison
equal deleted inserted replaced
336:fe0a93612022 337:fbbf69b4e8a7
303 If both CODING_STATE_SS2 and 303 If both CODING_STATE_SS2 and
304 CODING_STATE_SS3 are set, 304 CODING_STATE_SS3 are set,
305 CODING_STATE_SS2 overrides; but 305 CODING_STATE_SS2 overrides; but
306 this probably indicates an error 306 this probably indicates an error
307 in the text encoding. */ 307 in the text encoding. */
308 #ifdef ENABLE_COMPOSITE_CHARS
308 #define CODING_STATE_COMPOSITE (1 << 8) /* If set, we're currently processing 309 #define CODING_STATE_COMPOSITE (1 << 8) /* If set, we're currently processing
309 a composite character (i.e. a 310 a composite character (i.e. a
310 character constructed by 311 character constructed by
311 overstriking two or more 312 overstriking two or more
312 characters). */ 313 characters). */
314 #endif /* ENABLE_COMPOSITE_CHARS */
313 315
314 316
315 /* CODING_STATE_ISO2022_LOCK is the mask of flags that remain on until 317 /* CODING_STATE_ISO2022_LOCK is the mask of flags that remain on until
316 explicitly turned off when in the ISO2022 encoder/decoder. Other flags are 318 explicitly turned off when in the ISO2022 encoder/decoder. Other flags are
317 turned off at the end of processing each character or escape sequence. */ 319 turned off at the end of processing each character or escape sequence. */
320 #ifdef ENABLE_COMPOSITE_CHARS
318 # define CODING_STATE_ISO2022_LOCK \ 321 # define CODING_STATE_ISO2022_LOCK \
319 (CODING_STATE_END | CODING_STATE_COMPOSITE | CODING_STATE_R2L) 322 (CODING_STATE_END | CODING_STATE_COMPOSITE | CODING_STATE_R2L)
320 #define CODING_STATE_BIG5_LOCK \ 323 #else
321 CODING_STATE_END 324 # define CODING_STATE_ISO2022_LOCK (CODING_STATE_END | CODING_STATE_R2L)
325 #endif
326
327 #define CODING_STATE_BIG5_LOCK CODING_STATE_END
322 328
323 /* Flags indicating what we've seen so far when parsing an 329 /* Flags indicating what we've seen so far when parsing an
324 ISO2022 escape sequence. */ 330 ISO2022 escape sequence. */
325 enum iso_esc_flag 331 enum iso_esc_flag
326 { 332 {
367 character must be ]. */ 373 character must be ]. */
368 ISO_ESC_5_11_2, /* We've seen 0x9B 2. The next 374 ISO_ESC_5_11_2, /* We've seen 0x9B 2. The next
369 character must be ]. */ 375 character must be ]. */
370 376
371 /* Full sequences. */ 377 /* Full sequences. */
378 #ifdef ENABLE_COMPOSITE_CHARS
372 ISO_ESC_START_COMPOSITE, /* Private usage for START COMPOSING */ 379 ISO_ESC_START_COMPOSITE, /* Private usage for START COMPOSING */
373 ISO_ESC_END_COMPOSITE, /* Private usage for END COMPOSING */ 380 ISO_ESC_END_COMPOSITE, /* Private usage for END COMPOSING */
381 #endif /* ENABLE_COMPOSITE_CHARS */
374 ISO_ESC_SINGLE_SHIFT, /* We've seen a complete single-shift sequence. */ 382 ISO_ESC_SINGLE_SHIFT, /* We've seen a complete single-shift sequence. */
375 ISO_ESC_LOCKING_SHIFT,/* We've seen a complete locking-shift sequence. */ 383 ISO_ESC_LOCKING_SHIFT,/* We've seen a complete locking-shift sequence. */
376 ISO_ESC_DESIGNATE, /* We've seen a complete designation sequence. */ 384 ISO_ESC_DESIGNATE, /* We've seen a complete designation sequence. */
377 ISO_ESC_DIRECTIONALITY,/* We've seen a complete ISO6429 directionality 385 ISO_ESC_DIRECTIONALITY,/* We've seen a complete ISO6429 directionality
378 sequence. */ 386 sequence. */
503 511
504 512
505 #ifndef MULE 513 #ifndef MULE
506 #define MIN_LEADING_BYTE 0x80 514 #define MIN_LEADING_BYTE 0x80
507 /* These need special treatment in a string and/or character */ 515 /* These need special treatment in a string and/or character */
516 #ifdef ENABLE_COMPOSITE_CHARS
508 #define LEADING_BYTE_COMPOSITE 0x80 /* for a composite character */ 517 #define LEADING_BYTE_COMPOSITE 0x80 /* for a composite character */
518 #endif
509 #define LEADING_BYTE_CONTROL_1 0x8F /* represent normal 80-9F */ 519 #define LEADING_BYTE_CONTROL_1 0x8F /* represent normal 80-9F */
510 #define LEADING_BYTE_LATIN_ISO8859_1 0x81 /* Right half of ISO 8859-1 */ 520 #define LEADING_BYTE_LATIN_ISO8859_1 0x81 /* Right half of ISO 8859-1 */
511 #define BYTE_C1_P(c) ((unsigned int) ((unsigned int) (c) - 0x80) < 0x20) 521 #define BYTE_C1_P(c) ((unsigned int) ((unsigned int) (c) - 0x80) < 0x20)
512 #define BUFBYTE_FIRST_BYTE_P(c) ((c) < 0xA0) 522 #define BUFBYTE_FIRST_BYTE_P(c) ((c) < 0xA0)
513 #define BUFBYTE_LEADING_BYTE_P(c) BYTE_C1_P (c) 523 #define BUFBYTE_LEADING_BYTE_P(c) BYTE_C1_P (c)