=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/plugin/cmo.c,v retrieving revision 1.14 retrieving revision 1.18 diff -u -p -r1.14 -r1.18 --- OpenXM/src/kan96xx/plugin/cmo.c 2013/11/06 06:23:24 1.14 +++ OpenXM/src/kan96xx/plugin/cmo.c 2020/10/06 11:33:47 1.18 @@ -1,8 +1,9 @@ -/*$OpenXM: OpenXM/src/kan96xx/plugin/cmo.c,v 1.13 2005/06/16 05:07:24 takayama Exp $*/ +/*$OpenXM: OpenXM/src/kan96xx/plugin/cmo.c,v 1.17 2020/10/04 06:10:36 noro Exp $*/ #include #include /* #include */ #include +#include #include "datatype.h" #include "stackm.h" #include "extern.h" @@ -18,6 +19,13 @@ #include "cmotag.htmp" /* static char *cmotagToName(int tag) is defined here. */ +void warningCmo(char *s); +void errorCmo(char *s); +size_t cmoOutGMPCoeff(mpz_srcptr x); // defined in cmo-gmp.c +size_t cmoGetGMPCoeff(MP_INT *x, struct cmoBuffer *cb); +int cmoCheckMathCap(struct object ob, struct object *mathcapObjp); // in oxmisc2.h + + extern int OxVersion; int CmoClientMode = 1; /* This flag is used to translate names for @@ -156,7 +164,7 @@ struct cmoBuffer *cmoOutputToBuf(cmoAction a,void *dat } } -dumpCmoBuf(struct cmoBuffer *cb) +int dumpCmoBuf(struct cmoBuffer *cb) { int i,size, tag; char *s; @@ -167,7 +175,7 @@ dumpCmoBuf(struct cmoBuffer *cb) size = cb->pos; s = (char *)(cb->buf); tag = htonl(*((int *) s)); - printf("CMO StandardEncoding: size = %d, size/sizeof(int) = %d, tag=%s \n",size,size/sizeof(int),cmotagToName(tag)); + printf("CMO StandardEncoding: size = %d, size/sizeof(int) = %d, tag=%s \n",size,size/((int)sizeof(int)),cmotagToName(tag)); for (i=0; ism[10] = SM_dupErrors; mathcap->sm[11] = SM_pushCMOtag; mathcap->sm[12] = SM_executeFunctionWithOptionalArgument; - mathcap->smSize = 13; + mathcap->sm[13] = SM_nop; + mathcap->smSize = 14; return((void *)mathcap); } @@ -1475,11 +1485,11 @@ int cmoOutRawInt(int k) cmoOutputToBuf(CMOPUT,tmp,sizeof(cmoint)); } -warningCmo(char *s) { +void warningCmo(char *s) { fprintf(stderr,"Warning: plugin/cmo.c : %s\n",s); } -errorCmo(char *s) { +void errorCmo(char *s) { fprintf(stderr,"plugin/cmo.c : %s\n",s); errorKan1("%s\n","cmo fatal error. ox servers need SM_control_reset_connection."); /* ErrorPacket is automatically push on the ErrorStack.