1998-02-01 09:37:08 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include "f2c.h"
|
|
|
|
#define PAUSESIG 15
|
|
|
|
|
1998-05-19 18:52:03 +08:00
|
|
|
#include "signal1.h"
|
1998-02-01 09:37:08 +08:00
|
|
|
#undef abs
|
|
|
|
#undef min
|
|
|
|
#undef max
|
|
|
|
#include <stdlib.h>
|
|
|
|
extern int getpid(void), isatty(int), pause(void);
|
|
|
|
|
g2c.hin, [...]: Kill VOID, Void and Int.
* g2c.hin, libF77/d_cnjg.c, libF77/main.c, libF77/r_cnjg.c,
libF77/s_cat.c, libF77/s_paus.c, libF77/s_rnge.c, libF77/setarg.c,
libF77/setsig.c, libF77/signal1.h0, libI77/dfe.c, libI77/due.c,
libI77/err.c, libI77/fio.h, libI77/fmt.c, libI77/iio.c,
libI77/ilnw.c, libI77/lread.c, libI77/lwrite.c, libI77/rsfe.c,
libI77/rsli.c, libI77/rsne.c, libI77/sfe.c, libI77/sue.c,
libI77/util.c, libI77/wrtfmt.c, libI77/wsfe.c, libI77/wsle.c,
libI77/xwsne.c, libU77/date_.c: Kill VOID, Void and Int.
From-SVN: r54134
2002-06-01 09:58:10 +08:00
|
|
|
extern void f_exit(void);
|
1998-02-01 09:37:08 +08:00
|
|
|
|
g2c.hin, [...]: Kill VOID, Void and Int.
* g2c.hin, libF77/d_cnjg.c, libF77/main.c, libF77/r_cnjg.c,
libF77/s_cat.c, libF77/s_paus.c, libF77/s_rnge.c, libF77/setarg.c,
libF77/setsig.c, libF77/signal1.h0, libI77/dfe.c, libI77/due.c,
libI77/err.c, libI77/fio.h, libI77/fmt.c, libI77/iio.c,
libI77/ilnw.c, libI77/lread.c, libI77/lwrite.c, libI77/rsfe.c,
libI77/rsli.c, libI77/rsne.c, libI77/sfe.c, libI77/sue.c,
libI77/util.c, libI77/wrtfmt.c, libI77/wsfe.c, libI77/wsle.c,
libI77/xwsne.c, libU77/date_.c: Kill VOID, Void and Int.
From-SVN: r54134
2002-06-01 09:58:10 +08:00
|
|
|
static void
|
1998-05-19 18:52:03 +08:00
|
|
|
waitpause(Sigarg)
|
|
|
|
{ Use_Sigarg;
|
1998-02-01 09:37:08 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
g2c.hin, [...]: Kill VOID, Void and Int.
* g2c.hin, libF77/d_cnjg.c, libF77/main.c, libF77/r_cnjg.c,
libF77/s_cat.c, libF77/s_paus.c, libF77/s_rnge.c, libF77/setarg.c,
libF77/setsig.c, libF77/signal1.h0, libI77/dfe.c, libI77/due.c,
libI77/err.c, libI77/fio.h, libI77/fmt.c, libI77/iio.c,
libI77/ilnw.c, libI77/lread.c, libI77/lwrite.c, libI77/rsfe.c,
libI77/rsli.c, libI77/rsne.c, libI77/sfe.c, libI77/sue.c,
libI77/util.c, libI77/wrtfmt.c, libI77/wsfe.c, libI77/wsle.c,
libI77/xwsne.c, libU77/date_.c: Kill VOID, Void and Int.
From-SVN: r54134
2002-06-01 09:58:10 +08:00
|
|
|
static void
|
1998-02-01 09:37:08 +08:00
|
|
|
s_1paus(FILE *fin)
|
|
|
|
{
|
|
|
|
fprintf(stderr,
|
|
|
|
"To resume execution, type go. Other input will terminate the job.\n");
|
|
|
|
fflush(stderr);
|
|
|
|
if( getc(fin)!='g' || getc(fin)!='o' || getc(fin)!='\n' ) {
|
|
|
|
fprintf(stderr, "STOP\n");
|
|
|
|
#ifdef NO_ONEXIT
|
|
|
|
f_exit();
|
|
|
|
#endif
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
s_paus(char *s, ftnlen n)
|
|
|
|
{
|
|
|
|
fprintf(stderr, "PAUSE ");
|
|
|
|
if(n > 0)
|
|
|
|
fprintf(stderr, " %.*s", (int)n, s);
|
|
|
|
fprintf(stderr, " statement executed\n");
|
|
|
|
if( isatty(fileno(stdin)) )
|
|
|
|
s_1paus(stdin);
|
|
|
|
else {
|
|
|
|
#if (defined (MSDOS) && !defined (GO32)) || defined (_WIN32)
|
|
|
|
FILE *fin;
|
|
|
|
fin = fopen("con", "r");
|
|
|
|
if (!fin) {
|
|
|
|
fprintf(stderr, "s_paus: can't open con!\n");
|
|
|
|
fflush(stderr);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
s_1paus(fin);
|
|
|
|
fclose(fin);
|
|
|
|
#else
|
|
|
|
fprintf(stderr,
|
|
|
|
"To resume execution, execute a kill -%d %d command\n",
|
|
|
|
PAUSESIG, getpid() );
|
|
|
|
signal1(PAUSESIG, waitpause);
|
|
|
|
fflush(stderr);
|
|
|
|
pause();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
fprintf(stderr, "Execution resumes after PAUSE.\n");
|
|
|
|
fflush(stderr);
|
|
|
|
return 0; /* NOT REACHED */
|
|
|
|
}
|