1991-10-07 16:59:33 +00:00
|
|
|
#include "stdio.h"
|
|
|
|
#include "f2c.h"
|
|
|
|
#define PAUSESIG 15
|
|
|
|
|
1993-11-17 16:38:52 +00:00
|
|
|
static void waitpause()
|
1991-10-07 16:59:33 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID s_paus(s, n)
|
|
|
|
char *s;
|
|
|
|
long int n;
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
fprintf(stderr, "PAUSE ");
|
|
|
|
if(n > 0)
|
|
|
|
for(i = 0; i<n ; ++i)
|
|
|
|
putc(*s++, stderr);
|
|
|
|
fprintf(stderr, " statement executed\n");
|
|
|
|
if( isatty(fileno(stdin)) )
|
|
|
|
{
|
|
|
|
fprintf(stderr, "To resume execution, type go. Any other input will terminate job.\n");
|
|
|
|
fflush(stderr);
|
|
|
|
if( getchar()!='g' || getchar()!='o' || getchar()!='\n' )
|
|
|
|
{
|
|
|
|
fprintf(stderr, "STOP\n");
|
|
|
|
f_exit();
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf(stderr, "To resume execution, execute a kill -%d %d command\n",
|
|
|
|
PAUSESIG, getpid() );
|
|
|
|
signal(PAUSESIG, waitpause);
|
|
|
|
fflush(stderr);
|
|
|
|
pause();
|
|
|
|
}
|
|
|
|
fprintf(stderr, "Execution resumes after PAUSE.\n");
|
|
|
|
}
|