1 | #!/bin/sh |
---|
2 | # 4.2BSD line printer spooler interface for PostScript/TranScript printer |
---|
3 | # this is the printcap/lpd-invoked top level filter program for ALL file types |
---|
4 | # Copyright (c) 1985,1987,1990,1992 Adobe Systems Incorporated. All Rights |
---|
5 | # Reserved. |
---|
6 | # GOVERNMENT END USERS: See Notice file in TranScript library directory |
---|
7 | # -- probably /usr/lib/ps/Notice |
---|
8 | # RCSID: $Header: /afs/dev.mit.edu/source/repository/third/transcript/lib/psint.bsd,v 1.1.1.1 1996-10-07 20:25:32 ghudson Exp $ |
---|
9 | |
---|
10 | BINDIR=XBINDIRX |
---|
11 | PATH=$BINDIR:/bin:/usr/bin:/usr/ucb |
---|
12 | export PATH |
---|
13 | |
---|
14 | # set up initial undefined variable values |
---|
15 | width= length= indent= login= host= afile= |
---|
16 | prog=$0 |
---|
17 | cwd=`pwd` |
---|
18 | pname=`basename $cwd` |
---|
19 | |
---|
20 | # Some versions of Unix save up all entries to the log until the job is |
---|
21 | # done. The exec command commented out below causes all entries to the log |
---|
22 | # to be written to the log as they occur. If you desire this behavior, |
---|
23 | # remove the comment from this line, and put in the appropriate file name |
---|
24 | # for the log file. |
---|
25 | # |
---|
26 | # exec 2>>XLOGDIRX/${pname}-log |
---|
27 | # |
---|
28 | |
---|
29 | # define the default printer-specific and TranScript |
---|
30 | # configuration options, these may be overridden by |
---|
31 | # real printer-specific options in the .options file |
---|
32 | |
---|
33 | PSLIBDIR=XPSLIBDIRX |
---|
34 | REVERSE=XREVERSEX |
---|
35 | VERBOSELOG=XVERBOSELOGX |
---|
36 | BANNERFIRST=XBANNERFIRSTX |
---|
37 | BANNERLAST=XBANNERLASTX |
---|
38 | BANNERPRO=$PSLIBDIR/banner.pro |
---|
39 | PSCOMM=$PSLIBDIR/pscomm |
---|
40 | PSDMAN=$PSLIBDIR/psdman |
---|
41 | export PSLIBDIR VERBOSELOG BANNERFIRST BANNERLAST BANNERPRO REVERSE |
---|
42 | |
---|
43 | # load the values from the .options file if present |
---|
44 | test -r ./.options && . ./.options |
---|
45 | |
---|
46 | # parse the command line arguments, most get ignored |
---|
47 | # the -hhost vs. -h host is due to one report of someone doing it wrong. |
---|
48 | # you could add or filter out non-standard options here (-p and -f) |
---|
49 | |
---|
50 | while test $# != 0 |
---|
51 | do case "$1" in |
---|
52 | -c) ;; |
---|
53 | -w*) width=$1 ;; |
---|
54 | -l*) length=$1 ;; |
---|
55 | -i*) indent=$1 ;; |
---|
56 | -x*) width=$1 ;; |
---|
57 | -y*) length=$1 ;; |
---|
58 | -n) user=$2 ; shift ;; |
---|
59 | -n*) user=`expr $1 : '-.\(.*\)'` ;; |
---|
60 | -h) host=$2 ; shift ;; |
---|
61 | -h*) host=`expr $1 : '-.\(.*\)'` ;; |
---|
62 | -*) ;; |
---|
63 | *) afile=$1 ;; |
---|
64 | esac |
---|
65 | shift |
---|
66 | done |
---|
67 | |
---|
68 | PATH=$PSLIBDIR:$PATH |
---|
69 | export PATH |
---|
70 | |
---|
71 | # now exec the format-specific filter, based on $prog |
---|
72 | # if - communications filter [default] |
---|
73 | # of - banner filter [execed directly] |
---|
74 | # nf - ditroff, tf - troff (CAT), gf - plot |
---|
75 | # vf - raster, df - TeX DVI, cf - cifplot, rf - fortran |
---|
76 | |
---|
77 | prog=`basename $prog` |
---|
78 | comm="$PSCOMM -P $pname -p $prog -n $user -h $host $afile" |
---|
79 | dman="$PSDMAN -P $pname -p $prog -n $user -h $host $afile" |
---|
80 | |
---|
81 | case $prog in |
---|
82 | psif) $dman | $comm ;; |
---|
83 | psof) exec psbanner $pname ; exit 0 ;; |
---|
84 | psnf) psdit | $dman | $comm ;; |
---|
85 | pstf) pscat | $dman | $comm ;; |
---|
86 | psgf) psplot | $dman | $comm ;; |
---|
87 | psvf|pscf|psdf|psrf) echo "$prog: filter not available." 1>&2 ; |
---|
88 | psbad $prog $pname $user $host | $comm ;; |
---|
89 | esac |
---|