1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%
3% File:         PXNK:IO-DATA.SL
4% Description:  Data structures used by input and output
5% Author:       Eric Benson
6% Created:      4-May-84
7% Modified:     26-Jun-84 15:17:39
8% Status:       Open Source: BSD License
9% Package:
10%
11% (c) Copyright 1982, University of Utah
12%
13% Redistribution and use in source and binary forms, with or without
14% modification, are permitted provided that the following conditions are met:
15%
16%    * Redistributions of source code must retain the relevant copyright
17%      notice, this list of conditions and the following disclaimer.
18%    * Redistributions in binary form must reproduce the above copyright
19%      notice, this list of conditions and the following disclaimer in the
20%      documentation and/or other materials provided with the distribution.
21%
22% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25% PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNERS OR
26% CONTRIBUTORS
27% BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33% POSSIBILITY OF SUCH DAMAGE.
34%
35%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36%
37% Revisions:
38%
39% 27-May-87 (Harold Carr & Leigh Stoller)
40%  Added global declaration of $eol$.
41% 11-Aug-84 (Brian Beach)
42%  Changed linelength of channel 2 (bldmsg channel) to 0 (infinity).  This
43%  Prevents the insertion of extraneous linefeeds in built messages.
44% 4-May-84 11:20:48 (Brian Beach)
45%  Translated from RLISP to LISP.
46% Edit by Russ Fish, Mon Feb 27 21:02:56 1984
47%  Converted to system-independent I/O package, constants to io-const.red .
48% MLGriss, 9 July 1983
49%       Added TerminalWriteChar as "standard" function
50%       Renamed TerminalOutputHandler to TerminalWriteChar
51%       Added PAGEPOSITION warray
52%
53%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54
55(compiletime (load io-decls sys-macros))
56
57(global '($eol$))
58
59(declare-wstring tokenbuffer size maxtokensize)
60
61
62% All of these Channel WArrays have MaxChannels+1 (32) entries.
63
64(declare-warray readfunction initially
65                ('terminalinputhandler    % 0: StdIn!*
66                 'writeonlychannel        % 1: StdOut!*, StdErr!*, PromptOut!*
67                 'writeonlychannel        % 2: BldMsg()
68                 'compressreadchar        % 3: Compress()
69                 'writeonlychannel        % 4: FlatSize()
70                 'writeonlychannel        % 5: Unix!-StdErr!*
71                 'terminalinputhandler    % 6: Unix!-TTY!*
72                 'channelnotopen 'channelnotopen 'channelnotopen
73                 'channelnotopen 'channelnotopen 'channelnotopen
74                 'channelnotopen 'channelnotopen 'channelnotopen
75                 'channelnotopen 'channelnotopen 'channelnotopen
76                 'channelnotopen 'channelnotopen 'channelnotopen
77                 'channelnotopen 'channelnotopen 'channelnotopen
78                 'channelnotopen 'channelnotopen 'channelnotopen
79                 'channelnotopen 'channelnotopen 'channelnotopen
80                 'channelnotopen))
81
82(declare-warray writefunction initially
83                 ('readonlychannel        % 0: StdIn!*
84                  'independentwritechar   % 1: StdOut!*, StdErr!*, PromptOut!*
85                  'tostringwritechar      % 2: BldMsg()
86                  'explodewritechar       % 3: Explode()
87                  'flatsizewritechar      % 4: FlatSize()
88                  'independentwritechar   % 5: Unix!-StdErr!*
89                  'readonlychannel        % 6: Unix!-TTY!*
90                  'channelnotopen 'channelnotopen 'channelnotopen
91                  'channelnotopen 'channelnotopen 'channelnotopen
92                  'channelnotopen 'channelnotopen 'channelnotopen
93                  'channelnotopen 'channelnotopen 'channelnotopen
94                  'channelnotopen 'channelnotopen 'channelnotopen
95                  'channelnotopen 'channelnotopen 'channelnotopen
96                  'channelnotopen 'channelnotopen 'channelnotopen
97                  'channelnotopen 'channelnotopen 'channelnotopen
98                  'channelnotopen))
99
100(declare-warray closefunction initially
101                 ('illegalstandardchannelclose % 0: StdIn!*
102                  'illegalstandardchannelclose % 1: StdOut!*, StdErr!*, PromptOut!*
103                  'illegalstandardchannelclose % 2: BldMsg()
104                  'illegalstandardchannelclose % 3: Compress()/Expand()
105                  'illegalstandardchannelclose % 4: FlatSize()
106                  'illegalstandardchannelclose % 5: Unix!-StdErr!*
107                  'illegalstandardchannelclose % 6: Unix!-TTY!*
108                  'channelnotopen 'channelnotopen 'channelnotopen
109                  'channelnotopen 'channelnotopen 'channelnotopen
110                  'channelnotopen 'channelnotopen 'channelnotopen
111                  'channelnotopen 'channelnotopen 'channelnotopen
112                  'channelnotopen 'channelnotopen 'channelnotopen
113                  'channelnotopen 'channelnotopen 'channelnotopen
114                  'channelnotopen 'channelnotopen 'channelnotopen
115                  'channelnotopen 'channelnotopen 'channelnotopen
116                  'channelnotopen))
117
118(declare-warray unreadbuffer size maxchannels)
119(declare-warray lineposition size maxchannels)
120(declare-warray pageposition size maxchannels)
121(declare-warray maxline initially
122           (0 80 0 0 0 80 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
123              0 0 0 0 0 0))
124  % 0: StdIn!*
125  % 1: StdOut!*, StdErr!*, PromptOut!*
126  % 2: BldMsg()
127  % 3: Compress()/Explode()
128  % 4: FlatSize()
129  % 5: Unix!-StdErr!*
130  % 6: Unix!-TTY!*
131
132(declare-warray channelstatus initially
133                 (channelopenread       % 0: StdIn!*
134                  channelopenwrite      % 1: StdOut!*, StdErr!*, PromptOut!*
135                  channelopenspecial    % 2: BldMsg()
136                  channelopenspecial    % 3: Compress()/Explode()
137                  channelopenspecial    % 4: FlatSize()
138                  channelopenwrite      % 5: Unix!-StdErr!*
139                  channelopenread       % 6: Unix!-TTY!*
140                  channelclosed channelclosed channelclosed channelclosed
141                  channelclosed channelclosed channelclosed channelclosed
142                  channelclosed channelclosed channelclosed channelclosed
143                  channelclosed channelclosed channelclosed channelclosed
144                  channelclosed channelclosed channelclosed channelclosed
145                  channelclosed channelclosed channelclosed channelclosed
146                  channelclosed))
147
148(declare-warray maxbuffer size maxchannels)
149(declare-warray channeltable size maxchannels)
150(declare-warray nextposition size maxchannels)
151(declare-warray bufferlength size maxchannels)
152
153(setq $eol$ (mkitem id-tag 10))
154
155