Called by parent program:
vc-seq.setl (Section A.39 [vc-seq.setl])
Calls child programs:
vc-autoinit.setl (Section A.3 [vc-autoinit.setl])
vc-clear.setl (Section A.6 [vc-clear.setl])
vc-comdev.setl (Section A.7 [vc-comdev.setl])
vc-init.setl (Section A.21 [vc-init.setl])
Textually #includes:
vc-msg.setl (Section A.30 [vc-msg.setl])
Source code: *
const yhwh = `vc-send.setl';
-- Low-level sender
-- This program is normally invoked from vc-send, which is
-- simply a setuid'd wrapper compiled from a C program containing
--
-- main() {
-- execl("$(SETL)", "setl", "vc-send.setl", 0);
-- }
--
-- where $(SETL) has been substituted with the absolute pathname of
-- the `setl' program (the SETL driver) by the Makefile.
com_dev := command_line(1) ? filter (`exec setl vc-comdev.setl');
com_fd := fileno open (com_dev, `w');
tie (stdin, stdout);
loop doing
read (frame);
while not eof do
if #frame = 1 then
case frame of
(`i'): system (`exec setl vc-init.setl');
(`c'): system (`exec setl vc-clear.setl');
(`a'): system (`exec setl vc-autoinit.setl');
else msg (`Unrecognized special command ' + pretty frame);
end case;
-- Some of the above operations will cause our next putc to the
-- device (com_fd) to fail horribly if we do not do this:
close (com_fd);
select (om, 300); -- wait 300 ms before reopening the device
com_fd := fileno open (com_dev, `w');
else
csum := #frame + 1 +/ [abs c : c in frame];
putc (com_fd, char (#frame + 1) + frame + char (-csum mod 256));
flush (com_fd);
end if;
print;
end loop;
#include ``vc-msg.setl''