=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/ox_asir.c,v retrieving revision 1.68 retrieving revision 1.73 diff -u -p -r1.68 -r1.73 --- OpenXM_contrib2/asir2000/io/ox_asir.c 2010/12/12 07:38:00 1.68 +++ OpenXM_contrib2/asir2000/io/ox_asir.c 2015/08/04 06:20:45 1.73 @@ -44,24 +44,24 @@ * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. - * $OpenXM: OpenXM_contrib2/asir2000/io/ox_asir.c,v 1.67 2010/04/23 04:44:52 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/io/ox_asir.c,v 1.72 2014/05/09 19:35:51 ohara Exp $ */ #include "ca.h" #include "parse.h" #include "signal.h" #include "ox.h" #include "version.h" -#if defined(PARI) -#include "genpari.h" -#endif +char *find_asirrc(); void ox_usr1_handler(); int asir_ox_init(); /* environement is defined in libpari.a */ +#if 0 # if !( PARI_VERSION_CODE > 131588) extern jmp_buf environnement; # endif +#endif extern int myrank_102,nserver_102; extern int do_message; @@ -646,7 +646,7 @@ void asir_pops() void asir_setName(unsigned int serial) { char *name; - int l,n; + size_t l,n; char *dummy = "=0;"; SNODE snode; ERR err; @@ -668,7 +668,7 @@ void asir_setName(unsigned int serial) void asir_evalName(unsigned int serial) { char *name; - int l,n; + size_t l,n; SNODE snode; ERR err; pointer val; @@ -705,6 +705,7 @@ int asir_executeString() SNODE snode; pointer val; char *cmd; +#if 0 #if defined(PARI) recover(0); /* environement is defined in libpari.a */ @@ -715,6 +716,7 @@ int asir_executeString() } # endif #endif +#endif cmd = ((STRING)asir_pop_one())->body; /* XXX : probably this is useless */ #if 0 @@ -793,11 +795,7 @@ static void asir_executeFunction(int serial) #endif searchf(noargsysf,func,&f); if ( !f ) - searchf(sysf,func,&f); - if ( !f ) - searchf(ubinf,func,&f); - if ( !f ) - searchf(usrf,func,&f); + gen_searchf_searchonly(func,&f); if ( !f ) { sprintf(buf,"executeFunction : the function %s not found",func); goto error; @@ -871,11 +869,7 @@ static void asir_executeFunctionSync(int serial) #endif searchf(noargsysf,func,&f); if ( !f ) - searchf(sysf,func,&f); - if ( !f ) - searchf(ubinf,func,&f); - if ( !f ) - searchf(usrf,func,&f); + gen_searchf_searchonly(func,&f); if ( !f ) { sprintf(buf,"executeFunction : the function %s not found",func); goto error; @@ -947,16 +941,12 @@ Obj asir_peek_one() { void ox_asir_init(int argc,char **argv,char *servername) { - char ifname[BUFSIZ]; + char *ifname; extern int GC_dont_gc; extern int do_asirrc; extern int do_server_in_X11; extern char displayname[]; - char *getenv(); static ox_asir_initialized = 0; - FILE *ifp; - char *homedir; - char *ptr; int do_server_sav; #if !defined(VISUAL) int tmp; @@ -967,9 +957,11 @@ void ox_asir_init(int argc,char **argv,char *servernam do_server_in_X11 = 1; /* XXX */ #endif asir_save_handler(); +#if 0 #if defined(PARI) risa_pari_init(); #endif +#endif srandom((int)get_current_time()); rtime_init(); @@ -998,25 +990,10 @@ void ox_asir_init(int argc,char **argv,char *servernam #if defined(UINIT) reg_sysf(); #endif -/* if ASIR_CONFIG is set, execute it; else execute .asirrc */ - if ( ptr = getenv("ASIR_CONFIG") ) - strcpy(ifname,ptr); - else { - homedir = getenv("HOME"); - if ( !homedir ) { - char rootname[BUFSIZ]; - - get_rootdir(rootname,sizeof(rootname)); - homedir = rootname; - } - sprintf(ifname,"%s/.asirrc",homedir); - } - /* the bottom of the input stack */ input_init(0,"string"); - if ( do_asirrc && (ifp = fopen(ifname,"r")) ) { - fclose(ifp); + if ( do_asirrc && (ifname = find_asirrc()) ) { do_server_sav = do_server_in_X11; do_server_in_X11 = 0; if ( !SETJMP(main_env) ) @@ -1246,22 +1223,22 @@ int asir_ox_peek_cmo_string_length() int asir_ox_init(int byteorder) { int tmp; - char ifname[BUFSIZ]; + char *ifname; extern int GC_dont_gc; extern int do_asirrc; extern int do_server_in_X11; - char *getenv(); static ox_asir_initialized = 0; - FILE *ifp; GC_init(); #if !defined(VISUAL) && !defined(MPI) do_server_in_X11 = 0; /* XXX */ #endif asir_save_handler(); +#if 0 #if defined(PARI) risa_pari_init(); #endif +#endif srandom((int)get_current_time()); rtime_init(); @@ -1285,9 +1262,7 @@ int asir_ox_init(int byteorder) reg_sysf(); #endif input_init(0,"string"); - sprintf(ifname,"%s/.asirrc",getenv("HOME")); - if ( do_asirrc && (ifp = fopen(ifname,"r")) ) { - fclose(ifp); + if ( do_asirrc && (ifname = find_asirrc()) ) { if ( !SETJMP(main_env) ) execasirfile(ifname); }