diff options
| author | svn2git <svn2git@FreeBSD.org> | 1994-05-01 08:00:00 +0000 |
|---|---|---|
| committer | svn2git <svn2git@FreeBSD.org> | 1994-05-01 08:00:00 +0000 |
| commit | a16f65c7d117419bd266c28a1901ef129a337569 (patch) | |
| tree | 2626602f66dc3551e7a7c7bc9ad763c3bc7ab40a /lib/libF77/s_paus.c | |
| parent | 8503f4f13f77abf7adc8f7e329c6f9c1d52b6a20 (diff) | |
Release FreeBSD 1.1upstream/1.1.0_cvsrelease/1.1.0_cvs
This commit was manufactured to restore the state of the 1.1-RELEASE image.
Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
Diffstat (limited to 'lib/libF77/s_paus.c')
| -rw-r--r-- | lib/libF77/s_paus.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/lib/libF77/s_paus.c b/lib/libF77/s_paus.c new file mode 100644 index 000000000000..35107d880734 --- /dev/null +++ b/lib/libF77/s_paus.c @@ -0,0 +1,64 @@ +#include "stdio.h" +#include "f2c.h" +#define PAUSESIG 15 + +#ifdef KR_headers +#define Void /* void */ +#define Int /* int */ +#else +#define Void void +#define Int int +#undef abs +#include "stdlib.h" +#include "signal.h" +#ifdef __cplusplus +extern "C" { +#endif +extern int getpid(void), isatty(int), pause(void); +#endif + +extern VOID f_exit(Void); + +static VOID waitpause(Int n) +{ +return; +} + +#ifdef KR_headers +int s_paus(s, n) char *s; ftnlen n; +#else +int s_paus(char *s, ftnlen n) +#endif +{ +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"); +#ifdef __cplusplus +return 0; /* NOT REACHED */ +} +#endif +} |
