date and time created 83/01/21 11:19:01 by dlw
authorDavid Wasley <dlw@ucbvax.Berkeley.EDU>
Sat, 22 Jan 1983 03:19:01 +0000 (19:19 -0800)
committerDavid Wasley <dlw@ucbvax.Berkeley.EDU>
Sat, 22 Jan 1983 03:19:01 +0000 (19:19 -0800)
SCCS-vsn: usr.bin/f77/libF77/s_paus.c 1.1

usr/src/usr.bin/f77/libF77/s_paus.c [new file with mode: 0644]

diff --git a/usr/src/usr.bin/f77/libF77/s_paus.c b/usr/src/usr.bin/f77/libF77/s_paus.c
new file mode 100644 (file)
index 0000000..c07ab5f
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ *     "@(#)s_paus.c   1.1"
+ */
+
+#include <stdio.h>
+#define PAUSESIG 15
+
+
+s_paus(s, n)
+char *s;
+long int n;
+{
+int i;
+int waitpause();
+
+fprintf(stderr, "PAUSE: ");
+if(n > 0)
+       {
+       for(i = 0; i<n ; ++i)
+               putc(*s++, stderr);
+       putc('\n', stderr);
+       }
+if( isatty(fileno(stdin)) )
+       {
+       fprintf(stderr, "To resume execution, type:   go\nAny other input will terminate the program.\n");
+       if( getchar()!='g' || getchar()!='o' || getchar()!='\n' )
+               {
+               fprintf(stderr, "STOP\n");
+               f_exit();
+               _cleanup();
+               exit(0);
+               }
+       }
+else
+       {
+       fprintf(stderr, "To resume execution, type:    kill -%d %d\n",
+               PAUSESIG, getpid() );
+       signal(PAUSESIG, waitpause);
+       pause();
+       }
+fprintf(stderr, "Execution resumed after PAUSE.\n");
+}
+
+
+
+
+
+static waitpause()
+{
+return;
+}