Annotation of OpenXM/src/kxx/serversm.h, Revision 1.4
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: };
1.4 ! takayama 41: #define OINIT { .attr = NULL }
! 42:
1.1 maekawa 43: /********** macros to use Sarray **********************/
44: /* put to Object Array */
45: #define putoa(ob,i,cc) {\
46: if ((ob).tag != Sarray) {fprintf(stderr,"Warning: PUTOA is for an array of objects\n");} else \
47: {if ((0 <= (i)) && ((i) < (ob).lc.ival)) {\
48: (ob.rc.op)[i] = cc;\
49: }else{\
50: fprintf(stderr,"Warning: PUTOA, the size is %d.\n",(ob).lc.ival);\
51: }}}
52:
53: #define getoa(ob,i) ((ob.rc.op)[i])
54:
55: #define getoaSize(ob) ((ob).lc.ival)
56: /**************** end of macros from Kan/stackm.h *******************/
57:
58: /* Interface functions from kanlib.a. */
59: struct object KSpop();
60: void KSpush(struct object ob);
61: struct object KfindUserDictionary(char *s);
62: struct object KputUserDictionary(char *s,struct object ob);
63: struct object KnewErrorPacket(int serial,int no,char *s);
64: struct object KSmathCap(void); /* defined plugin/cmo.c */
65: void *KSmathCapByStruct(void); /* defined plugin/cmo.c */
66: char *popErrorStackByString(void);
67: struct object KSdupErrors(void);
68: struct object KpoInteger(int i);
1.2 takayama 69: struct object KSpeek(int k);
1.1 maekawa 70:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>