Blame


1 b855148c 2004-05-16 devnull #!/bin/rc
2 b855148c 2004-05-16 devnull # Generate paper output from the data that a PostScript program normally
3 b855148c 2004-05-16 devnull # sends back to a host computer using file output operators.
4 b855148c 2004-05-16 devnull #
5 b855148c 2004-05-16 devnull
6 b855148c 2004-05-16 devnull POSTLIB=/sys/lib/postscript/prologues
7 b855148c 2004-05-16 devnull PROLOGUE=$POSTLIB/hardcopy.ps
8 b855148c 2004-05-16 devnull
9 b855148c 2004-05-16 devnull OPTIONS=
10 b855148c 2004-05-16 devnull MODE=portrait
11 b855148c 2004-05-16 devnull
12 b855148c 2004-05-16 devnull NONCONFORMING='%!PS'
13 b855148c 2004-05-16 devnull ENDPROLOG='%%EndProlog'
14 b855148c 2004-05-16 devnull BEGINSETUP='%%BeginSetup'
15 b855148c 2004-05-16 devnull ENDSETUP='%%EndSetup'
16 b855148c 2004-05-16 devnull TRAILER='%%Trailer'
17 b855148c 2004-05-16 devnull
18 b855148c 2004-05-16 devnull SETUP=HardcopySetup
19 b855148c 2004-05-16 devnull DONE='(%stdout)(w) file -1 write'
20 b855148c 2004-05-16 devnull
21 b855148c 2004-05-16 devnull while (! ~ $#* 0 && ~ $1 -*) {
22 b855148c 2004-05-16 devnull switch ($1) {
23 b855148c 2004-05-16 devnull case -c; shift; OPTIONS=$OPTIONS' /#copies '$1' store'
24 b855148c 2004-05-16 devnull case -c*; OPTIONS=$OPTIONS' /#copies `{echo $1 | sed s/-c//}' store'
25 b855148c 2004-05-16 devnull
26 b855148c 2004-05-16 devnull case -f; shift; OPTIONS=$OPTIONS' /font '/$1' def'
27 b855148c 2004-05-16 devnull case -f*; OPTIONS=$OPTIONS' /font '/`{echo $1 | sed s/-f//}' def'
28 b855148c 2004-05-16 devnull
29 b855148c 2004-05-16 devnull case -p; shift; MODE=$1
30 b855148c 2004-05-16 devnull case -p*; MODE=`{echo $1 | sed s/-p//}
31 b855148c 2004-05-16 devnull
32 b855148c 2004-05-16 devnull case -m; shift; OPTIONS=$OPTIONS' /magnification '$1' def'
33 b855148c 2004-05-16 devnull case -m*; OPTIONS=$OPTIONS' /magnification '`{echo $1 | sed s/-m//}' def'
34 b855148c 2004-05-16 devnull
35 b855148c 2004-05-16 devnull case -s; shift; OPTIONS=$OPTIONS' /pointsize '$1' def'
36 b855148c 2004-05-16 devnull case -s*; OPTIONS=$OPTIONS' /pointsize '`{echo $1 | sed s/-s//}' def'
37 b855148c 2004-05-16 devnull
38 b855148c 2004-05-16 devnull case -x; shift; OPTIONS=$OPTIONS' /xoffset '$1' def'
39 b855148c 2004-05-16 devnull case -x*; OPTIONS=$OPTIONS' /xoffset '`{echo $1 | sed s/-x//}' def'
40 b855148c 2004-05-16 devnull
41 b855148c 2004-05-16 devnull case -y; shift; OPTIONS=$OPTIONS' /yoffset '$1' def'
42 b855148c 2004-05-16 devnull case -y*; OPTIONS=$OPTIONS' /yoffset '`{echo $1 | sed s/-y//}' def'
43 b855148c 2004-05-16 devnull
44 b855148c 2004-05-16 devnull case -L; shift; PROLOGUE=$1
45 b855148c 2004-05-16 devnull case -L*; PROLOGUE=`{echo $1 | sed s/-L//}
46 b855148c 2004-05-16 devnull
47 b855148c 2004-05-16 devnull case --;
48 b855148c 2004-05-16 devnull
49 b855148c 2004-05-16 devnull case -*; echo '$0: illegal option $1' >&2; exit 1
50 b855148c 2004-05-16 devnull }
51 b855148c 2004-05-16 devnull shift
52 b855148c 2004-05-16 devnull }
53 b855148c 2004-05-16 devnull
54 b855148c 2004-05-16 devnull switch ($MODE) {
55 b855148c 2004-05-16 devnull case l*; OPTIONS=$OPTIONS' /landscape true def'
56 b855148c 2004-05-16 devnull case *; OPTIONS=$OPTIONS' /landscape false def'
57 b855148c 2004-05-16 devnull }
58 b855148c 2004-05-16 devnull
59 b855148c 2004-05-16 devnull echo $NONCONFORMING
60 b855148c 2004-05-16 devnull cat $PROLOGUE
61 b855148c 2004-05-16 devnull echo $ENDPROLOG
62 b855148c 2004-05-16 devnull echo $BEGINSETUP
63 b855148c 2004-05-16 devnull echo $OPTIONS
64 b855148c 2004-05-16 devnull echo $SETUP
65 b855148c 2004-05-16 devnull echo $ENDSETUP
66 b855148c 2004-05-16 devnull
67 b855148c 2004-05-16 devnull cat $*
68 b855148c 2004-05-16 devnull
69 b855148c 2004-05-16 devnull echo $TRAILER
70 b855148c 2004-05-16 devnull echo $DONE