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

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

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

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