Pristine Ack-5.5
[Ack-5.5.git] / lang / fortran / lib / libF77 / s_paus.c
1 #include "stdio.h"
2 #include "f2c.h"
3 #define PAUSESIG 15
4
5 static void waitpause()
6 {
7 return;
8 }
9
10 VOID s_paus(s, n)
11 char *s;
12 long int n;
13 {
14 int i;
15
16 fprintf(stderr, "PAUSE ");
17 if(n > 0)
18         for(i = 0; i<n ; ++i)
19                 putc(*s++, stderr);
20 fprintf(stderr, " statement executed\n");
21 if( isatty(fileno(stdin)) )
22         {
23         fprintf(stderr, "To resume execution, type go.  Any other input will terminate job.\n");
24         fflush(stderr);
25         if( getchar()!='g' || getchar()!='o' || getchar()!='\n' )
26                 {
27                 fprintf(stderr, "STOP\n");
28                 f_exit();
29                 exit(0);
30                 }
31         }
32 else
33         {
34         fprintf(stderr, "To resume execution, execute a   kill -%d %d   command\n",
35                 PAUSESIG, getpid() );
36         signal(PAUSESIG, waitpause);
37         fflush(stderr);
38         pause();
39         }
40 fprintf(stderr, "Execution resumes after PAUSE.\n");
41 }