version 1.95, 2017/02/07 08:30:31 |
version 1.98, 2018/03/27 06:29:19 |
|
|
* 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/glob.c,v 1.94 2016/08/26 04:51:34 ohara Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/glob.c,v 1.97 2017/08/30 09:40:30 ohara Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "al.h" |
#include "al.h" |
Line 123 struct oVL oVLIST[52]; |
|
Line 123 struct oVL oVLIST[52]; |
|
|
|
VL CO = oVLIST; |
VL CO = oVLIST; |
VL ALG; |
VL ALG; |
|
VL LASTCO; |
|
|
struct oVS oGPVS,oAPVS,oEPVS,oPPVS; |
struct oVS oGPVS,oAPVS,oEPVS,oPPVS; |
VS GPVS = &oGPVS; |
VS GPVS = &oGPVS; |
Line 162 void glob_init() { |
|
Line 163 void glob_init() { |
|
VR(&oVLIST[i]) = &oVAR[i]; NEXT(&oVLIST[i]) = &oVLIST[i+1]; |
VR(&oVLIST[i]) = &oVAR[i]; NEXT(&oVLIST[i]) = &oVLIST[i+1]; |
} |
} |
VR(&oVLIST[i]) = &oVAR[i]; NEXT(&oVLIST[i]) = 0; |
VR(&oVLIST[i]) = &oVAR[i]; NEXT(&oVLIST[i]) = 0; |
|
LASTCO = &oVLIST[i]; |
asir_reallocarray((char **)&GPVS->va,(int *)&GPVS->asize,(int *)&GPVS->n,(int)sizeof(struct oPV)); |
asir_reallocarray((char **)&GPVS->va,(int *)&GPVS->asize,(int *)&GPVS->n,(int)sizeof(struct oPV)); |
asir_reallocarray((char **)&APVS->va,(int *)&APVS->asize,(int *)&APVS->n,(int)sizeof(struct oPV)); |
asir_reallocarray((char **)&APVS->va,(int *)&APVS->asize,(int *)&APVS->n,(int)sizeof(struct oPV)); |
asir_reallocarray((char **)&PPVS->va,(int *)&PPVS->asize,(int *)&PPVS->n,(int)sizeof(struct oPV)); |
asir_reallocarray((char **)&PPVS->va,(int *)&PPVS->asize,(int *)&PPVS->n,(int)sizeof(struct oPV)); |
Line 190 void notdef(VL vl,Obj a,Obj b,Obj *c) |
|
Line 192 void notdef(VL vl,Obj a,Obj b,Obj *c) |
|
error("undefined arithmetic operation."); |
error("undefined arithmetic operation."); |
} |
} |
|
|
|
int disable_debugger; |
int do_asirrc; |
int do_asirrc; |
int do_file; |
int do_file; |
char *do_filename; |
char *do_filename; |
Line 354 void process_args(int ac,char **av) |
|
Line 357 void process_args(int ac,char **av) |
|
#if !defined(MPI) |
#if !defined(MPI) |
do_message = 1; |
do_message = 1; |
#endif |
#endif |
|
#if defined(VISUAL) && defined(VISUAL_CONSOLE) |
|
disable_debugger=1; |
|
#endif |
do_quiet = 0; |
do_quiet = 0; |
while ( ac > 0 ) { |
while ( ac > 0 ) { |
if ( !strcmp(*av,"-heap") && (ac >= 2) ) { |
if ( !strcmp(*av,"-heap") && (ac >= 2) ) { |
Line 374 void process_args(int ac,char **av) |
|
Line 380 void process_args(int ac,char **av) |
|
av += 2; ac -= 2; |
av += 2; ac -= 2; |
} else if ( !strcmp(*av,"-cpp") && (ac >= 2) ) { |
} else if ( !strcmp(*av,"-cpp") && (ac >= 2) ) { |
strcpy(cppname,*(av+1)); av += 2; ac -= 2; |
strcpy(cppname,*(av+1)); av += 2; ac -= 2; |
|
} else if ( !strcmp(*av,"-d") && (ac >= 2) ) { |
|
#if defined(VISUAL) && defined(VISUAL_CONSOLE) |
|
disable_debugger=0; |
|
#endif |
|
av += 2; ac -= 2; |
} else if ( !strcmp(*av,"-f") && (ac >= 2) ) { |
} else if ( !strcmp(*av,"-f") && (ac >= 2) ) { |
do_quiet = 1; |
do_quiet = 1; |
in_fp = fopen(*(av+1),"r"); |
in_fp = fopen(*(av+1),"r"); |
Line 533 void int_handler(int sig) |
|
Line 544 void int_handler(int sig) |
|
extern NODE PVSS; |
extern NODE PVSS; |
NODE t; |
NODE t; |
|
|
|
if ( do_file || disable_debugger ) { |
if ( do_file ) { |
LEAVE_SIGNAL_CS_ALL; |
ExitAsir(); |
ExitAsir(); |
} |
} |
if ( !ox_get_pari_result && critical_when_signal ) { |
if ( !ox_get_pari_result && critical_when_signal ) { |
Line 629 void int_handler(int sig) |
|
Line 640 void int_handler(int sig) |
|
} |
} |
} |
} |
} |
} |
|
LEAVE_SIGNAL_CS_ALL; |
resetenv("return to toplevel"); |
resetenv("return to toplevel"); |
break; |
break; |
case 'd': |
case 'd': |
Line 885 char *scopyright() |
|
Line 897 char *scopyright() |
|
|
|
#if defined(VISUAL) || defined(__MINGW32__) |
#if defined(VISUAL) || defined(__MINGW32__) |
int recv_intr; |
int recv_intr; |
|
|
|
static CRITICAL_SECTION signal_cs; |
|
static int initialized_signal_cs; |
|
static int signal_cs_count; |
|
|
|
static void init_signal_cs() |
|
{ |
|
if (!initialized_signal_cs) { |
|
InitializeCriticalSection(&signal_cs); |
|
initialized_signal_cs=1; |
|
signal_cs_count=0; |
|
} |
|
} |
|
|
|
void try_enter_signal_cs() |
|
{ |
|
init_signal_cs(); |
|
if(TryEnterCriticalSection(&signal_cs)) { |
|
signal_cs_count++; |
|
} |
|
} |
|
|
|
void enter_signal_cs() |
|
{ |
|
init_signal_cs(); |
|
EnterCriticalSection(&signal_cs); |
|
signal_cs_count++; |
|
} |
|
|
|
void leave_signal_cs() |
|
{ |
|
init_signal_cs(); |
|
if(signal_cs_count>0) { |
|
LeaveCriticalSection(&signal_cs); |
|
signal_cs_count--; |
|
} |
|
} |
|
|
|
void leave_signal_cs_all() |
|
{ |
|
if (!initialized_signal_cs) { |
|
init_signal_cs(); |
|
} |
|
while(signal_cs_count>0) { |
|
LeaveCriticalSection(&signal_cs); |
|
signal_cs_count--; |
|
} |
|
} |
|
|
void check_intr() |
void check_intr() |
{ |
{ |
extern int recv_intr; |
extern int recv_intr; |
|
enter_signal_cs(); |
if ( recv_intr ) { |
if ( recv_intr ) { |
if ( recv_intr == 1 ) { |
if ( recv_intr == 1 ) { |
recv_intr = 0; |
recv_intr = 0; |
Line 897 void check_intr() |
|
Line 959 void check_intr() |
|
ox_usr1_handler(0); |
ox_usr1_handler(0); |
} |
} |
} |
} |
|
leave_signal_cs_all(); |
} |
} |
#endif |
#endif |