version 1.27, 2004/06/15 00:56:52 |
version 1.34, 2013/12/19 05:48:24 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/parse/main.c,v 1.26 2004/03/05 02:26:53 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/main.c,v 1.33 2006/09/28 07:43:45 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
Line 61 extern jmp_buf environnement; |
|
Line 61 extern jmp_buf environnement; |
|
|
|
extern JMP_BUF main_env; |
extern JMP_BUF main_env; |
|
|
#if defined(INTERVAL) |
|
#ifndef ASIRRCNAME |
#ifndef ASIRRCNAME |
#define ASIRRCNAME "int_asirrc" |
|
#endif |
|
#else |
|
#ifndef ASIRRCNAME |
|
#define ASIRRCNAME "asirrc" |
#define ASIRRCNAME "asirrc" |
#endif |
#endif |
#endif |
|
|
|
|
|
double get_current_time(); |
double get_current_time(); |
void init_socket(); |
void init_socket(); |
void recover(); |
void recover(); |
|
void set_stacksize(); |
|
|
extern int mpi_nprocs,mpi_myid; |
extern int mpi_nprocs,mpi_myid; |
|
|
Line 91 main(int argc,char *argv[]) |
|
Line 86 main(int argc,char *argv[]) |
|
FILE *ifp; |
FILE *ifp; |
char ifname[BUFSIZ]; |
char ifname[BUFSIZ]; |
extern int GC_dont_gc; |
extern int GC_dont_gc; |
extern int read_exec_file; |
|
extern int do_asirrc; |
extern int do_asirrc; |
extern int do_file; |
extern int do_file; |
extern char *do_filename; |
extern char *do_filename; |
Line 105 main(int argc,char *argv[]) |
|
Line 99 main(int argc,char *argv[]) |
|
char *slash,*bslash,*binname,*p; |
char *slash,*bslash,*binname,*p; |
#endif |
#endif |
|
|
|
set_stacksize(); |
StackBottom = &tmp; |
StackBottom = &tmp; |
GC_init(); |
GC_init(); |
#if defined(MPI) |
#if defined(MPI) |
Line 195 main(int argc,char *argv[]) |
|
Line 190 main(int argc,char *argv[]) |
|
sprintf(ifname,"%s/." ASIRRCNAME,homedir); |
sprintf(ifname,"%s/." ASIRRCNAME,homedir); |
} |
} |
|
|
|
if ( do_file ) { |
|
asir_infile=NULL; |
|
loadasirfile(do_filename); |
|
} else { |
|
/* the bottom of the input stack */ |
|
input_init(stdin,"stdin"); |
|
} |
|
|
if ( do_asirrc && (ifp = fopen(ifname,"r")) ) { |
if ( do_asirrc && (ifp = fopen(ifname,"r")) ) { |
if (!asir_setenv) { |
|
input_init(ifp,ifname); |
|
}else { |
|
asir_infile=NULL; |
|
loadasirfile(ifname); |
|
} |
|
if ( !SETJMP(main_env) ) { |
|
read_exec_file = 1; |
|
read_eval_loop(); |
|
read_exec_file = 0; |
|
} |
|
fclose(ifp); |
fclose(ifp); |
|
if ( !SETJMP(main_env) ) |
|
execasirfile(ifname); |
} |
} |
|
|
if ( do_file ) { |
|
if (!asir_setenv) { |
|
input_init(in_fp,"stdin"); |
|
}else { |
|
asir_infile=NULL; |
|
loadasirfile(do_filename); |
|
} |
|
}else |
|
input_init(stdin,"stdin"); |
|
prompt(); |
prompt(); |
while ( 1 ) { |
while ( 1 ) { |
#if defined(PARI) |
#if defined(PARI) |
Line 233 main(int argc,char *argv[]) |
|
Line 218 main(int argc,char *argv[]) |
|
#endif |
#endif |
if ( SETJMP(main_env) ) |
if ( SETJMP(main_env) ) |
prompt(); |
prompt(); |
|
if ( !do_file ) { |
|
if ( SETJMP(asir_infile->jmpbuf) ) |
|
prompt(); |
|
else |
|
asir_infile->ready_for_longjmp = 1; |
|
} |
restore_handler(); |
restore_handler(); |
read_eval_loop(); |
read_eval_loop(); |
} |
} |
Line 244 main(int argc,char *argv[]) |
|
Line 235 main(int argc,char *argv[]) |
|
void set_error(int code,char *reason,char *action) |
void set_error(int code,char *reason,char *action) |
{} |
{} |
#endif |
#endif |
|
|
|
void set_stacksize() |
|
{ |
|
#if !defined(VISUAL) |
|
struct rlimit rlim; |
|
int c,m; |
|
|
|
getrlimit(RLIMIT_STACK,&rlim); |
|
if ( rlim.rlim_cur < (1<<26) ) { |
|
rlim.rlim_cur = MIN(1<<26,rlim.rlim_max); |
|
setrlimit(RLIMIT_STACK,&rlim); |
|
} |
|
#endif |
|
} |