File: prescheme.h

package info (click to toggle)
scsh 0.5.1-2
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 6,540 kB
  • ctags: 8,656
  • sloc: lisp: 39,346; ansic: 13,466; sh: 1,669; makefile: 624
file content (36 lines) | stat: -rw-r--r-- 1,080 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

#include <errno.h>

#define PS_GETC(PORT,RESULT)      /* RESULT = getc(PORT); */ \
/* optional definition for Unixes that are even more losing than usual */ \
{                                          \
  FILE * TTport = PORT;			   \
  int errorp;				   \
  while (EOF == (RESULT = getc(TTport))	   \
	 && (errorp = ferror(TTport),	   \
	     clearerr(TTport),		   \
	     (errorp && errno == EINTR)))  \
    ;					   \
}
/* The trouble with the above is that all read errors look like
   EOF's.  */

/* C shifts may not work if the amount is greater than the machine word size */
/* Patched by JAR 6/6/93 */

#define PS_SHIFT_RIGHT(X,Y,RESULT)   \
{                                    \
  long TTx = X,  TTy = Y;            \
  RESULT = TTy >= 32 ? (TTx < 0 ? -1 : 0) : TTx >> TTy; \
}  

#define PS_SHIFT_LEFT(X,Y,RESULT)    \
{                                    \
  long TTy = Y;                      \
  RESULT = TTy >= 32 ? 0 : X << TTy; \
}  

#define PS_SMALL_MULTIPLY(x,y) ((x) * (y))

extern long TTreturn_value, TTrun_machine();
extern FILE *ps_open(char *, char *);