
     CONVERTING BSD fc,fs,xc,xs PARAMETERS TO PLP ty FORMAT:
     -------------------------------------------------------

One of the worst things about old LPDs is that they expected you
to give it line characteristics as octal numbers, using the
fc,fs,xc,xs printcap parameters. There are a number of disadvantages
to this, compared to using the "ty" parameter.

The ty format is portable, as it is supported on all UNIXes, rather
than simply BSD-derived ones; it's also _much_ easier to understand
than the fc,fs,xc,xs format -- compare these lines:

	:ty=pass8 -parity tabs litout nl:

	:fc#0000374:fs#0000003:xc#0:xs#0040040:

Note, also, that "ty" uses the same symbolic names as the "stty"
command, which is (relatively) well documented.

Anyway, assuming you have a set of printcaps which use the fc,fs,xc,xs
method, you can convert them to "ty" strings using the following
table.

Each parameter is an octal number, composed by logical-or'ing the 
bits for the desired parameters together.  The bit patterns below
have been worked out from SunOS 4.1.2 /usr/include/sys/ttold.h.

For example, the following fc,fs,xc,xs set:

	:fc#0000374:fs#0000003:xc#0:xs#0040040:

converts to the following ty string:

	:ty=-anyp -echo -crmod -raw -lcase tandem cbreak litout decctq:

Quite often, the resulting strings seem a little complicated, but
usually they can be broken down using combination modes. See the 
printcap(5) manual page for details of which combination modes
PLP supports.

Good luck!

--j.

Justin Mason, 19 Jan 1995.

Bits used in the fc, fs parameters:

	  TANDEM	00000001	/* send stopc on out q full */
	  CBREAK	00000002	/* half-cooked mode */
	  LCASE		00000004	/* simulate lower case */
	  ECHO		00000010	/* echo input */
	  CRMOD		00000020	/* map \r to \r\n on output */
	  RAW		00000040	/* no i/o processing */
	  ODDP		00000100	/* get/send odd parity */
	  EVENP		00000200	/* get/send even parity */
	  ANYP		00000300	/* get any parity/send none */

	  NLDELAY	00001400	/* \n delay */
		  NL0	00000000
		  NL1	00000400	/* tty 37 */
		  NL2	00001000	/* vt05 */
		  NL3	00001400

          TBDELAY       00006000        /* horizontal tab delay */
                  TAB0  00000000
                  TAB1  00002000        /* tty 37 */
                  TAB2  00004000

          XTABS         00006000        /* expand tabs on output */

          CRDELAY       00030000        /* \r delay */
                  CR0   00000000
                  CR1   00010000        /* tn 300 */
                  CR2   00020000        /* tty 37 */
                  CR3   00030000        /* concept 100 */

          VTDELAY       00040000        /* vertical tab delay */
                  FF0   00000000
                  FF1   00040000        /* tty 37 */

          BSDELAY       00100000        /* \b delay */
                  BS0   00000000
                  BS1   00100000

	ALLDELAY	00177400

bits used in the xc, xs parameters:
	
          CRTBS         00000001        /* do backspacing for crt */
          PRTERA        00000002        /* \ ... / erase */
          CRTERA        00000004        /* " \b " to wipe out char */
          TILDE         00000010        /* hazeltine tilde kludge */
          MDMBUF        00000020        /* start/stop output on carrier intr */
          LITOUT        00000040        /* literal output */
          TOSTOP        00000100        /* SIGSTOP on background output */
          FLUSHO        00000200        /* flush output to terminal */
          NOHANG        00000400        /* no SIGHUP on carrier drop */
          CRTKIL        00002000        /* kill line with " \b " */
          PASS8         00004000	/* pass 8 bits */
          CTLECH        00010000        /* echo control chars as ^X */
          PENDIN        00020000        /* tp->t_rawq needs reread */
          DECCTQ        00040000	/* only ^Q starts after ^S */
          NOFLSH        00100000	/* no output flush on signal */

