[soc.culture.china] Next kterm 4.1.2 beta ready

mleisher@nmsu.edu (Mark Leisher) (03/04/91)

crl.nmsu.edu:pub/misc/kterm-4.1.2.tar.Z  [128.123.1.14]
expo.lcs.mit.edu:contrib/kterm-4.1.2.tar.Z  [18.30.0.212]
kum.kaist.ac.kr:pub/x/kterm-4.1.2.tar.Z  [137.68.1.65]

kterm 4.1.2 patchlevel 4 is now available by anonymous ftp from the
above sites.

Things fixed/changed in patchlevel 4:

Problem with accidental color settings in JIS strings fixed, thanks to
Martin C. Fong of Sybase.

Changed the way fonts are checked for encoding styles.

Changed the text color resources names to be compatible with the color
xterm (colxterm) by Tom Weinstein et al.  (i.e. color[0-8] as opposed
to textColor[0-8]).

Thing that still need done:

Problem with cursor color not being reset.

Retaining tab characters in selections.  If anyone has this code lying
around, could you send me a copy?

Add Kiyoshi KANAZAWA's MBCS word selection patches and add word select
support for Chinese and Korean.

Update the Japanese man page and write the Chinese and Korean man
pages, maybe README and INSTALL in all three languages as well.  Any
volunteers would be gratefully accepted, as I don't know Japanese,
Chinese, or Korean.
-----------------------------------------------------------------------------
mleisher@nmsu.edu                      "I laughed.
Mark Leisher                                I cried.
Computing Research Lab                          I fell down.
New Mexico State University                        It changed my life."
Las Cruces, NM                     - Rich [Cowboy Feng's Space Bar and Grille]

mleisher@nmsu.edu (Mark Leisher) (03/15/91)

crl.nmsu.edu:pub/misc/kterm-4.1.2.tar.Z  [128.123.1.14]
kum.kaist.ac.kr:pub/unix/Xstuffs/kterm-4.1.2.tar.Z  [137.68.1.65]

kterm 4.1.2 patchlevel 5 beta is ready and available from the
anonymous ftp sites above.  Below are the patches.

Fixed in this patchlevel are:

1. Screen parameters to the FontType function are now passed correctly.

2. Major bug with selections and Big5 mode fixed.

3. Conversion functions for cutting/copying and pasting now insure
   that only text in the correct character set is converted.

4. No more core dumps if kterm starts without an application defaults
   file.

Thanks to Mr. Zhiwei Yang of GMD Darmstadt for finding the parameter
passing problems and finding the Big5 text bug.

=================== PL 4 to PL 5 patches ===========================

*** 1.6	1991/03/15 09:15:20
--- charproc.c	1991/03/15 09:26:06
***************
*** 2,8 ****
   * $XConsortium: charproc.c,v 1.123 90/03/12 10:30:21 jim Exp $
   * $Kagotani: /usr/src.yoshi/X/KTerm/4.1.0/RCS/charproc.c,v 1.1 90/06/27 09:38:31 kagotani Rel $
   *
!  * $Header: /usr/local/src/X11/contrib/clients/kterm-4.1.2/RCS/charproc.c,v 1.6 1991/03/15 09:15:20 mleisher Exp $
   */
  
  /*
--- 2,8 ----
   * $XConsortium: charproc.c,v 1.123 90/03/12 10:30:21 jim Exp $
   * $Kagotani: /usr/src.yoshi/X/KTerm/4.1.0/RCS/charproc.c,v 1.1 90/06/27 09:38:31 kagotani Rel $
   *
!  * $Header: /usr/local/src/X11/contrib/clients/kterm-4.1.2/RCS/charproc.c,v 1.7 1991/03/15 09:24:56 mleisher Exp $
   */
  
  /*
***************
*** 897,920 ****
   * fnum   - font number
   * type   - BOLD or 0
   */
! int FontType(screen, fnum, bold)
  TScreen *screen;
  int fnum, bold;
  {
!     XFontStruct *fnt;
  
      if (bold)
!       fnt = screen->_fnt_bold[fnum];
      else
!       fnt = screen->_fnt_norm[fnum];
  
!     if (!fnt)
        return(NONE);
!     if (fnt->min_byte1 < 0x80 && fnt->min_char_or_byte2 < 0x80)
        return(LOW);
!     if (fnt->min_byte1 > 0x80 && fnt->min_char_or_byte2 > 0x80)
        return(HIGH);
!     if (fnt->min_byte1 > 0x80 && fnt->min_char_or_byte2 < 0x80)
        return(MIXED);
  }
  
--- 897,923 ----
   * fnum   - font number
   * type   - BOLD or 0
   */
! static int
! FontType(screen, fnum, bold)
  TScreen *screen;
  int fnum, bold;
  {
!     XFontStruct *ft;
  
      if (bold)
!       ft = screen->_fnt_bold[fnum];
      else
!       ft = screen->_fnt_norm[fnum];
  
!     if (!ft)
        return(NONE);
!     if (!ft->min_byte1 && !ft->max_byte1)
!       return(NONE);
!     if (ft->min_byte1 < 0x80 && ft->min_char_or_byte2 < 0x80)
        return(LOW);
!     if (ft->min_byte1 > 0x80 && ft->min_char_or_byte2 > 0x80)
        return(HIGH);
!     if (ft->min_byte1 > 0x80 && ft->min_char_or_byte2 < 0x80)
        return(MIXED);
  }
  
***************
*** 1007,1014 ****
  	register Char *dcp = dotextbuf;
          Char oc, oc1;
          char lang = term->misc.lang[0];
!         int hzftype = FontType(term->screen, F_GB2312_0, 0);
!         int ftype = FontType(term->screen, FNUM(gset), 0);
  
          switch(lang) {
  #ifdef KTERM_HANZI
--- 1010,1017 ----
  	register Char *dcp = dotextbuf;
          Char oc, oc1;
          char lang = term->misc.lang[0];
!         int hzftype = FontType(&term->screen, F_GB2312_0, 0);
!         int ftype = FontType(&term->screen, FNUM(gset), 0);
  
          switch(lang) {
  #ifdef KTERM_HANZI
***************
*** 1083,1089 ****
                      /*
                       * Catch 7-bit stuff using an 8-bit font.
                       * Example:
!                      *    7-bit text GuoBiao text
                       *    JIS Kanji with EUC encoded font.
                       */
                      if (ftype == HIGH) {
--- 1086,1092 ----
                      /*
                       * Catch 7-bit stuff using an 8-bit font.
                       * Example:
!                      *    7-bit GuoBiao text
                       *    JIS Kanji with EUC encoded font.
                       */
                      if (ftype == HIGH) {
***************
*** 1244,1250 ****
  		}
                  c1 = HI;
                  c2 = LO;
!                 if (FontType(term->screen, F_GB2312_0, 0) == MIXED)
                    hzconvert(SGBtoBIG,c1,c2,&oc1,&oc2);
                  else
                    hzconvert(SGBtoGB,c1,c2,&oc1,&oc2);
--- 1247,1253 ----
  		}
                  c1 = HI;
                  c2 = LO;
!                 if (FontType(&term->screen, F_GB2312_0, 0) == MIXED)
                    hzconvert(SGBtoBIG,c1,c2,&oc1,&oc2);
                  else
                    hzconvert(SGBtoGB,c1,c2,&oc1,&oc2);
*** 1.4	1991/01/30 00:19:44
--- convert.c	1991/03/15 09:29:30
***************
*** 2,8 ****
   *	convert.c -- code converters for kterm
   *	$Kagotani: /usr/src.yoshi/X/KTerm/4.1.0/RCS/convert.c,v 1.1 90/06/27 09:38:46 kagotani Rel $
   *
!  * $Header: /usr/local/src/X11/contrib/clients/kterm-4.1.2/RCS/convert.c,v 1.4 1991/01/30 00:19:44 mleisher Exp $
   */
  
  /*
--- 2,8 ----
   *	convert.c -- code converters for kterm
   *	$Kagotani: /usr/src.yoshi/X/KTerm/4.1.0/RCS/convert.c,v 1.1 90/06/27 09:38:46 kagotani Rel $
   *
!  * $Header: /usr/local/src/X11/contrib/clients/kterm-4.1.2/RCS/convert.c,v 1.5 1991/03/15 09:28:40 mleisher Exp $
   */
  
  /*
***************
*** 61,76 ****
      i = j = 0;
      while(i < len) {
          gs1 = hz[i].gset;
!         oc1 = c1 = hz[i++].code;
!         gs2 = hz[i].gset;
!         oc2 = c2 = hz[i++].code;
!         hzconvert(from, c1, c2, &oc1, &oc2);
!         ptr[j].gset = gs1;
!         ptr[j++].code = oc1;
!         ptr[j].gset = gs2;
!         ptr[j++].code = oc2;
      }
!     ptr[j].gset = ptr[j].code = '\0';
      return(ptr);
  }
  
--- 61,84 ----
      i = j = 0;
      while(i < len) {
          gs1 = hz[i].gset;
!         c1 = hz[i].code;
!         if (gs1 != GSET_HANZI) {
!             ptr[j].gset = gs1;
!             ptr[j++].code = c1;
!         } else {
!             i++;
!             gs2 = hz[i].gset;
!             c2 = hz[i].code;
!             hzconvert(from, c1, c2, &oc1, &oc2);
!             ptr[j].gset = gs1;
!             ptr[j++].code = oc1;
!             ptr[j].gset = gs2;
!             ptr[j++].code = oc2;
!         }
!         i++;
      }
!     ptr[j].gset = 0;
!     ptr[j].code = '\0';
      return(ptr);
  }
  
***************
*** 84,98 ****
  	Ichr		*cs = *cs_p;
  	unsigned char	*gs = *gs_p;
  
!         c1 = cs++->code;
!         c2 = cs++->code;
!         if (gs) {
!             *gs++ = c1 | 0x80;
!             *gs++ = c2 | 0x80;
          }
!         *gs_p = gs;
!         *cs_p = cs;
!         return 2;
  }
  
  /* CS -> SGB */
--- 92,109 ----
  	Ichr		*cs = *cs_p;
  	unsigned char	*gs = *gs_p;
  
!         if (cs->gset == GSET_HANZI) {
!             c1 = cs++->code;
!             c2 = cs++->code;
!             if (gs) {
!                 *gs++ = c1 | 0x80;
!                 *gs++ = c2 | 0x80;
!             }
!             *gs_p = gs;
!             *cs_p = cs;
!             return(2);
          }
!         return(0);
  }
  
  /* CS -> SGB */
***************
*** 106,121 ****
  	unsigned char	*sgs = *sgs_p;
          unsigned char   oc1, oc2;
  
!         c1 = cs++->code;
!         c2 = cs++->code;
!         if (sgs) {
!             hzconvert(GBtoSGB, c1, c2, &oc1, &oc2);
!             *sgs++ = oc1 | 0x80;
!             *sgs++ = oc2 | 0x80;
          }
!         *sgs_p = sgs;
!         *cs_p = cs;
!         return 2;
  }
  
  /* CS -> BIG5 */
--- 117,135 ----
  	unsigned char	*sgs = *sgs_p;
          unsigned char   oc1, oc2;
  
!         if (cs->gset == GSET_HANZI) {
!             c1 = cs++->code;
!             c2 = cs++->code;
!             if (sgs) {
!                 hzconvert(GBtoSGB, c1, c2, &oc1, &oc2);
!                 *sgs++ = oc1 | 0x80;
!                 *sgs++ = oc2 | 0x80;
!             }
!             *sgs_p = sgs;
!             *cs_p = cs;
!             return(2);
          }
!         return(0);
  }
  
  /* CS -> BIG5 */
***************
*** 129,146 ****
  	unsigned char	*bs = *bs_p;
          unsigned char	ch1, ch2, och1, och2;
  
!         c1 = cs++->code;
!         c2 = cs++->code;
!         if (bs) {
!             ch1 = c1 | 0x80;
!             ch2 = c2 | 0x80;
!             hzconvert(GBtoBIG, ch1, ch2, &och1, &och2);
!             *bs++ = och1;
!             *bs++ = och2;
          }
!         *bs_p = bs;
!         *cs_p = cs;
!         return 2;
  }
  
  /* CS -> GUOBIAO using ESC-$-A */
--- 143,163 ----
  	unsigned char	*bs = *bs_p;
          unsigned char	ch1, ch2, och1, och2;
  
!         if (cs->gset == GSET_HANZI) {
!             c1 = cs++->code;
!             c2 = cs++->code;
!             if (bs) {
!                 ch1 = c1 | 0x80;
!                 ch2 = c2 | 0x80;
!                 hzconvert(GBtoBIG, ch1, ch2, &och1, &och2);
!                 *bs++ = och1;
!                 *bs++ = och2;
!             }
!             *bs_p = bs;
!             *cs_p = cs;
!             return(2);
          }
!         return(0);
  }
  
  /* CS -> GUOBIAO using ESC-$-A */
***************
*** 182,196 ****
  	Ichr		*cs = *cs_p;
  	unsigned char	*ks = *ks_p;
  
!         c1 = cs++->code;
!         c2 = cs++->code;
!         if (ks) {
!             *ks++ = c1 | 0x80;
!             *ks++ = c2 | 0x80;
          }
!         *ks_p = ks;
!         *cs_p = cs;
!         return 2;
  }
  
  /* CS -> KS using ESC-$-C */
--- 199,216 ----
  	Ichr		*cs = *cs_p;
  	unsigned char	*ks = *ks_p;
  
!         if (cs->gset == GSET_HANGUL) {
!             c1 = cs++->code;
!             c2 = cs++->code;
!             if (ks) {
!                 *ks++ = c1 | 0x80;
!                 *ks++ = c2 | 0x80;
!             }
!             *ks_p = ks;
!             *cs_p = cs;
!             return(2);
          }
!         return(0);
  }
  
  /* CS -> KS using ESC-$-C */
*** 1.3	1991/01/16 07:07:54
--- kterm.h	1991/03/15 09:32:00
***************
*** 1,7 ****
  /*
   *	$Kagotani: /usr/src.yoshi/X/KTerm/4.1.0/RCS/kterm.h,v 1.1 90/06/27 09:39:07 kagotani Rel $
   *
!  * $Header: /usr/local/src/X11/contrib/clients/kterm-4.1.2/RCS/kterm.h,v 1.3 1991/01/16 07:07:54 mleisher Exp $
   */
  
  /*
--- 1,7 ----
  /*
   *	$Kagotani: /usr/src.yoshi/X/KTerm/4.1.0/RCS/kterm.h,v 1.1 90/06/27 09:39:07 kagotani Rel $
   *
!  * $Header: /usr/local/src/X11/contrib/clients/kterm-4.1.2/RCS/kterm.h,v 1.4 1991/03/15 09:31:33 mleisher Exp $
   */
  
  /*
***************
*** 59,68 ****
  #endif
  
  #if defined(KTERM) && defined(KTERM_KANJI)
! #define KTERM_HANZI
! #define KTERM_HANGUL
  #endif
  
  /* gset field */
  #define CS96		0x80
  #define MBCS		0x40
--- 59,70 ----
  #endif
  
  #if defined(KTERM) && defined(KTERM_KANJI)
! 
! #define KTERM_DEFAULT_LANG "japanese"
! #define KTERM_DEFAULT_MODE "euc"
! 
! #define KTERM_HANZI  /* GB 2312 Hanzi support */
! #define KTERM_HANGUL /* KS C5601 Hangul support */
! 
  #endif
  
*** 1.4	1991/01/30 00:12:10
--- main.c	1991/03/15 09:40:20
***************
*** 2,8 ****
  static char rcs_id[] = "$XConsortium: main.c,v 1.145 90/01/11 14:22:31 jim Exp $";
  static char kterm_id[] = "$Kagotani: /usr/src.yoshi/X/KTerm/4.1.0/RCS/main.c,v 1.1 90/06/27 09:39:15 kagotani Rel $";
  static char nmsu_crl_rcs_id[] =
!   "$Header: /usr/local/src/X11/contrib/clients/kterm-4.1.2/RCS/main.c,v 1.4 1991/01/30 00:12:10 mleisher Exp $";
  #endif	/* lint */
  
  /*
--- 2,8 ----
  static char rcs_id[] = "$XConsortium: main.c,v 1.145 90/01/11 14:22:31 jim Exp $";
  static char kterm_id[] = "$Kagotani: /usr/src.yoshi/X/KTerm/4.1.0/RCS/main.c,v 1.1 90/06/27 09:39:15 kagotani Rel $";
  static char nmsu_crl_rcs_id[] =
!   "$Header: /usr/local/src/X11/contrib/clients/kterm-4.1.2/RCS/main.c,v 1.5 1991/03/15 09:39:43 mleisher Exp $";
  #endif	/* lint */
  
  /*
***************
*** 934,939 ****
--- 940,951 ----
  	}
  
  #ifdef KTERM_KANJI
+         if (!term->misc.lang) {
+             XtWarning("Language choice not found.");
+             term->misc.lang = KTERM_DEFAULT_LANG;
+             term->misc.k_m = KTERM_DEFAULT_MODE;
+         }
+ 
          switch(term->misc.lang[0]) {
  #ifdef KTERM_HANZI
            case 'c':
-----------------------------------------------------------------------------
mleisher@nmsu.edu                      "I laughed.
Mark Leisher                                I cried.
Computing Research Lab                          I fell down.
New Mexico State University                        It changed my life."
Las Cruces, NM                     - Rich [Cowboy Feng's Space Bar and Grille]