home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sun / admin / 9730 < prev    next >
Encoding:
Internet Message Format  |  1992-12-24  |  3.0 KB

  1. Path: sparky!uunet!auspex-gw!guy
  2. From: guy@Auspex.COM (Guy Harris)
  3. Newsgroups: comp.sys.sun.admin
  4. Subject: Re: deciphering printcap fc,fs,xc,xs fields
  5. Message-ID: <16088@auspex-gw.auspex.com>
  6. Date: 24 Dec 92 23:10:27 GMT
  7. References: <9960@fs3.cam.nist.gov>
  8. Sender: news@auspex-gw.auspex.com
  9. Organization: Auspex Systems, Santa Clara
  10. Lines: 65
  11. Nntp-Posting-Host: auspex.auspex.com
  12.  
  13. >Does anyone know how to decipher the fc,fs,xc, and xs fields 
  14. >in /etc/printcap?
  15. >
  16. >The values these fields have in my printcap file are:
  17. >
  18. >        :fc#0000374:fs#0000003:xc#0:xs#0040040:
  19.  
  20. To quote PRINTCAP(5):
  21.  
  22.     CAPABILITIES
  23.          Name Type Default            Description
  24.  
  25.         ...
  26.  
  27.          fc   num  0                  if   lp   is   a   tty,   clear
  28.                                       flag                       bits
  29.  
  30.         ...
  31.  
  32.          fs   num  0                  like   `fc'   but   set    bits
  33.  
  34.         ...
  35.  
  36.          xc   num  0                  if   lp   is   a   tty,   clear
  37.                                       local         mode         bits
  38.          xs   num  0                  like `xc' but set bits
  39.  
  40.     ...
  41.  
  42.      Note: the fs, fc, xs, and xc fields are  flag  masks  rather
  43.      than flag values.  Certain default device flags are set when
  44.      the device is opened by the line printer daemon if the  dev-
  45.      ice is connected to a terminal port.  The flags indicated in
  46.      the fc field are then cleared; the flags in the fs field are
  47.      then  set  (or vice-versa, depending on the order of fc#nnnn
  48.      and fs#nnnn in the /etc/printcap file).  The bits cleared by
  49.      the  fc  field  and  set  by  the  fs field are those in the
  50.      sg_flags field  of  the  sgtty  structure,  as  set  by  the
  51.      TIOCSETP  ioctl  call,  and the bits cleared by the xc field
  52.      and set by the xs field are those in the "local flags" word,
  53.      as  set  by the TIOCLSET ioctl call.  See ttcompat(4M) for a
  54.      description of these flags.  For example, to set exactly the
  55.      flags 06300 in the fs field, which specifies that the EVENP,
  56.      ODDP, and XTABS modes are to be set, and all other flags are
  57.      to be cleared, do:
  58.           :fc#0177777:fs#06300:
  59.  
  60.      The same process applies to the xc and xs fields.   Alterna-
  61.      tively,  the ms field can be used to specify modes to be set
  62.      and cleared.  These modes are specified as  stty(1V)  modes;
  63.      any  mode supported by stty may be specified, except for the
  64.      baud rate which must be specified with the br  field.   This
  65.      permits  modes not supported by the older terminal interface
  66.      described in ttcompat(4M) to be set or cleared. Thus, to set
  67.      the  terminal  port to which the printer is attached to even
  68.      parity, TAB expansion, no NEWLINE to RETURN/LINEFEED  trans-
  69.      lation, and RTS/CTS flow control enabled, do:
  70.           :ms=evenp,-tabs,nl,crtscts:
  71.  
  72. The modes in "fc", "fs", "xc", and "xs" are octal; you have to infer
  73. that from the document, because it never comes out and just *says* so.
  74.  
  75. Pretty gross, eh?  Now you know why I put the "ms" capability into the
  76. 4.0 printer stuff - no gross octal numbers, just "stty"-style
  77. strings....
  78.