[comp.unix.questions] Getting around terminfo/termcap limitations

james@parkridge.UUCP (08/18/87)

In article <4125@ncoast.UUCP> allbery@ncoast.UUCP (Brandon Allbery) writes:
>As quoted from <1377@chinet.UUCP> by randy@chinet.UUCP (Randy Suess):
>+---------------
>| In article <449@ambush.UUCP> kimcm@ambush.UUCP (Kim Chr. Madsen) writes:
>| >But also
>| >the disadvantage of not being able to add new attributes to the files.
>| 
>| 	Sure you can.  SysVr2 comes with the tic (terminfo compiler) that
>| 	allows you to replace any entry in the /usr/lib/terminfo/* that
>| 	you want.  There are public domain termcap - to - terminfo
>+---------------
>
>I think what he means is that you can't invent your own attributes and add
>them to the terminfo description.  Say, something like:
>
># new command 'ctr' moves to the center of the screen
>test-vt100|VT100 with a new attribute,
>	ctr=\E[12;40H, tc=vt100,
>
>will fail -- you can't use the 'ctr' command.

This is exactly the kind of problem we were having here(SunOS 3.0 - Sun 3/52).
In particular, we wanted to be able to define both characters and attributes
for use in drawing frames around windows on an ASCII terminal.
We also wanted to be able to add other new features as we thought of them or
as they became available without having to recompile every program that used
terminfo.

What we ended up doing was writing our own version on terminfo and tic which
we call tic/toc :-)

Toc is a program that controls a database containing all of the capabilities
that a terminal may have.  If you wish to add or delete one, you have to go
through this first.

Tic is our version of the current 'tic' except that it produces a file that
is only as big as is needed to hold all of the information on the capabilities
the specified terminal requires.

Along with these two we also had to write our own versions of the
terminfo-level routines like tparm(), tputs(), tgetent(), etc.  These routines
are compiled into a library along with a file produced by the toc program
that specifies where the capabilities are within the compiled files tic
creates.

The good thing is that you can add a capability to the database, recompile
the file produced by toc and place it in the library, re-tic any entries
that use the new capability and still run all of your code as is.  As far
as it is concerned, the new feature doesn't exist.

Well, enough run-on...If you want more information, check out the posting in
mod.newprod, drop us a line, or give us a call.
-- 
  ___________________________________________________________________________
 |                                                                           |
 |        James R. Sheridan                 Parkridge Computer Systems Inc.  |
 |                                                                           |
 |  ..utzoo!parkridge!pcssun!james          Oakville Corporate Centre        |
 |                                          710 Dorval Drive,  Suite 115     |
 |   YOU can help wipe out COBOL in         Oakville, Ontario, CANADA        |
 |          our lifetime!!                  L6K 3V7     (416) 842-6873       |
 |___________________________________________________________________________|