| 8 |
|
#include "meta.h" |
| 9 |
|
|
| 10 |
|
|
| 11 |
+ |
static PRIMITIVE peof = {PEOF, 0200, {-1, -1, -1, -1}, NULL, NULL}; |
| 12 |
|
|
| 12 |
– |
static PRIMITIVE peof = {PEOF, 0200, -1, -1, -1, -1, NULL}; |
| 13 |
|
|
| 14 |
|
|
| 15 |
– |
|
| 15 |
|
#define INTARG(n) (((unsigned)inbuf[n] << 7) | (unsigned)inbuf[n+1]) |
| 16 |
|
|
| 17 |
|
|
| 18 |
+ |
int |
| 19 |
+ |
readp( /* read in primitive from file */ |
| 20 |
+ |
PRIMITIVE *p, |
| 21 |
+ |
FILE *fp |
| 22 |
+ |
) |
| 23 |
|
|
| 20 |
– |
readp(p, fp) /* read in primitive from file */ |
| 21 |
– |
|
| 22 |
– |
PRIMITIVE *p; |
| 23 |
– |
FILE *fp; |
| 24 |
– |
|
| 24 |
|
{ |
| 25 |
|
char inbuf[MAXARGS]; |
| 26 |
|
register int c, nargs; |
| 91 |
|
#define LO7(i) (i & 0177) |
| 92 |
|
|
| 93 |
|
|
| 94 |
< |
|
| 95 |
< |
writep(p, fp) /* write primitive to file */ |
| 96 |
< |
|
| 97 |
< |
register PRIMITIVE *p; |
| 98 |
< |
FILE *fp; |
| 100 |
< |
|
| 94 |
> |
void |
| 95 |
> |
writep( /* write primitive to file */ |
| 96 |
> |
register PRIMITIVE *p, |
| 97 |
> |
FILE *fp |
| 98 |
> |
) |
| 99 |
|
{ |
| 102 |
– |
|
| 100 |
|
if (fp == NULL) fp = stdout; |
| 101 |
|
|
| 102 |
|
if (!iscom(p->com)) |
| 128 |
|
#undef LO7 |
| 129 |
|
|
| 130 |
|
|
| 131 |
< |
|
| 132 |
< |
|
| 133 |
< |
writeof(fp) /* write end of file command to fp */ |
| 134 |
< |
|
| 138 |
< |
FILE *fp; |
| 139 |
< |
|
| 131 |
> |
void |
| 132 |
> |
writeof( /* write end of file command to fp */ |
| 133 |
> |
FILE *fp |
| 134 |
> |
) |
| 135 |
|
{ |
| 141 |
– |
|
| 136 |
|
writep(&peof, fp); |
| 137 |
+ |
} |
| 138 |
|
|
| 144 |
– |
} |