version 1.1, 1999/12/03 07:39:12 |
version 1.2, 2000/01/19 02:08:07 |
|
|
/* $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.1.1.1 1999/12/03 07:39:12 noro Exp $ */ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
#if defined(THINK_C) |
#if defined(THINK_C) |
|
|
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 |
|
|
#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 |