public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Corrected patch to cygwin.dll + ncurses for termcaps
@ 1997-03-05  0:59 Mikey
  0 siblings, 0 replies; 4+ messages in thread
From: Mikey @ 1997-03-05  0:59 UTC (permalink / raw)
  To: Sheik; +Cc: cygnus

[-- Attachment #1: Type: text/plain, Size: 1861 bytes --]

Sorry, :^(.  I was playing around trying to get rcs to work, and I guess I
left the changes at the begining of the files in when I made the diffs. You
can either just delete the *.rej files, or I have included the corrected
diffs here.

----------
> From: Sheik <sheikyy@spartan.pei.edu>
> To: Mikey <jeffdb@netzone.com>
> Cc: cygnus <gnu-win32@cygnus.com>
> Subject: Re: patch to cygwin.dll + ncurses for termcaps
> Date: Tuesday, March 04, 1997 9:47 PM
> 
> 
> 
> On Tue, 4 Mar 1997, Mikey wrote:
> 
> > Scott
> > 	I don't recall if I put it in my orig post or not, but all of my
> > filesystems are mounted -b, so the patches are LF only. When you use
> > patch.exe the filesystem, file, and patch-file should all be in sync,
(the
> > file, and patch-file must be).
> > 
>    ug, I don't want to sound dense, but I don't think the patch itself is

> right, at least to the current source... for instance in your patch 
> called termcaps.dif, here is the cut of the first few lines....
> 
> diff -urbBN ../winsup.orig/Makefile.in ./Makefile.in
> --- ../winsup.orig/Makefile.in  Tue Feb 25 13:02:27 1997
> +++ ./Makefile.in       Sat Feb 01 18:14:57 1997
> @@ -1,4 +1,4 @@
> -# Makefile.in for the winsup directory. #
> +# Makefile.in for the winsup directory.
>  # Copyright (c) 1995, 1996 Cygnus Solutions
> 
> so I look at the current Makefile.in in the newest source, and here is 
> the first few lines.....
> 
> # Makefile.in for the winsup directory.
> # Copyright (c) 1995, 1996 Cygnus Solutions
> 
> 
> Notice, the first line DOESN'T have the "#" char at the end of the line.,

> but your patch expects it to be there. The entire patch file you sent 
> have these probs, so I thought maybe you based the patches on an older 
> source tarball...
> 
> Thanks again,
> Scott Kilau
termcaps.dif (DIF File)
terminfo.dif (DIF File)
bash_less.dif (DIF File)


[-- Attachment #2: bash_less.dif --]
[-- Type: text/x-diff, Size: 1981 bytes --]

diff -urBb userorig/less/output.c user/less/output.c
--- userorig/less/output.c	Sat Jan 11 10:33:03 1997
+++ user/less/output.c	Tue Jan 07 23:26:51 1997
@@ -249,7 +249,7 @@
  * using a more portable argument list mechanism than printf's.
  */
 	static int
-iprintf(fmt, parg)
+myprintf(fmt, parg)
 	register char *fmt;
 	PARG *parg;
 {
@@ -329,7 +329,7 @@
 		col += so_s_width;
 	}
 
-	col += iprintf(fmt, parg);
+        col += myprintf(fmt, parg);
 
 	if (!any_display)
 	{
@@ -370,7 +370,7 @@
 {
 	clear_bot();
 	so_enter();
-	(void) iprintf(fmt, parg);
+        (void) myprintf(fmt, parg);
 	putstr(intr_to_abort);
 	so_exit();
 	flush();
@@ -392,7 +392,7 @@
 	if (any_display)
 		clear_bot();
 
-	(void) iprintf(fmt, parg);
+        (void) myprintf(fmt, parg);
 	c = getchr();
 
 	if (!any_display)
diff -urbB user/bash.orig/cpp-Makefile user/bash/cpp-Makefile
--- user/bash.orig/cpp-Makefile	Tue Feb 25 18:52:47 1997
+++ user/bash/cpp-Makefile	Tue Feb 25 21:41:05 1997
@@ -300,7 +300,7 @@
 /**/# The GNU coding standards don't recognize the possibility that
 /**/# other information besides optimization and debugging might be
 /**/# passed to cc.  A different name should have been used.
-CFLAGS = -O -g
+CFLAGS = -include/usr/include/curses.h -include/usr/include/termcap.h -O
 
 SYSTEM_FLAGS = $(LINEBUF) $(VPRINTF) $(UNISTD) $(STDLIB) $(LIMITSH) \
        $(GROUPS) $(RESOURCE) $(PARAM) $(SIGHANDLER) $(SYSDEP) $(WAITH) \
@@ -549,7 +549,7 @@
 #  if defined (USE_TERMCAP_EMULATION)
 TERMCAP_LIBRARY = -lcurses
 #  else /* !USE_TERMCAP_EMULATION */
-TERMCAP_LIBRARY = -ltermcap
+TERMCAP_LIBRARY = -lncurses 
 #  endif /* !USE_TERMCAP_EMULATION */
 #endif /* !USE_GNU_TERMCAP */
 
@@ -659,7 +659,7 @@
 #  if defined (USE_TERMCAP_EMULATION)
 TERMCAP_LIB = -lcurses
 #  else  /* !USE_TERMCAP_EMULATION */
-TERMCAP_LIB = -ltermcap
+TERMCAP_LIB = -lncurses 
 #  endif /* !USE_TERMCAP_EMULATION */
 
 /**/# Directory list for -L so that the link editor (ld) can find -lreadline.

[-- Attachment #3: termcaps.dif --]
[-- Type: text/x-diff, Size: 22318 bytes --]

diff -urbBN ../winsup.orig/Makefile.in ./Makefile.in
--- ../winsup.orig/Makefile.in	Tue Feb 25 13:02:27 1997
+++ ./Makefile.in	Sat Feb 01 18:14:57 1997
@@ -152,10 +152,12 @@
 readme.info:$(srcdir)/doc/readme.texinfo
 	$(MAKEINFO) -I$(srcdir)/doc  $<
 
-install: $(THEIRLIBS) $(LIBNAME) new-$(DLLNAME) real-headers
+install-theirlibs: $(THEIRLIBS) $(LIBNAME)
 	for i in $(THEIRLIBS) $(LIBNAME); do \
 		$(INSTALL_DATA) $$i $(tooldir)/lib/$$i ; \
 	done
+
+install-dll: new-$(DLLNAME)
 	for i in $(DLLNAME); do \
 	  $(INSTALL_DATA) new-$$i $(tooldir)/lib/$$i ; \
 	  binname=`t='$(program_transform_name)'; echo "$$i" | sed -e $$t` ; \
@@ -163,16 +165,21 @@
 	  rm -f $(bindir)/$$binname ; \
 	  ln $(tooldir)/lib/$$i $(bindir)/$$binname >/dev/null 2>&1 || $(INSTALL_DATA) new-$$i $(bindir)/$$binname ; \
 	done
+
+install-real-headers: real-headers
 	for sub in include include/arpa include/asm include/Windows32 \
 	   include/cygwin32 include/net include/netinet include/sys ; do \
 		for i in $(srcdir)/$$sub/*.h ; do \
 		  $(INSTALL_DATA) $$i $(tooldir)/$$sub/`basename $$i` ; \
 		done ; \
 	done
+
+install-utils:
 	rootme=`pwd` ; export rootme ; \
 	rootsrc=`(cd $(srcdir) ; pwd)` ; export rootsrc ; \
 	cd utils; $(MAKE) install $(FLAGS_TO_PASS)
 
+install: install-theirlibs install-dll install-real-headers install-utils
 	# this will only work if you've maked stmp_ms_include below.
 	#	if [ -e ms_include/windows.h ] ; then  \
 	#		for i in ms_include/*.h ; do \
diff -urbBN ../winsup.orig/fhandler.cc ./fhandler.cc
--- ../winsup.orig/fhandler.cc	Tue Feb 25 13:49:49 1997
+++ ./fhandler.cc	Fri Feb 28 11:20:19 1997
@@ -1832,6 +1832,47 @@
 }
 
 void
+fhandler_console::clear_to_bol ()
+{
+  CONSOLE_SCREEN_BUFFER_INFO info;
+  DWORD done;
+  GetConsoleScreenBufferInfo (get_output_handle (), &info);
+  COORD tlc = {0,info.dwCursorPosition.Y};
+  FillConsoleOutputCharacterA (get_output_handle (), ' ',
+			       info.dwCursorPosition.X,
+			       tlc,
+			       &done);
+  FillConsoleOutputAttribute (get_output_handle (), 
+                               FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_RED,
+			       info.dwCursorPosition.X,
+			       tlc,
+                               &done);
+}
+
+void
+fhandler_console::output_chars (int x, int y, int num_chars, unsigned char fill_char)
+{
+  CONSOLE_SCREEN_BUFFER_INFO info;
+  COORD tlc = {x,y};
+  DWORD done;
+  GetConsoleScreenBufferInfo (get_output_handle (), &info);
+  FillConsoleOutputCharacterA (get_output_handle (), fill_char,
+			       num_chars, tlc, &done);
+  FillConsoleOutputAttribute (get_output_handle(), 
+                               FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_RED,
+                               num_chars, tlc, &done);
+  x += num_chars;
+fix_x:
+  if (x > info.dwSize.X)
+     {
+       x -= info.dwSize.X;
+       y += 1;
+       goto fix_x;
+     }
+  cursor_set(x,y);
+}
+
+void
 fhandler_console::cursor_set (int x, int y)
 {
   CONSOLE_SCREEN_BUFFER_INFO info;
@@ -1875,9 +1916,91 @@
   *x = info.dwCursorPosition.X;
 }
 
+void
+fhandler_console::screen_size_get (int *x, int *y)
+{
+  CONSOLE_SCREEN_BUFFER_INFO info;
+  GetConsoleScreenBufferInfo (get_output_handle (), &info);
+	*y = 1 + info.srWindow.Bottom - info.srWindow.Top;
+	*x = 1 + info.srWindow.Right - info.srWindow.Left;
+}
+
+
+void
+fhandler_console::scroll_scr_buf (int x, int y, int Up_Dn)
+{
+CONSOLE_SCREEN_BUFFER_INFO info;
+SMALL_RECT Sr, Cr; CHAR_INFO Fill; COORD Dest;
+GetConsoleScreenBufferInfo(get_output_handle (), &info); /* Get the screen buffer info. */ 
+Sr.Top = y;
+Sr.Bottom = info.dwSize.Y - 1; 
+Sr.Left = 0; 
+Sr.Right = info.dwSize.X - 1; 
+Dest.X = 0; Dest.Y = y + Up_Dn; /* The destination for the scroll rectangle */ 
+Cr = Sr; /* Clip the origion */
+Fill.Attributes = 7; /* Fill any empty rows with normal blanks. */ 
+Fill.Char.AsciiChar = ' '; 
+ScrollConsoleScreenBuffer(get_output_handle (), &Sr, &Cr, Dest, &Fill);
+cursor_set(x, y);
+}
+
+void
+fhandler_console::dch1 (int x, int y)
+{
+    SMALL_RECT Rr, Wr; 
+    int sizeX, sizeY; screen_size_get (&sizeX, &sizeY);
+    CHAR_INFO Buf[sizeX];COORD BufSize, BufCoord; DWORD done;
+    Rr.Top = y;    /* Set the source rectangle. */ 
+    Rr.Left = x + 1; /* from x+1 */ 
+    Rr.Bottom = y; /* only one line */
+    Rr.Right = (sizeX - 1) ;
+    BufSize.Y = 1; BufSize.X = sizeX ; /* The temp buf size is 1 row x columns. */
+    BufCoord.X = 0; BufCoord.Y = 0; /* destination 0, 0 */
+    ReadConsoleOutput(get_output_handle (), Buf, BufSize, BufCoord, &Rr); 
+    Wr.Top = y; // Set the destination rectangle. same row
+    Wr.Left = x; // overwrite char to be deleted
+    Wr.Bottom = y; 
+    Wr.Right = (sizeX - 1) ; //clip the extra space
+    WriteConsoleOutput(get_output_handle (), Buf, BufSize, BufCoord, &Wr);
+    BufCoord.X = sizeX - 1; BufCoord.Y = y;
+    FillConsoleOutputCharacterA (get_output_handle (), ' ', 1, BufCoord, &done);
+    FillConsoleOutputAttribute (get_output_handle (), FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_RED,
+			       1, BufCoord, &done);
+}
+
+void
+fhandler_console::scroll_line_buf (int x, int y)
+{
+    SMALL_RECT Rr, Wr; 
+    int sizeX, sizeY; screen_size_get (&sizeX, &sizeY);
+    CHAR_INFO Buf[sizeX];COORD BufSize, BufCoord; DWORD done;
+    Rr.Top = y;    /* Set the source rectangle. */ 
+    Rr.Left = x; /* from x */ 
+    Rr.Bottom = y; /* only one line */
+    Rr.Right = (sizeX - 2) ;
+    BufSize.Y = 1; BufSize.X = sizeX ; /* The temp buf size is 1 row x columns. */
+    BufCoord.X = 0; BufCoord.Y = 0; /* destination 0, 0 */
+    ReadConsoleOutput(get_output_handle (), Buf, BufSize, BufCoord, &Rr); 
+    Wr.Top = y; // Set the destination rectangle. same row
+    Wr.Left = x + 1; // scroll Right
+    Wr.Bottom = y; 
+    Wr.Right = (sizeX - 1) ; //clip the extra space
+    WriteConsoleOutput(get_output_handle (), Buf, BufSize, BufCoord, &Wr);
+    BufCoord.X = x; BufCoord.Y = y;
+    FillConsoleOutputCharacterA (get_output_handle (), ' ', 1, BufCoord, &done);
+    FillConsoleOutputAttribute (get_output_handle (), FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_RED,
+			       1, BufCoord, &done);
+}
+
+void
+fhandler_console::switchCP(int CP)
+{ /* FIXMEJD code to actually switch goes here */
+}
+
 #define BAK 1
 #define ESC 2
 #define NOR 0
+#define EOT 3
 #define IGN 4
 #define ERR 5
 #define DWN 6
@@ -1888,7 +2011,7 @@
 
 static const char base_chars[256] =
 {
-/*00 01 02 03 04 05 06 07 */ IGN, ERR, ERR, ERR, ERR, ERR, ERR, BEL, 
+/*00 01 02 03 04 05 06 07 */ IGN, ERR, ERR, ERR, EOT, ERR, ERR, BEL, 
 /*08 09 0A 0B 0C 0D 0E 0F */ BAK, TAB, DWN, ERR, ERR, CR,  ERR, IGN,
 /*10 11 12 13 14 15 16 17 */ ERR, ERR, ERR, ERR, ERR, ERR, ERR, ERR, 
 /*18 19 1A 1B 1C 1D 1E 1F */ ERR, ERR, ERR, ESC, ERR, ERR, ERR, ERR, 
@@ -1927,14 +2050,13 @@
 fhandler_console::char_command (char c)
 {
   static int fg=7,bg=0,bold=0;
-  int x, y;
   static int savex, savey; /* for CSI s, CSI u */
-
+  int i, x, y;
+  DWORD done;
+  cursor_get(&x, &y);
   switch (c)
     {
     case 'm':   /* Set Graphics Rendition */
-       int i;
-
        for(i = 0; i <= nargs_; i++)
          switch(args_[i])
            {
@@ -1948,12 +2070,12 @@
                bg=0;
                bold=FOREGROUND_INTENSITY;
                break;
-             case 4:    /* underline - simulate with magenta */
+             case 4:    /* underline - simulate with magenta mono only*/
                fg=FOREGROUND_BLUE | FOREGROUND_RED;
-               bold=FOREGROUND_INTENSITY;
                bg=0;
+               bold=FOREGROUND_INTENSITY;
                break;
-             case 5:
+             case 5:	/* blink */
                fg=FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED;
                bg=0;
                bold=FOREGROUND_INTENSITY | BACKGROUND_INTENSITY;
@@ -1963,6 +2085,16 @@
                bg=BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED;
                bold=0;
                break;
+	     case 8:
+		fg=0;
+		if (bg & BACKGROUND_BLUE)
+			fg |= FOREGROUND_BLUE;
+		if (bg & BACKGROUND_GREEN)
+			fg |= FOREGROUND_GREEN;
+		if (bg & BACKGROUND_RED)
+			fg |= FOREGROUND_RED;
+		bold=0;
+		break;  /* FIXME */
              case 30:        /* BLACK foreground */
                fg = 0;
                break;
@@ -2025,8 +2157,24 @@
     case 'J':
       switch (args_[0])
 	{
-	case 2:
-	default:
+	case 0:	/* erase from cursor to end of display */
+      	      cursor_get(&savex, &savey);
+	      clear_to_eol ();
+	      screen_size_get(&x, &y);
+	      for (i=savey + 1;i < y;i++){
+		cursor_set(0, i);
+		clear_to_eol (); }
+      	      cursor_set(savex, savey);
+	      break;
+	case 1:/* erase from start to cursor */
+      	      cursor_get(&savex, &savey);
+	      clear_to_bol ();
+	      for (y = 0;y < savey;y++) {
+		cursor_set(0, y);
+		clear_to_eol (); }
+      	      cursor_set(savex, savey);
+	      break;
+	case 2: /* erase whole display */
 	  clear_screen ();
 	  cursor_set (0,0);
 	  break;
@@ -2045,26 +2193,132 @@
     case 'D':
       cursor_rel (-(args_[0] ? args_[0]:1),0);
       break;
+    case 'I':
+      cursor_get(&x, &y);
+      cursor_set(8*(x/8+1), y);
+      break;
     case 'K':
+      switch (args_[0])
+	{
+	case 2: /* erase whole line */
+	      clear_to_bol (); /* el1 */
+	case 0:	/* erase from cursor to end of line */
       clear_to_eol ();
       break;
+	case 1: /* erase from start of line to cursor */
+	      clear_to_bol ();
+	      break;
+	}
+      break;
+    case 'L': /* il1= insert line(s) in screen buffer */
+      for (i=0;i<(args_[0]? args_[0]: 1);i++)
+	{
+      	  cursor_get(&x, &y);
+          scroll_scr_buf (x, y, 1);
+	}
+      break;
+    case 'M': /* dl1= delete line(s) from screen buffer */
+      for (i=0;i<(args_[0]? args_[0]: 1);i++)
+	{
+          cursor_get(&x, &y);
+          scroll_scr_buf (x, y, -1);
+	}
+      break;	
     case 'H':
     case 'f':
       cursor_set((args_[1] ? args_[1]:1) -1, (args_[0] ? args_[0]:1) -1);
       break;
     case 'G':   /* hpa - position cursor at column n-1 */
       cursor_get(&x, &y);
-      cursor_set(x, (args_[0] ? args_[0]-1:0));
+      cursor_set((args_[0] ? args_[0]-1:0), y);
+      break;
+    case 'P':	/* delete char */
+      cursor_get(&x, &y);
+      for (i=0;i<(args_[0] ? args_[0] : 1);i++)
+	{
+      		dch1 (x, y);
+	}
+      cursor_set(x, y);
+      break;
+    case '@':	/* insert char */
+      cursor_get(&x, &y);
+      for (i=0;i<(args_[0] ? args_[0] : 1);i++)
+	{
+      		scroll_line_buf (x, y);
+	}
+      cursor_set(x, y);
+      break;
+    case 'S': /* ind/indn scroll forward #1 line(s) from ll */
+      for (i=0;i<(args_[0]? args_[0]: 1);i++)
+	{
+	    WriteFile (get_output_handle (), "\n", 1, &done, 0);
+	}
+	break;
+    case 'T': /* ri/rin scroll backward (#1) line(s) from ul */
+      for (i=0;i<(args_[0]? args_[0]: 1);i++)
+	{
+      	  cursor_get(&x, &y);
+          scroll_scr_buf (x, y, 1);
+	}
+      break;
+    case 'X': /* erase (blank out) #1 chars w/out moving cursor */
+      cursor_get(&x, &y);
+      output_chars(x, y, (args_[0] ? args_[0] : 1), ' ');
+      cursor_set (x,y); 
+      break;
+    case 'Z':	/* back tab */
+      cursor_get(&x, &y);
+      cursor_set(((8*(x/8+1))-8), y);
+      break;
+    case 'b': /* rep output char #1 #2 times */
+      cursor_get(&x, &y);
+      output_chars(x, y, args_[1], args_[0]);
+      break;
+    case 'c': /* u9 terminal enquire string */
+      char term_rpt[5];
+      unsigned int ne1;
+      INPUT_RECORD input_rec1;
+      sprintf(term_rpt, "ansi"); /* return u8 terminal name */
+      input_rec1.EventType = KEY_EVENT;
+      i = 0;
+      while (term_rpt[i] != 0)
+        {
+          input_rec1.Event.KeyEvent.AsciiChar = term_rpt[i];
+          WriteConsoleInput (get_input_handle (), &input_rec1, 1, &ne1);
+	  i++;
+        }
       break;
     case 'd':   /* vpa - position cursor at line n */
       cursor_get(&x, &y);
-      cursor_set((args_[0]? args_[0]: 1) - 1, y);
+      cursor_set(x, (args_[0] ? args_[0]-1:0));
+      break;
+    case 'g':   /* eat tab set/clear for regular ansi */
+      break;
+    case 'n': /* u7 cursor position request */
+      if (args_[0] != 6){
+      small_printf("Bad position request %d, %d %d (%c)\n", args_[0], args_[1], c,c);
+      sleep (1);
+      break;}
+      cursor_get(&x, &y);
+      char pos_rpt[12];
+      unsigned int ne2;
+      INPUT_RECORD input_rec;
+      sprintf(pos_rpt, "\033[%d;%dR", y, x); /* return u6 cursor position report */
+      input_rec.EventType = KEY_EVENT;
+      i = 0;
+      while (pos_rpt[i] != 0)
+        {
+          input_rec.Event.KeyEvent.AsciiChar = pos_rpt[i];
+          WriteConsoleInput (get_input_handle (), &input_rec, 1, &ne2);
+	  i++;
+        }
       break;
     case 's':   /* Save cursor position */
       cursor_get(&savex, &savey);
       break;
     case 'u':   /* Restore cursor position */
       cursor_set(savex, savey);
+      break;
     default:
       small_printf("Bad escape %d, %d %d (%c)\n", args_[0], args_[1], c,c);
       sleep (1);
@@ -2078,6 +2332,7 @@
 {
   /* Scan forward to see what a char which needs special treatment */
   DWORD done;
+  int x, y;
   const unsigned char *found = src;
   while (found < end)
     {
@@ -2104,6 +2359,7 @@
 	  break;
 	case ESC:
 	  state_ = gotesc;
+	  /* debug_printf("\nESCAPE is %s\n", src); */
 	  break;
 	case DWN:
 	  if (get_w_binary ())
@@ -2111,6 +2367,11 @@
 	  else
 	    WriteFile (get_output_handle (), "\r\n", 2, &done, 0);
 	  break;
+	case EOT:
+	  cursor_get(&x, &y);
+          dch1 (x, y);
+          cursor_set(x, y);
+	  break;
 	case BAK:
 	  cursor_rel (-1, 0);
 	  break;
@@ -2126,7 +2387,9 @@
           cursor_set(8*(x/8+1), y);
           break;
 	case ERR:
-	  small_printf ("Got %d\n", *src);
+	  if (!is_tty())
+	    WriteFile (get_output_handle (), src, 1, &done, 0);
+/*	  small_printf ("Got %d\n", *src); */
 	  break;
 	}
       src ++;
@@ -2164,6 +2427,21 @@
 	  else
 	    {
 	      state_ = normal;
+	      int CP = 4;
+	      switch (*src)
+		{
+	          case '(': CP = 0; /* ASCII */
+			    break;
+		  case ')': CP = 1;
+			    break;
+		  case '*': CP = 2;
+			    break;
+		  case '+': CP = 3;
+			    break;
+		  default:
+			    break;
+		}
+	      if (CP != 4) { src++; if (*src != 'B') { src--; } else { switchCP(CP); } }
 	    }
 	  src++;
 	  break;
@@ -2194,6 +2472,43 @@
 	  state_ = normal;
 	  break;
 	case gotsquare:
+	      args_[0] = *src; /* first check for 'b' */
+	      nargs_++;
+	      *src++;
+	      if (*src != ';')
+		{
+		  *src--;
+		  nargs_--;
+		  args_[0] = 0;
+		}
+	      else
+		{
+		  *src++;
+		  int i=0;
+	          while (isdigit(*src))
+	            {
+		      args_[1] = args_[1] * 10 + *src - '0';
+		      *src++;
+	              i++;
+		    }
+	          if (*src != 'b')
+		    {
+		      nargs_--;
+	              args_[0] = 0;
+		      args_[1] = 0;
+		      while (i > 0)
+		        {
+			  i--;
+			  *src--;
+		        }
+		      *src--;
+		      *src--;
+		    }
+		  else
+		    {
+		      nargs_++;
+		    }
+		}
 	  if (*src == ';') 
 	    {
               state_ = gotarg1;
@@ -2247,12 +2562,15 @@
   debug_printf("FakeReadFile, res = %d, flags = %x\n", res, flags);
 
   /* if things are special, just do what we used to */
-  if ((!res) 
-      || (flags & ENABLE_LINE_INPUT) 
-      || (ov != 0))
+   if ((!res) || (ov !=0))
         {
           return ReadFile (hndl, pv, lenin, done, ov);
         }
+   if (flags & ENABLE_LINE_INPUT) 
+        { 
+	   FlushConsoleInputBuffer(hndl);
+           return ReadFile (hndl, pv, lenin, done, ov); 
+        }
 
   /* otherwise, do something that works */
   unsigned int num_events = 0, ne2, st;
@@ -2287,6 +2605,7 @@
           return 0;		/* seems to be failure */
         }
       /* doc says it will return at least one event... */
+      if (num_events)
       num_events--;
       /* check if we're just disposing of this one */
 
diff -urbBN ../winsup.orig/fhandler.h ./fhandler.h
--- ../winsup.orig/fhandler.h	Thu Feb 27 02:34:43 1997
+++ ./fhandler.h	Fri Feb 28 11:20:41 1997
@@ -235,8 +235,15 @@
   void clear_screen ();
   void cursor_set (int x, int y);
   void cursor_get (int *x, int *y);
-  void clear_to_eol ();
   void cursor_rel (int x, int y);
+  void clear_to_eol ();
+  void clear_to_bol ();
+  void output_chars (int x, int y, int num_chars, unsigned char fill_char);
+  void screen_size_get (int *x, int *y);
+  void dch1 (int x, int y);
+  void scroll_line_buf (int x, int y);
+  void scroll_scr_buf (int x, int y, int Up_Dn);
+  void switchCP (int CP);
   void get_info ();
   const unsigned char * write_normal (unsigned const char*, unsigned const char *);
   void char_command (char);
diff -urbBN ../winsup.orig/utils/termcap ./utils/termcap
--- ../winsup.orig/utils/termcap	Tue Feb 25 13:27:01 1997
+++ ./utils/termcap	Fri Feb 28 11:55:31 1997
@@ -1,4 +1,128 @@
-ansi:all we know about:\
-	:co#80:li#24:cl=50\E[;H\E[2J:bs:am:cm=\E[%i%d;%dH:\
-	:nd=\E[C:up=\E[A:ce=\E[K:ho=\E[H:pt:
+#ansi:all we know about:\
+#	:co#80:li#24:cl=50\E[;H\E[2J:bs:am:cm=\E[%i%d;%dH:\
+#	:nd=\E[C:up=\E[A:ce=\E[K:ho=\E[H:pt:
+#### Specials
+#
+# Special "terminals".  These are used to label tty lines when you don't
+# know what kind of terminal is on it.  The characteristics of an unknown
+# terminal are the lowest common denominator - they look about like a ti 700.
+# The last one, "other", is like unknown but it allows an escape from software
+# that insists that a "real" unknown terminal is merely so far unspecified.
+#
+
+dumb:\
+	:am:\
+	:co#80:\
+	:bl=^G:cr=^M:do=^J:sf=^J:
+unknown:\
+	:gn:\
+	:tc=dumb:
+other|none of the above, but not exactly unknown:\
+	:am:gn:\
+	:co#80:\
+	:cl=^M^J:do=^J:ho=^M:
+
+arpanet|bussiplexer|dialup|ethernet|network|net|patch|plugboard|switch|network switch or dialup:\
+	:tc=unknown:
+lpr|printer|print|printing|line printer:\
+	:hc:os:\
+	:co#132:li#66:\
+	:bl=^G:cr=^M:do=^J:ff=^L:le=^H:sf=^J:
+
+#### ANSI terminals and terminal emulators
+#
+# See near the end of this file for details on ANSI conformance.
+# Don't mess with these entries!  Lots of other entries depend on them!
+#
+# This section lists entries in a least-capable to most-capable order.
+# if you're in doubt about what `ANSI' matches yours, try them in that
+# order and back off from the first that breaks.
+
+# (ansi: changed ":pt:" to ":it#8:" -- esr)
+ansi-mini|any ansi terminal with pessimistic assumptions:\
+	:am:bs:\
+	:co#80:it#8:li#24:\
+	:ce=\E[K:cl=\E[;H\E[2J:cm=\E[%i%d;%dH:do=\E[B:\
+	:ho=\E[H:le=\E[D:nd=\E[C:up=\E[A:
+
+# Color controls corresponding to the ANSI.SYS de-facto standard
+# (This is not a standalone entry)
+ansi-pc-color:\
+	:Co#8:NC#3:pa#64:\
+	:AB=\E[4%p1%dm:AF=\E[3%p1%dm:\
+	:..Sb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m:\
+	:..Sf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m:\
+	:op=\E[37;40m:
+
+# Procomm and some other ANSI emulations don't recognize all of the ANSI-
+# standard capabilities.  This entry deletes cuu, cuf, cud, cub, and vpa/hpa
+# capabilities, forcing curses to use repetitions of cuu1, cuf1, cud1 and cub1.
+# Also deleted ich and ich1, as QModem up to 5.03 doesn't recognize these.
+# Finally, we delete rep and ri, which seem to confuse many emulators.
+# On the other hand, we can count on these programs doing rmacs/smacs/sgr.
+# From: Eric S. Raymond <esr@snark.thyrsus.com> July 25 1995
+pcansi-mono|ibm-pc terminal programs claiming to be ansi (mono mode):\
+	:am:bs:mi:ms:pt:\
+	:co#80:it#8:li#24:\
+	:ae=\E[10m:al=\E[L:as=\E[12m:bl=^G:bt=\E[Z:cd=\E[J:\
+	:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:ct=\E[2g:\
+	:dc=\E[P:dl=\E[M:do=\E[B:ho=\E[H:kb=^H:kd=\E[B:\
+	:kh=\E[H:kl=\E[D:kr=\E[C:ku=\E[A:le=\E[D:mb=\E[5m:\
+	:md=\E[1m:me=\E[0m:mk=\E[9m:mr=\E[7m:nd=\E[C:\
+	:..sa=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p8%t;11%;%?%p9%t;12%;m:\
+	:se=\E[m:sf=^J:so=\E[7m:st=\EH:ta=^I:ue=\E[m:up=\E[A:\
+	:us=\E[4m:
+pcansi-mono25|ansi25|ibm-pc terminal programs with 25 lines (mono mode):\
+	:li#25:\
+	:tc=pcansi-mono:
+pcansi-mono33|ansi33|ibm-pc terminal programs with 33 lines (mono mode):\
+	:li#33:\
+	:tc=pcansi-mono:
+pcansi-mono43|ansi43|ibm-pc terminal programs with 43 lines (mono mode):\
+	:li#43:\
+	:tc=pcansi-mono:
+# The color versions.  All PC emulators do color...
+pcansi|ibm-pc terminal programs claiming to be ansi:\
+	:tc=ansi-pc-color:tc=pcansi-mono:
+pcansi-25|ansi25|ibm-pc terminal programs with 25 lines:\
+	:li#25:\
+	:tc=pcansi:
+pcansi-33|ansi33|ibm-pc terminal programs with 33 lines:\
+	:li#33:\
+	:tc=pcansi:
+pcansi-43|ansi43|ibm-pc terminal programs with 43 lines:\
+	:li#43:\
+	:tc=pcansi:
+
+# From: Eric S. Raymond <esr@snark.thyrsus.com> Feb 3 1995
+# ansi-mono -- full X.364 with ANSI.SYS-compatible attributes, no color.
+# Function-key mappings aren't in X3.64 but these are pretty standard.
+# If you want pound signs rather than dollars, replace `B' with `A'
+# in the s?ds capabilities.
+ansi-mono|ANSI X3.64-1979 terminal with ANSI.SYS compatible attributes:\
+	:5i:\
+	:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:F1=\E[W:\
+	:F2=\E[X:IC=\E[%d@:LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:\
+	:SR=\E[%dT:UP=\E[%dA:cb=\E[1K:ch=\E[%dG:ct=\E[2g:\
+	:cv=\E[%dd:ec=\E[%dX:ei=:im=:k1=\E[M:k2=\E[N:k3=\E[O:\
+	:k4=\E[P:k5=\E[Q:k6=\E[R:k7=\E[S:k8=\E[T:k9=\E[U:\
+	:k;=\E[V:kB=\E[Z:kI=\E[L:kb=^H:kd=\E[B:kl=\E[D:\
+	:kr=\E[C:ku=\E[A:me=\E[0;10m:nw=\r\E[S:pf=\E[4i:\
+	:po=\E[5i:..rp=%p1%c\E[%p2%{1}%-%db:s0=\E(B:s1=\E)B:\
+	:s2=\E*B:s3=\E+B:\
+	:..sa=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p8%t;11%;%?%p9%t;12%;m:\
+	:ta=\E[I:tc=pcansi:
+
+# ansi -- this terminfo expresses the largest subset of X3.64 that will fit in
+# standard terminfo.  Assumes ANSI.SYS-compatible attributes and color
+# From: Eric S. Raymond <esr@snark.thyrsus.com> Feb 12 1995
+ansi|ansi/pc-term compatible with color:\
+	:u6=\E[%d;%dR:u7=\E[6n:..u8=\E[?%[;0123456789]c:\
+	:u9=\E[c:tc=ansi-pc-color:tc=ansi-mono:
+
+w32ansi|ansi console window w/function keys under cygwin32:\
+	:li=#50:k1=\E1:k2=\E2:k3=\E3:k4=\E4:\
+	:k5=\E5:k6=\E6:k7=\E7:k8=\E8:k9=\E9:k;=\E0:kI=\E[2~:\
+	:kh=\E[1~:kD=\E[3~:@7=\E[4~:kP=\E[5~:kN=\E[6~:\
+	:K1=\E[1~:K3=\E[5~:K4=\E[4~:K5=\E[6~:st@:ct@:tc=ansi:
+

[-- Attachment #4: terminfo.dif --]
[-- Type: text/x-diff, Size: 603 bytes --]

--- terminfo.src	1997/01/31 18:03:24	1.1
+++ terminfo.src	1997/02/25 15:47:25
@@ -396,7 +395,12 @@
 ansi|ansi/pc-term compatible with color, 
 	u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?%[;0123456789]c, 
 	u9=\E[c, use=klone+color,use=klone+acs,use=klone+sgr,use=ansi-m,
-
+w32ansi|ansi console window using ncurses under cygwin32, 
+	lines#50, kf1=\E1, kf2=\E2, kf3=\E3, 
+	kf4=\E4, kf5=\E5, kf6=\E6, kf7=\E7, kf8=\E8, kf9=\E9, kf10=\E0,
+	khome=\E[1~, kich1=\E[2~, kdch1=\E[3~, kend=\E[4~, kpp=\E[5~, 
+	knp=\E[6~, ka1=\E[1~, ka3=\E[5~, kc1=\E[4~, kc3=\E[6~, 
+	hts@, tbc@, use=ansi,
 #
 # ANSI.SYS entries
 #

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Corrected patch to cygwin.dll + ncurses for termcaps
@ 1997-03-31  6:44 Bruce D. McLeod
  0 siblings, 0 replies; 4+ messages in thread
From: Bruce D. McLeod @ 1997-03-31  6:44 UTC (permalink / raw)
  To: Sergey Okhapkin; +Cc: cygnus

At 02:41 PM 3/29/97 +0300, Sergey Okhapkin wrote:
>Bruce D. McLeod wrote:
>> I compiled and installed cygwin.dll and ncurses with this patch,
>> but I get: Error opening terminal: w32ansi
>> when I run any of the test programs.  It accepts a TERM of ansi,
>> but the screen output is wrong.  Is w32ansi correct, and if so,
>> why might I be getting this error?  Thanks.
>
>Did you reinstall terminfo database after applying this patch? This works
nice for me.

I had alot of terminfo problems.  I was getting "use resolution failed on"
errors for many terminal types.  I know nothing about terminfo, but it
looks like the cross-referencing of the 'use' inclusions is failing.
I think it has something do to with the immedhook stuff in tic.c, but I
didn't get far on that investigation.
   Feeling desparate, I commented out the nc_resolve_uses call in tic.c.
It would then successfully generate the w32asci file in terminfo/W, but
I would get the "Error opening terminal" error.  Stepping through, the
code thinks that file is corrupt.  I hacked around with the terminfo.src
file and found that if I took out the "kdch1=\E[3~" clause, the file was
accepted, but then my screen output is bogus.  The test program worm just
screens by continually.
   Any ideas?  I suspect the "use resolution" error is the root of the
problem.

Bruce

-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Corrected patch to cygwin.dll + ncurses for termcaps
@ 1997-03-29  5:35 Sergey Okhapkin
  0 siblings, 0 replies; 4+ messages in thread
From: Sergey Okhapkin @ 1997-03-29  5:35 UTC (permalink / raw)
  To: 'Bruce D. McLeod'; +Cc: cygnus

Bruce D. McLeod wrote:
> I compiled and installed cygwin.dll and ncurses with this patch,
> but I get: Error opening terminal: w32ansi
> when I run any of the test programs.  It accepts a TERM of ansi,
> but the screen output is wrong.  Is w32ansi correct, and if so,
> why might I be getting this error?  Thanks.

Did you reinstall terminfo database after applying this patch? This works nice for me.

-- 
Sergey Okhapkin
Moscow, Russia
Looking for a job

-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Corrected patch to cygwin.dll + ncurses for termcaps
@ 1997-03-28 13:27 Bruce D. McLeod
  0 siblings, 0 replies; 4+ messages in thread
From: Bruce D. McLeod @ 1997-03-28 13:27 UTC (permalink / raw)
  To: Mikey, Sheik; +Cc: cygnus

I compiled and installed cygwin.dll and ncurses with this patch,
but I get: Error opening terminal: w32ansi
when I run any of the test programs.  It accepts a TERM of ansi,
but the screen output is wrong.  Is w32ansi correct, and if so,
why might I be getting this error?  Thanks.

Bruce

At 01:35 AM 3/5/97 -0700, Mikey wrote:
>Sorry, :^(.  I was playing around trying to get rcs to work, and I guess I
>left the changes at the begining of the files in when I made the diffs. You
>can either just delete the *.rej files, or I have included the corrected
>diffs here.
>
>----------
>> From: Sheik <sheikyy@spartan.pei.edu>
>> To: Mikey <jeffdb@netzone.com>
>> Cc: cygnus <gnu-win32@cygnus.com>
>> Subject: Re: patch to cygwin.dll + ncurses for termcaps
>> Date: Tuesday, March 04, 1997 9:47 PM
>> 
>> 
>> 
>> On Tue, 4 Mar 1997, Mikey wrote:
>> 
>> > Scott
>> > 	I don't recall if I put it in my orig post or not, but all of my
>> > filesystems are mounted -b, so the patches are LF only. When you use
>> > patch.exe the filesystem, file, and patch-file should all be in sync,
>(the
>> > file, and patch-file must be).
>> > 
>>    ug, I don't want to sound dense, but I don't think the patch itself is
>
>> right, at least to the current source... for instance in your patch 
>> called termcaps.dif, here is the cut of the first few lines....
>> 
>> diff -urbBN ../winsup.orig/Makefile.in ./Makefile.in
>> --- ../winsup.orig/Makefile.in  Tue Feb 25 13:02:27 1997
>> +++ ./Makefile.in       Sat Feb 01 18:14:57 1997
>> @@ -1,4 +1,4 @@
>> -# Makefile.in for the winsup directory. #
>> +# Makefile.in for the winsup directory.
>>  # Copyright (c) 1995, 1996 Cygnus Solutions
>> 
>> so I look at the current Makefile.in in the newest source, and here is 
>> the first few lines.....
>> 
>> # Makefile.in for the winsup directory.
>> # Copyright (c) 1995, 1996 Cygnus Solutions
>> 
>> 
>> Notice, the first line DOESN'T have the "#" char at the end of the line.,
>
>> but your patch expects it to be there. The entire patch file you sent 
>> have these probs, so I thought maybe you based the patches on an older 
>> source tarball...
>> 
>> Thanks again,
>> Scott KilauContent-Type: application/octet-stream; name="termcaps.dif"

>Content-Description: termcaps.dif (DIF File)
>Content-Disposition: attachment; filename="termcaps.dif"
>
>Attachment Converted: c:\eudora\attach\termcaps1.dif
>Content-Type: application/octet-stream; name="terminfo.dif"
>Content-Transfer-Encoding: 7bit
>Content-Description: terminfo.dif (DIF File)
>Content-Disposition: attachment; filename="terminfo.dif"
>
>Attachment Converted: c:\eudora\attach\terminfo1.dif
>Content-Type: application/octet-stream; name="bash_less.dif"

>Content-Description: bash_less.dif (DIF File)
>Content-Disposition: attachment; filename="bash_less.dif"
>
>Attachment Converted: c:\eudora\attach\bash_less1.dif
>

-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1997-03-31  6:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-05  0:59 Corrected patch to cygwin.dll + ncurses for termcaps Mikey
1997-03-28 13:27 Bruce D. McLeod
1997-03-29  5:35 Sergey Okhapkin
1997-03-31  6:44 Bruce D. McLeod

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).