From 06f2631ff2e63cf5369696de976013c1f55e1f26 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Tue, 28 Jun 1994 15:12:14 +0000 Subject: [PATCH] Add the printcap stuff back. it's still useful (psm and fp-emu are deprecated due to being added to the tree already). --- contrib/FAQ/code/printcap01/Makefile | 22 ++++++++++++ contrib/FAQ/code/printcap01/README | 14 ++++++++ contrib/FAQ/code/printcap01/hpf.c | 38 +++++++++++++++++++++ contrib/FAQ/code/printcap01/printcap.sample | 9 +++++ contrib/FAQ/code/printcap01/ps2lj3 | 4 +++ 5 files changed, 87 insertions(+) create mode 100644 contrib/FAQ/code/printcap01/Makefile create mode 100644 contrib/FAQ/code/printcap01/README create mode 100644 contrib/FAQ/code/printcap01/hpf.c create mode 100644 contrib/FAQ/code/printcap01/printcap.sample create mode 100644 contrib/FAQ/code/printcap01/ps2lj3 diff --git a/contrib/FAQ/code/printcap01/Makefile b/contrib/FAQ/code/printcap01/Makefile new file mode 100644 index 0000000000..fda6ebb835 --- /dev/null +++ b/contrib/FAQ/code/printcap01/Makefile @@ -0,0 +1,22 @@ +# +# Makefile for the FAQ/printcap +# + +PROG = hpf +SRCS = hpf.c + + +install: + if test -d /usr/libexec/lpr; \ + then \ + true; \ + else \ + mkdir /usr/libexec/lpr; + fi; + + install -c -o bin -g bin -m 555 hpf /usr/libexec/lpr + install -c -o bin -g bin -m 555 ps2lj3 /usr/libexec/lpr + install -c -o bin -g bin -m 555 printcap.sample /etc/printcap + +.include + diff --git a/contrib/FAQ/code/printcap01/README b/contrib/FAQ/code/printcap01/README new file mode 100644 index 0000000000..c13eb72ddb --- /dev/null +++ b/contrib/FAQ/code/printcap01/README @@ -0,0 +1,14 @@ +This print cap package was created by Curt Mayer. Please contact hime for more +information. + +Curt Mayer +curt@toad.com +415-387-0217 home + +To install this package, type make then make install. This will copy the +printcap.sample to /etc/printcap and create the directory /usr/libexec/lpr +and copy the hpf filter to there. + +Thanks +Gary Clark II +FreeBSD FAQ Person diff --git a/contrib/FAQ/code/printcap01/hpf.c b/contrib/FAQ/code/printcap01/hpf.c new file mode 100644 index 0000000000..8d78c092f9 --- /dev/null +++ b/contrib/FAQ/code/printcap01/hpf.c @@ -0,0 +1,38 @@ +/* +source to my hp filter, installed as /usr/libexec/lpr/hpf: +*/ +#include "stdio.h" +#include +#include +#include +#include + +main(ac, av) +int ac; +char **av; +{ + int c; + struct sgttyb nbuf; + unsigned long lbits; + + setbuf(stdout, NULL); + lbits = LDECCTQ | LPASS8 | LLITOUT; + ioctl(fileno(stdout), TIOCLSET, &lbits); + ioctl(fileno(stdout), TIOCGETP, &nbuf); + nbuf.sg_flags &= ~(ECHO | XTABS | CRMOD); + ioctl(fileno(stdout), TIOCSETP, &nbuf); + + fputs("\033E\033&k2G", stdout); + + while (1) { + if ((c = getchar()) != EOF) { + putchar(c); + } else { + break; + } + } + + fputs("\033&l0H", stdout); + + exit(0); +} diff --git a/contrib/FAQ/code/printcap01/printcap.sample b/contrib/FAQ/code/printcap01/printcap.sample new file mode 100644 index 0000000000..10e87ba2d3 --- /dev/null +++ b/contrib/FAQ/code/printcap01/printcap.sample @@ -0,0 +1,9 @@ + +ps|postscript emulation:\ + :lp=/dev/lpa0:sd=/var/spool/lpd:lf=/var/log/lpd-errs:\ + :if=/usr/libexec/lpr/ps2lj3:sh:mx#0:sf: + +lp|epson|lj|local line printer:\ + :lp=/dev/lpa0:sd=/var/spool/lpd:lf=/var/log/lpd-errs:\ + :if=/usr/libexec/lpr/hpf:\ + :sh:mx#0:pw#80: diff --git a/contrib/FAQ/code/printcap01/ps2lj3 b/contrib/FAQ/code/printcap01/ps2lj3 new file mode 100644 index 0000000000..8dc9ff3840 --- /dev/null +++ b/contrib/FAQ/code/printcap01/ps2lj3 @@ -0,0 +1,4 @@ + +#!/bin/sh +/usr/gnu/bin/gs -dNOPAUSE -r300 -q -sDEVICE=ljet3 -sOutputFile=- -f - + -- 2.20.1