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

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

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:
                     18:
                     19: /********************  Object from Kan/stackm.h *************************/
                     20: #define Snull             0
                     21: #define Sinteger          1     /* integer */
                     22: #define Sdollar           5     /* pointer to a string obtained from $...$ */
                     23: #define Sarray            6     /* lc.ival is the size of array,
                     24:                                   (rc.op)[0], ..., (rc.op)[k] is the array
                     25:                                   of object */
                     26: #define Sclass          17   /* class, for extension */
                     27:
                     28:
                     29: union cell {
                     30:   int ival;
                     31:   char *str;
                     32:   struct object *op;
                     33:   void *voidp;
                     34: };
                     35: struct object{
                     36:   int tag;                /* class identifier */
                     37:   union cell lc;          /* left cell */
                     38:   union cell rc;          /* right cell */
1.3     ! takayama   39:   struct object *attr;
1.1       maekawa    40: };
                     41: /********** macros to use Sarray **********************/
                     42: /* put to Object Array */
                     43: #define putoa(ob,i,cc) {\
                     44: if ((ob).tag != Sarray) {fprintf(stderr,"Warning: PUTOA is for an array of objects\n");} else \
                     45: {if ((0 <= (i)) && ((i) < (ob).lc.ival)) {\
                     46:   (ob.rc.op)[i] = cc;\
                     47: }else{\
                     48:   fprintf(stderr,"Warning: PUTOA, the size is %d.\n",(ob).lc.ival);\
                     49: }}}
                     50:
                     51: #define getoa(ob,i) ((ob.rc.op)[i])
                     52:
                     53: #define getoaSize(ob) ((ob).lc.ival)
                     54: /**************** end of macros from Kan/stackm.h *******************/
                     55:
                     56: /*   Interface functions from kanlib.a.  */
                     57: struct object KSpop();
                     58: void KSpush(struct object ob);
                     59: struct object KfindUserDictionary(char *s);
                     60: struct object KputUserDictionary(char *s,struct object ob);
                     61: struct object KnewErrorPacket(int serial,int no,char *s);
                     62: struct object KSmathCap(void);  /* defined plugin/cmo.c */
                     63: void *KSmathCapByStruct(void);  /* defined plugin/cmo.c */
                     64: char *popErrorStackByString(void);
                     65: struct object KSdupErrors(void);
                     66: struct object KpoInteger(int i);
1.2       takayama   67: struct object KSpeek(int k);
1.1       maekawa    68:

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