version 1.9, 2002/02/24 10:27:18 |
version 1.11, 2002/11/04 11:08:59 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/stackmachine.c,v 1.8 2001/12/19 23:39:53 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/stackmachine.c,v 1.10 2002/11/04 10:53:56 takayama Exp $ */ |
/* stackmachin.c */ |
/* stackmachin.c */ |
|
|
#include <stdio.h> |
#include <stdio.h> |
Line 816 void scanner() { |
|
Line 816 void scanner() { |
|
fprintf(Fstack,"\nscanner> "); |
fprintf(Fstack,"\nscanner> "); |
} |
} |
KSexecuteString(" ctrlC-hook "); /* Execute User Defined functions. */ |
KSexecuteString(" ctrlC-hook "); /* Execute User Defined functions. */ |
|
KSexecuteString(" (Computation is interrupted.) "); |
continue ; |
continue ; |
} else { } |
} else { } |
if (DebugStack >= 1) { printOperandStack(); } |
if (DebugStack >= 1) { printOperandStack(); } |
|
|
|
|
signal(sig,SIG_IGN); |
signal(sig,SIG_IGN); |
/* see 133p */ |
/* see 133p */ |
|
cancelAlarm(); |
|
if (sig == SIGALRM) { |
|
fprintf(stderr,"ctrlC by SIGALRM\n"); |
|
} |
|
|
if (SGClock) { |
if (SGClock) { |
UserCtrlC = 1; |
UserCtrlC = 1; |
fprintf(stderr,"ctrl-c is locked because of gc.\n"); |
fprintf(stderr,"ctrl-c is locked because of gc.\n"); |
signal(SIGINT,ctrlC); |
signal(sig,ctrlC); if (sig == SIGALRM) alarm((unsigned int)10); |
return; |
return; |
} |
} |
if (OXlock) { |
if (OXlock) { |
|
|
unlockCtrlCForOx(); |
unlockCtrlCForOx(); |
} |
} |
fprintf(stderr,"ctrl-c is locked because of ox lock %d.\n",UserCtrlC); |
fprintf(stderr,"ctrl-c is locked because of ox lock %d.\n",UserCtrlC); |
signal(SIGINT,ctrlC); |
signal(sig,ctrlC); if (sig == SIGALRM) alarm((unsigned int)10); |
return; |
return; |
} |
} |
if (ErrorMessageMode != 1) { |
if (ErrorMessageMode != 1) { |
Line 1004 errorStackmachine(str) |
|
Line 1009 errorStackmachine(str) |
|
char message0[1024]; |
char message0[1024]; |
char *message; |
char *message; |
extern int ErrorMessageMode; |
extern int ErrorMessageMode; |
|
cancelAlarm(); |
if (ErrorMessageMode == 1 || ErrorMessageMode == 2) { |
if (ErrorMessageMode == 1 || ErrorMessageMode == 2) { |
pushErrorStack(KnewErrorPacket(SerialCurrent,-1,str)); |
pushErrorStack(KnewErrorPacket(SerialCurrent,-1,str)); |
} |
} |
Line 1108 KSexecuteString(s) |
|
Line 1114 KSexecuteString(s) |
|
} |
} |
recursive--; |
recursive--; |
if (localCatchCtrlC) { signal(SIGINT, sigfunc); } |
if (localCatchCtrlC) { signal(SIGINT, sigfunc); } |
|
KSexecuteString(" ctrlC-hook "); /* Execute User Defined functions. */ |
|
KSexecuteString(" (Computation is interrupted.) "); |
return(-1); |
return(-1); |
}else{ } |
}else{ } |
}else{ |
}else{ |
Line 1124 KSexecuteString(s) |
|
Line 1132 KSexecuteString(s) |
|
} |
} |
recursive = 0; |
recursive = 0; |
if (localCatchCtrlC) { signal(SIGINT, sigfunc); } |
if (localCatchCtrlC) { signal(SIGINT, sigfunc); } |
|
KSexecuteString(" ctrlC-hook "); /* Execute User Defined functions. */ |
|
KSexecuteString(" (Computation is interrupted.) "); |
return(-1); |
return(-1); |
}else { } |
}else { } |
} |
} |
Line 1470 struct object KSdupErrors() { |
|
Line 1480 struct object KSdupErrors() { |
|
} |
} |
return(rob); |
return(rob); |
} |
} |
|
|
|
void cancelAlarm() { |
|
alarm((unsigned int) 0); |
|
signal(SIGALRM,SIG_DFL); |
|
} |