|
|
1.1 root 1: /*
2: / This header file defines the I/O control blocks used by the
3: / UN*X operating system interface for the Macro Spitbol compiler.
4: */
5:
6: /*
7: / BLBLK - I/O buffer block
8: /
9: / All buffered I/O is passed through a BFBLK. This block is intentionally
10: / kept non-relocatable, so that it can be freely moved around the heap by
11: / the garbage collector.
12: */
13:
14: struct bfblk
15: {
16: WORD typ; /* type word */
17: WORD len; /* lenfth of bfblk */
18: WORD siz; /* size of buffer in bytes */
19: WORD rem; /* number of bytes remaining in buffer */
20: WORD off; /* offset to next position in buffer */
21: char buf[1]; /* buffer ([1] is kludge for C) */
22: };
23:
24: #define BFSIZE (sizeof struct bfblk - 1)
25:
26: /*
27: / FCBLK - file control block
28: /
29: / For every I/O association a FCBLK is created. All subsequent I/O
30: / operations are passed this block.
31: */
32:
33: struct fcblk
34: {
35: WORD typ; /* type word */
36: WORD len; /* length of fcblk */
37: WORD rsz; /* record size & mode */
38: struct ioblk *iob; /* pointer to IOBLK */
39: };
40:
41: #define FCSIZE (sizeof struct fcblk)
42:
43: /*
44: / IOBLK - I/O control block
45: /
46: / For every SPITBOL I/O channel there is one central IOBLK containing
47: / information about the channel: filename, file descriptor, IOBLK
48: / pointer, etc.
49: */
50:
51: struct ioblk
52: {
53: WORD typ; /* type word */
54: WORD len; /* length of IOBLK */
55: struct scblk *fnm; /* pointer to SCBLK holding filename */
56: WORD pid; /* process id for pipe */
57: struct bfblk *buf; /* pointer to BFBLK */
58: WORD fdn; /* file descriptor number */
59: WORD flg; /* flags */
60: };
61:
62: #define IOSIZE (sizeof struct ioblk)
63:
64: #define IO_INP 1
65: #define IO_OUP 2
66: #define IO_APP 4
67: #define IO_OPN 8
68: #define IO_EOF 16
69: #define IO_ERR 32
70: #define IO_SYS 64
71: #define IO_WRC 128
72: #define IO_PIP 256
73: #define IO_DED 512
74: #define IO_ILL 1024
75:
76: #define RECSIZ 1024
77: #define BUFSIZ 1024
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.