1 /* Loglan82 Compiler&Interpreter
\r
2 Copyright (C) 1981-1993 Institute of Informatics, University of Warsaw
\r
3 Copyright (C) 1993, 1994 LITA, Pau
\r
5 This program is free software; you can redistribute it and/or modify
\r
6 it under the terms of the GNU General Public License as published by
\r
7 the Free Software Foundation; either version 2 of the License, or
\r
8 (at your option) any later version.
\r
10 This program is distributed in the hope that it will be useful,
\r
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 GNU General Public License for more details.
\r
15 You should have received a copy of the GNU General Public License
\r
16 along with this program; if not, write to the Free Software
\r
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
\r
19 contacts: Andrzej.Salwicki@univ-pau.fr
\r
22 LITA Departement d'Informatique
\r
24 Avenue de l'Universite
\r
26 tel. ++33 59923154 fax. ++33 59841696
\r
28 =======================================================================
\r
31 #define send_par(par) theMessage.data.s[cnt++]=(short)(param[par].xword);
\r
32 #define send_shrt(wd) theMessage.data.s[cnt++]=(short)(wd);
\r
33 #define send_word(wd) theMessage.data.s[cnt++]=(short)((wd)&0xffff); \
\r
34 theMessage.data.s[cnt++]=(short)(((wd)>>16)&0xffff);
\r
38 theMessage.type=ClientMessage; \
\r
39 theMessage.format = 16; \
\r
40 theMessage.message_type = nrproc; \
\r
41 XSendEvent(theDisplay,theWindow,True,NoEventMask,&theMessage); \
\r
44 #define nxtev do XNextEvent( theDisplay, &retEv ); \
\r
45 while( retEv.type!=ClientMessage ); \
\r
48 #define rec_par(par) param[par].xword=(int)(retEv.xclient.data.s[cnt++]);
\r
49 #define rec_shrt(sh) sh = (int)(retEv.xclient.data.s[cnt++]);
\r
50 #define rec_word(wd) wd = (int)(retEv.xclient.data.s[cnt++]) & 0xffff; \
\r
51 wd |= (int)(retEv.xclient.data.s[cnt++]) << 16;
\r
56 if ((theDisplay = XOpenDisplay(NULL)) == NULL){
\r
57 fprintf (stderr,"\nint: Can't open display\n");
\r
60 myWindow = XCreateWindow(
\r
62 RootWindow(theDisplay,DefaultScreen(theDisplay)),
\r
64 CopyFromParent,InputOnly,CopyFromParent,
\r
67 if( (child_no=fork())==0 ){
\r
69 sprintf(me,"%d",(int)myWindow);
\r
70 execlp("herc","herc",me,NULL);
\r
75 rec_word(theWindow);
\r
79 if( graphmode == FALSE ) break;
\r
91 xystack[stackptr].x = curx;
\r
92 xystack[stackptr].y = cury;
\r
93 xystack[stackptr].fcol = fcol;
\r
94 xystack[stackptr].bcol = bcol;
\r
95 xystack[stackptr].style= style;
\r
98 if( stackptr == 16 ) stackptr--;
\r
106 if( stackptr < 0 ){
\r
111 curx = xystack[stackptr].x;
\r
112 cury = xystack[stackptr].y;
\r
113 fcol = xystack[stackptr].fcol;
\r
114 bcol = xystack[stackptr].bcol;
\r
115 style= xystack[stackptr].style;
\r
140 curx=param[0].xword;
\r
141 cury=param[1].xword;
\r
150 curx=param[0].xword;
\r
151 cury=param[1].xword;
\r
155 param[0].xword = curx;
\r
159 param[0].xword = cury;
\r
175 if( param[0].xword != 0 ) curx += 8;
\r
179 fcol = param[0].xword;
\r
185 bcol = param[0].xword;
\r
191 bcol = param[0].xword;
\r
200 curx=param[0].xword;
\r
201 cury=param[1].xword;
\r
208 char *s= (char *)(M + strings + param[ 0 ].xword + 1);
\r
209 int signs=M[ strings + param[ 0 ].xword ];
\r
233 word x=param[0].xword;
\r
234 word y=param[1].xword;
\r
235 word w = x - curx + 1;
\r
236 word h = y - cury + 1;
\r
239 if( w <= 0 ){ w=-w; x-=w; }
\r
240 if( h <= 0 ){ h=-h; y-=h; }
\r
248 newarry((word) 1, 3, (word)AINT, ¶m[ 2 ].xvirt, &am);
\r
258 if (member(¶m[ 0 ].xvirt, &am)){
\r
259 send_word( M[ am+3 ] )
\r
262 send_shrt( M[ am+4 ] )
\r
263 send_shrt( M[ am+5 ] )
\r
265 }else errsignal(RTEREFTN);
\r
270 patern((int *) ¶m[ 0 ].xword, (int *) ¶m[ 1 ].xword,
\r
271 (int *) ¶m[ 2 ].xword, (int *) ¶m[ 3 ].xword);
\r
275 intens((int *) ¶m[ 0 ].xword);
\r
279 pallet((int *) ¶m[ 0 ].xword);
\r
283 if (member(¶m[ 0 ].xvirt, &am))
\r
284 if (M[ am ] >= 0x8000L/sizeof(word))
\r
285 video(normalize((char *) &M[ am+3 ]));
\r
286 else errsignal(RTEILLAB);
\r
287 else errsignal(RTEREFTN);
\r
291 i = (int) param[ 1 ].xword;
\r
292 if (i == 0) graphmode = FALSE;
\r
294 if (i == 1) graphmode = TRUE;
\r
295 hpage((int *) ¶m[ 0 ].xword, &i,
\r
296 (int *) ¶m[ 2 ].xword);
\r
300 param[ 0 ].xword = nocard(NULL);
\r
314 if( child_no == 0 ) param[ 0 ].xword = inkey();
\r
321 param[ 0 ].xword = keycode;
\r
327 hfont((int *) ¶m[ 0 ].xword, (int *) ¶m[ 1 ].xword);
\r
331 param[ 0 ].xword = 0;
\r
332 param[ 1 ].xword = 0;
\r
333 hfont8((int *) ¶m[ 0 ].xword, (int *) ¶m[ 1 ].xword);
\r
339 double alfa,beta,aspect,abs; word kolb,wwyp;
\r
343 param[2].xword *= 2;
\r
345 alfa = (double)(param[3].xreal);
\r
346 beta = (double)(param[4].xreal);
\r
347 kolb = param[5].xword;
\r
348 wwyp = param[6].xword;
\r
350 aspect = (double)(param[7].xword) / (double)(param[8].xword);
\r
351 aspect *= (double)(param[2].xword);
\r
353 alfa = alfa / M_PI * 180.0 * 64.0 ;
\r
354 beta = beta / M_PI * 180.0 * 64.0 ;
\r
357 if( abs < 0.0 ) abs = -abs;
\r
361 send_shrt( (unsigned)aspect )
\r
362 send_shrt( (unsigned)alfa )
\r
363 send_shrt( (unsigned)beta )
\r
371 param[ 0 ].xbool = 2;
\r
372 param[ 1 ].xbool = lbool(1);
\r
405 case SETTHRESHOLD :
\r