[BACK]Return to serversm.h CVS log [TXT][DIR] Up to [local] / OpenXM / src / kxx

Annotation of OpenXM/src/kxx/serversm.h, Revision 1.8

1.1       maekawa     1: /* server stack machine, serversm.h  */
1.8     ! takayama    2: /* miss of these declarations caused segfault of ox_sm1 2015.10.09 */
        !             3: #include <string.h>
        !             4: void *sGC_malloc(int n);
        !             5:
1.1       maekawa     6: void *Sm1_mathcap(void);
                      7: int Sm1_setMathCap(ox_stream os);
                      8: void Sm1_pops(void);
                      9: int Sm1_executeStringByLocalParser(void);
                     10: char *Sm1_popString(void);
                     11: int Sm1_setName(void);
                     12: int Sm1_evalName(void);
                     13: int Sm1_start(int argc, char *fnames[],char *myname);
                     14: int Sm1_pushCMO(ox_stream fp);  /* read data from the stream and push it */
                     15: int Sm1_popCMO(ox_stream fp,int serial);         /* pop and send the data to stream. */
                     16: int Sm1_pushError2(int serial,int no,char *message);
                     17: char *Sm1_popErrorMessage(char *s);
                     18: void Sm1_getsp(void);
                     19: void Sm1_dupErrors(void);
1.2       takayama   20: void Sm1_pushCMOtag(int serial);
1.1       maekawa    21:
1.6       takayama   22: #include <setjmp.h>
                     23:
                     24: #if defined(__CYGWIN__) || defined(__MSYS__)
                     25: #define MYSETJMP(e) _setjmp(e)
1.7       takayama   26: #define MYSIGSETJMP(e,f) _setjmp(e)
                     27: #define MYLONGJMP(e,f) _longjmp(e,f)
                     28: #define MYSIGLONGJMP(e,f) _longjmp(e,f)
1.6       takayama   29: #else
                     30: #define MYSETJMP(e)  setjmp(e)
                     31: #define MYSIGSETJMP(e,f) sigsetjmp(e,f)
1.7       takayama   32: #define MYLONGJMP(e,f) longjmp(e,f)
                     33: #define MYSIGLONGJMP(e,f) siglongjmp(e,f)
1.6       takayama   34: #endif
1.1       maekawa    35:
                     36: /********************  Object from Kan/stackm.h *************************/
                     37: #define Snull             0
                     38: #define Sinteger          1     /* integer */
                     39: #define Sdollar           5     /* pointer to a string obtained from $...$ */
                     40: #define Sarray            6     /* lc.ival is the size of array,
                     41:                                   (rc.op)[0], ..., (rc.op)[k] is the array
                     42:                                   of object */
                     43: #define Sclass          17   /* class, for extension */
                     44:
                     45:
                     46: union cell {
                     47:   int ival;
                     48:   char *str;
                     49:   struct object *op;
                     50:   void *voidp;
                     51: };
                     52: struct object{
                     53:   int tag;                /* class identifier */
                     54:   union cell lc;          /* left cell */
                     55:   union cell rc;          /* right cell */
1.3       takayama   56:   struct object *attr;
1.1       maekawa    57: };
1.4       takayama   58: #define OINIT  { .attr = NULL }
                     59:
1.1       maekawa    60: /********** macros to use Sarray **********************/
                     61: /* put to Object Array */
                     62: #define putoa(ob,i,cc) {\
                     63: if ((ob).tag != Sarray) {fprintf(stderr,"Warning: PUTOA is for an array of objects\n");} else \
                     64: {if ((0 <= (i)) && ((i) < (ob).lc.ival)) {\
                     65:   (ob.rc.op)[i] = cc;\
                     66: }else{\
                     67:   fprintf(stderr,"Warning: PUTOA, the size is %d.\n",(ob).lc.ival);\
                     68: }}}
                     69:
                     70: #define getoa(ob,i) ((ob.rc.op)[i])
                     71:
                     72: #define getoaSize(ob) ((ob).lc.ival)
                     73: /**************** end of macros from Kan/stackm.h *******************/
                     74:
                     75: /*   Interface functions from kanlib.a.  */
                     76: struct object KSpop();
                     77: void KSpush(struct object ob);
                     78: struct object KfindUserDictionary(char *s);
                     79: struct object KputUserDictionary(char *s,struct object ob);
                     80: struct object KnewErrorPacket(int serial,int no,char *s);
1.5       takayama   81: struct object KnewErrorPacketObj(struct object);
1.1       maekawa    82: struct object KSmathCap(void);  /* defined plugin/cmo.c */
                     83: void *KSmathCapByStruct(void);  /* defined plugin/cmo.c */
                     84: char *popErrorStackByString(void);
                     85: struct object KSdupErrors(void);
                     86: struct object KpoInteger(int i);
1.5       takayama   87: struct object KpoString(char *s);
1.2       takayama   88: struct object KSpeek(int k);
1.5       takayama   89: struct object KSnewObjectArray(int k);

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>