summaryrefslogtreecommitdiffstats
path: root/contrib/libf2c/libF77/s_paus.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libf2c/libF77/s_paus.c')
-rw-r--r--contrib/libf2c/libF77/s_paus.c117
1 files changed, 50 insertions, 67 deletions
diff --git a/contrib/libf2c/libF77/s_paus.c b/contrib/libf2c/libF77/s_paus.c
index a7733a5..7969136 100644
--- a/contrib/libf2c/libF77/s_paus.c
+++ b/contrib/libf2c/libF77/s_paus.c
@@ -3,86 +3,69 @@
#define PAUSESIG 15
#include "signal1.h"
-#ifdef KR_headers
-#define Void /* void */
-#define Int /* int */
-#else
-#define Void void
-#define Int int
#undef abs
#undef min
#undef max
#include <stdlib.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern int getpid(void), isatty(int), pause(void);
-#endif
+extern int getpid (void), isatty (int), pause (void);
-extern VOID f_exit(Void);
+extern void f_exit (void);
- static VOID
-waitpause(Sigarg)
-{ Use_Sigarg;
- return;
- }
+static void
+waitpause (Sigarg)
+{
+ Use_Sigarg;
+ return;
+}
- static VOID
-#ifdef KR_headers
-s_1paus(fin) FILE *fin;
-#else
-s_1paus(FILE *fin)
-#endif
+static void
+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");
+ 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();
+ f_exit ();
#endif
- exit(0);
- }
- }
+ exit (0);
+ }
+}
- int
-#ifdef KR_headers
-s_paus(s, n) char *s; ftnlen n;
-#else
-s_paus(char *s, ftnlen n)
-#endif
+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 {
+ 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 */
-#ifdef __cplusplus
+ 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 */
}
OpenPOWER on IntegriCloud