=================================================================== RCS file: /home/cvs/OpenXM/src/kxx/nullstackmachine.c,v retrieving revision 1.1.1.1 retrieving revision 1.5 diff -u -p -r1.1.1.1 -r1.5 --- OpenXM/src/kxx/nullstackmachine.c 1999/10/08 02:12:13 1.1.1.1 +++ OpenXM/src/kxx/nullstackmachine.c 2016/08/27 01:35:07 1.5 @@ -2,19 +2,21 @@ #include "ox_kan.h" #include "serversm.h" #include +#include +#include jmp_buf EnvOfStackMachine; /* dummy data. */ int SerialCurrent = -1; int Quiet = 0; -void *GC_malloc(n) { +void *sGC_malloc(int n) { return((void *)malloc(n)); } /* internal use. */ int Sm1_popInt(); -Sm1_start() { +Sm1_start(int argc,char *fnames[],char *myname) { fprintf(stderr,"nullstackmachine: sleep, pstack\n"); } @@ -82,7 +84,7 @@ void printCMO_object(FILE *fp,CMO_Object *op) n = ntohl(((CMO_string_object *)op)->size); fprintf(stderr,"n=%d :"); fflush(NULL); for (i=0; idata[i]); + fprintf(fp,"%c",((CMO_string_object *)op)->data[i]); } break; default: @@ -95,9 +97,10 @@ void printCMO_object(FILE *fp,CMO_Object *op) void *Sm1_mathcap(void) { int n,i; struct mathCap *mathcap; + static char *infoStr; + infoStr = "nullserver00 Version=0.1; 199901160;"; mathcap = (struct mathCap *) malloc(sizeof(struct mathCap)); - strcpy(mathcap->name,"nullserver00 Version=0.1"); - mathcap->version = 199901160; + mathcap->infop = infoStr; /* string is OK? 2016.08.27 */ mathcap->cmo[0] = CMO_ERROR2; mathcap->cmo[1] = CMO_NULL; mathcap->cmo[2] = CMO_INT32; @@ -124,13 +127,13 @@ int Sm1_executeStringByLocalParser(void) { if (s != NULL) { if (strcmp(s,"sleep") == 0) { while (1) { - fprintf(stderr,"Sleeping... "); fflush(NULL); - sleep(10); + fprintf(stderr,"Sleeping... "); fflush(NULL); + sleep(10); } }else if (strcmp(s,"pstack") == 0) { fprintf(stderr,"pstack -------------- Stackp = %d\n",Stackp); for (i=Stackp-1; i>=0; i--) { - printCMO_object(stdout,LocalStack[i]); fprintf(stderr,"\n"); + printCMO_object(stdout,LocalStack[i]); fprintf(stderr,"\n"); } fprintf(stderr,"\n--------------------\n"); }else{ @@ -242,23 +245,23 @@ int Sm1_pushCMO(ox_stream ostream) /* old one went to n = nullCmoGetInt32(ostream); fprintf(stderr,"size=%d ",n); if (n > 1000-2) { - fprintf(stderr," size is too large. \n"); + fprintf(stderr," size is too large. \n"); }else{ - for (i=0; i