summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Resource/Init/gs_res.ps72
-rw-r--r--Resource/Init/gs_resmp.ps4
2 files changed, 49 insertions, 27 deletions
diff --git a/Resource/Init/gs_res.ps b/Resource/Init/gs_res.ps
index 8eb8bb0e5..153761427 100644
--- a/Resource/Init/gs_res.ps
+++ b/Resource/Init/gs_res.ps
@@ -197,7 +197,7 @@ setglobal
197/.findresource { % <key> <category> findresource <instance> 197/.findresource { % <key> <category> findresource <instance>
198 2 copy dup /Category eq 198 2 copy dup /Category eq
199 { pop //Category 0 get begin } { .findcategory } ifelse 199 { pop //Category 0 get begin } { .findcategory } ifelse
200 /FindResource .resourceexec exch pop exch pop 200 /FindResource //.resourceexec exec exch pop exch pop
201} bind 201} bind
202end % .Instances of Category 202end % .Instances of Category
203def 203def
@@ -223,7 +223,7 @@ def
223 not { /defineresource cvx /typecheck signaloperror } if 223 not { /defineresource cvx /typecheck signaloperror } if
224 } if 224 } if
225 } if 225 } if
226 /DefineResource .resourceexec 226 /DefineResource //.resourceexec exec
227 4 1 roll pop pop pop 227 4 1 roll pop pop pop
228 } .errorexec 228 } .errorexec
229} bind executeonly odef 229} bind executeonly odef
@@ -252,7 +252,7 @@ def
252 % without the check. 252 % without the check.
253 /resourcestatus cvx /typecheck signalerror 253 /resourcestatus cvx /typecheck signalerror
254 } if 254 } if
255 2 copy .findcategory /ResourceStatus .resourceexec 255 2 copy .findcategory /ResourceStatus //.resourceexec exec
256 { 4 2 roll pop pop //true } { pop pop //false } ifelse 256 { 4 2 roll pop pop //true } { pop pop //false } ifelse
257 } stopped { 257 } stopped {
258 % Although resourcestatus is an operator, Adobe uses executable name 258 % Although resourcestatus is an operator, Adobe uses executable name
@@ -266,7 +266,7 @@ def
266 } if 266 } if
267 1 .argindex 1 index % catch stackunderflow 267 1 .argindex 1 index % catch stackunderflow
268 268
269 { .findcategory /UndefineResource .resourceexec pop pop 269 { .findcategory /UndefineResource //.resourceexec exec pop pop
270 } stopped { 270 } stopped {
271 % Although undefineresource is an operator, Adobe uses executable name 271 % Although undefineresource is an operator, Adobe uses executable name
272 % here but uses operator for the errors above. CET 23-33 272 % here but uses operator for the errors above. CET 23-33
@@ -315,10 +315,10 @@ currentdict /pssystemparams known not {
315 /pssystemparams 10 dict readonly def 315 /pssystemparams 10 dict readonly def
316} if 316} if
317pssystemparams begin 317pssystemparams begin
318 .default_resource_dir 318 //.default_resource_dir exec
319 /FontResourceDir (Font) .resource_dir_name 319 /FontResourceDir (Font) //.resource_dir_name exec
320 readonly .forcedef % pssys'params is r-o 320 readonly .forcedef % pssys'params is r-o
321 /GenericResourceDir () .resource_dir_name 321 /GenericResourceDir () //.resource_dir_name exec
322 readonly .forcedef % pssys'params is r-o 322 readonly .forcedef % pssys'params is r-o
323 pop % .default_resource_dir 323 pop % .default_resource_dir
324 /GenericResourcePathSep 324 /GenericResourcePathSep
@@ -387,13 +387,13 @@ status {
387} bind def 387} bind def
388/.localresourceforall { % <key> <value> <args> .localr'forall - 388/.localresourceforall { % <key> <value> <args> .localr'forall -
389 exch pop 389 exch pop
390 2 copy 0 get .stringmatch { .enumerateresource } { pop pop } ifelse 390 2 copy 0 get .stringmatch { //.enumerateresource exec } { pop pop } ifelse
391} bind def 391} bind def
392/.globalresourceforall { % <key> <value> <args> .globalr'forall - 392/.globalresourceforall { % <key> <value> <args> .globalr'forall -
393 exch pop 393 exch pop
394 2 copy 0 get .stringmatch { 394 2 copy 0 get .stringmatch {
395 dup 3 get begin .LocalInstances end 2 index known not { 395 dup 3 get begin .LocalInstances end 2 index known not {
396 .enumerateresource 396 //.enumerateresource exec
397 } { 397 } {
398 pop pop 398 pop pop
399 } ifelse 399 } ifelse
@@ -408,7 +408,7 @@ status {
408 3 index known { 408 3 index known {
409 pop pop pop 409 pop pop pop
410 } { 410 } {
411 2 index known { pop pop } { .enumerateresource } ifelse 411 2 index known { pop pop } { //.enumerateresource exec } ifelse
412 } ifelse 412 } ifelse
413} bind def 413} bind def
414 414
@@ -468,19 +468,19 @@ status {
468 % .knownget doesn't fail on null 468 % .knownget doesn't fail on null
469 /findresource cvx /typecheck signaloperror 469 /findresource cvx /typecheck signaloperror
470 } if 470 } if
471 dup .getvminstance { 471 dup //.getvminstance exec {
472 exch pop 0 get 472 exch pop 0 get
473 } { 473 } {
474 dup ResourceStatus { 474 dup ResourceStatus {
475 pop 1 gt { 475 pop 1 gt {
476 .DoLoadResource .getvminstance not { 476 .DoLoadResource //.getvminstance exec not {
477 /findresource cvx .undefinedresource 477 /findresource cvx //.undefinedresource exec
478 } if 0 get 478 } if 0 get
479 } { 479 } {
480 .GetInstance pop 0 get 480 .GetInstance pop 0 get
481 } ifelse 481 } ifelse
482 } { 482 } {
483 /findresource cvx .undefinedresource 483 /findresource cvx //.undefinedresource exec
484 } ifelse 484 } ifelse
485 } ifelse 485 } ifelse
486} bind executeonly 486} bind executeonly
@@ -621,7 +621,7 @@ status {
621 .currentglobal not .setglobal 621 .currentglobal not .setglobal
622 vmstatus pop exch pop add 622 vmstatus pop exch pop add
623 } repeat 623 } repeat
624} bind def 624} bind executeonly odef
625/.DoLoadResource { 625/.DoLoadResource {
626 % .LoadResource may push entries on the operand stack. 626 % .LoadResource may push entries on the operand stack.
627 % It is an undocumented feature of Adobe implementations, 627 % It is an undocumented feature of Adobe implementations,
@@ -633,8 +633,8 @@ status {
633 {.LoadResource} 4 1 roll 4 .execn 633 {.LoadResource} 4 1 roll 4 .execn
634 % Stack: ... count key memused 634 % Stack: ... count key memused
635 .vmused exch sub 635 .vmused exch sub
636 1 index .getvminstance not { 636 1 index //.getvminstance exec not {
637 pop dup .undefinedresource % didn't load 637 pop dup //.undefinedresource exec % didn't load
638 } if 638 } if
639 dup 1 1 put 639 dup 1 1 put
640 2 3 -1 roll put 640 2 3 -1 roll put
@@ -648,7 +648,7 @@ status {
648 { //true setglobal { .runresource } stopped //false setglobal { stop } if } 648 { //true setglobal { .runresource } stopped //false setglobal { stop } if }
649 ifelse 649 ifelse
650 } 650 }
651 { dup .undefinedresource 651 { dup //.undefinedresource exec
652 } 652 }
653 ifelse 653 ifelse
654 } bind 654 } bind
@@ -758,7 +758,7 @@ counttomark 2 idiv
758 /FindResource 758 /FindResource
759 { .Instances 1 index .knownget 759 { .Instances 1 index .knownget
760 { exch pop } 760 { exch pop }
761 { /findresource cvx .undefinedresource } 761 { /findresource cvx //.undefinedresource exec }
762 ifelse 762 ifelse
763 } bind executeonly 763 } bind executeonly
764 /ResourceStatus 764 /ResourceStatus
@@ -862,7 +862,7 @@ userdict /.localcsdefaults //false put
862 2 copy /Generic /Category findresource /DefineResource get exec 862 2 copy /Generic /Category findresource /DefineResource get exec
863 exch pop 863 exch pop
864 exch //.defaultcsnames exch .knownget { 864 exch //.defaultcsnames exch .knownget {
865 1 index .definedefaultcs 865 1 index //.definedefaultcs exec
866 currentglobal not { .userdict /.localcsdefaults //true put } if 866 currentglobal not { .userdict /.localcsdefaults //true put } if
867 } if 867 } if
868} bind executeonly 868} bind executeonly
@@ -872,13 +872,13 @@ userdict /.localcsdefaults //false put
872 //.defaultcsnames 1 index .knownget { 872 //.defaultcsnames 1 index .knownget {
873 % Stack: resname index 873 % Stack: resname index
874 currentglobal { 874 currentglobal {
875 .undefinedefaultcs pop 875 //.undefinedefaultcs exec pop
876 } { 876 } {
877 % We removed the local definition, but there might be a global one. 877 % We removed the local definition, but there might be a global one.
878 exch .GetInstance { 878 exch .GetInstance {
879 0 get .definedefaultcs 879 0 get //.definedefaultcs exec
880 } { 880 } {
881 .undefinedefaultcs 881 //.undefinedefaultcs exec
882 } ifelse 882 } ifelse
883 % Recompute .localcsdefaults by scanning. This is rarely needed. 883 % Recompute .localcsdefaults by scanning. This is rarely needed.
884 .userdict /.localcsdefaults //false //.defaultcsnames { 884 .userdict /.localcsdefaults //false //.defaultcsnames {
@@ -997,7 +997,7 @@ currentdict /.fontstatusaux .undef
997 /Generic /Category findresource /UndefineResource get exec 997 /Generic /Category findresource /UndefineResource get exec
998 } bind executeonly 998 } bind executeonly
999/FindResource { 999/FindResource {
1000 dup .getvminstance { 1000 dup //.getvminstance exec {
1001 exch pop 0 get 1001 exch pop 0 get
1002 } { 1002 } {
1003 dup ResourceStatus { 1003 dup ResourceStatus {
@@ -1024,7 +1024,7 @@ currentdict /.fontstatusaux .undef
1024 % stack: name font vmused 1024 % stack: name font vmused
1025 % findfont has the prerogative of not calling definefont 1025 % findfont has the prerogative of not calling definefont
1026 % in certain obscure cases of font substitution. 1026 % in certain obscure cases of font substitution.
1027 2 index .getvminstance { 1027 2 index //.getvminstance exec {
1028 dup 1 1 put 1028 dup 1 1 put
1029 2 3 -1 roll put 1029 2 3 -1 roll put
1030 } { 1030 } {
@@ -1159,3 +1159,25 @@ end % level2dict
1159 1159
1160%% Replace 1 (gs_resmp.ps) 1160%% Replace 1 (gs_resmp.ps)
1161(gs_resmp.ps) dup runlibfile VMDEBUG 1161(gs_resmp.ps) dup runlibfile VMDEBUG
1162
1163[
1164 /.default_resource_dir
1165 /.resource_dir_name
1166]
1167{systemdict exch .forceundef} forall
1168
1169[
1170 /.definedefaultcs
1171 /.undefinedefaultcs
1172 /.defaultcsnames
1173 /.enumerateresource
1174 /.externalresourceforall
1175 /.getvminstance
1176 /.globalresourceforall
1177 /.localresourceforall
1178 /resourceforall1
1179 /.resourceexec
1180 /.undefinedresource
1181 /.vmused
1182]
1183{level2dict exch .forceundef} forall
diff --git a/Resource/Init/gs_resmp.ps b/Resource/Init/gs_resmp.ps
index 9bb42638a..cb948d1ec 100644
--- a/Resource/Init/gs_resmp.ps
+++ b/Resource/Init/gs_resmp.ps
@@ -230,7 +230,7 @@ currentpacking //false setpacking
230 } { 230 } {
231 dup dup .map exch .knownget { % /Name /Name <<record>> 231 dup dup .map exch .knownget { % /Name /Name <<record>>
232 dup dup /RecordVirtualMethods get /IsActive get exec { 232 dup dup /RecordVirtualMethods get /IsActive get exec {
233 1 index .getvminstance { % /Name /Name <<record>> holder 233 1 index //.getvminstance exec { % /Name /Name <<record>> holder
234 1 get 1 eq 234 1 get 1 eq
235 } { 235 } {
236 //true 236 //true
@@ -242,7 +242,7 @@ currentpacking //false setpacking
242 DefineResource exec % size bStatusIs1 /Name Instance 242 DefineResource exec % size bStatusIs1 /Name Instance
243 % Make ResourceStatus to return correct values for this instance : 243 % Make ResourceStatus to return correct values for this instance :
244 % Hack: we replace status values in the instance holder : 244 % Hack: we replace status values in the instance holder :
245 exch .getvminstance pop % size bStatusIs1 Instance holder 245 exch //.getvminstance exec pop % size bStatusIs1 Instance holder
246 dup 5 -1 roll 2 exch put % bStatusIs1 Instance holder 246 dup 5 -1 roll 2 exch put % bStatusIs1 Instance holder
247 3 2 roll { % Instance holder 247 3 2 roll { % Instance holder
248 1 1 put % Instance 248 1 1 put % Instance