[BACK]Return to printcap.5 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / man / man5

File: [cvs.NetBSD.org] / src / share / man / man5 / printcap.5 (download)

Revision 1.27, Sun Apr 22 10:18:47 2012 UTC (11 years, 11 months ago) by wiz
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, agc-symver-base, agc-symver
Changes since 1.26: +2 -2 lines

Sort SEE ALSO.

.\"	$NetBSD: printcap.5,v 1.27 2012/04/22 10:18:47 wiz Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     @(#)printcap.5	8.2 (Berkeley) 12/11/93
.\"
.Dd April 5, 2012
.Dt PRINTCAP 5
.Os
.Sh NAME
.Nm printcap
.Nd printer capability data base
.Sh SYNOPSIS
.Nm printcap
.Sh DESCRIPTION
The
.Nm
data base is used to describe line printers.
The spooling system accesses the
.Nm printcap
file every time it is used, allowing dynamic
addition and deletion of printers.
Each entry in the data base is used to describe one printer.
.Pp
The default printer is normally
.Em lp ,
though the environment variable
.Ev PRINTER
may be used to override this.
Each spooling utility supports an option,
.Fl P Ar printer ,
to allow explicit naming of a destination printer.
.Pp
Refer to the
.%T "4.3 BSD Line Printer Spooler Manual"
for a complete discussion on how to set up the database for a given printer.
.Sh CAPABILITIES
Refer to
.Xr capfile 5
for a description of the file layout.
.Bl -column Name Type "/var/spool/output/lpd"
.It Sy Name	Type	Default	Description
.It "af	str" Ta Dv NULL Ta No "name of accounting file"
.It "br	num	none	if lp is a tty, set the baud rate"
.Pf ( Xr ioctl 2
call)
.It "cf	str" Ta Dv NULL Ta No "cifplot data filter"
.It "df	str" Ta Dv NULL Ta No "tex data filter"
.Pf ( Tn DVI
format)
.It "fc	num	0	if lp is a tty, clear flag bits"
.Pq Pa sgtty.h
.It "ff	str" Ta So Li \ef Sc Ta No "string to send for a form feed"
.It "fo	bool	false	print a form feed when device is opened"
.It "fs	num	0	like `fc' but set bits"
.It "gf	str" Ta Dv NULL Ta No "graph data filter"
.Pf ( Xr plot 3
format
.It "hl	bool	false	print the burst header page last"
.It "ic	bool	false	driver supports (non standard) ioctl to indent printout"
.It "if	str" Ta Dv NULL Ta No "name of text filter which does accounting"
.It "lf	str" Ta Pa /dev/console Ta No "error logging file name"
.It "lo	str" Ta Pa lock Ta No "name of lock file"
.It "lp	str" Ta Pa /dev/lp Ta No "device name to open for output to local \
printer, or port@host for remote printer/printer on print server"
.It "ms	str" Ta Dv NULL Ta No "list of terminal modes to set or clear"
.It "mx	num	1000	maximum file size (in"
.Dv BUFSIZ
blocks), zero = unlimited
.It "nd	str" Ta Dv NULL Ta No "next directory for list of queues (unimplemented)"
.It "nf	str" Ta Dv NULL Ta No "ditroff data filter (device independent troff)"
.It "of	str" Ta Dv NULL Ta No "name of output filtering program"
.It "pc	num	200	price per foot or page in hundredths of cents"
.It "pf	str" Ta Dv NULL Ta No "filter for printing"
.Tn PostScript
files
.It "pl	num	66	page length (in lines)"
.It "pw	num	132	page width (in characters)"
.It "px	num	0	page width in pixels (horizontal)"
.It "py	num	0	page length in pixels (vertical)"
.It "rf	str" Ta Dv NULL Ta No "filter for printing"
.Tn FORTRAN
style text files
.It "rg	str" Ta Dv NULL Ta No "restricted group. Only members of group allowed access"
.It "rm	str" Ta Dv NULL Ta No "machine name for remote printer or port@host \
for a remote printer on a port other than the standard port."
.Po
also suppress the burst page, see
.Sx NOTES
.Pc
.It "rp	str	``lp''	remote printer name argument"
.It "rs	bool	false	restrict remote users to those with local accounts"
.It "rw	bool	false	open the printer device for reading and writing"
.It "sb	bool	false	short banner (one line only)"
.It "sc	bool	false	suppress multiple copies"
.It "sd	str" Ta Pa /var/spool/output/lpd Ta No "spool directory"
.It "sf	bool	false	suppress form feeds"
.It "sh	bool	false	suppress printing of burst page header"
.Po
local only, see
.Sx NOTES
.Pc
.It "st	str" Ta Pa status Ta No "status file name"
.It "tf	str" Ta Dv NULL Ta No "troff data filter (cat phototypesetter)"
.It "tr	str" Ta Dv NULL Ta No "trailer string to print when queue empties"
.It "vf	str" Ta Dv NULL Ta No "raster image filter"
.It "xc	num	0	if lp is a tty, clear local mode bits"
.Pq Xr tty 4
.It "xs	num	0	like `xc' but set bits"
.El
.Pp
If the local line printer driver supports indentation, the daemon
must understand how to invoke it.
.Sh FILTERS
If a printer is specified via
.Sy lp
(either local or remote),
the
.Xr lpd 8
daemon creates a pipeline of
.Em filters
to process files for various printer types.
The pipeline is not set up for remote printers specified via
.Sy rm
unless the local host is the same as the remote printer host
given.
The filters selected depend on the flags passed to
.Xr lpr 1 .
The pipeline set up is:
.Bd -literal -offset indent
p	pr | if	regular text + pr(1)
none	if	regular text
c	cf	cifplot
d	df	DVI (tex)
g	gf	plot(3)
n	nf	ditroff
o	pf	PostScript
f	rf	Fortran
t	tf	troff
v	vf	raster image
.Ed
.Pp
The
.Sy if
filter is invoked with arguments:
.Bd -filled -offset indent
.Cm if
.Op Fl c
.Fl w Ns Ar width
.Fl l Ns Ar length
.Fl i Ns Ar indent
.Fl n Ar login
.Op Fl j Ar jobname
.Fl h Ar host acct-file
.Ed
.Pp
The
.Fl c
flag is passed only if the
.Fl l
flag (pass control characters literally)
is specified to
.Xr lpr 1 .
The
.Ar width
and
.Ar length
specify the page width and length
(from
.Cm pw
and
.Cm pl
respectively) in characters.
The
.Fl n
and
.Fl h
parameters specify the login name and host name of the owner
of the job respectively.
The
.Fl j
parameter is optional and specifies the name of the print
job if available.
The
.Ar acct-file
option is passed from the
.Cm af
.Nm printcap
entry.
.Pp
If no
.Cm if
is specified,
.Cm of
is used instead,
with the distinction that
.Cm of
is opened only once,
while
.Cm if
is opened for every individual job.
Thus,
.Cm if
is better suited to performing accounting.
The
.Cm of
is only given the
.Ar width
and
.Ar length
flags.
.Pp
All other filters are called as:
.Bd -filled -offset indent
.Nm filter
.Fl x Ns Ar width
.Fl y Ns Ar length
.Fl n Ar login
.Op Fl j Ar jobname
.Fl h Ar host acct-file
.Ed
.Pp
where
.Ar width
and
.Ar length
are represented in pixels,
specified by the
.Cm px
and
.Cm py
entries respectively.
.Pp
All filters take
.Em stdin
as the file,
.Em stdout
as the printer,
may log either to
.Em stderr
or using
.Xr syslog 3 ,
and must not ignore
.Dv SIGINT .
.Pp
Filters can communicate errors to lpd by their exit code and by modifying
the mode of the spool lock file as follows:
.Bl -tag -width Exit-code -compact -offset indent
.It Sy Exit code
.Sy Description
.It 0
Success.
.It 1
An attempt is made to reprint the job and mail is sent if it fails.
.It 2
.Xr lpd 8
silently discards the job.
.It n
.Xr lpd 8
discards the job and mail is sent.
.El
.Bl -tag -width lockxmode -compact -offset indent
.It Sy lock code
.Sy Description
.It u+x
Stop printing and leave queue disabled (S_IXUSR).
.It o+x
Rebuild the queue (S_IXOTH).
.El
.Sh LOGGING
Error messages generated by the line printer programs themselves
(that is, the lp* programs) are logged by
.Xr syslog 3
using the
.Dv LPR
facility.
Messages printed on
.Em stderr
of one of the filters are sent to the corresponding
.Cm lf
file.
The filters may, of course, use
.Xr syslog 3
themselves.
.Pp
Error messages sent to the console have a carriage return and a line
feed appended to them, rather than just a line feed.
.Sh SEE ALSO
.Xr lpq 1 ,
.Xr lpr 1 ,
.Xr lprm 1 ,
.Xr capfile 5 ,
.Xr lpc 8 ,
.Xr lpd 8 ,
.Xr pac 8
.Rs
.%T "4.3 BSD Line Printer Spooler Manual"
.Re
.Sh NOTES
The
.Sy sh
flag is a function of the spooler with the locally attached printer,
and so has no effect when used with
.Sy rm .
.Nx
never adds a burst page when used as a remote spooler.
To suppress the burst page for other systems or dedicated devices,
refer to the documentation for those systems or devices.
.Sh HISTORY
The
.Nm
file format appeared in
.Bx 4.2 .