version 1.1.1.1, 1999/12/03 07:39:12 |
version 1.3, 2000/02/08 04:47:12 |
|
|
/* $OpenXM: OpenXM/src/asir99/parse/main.c,v 1.2 1999/11/18 05:42:03 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2000/parse/main.c,v 1.2 2000/01/19 02:08:07 noro Exp $ */ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
#if defined(THINK_C) |
#if defined(THINK_C) |
Line 20 extern int mpi_nprocs,mpi_myid; |
|
Line 20 extern int mpi_nprocs,mpi_myid; |
|
#if defined(VISUAL_LIB) |
#if defined(VISUAL_LIB) |
void Main(argc,argv) |
void Main(argc,argv) |
#else |
#else |
void ExitAsir() { |
|
exit(0); |
|
} |
|
|
|
#if defined(VISUAL) |
#if defined(VISUAL) |
void |
void |
#endif |
#endif |
|
|
char *getenv(); |
char *getenv(); |
char *homedir; |
char *homedir; |
char *slash,*binname; |
char *slash,*binname; |
|
char *ptr; |
|
|
StackBottom = &tmp + 1; /* XXX */ |
StackBottom = &tmp + 1; /* XXX */ |
#if MPI |
#if MPI |
|
|
/* never return */ |
/* never return */ |
ox_main(argc,argv); |
ox_main(argc,argv); |
exit(0); |
exit(0); |
|
#if DO_PLOT |
} else if ( !strcmp(binname,"ox_plot") ) { |
} else if ( !strcmp(binname,"ox_plot") ) { |
/* never return */ |
/* never return */ |
ox_plot_main(argc,argv); |
ox_plot_main(argc,argv); |
exit(0); |
exit(0); |
|
#endif |
} else if ( !strcmp(binname,"ox_launch") ) { |
} else if ( !strcmp(binname,"ox_launch") ) { |
/* never return */ |
/* never return */ |
launch_main(argc,argv); |
launch_main(argc,argv); |
|
|
#if defined(UINIT) |
#if defined(UINIT) |
reg_sysf(); |
reg_sysf(); |
#endif |
#endif |
|
|
|
/* if ASIR_CONFIG is set, execute it; else execute .asirrc */ |
|
if ( ptr = getenv("ASIR_CONFIG") ) |
|
strcpy(ifname,ptr); |
|
else { |
#if defined(THINK_C) |
#if defined(THINK_C) |
sprintf(ifname,"asirrc"); |
sprintf(ifname,"asirrc"); |
#else |
#else |
homedir = getenv("HOME"); |
homedir = getenv("HOME"); |
if ( !homedir ) { |
if ( !homedir ) { |
char rootname[BUFSIZ]; |
char rootname[BUFSIZ]; |
|
|
get_rootdir(rootname,sizeof(rootname)); |
get_rootdir(rootname,sizeof(rootname)); |
homedir = rootname; |
homedir = rootname; |
} |
} |
sprintf(ifname,"%s/.asirrc",homedir); |
sprintf(ifname,"%s/.asirrc",homedir); |
#endif |
#endif |
|
} |
|
|
if ( do_asirrc && (ifp = fopen(ifname,"r")) ) { |
if ( do_asirrc && (ifp = fopen(ifname,"r")) ) { |
input_init(ifp,ifname); |
input_init(ifp,ifname); |
if ( !setjmp(env) ) { |
if ( !setjmp(env) ) { |
|
|
} |
} |
fclose(ifp); |
fclose(ifp); |
} |
} |
|
|
if ( do_file ) |
if ( do_file ) |
input_init(in_fp,"stdin"); |
input_init(in_fp,"stdin"); |
else |
else |