version 1.4, 2005/06/16 05:07:24 |
version 1.9, 2020/10/07 07:47:23 |
|
|
#include <stdio.h> |
#include <stdio.h> |
#include <setjmp.h> |
#include <setjmp.h> |
|
#include <stdlib.h> |
#include "ox_kan.h" |
#include "ox_kan.h" |
#include "serversm.h" |
#include "serversm.h" |
extern int OXprintMessage; |
extern int OXprintMessage; |
|
extern char *MsgStackTrace; |
|
extern char *MsgSourceTrace; |
|
extern struct object *MsgStackTraceInArrayp; |
|
|
|
void KSstart(); // kan96xx/Kan/datatype.h |
|
int KSexecuteString(char *s); // kan96xx/Kan/datatype.h |
|
int Kan_pushCMOFromStream(FILE2 *fp); //kan96xx/Kan/plugin.h |
|
int Kan_popCMOToStream(FILE2 *fp,int serial); // |
|
int KgetCmoTagOfObject(struct object obj); // |
|
int KSstackPointer(void); //kan96xx/Kan/extern.h |
|
int Kan_setMathCapToStream(FILE2 *fp,struct object ob); // kan96xx/plugin/cmo.c |
|
|
|
|
/* server stack machine */ |
/* server stack machine */ |
|
|
int Sm1_start(int argc, char *fnames[],char *myname) { |
int Sm1_start(int argc, char *fnames[],char *myname) { |
Line 138 int Sm1_popCMO(ox_stream fp,int serial) |
|
Line 151 int Sm1_popCMO(ox_stream fp,int serial) |
|
int Sm1_pushError2(int serial, int no, char *s) |
int Sm1_pushError2(int serial, int no, char *s) |
{ |
{ |
struct object ob = OINIT; |
struct object ob = OINIT; |
ob = KnewErrorPacket(serial,no,s); |
struct object core = OINIT; |
|
struct object core1 = OINIT; |
|
char *ss; |
|
|
|
ss = (char *)sGC_malloc(strlen(s)+1); |
|
strcpy(ss,s); |
|
/* |
|
char *error_message="<ox103:error_message>"; |
|
char *message="<ox103:message>"; |
|
char *stack_trace="<ox103:stack_trace>"; |
|
char *source_trace="<ox103:source_trace>"; |
|
char *error_message2="</ox103:error_message>"; |
|
char *message2="</ox103:message>"; |
|
char *stack_trace2="</ox103:stack_trace>"; |
|
char *source_trace2="</ox103:source_trace>"; |
|
ss = (char *) sGC_malloc(strlen(s)+strlen(MsgStackTrace)+ |
|
strlen(MsgSourceTrace)+ |
|
strlen(error_message)+strlen(error_message2)+ |
|
strlen(message)+strlen(message2)+ |
|
strlen(stack_trace)+strlen(stack_trace2)+ |
|
strlen(source_trace)+strlen(source_trace2)+2); |
|
|
|
strcat(ss,error_message); |
|
strcat(ss,message); |
|
strcat(ss,s); |
|
strcat(ss,message2); |
|
if (MsgStackTrace != NULL) { |
|
strcat(ss,stack_trace); |
|
strcat(ss,MsgStackTrace); |
|
strcat(ss,stack_trace2); |
|
} |
|
if (MsgSourceTrace != NULL) { |
|
strcat(ss,source_trace); |
|
strcat(ss,MsgSourceTrace); |
|
strcat(ss,source_trace2); |
|
} |
|
strcat(ss,error_message2); |
|
*/ |
|
|
|
if (MsgStackTraceInArrayp != NULL) { |
|
core = KSnewObjectArray(2); |
|
core1 = KSnewObjectArray(2); |
|
putoa(core1,0,KpoString("where")); /* keyword */ |
|
putoa(core1,1,(*MsgStackTraceInArrayp)); |
|
putoa(core,0,core1); |
|
core1 = KSnewObjectArray(2); |
|
putoa(core1,0,KpoString("reason_of_error")); /* keyword */ |
|
putoa(core1,1,KpoString(s)); |
|
putoa(core,1,core1); |
|
}else{ |
|
core = KSnewObjectArray(0); |
|
} |
|
ob = KSnewObjectArray(4); |
|
putoa(ob,0,KpoInteger(serial)); putoa(ob,1,KpoInteger(no)); |
|
putoa(ob,2,KpoString(ss)); |
|
putoa(ob,3,core); |
|
|
|
ob = KnewErrorPacketObj(ob); |
KSpush(ob); |
KSpush(ob); |
} |
} |
|
|