version 1.14, 2004/09/12 08:55:36 |
version 1.15, 2004/09/12 10:22:50 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/primitive.c,v 1.13 2004/09/12 02:37:57 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/primitive.c,v 1.14 2004/09/12 08:55:36 takayama Exp $ */ |
/* primitive.c */ |
/* primitive.c */ |
/* The functions in this module were in stackmachine.c */ |
/* The functions in this module were in stackmachine.c */ |
|
|
Line 745 int executePrimitive(ob) |
|
Line 745 int executePrimitive(ob) |
|
break; |
break; |
} |
} |
while (1) { |
while (1) { |
status = executeExecutableArray(ob1,(char *)NULL); |
status = executeExecutableArray(ob1,(char *)NULL,1); |
if ((status & STATUS_BREAK) || GotoP) break; |
if ((status & STATUS_BREAK) || GotoP) break; |
/* here, do not return 1. Do not propagate exit signal outside of the |
/* here, do not return 1. Do not propagate exit signal outside of the |
loop. */ |
loop. */ |
Line 784 int executePrimitive(ob) |
|
Line 784 int executePrimitive(ob) |
|
*/ |
*/ |
for ( ; i<=lim; i += inc) { |
for ( ; i<=lim; i += inc) { |
Kpush(KpoInteger(i)); |
Kpush(KpoInteger(i)); |
status = executeExecutableArray(ob1,(char *)NULL); |
status = executeExecutableArray(ob1,(char *)NULL,1); |
if ((status & STATUS_BREAK) || GotoP) goto xyz; |
if ((status & STATUS_BREAK) || GotoP) goto xyz; |
} |
} |
}else{ |
}else{ |
Line 793 int executePrimitive(ob) |
|
Line 793 int executePrimitive(ob) |
|
*/ |
*/ |
for ( ; i>=lim; i += inc) { |
for ( ; i>=lim; i += inc) { |
Kpush(KpoInteger(i)); |
Kpush(KpoInteger(i)); |
status = executeExecutableArray(ob1,(char *)NULL); |
status = executeExecutableArray(ob1,(char *)NULL,1); |
if ((status & STATUS_BREAK) || GotoP) goto xyz; |
if ((status & STATUS_BREAK) || GotoP) goto xyz; |
} |
} |
} |
} |
Line 825 int executePrimitive(ob) |
|
Line 825 int executePrimitive(ob) |
|
|
|
for (i=0; i<osize; i++) { |
for (i=0; i<osize; i++) { |
Kpush(getoa(ob1,i)); |
Kpush(getoa(ob1,i)); |
status = executeExecutableArray(ob2,(char *)NULL); |
status = executeExecutableArray(ob2,(char *)NULL,0); |
if ((status & STATUS_BREAK) || GotoP) goto foor; |
if (status & STATUS_BREAK) goto foor; |
} |
} |
foor: ; |
foor: ; |
/*KSexecuteString("]");*/ |
/*KSexecuteString("]");*/ |
Line 875 int executePrimitive(ob) |
|
Line 875 int executePrimitive(ob) |
|
ob1 = ob2; |
ob1 = ob2; |
} |
} |
/* execute ob1 */ |
/* execute ob1 */ |
status = executeExecutableArray(ob1,(char *)NULL); |
status = executeExecutableArray(ob1,(char *)NULL,0); |
if (status & STATUS_BREAK) return(status); |
if (status & STATUS_BREAK) return(status); |
|
|
break; |
break; |
Line 887 int executePrimitive(ob) |
|
Line 887 int executePrimitive(ob) |
|
case SexecutableArray: break; |
case SexecutableArray: break; |
default: errorStackmachine("Usage:exec"); |
default: errorStackmachine("Usage:exec"); |
} |
} |
status = executeExecutableArray(ob1,(char *)NULL); |
status = executeExecutableArray(ob1,(char *)NULL,0); |
break; |
break; |
|
|
/* Postscript primitives :dictionary */ |
/* Postscript primitives :dictionary */ |
Line 1467 int executePrimitive(ob) |
|
Line 1467 int executePrimitive(ob) |
|
} |
} |
/* normal exec. */ |
/* normal exec. */ |
Kpush(ob2); |
Kpush(ob2); |
status = executeExecutableArray(ob1,(char *)NULL); |
status = executeExecutableArray(ob1,(char *)NULL,0); |
|
|
if (ccflag) { |
if (ccflag) { |
contextControl(CCPOP); ccflag = 0; /* recover the Current context. */ |
contextControl(CCPOP); ccflag = 0; /* recover the Current context. */ |
Line 1579 int executePrimitive(ob) |
|
Line 1579 int executePrimitive(ob) |
|
contextControl(CCPUSH); ccflag = 1; |
contextControl(CCPUSH); ccflag = 1; |
CurrentContextp = PrimitiveContextp; |
CurrentContextp = PrimitiveContextp; |
/* normal exec. */ |
/* normal exec. */ |
status = executeExecutableArray(ob1,(char *)NULL); |
status = executeExecutableArray(ob1,(char *)NULL,0); |
contextControl(CCPOP); /* recover the Current context. */ |
contextControl(CCPOP); /* recover the Current context. */ |
break; |
break; |
|
|
Line 1624 int executePrimitive(ob) |
|
Line 1624 int executePrimitive(ob) |
|
} |
} |
/* normal exec. */ |
/* normal exec. */ |
Kpush(ob2); Kpush(ob4); |
Kpush(ob2); Kpush(ob4); |
status = executeExecutableArray(ob1,(char *)NULL); |
status = executeExecutableArray(ob1,(char *)NULL,0); |
if (ccflag) { |
if (ccflag) { |
contextControl(CCPOP); ccflag = 0; /* recover the Current context. */ |
contextControl(CCPOP); ccflag = 0; /* recover the Current context. */ |
} |
} |
Line 1695 int executePrimitive(ob) |
|
Line 1695 int executePrimitive(ob) |
|
n = ob2.lc.ival; |
n = ob2.lc.ival; |
if (n > 0) { |
if (n > 0) { |
signal(SIGALRM,ctrlC); alarm((unsigned int) n); |
signal(SIGALRM,ctrlC); alarm((unsigned int) n); |
status = executeExecutableArray(ob1,(char *)NULL); |
status = executeExecutableArray(ob1,(char *)NULL,0); |
cancelAlarm(); |
cancelAlarm(); |
}else{ |
}else{ |
before_real = time(&before_real); |
before_real = time(&before_real); |
times(&before); |
times(&before); |
status = executeExecutableArray(ob1,(char *)NULL); |
status = executeExecutableArray(ob1,(char *)NULL,0); |
times(&after); |
times(&after); |
after_real = time(&after_real); |
after_real = time(&after_real); |
ob1 = newObjectArray(3); |
ob1 = newObjectArray(3); |