1/* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */
2
3#include <stdio.h>
4#include "signal1.h"
5
6#ifndef KR_headers
7#undef VOID
8#include <stdlib.h>
9#endif
10
11#ifndef VOID
12#define VOID void
13#endif
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19#ifdef NO__STDC
20#define ONEXIT onexit
21extern VOID f_exit();
22#else
23#ifndef KR_headers
24extern void f_exit(void);
25#ifndef NO_ONEXIT
26#define ONEXIT atexit
27extern int atexit(void (*)(void));
28#endif
29#else
30#ifndef NO_ONEXIT
31#define ONEXIT onexit
32extern VOID f_exit();
33#endif
34#endif
35#endif
36
37#ifdef KR_headers
38extern VOID f_init();
39extern int MAIN__();
40#else
41extern void f_init(void);
42extern int MAIN__(void);
43#endif
44
45#ifdef __cplusplus
46	}
47#endif
48
49#ifdef KR_headers
50main(argc, argv) int argc; char **argv;
51#else
52main(int argc, char **argv)
53#endif
54{
55f_setarg(argc, argv);
56f_setsig();
57f_init();
58#ifndef NO_ONEXIT
59ONEXIT(f_exit);
60#endif
61MAIN__();
62#ifdef NO_ONEXIT
63f_exit();
64#endif
65exit(0);	/* exit(0) rather than return(0) to bypass Cray bug */
66return 0;	/* For compilers that complain of missing return values; */
67		/* others will complain that this is unreachable code. */
68}
69