version 1.35, 2014/05/09 19:35:52 |
version 1.37, 2015/08/06 10:01:53 |
|
|
* 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.34 2013/12/19 05:48:24 saito Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/main.c,v 1.36 2015/08/04 06:20:45 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
|
|
#include <stdlib.h> |
#include <stdlib.h> |
#if defined(VISUAL) |
#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) |
#include <io.h> |
#include <io.h> |
#define R_OK 4 |
#define R_OK 4 |
#else |
#else |
|
|
#include <fcntl.h> |
#include <fcntl.h> |
#endif |
#endif |
|
|
#if defined(PARI) |
|
#include "genpari.h" |
|
|
|
/* XXX : environment is defined in libpari.a */ |
|
# if !(PARI_VERSION_CODE > 131588) |
|
extern jmp_buf environnement; |
|
# endif |
|
#endif |
|
|
|
extern JMP_BUF main_env; |
extern JMP_BUF main_env; |
|
|
#ifndef ASIRRCNAME |
#ifndef ASIRRCNAME |
Line 101 char *find_asirrc() |
|
Line 92 char *find_asirrc() |
|
return name; |
return name; |
} |
} |
} |
} |
#if defined(VISUAL) |
#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) |
env = getenv("HOMEDRIVE"); |
env = getenv("HOMEDRIVE"); |
env2 = getenv("HOMEPATH"); |
env2 = getenv("HOMEPATH"); |
if ( env && env2 ) { |
if ( env && env2 ) { |
Line 129 char *find_asirrc() |
|
Line 120 char *find_asirrc() |
|
#if defined(VISUAL_LIB) |
#if defined(VISUAL_LIB) |
void Main(int argc,char *argv[]) |
void Main(int argc,char *argv[]) |
#else |
#else |
#if defined(VISUAL) |
#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) |
void |
void |
#endif |
#endif |
main(int argc,char *argv[]) |
main(int argc,char *argv[]) |
Line 144 main(int argc,char *argv[]) |
|
Line 135 main(int argc,char *argv[]) |
|
extern int asir_setenv; |
extern int asir_setenv; |
extern FILE *in_fp; |
extern FILE *in_fp; |
extern int *StackBottom; |
extern int *StackBottom; |
#if !defined(VISUAL) |
#if !defined(VISUAL) && !defined(__MINGW32__) && !defined(__MINGW64__) |
char *slash,*bslash,*binname,*p; |
char *slash,*bslash,*binname,*p; |
#endif |
#endif |
|
|
Line 164 main(int argc,char *argv[]) |
|
Line 155 main(int argc,char *argv[]) |
|
exit(0); |
exit(0); |
} else |
} else |
ox_mpi_master_init(); |
ox_mpi_master_init(); |
#elif !defined(VISUAL) |
#elif !defined(VISUAL) && !defined(__MINGW32__) && !defined(__MINGW64__) |
slash = (char *)rindex(argv[0],'/'); |
slash = (char *)rindex(argv[0],'/'); |
bslash = (char *)rindex(argv[0],'\\'); |
bslash = (char *)rindex(argv[0],'\\'); |
if ( slash ) |
if ( slash ) |
Line 200 main(int argc,char *argv[]) |
|
Line 191 main(int argc,char *argv[]) |
|
endian_init(); |
endian_init(); |
cppname_init(); |
cppname_init(); |
process_args(--argc,++argv); |
process_args(--argc,++argv); |
#if defined(PARI) |
|
risa_pari_init(); |
|
#endif |
|
if (!do_quiet) { |
if (!do_quiet) { |
copyright(); |
copyright(); |
} |
} |
Line 218 main(int argc,char *argv[]) |
|
Line 206 main(int argc,char *argv[]) |
|
parif_init(); |
parif_init(); |
order_init(); |
order_init(); |
/* XXX set the default ordering */ |
/* XXX set the default ordering */ |
#if defined(VISUAL) |
#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) |
init_socket(); |
init_socket(); |
#endif |
#endif |
#if defined(UINIT) |
#if defined(UINIT) |
Line 240 main(int argc,char *argv[]) |
|
Line 228 main(int argc,char *argv[]) |
|
|
|
prompt(); |
prompt(); |
while ( 1 ) { |
while ( 1 ) { |
#if defined(PARI) |
|
recover(0); |
|
/* XXX environement is defined in libpari.a */ |
|
# if !(PARI_VERSION_CODE > 131588) |
|
if ( setjmp(environnement) ) { |
|
avma = top; recover(1); |
|
resetenv(""); |
|
} |
|
# endif |
|
#endif |
|
if ( SETJMP(main_env) ) |
if ( SETJMP(main_env) ) |
prompt(); |
prompt(); |
if ( !do_file ) { |
if ( !do_file ) { |
Line 272 void set_error(int code,char *reason,char *action) |
|
Line 250 void set_error(int code,char *reason,char *action) |
|
|
|
void set_stacksize() |
void set_stacksize() |
{ |
{ |
#if !defined(VISUAL) |
#if !defined(VISUAL) && !defined(__MINGW32__) && !defined(__MINGW64__) |
struct rlimit rlim; |
struct rlimit rlim; |
int c,m; |
int c,m; |
|
|