Allow those of us who have to print through LPRng spoolers to send

spooler options using `Z' control-file lines and the `-Z' flag.
This commit is contained in:
Garrett Wollman 2000-06-21 20:20:26 +00:00
parent f9c078dffe
commit 10915f6e07
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61913
2 changed files with 64 additions and 7 deletions

View File

@ -47,6 +47,7 @@
.Op Fl L Ar locale
.Op Fl T Ar title
.Op Fl U Ar user
.Op Fl Z Ar daemon-options
.Op Fl i Ar numcols
.Op Fl 1234 Ar font
.Op Fl w Ns Ar num
@ -180,10 +181,14 @@ Normally, the first file's name is used.
Use
.Ar locale
specified as argument instead of one found in environment.
Use "C" to reset locale to default.
(Only effective when filtering through
.Xr pr 1
is requested using the
.Fl p
option.)
.It Fl T Ar title
Title name for
.Xr pr 1 ,
.Xr pr 1 ,
instead of the file name.
.It Fl U Ar user
User name to print on the burst page,
@ -191,6 +196,22 @@ also for accounting purposes.
This option is only honored if the real user-id is daemon
(or that specified in the printcap file instead of daemon),
and is intended for those instances where print filters wish to requeue jobs.
.It Fl Z Ar daemon-options
Some spoolers, such as
.Tn LPRng ,
accept additional per-job options using a
.Ql Z
control line.
When
.Fl Z
is specified, and
.Fl p
.Pq Xr pr 1
is not requested, the specified
.Ar daemon-options
will be passed to the remote
.Tn LPRng
spooler.
.It Fl i numcols
The output is indented by
.Pq Ar numcols .
@ -256,7 +277,28 @@ regarding missing spool files by
Fonts for
.Xr troff 1
and
.Xr tex
.Tn TeX
reside on the host with the printer.
It is currently not possible to
use local font libraries.
.Pp
The
.Ql Z
control file line is used for two different purposes; for
standard
.Fx
.Xr lpd 8 ,
it specifies a locale to be passed to
.Xr pr 1 .
For
.Tn LPRng
.Xr lpd 8 ,
it specifies additional options to be interpreted by the spooler's
input and output filters.
When submitting jobs via
.Nm lpr ,
.Fl p
.Fl L Ar locale
is used in the former context, and
.Fl Z Ar daemon-options
is used in the latter.

View File

@ -103,6 +103,7 @@ static char *locale; /* pr'ing locale */
static int userid; /* user id */
static char *Uflag; /* user name specified with -U flag */
static char *width; /* width for versatec printing */
static char *Zflag; /* extra filter options for LPRng servers */
static struct stat statb;
@ -154,7 +155,8 @@ main(argc, argv)
errs = 0;
while ((c = getopt(argc, argv,
":#:1:2:3:4:C:J:L:P:T:U:cdfghi:lnmprstvw:")) != -1)
":#:1:2:3:4:C:J:L:P:T:U:Z:cdfghi:lnmprstvw:"))
!= -1)
switch (c) {
case '#': /* n copies */
i = strtol(optarg, &p, 10);
@ -198,6 +200,10 @@ main(argc, argv)
Uflag = optarg;
break;
case 'Z':
Zflag = optarg;
break;
case 'c': /* print cifplot output */
case 'd': /* print tex output (dvi files) */
case 'g': /* print graph(1G) output */
@ -332,6 +338,8 @@ main(argc, argv)
card('C', class);
card('L', person);
}
if (format != 'p' && Zflag != 0)
card('Z', Zflag);
if (iflag)
card('I', itoa(indent));
if (mailflg)
@ -342,6 +350,12 @@ main(argc, argv)
card('1'+i, fonts[i]);
if (width != NULL)
card('W', width);
/*
* XXX
* Our use of `Z' here is incompatible with LPRng's
* use. We assume that the only use of our existing
* `Z' card is as shown for `p' format (pr) files.
*/
if (format == 'p') {
char *s;
@ -734,9 +748,10 @@ chkprinter(s, pp)
static void
usage()
{
fprintf(stderr, "%s\n%s\n",
"usage: lpr [-Pprinter] [-#num] [-C class] [-J job] [-T title] [-U user]",
"[-i[numcols]] [-1234 font] [-L locale] [-wnum] [-cdfghlnmprstv] [name ...]");
fprintf(stderr, "%s\n",
"usage: lpr [-Pprinter] [-#num] [-C class] [-J job] [-T title] [-U user]\n"
"\t[-Z daemon-options] [-i[numcols]] [-i[numcols]] [-1234 font]\n"
"\t[-L locale] [-wnum] [-cdfghlnmprstv] [name ...]");
exit(1);
}