1999-09-18 10:51:31 +00:00
|
|
|
/* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "signal1.h"
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2003-07-11 03:42:19 +00:00
|
|
|
extern void f_exit (void);
|
1999-09-18 10:51:31 +00:00
|
|
|
#ifndef NO_ONEXIT
|
|
|
|
#define ONEXIT atexit
|
2003-07-11 03:42:19 +00:00
|
|
|
extern int atexit (void (*)(void));
|
1999-09-18 10:51:31 +00:00
|
|
|
#endif
|
|
|
|
|
2003-07-11 03:42:19 +00:00
|
|
|
extern void f_init (void);
|
|
|
|
extern int MAIN__ (void);
|
|
|
|
extern void f_setarg (int, char **);
|
|
|
|
extern void f_setsig (void);
|
1999-09-18 10:51:31 +00:00
|
|
|
|
2003-07-11 03:42:19 +00:00
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
1999-09-18 10:51:31 +00:00
|
|
|
{
|
2003-07-11 03:42:19 +00:00
|
|
|
f_setarg (argc, argv);
|
|
|
|
f_setsig ();
|
|
|
|
f_init ();
|
1999-09-18 10:51:31 +00:00
|
|
|
#ifndef NO_ONEXIT
|
2003-07-11 03:42:19 +00:00
|
|
|
ONEXIT (f_exit);
|
1999-09-18 10:51:31 +00:00
|
|
|
#endif
|
2003-07-11 03:42:19 +00:00
|
|
|
MAIN__ ();
|
1999-09-18 10:51:31 +00:00
|
|
|
#ifdef NO_ONEXIT
|
2003-07-11 03:42:19 +00:00
|
|
|
f_exit ();
|
1999-09-18 10:51:31 +00:00
|
|
|
#endif
|
2003-07-11 03:42:19 +00:00
|
|
|
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. */
|
1999-09-18 10:51:31 +00:00
|
|
|
}
|