=================================================================== RCS file: /home/cvs/OpenXM/src/k097/ki.c,v retrieving revision 1.9 retrieving revision 1.12 diff -u -p -r1.9 -r1.12 --- OpenXM/src/k097/ki.c 2015/10/10 11:29:46 1.9 +++ OpenXM/src/k097/ki.c 2020/10/07 23:53:25 1.12 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/k097/ki.c,v 1.8 2013/11/06 06:23:23 takayama Exp $ */ +/* $OpenXM: OpenXM/src/k097/ki.c,v 1.11 2016/03/31 06:34:29 takayama Exp $ */ /* ki.c ( kx interpreter ) */ #include @@ -13,7 +13,10 @@ #include #include #include +#include "mysig.h" +#include "ki.h" + char *getLOAD_K_PATH(); /* from d.h */ #if defined(__CYGWIN__) @@ -41,34 +44,35 @@ int K00_verbose = 0; extern int DebugMode; -sendKan(int p) { +int sendKan(int p) { static int n = 2; extern int Interactive; struct object obj = OINIT; int result; extern int InSendmsg2; - signal(SIGINT,SIG_IGN); /* Don't jump to ctrlC(). */ + result=0; + mysignal(SIGINT,SIG_IGN); /* Don't jump to ctrlC(). */ if (p == 10) {printf("In(%d)= ",n++); return 0;} if (p == 0 && DebugCompiler) printf("sendKan[%s]\n",Kbuff); /* printf("sendKan[%s]\n",Kbuff); */ if (strlen(Kbuff) != 0) { - signal(SIGINT,SIG_DFL); + mysignal(SIGINT,SIG_DFL); result = KSexecuteString(Kbuff); /* fprintf(stderr,"r=%d ",result); */ - signal(SIGINT,SIG_IGN); /* Reset SIGINT. Don't jump to ctrlC(). */ + mysignal(SIGINT,SIG_IGN); /* Reset SIGINT. Don't jump to ctrlC(). */ } /* fprintf(stderr,"r=%d ",result); */ if (result == -1) { K00recoverFromError(); InSendmsg2 = 0; fprintf(stderr,"--- Engine error or interrupt : "); if (DebugMode) { - signal(SIGINT,SIG_DFL); + mysignal(SIGINT,SIG_DFL); KSexecuteString("db.DebugStack setstack "); - signal(SIGINT,SIG_IGN); /* Reset SIGINT. Don't jump to ctrlC(). */ + mysignal(SIGINT,SIG_IGN); /* Reset SIGINT. Don't jump to ctrlC(). */ obj = KSpop(); - signal(SIGINT,SIG_DFL); + mysignal(SIGINT,SIG_DFL); KSexecuteString("stdstack "); - signal(SIGINT,SIG_IGN); /* Reset SIGINT. Don't jump to ctrlC(). */ + mysignal(SIGINT,SIG_IGN); /* Reset SIGINT. Don't jump to ctrlC(). */ if (obj.tag == Sdollar) { fprintf(stderr,"%s\n",obj.lc.str); fprintf(stderr,"\n"); @@ -129,7 +133,7 @@ void *mymalloc(int n) return((void *)GC_malloc(n)); } -execFile(char *s) +int execFile(char *s) { FILE *fp; #define TMP_SIZE 1024