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