2 %%Creator: yetti:oz (Ozan Yigit)
3 %%Title: stdin (ditroff)
4 %%CreationDate: Thu Dec 13 15:56:08 1990
6 % lib/psdit.pro -- prolog for psdit (ditroff) files
7 % Copyright (c) 1984, 1985 Adobe Systems Incorporated. All Rights Reserved.
8 % last edit: shore Sat Nov 23 20:28:03 1985
9 % RCSID: $Header: psdit.pro,v 2.1 85/11/24 12:19:43 shore Rel $
11 /$DITroff 140 dict def $DITroff begin
12 /fontnum 1 def /fontsize 10 def /fontheight 10 def /fontslant 0 def
13 /xi {0 72 11 mul translate 72 resolution div dup neg scale 0 0 moveto
14 /fontnum 1 def /fontsize 10 def /fontheight 10 def /fontslant 0 def F
15 /pagesave save def}def
16 /PB{save /psv exch def currentpoint translate
17 resolution 72 div dup neg scale 0 0 moveto}def
19 /arctoobig 90 def /arctoosmall .05 def
20 /m1 matrix def /m2 matrix def /m3 matrix def /oldmat matrix def
21 /tan{dup sin exch cos div}def
22 /point{resolution 72 div mul}def
23 /dround {transform round exch round exch itransform}def
24 /xT{/devname exch def}def
25 /xr{/mh exch def /my exch def /resolution exch def}def
27 /xs{docsave restore end}def
29 /xf{/fontname exch def /slotno exch def fontnames slotno get fontname eq not
30 {fonts slotno fontname findfont put fontnames slotno fontname put}if}def
31 /xH{/fontheight exch def F}def
32 /xS{/fontslant exch def F}def
33 /s{/fontsize exch def /fontheight fontsize def F}def
34 /f{/fontnum exch def F}def
35 /F{fontheight 0 le {/fontheight fontsize def}if
36 fonts fontnum get fontsize point 0 0 fontheight point neg 0 0 m1 astore
37 fontslant 0 ne{1 0 fontslant tan 1 0 0 m2 astore m3 concatmatrix}if
38 makefont setfont .04 fontsize point mul 0 dround pop setlinewidth}def
39 /X{exch currentpoint exch pop moveto show}def
40 /N{3 1 roll moveto show}def
41 /Y{exch currentpoint pop exch moveto show}def
43 /ditpush{}def/ditpop{}def
44 /AX{3 -1 roll currentpoint exch pop moveto 0 exch ashow}def
45 /AN{4 2 roll moveto 0 exch ashow}def
46 /AY{3 -1 roll currentpoint pop exch moveto 0 exch ashow}def
48 /MX{currentpoint exch pop moveto}def
49 /MY{currentpoint pop exch moveto}def
51 /cb{pop}def % action on unknown char -- nothing for now
53 /p{pop showpage pagesave restore /pagesave save def}def
54 /abspoint{currentpoint exch pop add exch currentpoint pop add exch}def
55 /distance{dup mul exch dup mul add sqrt}def
56 /dstroke{currentpoint stroke moveto}def
57 /Dl{2 copy gsave rlineto stroke grestore rmoveto}def
58 /arcellipse{/diamv exch def /diamh exch def oldmat currentmatrix pop
59 currentpoint translate 1 diamv diamh div scale /rad diamh 2 div def
60 currentpoint exch rad add exch rad -180 180 arc oldmat setmatrix}def
61 /Dc{dup arcellipse dstroke}def
62 /De{arcellipse dstroke}def
63 /Da{/endv exch def /endh exch def /centerv exch def /centerh exch def
64 /cradius centerv centerv mul centerh centerh mul add sqrt def
65 /eradius endv endv mul endh endh mul add sqrt def
66 /endang endv endh atan def
67 /startang centerv neg centerh neg atan def
68 /sweep startang endang sub dup 0 lt{360 add}if def
70 {/midang startang sweep 2 div sub def /midrad cradius eradius add 2 div def
71 /midh midang cos midrad mul def /midv midang sin midrad mul def
72 midh neg midv neg endh endv centerh centerv midh midv Da
73 currentpoint moveto Da}
75 {/controldelt 1 sweep 2 div cos sub 3 sweep 2 div sin mul div 4 mul def
76 centerv neg controldelt mul centerh controldelt mul
77 endv neg controldelt mul centerh add endh add
78 endh controldelt mul centerv add endv add
79 centerh endh add centerv endv add rcurveto dstroke}
80 {centerh endh add centerv endv add rlineto dstroke}ifelse}ifelse}def
82 /Barray 200 array def % 200 values in a wiggle
84 /D~~{counttomark Barray exch 0 exch getinterval astore /Bcontrol exch def pop
85 /Blen Bcontrol length def Blen 4 ge Blen 2 mod 0 eq and
86 {Bcontrol 0 get Bcontrol 1 get abspoint /Ycont exch def /Xcont exch def
87 Bcontrol 0 2 copy get 2 mul put Bcontrol 1 2 copy get 2 mul put
88 Bcontrol Blen 2 sub 2 copy get 2 mul put
89 Bcontrol Blen 1 sub 2 copy get 2 mul put
90 /Ybi /Xbi currentpoint 3 1 roll def def 0 2 Blen 4 sub
92 Bcontrol i get 3 div Bcontrol i 1 add get 3 div
93 Bcontrol i get 3 mul Bcontrol i 2 add get add 6 div
94 Bcontrol i 1 add get 3 mul Bcontrol i 3 add get add 6 div
95 /Xbi Xcont Bcontrol i 2 add get 2 div add def
96 /Ybi Ycont Bcontrol i 3 add get 2 div add def
97 /Xcont Xcont Bcontrol i 2 add get add def
98 /Ycont Ycont Bcontrol i 3 add get add def
99 Xbi currentpoint pop sub Ybi currentpoint exch pop sub rcurveto
102 /ditstart{$DITroff begin
103 /nfonts 60 def % NFONTS makedev/ditroff dependent!
104 /fonts[nfonts{0}repeat]def
105 /fontnames[nfonts{()}repeat]def
110 /oc {/pswid exch def /cc exch def /name exch def
111 /ditwid pswid fontsize mul resolution mul 72000 div def
112 /ditsiz fontsize resolution mul 72 div def
113 ocprocs name known{ocprocs name get exec}{name cb}
115 /fractm [.65 0 0 .6 0 0] def
117 {/fden exch def /fnum exch def gsave /cf currentfont def
118 cf fractm makefont setfont 0 .3 dm 2 copy neg rmoveto
119 fnum show rmoveto currentfont cf setfont(\244)show setfont fden show
120 grestore ditwid 0 rmoveto} def
121 /oce {grestore ditwid 0 rmoveto}def
123 /ocprocs 50 dict def ocprocs begin
124 (14){(1)(4)fraction}def
125 (12){(1)(2)fraction}def
126 (34){(3)(4)fraction}def
127 (13){(1)(3)fraction}def
128 (23){(2)(3)fraction}def
129 (18){(1)(8)fraction}def
130 (38){(3)(8)fraction}def
131 (58){(5)(8)fraction}def
132 (78){(7)(8)fraction}def
133 (sr){gsave 0 .06 dm rmoveto(\326)show oce}def
134 (is){gsave 0 .15 dm rmoveto(\362)show oce}def
135 (->){gsave 0 .02 dm rmoveto(\256)show oce}def
136 (<-){gsave 0 .02 dm rmoveto(\254)show oce}def
137 (==){gsave 0 .05 dm rmoveto(\272)show oce}def
140 % an attempt at a PostScript FONT to implement ditroff special chars
141 % this will enable us to
142 % cache the little buggers
143 % generate faster, more compact PS out of psdit
144 % confuse everyone (including myself)!
147 /FontName /DIThacks def
148 /FontMatrix [.001 0 0 .001 0 0] def
149 /FontBBox [-260 -260 900 900] def% a lie but ...
150 /Encoding 256 array def
151 0 1 255{Encoding exch /.notdef put}for
153 dup 8#040/space put %space
154 dup 8#110/rc put %right ceil
155 dup 8#111/lt put %left top curl
156 dup 8#112/bv put %bold vert
157 dup 8#113/lk put %left mid curl
158 dup 8#114/lb put %left bot curl
159 dup 8#115/rt put %right top curl
160 dup 8#116/rk put %right mid curl
161 dup 8#117/rb put %right bot curl
162 dup 8#120/rf put %right floor
163 dup 8#121/lf put %left floor
164 dup 8#122/lc put %left ceil
165 dup 8#140/sq put %square
166 dup 8#141/bx put %box
167 dup 8#142/ci put %circle
168 dup 8#143/br put %box rule
169 dup 8#144/rn put %root extender
170 dup 8#145/vr put %vertical rule
171 dup 8#146/ob put %outline bullet
172 dup 8#147/bu put %bullet
173 dup 8#150/ru put %rule
174 dup 8#151/ul put %underline
178 /cc exch def /fd exch def
179 /charname fd /Encoding get cc get def
180 /charwid fd /Metrics get charname get def
181 /charproc fd /CharProcs get charname get def
182 charwid 0 fd /FontBBox get aload pop setcachedevice
183 2 setlinejoin 40 setlinewidth
184 newpath 0 0 moveto gsave charproc grestore
186 /BuildChar load 0 DITfd put
188 /CharProcs 50 dict def
193 /rn{0 840 moveto 500 0 rls}def
194 /vr{0 800 moveto 0 -770 rls}def
195 /bv{0 800 moveto 0 -1000 rls}def
196 /br{0 750 moveto 0 -1000 rls}def
197 /ul{0 -140 moveto 500 0 rls}def
198 /ob{200 250 rmoveto currentpoint newpath 200 0 360 arc closepath stroke}def
199 /bu{200 250 rmoveto currentpoint newpath 200 0 360 arc closepath fill}def
200 /sq{80 0 rmoveto currentpoint dround newpath moveto
201 640 0 rlineto 0 640 rlineto -640 0 rlineto closepath stroke}def
202 /bx{80 0 rmoveto currentpoint dround newpath moveto
203 640 0 rlineto 0 640 rlineto -640 0 rlineto closepath fill}def
204 /ci{500 360 rmoveto currentpoint newpath 333 0 360 arc
205 50 setlinewidth stroke}def
207 /lt{0 -200 moveto 0 550 rlineto currx 800 2cx s4 add exch s4 a4p stroke}def
208 /lb{0 800 moveto 0 -550 rlineto currx -200 2cx s4 add exch s4 a4p stroke}def
209 /rt{0 -200 moveto 0 550 rlineto currx 800 2cx s4 sub exch s4 a4p stroke}def
210 /rb{0 800 moveto 0 -500 rlineto currx -200 2cx s4 sub exch s4 a4p stroke}def
211 /lk{0 800 moveto 0 300 -300 300 s4 arcto pop pop 1000 sub
212 0 300 4 2 roll s4 a4p 0 -200 lineto stroke}def
213 /rk{0 800 moveto 0 300 s2 300 s4 arcto pop pop 1000 sub
214 0 300 4 2 roll s4 a4p 0 -200 lineto stroke}def
215 /lf{0 800 moveto 0 -1000 rlineto s4 0 rls}def
216 /rf{0 800 moveto 0 -1000 rlineto s4 neg 0 rls}def
217 /lc{0 -200 moveto 0 1000 rlineto s4 0 rls}def
218 /rc{0 -200 moveto 0 1000 rlineto s4 neg 0 rls}def
221 /Metrics 50 dict def Metrics begin
248 /s2 500 def /s4 250 def /s3 333 def
249 /a4p{arcto pop pop pop pop}def
251 /rls{rlineto stroke}def
252 /currx{currentpoint pop}def
253 /dround{transform round exch round exch itransform} def
256 /DIThacks exch definefont pop
261 2(Times-Italic)xf 2 f
263 4(Times-BoldItalic)xf 4 f
265 6(Helvetica-Bold)xf 6 f
267 8(Courier-Bold)xf 8 f
315 1965 1488(oz@nexus.yorku.ca)N
317 555 1804(Implementation)N
420 1109(implementation)X
453 555 2724(external-hashing)N
471 875(implementation.)X
519 942(initialization.)X
526 2208(binary-compatible)X
543 1107(implementation)X
559 555 3452(simpli\256cations)N
635 2922(implementation)X
848 555 5316(hhhhhhhhhhhhhhhhhh)N
860 1529(\(dis\)organization.)X
872 2061(implementations)X
938 555 768(public-domain)N
947 2765(de\256nition\))X
1004 1759(distributions)X
1014 555 1276(dropped\))N
1033 555 1564(Acknowledgments)N
1050 555 1784(Zacherissen)N
1102 555 2168(Distribution)N
1193 747 3780(readme.ms)N
1221 1323(miscellaneous)X
1246 555 4528(currently)N
1249 1329(functionality.)X
1266 555 4624(key/value)N
1294 939(<build|creat|look|insert|cat|delete>)X
1304 1675(dbm/sdbm/ndbm)X
1333 1897(dbm/ndbm/sdbm)X
1370 555 5432(hhhhhhhhhhhhhhhhhh)N
1492 555 988([janick@bnr.ca])N
1574 3478(signi\256cant)X
1585 2271(improvements.)X
1594 555 1812(Implementation)N
1605 2207(implementation)X
1609 3181(bit-scrambling)X
1659 747 2752(dbm_hash\(char)N
1868 3229(\(distribution)X
1886 555 4680(Portability)N
1942 555 5312(literature)N
1969 3107(directory-less)X
1980 1720(variations\),)X
2012 555 5696(mentation)N
2028 555 5792(excellent)N
2041 555 672(References)N
2062 1658(communication)X
2080 2851(addressing'',)X
2086 875 1168(Conference)N
2177 1885(Incrementally)X