OSDN Git Service

remove iso-2022-jp support
authorSHIRAKATA Kentaro <argrath@ub32.org>
Tue, 19 Sep 2017 17:12:33 +0000 (02:12 +0900)
committerSHIRAKATA Kentaro <argrath@ub32.org>
Sun, 21 Jan 2018 18:42:21 +0000 (03:42 +0900)
ChangeLog.j
include/extern.h
japanese/jlib.c
sys/winnt/nttty.c

index c3af0f6..88c8b93 100644 (file)
@@ -1,3 +1,5 @@
+       * ISO-2022-JP\91Î\89\9e\82ð\8dí\8f\9c
+
 Fri Feb 17 2017  Kentaro Shirakata  <argrath@ub32.org>
 
        * \89æ\96Ê\8fã\82Ì\89ö\95¨\82ð/\83R\83}\83\93\83h\82Å\8c©\82½\8dÛ\82É\95\8e\9a\89»\82¯\82·\82é\96â\91è\82ð\8fC\90³ (#36909)
index 2e63b4d..cd776db 100644 (file)
@@ -2787,8 +2787,8 @@ E const char *FDECL(str2ic, (const char *));
 #ifdef SJIS_FILESYSTEM
 E const char *FDECL(ic2str, (const char *));
 #endif
-E int FDECL(jbuffer, (unsigned int, unsigned int *, void (*)(), void (*)(unsigned int), void (*)(unsigned int, unsigned int)));
-E int FDECL(cbuffer, (unsigned int, unsigned int *, void (*)(), void (*)(unsigned int), void (*)(unsigned int, unsigned int)));
+E int FDECL(jbuffer, (unsigned int, unsigned int *, void (*)(unsigned int), void (*)(unsigned int, unsigned int)));
+E int FDECL(cbuffer, (unsigned int, unsigned int *, void (*)(unsigned int), void (*)(unsigned int, unsigned int)));
 E void FDECL(cputchar,(int));
 E void FDECL(jputchar,(int));
 E void FDECL(jputs,(const char *));
index 67a308a..c385469 100644 (file)
@@ -17,7 +17,6 @@ int xputc2(int, int);
 
 #define EUC    0
 #define SJIS   1
-#define JIS    2
 
 /* internal kcode */
 /* IC=0 EUC */
@@ -73,8 +72,6 @@ setkcode(c)
 {
     if(c == 'E' || c == 'e' )
       output_kcode = EUC;
-    else if(c == 'J' || c == 'j')
-      output_kcode = JIS;
     else if(c == 'S' || c == 's')
       output_kcode = SJIS;
     else if(c == 'I' || c == 'i')
@@ -141,7 +138,6 @@ str2ic(s)
     static unsigned char buf[1024];
     const unsigned char *up;
     unsigned char *p, *pp;
-    int kin;
 
     if(!s)
       return s;
@@ -167,23 +163,6 @@ str2ic(s)
              *(p++) = (unsigned char)*(s++);
        }
     }
-    else if( IC==EUC && input_kcode == JIS ){
-       kin = 0;
-       while(*s){
-           if(s[0] == 033 && s[1] == '$' && (s[2] == 'B' || s[3] == '@')){
-               kin = 1;
-               s += 3;
-           }
-           else if(s[0] == 033 && s[1] == '(' && (s[2] == 'B' || s[3] == 'J')){
-               kin = 0;
-               s += 3;
-           }
-           else if( kin )
-             *(p++) = (*(s++) | 0x80);
-           else
-             *(p++) = *(s++);
-       }
-    }
     else{
        strcpy((char *)buf, s);
        return (char *)buf;
@@ -204,7 +183,6 @@ ic2str(s)
     static unsigned char buf[1024];
     const unsigned char *up;
     unsigned char *p, *pp;
-    int kin;
 
     if(!s)
       return s;
@@ -239,39 +217,10 @@ ic2str(s)
 **     primitive function
 */
 
-static int kmode;      /* 0: Kanji out */
-                       /* 1: Kanji in */
-
-static void
-tty_reset()
-{
-    if(kmode && output_kcode==JIS ){
-       putchar(033);
-       putchar('(');
-       putchar('B');
-/*
-    if (flags.DECgraphics){
-      putchar(033);
-      putchar('$');
-      putchar(')');
-      putchar('B');
-    }
-*/
-    }
-    kmode = 0;
-}
-
 /* print out 1 byte character to tty (no conversion) */
 static void
 tty_cputc(unsigned int c)
 {
-    if(kmode && output_kcode==JIS ){
-       putchar(033);
-       putchar('(');
-       putchar('B');
-    }
-    kmode = 0;
-
 #if defined(NO_TERMS) && (defined(MSDOS) || defined(WIN32CON))
     xputc(c);
 #else
@@ -283,8 +232,6 @@ tty_cputc(unsigned int c)
 static void
 tty_cputc2(unsigned int c, unsigned int c2)
 {
-    kmode = 1;
-
 #if defined(NO_TERMS) && (defined(MSDOS) || defined(WIN32CON))
     xputc2(c, c2);
 #else
@@ -297,13 +244,6 @@ tty_cputc2(unsigned int c, unsigned int c2)
 static void
 tty_jputc(unsigned int c)
 {
-    if(kmode && output_kcode==JIS ){
-       putchar(033);
-       putchar('(');
-       putchar('B');
-    }
-    kmode = 0;
-
 #if defined(NO_TERMS) && (defined(MSDOS) || defined(WIN32CON))
     xputc(c);
 #else
@@ -315,13 +255,6 @@ tty_jputc(unsigned int c)
 static void
 tty_jputc2(unsigned int c, unsigned int c2)
 {
-    if(!kmode && output_kcode==JIS ){
-       putchar(033);
-       putchar('$');
-       putchar('B');
-    }
-    kmode = 1;
-
 #if defined(NO_TERMS) && (defined(MSDOS) || defined(WIN32CON))
     xputc2(c, c2);
 #else
@@ -338,7 +271,6 @@ int
 jbuffer(
      unsigned int c,
      unsigned int *buf,
-     void (*reset)(),
      void (*f1)(unsigned int),
      void (*f2)(unsigned int, unsigned int))
 {
@@ -348,7 +280,6 @@ jbuffer(
     unsigned char *p;
 
     if(!buf) buf = ibuf;
-    if(!reset) reset = tty_reset;
     if(!f1) f1 = tty_jputc;
     if(!f2) f2 = tty_jputc2;
 
@@ -367,10 +298,6 @@ jbuffer(
          ;
        else if(IC == EUC){
            switch(output_kcode){
-             case JIS:
-               c1 &= 0x7f;
-               c2 &= 0x7f;
-               break;
              case SJIS:
                uc[0] = c1;
                uc[1] = c2;
@@ -388,10 +315,6 @@ jbuffer(
            uc[1] = c2;
            p = sj2e(uc);
            switch(output_kcode){
-             case JIS:
-               c1 &= 0x7f;
-               c2 &= 0x7f;
-               break;
              case EUC:
                break;
              default:
@@ -407,7 +330,6 @@ jbuffer(
        f1(c);
        return 1;
     }
-    reset();
     return -1;
 }
 
@@ -419,14 +341,12 @@ int
 cbuffer(
      unsigned int c,
      unsigned int *buf,
-     void (*reset)(),
      void (*f1)(unsigned int),
      void (*f2)(unsigned int, unsigned int))
 {
     static unsigned int ibuf[2];
 
     if(!buf) buf = ibuf;
-    if(!reset) reset = tty_reset;
     if(!f1) f1 = tty_cputc;
     if(!f2) f2 = tty_cputc2;
 
@@ -444,7 +364,6 @@ cbuffer(
        f1(c);
        return 1;
     }
-    reset();
     return -1;
 }
 
@@ -452,13 +371,13 @@ void
 jputchar(int c)
 {
     static unsigned int buf[2];
-    jbuffer((unsigned int)(c & 0xff), buf, NULL, NULL, NULL);
+    jbuffer((unsigned int)(c & 0xff), buf, NULL, NULL);
 }
 void
 cputchar(int c)
 {
     static unsigned int buf[2];
-    cbuffer((unsigned int)(c & 0xff), buf, NULL, NULL, NULL);
+    cbuffer((unsigned int)(c & 0xff), buf, NULL, NULL);
 }
 
 void
index 9fd146c..293b707 100644 (file)
@@ -1068,7 +1068,7 @@ VA_DECL(const char *, fmt)
        {
            char *str = buf;
            while(*str){
-               jbuffer(*(str++), NULL, NULL, xputc_core, xputc2_core);
+               jbuffer(*(str++), NULL, xputc_core, xputc2_core);
            }
        }
 #endif