%!PS currentpacking true setpacking /Inspect << /buffer 1024 string /break? true /indent? true /line 1 /depth 0 /depth++ {/depth depth 1 add def} bind /depth-- {/depth depth 1 sub def} bind /indent {indent? {depth {(\t) print} repeat} {/indent? true def} ifelse} bind /priv {0 eq {(-private-)} {( --private-- )} ifelse 8 p} bind /nl {(\n) print /line line 1 add def} bind /escape? true % Section: Reference tracking /refs <<>> /ref { (Reference to ) 6 p typename 6 p refs exch get dup 0 lt {( key)} {( value)} ifelse 6 p ( on line ) 6 p abs 6 p } bind /saveref { dup {refs {line eq {stop} {pop} ifelse} forall} stopped {refs exch 2 copy get neg put} if refs exch line put } bind /char { dup 1 string dup 3 -1 roll 0 exch put exch dup << 8 (\\b) 13 (\\r) 12 (\\f) 40 (\\\() 41 (\\\)) 92 (\\\\) 9 {escape? {(\\t)} {(\t)} ifelse} bind 10 {escape? {(\\n)} {nl ()} ifelse} bind >> dup 3 1 roll exch known {exch get dup xcheck {exec} if 24 p pop} {pop dup 32 ge exch dup 126 le 3 -1 roll and not {(\\) 24 p 8 3 string cvrs dup length 3 lt {0 24 p} if dup length 2 lt {0 24 p} if 24 p pop} {pop 14 p} ifelse} ifelse } bind /p { (\033[38;5;) print buffer cvs print (m) print dup type /stringtype ne {buffer cvs} if print (\033[0m) print } bind % Section: Type-handling /typename { dup type << /dicttype (dictionary) /gstatetype (graphics state) /packedarraytype (packed array) /savetype (VM snapshot) >> begin dup currentdict exch known {exec} { 24 string cvs dup length 0 exch 4 sub getinterval } ifelse end } bind /arraytype { break? exch /break? true def dup xcheck {({)} {([)} ifelse 8 p dup rcheck { dup length 0 gt { nl dup depth++ {call} forall depth-- indent } if } {1 priv} ifelse xcheck {(})} {(])} ifelse 8 p /break? exch def } bind /booleantype {13 p} bind /devicetype { (Device ) 11 p /break? false def /indent? false def getdeviceprops .dicttomark call /break? true def } bind /dicttype { break? exch (<<) 9 p dup rcheck { dup length 0 gt { dup nl depth++ { exch /break? false def call /break? true def ( => ) 8 p /indent? false def call } forall depth-- indent } if pop } {1 priv pop} ifelse (>>) 9 p /break? exch def } bind /filetype { (File ) 11 p dup status not {((invalid) ) 11 p} if mark exch { dup fileposition dup 3 -1 roll bytesavailable add exch } stopped { $error /newerror false put ((not positionable)) 11 p } { (@ ) 11 p 11 p (/) 11 p 11 p } ifelse cleartomark } bind /fonttype {pop (FontID) 11 p} bind /gstatetype { (Graphics State ) 11 p gsave setgstate /break? false def /indent? false def << /LineWidth currentlinewidth /LineCaps currentlinecap [(butt) (round) (square)] exch get /LineJoints currentlinejoin [(miter) (round) (bevel)] exch get /MiterLimit currentmiterlimit /AdjustStrokes currentstrokeadjust /Dashes [currentdash] /Colour [currentcolor] /ColourSpace currentcolorspace /Greyness currentgray /HSB [currenthsbcolor] /RGB [currentrgbcolor] /CMYK [currentcmykcolor] >> call /break? true def grestore } bind /integertype {3 p} bind /marktype {pop (Mark) 9 p} bind /nametype { dup 1024 string cvs dup false exch { dup 32 le exch 126 gt or {not exit} if } forall { stringtype ( ) print systemdict /cvn get operatortype xcheck {( ) print systemdict /cvx get operatortype} if } { pop dup xcheck not {(/) 10 p} if 10 p } ifelse } bind /nulltype {pop (null) 6 p} bind /operatortype {9 p} bind /packedarraytype {(#) 8 p arraytype} bind /realtype {3 p} bind /savetype {pop (VM Snapshot) 11 p} bind /stringtype {(\() 14 p dup rcheck {{char} forall} {pop 0 priv} ifelse (\)) 14 p} bind /unknowntype {(Unknown object: ) 9 p 9 p attr? {pop} {attr} ifelse} bind /call { Inspect begin indent dup dup type dup Inspect exch known {exec} {unknowntype} ifelse attr? {attr} {pop} ifelse break? {nl} if depth 0 eq {reset} if end } bind /reset { /refs <<>> def /break? true def /indent? true def /line 1 def /depth 0 def /buffer 1024 string def } bind % Section: Object attributes /attr? false /attr { ( %{) 8 p << /_ 3 -1 roll /r {/_ load {rcheck} stopped {pop false} if} bind /w {/_ load {wcheck} stopped {pop false} if} bind /x {/_ load xcheck} bind /on {true eq} bind /off {true ne} bind >> begin /_ load gcheck {(global)} {(local)} ifelse 8 p x off r off and w off and {(, no access) 8 p} if x on r on and w on and {(, full-access, writable) 8 p} if x on r on and w off and {(, full-access, unwritable) 8 p} if x on r off and w off and {(, execute-only) 8 p} if x off r on and w off and {(, read-only) 8 p} if x off r off and w on and {(, write-only) 8 p} if end (}%) 8 p } bind >> def /=== { dup Inspect /call get exec } bind def /? { 0 1 count 3 sub { index Inspect /call get exec } for } bind def << % Track references for the following object types: [/arraytype /dicttype /gstatetype /savetype] {dup Inspect 3 -1 roll get} forall >> { {dup Inspect /refs get exch known {ref}} bind dup length 2 add array 3 -1 roll exch count 2 roll aload pop [/saveref cvx count -1 roll aload pop] cvx /ifelse load count -1 roll astore cvx Inspect 3 1 roll put } forall setpacking