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

Diff for /OpenXM/src/kxx/sample_kanlib.c between version 1.4 and 1.6

version 1.4, 2015/10/08 11:49:38 version 1.6, 2016/03/31 06:34:29
Line 1 
Line 1 
 /* $OpenXM: OpenXM/src/kxx/sample_kanlib.c,v 1.3 2004/09/17 02:42:58 takayama Exp $ */  /* $OpenXM: OpenXM/src/kxx/sample_kanlib.c,v 1.5 2016/03/31 05:27:34 takayama Exp $ */
 /*  /*
 This is a sample program to use kanlib.a  This is a sample program to use kanlib.a
 gcc -g -O2 -g -D_BSD_SOURCE sample_kanlib.c -o sample_kanlib  -ldl   ../kan96xx/Kan/kanlib.a -L../../lib -lgmp -lgc  gcc -g -O2 -g -D_BSD_SOURCE sample_kanlib.c -o sample_kanlib  -ldl   ../kan96xx/Kan/kanlib.a -L../../lib -lgmp -lgc
Line 7  gcc -g -O2 -g -D_BSD_SOURCE sample_kanlib.c -o sample_
Line 7  gcc -g -O2 -g -D_BSD_SOURCE sample_kanlib.c -o sample_
 #include <stdio.h>  #include <stdio.h>
 #include <setjmp.h>  #include <setjmp.h>
 #include <signal.h>  #include <signal.h>
   #include "mysig.h"
   
 // serversm.h is not included.  // serversm.h is not included.
 #if defined(__CYGWIN__) || defined(__MSYS__)  #if defined(__CYGWIN__) || defined(__MSYS__)
Line 29  void ctrlC();
Line 30  void ctrlC();
   
 main() {  main() {
   char s[1024];    char s[1024];
     int r;
   Quiet = 0;    Quiet = 0;
   KSstart();    KSstart();
   
   if (signal(SIGINT,SIG_IGN) != SIG_IGN) {    if (mysignal(SIGINT,SIG_IGN) != SIG_IGN) {
         signal(SIGINT,ctrlC);          mysignal(SIGINT,ctrlC);
   }    }
   while( fgets(s,1023,stdin) != NULL) {    while( fgets(s,1023,stdin) != NULL) {
         if (SETJMP(EnvOfStackMachine)) {          if (SETJMP(EnvOfStackMachine)) {
Line 46  main() {
Line 48  main() {
       KSexecuteString(" (Computation is interrupted.) ");        KSexecuteString(" (Computation is interrupted.) ");
           continue;            continue;
         } else {  }          } else {  }
         KSexecuteString(s);          r=KSexecuteString(s);
           fprintf(stderr,"result code=%d\n",r);
   }    }
 }  }

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

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