(decode_coding_iso2022): Use `DECODE_ADD_UCS_CHAR'; don't use
authortomo <tomo>
Fri, 10 Sep 1999 11:14:06 +0000 (11:14 +0000)
committertomo <tomo>
Fri, 10 Sep 1999 11:14:06 +0000 (11:14 +0000)
`XCHARSET_REP_BYTES'.

src/file-coding.c

index adfc45f..14b0ade 100644 (file)
@@ -5005,9 +5005,23 @@ decode_coding_iso2022 (Lstream *decoding, CONST unsigned char *src,
                    charset = new_charset;
                }
 
-#ifndef UTF2000
+#ifdef UTF2000
+             if (XCHARSET_DIMENSION (charset) == 1)
+               {
+                 DECODE_OUTPUT_PARTIAL_CHAR (ch);
+                 DECODE_ADD_UCS_CHAR
+                   (MAKE_CHAR (charset, c & 0x7F, 0), dst);
+               }
+             else if (ch)
+               {
+                 DECODE_ADD_UCS_CHAR
+                   (MAKE_CHAR (charset, ch & 0x7F, c & 0x7F), dst);
+                 ch = 0;
+               }
+             else
+               ch = c;
+#else
              lb = XCHARSET_LEADING_BYTE (charset);
-#endif
              switch (XCHARSET_REP_BYTES (charset))
                {
                case 1: /* ASCII */
@@ -5017,44 +5031,25 @@ decode_coding_iso2022 (Lstream *decoding, CONST unsigned char *src,
 
                case 2: /* one-byte official */
                  DECODE_OUTPUT_PARTIAL_CHAR (ch);
-#ifdef UTF2000
-                 DECODE_ADD_UCS_CHAR(MAKE_CHAR(charset, c & 0x7F, 0), dst);
-#else
                  Dynarr_add (dst, lb);
                  Dynarr_add (dst, c | 0x80);
-#endif
                  break;
 
                case 3: /* one-byte private or two-byte official */
-#ifdef UTF2000
-                 if (XCHARSET_DIMENSION (charset) == 1)
-#else
                  if (XCHARSET_PRIVATE_P (charset))
-#endif
                    {
                      DECODE_OUTPUT_PARTIAL_CHAR (ch);
-#ifdef UTF2000
-                     DECODE_ADD_UCS_CHAR(MAKE_CHAR(charset, c & 0x7F, 0),
-                                         dst);
-#else
                      Dynarr_add (dst, PRE_LEADING_BYTE_PRIVATE_1);
                      Dynarr_add (dst, lb);
                      Dynarr_add (dst, c | 0x80);
-#endif
                    }
                  else
                    {
                      if (ch)
                        {
-#ifdef UTF2000
-                         DECODE_ADD_UCS_CHAR(MAKE_CHAR(charset,
-                                                       ch & 0x7F,
-                                                       c & 0x7F), dst);
-#else
                          Dynarr_add (dst, lb);
                          Dynarr_add (dst, ch | 0x80);
                          Dynarr_add (dst, c | 0x80);
-#endif
                          ch = 0;
                        }
                      else
@@ -5065,21 +5060,16 @@ decode_coding_iso2022 (Lstream *decoding, CONST unsigned char *src,
                default:        /* two-byte private */
                  if (ch)
                    {
-#ifdef UTF2000
-                     DECODE_ADD_UCS_CHAR(MAKE_CHAR(charset,
-                                                   ch & 0x7F,
-                                                   c & 0x7F), dst);
-#else
                      Dynarr_add (dst, PRE_LEADING_BYTE_PRIVATE_2);
                      Dynarr_add (dst, lb);
                      Dynarr_add (dst, ch | 0x80);
                      Dynarr_add (dst, c | 0x80);
-#endif
                      ch = 0;
                    }
                  else
                    ch = c;
                }
+#endif
            }
 
          if (!ch)