version 1.1, 1999/10/08 02:12:05 |
version 1.6, 2000/02/02 03:30:48 |
|
|
|
/*$OpenXM: OpenXM/src/kan96xx/plugin/cmo.c,v 1.5 2000/01/25 05:07:11 takayama Exp $*/ |
#include <stdio.h> |
#include <stdio.h> |
#include <string.h> |
#include <string.h> |
#include <netinet/in.h> |
/* #include <netinet/in.h> */ |
#include <stdlib.h> |
#include <stdlib.h> |
#include "datatype.h" |
#include "datatype.h" |
#include "stackm.h" |
#include "stackm.h" |
Line 36 int CmoClientMode = 1; /* This flag is used to transl |
|
Line 37 int CmoClientMode = 1; /* This flag is used to transl |
|
**************************************************************************/ |
**************************************************************************/ |
/* If you change the format of mathcap, do the follows. |
/* If you change the format of mathcap, do the follows. |
Mofify cmoCheckMathCap in oxmisc2.c, |
Mofify cmoCheckMathCap in oxmisc2.c, |
oxReq, SM_setMathCap:, and |
oxSendMathCap in oxmisc.c, |
|
newMathCap in cmo.c, |
|
oxReq, SM_setMathCap: in oxmisc2.c, and |
grep mathCap and make all modifications. |
grep mathCap and make all modifications. |
*/ |
*/ |
|
|
Line 86 struct cmoBuffer *cmoOutputToBuf(cmoAction a,void *dat |
|
Line 89 struct cmoBuffer *cmoOutputToBuf(cmoAction a,void *dat |
|
break; |
break; |
case CMOPUT: |
case CMOPUT: |
for (i=0; i<size; i++) { |
for (i=0; i<size; i++) { |
fp2fputc(((char *)data)[i], b.fp); |
fp2fputc((int) ((char *)data)[i], b.fp); |
} |
} |
break; |
break; |
case CMOFLUSH: |
case CMOFLUSH: |
Line 195 cmoToStream(struct object cmoObj,struct object of) |
|
Line 198 cmoToStream(struct object cmoObj,struct object of) |
|
s = (char *)(cb->buf); |
s = (char *)(cb->buf); |
for (i=0; i<size; i++) { |
for (i=0; i<size; i++) { |
if (file2) { |
if (file2) { |
fp2fputc(s[i],(FILE2 *)(of.rc.voidp)); |
fp2fputc((int) s[i],(FILE2 *)(of.rc.voidp)); |
}else{ |
}else{ |
fputc(s[i],of.rc.file); |
fputc((int) s[i],of.rc.file); |
} |
} |
} |
} |
} |
} |
Line 1317 struct object newMathCap(struct mathCap *mathcap){ |
|
Line 1320 struct object newMathCap(struct mathCap *mathcap){ |
|
struct object ob3; |
struct object ob3; |
struct object obOx; |
struct object obOx; |
struct object obSm; |
struct object obSm; |
|
struct object ob3tmp; |
struct object *obp; |
struct object *obp; |
int i; |
int i,j; |
struct object mathinfo; |
struct object mathinfo; |
|
|
rob = newObjectArray(3); |
rob = newObjectArray(3); |
Line 1328 struct object newMathCap(struct mathCap *mathcap){ |
|
Line 1332 struct object newMathCap(struct mathCap *mathcap){ |
|
for (i=0; i<getoaSize(mathinfo); i++) { |
for (i=0; i<getoaSize(mathinfo); i++) { |
putoa(ob1,i,getoa(mathinfo,i)); |
putoa(ob1,i,getoa(mathinfo,i)); |
} |
} |
ob2 = newObjectArray(mathcap->n); |
ob3 = newObjectArray(mathcap->oxSize); |
for (i=0; i<mathcap->n; i++) { |
|
putoa(ob2,i,KpoInteger((mathcap->cmo)[i])); |
|
} |
|
obOx = newObjectArray(mathcap->oxSize); |
|
for (i=0; i<mathcap->oxSize; i++) { |
for (i=0; i<mathcap->oxSize; i++) { |
putoa(obOx,i,KpoInteger((mathcap->ox)[i])); |
ob3tmp = newObjectArray(2); |
|
putoa(ob3tmp,0,KpoInteger((mathcap->ox)[i])); |
|
ob2 = newObjectArray(mathcap->n); |
|
for (j=0; j<mathcap->n; j++) { |
|
putoa(ob2,j,KpoInteger((mathcap->cmo)[j])); |
|
} |
|
putoa(ob3tmp,1,ob2); |
|
putoa(ob3,i,ob3tmp); |
} |
} |
ob3 = newObjectArray(2); |
|
putoa(ob3,0,obOx); |
|
putoa(ob3,1,ob2); |
|
|
|
obSm = newObjectArray(mathcap->smSize); |
obSm = newObjectArray(mathcap->smSize); |
for (i=0; i<mathcap->smSize; i++) { |
for (i=0; i<mathcap->smSize; i++) { |
Line 1385 void *KSmathCapByStruct(void) |
|
Line 1389 void *KSmathCapByStruct(void) |
|
putoa(ob,1,KpoString(sys)); |
putoa(ob,1,KpoString(sys)); |
putoa(ob,2,KpoString(sysVersion)); |
putoa(ob,2,KpoString(sysVersion)); |
s1 = getenv("HOSTTYPE"); |
s1 = getenv("HOSTTYPE"); |
|
if (s1 == NULL) s1="unknown"; |
s2 = (char *)sGC_malloc(strlen(s1)+2+strlen("HOSTTYPE=")); |
s2 = (char *)sGC_malloc(strlen(s1)+2+strlen("HOSTTYPE=")); |
strcpy(s2,"HOSTTYPE="); |
strcpy(s2,"HOSTTYPE="); |
strcat(s2,s1); |
strcat(s2,s1); |
Line 1438 void *KSmathCapByStruct(void) |
|
Line 1443 void *KSmathCapByStruct(void) |
|
mathcap->sm[8] = SM_setMathCap; |
mathcap->sm[8] = SM_setMathCap; |
mathcap->sm[9] = SM_getsp; |
mathcap->sm[9] = SM_getsp; |
mathcap->sm[10] = SM_dupErrors; |
mathcap->sm[10] = SM_dupErrors; |
mathcap->smSize = 11; |
mathcap->sm[11] = SM_pushCMOtag; |
|
mathcap->smSize = 12; |
|
|
return((void *)mathcap); |
return((void *)mathcap); |
} |
} |