home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!auspex-gw!guy
- From: guy@Auspex.COM (Guy Harris)
- Newsgroups: comp.sys.sun.admin
- Subject: Re: deciphering printcap fc,fs,xc,xs fields
- Message-ID: <16088@auspex-gw.auspex.com>
- Date: 24 Dec 92 23:10:27 GMT
- References: <9960@fs3.cam.nist.gov>
- Sender: news@auspex-gw.auspex.com
- Organization: Auspex Systems, Santa Clara
- Lines: 65
- Nntp-Posting-Host: auspex.auspex.com
-
- >Does anyone know how to decipher the fc,fs,xc, and xs fields
- >in /etc/printcap?
- >
- >The values these fields have in my printcap file are:
- >
- > :fc#0000374:fs#0000003:xc#0:xs#0040040:
-
- To quote PRINTCAP(5):
-
- CAPABILITIES
- Name Type Default Description
-
- ...
-
- fc num 0 if lp is a tty, clear
- flag bits
-
- ...
-
- fs num 0 like `fc' but set bits
-
- ...
-
- xc num 0 if lp is a tty, clear
- local mode bits
- xs num 0 like `xc' but set bits
-
- ...
-
- Note: the fs, fc, xs, and xc fields are flag masks rather
- than flag values. Certain default device flags are set when
- the device is opened by the line printer daemon if the dev-
- ice is connected to a terminal port. The flags indicated in
- the fc field are then cleared; the flags in the fs field are
- then set (or vice-versa, depending on the order of fc#nnnn
- and fs#nnnn in the /etc/printcap file). The bits cleared by
- the fc field and set by the fs field are those in the
- sg_flags field of the sgtty structure, as set by the
- TIOCSETP ioctl call, and the bits cleared by the xc field
- and set by the xs field are those in the "local flags" word,
- as set by the TIOCLSET ioctl call. See ttcompat(4M) for a
- description of these flags. For example, to set exactly the
- flags 06300 in the fs field, which specifies that the EVENP,
- ODDP, and XTABS modes are to be set, and all other flags are
- to be cleared, do:
- :fc#0177777:fs#06300:
-
- The same process applies to the xc and xs fields. Alterna-
- tively, the ms field can be used to specify modes to be set
- and cleared. These modes are specified as stty(1V) modes;
- any mode supported by stty may be specified, except for the
- baud rate which must be specified with the br field. This
- permits modes not supported by the older terminal interface
- described in ttcompat(4M) to be set or cleared. Thus, to set
- the terminal port to which the printer is attached to even
- parity, TAB expansion, no NEWLINE to RETURN/LINEFEED trans-
- lation, and RTS/CTS flow control enabled, do:
- :ms=evenp,-tabs,nl,crtscts:
-
- The modes in "fc", "fs", "xc", and "xs" are octal; you have to infer
- that from the document, because it never comes out and just *says* so.
-
- Pretty gross, eh? Now you know why I put the "ms" capability into the
- 4.0 printer stuff - no gross octal numbers, just "stty"-style
- strings....
-