-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcleanup.c
45 lines (35 loc) · 892 Bytes
/
cleanup.c
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
37
38
39
40
41
42
43
44
45
#include "cpm.h"
#define FILL 0, " ", " ", 0, {0}, 0, {0}, 0, {0}, 0
/*
Default stdin, stdout and stderr to the console.
If PIPEMGR is detected by the start-up routine,
then it changes these to RSX:, RSX: and ERR: by
calling the _initrsx function.
*/
struct fcb _fcb[MAXFILE] =
{
{ FILL, U_CON }, /* stdin */
{ FILL, U_CON }, /* stdout */
{ FILL, U_CON }, /* stderr */
};
void _cpm_clean()
{
uchar i;
i = 0;
do
close(i);
while (++i < MAXFILE);
}
void _putrno(uchar *where, long rno)
{
where[0] = rno & 0xFF;
where[1] = (rno >> 8) & 0xFF;
where[2] = (rno >> 16) & 0xFF;
}
void _initrsx()
{
/* Use PIPEMGR for stdin, stdout and stderr redirection */
_fcb[0].use = U_RSX; /* stdin */
_fcb[1].use = U_RSX; /* stdout */
_fcb[2].use = U_ERR; /* stderr */
}