[BACK]Return to ki.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / k097

Diff for /OpenXM/src/k097/ki.c between version 1.6 and 1.10

version 1.6, 2003/12/05 14:02:23 version 1.10, 2016/03/31 05:27:34
Line 1 
Line 1 
 /* $OpenXM: OpenXM/src/k097/ki.c,v 1.5 2003/08/22 16:08:20 ohara Exp $ */  /* $OpenXM: OpenXM/src/k097/ki.c,v 1.9 2015/10/10 11:29:46 takayama Exp $ */
 /* ki.c    ( kx interpreter )  */  /* ki.c    ( kx interpreter )  */
   
 #include <stdio.h>  #include <stdio.h>
Line 11 
Line 11 
 #include "gradedset.h"  #include "gradedset.h"
 #include <setjmp.h>  #include <setjmp.h>
 #include <signal.h>  #include <signal.h>
   #include <string.h>
   #include <stdlib.h>
   #include "mysig.h"
   
 char *getLOAD_K_PATH();  /* from d.h */  char *getLOAD_K_PATH();  /* from d.h */
   
Line 42  extern int DebugMode;
Line 45  extern int DebugMode;
 sendKan(int p) {  sendKan(int p) {
   static int n = 2;    static int n = 2;
   extern int Interactive;    extern int Interactive;
   struct object obj;    struct object obj = OINIT;
   int result;    int result;
   extern int InSendmsg2;    extern int InSendmsg2;
   signal(SIGINT,SIG_IGN); /* Don't jump to ctrlC(). */    mysignal(SIGINT,SIG_IGN); /* Don't jump to ctrlC(). */
   if (p == 10) {printf("In(%d)= ",n++); return;}    if (p == 10) {printf("In(%d)= ",n++); return 0;}
   if (p == 0 && DebugCompiler) printf("sendKan[%s]\n",Kbuff);    if (p == 0 && DebugCompiler) printf("sendKan[%s]\n",Kbuff);
   /* printf("sendKan[%s]\n",Kbuff);   */    /* printf("sendKan[%s]\n",Kbuff);   */
   if (strlen(Kbuff) != 0) {    if (strlen(Kbuff) != 0) {
     signal(SIGINT,SIG_DFL);      mysignal(SIGINT,SIG_DFL);
     result = KSexecuteString(Kbuff);      result = KSexecuteString(Kbuff);
     /* fprintf(stderr,"r=%d ",result);  */      /* 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); */    /* fprintf(stderr,"r=%d ",result); */
   if (result == -1) {    if (result == -1) {
     K00recoverFromError();  InSendmsg2 = 0;      K00recoverFromError();  InSendmsg2 = 0;
     fprintf(stderr,"--- Engine error or interrupt : ");      fprintf(stderr,"--- Engine error or interrupt : ");
     if (DebugMode) {      if (DebugMode) {
       signal(SIGINT,SIG_DFL);        mysignal(SIGINT,SIG_DFL);
       KSexecuteString("db.DebugStack setstack ");        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();        obj = KSpop();
       signal(SIGINT,SIG_DFL);        mysignal(SIGINT,SIG_DFL);
       KSexecuteString("stdstack ");        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) {        if (obj.tag == Sdollar) {
         fprintf(stderr,"%s\n",obj.lc.str);          fprintf(stderr,"%s\n",obj.lc.str);
         fprintf(stderr,"\n");          fprintf(stderr,"\n");
Line 157  execFile(char *s)
Line 160  execFile(char *s)
             fprintf(stderr,"Fatal error: Cannot open the system macro %s in %s, %s, %s nor %s.\n",              fprintf(stderr,"Fatal error: Cannot open the system macro %s in %s, %s, %s nor %s.\n",
                     s,tname2,tname3,tname4,tname);                      s,tname2,tname3,tname4,tname);
             exit(11);              exit(11);
             return;              return 0;
           }            }
         }          }
       }        }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.10

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>