summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/lpd
diff options
context:
space:
mode:
authorgad <gad@FreeBSD.org>2001-09-20 01:04:50 +0000
committergad <gad@FreeBSD.org>2001-09-20 01:04:50 +0000
commitee2fdcd34f636b081539a63fdccd640162d90e14 (patch)
tree44e62bd6f0f310000d35c8425423e8f005ab64e1 /usr.sbin/lpr/lpd
parent34c8082463d00bd1cac61a0dcb27a982d0dfe557 (diff)
downloadFreeBSD-src-ee2fdcd34f636b081539a63fdccd640162d90e14.zip
FreeBSD-src-ee2fdcd34f636b081539a63fdccd640162d90e14.tar.gz
Add minimal support for "o"-type print-file actions in lpd control files.
This was described in the original RFC wrt lpr, but most lpr's do not actually implement it. There is some indication that MacOS 10.1 will be using this when sending postscript files to print servers (that is what "o"-type was supposed to signify -- postscript files). MFC after: 1 week
Diffstat (limited to 'usr.sbin/lpr/lpd')
-rw-r--r--usr.sbin/lpr/lpd/printjob.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c
index 91c03c3..d81ce58 100644
--- a/usr.sbin/lpr/lpd/printjob.c
+++ b/usr.sbin/lpr/lpd/printjob.c
@@ -408,6 +408,8 @@ printit(struct printer *pp, char *file)
* R -- laser dpi "resolution"
* f -- "file name" name of text file to print
* l -- "file name" text file with control chars
+ * o -- "file name" postscript file, according to
+ * the RFC. Here it is treated like an 'f'.
* p -- "file name" text file to print with pr(1)
* t -- "file name" troff(1) file to print
* n -- "file name" ditroff(1) file to print
@@ -626,7 +628,7 @@ print(struct printer *pp, int format, char *file)
pp->tof = 1;
}
if (pp->filters[LPF_INPUT] == NULL
- && (format == 'f' || format == 'l')) {
+ && (format == 'f' || format == 'l' || format == 'o')) {
pp->tof = 0;
while ((n = read(fi, buf, BUFSIZ)) > 0)
if (write(ofd, buf, n) != n) {
@@ -674,6 +676,14 @@ print(struct printer *pp, int format, char *file)
return(ERROR);
}
fi = p[0]; /* use pipe for input */
+ case 'o': /* print postscript file */
+ /*
+ * For now, treat this as a plain-text file, and assume
+ * the standard LPF_INPUT filter will recognize that it
+ * is postscript and know what to do with it. These
+ * 'o'-file requests could come from MacOS 10.1 systems.
+ */
+ /* FALLTHROUGH */
case 'f': /* print plain text file */
prog = pp->filters[LPF_INPUT];
av[1] = width;
OpenPOWER on IntegriCloud