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

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

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

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