=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/Kan/ext.c,v retrieving revision 1.15 retrieving revision 1.27 diff -u -p -r1.15 -r1.27 --- OpenXM/src/kan96xx/Kan/ext.c 2003/07/21 13:36:41 1.15 +++ OpenXM/src/kan96xx/Kan/ext.c 2004/09/11 12:13:41 1.27 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/kan96xx/Kan/ext.c,v 1.14 2003/07/14 12:49:52 takayama Exp $ */ +/* $OpenXM: OpenXM/src/kan96xx/Kan/ext.c,v 1.26 2004/09/09 08:50:12 takayama Exp $ */ #include #include #include @@ -12,21 +12,25 @@ #include "extern2.h" #include #include "plugin.h" +#include "kclass.h" #include +#include #include "ox_pathfinder.h" +extern int Quiet; extern char **environ; #define MYCP_SIZE 100 static int Mychildren[MYCP_SIZE]; static int Mycp = 0; +static int Verbose_mywait = 0; static void mywait() { int status; int pid; int i,j; - signal(SIGCHLD,SIG_IGN); + /* signal(SIGCHLD,SIG_IGN); */ pid = wait(&status); - fprintf(stderr,"Child process %d is exiting.\n",pid); + if ((!Quiet) && (Verbose_mywait)) fprintf(stderr,"Child process %d is exiting.\n",pid); for (i=0; ilc).ival,(obj2.rc.op->rc).ival, m,CurrentContextp->userDictionary); + }else if (strcmp(key,"getattr")==0) { + if (size != 2) errorKan1("%s\n","[(getattr) symbol] extension."); + obj1 = getoa(obj,1); + if (obj1.tag != Sstring) errorKan1("%s\n","[(getattr) symbol] extension."); + rob = KfindUserDictionary(obj1.lc.str); + if (rob.tag != NoObject.tag) { + if (strcmp(UD_str,obj1.lc.str) == 0) { + rob = KpoInteger(UD_attr); + }else errorKan1("%s\n","getattr: internal error."); + }else rob = NullObject; }else if (strcmp(key,"getServerEnv")==0) { if (size != 2) errorKan1("%s\n","[(getServerEnv) serverName] extension."); obj1 = getoa(obj,1); @@ -342,6 +357,35 @@ struct object Kextension(struct object obj) obj2 = getoa(obj,2); if (obj2.tag != Sarray) errorKan1("%s\n","[(regionMatches) str strArray] extension. strArray must be an array."); rob = KregionMatches(obj1,obj2); + }else if (strcmp(key,"newVector")==0) { + if (size != 2) errorKan1("%s\n","[(newVector) m] extension."); + obj1 = getoa(obj,1); + if (obj1.tag != Sinteger) errorKan1("%s\n","[(newVector) m] extension. m must be an integer."); + rob = newObjectArray(KopInteger(obj1)); + }else if (strcmp(key,"newMatrix")==0) { + if (size != 3) errorKan1("%s\n","[(newMatrix) m n] extension."); + obj1 = getoa(obj,1); + if (obj1.tag != Sinteger) errorKan1("%s\n","[(newMatrix) m n] extension. m must be an integer."); + obj2 = getoa(obj,2); + if (obj2.tag != Sinteger) errorKan1("%s\n","[(newMatrix) m n] extension. n must be an integer."); + rob = newObjectArray(KopInteger(obj1)); + for (i=0; i