3 /** maximum special value of mark */
4 #define MAXMARKER MAXINTEGER
6 /** maximum appetite (easily extensible ?) */
7 #define MAXAPPT MAXINTEGER
9 /** maximum number of trace messages in line */
12 /** maximum length of formal procedure header */
15 /** maximum number of a system signal */
18 /** maximum number of params to standard proc */
21 /** size of I/O transfer block in bytes */
22 #define IOBLOCK 0x4000
24 /* Object structure : */
26 /* Offsets from the beginning : */
27 /** prototype number */
29 /** link to same size list (killed only) */
31 /** link to other size list (killed only) */
36 /* prot number 1 always FILEOBJECT */
39 /* flag to tell if file is temporary */
43 /* file name pointer */
46 #define FFILE (FNAME + sizeof(char *) / sizeof(word))
47 /** appetite of file object */
48 #define APFILE (FFILE + sizeof(FILE *) / sizeof(word))
51 * \defgroup ObjectOffests Offsets from the first address after object
63 /** number of times the object occurs in SL */
66 /** signal number (handlers only) */
69 /** remote dynamic link (procedures only) */
72 /** coroutine link (coroutine only) */
75 /** coroutine head (process only) */
78 /** virtual scratch (process only) */
83 * Virtual address (also formal type)
87 * address of dictionary item
88 * node and process index for processes
89 * or for formal types - number of arrayof
94 * negative for processes or for formal types - actual type
99 #define loadvirt(v, a) { word ta; \
101 (v).addr = M[ ta++ ]; \
102 (v).mark = M[ ta ]; }
103 #define storevirt(v, a) { word ta; \
105 M[ ta++ ] = (v).addr; \
106 M[ ta ] = (v).mark; }
108 #define MF(a) (*( (FILE **) (M+(a)) ))
109 #define MN(a) (*( (char **) (M+(a)) ))
110 #define MR(a) *( (real *) (M+(a)) )
121 #define min(x, y) ((x) < (y) ? (x) : (y))
122 #define max(x, y) ((x) > (y) ? (x) : (y))
123 #define absolute(x) ((x) >= 0 ? (x) : -(x))
126 * \defgroup LoglanBooleans LOGLAN's booleans
129 #define LFALSE ((word)0)
130 #define LTRUE (~LFALSE)
131 #define lbool(b) ( (b) ? LTRUE : LFALSE )
135 * \defgroup FileTypes Type of files
144 /** file of integer */
150 /** direct access file */
155 * \defgroup FileStatus File status
158 /** sequential file opened for read */
161 /** sequential file opened for write */
164 /** direct access file */
167 /** file not opened */
173 * \defgroup RuntimeErrorTypes Run time error types :
176 /** SL chain cut off */
179 /** unimplemented standard procedure */
182 /** illegal attach */
185 /** illegal detach */
188 /** coroutine terminated */
191 /** coroutine active */
194 /** array index error */
197 /** incorrect array bounds */
203 /** illegal assignment */
206 /** formal type missing */
215 /** incompatible headers */
218 /** handler not found */
221 /** memory overflow */
224 /** formal header too long */
227 /** illegal return */
230 /** reference to NONE */
233 /** division by zero */
239 /** illegal I/O operation */
245 /** Cannot open file */
248 /** Input data format bad */
251 /** illegal resume */
254 /** too many processes on one machine */
257 /** invalid node number */
260 /** negative step value */
263 /** only process may be global */
275 #define MAXINSTANCE 255
278 * \defgroup Variables Variables
281 /** main memory for code and data */
284 /** pointer to standard proc. param list */
285 extern union value *param;
287 /** offset conversion table for compact. */
290 /** signal to number conversion table */
293 /** appetites of primitive types */
294 extern int primapet[];
296 /** instruction counter */
299 /** previous ic for redecoding after comp. */
302 /** opcode of L-code instruction */
305 /** arguments of L-code instruction */
306 extern word a1, a2, a3;
312 * \defgroup KernelVariables kernel variables for the running system
315 /** size of memory array for code and data */
316 extern word memorysize;
318 /** DISPLAY offset in process object */
321 /** indirect DISPLAY offset in process object */
322 extern word disp2off;
324 /** DISPLAY address - physical addresses */
327 /** DISPLAY address - indirect addresses */
328 extern word display2;
330 /** pointers to current object */
333 /** main block object */
334 extern word mainprog;
336 /** offset of variable main */
339 /* TODO: Does this groups ends here ?*/
342 /** TRUE if compactification message printed */
345 /** TRUE if trace is printed */
348 /** output file for trace */
349 extern FILE *tracefile;
351 /** is graphics active ? */
354 /** for continue execution */
355 extern jmp_buf contenv;
357 extern int internal_sock,graph_sock,net_sock;
358 extern int connected;
364 extern char ProgName[255];
365 extern ctx_struct my_ctx;
366 extern void send_to_graph(G_MESSAGE*);
367 extern int read_from_graph(G_MESSAGE*);
368 extern int read_from_net(MESSAGE*);
369 extern char mygname[80],mykname[80],mynname[80];
370 extern int DirConn[MAXINSTANCE];