version 1.22, 2013/11/06 06:44:48 |
version 1.26, 2020/10/06 11:33:46 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/primitive.c,v 1.21 2005/07/03 11:08:54 ohara 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 <stdlib.h> |
#include <stdlib.h> |
#include <string.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 "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 280 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 453 int executePrimitive(ob) |
|
Line 456 int executePrimitive(ob) |
|
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 1200 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 1746 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{ |