[BACK]Return to primitive.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Kan

Diff for /OpenXM/src/kan96xx/Kan/primitive.c between version 1.19 and 1.26

version 1.19, 2004/09/20 02:11:22 version 1.26, 2020/10/06 11:33:46
Line 1 
Line 1 
 /* $OpenXM: OpenXM/src/kan96xx/Kan/primitive.c,v 1.18 2004/09/17 02:42:57 takayama Exp $ */  /* $OpenXM: OpenXM/src/kan96xx/Kan/primitive.c,v 1.25 2018/09/07 00:15:44 takayama Exp $ */
 /*   primitive.c */  /*   primitive.c */
 /*  The functions in this module were in stackmachine.c */  /*  The functions in this module were in stackmachine.c */
   
 #include <stdio.h>  #include <stdio.h>
   #include <stdlib.h>
   #include <string.h>
 #include <signal.h>  #include <signal.h>
   #include <time.h>
   #include <unistd.h>
 #include "datatype.h"  #include "datatype.h"
 #include "stackm.h"  #include "stackm.h"
 #include "extern.h"  #include "extern.h"
   #include "extern2.h"
 #include "gradedset.h"  #include "gradedset.h"
 #include "kclass.h"  #include "kclass.h"
 #include <sys/types.h>  #include <sys/types.h>
 #include <sys/times.h>  #include <sys/times.h>
   #include "mysig.h"
   
 int PrintDollar = 1;         /* flag for printObject() */  int PrintDollar = 1;         /* flag for printObject() */
 int PrintComma  = 1;         /* flag for printObject() */  int PrintComma  = 1;         /* flag for printObject() */
Line 277  void printObject(ob,nl,fp) 
Line 283  void printObject(ob,nl,fp) 
     printObjectList(&ob);      printObjectList(&ob);
     break;      break;
   case Sfile:    case Sfile:
     fprintf(fp,"Name=%s, FILE *=%x ",ob.lc.str,(int) ob.rc.file);      fprintf(fp,"Name=%s, FILE *=%p ",ob.lc.str,ob.rc.file);
     break;      break;
   case Sring:    case Sring:
     fprintf(fp,"Ring."); KshowRing(KopRingp(ob));      fprintf(fp,"Ring."); KshowRing(KopRingp(ob));
Line 422  void  KdefinePrimitiveFunctions() {
Line 428  void  KdefinePrimitiveFunctions() {
 int executePrimitive(ob)  int executePrimitive(ob)
      struct object ob;       struct object ob;
 {  {
   struct object ob1;    struct object ob1 = OINIT;
   struct object ob2;    struct object ob2 = OINIT;
   struct object ob3;    struct object ob3 = OINIT;
   struct object ob4;    struct object ob4 = OINIT;
   struct object ob5;    struct object ob5 = OINIT;
   struct object rob;    struct object rob = OINIT;
   struct object obArray[OB_ARRAY_MAX];    struct object obArray[OB_ARRAY_MAX];
   struct object obArray2[OB_ARRAY_MAX];    struct object obArray2[OB_ARRAY_MAX];
   int size;    int size;
Line 440  int executePrimitive(ob) 
Line 446  int executePrimitive(ob) 
   FILE *fp;    FILE *fp;
   char *fname;    char *fname;
   int rank;    int rank;
   struct object oMat;    struct object oMat = OINIT;
   static int timerStart = 1;    static int timerStart = 1;
   static struct tms before, after;    static struct tms before, after;
   static time_t before_real, after_real;    static time_t before_real, after_real;
   struct object oInput;    struct object oInput = OINIT;
   char *str;    char *str;
   int ccflag = 0;    int ccflag = 0;
   extern int KeepInput;    extern int KeepInput;
   extern int History;    extern int History;
   extern struct ring *CurrentRingp;    extern struct ring *CurrentRingp;
   extern TimerOn;    extern int TimerOn;
   extern SecureMode;    extern int SecureMode;
   extern int RestrictedMode;    extern int RestrictedMode;
   
   infixOn = 0;    infixOn = 0;
Line 1197  int executePrimitive(ob) 
Line 1203  int executePrimitive(ob) 
     default: errorStackmachine("Usage:system");      default: errorStackmachine("Usage:system");
     }      }
     if (SecureMode) errorStackmachine("Security violation.");      if (SecureMode) errorStackmachine("Security violation.");
     system( ob1.lc.str );      {int rr; rr=system( ob1.lc.str );}
     break;      break;
   
   case Scat_n:    case Scat_n:
Line 1581  int executePrimitive(ob) 
Line 1587  int executePrimitive(ob) 
   
       if (QuoteMode && (status & DO_QUOTE)) {        if (QuoteMode && (status & DO_QUOTE)) {
         /* generate tree object, for kan/k0 */          /* generate tree object, for kan/k0 */
         struct object qob;          struct object qob = OINIT;
         struct object qattr;          struct object qattr = OINIT;
         struct object qattr2;          struct object qattr2 = OINIT;
         if (i==0) { Kpop(); Kpop();}          if (i==0) { Kpop(); Kpop();}
         qob = newObjectArray(3);          qob = newObjectArray(3);
         qattr = newObjectArray(1);          qattr = newObjectArray(1);
Line 1743  int executePrimitive(ob) 
Line 1749  int executePrimitive(ob) 
     }      }
         n = ob2.lc.ival;          n = ob2.lc.ival;
         if (n > 0) {          if (n > 0) {
           signal(SIGALRM,ctrlC); alarm((unsigned int) n);            mysignal(SIGALRM,ctrlC); alarm((unsigned int) n);
       status = executeExecutableArray(ob1,(char *)NULL,0);        status = executeExecutableArray(ob1,(char *)NULL,0);
           cancelAlarm();            cancelAlarm();
         }else{          }else{

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.26

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