1 |
|
#ifndef lint |
2 |
< |
static const char RCSid[] = "$Id$"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
4 |
|
/* |
5 |
|
* Human-readable file I/O |
10 |
|
|
11 |
|
|
12 |
|
|
13 |
< |
#if CPM || MAC |
14 |
< |
#define getc agetc |
15 |
< |
#define putc aputc |
16 |
< |
#endif |
13 |
> |
static PRIMITIVE peof = {PEOF, 0200, {-1, -1, -1, -1}, NULL, NULL}; |
14 |
|
|
15 |
|
|
16 |
< |
static PRIMITIVE peof = {PEOF, 0200, -1, -1, -1, -1, NULL}; |
17 |
< |
|
18 |
< |
|
19 |
< |
readp(p, fp) /* get human-readable primitive */ |
20 |
< |
|
24 |
< |
PRIMITIVE *p; |
25 |
< |
FILE *fp; |
26 |
< |
|
16 |
> |
int |
17 |
> |
readp( /* get human-readable primitive */ |
18 |
> |
PRIMITIVE *p, |
19 |
> |
FILE *fp |
20 |
> |
) |
21 |
|
{ |
22 |
|
char inbuf[MAXARGS]; |
23 |
|
register int c, nargs; |
76 |
|
|
77 |
|
|
78 |
|
|
79 |
+ |
void |
80 |
+ |
writep( /* print primitive in human-readable form */ |
81 |
+ |
register PRIMITIVE *p, |
82 |
+ |
FILE *fp |
83 |
+ |
) |
84 |
|
|
86 |
– |
writep(p, fp) /* print primitive in human-readable form */ |
87 |
– |
|
88 |
– |
register PRIMITIVE *p; |
89 |
– |
FILE *fp; |
90 |
– |
|
85 |
|
{ |
86 |
|
|
87 |
|
if (fp == NULL) fp = stdout; |
111 |
|
|
112 |
|
|
113 |
|
|
114 |
+ |
void |
115 |
+ |
writeof( /* write end of file command to fp */ |
116 |
+ |
FILE *fp |
117 |
+ |
) |
118 |
|
|
121 |
– |
writeof(fp) /* write end of file command to fp */ |
122 |
– |
|
123 |
– |
FILE *fp; |
124 |
– |
|
119 |
|
{ |
120 |
|
|
121 |
|
writep(&peof, fp); |
122 |
|
|
123 |
< |
} |
123 |
> |
} |
124 |
> |
|