don't use 'cc -f' with compilers that don't do automatic double to
[unix-history] / usr / src / usr.bin / f77 / libF77 / s_paus.c
CommitLineData
936699f8 1/*
a6c6a0df
RE
2 * Copyright (c) 1980 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 *
6 * @(#)s_paus.c 5.1 %G%
936699f8
DW
7 */
8
9#include <stdio.h>
10#define PAUSESIG 15
11
12
13s_paus(s, n)
14char *s;
15long int n;
16{
17int i;
18int waitpause();
19
20fprintf(stderr, "PAUSE: ");
21if(n > 0)
22 {
23 for(i = 0; i<n ; ++i)
24 putc(*s++, stderr);
25 putc('\n', stderr);
26 }
27if( isatty(fileno(stdin)) )
28 {
29 fprintf(stderr, "To resume execution, type: go\nAny other input will terminate the program.\n");
30 if( getchar()!='g' || getchar()!='o' || getchar()!='\n' )
31 {
32 fprintf(stderr, "STOP\n");
33 f_exit();
34 _cleanup();
35 exit(0);
36 }
37 }
38else
39 {
40 fprintf(stderr, "To resume execution, type: kill -%d %d\n",
41 PAUSESIG, getpid() );
42 signal(PAUSESIG, waitpause);
43 pause();
44 }
45fprintf(stderr, "Execution resumed after PAUSE.\n");
46}
47
48
49
50
51
52static waitpause()
53{
54return;
55}