diff options
author | Ray Johnston <ray.johnston@artifex.com> | 2003-04-12 18:08:18 +0000 |
---|---|---|
committer | Ray Johnston <ray.johnston@artifex.com> | 2003-04-12 18:08:18 +0000 |
commit | 0f78338e2798a147794f9043011fdaaa67db77cf (patch) | |
tree | 6f2bbbd15e0864edbf9bd8697cc3971466323925 | |
parent | 5fc0de95672e1ec901249105685a8e85dfd1c115 (diff) | |
download | ghostpdl-0f78338e2798a147794f9043011fdaaa67db77cf.tar.gz |
Create more specific DEBUG switches in the interpreter initialization
modules to allow debugging to only include information of interest.
If -dDEBUG is set, then set all of the specific switches.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@3822 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r-- | gs/doc/Use.htm | 35 | ||||
-rw-r--r-- | gs/lib/docie.ps | 46 | ||||
-rw-r--r-- | gs/lib/gs_ccfnt.ps | 2 | ||||
-rw-r--r-- | gs/lib/gs_cff.ps | 44 | ||||
-rw-r--r-- | gs/lib/gs_cmap.ps | 18 | ||||
-rw-r--r-- | gs/lib/gs_epsf.ps | 18 | ||||
-rw-r--r-- | gs/lib/gs_fapi.ps | 2 | ||||
-rw-r--r-- | gs/lib/gs_init.ps | 25 | ||||
-rw-r--r-- | gs/lib/gs_pdfwr.ps | 2 | ||||
-rw-r--r-- | gs/lib/gs_resst.ps | 16 | ||||
-rw-r--r-- | gs/lib/gs_setpd.ps | 22 | ||||
-rw-r--r-- | gs/lib/gs_ttf.ps | 40 | ||||
-rw-r--r-- | gs/lib/pdf_base.ps | 14 | ||||
-rw-r--r-- | gs/lib/pdf_draw.ps | 8 | ||||
-rw-r--r-- | gs/lib/pdf_font.ps | 24 | ||||
-rw-r--r-- | gs/lib/pdf_main.ps | 6 | ||||
-rw-r--r-- | gs/lib/pdf_sec.ps | 6 | ||||
-rw-r--r-- | gs/lib/pdfopt.ps | 28 | ||||
-rw-r--r-- | gs/lib/pdfwrite.ps | 14 | ||||
-rw-r--r-- | gs/lib/viewgif.ps | 4 | ||||
-rw-r--r-- | gs/lib/viewjpeg.ps | 2 |
21 files changed, 214 insertions, 162 deletions
diff --git a/gs/doc/Use.htm b/gs/doc/Use.htm index 26cf92ad5..cc60b1be1 100644 --- a/gs/doc/Use.htm +++ b/gs/doc/Use.htm @@ -2285,8 +2285,39 @@ The information here describing is probably interesting only to developers. <h4><a name="Debug_switches"></a>Debug switches</h4> -The <b><tt>-Z</tt></b> and <b><tt>-T</tt></b> -! switches apply only +There are several debugging switches that are detected by the interpreter. +These switches are available whether or not Ghostscript was built with the +DEBUG macro defined to the compiler (refer to <a href="Make.htm#Debugging"> +building a debugging configuration</a>). + +<p>Previous to 8.10, there was a single DEBUG flag, enabled with <b><tt>-dDEBUG +</tt></b> on the command line. Now there are several debugging flags to allow +more selective debugging information to be printed containing only what is +needed to investigate particular areas. For backward compatibilty, the +<b><tt>-dDEBUG</tt></b> option will set all of the subset switches. + +<ul> +<table cellpadding=0 cellspacing=0> + <tr><td><td> <td> + <tr><td><b><tt>-dCCFONTDEBUG</tt></b><td><td>Compiled Fonts + <tr><td><b><tt>-dCFFDEBUG</tt></b><td><td>CFF Fonts + <tr><td><b><tt>-dCMAPDEBUG</tt></b><td><td>CMAP + <tr><td><b><tt>-dDOCIEDEBUG</tt></b><td><td>CIE color + <tr><td><b><tt>-dEPSDEBUG</tt></b><td><td>EPS handling + <tr><td><b><tt>-dFAPIDEBUG</tt></b><td><td>Font API + <tr><td><b><tt>-dINITDEBUG</tt></b><td><td>Initialization + <tr><td><b><tt>-dPDFDEBUG</tt></b><td><td>PDF Interpreter + <tr><td><b><tt>-dPDFOPTDEBUG</tt></b><td><td>PDF Optimizer (Linearizer) + <tr><td><b><tt>-dPDFWRDEBUG</tt></b><td><td>PDF Writer + <tr><td><b><tt>-dSETPDDEBUG</tt></b><td><td>setpagedevice + <tr><td><b><tt>-dSTRESDEBUG</tt></b><td><td>Static Resources + <tr><td><b><tt>-dTTFDEBUG</tt></b><td><td>TTF Fonts + <tr><td><b><tt>-dVGIFDEBUG</tt></b><td><td>ViewGIF + <tr><td><b><tt>-dVJPGDEBUG</tt></b><td><td>ViewJPEG +</table></ul> + +<p><p> +The <b><tt>-Z</tt></b> and <b><tt>-T</tt></b> switches apply only if the interpreter was <a href="Make.htm#Debugging">built for a debugging configuration</a>. In the table below, the first column is a debugging switch, the second is an equivalent switch (if any) and the third is its diff --git a/gs/lib/docie.ps b/gs/lib/docie.ps index d900a0edd..559dfb5d8 100644 --- a/gs/lib/docie.ps +++ b/gs/lib/docie.ps @@ -93,33 +93,33 @@ /csmap % <csdict> <l> <m> <n> csmap <csdict> <x> <y> <z> { 3 index /RangeLMN .knownget not { r3default } if restrict3 -DEBUG { (After RangeLMN Decode: ) print3 } if +DOCIEDEBUG { (After RangeLMN Decode: ) print3 } if 3 index /DecodeLMN .knownget { apply3 } if -DEBUG { (After DecodeLMN Decode: ) print3 } if +DOCIEDEBUG { (After DecodeLMN Decode: ) print3 } if 3 index /MatrixLMN .knownget { mmult3 } if -DEBUG { (After MatrixLMN Decode: ) print3 } if +DOCIEDEBUG { (After MatrixLMN Decode: ) print3 } if } bind def /csciea % <csdict> <a> csciea <csdict> <x> <y> <z> { 1 index /RangeA .knownget not { r1default } if restrict -DEBUG { (After RangeA Decode: ) print1 } if +DOCIEDEBUG { (After RangeA Decode: ) print1 } if 1 index /DecodeA .knownget { exec } if -DEBUG { (After DecodeA Decode: ) print1 } if +DOCIEDEBUG { (After DecodeA Decode: ) print1 } if 1 index /MatrixA .knownget { { 1 index mul exch } forall pop } { dup dup } ifelse -DEBUG { (After MatrixA Decode: ) print3 } if +DOCIEDEBUG { (After MatrixA Decode: ) print3 } if csmap } bind def /cscieabc % <csdict> <a> <b> <c> cscieabc <csdict> <x> <y> <z> { 3 index /RangeABC .knownget not { r3default } if restrict3 -DEBUG { (After RangeABC Decode: ) print3 } if +DOCIEDEBUG { (After RangeABC Decode: ) print3 } if 3 index /DecodeABC .knownget { apply3 } if -DEBUG { (After DecodeABC Decode: ) print3 } if +DOCIEDEBUG { (After DecodeABC Decode: ) print3 } if 3 index /MatrixABC .knownget { mmult3 } if -DEBUG { (After MatrixABC Decode: ) print3 } if +DOCIEDEBUG { (After MatrixABC Decode: ) print3 } if csmap } bind def @@ -131,7 +131,7 @@ DEBUG { (After MatrixABC Decode: ) print3 } if 3 -1 roll 3 index 1 get 1 sub mul 3 -1 roll 3 index 2 get 1 sub mul % Stack: rtable ia ib ic -DEBUG { (RenderTable indices: ) print3 mark 5 1 roll } if +DOCIEDEBUG { (RenderTable indices: ) print3 mark 5 1 roll } if 3 -1 roll round cvi 3 index 3 get exch get % Stack: rtable ib ic string 3 -1 roll round cvi 3 index 2 get mul @@ -140,16 +140,16 @@ DEBUG { (RenderTable indices: ) print3 mark 5 1 roll } if % Stack: rtable string index 2 index 4 get getinterval % Stack: rtable bytes -DEBUG { (RenderTable values: ) print (<) print (%stdout) (w) file 1 index writehexstring (>) = } if +DOCIEDEBUG { (RenderTable values: ) print (<) print (%stdout) (w) file 1 index writehexstring (>) = } if } bind def /bpdefault [0 0 0] def /crmap % <csdict> <crdict> <x> <y> <z> crmap <v1> ... { -DEBUG { (CIE XYZ = ) print3 } if +DOCIEDEBUG { (CIE XYZ = ) print3 } if 3 index /MatrixPQR .knownget { mmult3 } if -DEBUG { (After MatrixPQR: ) print3 } if +DOCIEDEBUG { (After MatrixPQR: ) print3 } if 4 index /WhitePoint get 5 index /BlackPoint .knownget not { bpdefault } if 5 index /WhitePoint get @@ -170,24 +170,24 @@ DEBUG { (After MatrixPQR: ) print3 } if } forall 7 3 roll pop pop pop pop % get rid of White/BlackPoints -DEBUG { (After TransformPQR: ) print3 } if +DOCIEDEBUG { (After TransformPQR: ) print3 } if 3 index /MatrixPQR .knownget { minvert3 mmult3 } if -DEBUG { (After MatrixPQR': ) print3 } if +DOCIEDEBUG { (After MatrixPQR': ) print3 } if 3 index /MatrixLMN .knownget { mmult3 } if -DEBUG { (After MatrixLMN Encode: ) print3 } if +DOCIEDEBUG { (After MatrixLMN Encode: ) print3 } if 3 index /EncodeLMN .knownget { apply3 } if -DEBUG { (After EncodeLMN Encode: ) print3 } if +DOCIEDEBUG { (After EncodeLMN Encode: ) print3 } if 3 index /RangeLMN .knownget not { r3default } if restrict3 -DEBUG { (After RangeLMN Encode: ) print3 } if +DOCIEDEBUG { (After RangeLMN Encode: ) print3 } if 3 index /MatrixABC .knownget { mmult3 } if -DEBUG { (After MatrixABC Encode: ) print3 } if +DOCIEDEBUG { (After MatrixABC Encode: ) print3 } if 3 index /EncodeABC .knownget { apply3 } if -DEBUG { (After EncodeABC Encode: ) print3 } if +DOCIEDEBUG { (After EncodeABC Encode: ) print3 } if 3 index /RangeABC .knownget not { r3default } if 5 -1 roll /RenderTable .knownget { % Stack: u v w ranges rtable 5 1 roll rescale3 -DEBUG { (Rescaled ABC: ) print3 } if +DOCIEDEBUG { (Rescaled ABC: ) print3 } if % Stack: rtable a b c lookup3 % Stack: rtable bytes @@ -198,10 +198,10 @@ DEBUG { (Rescaled ABC: ) print3 } if 3 index 3 -1 roll 5 add get exec 3 1 roll } for pop pop -DEBUG { (After RenderTableT: ) print ] dup == aload pop } if +DOCIEDEBUG { (After RenderTableT: ) print ] dup == aload pop } if } { restrict3 -DEBUG { (After RangeABC Encode: ) print3 } if +DOCIEDEBUG { (After RangeABC Encode: ) print3 } if } ifelse } bind def diff --git a/gs/lib/gs_ccfnt.ps b/gs/lib/gs_ccfnt.ps index 557889a06..1272328ab 100644 --- a/gs/lib/gs_ccfnt.ps +++ b/gs/lib/gs_ccfnt.ps @@ -17,7 +17,7 @@ % Find and register all the precompiled font operators in systemdict. /registerfont % <fontname> <fontdict> registerfont <font> - { DEBUG { (Registering ) print 1 index = } if + { CCFONTDEBUG { (Registering ) print 1 index = } if dup begin Encoding type /nametype eq { Encoding .findencoding /Encoding exch def diff --git a/gs/lib/gs_cff.ps b/gs/lib/gs_cff.ps index b116c98b4..ae09ca831 100644 --- a/gs/lib/gs_cff.ps +++ b/gs/lib/gs_cff.ps @@ -184,17 +184,17 @@ mark /next { % - next <byte> f read { 1 advance - DEBUG { ( ) print dup = } if + CFFDEBUG { ( ) print dup = } if } if } bind def /next2 { % - next2 <byte1> <byte2> f read { f read { 2 advance - DEBUG { ( ) print 1 index =only (,) print dup = } if + CFFDEBUG { ( ) print 1 index =only (,) print dup = } if } { 1 advance - DEBUG { ( ) print dup = } if + CFFDEBUG { ( ) print dup = } if } ifelse } if } bind def @@ -203,7 +203,7 @@ mark pop () } { string f exch readstring pop dup length advance - DEBUG { ( ) print dup == } if + CFFDEBUG { ( ) print dup == } if } ifelse } bind def /card8 % - card8 <card8> @@ -231,19 +231,19 @@ def /card16 load def /Index { % <name> Index <name> <array> - DEBUG { (% reading Index: ) print dup = } if + CFFDEBUG { (% reading Index: ) print dup = } if mark card16 dup 0 ne { 1 exch next offsetproc dup exec pop exch { dup exec dup 4 -1 roll sub 3 1 roll exch } repeat pop } if pop .packtomark - DEBUG { (% Index lengths = ) print dup === } if + CFFDEBUG { (% Index lengths = ) print dup === } if [ exch { nextstring } forall ] readonly } bind def /tokens { % - tokens <num1> ... <op#> (op# = 12 means EOF) { f read not { 12 exit } if - DEBUG { (..) print dup = } if + CFFDEBUG { (..) print dup = } if 1 advance dup 12 eq { pop next 32 add exit } if dup 28 lt { exit } if @@ -296,7 +296,7 @@ def /Dict { % <opsdict> Dict - /opdict exch store { mark tokens - DEBUG { (tokens: ) print ] dup === mark exch aload pop } if + CFFDEBUG { (tokens: ) print ] dup === mark exch aload pop } if opdict exch .knownget { exec } if cleartomark } loop cleartomark } bind def @@ -314,7 +314,7 @@ def % ------ Top dictionary ------ % /offput { % <offset> <proc> offput - - DEBUG { (queued: ) print 1 index =only ( ) print dup === } if + CFFDEBUG { (queued: ) print 1 index =only ( ) print dup === } if currentdict exch aload length 1 add packedarray cvx offsets 3 1 roll put } bind def @@ -326,7 +326,7 @@ def /queued exch store } bind def /printvk { % <value> <key> printvk <value> <key> - DEBUG { (\t% ) print dup =only ( = ) print 1 index === } if + CFFDEBUG { (\t% ) print dup =only ( = ) print 1 index === } if } bind def /xxput { % <value> <key> <dict> xxput - 3 1 roll exch put @@ -341,7 +341,7 @@ def printvk xdef } bind def /topdictops mark - 12 { DEBUG { (\t% EOD) = } if exit } + 12 { CFFDEBUG { (\t% EOD) = } if exit } 0 { idstring /version putfi } 1 { idstring /Notice putfi } 32 { idstring /Copyright putfi } @@ -527,7 +527,7 @@ dup % Format 2 } bind def /privatedictops mark - 12 { DEBUG { (\t% EOD) = } if exit } + 12 { CFFDEBUG { (\t% EOD) = } if exit } 6 { deltarray /BlueValues pxdef } 7 { deltarray /OtherBlues pxdef } 8 { deltarray /FamilyBlues pxdef } @@ -586,7 +586,7 @@ dup % Format 2 % The value of Encoding is either a number, for predefined % encodings, or an array of mixed GIDs and names. /Encoding mark Encoding - DEBUG { (Encoding: ) print dup === flush } if + CFFDEBUG { (Encoding: ) print dup === flush } if dup type /integertype eq { StandardEncodings exch get { idname } forall } { @@ -598,7 +598,7 @@ dup % Format 2 % Note that they may only correspond to an initial % subset of the charset. /CharStrings charset length CharStringArray length .min dict def - DEBUG { + CFFDEBUG { charset length =only ( charset ) print CharStringArray length =only ( CharStringArray) = charset == flush @@ -616,7 +616,7 @@ dup % Format 2 % Construct the GlyphDirectory, similar to CharStrings. /FDBytes FDArray length 1 gt { 1 } { 0 } ifelse def /GlyphDirectory charset length CharStringArray length .min dict def - DEBUG { + CFFDEBUG { charset length =only ( charset ) print CharStringArray length =only ( CharStringArray) = charset == flush @@ -661,7 +661,7 @@ dup % Format 2 /cff exch def /pos 0 def /resname exch cvlit def - /DEBUG DEBUG def % bring the binding closer + /DEBUG CFFDEBUG def % bring the binding closer % Read the header. @@ -706,12 +706,12 @@ dup % Format 2 % Read other tables with queued offsets. - DEBUG { (offsets: ) print [ offsets { pop } forall ] == } if + CFFDEBUG { (offsets: ) print [ offsets { pop } forall ] == } if { /f cff def - DEBUG { (pos=) print pos = } if + CFFDEBUG { (pos=) print pos = } if offsets pos 2 copy .knownget not { pop pop exit } if 3 1 roll undef - DEBUG { (exec queued: ) print dup == } if + CFFDEBUG { (exec queued: ) print dup == } if exec } loop offsets length 0 ne { @@ -723,7 +723,7 @@ dup % Format 2 % Process out-of-order tables. - DEBUG { queued length =only ( queued) = flush } if + CFFDEBUG { queued length =only ( queued) = flush } if queued { exec } forall % Update Encoding and CharStrings. @@ -737,10 +737,10 @@ dup % Format 2 % Wrap up. resname mark 0 1 fonts length 1 sub { - DEBUG { dup =only ( ) print flush } if + CFFDEBUG { dup =only ( ) print flush } if dup names exch get forceresname { pop resname } if - DEBUG { dup == flush } if + CFFDEBUG { dup == flush } if exch fonts exch get dup /CIDFontType known { % This is a CIDFont. diff --git a/gs/lib/gs_cmap.ps b/gs/lib/gs_cmap.ps index 102e73056..a77b2654c 100644 --- a/gs/lib/gs_cmap.ps +++ b/gs/lib/gs_cmap.ps @@ -32,19 +32,19 @@ % we need to replace dst type codes in the notdef map with the value 3, % which corresponds to CODE_VALUE_NOTDEF, see gxfcmap.h . % - DEBUG { (rewriting TempMapsNotDef\n) print flush } if + CMAPDEBUG { (rewriting TempMapsNotDef\n) print flush } if .TempMaps 2 get dup length 0 gt { 0 get - DEBUG { (...original...\n) print flush } if + CMAPDEBUG { (...original...\n) print flush } if 1 5 2 index length 1 sub { { 1 index exch get 2 3 put } stopped - { DEBUG { (cannot rewrite\n) print flush } if } - { DEBUG { (rewrite\n) print flush } if } ifelse + { CMAPDEBUG { (cannot rewrite\n) print flush } if } + { CMAPDEBUG { (rewrite\n) print flush } if } ifelse } for } if pop - DEBUG { (...FINISHED...\n) print } if + CMAPDEBUG { (...FINISHED...\n) print } if } bind def % composefont doesn't appear in CMap files -- it's documented in @@ -114,7 +114,7 @@ } bind def /endcmap { % - endcmap - .rewriteTempMapsNotDef - DEBUG { + CMAPDEBUG { (*** defined charmap ***\n) print .TempMaps 1 get {exch == (\t) print ==} forall (*** undefined charmap ***\n) print @@ -125,7 +125,7 @@ % Append data from .TempMaps to .CodeMapData. /t .TempMaps i get def .CodeMapData i get length t { exch pop length add } forall - DEBUG { (requested array size ) print dup == } if + CMAPDEBUG { (requested array size ) print dup == } if array /a exch def a 0 .CodeMapData i get .putmore 0 1 t length 1 sub { @@ -337,7 +337,7 @@ 4 index 10 index eq and % compare params 1 index 7 index eq and % compare fontindex { - DEBUG { (merge! char\n) print } if + CMAPDEBUG { (merge! char\n) print } if pop 4 2 roll pop pop % prefix params keys value fontindex keys2 value2 5 -1 roll 3 -1 roll concatstrings @@ -450,7 +450,7 @@ 4 index 10 index eq and % compare params 1 index 7 index eq and % compare fontindex { - DEBUG { (merge!\n) print } if + CMAPDEBUG { (merge!\n) print } if pop 4 2 roll pop pop % prefix params keys value fontindex keys2 value2 5 -1 roll 3 -1 roll concatstrings diff --git a/gs/lib/gs_epsf.ps b/gs/lib/gs_epsf.ps index 362c83422..9f6116762 100644 --- a/gs/lib/gs_epsf.ps +++ b/gs/lib/gs_epsf.ps @@ -49,7 +49,7 @@ % Rescale and translate to fit the BoundingBox on the page /EPSBoundingBoxFitPage { % llx lly urx ury -- - DEBUG { (gs_epsf.ps: Rescaling EPS to fit page\n) print flush } if + EPSDEBUG { (gs_epsf.ps: Rescaling EPS to fit page\n) print flush } if clippath pathbbox newpath % translate to new origin at lower left of clippath 3 index 3 index translate @@ -67,7 +67,7 @@ % Crop the page to the BoundingBox /EPSBoundingBoxCrop { % llx lly urx ury -- - DEBUG { + EPSDEBUG { (gs_epsf.ps: Setting pagesize from EPS bounding box\n) print flush } if exch 3 index sub exch 2 index sub % stack: llx lly urx-llx ury-lly @@ -121,12 +121,12 @@ } { (%%BoundingBox:) anchorsearch { pop - DEBUG { (gs_epsf.ps: found %%BoundingBox\n) print flush } if + EPSDEBUG { (gs_epsf.ps: found %%BoundingBox\n) print flush } if 1 EPSBoundingBoxProcess } { (%%HiResBoundingBox:) anchorsearch { pop - DEBUG { (gs_epsf.ps: found %%HiResBoundingBox\n) print flush } if + EPSDEBUG { (gs_epsf.ps: found %%HiResBoundingBox\n) print flush } if 2 EPSBoundingBoxProcess } { pop % Not interested in this DSC comment @@ -171,29 +171,29 @@ dup (%!PS-Adobe-X.X EPSF-X.X) .peekstring { (EPSF) search { pop pop pop - DEBUG {(runEPS: Found EPS\n) print flush} if + EPSDEBUG {(runEPS: Found EPS\n) print flush} if systemdict /NOEPS known { cvx .runNoEPS } { cvx .runEPS } ifelse } { - DEBUG {(runEPS: Normal DSC\n) print flush} if + EPSDEBUG {(runEPS: Normal DSC\n) print flush} if pop cvx .runNoEPS } ifelse } { - DEBUG {(runEPS: Short DSC\n) print flush} if + EPSDEBUG {(runEPS: Short DSC\n) print flush} if pop cvx .runNoEPS } ifelse } { - DEBUG {(runEPS: Not DSC\n) print flush} if + EPSDEBUG {(runEPS: Not DSC\n) print flush} if cvx .runNoEPS } ifelse } { - DEBUG {(runEPS: Short non-DSC\n) print flush} if + EPSDEBUG {(runEPS: Short non-DSC\n) print flush} if pop cvx .runNoEPS } ifelse diff --git a/gs/lib/gs_fapi.ps b/gs/lib/gs_fapi.ps index af9f7249d..5fa7fb249 100644 --- a/gs/lib/gs_fapi.ps +++ b/gs/lib/gs_fapi.ps @@ -181,7 +181,7 @@ currentdict end Redefine % with .FAPIrebuildfont . Otherwise the font is handled with the native GS font renderer. /FAPI_hook_debug % <proc> FAPI_hook_debug - -DEBUG { {exec} } { {pop} } ifelse +FAPIDEBUG { {exec} } { {pop} } ifelse bind def /FAPI_hook_warn % <proc> FAPI_hook_debug - diff --git a/gs/lib/gs_init.ps b/gs/lib/gs_init.ps index 9f804000a..6a5eb307c 100644 --- a/gs/lib/gs_init.ps +++ b/gs/lib/gs_init.ps @@ -76,8 +76,29 @@ true setpacking % Acquire the debugging flags. currentdict /DEBUG known /DEBUG exch def + +% if DEBUG is set, set ALL of the subset debugging flags +mark % '[' isn't defined yet + /CCFONTDEBUG % Compiled Fonts + /CFFDEBUG % CFF Fonts + /CMAPDEBUG % CMAP + /DOCIEDEBUG % CIE color + /EPSDEBUG % EPS handling + /FAPIDEBUG % Font API + /INITDEBUG % Initialization + /PDFDEBUG % PDF Interpreter + /PDFOPTDEBUG % PDF Optimizer (Linearizer) + /PDFWRDEBUG % PDF Writer + /SETPDDEBUG % setpagedevice + /STRESDEBUG % Static Resources + /TTFDEBUG % TTF Fonts + /VGIFDEBUG % ViewGIF + /VJPGDEBUG % ViewJPEG +counttomark array astore exch pop % ']' isn't defined yet +{ dup currentdict exch known DEBUG or def } forall + /VMDEBUG - DEBUG {{print mark + INITDEBUG {{print mark systemdict /level2dict known { .currentglobal dup false .setglobal vmstatus true .setglobal vmstatus 3 -1 roll pop @@ -1697,7 +1718,7 @@ ifelse % If the initial device parameters are invalid, the setdevice may fail. % Trap this and produce a reasonable error message. { setdevice } % does an erasepage -DEBUG { exec false } { .internalstopped } ifelse { +INITDEBUG { exec false } { .internalstopped } ifelse { (**** Unable to open the initial device, quitting.) = flush 1 .quit } if diff --git a/gs/lib/gs_pdfwr.ps b/gs/lib/gs_pdfwr.ps index e75e19ed0..da5120f6c 100644 --- a/gs/lib/gs_pdfwr.ps +++ b/gs/lib/gs_pdfwr.ps @@ -415,7 +415,7 @@ bind def 3 -1 roll .parse_dsc_comments % <dsc dict> <dict> <type> 1 index //.pdf_hook_DSC_Creator exec dup /NOP ne 2 index length 1 gt or { % Skip unparsed comments - DEBUG { (**** DSC comment: ) print dup == 1 index === flush } if + PDFWRDEBUG { (**** DSC comment: ) print dup == 1 index === flush } if exch mark 4 1 roll { % mark <key1> <value1> ... <dsc dict> <type> <key> <value> 3 index 2 index known { % Skip the DSC_struct entry diff --git a/gs/lib/gs_resst.ps b/gs/lib/gs_resst.ps index ed0b29c83..acc8ed685 100644 --- a/gs/lib/gs_resst.ps +++ b/gs/lib/gs_resst.ps @@ -50,10 +50,10 @@ languagelevel 2 .setlanguagelevel /MakeInstance % <Name> <record> MakeInstance <Name> <Instance> <size> { begin - DEBUG { (Loading a static resource ) print dup = } if + STRESDEBUG { (Loading a static resource ) print dup = } if 255 string 2 index 2 index //GetFilePath exec (r) file run - DEBUG { (Completed loading the static resource ) print dup = } if + STRESDEBUG { (Completed loading the static resource ) print dup = } if StaticFileEnd StaticFilePos sub end 1 index Category findresource @@ -81,11 +81,11 @@ mark /.StaticResourcesBeg % <end_string> <no_of_resources> <category_name> .StaticResourcesBeg <category_name> % Puts .map dictionary to dstack. { - DEBUG { (Starting static resources for category ) print dup = } if + STRESDEBUG { (Starting static resources for category ) print dup = } if dup /Category resourcestatus { pop pop exch dict begin exch pop } { - DEBUG { (Skipping the resources because the category isn't defined.) = } if + STRESDEBUG { (Skipping the resources because the category isn't defined.) = } if pop pop .skipeof } ifelse } bind @@ -93,7 +93,7 @@ mark /.StaticResourcesEnd % <category_name> .StaticResourcesEnd - % Removes .map dictionary from dstack. { - DEBUG { (Completting static resources for category ) print dup = } if + STRESDEBUG { (Completting static resources for category ) print dup = } if currentdict end dup % /CatName <map> <map> systemdict /.io_static_root .knownget not { 10 dict % /CatName <map> <map> <dir> @@ -123,7 +123,7 @@ end % the temporary dictionary for local binding. /.BeginResource % <instance_name> BeginResource <instance_name> % Puts a record dictionary to dstack. { - DEBUG { (Static resource ) print dup =string cvs print } if + STRESDEBUG { (Static resource ) print dup =string cvs print } if currentfile fileposition currentfile =string readline pop dup length 0 exch 10 .min getinterval (%% Replace) ne { % We are in COMPILE_INITS=1 . @@ -143,11 +143,11 @@ end % the temporary dictionary for local binding. /StaticFileEnd currentfile fileposition (.EndResource) length sub def - DEBUG { ( from position ) print StaticFilePos =string cvs print ( to position ) print StaticFileEnd = } if + STRESDEBUG { ( from position ) print StaticFilePos =string cvs print ( to position ) print StaticFileEnd = } if currentdict end def } { pop - DEBUG { ( ignored with COMPILE_INITS=0. ) = } if + STRESDEBUG { ( ignored with COMPILE_INITS=0. ) = } if } ifelse } bind diff --git a/gs/lib/gs_setpd.ps b/gs/lib/gs_setpd.ps index bedc6d383..c81540dbb 100644 --- a/gs/lib/gs_setpd.ps +++ b/gs/lib/gs_setpd.ps @@ -100,7 +100,7 @@ level2dict begin dup type /booleantype eq { pop pop } { % This should never happen! - DEBUG { (Error in .trysetparams!) = pstack flush } if + SETPDDEBUG { (Error in .trysetparams!) = pstack flush } if cleartomark pop pop pop /.installpagedevice cvx /rangecheck signalerror } @@ -475,7 +475,7 @@ level2dict begin /setpagedevice load /configurationerror signalerror } bind 1 { % Roll back the failed request to its previous status. -DEBUG { (Rolling back.) = pstack flush } if +SETPDDEBUG { (Rolling back.) = pstack flush } if 3 index 2 index 3 -1 roll put 4 index 1 index .knownget { 4 index 3 1 roll put } @@ -544,9 +544,9 @@ DEBUG { (Rolling back.) = pstack flush } if % -mark- key1 value1 ... counttomark 5 add index .computemediasize exch pop exch pop /.MediaSize exch -DEBUG { (Putting.) = pstack flush } if +SETPDDEBUG { (Putting.) = pstack flush } if .putdeviceparamsonly -DEBUG { (Result of putting.) = pstack flush } if +SETPDDEBUG { (Result of putting.) = pstack flush } if } bind def % Compute the media size and initial matrix from a merged request (after @@ -582,7 +582,7 @@ DEBUG { (Result of putting.) = pstack flush } if % also handle the case where the current device % is not a page device. % Stack: mark <request> <current> -DEBUG { (Checking.) = pstack flush } if +SETPDDEBUG { (Checking.) = pstack flush } if dup /OutputDevice .knownget { % Current device is a page device. @@ -624,7 +624,7 @@ DEBUG { (Checking.) = pstack flush } if % Construct a merged request from the actual request plus % any keys that should always be propagated. % Stack: mark <request> <orig> -DEBUG { (Merging.) = pstack flush } if +SETPDDEBUG { (Merging.) = pstack flush } if exch 1 index length 1 index length add dict .copiedkeys @@ -660,7 +660,7 @@ DEBUG { (Merging.) = pstack flush } if % Select input and output media. % Stack: mark <orig> <request> <merged> -DEBUG { (Selecting.) = pstack flush } if +SETPDDEBUG { (Selecting.) = pstack flush } if 0 dict % <failed> 1 index /InputAttributes .knownget @@ -677,7 +677,7 @@ DEBUG { (Selecting.) = pstack flush } if % Construct the new device, and attempt to set its attributes. % Stack: mark <orig> <request> <merged> <failed> -DEBUG { (Constructing.) = pstack flush } if +SETPDDEBUG { (Constructing.) = pstack flush } if currentdevice .devicename 2 index /OutputDevice get eq { currentdevice } @@ -693,7 +693,7 @@ DEBUG { (Constructing.) = pstack flush } if { % The request failed. % Stack: ... <orig> <request> <merged> <failed> <device> % <Policies> true mark <name> <errorname> ... -DEBUG { (Recovering.) = pstack flush } if +SETPDDEBUG { (Recovering.) = pstack flush } if counttomark 4 add index counttomark 2 idiv { dup 4 -2 roll put } repeat pop pop pop @@ -713,7 +713,7 @@ DEBUG { (Recovering.) = pstack flush } if % The attempt succeeded. Install the new device. % Stack: mark ... <merged> <failed> <device> <eraseflag> -DEBUG { (Installing.) = pstack flush } if +SETPDDEBUG { (Installing.) = pstack flush } if pop 2 .endpage { 1 //true .outputpage @@ -815,7 +815,7 @@ DEBUG { (Installing.) = pstack flush } if % Clean up, calling PolicyReport if needed. % Stack: mark ... <failed> <merged> -DEBUG { (Finishing.) = pstack flush } if +SETPDDEBUG { (Finishing.) = pstack flush } if exch dup length 0 ne { 1 index /Policies get /PolicyReport get diff --git a/gs/lib/gs_ttf.ps b/gs/lib/gs_ttf.ps index da13fd3ee..a67c2e42f 100644 --- a/gs/lib/gs_ttf.ps +++ b/gs/lib/gs_ttf.ps @@ -198,7 +198,7 @@ % <nametable> <nameid> findname <string> true % <nametable> <nameid> findname false /findname { - DEBUG { (findname: ) print dup =only } if + TTFDEBUG { (findname: ) print dup =only } if false 3 1 roll 0 1 3 index 2 getu16 1 sub { % Stack: false table id index 12 mul 6 add 2 index exch 12 getinterval @@ -213,7 +213,7 @@ is2byte { string2to1 } if true null 4 -1 roll exit } if pop } for pop pop - DEBUG { + TTFDEBUG { dup { ( = ) print 1 index == } { ( not found) = } ifelse } if } bind def @@ -368,7 +368,7 @@ exch sub 0 .max dup { 0 putglyph } repeat ecode scode sub 1 add add numcodes add /numcodes exch def /delta iddelta i2 gets16 def - DEBUG { + TTFDEBUG { (scode=) print scode =only ( ecode=) print ecode =only ( delta=) print delta =only @@ -404,14 +404,14 @@ % <cmaptab> cmaparray <glypharray> /cmaparray { dup 0 getu16 cmapformats exch .knownget { - DEBUG { + TTFDEBUG { (cmap: format ) print 1 index 0 getu16 = flush } if exec } { (Can't handle format ) print 0 getu16 = flush 0 1 255 { } for 256 packedarray } ifelse - DEBUG { + TTFDEBUG { (cmap: length=) print dup length = dup == } if } bind def @@ -424,7 +424,7 @@ } 16#00020000 { % Detailed map, required by Microsoft fonts. dup length 36 lt { - DEBUG { (post format 2.0 invalid.) = flush } if + TTFDEBUG { (post format 2.0 invalid.) = flush } if pop [ ] } { /postglyphs exch def @@ -447,7 +447,7 @@ % Some badly formed TT fonts have glyph index values past the end % of the 'post' table. 1 index length 1 index le { - DEBUG { ( *** warning: glyph index past end of 'post' table) = flush } if + TTFDEBUG { ( *** warning: glyph index past end of 'post' table) = flush } if exit } if get 1 add add @@ -455,7 +455,7 @@ 1 add postglyphs exch 1 index length 1 index lt { - DEBUG { ( *** warning: glyph index past end of 'post' table) = flush } if + TTFDEBUG { ( *** warning: glyph index past end of 'post' table) = flush } if % extend the postglyphs string by 1 byte of 0x00 exch (\000) concatstrings /postglyphs exch def postglyphs exch } if @@ -591,7 +591,7 @@ end readonly def % .loadttfontdict % tabs = tables we want to keep, sorted by file position. /tabs [ 0 16 tables length 1 sub { tables exch 16 getinterval - DEBUG { dup .printtab } if + TTFDEBUG { dup .printtab } if dup 0 4 getinterval readtables_ 1 index known { tabdict exch 2 index put } { @@ -782,16 +782,16 @@ mark % Uses post, defines glyphencoding /.getpost { /glyphencoding post null eq { - DEBUG { (post missing) = flush } if [ ] + TTFDEBUG { (post missing) = flush } if [ ] } { postformats post 0 getu32 .knownget { - DEBUG { + TTFDEBUG { (post: format ) print post 0 getu16 =only (,) print post 2 getu16 = flush } if post exch exec } { - DEBUG { (post: unknown format ) print post 0 getu32 = flush } if [ ] + TTFDEBUG { (post: unknown format ) print post 0 getu32 = flush } if [ ] } ifelse } ifelse def } bind def @@ -828,7 +828,7 @@ mark } if counttomark 0 ne { .dicttomark } { pop pop } ifelse /XUID [orgXUID 42 curxuid] - DEBUG { + TTFDEBUG { tabs { .printtab } forall [ sfnts { length } forall ] == count ttkeycount sub array astore dup { == } forall aload pop @@ -848,7 +848,7 @@ mark dup 4 8 getinterval exch % the default 0 1 2 index 2 getu16 1 sub { 8 mul 4 add 1 index exch 8 getinterval - DEBUG { + TTFDEBUG { (cmap: platform ) print dup 0 getu16 =only ( encoding ) print dup 2 getu16 = flush } if @@ -878,20 +878,20 @@ mark (gs/lib/xlatmap containg a record with an invalid (PlatformID.SpecificID)) = /.pickcmap_with_xlatmap cvx /configurationerror signalerror } ifelse - DEBUG { + TTFDEBUG { (Seeking a cmap for platform=) print 1 index =only ( encoding=) print dup = } if tabdict /cmap get % bool [] i PlatID SpecID (cmap) dup /cmaptab exch def % temporary 0 1 2 index 2 getu16 1 sub { % bool [] i PlatID SpecID (cmap) j 8 mul 4 add 1 index exch 8 getinterval % bool [] i PlatID SpecID (cmap) (cmapsub) - DEBUG { + TTFDEBUG { (cmap: platform ) print dup 0 getu16 =only ( encoding ) print dup 2 getu16 = flush } if dup 0 getu16 4 index eq { dup 2 getu16 3 index eq { % bool [] i PlatID SpecID (cmap) (cmapsub) - DEBUG { + TTFDEBUG { (Choosen a cmap for platform=) print 3 index =only ( encoding=) print 2 index = } if @@ -946,7 +946,7 @@ mark % - .charkeys /CharStrings <charstrings> /Encoding <encoding> % Resets glyphencoding /.charkeys { - DEBUG { + TTFDEBUG { (glyphencoding: length=) print glyphencoding dup length = === flush } if % Hack: if there is no usable post table but the cmap uses @@ -992,14 +992,14 @@ mark [ cmaptab cmaparray dup length 256 gt { 0 256 getinterval } if { glyphencoding exch get } forall counttomark 256 exch sub { /.notdef } repeat ] - DEBUG { (Encoding: ) print dup === flush } if + TTFDEBUG { (Encoding: ) print dup === flush } if } bind def % -mark- <key> <value> ... .definettfont <font> /.definettfont { /FontType 42 /PaintType 0 - DEBUG { + TTFDEBUG { (numloca=) print numloca = } if .dicttomark diff --git a/gs/lib/pdf_base.ps b/gs/lib/pdf_base.ps index 2f1a5fc1e..d7451a706 100644 --- a/gs/lib/pdf_base.ps +++ b/gs/lib/pdf_base.ps @@ -121,7 +121,7 @@ pdfdict begin } if } bind def /.pdfexectoken { % <count> <opdict> <exectoken> .pdfexectoken ? - DEBUG { dup == flush } if + PDFDEBUG { dup == flush } if 2 copy .knownget { exch pop exch pop exch pop exec } { @@ -151,10 +151,10 @@ pdfdict begin .pdfexectoken } { .pdffixname - exch pop exch pop DEBUG { dup ==only ( ) print flush } if + exch pop exch pop PDFDEBUG { dup ==only ( ) print flush } if } ifelse } { - exch pop exch pop DEBUG { dup ==only ( ) print flush } if + exch pop exch pop PDFDEBUG { dup ==only ( ) print flush } if } ifelse } { (%%EOF) cvn cvx .pdfexectoken @@ -342,7 +342,7 @@ pdfdict begin pop false } { % Update Objects from GlobalObjects - DEBUG { (%Global=>local: ) print dup == } if + PDFDEBUG { (%Global=>local: ) print dup == } if GlobalObjects 1 index get dup Objects 4 1 roll lput true } ifelse } { @@ -425,7 +425,7 @@ pdfdict begin % The only global objects we bother to save are % (resource) dictionaries. 1 index dup gcheck exch type /dicttype eq and { - DEBUG { (%Local=>global: ) print dup == } if + PDFDEBUG { (%Local=>global: ) print dup == } if GlobalObjects 1 index 3 index put IsGlobal 1 index 1 put } if @@ -444,7 +444,7 @@ pdfdict begin /obj { pop pop endobj exit } bind .dicttomark readonly def /resolveR { % <object#> <generation#> resolveR <object> - DEBUG { (%Resolving: ) print 2 copy 2 array astore == } if + PDFDEBUG { (%Resolving: ) print 2 copy 2 array astore == } if 1 index resolved? { exch pop exch pop } { @@ -515,7 +515,7 @@ pdfdict begin 10 eq { exit } if } loop % scan past \n dup /FilePosition PDFfile fileposition put - DEBUG { (%FilePosition: ) print dup /FilePosition get == } if + PDFDEBUG { (%FilePosition: ) print dup /FilePosition get == } if } if % Some (bad) PDf files have invalid stream lengths. This causes problems % if we reposition beyond the end of the file. So we compare the given diff --git a/gs/lib/pdf_draw.ps b/gs/lib/pdf_draw.ps index 8d138c208..a1d018e47 100644 --- a/gs/lib/pdf_draw.ps +++ b/gs/lib/pdf_draw.ps @@ -109,7 +109,7 @@ pdfdict begin /resolvefunction { % <fndict> resolvefunction <function> .resolvefn - DEBUG { (%Function: ) print dup === flush } if + PDFDEBUG { (%Function: ) print dup === flush } if } bdef /resolvefnproc { % <fndict> resolvefnproc <proc> @@ -655,7 +655,7 @@ end } bdef /.pdfpaintproc { % <patdict> <resdict> .pdfpaintproc - - DEBUG { (%Begin PaintProc) = flush } if + PDFDEBUG { (%Begin PaintProc) = flush } if % For uncolored patterns, we have to unbind the current % color and color space before running the PaintProc. % There's no harm in doing this for colored patterns, @@ -671,7 +671,7 @@ end /pdfemptycount exch def Q - DEBUG { (%End PaintProc) = flush } if + PDFDEBUG { (%End PaintProc) = flush } if PDFfile exch setfileposition } bdef @@ -703,7 +703,7 @@ end 2 index /Resources knownoget { oforce } { 0 dict } ifelse /.pdfpaintproc cvx ] cvx put - DEBUG { + PDFDEBUG { (%Pattern: ) print dup === flush } if } bdef diff --git a/gs/lib/pdf_font.ps b/gs/lib/pdf_font.ps index ed4202c11..e3bef842e 100644 --- a/gs/lib/pdf_font.ps +++ b/gs/lib/pdf_font.ps @@ -448,7 +448,7 @@ end readonly def % an empty string. Work around this nonsense here. dup length 0 ne { data exch readstring pop } if dup length 3 -1 roll exch sub - DEBUG + PDFDEBUG { dup =only ( read ) print 1 index length =only (: ) print 1 index == flush @@ -462,11 +462,11 @@ end readonly def 1 index 0 get 16#80 eq { ( **** Warning: Embedded Type1 font in PFB format is not valid PDF.\n) pdfformaterror - DEBUG { (skipping PFB header) = flush } if + PDFDEBUG { (skipping PFB header) = flush } if exch pop buffer 0 5 getinterval type1readdata exch dup 4 get 256 mul 1 index 3 get add 256 mul 1 index 2 get add 256 mul 1 index 1 get add - DEBUG { (PFB segment length = ) print dup = } if + PDFDEBUG { (PFB segment length = ) print dup = } if exch pop % discard the string keeping the PFB segment length 2 copy ne { ( **** Warning: Type 1 PFB segment length and Length 1 value do not match.\n) @@ -481,7 +481,7 @@ end readonly def % Read the next block of the initial text portion. /type1read1 { % <left> type1read1 <string> <left'> - DEBUG { (read1 ) print } if + PDFDEBUG { (read1 ) print } if dup 0 eq { pop sectionstr 0 2 put stream /Length2 oget @@ -489,14 +489,14 @@ end readonly def dup 8 lt { type1read2 % Hexify. } { - DEBUG { (read2 ) print } if + PDFDEBUG { (read2 ) print } if pfbhdr 0 get 16#80 eq { % eat 6 more bytes of PFB junk before proceeding - DEBUG { (skipping PFB header in segment 2) = flush } if + PDFDEBUG { (skipping PFB header in segment 2) = flush } if buffer 0 6 getinterval type1readdata exch dup 5 get 256 mul 1 index 4 get add 256 mul 1 index 3 get add 256 mul 1 index 2 get add - DEBUG { (PFB segment length = ) print dup = } if + PDFDEBUG { (PFB segment length = ) print dup = } if exch pop % discard the string keeping the PFB segment length 2 copy ne { ( **** Warning: Type 1 PFB segment length and Length 2 value do not match.\n) @@ -539,22 +539,22 @@ end readonly def cleartomark\n) readonly def /type1read2 { % <left> type1read2 <string> <left'> - DEBUG { (read2 ) print } if + PDFDEBUG { (read2 ) print } if dup 0 eq { pop sectionstr 0 3 put stream /Length3 oget dup 0 eq - { DEBUG { (trailer ) print } if + { PDFDEBUG { (trailer ) print } if type1trailer exch } { pfbhdr 0 get 16#80 eq { % eat 6 more bytes of PFB junk before proceeding - DEBUG { (skipping PFB header in segment 3) = flush } if + PDFDEBUG { (skipping PFB header in segment 3) = flush } if buffer 0 6 getinterval type1readdata exch dup 5 get 256 mul 1 index 4 get add 256 mul 1 index 3 get add 256 mul 1 index 2 get add - DEBUG { (PFB segment length = ) print dup = } if + PDFDEBUG { (PFB segment length = ) print dup = } if exch pop % discard the string keeping the PFB segment length 2 copy ne { ( **** Warning: Type 1 PFB segment length and Length 3 value do not match.\n) @@ -575,7 +575,7 @@ readonly def % Read the next block of the final text portion. % When finished, this procedure returns an empty string. /type1read3 % <left> type1read3 <string> <left'> - { DEBUG { (read3 ) print } if + { PDFDEBUG { (read3 ) print } if buffer type1readdata } bdef diff --git a/gs/lib/pdf_main.ps b/gs/lib/pdf_main.ps index 05d58e021..87712e2fb 100644 --- a/gs/lib/pdf_main.ps +++ b/gs/lib/pdf_main.ps @@ -686,19 +686,19 @@ end readonly def % stack: [<prevproc>] <pagedict> <Crop|Media Box> exch pop % done with the pagedict systemdict /PDFFitPage known { - DEBUG { (Fiting PDF to imageable area of the page.) = flush } if + PDFDEBUG { (Fiting PDF to imageable area of the page.) = flush } if currentpagedevice /.HWMargins get aload pop currentpagedevice /PageSize get aload pop 3 -1 roll sub 3 1 roll exch sub exch % stack: [<prevproc>] <pagedict> <Crop|Media Box> Xmin Ymin Xmax Ymax - DEBUG { ( Translate up by [ ) print 3 index =print (, ) print 2 index =print ( ]) = flush } if + PDFDEBUG { ( Translate up by [ ) print 3 index =print (, ) print 2 index =print ( ]) = flush } if 3 index 3 index translate % move origin up to imageable area 2 index sub exch 3 index sub exch 4 2 roll pop pop % stack: [Box] XImageable YImageable 2 index aload pop 2 index sub exch 3 index sub exch 4 2 roll pop pop % stack: [Box] XImageable YImageable XBox YBox 3 -1 roll exch div 3 1 roll div .min - DEBUG { ( Scale by ) print dup = flush } if + PDFDEBUG { ( Scale by ) print dup = flush } if dup scale } if % Now translate to the origin given in the Crop|Media Box diff --git a/gs/lib/pdf_sec.ps b/gs/lib/pdf_sec.ps index 97277e79d..5143bab1b 100644 --- a/gs/lib/pdf_sec.ps +++ b/gs/lib/pdf_sec.ps @@ -278,7 +278,7 @@ def 2 index cvlit mark mark 5 2 roll { .pdftoken not { (%%EOF) cvn cvx } if dup xcheck - { DEBUG { dup == flush } if + { PDFDEBUG { dup == flush } if 3 -1 roll pop 2 copy .knownget { exch pop exch pop exec @@ -305,10 +305,10 @@ def } ifelse } - { exch pop DEBUG { dup ==only ( ) print flush } if + { exch pop PDFDEBUG { dup ==only ( ) print flush } if dup type /stringtype eq { 1 index arc4decode - DEBUG { (%Decrypted: ) print dup == flush } if + PDFDEBUG { (%Decrypted: ) print dup == flush } if } if exch pop diff --git a/gs/lib/pdfopt.ps b/gs/lib/pdfopt.ps index 8193098da..7e9ff9a92 100644 --- a/gs/lib/pdfopt.ps +++ b/gs/lib/pdfopt.ps @@ -167,7 +167,7 @@ userdict /clostreams 20 dict put % stream -> [data endproc] currentdict end } bind def /bitwrite { % <bstream> <value> <width> bitwrite - - PDEBUG { ( ) print 1 index =only (:) print dup = } if + PDFOPTDEBUG { ( ) print 1 index =only (:) print dup = } if 3 -1 roll begin N exch sub dup 0 ge { /N exch def N bitshift B add @@ -269,7 +269,7 @@ userdict /clostreams 20 dict put % stream -> [data endproc] % Delete replaced objects. 0 1 Objects llength 1 sub { Objects 1 index lget replaceable? { - PDEBUG { (Deleting ) print dup = } if + PDFOPTDEBUG { (Deleting ) print dup = } if Generations 1 index 0 lput } if pop } for @@ -408,7 +408,7 @@ userdict /clostreams 20 dict put % stream -> [data endproc] % Collect all the objects referenced from a page. The first object number % (which may not be the smallest one) is that of the page object itself. /identifyPageObjects { % <extra> <page#> identifyPageObjects <obj#s> - PDEBUG { + PDFOPTDEBUG { (%Objects for page: ) print dup = } if pdffindpageref @@ -468,7 +468,7 @@ userdict /clostreams 20 dict put % stream -> [data endproc] [ 3 1 roll { 2 copy eq { pop } { exch } ifelse } forall counttomark 1 roll ] - PDEBUG { + PDFOPTDEBUG { (%Objects = ) print dup === flush } if } bind def @@ -593,7 +593,7 @@ userdict /clostreams 20 dict put % stream -> [data endproc] % Write a part of the output file. /writePart { % <proc> <label> writePart - - PDEBUG { + PDFOPTDEBUG { dup print ( count=) print count =only ( start=) print OFile { .fileposition } stopped { pop (???) } if = 2 .execn @@ -703,25 +703,25 @@ userdict /clostreams 20 dict put % stream -> [data endproc] % Find the start and end of objects in the output. /omstart { % <obj#> omstart <pos> - PDEBUG { (start\() print dup =only } if + PDFOPTDEBUG { (start\() print dup =only } if omap - PDEBUG { (=>) print dup =only } if + PDFOPTDEBUG { (=>) print dup =only } if XRef exch get - PDEBUG { (\) = ) print dup = } if + PDFOPTDEBUG { (\) = ) print dup = } if } bind def /omend { % <obj#> omend <pos> % The end of an object is the start of the next object. % The caller must be sure that this object is not the last one % in part 9. - PDEBUG { (end\() print dup =only } if + PDFOPTDEBUG { (end\() print dup =only } if omap - PDEBUG { (=>) print dup =only } if + PDFOPTDEBUG { (=>) print dup =only } if 1 add % Check that the requested object wasn't the last one in part 6: % the next object in the output file is the first in part 7. PHSN omap 1 index eq { pop 1 } if XRef exch get - PDEBUG { (\) = ) print dup = } if + PDFOPTDEBUG { (\) = ) print dup = } if } bind def /omlength { % <obj#> omlength <length> dup omend exch omstart sub @@ -751,7 +751,7 @@ userdict /clostreams 20 dict put % stream -> [data endproc] /writePageOffsetHints { - PDEBUG { /writePageOffsetHints == } if + PDFOPTDEBUG { /writePageOffsetHints == } if 20 dict begin /bits OFile bitstream def /bwn { bits 3 1 roll bitwrite } def @@ -851,7 +851,7 @@ userdict /clostreams 20 dict put % stream -> [data endproc] } bind def /writeSharedObjectHints { - PDEBUG { /writeSharedObjectHints == } if + PDFOPTDEBUG { /writeSharedObjectHints == } if 20 dict begin /bits OFile bitstream def /bwn { bits 3 1 roll bitwrite } def @@ -935,7 +935,7 @@ userdict /clostreams 20 dict put % stream -> [data endproc] [LPDict PHS] createObjects /LPDictN 1 index def 1 add /PHSN exch def - PDEBUG { << /LPDictN LPDictN /PHSN PHSN >> === } if + PDFOPTDEBUG { << /LPDictN LPDictN /PHSN PHSN >> === } if % Count the number of objects in the output. diff --git a/gs/lib/pdfwrite.ps b/gs/lib/pdfwrite.ps index 8d4691533..5e1ad895e 100644 --- a/gs/lib/pdfwrite.ps +++ b/gs/lib/pdfwrite.ps @@ -29,7 +29,7 @@ /.setlanguagelevel where { pop 2 .setlanguagelevel } if .currentglobal true .setglobal -/PDEBUG where { pop } { /PDEBUG false def } ifelse +/PDFWRDEBUG where { pop } { /PDFWRDEBUG false def } ifelse % ================ Object mapping ================ % @@ -37,7 +37,7 @@ /omapinit { % - omapinit - /RMap 100 dict def /XRef 100 dict def - PDEBUG { (omapinit) = } if + PDFWRDEBUG { (omapinit) = } if } def % Map an object number. @@ -45,9 +45,9 @@ RMap 1 index .knownget { exch pop false } { - PDEBUG { (omap\() print dup =only } if + PDFWRDEBUG { (omap\() print dup =only } if RMap dup length 1 add 2 index exch dup 5 1 roll put pop true - PDEBUG { (\) = ) print 1 index = } if + PDFWRDEBUG { (\) = ) print 1 index = } if } ifelse } def /omap { % <oldobj#> omap <newobj#> @@ -65,7 +65,7 @@ } bind def /setomap { % <omap> setomap - aload pop /XRef exch def /RMap exch def - PDEBUG { + PDFWRDEBUG { (setomap: #Xref = ) print XRef length =only (, #RMap = ) print RMap length = } if @@ -192,14 +192,14 @@ readonly def .dicttomark readonly def /pdfwritevalue { % <obj> pdfwritevalue - - PDEBUG { (****Writing: ) print dup === flush } if + PDFWRDEBUG { (****Writing: ) print dup === flush } if //pdfwritetypes 1 index type get exec } def % We make pdfwriteobjdef a separate procedure for external use. /pdfwriteobjheader { % <newobj#> pdfwriteobjheader - XRef 1 index OFile .fileposition put - PDEBUG { (XRef\() print dup =only (\) = ) print XRef 1 index get = } if + PDFWRDEBUG { (XRef\() print dup =only (\) = ) print XRef 1 index get = } if OFile exch write=only ( 0 obj\n) ows } def /pdfwriteobjdef { % <newobj#> <value> pdfwriteobjdef - diff --git a/gs/lib/viewgif.ps b/gs/lib/viewgif.ps index adf9c6ccc..7106ccfea 100644 --- a/gs/lib/viewgif.ps +++ b/gs/lib/viewgif.ps @@ -109,10 +109,10 @@ /ImageOutFile where { /ImageOut ImageOutFile (w) file def } if F readGIFheader /Header exch def currentdict Header end begin begin - DEBUG { Header { exch == == } forall (----------------\n) print flush } if + VGIFDEBUG { Header { exch == == } forall (----------------\n) print flush } if F readGIFimageHeader /ImageHeader exch def currentdict ImageHeader end begin begin - DEBUG { ImageHeader { exch == == } forall (----------------\n) print flush } if + VGIFDEBUG { ImageHeader { exch == == } forall (----------------\n) print flush } if /D F << /InitialCodeLength F read1 /FirstBitLowOrder true diff --git a/gs/lib/viewjpeg.ps b/gs/lib/viewjpeg.ps index 7524a6f85..24cdcb45d 100644 --- a/gs/lib/viewjpeg.ps +++ b/gs/lib/viewjpeg.ps @@ -88,7 +88,7 @@ JPEGdict begin /width NextByte 8 bitshift NextByte add def /colors NextByte def - DEBUG { currentdict { exch == == } forall flush } if + VJPGDEBUG { currentdict { exch == == } forall flush } if exit } if |