1998-02-01 02:37:08 +01:00
|
|
|
/* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "signal1.h"
|
|
|
|
|
|
|
|
#ifndef KR_headers
|
|
|
|
#undef VOID
|
|
|
|
#include <stdlib.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef VOID
|
|
|
|
#define VOID void
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef NO__STDC
|
|
|
|
#define ONEXIT onexit
|
|
|
|
extern VOID f_exit();
|
|
|
|
#else
|
|
|
|
#ifndef KR_headers
|
|
|
|
extern void f_exit(void);
|
|
|
|
#ifndef NO_ONEXIT
|
|
|
|
#define ONEXIT atexit
|
|
|
|
extern int atexit(void (*)(void));
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#ifndef NO_ONEXIT
|
|
|
|
#define ONEXIT onexit
|
|
|
|
extern VOID f_exit();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef KR_headers
|
1998-05-22 12:32:18 +02:00
|
|
|
extern VOID f_init();
|
1998-02-01 02:37:08 +01:00
|
|
|
extern int MAIN__();
|
|
|
|
#else
|
1998-05-22 12:32:18 +02:00
|
|
|
extern void f_init(void);
|
1998-02-01 02:37:08 +01:00
|
|
|
extern int MAIN__(void);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef KR_headers
|
|
|
|
main(argc, argv) int argc; char **argv;
|
|
|
|
#else
|
|
|
|
main(int argc, char **argv)
|
|
|
|
#endif
|
|
|
|
{
|
1998-05-22 12:32:18 +02:00
|
|
|
f_setarg(argc, argv);
|
|
|
|
f_setsig();
|
1998-02-01 02:37:08 +01:00
|
|
|
f_init();
|
|
|
|
#ifndef NO_ONEXIT
|
|
|
|
ONEXIT(f_exit);
|
|
|
|
#endif
|
|
|
|
MAIN__();
|
|
|
|
#ifdef NO_ONEXIT
|
|
|
|
f_exit();
|
|
|
|
#endif
|
|
|
|
exit(0); /* exit(0) rather than return(0) to bypass Cray bug */
|
|
|
|
return 0; /* For compilers that complain of missing return values; */
|
|
|
|
/* others will complain that this is unreachable code. */
|
|
|
|
}
|