Apropos ISPELL-a.

Martin Dalecki dalecki w cs.net.pl
Czw, 6 Sty 2000, 08:14:58 CET


Czytałem ostatnio, źe przejęliście dysponencję nad projektem ispell...
Otóź mam taką sobie małą łatkę, dodającą w pierwszej kolejności
wyświetlanie bierzącego wiersza do okienka pracy tegoź programu.

Było by równieź cacy jeśli by ktoś udostępnił tar-a aktualnej wersji
via FTP.

--
	Marcin Dalecki
-------------- następna część ---------
diff -ur ispell-3.1/correct.c /root/src/ispell-3.1.20-my/correct.c
--- ispell-3.1/correct.c	Thu Oct 12 20:04:06 1995
+++ /root/src/ispell-3.1.20-my/correct.c	Fri May 21 20:52:51 1999
@@ -169,6 +169,16 @@
 static void	regex_dict_lookup P ((char * cmd, char * grepstr));
 #endif /* REGEX_LOOKUP */
 
+/*
+ * Track in which line position we are currentl.
+ * This helps much at keeping some kind of sense how much is
+ * still left to be done.
+ * FIXME: Normally we would need to initialize the variable at open time!
+ *
+ * --mdcki.
+ */
+static int current_lineno = 0;
+
 void givehelp (interactive)
     int		    interactive;	/* NZ for interactive-mode help */
     {
@@ -277,6 +287,7 @@
 		contextbufs[0][bufsize] = '\0';
 		}
 	    }
+	++current_lineno;
 	checkline (outfile);
 	}
     }
@@ -305,13 +316,17 @@
 	return;
 
     erase ();
-    (void) printf ("    %s", ctok);
+    inverse();
+    (void) printf(" %d", current_lineno);
     if (currentfile)
 	(void) printf (CORR_C_FILE_LABEL, currentfile);
     if (readonly)
 	(void) printf (" %s", CORR_C_READONLY);
+    normal();
+    (void) printf (" %s", ctok);
     (void) printf ("\r\n\r\n");
 
+
     makepossibilities (itok);
 
     /*
@@ -379,7 +394,44 @@
     if (minimenusize != 0)
 	{
 	move (li - 2, 0);
-	(void) printf (CORR_C_MINI_MENU);
+	inverse();
+	printf("[SP]");
+	normal();
+	printf(" <number> ");
+	inverse();
+	putchar('R');
+	normal();
+	printf("epl ");
+	inverse();
+	putchar('A');
+	normal();
+	printf("ccept ");
+	inverse();
+	putchar('I');
+	normal();
+	printf("nsert ");
+	inverse();
+	putchar('L');
+	normal();
+	printf("ookup ");
+	inverse();
+	putchar('U');
+	normal();
+	printf("ncap ");
+	inverse();
+	putchar('Q');
+	normal();
+	printf("uit e");
+	inverse();
+	putchar('X');
+	normal();
+	printf("it or ");
+	inverse();
+	putchar('?');
+	normal();
+	printf(" for help");
+
+//	(void) printf (CORR_C_MINI_MENU);
 	}
 
     for (  ;  ;  )
diff -ur ispell-3.1/ijoin.c /root/src/ispell-3.1.20-my/ijoin.c
--- ispell-3.1/ijoin.c	Wed Nov  2 19:44:21 1994
+++ /root/src/ispell-3.1.20-my/ijoin.c	Fri May 21 18:41:34 1999
@@ -133,7 +133,9 @@
 static int		unpairable1 = 0; /* NZ if -a1 */
 static int		unpairable2 = 0; /* NZ if -a2 */
 
+#ifndef __linux__
 extern int	strcmp ();
+#endif
 
 int main (argc, argv)			/* Join files */
     int			argc;		/* Argument count */
diff -ur ispell-3.1/term.c /root/src/ispell-3.1.20-my/term.c
--- ispell-3.1/term.c	Wed Nov  2 19:44:28 1994
+++ /root/src/ispell-3.1.20-my/term.c	Sun May 23 17:34:38 1999
@@ -65,7 +65,8 @@
 #include "proto.h"
 #include "msgs.h"
 #ifdef USG
-#include <termio.h>
+#include <unistd.h>
+#include <termios.h>
 #else
 #include <sgtty.h>
 #endif
@@ -136,8 +137,8 @@
     }
 
 #ifdef USG
-static struct termio	sbuf;
-static struct termio	osbuf;
+static struct termios	sbuf;
+static struct termios	osbuf;
 #else
 static struct sgttyb	sbuf;
 static struct sgttyb	osbuf;
@@ -247,7 +248,7 @@
 	(void) fprintf (stderr, TERM_C_NO_BATCH);
 	exit (1);
 	}
-    (void) ioctl (0, TCGETA, (char *) &osbuf);
+    tcgetattr(STDIN_FILENO, &osbuf);
     termchanged = 1;
 
     sbuf = osbuf;
@@ -256,7 +257,7 @@
     sbuf.c_iflag &= ~(INLCR | IGNCR | ICRNL);
     sbuf.c_cc[VMIN] = 1;
     sbuf.c_cc[VTIME] = 1;
-    (void) ioctl (0, TCSETAW, (char *) &sbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &sbuf);
 
     uerasechar = osbuf.c_cc[VERASE];
     ukillchar = osbuf.c_cc[VKILL];
@@ -344,7 +345,7 @@
 	if (te)
 	    tputs (te, 1, putch);
 #ifdef USG
-	(void) ioctl (0, TCSETAW, (char *) &osbuf);
+	tcsetattr(STDIN_FILENO, TCSANOW, &osbuf);
 #else
 	(void) ioctl (0, TIOCSETP, (char *) &osbuf);
 #ifdef TIOCSLTC
@@ -360,7 +361,7 @@
     int		signo;
     {
 #ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &osbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &osbuf);
 #else
     (void) ioctl (0, TIOCSETP, (char *) &osbuf);
 #ifdef TIOCSLTC
@@ -375,7 +376,7 @@
     /* stop here until continued */
     (void) signal (signo, onstop);
 #ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &sbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &sbuf);
 #else
     (void) ioctl (0, TIOCSETP, (char *) &sbuf);
 #ifdef TIOCSLTC
@@ -435,7 +436,7 @@
     argv[i] = NULL;
 
 #ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &osbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &osbuf);
 #else
     (void) ioctl (0, TIOCSETP, (char *) &osbuf);
 #ifdef TIOCSLTC
@@ -481,7 +482,7 @@
 #endif
 
 #ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &sbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &sbuf);
 #else
     (void) ioctl (0, TIOCSETP, (char *) &sbuf);
 #ifdef TIOCSLTC
@@ -514,7 +515,7 @@
 #endif
 
 #ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &osbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &osbuf);
 #else
     (void) ioctl (0, TIOCSETP, (char *) &osbuf);
 #ifdef TIOCSLTC
@@ -546,7 +547,7 @@
 #endif
 
 #ifdef USG
-    (void) ioctl (0, TCSETAW, (char *) &sbuf);
+    tcsetattr(STDIN_FILENO, TCSANOW, &sbuf);
 #else
     (void) ioctl (0, TIOCSETP, (char *) &sbuf);
 #ifdef TIOCSLTC


Więcej informacji o liście dyskusyjnej pld-devel-pl