[net.periphs] Anyone have code in C to interpret VT-100 sequences?

dave@utcsrgv.UUCP (Dave Sherman) (04/11/84)

I have an extensive CAI system which has assumptions about VT-100s
wired into it all over the place - in C programs, in text files,
and in (run-time interpreted) CAI files. I'm in the process of
making it terminal-independent, while not affecting its use on VT-100s.

I have figured out that the way to do it is to modify putc to
be a function (#undef putc) which checks the terminal type and
simply passes the data on if it's a VT-100, converting it if not.
When it gets an ESC, it will build up (with subsequent calls
to putc) a string which records the VT-100 sequence, and at the
end generate the appropriate sequence for the user's terminal.

Has anyone ever written the code in C to interpret the VT-100
sequences? It's not hard to do, but it's a rather long process.
I have to be able to take a string beginning with ESC
(e.g., "<ESC>[1;5m", figure out where it ends, and figure out
which termcap routines to call (e.g., bold(), ul() or whatever).
If someone's done all this already I'd *love* to get a copy.

Thanks.

Dave Sherman
The Law Society of Upper Canada
Toronto
ARPA: ihnp4!utcsrgv!dave@BERKELEY
UUCP: see below \|/
-- 
 {allegra,cornell,decvax,ihnp4,linus,utzoo}!utcsrgv!dave