summaryrefslogtreecommitdiff
path: root/contrib/FAQ/code
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/FAQ/code')
-rw-r--r--contrib/FAQ/code/printcap01/Makefile22
-rw-r--r--contrib/FAQ/code/printcap01/README14
-rw-r--r--contrib/FAQ/code/printcap01/hpf.c38
-rw-r--r--contrib/FAQ/code/printcap01/printcap.sample9
-rw-r--r--contrib/FAQ/code/printcap01/ps2lj34
5 files changed, 87 insertions, 0 deletions
diff --git a/contrib/FAQ/code/printcap01/Makefile b/contrib/FAQ/code/printcap01/Makefile
new file mode 100644
index 0000000000000..fda6ebb835867
--- /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 <bsd.prog.mk>
+
diff --git a/contrib/FAQ/code/printcap01/README b/contrib/FAQ/code/printcap01/README
new file mode 100644
index 0000000000000..c13eb72ddb653
--- /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 0000000000000..8d78c092f902f
--- /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 <signal.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
+#include <sgtty.h>
+
+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 0000000000000..10e87ba2d386e
--- /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 0000000000000..8dc9ff3840118
--- /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 -
+