Browse Source

Plan 9 from Bell Labs 2006-01-17

David du Colombier 18 years ago
parent
commit
bb1445f693
100 changed files with 13423 additions and 3443 deletions
  1. 527 441
      dist/replica/_plan9.db
  2. 527 441
      dist/replica/plan9.db
  3. 1934 0
      dist/replica/plan9.log
  4. 4 0
      sys/include/ape/string.h
  5. 1 1
      sys/include/fcall.h
  6. 1 0
      sys/lib/ghostscript/EndOfTask.ps
  7. 35 0
      sys/lib/ghostscript/PDFX_def.ps
  8. 1 0
      sys/lib/ghostscript/acctest.ps
  9. 12 14
      sys/lib/ghostscript/addxchar.ps
  10. 11 13
      sys/lib/ghostscript/align.ps
  11. 18 20
      sys/lib/ghostscript/bdftops.ps
  12. 11 13
      sys/lib/ghostscript/caption.ps
  13. 11 13
      sys/lib/ghostscript/cid2code.ps
  14. 2 0
      sys/lib/ghostscript/decrypt.ps
  15. 35 37
      sys/lib/ghostscript/docie.ps
  16. 756 0
      sys/lib/ghostscript/dumphint.ps
  17. 12 14
      sys/lib/ghostscript/errpage.ps
  18. 23 25
      sys/lib/ghostscript/font2c.ps
  19. 18 20
      sys/lib/ghostscript/font2pcl.ps
  20. 11 13
      sys/lib/ghostscript/gs_agl.ps
  21. 35 36
      sys/lib/ghostscript/gs_btokn.ps
  22. 12 14
      sys/lib/ghostscript/gs_ccfnt.ps
  23. 11 13
      sys/lib/ghostscript/gs_ce_e.ps
  24. 117 98
      sys/lib/ghostscript/gs_cff.ps
  25. 94 148
      sys/lib/ghostscript/gs_cidcm.ps
  26. 197 0
      sys/lib/ghostscript/gs_ciddc.ps
  27. 129 0
      sys/lib/ghostscript/gs_cidfm.ps
  28. 27 19
      sys/lib/ghostscript/gs_cidfn.ps
  29. 139 0
      sys/lib/ghostscript/gs_cidtt.ps
  30. 147 0
      sys/lib/ghostscript/gs_ciecs2.ps
  31. 123 0
      sys/lib/ghostscript/gs_ciecs3.ps
  32. 141 60
      sys/lib/ghostscript/gs_cmap.ps
  33. 11 13
      sys/lib/ghostscript/gs_cmdl.ps
  34. 984 0
      sys/lib/ghostscript/gs_cspace.ps
  35. 11 13
      sys/lib/ghostscript/gs_css_e.ps
  36. 11 13
      sys/lib/ghostscript/gs_dbt_e.ps
  37. 248 0
      sys/lib/ghostscript/gs_devcs.ps
  38. 191 0
      sys/lib/ghostscript/gs_devn.ps
  39. 78 0
      sys/lib/ghostscript/gs_devpxl.ps
  40. 11 13
      sys/lib/ghostscript/gs_diskf.ps
  41. 214 0
      sys/lib/ghostscript/gs_diskn.ps
  42. 33 13
      sys/lib/ghostscript/gs_dpnxt.ps
  43. 30 15
      sys/lib/ghostscript/gs_dps.ps
  44. 12 14
      sys/lib/ghostscript/gs_dps1.ps
  45. 11 13
      sys/lib/ghostscript/gs_dps2.ps
  46. 11 13
      sys/lib/ghostscript/gs_dscp.ps
  47. 213 31
      sys/lib/ghostscript/gs_epsf.ps
  48. 268 0
      sys/lib/ghostscript/gs_fapi.ps
  49. 11 13
      sys/lib/ghostscript/gs_fform.ps
  50. 399 0
      sys/lib/ghostscript/gs_fntem.ps
  51. 478 334
      sys/lib/ghostscript/gs_fonts.ps
  52. 14 16
      sys/lib/ghostscript/gs_frsd.ps
  53. 311 92
      sys/lib/ghostscript/gs_icc.ps
  54. 11 13
      sys/lib/ghostscript/gs_il1_e.ps
  55. 11 13
      sys/lib/ghostscript/gs_il2_e.ps
  56. 656 0
      sys/lib/ghostscript/gs_img.ps
  57. 204 0
      sys/lib/ghostscript/gs_indxd.ps
  58. 485 152
      sys/lib/ghostscript/gs_init.ps
  59. 11 13
      sys/lib/ghostscript/gs_kanji.ps
  60. 11 13
      sys/lib/ghostscript/gs_ksb_e.ps
  61. 11 13
      sys/lib/ghostscript/gs_l2img.ps
  62. 192 194
      sys/lib/ghostscript/gs_lev2.ps
  63. 11 13
      sys/lib/ghostscript/gs_lgo_e.ps
  64. 11 13
      sys/lib/ghostscript/gs_lgx_e.ps
  65. 44 174
      sys/lib/ghostscript/gs_ll3.ps
  66. 11 13
      sys/lib/ghostscript/gs_mex_e.ps
  67. 11 13
      sys/lib/ghostscript/gs_mgl_e.ps
  68. 11 13
      sys/lib/ghostscript/gs_mro_e.ps
  69. 299 0
      sys/lib/ghostscript/gs_patrn.ps
  70. 11 13
      sys/lib/ghostscript/gs_pdf_e.ps
  71. 406 87
      sys/lib/ghostscript/gs_pdfwr.ps
  72. 12 14
      sys/lib/ghostscript/gs_pfile.ps
  73. 11 13
      sys/lib/ghostscript/gs_rdlin.ps
  74. 196 77
      sys/lib/ghostscript/gs_res.ps
  75. 522 0
      sys/lib/ghostscript/gs_resmp.ps
  76. 156 0
      sys/lib/ghostscript/gs_resst.ps
  77. 267 0
      sys/lib/ghostscript/gs_sepr.ps
  78. 167 80
      sys/lib/ghostscript/gs_setpd.ps
  79. 46 39
      sys/lib/ghostscript/gs_statd.ps
  80. 11 13
      sys/lib/ghostscript/gs_std_e.ps
  81. 180 0
      sys/lib/ghostscript/gs_stres.ps
  82. 11 13
      sys/lib/ghostscript/gs_sym_e.ps
  83. 13 15
      sys/lib/ghostscript/gs_trap.ps
  84. 541 169
      sys/lib/ghostscript/gs_ttf.ps
  85. 13 15
      sys/lib/ghostscript/gs_typ32.ps
  86. 15 14
      sys/lib/ghostscript/gs_typ42.ps
  87. 48 26
      sys/lib/ghostscript/gs_type1.ps
  88. 11 13
      sys/lib/ghostscript/gs_wan_e.ps
  89. 11 13
      sys/lib/ghostscript/gs_wl1_e.ps
  90. 11 13
      sys/lib/ghostscript/gs_wl2_e.ps
  91. 11 13
      sys/lib/ghostscript/gs_wl5_e.ps
  92. 20 21
      sys/lib/ghostscript/gslp.ps
  93. 21 18
      sys/lib/ghostscript/gsnup.ps
  94. 1 1
      sys/lib/ghostscript/ht_ccsto.ps
  95. 11 13
      sys/lib/ghostscript/image-qa.ps
  96. 11 13
      sys/lib/ghostscript/impath.ps
  97. 11 13
      sys/lib/ghostscript/jispaper.ps
  98. 3 1
      sys/lib/ghostscript/landscap.ps
  99. 1 0
      sys/lib/ghostscript/level1.ps
  100. 12 14
      sys/lib/ghostscript/lines.ps

File diff suppressed because it is too large
+ 527 - 441
dist/replica/_plan9.db


File diff suppressed because it is too large
+ 527 - 441
dist/replica/plan9.db


+ 1934 - 0
dist/replica/plan9.log

@@ -25112,3 +25112,1937 @@
 1137268850 70 m sys/src/cmd/aux/antiword/wordwin.c - 664 sys sys 1137261474 5584
 1137268850 71 m sys/src/cmd/aux/antiword/xmalloc.c - 664 sys sys 1137261474 2501
 1137268850 72 m sys/src/cmd/aux/antiword/xml.c - 664 sys sys 1137261474 34115
+1137459704 0 c 386/bin/page - 775 sys sys 1137459167 233797
+1137459704 1 c sys/src/cmd/ql/asmout.c - 664 sys sys 1137459145 35737
+1137459704 2 c sys/src/cmd/page/gs.c - 664 sys sys 1137459165 6553
+1137459704 3 c sys/src/cmd/page/page.h - 664 sys sys 1137459166 2159
+1137459704 4 c sys/src/cmd/page/pdf.c - 664 sys sys 1137459165 2942
+1137459704 5 c sys/src/cmd/page/pdfprolog.ps - 664 sys sys 1137459166 519
+1137459704 6 c sys/src/cmd/page/ps.c - 664 sys sys 1137459165 9187
+1137461505 0 c sys/include/fcall.h - 664 sys sys 1137461445 3063
+1137463255 0 c 386/bin/gs - 775 sys sys 1137463007 13275174
+1137463255 1 c sys/include/ape/string.h - 664 sys sys 1137462511 1259
+1137463255 2 c sys/src/cmd/gs/386.h - 664 sys sys 1137462348 1464
+1137463255 3 c sys/src/cmd/gs/alpha.h - 664 sys sys 1137462348 1373
+1137463255 4 c sys/src/cmd/gs/arch.h - 664 sys sys 1137462338 347
+1137463255 5 c sys/src/cmd/gs/arm.h - 664 sys sys 1137462348 1376
+1137463255 6 c sys/src/cmd/gs/default.386.h - 664 sys sys 1137462347 1464
+1137463255 7 m sys/src/cmd/gs/default.386.h - 664 sys sys 1137462347 1464
+1137463255 8 c sys/src/cmd/gs/default.alpha.h - 664 sys sys 1137462347 1373
+1137463255 9 m sys/src/cmd/gs/default.alpha.h - 664 sys sys 1137462347 1373
+1137463255 10 c sys/src/cmd/gs/default.arm.h - 664 sys sys 1137462347 1376
+1137463255 11 c sys/src/cmd/gs/default.mips.h - 664 sys sys 1137462347 1372
+1137463255 12 m sys/src/cmd/gs/default.mips.h - 664 sys sys 1137462347 1372
+1137463255 13 c sys/src/cmd/gs/default.power.h - 664 sys sys 1137462347 1444
+1137463255 14 m sys/src/cmd/gs/default.power.h - 664 sys sys 1137462347 1444
+1137463255 15 c sys/src/cmd/gs/doc/API.htm - 664 sys sys 1137462563 23585
+1137463255 16 c sys/src/cmd/gs/doc/Bug-form.htm - 664 sys sys 1137462564 5302
+1137463255 17 c sys/src/cmd/gs/doc/Bug-info.htm - 664 sys sys 1137462564 7401
+1137463255 18 c sys/src/cmd/gs/doc/C-style.htm - 664 sys sys 1137462565 56085
+1137463255 19 c sys/src/cmd/gs/doc/Changes.htm - 664 sys sys 1137462565 6682
+1137463255 20 c sys/src/cmd/gs/doc/Commprod.htm - 664 sys sys 1137462566 13277
+1137463255 21 c sys/src/cmd/gs/doc/Copying.htm - 664 sys sys 1137462566 2570
+1137463255 22 c sys/src/cmd/gs/doc/DLL.htm - 664 sys sys 1137462567 25595
+1137463255 23 a sys/src/cmd/gs/doc/Deprecated.htm - 664 sys sys 1137462567 181501
+1137463255 24 a sys/src/cmd/gs/doc/Details.htm - 664 sys sys 1137462568 14143
+1137463255 25 a sys/src/cmd/gs/doc/Details8.htm - 664 sys sys 1137462572 1468891
+1137463255 26 c sys/src/cmd/gs/doc/Develop.htm - 664 sys sys 1137462573 163215
+1137463255 27 c sys/src/cmd/gs/doc/Devices.htm - 664 sys sys 1137462573 59077
+1137463255 28 c sys/src/cmd/gs/doc/Drivers.htm - 664 sys sys 1137462574 130714
+1137463255 29 c sys/src/cmd/gs/doc/Fonts.htm - 664 sys sys 1137462575 45394
+1137463255 30 c sys/src/cmd/gs/doc/Helpers.htm - 664 sys sys 1137462575 10326
+1137463255 31 c sys/src/cmd/gs/doc/Hershey.htm - 664 sys sys 1137462576 14205
+1137463255 32 c sys/src/cmd/gs/doc/History1.htm - 664 sys sys 1137462576 15593
+1137463255 33 c sys/src/cmd/gs/doc/History2.htm - 664 sys sys 1137462577 211259
+1137463255 34 c sys/src/cmd/gs/doc/History3.htm - 664 sys sys 1137462578 348905
+1137463255 35 c sys/src/cmd/gs/doc/History4.htm - 664 sys sys 1137462579 162218
+1137463255 36 c sys/src/cmd/gs/doc/History5.htm - 664 sys sys 1137462581 564959
+1137463255 37 c sys/src/cmd/gs/doc/History6.htm - 664 sys sys 1137462583 365320
+1137463255 38 c sys/src/cmd/gs/doc/History7.htm - 664 sys sys 1137462585 822891
+1137463255 39 a sys/src/cmd/gs/doc/History8.htm - 664 sys sys 1137462588 788680
+1137463255 40 c sys/src/cmd/gs/doc/Htmstyle.htm - 664 sys sys 1137462588 28073
+1137463255 41 c sys/src/cmd/gs/doc/Humor.htm - 664 sys sys 1137462588 3633
+1137463255 42 c sys/src/cmd/gs/doc/Install.htm - 664 sys sys 1137462589 20665
+1137463255 43 c sys/src/cmd/gs/doc/Issues.htm - 664 sys sys 1137462589 20893
+1137463255 44 c sys/src/cmd/gs/doc/Language.htm - 664 sys sys 1137462590 87637
+1137463255 45 c sys/src/cmd/gs/doc/Lib.htm - 664 sys sys 1137462591 32830
+1137463255 46 c sys/src/cmd/gs/doc/Maintain.htm - 664 sys sys 1137462591 8759
+1137463255 47 c sys/src/cmd/gs/doc/Make.htm - 664 sys sys 1137462592 115126
+1137463255 48 c sys/src/cmd/gs/doc/News.htm - 664 sys sys 1137462592 5437
+1137463255 49 c sys/src/cmd/gs/doc/PUBLIC - 664 sys sys 1137462592 14333
+1137463255 50 c sys/src/cmd/gs/doc/Projects.htm - 664 sys sys 1137462593 30626
+1137463255 51 c sys/src/cmd/gs/doc/Ps-style.htm - 664 sys sys 1137462593 14820
+1137463255 52 c sys/src/cmd/gs/doc/Ps2epsi.htm - 664 sys sys 1137462594 6604
+1137463255 53 c sys/src/cmd/gs/doc/Ps2pdf.htm - 664 sys sys 1137462594 40440
+1137463255 54 a sys/src/cmd/gs/doc/Ps2ps2.htm - 775 sys sys 1137462594 9943
+1137463255 55 c sys/src/cmd/gs/doc/Psfiles.htm - 664 sys sys 1137462595 30055
+1137463255 56 c sys/src/cmd/gs/doc/Public.htm - 664 sys sys 1137462595 14407
+1137463255 57 c sys/src/cmd/gs/doc/README - 664 sys sys 1137462596 16006
+1137463255 58 c sys/src/cmd/gs/doc/Readme.htm - 664 sys sys 1137462596 22707
+1137463255 59 c sys/src/cmd/gs/doc/Release.htm - 664 sys sys 1137462596 30201
+1137463255 60 c sys/src/cmd/gs/doc/Source.htm - 664 sys sys 1137462597 13853
+1137463255 61 a sys/src/cmd/gs/doc/Testing.htm - 664 sys sys 1137462597 11174
+1137463255 62 c sys/src/cmd/gs/doc/Unix-lpr.htm - 664 sys sys 1137462597 10695
+1137463255 63 c sys/src/cmd/gs/doc/Use.htm - 664 sys sys 1137462598 144523
+1137463255 64 c sys/src/cmd/gs/doc/Xfonts.htm - 664 sys sys 1137462599 10644
+1137463255 65 c sys/src/cmd/gs/doc/gs-vms.hlp - 664 sys sys 1137462599 10848
+1137463255 66 c sys/src/cmd/gs/doc/gs.css - 664 sys sys 1137462599 986
+1137463255 67 c sys/src/cmd/gs/doc/gsdoc.el - 664 sys sys 1137462600 22041
+1137463255 68 c sys/src/cmd/gs/doc/index.html - 664 sys sys 1137462600 456
+1137463255 69 c sys/src/cmd/gs/examples/annots.pdf - 664 sys sys 1137462606 454126
+1137463255 70 a sys/src/cmd/gs/examples/golfer.eps - 775 sys sys 1137462607 25574
+1137463255 71 a sys/src/cmd/gs/examples/tiger.eps - 775 sys sys 1137462608 78599
+1137463255 72 c sys/src/cmd/gs/examples/vasarely.ps - 664 sys sys 1137462608 13217
+1137463255 73 c sys/src/cmd/gs/examples/waterfal.ps - 664 sys sys 1137462609 2532
+1137463255 74 c sys/src/cmd/gs/fixSAFER.ed - 664 sys sys 1137462361 94
+1137463255 75 c sys/src/cmd/gs/icclib/Licence.txt - 664 sys sys 1137462601 1526
+1137463255 76 c sys/src/cmd/gs/icclib/Readme.txt - 664 sys sys 1137462601 7174
+1137463255 77 c sys/src/cmd/gs/icclib/icc.c - 664 sys sys 1137462603 362717
+1137463255 78 c sys/src/cmd/gs/icclib/icc.h - 664 sys sys 1137462603 41784
+1137463255 79 c sys/src/cmd/gs/icclib/icc9809.h - 664 sys sys 1137462604 47024
+1137463255 80 c sys/src/cmd/gs/jpeg/README - 664 sys sys 1137462958 19945
+1137463255 81 c sys/src/cmd/gs/jpeg/change.log - 664 sys sys 1137462959 9284
+1137463255 82 c sys/src/cmd/gs/jpeg/cjpeg.1 - 664 sys sys 1137462959 10126
+1137463255 83 c sys/src/cmd/gs/jpeg/cjpeg.c - 664 sys sys 1137462959 19852
+1137463255 84 c sys/src/cmd/gs/jpeg/configure - 775 sys sys 1137462960 60309
+1137463255 85 c sys/src/cmd/gs/jpeg/djpeg.1 - 664 sys sys 1137462960 7416
+1137463255 86 c sys/src/cmd/gs/jpeg/filelist.doc - 664 sys sys 1137462961 8368
+1137463255 87 c sys/src/cmd/gs/jpeg/install.doc - 664 sys sys 1137462961 51928
+1137463255 88 c sys/src/cmd/gs/jpeg/jcapimin.c - 664 sys sys 1137462962 9121
+1137463255 89 c sys/src/cmd/gs/jpeg/jccoefct.c - 664 sys sys 1137462962 16400
+1137463255 90 c sys/src/cmd/gs/jpeg/jchuff.c - 664 sys sys 1137462962 28222
+1137463255 91 c sys/src/cmd/gs/jpeg/jcinit.c - 664 sys sys 1137462963 2349
+1137463255 92 c sys/src/cmd/gs/jpeg/jcmarker.c - 664 sys sys 1137462963 17245
+1137463255 93 c sys/src/cmd/gs/jpeg/jcmaster.c - 664 sys sys 1137462963 19889
+1137463255 94 c sys/src/cmd/gs/jpeg/jcomapi.c - 664 sys sys 1137462963 3110
+1137463255 95 c sys/src/cmd/gs/jpeg/jcparam.c - 664 sys sys 1137462964 21275
+1137463255 96 c sys/src/cmd/gs/jpeg/jcphuff.c - 664 sys sys 1137462965 25115
+1137463255 97 c sys/src/cmd/gs/jpeg/jctrans.c - 664 sys sys 1137462965 13977
+1137463255 98 c sys/src/cmd/gs/jpeg/jdapimin.c - 664 sys sys 1137462965 12637
+1137463255 99 c sys/src/cmd/gs/jpeg/jdcoefct.c - 664 sys sys 1137462966 25155
+1137463255 100 c sys/src/cmd/gs/jpeg/jdcolor.c - 664 sys sys 1137462966 12962
+1137463255 101 c sys/src/cmd/gs/jpeg/jdhuff.c - 664 sys sys 1137462966 20866
+1137463255 102 c sys/src/cmd/gs/jpeg/jdinput.c - 664 sys sys 1137462967 13500
+1137463255 103 c sys/src/cmd/gs/jpeg/jdmarker.c - 664 sys sys 1137462967 41118
+1137463255 104 c sys/src/cmd/gs/jpeg/jdmaster.c - 664 sys sys 1137462968 19710
+1137463255 105 c sys/src/cmd/gs/jpeg/jdphuff.c - 664 sys sys 1137462968 20559
+1137463255 106 c sys/src/cmd/gs/jpeg/jdtrans.c - 664 sys sys 1137462968 5090
+1137463255 107 c sys/src/cmd/gs/jpeg/jerror.c - 664 sys sys 1137462969 7801
+1137463255 108 c sys/src/cmd/gs/jpeg/jpegtran.1 - 664 sys sys 1137462975 7462
+1137463255 109 c sys/src/cmd/gs/jpeg/libjpeg.doc - 664 sys sys 1137462977 159338
+1137463255 110 c sys/src/cmd/gs/jpeg/makcjpeg.st - 664 sys sys 1137462978 1770
+1137463255 111 c sys/src/cmd/gs/jpeg/makdjpeg.st - 664 sys sys 1137462979 1770
+1137463255 112 c sys/src/cmd/gs/jpeg/makefile.ansi - 664 sys sys 1137462979 11797
+1137463255 113 c sys/src/cmd/gs/jpeg/makefile.bcc - 664 sys sys 1137462979 14400
+1137463255 114 c sys/src/cmd/gs/jpeg/makefile.cfg - 664 sys sys 1137462980 15750
+1137463255 115 c sys/src/cmd/gs/jpeg/makefile.dj - 664 sys sys 1137462980 11931
+1137463255 116 c sys/src/cmd/gs/jpeg/makefile.manx - 664 sys sys 1137462980 11723
+1137463255 117 c sys/src/cmd/gs/jpeg/makefile.mc6 - 664 sys sys 1137462981 13918
+1137463255 118 c sys/src/cmd/gs/jpeg/makefile.mms - 664 sys sys 1137462981 13253
+1137463255 119 c sys/src/cmd/gs/jpeg/makefile.sas - 664 sys sys 1137462982 12586
+1137463255 120 c sys/src/cmd/gs/jpeg/makefile.unix - 664 sys sys 1137462982 12171
+1137463255 121 c sys/src/cmd/gs/jpeg/makefile.vms - 664 sys sys 1137462983 4423
+1137463255 122 c sys/src/cmd/gs/jpeg/makefile.wat - 664 sys sys 1137462983 12421
+1137463255 123 c sys/src/cmd/gs/jpeg/makljpeg.st - 664 sys sys 1137462984 4329
+1137463255 124 c sys/src/cmd/gs/jpeg/maktjpeg.st - 664 sys sys 1137462985 1353
+1137463255 125 c sys/src/cmd/gs/jpeg/rdjpgcom.1 - 664 sys sys 1137462986 1561
+1137463255 126 c sys/src/cmd/gs/jpeg/usage.doc - 664 sys sys 1137462990 27171
+1137463255 127 c sys/src/cmd/gs/jpeg/cderror.h - 664 sys sys 1137462958 5249
+1137463255 128 c sys/src/cmd/gs/jpeg/cdjpeg.c - 664 sys sys 1137462958 4682
+1137463255 129 c sys/src/cmd/gs/jpeg/cdjpeg.h - 664 sys sys 1137462959 6123
+1137463255 130 a sys/src/cmd/gs/jpeg/config.guess - 775 sys sys 1137462959 24280
+1137463255 131 a sys/src/cmd/gs/jpeg/config.sub - 775 sys sys 1137462960 19802
+1137463255 132 c sys/src/cmd/gs/jpeg/djpeg.c - 664 sys sys 1137462961 19339
+1137463255 133 a sys/src/cmd/gs/jpeg/install-sh - 775 sys sys 1137462961 5584
+1137463255 134 c sys/src/cmd/gs/jpeg/jchuff.h - 664 sys sys 1137462962 1575
+1137463255 135 a sys/src/cmd/gs/jpeg/jconfig.mac - 664 sys sys 1137462964 1199
+1137463255 136 a sys/src/cmd/gs/jpeg/jconfig.vc - 664 sys sys 1137462964 1333
+1137463255 137 c sys/src/cmd/gs/jpeg/jdhuff.h - 664 sys sys 1137462967 8138
+1137463255 138 c sys/src/cmd/gs/jpeg/jerror.h - 664 sys sys 1137462969 13936
+1137463255 139 c sys/src/cmd/gs/jpeg/jidctflt.c - 664 sys sys 1137462969 8451
+1137463255 140 c sys/src/cmd/gs/jpeg/jidctfst.c - 664 sys sys 1137462970 13170
+1137463255 141 c sys/src/cmd/gs/jpeg/jidctint.c - 664 sys sys 1137462970 14815
+1137463255 142 c sys/src/cmd/gs/jpeg/jidctred.c - 664 sys sys 1137462970 13528
+1137463255 143 c sys/src/cmd/gs/jpeg/jmemdos.c - 664 sys sys 1137462971 18977
+1137463255 144 c sys/src/cmd/gs/jpeg/jmemmac.c - 664 sys sys 1137462972 9507
+1137463255 145 c sys/src/cmd/gs/jpeg/jmemmgr.c - 664 sys sys 1137462972 40988
+1137463255 146 c sys/src/cmd/gs/jpeg/jmemname.c - 664 sys sys 1137462973 8314
+1137463255 147 c sys/src/cmd/gs/jpeg/jmemsys.h - 664 sys sys 1137462973 8230
+1137463255 148 c sys/src/cmd/gs/jpeg/jmorecfg.h.save - 664 sys sys 1137462974 12458
+1137463255 149 c sys/src/cmd/gs/jpeg/jpegint.h - 664 sys sys 1137462974 15712
+1137463255 150 c sys/src/cmd/gs/jpeg/jpeglib.h - 664 sys sys 1137462975 46205
+1137463255 151 c sys/src/cmd/gs/jpeg/jpegtran.c - 664 sys sys 1137462975 16227
+1137463255 152 c sys/src/cmd/gs/jpeg/jversion.h - 664 sys sys 1137462976 360
+1137463255 153 a sys/src/cmd/gs/jpeg/ltconfig - 775 sys sys 1137462977 43097
+1137463255 154 a sys/src/cmd/gs/jpeg/ltmain.sh - 664 sys sys 1137462978 70979
+1137463255 155 a sys/src/cmd/gs/jpeg/makeapps.ds - 664 sys sys 1137462979 21331
+1137463255 156 a sys/src/cmd/gs/jpeg/makefile.vc - 664 sys sys 1137462982 12176
+1137463255 157 a sys/src/cmd/gs/jpeg/makelib.ds - 664 sys sys 1137462984 21450
+1137463255 158 a sys/src/cmd/gs/jpeg/makeproj.mac - 664 sys sys 1137462984 10374
+1137463255 159 c sys/src/cmd/gs/jpeg/rdcolmap.c - 664 sys sys 1137462985 6849
+1137463255 160 c sys/src/cmd/gs/jpeg/rdgif.c - 664 sys sys 1137462986 1272
+1137463255 161 c sys/src/cmd/gs/jpeg/rdjpgcom.c - 664 sys sys 1137462987 13879
+1137463255 162 c sys/src/cmd/gs/jpeg/rdppm.c - 664 sys sys 1137462987 14024
+1137463255 163 a sys/src/cmd/gs/jpeg/testimg.bmp - 664 sys sys 1137462988 35050
+1137463255 164 a sys/src/cmd/gs/jpeg/transupp.c - 664 sys sys 1137462990 32630
+1137463255 165 a sys/src/cmd/gs/jpeg/transupp.h - 664 sys sys 1137462990 5761
+1137463255 166 c sys/src/cmd/gs/jpeg/wrgif.c - 664 sys sys 1137462991 12888
+1137463255 167 c sys/src/cmd/gs/jpeg/wrjpgcom.c - 664 sys sys 1137462991 16563
+1137463255 168 c sys/src/cmd/gs/lib/Fontmap - 664 sys sys 1137462610 109
+1137463255 169 c sys/src/cmd/gs/lib/Fontmap.ATB - 664 sys sys 1137462611 5915
+1137463255 170 c sys/src/cmd/gs/lib/Fontmap.ATM - 664 sys sys 1137462611 5691
+1137463255 171 c sys/src/cmd/gs/lib/Fontmap.GS - 664 sys sys 1137462611 13531
+1137463255 172 c sys/src/cmd/gs/lib/Fontmap.OS2 - 664 sys sys 1137462612 7275
+1137463255 173 c sys/src/cmd/gs/lib/Fontmap.SGI - 664 sys sys 1137462612 13791
+1137463255 174 c sys/src/cmd/gs/lib/Fontmap.Sol - 664 sys sys 1137462613 16470
+1137463255 175 c sys/src/cmd/gs/lib/Fontmap.Ult - 664 sys sys 1137462613 6084
+1137463255 176 c sys/src/cmd/gs/lib/acctest.ps - 664 sys sys 1137462614 4328
+1137463255 177 c sys/src/cmd/gs/lib/addxchar.ps - 664 sys sys 1137462614 9852
+1137463255 178 c sys/src/cmd/gs/lib/align.ps - 664 sys sys 1137462615 2317
+1137463255 179 c sys/src/cmd/gs/lib/bdftops - 775 sys sys 1137462615 235
+1137463255 180 c sys/src/cmd/gs/lib/bdftops.bat - 775 sys sys 1137462616 158
+1137463255 181 c sys/src/cmd/gs/lib/bdftops.ps - 664 sys sys 1137462616 23410
+1137463255 182 c sys/src/cmd/gs/lib/caption.ps - 664 sys sys 1137462619 1725
+1137463255 183 c sys/src/cmd/gs/lib/cid2code.ps - 664 sys sys 1137462620 4479
+1137463255 184 c sys/src/cmd/gs/lib/decrypt.ps - 664 sys sys 1137462621 354
+1137463255 185 c sys/src/cmd/gs/lib/docie.ps - 664 sys sys 1137462622 7123
+1137463255 186 c sys/src/cmd/gs/lib/dvipdf - 775 sys sys 1137462623 965
+1137463255 187 c sys/src/cmd/gs/lib/errpage.ps - 664 sys sys 1137462624 8598
+1137463255 188 c sys/src/cmd/gs/lib/fixmswrd.pl - 775 sys sys 1137462624 4585
+1137463255 189 c sys/src/cmd/gs/lib/font2c - 775 sys sys 1137462625 243
+1137463255 190 c sys/src/cmd/gs/lib/font2c.bat - 775 sys sys 1137462625 166
+1137463255 191 c sys/src/cmd/gs/lib/font2c.ps - 664 sys sys 1137462626 19593
+1137463255 192 c sys/src/cmd/gs/lib/font2pcl.ps - 664 sys sys 1137462626 17575
+1137463255 193 c sys/src/cmd/gs/lib/gs_btokn.ps - 664 sys sys 1137462628 11103
+1137463255 194 c sys/src/cmd/gs/lib/gs_ccfnt.ps - 664 sys sys 1137462628 2167
+1137463255 195 c sys/src/cmd/gs/lib/gs_ce_e.ps - 664 sys sys 1137462629 2368
+1137463255 196 c sys/src/cmd/gs/lib/gs_cff.ps - 664 sys sys 1137462629 22476
+1137463255 197 c sys/src/cmd/gs/lib/gs_cidfn.ps - 664 sys sys 1137462630 12612
+1137463255 198 c sys/src/cmd/gs/lib/gs_cmap.ps - 664 sys sys 1137462632 17210
+1137463255 199 c sys/src/cmd/gs/lib/gs_cmdl.ps - 664 sys sys 1137462632 4848
+1137463255 200 c sys/src/cmd/gs/lib/gs_dbt_e.ps - 664 sys sys 1137462633 2288
+1137463255 201 c sys/src/cmd/gs/lib/gs_diskf.ps - 664 sys sys 1137462634 7584
+1137463255 202 c sys/src/cmd/gs/lib/gs_dpnxt.ps - 664 sys sys 1137462634 4766
+1137463255 203 c sys/src/cmd/gs/lib/gs_dps.ps - 664 sys sys 1137462635 7842
+1137463255 204 c sys/src/cmd/gs/lib/gs_dps1.ps - 664 sys sys 1137462635 4576
+1137463255 205 c sys/src/cmd/gs/lib/gs_dps2.ps - 664 sys sys 1137462636 6977
+1137463255 206 c sys/src/cmd/gs/lib/gs_epsf.ps - 664 sys sys 1137462636 7220
+1137463255 207 c sys/src/cmd/gs/lib/gs_fform.ps - 664 sys sys 1137462637 3166
+1137463255 208 c sys/src/cmd/gs/lib/gs_fonts.ps - 664 sys sys 1137462638 43873
+1137463255 209 c sys/src/cmd/gs/lib/gs_il1_e.ps - 664 sys sys 1137462639 2800
+1137463255 210 c sys/src/cmd/gs/lib/gs_il2_e.ps - 664 sys sys 1137462639 2781
+1137463255 211 c sys/src/cmd/gs/lib/gs_init.ps - 664 sys sys 1137462641 73009
+1137463255 212 c sys/src/cmd/gs/lib/gs_kanji.ps - 664 sys sys 1137462641 3946
+1137463255 213 c sys/src/cmd/gs/lib/gs_ksb_e.ps - 664 sys sys 1137462641 3295
+1137463255 214 c sys/src/cmd/gs/lib/gs_l2img.ps - 664 sys sys 1137462642 5635
+1137463255 215 c sys/src/cmd/gs/lib/gs_lev2.ps - 664 sys sys 1137462643 31509
+1137463255 216 c sys/src/cmd/gs/lib/gs_lgo_e.ps - 664 sys sys 1137462643 2890
+1137463255 217 c sys/src/cmd/gs/lib/gs_lgx_e.ps - 664 sys sys 1137462643 1916
+1137463255 218 c sys/src/cmd/gs/lib/gs_ll3.ps - 664 sys sys 1137462644 10554
+1137463255 219 c sys/src/cmd/gs/lib/gs_mex_e.ps - 664 sys sys 1137462644 3997
+1137463255 220 c sys/src/cmd/gs/lib/gs_mgl_e.ps - 664 sys sys 1137462645 2193
+1137463255 221 c sys/src/cmd/gs/lib/gs_mro_e.ps - 664 sys sys 1137462645 2539
+1137463255 222 c sys/src/cmd/gs/lib/gs_pdf_e.ps - 664 sys sys 1137462646 1709
+1137463255 223 c sys/src/cmd/gs/lib/gs_pdfwr.ps - 664 sys sys 1137462646 25452
+1137463255 224 c sys/src/cmd/gs/lib/gs_pfile.ps - 664 sys sys 1137462646 4345
+1137463255 225 c sys/src/cmd/gs/lib/gs_rdlin.ps - 664 sys sys 1137462647 866
+1137463255 226 c sys/src/cmd/gs/lib/gs_res.ps - 664 sys sys 1137462647 34685
+1137463255 227 c sys/src/cmd/gs/lib/gs_setpd.ps - 664 sys sys 1137462649 27947
+1137463255 228 c sys/src/cmd/gs/lib/gs_statd.ps - 664 sys sys 1137462650 13461
+1137463255 229 c sys/src/cmd/gs/lib/gs_std_e.ps - 664 sys sys 1137462650 3243
+1137463255 230 c sys/src/cmd/gs/lib/gs_sym_e.ps - 664 sys sys 1137462650 3102
+1137463255 231 c sys/src/cmd/gs/lib/gs_trap.ps - 664 sys sys 1137462651 3040
+1137463255 232 c sys/src/cmd/gs/lib/gs_ttf.ps - 664 sys sys 1137462652 46435
+1137463255 233 c sys/src/cmd/gs/lib/gs_typ32.ps - 664 sys sys 1137462652 4220
+1137463255 234 c sys/src/cmd/gs/lib/gs_typ42.ps - 664 sys sys 1137462652 1701
+1137463255 235 c sys/src/cmd/gs/lib/gs_type1.ps - 664 sys sys 1137462653 7527
+1137463255 236 c sys/src/cmd/gs/lib/gs_wan_e.ps - 664 sys sys 1137462653 1687
+1137463255 237 c sys/src/cmd/gs/lib/gs_wl1_e.ps - 664 sys sys 1137462653 2534
+1137463255 238 c sys/src/cmd/gs/lib/gs_wl2_e.ps - 664 sys sys 1137462654 2532
+1137463255 239 c sys/src/cmd/gs/lib/gs_wl5_e.ps - 664 sys sys 1137462654 2550
+1137463255 240 c sys/src/cmd/gs/lib/gsbj - 775 sys sys 1137462654 280
+1137463255 241 c sys/src/cmd/gs/lib/gsbj.bat - 775 sys sys 1137462655 179
+1137463255 242 c sys/src/cmd/gs/lib/gsdj - 775 sys sys 1137462655 282
+1137463255 243 c sys/src/cmd/gs/lib/gsdj.bat - 775 sys sys 1137462656 181
+1137463255 244 c sys/src/cmd/gs/lib/gsdj500 - 775 sys sys 1137462656 285
+1137463255 245 c sys/src/cmd/gs/lib/gsdj500.bat - 775 sys sys 1137462656 187
+1137463255 246 c sys/src/cmd/gs/lib/gslj - 775 sys sys 1137462657 283
+1137463255 247 c sys/src/cmd/gs/lib/gslj.bat - 775 sys sys 1137462657 182
+1137463255 248 c sys/src/cmd/gs/lib/gslp - 775 sys sys 1137462657 280
+1137463255 249 c sys/src/cmd/gs/lib/gslp.bat - 775 sys sys 1137462658 179
+1137463255 250 c sys/src/cmd/gs/lib/gslp.ps - 664 sys sys 1137462658 19645
+1137463255 251 c sys/src/cmd/gs/lib/gsnd - 775 sys sys 1137462658 207
+1137463255 252 c sys/src/cmd/gs/lib/gsnd.bat - 775 sys sys 1137462659 130
+1137463255 253 c sys/src/cmd/gs/lib/gsndt.bat - 775 sys sys 1137462659 134
+1137463255 254 c sys/src/cmd/gs/lib/gsnup.ps - 664 sys sys 1137462659 2727
+1137463255 255 c sys/src/cmd/gs/lib/gst.bat - 775 sys sys 1137462660 119
+1137463255 256 c sys/src/cmd/gs/lib/gstt.bat - 775 sys sys 1137462660 121
+1137463255 257 c sys/src/cmd/gs/lib/ht_ccsto.ps - 664 sys sys 1137462661 227916
+1137463255 258 c sys/src/cmd/gs/lib/image-qa.ps - 664 sys sys 1137462662 73327
+1137463255 259 c sys/src/cmd/gs/lib/impath.ps - 664 sys sys 1137462662 5542
+1137463255 260 c sys/src/cmd/gs/lib/jispaper.ps - 664 sys sys 1137462663 934
+1137463255 261 c sys/src/cmd/gs/lib/landscap.ps - 664 sys sys 1137462663 1529
+1137463255 262 c sys/src/cmd/gs/lib/level1.ps - 664 sys sys 1137462664 114
+1137463255 263 c sys/src/cmd/gs/lib/lines.ps - 664 sys sys 1137462664 3872
+1137463255 264 c sys/src/cmd/gs/lib/lp386.bat - 775 sys sys 1137462664 141
+1137463255 265 c sys/src/cmd/gs/lib/lp386r2.bat - 775 sys sys 1137462665 136
+1137463255 266 c sys/src/cmd/gs/lib/lpgs.bat - 775 sys sys 1137462665 183
+1137463255 267 c sys/src/cmd/gs/lib/lpr2.bat - 775 sys sys 1137462665 176
+1137463255 268 c sys/src/cmd/gs/lib/lprsetup.sh - 775 sys sys 1137462665 4665
+1137463255 269 c sys/src/cmd/gs/lib/markhint.ps - 664 sys sys 1137462666 3477
+1137463255 270 c sys/src/cmd/gs/lib/markpath.ps - 664 sys sys 1137462666 1894
+1137463255 271 c sys/src/cmd/gs/lib/packfile.ps - 664 sys sys 1137462668 10365
+1137463255 272 c sys/src/cmd/gs/lib/pcharstr.ps - 664 sys sys 1137462668 3588
+1137463255 273 c sys/src/cmd/gs/lib/pdf2dsc - 775 sys sys 1137462668 639
+1137463255 274 c sys/src/cmd/gs/lib/pdf2dsc.ps - 664 sys sys 1137462669 5094
+1137463255 275 c sys/src/cmd/gs/lib/pdf2ps - 775 sys sys 1137462669 844
+1137463255 276 c sys/src/cmd/gs/lib/pdf2ps.bat - 775 sys sys 1137462670 496
+1137463255 277 c sys/src/cmd/gs/lib/pdf_base.ps - 664 sys sys 1137462670 34426
+1137463255 278 c sys/src/cmd/gs/lib/pdf_draw.ps - 664 sys sys 1137462671 41076
+1137463255 279 c sys/src/cmd/gs/lib/pdf_font.ps - 664 sys sys 1137462672 53454
+1137463255 280 c sys/src/cmd/gs/lib/pdf_main.ps - 664 sys sys 1137462673 45457
+1137463255 281 c sys/src/cmd/gs/lib/pdf_ops.ps - 664 sys sys 1137462673 20969
+1137463255 282 c sys/src/cmd/gs/lib/pdf_sec.ps - 664 sys sys 1137462674 14038
+1137463255 283 c sys/src/cmd/gs/lib/pf2afm - 775 sys sys 1137462678 438
+1137463255 284 c sys/src/cmd/gs/lib/pf2afm.bat - 775 sys sys 1137462680 319
+1137463255 285 c sys/src/cmd/gs/lib/pf2afm.ps - 664 sys sys 1137462680 14922
+1137463255 286 c sys/src/cmd/gs/lib/pfbtopfa - 775 sys sys 1137462681 454
+1137463255 287 c sys/src/cmd/gs/lib/stc.upp - 664 sys sys 1137462702 1919
+1137463255 288 c sys/src/cmd/gs/lib/eps2eps - 775 sys sys 1137462623 557
+1137463255 289 c sys/src/cmd/gs/lib/eps2eps.bat - 775 sys sys 1137462623 577
+1137463255 290 c sys/src/cmd/gs/lib/pfbtopfa.ps - 664 sys sys 1137462683 1145
+1137463255 291 c sys/src/cmd/gs/lib/pftogsf.bat - 775 sys sys 1137462683 1383
+1137463255 292 c sys/src/cmd/gs/lib/ppath.ps - 664 sys sys 1137462683 1978
+1137463255 293 c sys/src/cmd/gs/lib/prfont.ps - 664 sys sys 1137462684 6484
+1137463255 294 c sys/src/cmd/gs/lib/printafm - 775 sys sys 1137462685 208
+1137463255 295 c sys/src/cmd/gs/lib/printafm.ps - 664 sys sys 1137462685 3244
+1137463255 296 c sys/src/cmd/gs/lib/ps2ai.ps - 664 sys sys 1137462686 22503
+1137463255 297 c sys/src/cmd/gs/lib/ps2ascii - 775 sys sys 1137462686 790
+1137463255 298 c sys/src/cmd/gs/lib/ps2ascii.bat - 775 sys sys 1137462687 437
+1137463255 299 c sys/src/cmd/gs/lib/ps2ascii.ps - 664 sys sys 1137462687 44622
+1137463255 300 c sys/src/cmd/gs/lib/ps2epsi - 775 sys sys 1137462688 1816
+1137463255 301 c sys/src/cmd/gs/lib/ps2epsi.bat - 775 sys sys 1137462688 838
+1137463255 302 c sys/src/cmd/gs/lib/ps2epsi.ps - 664 sys sys 1137462689 8253
+1137463255 303 c sys/src/cmd/gs/lib/ps2pdf - 775 sys sys 1137462689 212
+1137463255 304 c sys/src/cmd/gs/lib/ps2pdf.bat - 775 sys sys 1137462690 512
+1137463255 305 c sys/src/cmd/gs/lib/ps2pdf12 - 775 sys sys 1137462690 175
+1137463255 306 c sys/src/cmd/gs/lib/ps2pdf12.bat - 775 sys sys 1137462691 334
+1137463255 307 c sys/src/cmd/gs/lib/ps2pdf13 - 775 sys sys 1137462692 175
+1137463255 308 c sys/src/cmd/gs/lib/ps2pdf13.bat - 775 sys sys 1137462692 334
+1137463255 309 c sys/src/cmd/gs/lib/ps2pdfwr - 775 sys sys 1137462694 1015
+1137463255 310 c sys/src/cmd/gs/lib/ps2pdfxx.bat - 775 sys sys 1137462694 1387
+1137463255 311 c sys/src/cmd/gs/lib/ps2ps - 775 sys sys 1137462695 559
+1137463255 312 c sys/src/cmd/gs/lib/ps2ps.bat - 775 sys sys 1137462695 480
+1137463255 313 c sys/src/cmd/gs/lib/pv.sh - 775 sys sys 1137462697 1249
+1137463255 314 c sys/src/cmd/gs/lib/rollconv.ps - 664 sys sys 1137462698 11768
+1137463255 315 c sys/src/cmd/gs/lib/showchar.ps - 664 sys sys 1137462699 2936
+1137463255 316 c sys/src/cmd/gs/lib/stc1520h.upp - 664 sys sys 1137462703 2150
+1137463255 317 c sys/src/cmd/gs/lib/stc2.upp - 664 sys sys 1137462704 1900
+1137463255 318 c sys/src/cmd/gs/lib/stc2_h.upp - 664 sys sys 1137462706 1875
+1137463255 319 c sys/src/cmd/gs/lib/stc2s_h.upp - 664 sys sys 1137462706 2268
+1137463255 320 c sys/src/cmd/gs/lib/stc500p.upp - 664 sys sys 1137462709 1899
+1137463255 321 c sys/src/cmd/gs/lib/stc500ph.upp - 664 sys sys 1137462709 1899
+1137463255 322 c sys/src/cmd/gs/lib/stc600ih.upp - 664 sys sys 1137462710 2277
+1137463255 323 c sys/src/cmd/gs/lib/stc600p.upp - 664 sys sys 1137462710 1147
+1137463255 324 c sys/src/cmd/gs/lib/stc600pl.upp - 664 sys sys 1137462711 1111
+1137463255 325 c sys/src/cmd/gs/lib/stc800ih.upp - 664 sys sys 1137462712 2154
+1137463255 326 c sys/src/cmd/gs/lib/stc800p.upp - 664 sys sys 1137462712 1111
+1137463255 327 c sys/src/cmd/gs/lib/stc800pl.upp - 664 sys sys 1137462713 1093
+1137463255 328 c sys/src/cmd/gs/lib/stc_h.upp - 664 sys sys 1137462714 1909
+1137463255 329 c sys/src/cmd/gs/lib/stc_l.upp - 664 sys sys 1137462714 730
+1137463255 330 c sys/src/cmd/gs/lib/stcany.upp - 664 sys sys 1137462715 669
+1137463255 331 c sys/src/cmd/gs/lib/stcinfo.ps - 664 sys sys 1137462716 25737
+1137463255 332 c sys/src/cmd/gs/lib/stcolor.ps - 664 sys sys 1137462717 5225
+1137463255 333 c sys/src/cmd/gs/lib/stocht.ps - 664 sys sys 1137462717 2642
+1137463255 334 c sys/src/cmd/gs/lib/traceimg.ps - 664 sys sys 1137462718 1535
+1137463255 335 c sys/src/cmd/gs/lib/traceop.ps - 664 sys sys 1137462719 2738
+1137463255 336 c sys/src/cmd/gs/lib/type1enc.ps - 664 sys sys 1137462719 2540
+1137463255 337 c sys/src/cmd/gs/lib/type1ops.ps - 664 sys sys 1137462720 7580
+1137463255 338 c sys/src/cmd/gs/lib/uninfo.ps - 664 sys sys 1137462720 6140
+1137463255 339 c sys/src/cmd/gs/lib/unix-lpr.sh - 775 sys sys 1137462721 4210
+1137463255 340 c sys/src/cmd/gs/lib/unprot.ps - 664 sys sys 1137462721 1908
+1137463255 341 c sys/src/cmd/gs/lib/viewcmyk.ps - 664 sys sys 1137462722 2120
+1137463255 342 c sys/src/cmd/gs/lib/viewgif.ps - 664 sys sys 1137462722 4575
+1137463255 343 c sys/src/cmd/gs/lib/viewjpeg.ps - 664 sys sys 1137462722 4953
+1137463255 344 c sys/src/cmd/gs/lib/viewmiff.ps - 664 sys sys 1137462723 3782
+1137463255 345 c sys/src/cmd/gs/lib/viewpbm.ps - 664 sys sys 1137462723 5314
+1137463255 346 c sys/src/cmd/gs/lib/viewpcx.ps - 664 sys sys 1137462724 4352
+1137463255 347 c sys/src/cmd/gs/lib/viewps2a.ps - 664 sys sys 1137462724 1286
+1137463255 348 c sys/src/cmd/gs/lib/wftopfa - 775 sys sys 1137462725 227
+1137463255 349 c sys/src/cmd/gs/lib/wftopfa.ps - 664 sys sys 1137462725 8925
+1137463255 350 c sys/src/cmd/gs/lib/winmaps.ps - 664 sys sys 1137462726 3747
+1137463255 351 c sys/src/cmd/gs/lib/wmakebat.bat - 775 sys sys 1137462726 202
+1137463255 352 c sys/src/cmd/gs/lib/wrfont.ps - 664 sys sys 1137462727 18170
+1137463255 353 c sys/src/cmd/gs/lib/zeroline.ps - 664 sys sys 1137462728 2467
+1137463255 354 a sys/src/cmd/gs/lib/EndOfTask.ps - 775 sys sys 1137462609 1
+1137463255 355 a sys/src/cmd/gs/lib/FAPIcidfmap - 664 sys sys 1137462609 1495
+1137463255 356 a sys/src/cmd/gs/lib/FAPIconfig - 664 sys sys 1137462609 778
+1137463255 357 a sys/src/cmd/gs/lib/FAPIfontmap - 664 sys sys 1137462610 1480
+1137463255 358 a sys/src/cmd/gs/lib/PDFX_def.ps - 775 sys sys 1137462614 1355
+1137463255 359 c sys/src/cmd/gs/lib/bdftops.cmd - 775 sys sys 1137462616 267
+1137463255 360 a sys/src/cmd/gs/lib/cidfmap - 664 sys sys 1137462621 996
+1137463255 361 a sys/src/cmd/gs/lib/dumphint - 775 sys sys 1137462622 481
+1137463255 362 a sys/src/cmd/gs/lib/dumphint.bat - 775 sys sys 1137462622 378
+1137463255 363 a sys/src/cmd/gs/lib/dumphint.ps - 775 sys sys 1137462622 20048
+1137463255 364 c sys/src/cmd/gs/lib/eps2eps.cmd - 775 sys sys 1137462624 724
+1137463255 365 c sys/src/cmd/gs/lib/font2c.cmd - 775 sys sys 1137462625 275
+1137463255 366 a sys/src/cmd/gs/lib/ghostpdf.inf - 664 sys sys 1137462627 683
+1137463255 367 a sys/src/cmd/gs/lib/ghostpdf.ppd - 664 sys sys 1137462627 25478
+1137463255 368 c sys/src/cmd/gs/lib/gs_agl.ps - 664 sys sys 1137462628 28612
+1137463255 369 c sys/src/cmd/gs/lib/gs_cidcm.ps - 664 sys sys 1137462630 17059
+1137463255 370 a sys/src/cmd/gs/lib/gs_ciddc.ps - 664 sys sys 1137462630 7333
+1137463255 371 a sys/src/cmd/gs/lib/gs_cidfm.ps - 664 sys sys 1137462630 4638
+1137463255 372 a sys/src/cmd/gs/lib/gs_cidtt.ps - 664 sys sys 1137462631 4796
+1137463255 373 a sys/src/cmd/gs/lib/gs_ciecs2.ps - 664 sys sys 1137462631 3477
+1137463255 374 a sys/src/cmd/gs/lib/gs_ciecs3.ps - 664 sys sys 1137462631 3183
+1137463255 375 a sys/src/cmd/gs/lib/gs_cspace.ps - 664 sys sys 1137462632 29498
+1137463255 376 c sys/src/cmd/gs/lib/gs_css_e.ps - 664 sys sys 1137462632 4955
+1137463255 377 a sys/src/cmd/gs/lib/gs_devcs.ps - 664 sys sys 1137462633 6281
+1137463255 378 a sys/src/cmd/gs/lib/gs_devn.ps - 664 sys sys 1137462633 5556
+1137463255 379 a sys/src/cmd/gs/lib/gs_devpxl.ps - 664 sys sys 1137462634 2244
+1137463255 380 a sys/src/cmd/gs/lib/gs_diskn.ps - 664 sys sys 1137462634 6892
+1137463255 381 c sys/src/cmd/gs/lib/gs_dscp.ps - 664 sys sys 1137462636 3936
+1137463255 382 a sys/src/cmd/gs/lib/gs_fapi.ps - 664 sys sys 1137462637 9287
+1137463255 383 a sys/src/cmd/gs/lib/gs_fntem.ps - 664 sys sys 1137462637 10788
+1137463255 384 c sys/src/cmd/gs/lib/gs_frsd.ps - 664 sys sys 1137462638 3002
+1137463255 385 c sys/src/cmd/gs/lib/gs_icc.ps - 664 sys sys 1137462639 10598
+1137463255 386 a sys/src/cmd/gs/lib/gs_img.ps - 664 sys sys 1137462640 21397
+1137463255 387 a sys/src/cmd/gs/lib/gs_indxd.ps - 664 sys sys 1137462640 5462
+1137463255 388 a sys/src/cmd/gs/lib/gs_patrn.ps - 664 sys sys 1137462645 7927
+1137463255 389 a sys/src/cmd/gs/lib/gs_resmp.ps - 664 sys sys 1137462648 22414
+1137463255 390 a sys/src/cmd/gs/lib/gs_resst.ps - 664 sys sys 1137462648 5673
+1137463255 391 c sys/src/cmd/gs/lib/gssetgs.bat - 664 sys sys 1137462660 244
+1137463255 392 c sys/src/cmd/gs/lib/pdf2dsc.bat - 775 sys sys 1137462669 367
+1137463255 393 c sys/src/cmd/gs/lib/pdf2ps.cmd - 775 sys sys 1137462670 816
+1137463255 394 c sys/src/cmd/gs/lib/pdfopt - 775 sys sys 1137462674 485
+1137463255 395 c sys/src/cmd/gs/lib/pdfopt.bat - 775 sys sys 1137462675 402
+1137463255 396 c sys/src/cmd/gs/lib/pdfopt.ps - 664 sys sys 1137462677 36025
+1137463255 397 c sys/src/cmd/gs/lib/pdfwrite.ps - 664 sys sys 1137462678 9903
+1137463255 398 c sys/src/cmd/gs/lib/pf2afm.cmd - 775 sys sys 1137462680 254
+1137463255 399 c sys/src/cmd/gs/lib/pphs - 775 sys sys 1137462684 334
+1137463255 400 c sys/src/cmd/gs/lib/pphs.ps - 664 sys sys 1137462684 6924
+1137463255 401 c sys/src/cmd/gs/lib/ps2ascii.cmd - 775 sys sys 1137462687 531
+1137463255 402 c sys/src/cmd/gs/lib/ps2epsi.cmd - 775 sys sys 1137462689 955
+1137463255 403 c sys/src/cmd/gs/lib/ps2pdf.cmd - 775 sys sys 1137462690 956
+1137463255 404 c sys/src/cmd/gs/lib/ps2pdf12.cmd - 775 sys sys 1137462691 334
+1137463255 405 c sys/src/cmd/gs/lib/ps2pdf13.cmd - 775 sys sys 1137462692 334
+1137463255 406 c sys/src/cmd/gs/lib/ps2pdf14 - 664 sys sys 1137462693 175
+1137463255 407 c sys/src/cmd/gs/lib/ps2pdf14.bat - 664 sys sys 1137462693 334
+1137463255 408 c sys/src/cmd/gs/lib/ps2pdf14.cmd - 664 sys sys 1137462694 334
+1137463255 409 c sys/src/cmd/gs/lib/ps2ps.cmd - 775 sys sys 1137462695 696
+1137463255 410 c sys/src/cmd/gs/lib/st640ih.upp - 664 sys sys 1137462699 2277
+1137463255 411 c sys/src/cmd/gs/lib/st640ihg.upp - 664 sys sys 1137462700 1504
+1137463255 412 c sys/src/cmd/gs/lib/st640p.upp - 664 sys sys 1137462700 1910
+1137463255 413 c sys/src/cmd/gs/lib/st640pg.upp - 664 sys sys 1137462700 1137
+1137463255 414 c sys/src/cmd/gs/lib/st640pl.upp - 664 sys sys 1137462701 1874
+1137463255 415 c sys/src/cmd/gs/lib/st640plg.upp - 664 sys sys 1137462701 1101
+1137463255 416 c sys/src/cmd/gs/lib/stc200_h.upp - 664 sys sys 1137462705 1844
+1137463255 417 c sys/src/cmd/gs/lib/stc300.upp - 664 sys sys 1137462707 2132
+1137463255 418 c sys/src/cmd/gs/lib/stc300bl.upp - 664 sys sys 1137462708 1337
+1137463255 419 c sys/src/cmd/gs/lib/stc300bm.upp - 664 sys sys 1137462708 1426
+1137463255 420 c sys/src/cmd/gs/lib/stc640p.upp - 664 sys sys 1137462711 1091
+1137463255 421 c sys/src/cmd/gs/lib/stcany_h.upp - 664 sys sys 1137462715 677
+1137463255 422 a sys/src/cmd/gs/lib/gs_sepr.ps - 664 sys sys 1137462649 8293
+1137463255 423 a sys/src/cmd/gs/lib/gs_stres.ps - 664 sys sys 1137462650 4174
+1137463255 424 a sys/src/cmd/gs/lib/mkcidfm.ps - 664 sys sys 1137462666 7304
+1137463255 425 a sys/src/cmd/gs/lib/opdfread.ps - 664 sys sys 1137462667 111167
+1137463255 426 a sys/src/cmd/gs/lib/pdf_rbld.ps - 664 sys sys 1137462673 14217
+1137463255 427 a sys/src/cmd/gs/lib/pfbtopfa.bat - 775 sys sys 1137462682 309
+1137463255 428 a sys/src/cmd/gs/lib/ps2ps2 - 775 sys sys 1137462696 560
+1137463255 429 a sys/src/cmd/gs/lib/ps2ps2.bat - 775 sys sys 1137462696 502
+1137463255 430 a sys/src/cmd/gs/lib/ps2ps2.cmd - 775 sys sys 1137462696 697
+1137463255 431 a sys/src/cmd/gs/lib/ps2write.bat - 775 sys sys 1137462696 818
+1137463255 432 a sys/src/cmd/gs/lib/rinkj-2200-setup - 664 sys sys 1137462698 3228
+1137463255 433 a sys/src/cmd/gs/lib/xlatmap - 664 sys sys 1137462727 1750
+1137463255 434 a sys/src/cmd/gs/libpng/ANNOUNCE - 664 sys sys 1137462992 1476
+1137463255 435 c sys/src/cmd/gs/libpng/CHANGES - 664 sys sys 1137462993 79441
+1137463255 436 a sys/src/cmd/gs/libpng/INSTALL - 664 sys sys 1137462993 7366
+1137463255 437 a sys/src/cmd/gs/libpng/KNOWNBUG - 664 sys sys 1137462993 402
+1137463255 438 a sys/src/cmd/gs/libpng/LICENSE - 664 sys sys 1137462993 4105
+1137463255 439 c sys/src/cmd/gs/libpng/README - 664 sys sys 1137462994 13988
+1137463255 440 c sys/src/cmd/gs/libpng/TODO - 664 sys sys 1137462994 1182
+1137463255 441 a sys/src/cmd/gs/libpng/Y2KINFO - 664 sys sys 1137462994 2321
+1137463255 442 a sys/src/cmd/gs/libpng/configure - 775 sys sys 1137462995 388
+1137463255 443 c sys/src/cmd/gs/libpng/example.c - 664 sys sys 1137462995 29793
+1137463255 444 a sys/src/cmd/gs/libpng/libpng.3 - 664 sys sys 1137462996 164387
+1137463255 445 c sys/src/cmd/gs/libpng/libpng.txt - 664 sys sys 1137462997 127770
+1137463255 446 a sys/src/cmd/gs/libpng/libpngpf.3 - 664 sys sys 1137462997 24981
+1137463255 447 c sys/src/cmd/gs/libpng/png.c - 664 sys sys 1137462998 23742
+1137463255 448 c sys/src/cmd/gs/libpng/png.h - 664 sys sys 1137462999 142306
+1137463255 449 a sys/src/cmd/gs/libpng/pngbar.jpg - 664 sys sys 1137463000 2498
+1137463255 450 a sys/src/cmd/gs/libpng/pngbar.png - 664 sys sys 1137463000 2399
+1137463255 451 c sys/src/cmd/gs/libpng/pngconf.h - 664 sys sys 1137463000 43647
+1137463255 452 c sys/src/cmd/gs/libpng/pngerror.c - 664 sys sys 1137463001 8608
+1137463255 453 a sys/src/cmd/gs/libpng/pnggccrd.c - 664 sys sys 1137463002 235080
+1137463255 454 c sys/src/cmd/gs/libpng/pngget.c - 664 sys sys 1137463002 26015
+1137463255 455 c sys/src/cmd/gs/libpng/pngmem.c - 664 sys sys 1137463003 16603
+1137463255 456 a sys/src/cmd/gs/libpng/pngnow.png - 664 sys sys 1137463003 2069
+1137463255 457 c sys/src/cmd/gs/libpng/pngpread.c - 664 sys sys 1137463004 45988
+1137463255 458 c sys/src/cmd/gs/libpng/pngread.c - 664 sys sys 1137463004 46423
+1137463255 459 c sys/src/cmd/gs/libpng/pngrio.c - 664 sys sys 1137463005 5354
+1137463255 460 c sys/src/cmd/gs/libpng/pngrtran.c - 664 sys sys 1137463006 142687
+1137463255 461 c sys/src/cmd/gs/libpng/pngrutil.c - 664 sys sys 1137463006 91082
+1137463255 462 c sys/src/cmd/gs/libpng/pngset.c - 664 sys sys 1137463007 38654
+1137463255 463 c sys/src/cmd/gs/libpng/pngtest.c - 664 sys sys 1137463007 46652
+1137463255 464 c sys/src/cmd/gs/libpng/pngtest.png - 664 sys sys 1137463007 8574
+1137463255 465 c sys/src/cmd/gs/libpng/pngtrans.c - 664 sys sys 1137463007 20378
+1137463255 466 a sys/src/cmd/gs/libpng/pngvcrd.c - 664 sys sys 1137463008 143414
+1137463255 467 c sys/src/cmd/gs/libpng/pngwio.c - 664 sys sys 1137463008 7439
+1137463255 468 c sys/src/cmd/gs/libpng/pngwrite.c - 664 sys sys 1137463008 47886
+1137463255 469 c sys/src/cmd/gs/libpng/pngwtran.c - 664 sys sys 1137463009 17042
+1137463255 470 c sys/src/cmd/gs/libpng/pngwutil.c - 664 sys sys 1137463009 83750
+1137463255 471 c sys/src/cmd/gs/man/dvipdf.1 - 664 sys sys 1137462728 786
+1137463255 472 c sys/src/cmd/gs/man/eps2eps.1 - 664 sys sys 1137462729 1035
+1137463255 473 c sys/src/cmd/gs/man/font2c.1 - 664 sys sys 1137462729 745
+1137463255 474 c sys/src/cmd/gs/man/gs.1 - 664 sys sys 1137462730 13217
+1137463255 475 c sys/src/cmd/gs/man/gslp.1 - 664 sys sys 1137462730 3058
+1137463255 476 c sys/src/cmd/gs/man/gsnd.1 - 664 sys sys 1137462730 636
+1137463255 477 c sys/src/cmd/gs/man/pdf2dsc.1 - 664 sys sys 1137462731 1502
+1137463255 478 c sys/src/cmd/gs/man/pdf2ps.1 - 664 sys sys 1137462731 991
+1137463255 479 c sys/src/cmd/gs/man/pdfopt.1 - 664 sys sys 1137462732 1248
+1137463255 480 c sys/src/cmd/gs/man/pf2afm.1 - 664 sys sys 1137462732 730
+1137463255 481 c sys/src/cmd/gs/man/pfbtopfa.1 - 664 sys sys 1137462732 602
+1137463255 482 c sys/src/cmd/gs/man/printafm.1 - 664 sys sys 1137462733 622
+1137463255 483 c sys/src/cmd/gs/man/ps2ascii.1 - 664 sys sys 1137462733 1407
+1137463255 484 c sys/src/cmd/gs/man/ps2epsi.1 - 664 sys sys 1137462734 2856
+1137463255 485 c sys/src/cmd/gs/man/ps2pdf.1 - 664 sys sys 1137462734 1728
+1137463255 486 c sys/src/cmd/gs/man/ps2pdfwr.1 - 664 sys sys 1137462734 1000
+1137463255 487 c sys/src/cmd/gs/man/ps2ps.1 - 664 sys sys 1137462735 1402
+1137463255 488 c sys/src/cmd/gs/man/wftopfa.1 - 664 sys sys 1137462735 624
+1137463255 489 c sys/src/cmd/gs/mips.h - 664 sys sys 1137462349 1372
+1137463255 490 c sys/src/cmd/gs/mkfile - 664 sys sys 1137462536 7772
+1137463255 491 c sys/src/cmd/gs/power.h - 664 sys sys 1137462349 1444
+1137463255 492 c sys/src/cmd/gs/src/all-arch.mak - 664 sys sys 1137462387 29165
+1137463255 493 c sys/src/cmd/gs/src/bcc32.cfg - 664 sys sys 1137462388 185
+1137463255 494 c sys/src/cmd/gs/src/bcwin32.mak - 664 sys sys 1137462388 20376
+1137463255 495 c sys/src/cmd/gs/src/bench.c - 664 sys sys 1137462388 12796
+1137463255 496 c sys/src/cmd/gs/src/bfont.h - 664 sys sys 1137462389 3402
+1137463255 497 c sys/src/cmd/gs/src/btoken.h - 664 sys sys 1137462389 1842
+1137463255 498 c sys/src/cmd/gs/src/catmake - 775 sys sys 1137462389 257
+1137463255 499 c sys/src/cmd/gs/src/ccfont.h - 664 sys sys 1137462389 3854
+1137463255 500 c sys/src/cmd/gs/src/cfonts.mak - 664 sys sys 1137462390 15163
+1137463255 501 c sys/src/cmd/gs/src/contrib.mak - 664 sys sys 1137462390 34537
+1137463255 502 c sys/src/cmd/gs/src/cp.bat - 775 sys sys 1137462391 388
+1137463255 503 c sys/src/cmd/gs/src/cp.cmd - 775 sys sys 1137462391 97
+1137463255 504 c sys/src/cmd/gs/src/ctype_.h - 664 sys sys 1137462391 1010
+1137463255 505 c sys/src/cmd/gs/src/devs.mak - 664 sys sys 1137462392 64181
+1137463255 506 c sys/src/cmd/gs/src/dirent_.h - 664 sys sys 1137462392 1672
+1137463255 507 c sys/src/cmd/gs/src/dos_.h - 664 sys sys 1137462393 2767
+1137463255 508 c sys/src/cmd/gs/src/dstack.h - 664 sys sys 1137462394 10152
+1137463255 509 c sys/src/cmd/gs/src/dvx-gcc.mak - 664 sys sys 1137462395 11617
+1137463255 510 c sys/src/cmd/gs/src/dvx-head.mak - 664 sys sys 1137462395 1778
+1137463255 511 c sys/src/cmd/gs/src/dvx-tail.mak - 664 sys sys 1137462395 3105
+1137463255 512 c sys/src/cmd/gs/src/dw32c.def - 664 sys sys 1137462395 72
+1137463255 513 c sys/src/cmd/gs/src/dwdll.h - 664 sys sys 1137462396 1610
+1137463255 514 c sys/src/cmd/gs/src/dwimg.h - 664 sys sys 1137462397 2879
+1137463255 515 c sys/src/cmd/gs/src/dwinst.cpp - 664 sys sys 1137462397 23399
+1137463255 516 c sys/src/cmd/gs/src/dwinst.h - 664 sys sys 1137462397 3293
+1137463255 517 c sys/src/cmd/gs/src/dwmain.h - 664 sys sys 1137462398 938
+1137463255 518 c sys/src/cmd/gs/src/dwmain.rc - 664 sys sys 1137462398 1017
+1137463255 519 c sys/src/cmd/gs/src/dwmain16.def - 664 sys sys 1137462398 155
+1137463255 520 c sys/src/cmd/gs/src/dwmain32.def - 664 sys sys 1137462399 43
+1137463255 521 c sys/src/cmd/gs/src/dwsetup.cpp - 664 sys sys 1137462400 33506
+1137463255 522 c sys/src/cmd/gs/src/dwsetup.def - 664 sys sys 1137462400 71
+1137463255 523 c sys/src/cmd/gs/src/dwsetup.h - 664 sys sys 1137462401 1921
+1137463255 524 c sys/src/cmd/gs/src/dwsetup.rc - 664 sys sys 1137462401 4682
+1137463255 525 c sys/src/cmd/gs/src/dwtext.h - 664 sys sys 1137462402 3785
+1137463255 526 c sys/src/cmd/gs/src/dwuninst.cpp - 664 sys sys 1137462402 19713
+1137463255 527 c sys/src/cmd/gs/src/dwuninst.def - 664 sys sys 1137462403 76
+1137463255 528 c sys/src/cmd/gs/src/dwuninst.h - 664 sys sys 1137462403 1052
+1137463255 529 c sys/src/cmd/gs/src/dwuninst.rc - 664 sys sys 1137462403 1255
+1137463255 530 c sys/src/cmd/gs/src/echogs.c - 664 sys sys 1137462404 8713
+1137463255 531 c sys/src/cmd/gs/src/errno_.h - 664 sys sys 1137462404 1186
+1137463255 532 c sys/src/cmd/gs/src/errors.h - 664 sys sys 1137462405 1074
+1137463255 533 c sys/src/cmd/gs/src/estack.h - 664 sys sys 1137462405 7612
+1137463255 534 c sys/src/cmd/gs/src/files.h - 664 sys sys 1137462406 5644
+1137463255 535 c sys/src/cmd/gs/src/gconf.c - 664 sys sys 1137462406 5494
+1137463255 536 c sys/src/cmd/gs/src/gconf.h - 664 sys sys 1137462406 1192
+1137463255 537 c sys/src/cmd/gs/src/gdebug.h - 664 sys sys 1137462408 5416
+1137463255 538 c sys/src/cmd/gs/src/gdev3852.c - 664 sys sys 1137462409 5832
+1137463255 539 c sys/src/cmd/gs/src/gdev3b1.c - 664 sys sys 1137462409 21139
+1137463255 540 c sys/src/cmd/gs/src/gdev4081.c - 664 sys sys 1137462409 2773
+1137463255 541 c sys/src/cmd/gs/src/gdev4693.c - 664 sys sys 1137462409 5648
+1137463255 542 c sys/src/cmd/gs/src/gdev8510.c - 664 sys sys 1137462410 4046
+1137463255 543 c sys/src/cmd/gs/src/gdev8bcm.c - 664 sys sys 1137462410 2422
+1137463255 544 c sys/src/cmd/gs/src/gdev8bcm.h - 664 sys sys 1137462410 2698
+1137463255 545 c sys/src/cmd/gs/src/gdevabuf.c - 664 sys sys 1137462410 13995
+1137463255 546 c sys/src/cmd/gs/src/gdevadmp.c - 664 sys sys 1137462411 11704
+1137463255 547 c sys/src/cmd/gs/src/gdevbbox.c - 664 sys sys 1137462411 37913
+1137463255 548 c sys/src/cmd/gs/src/gdevbbox.h - 664 sys sys 1137462412 5764
+1137463255 549 c sys/src/cmd/gs/src/gdevbit.c - 664 sys sys 1137462412 11557
+1137463255 550 c sys/src/cmd/gs/src/gdevbj10.c - 664 sys sys 1137462412 15471
+1137463255 551 c sys/src/cmd/gs/src/gdevbjc.h - 664 sys sys 1137462412 8389
+1137463255 552 c sys/src/cmd/gs/src/gdevbjcl.c - 664 sys sys 1137462413 5889
+1137463255 553 c sys/src/cmd/gs/src/gdevbjcl.h - 664 sys sys 1137462413 12872
+1137463255 554 c sys/src/cmd/gs/src/gdevbmp.c - 664 sys sys 1137462413 7079
+1137463255 555 c sys/src/cmd/gs/src/gdevbmp.h - 664 sys sys 1137462413 1324
+1137463255 556 c sys/src/cmd/gs/src/gdevbmpa.c - 664 sys sys 1137462414 27291
+1137463255 557 c sys/src/cmd/gs/src/gdevbmpc.c - 664 sys sys 1137462414 6946
+1137463255 558 c sys/src/cmd/gs/src/gdevccr.c - 664 sys sys 1137462414 7760
+1137463255 559 c sys/src/cmd/gs/src/gdevcd8.c - 664 sys sys 1137462415 92322
+1137463255 560 c sys/src/cmd/gs/src/gdevcdj.c - 664 sys sys 1137462416 113141
+1137463255 561 c sys/src/cmd/gs/src/gdevcgm.c - 664 sys sys 1137462416 14740
+1137463255 562 c sys/src/cmd/gs/src/gdevcgml.c - 664 sys sys 1137462417 28632
+1137463255 563 c sys/src/cmd/gs/src/gdevcgml.h - 664 sys sys 1137462417 13770
+1137463255 564 c sys/src/cmd/gs/src/gdevcgmx.h - 664 sys sys 1137462417 5181
+1137463255 565 c sys/src/cmd/gs/src/gdevcif.c - 664 sys sys 1137462417 3414
+1137463255 566 c sys/src/cmd/gs/src/gdevclj.c - 664 sys sys 1137462418 22763
+1137463255 567 c sys/src/cmd/gs/src/gdevcljc.c - 664 sys sys 1137462418 3771
+1137463255 568 c sys/src/cmd/gs/src/gdevcmap.c - 664 sys sys 1137462418 10592
+1137463255 569 c sys/src/cmd/gs/src/gdevcmap.h - 664 sys sys 1137462419 2252
+1137463255 570 c sys/src/cmd/gs/src/gdevcp50.c - 664 sys sys 1137462419 7825
+1137463255 571 c sys/src/cmd/gs/src/gdevcslw.c - 664 sys sys 1137462419 4215
+1137463255 572 c sys/src/cmd/gs/src/gdevdbit.c - 664 sys sys 1137462420 18846
+1137463255 573 c sys/src/cmd/gs/src/gdevdcrd.c - 664 sys sys 1137462420 5435
+1137463255 574 c sys/src/cmd/gs/src/gdevdcrd.h - 664 sys sys 1137462420 1015
+1137463255 575 c sys/src/cmd/gs/src/gdevddrw.c - 664 sys sys 1137462420 28007
+1137463255 576 c sys/src/cmd/gs/src/gdevdfax.c - 664 sys sys 1137462421 3019
+1137463255 577 c sys/src/cmd/gs/src/gdevdflt.c - 664 sys sys 1137462422 32353
+1137463255 578 c sys/src/cmd/gs/src/gdevdgbr.c - 664 sys sys 1137462422 26440
+1137463255 579 c sys/src/cmd/gs/src/gdevdjet.c - 664 sys sys 1137462422 17397
+1137463255 580 c sys/src/cmd/gs/src/gdevdjtc.c - 664 sys sys 1137462423 9389
+1137463255 581 c sys/src/cmd/gs/src/gdevdm24.c - 664 sys sys 1137462423 8360
+1137463255 582 c sys/src/cmd/gs/src/gdevdrop.c - 664 sys sys 1137462424 23474
+1137463255 583 c sys/src/cmd/gs/src/gdevegaa.asm - 664 sys sys 1137462425 6536
+1137463255 584 c sys/src/cmd/gs/src/gdevemap.c - 664 sys sys 1137462425 2920
+1137463255 585 c sys/src/cmd/gs/src/gdevepsc.c - 664 sys sys 1137462426 13738
+1137463255 586 c sys/src/cmd/gs/src/gdevepsn.c - 664 sys sys 1137462426 14731
+1137463255 587 c sys/src/cmd/gs/src/gdevescp.c - 664 sys sys 1137462426 11143
+1137463255 588 c sys/src/cmd/gs/src/gdevevga.c - 664 sys sys 1137462427 3034
+1137463255 589 c sys/src/cmd/gs/src/gdevherc.c - 664 sys sys 1137462427 11540
+1137463255 590 c sys/src/cmd/gs/src/gdevhit.c - 664 sys sys 1137462428 2743
+1137463255 591 c sys/src/cmd/gs/src/gdevhl7x.c - 664 sys sys 1137462428 30573
+1137463255 592 c sys/src/cmd/gs/src/gdevimgn.c - 664 sys sys 1137462429 19349
+1137463255 593 c sys/src/cmd/gs/src/gdevjpeg.c - 664 sys sys 1137462429 10582
+1137463255 594 c sys/src/cmd/gs/src/gdevl256.c - 664 sys sys 1137462430 9410
+1137463255 595 c sys/src/cmd/gs/src/gdevl31s.c - 664 sys sys 1137462430 10512
+1137463255 596 c sys/src/cmd/gs/src/gdevlbp8.c - 664 sys sys 1137462430 6372
+1137463255 597 c sys/src/cmd/gs/src/gdevlj56.c - 664 sys sys 1137462431 5952
+1137463255 598 c sys/src/cmd/gs/src/gdevlp8k.c - 664 sys sys 1137462431 13717
+1137463255 599 c sys/src/cmd/gs/src/gdevlxm.c - 664 sys sys 1137462431 14493
+1137463255 600 c sys/src/cmd/gs/src/gdevm1.c - 664 sys sys 1137462431 22546
+1137463255 601 c sys/src/cmd/gs/src/gdevm16.c - 664 sys sys 1137462432 5294
+1137463255 602 c sys/src/cmd/gs/src/gdevm2.c - 664 sys sys 1137462432 7711
+1137463255 603 c sys/src/cmd/gs/src/gdevm24.c - 664 sys sys 1137462433 15532
+1137463255 604 c sys/src/cmd/gs/src/gdevm32.c - 664 sys sys 1137462433 7969
+1137463255 605 c sys/src/cmd/gs/src/gdevm4.c - 664 sys sys 1137462433 9520
+1137463255 606 c sys/src/cmd/gs/src/gdevm8.c - 664 sys sys 1137462434 7365
+1137463255 607 c sys/src/cmd/gs/src/gdevmeds.c - 664 sys sys 1137462436 3396
+1137463255 608 c sys/src/cmd/gs/src/gdevmeds.h - 664 sys sys 1137462436 954
+1137463255 609 c sys/src/cmd/gs/src/gdevmem.c - 664 sys sys 1137462436 20078
+1137463255 610 c sys/src/cmd/gs/src/gdevmem.h - 664 sys sys 1137462437 10668
+1137463255 611 c sys/src/cmd/gs/src/gdevmgr.c - 664 sys sys 1137462437 14200
+1137463255 612 c sys/src/cmd/gs/src/gdevmgr.h - 664 sys sys 1137462437 3725
+1137463255 613 c sys/src/cmd/gs/src/gdevmiff.c - 664 sys sys 1137462438 2529
+1137463255 614 c sys/src/cmd/gs/src/gdevmpla.c - 664 sys sys 1137462438 18700
+1137463255 615 c sys/src/cmd/gs/src/gdevmpla.h - 664 sys sys 1137462438 1915
+1137463255 616 c sys/src/cmd/gs/src/gdevmr1.c - 664 sys sys 1137462438 8718
+1137463255 617 c sys/src/cmd/gs/src/gdevmr2n.c - 664 sys sys 1137462439 6088
+1137463255 618 c sys/src/cmd/gs/src/gdevmr8n.c - 664 sys sys 1137462439 10911
+1137463255 619 c sys/src/cmd/gs/src/gdevmrop.h - 664 sys sys 1137462439 2943
+1137463255 620 c sys/src/cmd/gs/src/gdevmrun.c - 664 sys sys 1137462440 18289
+1137463255 621 c sys/src/cmd/gs/src/gdevmrun.h - 664 sys sys 1137462440 2059
+1137463255 622 c sys/src/cmd/gs/src/gdevmswn.c - 664 sys sys 1137462440 14878
+1137463255 623 c sys/src/cmd/gs/src/gdevmswn.h - 664 sys sys 1137462440 3513
+1137463255 624 c sys/src/cmd/gs/src/gdevmsxf.c - 664 sys sys 1137462441 13898
+1137463255 625 c sys/src/cmd/gs/src/gdevn533.c - 664 sys sys 1137462441 5345
+1137463255 626 c sys/src/cmd/gs/src/gdevnfwd.c - 664 sys sys 1137462441 35891
+1137463255 627 c sys/src/cmd/gs/src/gdevo182.c - 664 sys sys 1137462442 8298
+1137463255 628 c sys/src/cmd/gs/src/gdevokii.c - 664 sys sys 1137462442 8938
+1137463255 629 c sys/src/cmd/gs/src/gdevos2p.c - 664 sys sys 1137462442 19961
+1137463255 630 c sys/src/cmd/gs/src/gdevp2up.c - 664 sys sys 1137462443 4669
+1137463255 631 c sys/src/cmd/gs/src/gdevpbm.c - 664 sys sys 1137462444 34099
+1137463255 632 c sys/src/cmd/gs/src/gdevpccm.c - 664 sys sys 1137462444 3500
+1137463255 633 c sys/src/cmd/gs/src/gdevpccm.h - 664 sys sys 1137462444 1368
+1137463255 634 c sys/src/cmd/gs/src/gdevpcfb.c - 664 sys sys 1137462445 23791
+1137463255 635 c sys/src/cmd/gs/src/gdevpcfb.h - 664 sys sys 1137462445 6261
+1137463255 636 c sys/src/cmd/gs/src/gdevpcl.c - 664 sys sys 1137462445 12905
+1137463255 637 c sys/src/cmd/gs/src/gdevpcl.h - 664 sys sys 1137462445 2518
+1137463255 638 c sys/src/cmd/gs/src/gdevpcx.c - 664 sys sys 1137462446 13841
+1137463255 639 c sys/src/cmd/gs/src/gdevpdf.c - 664 sys sys 1137462446 40675
+1137463255 640 c sys/src/cmd/gs/src/gdevpdfd.c - 664 sys sys 1137462448 43451
+1137463255 641 c sys/src/cmd/gs/src/gdevpdfi.c - 664 sys sys 1137462449 42849
+1137463255 642 c sys/src/cmd/gs/src/gdevpdfm.c - 664 sys sys 1137462450 63605
+1137463255 643 c sys/src/cmd/gs/src/gdevpdfo.c - 664 sys sys 1137462450 42559
+1137463255 644 c sys/src/cmd/gs/src/gdevpdfo.h - 664 sys sys 1137462450 13545
+1137463255 645 c sys/src/cmd/gs/src/gdevpdfp.c - 664 sys sys 1137462451 16712
+1137463255 646 c sys/src/cmd/gs/src/gdevpdfr.c - 664 sys sys 1137462451 13866
+1137463255 647 c sys/src/cmd/gs/src/gdevpdft.c - 664 sys sys 1137462451 12247
+1137463255 648 c sys/src/cmd/gs/src/gdevpdfu.c - 664 sys sys 1137462452 54491
+1137463255 649 c sys/src/cmd/gs/src/gdevpdfx.h - 664 sys sys 1137462452 43928
+1137463255 650 c sys/src/cmd/gs/src/gdevpe.c - 664 sys sys 1137462457 7474
+1137463255 651 c sys/src/cmd/gs/src/gdevpipe.c - 664 sys sys 1137462458 2222
+1137463255 652 c sys/src/cmd/gs/src/gdevpjet.c - 664 sys sys 1137462458 8186
+1137463255 653 c sys/src/cmd/gs/src/gdevplnx.c - 664 sys sys 1137462459 37291
+1137463255 654 c sys/src/cmd/gs/src/gdevplnx.h - 664 sys sys 1137462459 3129
+1137463255 655 c sys/src/cmd/gs/src/gdevpm.c - 664 sys sys 1137462459 38091
+1137463255 656 c sys/src/cmd/gs/src/gdevpm.h - 664 sys sys 1137462460 1217
+1137463255 657 c sys/src/cmd/gs/src/gdevpng.c - 664 sys sys 1137462460 21221
+1137463255 658 c sys/src/cmd/gs/src/gdevppla.c - 664 sys sys 1137462461 4098
+1137463255 659 c sys/src/cmd/gs/src/gdevppla.h - 664 sys sys 1137462461 1928
+1137463255 660 c sys/src/cmd/gs/src/gdevprn.c - 664 sys sys 1137462461 39728
+1137463255 661 c sys/src/cmd/gs/src/gdevprn.h - 664 sys sys 1137462461 28392
+1137463255 662 c sys/src/cmd/gs/src/gdevprna.c - 664 sys sys 1137462462 28515
+1137463255 663 c sys/src/cmd/gs/src/gdevprna.h - 664 sys sys 1137462462 8621
+1137463255 664 c sys/src/cmd/gs/src/gdevps.c - 664 sys sys 1137462463 51391
+1137463255 665 c sys/src/cmd/gs/src/gdevpsdf.h - 664 sys sys 1137462463 14541
+1137463255 666 c sys/src/cmd/gs/src/gdevpsdi.c - 664 sys sys 1137462464 24178
+1137463255 667 c sys/src/cmd/gs/src/gdevpsdp.c - 664 sys sys 1137462464 26688
+1137463255 668 c sys/src/cmd/gs/src/gdevpsds.c - 664 sys sys 1137462464 32021
+1137463255 669 c sys/src/cmd/gs/src/gdevpsds.h - 664 sys sys 1137462465 8309
+1137463255 670 c sys/src/cmd/gs/src/gdevpsim.c - 664 sys sys 1137462468 13563
+1137463255 671 c sys/src/cmd/gs/src/gdevpx.c - 664 sys sys 1137462469 47700
+1137463255 672 c sys/src/cmd/gs/src/gdevpxat.h - 664 sys sys 1137462469 3407
+1137463255 673 c sys/src/cmd/gs/src/gdevpxen.h - 664 sys sys 1137462470 7288
+1137463255 674 c sys/src/cmd/gs/src/gdevpxop.h - 664 sys sys 1137462470 4116
+1137463255 675 c sys/src/cmd/gs/src/gdevpxut.c - 664 sys sys 1137462470 6788
+1137463255 676 c sys/src/cmd/gs/src/gdevpxut.h - 664 sys sys 1137462471 2857
+1137463255 677 c sys/src/cmd/gs/src/gdevrops.c - 664 sys sys 1137462471 7127
+1137463255 678 c sys/src/cmd/gs/src/gdevs3ga.c - 664 sys sys 1137462471 7270
+1137463255 679 c sys/src/cmd/gs/src/gdevsco.c - 664 sys sys 1137462472 6545
+1137463255 680 c sys/src/cmd/gs/src/gdevsgi.c - 664 sys sys 1137462472 7111
+1137463255 681 c sys/src/cmd/gs/src/gdevsgi.h - 664 sys sys 1137462472 2060
+1137463255 682 c sys/src/cmd/gs/src/gdevsj48.c - 664 sys sys 1137462472 8849
+1137463255 683 c sys/src/cmd/gs/src/gdevsnfb.c - 664 sys sys 1137462473 3214
+1137463255 684 c sys/src/cmd/gs/src/gdevsppr.c - 664 sys sys 1137462473 5358
+1137463255 685 c sys/src/cmd/gs/src/gdevstc.c - 664 sys sys 1137462474 119115
+1137463255 686 c sys/src/cmd/gs/src/gdevstc.h - 664 sys sys 1137462474 8985
+1137463255 687 c sys/src/cmd/gs/src/gdevstc1.c - 664 sys sys 1137462474 4584
+1137463255 688 c sys/src/cmd/gs/src/gdevstc2.c - 664 sys sys 1137462474 13540
+1137463255 689 c sys/src/cmd/gs/src/gdevstc3.c - 664 sys sys 1137462475 3590
+1137463255 690 c sys/src/cmd/gs/src/gdevstc4.c - 664 sys sys 1137462475 7679
+1137463255 691 c sys/src/cmd/gs/src/gdevsun.c - 664 sys sys 1137462475 20582
+1137463255 692 c sys/src/cmd/gs/src/gdevsunr.c - 664 sys sys 1137462476 3507
+1137463255 693 c sys/src/cmd/gs/src/gdevsvga.c - 664 sys sys 1137462476 27227
+1137463255 694 c sys/src/cmd/gs/src/gdevsvga.h - 664 sys sys 1137462476 3201
+1137463255 695 c sys/src/cmd/gs/src/gdevtfax.c - 664 sys sys 1137462477 12370
+1137463255 696 c sys/src/cmd/gs/src/gdevtfax.h - 664 sys sys 1137462477 991
+1137463255 697 c sys/src/cmd/gs/src/gdevtfnx.c - 664 sys sys 1137462477 5393
+1137463255 698 c sys/src/cmd/gs/src/gdevtifs.c - 664 sys sys 1137462478 10773
+1137463255 699 c sys/src/cmd/gs/src/gdevtifs.h - 664 sys sys 1137462478 9447
+1137463255 700 c sys/src/cmd/gs/src/gdevtknk.c - 664 sys sys 1137462478 8110
+1137463255 701 c sys/src/cmd/gs/src/gdevupd.c - 664 sys sys 1137462480 265024
+1137463255 702 c sys/src/cmd/gs/src/gdevvec.c - 664 sys sys 1137462480 36338
+1137463255 703 c sys/src/cmd/gs/src/gdevvec.h - 664 sys sys 1137462481 15566
+1137463255 704 c sys/src/cmd/gs/src/gdevvglb.c - 664 sys sys 1137462481 10030
+1137463255 705 c sys/src/cmd/gs/src/gdevwddb.c - 664 sys sys 1137462481 17628
+1137463255 706 c sys/src/cmd/gs/src/gdevwdib.c - 664 sys sys 1137462482 21678
+1137463255 707 c sys/src/cmd/gs/src/gdevwpr2.c - 664 sys sys 1137462482 46471
+1137463255 708 c sys/src/cmd/gs/src/gdevwprn.c - 664 sys sys 1137462482 19723
+1137463255 709 c sys/src/cmd/gs/src/gdevx.c - 664 sys sys 1137462483 39240
+1137463255 710 c sys/src/cmd/gs/src/gdevx.h - 664 sys sys 1137462483 8641
+1137463255 711 c sys/src/cmd/gs/src/gdevxalt.c - 664 sys sys 1137462483 24681
+1137463255 712 c sys/src/cmd/gs/src/gdevxcmp.c - 664 sys sys 1137462484 27678
+1137463255 713 c sys/src/cmd/gs/src/gdevxcmp.h - 664 sys sys 1137462484 4416
+1137463255 714 c sys/src/cmd/gs/src/gdevxini.c - 664 sys sys 1137462485 32749
+1137463255 715 c sys/src/cmd/gs/src/gdevxres.c - 664 sys sys 1137462485 6027
+1137463255 716 c sys/src/cmd/gs/src/gdevxxf.c - 664 sys sys 1137462485 13424
+1137463255 717 c sys/src/cmd/gs/src/genarch.c - 664 sys sys 1137462486 8533
+1137463255 718 c sys/src/cmd/gs/src/genconf.c - 664 sys sys 1137462486 28194
+1137463255 719 c sys/src/cmd/gs/src/gendev.c - 664 sys sys 1137462486 9824
+1137463255 720 c sys/src/cmd/gs/src/genht.c - 664 sys sys 1137462487 10285
+1137463255 721 c sys/src/cmd/gs/src/geninit.c - 664 sys sys 1137462487 12334
+1137463255 722 c sys/src/cmd/gs/src/ghost.h - 664 sys sys 1137462487 881
+1137463255 723 c sys/src/cmd/gs/src/gp.h - 664 sys sys 1137462488 15009
+1137463255 724 c sys/src/cmd/gs/src/gp_dosfe.c - 664 sys sys 1137462488 4154
+1137463255 725 c sys/src/cmd/gs/src/gp_dosfs.c - 664 sys sys 1137462488 4109
+1137463255 726 c sys/src/cmd/gs/src/gp_dvx.c - 664 sys sys 1137462488 3784
+1137463255 727 c sys/src/cmd/gs/src/gp_getnv.c - 664 sys sys 1137462489 1391
+1137463255 728 c sys/src/cmd/gs/src/gp_iwatc.c - 664 sys sys 1137462489 5197
+1137463255 729 c sys/src/cmd/gs/src/gp_mktmp.c - 664 sys sys 1137462490 1344
+1137463255 730 c sys/src/cmd/gs/src/gp_msdos.c - 664 sys sys 1137462491 3771
+1137463255 731 c sys/src/cmd/gs/src/gp_mshdl.c - 664 sys sys 1137462491 3811
+1137463255 732 c sys/src/cmd/gs/src/gp_msio.c - 664 sys sys 1137462491 6334
+1137463255 733 c sys/src/cmd/gs/src/gp_mslib.c - 664 sys sys 1137462492 1157
+1137463255 734 c sys/src/cmd/gs/src/gp_mswin.c - 664 sys sys 1137462493 22033
+1137463255 735 c sys/src/cmd/gs/src/gp_mswin.h - 664 sys sys 1137462493 1673
+1137463255 736 c sys/src/cmd/gs/src/gp_nsync.c - 664 sys sys 1137462493 2079
+1137463255 737 c sys/src/cmd/gs/src/gp_ntfs.c - 664 sys sys 1137462493 8146
+1137463255 738 c sys/src/cmd/gs/src/gp_os2.c - 664 sys sys 1137462494 21900
+1137463255 739 c sys/src/cmd/gs/src/gp_os9.c - 664 sys sys 1137462494 4183
+1137463255 740 c sys/src/cmd/gs/src/gp_psync.c - 664 sys sys 1137462495 5785
+1137463255 741 c sys/src/cmd/gs/src/gp_strdl.c - 664 sys sys 1137462496 1300
+1137463255 742 c sys/src/cmd/gs/src/gp_sysv.c - 664 sys sys 1137462496 1758
+1137463255 743 c sys/src/cmd/gs/src/gp_unifn.c - 664 sys sys 1137462496 2548
+1137463255 744 c sys/src/cmd/gs/src/gp_unifs.c - 664 sys sys 1137462496 12725
+1137463255 745 c sys/src/cmd/gs/src/gp_unix.c - 664 sys sys 1137462497 4883
+1137463255 746 c sys/src/cmd/gs/src/gp_vms.c - 664 sys sys 1137462497 18103
+1137463255 747 c sys/src/cmd/gs/src/gp_wgetv.c - 664 sys sys 1137462498 3587
+1137463255 748 c sys/src/cmd/gs/src/gp_win32.c - 664 sys sys 1137462498 3462
+1137463255 749 c sys/src/cmd/gs/src/gp_wsync.c - 664 sys sys 1137462498 5539
+1137463255 750 c sys/src/cmd/gs/src/gpcheck.h - 664 sys sys 1137462498 2405
+1137463255 751 c sys/src/cmd/gs/src/gpgetenv.h - 664 sys sys 1137462499 1532
+1137463255 752 c sys/src/cmd/gs/src/gpsync.h - 664 sys sys 1137462500 2409
+1137463255 753 c sys/src/cmd/gs/src/gs.c - 664 sys sys 1137462500 2385
+1137463255 754 c sys/src/cmd/gs/src/gs.mak - 664 sys sys 1137462500 20090
+1137463255 755 c sys/src/cmd/gs/src/gs16spl.c - 664 sys sys 1137462501 5255
+1137463255 756 c sys/src/cmd/gs/src/gs16spl.rc - 775 sys sys 1137462501 1292
+1137463255 757 c sys/src/cmd/gs/src/gsalloc.c - 664 sys sys 1137462502 63582
+1137463255 758 c sys/src/cmd/gs/src/gsalloc.h - 664 sys sys 1137462502 2859
+1137463255 759 c sys/src/cmd/gs/src/gsalpha.c - 664 sys sys 1137462503 1190
+1137463255 760 c sys/src/cmd/gs/src/gsalpha.h - 664 sys sys 1137462503 1140
+1137463255 761 c sys/src/cmd/gs/src/gsalphac.c - 664 sys sys 1137462503 25609
+1137463255 762 c sys/src/cmd/gs/src/gsalphac.h - 664 sys sys 1137462504 1900
+1137463255 763 c sys/src/cmd/gs/src/gsargs.c - 664 sys sys 1137462504 5344
+1137463255 764 c sys/src/cmd/gs/src/gsargs.h - 664 sys sys 1137462504 2630
+1137463255 765 c sys/src/cmd/gs/src/gsbitmap.h - 664 sys sys 1137462505 8382
+1137463255 766 c sys/src/cmd/gs/src/gsbitops.c - 664 sys sys 1137462506 18252
+1137463255 767 c sys/src/cmd/gs/src/gsbitops.h - 664 sys sys 1137462506 13142
+1137463255 768 c sys/src/cmd/gs/src/gsbittab.c - 664 sys sys 1137462506 4618
+1137463255 769 c sys/src/cmd/gs/src/gsbittab.h - 664 sys sys 1137462507 2966
+1137463255 770 c sys/src/cmd/gs/src/gsccode.h - 664 sys sys 1137462507 5620
+1137463255 771 c sys/src/cmd/gs/src/gsccolor.h - 664 sys sys 1137462507 1973
+1137463255 772 c sys/src/cmd/gs/src/gscdef.c - 664 sys sys 1137462508 2600
+1137463255 773 c sys/src/cmd/gs/src/gscdefs.h - 664 sys sys 1137462508 3228
+1137463255 774 c sys/src/cmd/gs/src/gscdevn.c - 664 sys sys 1137462509 17902
+1137463255 775 c sys/src/cmd/gs/src/gschar.c - 664 sys sys 1137462511 9982
+1137463255 776 c sys/src/cmd/gs/src/gschar.h - 664 sys sys 1137462511 5360
+1137463255 777 c sys/src/cmd/gs/src/gschar0.c - 664 sys sys 1137462512 12696
+1137463255 778 c sys/src/cmd/gs/src/gscie.c - 664 sys sys 1137462512 47160
+1137463255 779 c sys/src/cmd/gs/src/gscie.h - 664 sys sys 1137462513 29653
+1137463255 780 c sys/src/cmd/gs/src/gsciemap.c - 664 sys sys 1137462513 19961
+1137463255 781 c sys/src/cmd/gs/src/gsclipsr.c - 664 sys sys 1137462514 2922
+1137463255 782 c sys/src/cmd/gs/src/gsclipsr.h - 664 sys sys 1137462514 911
+1137463255 783 c sys/src/cmd/gs/src/gscolor.c - 664 sys sys 1137462514 7484
+1137463255 784 c sys/src/cmd/gs/src/gscolor.h - 664 sys sys 1137462515 1318
+1137463255 785 c sys/src/cmd/gs/src/gscolor1.c - 664 sys sys 1137462515 6508
+1137463255 786 c sys/src/cmd/gs/src/gscolor1.h - 664 sys sys 1137462515 1859
+1137463255 787 c sys/src/cmd/gs/src/gscolor2.c - 664 sys sys 1137462516 16183
+1137463255 788 c sys/src/cmd/gs/src/gscolor2.h - 664 sys sys 1137462516 1862
+1137463255 789 c sys/src/cmd/gs/src/gscolor3.c - 664 sys sys 1137462516 3053
+1137463255 790 c sys/src/cmd/gs/src/gscolor3.h - 664 sys sys 1137462517 1137
+1137463255 791 c sys/src/cmd/gs/src/os2.mak - 664 sys sys 1137462730 22812
+1137463255 792 c sys/src/cmd/gs/src/unixinst.mak - 664 sys sys 1137462776 6527
+1137463255 793 c sys/src/cmd/gs/src/gscompt.h - 664 sys sys 1137462517 2115
+1137463255 794 c sys/src/cmd/gs/src/gscoord.c - 664 sys sys 1137462517 14233
+1137463255 795 c sys/src/cmd/gs/src/gscoord.h - 664 sys sys 1137462518 2050
+1137463255 796 c sys/src/cmd/gs/src/gscparam.c - 664 sys sys 1137462518 17578
+1137463255 797 c sys/src/cmd/gs/src/gscpixel.c - 664 sys sys 1137462518 3964
+1137463255 798 c sys/src/cmd/gs/src/gscpixel.h - 664 sys sys 1137462519 1015
+1137463255 799 c sys/src/cmd/gs/src/gscpm.h - 664 sys sys 1137462519 1556
+1137463255 800 c sys/src/cmd/gs/src/gscrd.c - 664 sys sys 1137462519 11579
+1137463255 801 c sys/src/cmd/gs/src/gscrd.h - 664 sys sys 1137462519 3536
+1137463255 802 c sys/src/cmd/gs/src/gscrdp.c - 664 sys sys 1137462520 20059
+1137463255 803 c sys/src/cmd/gs/src/gscrdp.h - 664 sys sys 1137462520 3847
+1137463255 804 c sys/src/cmd/gs/src/gscrypt1.c - 664 sys sys 1137462520 1611
+1137463255 805 c sys/src/cmd/gs/src/gscrypt1.h - 664 sys sys 1137462521 1790
+1137463255 806 c sys/src/cmd/gs/src/gscscie.c - 664 sys sys 1137462521 15620
+1137463255 807 c sys/src/cmd/gs/src/gscsel.h - 664 sys sys 1137462521 1313
+1137463255 808 c sys/src/cmd/gs/src/gscsepr.c - 664 sys sys 1137462522 17144
+1137463255 809 c sys/src/cmd/gs/src/gscsepr.h - 664 sys sys 1137462522 2779
+1137463255 810 c sys/src/cmd/gs/src/gscspace.c - 664 sys sys 1137462522 20495
+1137463255 811 c sys/src/cmd/gs/src/gscspace.h - 664 sys sys 1137462523 19209
+1137463255 812 c sys/src/cmd/gs/src/gscssub.c - 664 sys sys 1137462523 3950
+1137463255 813 c sys/src/cmd/gs/src/gscssub.h - 664 sys sys 1137462523 3013
+1137463255 814 c sys/src/cmd/gs/src/gsdcolor.h - 664 sys sys 1137462524 17080
+1137463255 815 c sys/src/cmd/gs/src/gsdevice.c - 664 sys sys 1137462524 26217
+1137463255 816 c sys/src/cmd/gs/src/gsdevice.h - 664 sys sys 1137462524 4238
+1137463255 817 c sys/src/cmd/gs/src/gsdevmem.c - 664 sys sys 1137462525 7455
+1137463255 818 c sys/src/cmd/gs/src/gsdll.c - 664 sys sys 1137462526 5250
+1137463255 819 c sys/src/cmd/gs/src/gsdll.h - 664 sys sys 1137462526 3767
+1137463255 820 c sys/src/cmd/gs/src/gsdll2.rc - 664 sys sys 1137462527 797
+1137463255 821 c sys/src/cmd/gs/src/gsdll32.def - 664 sys sys 1137462527 657
+1137463255 822 c sys/src/cmd/gs/src/gsdll32.rc - 664 sys sys 1137462527 1871
+1137463255 823 c sys/src/cmd/gs/src/gsdllos2.h - 664 sys sys 1137462528 1148
+1137463255 824 c sys/src/cmd/gs/src/gsdllwin.h - 664 sys sys 1137462528 1815
+1137463255 825 c sys/src/cmd/gs/src/gsdparam.c - 664 sys sys 1137462529 26032
+1137463255 826 c sys/src/cmd/gs/src/gsdpnext.h - 664 sys sys 1137462529 889
+1137463255 827 c sys/src/cmd/gs/src/gsdps.c - 664 sys sys 1137462529 2930
+1137463255 828 c sys/src/cmd/gs/src/gsdps.h - 664 sys sys 1137462529 1051
+1137463255 829 c sys/src/cmd/gs/src/gsdps1.c - 664 sys sys 1137462530 8019
+1137463255 830 c sys/src/cmd/gs/src/gsdsrc.c - 664 sys sys 1137462530 3065
+1137463255 831 c sys/src/cmd/gs/src/gsdsrc.h - 664 sys sys 1137462530 4812
+1137463255 832 c sys/src/cmd/gs/src/gserror.h - 664 sys sys 1137462531 1073
+1137463255 833 c sys/src/cmd/gs/src/gserrors.h - 664 sys sys 1137462531 1695
+1137463255 834 c sys/src/cmd/gs/src/gserver.c - 664 sys sys 1137462531 9330
+1137463255 835 c sys/src/cmd/gs/src/gsexit.h - 664 sys sys 1137462532 1489
+1137463255 836 c sys/src/cmd/gs/src/gsfcmap.c - 664 sys sys 1137462532 17601
+1137463255 837 c sys/src/cmd/gs/src/gsfcmap.h - 664 sys sys 1137462533 2234
+1137463255 838 c sys/src/cmd/gs/src/gsfemu.c - 664 sys sys 1137462533 19990
+1137463255 839 c sys/src/cmd/gs/src/gsflip.c - 664 sys sys 1137462534 11399
+1137463255 840 c sys/src/cmd/gs/src/gsflip.h - 664 sys sys 1137462534 1499
+1137463255 841 c sys/src/cmd/gs/src/gsfname.c - 664 sys sys 1137462534 3315
+1137463255 842 c sys/src/cmd/gs/src/gsfname.h - 664 sys sys 1137462535 2134
+1137463255 843 c sys/src/cmd/gs/src/gsfont.c - 664 sys sys 1137462535 29107
+1137463255 844 c sys/src/cmd/gs/src/gsfont.h - 664 sys sys 1137462535 3495
+1137463255 845 c sys/src/cmd/gs/src/gsfont0.c - 664 sys sys 1137462535 3799
+1137463255 846 c sys/src/cmd/gs/src/gsfunc.c - 664 sys sys 1137462536 6152
+1137463255 847 c sys/src/cmd/gs/src/gsfunc.h - 664 sys sys 1137462536 7709
+1137463255 848 c sys/src/cmd/gs/src/gsfunc0.c - 664 sys sys 1137462537 45854
+1137463255 849 c sys/src/cmd/gs/src/gsfunc0.h - 664 sys sys 1137462537 2236
+1137463255 850 c sys/src/cmd/gs/src/gsfunc3.c - 664 sys sys 1137462537 22423
+1137463255 851 c sys/src/cmd/gs/src/gsfunc3.h - 664 sys sys 1137462538 3840
+1137463255 852 c sys/src/cmd/gs/src/gsgc.h - 664 sys sys 1137462539 3494
+1137463255 853 c sys/src/cmd/gs/src/gshsb.c - 664 sys sys 1137462540 4115
+1137463255 854 c sys/src/cmd/gs/src/gshsb.h - 664 sys sys 1137462540 951
+1137463255 855 c sys/src/cmd/gs/src/gsht.c - 664 sys sys 1137462540 48386
+1137463255 856 c sys/src/cmd/gs/src/gsht.h - 664 sys sys 1137462541 2425
+1137463255 857 c sys/src/cmd/gs/src/gsht1.c - 664 sys sys 1137462541 19754
+1137463255 858 c sys/src/cmd/gs/src/gsht1.h - 664 sys sys 1137462541 1946
+1137463255 859 c sys/src/cmd/gs/src/gshtscr.c - 664 sys sys 1137462542 21844
+1137463255 860 c sys/src/cmd/gs/src/gshtx.c - 664 sys sys 1137462542 15065
+1137463255 861 c sys/src/cmd/gs/src/gshtx.h - 664 sys sys 1137462542 4726
+1137463255 862 c sys/src/cmd/gs/src/gsimage.c - 664 sys sys 1137462543 17485
+1137463255 863 c sys/src/cmd/gs/src/gsimage.h - 664 sys sys 1137462544 8472
+1137463255 864 c sys/src/cmd/gs/src/gsimpath.c - 664 sys sys 1137462544 5919
+1137463255 865 c sys/src/cmd/gs/src/gsinit.c - 664 sys sys 1137462544 2073
+1137463255 866 c sys/src/cmd/gs/src/gsio.h - 664 sys sys 1137462545 2009
+1137463255 867 c sys/src/cmd/gs/src/gsiodev.c - 664 sys sys 1137462545 9670
+1137463255 868 c sys/src/cmd/gs/src/gsiparam.h - 664 sys sys 1137462547 10767
+1137463255 869 c sys/src/cmd/gs/src/gsiparm2.h - 664 sys sys 1137462547 1806
+1137463255 870 c sys/src/cmd/gs/src/gsiparm3.h - 664 sys sys 1137462547 2004
+1137463255 871 c sys/src/cmd/gs/src/gsiparm4.h - 664 sys sys 1137462548 1938
+1137463255 872 c sys/src/cmd/gs/src/gsistate.c - 664 sys sys 1137462548 7209
+1137463255 873 c sys/src/cmd/gs/src/gsjconf.h - 664 sys sys 1137462548 1929
+1137463255 874 c sys/src/cmd/gs/src/gsjmorec.h - 664 sys sys 1137462548 1647
+1137463255 875 c sys/src/cmd/gs/src/gslib.c - 664 sys sys 1137462549 31411
+1137463255 876 c sys/src/cmd/gs/src/gslib.h - 664 sys sys 1137462549 1375
+1137463255 877 c sys/src/cmd/gs/src/gsline.c - 664 sys sys 1137462550 8386
+1137463255 878 c sys/src/cmd/gs/src/gsline.h - 664 sys sys 1137462550 2523
+1137463255 879 c sys/src/cmd/gs/src/gslparam.h - 664 sys sys 1137462551 1371
+1137463255 880 c sys/src/cmd/gs/src/gsmalloc.c - 664 sys sys 1137462551 15538
+1137463255 881 c sys/src/cmd/gs/src/gsmalloc.h - 664 sys sys 1137462551 2263
+1137463255 882 c sys/src/cmd/gs/src/gsmatrix.c - 664 sys sys 1137462552 17028
+1137463255 883 c sys/src/cmd/gs/src/gsmatrix.h - 664 sys sys 1137462552 3139
+1137463255 884 c sys/src/cmd/gs/src/gsmdebug.h - 664 sys sys 1137462552 1731
+1137463255 885 c sys/src/cmd/gs/src/gsmemlok.c - 664 sys sys 1137462552 11581
+1137463255 886 c sys/src/cmd/gs/src/gsmemlok.h - 664 sys sys 1137462553 1938
+1137463255 887 c sys/src/cmd/gs/src/gsmemory.c - 664 sys sys 1137462553 9933
+1137463255 888 c sys/src/cmd/gs/src/gsmemory.h - 664 sys sys 1137462553 16583
+1137463255 889 c sys/src/cmd/gs/src/gsmemraw.h - 664 sys sys 1137462554 8635
+1137463255 890 c sys/src/cmd/gs/src/gsmemret.c - 664 sys sys 1137462554 10957
+1137463255 891 c sys/src/cmd/gs/src/gsmemret.h - 664 sys sys 1137462554 2443
+1137463255 892 c sys/src/cmd/gs/src/gsmisc.c - 664 sys sys 1137462555 33157
+1137463255 893 c sys/src/cmd/gs/src/gsnogc.c - 664 sys sys 1137462555 10195
+1137463255 894 c sys/src/cmd/gs/src/gsnogc.h - 664 sys sys 1137462555 988
+1137463255 895 c sys/src/cmd/gs/src/gsnorop.c - 664 sys sys 1137462556 4120
+1137463255 896 c sys/src/cmd/gs/src/gsnotify.c - 664 sys sys 1137462556 3345
+1137463255 897 c sys/src/cmd/gs/src/gsnotify.h - 664 sys sys 1137462556 3480
+1137463255 898 c sys/src/cmd/gs/src/gsos2.rc - 664 sys sys 1137462557 801
+1137463255 899 c sys/src/cmd/gs/src/gspaint.c - 664 sys sys 1137462558 12685
+1137463255 900 c sys/src/cmd/gs/src/gspaint.h - 664 sys sys 1137462558 1106
+1137463255 901 c sys/src/cmd/gs/src/gsparam.c - 664 sys sys 1137462558 12209
+1137463255 902 c sys/src/cmd/gs/src/gsparam.h - 664 sys sys 1137462559 21015
+1137463255 903 c sys/src/cmd/gs/src/gsparam2.c - 664 sys sys 1137462559 9986
+1137463255 904 c sys/src/cmd/gs/src/gsparams.c - 664 sys sys 1137462559 11728
+1137463255 905 c sys/src/cmd/gs/src/gsparams.h - 664 sys sys 1137462560 2410
+1137463255 906 c sys/src/cmd/gs/src/gsparamx.c - 664 sys sys 1137462560 5082
+1137463255 907 c sys/src/cmd/gs/src/gsparamx.h - 664 sys sys 1137462560 1679
+1137463255 908 c sys/src/cmd/gs/src/gspath.c - 664 sys sys 1137462561 14236
+1137463255 909 c sys/src/cmd/gs/src/gspath.h - 664 sys sys 1137462561 3543
+1137463255 910 c sys/src/cmd/gs/src/gspath1.c - 664 sys sys 1137462561 18182
+1137463255 911 c sys/src/cmd/gs/src/gspath2.h - 664 sys sys 1137462562 1206
+1137463255 912 c sys/src/cmd/gs/src/gspcolor.c - 664 sys sys 1137462562 10716
+1137463255 913 c sys/src/cmd/gs/src/gspcolor.h - 664 sys sys 1137462562 4317
+1137463255 914 c sys/src/cmd/gs/src/gspenum.h - 664 sys sys 1137462563 1107
+1137463255 915 c sys/src/cmd/gs/src/gspmdrv.c - 664 sys sys 1137462563 35028
+1137463255 916 c sys/src/cmd/gs/src/gspmdrv.h - 664 sys sys 1137462564 1005
+1137463255 917 c sys/src/cmd/gs/src/gspmdrv.rc - 664 sys sys 1137462564 1410
+1137463255 918 c sys/src/cmd/gs/src/gsptype1.c - 664 sys sys 1137462565 39529
+1137463255 919 c sys/src/cmd/gs/src/gsptype1.h - 664 sys sys 1137462565 5339
+1137463255 920 c sys/src/cmd/gs/src/gsptype2.c - 664 sys sys 1137462566 10798
+1137463255 921 c sys/src/cmd/gs/src/gsptype2.h - 664 sys sys 1137462566 3670
+1137463255 922 c sys/src/cmd/gs/src/gsrect.h - 664 sys sys 1137462567 3315
+1137463255 923 c sys/src/cmd/gs/src/gsrefct.h - 664 sys sys 1137462567 6078
+1137463255 924 c sys/src/cmd/gs/src/gsrop.c - 664 sys sys 1137462567 2294
+1137463255 925 c sys/src/cmd/gs/src/gsrop.h - 664 sys sys 1137462568 1375
+1137463255 926 c sys/src/cmd/gs/src/gsropc.c - 664 sys sys 1137462568 9206
+1137463255 927 c sys/src/cmd/gs/src/gsropc.h - 664 sys sys 1137462569 1744
+1137463255 928 c sys/src/cmd/gs/src/gsropt.h - 664 sys sys 1137462569 7746
+1137463255 929 c sys/src/cmd/gs/src/gsroptab.c - 664 sys sys 1137462569 16643
+1137463255 930 c sys/src/cmd/gs/src/gsshade.c - 664 sys sys 1137462570 17086
+1137463255 931 c sys/src/cmd/gs/src/gsshade.h - 664 sys sys 1137462571 9133
+1137463255 932 c sys/src/cmd/gs/src/gsstate.c - 664 sys sys 1137462572 32373
+1137463255 933 c sys/src/cmd/gs/src/gsstate.h - 664 sys sys 1137462572 3221
+1137463255 934 c sys/src/cmd/gs/src/gsstruct.h - 664 sys sys 1137462573 52592
+1137463255 935 c sys/src/cmd/gs/src/gsstype.h - 664 sys sys 1137462573 3728
+1137463255 936 c sys/src/cmd/gs/src/gstext.c - 664 sys sys 1137462574 20019
+1137463255 937 c sys/src/cmd/gs/src/gstext.h - 664 sys sys 1137462574 11818
+1137463255 938 c sys/src/cmd/gs/src/gstrap.c - 664 sys sys 1137462575 3379
+1137463255 939 c sys/src/cmd/gs/src/gstrap.h - 664 sys sys 1137462576 2148
+1137463255 940 c sys/src/cmd/gs/src/gx.h - 664 sys sys 1137462583 1405
+1137463255 941 c sys/src/cmd/gs/src/gstype1.c - 664 sys sys 1137462576 15115
+1137463255 942 c sys/src/cmd/gs/src/gstype1.h - 664 sys sys 1137462577 7604
+1137463255 943 c sys/src/cmd/gs/src/gstype2.c - 664 sys sys 1137462577 21587
+1137463255 944 c sys/src/cmd/gs/src/gstype42.c - 664 sys sys 1137462578 34346
+1137463255 945 c sys/src/cmd/gs/src/gstypes.h - 664 sys sys 1137462578 4140
+1137463255 946 c sys/src/cmd/gs/src/gsuid.h - 664 sys sys 1137462579 2469
+1137463255 947 c sys/src/cmd/gs/src/gsutil.c - 664 sys sys 1137462579 7998
+1137463255 948 c sys/src/cmd/gs/src/gsutil.h - 664 sys sys 1137462579 2886
+1137463255 949 c sys/src/cmd/gs/src/gswin.rc - 664 sys sys 1137462580 894
+1137463255 950 c sys/src/cmd/gs/src/gswin32.rc - 664 sys sys 1137462581 1469
+1137463255 951 c sys/src/cmd/gs/src/gswin386.rc - 664 sys sys 1137462581 69
+1137463255 952 c sys/src/cmd/gs/src/gsxfont.h - 664 sys sys 1137462582 1263
+1137463255 953 c sys/src/cmd/gs/src/gxacpath.c - 664 sys sys 1137462583 15544
+1137463255 954 c sys/src/cmd/gs/src/gxalloc.h - 664 sys sys 1137462583 17638
+1137463255 955 c sys/src/cmd/gs/src/gxalpha.h - 664 sys sys 1137462584 2965
+1137463255 956 c sys/src/cmd/gs/src/gxarith.h - 664 sys sys 1137462584 3299
+1137463255 957 c sys/src/cmd/gs/src/gxband.h - 664 sys sys 1137462585 3506
+1137463255 958 c sys/src/cmd/gs/src/gxbcache.c - 664 sys sys 1137462585 4285
+1137463255 959 c sys/src/cmd/gs/src/gxbcache.h - 664 sys sys 1137462585 4273
+1137463255 960 c sys/src/cmd/gs/src/gxbitfmt.h - 664 sys sys 1137462586 7253
+1137463255 961 c sys/src/cmd/gs/src/gxbitmap.h - 664 sys sys 1137462586 6563
+1137463255 962 c sys/src/cmd/gs/src/gxbitops.h - 664 sys sys 1137462587 5127
+1137463255 963 c sys/src/cmd/gs/src/gxccache.c - 664 sys sys 1137462588 16418
+1137463255 964 c sys/src/cmd/gs/src/gxccman.c - 664 sys sys 1137462588 26893
+1137463255 965 c sys/src/cmd/gs/src/gxcdevn.h - 664 sys sys 1137462589 1891
+1137463255 966 c sys/src/cmd/gs/src/gxchar.c - 664 sys sys 1137462589 49829
+1137463255 967 c sys/src/cmd/gs/src/gxchar.h - 664 sys sys 1137462590 5843
+1137463255 968 c sys/src/cmd/gs/src/gxcht.c - 664 sys sys 1137462591 45561
+1137463255 969 c sys/src/cmd/gs/src/gxcie.h - 664 sys sys 1137462592 5505
+1137463255 970 c sys/src/cmd/gs/src/gxcindex.h - 664 sys sys 1137462592 4827
+1137463255 971 c sys/src/cmd/gs/src/gxclbits.c - 664 sys sys 1137462592 24248
+1137463255 972 c sys/src/cmd/gs/src/gxcldev.h - 664 sys sys 1137462593 29563
+1137463255 973 c sys/src/cmd/gs/src/gxclfile.c - 664 sys sys 1137462593 3895
+1137463255 974 c sys/src/cmd/gs/src/gxclimag.c - 664 sys sys 1137462594 48155
+1137463255 975 c sys/src/cmd/gs/src/gxclio.h - 664 sys sys 1137462594 3218
+1137463255 976 c sys/src/cmd/gs/src/gxclip.c - 664 sys sys 1137462594 18738
+1137463255 977 c sys/src/cmd/gs/src/gxclip.h - 664 sys sys 1137462595 2941
+1137463255 978 c sys/src/cmd/gs/src/gxclip2.c - 664 sys sys 1137462595 9770
+1137463255 979 c sys/src/cmd/gs/src/gxclip2.h - 664 sys sys 1137462595 1881
+1137463255 980 c sys/src/cmd/gs/src/gxclipm.c - 664 sys sys 1137462596 11952
+1137463255 981 c sys/src/cmd/gs/src/gxclipm.h - 664 sys sys 1137462596 973
+1137463255 982 c sys/src/cmd/gs/src/gxclipsr.h - 664 sys sys 1137462596 1666
+1137463255 983 c sys/src/cmd/gs/src/gxclist.c - 664 sys sys 1137462597 25654
+1137463255 984 c sys/src/cmd/gs/src/gxclist.h - 664 sys sys 1137462597 14876
+1137463255 985 c sys/src/cmd/gs/src/gxcllzw.c - 664 sys sys 1137462598 1565
+1137463255 986 c sys/src/cmd/gs/src/gxclmem.c - 664 sys sys 1137462598 39546
+1137463255 987 c sys/src/cmd/gs/src/gxclmem.h - 664 sys sys 1137462598 6387
+1137463255 988 c sys/src/cmd/gs/src/gxclpage.c - 664 sys sys 1137462599 3715
+1137463255 989 c sys/src/cmd/gs/src/gxclpage.h - 664 sys sys 1137462599 2333
+1137463255 990 c sys/src/cmd/gs/src/gxclpath.c - 664 sys sys 1137462600 42385
+1137463255 991 c sys/src/cmd/gs/src/gxclpath.h - 664 sys sys 1137462600 10920
+1137463255 992 c sys/src/cmd/gs/src/gxclrast.c - 664 sys sys 1137462601 74443
+1137463255 993 c sys/src/cmd/gs/src/gxclread.c - 664 sys sys 1137462601 16608
+1137463255 994 c sys/src/cmd/gs/src/gxclrect.c - 664 sys sys 1137462602 20776
+1137463255 995 c sys/src/cmd/gs/src/gxclutil.c - 664 sys sys 1137462603 21395
+1137463255 996 c sys/src/cmd/gs/src/gxclzlib.c - 664 sys sys 1137462603 1700
+1137463255 997 c sys/src/cmd/gs/src/gxcmap.c - 664 sys sys 1137462603 47294
+1137463255 998 c sys/src/cmd/gs/src/gxcmap.h - 664 sys sys 1137462604 10383
+1137463255 999 c sys/src/cmd/gs/src/gxcolor2.h - 664 sys sys 1137462604 3856
+1137463255 1000 c sys/src/cmd/gs/src/gxcomp.h - 664 sys sys 1137462605 5919
+1137463255 1001 c sys/src/cmd/gs/src/gxcoord.h - 664 sys sys 1137462605 1409
+1137463255 1002 c sys/src/cmd/gs/src/gxcpath.c - 664 sys sys 1137462606 29202
+1137463255 1003 c sys/src/cmd/gs/src/gxcpath.h - 664 sys sys 1137462606 5293
+1137463255 1004 c sys/src/cmd/gs/src/gxcspace.h - 664 sys sys 1137462607 10063
+1137463255 1005 c sys/src/cmd/gs/src/gxctable.c - 664 sys sys 1137462607 4224
+1137463255 1006 c sys/src/cmd/gs/src/gxctable.h - 664 sys sys 1137462607 2155
+1137463255 1007 c sys/src/cmd/gs/src/gxcvalue.h - 664 sys sys 1137462608 1564
+1137463255 1008 c sys/src/cmd/gs/src/gxdcconv.c - 664 sys sys 1137462608 4952
+1137463255 1009 c sys/src/cmd/gs/src/gxdcconv.h - 664 sys sys 1137462608 1313
+1137463255 1010 c sys/src/cmd/gs/src/gxdcolor.c - 664 sys sys 1137462609 23693
+1137463255 1011 c sys/src/cmd/gs/src/gxdcolor.h - 664 sys sys 1137462609 14056
+1137463255 1012 c sys/src/cmd/gs/src/gxdda.h - 664 sys sys 1137462609 5566
+1137463255 1013 c sys/src/cmd/gs/src/gxdevbuf.h - 664 sys sys 1137462610 4114
+1137463255 1014 c sys/src/cmd/gs/src/gxdevcli.h - 664 sys sys 1137462611 62657
+1137463255 1015 c sys/src/cmd/gs/src/gxdevice.h - 664 sys sys 1137462611 24696
+1137463255 1016 c sys/src/cmd/gs/src/gxdevmem.h - 664 sys sys 1137462611 11351
+1137463255 1017 c sys/src/cmd/gs/src/gxdevrop.h - 664 sys sys 1137462612 1019
+1137463255 1018 c sys/src/cmd/gs/src/x_.h - 664 sys sys 1137462785 6137
+1137463255 1019 c sys/src/cmd/gs/src/gxdht.h - 664 sys sys 1137462613 13670
+1137463255 1020 c sys/src/cmd/gs/src/gxdhtres.h - 664 sys sys 1137462613 1446
+1137463255 1021 c sys/src/cmd/gs/src/gxdither.h - 664 sys sys 1137462614 1709
+1137463255 1022 c sys/src/cmd/gs/src/gxfarith.h - 664 sys sys 1137462615 4571
+1137463255 1023 c sys/src/cmd/gs/src/gxfcache.h - 664 sys sys 1137462615 12191
+1137463255 1024 c sys/src/cmd/gs/src/gxfcmap.h - 664 sys sys 1137462616 11790
+1137463255 1025 c sys/src/cmd/gs/src/gxfill.c - 664 sys sys 1137462618 67755
+1137463255 1026 c sys/src/cmd/gs/src/gxfixed.h - 664 sys sys 1137462619 11211
+1137463255 1027 c sys/src/cmd/gs/src/gxfmap.h - 664 sys sys 1137462619 3893
+1137463255 1028 c sys/src/cmd/gs/src/gxfont.h - 664 sys sys 1137462620 18603
+1137463255 1029 c sys/src/cmd/gs/src/gxfont0.h - 664 sys sys 1137462620 2604
+1137463255 1030 c sys/src/cmd/gs/src/gxfont1.h - 664 sys sys 1137462620 5549
+1137463255 1031 c sys/src/cmd/gs/src/gxfont42.h - 664 sys sys 1137462621 5455
+1137463255 1032 c sys/src/cmd/gs/src/gxfrac.h - 664 sys sys 1137462621 3616
+1137463255 1033 c sys/src/cmd/gs/src/gxftype.h - 664 sys sys 1137462621 1662
+1137463255 1034 c sys/src/cmd/gs/src/gxfunc.h - 664 sys sys 1137462622 2700
+1137463255 1035 c sys/src/cmd/gs/src/gxgetbit.h - 664 sys sys 1137462622 3592
+1137463255 1036 c sys/src/cmd/gs/src/gxht.c - 664 sys sys 1137462624 28623
+1137463255 1037 c sys/src/cmd/gs/src/gxht.h - 664 sys sys 1137462624 8594
+1137463255 1038 c sys/src/cmd/gs/src/gxhtbit.c - 664 sys sys 1137462624 7921
+1137463255 1039 c sys/src/cmd/gs/src/gxhttile.h - 664 sys sys 1137462625 1539
+1137463255 1040 c sys/src/cmd/gs/src/gxhttype.h - 664 sys sys 1137462625 1628
+1137463255 1041 c sys/src/cmd/gs/src/gxi12bit.c - 664 sys sys 1137462625 10824
+1137463255 1042 c sys/src/cmd/gs/src/gxiclass.h - 664 sys sys 1137462626 2680
+1137463255 1043 c sys/src/cmd/gs/src/gxicolor.c - 664 sys sys 1137462626 13902
+1137463255 1044 c sys/src/cmd/gs/src/gxidata.c - 664 sys sys 1137462627 12808
+1137463255 1045 c sys/src/cmd/gs/src/gxifast.c - 664 sys sys 1137462627 21676
+1137463255 1046 c sys/src/cmd/gs/src/gximage.c - 664 sys sys 1137462629 14135
+1137463255 1047 c sys/src/cmd/gs/src/gximage.h - 664 sys sys 1137462629 11528
+1137463255 1048 c sys/src/cmd/gs/src/gximage1.c - 664 sys sys 1137462629 6379
+1137463255 1049 c sys/src/cmd/gs/src/gximage2.c - 664 sys sys 1137462630 10287
+1137463255 1050 c sys/src/cmd/gs/src/gximage3.c - 664 sys sys 1137462630 24843
+1137463255 1051 c sys/src/cmd/gs/src/gximage4.c - 664 sys sys 1137462631 4648
+1137463255 1052 c sys/src/cmd/gs/src/gximono.c - 664 sys sys 1137462631 14907
+1137463255 1053 c sys/src/cmd/gs/src/gxino12b.c - 664 sys sys 1137462632 874
+1137463255 1054 c sys/src/cmd/gs/src/gxiodev.h - 664 sys sys 1137462632 7069
+1137463255 1055 c sys/src/cmd/gs/src/gxiparam.h - 664 sys sys 1137462633 8641
+1137463255 1056 c sys/src/cmd/gs/src/gxipixel.c - 664 sys sys 1137462633 26216
+1137463255 1057 c sys/src/cmd/gs/src/gxiscale.c - 664 sys sys 1137462634 10271
+1137463255 1058 c sys/src/cmd/gs/src/gxistate.h - 664 sys sys 1137462634 10901
+1137463255 1059 c sys/src/cmd/gs/src/gxline.h - 664 sys sys 1137462634 2749
+1137463255 1060 c sys/src/cmd/gs/src/gxlum.h - 664 sys sys 1137462634 1064
+1137463255 1061 c sys/src/cmd/gs/src/gxmatrix.h - 664 sys sys 1137462635 3815
+1137463255 1062 c sys/src/cmd/gs/src/gxmclip.c - 664 sys sys 1137462635 3391
+1137463255 1063 c sys/src/cmd/gs/src/gxmclip.h - 664 sys sys 1137462636 3678
+1137463255 1064 c sys/src/cmd/gs/src/gxobj.h - 664 sys sys 1137462636 6108
+1137463255 1065 c sys/src/cmd/gs/src/gxp1fill.c - 664 sys sys 1137462637 12627
+1137463255 1066 c sys/src/cmd/gs/src/gxp1impl.h - 664 sys sys 1137462637 1556
+1137463255 1067 c sys/src/cmd/gs/src/gxpageq.c - 664 sys sys 1137462637 10786
+1137463255 1068 c sys/src/cmd/gs/src/gxpageq.h - 664 sys sys 1137462638 10909
+1137463255 1069 c sys/src/cmd/gs/src/gxpaint.c - 664 sys sys 1137462638 2913
+1137463255 1070 c sys/src/cmd/gs/src/gxpaint.h - 664 sys sys 1137462638 4040
+1137463255 1071 c sys/src/cmd/gs/src/gxpath.c - 664 sys sys 1137462639 28715
+1137463255 1072 c sys/src/cmd/gs/src/gxpath.h - 664 sys sys 1137462639 13371
+1137463255 1073 c sys/src/cmd/gs/src/gxpath2.c - 664 sys sys 1137462640 14456
+1137463255 1074 c sys/src/cmd/gs/src/gxpcache.h - 664 sys sys 1137462640 1723
+1137463255 1075 c sys/src/cmd/gs/src/gxpcmap.c - 664 sys sys 1137462641 22457
+1137463255 1076 c sys/src/cmd/gs/src/gxpcolor.h - 664 sys sys 1137462641 8746
+1137463255 1077 c sys/src/cmd/gs/src/gxpcopy.c - 664 sys sys 1137462641 22721
+1137463255 1078 c sys/src/cmd/gs/src/gxpdash.c - 664 sys sys 1137462642 5709
+1137463255 1079 c sys/src/cmd/gs/src/gxpflat.c - 664 sys sys 1137462642 20274
+1137463255 1080 c sys/src/cmd/gs/src/gxropc.h - 664 sys sys 1137462642 1568
+1137463255 1081 c sys/src/cmd/gs/src/gxrplane.h - 664 sys sys 1137462643 1739
+1137463255 1082 c sys/src/cmd/gs/src/gxsample.c - 664 sys sys 1137462643 3737
+1137463255 1083 c sys/src/cmd/gs/src/gxsample.h - 664 sys sys 1137462644 2996
+1137463255 1084 c sys/src/cmd/gs/src/gxshade.c - 664 sys sys 1137462644 10470
+1137463255 1085 c sys/src/cmd/gs/src/gxshade.h - 664 sys sys 1137462645 7849
+1137463255 1086 c sys/src/cmd/gs/src/gxshade1.c - 664 sys sys 1137462645 23890
+1137463255 1087 c sys/src/cmd/gs/src/gxshade4.c - 664 sys sys 1137462645 6127
+1137463255 1088 c sys/src/cmd/gs/src/gxshade4.h - 664 sys sys 1137462646 6714
+1137463255 1089 c sys/src/cmd/gs/src/gxshade6.c - 664 sys sys 1137462647 118438
+1137463255 1090 c sys/src/cmd/gs/src/gxstate.h - 664 sys sys 1137462647 2939
+1137463255 1091 c sys/src/cmd/gs/src/gxstroke.c - 664 sys sys 1137462648 46693
+1137463255 1092 c sys/src/cmd/gs/src/gxsync.c - 664 sys sys 1137462649 4274
+1137463255 1093 c sys/src/cmd/gs/src/gxsync.h - 664 sys sys 1137462649 2653
+1137463255 1094 c sys/src/cmd/gs/src/gxtext.h - 664 sys sys 1137462649 12063
+1137463255 1095 c sys/src/cmd/gs/src/gxtmap.h - 664 sys sys 1137462650 1791
+1137463255 1096 c sys/src/cmd/gs/src/gxtype1.c - 664 sys sys 1137462651 18022
+1137463255 1097 c sys/src/cmd/gs/src/gxtype1.h - 664 sys sys 1137462652 8578
+1137463255 1098 c sys/src/cmd/gs/src/gxxfont.h - 664 sys sys 1137462653 6394
+1137463255 1099 c sys/src/cmd/gs/src/gzacpath.h - 664 sys sys 1137462653 2063
+1137463255 1100 c sys/src/cmd/gs/src/gzcpath.h - 664 sys sys 1137462653 4001
+1137463255 1101 c sys/src/cmd/gs/src/gzht.h - 664 sys sys 1137462654 10342
+1137463255 1102 c sys/src/cmd/gs/src/gzline.h - 664 sys sys 1137462654 1353
+1137463255 1103 c sys/src/cmd/gs/src/gzpath.h - 664 sys sys 1137462654 14612
+1137463255 1104 c sys/src/cmd/gs/src/gzstate.h - 664 sys sys 1137462655 5466
+1137463255 1105 c sys/src/cmd/gs/src/ialloc.c - 664 sys sys 1137462655 11230
+1137463255 1106 c sys/src/cmd/gs/src/ialloc.h - 664 sys sys 1137462656 4352
+1137463255 1107 c sys/src/cmd/gs/src/iastate.h - 664 sys sys 1137462657 974
+1137463255 1108 c sys/src/cmd/gs/src/iastruct.h - 664 sys sys 1137462657 916
+1137463255 1109 c sys/src/cmd/gs/src/ibnum.c - 664 sys sys 1137462658 6003
+1137463255 1110 c sys/src/cmd/gs/src/ibnum.h - 664 sys sys 1137462658 2887
+1137463255 1111 c sys/src/cmd/gs/src/iccfont.c - 664 sys sys 1137462658 9948
+1137463255 1112 c sys/src/cmd/gs/src/iccinit0.c - 664 sys sys 1137462658 938
+1137463255 1113 c sys/src/cmd/gs/src/icfontab.c - 664 sys sys 1137462659 1467
+1137463255 1114 c sys/src/cmd/gs/src/ichar.h - 664 sys sys 1137462659 2926
+1137463255 1115 c sys/src/cmd/gs/src/ichar1.h - 664 sys sys 1137462660 2126
+1137463255 1116 c sys/src/cmd/gs/src/icharout.h - 664 sys sys 1137462660 2570
+1137463255 1117 c sys/src/cmd/gs/src/icie.h - 664 sys sys 1137462661 3612
+1137463255 1118 c sys/src/cmd/gs/src/icolor.h - 664 sys sys 1137462661 1995
+1137463255 1119 c sys/src/cmd/gs/src/iconf.c - 664 sys sys 1137462661 2969
+1137463255 1120 c sys/src/cmd/gs/src/icontext.c - 664 sys sys 1137462662 9502
+1137463255 1121 c sys/src/cmd/gs/src/icontext.h - 664 sys sys 1137462663 1934
+1137463255 1122 c sys/src/cmd/gs/src/icremap.h - 664 sys sys 1137462663 1502
+1137463255 1123 c sys/src/cmd/gs/src/icsmap.h - 664 sys sys 1137462664 1700
+1137463255 1124 c sys/src/cmd/gs/src/icstate.h - 664 sys sys 1137462664 2847
+1137463255 1125 c sys/src/cmd/gs/src/iddict.h - 664 sys sys 1137462664 1665
+1137463255 1126 c sys/src/cmd/gs/src/iddstack.h - 664 sys sys 1137462665 1338
+1137463255 1127 c sys/src/cmd/gs/src/idebug.c - 664 sys sys 1137462665 8317
+1137463255 1128 c sys/src/cmd/gs/src/idebug.h - 664 sys sys 1137462665 1714
+1137463255 1129 c sys/src/cmd/gs/src/idict.c - 664 sys sys 1137462665 26536
+1137463255 1130 c sys/src/cmd/gs/src/idict.h - 664 sys sys 1137462666 10036
+1137463255 1131 c sys/src/cmd/gs/src/idictdef.h - 664 sys sys 1137462666 4876
+1137463255 1132 c sys/src/cmd/gs/src/idosave.h - 664 sys sys 1137462667 1592
+1137463255 1133 c sys/src/cmd/gs/src/idparam.c - 664 sys sys 1137462667 11476
+1137463255 1134 c sys/src/cmd/gs/src/idparam.h - 664 sys sys 1137462668 4493
+1137463255 1135 c sys/src/cmd/gs/src/idsdata.h - 664 sys sys 1137462668 2989
+1137463255 1136 c sys/src/cmd/gs/src/idstack.c - 664 sys sys 1137462669 7388
+1137463255 1137 c sys/src/cmd/gs/src/idstack.h - 664 sys sys 1137462669 2343
+1137463255 1138 c sys/src/cmd/gs/src/iesdata.h - 664 sys sys 1137462669 1938
+1137463255 1139 c sys/src/cmd/gs/src/iestack.h - 664 sys sys 1137462670 1351
+1137463255 1140 c sys/src/cmd/gs/src/ifilter.h - 664 sys sys 1137462671 3282
+1137463255 1141 c sys/src/cmd/gs/src/ifilter2.h - 664 sys sys 1137462671 1115
+1137463255 1142 c sys/src/cmd/gs/src/ifont.h - 664 sys sys 1137462672 3703
+1137463255 1143 c sys/src/cmd/gs/src/ifont1.h - 664 sys sys 1137462672 2282
+1137463255 1144 c sys/src/cmd/gs/src/ifrpred.h - 664 sys sys 1137462673 1004
+1137463255 1145 c sys/src/cmd/gs/src/ifunc.h - 664 sys sys 1137462673 2769
+1137463255 1146 c sys/src/cmd/gs/src/ifwpred.h - 664 sys sys 1137462674 1007
+1137463255 1147 c sys/src/cmd/gs/src/igc.c - 664 sys sys 1137462675 37315
+1137463255 1148 c sys/src/cmd/gs/src/igc.h - 664 sys sys 1137462676 3332
+1137463255 1149 c sys/src/cmd/gs/src/igcref.c - 664 sys sys 1137462677 21549
+1137463255 1150 c sys/src/cmd/gs/src/igcstr.c - 664 sys sys 1137462677 11594
+1137463255 1151 c sys/src/cmd/gs/src/igcstr.h - 664 sys sys 1137462678 1341
+1137463255 1152 c sys/src/cmd/gs/src/igstate.h - 664 sys sys 1137462680 7810
+1137463255 1153 c sys/src/cmd/gs/src/iht.h - 664 sys sys 1137462680 1084
+1137463255 1154 c sys/src/cmd/gs/src/iimage.h - 664 sys sys 1137462680 1985
+1137463255 1155 c sys/src/cmd/gs/src/iimage2.h - 664 sys sys 1137462681 1283
+1137463255 1156 c sys/src/cmd/gs/src/iinit.c - 664 sys sys 1137462682 14193
+1137463255 1157 c sys/src/cmd/gs/src/iinit.h - 664 sys sys 1137462683 1311
+1137463255 1158 c sys/src/cmd/gs/src/ilevel.h - 664 sys sys 1137462683 1101
+1137463255 1159 c sys/src/cmd/gs/src/ilocate.c - 664 sys sys 1137462684 16348
+1137463255 1160 c sys/src/cmd/gs/src/imain.c - 664 sys sys 1137462684 28038
+1137463255 1161 c sys/src/cmd/gs/src/imain.h - 664 sys sys 1137462684 9565
+1137463255 1162 c sys/src/cmd/gs/src/imainarg.c - 664 sys sys 1137462685 28643
+1137463255 1163 c sys/src/cmd/gs/src/imainarg.h - 664 sys sys 1137462685 1597
+1137463255 1164 c sys/src/cmd/gs/src/imemory.h - 664 sys sys 1137462686 3595
+1137463255 1165 c sys/src/cmd/gs/src/iminst.h - 664 sys sys 1137462686 3730
+1137463255 1166 c sys/src/cmd/gs/src/iname.c - 664 sys sys 1137462687 18273
+1137463255 1167 c sys/src/cmd/gs/src/iname.h - 664 sys sys 1137462687 3299
+1137463255 1168 c sys/src/cmd/gs/src/inamedef.h - 664 sys sys 1137462687 6350
+1137463255 1169 c sys/src/cmd/gs/src/inameidx.h - 664 sys sys 1137462688 3279
+1137463255 1170 c sys/src/cmd/gs/src/inames.h - 664 sys sys 1137462688 4077
+1137463255 1171 c sys/src/cmd/gs/src/inamestr.h - 664 sys sys 1137462688 3855
+1137463255 1172 c sys/src/cmd/gs/src/inobtokn.c - 664 sys sys 1137462689 1003
+1137463255 1173 c sys/src/cmd/gs/src/inouparm.c - 664 sys sys 1137462689 935
+1137463255 1174 c sys/src/cmd/gs/src/instcopy - 775 sys sys 1137462689 1024
+1137463255 1175 c sys/src/cmd/gs/src/int.mak - 664 sys sys 1137462690 83476
+1137463255 1176 c sys/src/cmd/gs/src/interp.c - 664 sys sys 1137462691 53665
+1137463255 1177 c sys/src/cmd/gs/src/interp.h - 664 sys sys 1137462691 3002
+1137463255 1178 c sys/src/cmd/gs/src/iosdata.h - 664 sys sys 1137462691 1278
+1137463255 1179 c sys/src/cmd/gs/src/iostack.h - 664 sys sys 1137462692 990
+1137463255 1180 c sys/src/cmd/gs/src/ipacked.h - 664 sys sys 1137462692 5610
+1137463255 1181 c sys/src/cmd/gs/src/iparam.c - 664 sys sys 1137462692 33624
+1137463255 1182 c sys/src/cmd/gs/src/iparam.h - 664 sys sys 1137462693 4326
+1137463255 1183 c sys/src/cmd/gs/src/iparray.h - 664 sys sys 1137462693 1304
+1137463255 1184 c sys/src/cmd/gs/src/ipcolor.h - 664 sys sys 1137462694 1428
+1137463255 1185 c sys/src/cmd/gs/src/ireclaim.c - 664 sys sys 1137462694 5490
+1137463255 1186 c sys/src/cmd/gs/src/iref.h - 664 sys sys 1137462695 20804
+1137463255 1187 c sys/src/cmd/gs/src/isave.c - 664 sys sys 1137462695 34386
+1137463255 1188 c sys/src/cmd/gs/src/isave.h - 664 sys sys 1137462696 4762
+1137463255 1189 c sys/src/cmd/gs/src/iscan.c - 664 sys sys 1137462696 30159
+1137463255 1190 c sys/src/cmd/gs/src/iscan.h - 664 sys sys 1137462696 6367
+1137463255 1191 c sys/src/cmd/gs/src/iscanbin.c - 664 sys sys 1137462697 24416
+1137463255 1192 c sys/src/cmd/gs/src/iscanbin.h - 664 sys sys 1137462697 1352
+1137463255 1193 c sys/src/cmd/gs/src/iscannum.c - 664 sys sys 1137462698 9762
+1137463255 1194 c sys/src/cmd/gs/src/iscannum.h - 664 sys sys 1137462698 1205
+1137463255 1195 c sys/src/cmd/gs/src/isdata.h - 664 sys sys 1137462698 4111
+1137463255 1196 c sys/src/cmd/gs/src/isstate.h - 664 sys sys 1137462699 1382
+1137463255 1197 c sys/src/cmd/gs/src/istack.c - 664 sys sys 1137462699 18496
+1137463255 1198 c sys/src/cmd/gs/src/istack.h - 664 sys sys 1137462700 6808
+1137463255 1199 c sys/src/cmd/gs/src/istkparm.h - 664 sys sys 1137462700 1665
+1137463255 1200 c sys/src/cmd/gs/src/istream.h - 664 sys sys 1137462700 1378
+1137463255 1201 c sys/src/cmd/gs/src/istruct.h - 664 sys sys 1137462701 3418
+1137463255 1202 c sys/src/cmd/gs/src/iutil.c - 664 sys sys 1137462702 24604
+1137463255 1203 c sys/src/cmd/gs/src/iutil.h - 664 sys sys 1137462703 6120
+1137463255 1204 c sys/src/cmd/gs/src/iutil2.c - 664 sys sys 1137462704 4391
+1137463255 1205 c sys/src/cmd/gs/src/iutil2.h - 664 sys sys 1137462705 1773
+1137463255 1206 c sys/src/cmd/gs/src/iutilasm.asm - 664 sys sys 1137462706 12294
+1137463255 1207 c sys/src/cmd/gs/src/ivmem2.h - 664 sys sys 1137462706 963
+1137463255 1208 c sys/src/cmd/gs/src/ivmspace.h - 664 sys sys 1137462707 4474
+1137463255 1209 c sys/src/cmd/gs/src/jerror_.h - 664 sys sys 1137462709 903
+1137463255 1210 c sys/src/cmd/gs/src/jpeg.mak - 664 sys sys 1137462712 15307
+1137463255 1211 c sys/src/cmd/gs/src/lib.mak - 664 sys sys 1137462716 110130
+1137463255 1212 c sys/src/cmd/gs/src/libpng.mak - 664 sys sys 1137462717 5416
+1137463255 1213 c sys/src/cmd/gs/src/main.h - 664 sys sys 1137462721 3392
+1137463255 1214 c sys/src/cmd/gs/src/malloc_.h - 664 sys sys 1137462721 1903
+1137463255 1215 c sys/src/cmd/gs/src/math_.h - 664 sys sys 1137462722 2742
+1137463255 1216 c sys/src/cmd/gs/src/md5.c - 664 sys sys 1137462722 12434
+1137463255 1217 c sys/src/cmd/gs/src/md5.h - 664 sys sys 1137462723 3392
+1137463255 1218 c sys/src/cmd/gs/src/memory_.h - 664 sys sys 1137462723 3953
+1137463255 1219 c sys/src/cmd/gs/src/msvc32.mak - 664 sys sys 1137462724 23516
+1137463255 1220 c sys/src/cmd/gs/src/msvccmd.mak - 664 sys sys 1137462725 5247
+1137463255 1221 c sys/src/cmd/gs/src/msvclib.mak - 664 sys sys 1137462725 13279
+1137463255 1222 c sys/src/cmd/gs/src/msvctail.mak - 664 sys sys 1137462725 3101
+1137463255 1223 c sys/src/cmd/gs/src/mv.bat - 775 sys sys 1137462726 69
+1137463255 1224 c sys/src/cmd/gs/src/mv.cmd - 775 sys sys 1137462726 69
+1137463255 1225 c sys/src/cmd/gs/src/oparc.h - 664 sys sys 1137462727 1048
+1137463255 1226 c sys/src/cmd/gs/src/opcheck.h - 664 sys sys 1137462727 3021
+1137463255 1227 c sys/src/cmd/gs/src/opdef.h - 664 sys sys 1137462728 5399
+1137463255 1228 c sys/src/cmd/gs/src/openvms.mak - 664 sys sys 1137462728 16947
+1137463255 1229 c sys/src/cmd/gs/src/openvms.mmk - 664 sys sys 1137462729 17347
+1137463255 1230 c sys/src/cmd/gs/src/oper.h - 664 sys sys 1137462729 4321
+1137463255 1231 c sys/src/cmd/gs/src/opextern.h - 664 sys sys 1137462730 4423
+1137463255 1232 c sys/src/cmd/gs/src/ostack.h - 664 sys sys 1137462731 3216
+1137463255 1233 c sys/src/cmd/gs/src/pcwin.mak - 664 sys sys 1137462731 4005
+1137463255 1234 c sys/src/cmd/gs/src/pipe_.h - 664 sys sys 1137462731 1667
+1137463255 1235 c sys/src/cmd/gs/src/png_.h - 664 sys sys 1137462733 884
+1137463255 1236 c sys/src/cmd/gs/src/rm.bat - 775 sys sys 1137462733 162
+1137463255 1237 c sys/src/cmd/gs/src/rm.cmd - 775 sys sys 1137462733 150
+1137463255 1238 c sys/src/cmd/gs/src/sa85d.c - 664 sys sys 1137462734 4506
+1137463255 1239 c sys/src/cmd/gs/src/sa85d.h - 664 sys sys 1137462734 1468
+1137463255 1240 c sys/src/cmd/gs/src/sa85x.h - 664 sys sys 1137462735 1434
+1137463255 1241 c sys/src/cmd/gs/src/sbcp.c - 664 sys sys 1137462736 5469
+1137463255 1242 c sys/src/cmd/gs/src/sbhc.c - 664 sys sys 1137462736 7616
+1137463255 1243 c sys/src/cmd/gs/src/sbhc.h - 664 sys sys 1137462737 2934
+1137463255 1244 c sys/src/cmd/gs/src/sbtx.h - 664 sys sys 1137462737 1361
+1137463255 1245 c sys/src/cmd/gs/src/sbwbs.c - 664 sys sys 1137462737 13997
+1137463255 1246 c sys/src/cmd/gs/src/sbwbs.h - 664 sys sys 1137462738 2796
+1137463255 1247 c sys/src/cmd/gs/src/unixansi.mak - 664 sys sys 1137462775 14168
+1137463255 1248 c sys/src/cmd/gs/src/scanchar.h - 664 sys sys 1137462738 2565
+1137463255 1249 c sys/src/cmd/gs/src/scantab.c - 664 sys sys 1137462739 4339
+1137463255 1250 c sys/src/cmd/gs/src/scf.h - 664 sys sys 1137462739 7015
+1137463255 1251 c sys/src/cmd/gs/src/scfd.c - 664 sys sys 1137462740 24056
+1137463255 1252 c sys/src/cmd/gs/src/scfdgen.c - 664 sys sys 1137462740 8103
+1137463255 1253 c sys/src/cmd/gs/src/scfdtab.c - 664 sys sys 1137462740 11427
+1137463255 1254 c sys/src/cmd/gs/src/scfe.c - 664 sys sys 1137462741 15011
+1137463255 1255 c sys/src/cmd/gs/src/scfetab.c - 664 sys sys 1137462741 5940
+1137463255 1256 c sys/src/cmd/gs/src/scfparam.c - 664 sys sys 1137462741 3189
+1137463255 1257 c sys/src/cmd/gs/src/scfx.h - 664 sys sys 1137462742 4676
+1137463255 1258 c sys/src/cmd/gs/src/scommon.h - 664 sys sys 1137462742 6459
+1137463255 1259 c sys/src/cmd/gs/src/sdcparam.c - 664 sys sys 1137462742 17747
+1137463255 1260 c sys/src/cmd/gs/src/sdcparam.h - 664 sys sys 1137462743 1856
+1137463255 1261 c sys/src/cmd/gs/src/sdct.h - 664 sys sys 1137462743 5439
+1137463255 1262 c sys/src/cmd/gs/src/sdctc.c - 664 sys sys 1137462744 1437
+1137463255 1263 c sys/src/cmd/gs/src/sdctd.c - 664 sys sys 1137462744 8872
+1137463255 1264 c sys/src/cmd/gs/src/sdcte.c - 664 sys sys 1137462744 6707
+1137463255 1265 c sys/src/cmd/gs/src/sddparam.c - 664 sys sys 1137462745 2127
+1137463255 1266 c sys/src/cmd/gs/src/sdeparam.c - 664 sys sys 1137462745 9837
+1137463255 1267 c sys/src/cmd/gs/src/seexec.c - 664 sys sys 1137462745 6187
+1137463255 1268 c sys/src/cmd/gs/src/sfilter.h - 664 sys sys 1137462745 4272
+1137463255 1269 c sys/src/cmd/gs/src/sfilter1.c - 664 sys sys 1137462746 7183
+1137463255 1270 c sys/src/cmd/gs/src/sfilter2.c - 664 sys sys 1137462746 6810
+1137463255 1271 c sys/src/cmd/gs/src/sfxboth.c - 664 sys sys 1137462746 879
+1137463255 1272 c sys/src/cmd/gs/src/sfxfd.c - 664 sys sys 1137462747 10801
+1137463255 1273 c sys/src/cmd/gs/src/sfxstdio.c - 664 sys sys 1137462747 8235
+1137463255 1274 c sys/src/cmd/gs/src/shc.c - 664 sys sys 1137462748 1791
+1137463255 1275 c sys/src/cmd/gs/src/shc.h - 664 sys sys 1137462748 8062
+1137463255 1276 c sys/src/cmd/gs/src/shcgen.c - 664 sys sys 1137462748 14584
+1137463255 1277 c sys/src/cmd/gs/src/shcgen.h - 664 sys sys 1137462749 2197
+1137463255 1278 c sys/src/cmd/gs/src/siinterp.c - 664 sys sys 1137462749 8200
+1137463255 1279 c sys/src/cmd/gs/src/siinterp.h - 664 sys sys 1137462749 959
+1137463255 1280 c sys/src/cmd/gs/src/siscale.c - 664 sys sys 1137462750 19019
+1137463255 1281 c sys/src/cmd/gs/src/siscale.h - 664 sys sys 1137462751 968
+1137463255 1282 c sys/src/cmd/gs/src/sisparam.h - 664 sys sys 1137462751 2721
+1137463255 1283 c sys/src/cmd/gs/src/sjpeg.h - 664 sys sys 1137462752 2599
+1137463255 1284 c sys/src/cmd/gs/src/sjpegc.c - 664 sys sys 1137462752 7440
+1137463255 1285 c sys/src/cmd/gs/src/sjpegd.c - 664 sys sys 1137462752 2625
+1137463255 1286 c sys/src/cmd/gs/src/sjpege.c - 664 sys sys 1137462753 3259
+1137463255 1287 c sys/src/cmd/gs/src/slzwc.c - 664 sys sys 1137462754 1263
+1137463255 1288 c sys/src/cmd/gs/src/slzwd.c - 664 sys sys 1137462754 11606
+1137463255 1289 c sys/src/cmd/gs/src/slzwx.h - 664 sys sys 1137462755 2888
+1137463255 1290 c sys/src/cmd/gs/src/smtf.c - 664 sys sys 1137462756 4259
+1137463255 1291 c sys/src/cmd/gs/src/smtf.h - 664 sys sys 1137462756 1457
+1137463255 1292 c sys/src/cmd/gs/src/spdiff.c - 664 sys sys 1137462757 14890
+1137463255 1293 c sys/src/cmd/gs/src/spdiffx.h - 664 sys sys 1137462757 2130
+1137463255 1294 c sys/src/cmd/gs/src/spngp.c - 664 sys sys 1137462757 11139
+1137463255 1295 c sys/src/cmd/gs/src/spngpx.h - 664 sys sys 1137462758 2196
+1137463255 1296 c sys/src/cmd/gs/src/spprint.c - 664 sys sys 1137462758 5314
+1137463255 1297 c sys/src/cmd/gs/src/spprint.h - 664 sys sys 1137462759 3193
+1137463255 1298 c sys/src/cmd/gs/src/spsdf.c - 664 sys sys 1137462759 7176
+1137463255 1299 c sys/src/cmd/gs/src/spsdf.h - 664 sys sys 1137462759 3062
+1137463255 1300 c sys/src/cmd/gs/src/srdline.h - 664 sys sys 1137462760 1916
+1137463255 1301 c sys/src/cmd/gs/src/srld.c - 664 sys sys 1137462760 2899
+1137463255 1302 c sys/src/cmd/gs/src/srle.c - 664 sys sys 1137462760 4715
+1137463255 1303 c sys/src/cmd/gs/src/srlx.h - 664 sys sys 1137462761 2643
+1137463255 1304 c sys/src/cmd/gs/src/sstring.c - 664 sys sys 1137462761 10195
+1137463255 1305 c sys/src/cmd/gs/src/sstring.h - 664 sys sys 1137462762 2621
+1137463255 1306 c sys/src/cmd/gs/src/stat_.h - 664 sys sys 1137462762 2879
+1137463255 1307 c sys/src/cmd/gs/src/std.h - 664 sys sys 1137462762 13420
+1137463255 1308 c sys/src/cmd/gs/src/stdio_.h - 664 sys sys 1137462763 2086
+1137463255 1309 c sys/src/cmd/gs/src/stdpre.h - 664 sys sys 1137462764 14972
+1137463255 1310 c sys/src/cmd/gs/src/store.h - 664 sys sys 1137462764 10482
+1137463255 1311 c sys/src/cmd/gs/src/stream.c - 664 sys sys 1137462765 31913
+1137463255 1312 c sys/src/cmd/gs/src/stream.h - 664 sys sys 1137462765 14820
+1137463255 1313 c sys/src/cmd/gs/src/strimpl.h - 664 sys sys 1137462765 7445
+1137463255 1314 c sys/src/cmd/gs/src/string_.h - 664 sys sys 1137462766 1385
+1137463255 1315 c sys/src/cmd/gs/src/szlibc.c - 664 sys sys 1137462766 3667
+1137463255 1316 c sys/src/cmd/gs/src/szlibd.c - 664 sys sys 1137462766 3380
+1137463255 1317 c sys/src/cmd/gs/src/szlibe.c - 664 sys sys 1137462767 2955
+1137463255 1318 c sys/src/cmd/gs/src/szlibx.h - 664 sys sys 1137462767 1914
+1137463255 1319 c sys/src/cmd/gs/src/szlibxx.h - 664 sys sys 1137462767 2394
+1137463255 1320 c sys/src/cmd/gs/src/time_.h - 664 sys sys 1137462768 2924
+1137463255 1321 c sys/src/cmd/gs/src/ugcclib.mak - 664 sys sys 1137462773 4703
+1137463255 1322 c sys/src/cmd/gs/src/unix-aux.mak - 664 sys sys 1137462774 4654
+1137463255 1323 c sys/src/cmd/gs/src/unix-end.mak - 664 sys sys 1137462775 3506
+1137463255 1324 c sys/src/cmd/gs/src/unix-gcc.mak - 664 sys sys 1137462775 16505
+1137463255 1325 c sys/src/cmd/gs/src/unixhead.mak - 664 sys sys 1137462776 2018
+1137463255 1326 c sys/src/cmd/gs/src/unixlink.mak - 664 sys sys 1137462776 2871
+1137463255 1327 c sys/src/cmd/gs/src/version.mak - 664 sys sys 1137462777 1173
+1137463255 1328 c sys/src/cmd/gs/src/vmsmath.h - 664 sys sys 1137462778 1454
+1137463255 1329 c sys/src/cmd/gs/src/watclib.mak - 664 sys sys 1137462778 4212
+1137463255 1330 c sys/src/cmd/gs/src/watcw32.mak - 664 sys sys 1137462779 16652
+1137463255 1331 c sys/src/cmd/gs/src/wccommon.mak - 664 sys sys 1137462779 4602
+1137463255 1332 c sys/src/cmd/gs/src/wctail.mak - 664 sys sys 1137462780 3450
+1137463255 1333 c sys/src/cmd/gs/src/windows_.h - 664 sys sys 1137462781 1722
+1137463255 1334 c sys/src/cmd/gs/src/winint.mak - 775 sys sys 1137462781 11936
+1137463255 1335 c sys/src/cmd/gs/src/winlib.mak - 664 sys sys 1137462782 6367
+1137463255 1336 c sys/src/cmd/gs/src/winplat.mak - 664 sys sys 1137462782 1989
+1137463255 1337 c sys/src/cmd/gs/src/wmin.mak - 664 sys sys 1137462783 2823
+1137463255 1338 c sys/src/cmd/gs/src/zarith.c - 664 sys sys 1137462786 8869
+1137463255 1339 c sys/src/cmd/gs/src/zarray.c - 664 sys sys 1137462787 3249
+1137463255 1340 c sys/src/cmd/gs/src/zbfont.c - 664 sys sys 1137462789 24923
+1137463255 1341 c sys/src/cmd/gs/src/zbseq.c - 664 sys sys 1137462790 4237
+1137463255 1342 c sys/src/cmd/gs/src/zcfont.c - 664 sys sys 1137462791 5151
+1137463255 1343 c sys/src/cmd/gs/src/zchar.c - 664 sys sys 1137462792 24426
+1137463255 1344 c sys/src/cmd/gs/src/zchar1.c - 664 sys sys 1137462793 36915
+1137463255 1345 c sys/src/cmd/gs/src/zchar2.c - 664 sys sys 1137462794 1253
+1137463255 1346 c sys/src/cmd/gs/src/zchar32.c - 664 sys sys 1137462795 5638
+1137463255 1347 c sys/src/cmd/gs/src/zchar42.c - 664 sys sys 1137462796 6662
+1137463255 1348 c sys/src/cmd/gs/src/zcharout.c - 664 sys sys 1137462798 10903
+1137463255 1349 c sys/src/cmd/gs/src/zcharx.c - 664 sys sys 1137462799 4357
+1137463255 1350 c sys/src/cmd/gs/src/zcid.c - 664 sys sys 1137462799 6761
+1137463255 1351 c sys/src/cmd/gs/src/zcie.c - 664 sys sys 1137462802 21554
+1137463255 1352 c sys/src/cmd/gs/src/zcolor.c - 664 sys sys 1137462803 20290
+1137463255 1353 c sys/src/cmd/gs/src/zcolor1.c - 664 sys sys 1137462804 4820
+1137463255 1354 c sys/src/cmd/gs/src/zcolor2.c - 664 sys sys 1137462805 1606
+1137463255 1355 c sys/src/cmd/gs/src/zcontext.c - 664 sys sys 1137462808 37678
+1137463255 1356 c sys/src/cmd/gs/src/zcontrol.c - 664 sys sys 1137462809 26631
+1137463255 1357 c sys/src/cmd/gs/src/zcrd.c - 664 sys sys 1137462810 15370
+1137463255 1358 c sys/src/cmd/gs/src/zcsdevn.c - 664 sys sys 1137462811 4670
+1137463255 1359 c sys/src/cmd/gs/src/zcsindex.c - 664 sys sys 1137462812 6755
+1137463255 1360 c sys/src/cmd/gs/src/zcspixel.c - 664 sys sys 1137462814 1649
+1137463255 1361 c sys/src/cmd/gs/src/zcssepr.c - 664 sys sys 1137462815 5925
+1137463255 1362 c sys/src/cmd/gs/src/zdevcal.c - 664 sys sys 1137462816 2433
+1137463255 1363 c sys/src/cmd/gs/src/zdevice.c - 664 sys sys 1137462817 12818
+1137463255 1364 c sys/src/cmd/gs/src/zdevice2.c - 664 sys sys 1137462818 9894
+1137463255 1365 c sys/src/cmd/gs/src/zdict.c - 664 sys sys 1137462821 11414
+1137463255 1366 c sys/src/cmd/gs/src/zdosio.c - 664 sys sys 1137462822 2478
+1137463255 1367 c sys/src/cmd/gs/src/zdouble.c - 664 sys sys 1137462824 12419
+1137463255 1368 c sys/src/cmd/gs/src/zdpnext.c - 664 sys sys 1137462825 13204
+1137463255 1369 c sys/src/cmd/gs/src/zdps.c - 664 sys sys 1137462827 7109
+1137463255 1370 c sys/src/cmd/gs/src/zdps1.c - 664 sys sys 1137462828 11811
+1137463255 1371 c sys/src/cmd/gs/src/zfbcp.c - 664 sys sys 1137462832 2441
+1137463255 1372 c sys/src/cmd/gs/src/zfcmap.c - 664 sys sys 1137462836 14672
+1137463255 1373 c sys/src/cmd/gs/src/zfdctd.c - 664 sys sys 1137462837 3268
+1137463255 1374 c sys/src/cmd/gs/src/zfdcte.c - 664 sys sys 1137462838 4441
+1137463255 1375 c sys/src/cmd/gs/src/zfdecode.c - 664 sys sys 1137462839 9304
+1137463255 1376 c sys/src/cmd/gs/src/zfile.c - 664 sys sys 1137462841 41071
+1137463255 1377 c sys/src/cmd/gs/src/zfileio.c - 664 sys sys 1137462844 24833
+1137463255 1378 c sys/src/cmd/gs/src/zfilter.c - 664 sys sys 1137462846 12661
+1137463255 1379 c sys/src/cmd/gs/src/zfilter2.c - 664 sys sys 1137462846 3961
+1137463255 1380 c sys/src/cmd/gs/src/zfilterx.c - 664 sys sys 1137462848 9040
+1137463255 1381 c sys/src/cmd/gs/src/zfont.c - 664 sys sys 1137462851 17074
+1137463255 1382 c sys/src/cmd/gs/src/zfont0.c - 664 sys sys 1137462852 10205
+1137463255 1383 c sys/src/cmd/gs/src/zfont1.c - 664 sys sys 1137462854 11988
+1137463255 1384 c sys/src/cmd/gs/src/zfont2.c - 664 sys sys 1137462855 3429
+1137463255 1385 c sys/src/cmd/gs/src/zfont32.c - 664 sys sys 1137462857 2232
+1137463255 1386 c sys/src/cmd/gs/src/zfont42.c - 664 sys sys 1137462858 11043
+1137463255 1387 c sys/src/cmd/gs/src/zfproc.c - 664 sys sys 1137462859 11502
+1137463255 1388 c sys/src/cmd/gs/src/zfunc.c - 664 sys sys 1137462861 10140
+1137463255 1389 c sys/src/cmd/gs/src/zfunc0.c - 664 sys sys 1137462862 3097
+1137463255 1390 c sys/src/cmd/gs/src/zfunc3.c - 664 sys sys 1137462863 3683
+1137463255 1391 c sys/src/cmd/gs/src/zfunc4.c - 664 sys sys 1137462863 8546
+1137463255 1392 c sys/src/cmd/gs/src/zfzlib.c - 664 sys sys 1137462864 2820
+1137463255 1393 c sys/src/cmd/gs/src/zgeneric.c - 664 sys sys 1137462865 15428
+1137463255 1394 c sys/src/cmd/gs/src/zgstate.c - 664 sys sys 1137462866 13544
+1137463255 1395 c sys/src/cmd/gs/src/zhsb.c - 664 sys sys 1137462868 1621
+1137463255 1396 c sys/src/cmd/gs/src/zht.c - 664 sys sys 1137462868 7624
+1137463255 1397 c sys/src/cmd/gs/src/zht1.c - 664 sys sys 1137462870 4446
+1137463255 1398 c sys/src/cmd/gs/src/zht2.c - 664 sys sys 1137462871 15846
+1137463255 1399 c sys/src/cmd/gs/src/zimage.c - 664 sys sys 1137462874 17160
+1137463255 1400 c sys/src/cmd/gs/src/zimage2.c - 664 sys sys 1137462874 1445
+1137463255 1401 c sys/src/cmd/gs/src/zimage3.c - 664 sys sys 1137462875 4245
+1137463255 1402 c sys/src/cmd/gs/src/Makefile.in - 664 sys sys 1137462387 15660
+1137463255 1403 c sys/src/cmd/gs/src/configure.ac - 664 sys sys 1137462390 12189
+1137463255 1404 c sys/src/cmd/gs/src/dpmain.c - 664 sys sys 1137462393 29195
+1137463255 1405 c sys/src/cmd/gs/src/dscparse.c - 664 sys sys 1137462394 120737
+1137463255 1406 c sys/src/cmd/gs/src/dscparse.h - 664 sys sys 1137462394 18677
+1137463255 1407 c sys/src/cmd/gs/src/dwdll.c - 664 sys sys 1137462396 5816
+1137463255 1408 c sys/src/cmd/gs/src/dwimg.c - 664 sys sys 1137462396 46346
+1137463255 1409 c sys/src/cmd/gs/src/dwmain.c - 664 sys sys 1137462398 14102
+1137463255 1410 c sys/src/cmd/gs/src/dwmainc.c - 664 sys sys 1137462399 12295
+1137463255 1411 c sys/src/cmd/gs/src/dwnodll.c - 664 sys sys 1137462399 1540
+1137463255 1412 c sys/src/cmd/gs/src/dwreg.c - 664 sys sys 1137462399 3021
+1137463255 1413 c sys/src/cmd/gs/src/dwreg.h - 664 sys sys 1137462400 999
+1137463255 1414 c sys/src/cmd/gs/src/dwtext.c - 664 sys sys 1137462401 26876
+1137463255 1415 c sys/src/cmd/gs/src/dxmain.c - 664 sys sys 1137462403 31630
+1137463255 1416 c sys/src/cmd/gs/src/dxmainc.c - 775 sys sys 1137462404 3079
+1137463255 1417 c sys/src/cmd/gs/src/fcntl_.h - 664 sys sys 1137462406 1751
+1137463255 1418 c sys/src/cmd/gs/src/gconfig.c - 664 sys sys 1137462407 5494
+1137463255 1419 c sys/src/cmd/gs/src/gconfig.h - 664 sys sys 1137462407 6915
+1137463255 1420 c sys/src/cmd/gs/src/gconfig_.h - 664 sys sys 1137462407 132
+1137463255 1421 c sys/src/cmd/gs/src/gconfxx.h - 664 sys sys 1137462408 6915
+1137463255 1422 c sys/src/cmd/gs/src/gdevatx.c - 664 sys sys 1137462411 8384
+1137463255 1423 c sys/src/cmd/gs/src/gdevcfax.c - 664 sys sys 1137462416 6461
+1137463255 1424 c sys/src/cmd/gs/src/gdevdljm.c - 664 sys sys 1137462423 9675
+1137463255 1425 c sys/src/cmd/gs/src/gdevdljm.h - 664 sys sys 1137462423 4744
+1137463255 1426 c sys/src/cmd/gs/src/gdevdsp.c - 664 sys sys 1137462424 60679
+1137463255 1427 c sys/src/cmd/gs/src/gdevdsp.h - 664 sys sys 1137462425 10126
+1137463255 1428 c sys/src/cmd/gs/src/gdevdsp2.h - 664 sys sys 1137462425 1557
+1137463255 1429 c sys/src/cmd/gs/src/gdevfax.c - 664 sys sys 1137462427 8120
+1137463255 1430 c sys/src/cmd/gs/src/gdevfax.h - 664 sys sys 1137462427 2257
+1137463255 1431 c sys/src/cmd/gs/src/gdevifno.c - 664 sys sys 1137462428 17835
+1137463255 1432 c sys/src/cmd/gs/src/gdevijs.c - 664 sys sys 1137462429 32092
+1137463255 1433 c sys/src/cmd/gs/src/gdevmac.c - 775 sys sys 1137462434 23743
+1137463255 1434 c sys/src/cmd/gs/src/gdevmac.h - 775 sys sys 1137462435 5050
+1137463255 1435 c sys/src/cmd/gs/src/gdevplan9.c - 664 sys sys 1137462458 16262
+1137463255 1436 c sys/src/cmd/gs/src/gscdefs.c - 664 sys sys 1137462508 2600
+1137463255 1437 c sys/src/cmd/gs/src/iconfig.c - 664 sys sys 1137462662 2969
+1137463255 1438 c sys/src/cmd/gs/src/jconfig.h - 664 sys sys 1137462708 19233
+1137463255 1439 c sys/src/cmd/gs/src/jconfig0.h - 664 sys sys 1137462709 19233
+1137463255 1440 c sys/src/cmd/gs/src/jmcorig.h - 664 sys sys 1137462710 12458
+1137463255 1441 c sys/src/cmd/gs/src/jmorecf0.h - 664 sys sys 1137462711 1647
+1137463255 1442 c sys/src/cmd/gs/src/jmorecfg.h - 664 sys sys 1137462711 1647
+1137463255 1443 c sys/src/cmd/gs/src/jpeglib.h - 664 sys sys 1137462713 46205
+1137463255 1444 c sys/src/cmd/gs/src/jpeglib0.h - 664 sys sys 1137462713 46205
+1137463255 1445 c sys/src/cmd/gs/src/jpeglib_.h - 664 sys sys 1137462714 46205
+1137463255 1446 c sys/src/cmd/gs/src/ld.tr - 664 sys sys 1137462715 8608
+1137463255 1447 c sys/src/cmd/gs/src/plan9-aux.mak - 664 sys sys 1137462732 4658
+1137463255 1448 c sys/src/cmd/gs/src/plan9.mak - 664 sys sys 1137462732 14631
+1137463255 1449 c sys/src/cmd/gs/src/ziodev.c - 664 sys sys 1137462876 8795
+1137463255 1450 c sys/src/cmd/gs/src/ziodev2.c - 664 sys sys 1137462877 3731
+1137463255 1451 c sys/src/cmd/gs/src/zlib.mak - 664 sys sys 1137462883 6018
+1137463255 1452 c sys/src/cmd/gs/src/zmath.c - 664 sys sys 1137462884 6086
+1137463255 1453 c sys/src/cmd/gs/src/zmatrix.c - 664 sys sys 1137462885 8275
+1137463255 1454 c sys/src/cmd/gs/src/zmedia2.c - 664 sys sys 1137462887 16199
+1137463255 1455 c sys/src/cmd/gs/src/zmisc.c - 664 sys sys 1137462888 10683
+1137463255 1456 c sys/src/cmd/gs/src/zmisc1.c - 664 sys sys 1137462889 5013
+1137463255 1457 c sys/src/cmd/gs/src/zmisc2.c - 664 sys sys 1137462890 7910
+1137463255 1458 c sys/src/cmd/gs/src/zmisc3.c - 664 sys sys 1137462890 3285
+1137463255 1459 c sys/src/cmd/gs/src/zpacked.c - 664 sys sys 1137462891 6755
+1137463255 1460 c sys/src/cmd/gs/src/zpaint.c - 664 sys sys 1137462892 1995
+1137463255 1461 c sys/src/cmd/gs/src/zpath.c - 664 sys sys 1137462894 3692
+1137463255 1462 c sys/src/cmd/gs/src/zpath1.c - 664 sys sys 1137462895 6597
+1137463255 1463 c sys/src/cmd/gs/src/zpcolor.c - 664 sys sys 1137462896 9873
+1137463255 1464 c sys/src/cmd/gs/src/zrelbit.c - 664 sys sys 1137462898 7341
+1137463255 1465 c sys/src/cmd/gs/src/zrop.c - 664 sys sys 1137462899 2699
+1137463255 1466 c sys/src/cmd/gs/src/zshade.c - 664 sys sys 1137462899 19033
+1137463255 1467 c sys/src/cmd/gs/src/zstack.c - 664 sys sys 1137462900 6770
+1137463255 1468 c sys/src/cmd/gs/src/zstring.c - 664 sys sys 1137462901 5089
+1137463255 1469 c sys/src/cmd/gs/src/zsysvm.c - 664 sys sys 1137462902 4187
+1137463255 1470 c sys/src/cmd/gs/src/ztoken.c - 664 sys sys 1137462903 10266
+1137463255 1471 c sys/src/cmd/gs/src/ztrap.c - 664 sys sys 1137462904 1753
+1137463255 1472 c sys/src/cmd/gs/src/ztype.c - 664 sys sys 1137462906 12202
+1137463255 1473 c sys/src/cmd/gs/src/zupath.c - 664 sys sys 1137462907 16732
+1137463255 1474 c sys/src/cmd/gs/src/zusparam.c - 664 sys sys 1137462908 17728
+1137463255 1475 c sys/src/cmd/gs/src/zvmem.c - 664 sys sys 1137462908 11367
+1137463255 1476 c sys/src/cmd/gs/src/zvmem2.c - 664 sys sys 1137462909 3749
+1137463255 1477 c sys/src/cmd/gs/src/gdevmacpictop.h - 664 sys sys 1137462435 25223
+1137463255 1478 c sys/src/cmd/gs/src/gdevmacttf.h - 775 sys sys 1137462435 1618
+1137463255 1479 c sys/src/cmd/gs/src/gdevmacxf.c - 775 sys sys 1137462436 14591
+1137463255 1480 c sys/src/cmd/gs/src/gdevp14.c - 664 sys sys 1137462443 92374
+1137463255 1481 c sys/src/cmd/gs/src/gdevp14.h - 664 sys sys 1137462443 2473
+1137463255 1482 c sys/src/cmd/gs/src/gdevpdfb.c - 664 sys sys 1137462446 19786
+1137463255 1483 c sys/src/cmd/gs/src/gdevpdfc.c - 664 sys sys 1137462447 30863
+1137463255 1484 c sys/src/cmd/gs/src/gdevpdfg.c - 664 sys sys 1137462448 51317
+1137463255 1485 c sys/src/cmd/gs/src/gdevpdfg.h - 664 sys sys 1137462448 13315
+1137463255 1486 c sys/src/cmd/gs/src/gdevpdfj.c - 664 sys sys 1137462449 19203
+1137463255 1487 c sys/src/cmd/gs/src/gdevpdfv.c - 664 sys sys 1137462452 31216
+1137463255 1488 c sys/src/cmd/gs/src/gdevphex.c - 664 sys sys 1137462458 92822
+1137463255 1489 c sys/src/cmd/gs/src/gdevpnga.c - 664 sys sys 1137462460 31192
+1137463255 1490 c sys/src/cmd/gs/src/gdevpsdu.c - 664 sys sys 1137462465 13206
+1137463255 1491 c sys/src/cmd/gs/src/gdevpsf.h - 664 sys sys 1137462465 11262
+1137463255 1492 c sys/src/cmd/gs/src/gdevpsf1.c - 664 sys sys 1137462466 15788
+1137463255 1493 c sys/src/cmd/gs/src/gdevpsf2.c - 664 sys sys 1137462466 57164
+1137463255 1494 c sys/src/cmd/gs/src/gdevpsfm.c - 664 sys sys 1137462467 9339
+1137463255 1495 c sys/src/cmd/gs/src/gdevpsft.c - 664 sys sys 1137462467 34874
+1137463255 1496 c sys/src/cmd/gs/src/gdevpsfu.c - 664 sys sys 1137462467 9829
+1137463255 1497 c sys/src/cmd/gs/src/gdevpsfx.c - 664 sys sys 1137462468 23492
+1137463255 1498 c sys/src/cmd/gs/src/gdevpsu.c - 664 sys sys 1137462468 10087
+1137463255 1499 c sys/src/cmd/gs/src/gdevpsu.h - 664 sys sys 1137462469 2485
+1137463255 1500 c sys/src/cmd/gs/src/gdevtrac.c - 664 sys sys 1137462479 19772
+1137463255 1501 c sys/src/cmd/gs/src/gp_mac.c - 664 sys sys 1137462489 8429
+1137463255 1502 c sys/src/cmd/gs/src/gp_mac.h - 775 sys sys 1137462489 849
+1137463255 1503 c sys/src/cmd/gs/src/gp_macio.c - 664 sys sys 1137462490 27429
+1137463255 1504 c sys/src/cmd/gs/src/gp_msdll.c - 664 sys sys 1137462491 1585
+1137463255 1505 c sys/src/cmd/gs/src/gp_mspol.c - 664 sys sys 1137462492 1438
+1137463255 1506 c sys/src/cmd/gs/src/gp_msprn.c - 664 sys sys 1137462492 6302
+1137463255 1507 c sys/src/cmd/gs/src/gp_stdia.c - 664 sys sys 1137462495 1087
+1137463255 1508 c sys/src/cmd/gs/src/gp_stdin.c - 664 sys sys 1137462495 1345
+1137463255 1509 c sys/src/cmd/gs/src/gpmisc.c - 664 sys sys 1137462499 10821
+1137463255 1510 c sys/src/cmd/gs/src/gpmisc.h - 664 sys sys 1137462499 2423
+1137463255 1511 c sys/src/cmd/gs/src/gsbitcom.c - 664 sys sys 1137462505 9133
+1137463255 1512 c sys/src/cmd/gs/src/gscdevn.h - 664 sys sys 1137462510 2731
+1137463255 1513 c sys/src/cmd/gs/src/gscindex.h - 664 sys sys 1137462513 2978
+1137463255 1514 c sys/src/cmd/gs/src/gsdfilt.c - 664 sys sys 1137462525 3379
+1137463255 1515 c sys/src/cmd/gs/src/gsdfilt.h - 664 sys sys 1137462526 2974
+1137463255 1516 c sys/src/cmd/gs/src/gsfcid.c - 664 sys sys 1137462532 6468
+1137463255 1517 c sys/src/cmd/gs/src/gsfunc4.c - 664 sys sys 1137462538 22697
+1137463255 1518 c sys/src/cmd/gs/src/gsfunc4.h - 664 sys sys 1137462538 2751
+1137463255 1519 c sys/src/cmd/gs/src/gsicc.c - 664 sys sys 1137462543 23236
+1137463255 1520 c sys/src/cmd/gs/src/gsicc.h - 664 sys sys 1137462543 7824
+1137463255 1521 c sys/src/cmd/gs/src/gsiodevs.c - 664 sys sys 1137462545 3030
+1137463255 1522 c sys/src/cmd/gs/src/gsipar3x.h - 664 sys sys 1137462546 2748
+1137463255 1523 c sys/src/cmd/gs/src/gstparam.h - 664 sys sys 1137462574 4142
+1137463255 1524 c sys/src/cmd/gs/src/gstrans.c - 664 sys sys 1137462575 13056
+1137463255 1525 c sys/src/cmd/gs/src/gstrans.h - 664 sys sys 1137462575 6977
+1137463255 1526 c sys/src/cmd/gs/src/gxblend.c - 664 sys sys 1137462587 31736
+1137463255 1527 c sys/src/cmd/gs/src/gxblend.h - 664 sys sys 1137462588 8379
+1137463255 1528 c sys/src/cmd/gs/src/gxchrout.c - 664 sys sys 1137462590 2093
+1137463255 1529 c sys/src/cmd/gs/src/gxchrout.h - 664 sys sys 1137462590 1314
+1137463255 1530 c sys/src/cmd/gs/src/gxcid.h - 664 sys sys 1137462591 2000
+1137463255 1531 c sys/src/cmd/gs/src/gxfcid.h - 664 sys sys 1137462616 5598
+1137463255 1532 c sys/src/cmd/gs/src/gximag3x.c - 664 sys sys 1137462628 29008
+1137463255 1533 c sys/src/cmd/gs/src/gximag3x.h - 664 sys sys 1137462628 2874
+1137463255 1534 c sys/src/cmd/gs/src/gximage3.h - 664 sys sys 1137462631 2809
+1137463255 1535 c sys/src/cmd/gs/src/gxstdio.h - 664 sys sys 1137462647 1171
+1137463255 1536 c sys/src/cmd/gs/src/gxttf.h - 664 sys sys 1137462650 3966
+1137463255 1537 c sys/src/cmd/gs/src/iapi.c - 664 sys sys 1137462656 7706
+1137463255 1538 c sys/src/cmd/gs/src/iapi.h - 664 sys sys 1137462656 10173
+1137463255 1539 c sys/src/cmd/gs/src/icclib.mak - 664 sys sys 1137462659 2706
+1137463255 1540 c sys/src/cmd/gs/src/icid.h - 664 sys sys 1137462660 1764
+1137463255 1541 c sys/src/cmd/gs/src/iconf.h - 664 sys sys 1137462662 1179
+1137463255 1542 c sys/src/cmd/gs/src/idisp.c - 664 sys sys 1137462666 2913
+1137463255 1543 c sys/src/cmd/gs/src/idisp.h - 664 sys sys 1137462667 1103
+1137463255 1544 c sys/src/cmd/gs/src/ifcid.h - 664 sys sys 1137462670 1116
+1137463255 1545 c sys/src/cmd/gs/src/ifont2.h - 664 sys sys 1137462672 1159
+1137463255 1546 c sys/src/cmd/gs/src/ifont42.h - 664 sys sys 1137462673 2099
+1137463255 1547 c sys/src/cmd/gs/src/ijs.mak - 664 sys sys 1137462683 4244
+1137463255 1548 c sys/src/cmd/gs/src/itoken.h - 664 sys sys 1137462701 1605
+1137463255 1549 c sys/src/cmd/gs/src/macgenmcpxml.sh - 664 sys sys 1137462717 14834
+1137463255 1550 c sys/src/cmd/gs/src/macos-fw.mak - 664 sys sys 1137462718 6116
+1137463255 1551 c sys/src/cmd/gs/src/macos-mcp.mak - 664 sys sys 1137462718 14267
+1137463255 1552 c sys/src/cmd/gs/src/macosx.mak - 664 sys sys 1137462720 14629
+1137463255 1553 a sys/src/cmd/gs/src/dmmain.c - 664 sys sys 1137462392 28992
+1137463255 1554 a sys/src/cmd/gs/src/dmmain.r - 664 sys sys 1137462392 110116
+1137463255 1555 a sys/src/cmd/gs/src/dwtrace.c - 664 sys sys 1137462402 10110
+1137463255 1556 a sys/src/cmd/gs/src/dwtrace.h - 664 sys sys 1137462402 970
+1137463255 1557 a sys/src/cmd/gs/src/fapi_ft.c - 664 sys sys 1137462405 26794
+1137463255 1558 a sys/src/cmd/gs/src/fapiufst.c - 664 sys sys 1137462405 42373
+1137463255 1559 a sys/src/cmd/gs/src/gconfigd.h - 644 sys sys 1137462407 275
+1137463255 1560 a sys/src/cmd/gs/src/gdevddrw.h - 664 sys sys 1137462421 1375
+1137463255 1561 a sys/src/cmd/gs/src/gdevdevn.c - 664 sys sys 1137462421 49308
+1137463255 1562 a sys/src/cmd/gs/src/gdevdevn.h - 664 sys sys 1137462421 8630
+1137463255 1563 a sys/src/cmd/gs/src/gdevdsha.c - 664 sys sys 1137462424 3693
+1137463255 1564 a sys/src/cmd/gs/src/gdevm40.c - 664 sys sys 1137462433 13256
+1137463255 1565 a sys/src/cmd/gs/src/gdevm48.c - 664 sys sys 1137462433 12743
+1137463255 1566 a sys/src/cmd/gs/src/gdevm56.c - 664 sys sys 1137462434 14291
+1137463255 1567 a sys/src/cmd/gs/src/gdevm64.c - 664 sys sys 1137462434 11308
+1137463255 1568 a sys/src/cmd/gs/src/gdevpdfb.h - 775 sys sys 1137462447 7595
+1137463255 1569 a sys/src/cmd/gs/src/gdevpdfc.h - 664 sys sys 1137462447 2133
+1137463255 1570 a sys/src/cmd/gs/src/gdevpdfk.c - 664 sys sys 1137462449 23479
+1137463255 1571 a sys/src/cmd/gs/src/gdevpdt.c - 664 sys sys 1137462453 1859
+1137463255 1572 a sys/src/cmd/gs/src/gdevpdt.h - 664 sys sys 1137462453 3412
+1137463255 1573 a sys/src/cmd/gs/src/gdevpdtb.c - 664 sys sys 1137462453 20715
+1137463255 1574 a sys/src/cmd/gs/src/gdevpdtb.h - 664 sys sys 1137462453 5717
+1137463255 1575 a sys/src/cmd/gs/src/gdevpdtc.c - 664 sys sys 1137462453 21783
+1137463255 1576 a sys/src/cmd/gs/src/gdevpdtd.c - 664 sys sys 1137462454 20891
+1137463255 1577 a sys/src/cmd/gs/src/gdevpdtd.h - 664 sys sys 1137462454 5088
+1137463255 1578 a sys/src/cmd/gs/src/gdevpdte.c - 664 sys sys 1137462454 37159
+1137463255 1579 a sys/src/cmd/gs/src/gdevpdtf.c - 664 sys sys 1137462454 30646
+1137463255 1580 a sys/src/cmd/gs/src/gdevpdtf.h - 664 sys sys 1137462454 14295
+1137463255 1581 a sys/src/cmd/gs/src/gdevpdti.c - 664 sys sys 1137462455 28742
+1137463255 1582 a sys/src/cmd/gs/src/gdevpdti.h - 664 sys sys 1137462455 2472
+1137463255 1583 a sys/src/cmd/gs/src/gdevpdts.c - 664 sys sys 1137462455 18142
+1137463255 1584 a sys/src/cmd/gs/src/gdevpdts.h - 664 sys sys 1137462455 3879
+1137463255 1585 a sys/src/cmd/gs/src/gdevpdtt.c - 664 sys sys 1137462455 70911
+1137463255 1586 a sys/src/cmd/gs/src/gdevpdtt.h - 664 sys sys 1137462456 11088
+1137463255 1587 a sys/src/cmd/gs/src/gdevpdtv.c - 775 sys sys 1137462456 17487
+1137463255 1588 a sys/src/cmd/gs/src/gdevpdtv.h - 775 sys sys 1137462456 720
+1137463255 1589 a sys/src/cmd/gs/src/gdevpdtw.c - 664 sys sys 1137462456 22383
+1137463255 1590 a sys/src/cmd/gs/src/gdevpdtw.h - 664 sys sys 1137462456 2725
+1137463255 1591 a sys/src/cmd/gs/src/gdevpdtx.h - 664 sys sys 1137462456 3667
+1137463255 1592 a sys/src/cmd/gs/src/gdevperm.c - 664 sys sys 1137462457 14011
+1137463255 1593 a sys/src/cmd/gs/src/gdevpsd.c - 664 sys sys 1137462463 33306
+1137463255 1594 a sys/src/cmd/gs/src/gdevrinkj.c - 664 sys sys 1137462471 33523
+1137463255 1595 a sys/src/cmd/gs/src/gdevtsep.c - 664 sys sys 1137462479 31680
+1137463255 1596 a sys/src/cmd/gs/src/gdevxcf.c - 664 sys sys 1137462484 40526
+1137463255 1597 a sys/src/cmd/gs/src/gp_macpoll.c - 664 sys sys 1137462490 2251
+1137463255 1598 a sys/src/cmd/gs/src/gp_os2.h - 664 sys sys 1137462494 1318
+1137463255 1599 a sys/src/cmd/gs/src/gp_os2pr.c - 664 sys sys 1137462494 3810
+1137463255 1600 a sys/src/cmd/gs/src/gp_unix_cache.c - 664 sys sys 1137462497 13496
+1137463255 1601 a sys/src/cmd/gs/src/gs_dll_call.h - 664 sys sys 1137462501 1545
+1137463255 1602 a sys/src/cmd/gs/src/gscedata.c - 664 sys sys 1137462510 164496
+1137463255 1603 a sys/src/cmd/gs/src/gscedata.h - 664 sys sys 1137462510 1192
+1137463255 1604 a sys/src/cmd/gs/src/gscencs.c - 664 sys sys 1137462511 6865
+1137463255 1605 a sys/src/cmd/gs/src/gscencs.h - 664 sys sys 1137462511 2628
+1137463255 1606 a sys/src/cmd/gs/src/gsequivc.c - 664 sys sys 1137462530 16346
+1137463255 1607 a sys/src/cmd/gs/src/gsequivc.h - 664 sys sys 1137462531 1634
+1137463255 1608 a sys/src/cmd/gs/src/gsfcid2.c - 664 sys sys 1137462532 9482
+1137463255 1609 a sys/src/cmd/gs/src/gsfcmap1.c - 664 sys sys 1137462533 19816
+1137463255 1610 a sys/src/cmd/gs/src/gsfont0c.c - 664 sys sys 1137462536 4402
+1137463255 1611 a sys/src/cmd/gs/src/gsgcache.c - 664 sys sys 1137462539 7000
+1137463255 1612 c sys/src/cmd/gs/src/macsystypes.h - 775 sys sys 1137462720 1372
+1137463255 1613 c sys/src/cmd/gs/src/sarc4.c - 664 sys sys 1137462735 3596
+1137463255 1614 c sys/src/cmd/gs/src/sarc4.h - 664 sys sys 1137462735 1945
+1137463255 1615 c sys/src/cmd/gs/src/sbcp.h - 664 sys sys 1137462736 1615
+1137463255 1616 c sys/src/cmd/gs/src/smd5.c - 664 sys sys 1137462755 2229
+1137463255 1617 c sys/src/cmd/gs/src/smd5.h - 664 sys sys 1137462755 1409
+1137463255 1618 c sys/src/cmd/gs/src/unistd_.h - 664 sys sys 1137462774 1836
+1137463255 1619 c sys/src/cmd/gs/src/unix-dll.mak - 664 sys sys 1137462774 4743
+1137463255 1620 c sys/src/cmd/gs/src/vms_x_fix.h - 664 sys sys 1137462778 38651
+1137463255 1621 c sys/src/cmd/gs/src/zdfilter.c - 664 sys sys 1137462819 1515
+1137463255 1622 c sys/src/cmd/gs/src/zdscpars.c - 664 sys sys 1137462829 16086
+1137463255 1623 c sys/src/cmd/gs/src/zfarc4.c - 664 sys sys 1137462831 3167
+1137463255 1624 c sys/src/cmd/gs/src/zfcid.c - 664 sys sys 1137462833 2390
+1137463255 1625 c sys/src/cmd/gs/src/zfcid0.c - 664 sys sys 1137462834 17235
+1137463255 1626 c sys/src/cmd/gs/src/zfcid1.c - 664 sys sys 1137462835 12541
+1137463255 1627 c sys/src/cmd/gs/src/zfmd5.c - 664 sys sys 1137462850 1273
+1137463255 1628 c sys/src/cmd/gs/src/zfrsd.c - 664 sys sys 1137462860 7952
+1137463255 1629 c sys/src/cmd/gs/src/zicc.c - 664 sys sys 1137462873 6078
+1137463255 1630 c sys/src/cmd/gs/src/ziodevs.c - 664 sys sys 1137462878 7493
+1137463255 1631 c sys/src/cmd/gs/src/ziodevsc.c - 664 sys sys 1137462881 8418
+1137463255 1632 c sys/src/cmd/gs/src/ztrans.c - 664 sys sys 1137462904 12822
+1137463255 1633 a sys/src/cmd/gs/src/gsgcache.h - 664 sys sys 1137462539 1759
+1137463255 1634 a sys/src/cmd/gs/src/gsgdata.c - 664 sys sys 1137462539 4236
+1137463255 1635 a sys/src/cmd/gs/src/gsgdata.h - 664 sys sys 1137462539 4521
+1137463255 1636 a sys/src/cmd/gs/src/gsiodisk.c - 664 sys sys 1137462545 28520
+1137463255 1637 a sys/src/cmd/gs/src/gsiomacres.c - 664 sys sys 1137462546 12876
+1137463255 1638 a sys/src/cmd/gs/src/gsiorom.c - 664 sys sys 1137462546 3136
+1137463255 1639 a sys/src/cmd/gs/src/gslibctx.c - 664 sys sys 1137462549 3441
+1137463255 1640 a sys/src/cmd/gs/src/gslibctx.h - 664 sys sys 1137462550 2412
+1137463255 1641 a sys/src/cmd/gs/src/gsovrc.c - 664 sys sys 1137462557 38945
+1137463255 1642 a sys/src/cmd/gs/src/gsovrc.h - 664 sys sys 1137462557 15814
+1137463255 1643 a sys/src/cmd/gs/src/gsserial.c - 664 sys sys 1137462570 9527
+1137463255 1644 a sys/src/cmd/gs/src/gsserial.h - 664 sys sys 1137462570 10314
+1137463255 1645 a sys/src/cmd/gs/src/gswin.icx - 664 sys sys 1137462580 51217
+1137463255 1646 a sys/src/cmd/gs/src/gswin16.icx - 664 sys sys 1137462580 2190
+1137463255 1647 a sys/src/cmd/gs/src/gswts.c - 664 sys sys 1137462582 32197
+1137463255 1648 a sys/src/cmd/gs/src/gswts.h - 664 sys sys 1137462582 1784
+1137463255 1649 a sys/src/cmd/gs/src/gxdevndi.c - 664 sys sys 1137462612 9354
+1137463255 1650 a sys/src/cmd/gs/src/gxdevndi.h - 664 sys sys 1137462612 1428
+1137463255 1651 a sys/src/cmd/gs/src/gxdhtserial.c - 664 sys sys 1137462613 22268
+1137463255 1652 a sys/src/cmd/gs/src/gxdhtserial.h - 664 sys sys 1137462613 2880
+1137463255 1653 a sys/src/cmd/gs/src/gxdtfill.h - 664 sys sys 1137462614 12495
+1137463255 1654 a sys/src/cmd/gs/src/gxfapi.c - 664 sys sys 1137462614 2578
+1137463255 1655 a sys/src/cmd/gs/src/gxfapi.h - 664 sys sys 1137462615 1075
+1137463255 1656 a sys/src/cmd/gs/src/gxfcmap1.h - 664 sys sys 1137462616 4332
+1137463255 1657 a sys/src/cmd/gs/src/gxfcopy.c - 664 sys sys 1137462617 71890
+1137463255 1658 a sys/src/cmd/gs/src/gxfcopy.h - 664 sys sys 1137462617 6708
+1137463255 1659 a sys/src/cmd/gs/src/gxfdrop.c - 664 sys sys 1137462617 19459
+1137463255 1660 a sys/src/cmd/gs/src/gxfdrop.h - 664 sys sys 1137462617 5196
+1137463255 1661 a sys/src/cmd/gs/src/gxfill.h - 664 sys sys 1137462618 6547
+1137463255 1662 a sys/src/cmd/gs/src/gxfillsl.h - 664 sys sys 1137462618 6458
+1137463255 1663 a sys/src/cmd/gs/src/gxfilltr.h - 664 sys sys 1137462618 11588
+1137463255 1664 a sys/src/cmd/gs/src/gxfillts.h - 664 sys sys 1137462619 4992
+1137463255 1665 a sys/src/cmd/gs/src/gxfont0c.h - 664 sys sys 1137462620 1942
+1137463255 1666 a sys/src/cmd/gs/src/gxhintn.c - 664 sys sys 1137462623 98161
+1137463255 1667 a sys/src/cmd/gs/src/gxhintn.h - 664 sys sys 1137462623 8013
+1137463255 1668 a sys/src/cmd/gs/src/gxhldevc.c - 664 sys sys 1137462623 6573
+1137463255 1669 a sys/src/cmd/gs/src/gxhldevc.h - 664 sys sys 1137462623 7312
+1137463255 1670 a sys/src/cmd/gs/src/gxi16bit.c - 664 sys sys 1137462626 9367
+1137463255 1671 a sys/src/cmd/gs/src/gxino16b.c - 664 sys sys 1137462632 872
+1137463255 1672 a sys/src/cmd/gs/src/gxoprect.c - 664 sys sys 1137462636 21560
+1137463255 1673 a sys/src/cmd/gs/src/gxoprect.h - 664 sys sys 1137462636 2828
+1137463255 1674 a sys/src/cmd/gs/src/gxsamplp.h - 775 sys sys 1137462644 5840
+1137463255 1675 a sys/src/cmd/gs/src/gxttfb.c - 664 sys sys 1137462650 22589
+1137463255 1676 a sys/src/cmd/gs/src/gxttfb.h - 664 sys sys 1137462651 2497
+1137463255 1677 a sys/src/cmd/gs/src/gxwts.c - 664 sys sys 1137462652 16004
+1137463255 1678 a sys/src/cmd/gs/src/gxwts.h - 664 sys sys 1137462652 1871
+1137463255 1679 a sys/src/cmd/gs/src/gzspotan.c - 664 sys sys 1137462654 21909
+1137463255 1680 a sys/src/cmd/gs/src/gzspotan.h - 664 sys sys 1137462655 5318
+1137463255 1681 a sys/src/cmd/gs/src/ierrors.h - 664 sys sys 1137462669 4966
+1137463255 1682 a sys/src/cmd/gs/src/ifapi.h - 664 sys sys 1137462670 8221
+1137463255 1683 a sys/src/cmd/gs/src/iplugin.c - 664 sys sys 1137462694 3348
+1137463255 1684 a sys/src/cmd/gs/src/iplugin.h - 664 sys sys 1137462694 2690
+1137463255 1685 a sys/src/cmd/gs/src/jasper.mak - 664 sys sys 1137462707 11617
+1137463255 1686 a sys/src/cmd/gs/src/jbig2.mak - 664 sys sys 1137462708 7293
+1137463255 1687 a sys/src/cmd/gs/src/macos_carbon_d_pre.h - 664 sys sys 1137462719 991
+1137463255 1688 a sys/src/cmd/gs/src/macos_carbon_pre.h - 664 sys sys 1137462719 919
+1137463255 1689 a sys/src/cmd/gs/src/macos_classic_d_pre.h - 664 sys sys 1137462719 975
+1137463255 1690 a sys/src/cmd/gs/src/md5main.c - 664 sys sys 1137462723 4259
+1137463255 1691 a sys/src/cmd/gs/src/mkromfs.c - 664 sys sys 1137462724 5444
+1137463255 1692 a sys/src/cmd/gs/src/sjbig2.c - 664 sys sys 1137462751 8350
+1137463255 1693 a sys/src/cmd/gs/src/sjbig2.h - 664 sys sys 1137462751 1751
+1137463255 1694 a sys/src/cmd/gs/src/sjpx.c - 664 sys sys 1137462753 13298
+1137463255 1695 a sys/src/cmd/gs/src/sjpx.h - 664 sys sys 1137462753 2072
+1137463255 1696 a sys/src/cmd/gs/src/slzwe.c - 664 sys sys 1137462754 6124
+1137463255 1697 a sys/src/cmd/gs/src/stdint_.h - 664 sys sys 1137462763 3792
+1137463255 1698 a sys/src/cmd/gs/src/stdpn.h - 664 sys sys 1137462763 2331
+1137463255 1699 a sys/src/cmd/gs/src/ttcalc.c - 664 sys sys 1137462768 7218
+1137463255 1700 a sys/src/cmd/gs/src/ttcalc.h - 664 sys sys 1137462768 5050
+1137463255 1701 a sys/src/cmd/gs/src/ttcommon.h - 664 sys sys 1137462768 6990
+1137463255 1702 a sys/src/cmd/gs/src/ttconf.h - 664 sys sys 1137462769 2274
+1137463255 1703 a sys/src/cmd/gs/src/ttconfig.h - 664 sys sys 1137462769 8739
+1137463255 1704 a sys/src/cmd/gs/src/ttfinp.c - 664 sys sys 1137462769 1643
+1137463255 1705 a sys/src/cmd/gs/src/ttfinp.h - 664 sys sys 1137462769 1086
+1137463255 1706 a sys/src/cmd/gs/src/ttfmain.c - 664 sys sys 1137462770 31780
+1137463255 1707 a sys/src/cmd/gs/src/ttfmemd.c - 664 sys sys 1137462770 5739
+1137463255 1708 a sys/src/cmd/gs/src/ttfmemd.h - 664 sys sys 1137462770 1049
+1137463255 1709 a sys/src/cmd/gs/src/ttfoutl.h - 664 sys sys 1137462770 6013
+1137463255 1710 a sys/src/cmd/gs/src/ttfsfnt.h - 664 sys sys 1137462770 10381
+1137463255 1711 a sys/src/cmd/gs/src/ttinterp.c - 664 sys sys 1137462771 136774
+1137463255 1712 a sys/src/cmd/gs/src/ttinterp.h - 664 sys sys 1137462771 2098
+1137463255 1713 a sys/src/cmd/gs/src/ttload.c - 664 sys sys 1137462771 6708
+1137463255 1714 a sys/src/cmd/gs/src/ttload.h - 664 sys sys 1137462772 7132
+1137463255 1715 a sys/src/cmd/gs/src/ttmisc.h - 664 sys sys 1137462772 944
+1137463255 1716 a sys/src/cmd/gs/src/ttobjs.c - 664 sys sys 1137462772 26898
+1137463255 1717 a sys/src/cmd/gs/src/ttobjs.h - 664 sys sys 1137462772 34744
+1137463255 1718 a sys/src/cmd/gs/src/tttables.h - 664 sys sys 1137462773 5587
+1137463255 1719 a sys/src/cmd/gs/src/tttype.h - 664 sys sys 1137462773 45065
+1137463255 1720 a sys/src/cmd/gs/src/tttypes.h - 664 sys sys 1137462773 4510
+1137463255 1721 a sys/src/cmd/gs/src/vdtrace.c - 664 sys sys 1137462776 6815
+1137463255 1722 a sys/src/cmd/gs/src/vdtrace.h - 664 sys sys 1137462777 10453
+1137463255 1723 a sys/src/cmd/gs/src/wrfont.c - 664 sys sys 1137462783 2148
+1137463255 1724 a sys/src/cmd/gs/src/wrfont.h - 664 sys sys 1137462783 1504
+1137463255 1725 a sys/src/cmd/gs/src/write_t1.c - 664 sys sys 1137462784 7101
+1137463255 1726 a sys/src/cmd/gs/src/write_t1.h - 664 sys sys 1137462784 1082
+1137463255 1727 a sys/src/cmd/gs/src/write_t2.c - 664 sys sys 1137462784 12512
+1137463255 1728 a sys/src/cmd/gs/src/write_t2.h - 664 sys sys 1137462785 1076
+1137463255 1729 a sys/src/cmd/gs/src/zchar42.h - 664 sys sys 1137462796 1058
+1137463255 1730 a sys/src/cmd/gs/src/zcidtest.c - 664 sys sys 1137462800 3686
+1137463255 1731 a sys/src/cmd/gs/src/zcolor3.c - 664 sys sys 1137462806 1750
+1137463255 1732 a sys/src/cmd/gs/src/zfapi.c - 664 sys sys 1137462830 68987
+1137463255 1733 a sys/src/cmd/gs/src/zfile1.c - 664 sys sys 1137462842 3783
+1137463255 1734 a sys/src/cmd/gs/src/zfjbig2.c - 664 sys sys 1137462848 4789
+1137463255 1735 a sys/src/cmd/gs/src/zfjpx.c - 664 sys sys 1137462849 2226
+1137463255 1736 a sys/src/cmd/gs/src/zfontenum.c - 664 sys sys 1137462858 4067
+1137463255 1737 a sys/src/cmd/gs/src/zfsample.c - 664 sys sys 1137462860 18658
+1137463255 1738 a sys/src/cmd/gs/src/zht2.h - 664 sys sys 1137462872 1173
+1137463255 1739 a sys/src/cmd/gs/src/ziodevst.c - 664 sys sys 1137462882 4915
+1137463255 1740 c sys/src/cmd/gs/zlib/ChangeLog - 664 sys sys 1137462950 37959
+1137463255 1741 a sys/src/cmd/gs/zlib/FAQ - 664 sys sys 1137462950 15050
+1137463255 1742 c sys/src/cmd/gs/zlib/INDEX - 664 sys sys 1137462950 1318
+1137463255 1743 c sys/src/cmd/gs/zlib/Makefile - 664 sys sys 1137462950 4133
+1137463255 1744 c sys/src/cmd/gs/zlib/Makefile.in - 664 sys sys 1137462951 4133
+1137463255 1745 c sys/src/cmd/gs/zlib/README - 664 sys sys 1137462951 5710
+1137463255 1746 c sys/src/cmd/gs/zlib/adler32.c - 664 sys sys 1137462951 2289
+1137463255 1747 a sys/src/cmd/gs/zlib/algorithm.txt - 664 sys sys 1137462951 9336
+1137463255 1748 c sys/src/cmd/gs/zlib/compress.c - 664 sys sys 1137462951 2542
+1137463255 1749 c sys/src/cmd/gs/zlib/configure - 664 sys sys 1137462952 12604
+1137463255 1750 c sys/src/cmd/gs/zlib/crc32.c - 664 sys sys 1137462952 10729
+1137463255 1751 a sys/src/cmd/gs/zlib/crc32.h - 664 sys sys 1137462952 30568
+1137463255 1752 c sys/src/cmd/gs/zlib/deflate.c - 664 sys sys 1137462953 55016
+1137463255 1753 c sys/src/cmd/gs/zlib/deflate.h - 664 sys sys 1137462953 11938
+1137463255 1754 c sys/src/cmd/gs/zlib/example.c - 664 sys sys 1137462953 16488
+1137463255 1755 c sys/src/cmd/gs/zlib/gzio.c - 664 sys sys 1137462953 30744
+1137463255 1756 a sys/src/cmd/gs/zlib/infback.c - 664 sys sys 1137462954 22129
+1137463255 1757 c sys/src/cmd/gs/zlib/inffast.c - 664 sys sys 1137462954 12193
+1137463255 1758 c sys/src/cmd/gs/zlib/inffast.h - 664 sys sys 1137462954 407
+1137463255 1759 a sys/src/cmd/gs/zlib/inffixed.h - 664 sys sys 1137462954 6343
+1137463255 1760 c sys/src/cmd/gs/zlib/inflate.c - 664 sys sys 1137462954 45521
+1137463255 1761 a sys/src/cmd/gs/zlib/inflate.h - 664 sys sys 1137462954 5802
+1137463255 1762 c sys/src/cmd/gs/zlib/inftrees.c - 664 sys sys 1137462955 13671
+1137463255 1763 c sys/src/cmd/gs/zlib/inftrees.h - 664 sys sys 1137462955 2373
+1137463255 1764 c sys/src/cmd/gs/zlib/minigzip.c - 664 sys sys 1137462955 8058
+1137463255 1765 c sys/src/cmd/gs/zlib/trees.c - 664 sys sys 1137462956 44095
+1137463255 1766 a sys/src/cmd/gs/zlib/trees.h - 664 sys sys 1137462956 8444
+1137463255 1767 c sys/src/cmd/gs/zlib/uncompr.c - 664 sys sys 1137462956 2139
+1137463255 1768 c sys/src/cmd/gs/zlib/zconf.h - 664 sys sys 1137462956 9391
+1137463255 1769 a sys/src/cmd/gs/zlib/zconf.in.h - 664 sys sys 1137462956 9394
+1137463255 1770 a sys/src/cmd/gs/zlib/zlib.3 - 664 sys sys 1137462957 4488
+1137463255 1771 c sys/src/cmd/gs/zlib/zlib.h - 664 sys sys 1137462957 57769
+1137463255 1772 c sys/src/cmd/gs/zlib/zutil.c - 664 sys sys 1137462957 7057
+1137463255 1773 c sys/src/cmd/gs/zlib/zutil.h - 664 sys sys 1137462957 6612
+1137465107 0 c sys/lib/ghostscript/acctest.ps - 664 sys sys 1137463348 4328
+1137465107 1 c sys/lib/ghostscript/addxchar.ps - 664 sys sys 1137463348 9852
+1137465107 2 c sys/lib/ghostscript/align.ps - 664 sys sys 1137463348 2317
+1137465107 3 c sys/lib/ghostscript/bdftops.ps - 664 sys sys 1137463349 23410
+1137465107 4 c sys/lib/ghostscript/caption.ps - 664 sys sys 1137463349 1725
+1137465107 5 c sys/lib/ghostscript/cid2code.ps - 664 sys sys 1137463349 4479
+1137465107 6 c sys/lib/ghostscript/decrypt.ps - 664 sys sys 1137463349 354
+1137465107 7 c sys/lib/ghostscript/docie.ps - 664 sys sys 1137463349 7123
+1137465107 8 c sys/lib/ghostscript/errpage.ps - 664 sys sys 1137463350 8598
+1137465107 9 c sys/lib/ghostscript/font2c.ps - 664 sys sys 1137463350 19593
+1137465107 10 c sys/lib/ghostscript/font2pcl.ps - 664 sys sys 1137463350 17575
+1137465107 11 c sys/lib/ghostscript/gs_agl.ps - 664 sys sys 1137463350 28612
+1137465107 12 c sys/lib/ghostscript/gs_btokn.ps - 664 sys sys 1137463351 11103
+1137465107 13 c sys/lib/ghostscript/gs_ccfnt.ps - 664 sys sys 1137463351 2167
+1137465107 14 c sys/lib/ghostscript/gs_ce_e.ps - 664 sys sys 1137463351 2368
+1137465107 15 c sys/lib/ghostscript/gs_cff.ps - 664 sys sys 1137463351 22476
+1137465107 16 c sys/lib/ghostscript/gs_cidcm.ps - 664 sys sys 1137463351 17059
+1137465107 17 c sys/lib/ghostscript/gs_cidfn.ps - 664 sys sys 1137463352 12612
+1137465107 18 c sys/lib/ghostscript/gs_cmap.ps - 664 sys sys 1137463352 17210
+1137465107 19 c sys/lib/ghostscript/gs_cmdl.ps - 664 sys sys 1137463353 4848
+1137465107 20 c sys/lib/ghostscript/gs_css_e.ps - 664 sys sys 1137463353 4955
+1137465107 21 c sys/lib/ghostscript/gs_dbt_e.ps - 664 sys sys 1137463353 2288
+1137465107 22 c sys/lib/ghostscript/gs_diskf.ps - 664 sys sys 1137463353 7584
+1137465107 23 c sys/lib/ghostscript/gs_dpnxt.ps - 664 sys sys 1137463354 4766
+1137465107 24 c sys/lib/ghostscript/gs_dps.ps - 664 sys sys 1137463354 7842
+1137465107 25 c sys/lib/ghostscript/gs_dps1.ps - 664 sys sys 1137463354 4576
+1137465107 26 c sys/lib/ghostscript/gs_dps2.ps - 664 sys sys 1137463354 6977
+1137465107 27 c sys/lib/ghostscript/gs_dscp.ps - 664 sys sys 1137463354 3936
+1137465107 28 c sys/lib/ghostscript/gs_epsf.ps - 664 sys sys 1137463355 7220
+1137465107 29 c sys/lib/ghostscript/gs_fform.ps - 664 sys sys 1137463355 3166
+1137465107 30 c sys/lib/ghostscript/gs_fonts.ps - 664 sys sys 1137463355 43873
+1137465107 31 c sys/lib/ghostscript/gs_frsd.ps - 664 sys sys 1137463356 3002
+1137465107 32 c sys/lib/ghostscript/gs_icc.ps - 664 sys sys 1137463356 10598
+1137465107 33 c sys/lib/ghostscript/gs_il1_e.ps - 664 sys sys 1137463356 2800
+1137465107 34 c sys/lib/ghostscript/gs_il2_e.ps - 664 sys sys 1137463356 2781
+1137465107 35 c sys/lib/ghostscript/gs_init.ps - 664 sys sys 1137463357 73009
+1137465107 36 c sys/lib/ghostscript/gs_kanji.ps - 664 sys sys 1137463357 3946
+1137465107 37 c sys/lib/ghostscript/gs_ksb_e.ps - 664 sys sys 1137463357 3295
+1137465107 38 c sys/lib/ghostscript/gs_l2img.ps - 664 sys sys 1137463357 5635
+1137465107 39 c sys/lib/ghostscript/gs_lev2.ps - 664 sys sys 1137463358 31509
+1137465107 40 c sys/lib/ghostscript/gs_lgo_e.ps - 664 sys sys 1137463358 2890
+1137465107 41 c sys/lib/ghostscript/gs_lgx_e.ps - 664 sys sys 1137463358 1916
+1137465107 42 c sys/lib/ghostscript/gs_ll3.ps - 664 sys sys 1137463358 10554
+1137465107 43 c sys/lib/ghostscript/gs_mex_e.ps - 664 sys sys 1137463358 3997
+1137465107 44 c sys/lib/ghostscript/gs_mgl_e.ps - 664 sys sys 1137463358 2193
+1137465107 45 c sys/lib/ghostscript/gs_mro_e.ps - 664 sys sys 1137463359 2539
+1137465107 46 c sys/lib/ghostscript/gs_pdf_e.ps - 664 sys sys 1137463359 1709
+1137465107 47 c sys/lib/ghostscript/gs_pdfwr.ps - 664 sys sys 1137463359 25452
+1137465107 48 c sys/lib/ghostscript/gs_pfile.ps - 664 sys sys 1137463359 4345
+1137465107 49 c sys/lib/ghostscript/gs_rdlin.ps - 664 sys sys 1137463359 866
+1137465107 50 c sys/lib/ghostscript/gs_res.ps - 664 sys sys 1137463360 34685
+1137465107 51 c sys/lib/ghostscript/gs_setpd.ps - 664 sys sys 1137463360 27947
+1137465107 52 c sys/lib/ghostscript/gs_statd.ps - 664 sys sys 1137463360 13461
+1137465107 53 c sys/lib/ghostscript/gs_std_e.ps - 664 sys sys 1137463361 3243
+1137465107 54 c sys/lib/ghostscript/gs_sym_e.ps - 664 sys sys 1137463361 3102
+1137465107 55 c sys/lib/ghostscript/gs_trap.ps - 664 sys sys 1137463361 3040
+1137465107 56 c sys/lib/ghostscript/gs_ttf.ps - 664 sys sys 1137463361 46435
+1137465107 57 c sys/lib/ghostscript/gs_typ32.ps - 664 sys sys 1137463361 4220
+1137465107 58 c sys/lib/ghostscript/gs_typ42.ps - 664 sys sys 1137463362 1701
+1137465107 59 c sys/lib/ghostscript/gs_type1.ps - 664 sys sys 1137463362 7527
+1137465107 60 c sys/lib/ghostscript/gs_wan_e.ps - 664 sys sys 1137463362 1687
+1137465107 61 c sys/lib/ghostscript/gs_wl1_e.ps - 664 sys sys 1137463362 2534
+1137465107 62 c sys/lib/ghostscript/gs_wl2_e.ps - 664 sys sys 1137463362 2532
+1137465107 63 c sys/lib/ghostscript/gs_wl5_e.ps - 664 sys sys 1137463362 2550
+1137465107 64 c sys/lib/ghostscript/gslp.ps - 664 sys sys 1137463363 19645
+1137465107 65 c sys/lib/ghostscript/gsnup.ps - 664 sys sys 1137463363 2727
+1137465107 66 c sys/lib/ghostscript/ht_ccsto.ps - 664 sys sys 1137463364 227916
+1137465107 67 c sys/lib/ghostscript/image-qa.ps - 664 sys sys 1137463365 73327
+1137465107 68 c sys/lib/ghostscript/impath.ps - 664 sys sys 1137463365 5542
+1137465107 69 c sys/lib/ghostscript/jispaper.ps - 664 sys sys 1137463365 934
+1137465107 70 c sys/lib/ghostscript/landscap.ps - 664 sys sys 1137463365 1529
+1137465107 71 c sys/lib/ghostscript/level1.ps - 664 sys sys 1137463365 114
+1137465107 72 a sys/lib/ghostscript/EndOfTask.ps - 775 sys sys 1137463348 1
+1137465107 73 a sys/lib/ghostscript/PDFX_def.ps - 775 sys sys 1137463348 1355
+1137465107 74 a sys/lib/ghostscript/dumphint.ps - 775 sys sys 1137463350 20048
+1137465107 75 a sys/lib/ghostscript/gs_ciddc.ps - 664 sys sys 1137463351 7333
+1137465107 76 a sys/lib/ghostscript/gs_cidfm.ps - 664 sys sys 1137463352 4638
+1137465107 77 a sys/lib/ghostscript/gs_cidtt.ps - 664 sys sys 1137463352 4796
+1137465107 78 a sys/lib/ghostscript/gs_ciecs2.ps - 664 sys sys 1137463352 3477
+1137465107 79 a sys/lib/ghostscript/gs_ciecs3.ps - 664 sys sys 1137463352 3183
+1137465107 80 a sys/lib/ghostscript/gs_cspace.ps - 664 sys sys 1137463353 29498
+1137465107 81 a sys/lib/ghostscript/gs_devcs.ps - 664 sys sys 1137463353 6281
+1137465107 82 a sys/lib/ghostscript/gs_devn.ps - 664 sys sys 1137463353 5556
+1137465107 83 a sys/lib/ghostscript/gs_devpxl.ps - 664 sys sys 1137463353 2244
+1137465107 84 a sys/lib/ghostscript/gs_diskn.ps - 664 sys sys 1137463354 6892
+1137465107 85 a sys/lib/ghostscript/gs_fapi.ps - 664 sys sys 1137463355 9287
+1137465107 86 a sys/lib/ghostscript/gs_fntem.ps - 664 sys sys 1137463355 10788
+1137465107 87 a sys/lib/ghostscript/gs_img.ps - 664 sys sys 1137463356 21397
+1137465107 88 a sys/lib/ghostscript/gs_indxd.ps - 664 sys sys 1137463356 5462
+1137465107 89 a sys/lib/ghostscript/gs_patrn.ps - 664 sys sys 1137463359 7927
+1137465107 90 a sys/lib/ghostscript/gs_resmp.ps - 664 sys sys 1137463360 22414
+1137465107 91 a sys/lib/ghostscript/gs_resst.ps - 664 sys sys 1137463360 5673
+1137465107 92 a sys/lib/ghostscript/gs_sepr.ps - 664 sys sys 1137463360 8293
+1137465107 93 a sys/lib/ghostscript/gs_stres.ps - 664 sys sys 1137463361 4174
+1137465107 94 c sys/lib/ghostscript/lines.ps - 664 sys sys 1137463365 3872
+1137465107 95 c sys/lib/ghostscript/markhint.ps - 664 sys sys 1137463365 3477
+1137465107 96 c sys/lib/ghostscript/markpath.ps - 664 sys sys 1137463366 1894
+1137465107 97 a sys/lib/ghostscript/mkcidfm.ps - 664 sys sys 1137463366 7304
+1137465107 98 a sys/lib/ghostscript/opdfread.ps - 664 sys sys 1137463366 111167
+1137465107 99 c sys/lib/ghostscript/packfile.ps - 664 sys sys 1137463366 10365
+1137465107 100 c sys/lib/ghostscript/pcharstr.ps - 664 sys sys 1137463366 3588
+1137465107 101 c sys/lib/ghostscript/pdf2dsc.ps - 664 sys sys 1137463367 5094
+1137465107 102 c sys/lib/ghostscript/pdf_base.ps - 664 sys sys 1137463367 34426
+1137465107 103 c sys/lib/ghostscript/pdf_draw.ps - 664 sys sys 1137463367 41076
+1137465107 104 c sys/lib/ghostscript/pdf_font.ps - 664 sys sys 1137463367 53454
+1137465107 105 c sys/lib/ghostscript/pdf_main.ps - 664 sys sys 1137463368 45457
+1137465107 106 c sys/lib/ghostscript/pdf_ops.ps - 664 sys sys 1137463368 20969
+1137465107 107 a sys/lib/ghostscript/pdf_rbld.ps - 664 sys sys 1137463368 14217
+1137465107 108 c sys/lib/ghostscript/pdf_sec.ps - 664 sys sys 1137463368 14038
+1137465107 109 c sys/lib/ghostscript/pdfopt.ps - 664 sys sys 1137463369 36025
+1137465107 110 c sys/lib/ghostscript/pdfwrite.ps - 664 sys sys 1137463369 9903
+1137465107 111 c sys/lib/ghostscript/pf2afm.ps - 664 sys sys 1137463369 14922
+1137465107 112 c sys/lib/ghostscript/pfbtopfa.ps - 664 sys sys 1137463369 1145
+1137465107 113 c sys/lib/ghostscript/ppath.ps - 664 sys sys 1137463369 1978
+1137465107 114 c sys/lib/ghostscript/pphs.ps - 664 sys sys 1137463370 6924
+1137465107 115 c sys/lib/ghostscript/prfont.ps - 664 sys sys 1137463370 6484
+1137465107 116 c sys/lib/ghostscript/printafm.ps - 664 sys sys 1137463370 3244
+1137465107 117 c sys/lib/ghostscript/ps2ai.ps - 664 sys sys 1137463370 22503
+1137465107 118 c sys/lib/ghostscript/ps2ascii.ps - 664 sys sys 1137463371 44622
+1137465107 119 c sys/lib/ghostscript/ps2epsi.ps - 664 sys sys 1137463371 8253
+1137465107 120 c sys/lib/ghostscript/rollconv.ps - 664 sys sys 1137463371 11768
+1137465107 121 c sys/lib/ghostscript/showchar.ps - 664 sys sys 1137463371 2936
+1137465107 122 c sys/lib/ghostscript/stcinfo.ps - 664 sys sys 1137463372 25737
+1137465107 123 c sys/lib/ghostscript/stcolor.ps - 664 sys sys 1137463372 5225
+1137465107 124 c sys/lib/ghostscript/stocht.ps - 664 sys sys 1137463372 2642
+1137465107 125 c sys/lib/ghostscript/traceimg.ps - 664 sys sys 1137463372 1535
+1137465107 126 c sys/lib/ghostscript/traceop.ps - 664 sys sys 1137463372 2738
+1137465107 127 c sys/lib/ghostscript/type1enc.ps - 664 sys sys 1137463373 2540
+1137465107 128 c sys/lib/ghostscript/type1ops.ps - 664 sys sys 1137463373 7580
+1137465107 129 c sys/lib/ghostscript/uninfo.ps - 664 sys sys 1137463373 6140
+1137465107 130 c sys/lib/ghostscript/unprot.ps - 664 sys sys 1137463373 1908
+1137465107 131 c sys/lib/ghostscript/viewcmyk.ps - 664 sys sys 1137463373 2120
+1137465107 132 c sys/lib/ghostscript/viewgif.ps - 664 sys sys 1137463373 4575
+1137465107 133 c sys/lib/ghostscript/viewjpeg.ps - 664 sys sys 1137463373 4953
+1137465107 134 c sys/lib/ghostscript/viewmiff.ps - 664 sys sys 1137463374 3782
+1137465107 135 c sys/lib/ghostscript/viewpbm.ps - 664 sys sys 1137463374 5314
+1137465107 136 c sys/lib/ghostscript/viewpcx.ps - 664 sys sys 1137463374 4352
+1137465107 137 c sys/lib/ghostscript/viewps2a.ps - 664 sys sys 1137463374 1286
+1137465107 138 c sys/lib/ghostscript/wftopfa.ps - 664 sys sys 1137463374 8925
+1137465107 139 c sys/lib/ghostscript/winmaps.ps - 664 sys sys 1137463374 3747
+1137465107 140 c sys/lib/ghostscript/wrfont.ps - 664 sys sys 1137463375 18170
+1137465107 141 c sys/lib/ghostscript/zeroline.ps - 664 sys sys 1137463375 2467
+1137468708 0 c 386/bin/gs - 775 sys sys 1137468663 13275174
+1137468708 1 c 386/bin/page - 775 sys sys 1137468664 233797
+1137468708 2 c 386/lib/ape/libap.a - 664 sys sys 1137468666 815826
+1137468708 3 c 386/lib/ape/libbsd.a - 664 sys sys 1137468667 183166
+1137468708 4 c 386/lib/ape/libdraw.a - 664 sys sys 1137468668 580920
+1137468708 5 c 386/lib/ape/libfmt.a - 664 sys sys 1137468669 150952
+1137468708 6 c 386/lib/ape/libnet.a - 664 sys sys 1137468669 16950
+1137468708 7 c 386/lib/ape/libregexp.a - 664 sys sys 1137468669 47670
+1137469705 0 a sys/lib/ghostscript/xlatmap - 664 sys sys 1137469677 1750
+1137469705 1 c sys/src/ape/lib/utf/utfecpy.c - 664 sys sys 1137468847 1079

+ 4 - 0
sys/include/ape/string.h

@@ -31,6 +31,10 @@ extern void *memset(void *, int, size_t);
 extern char *strerror(int);
 extern size_t strlen(const char *);
 
+#ifdef _BSD_EXTENSION
+#include <bsd.h>
+#endif
+
 #ifdef __cplusplus
 }
 #endif

+ 1 - 1
sys/include/fcall.h

@@ -64,7 +64,7 @@ struct	Fcall
 #define	GBIT8(p)	((p)[0])
 #define	GBIT16(p)	((p)[0]|((p)[1]<<8))
 #define	GBIT32(p)	((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24))
-#define	GBIT64(p)	((vlong)((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) |\
+#define	GBIT64(p)	((u32int)((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) |\
 				((vlong)((p)[4]|((p)[5]<<8)|((p)[6]<<16)|((p)[7]<<24)) << 32))
 
 #define	PBIT8(p,v)	(p)[0]=(v)

+ 1 - 0
sys/lib/ghostscript/EndOfTask.ps

@@ -0,0 +1 @@
+

+ 35 - 0
sys/lib/ghostscript/PDFX_def.ps

@@ -0,0 +1,35 @@
+%!
+% $Id: PDFX_def.ps,v 1.1 2005/09/12 11:34:50 leonardo Exp $
+% This is a sample prefix file for creating a PDF/X-3 document.
+% Feel free to modify entries marked with "Customize".
+
+% This assumes an ICC profile to reside in the file (ISO Coated sb.icc),
+% unless the user modifies the corresponding line below.
+
+% Define emtries to the document Info dictionary :
+
+/ICCProfile (ISO Coated sb.icc)   % Customize.
+def
+
+[ /GTS_PDFXVersion (PDF/X-3:2001) % Must be so (the standard requires).
+  /Title (Title)                  % Customize.
+  /Trapped /False                 % Must be so (Ghostscript doesn't provide other).
+  /DOCINFO pdfmark
+
+% Define an IDD profile :
+
+[/_objdef {icc_PDFX} /type /stream /OBJ pdfmark
+[{icc_PDFX} ICCProfile (r) file /PUT pdfmark
+
+% Define the output intent dictionary :
+
+[/_objdef {OutputIntent_PDFX} /type /dict /OBJ pdfmark
+[{OutputIntent_PDFX} <<
+  /Type /OutputIntent             % Must be so (the standard requires).
+  /S /GTS_PDFX                    % Must be so (the standard requires).
+  /OutputCondition (Commercial and specialty printing) % Customize
+  /Info (none)                             % Customize
+  /OutputConditionIdentifier (Custom)      % Customize
+  /DestOutputProfile {icc_PDFX}            % Must be so (see above).
+>> /PUT pdfmark
+[{Catalog} <</OutputIntents [ {OutputIntent_PDFX} ]>> /PUT pdfmark

+ 1 - 0
sys/lib/ghostscript/acctest.ps

@@ -1,5 +1,6 @@
 %!
 % Check that operators do their access tests correctly.
+% $Id: acctest.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 
 % proc dotest => .
 /dotest

+ 12 - 14
sys/lib/ghostscript/addxchar.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: addxchar.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: addxchar.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Add the Central European and other Adobe extended Latin characters to a
 % Type 1 font.
 % Requires -dWRITESYSTEMDICT to disable access protection.

+ 11 - 13
sys/lib/ghostscript/align.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1989, 1996 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: align.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: align.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Print a page that indicates the proper settings of Margins and HWMargins
 % for a given device.  Requires a Level 2 system.
 

+ 18 - 20
sys/lib/ghostscript/bdftops.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1990, 1995, 1996 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: bdftops.ps,v 1.3 2001/03/27 20:53:36 alexcher Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: bdftops.ps,v 1.7 2003/08/06 17:05:09 alexcher Exp $
 % bdftops.ps
 % Convert a BDF file (possibly with (an) associated AFM file(s))
 % to a PostScript Type 1 font (without eexec encryption).
@@ -461,10 +459,10 @@ envBDF begin
 	 (BITMAP) checkline
 
 % Update the font bounding box.
-	 /fbbxo fbbxo bbox min def
-	 /fbbyo fbbyo bboy min def
-	 /fbbxe fbbxe bbox bbw add max def
-	 /fbbye fbbye bboy bbh add max def
+	 /fbbxo fbbxo bbox .min def
+	 /fbbyo fbbyo bboy .min def
+	 /fbbxe fbbxe bbox bbw add .max def
+	 /fbbye fbbye bboy bbh add .max def
 
 % Read the bits for this character.
 	 /raster bbw 7 add 8 idiv def
@@ -493,8 +491,8 @@ envBDF begin
       /fbbw fbbxe fbbxo sub def
       /fbbh fbbye fbbyo sub def
       /fraster fbbw 7 add 8 idiv def
-      /bits fraster fbbh mul 200 max 65535 min string def
-      /outline bits length 6 mul 65535 min string def
+      /bits fraster fbbh mul 200 .max 65535 .min string def
+      /outline bits length 16 mul 65535 .min string def
 
 %  Process the characters.
       chardata

+ 11 - 13
sys/lib/ghostscript/caption.ps

@@ -1,22 +1,20 @@
 %!
 %    Copyright (C) 1995 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: caption.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: caption.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Add a "caption" to the bottom of each page.
 /captionsize 20 def
 /caption

+ 11 - 13
sys/lib/ghostscript/cid2code.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1998, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: cid2code.ps,v 1.3 2000/11/30 18:22:11 lpd Exp $
+% $Id: cid2code.ps,v 1.5 2002/02/21 21:49:28 giles Exp $
 % Construct an inverse map from CIDs to codes.
 
 % Create an inverse map from CIDs to code values.

+ 2 - 0
sys/lib/ghostscript/decrypt.ps

@@ -1,4 +1,6 @@
+%!
 % Decrypt an eexec-encoded file.
+% $Id: decrypt.ps,v 1.6 2002/02/21 21:49:28 giles Exp $
 
 (t.in) (r) file /in exch def
 (t.out) (w) file /out exch def

+ 35 - 37
sys/lib/ghostscript/docie.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1995 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: docie.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: docie.ps,v 1.5 2003/04/12 18:08:18 ray Exp $
 % docie.ps
 % Emulate CIE algorithms in PostScript.
 
@@ -95,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
 
@@ -133,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
@@ -142,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
@@ -172,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
@@ -200,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

+ 756 - 0
sys/lib/ghostscript/dumphint.ps

@@ -0,0 +1,756 @@
+% Copyright (C) 2000, 2001 Aladdin Enterprises.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: dumphint.ps,v 1.2 2004/04/08 16:18:25 giles Exp $
+% Linearized PDF hint formatting utility.
+
+%
+% Linearized PDF hints generated by Acrobat suite seem to deviate from
+% the published specification.
+%
+% /P (page offset hint table) key in hint stream is not generated by
+% Adobe products. The key is no longer required in PDF 1.5.
+%
+% Per-page items 4 and 5 of the page offset hint table start from 1st
+% page rather than 2nd page as the spec claims.
+%
+% All array entries start from the new byte boundary.
+%
+
+/table_width 79 def 
+/col1_width  66 def
+
+% Skip bits to the next byte boundary
+/bytealign {		% <stream> bytealign -
+  begin /N 0 def /B 0 def end
+} bind def
+
+% Set bit stream position and align it to byte boundary
+/set_align {            % <<>> pos set_align -
+  exch begin
+  S exch setfileposition
+  /N 0 def /B 0 def
+  end
+} bind def
+
+% Read requested number of bits from the bit stream.
+/bitread {		% <bstream> <width> bitwrite <value>
+  exch begin
+  0                     %  bit val
+  { 
+    1 index N .min      %  bit val m
+    dup 3 1 roll        %  bit m val m 
+    bitshift            %  bit m val<<m
+    B 2 index N sub     %  bit m val<<m B m-N
+    bitshift add        %  bit m val<<m+B>>(N-m)
+    3 -1 roll           %  m val' bit 
+    2 index sub         %  m val' bit'
+    3 -1 roll           %  val' bit' m
+    N exch sub dup      %  val' bit' N' N'
+    1 exch bitshift     %  val' bit' N' 1<<N'
+    1 sub B and         %  val' bit' N' B&(1<<N')
+    /B exch def         %  val' bit' N'
+    /N exch def         %  val' bit'
+    dup 0 le {
+      pop exit          %  val'
+    } if
+    /N N 8 add def
+    /B B 8 bitshift S read not { 0 ( *** EOF! *** ) = } if add def
+    exch
+  } loop                %  bit' val'
+  end
+} bind def
+
+% Print a string several times
+/multiprint {           % cnt (s) multiprint -
+  exch { dup print } repeat pop
+} bind def
+
+% Split the line into 2 substrings.
+/split_line {           % (s) split_line () ()
+  dup length col1_width gt {
+    col1_width 1 sub
+    dup -1 0 {
+      dup               % (s) w i i
+      3 index           % (s) w i i ()
+      exch get          % (s) w i c
+      32 eq {
+        exch pop exit
+      } if
+      pop
+    } for
+    1 add               % (s) w'
+    1 index exch        % (s) (s) w'
+    0 exch              % (s) (s) 0 w'
+    getinterval         % (s) (v)
+  } {
+    dup                 % (s) (s)
+  } ifelse                  
+  (\n) search {
+    4 1 roll            % (pre) (s) (post) (match)
+    pop pop             % (pre) (s)
+    1 index length      % (pre) (s) len
+    1 add               % (pre) (s) len+1
+  } {
+    exch                % (pre) (s)
+    1 index length      % (pre) (s) len
+  } ifelse
+  1 index length        % (pre) (s) len Len
+  1 index sub           % (pre) (s) len Len-len
+  getinterval           % (pre) (post)
+} bind def
+
+% Print a 2 column table. The string is printed in 1st column
+% left-aligned. The number is printed in 2nd column right-aligned.
+/two_column {           % n () two_column -
+  split_line            % n (a) ()
+  3 1 roll              % () n (a)
+  dup length            % () n (a) len
+  exch print            % () n len
+  exch =string cvs      % () len (n)
+  dup length            % () len (n) len2
+  3 -1 roll add         % () (n) len+len2 
+  //table_width         % () (n) len+len2 78
+  exch sub              % () (n) 78-len+len2 
+  ( ) multiprint        % () (n)
+  =                     % ()
+  { dup length 0 eq { exit } if
+    split_line exch =
+  } loop
+  pop
+  () =
+} bind def
+
+% Print the header of a hint table
+/table_header {               % () table_header -
+  dup length dup
+  table_width exch sub 2 idiv % () len sp
+  dup ( ) multiprint          % () len sp
+  3 -1 roll =                 % len sp
+  ( ) multiprint              % len
+  (=) multiprint
+  ()= ()=
+} bind def
+
+% Pretty-print an array on top level
+/dump_array {               % [ ] dump_array -
+  ([) = ( ) print
+  1 exch {
+    =string cvs         % pos ()
+    dup length dup      % pos () len len
+    3 index add 1 add   % pos () len len+pos+1
+    table_width gt {
+      () =
+      (  ) print        % pos () len
+      2 add             % pos () pos'
+      3 1 roll print pop % pos'
+    } {
+      ( ) print         % pos () len
+      exch print        % pos len
+      add 1 add         % pos'
+    } ifelse
+  } forall
+  pop
+  () = (]) =
+} bind def
+
+% Pretty-print an array on 2nd level
+/dump_array2 {             % [ ] dump_array2 -
+  (  [) print
+  3 exch {
+    =string cvs            % pos ()
+    dup length dup         % pos () len len
+    3 index add 1 add      % pos () len len+pos+1
+    table_width 2 sub gt {
+      () =
+      (    ) print         % pos () len
+      4 add                % pos () pos'
+      3 1 roll print pop   % pos'
+    } {
+      ( ) print            % pos () len
+      exch print           % pos len
+      add 1 add            % pos'
+    } ifelse
+  } forall
+  pop
+  ( ]) =
+} bind def
+
+% Print an array header
+/array_header {
+  () = =
+} bind def
+
+% Analyze the page offset hint table.
+/dump_page_offset_table {  % - dump_page_offset_table -
+  hint_stream
+    
+  dup 32 bitread
+  dup /hint_minnop exch def
+  (1. The least number of objects in a page.) two_column
+
+  dup 32 bitread
+  dup /hint_1st_obj exch def
+  (2. Location of the first page's page object.) two_column
+
+  dup 16 bitread
+  dup /hint_maxnopbits exch def
+  (3. Bits for difference between max and min number of page objects.) two_column
+
+  dup 32 bitread
+  dup /hint_minpl exch def
+  (4. Least length of a page.) two_column
+
+  dup 16 bitread
+  dup /hint_maxplbits exch def
+  (5. Bits for difference between max and min length of a page.) two_column
+
+  dup 32 bitread
+  dup /hint_minsco exch def
+  (6. Least start of Contents offset. ) 
+  1 index 0 ne { (\n*** Acrobat expects 0 ***) concatstrings } if
+  two_column
+
+  dup 16 bitread
+  dup /hint_maxscobits exch def
+  (7. Bits for difference between max and min offset to the start of the content stream.) two_column
+
+  dup 32 bitread
+  dup /hint_mincl exch def
+  (8. Least contents length.) two_column
+
+  dup 16 bitread
+  dup /hint_maxclbits exch def
+  (9. Bits needed to represent the greatest Contents length.) two_column
+
+  dup 16 bitread
+  dup /hint_maxsorbits exch def
+  (10. Bits needed to represent the greatest number of Shared Object references.) two_column
+
+  dup 16 bitread
+  dup /hint_sobits exch def
+  (11. Bits needed to identify a Shared Object.) two_column
+
+  dup 16 bitread
+  dup /hint_numfbits exch def
+  (12. Bits needed to represent numerator of fraction.) two_column
+
+  dup 16 bitread
+  dup /hint_denf exch def
+  (13. Denominator of fraction.) two_column
+
+  pop 
+
+  LinearizationParams /N get
+
+  % 1. Number of objects in the page.
+  hint_stream bytealign
+  /hint_page_obj [
+    2 index {
+      hint_stream hint_maxnopbits bitread
+      hint_minnop add
+    } repeat
+  ] readonly def
+
+  (1. Number of objects on the page) array_header
+  hint_page_obj dump_array
+
+  % 2, Page length in bytes.
+  hint_stream bytealign
+  /hint_page_len [
+    2 index {
+      hint_stream hint_maxplbits bitread
+      hint_minpl add
+    } repeat
+  ] readonly def
+
+  (2. Page length in bytes.) array_header
+  hint_page_len dump_array
+
+  % 3, Number of shared objects referenced from the page
+  hint_stream bytealign
+  /hint_page_sobj [
+    2 index {
+      hint_stream hint_maxsorbits bitread
+    } repeat
+  ] readonly def
+
+  (3. Number of shared objects referenced from the page.) array_header
+  hint_page_sobj dump_array
+
+  % 4. Index into the shared objects hint table
+  hint_stream bytealign
+  /hint_page_sobj_id [
+    0 1 4 index 1 sub {
+      hint_page_sobj exch get [
+        exch {
+          hint_stream hint_sobits bitread
+        } repeat
+      ] readonly
+    } for
+  ] readonly def
+
+  (4. Index into the shared objects hint table.) array_header
+  ([) =
+  hint_page_sobj_id { dump_array2 } forall
+  (])=
+
+  % 5. Fractional position for each shared object reference
+  hint_stream bytealign
+  /hint_page_sobj_pos [
+    0 1 4 index 1 sub {
+      hint_page_sobj exch get [
+        exch {
+          hint_stream hint_numfbits bitread
+          hint_denf div
+        } repeat
+      ] readonly
+    } for
+  ] readonly def
+
+  (5. Fractional position for each shared object reference. ) array_header
+  ([)=
+  hint_page_sobj_pos { dump_array2 } forall
+  (])=
+
+  % 6. Offset of the page's content stream from the beginning of the page.
+  hint_stream bytealign
+  /hint_page_content_offset [
+    2 index {
+      hint_stream hint_maxscobits bitread
+      hint_minsco add
+    } repeat
+  ] readonly def
+
+  (6. Offset of the page's content stream from the beginning of the page.) array_header
+  hint_page_content_offset dump_array
+
+  % 7. Length of the page's content stream in bytes.
+  hint_stream bytealign
+  /hint_page_content_len [
+    2 index {
+      hint_stream hint_maxclbits bitread
+      hint_mincl add
+    } repeat
+  ] readonly def
+
+  (7. Length of the page's content stream in bytes.) array_header
+  hint_page_content_len dump_array
+
+  pop
+} bind def
+
+% Analyze tha shared object hint table
+/dump_shared_object_table { 
+  hint_stream
+    
+  dup 32 bitread
+  dup /shint_1st_obj_id exch def
+  (1. Object number of the first object in the shared objects section) two_column
+
+  dup 32 bitread
+  dup /shint_1st_obj_pos exch def
+  (2. Location of the first object in the shared objects section.) two_column
+
+  dup 32 bitread
+  dup /shint_1st_shared exch def
+  (3. The number of shared object entries for the first page.) two_column
+
+  dup 32 bitread
+  dup /shint_all_shared exch def
+  (4. Number of shared object entries for the shared objects section including 1st page.) two_column
+
+  dup 16 bitread
+  dup /shint_group_bits exch def
+  (5. Number of bits needed to represent the greatest number of objects in a shared object group.) two_column
+
+  dup 32 bitread
+  dup /shint_group_least_sz exch def
+  (6. Least length of a shared object group in bytes.) two_column
+
+  dup 16 bitread
+  dup /shint_group_diff_bits exch def
+  (7. Bits for the difference between the greatest and least length of a shared object group size.)  two_column
+  pop
+
+  (1. length of the object group in bytes.) array_header
+  hint_stream bytealign
+  /shint_group_sz [
+    shint_all_shared {
+      hint_stream shint_group_diff_bits bitread
+      shint_group_least_sz add
+    } repeat
+  ] readonly def
+
+  shint_group_sz dump_array
+
+  (2. MD5 signature flag) array_header
+    hint_stream bytealign
+    /shint_md5_flags
+    [ shint_all_shared 
+      { hint_stream 1 bitread
+      } repeat
+    ] readonly def
+
+    shint_md5_flags dump_array
+
+    (3. MD5 signature string) array_header
+    false shint_md5_flags { 0 ne or } forall { 
+      shint_md5_flags {
+        0 eq {
+          (<>)=
+        } {
+          hint_stream /S get 128 string
+          readstring pop
+          dup length 128 eq {
+            ==
+          } { pop (Error reading nd5 string.) ==
+          } ifelse
+        } ifelse
+      } forall   
+    } {
+      () = (none) =
+    } ifelse
+
+    (4. The number of objects in the group.) array_header
+    hint_stream bytealign
+    /shint_group_cnt [
+      shint_all_shared {
+        hint_stream shint_group_bits bitread
+      } repeat
+    ] readonly def
+
+    shint_group_cnt dump_array
+
+  } bind def
+
+% Analyze the thumbnail hint table.
+/dump_thumbnail_table {
+  hint_stream
+
+  dup 32 bitread
+  dup /thint_1st_obj_id exch def
+  (1. Object number of the first thumbnail image.) two_column
+
+  dup 32 bitread
+  dup /thint_1st_obj_pos exch def
+  (2. Location of the first thumbnail image.) two_column
+
+  dup 32 bitread
+  dup /thint_page_cnt exch def
+  (3. Number of pages that have thumbnail images.) two_column
+
+  dup 16 bitread
+  dup /thint_no_thumbnail_bits exch def
+  (4. Bits for the max number of consecutive pages without a thumbnail image.) two_column
+
+  dup 32 bitread
+  dup /thint_min_sz exch def
+  (5. The least length of a thumbnail image in bytes.) two_column
+
+  dup 15 bitread
+  dup /thint_obj_sz_bits exch def
+  (6. Bits for the difference between max and min length of a thumbnail image.) two_column
+
+  dup 32 bitread
+  dup /thint_min_obj_cnt exch def
+  (7. The least number of objects in a thumbnail image.) two_column
+
+  dup 16 bitread
+  dup /thint_obj_cnt_bits exch def
+  (8. Bits for the difference between max and min number of objects in a thumbnail image.) two_column
+
+  dup 32 bitread
+  dup /thint_1st_shared_obj exch def
+  (9. First object in the thumbnail shared objects section.) two_column
+
+  dup 32 bitread
+  dup /thint_1st_shared_pos exch def
+  (10. Location of the first object in the thumbnail shared objects section.) two_column
+
+  dup 32 bitread
+  dup /thint_shared_cnt exch def
+  (11. Number of thumbnail shared objects.) two_column
+
+  dup 32 bitread
+  dup /thint_shared_section_sz exch def
+  (12. Length of the thumbnail shared objects section in bytes.) two_column
+
+  pop
+  LinearizationParams /N get
+
+  (1. The number of preceding pages lacking a thumbnail image.) array_header
+  hint_stream bytealign
+  /thint_no_thumbnail_pages [
+    2 index {
+      hint_stream thint_no_thumbnail_bits bitread
+    } repeat
+  ] readonly def
+
+  thint_no_thumbnail_pages dump_array
+
+  (2. Number of objects in this page's thumbnail image.) array_header
+  hint_stream bytealign
+  /thint_page_obj_cnt [
+    2 index {
+      hint_stream thint_obj_cnt_bits bitread
+      thint_min_obj_cnt add
+    } repeat
+  ] readonly def
+
+  thint_page_obj_cnt dump_array
+
+  (3. Length of this page's thumbnail image in bytes.) array_header
+  hint_stream bytealign
+  /thint_page_obj_sz [
+    2 index {
+      hint_stream thint_obj_sz_bits bitread
+      thint_min_sz add
+    } repeat
+  ] readonly def
+
+  thint_page_obj_sz dump_array
+  pop
+} bind def
+
+% Analyze the generic hint table.
+% The hint field names are re-used. 
+/dump_generic_table { 
+  hint_stream
+
+  dup 32 bitread
+  dup /ghint_1st_obj exch def
+  (1. Object number of the first object in the group.) two_column
+
+  dup 32 bitread
+  dup /ghint_1st_obj_pos exch def
+  (2. Location of the first object in the group.) two_column
+
+  dup 32 bitread
+  dup /ghint_obj_cnt exch def
+  (3. Number of objects in the group.) two_column
+
+  dup 32 bitread
+  dup /ghint_group_sz exch def
+  (4. Length of the object group in bytes.) two_column
+
+  pop
+} bind def
+
+% Analyze the interactive hint table.
+% The hint field names are re-used.
+/dump_interactive_table {
+  hint_stream
+
+  dup 32 bitread
+  dup /ihint_1st_obj exch def
+  (1. Object number of the first object in the group.) two_column
+
+  dup 32 bitread
+  dup /ihint_1st_obj_pos exch def
+  (2. Location of the first object in the group.) two_column
+
+  dup 32 bitread
+  dup /ihint_obj_cnt exch def
+  (3. Number of objects in the group.) two_column
+
+  dup 32 bitread
+  dup /ihint_group_sz exch def
+  (4. Length of the object group in bytes.) two_column
+
+  dup 32 bitread
+  dup /ihint_shared_cnt exch def
+  (5. Number of shared object references.) two_column
+
+  dup 16 bitread
+  dup /ihint_shared_obj_bits exch def
+  (6. Bits for the max shared object id used by the interactive form or the logical structure hierarchy.)
+  1 index hint_sobits ne {
+    (\n*** This fiels is not equal to max shared object ID bits ***) concatstrings 
+  } if
+
+  pop
+
+  (7. Shared object identifier.) array_header
+  hint_stream bytealign
+  /ihint_shared_obj_id [
+    ihint_shared_cnt {
+      hint_stream hint_sobits bitread
+    } repeat
+  ] readonly def
+
+  ihint_shared_obj_id dump_array
+} bind def
+
+% Enumerate all documented hint tables.
+/dump_all_tables {  % <<stream>> dump_all_tables -
+  (Page offset hint table) table_header
+  hint_stream 0 set_align
+  dump_page_offset_table
+
+  (S, Shared object hint table) table_header
+  dup /S .knownget {
+    hint_stream exch set_align
+    dump_shared_object_table
+  } {
+    (Required table is not found.) error_msg
+  } ifelse
+
+  dup /T .knownget {
+    (T, Thumbnail hint table) table_header
+    hint_stream exch set_align
+    dump_thumbnail_table
+  } if   
+
+  dup /O .knownget {
+    (O, Outline hint table) table_header
+    hint_stream exch set_align
+    dump_generic_table
+  } if
+
+  dup /A .knownget {
+    (A, Thread information hint table) table_header 
+    hint_stream exch set_align
+    dump_generic_table
+  } if
+
+  dup /E .knownget {
+    (E, Named destination hint table) table_header
+    hint_stream exch set_align
+    dump_generic_table
+  } if
+
+  dup /V .knownget {
+    (V, Interactive form hint table) table_header
+    hint_stream exch set_align
+    dump_interactive_table
+  } if
+
+  dup /I .knownget {
+    (I, Information dictionary hint table) table_header
+    hint_stream exch set_align
+    dump_generic_table
+  } if
+
+  dup /C .knownget {
+    (C, Logical structure hint table) table_header
+    hint_stream exch set_align
+    dump_interactive_table
+  } if
+
+  dup /L .knownget {
+    (L, Page label hint table) table_header
+    hint_stream exch set_align
+    dump_generic_table
+  } if
+
+    pop
+} bind def
+
+
+% Load PDF file and extract the hint stream.
+/pdf_dump_hints {                             % <infile> pdf_dump_hints -
+  dup (r) file                                % fname
+  false exch                                  % fname F file 
+  {
+    dup 7 string readstring pop               % fname F file ()
+    (%PDF-1.) ne { pop exit } if              % fname F file
+    dup 0 setfileposition
+    dup token not { pop exit } if             % fname F file obj
+    dup type /integertype ne { pop exit } if  % fname F file obj
+    1 index token not { pop pop exit } if     % fname F file obj gen
+    dup type /integertype ne {pop pop exit}if % fname F file obj gen
+    4 2 roll                                  % fname obj gen F file
+    dup 0 setfileposition
+    exch true or                              % fname obj gen file T
+    exit
+  } loop
+  {
+    pdfdict begin
+    pdfopenfile dup begin
+    40 dict begin
+    /IDict exch def
+    .setsafe
+
+    % Read all objects into memory.
+    Trailer touch
+    resolveR                                  % fname <<>>
+    dup /Linearized known {
+      dup /L get                              % fname <<>> Len
+      3 -1 roll status not { 0 0 0 0 } if     % <<>> Len
+      pop pop exch pop                        % <<>> Len len
+      eq {
+        /LinearizationParams exch def
+        LinearizationParams /H get
+        dup length 2 eq {
+          0 get PDFoffset add PDFfile exch setfileposition
+          PDFfile token pop 
+          PDFfile token pop
+          resolveR dup true resolvestream
+          /ReusableStreamDecode filter 
+          bitstream dup bytealign
+          /hint_stream exch def
+
+          dump_all_tables
+        } {
+          pop
+          (Overflow hint stream is not supported.) =
+        } ifelse
+      } {
+        pop
+        (Wrong file length in linearization dictionary.) =
+      } ifelse
+    } {
+      pop (The file is not linearized.) =
+    } ifelse
+    end		% temporary dict
+    end		% IDict
+    end
+  } {
+    pop
+    (Input file is not a valid PDF file.) =
+  } ifelse
+} bind def
+
+% Initial setup
+/dump_hints {
+  counttomark 1 eq {
+    exch pop
+    save exch
+    3000000 setvmthreshold
+    pdfoptdict begin 
+    pdf_dump_hints
+    end
+    restore
+    true
+  } {
+    cleartomark false
+  } ifelse
+} bind def
+
+/shellarguments {false} def
+(pdfopt.ps) runlibfile
+currentdict /shellarguments undef
+
+% Check for command line arguments.
+mark shellarguments {
+  dump_hints not {
+    (Usage: gs -dNODISPLAY  -- dumphint.ps input.pdf) = flush
+  } if
+} {
+  pop
+} ifelse
+
+% EOF

+ 12 - 14
sys/lib/ghostscript/errpage.ps

@@ -1,22 +1,20 @@
 %!
 %    Copyright (C) 1992, 1996, 1998 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: errpage.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: errpage.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Print an informative error page if an error occurs.
 % Inspired by Adobe's `ehandler.ps' and David Holzgang's PinPoint.
 

+ 23 - 25
sys/lib/ghostscript/font2c.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1992, 1993, 1994, 1995, 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: font2c.ps,v 1.3 2001/09/13 23:16:29 lpd Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: font2c.ps,v 1.6 2003/07/10 02:56:51 ray Exp $
 % font2c.ps
 % Write out a PostScript Type 0 or Type 1 font as C code
 % that can be linked with the interpreter.
@@ -206,7 +204,7 @@ end
     } bind def
 % Write a packed string/name/null array.
    /wsna	% <name> <(string|name|null)*> wsna -
-    { (\tstatic const char ) ws exch wt ([] = {) wl
+    { (\tstatic const unsigned char ) ws exch wt ([] = {) wl
       { wsn } forall
       (\t0\n};) wl
     } bind def
@@ -294,11 +292,11 @@ end def
       /packedarraytype
 	/arraytype load def
       /realtype
-       { (\tmake_real\(&) ws exch wt (, ) ws
+       { (\tmake_real\(&) ws exch wt (, (float)) ws
          wt (\);) wl true
        } bind def
       /stringtype
-       { ({\tstatic const char s_[] = ) ws
+       { ({\tstatic const unsigned char s_[] = ) ws
          dup dup can_wcs { wcs } { wcca } ifelse
 	 (;) wl
 	 (\tmake_const_string\(&) ws exch wt
@@ -362,7 +360,7 @@ end def
      { { { type dup /nulltype eq exch /stringtype eq or } isall }
        { ({) ws dup (sa_) exch wsna
 	 (\tcode = (*pprocs->string_array_create)\(i_ctx_p, &) ws exch wt
-	 (, sa_, ) ws dup length wt (, ) ws wpa (\);) wl
+	 (, \(const char *\)sa_, ) ws dup length wt (, ) ws wpa (\);) wl
 	 (\tif ( code < 0 ) return code;) wl
 	 (}) wl true
        }
@@ -371,7 +369,7 @@ end def
      { { { type /nametype eq } isall }
        { ({) ws dup (na_) exch wsna
 	 (\tcode = (*pprocs->name_array_create)\(i_ctx_p, &) ws 1 index wt
-	 (, na_, ) ws dup length wt (\);) wl
+	 (, \(const char *\)na_, ) ws dup length wt (\);) wl
 	 (\tif ( code < 0 ) return code;) wl
 	 wap (}) wl true
        }
@@ -380,11 +378,11 @@ end def
      { { iswproc }
        { dup cvos
 		% Stack: name proc string
-	 ({\tstatic const char s_[] = ) ws
+	 ({\tstatic const unsigned char s_[] = ) ws
          dup dup can_wcs { wcs } { wcca } ifelse
 	 (;) wl
 	 (\tcode = (*pprocs->ref_from_string)\(i_ctx_p, &) ws 2 index wt
-	 (, s_, ) ws length wt (\);) wl
+	 (, \(const char *\)s_, ) ws length wt (\);) wl
 	 (\tif ( code < 0 ) return code;) wl
 	 wap (}) wl true
 	 wtempname deletefile
@@ -414,7 +412,7 @@ end def
       (\t { 0, 0, ) ws length wt (, ) ws 3 -1 roll wt (, ) ws
       dup wpa (, ) ws dup wva ( };) wl pop
       (\tcode = \(*pprocs->ref_dict_create\)\(i_ctx_p, &) ws wt
-      (, &keys_, str_keys_, v_\);) wl
+      (, &keys_, \(const char *\)str_keys_, v_\);) wl
       (\tif ( code < 0 ) return code;) wl
       (}) wl
       (}) wl
@@ -484,11 +482,11 @@ end def
    /CharStrings
     { ({) wl
       dup wcdkeys
-      (static const char values_[] = {) wl
+      (static const unsigned char values_[] = {) wl
        { wsn } cdforall
       (\t0\n};) wl
       (\tcode = \(*pprocs->string_dict_create\)\(i_ctx_p, &) ws wt
-      (, &keys_, str_keys_, values_\);) wl
+      (, &keys_, (const char *)str_keys_, \(const char *\)values_\);) wl
       (\tif ( code < 0 ) return code;) wl
       (}) wl
     } bind def
@@ -499,7 +497,7 @@ end def
       (static const ref_(float) values_[] = {) wl
       dup { (\t) ws wnums () wl } cdforall
       (\t0\n};) wl
-      (static const char lengths_[] = {) wl
+      (static const unsigned char lengths_[] = {) wl
        { (\t) ws dup isnumber
 	  { pop 0 }
 	  { length 1 add }

+ 18 - 20
sys/lib/ghostscript/font2pcl.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1993, 1994, 1995, 1997 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: font2pcl.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: font2pcl.ps,v 1.5 2002/06/02 12:03:28 mpsuzuki Exp $
 % font2pcl.ps
 % Write out a font as a PCL bitmap font.
 
@@ -123,7 +121,7 @@ pcldict begin		% internal procedures
 		% Stack: rw rh ymin ymax1 xmin xmax1
    3 index 1 4 index 1 sub
     { currentdevice exch row copyscanlines .findzeros
-      exch 4 1 roll max 3 1 roll min exch
+      exch 4 1 roll .max 3 1 roll .min exch
     }
    for		% xmin xmax1
 		% Special check: xmin > xmax1 if height = 0
@@ -285,8 +283,8 @@ currentdict readonly end pop		% pcldict
     { 0 exch transform exch pop negY ulwidth 2 div add }
     { ully ulwidth add }
    ifelse u0y sub
-   round cvi 1 max 255 min (Underline Position) wbyte
-   ulwidth round cvi 1 max 255 min (Underline Thickness) wbyte
+   round cvi 1 .max 255 .min (Underline Position) wbyte
+   ulwidth round cvi 1 .max 255 .min (Underline Thickness) wbyte
    grestore
    uh 1.2 mul 4 mul cvi (Text Height) wword
    (average lowercase character) dup stringwidth
@@ -307,7 +305,7 @@ currentdict readonly end pop		% pcldict
    0 (Cap Height) wword			% (default)
    currentfont /UniqueID known { UniqueID } { 0 } ifelse
      16#c1000000 add (Font Number (Adobe UniqueID)) wdword
-   FontName length 16 max string
+   FontName length 16 .max string
      dup FontName exch cvs pop
      outfile exch 0 16 getinterval writestring	% Font Name
    WriteResolution?
@@ -421,8 +419,8 @@ currentdict readonly end pop		% pcldict
    ixbbox
      negY /rury exch def  /rurx exch def
      negY /rlly exch def  /rllx exch def
-     /rminx rllx rurx min def
-     /rminy rlly negY rury negY min def
+     /rminx rllx rurx .min def
+     /rminy rlly negY rury negY .min def
      /rw rurx rllx sub abs def
      /rh rury rlly sub abs def
    gsave rot neg rotate

+ 11 - 13
sys/lib/ghostscript/gs_agl.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_agl.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_agl.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 
 % This file was derived from the Adobe Glyph List, version 1.2, dated
 % 22 Oct 1998, at

+ 35 - 36
sys/lib/ghostscript/gs_btokn.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1994, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_btokn.ps,v 1.5 2001/09/15 07:11:00 masata-y Exp $
+% $Id: gs_btokn.ps,v 1.9 2002/04/19 06:52:25 lpd Exp $
 % Initialization file for binary tokens.
 % When this is run, systemdict is still writable,
 % but everything defined here goes into level2dict.
@@ -144,16 +142,20 @@ mark
 % 480
 	/DeviceN
 % 481 -- end
-.packtomark
-dup /SystemNames exch def .installsystemnames
+.packtomark .installsystemnames
 
 % Define printobject and writeobject.
 % These are mostly implemented in PostScript, so that we don't have to
 % worry about interrupts or callbacks when writing to the output file.
 
 % Define procedures for accumulating the space required to represent
-% an object in binary form.
-/cntdict mark		% <#refs> <#chars> <obj> -proc- <#refs> <#chars>
+% an object in binary form.  The procedures for composite objects (arrays
+% and dictionaries) leave different results on the stack:
+%	<#refs> <#chars> <simple_obj> -proc- <#refs> <#chars>
+%	<#refs> <#chars> <array|dict> -proc- <array|dict> <#refs> <#chars>
+% This is required so that .writeobjects can also accumulate the actual
+% list of composite objects to write in the binary object sequence.
+/cntdict mark
   /integertype /pop load
   /realtype 1 index
   /marktype 1 index
@@ -164,16 +166,19 @@ dup /SystemNames exch def .installsystemnames
   /arraytype null
   /dicttype null
 .dicttomark def
+/.cntobj {	% <<arguments and results as for procedures in cntdict>>
+  dup type //cntdict exch get exec
+} .bind def
 cntdict /arraytype {
-  dup length 4 -1 roll add 3 1 roll {
-    dup type //cntdict exch get exec
-  } forall
+  dup dup length 5 -1 roll add 4 2 roll { .cntobj } forall
 } bind put
 cntdict /dicttype {
   WRITEDICTS {
     dup dup length 2 mul 5 -1 roll add 4 2 roll {
-      4 1 roll dup type //cntdict exch get exec
-      3 -1 roll dup type //cntdict exch get exec
+	% We have to use .execn here, rather than simply rolling the
+	% value under the top elements, because key might involve arrays
+	% or dictionaries.
+      cvlit {.cntobj} exch 2 .execn .cntobj
     } forall
   } {
     /writeobject load /typecheck signalerror
@@ -213,20 +218,13 @@ cntdict /dicttype {
 
   dup length 0 3 -1 roll
 	% Stack: file tag -mark- #refs #chars array
-  dup 4 1 roll {
-      dup type /arraytype eq {
-	  % Nested array. An element of the array is also
-	  % an array(sub array). Push the sub array to the stack.
-	  dup 4 1 roll
-      } if
-      dup type //cntdict exch get exec
-   } forall
+  dup 4 1 roll { .cntobj } forall
 
 	% Write the header.
 
-	% Stack: file tag -mark- array1 ... array|dictN #refs #chars
+	% Stack: file tag -mark- array1 ... (array|dict)N #refs #chars
   counttomark 3 add -2 roll 4 1 roll
-	% Stack: -mark- array1 ... array|dictN tag #refs #chars file
+	% Stack: -mark- array1 ... (array|dict)N tag #refs #chars file
   dup counttomark 1 sub index length
   4 index 3 bitshift 4 index add
   (xxxxxxxx) .bosheader writestring
@@ -236,13 +234,14 @@ cntdict /dicttype {
   3 1 roll pop
   counttomark 1 sub index length 3 bitshift exch
   3 bitshift
-	% Stack: -mark- array1 ... array|dictN tag file ref# char#
+	% Stack: -mark- array1 ... (array|dict)N tag file ref# char#
   counttomark 4 sub {
     counttomark -1 roll dup 6 1 roll
+	% Stack: ... objN tag file ref# char# objN
     dup type /dicttype eq {		% can't be first object
-      { 5 1 roll (xxxxxxxx) .bosobject
+      { 5 1 roll (x\000xxxxxx) .bosobject
 	3 index exch writestring
-	4 -1 roll (xxxxxxxx) .bosobject
+	4 -1 roll (x\000xxxxxx) .bosobject
 	3 index exch writestring
       } forall
     } {
@@ -294,7 +293,7 @@ cntdict /dicttype {
 /.objectprinttest {		% <obj> .objectprinttest -
 		% This is a pseudo-operator so it will restore the stack
 		% if it gets an error.
-  0 0 2 index roll dup type //cntdict exch get exec pop pop pop
+  mark 0 0 3 index .cntobj cleartomark pop
 } bind odef
 /.printerror {
   $error /binary get .languagelevel 2 ge and {

+ 12 - 14
sys/lib/ghostscript/gs_ccfnt.ps

@@ -1,25 +1,23 @@
 %    Copyright (C) 1994, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_ccfnt.ps,v 1.5 2001/10/01 05:25:55 lpd Exp $
+% $Id: gs_ccfnt.ps,v 1.8 2003/04/12 18:08:18 ray Exp $
 % 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

+ 11 - 13
sys/lib/ghostscript/gs_ce_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_ce_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_ce_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the Adobe CE (Central European) encoding vector.
 % We define it by differences from the ISOLatin1Encoding vector.
 /CEEncoding

+ 117 - 98
sys/lib/ghostscript/gs_cff.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1997, 1998, 1999, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gs_cff.ps,v 1.10 2001/10/12 08:52:14 igorm Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_cff.ps,v 1.19 2005/07/18 05:51:57 ray Exp $
 % Loader for CFF (compressed) fonts, including OpenType CFFs.
 % The following are not implemented yet:
 %	Deleted entries in the Name Index
@@ -59,7 +57,7 @@
       pop pop /.loadottofontfile cvx /invalidfont signalerror
     } if
     f 4 string readstring pop (CFF ) eq { sub exit } if
-    1 sub
+    f 12 string readstring pop pop 1 sub	% skip to next table
   } loop
 		% Stack: tablesread
   card32 pop card32 card32
@@ -186,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
@@ -205,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>
@@ -232,18 +230,20 @@ def
 /sid		% - <sid> sid
   /card16 load
 def
-/Index {	% - Index <array>
+/Index {	% <name> Index <name> <array>
+  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
+  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,9 +314,14 @@ def
 % ------ Top dictionary ------ %
 
 /offput {	% <offset> <proc> offput -
-  DEBUG { (queued: ) print 1 index =only ( ) print dup === } if
-  currentdict exch aload length 1 add packedarray cvx
-  offsets 3 1 roll put
+  1 index 0 le
+  CFFDEBUG { dup { (not ) print } if (queued: ) print 2 index =only ( ) print 1 index === } if
+  { pop pop
+  }
+  { currentdict exch aload length 1 add packedarray cvx
+      offsets 3 1 roll put
+  }
+  ifelse
 } bind def
 /queueput {	% <font> <proc> queueput -
   16#7fffffff offsets { pop .min } forall
@@ -325,17 +330,23 @@ def
   [ queued aload pop counttomark 2 add -1 roll ]
   /queued exch store
 } bind def
+/printvk {	% <value> <key> printvk <value> <key>
+  CFFDEBUG { (\t% ) print dup =only ( = ) print 1 index === } if
+} bind def
 /xxput {	% <value> <key> <dict> xxput -
   3 1 roll exch put
 } bind def
 /putfi {	% <value> <key> putfi -
-  FontInfo xxput
+  printvk FontInfo xxput
 } bind def
 /xdef {		% <value> <key> xdef -
   exch def
 } bind def
+/pxdef {	% <value> <key> pxdef -
+  printvk xdef
+} bind def
 /topdictops mark
-  12 { exit }
+  12 { CFFDEBUG { (\t% EOD) = } if exit }
   0 { idstring /version putfi }
   1 { idstring /Notice putfi }
   32 { idstring /Copyright putfi }
@@ -346,14 +357,15 @@ def
   34 { /ItalicAngle putfi }
   35 { /UnderlinePosition putfi }
   36 { /UnderlineThickness putfi }
-  37 { /PaintType xdef }
-  38 { /FontType xdef }		% actually CharstringType
-  39 { counttomark array astore /FontMatrix xdef }
-  13 { /UniqueID xdef }
-  5 { counttomark array astore /FontBBox xdef }
-  40 { /StrokeWidth xdef }
-  14 { counttomark array astore /XUID xdef }
+  37 { /PaintType pxdef }
+  38 { /FontType pxdef }		% actually CharstringType
+  39 { counttomark array astore /FontMatrix pxdef }
+  13 { /UniqueID pxdef }
+  5 { counttomark array astore /FontBBox pxdef }
+  40 { /StrokeWidth pxdef }
+  14 { counttomark array astore /XUID pxdef }
   15 {
+    /charset printvk pop
     dup StandardCharsets length lt {
       StandardCharsets exch get /charset xdef
     } {
@@ -361,6 +373,7 @@ def
     } ifelse
   }
   16 {
+    /Encoding printvk pop
     dup StandardEncodings length lt {
       /Encoding xdef
     } {
@@ -379,20 +392,21 @@ def
     /CIDFontType 0 def
     /CIDCount 8720 def % Default value defined in CFF spec.
     3 dict begin
-    /Supplement xdef
-    idstring /Ordering xdef
-    idstring /Registry xdef
+    /Supplement pxdef
+    idstring /Ordering pxdef
+    idstring /Registry pxdef
     /CIDSystemInfo currentdict end def
   }
-  63 { /CIDFontVersion xdef }
-  64 { /CIDFontRevision xdef }
-  65 { /CIDFontType xdef }
-  66 { /CIDCount xdef }
-  67 { /UIDBase xdef }
+  63 { /CIDFontVersion pxdef }
+  64 { /CIDFontRevision pxdef }
+  65 { /CIDFontType pxdef }
+  66 { /CIDCount pxdef }
+  67 { /UIDBase pxdef }
   68 { { readFDArray } offput }
   69 { { readFDSelect } offput }
 	% This operator only appears in a FDArray element.
-  70 { idstring /FontName exch def }
+	% We don't really need it, so ignore an error.
+  70 { { idstring } .internalstopped { pop pop } { /FontName pxdef } ifelse }
 .dicttomark readonly def
 
 % readcharset and readFDSelect may require the length of CharStringArray,
@@ -474,7 +488,7 @@ def
 % ------ FDArray and FDSelect ------ %
 
 /readFDArray {		% <font> readFDArray -
-  Index exch
+  /FDarray Index exch pop exch
   2 dict begin /f null def begin
   [ exch {
     dup length subfilefilter /f exch store
@@ -487,18 +501,22 @@ def
   } forall ] /FDArray xdef end end
 } bind def
 
-% Note: this implementation can overflow the operand stack.
-% We'll fix this if it ever becomes necessary.
 /fdselectformats [
-{ [ exch charstringcount pop { card8 } repeat ] } bind
-{ /FDSelect cvx /invalidfont signalerror } bind
-dup
-{ pop [ card16 card16 exch {
-		% Stack: previndex
-    card8 card16 dup 4 1 roll 3 -1 roll sub 1 sub {
-      exch 1 index
-    } repeat exch
-  } repeat pop ]
+% Note: this procedure can overflow the operand stack.
+% We'll fix this if it ever becomes necessary.
+{ [ exch charstringcount pop { card8 } repeat ] } bind	% Format 0
+{ /FDSelect cvx /invalidfont signalerror } bind		% Format 1
+dup							% Format 2
+% The following procedure does not use excessive op-stack space.
+{ pop 65535 array card16 card16 exch			% Format 3
+  { % Stack: array previndex
+    card8 card16 
+    exch 1 index 4 -1 roll
+    exch 1 exch 1 sub
+    { 3 index exch 2 index put } for pop
+  } repeat
+  % now resize the array to the final index.
+  0 exch getinterval
 } bind
 ] readonly def
 
@@ -515,31 +533,31 @@ dup
 } bind def
 
 /privatedictops mark
-  12 { exit }
-  6 { deltarray /BlueValues xdef }
-  7 { deltarray /OtherBlues xdef }
-  8 { deltarray /FamilyBlues xdef }
-  9 { deltarray /FamilyOtherBlues xdef }
-  41 { /BlueScale xdef }
-  42 { /BlueShift xdef }
-  43 { /BlueFuzz xdef }
-  10 { 1 array astore /StdHW xdef }
-  11 { 1 array astore /StdVW xdef }
-  44 { deltarray /StemSnapH xdef }
-  45 { deltarray /StemSnapV xdef }
-  46 { 0 ne /ForceBold xdef }
-  47 { /ForceBoldThreshold xdef }
-  48 { /lenIV xdef }
-  49 { /LanguageGroup xdef }
-  50 { /ExpansionFactor xdef }
-  51 { /initialRandomSeed xdef }
+  12 { CFFDEBUG { (\t% EOD) = } if exit }
+  6 { deltarray /BlueValues pxdef }
+  7 { deltarray /OtherBlues pxdef }
+  8 { deltarray /FamilyBlues pxdef }
+  9 { deltarray /FamilyOtherBlues pxdef }
+  41 { /BlueScale pxdef }
+  42 { /BlueShift pxdef }
+  43 { /BlueFuzz pxdef }
+  10 { 1 array astore /StdHW pxdef }
+  11 { 1 array astore /StdVW pxdef }
+  44 { deltarray /StemSnapH pxdef }
+  45 { deltarray /StemSnapV pxdef }
+  46 { 0 ne /ForceBold pxdef }
+  47 { /ForceBoldThreshold pxdef }
+  48 { /lenIV pxdef }
+  49 { /LanguageGroup pxdef }
+  50 { /ExpansionFactor pxdef }
+  51 { /initialRandomSeed pxdef }
   19 { PrivateStart add { readSubrs } offput }
-  20 { /defaultWidthX xdef }
-  21 { /nominalWidthX xdef }
+  20 { /defaultWidthX pxdef }
+  21 { /nominalWidthX pxdef }
 	% Multiple Master fonts only
-  59 { /NDV xdef }
-  60 { /CDV xdef }
-  61 { /lenBuildCharArray xdef }
+  59 { /NDV pxdef }
+  60 { /CDV pxdef }
+  61 { /lenBuildCharArray pxdef }
 .dicttomark readonly def
 
 /readPrivate {		% <font> <size> readPrivate -
@@ -574,7 +592,7 @@ dup
 		% 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
   } {
@@ -586,7 +604,7 @@ dup
 		% 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
@@ -604,7 +622,7 @@ dup
 		% 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
@@ -649,7 +667,7 @@ dup
   /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.
 
@@ -693,24 +711,25 @@ dup
   } forall ] def
 
 	% Read other tables with queued offsets.
-
-  DEBUG { (offsets: ) print [ offsets { pop } forall ] == } if
-  { /f cff def
-    DEBUG { (pos=) print pos = } if
-    offsets pos 2 copy .knownget not { pop pop exit } if
-    3 1 roll undef
-    DEBUG { (exec queued: ) print dup == } if
-    exec
+        % We process these in order so we can advance if needed.
+	% The CFF file may not be positionable.
+  {		% outer loop since offsets may be updated when processing
+    CFFDEBUG { (offsets: ) print [ offsets { pop } forall ] == } if
+    [ offsets { pop } forall ] { lt } .sort	% process in order of appearance
+    { 
+      /f cff def
+      CFFDEBUG { (queued offset: ) print dup =print flush (, current pos=) print pos = } if
+      dup pos ne { dup pos sub nextstring pop } if	% negative advance will cause error
+      offsets exch 2 copy get 3 1 roll undef
+      CFFDEBUG { (exec queued: ) print dup == } if
+      exec
+    } forall
+    offsets length 0 eq { exit } if
   } loop
-  offsets length 0 ne {
-    (Error: missing tables at ) print [ offsets { pop } forall ] ==
-    (Current position is ) print pos ==
-    flush stop
-  } if
 
 	% 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.
@@ -724,10 +743,10 @@ dup
 	% 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.

+ 94 - 148
sys/lib/ghostscript/gs_cidcm.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 2000 artofcode LLC.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gs_cidcm.ps,v 1.5 2001/07/01 08:55:34 igorm Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_cidcm.ps,v 1.12 2004/10/25 15:11:37 igor Exp $
 % Extending Font resource category with CIDFont-CMap fonts.
 
 languagelevel 2 .setlanguagelevel currentglobal true setglobal
@@ -31,7 +29,7 @@ languagelevel 2 .setlanguagelevel currentglobal true setglobal
 % resource files. This supposes that document doesn't uninstall
 % resource files. To disable caching, set enable_cache to false.
 
-% We suppose that names starting with '.prs' do not appear in resource files.
+% We assume that names starting with '.prs' do not appear in resource files.
 % If this causes any problem, this prefix should be systematically changed
 % in this file.  ('prs' is an abbreviation for 'prescan'.)
 
@@ -41,8 +39,8 @@ languagelevel 2 .setlanguagelevel currentglobal true setglobal
 
 /.prs_dict currentdict def       % self-reference (constant)
 /.prs_empty 0 dict readonly def  
-/path_buffer 255 string def
-/name_buffer 255 string def
+/path_buffer 8192 string def
+/name_buffer 1024 string def
 /minus (-) 0 get def             % character code constant for '-'
 /period (.) 0 get def            % character code constant for '.'
 /CMap 10 dict def                % CSI cache for CMaps
@@ -130,51 +128,74 @@ currentdict end def
   %
   % Returns an empty dictionary if no CIDSystemInfo is found.
 
+  RESMPDEBUG { (cidcm GetCIDSystemInfoFromFile beg) = } if
   //.prs_dict begin
   /.prsFile exch def
   /.prsResult //.prs_empty def
   /.prsDictCount countdictstack def
+  RESMPDEBUG { (cidcm GetCIDSystemInfoFromFile will PrescanFile.) = } if
   { //PrescanFile } stopped pop
   //.prs_dict /.prsResult get
   end
+  RESMPDEBUG { (cidcm GetCIDSystemInfoFromFile end) = } if
 } bind def
 
 /GetCIDSystemInfo {     % <InstName> <CatName> GetCIDSystemInfo <CSI>
   
   % Retrieve CSI, using caches.
-  
-  2 copy resourcestatus {
+
+  RESMPDEBUG { (cidcm GetCIDSystemInfo beg) = } if
+  /Category findresource begin                % /InstName
+  dup ResourceStatus 
+  {
     pop 2 lt {
-      findresource /CIDSystemInfo .knownget not {
+      FindResource /CIDSystemInfo .knownget not {
         //.prs_empty
+      } if                                    % CSI
+    } {                                       % /InstName
+      currentdict /GetCIDSystemInfoFromMap .knownget {
+        exec
       } if
-    } {                                                      
-      dup //.prs_dict exch get                % /InstName /CatName CSIs
-      dup 3 index known
-      //enable_cache and {                            
-        exch pop exch get                     % CSI
-      } {                                                  
-        3 1 roll                              % CSIs /InstName /CatName
-        /Category findresource begin          % CSIs /InstName
-        dup //path_buffer ResourceFileName    % CSIs /InstName (path)
-        end                                   
-        currentglobal exch true setglobal     % CSIs /InstName g
-        mark exch                             % CSIs /InstName g [ (path)
-        { (r) file                            % CSIs /InstName g [ file
-          //GetCIDSystemInfoFromFile exec     % CSIs /InstName g [ CSI
-        } stopped {
-          cleartomark //.prs_empty             
+      dup type /nametype eq
+      {
+        RESMPDEBUG { (cidcm GetCIDSystemInfo got a name.) = } if
+        //.prs_dict Category get              % /InstName CSIs
+        dup 2 index known
+        //enable_cache and {
+          RESMPDEBUG { (cidcm GetCIDSystemInfo from cache.) = } if
+          exch get                            % CSI
         } {
-          exch pop
-        } ifelse                              % CSIs /InstName g CSI
-        exch setglobal                        % CSIs /InstName CSI
-        dup 4 1 roll                          % CSI CSIs /InstName CSI
-        put                                   % CSI
-      } ifelse
+          RESMPDEBUG { (cidcm GetCIDSystemInfo from file.) = } if
+          exch                                % CSIs /InstName
+          dup //path_buffer ResourceFileName  % CSIs /InstName (path)
+          RESMPDEBUG { (cidcm GetCIDSystemInfo from file ) print dup = } if
+          currentglobal exch true setglobal   % CSIs /InstName g (path)
+          mark exch                           % CSIs /InstName g [ (path)
+          { (r) file                          % CSIs /InstName g [ file
+            //GetCIDSystemInfoFromFile exec   % CSIs /InstName g [ CSI
+          } stopped {
+            cleartomark //.prs_empty             
+          } {
+            exch pop
+          } ifelse                            % CSIs /InstName g CSI
+          exch setglobal                      % CSIs /InstName CSI
+          dup 4 1 roll                        % CSI CSIs /InstName CSI
+          put                                 % CSI
+          RESMPDEBUG {
+            (cidcm GetCIDSystemInfo got from file : <<) print
+            dup { exch //=string cvs print ( ) print
+                       //=string cvs print ( ) print
+            } forall
+            (>>) =
+          } if
+        } ifelse
+      } if
     } ifelse
   } {
-    pop pop //.prs_empty
+    pop //.prs_empty
   } ifelse
+  end
+  RESMPDEBUG { (cidcm GetCIDSystemInfo end) = } if
 } bind def
 
 /IsCompatibleCSI {  % <CSI-M> <CSI-F> IsCompatibleCSI <bool>
@@ -214,10 +235,9 @@ currentdict end def
   } loop
 } bind def
 
-/IsComposedOK {     % <CIDFontName> <CMapName> IsComposedOK <bool>
+/IsWellComposed {     % <CIDFontName> <CMapName> IsWellComposed <bool>
   
   % Check if the given CIDFont and CMap have compatible CSIs.
-
   exch                                  % /CMapName /CIDFontName
   /CIDFont //GetCIDSystemInfo exec      % /CMapName CSI-F
   dup type /dicttype eq {
@@ -256,7 +276,7 @@ currentdict end def
         1 add dup                       % (FontName) i /CIDFontName (FontName) i1 i1
         5 index length                  % (FontName) i /CIDFontName (FontName) i1 i1 l
         exch sub getinterval cvn        % (FontName) i /CIDFontName /CMapName
-        2 copy //IsComposedOK exec {    % (FontName) i /CIDFontName /CMapName 
+        2 copy //IsWellComposed exec {  % (FontName) i /CIDFontName /CMapName 
           4 2 roll pop pop              % /CIDFontName /CMapName
           stop
         } if
@@ -282,81 +302,11 @@ currentdict end def
   add 0 exch getinterval                  % (CIDFont-CMap)
 } bind def
 
-
-% Define a few procedure templates to be modified dynamically :
-
-currentpacking false setpacking
-
-/BindAux {   % <proc> BindAux <proc>
-  0 exec
-} bind def
-
-/EnumerateFontNames { %  - EnumerateFontNames ...
-  
-  % This is a pattern for enumeration procedure to be built dynamically,
-  % using Bind with a temporary dictionary.
-  % The following names will be replaced with specific objects
-  % during Bind : en_local_dict, scr, proc, Fonts, Category .
-
-  end % Category
-  { 
-    0 1 2 {
-      en_local_dict exch /status exch put
-      Fonts {                                            
-        en_local_dict /status get eq {            
-          scr cvs                           % ... (Font)
-          proc exec                         %
-        } {
-          pop
-        } ifelse                            % ...
-      } forall
-    } for                                   % ...
-  } stopped
-  Category begin
-  { stop } if
-} bind def
-
-setpacking
-
-/Bind {    % <proc> Bind <proc>
-  
-  % Make a copy of the given procedure, binding in the values of all names
-  % defined in currentdict.
-  % Caution : this code cannot handle procedures that were already
-  % bound recursively.
-
-  dup length array copy
-  dup length 1 sub -1 0 {                      
-    2 copy get                            % {precopy} i {elem}
-    dup dup type /arraytype eq exch xcheck and {
-                                          % {precopy} i {elem}
-      //BindAux exec                      % {precopy} i {elem_copy}
-      2 index 3 1 roll put                % {precopy}
-    } {
-      dup dup type /nametype eq exch xcheck and {
-                                          % {precopy} i {elem}
-        currentdict exch .knownget {            
-          2 index 3 1 roll put            % {precopy}
-        } {                                            
-          pop
-        } ifelse
-      } {
-        pop pop
-      } ifelse
-    } ifelse                              % {precopy}
-  } for                                   % {copy}
-  cvx
-} bind def
-
-//BindAux 0 //Bind put   % bind the recursive call in 'Bind'.
-
-
-
 % Redefine the /Font category with CIDFont-CMap construction :
 
 % The following code supposes that the following names are not
 % defined in the old /Font category dictionary :
-% /IsComposedFont, /Bind, /IsComposedOK, /EnumerateFontNames .
+% /IsComposedFont, /IsWellComposed .
 
 
 /Font /Category findresource dup length dict copy begin
@@ -377,7 +327,7 @@ setpacking
                    % <InstName> ResourceStatus false
   dup //ResourceStatus exec {                    
     3 2 roll pop true                     % nStatus nSize true
-  } {                                                  
+  } {
     //IsComposedFont exec {               % /CIDFontName /CMapName 
       /CMap resourcestatus {              % /CIDFontName nStatusM nSizeM 
         exch pop exch                     % nSizeM /CIDFontName 
@@ -414,21 +364,38 @@ setpacking
   % about fonts, CMaps and CIDFonts.
   % These dictionaries must be created dynamically, to allow for a possible 
   % recursive call to resourceforall from the resourceforall procedure.
-
   currentglobal false setglobal
   20 dict 20 dict 20 dict
+
   4 -1 roll setglobal                     % (templ) proc (scr) <<CIDFont>> <<CMap>> <<Fonts>>
 
-  % Store resource names into local dictionaries :
+  % Store resource identifiers into local dictionaries
+  % A resource instance can have a key that is not a name or a string. In this
+  % case, resourceforall passes the key directly to proc instead of copying it
+  % into the scratch string. This case can arise only for a resource instance
+  % defined in virtual memory by a previous defineresource
+
+  % Discard non-string keys of CIDFont and CMap because <CIDFontName>- -<CMapName>
+  % is only defined for names.
+
+  { /.DisableResourceOrdering pop % gs_resmp accesses this through execstack - don't remove !
+
+    5 index [ 2 index {exch //null put} aload pop ] cvx bind 5 index //ResourceForAll exec
 
-  5 index [ 2 index {exch cvn dup put} aload pop ] cvx 5 index //ResourceForAll exec
-  (*)     [ 3 index {exch cvn dup put} aload pop ] cvx 5 index /CMap resourceforall
-  (*)     [ 4 index {exch cvn dup put} aload pop ] cvx 5 index /CIDFont resourceforall
+    (*) [ 3 index {exch dup type /stringtype eq { cvn dup put } { pop pop } ifelse } aload pop
+        ] cvx bind 5 index /CMap resourceforall
+
+    (*) [ 4 index {exch dup type /stringtype eq { cvn dup put } { pop pop } ifelse } aload pop
+        ] cvx bind 5 index /CIDFont resourceforall
+
+    exit
+  } loop % This loop is a pattern for execstack_lookup - don't remove !
 
   %% Make the list of fonts in the form (/Name status) :
 
                                           % (templ) proc (scr) <<CIDFont>> <<CMap>> <<Fonts>>
   dup {                                              
+    pop dup
     //ResourceStatus exec {                        
       pop 2 index                         % (templ) proc (scr) <<CIDFont>> <<CMap>> <<Fonts>> /Name nStatus <<Font>>
       3 1 roll put                        % (templ) proc (scr) <<CIDFont>> <<CMap>> <<Fonts>>
@@ -450,7 +417,7 @@ setpacking
         } {                                            
           2 index                         % (templ) proc (scr) <<CMap>> <<Font>> /CIDFont /CMap /Font /CIDFont
           4 2 roll                        % (templ) proc (scr) <<CMap>> <<Font>> /Font /CIDFont /CIDFont /CMap
-          //IsComposedOK exec {                
+          //IsWellComposed exec {                
             exch 2 index exch 2 put       % (templ) proc (scr) <<CMap>> <<Font>> /CIDFont
           } {
             exch pop
@@ -464,32 +431,11 @@ setpacking
     pop pop                               % (templ) proc (scr) <<CMap>> <<Font>>
   } forall                                % (templ) proc (scr) <<CMap>> <<Font>>
   exch pop                                % (templ) proc (scr) <<Font>>
+  4 3 roll pop                            % proc (scr) <<Font>>
 
-  % Build the enumeration procedure :
-
-  % Since the resourceforall procedure may leave values on the operand stack,
-  % we cannot simply store the enumerator's local data on the stack.
-  % We also cannot use a static dictionary to store local variables,
-  % because of possible recursion in the resourceforall procedure.
-  % To work around this, we create a copy of the enumeration procedure and
-  % bind it dynamically with a temporary dictionary, which contains
-  % local variables for the currently executing instance of resourceforall.
-
-  currentdict
-  6 dict begin % the temporary dictionary
-    /Category exch def
-    /Fonts exch def
-    /scr exch def
-    /proc exch def
-    /en_local_dict currentdict def
-    //EnumerateFontNames //Bind exec      % (templ) Enumerator
-    /status 0 def % variable for the current status to enumerate - do not Bind with it !
-  end
-  exch pop                                % Enumerator
-
-  % Do the enumeration :
+  % Make the enumerator and apply it :
+  /MappedCategoryRedefiner /ProcSet findresource /MakeResourceEnumerator get exec exec
 
-  exec
 } bind def
 
 

+ 197 - 0
sys/lib/ghostscript/gs_ciddc.ps

@@ -0,0 +1,197 @@
+%    Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000 Aladdin Enterprises.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_ciddc.ps,v 1.14 2005/01/20 00:26:06 ray Exp $
+% Define Decoding and CIDDecoding resource categories and related procsets.
+
+languagelevel 2 .setlanguagelevel
+currentglobal true setglobal
+
+%----------------ParseDecoding procset----------------------------
+
+/ParseDecoding <<
+
+/Parse    % <resource_name> <num_tokens> Parse -
+{ dict begin                                  % /ResName
+  0                                           % /ResName nCode
+  { currentfile token not {
+      exit
+    } if                                      % /ResName nCode token
+    dup type /integertype eq {                % /ResName nCode
+       exch pop
+    } {
+      1 index def                             % /ResName nCode
+    } ifelse
+  } loop                                      % /ResName nCode
+  pop                                         % /ResName
+  currentdict end /Decoding                   % /ResName <<inst>> /Decoding
+  defineresource pop
+} bind
+
+>> /ProcSet defineresource pop
+
+%----------------Decoding category----------------------------
+
+/Generic /Category findresource dup length dict copy
+dup /InstanceType /dicttype put
+/Decoding exch /Category defineresource pop
+
+%----------------ParseCMap_Inverse procset----------------------------
+
+/ParseCMap_Inverse <<
+  /findresource { pop } bind
+  /defineresource { pop pop } bind
+  /dict {}
+  /def { pop pop } bind
+  /dup null
+  /begin { pop } bind
+  /end {}
+  /currentdict null
+  /CMapName null
+  /usecmap { pop } bind
+  /begincmap {}
+  /endcmap {}
+  /begincodespacerange { pop mark } bind
+  /endcodespacerange { cleartomark } bind
+  /beginnotdefrange { pop mark } bind
+  /endnotdefrange { cleartomark } bind
+  /beginbfchar { pop mark } bind
+  /endbfchar { pop mark } bind
+  /beginbfrange { begincidrange }
+  /endbfrange { endcidrange }
+  /begincidchar { beginbfchar }
+  /endcidchar { endbfchar }
+  /begincidrange { pop mark } bind
+  /endcidrange  { cleartomark } bind
+>>  % Just keep it on stack for a while.
+
+% Now we define another dict for local binding, than merge it with the previous one :
+dup length 5 add dict begin
+
+  /.Ranges 40 dict def % Key = CID/256, value = array of 256 integer codes.
+  //.Ranges /CIDCount 0 put
+
+  /.StringToInt     % <string> .StringToInt <integer>
+  { 0 exch { exch 8 bitshift add } forall
+  } bind def
+
+  /.SetCouple    % <I> <b> .SetCouple -
+  { exch                                    % b I
+    dup 256 idiv                            % b I I0
+    dup //.Ranges exch known not {
+      dup //.Ranges exch 256 array put
+    } if                                    % b I I0
+    //.Ranges exch get                      % b I [Range]
+    exch 256 mod                            % b [Range] I1
+    3 2 roll put                            %
+  } bind def
+
+  /endcidrange
+  { % Writes the inversed CMap to .Ranges
+    counttomark 3 idiv {                    % (b) (e) I
+      exch .StringToInt                     % (b) I e
+      3 2 roll .StringToInt                 % I e b
+      % Note : this code does't handle multidimentional CID ranges.
+      % fixme : optimize below.
+      dup 3 2 roll exch sub 1 add           % I b d
+      { 2 copy //.SetCouple exec            % I b
+        1 add exch 1 add exch
+      } repeat                              % I b
+      pop                                   % I
+      dup //.Ranges /CIDCount get gt {      % I
+        dup //.Ranges exch /CIDCount exch put
+      } if                                  % I
+      pop
+    } repeat
+    pop % mark
+  } bind def
+
+  /.GetCIDDecoding         % - .GetCIDDEcoding <dict>
+  { //.Ranges dup length dict copy
+    //.Ranges //.PurgeDict exec
+    //.Ranges /CIDCount 0 put
+  } bind def
+
+currentdict end
+exch copy % Merge the dicts - see above.
+/ProcSet defineresource pop
+
+%----------------CIDDecoding category----------------------------
+% Note that we put all instances in global memory - see FindResource.
+
+/Generic /Category findresource dup length dict copy
+begin
+  /Category /CIDDecoding def
+  /InstanceType /dicttype def
+
+  /.CMapChooser <<
+    % This lists CMaps to inverse and unite for creating a CIDDecoding.
+    % Choose by FAPIcidfmap.Registry concatenated with TrueType encoding ID.
+    % Font renderer must provide the glyph substitution internally.
+
+    /CNS1.Big5       [ /ETen-B5-H /ETen-B5-V ]
+    /CNS1.Unicode    [ /UniCNS-UCS2-H /UniCNS-UCS2-V]
+    /GB1.GB2312      [ /GBK-EUC-H /GBK-EUC-V ]
+    /GB1.Unicode     [ /UniGB-UCS2-H /UniGB-UCS2-V ]
+    /Japan1.ShiftJIS [ /90ms-RKSJ-H /90ms-RKSJ-V ]
+    /Japan1.Unicode  [ /UniJIS-UCS2-H  /UniJIS-UCS2-V]
+    /Japan2.ShiftJIS [ /90ms-RKSJ-H /90ms-RKSJ-V ]
+    /Japan2.Unicode  [ /UniHojo-UCS2-H ]
+    /Korea1.Johab    [ /KSC-Johab-V /KSC-Johab-H ]
+    /Korea1.Wansung  [ /KSCms-UHC-V /KSCms-UHC-H ]
+    /Korea1.Unicode  [ /UniKS-UCS2-H /UniKS-UCS2-V ]
+    /Identity.Symbol [ /Identity-H /Identity-V ]
+  >> def
+
+  /.MakeInstance    % <name> .MakeInstance <inst>
+  { dup                                              % /Name /Name
+    //.CMapChooser exch .knownget not {
+      (Can't build /) print =string cvs print ( /CIDDecoding resource. See gs_ciddc.ps . ) =
+      /findresource cvx /undefinedresource signalerror
+    } if                                             % /Name [CMaps]
+    exch pop                                         % [CMaps]
+    /CMap /Category findresource                     % [CMaps] <CMapCategory>
+    /ParseCMap_Inverse /ProcSet findresource         % [CMaps] <CMapCategory> <PCI>
+    3 2 roll {                                       % <CMapCategory> <PCI> /CMapName
+      3 2 roll begin                                 % <PCI> /CMapName
+      dup .ResourceFile not {
+        (Can't find CMap ) print =string cvs print ( building a CIDDecoding resource. ) =
+        /findresource cvx /undefinedresource signalerror
+      } if
+      currentdict end exch                           % <PCI> /CMapName <CMapCategory> file
+
+      3 index begin
+      cvx exec                                       % <PCI> /CMapName <CMapCategory>
+      end
+      exch pop exch                                  % <CMapCategory> <PCI>
+    } forall
+    exch pop begin                                   %
+    .GetCIDDecoding
+    end
+  } bind def
+
+  /FindResource      % <name> FindResource <dict>
+  { currentglobal exch                               % bGlobal /InstName
+    true setglobal
+    dup //.MakeInstance exec                         % bGlobal /InstName <Inst>
+    DefineResource                                   % bGlobal <Inst>
+    exch setglobal                                   % <Inst>
+  } bind def
+
+currentdict end
+/CIDDecoding exch /Category defineresource pop
+
+setglobal
+.setlanguagelevel

+ 129 - 0
sys/lib/ghostscript/gs_cidfm.ps

@@ -0,0 +1,129 @@
+%    Copyright (C) 2000 artofcode LLC.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_cidfm.ps,v 1.7 2004/10/25 15:11:37 igor Exp $
+% Redefine CIDFont category with cidfmap .
+
+languagelevel 2 .setlanguagelevel
+
+4 dict begin
+/CategoryName /CIDFont def
+
+/MapFileName (cidfmap) def
+
+/IsMyRecord      % <raw_record> -> <raw_record> bool
+{ % Only for client's needs.
+  dup type /nametype eq
+} bind def
+
+/RecordVirtualMethods 3 dict begin
+
+  /MakeInstance   % <Name> <record> MakeInstance <Name> <Instance> <size>
+  { % We know that currentdict is the category.
+    /Substitute get FindResource            % /Name <<CIDFont>>
+    dup length dict copy                    % /Name <<CIDFont>>
+    1 index ResourceStatus pop exch pop     % /Name <<CIDFont>> size
+  } bind def
+
+  /GetFilePath  % <scratch> <Name> <record> GetFilePath <filepath>
+  { % We know that currentdict is the category.
+    exch pop
+    /Substitute get exch ResourceFileName
+  } bind def
+
+  /GetSize   % <Name> <record> GetSize <size>
+  { % We know that currentdict is the category.
+    /Substitute get ResourceStatus {
+      exch pop exch pop
+    } {
+      /undefinedresource signalerror
+    } ifelse
+  } bind def
+
+  /GetCSI   % <record> GetCSI null
+  	    % <record> GetCSI dict
+  { % We know that currentdict is the category.
+    RESMPDEBUG { (cidfm GetCSI beg ) = } if
+    /Substitute get			% /Name
+    GetCIDSystemInfoFromMap
+    RESMPDEBUG { (cidfm GetCSI end ) print dup = } if
+  } bind def
+
+  /IsActive % <record> IsActive <bool>
+  { pop true
+  } bind def
+
+currentdict end def
+
+/VerifyMap  % <raw_map> VerifyMap -
+{ % Checks for vicious substitution cycles.
+  dup length dict copy                  % <<map>>
+  dup length dict                       % <<map>> <<temp>>
+  { % Choose a random record :
+    true 2 index {                      % <<map>> <<temp>> true /Name /Subs
+      3 2 roll pop false exit           % <<map>> <<temp>> /Name /Subs false
+    } forall
+    { exit                              % <<map>> <<temp>>
+    } if                                % <<map>> <<temp>> /Name /Subs
+    % Move the substitution chain to <<temp>>, checking for a cycle :
+    3 index 2 index undef               % <<map>> <<temp>> /Name /Subs
+    exch 2 index exch 0 put             % <<map>> <<temp>> /Subs
+    { //IsMyRecord exec not {
+        % Not a substitution, the chain terminates.
+        pop exit                        % <<map>> <<temp>>
+      } if                              % <<map>> <<temp>> /Subs
+      1 index 1 index known {
+        (Vicious substitution cycle in map file with the entry ) print =string cvs print ( .) =
+        /VerifyMap cvx /undefinedresource signalerror
+      } if                              % <<map>> <<temp>> /Subs
+      1 index 1 index 0 put
+      dup 3 index exch .knownget not {  % <<map>> <<temp>> /Subs
+        % No more substitutions, the chain terminates.
+        pop exit                        % <<map>> <<temp>>
+      } if                              % <<map>> <<temp>> /Subs /Subs1
+      exch                              % <<map>> <<temp>> /Subs1 /Subs
+      3 index exch undef                % <<map>> <<temp>> /Subs1
+    } loop
+    % Not cycled, now purge the <<temp>> :
+    { % Choose a random record :
+      true 1 index {                    % <<map>> <<temp>> true /Name /Subs
+        3 2 roll pop false exit         % <<map>> <<temp>> /Name /Subs false
+      } forall
+      { exit                            % <<map>> <<temp>>
+      } if                              % <<map>> <<temp>> /Name /Subs
+      % Remove it :
+      pop 1 index exch undef            % <<map>> <<temp>>
+    } loop
+  } loop
+  pop pop                               %
+} bind def
+
+/PreprocessRecord  % <map> <Name> <raw_record> PreprocessRecord <map> <Name> <record> <bool>
+{ //IsMyRecord exec {
+    1 dict begin
+    /Substitute exch def
+    /RecordVirtualMethods //RecordVirtualMethods def
+    currentdict end
+    true
+  } {
+    false
+  } ifelse
+} bind def
+
+currentdict end 
+
+/MappedCategoryRedefiner /ProcSet findresource /Redefine get exec
+
+.setlanguagelevel

+ 27 - 19
sys/lib/ghostscript/gs_cidfn.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1995, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gs_cidfn.ps,v 1.18 2000/12/08 23:35:38 lpd Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_cidfn.ps,v 1.27 2003/05/23 09:57:34 igor Exp $
 % ProcSet for implementing CIDFont and CIDMap resources.
 % When this is run, systemdict is still writable.
 
@@ -61,7 +59,7 @@ dup 0 {
     end
   } if
   1 index exch .buildfont9 exch pop
-} bind put
+} put % Don't bind it here, because gs_fapi.ps redefines .buildfont9
 
 % Add entries to a new CIDFontType 0 font per documentation (FontMatrix)
 % or for .buildfont9 (FDArray.Private.Subrs).
@@ -70,7 +68,10 @@ dup 0 {
   dup /FontMatrix known not {
     dup /FontMatrix [0.001 0 0 0.001 0 0] put
     dup /FDArray get {
-      /FontMatrix get [1000 0 0 1000 0 0] 1 index concatmatrix pop
+       currentglobal exch dup gcheck setglobal
+       dup /FontMatrix get [1000 0 0 1000 0 0] matrix concatmatrix
+       /FontMatrix exch put
+       setglobal
     } forall
   } if
   dup /FDArray get {
@@ -131,14 +132,14 @@ dup 0 {
 dup 1 {
   10 .checkfonttype pop
   1 index exch .buildfont10 exch pop
-} bind put
+} put % Don't bind it here because gs_fapi.ps redefines .buildfont10
 
 % ------ CIDFontType 2 (FontType 11) ------ %
 
 dup 2 {
   11 .checkfonttype pop
   1 index exch .buildfont11 exch pop
-} bind put
+} put % Don't bind it here because gs_fapi.ps redefines .buildfont11
 
 pop		% .cidfonttypes
 
@@ -178,7 +179,7 @@ pop		% .cidfonttypes
       mark 3 1 roll {
 		% Stack: mark str ... readproc length
 	dup 0 eq { pop exit } if
-	dup 65400 min dup string 3 index exec
+	dup 65400 .min dup string 3 index exec
 		% Stack: mark str ... readproc length newstrlen newstr
 	4 1 roll sub
       } loop
@@ -334,6 +335,10 @@ languagelevel exch 2 .setlanguagelevel
 % category with only a CIDFontType and no FontType.
 /.buildcidfont {		% <name> <fontdict> .buildcidfont
 				%   <name> <cidfont>
+  systemdict /ProvideUnicode .knownget not { false } if {
+    /FontEmulationProcs /ProcSet findresource
+    /ProvideUnicodeDecoding get exec
+  } if
   dup /CIDFontType get //.cidfonttypes exch get exec
 } odef
 
@@ -391,3 +396,6 @@ dup /.CheckResource {
 /Category defineresource pop
 
 .setlanguagelevel
+
+%% Replace 1 (gs_ciddc.ps)
+(gs_ciddc.ps) runlibfile

+ 139 - 0
sys/lib/ghostscript/gs_cidtt.ps

@@ -0,0 +1,139 @@
+%    Copyright (C) 2000 artofcode LLC.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_cidtt.ps,v 1.9 2005/04/29 16:58:04 ray Exp $
+% Redefine CIDFont category with an emulation with True Type fonts.
+
+languagelevel 2 .setlanguagelevel
+
+15 dict begin    % a temporary dictionary for local binding.
+
+%------------------Copy the FontEmulationProcs here : -------------------
+
+/FontEmulationProcs /ProcSet findresource {
+  def
+} forall
+
+currentdict /super.complete_instance currentdict /complete_instance get put
+
+%-------Auxiliary procedures for building CIDFontType 2 from TT file -----------
+
+/GenerateCIDMap   % <font> GenerateCIDMap <font>
+{ begin
+    % Obtain the maximal CID :
+    %   This implementation doesn't check whether glyphs really present.
+    Decoding /CIDCount get /CIDCount exch def
+    % Prepare the CIDMap structure :
+    /CIDMap [
+      CIDCount 22000 le {
+        CIDCount 2 mul string
+      } {
+        44000 string
+        CIDCount 44000 gt {
+	   % need three strings
+           44000 string		% 22000 2 mul string
+           CIDCount 44000 sub 2 mul string
+        } {
+           CIDCount 22000 sub 2 mul string
+        } ifelse
+      } ifelse
+    ] def
+    % Now fill it :
+    Decoding TT_cmap SubstNWP GDBytes CIDMap .fillCIDMap
+  currentdict end
+} bind def
+
+/load_sfnts  % <FontDict> load_sfnts <FontDict> 
+{ % Read the True Type file from the path /Path, and buld /sfnts,
+  % skipping glyf and loca. 
+  dup /Path get                                            % <font> (path)
+  QUIET not {
+    (Loading a TT font from ) print dup print 
+    ( to emulate a CID font ) print 1 index /CIDFontName get =only ( ... ) print
+  } if
+  (r) file dup                                             % <font> file file
+  3 1 roll                                                 % file <font> file
+  1 index /SubfontID .knownget not { 0 } if                % file <font> file SubfontID
+  .load_tt_font_stripped exch copy                         % file <font>
+  QUIET not {
+    (Done.) =
+  } if
+  dup 3 1 roll                                             % <font> file <font>
+  exch /File exch put                                      % <font>
+  dup dup /CIDSystemInfo get /Ordering get (.)             % <font> () ()
+  2 index /Decoding get =string cvs                        % <font> () () ()
+  concatstrings concatstrings cvn /Decoding exch put       % <font>
+  //ChooseDecoding exec                                    % <font>
+  //GenerateCIDMap exec                                    % <font>
+} bind def
+
+%-----------TrueType-specific methods for category redefinition : -----------
+
+/RefinePath      % <FontDict> RefinePath <FontDict>
+{ dup begin
+  Path .libfile {
+      dup .filename {
+        currentdict exch /Path exch put
+      } if
+      closefile
+  } {
+    (Can't find the font file ) print =
+    /findfont cvx /undefinedfilename signalerror
+  } ifelse
+  end
+} bind def
+
+/complete_instance  % <font_name> <FontDict> <Options> complete_FAPI_Font <font_name> <FontDict>
+{ 1 index /CIDFontType 2 put % Other types are not emulated yet.
+  //super.complete_instance exec
+  //RefinePath exec
+  //load_sfnts exec
+} bind def
+
+/IsMyRecord      % <raw_record> -> <raw_record> bool
+{ dup type /dicttype eq { dup /FileType .knownget { /TrueType eq } { false } ifelse } { false } ifelse
+} bind def
+
+/IsActive       % <record> IsActive <bool>
+{ pop true
+} bind def
+
+/CIDFontRecordVirtualMethods //RecordVirtualMethodsStub dup length 3 add dict copy begin
+  /GetCSI //TranslateCSI def
+  /IsActive //IsActive def
+  /MakeInstance   % <Name> <record> MakeInstance <Name> <Instance> <size>
+  { //CIDFontOptions //complete_instance exec
+    2 copy //GetSize exec
+  } bind def
+currentdict end def
+
+% Redefine the /CIDFont category :
+4 dict begin
+  /CategoryName /CIDFont def
+  /IsMapFileOptional true def
+  /VerifyMap  { pop } bind def
+  /PreprocessRecord  % <map> <Name> <raw_record> PreprocessRecord <map> <Name> <record> <bool>
+  { //IsMyRecord exec dup {
+      pop dup /RecordVirtualMethods //CIDFontRecordVirtualMethods put
+      true
+    } if
+  } bind def
+currentdict end
+
+/MappedCategoryRedefiner /ProcSet findresource /Redefine get exec
+
+end  % the temporary dictionary for local binding.
+
+.setlanguagelevel

+ 147 - 0
sys/lib/ghostscript/gs_ciecs2.ps

@@ -0,0 +1,147 @@
+%    Copyright (C) 2002 Aladdin Enterprises.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_ciecs2.ps,v 1.1 2002/08/22 07:12:28 henrys Exp $
+% Level 2 CIEBased color space method dictionaries.
+
+%
+% The validation routines in these method dictionaries perform only
+% partial validations; the .setcie* operators will perform the rest.
+%
+
+% verify that at least one of the CIEBased color spaces is supported
+true
+  { /.setcieaspace /.setcieabcspace /.setciedefspace /.setciedefgspace }
+  {
+    where
+      { pop not exit }
+    if
+  }
+forall
+  { currentfile closefile }
+if
+
+
+.currentglobal true .setglobal
+.cspace_util begin
+
+%
+%   <obj>   check_cie_cspace   <obj>
+%
+% Perform a very basic check that an object is a CIEBased color space
+% array.
+%
+/check_cie_cspace
+  {
+    //check_array exec
+    dup 1 get type /dicttype ne
+      //setcspace_typecheck
+    if
+  }
+bind def
+
+
+
+/.setcieaspace where
+  {
+    pop
+    colorspacedict
+    /CIEBasedA
+      mark
+        /cs_potential_indexed_base true
+        /cs_potential_pattern_base true
+        /cs_potential_alternate true
+        /cs_potential_icc_alternate true
+        /cs_get_ncomps //ncomps_1
+
+        /cs_get_range
+          {
+            1 get /RangeA .knownget not
+              { //dflt_range_1 }
+            if
+          }
+        bind
+
+        /cs_get_default_color { pop 0 } bind
+        /cs_get_currentgray //no_currentgray
+        /cs_get_currentrgb //no_currentrgb
+        /cs_get_currentcmyk //no_currentcmyk
+        /cs_validate //check_cie_cspace
+        /cs_substitute //dup_1
+        /cs_prepare {}
+
+        /cs_install
+          {
+            NOCIE
+              { pop /DeviceGray //.cs_install exec }
+              { 1 get .setcieaspace }
+            ifelse
+          }
+        bind
+
+        /cs_prepare_color //validate_1
+        /cs_complete_setcolor //pop_1
+      .dicttomark
+    put
+  }
+if
+
+/.setcieabcspace where
+  {
+    pop
+    colorspacedict
+    /CIEBasedABC
+      mark
+        /cs_potential_indexed_base true
+        /cs_potential_pattern_base true
+        /cs_potential_alternate true
+        /cs_potential_icc_alternate true
+        /cs_get_ncomps //ncomps_3
+
+        /cs_get_range
+          {
+            1 get /RangeABC .knownget not
+              { //dflt_range_3 }
+            if
+          }
+        bind
+
+        /cs_get_default_color { pop 0 0 0 } bind
+        /cs_get_currentgray //no_currentgray
+        /cs_get_currentrgb //no_currentrgb
+        /cs_get_currentcmyk //no_currentcmyk
+        /cs_validate //check_cie_cspace
+        /cs_substitute //dup_1
+        /cs_prepare {}
+
+        /cs_install
+          {
+            NOCIE
+              { pop /DeviceRGB //.cs_install exec }
+              { 1 get .setcieabcspace }
+            ifelse
+          }
+        bind
+
+        /cs_prepare_color //validate_3
+        /cs_complete_setcolor //pop_1
+      .dicttomark
+    put
+  }
+if
+
+
+end     % .cspace_util
+.setglobal

+ 123 - 0
sys/lib/ghostscript/gs_ciecs3.ps

@@ -0,0 +1,123 @@
+%    Copyright (C) 2002 Aladdin Enterprises.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_ciecs3.ps,v 1.1 2002/08/22 07:12:28 henrys Exp $
+% Level 3 CIEBased color space method dictionaries.
+% This assumes gs_ciecs2.ps has already been processed.
+
+%
+% The validation routines in these method dictionaries perform only
+% partial validations; the .setcie* operators will perform the rest.
+%
+
+
+.currentglobal true .setglobal
+.cspace_util begin
+
+
+/.setciedefspace where
+  {
+    pop
+    colorspacedict
+    /CIEBasedDEF
+      mark
+        /cs_potential_indexed_base true
+        /cs_potential_pattern_base true
+        /cs_potential_alternate true
+        /cs_potential_icc_alternate true
+        /cs_get_ncomps //ncomps_3
+
+        /cs_get_range
+          {
+            1 get /RangeDEF .knownget not
+              { //dflt_range_3 }
+            if
+          }
+        bind
+
+        /cs_get_default_color { pop 0 0 0 } bind
+        /cs_get_currentgray //no_currentgray
+        /cs_get_currentrgb //no_currentrgb
+        /cs_get_currentcmyk //no_currentcmyk
+        /cs_validate //check_cie_cspace
+        /cs_substitute //dup_1
+        /cs_prepare {}
+
+        /cs_install
+          {
+            NOCIE
+              { pop /DeviceRGB //.cs_install exec }
+              { 1 get .setciedefspace }
+            ifelse
+          }
+        bind
+
+        /cs_prepare_color //validate_3
+        /cs_complete_setcolor //pop_1
+      .dicttomark
+    put
+  }
+if
+
+
+/.setciedefgspace where
+  {
+    pop
+    colorspacedict
+    /CIEBasedDEFG
+      mark
+        /cs_potential_indexed_base true
+        /cs_potential_pattern_base true
+        /cs_potential_alternate true
+        /cs_potential_icc_alternate true
+        /cs_get_ncomps //ncomps_4
+
+        /cs_get_range
+          {
+            1 get /RangeDEFG .knownget not
+              { //dflt_range_4 }
+            if
+          }
+        bind
+
+        /cs_get_default_color { pop 0 0 0 0 } bind
+        /cs_get_currentgray //no_currentgray
+        /cs_get_currentrgb //no_currentrgb
+        /cs_get_currentcmyk //no_currentcmyk
+        /cs_validate //check_cie_cspace
+        /cs_substitute //dup_1
+        /cs_prepare {}
+
+        % the use of the DeviceCMYK color space is questionable:
+        % it will likely have the wrong polarity
+        /cs_install
+          {
+            NOCIE
+              { pop /DeviceCMYK //.cs_install exec }
+              { 1 get .setciedefgspace }
+            ifelse
+          }
+        bind
+
+        /cs_prepare_color //validate_4
+        /cs_complete_setcolor //pop_1
+      .dicttomark
+    put
+  }
+if
+
+
+end     % .cspace_util
+.setglobal

+ 141 - 60
sys/lib/ghostscript/gs_cmap.ps

@@ -1,42 +1,50 @@
 %    Copyright (C) 1995, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gs_cmap.ps,v 1.11 2001/06/16 19:02:31 igorm Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_cmap.ps,v 1.19 2005/08/17 21:54:55 igor Exp $
 % ProcSet for implementing CMap resources.
 % When this is run, systemdict is still writable.
 
 % NOTE: Rearranged fonts are not implemented yet.
 
+[
+   /CMERGE_DEBUG
+   /USE_CIDCHAR_AS_RANGE
+] {dup where {pop pop} { currentdict exch //false def pop } ifelse} forall
+
 % ---------------- Public operators ---------------- %
 
 /.rewriteTempMapsNotDef {
-  DEBUG { (rewriting TempMapsNotDef\n) print flush } if
+  %
+  % Before building .CodeMapData from .TempMaps,
+  % we need to replace dst type codes in the notdef map with the value 3,
+  % which corresponds to CODE_VALUE_NOTDEF, see gxfcmap.h .
+  %
+  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
@@ -46,6 +54,7 @@
     /CMap 2 index dup type /dicttype ne { /CMap findresource } if def
     /FDepVector 1 index cvlit def	% temporarily
     /Encoding [ 0 1 FDepVector length 1 sub { } for ] def
+    /FontInfo 1 dict def % for .processToUnicode in pdf_font.ps .
     /FDepVector [ 0 1 FDepVector length 1 sub {
 		% Stack: name cmap[name] fonts /FDepVector [ fonts... i
       FDepVector 1 index get
@@ -57,7 +66,7 @@
 	} ifelse findresource
       } if
       exch CMap /FontMatrices get dup length 2 index gt {
-	exch get dup null eq { pop } { makefont } ifelse
+	exch get dup //null eq { pop } { makefont } ifelse
       } {
 	pop pop
       } ifelse
@@ -77,9 +86,9 @@
 % Our internal .CodeMapData structure closely mirrors the structures
 % defined in gxfcmap.h (q.v.).  () indicate a string, [] indicate an array,
 % ? indicates a Boolean, # indicates an integer, {} for grouping.
-%	[[(first) (last) ...]		% code space ranges
-%	 [(prefix) (key_size,?is_range,value_type,value_size) (keys...)
-%	   {(values...) | [value ...]} #font_index	% code mappings
+%	[[[(first) (last) ...]+]		% code space ranges
+%	 [[(prefix) (key_size,?is_range,value_type,value_size) (keys...)
+%	   {(values...) | [value ...]} #font_index ]+]	% code mappings
 %	  ...]
 %	 <<same>>		% notdef mappings
 %	]
@@ -98,42 +107,52 @@
 % ------ Font-level operators ------ %
 
 /begincmap {		% - begincmap -
-  /.CodeMapData [[] [] []] def
+  /.CodeMapData [[[]] [[]] [[]]] def
   /FontMatrices [] def
   /.FontIndex 0 def
   /.TempMaps [20 dict 50 dict 50 dict] def
-  /CodeMap null def		% for .buildcmap
+  /CodeMap //null def		% for .buildcmap
 } bind def
+
 /endcmap {		% - endcmap -
   .rewriteTempMapsNotDef
-  DEBUG {
-    (*** defined charmap ***\n) print
-    .TempMaps 1 get {exch == (\t) print ==} forall
-    (*** undefined charmap ***\n) print
-    .TempMaps 2 get {exch == (\t) print ==} forall
+
+  CMAPDEBUG {
+    2 (*** undefined charmap ***)
+    1 (*** defined charmap ***)
+    0 (*** code space ranges ***)
+    3 { =
+      .TempMaps exch get
+      0 1 2 index length 1 sub {
+        dup == (\t) print
+        1 index exch get ==
+      } for
+      pop
+    } repeat
+  } if
+  
+  /.CodeMapData dup load [ exch
+    .TempMaps aload pop begin begin begin 
+    {
+      [ exch aload pop
+        0 1 currentdict length 1 sub { 
+           currentdict exch get 
+        } for 
+      ]
+      end
+    } forall
+  ] .endmap def
+
+  CMAPDEBUG {
+    (*** Content of .CodeMapData ***) =
+    0 .CodeMapData { exch dup == 1 add exch (\t) print == } forall
+    pop
   } if
-  10 dict begin 0 1 2 {
-    /i exch def
-		% 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
-    array /a exch def
-    a 0 .CodeMapData i get .putmore
-    0 1 t length 1 sub {
-      t exch get .putmore
-    } for pop pop
-    .CodeMapData i a put
-  } for end
+
   currentdict /.TempMaps undef
-  /.CodeMapData .CodeMapData .endmap def
   /FontMatrices FontMatrices .endmap def
 } bind def
 
-/.putmore {		% <array> <i> <array2> .putmore <array> <i+len(array2)>
-  3 copy putinterval length add
-} bind def
-
 /.endmap {		% <map> .endmap <map>
   dup type /arraytype eq {
 	% This might be a shared read-only array inherited via usecmap.
@@ -156,6 +175,7 @@
 /begincodespacerange {	% <count> begincodespacerange -
   pop mark
 } bind def
+
 /endcodespacerange {	% <code_lo> <code_hi> ... endcodespacerange -
   0 .appendmap
 } bind def
@@ -178,6 +198,7 @@
     /FontMatrices exch def
   } if
 } bind def
+
 /endusematrix {		% <matrix> endusematrix -
   FontMatrices 3 1 roll put
 } bind def
@@ -242,10 +263,10 @@
 			%   .addbfrange <<same as .addbfchar>>
   4 string dup 3
   3 index type /nametype eq {
-    2 index 2 1 put
+    2 index 2 1 put % dst = CODE_VALUE_GLYPH, see gxfcmap.h .
     4 -1 roll 1 array astore 4 1 roll 4
   } {
-    2 index 2 2 put
+    2 index 2 2 put % dst = CODE_VALUE_CHARS, see gxfcmap.h .
     3 index length
   } ifelse put
 			% Stack: code_lo code_hi value params
@@ -280,13 +301,72 @@
   1 .endmapranges
 } bind def
 
-/.endmapchars {		% -mark- <code> <cid> ... <map#> .endmapchars -
+/.endmapchars {         % -mark- <code> <cid> ... <map#> .endmapchars -
   counttomark 1 add 1 roll
   counttomark 2 idiv {
-    counttomark -2 roll		% process in correct order
-		% Construct prefix, params, key, value, font_index
-    <00 00 00 02> ()	% params, key
-    3 -1 roll .endmapvalue
+    counttomark -2 roll         % process in correct order
+    exch        % <cid> <code>
+                % Construct prefix, params, key, value, font_index
+    dup length 1 eq {   % 1-byte
+      <00 00 00 02> ()  % <prefix> <param> <null_key>
+    } {                 % N-byte
+      dup 0 1 getinterval exch  % make 1-byte prefix
+      4 string dup 0
+      USE_CIDCHAR_AS_RANGE {
+        <00 01 00 02>   % skelton for param
+      } {
+        <00 00 00 02>   % skelton for param
+      } ifelse
+      putinterval
+      exch              % <prefix> <param> <code>
+      dup length        % <prefix> <param> <code> N
+      1 sub             % <prefix> <param> <code> N-1
+      dup               % <prefix> <param> <code> N-1 N-1
+      3 index           % <prefix> <param> <code> N-1 N-1 <param>
+      exch              % <prefix> <param> <code> N-1 <param> N-1
+      0 exch            % <prefix> <param> <code> N-1 <param> 0 N-1
+      put               % <prefix> <param'> <code> N-1
+      1 exch            % <prefix> <param'> <code> 1 N-1
+      getinterval       % <prefix> <param'> <key>
+
+      USE_CIDCHAR_AS_RANGE {
+        dup length 2 mul string % <key> <dkey>
+        dup                     % <key> <dkey> <dkey>
+        2 index                 % <key> <dkey> <dkey> <key>
+        0 exch putinterval      % <key> <dkey'>
+        dup                     % <key> <dkey'> <dkey'>
+        3 -1 roll               % <dkey'> <dkey'> <key>
+        dup length              % <dkey'> <dkey'> <key> N-1
+        exch putinterval        % <dkey''>
+      } if
+
+    } ifelse
+
+    4 -1 roll           % <prefix> <param'> <key> <cid>
+    .endmapvalue        % <prefix> <param'> <key> <hex_cid> <font_idx>
+    % prefix params keys value fontindex
+    counttomark 5 gt { % 2 (or more) ranges (1 range = 5 item)
+       4 index 10 index eq      % compare prefix
+       4 index 10 index eq and  % compare params
+       1 index 7 index eq and   % compare fontindex
+        {
+          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
+           % prefix params value fontindex value2 keys'
+          4 -1 roll 3 -1 roll concatstrings
+           % prefix params fontindex keys' values'
+          3 -1 roll
+        } if
+     } if % end of 2 (or more) ranges
+    CMERGE_DEBUG {
+    ( prefix:) print 4 index =only
+    ( param:) print 3 index =only
+    ( key:) print 2 index =only
+    ( hex_cid:) print 1 index =only
+    ( font_idx:) print 0 index == flush
+    } if
   } repeat
   counttomark 2 add -1 roll .appendmap
 } bind def
@@ -356,7 +436,8 @@
     dup length 3 index length exch sub
 				% cid_base code_lo code_hi prefix range_len
     dup 255 gt {
-       (too long coderange specification for current GS\n) print stop
+       (too long coderange specification for current GS\n) print
+       signalerror
     } if
     <00 01 00 02> 4 string copy	% create initialized param
     dup 0 4 -1 roll put		% put range_len into param
@@ -382,7 +463,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
@@ -436,18 +517,18 @@ dup /DefineResource {
       dup length dict .copydict exch .setglobal
     } if
     dup gcheck 2 index gcheck not and {
-      exch .currentglobal exch true .setglobal
+      exch .currentglobal exch //true .setglobal
       dup length string copy exch .setglobal exch
     } if dup /CMapName 3 index put
   } if
-  dup /CodeMap get null eq { .buildcmap } if
+  dup /CodeMap get //null eq { .buildcmap } if
   /Generic /Category findresource /DefineResource get exec
 } put
 /Category defineresource pop
 	% We might have loaded CID font support already.
 /CIDInit /ProcSet 2 copy { findresource } .internalstopped
 	% An interior `stopped' might have reset VM allocation to local.
-true .setglobal
+//true .setglobal
  { pop pop 3 -1 roll }
  { dup length 4 index length add dict .copydict 4 -1 roll exch .copydict }
 ifelse exch defineresource pop

+ 11 - 13
sys/lib/ghostscript/gs_cmdl.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1994, 1996, 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_cmdl.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_cmdl.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Parse and execute the command line.
 % C code handles the following switches: -h/-? -I -M -v
 

+ 984 - 0
sys/lib/ghostscript/gs_cspace.ps

@@ -0,0 +1,984 @@
+%    Copyright (C) 2002 Aladdin Enterprises.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_cspace.ps,v 1.6 2003/06/26 22:42:33 dan Exp $
+% basic colorspace mechanism
+
+%
+% This new implementation of color spaces extends the color space 
+% formalism to all PostScript levels. Level specific features and 
+% operators continue to be accessible only in the appropriate level, 
+% but the colorspace concept and associated mechanisms are used 
+% throughout.
+%
+% The color space mechanism is built around two dictionaries:
+%
+%   .cspace_util
+%       A dictionary in global VM that is accessible in userdict only
+%       during initialization. This dictionary is intended for various
+%       utility procedures that are used in implementing the individual
+%       color spaces.
+%
+%   colorspacedict
+%       A dictionary of methods for each color space type. The keys
+%       in this dictionary are color space type names (e.g.: /DeviceGray,
+%       /Separation, etc.), and the values are dictionaries of methods.
+%       The set of methods is the same for each color space type, and
+%       provides a complete implementation for the corresponding color
+%       space type. This dictionary is in global VM.
+%
+% The information specific to a color space type is created in a file
+% for that type or group of types (e.g.: gs_csdev.ps, gs_csindx.ps,
+% etc.). These files will generally adhere to the template:
+%
+%      .currentglobal true .setglobal
+%      <level-specific dictionary> begin
+%      ...
+%      .cspace_util begin
+%      colorspacedict
+%      /<color space type name>
+%       mark
+%          /cs_validate
+%            {
+%               ...
+%            }
+%          bind
+%          ...
+%       .dicttomark
+%      put
+%      end      % .cspace_util
+%      end ...  % level-specific dictionary
+%      .setglobal
+%
+% The methods associated with a color space are listed below (along with
+% their stack handling), followed by descriptions.
+%
+%   -   cs_potential_indexed_base   <bool>
+%
+%   -   cs_potential_pattern_base   <bool>
+%
+%   -   cs_potential_alternate   <bool>
+%
+%   -   cs_potential_icc_alternate   <bool>
+%
+%
+%   <name | array>   cs_get_ncomps   <int>
+%
+%   <name | array>   cs_get_range   <range_array>
+%
+%   <name | array>   cs_get_default_color   <c1> ... <cn>
+%
+%
+%   <c1> ... <cn>  <name | array>   cs_get_currentgray   <gray>
+%
+%   <c1> ... <cn>  <name | array>   cs_get_currentrgb   <red>  <green>  <blue>
+%
+%   <c1> ... <cn>  <name | array>   cs_get_currentcmyk 
+%                                       <cyan>  <magenta>  <yellow>  <black>
+%
+%
+%   <name | array>   cs_validate   <name | array>
+%
+%   <name1 | array1>    cs_substitute   <name1 | array1>  <array2>
+%
+%   <name1 | array1>  <array2>   cs_prepare   <name1 | array1>  <array2>
+%
+%   <name | array>   cs_install   -
+%
+%
+%   <c1> ... <cn>  <array>   cs_verify_color   <c1> ... <cn>
+%
+%   <array>   cs_complete_color   -
+%
+%
+% cs_potential_indexed_base, cs_potential_pattern_base,
+% cs_potential_alternate, cs_potential_icc_alternate
+%   These are booleans rather than procedures. They indicate if the color
+%   space can be a base space of an Indexed color space (anything except
+%   Indexed and Pattern), a Pattern color space (anything except Pattern),
+%   the alternative color space of a Separation or DeviceN color space, or
+%   the alternative color space of an ICCBased color space. The two
+%   parameters are distinct only because of a Ghostscript-specific
+%   implementation problem; in principle, there is nothing special about
+%   ICCBased color spaces in this regard.
+%
+% cs_get_ncomps
+%   Return the number of color components for the color spaces. For Pattern
+%   color spaces, the value is -1 if there is no base space, or -(n + 1) if
+%   the base space has n components.
+%
+% cs_get_range
+%   Return the input Range array appropriate for this color space. This is
+%   defined for all color spaces, though it is of interest primarily for
+%   CIEBased and ICCBased color spaces. For Indexed color spaces this is
+%   [ 0 hival ], where hival is the maximum support index value. For all
+%   other non-CIEBased, non-ICCBased color spaces, the range is an array
+%   of ncomps elements, all of which are [ 0 1 ], where ncomps is the 
+%   number of color space components.
+%
+% cs_get_default_color
+%   Generates the default color for the current color space. Under normal
+%   circumstances this is done internally. It is provided in PostScript
+%   only to support an optimization that doesn't change the current color
+%   space more often than necessary.
+%
+% cs_get_currentgray, cs_get_currentrgb, cs_get_currentcmyk
+%   These procedures are used to implement the currentgray, currentrgb,
+%   and currentcmyk operators (which are pseudo-operators in the current
+%   implementation).
+%
+% cs_validate
+%   Validate the operand color space. Because color spaces are extensively
+%   manipulated in PostScript in this implementation, error handling can
+%   become burdensome. To make the code somewhat simpler, it is useful to
+%   be able to validate a color space prior to manipulation, so as to
+%   ensure that errors are not discovered in awkward places.
+%
+% cs_substitute
+%   Substitute a device-independent color space for device specific color
+%   space. This applies directly to the device-specific color spaces
+%   (DeviceGray, DeviceRGB, DeviceCMYK), and indirectly when these color
+%   spaces are used as base/alternative color spaces. The mechanism for
+%   color substitution is included in all language levels, though it may
+%   only be accessed for Language Level 3.
+%
+%   The substituted color space is the topmost of the operands pushed.
+%   this may or may not be the same as the original color space, which
+%   is immediately below it on the operand stack. If the two differ,
+%   the substituted space will always be in local VM (and will be
+%   writable).
+%
+%   Substitution is applied recursively to the base/alternate color
+%   space of ICCBased, Indexed, Separation, DeviceN, or Pattern
+%   color spaces. Because Ghostscript currently requires that any
+%   base or alternative color space be the current color space when
+%   the enclosing color space is set, this substitution effectively
+%   occurs twice: once in the original color space, and once when the
+%   base/alternative color space is made the current color space.
+%   We retain the first substitution as we would eventually like to
+%   remove the restriction on making the base/alternative color space
+%   the current color space.
+%
+% cs_prepare
+%   Perform any operations required on the color space for installation.
+%   This method exists primarily to allow conversion of PostScript
+%   procedures to functions for CIEBased color spaces. Two operands are
+%   provided: the original and the substituted color space. If the two
+%   differ and the latter is writable, required modifications can
+%   be made "in place". Otherwise, a new instance of the second color
+%   space must be built.
+%
+%   Currently, cs_prepare is not explicitly recursive. Because
+%   Ghostscript requires a base/alternate color space to be installed
+%   as the current color space prior to installing the enclosing color
+%   space, the cs_prepare method will implicitly be called recursively.
+%   The reason for not making this explicit is that color space
+%   preparation may involve a considerable amount of work, which could
+%   be avoided if, for example, an alternative color space will not
+%   be used because the enclosing Separation/DeviceN color space is
+%   supported in native mode by the process color model. We would
+%   eventually like to remove the need to prepare color spaces that
+%   will not be used.
+%
+% cs_install
+%   This method actually installs the color space in the graphic state.
+%   Only the substituted/prepared space (which may be the same as the
+%   original space) is passed as an operand; the original space is handled
+%   directly by the .setcolorspace operator.
+%
+%   The provision of a separate method for this tasks reflects the
+%   historical implementation of color spaces in the Ghostscript
+%   interpreter. This implementation provides a unique operator for each
+%   color space type.
+%
+% cs_prepare_color
+%   Modify a set of color operands as required by a color space. This
+%   is used primarily to verify the color operands, as this is most
+%   conveniently done in PostScript.
+%
+% cs_complete_setcolor
+%   This method is invoked immediately after a (successful) invocation
+%   of setcolor. Ii is provided as a separate method for compatibility
+%   with Adobe implementations. These implementations invoke the lookup
+%   (Indexed) or tint procedure each time setcolor is invoked (only if
+%   the alternative color space is used in the case of the tint
+%   transform). Because Ghostscript may convert these procedures to
+%   functions (or pre-sample them), the procedures may not always be
+%   called when expected. There are applications that depend on this
+%   behavior (e.g.: Adobe PhotoShop 5+), so this method provides a way
+%   to emulate it.
+%
+%   In principle, a cs_complete_setcolor procedure for an Indexed color
+%   space whose base space should invoke cs_complete_setcolor on its
+%   base space. Currently we don't do this, because it has not been
+%   shown to be necessary. It would be simple to add if it is every
+%   needed.
+%
+% All of these methods are procedures.
+%
+% For each of these methods, there is a procedure in .cspace_util with
+% a dot ('.') prefix that will invoke the appropriate procedure for the
+% operand array.
+%
+
+.currentglobal true .setglobal
+userdict /.cspace_util 80 dict put
+.cspace_util begin
+
+%
+% Colorspacedict is initially in .cspace_util; it is copied to level2dict
+% in the Level 2 initialization code to retain compatibility with 
+% earlier implementations.
+%
+/colorspacedict 20 dict def
+
+
+%
+%   <obj>   make_array1   <array>
+%
+% procedure for conditionally converting a named color space to a
+% 1-element array. Since names are always global, the array will be
+% as well.
+%
+/make_array1
+  {
+    dup type /nametype eq
+      { currentglobal true setglobal exch 1 array astore exch setglobal }
+    if
+  }
+bind def
+
+%
+%  <name|array>   .get_cspace_type   name
+%
+% Provide generic routine for retrieving the color space type.
+%
+/.get_cspace_type
+  {
+    dup type dup /arraytype eq exch /packedarraytype eq or
+      { 0 get }
+    if
+  }
+bind def
+
+%
+%   <name|array>   .get_method_dict   <dict>
+%
+% Get the method dictionary for a specific color space. Note that the
+% color space is left on the stack.
+%
+/.get_method_dict
+  { //colorspacedict exch //.get_cspace_type exec get }
+bind def
+
+%
+%   <name|array>  <proc_name>   .get_method   <name|array>  <proc | bool>
+%
+% Get the named method for the operand color space.
+%
+/.get_method
+  { exch //.get_method_dict exec exch get }
+bind def
+
+
+%
+%   <name_array>   .cs_potential_indexed_base   <bool>
+%   <name_array>   .cs_potential_pattern_base   <bool>
+%   <name_array>   .cs_potential_alternate    <bool>
+%   <name_array>   .cs_potential_icc_alternate   <bool>
+%   <name | array>   .cs_get_ncomps   <int>
+%   <name | array>   .cs_get_range   <range_array>
+%   <name | array>   .cs_get_default_color   <c1>  ...  <cn>
+%   <c1> ... <cn>  <name | array>   .cs_get_currentgray   <gray>
+%   <c1> ... <cn>  <name | array>   .cs_get_currentrgb   <r>  <g>  <b>
+%   <c1> ... <cn>  <name | array>   .cs_get_currentcmyk   <c>  <m>  <y>  <k>
+%   <name | array>   .cs_validate   <name | array>
+%   <name1 | array1>   .cs_substitute   <name1 | array1>  <array2>
+%   <name1 | array1>  <array2>   .cs_prepare   <name1 | array1>  <array2>
+%   <name | array>   .cs_install   -
+%   <c1> ... <cn> <array>   .cs_prepare_color   <c1> ... <cn>
+%   <array>   .cs_complete_setcolor   -
+%
+% These procedures provide access to the corresponding methods of the
+% operand color space.
+%
+/.cs_potential_indexed_base
+  { /cs_potential_indexed_base //.get_method exec }
+bind def
+
+/.cs_potential_pattern_base
+  { /cs_potential_pattern_base //.get_method exec }
+bind def
+
+/.cs_potential_alternate
+  { /cs_potential_alternate //.get_method exec }
+bind def
+
+/.cs_potential_icc_alternate
+  { /cs_potential_icc_alternate //.get_method exec }
+bind def
+
+/.cs_get_ncomps
+  { dup /cs_get_ncomps //.get_method exec exec }
+bind def
+
+/.cs_get_range
+  { dup /cs_get_range //.get_method exec exec }
+bind def
+
+/.cs_get_default_color
+  { dup /cs_get_default_color //.get_method exec exec }
+bind def
+
+/.cs_get_currentgray
+  { dup /cs_get_currentgray //.get_method exec exec }
+bind def
+
+/.cs_get_currentrgb
+  { dup /cs_get_currentrgb //.get_method exec exec }
+bind def
+
+/.cs_get_currentcmyk
+  { dup /cs_get_currentcmyk //.get_method exec exec }
+bind def
+
+/.cs_validate
+  { dup /cs_validate //.get_method exec exec }
+bind def
+
+/.cs_substitute
+  { dup /cs_substitute //.get_method exec exec }
+bind def
+
+/.cs_prepare
+  { dup /cs_prepare //.get_method exec exec }
+bind def
+
+/.cs_install
+  { dup /cs_install //.get_method exec exec }
+bind def
+
+/.cs_prepare_color
+  { dup /cs_prepare_color //.get_method exec exec }
+bind def
+
+/.cs_complete_setcolor
+  { dup /cs_complete_setcolor //.get_method exec exec }
+bind def
+
+
+%
+% Make sure we have an interpreter color space before redefining
+% setcolorspace. The interpreter internal code only sets the effective
+% color space; the interpreters color spaces begins as a null object.
+%
+% NB: This should come prior to the redefinition of setcolorspace, and
+%     must use an array operand.
+%
+[ /DeviceGray ] setcolorspace
+
+
+%
+%   <c1> ... <cn>   setcolor   -
+%
+% As with setcolorspace, setcolor is initially placed in .cspace_util,
+% and is copied to level2dict by the Level 2 initialization code. The
+% internal definition of setcolor is removed from systemdict as soon
+% as this procedure is defined.
+%
+/setcolor
+  {
+      {
+        currentcolorspace //.cs_prepare_color exec //setcolor
+        currentcolorspace //.cs_complete_setcolor exec
+      }
+    stopped
+      { //.cspace_util /setcolor get $error /errorname get signalerror }
+    if
+  }
+bind odef
+
+systemdict /setcolor .undef
+
+
+%
+%   <name|array>  <bool>   _setcolorspace   -
+%   <name|array>   _setcolorspace_nosub   -
+%
+%   <name|array>   setcolorspace   -
+%   <name|array>   forcesetcolorspace   -
+%
+% setcolorspace is initially placed in .cspace_util. It is copied to
+% level2dict by the Level 2 initialization code. The internal
+% setcolorspace operator is removed from systemdict as soon as this
+% procedure is defined.
+%
+% Because some jobs, in particular PDF jobs, repeatedly set the same
+% color space, this procedure will check if the operand and current
+% color spaces are the same. The check is absolute for parameterless
+% color spaces, conservative for others. For PostScript, this
+% optimization can only be employed if color space substitution is
+% disabled, as otherwise there is no way to account for  possible changes
+% in the /Default* instances of the ColorSpace resource category. For PDF
+% jobs, resource category instances can only be changed at very specific
+% times (typically page boundaries), so the "operand color space is the
+% same as current color space" optimization may be used even if color
+% space substitution is in effect. The optimization is also highly
+% desirable in such cases, as it greatly improves performance.
+%
+% In certain situations, it is critical that a color space be set,
+% even if it is the same as the current color space. This is the case
+% when a CIEBased color space is used as a base or alternative color
+% space, due to some long-standing problems with the graphics libraries
+% handling of sampled information from the procedures in CIE color
+% spaces and the color rendering dictionary. The forcesetcolorspace
+% operator is provided for those situations.
+%
+% Note also that, if the current color space is not reset, at least
+% the current color must be reset to its default value.
+%
+% Another problem arises in the case of ICCBased color spaces. These
+% color spaces may be used to substitute for a DeviceGray/DeviceRGB/
+% DeviceCMYK color space, and may themselves require such a color
+% space as an alternate. Obviously, when this is the case the normal
+% setcolorspace mechanism would encounter and infinite loop if the
+% alternate colro space needed to be used. For this particular case,
+% the special _setcolorspace_nosub is provided, which suppresses
+% color space substitution. This routine does not bother to check if
+% the operand and current color space are the same.
+%
+/_setcolorspace
+  {
+      {
+        % see if the operand space is the same as the current space
+        currentcolorspace dup length 1 eq
+          {
+            0 get
+            2 index dup type dup /arraytype eq exch /packedarraytype eq or
+              {
+                dup length 1 eq
+                  { 0 get }
+                if
+              }
+            if
+          }
+          { 2 index }
+        ifelse
+        eq and dup
+          {
+            %
+            % If PDFfile is defined on the dictionary stack, this is a
+            % PDF job. No additional check is required in this case (see
+            % comment above).
+            %
+            /PDFfile where
+              { pop }
+              { .getuseciecolor not and }   % check that UseCIEColor is off
+            ifelse
+          }
+        if
+          { //.cs_get_default_color exec setcolor }
+          {
+            //.cs_validate exec
+            //.cs_substitute exec
+            //.cs_prepare exec
+            //.cs_install exec
+            //make_array1 exec //setcolorspace
+          }
+        ifelse
+      }
+    stopped
+      { //.cspace_util /setcolorspace get $error /errorname get signalerror }
+    if
+  }
+bind def
+
+/_setcolorspace_nosub
+  {
+      {
+        //.cs_validate exec
+        dup
+        //.cs_prepare exec
+        //.cs_install exec
+        //make_array1 exec //setcolorspace
+      }
+    stopped
+      { //.cspace_util /setcolorspace get $error /errorname get signalerror }
+    if
+  }
+bind def
+
+/setcolorspace { //true //_setcolorspace exec } bind odef
+/forcesetcolorspace { //false //_setcolorspace exec } bind odef
+
+%
+%   -   initgraphics   -
+%
+% The initgraphics operator must be redefined create a real color space.
+% Previously this was unnecessary, as .currentcolorspace could return
+% an integer.
+%
+%
+/initgraphics
+  { initgraphics { /DeviceGray } cvlit forcesetcolorspace }
+.bind systemdict begin odef end
+
+systemdict /setcolorspace .undef
+
+
+%
+%   <gray>   setgray   -
+%
+%   <r> <g> <b>   setrgbcolor  -
+%
+%   <c> <m> <y> <b>   setcmykcolor   -
+%
+% The Level 1 color setting operators. setcmykcolor is created only if
+% setcolorscreen is present. These operators are always defined in
+% systemdict. 
+%
+/setgray
+  {
+      { { /DeviceGray } cvlit  //setcolorspace //setcolor }
+    stopped
+      { /setgray load $error /errorname get signalerror }
+    if
+  }
+bind systemdict begin odef end
+
+/setrgbcolor
+  {
+      { { /DeviceRGB } cvlit //setcolorspace //setcolor }
+    stopped
+      { /setrgbcolor load $error /errorname get signalerror }
+    if
+  }
+bind systemdict begin odef end
+
+/setcolorscreen where
+  {
+    pop
+    /setcmykcolor
+      {
+          { { /DeviceCMYK } cvlit //setcolorspace //setcolor }
+        stopped
+          { /setcmykcolor load $error /errorname get signalerror }
+        if
+      }
+    bind systemdict begin odef end
+  }
+if
+
+
+%
+%   -   currentgray  <gray>
+%
+%   -   currentrgbcolor   <r> <g> <b>
+%
+%   -   currentcmykcolor   <c> <m> <y> <k>
+%
+% Return the current color, mapped to a DeviceGray, DeviceRGB, or
+% DeviceCMYK color space. The latter is only created if setcolorscreen
+% is present.
+/currentgray
+  { currentcolor currentcolorspace //.cs_get_currentgray exec }
+bind systemdict begin odef end
+
+/currentrgbcolor
+  { currentcolor currentcolorspace //.cs_get_currentrgb exec }
+bind systemdict begin odef end
+
+/setcolorscreen where
+  {
+    pop
+    /currentcmykcolor
+      { currentcolor currentcolorspace //.cs_get_currentcmyk exec }
+    bind systemdict begin odef end
+  }
+if
+
+
+
+%
+% Add some generically useful structures and procedures to .cspace_util.
+%
+
+%
+% Some common errors. The command for these errors will normally be
+% overwritten by the invoking operator. We cannot "load" the secolorspace
+% or setcolor operators, as they are not present in Level 1 systems.
+%
+/setcspace_typecheck
+  { /setcolorspace cvx /typecheck signalerror }
+bind def
+
+/setcspace_rangecheck
+  { /setcolorspace cvx /rangecheck signalerror }
+bind def
+
+/setcspace_invalidaccess
+  { /setcolorspace cvx /invalidaccess signalerror }
+bind def
+
+/setcspace_undefined
+  { /setcolorspace cvx /undefined signalerror }
+bind def
+
+/setcolor_typecheck
+  { /setcolor cvx /typecheck signalerror }
+bind def
+
+/setcolor_invalidaccess
+  { /setcolor cvx /invalidaccess signalerror }
+bind def
+
+
+%
+%   <obj>   check_array   <obj>
+%
+% Check that an object is an array. Currently we don't check for
+% readability, as a failing get or length operator should generate
+% the appropriate invalidaccess error.
+/check_array
+  {
+    dup type dup /arraytype ne exch /packedarraytype ne and
+      { /setcolorspace cvx /typecheck signalerror }
+    if
+  }
+bind def
+
+
+% pre-defined procedures for cs_ncomps and cs_get_range
+/ncomps_1 { pop 1 } bind def
+/ncomps_3 { pop 3 } bind def
+/ncomps_4 { pop 4 } bind def
+
+/dflt_range_4 [ 0 1  0 1  0 1  0 1 ] readonly def
+/dflt_range_3 dflt_range_4 0 6 getinterval def
+/dflt_range_1 dflt_range_4 0 2 getinterval def
+
+%   <obj>   get_range_[1|3|4]   <range>
+/get_range_1 { pop //dflt_range_1 } bind def
+/get_range_3 { pop //dflt_range_3 } bind def
+/get_range_4 { pop //dflt_range_4 } bind def
+
+
+%
+%   <c1> ... <cn>  <name | array>  <n>
+%   check_num_stack
+%   <c1> ... <cn>  <array | array>
+%
+%   <c1>  <array>   validate_color_1   <c1>
+%   <c1>  <c2>  <c3>  <arraY>   validate_color_3   <c1>  <c2>  <c3>
+%   <c1>  <c2>  <c3> <c4>  <arraY>   validate_color_4   <c1>  <c2>  <c3>  <c4>
+%
+% check_num_stack verifies that the stack consists of a color space array and
+% n numbers. This is used by most of the cs_prepare_color procedures. The
+% validate_color_[1|3|4] procedures can be used as the cs_prepare_color
+% procedure for Device specific, CIEBased, and Indexed color spaces.
+%
+% Note that the pseudo-operator that (indirectly) invokes this routine will
+% handle resetting the stacks.
+%
+/check_num_stack
+  {
+    dup 2 add copy exch pop
+      {
+        type dup /integertype ne exch /realtype ne and
+          //setcolor_typecheck
+        if
+      }
+    repeat
+    pop         % remove the extra op_count
+  }
+bind def
+
+%   <c1>  <array>   validate_1   <c1>
+/validate_1 { 1 //check_num_stack exec pop } bind def
+
+%   <c1>  <c2>  <c3>   <array>   validate_3   <c1>  <c2>  <c3>
+/validate_3 { 3 //check_num_stack exec pop } bind def
+
+%   <c1>  <c2>  <c3>  <c4>  <array>   validate_4   <c1>  <c2>  <c3>  <c4>
+/validate_4 { 4 //check_num_stack exec pop } bind def
+
+
+%
+%   <obj>   pop_1   -
+%
+% This is a procedure form of pop. It may be used where a procedure is
+% expected, but the function of the procedure is the same as the pop
+% operator.
+/pop_1 { pop } bind def
+
+%
+%   <obj>   dup_1   <obj>  <obj>
+%
+% An analog to pop_1, this one for dup.
+%
+/dup_1 { dup } bind def
+
+%
+%   <obj1> ... <objn>  <n>   clear_n_objs   -
+%
+% Clear n objects from the operand stack.
+%
+/clear_n_objs { //pop_1 repeat }  bind def
+
+%
+%   <obj1> ... <objn>  <array>   clear_setcolor_operands   -
+%
+% Clear the setcolor operands for a color space.
+%
+/clear_setcolor_operands
+  { //.cs_get_ncomps exec //clear_n_objs exec }
+bind def
+
+%
+% Return 1, 3, or 4 zeros. These routines are used primarily for the
+% CIEBased color spaces, for which currentgray and currentrgb
+% should return 0 for all components, and currentcmyk should return
+% 0 0 0 1.0 (this varies from Adobe's documentation but is consistent
+% with their impelementations).
+%
+/no_currentgray { //.cs_get_ncomps exec //clear_n_objs exec 0 } bind def
+/no_currentrgb { //.cs_get_ncomps exec //clear_n_objs exec 0 0 0 } bind def
+/no_currentcmyk { //.cs_get_ncomps exec //clear_n_objs exec 0 0 0 1.0 } bind def
+
+
+%
+%   <num>   bound_0_1   <num>
+%
+% Bound a number to the range [0, 1]
+%
+/bound_0_1
+  {
+    dup 0 lt
+      { pop 0 }
+      {
+        dup 1 gt
+          { pop 1 }
+        if
+      }
+    ifelse
+  }
+bind def
+
+
+%
+% Provide pseudo-operators  for sethsbcolor and currenthsbcolor. These are
+% alternate versions of the setrgbcolor and currentrgbcolor operators, which
+% make use of a hue/staturation/brightness color description.
+%
+
+%
+%   <num_1> ...  <num_n>  n   max_n   <num>
+%   <num_1> ...  <num_n>  n   min_n   <num>
+%
+% Find the maximum and minum of 3 color component intensities.
+%
+/max_n
+  {
+    1 sub
+      { 2 copy lt { exch } if pop }
+    repeat
+  }
+bind def
+
+/min_n
+  {
+    1 sub
+      { 2 copy gt { exch } if pop }
+    repeat
+  }
+bind def
+
+
+%
+%   <r>  <g>  <b>   .rgb_2_hsb   <h>  <s>  <br>
+%   <h>  <s>  <br>   .hsb_2_rgb   <r>  <g>  <b>
+%
+% Convert between RGB and HSB colors, using the hexcone approach (see
+% Rogers, David, "Procedureal Elements For Computer Graphics",
+% (McGraw-Hill, 1985), pp. 402 - 3).
+%
+% The rgb ==> hsb calculation is:
+%
+%   br = max(r, g, b)
+%
+%   if (br == 0)
+%       h = 0, s = 0;
+%   else {
+%       v = min(r, g, b)
+%       diff = br - v;
+%       sat = diff / br;
+%       if (r == br)
+%           h = (g - b) / (6 * diff) + (b > g ? 1 : 0);
+%       else if (g == br)
+%           h = 1/3 + (b - r) / (6 * diff);
+%       else    /* b == br */
+%           h = 2/3 + (r - g) / (6 * diff);
+%   }
+%
+% The hsb ==> rgb conversion is:
+%
+%    mn = (1 - s) * br, md = 6 * s * br;
+%
+%    switch ((int)floor(6 * h)) {
+%      case 0:  /* r >= g >= b */
+%        r = br;
+%        g = mn + h * md;
+%        b = mn;
+%        break;
+%
+%      case 1:  /* g >= r >= b */
+%        r = mn + md * (1/3 - h);
+%        g = br;
+%        b = mn;
+%        break;
+%
+%      case 2:  /* g >= b >= r */
+%        r = mn;
+%        g = br;
+%        b = mn + (h - 1/3) * md;
+%        break;
+%
+%      case 3:  /* b >= g >= r */
+%        r = mn;
+%        g = mn + (2/3 - h) * md;
+%        b = br;
+%        break;
+%
+%      case 4:  /* b >= r >= g */
+%        r = mn + (h - 2/3) * md;
+%        g = mn;
+%        b = br;
+%        break;
+%
+%      case 5:  /* r >= b >= g */
+%        r = br;
+%        g = mn;
+%        b = mn + (1 - h) * md;
+%        break;
+%
+%      case 6:  /* We have wrapped around the hexcone.  Thus this case is
+%      		   the same as case 0 with h = 0 */
+%        h = 0;
+%        r = br;
+%        g = mn + h * md = mn;
+%        b = mn;
+%        break;
+%    }
+%
+/.rgb_2_hsb
+  {
+    % find the largest and smallest components
+    3 copy 3 //max_n exec dup 5 1 roll
+    dup 0 eq
+      { pop pop pop pop 0 0 }
+      {
+        4 copy pop 3 //min_n exec 1 index exch sub
+        dup 2 index div 7 1 roll
+        dup 0 eq
+          { 5 { pop } repeat 0 3 1 roll }
+          {
+            6 mul 5 1 roll
+            2 copy eq       % blue == brightness
+              { pop pop sub exch div .666667 add }
+              {
+                2 index eq  % green == brightness
+                  { exch pop exch sub exch div .3333333 add }
+                  {
+                    % red == brightness
+                    sub exch pop exch div
+                    dup 0 lt
+                      { 1 add }
+                    if
+                  }
+                ifelse
+              }
+            ifelse
+            3 1 roll
+          }
+        ifelse
+      }
+    ifelse
+  }
+bind def
+
+
+/.hsb_2_rgb
+  {
+    3 { 0 max 1 min 3 1 roll } repeat
+    1 2 index sub 1 index mul      % (1 - s) * br
+    3 -1 roll 2 index mul 6 mul    % 6 * s * br
+    4 -1 roll                      % stack: <br>  <(1 - s) * br>  <6 * s * br>  <h>
+
+    % array of procedures for the 7 hue cases
+      {
+        % 0 ==> r >= g >= b
+        { mul 1 index add exch }
+
+        % 1 ==> g >= r >= b
+        { 0.333333 exch sub mul 1 index add 3 1 roll }
+
+        % 2 ==> g >= b >= r
+        { 0.333333 sub mul 1 index add 3 1 roll exch 3 -1 roll }
+
+        % 3 ==> b >= g >= r
+        { 0.666667 exch sub mul 1 index add 3 -1 roll }
+
+        % 4 ==> b >= r >= g
+        { 0.666667 sub mul 1 index add 3 1 roll exch }
+
+        % 5 ==> r >= b >= g
+        { 1 exch sub mul 1 index add }
+
+        % 6 ==> r = br, g = b = mn
+	% Case 6 is the same as case 0 with h = 0.  This also simplifies
+	% the calculations.
+        { pop pop dup }
+      }
+    1 index 6 mul cvi              % (int)(6 * h)
+    get exec    
+  }
+bind def
+
+
+%
+%   <hue>  <saturation>  <brightness   sethsbcolor   -
+%
+%   - currenthsbcolor   <hue>  <saturation>  <brightness>
+%
+/sethsbcolor
+  {
+      { //.hsb_2_rgb exec setrgbcolor }
+    stopped
+      { /sethsbcolor load $error /errorname get signalerror }
+    if
+  }
+bind systemdict begin odef end
+
+/currenthsbcolor
+  {
+      { currentrgbcolor //.rgb_2_hsb exec }
+    stopped
+      { /currenthsbcolor load $error /errorname get signalerror }
+    if
+  }
+bind systemdict begin odef end
+
+end     % .cspace_util
+.setglobal

+ 11 - 13
sys/lib/ghostscript/gs_css_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_css_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_css_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the CFF StandardStrings that represent characters.
 % This is a pseudo-encoding.
 /currentglobal where

+ 11 - 13
sys/lib/ghostscript/gs_dbt_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1993, 1994 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_dbt_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_dbt_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the Dingbats encoding vector.
 /currentglobal where
  { pop currentglobal { setglobal } true setglobal }

+ 248 - 0
sys/lib/ghostscript/gs_devcs.ps

@@ -0,0 +1,248 @@
+%    Copyright (C) 2002 Aladdin Enterprises.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_devcs.ps,v 1.7 2005/09/12 11:34:50 leonardo Exp $
+% Device-specific color space method dictionaries.
+
+%
+% This file implements the method dictionaries for the Device-specific
+% color spaces. See gs_cspace.ps for information.
+%
+% Note that, because these color spaces are parameter-less, no color
+% space validation is required: if we can get to the color space methods,
+% we know the color space is legitimate.
+%
+% The colorspace substitution routines for these color spaces
+% (cs_substitute) will fail in a Level 1 system, but this is not a
+% problem as .getuseciecolor will always return false for such systems.
+%
+.currentglobal true .setglobal
+.cspace_util begin
+
+%
+%   <r>  <g>  <b>   rgb_2_gray   <gray>
+%
+% Convert RGB colors to gray. This includes a special check for
+% r == g == b, and avoids roundoff error if this is the case.
+%
+/rgb_2_gray
+  {
+    3 copy 1 index eq 3 1 roll eq and
+      { pop pop }
+      { .11 mul exch .59 mul add exch .3 mul add }
+    ifelse
+  }
+bind def
+
+systemdict /..page_default_spaces 3 dict put
+
+% <color_space_name> ..includecolorspace -
+/..includecolorspace
+{ % Only includes ones explicitly defined by the document.
+  systemdict /..page_default_spaces get 1 index known {
+    pop
+  } {
+    mark exch
+    { dup /ColorSpace resourcestatus {
+        pop 0 eq {
+          systemdict /..page_default_spaces get 1 index //true put
+          gsave
+          { dup /ColorSpace findresource //_setcolorspace_nosub exec .includecolorspace
+          } stopped pop
+          grestore
+        } if
+      } if
+    } stopped pop
+    cleartomark
+  } ifelse
+} bind def
+
+% <color_space> <color_space_name> cs_substitute_generic <color_space1> <color_space2>
+/cs_substitute_generic
+{ .getuseciecolor
+    { NOSUBSTDEVICECOLORS 
+        { //..includecolorspace exec dup }
+        { /ColorSpace findresource }
+      ifelse
+    }
+    { pop dup }
+  ifelse
+}
+bind def
+
+% <color_space> <color_space_name> cs_substitute_DeviceRGB_for_PDFX <color_space1> <color_space2>
+/cs_substitute_DeviceRGB_for_PDFX
+{ systemdict /PDFX .knownget not { false } if {
+    dup /ColorSpace resourcestatus {
+      pop pop
+    } {
+      (Error: Need a /DefaultRGB /ColorSpace resource for generating a PDF/X document.) =
+      /cs_substitute_DeviceRGB_for_PDFX /undefined signalerror
+    } ifelse
+    /ColorSpace findresource
+  } {
+    //cs_substitute_generic exec
+  } ifelse   
+} bind def
+
+colorspacedict
+
+dup
+/DeviceGray
+  mark
+    /cs_potential_indexed_base true
+    /cs_potential_pattern_base true
+    /cs_potential_alternate true
+    /cs_potential_icc_alternate true
+    /cs_get_ncomps //ncomps_1
+    /cs_get_range  //get_range_1
+    /cs_get_default_color { pop 0 } bind
+    /cs_get_currentgray //pop_1
+    /cs_get_currentrgb { pop dup dup } bind
+    /cs_get_currentcmyk { pop 1 exch sub 0 0 0 4 -1 roll } bind
+    /cs_validate {}
+
+    /cs_substitute
+      { /DefaultGray //cs_substitute_generic exec
+      }
+    bind
+
+    /cs_prepare {}
+    /cs_install { pop 0 .setdevcspace } bind
+    /cs_prepare_color //validate_1
+    /cs_complete_setcolor //pop_1
+  .dicttomark
+put
+
+
+/DeviceRGB
+  mark
+    /cs_potential_indexed_base true
+    /cs_potential_pattern_base true
+    /cs_potential_alternate true
+    /cs_potential_icc_alternate true
+    /cs_get_ncomps //ncomps_3
+    /cs_get_range  //get_range_3
+    /cs_get_default_color { pop 0 0 0 } bind
+    /cs_get_currentgray { pop //rgb_2_gray exec } bind
+    /cs_get_currentrgb //pop_1
+
+    % to convert to cmyk use blackgeneration and undercolorremoval
+    /cs_get_currentcmyk
+      {
+        pop
+
+        % convert to subtractive (CMY) color space
+        3
+          { 1 exch sub 3 1 roll }
+        repeat
+
+        % find the minimum (initial k component)
+        3 copy
+        2
+          {
+            2 copy gt
+              { exch }
+            if
+            pop
+          }
+        repeat
+
+        % apply undercolorremoval
+        dup 5 1 roll currentundercolorremoval exec 4 1 roll
+        3
+          { 3 index sub //bound_0_1 exec 3 1 roll }
+        repeat
+
+        % apply blackgeneration
+        5 3 roll pop currentblackgeneration exec //bound_0_1 exec
+      }
+    bind
+
+    /cs_validate {}
+
+    /cs_substitute
+      { /DefaultRGB //cs_substitute_DeviceRGB_for_PDFX exec
+      }
+    bind
+
+    /cs_prepare {}
+    /cs_install { pop 1 .setdevcspace } bind
+    /cs_prepare_color //validate_3
+    /cs_complete_setcolor //pop_1
+  .dicttomark
+put
+
+end     % .cspace_util
+.setglobal
+
+
+% Only create the DeviceCMYK color space if setcolorscreen is present
+/setcolorscreen where
+  { pop }
+  { currentfile closefile }
+ifelse
+
+
+.currentglobal true .setglobal
+.cspace_util begin
+
+colorspacedict
+/DeviceCMYK
+  mark
+    /cs_potential_indexed_base true
+    /cs_potential_pattern_base true
+    /cs_potential_alternate true
+    /cs_potential_icc_alternate true
+    /cs_get_ncomps //ncomps_4
+    /cs_get_range  //get_range_4
+    /cs_get_default_color { pop 0 0 0 1 } bind
+
+    /cs_get_currentgray
+      { pop 4 1 roll //rgb_2_gray exec add 1 exch sub //bound_0_1 exec }
+    bind
+
+    /cs_get_currentrgb 
+      {
+        pop
+        4 1 roll 3
+          { 3 index add  1 exch sub //bound_0_1 exec 3 1 roll }
+        repeat
+        4 -1 roll pop
+      }
+    bind
+
+    /cs_get_currentcmyk //pop_1
+
+    /cs_validate {}
+
+    /cs_substitute
+      { /DefaultCMYK //cs_substitute_generic exec
+      }
+    bind
+
+    /cs_prepare {}
+    /cs_install { pop 2 .setdevcspace } bind
+    /cs_prepare_color //validate_4
+    /cs_complete_setcolor //pop_1
+  .dicttomark
+put
+
+currentdict /..includecolorspace .undef
+currentdict /cs_substitute_generic .undef
+
+end     % .cspace_util
+.setglobal
+

+ 191 - 0
sys/lib/ghostscript/gs_devn.ps

@@ -0,0 +1,191 @@
+%    Copyright (C) 2001, 2002 Aladdin Enterprises.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_devn.ps,v 1.3 2002/11/13 20:23:10 alexcher Exp $
+% DeviceN color space method dictionary; this depends on gs_sepr.ps
+
+
+% verify that DeviceN and Separation color spaces are supported
+/.setdevicenspace where
+  {
+    pop
+    /.setseparationspace where
+      { pop //false }
+      { //true }
+    ifelse
+  }
+  { //true }
+ifelse
+  { currentfile closefile }
+if
+
+.currentglobal true .setglobal
+.cspace_util begin
+
+
+%
+%   <c1> ... <cm>  <array>   apply_devn_tint_xform   <c1>' ... <cn>'  <array>
+%
+% Apply the tint transformation for the DeviceN color intensity values.
+/apply_devn_tint_xform
+  {
+    dup 1 get length 1 add exch
+    mark 2 index 2 add 2 roll
+    index 3 get exec
+    counttomark 2 add -2 roll pop
+  }
+bind def
+
+
+
+colorspacedict
+/DeviceN
+  mark
+    /cs_potential_indexed_base true
+    /cs_potential_pattern_base true
+    /cs_potential_alternate false
+    /cs_potential_icc_alternate false
+    /cs_get_ncomps { 1 get length } bind
+    /cs_get_range { 1 get length [ exch { 0 1 } repeat ] } bind
+    /cs_get_default_color { 1 get length { 1 } repeat } bind
+
+    /cs_get_currentgray
+      { //apply_devn_tint_xform exec 2 get //.cs_get_currentgray exec }
+    bind
+    /cs_get_currentrgb
+      { //apply_devn_tint_xform exec 2 get //.cs_get_currentrgb exec }
+    bind
+    /cs_get_currentcmyk
+      { //apply_devn_tint_xform exec 2 get //.cs_get_currentcmyk exec }
+    bind
+
+    % a lot of validation is done by the cs_validate method
+    /cs_validate
+      {
+        //check_array exec
+        dup 1 get //check_array exec
+          {
+            type dup /nametype ne exch /stringtype ne and
+              //setcspace_typecheck
+            if
+          }
+        forall
+        dup 2 get //.cs_validate exec //.cs_potential_alternate exec not
+          //setcspace_rangecheck
+        if
+        dup 3 get //check_array exec xcheck not
+          //setcspace_typecheck
+        if
+      }
+    bind
+
+    % substitute the base space if appropriate
+    /cs_substitute
+      {
+        dup 2 get //.cs_substitute exec 2 copy eq
+          { pop pop dup }
+          {
+            % retain only the new alternate space
+            exch pop
+
+            % build all new structures in local VM
+            .currentglobal 3 1 roll //false .setglobal
+
+            % construct a new array and insert the new base color space
+            1 index dup length array copy dup 2 4 -1 roll put
+
+            % restore VM mode
+            3 -1 roll .setglobal
+          }
+        ifelse
+      }
+    bind
+
+    %
+    % The Ghostscript interpreter works better when tinttransform procedures
+    % are translated into functions. Attempt to do that here.
+    %
+    /cs_prepare //converttinttransform
+
+    %
+    % Install the current color space.
+    %
+    % The current Ghostscript color space implementation requires that
+    % color spaces that provide a base or alternative color space set
+    % that base/alternative color space to be the current color space
+    % before attempting to set the original color space.
+    %
+    % Beginning with Acrobat 5, PDF apparently supports 1-component
+    % DeviceN color spaces with the single component "All" (the "PDF
+    % Reference", 3rd ed., p. 206 still describes this as illegal).
+    % We translate such calls to Separation color spaces.
+    %
+    /cs_install
+      {
+        % save the current color space
+        currentcolorspace
+
+        % set the base color space as the current color space
+        1 index 2 get //forcesetcolorspace
+
+        % set the indexed color space; restore the earlier space on error
+        mark 2 index
+        dup 1 get dup length 1 eq exch 0 get /All eq and
+          {
+            dup length array copy
+            dup 0 /Separation put
+            dup 1 /All put
+              { .setseparationspace }
+          }
+          { { .setdevicenspace } }
+        ifelse
+        stopped
+          { cleartomark setcolorspace stop }
+          { pop pop pop }
+        ifelse
+      }
+    bind
+
+    /cs_prepare_color { dup 1 get length //check_num_stack exec pop } bind
+
+    %
+    % If a DeviceN color space is not supported in native mode by
+    % the current process color model, Adobe implementations will always
+    % execute the tint transform procedure when setcolor is invoked.
+    % Ghostscript may have turned this transform into a sampled function,
+    % and even if this is not the case, will have sampled the transform
+    % when the color space is first set. Some applications depend on
+    % the Adobe behavior, so we implement it via the cs_complete_setcolor
+    % method.
+    %
+    /cs_complete_setcolor
+      {
+        .usealternate
+          {
+            pop currentcolor
+            currentcolorspace 3 get exec
+            currentcolorspace 2 get
+            //clear_setcolor_operands exec
+          }
+          { pop }
+        ifelse
+      }
+    bind
+
+  .dicttomark
+put
+
+end     % .cspace_util
+.setglobal

+ 78 - 0
sys/lib/ghostscript/gs_devpxl.ps

@@ -0,0 +1,78 @@
+%    Copyright (C) 2002 Aladdin Enterprises.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_devpxl.ps,v 1.1 2002/08/22 07:12:28 henrys Exp $
+% DevicePixel color space method dictionaries.
+
+%
+% This file implements the DevicePixel color space. See gs_cspace.ps
+% for information.
+%
+% The DevicePixel color space includes a single parameter, the bit
+% depth of the device color representation. Color is expressed as
+% single integers in an opaque, device-specific format.
+%
+
+% verify that the DevicePixel color space is supported
+/.setdevicepixelspace where
+  { pop }
+  { currentfile closefile }
+ifelse
+
+
+.currentglobal true .setglobal
+
+.cspace_util begin
+
+
+colorspacedict
+/DevicePixel
+  mark
+    /cs_potential_indexed_base true
+    /cs_potential_pattern_base true
+    /cs_potential_alternate true
+    /cs_potential_icc_alternate true
+    /cs_get_ncomps //ncomps_1
+    /cs_get_range { [ exch 1 get 1 exch bitshift 1 sub ] } bind
+    /cs_get_default_color { pop 0 } bind    % no good default
+    /cs_get_currentgray //no_currentgray
+    /cs_get_currentrgb //no_currentrgb
+    /cs_get_currentcmyk //no_currentcmyk
+
+    /cs_validate
+      {
+        //check_array exec
+        dup 1 get dup type /integertype ne
+          //setcspace_typecheck
+        if
+        dup 0 lt
+          //setcspace_rangecheck
+        if
+        31 gt   % 31 bits is an implementation limit
+          { /setcolorspace cvx /limitcheck signalerror }
+        if
+      }
+    bind
+
+    /cs_substitute //dup_1
+    /cs_prepare {}
+    /cs_install { .setdevicepixelspace } bind
+    /cs_prepare_color //validate_1
+    /cs_complete_setcolor //pop_1
+  .dicttomark
+put
+
+end     % .cspace_util
+.setglobal

+ 11 - 13
sys/lib/ghostscript/gs_diskf.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1996 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_diskf.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_diskf.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Support for converting Type 1 fonts without eexec encryption to
 % Type 4 fonts that load individual character outlines on demand.
 

+ 214 - 0
sys/lib/ghostscript/gs_diskn.ps

@@ -0,0 +1,214 @@
+%    Copyright (C) 1990, 2000 Aladdin Enterprises.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_diskn.ps,v 1.5 2003/08/08 18:45:04 ray Exp $
+% Initialization file for %disk device modifications
+% When this is run, systemdict is still writable,
+
+systemdict begin
+
+% Collect the list of searchable IODevices in SearchOrder
+% Efficiency here doesn't matter since we run this at the end
+% of gs_init and convert it to a static array.
+/.getsearchabledevs { % - .getsearchabledevs [ list_of_strings ]
+  //systemdict /.searchabledevs .knownget not {
+    .currentglobal true .setglobal
+    mark (*) { 
+      dup length string copy dup currentdevparams /Searchable
+      .knownget { not { pop } if } { pop } ifelse
+    } 8192 string /IODevice resourceforall
+    ]
+    % now process the array into correct SearchOrder
+    0 1 2 {
+      mark exch 2 index {
+	dup currentdevparams /SearchOrder get 2 index eq
+	{ exch } { pop } ifelse
+      } forall % devices on the old list
+      pop
+      % make the array and sort it by name
+      ] { lt } bind .sort 
+      exch
+    } for
+    % collect all devices with SearchOrder > 2
+    mark 2 index {
+      dup currentdevparams /SearchOrder get 2 gt 
+      { exch } { pop } ifelse
+    } forall 
+    ] exch pop
+    % We now have 4 arrays on the stack, SO=0 SO=1 SO=2 SO>2
+    % make them into a single array
+    mark 5 1 roll ] mark exch { { } forall } forall ]
+    //systemdict /.searchabledevs 2 index .forceput
+    exch .setglobal
+  }
+  if
+} .bind executeonly def % must be bound and hidden for .forceput
+
+% Modify .putdevparams to force regeneration of .searchabledevs list
+/.putdevparams {
+  % We could be smarter and check for %disk* device, but this
+  % doesn't get run enough to justify the complication
+  //.putdevparams
+  //systemdict /.searchabledevs .forceundef  
+} .bind odef % must be bound and hidden for .forceundef
+
+% ------ extend filenameforall to handle wildcards in %dev% part of pattern -------%
+/filenameforall {
+  count 3 ge {
+    2 index (%) search {
+      pop pop 
+    } {
+      % no device specified, so search them all
+      pop (*%) 3 index concatstrings
+      % we need to suppress the device when we return the string
+      % in order to match Adobe's behaviour with %disk devices.
+      4 -2 roll		% the callers procedure
+      [ { (%) search { pop pop (%) search { pop pop } if } if } /exec load
+        4 -1 roll		% the callers procedure
+        /exec load
+      ] cvx
+      4 2 roll		% put the modified procedure where it belongs
+    } ifelse
+    % extract device portion (up to end of string or next %)
+    (%) search { exch pop } if	% stack: opat proc scratch npat device
+    dup (*) search { pop pop pop true } { pop false } ifelse
+    1 index (?) search { pop pop pop true } { pop false } ifelse
+    or not {
+      pop pop //filenameforall	% device with no wildcard
+    } {
+      (%) concatstrings (%) exch concatstrings
+      .getsearchabledevs
+      % find all matching devices and add the rest of the search string
+      mark exch {
+          dup counttomark 1 add index .stringmatch {
+          counttomark 2 add index concatstrings
+        } {
+          pop
+        } ifelse
+      } forall
+      ]
+      3 1 roll pop pop
+      4 -1 roll pop 
+      % now we need to invoke filenameforall for each of the strings
+      % in the array. We do this by building a procedure that is like
+      % an unrolled 'forall' loop. We do this to get the parameters
+      % for each filenameforall, since each execution will pop its
+      % parameters, but we can't use the operand stack for storage
+      % since each invocation must have the same operand stack.
+      mark exch {
+          counttomark dup 3 add index exch
+          2 add index
+          /filenameforall load
+        } forall
+      ] cvx
+      3 1 roll pop pop
+      exec		% run our unrolled loop
+    }
+    ifelse
+  } {
+    //filenameforall	% not enough parameters -- just let it fail
+  }
+  ifelse
+} odef
+
+% redefine file to search all devices in order
+/file {
+  dup 0 get (r) 0 get eq dup {
+    pop false				% success code
+    2 index 0 get 37 eq { [ () ] } { .getsearchabledevs } ifelse
+    { 3 index concatstrings	% prepend the device
+      {
+        2 index //file } .internalstopped not {
+	4 1 roll pop pop pop true
+	exit		% exit with success
+      } {
+        pop pop
+      }
+      ifelse
+    }
+    forall
+  }
+  if
+  not {		% just let standard file operator handle things
+    //file
+  }
+  if
+} bind odef
+
+% redefine deletefile to search all devices in order
+/deletefile {
+  false				% success code
+  1 index 0 get 37 eq { [ () ] } { .getsearchabledevs } ifelse
+  { 2 index concatstrings	% prepend the device
+    { //deletefile } .internalstopped exch pop not {
+      pop true exit		% exit with success
+    }
+    if
+  }
+  forall
+  not { $error /errorname get /deletefile exch signalerror } if
+} bind odef
+
+% redefine status to search all devices in order
+/status {
+  dup type /stringtype eq {
+    false				% success code
+    1 index 0 get 37 eq { [ () ] } { .getsearchabledevs } ifelse
+    { 2 index concatstrings	% prepend the device
+      { //status } .internalstopped not {
+        { true 7 -2 roll pop pop true exit } % exit with success
+	if
+      }
+      if
+    }
+    forall
+    % If we made it this far, no devices were found to status the file
+    	% clean up to return 'false'
+    exch pop
+  } {
+    //status
+  }
+  ifelse
+} bind odef
+
+% Also redefine renamefile to search all devices in order
+/renamefile {
+  false				% success code
+  2 index 0 get 37 eq { [ () ] } { .getsearchabledevs } ifelse
+  { dup 4 index concatstrings	% prepend the device
+    { (r) //file } .internalstopped
+    not {
+      closefile exch pop true exit	% exit with success
+    } {
+      pop pop
+    } ifelse
+  }
+  forall
+  not { $error /errorname get /renamefile exch signalerror } if
+  3 -1 roll concatstrings exch
+  //renamefile
+} bind odef
+
+% redefine devforall to process devices in numeric order
+% Spec's for 'devforall' are unclear, but font downloaders may expect this
+/devforall {		% <proc> <scratch> devforall -
+  [ { dup length string copy } 2 index //devforall ]	
+  % stack: proc scratch array_of_device_names
+  { lt } .sort
+  % We don't really invoke the procedure with the scratch string
+  % but rather with the strings from our array
+  exch pop exch forall
+} odef
+end				% systemdict

+ 33 - 13
sys/lib/ghostscript/gs_dpnxt.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1997, 1998 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_dpnxt.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_dpnxt.ps,v 1.5 2002/08/22 07:12:28 henrys Exp $
 % gs_dpnxt.ps
 % NeXT Display PostScript extensions
 
@@ -104,6 +102,28 @@ counttomark { counttomark 1 sub def } repeat pop
   } //systemdict /exec get 3 packedarray cvx loop
 } bind odef
 
+%
+%   <w>  <h>  <bpc>  <mtx>  <dsrc0> ... <multi>  <ncomp>   alphaimage   -
+%
+img_utils_dict begin
+/.alphaimage  where
+  {
+    pop
+    currentglobal true setglobal
+    /alphaimage
+      {
+        //true
+          //.colorimage
+        stopped
+          { /alphaimage load $error /errorname get signalerror }
+        if
+      }
+    .bind systemdict begin odef end
+    setglobal
+  }
+if
+end
+
 % Implement sizeimage using lower-level operators.
 
 /sizeimage {		% <x> <y> <width> <height> <matrix> sizeimage

+ 30 - 15
sys/lib/ghostscript/gs_dps.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1997, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gs_dps.ps,v 1.4 2000/09/19 18:29:11 lpd Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_dps.ps,v 1.8 2002/11/14 17:24:00 raph Exp $
 % Initialization file for Display PostScript functions.
 
 % ------ Contexts ------ %
@@ -183,7 +181,24 @@
   /BlueValues null /ColorValues null
 .dicttomark readonly def
 /deviceinfo {			% - deviceinfo <dict>
-  currentdevice //.deviceinfodict .getdeviceparams .dicttomark readonly
+  currentdevice //.deviceinfodict .getdeviceparams .dicttomark
+  dup begin
+  /ColorValues .knownget {
+    0 le
+    { currentdict /ColorValues undef }
+    {
+      % hack around devices that incorrect set GrayValues
+      Colors 3 eq { 1 } { GrayValues } ifelse
+      RedValues mul GreenValues mul BlueValues mul ColorValues ne
+      { currentdict /GrayValues undef
+        currentdict /RedValues undef
+        currentdict /GreenValues undef
+        currentdict /BlueValues undef
+      } if
+    }
+    ifelse
+  } if
+  currentdict end readonly
 } odef
 
 % The current implementation allocates a 2-element array each time.

+ 12 - 14
sys/lib/ghostscript/gs_dps1.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1997, 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gs_dps1.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_dps1.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Initialization file for most of the Display PostScript functions
 % that are also included in Level 2.
 

+ 11 - 13
sys/lib/ghostscript/gs_dps2.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1990, 1996, 1997, 1998, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_dps2.ps,v 1.3 2000/11/07 18:51:24 lpd Exp $
+% $Id: gs_dps2.ps,v 1.5 2002/02/21 21:49:28 giles Exp $
 % Initialization file for basic Display PostScript functions
 % that are also included in Level 2.
 

+ 11 - 13
sys/lib/ghostscript/gs_dscp.ps

@@ -1,21 +1,19 @@
 %  Copyright (C) 2000 Artifex Software Inc.   All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_dscp.ps,v 1.4 2001/03/12 22:41:22 dancoby Exp $
+% $Id: gs_dscp.ps,v 1.6 2002/02/21 21:49:28 giles Exp $
 %  Postscript interface routines to DSC parser
 
 /send_orientation {			% <orientation> send_orientation -

+ 213 - 31
sys/lib/ghostscript/gs_epsf.ps

@@ -1,43 +1,218 @@
-%    Copyright (C) 1989, 1996 Aladdin Enterprises.  All rights reserved.
+%    Copyright (C) 1989, 1996, 2002 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_epsf.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
-% Allow the interpreter to recognize MS-DOS EPSF file headers, and skip to
-% the PostScript section of the file.
+% $Id: gs_epsf.ps,v 1.15 2005/08/30 23:26:49 alexcher Exp $
+% Allow the interpreter to encapsulate EPS files, to recognize MS-DOS 
+% EPSF file headers, and skip to the PostScript section of the file.
+
+% Encapsulate EPS files and optionally resize page or rescale image.
+% To display an EPS file cropped to the bounding box:
+%  gs -dEPSCrop file.eps
+% To display an EPS file scaled to fit the page:
+%  gs -dEPSFitPage file.eps
+% To display a file without EPS encapsulation:
+%  gs -dNOEPS file.ps
+
+% When starting to process an EPS file, state is 0.
+% After %%BoundingBox processed, state is 1 if OK or 2 if cropped.
+% After %%HiResBoundingBox processed, state is 3 if OK or 4 if cropped.
+% After %%EndComments processed, state is 5.
+/EPSBoundingBoxState 5 def
+/EPSBoundingBoxSetState {
+  //systemdict /EPSBoundingBoxState 3 -1 roll .forceput
+} .bind odef % .forceput must be bound and hidden
+
+% Parse 4 numbers for a bounding box
+/EPSBoundingBoxParse { % (llx lly urx ury) -- llx lly urx ury true OR false
+    mark exch
+    token {exch token {exch token {exch token {exch pop} if} if} if} if
+    counttomark
+    4 eq {
+      5 -1 roll pop % remove mark
+      true
+    } {
+      cleartomark false
+    } ifelse
+} bind def
+
+% Rescale and translate to fit the BoundingBox on the page
+/EPSBoundingBoxFitPage { % llx lly urx ury --
+  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
+  % calculate scale to fit smaller of width or height
+  exch 4 -1 roll sub 3 1 roll exch sub 
+  4 2 roll 5 index 5 index 4 2 roll
+  exch 4 -1 roll sub 3 1 roll exch sub 
+  4 2 roll
+  exch 4 -1 roll div 3 1 roll exch div
+  1 index 1 index lt {pop}{exch pop} ifelse
+  dup scale
+  % translate to EPS -llx,-lly
+  exch neg exch neg translate
+} bind def
+
+% Crop the page to the BoundingBox
+/EPSBoundingBoxCrop { % llx lly urx ury --
+  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
+  << /PageSize [ 5 -2 roll ] >> setpagedevice
+  neg exch neg exch translate
+} bind def
+
+
+/EPSBoundingBoxProcess { % (llx lly urx ury) state --
+  //systemdict /EPSBoundingBoxState get 1 index lt {
+    exch EPSBoundingBoxParse 
+    {
+      //systemdict /EPSCrop known {
+        EPSBoundingBoxCrop
+      } {
+        //systemdict /EPSFitPage known {
+          EPSBoundingBoxFitPage
+	} {
+	  % Warn if some of the EPS file will be clipped
+	  clippath pathbbox newpath
+	  { % context for exit
+	    5 -1 roll lt { 6 { pop } repeat true exit } if
+	    4 -1 roll lt { 4 { pop } repeat true exit } if
+	    3 -1 roll gt { 2 { pop } repeat true exit } if
+	    exch gt { true exit } if
+	    false exit
+	  } loop
+	  QUIET not and /EPSBoundingBoxState .systemvar 1 and 1 eq and {
+	    (\n   **** Warning: Some of the BoundingBox for the EPS file will be clipped.) =
+	    (                 Use -dEPSCrop or -dEPSFitPage to avoid clipping.\n) =
+	    flush
+            1 add
+          } if
+	} ifelse
+      } ifelse
+      EPSBoundingBoxSetState
+    } {
+      pop % state
+    } ifelse
+  } {
+    pop pop
+  } ifelse
+} bind def
+
+/ProcessEPSComment { % file comment --  file comment
+  //systemdict /EPSBoundingBoxState get 3 lt {
+    dup
+    (%%EndComments) anchorsearch {
+      pop pop
+      % ignore any following bounding boxes
+      5 EPSBoundingBoxSetState
+    } {
+      (%%BoundingBox:) anchorsearch {
+	pop 
+	EPSDEBUG { (gs_epsf.ps: found %%BoundingBox\n) print flush } if
+	1 EPSBoundingBoxProcess
+      } {
+	(%%HiResBoundingBox:) anchorsearch {
+	  pop 
+	  EPSDEBUG { (gs_epsf.ps: found %%HiResBoundingBox\n) print flush } if
+	3 EPSBoundingBoxProcess
+	} { 
+	  pop % Not interested in this DSC comment
+	} ifelse
+      } ifelse
+    } ifelse
+  } if
+} bind def
+
+% Install EPS handler for DSC comments, which we do later
+/EPSBoundingBoxInit {
+  systemdict /NOEPS known not {
+    % Merge ProcessEPSComment with existing handler
+    /ProcessEPSComment load /exec load
+    currentuserparams /ProcessDSCComment get 
+    dup null eq {pop {pop pop}} if /exec load
+    4 array astore cvx readonly
+    << /ProcessDSCComment 3 -1 roll >> setuserparams
+  } if
+} bind def
+
+/.runNoEPS /run load def
+
+/.runEPS { % file OR string --
+  /runEPS_save save def
+  /runEPS_dict_count countdictstack def
+  /runEPS_op_count count 2 sub def
+  /runEPS_page_count currentpagedevice /PageCount get def 
+  0 EPSBoundingBoxSetState
+  .runNoEPS
+  currentpagedevice /PageCount get runEPS_page_count sub 0 eq 
+  { /showpage load exec } if
+  count runEPS_op_count sub {pop} repeat
+  countdictstack runEPS_dict_count sub {end} repeat
+  runEPS_save restore
+} bind def
+
+/run { % file OR string --
+  dup type /filetype ne { (r) file } if
+  dup (%!PS-Adobe-) .peekstring {
+    (%!PS-Adobe-) eq {
+      dup (%!PS-Adobe-X.X EPSF-X.X) .peekstring {
+      (EPSF) search {
+        pop pop pop
+        EPSDEBUG {(runEPS: Found EPS\n) print flush} if
+        systemdict /NOEPS known {
+          cvx .runNoEPS
+        } {
+          cvx .runEPS
+        } ifelse
+      } {
+        EPSDEBUG {(runEPS: Normal DSC\n) print flush} if
+        pop
+          cvx .runNoEPS
+
+      } ifelse
+      } {
+        EPSDEBUG {(runEPS: Short DSC\n) print flush} if
+      pop
+        cvx .runNoEPS
+      } ifelse
+    } {
+      EPSDEBUG {(runEPS: Not DSC\n) print flush} if
+      cvx .runNoEPS
+    } ifelse
+  } {
+    EPSDEBUG {(runEPS: Short non-DSC\n) print flush} if
+    pop
+    cvx .runNoEPS
+  } ifelse
+} bind odef
+
+
+% Handle DOS EPS files.
 
 /.runnoepsf /run load def
 /.epsfheader <C5D0D3C6> def
 /run
  { dup type /filetype ne { (r) file } if
 		% Check for MS-DOS EPSF file (see Red Book p. 729).
-   true exch 0 1 3
-    {		% Stack: true file index
-      1 index read dup { pop dup .epsfheader 3 index get eq } if
-       { pop pop }	% if matched, don't need the character
-       {	% unread characters (wasn't EPSF)
-	 2 index exch unread     % unread mismatch character
-	 dup {   % loop unreading backwards in .epsfheader
-	   1 sub dup .epsfheader exch get 2 index exch unread
-	 } repeat pop
-	 exch not exch exit	% change true to false
-       }
-      ifelse
-    }
-   for exch	% Stack: file true/false
+ dup (    ) .peekstring 
+  { .epsfheader eq { dup (    ) readstring exch pop } { false } ifelse }
+  { pop false }
+ ifelse
+		% Stack: file true/false
     {		% This block is executed if the file is MS-DOS EPSF.
 		% Build up the little-endian byte offset and length.
       2
@@ -53,9 +228,16 @@
 		% PostScript section.
       dup 4 -1 roll 12 sub () /SubFileDecode filter flushfile
 		% Now interpret the PostScript.
-      exch () /SubFileDecode filter cvx .runexec
+      exch () /SubFileDecode filter cvx run
     }
     { .runnoepsf
     }
    ifelse
  } odef
+
+% rebind .runstdin to use redefined run
+userdict begin
+/.runstdin {
+  { (%stdin) run } execute0
+} bind def
+end

+ 268 - 0
sys/lib/ghostscript/gs_fapi.ps

@@ -0,0 +1,268 @@
+%    Copyright (C) 2000 artofcode LLC.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_fapi.ps,v 1.25 2003/04/12 18:08:18 ray Exp $
+% Redefine Font and CIDFont categories with FAPI-handeled fonts.
+
+systemdict /.FAPIavailable known { .FAPIavailable } { false } ifelse not {
+  (%END FAPI) .skipeof
+} if
+
+languagelevel 2 .setlanguagelevel
+
+%====================================================================
+% Redefine Font category with FAPIfontmap and CIDFont with FAPIfontmap :
+15 dict begin    % a temporary dictionary for local binding.
+
+/EmbedFontObjectsQuery mark
+  /.EmbedFontObjects 0
+.dicttomark def
+
+/is_device_compatible_to_FAPI    % - is_device_compatible_to_FAPI <bool>
+{ currentdevice //EmbedFontObjectsQuery .getdeviceparams               % <mark> <name> <value> ...
+  dup mark eq {
+    pop true
+  } {
+    exch pop exch pop 0 eq
+  } ifelse
+  % The code above assumes that only the requested parameter is rendered.
+  % The commented-out code below may be useful for general case.
+  % Keeping it for a while.
+  % counttomark 2 idiv {
+  %   exch /.EmbedFontObjects eq {
+  %     counttomark 1 add 1 roll cleartomark
+  %     0 eq exit
+  %   } if
+  % } repeat
+  % dup mark eq {
+  %   pop true
+  % } if
+} bind def
+
+%----------------------------- Process FAPIconfig -----------------------
+
+/Config
+<<
+%% Replace 1 (FAPIconfig)
+  (FAPIconfig) .runlibfile
+>> def
+
+%------------------Copy the FontEmulationProcs here : -------------------
+
+/FontEmulationProcs /ProcSet findresource {
+  def
+} forall
+
+currentdict /super.complete_instance currentdict /complete_instance get put
+
+%-----------FAPI-specific methods for category redefinition : -----------
+
+/RefinePath      % <FontDict> /key RefinePath <FontDict>
+{ exch begin
+  //Config exch get
+  /Path exch
+  Path false .file_name_combine not {
+    exch
+    (Can't combine paths ) print print ( and ) print =
+    /RefinePath /configurationerror signalerror
+  } if
+  def
+  currentdict end
+} bind def
+
+/complete_instance  % <font_name> <FontDict> <Options> complete_FAPI_Font <font_name> <FontDict>
+{ //super.complete_instance exec
+  dup /CIDFontName known { /CIDFontPath } { /FontPath } ifelse //RefinePath exec
+} bind def
+
+/IsMyRecord      % <raw_record> -> <raw_record> bool
+{ dup type /dicttype eq { dup /FAPI known } { false } ifelse
+} bind def
+
+/IsActive       % <record> IsActive <bool>
+{ pop //is_device_compatible_to_FAPI exec
+} bind def
+
+/FontRecordVirtualMethods //RecordVirtualMethodsStub dup length 2 add dict copy begin
+  /IsActive //IsActive def
+  /MakeInstance   % <Name> <record> MakeInstance <Name> <Instance> <size>
+  { //FontOptions //complete_instance exec
+    2 copy //GetSize exec
+  } bind def
+currentdict end def
+
+/CIDFontRecordVirtualMethods //RecordVirtualMethodsStub dup length 3 add dict copy begin
+  /GetCSI //TranslateCSI def
+  /IsActive //IsActive def
+  /MakeInstance   % <Name> <record> MakeInstance <Name> <Instance> <size>
+  { //CIDFontOptions //complete_instance exec
+    2 copy //GetSize exec
+  } bind def
+currentdict end def
+
+%----------------------------------The Redefintion---------------------
+
+/MappedCategoryRedefiner /ProcSet findresource /Redefine get /Redefine exch def
+
+% Redefine the /Font category :
+4 dict begin
+  /CategoryName /Font def
+  /MapFileName (FAPIfontmap) def
+  /VerifyMap  { pop } bind def
+  /PreprocessRecord  % <map> <Name> <raw_record> PreprocessRecord <map> <Name> <record> <bool>
+  { //IsMyRecord exec dup {
+      pop dup /RecordVirtualMethods //FontRecordVirtualMethods put
+      true
+    } if
+  } bind def
+currentdict end Redefine
+
+% Redefine the /CIDFont category :
+4 dict begin
+  /CategoryName /CIDFont def
+  /MapFileName (FAPIcidfmap) def
+  /VerifyMap  { pop } bind def
+  /PreprocessRecord  % <map> <Name> <raw_record> PreprocessRecord <map> <Name> <record> <bool>
+  { //IsMyRecord exec dup {
+      pop dup /RecordVirtualMethods //CIDFontRecordVirtualMethods put
+      true
+    } if
+  } bind def
+currentdict end Redefine
+
+%==================== A hook for buildfont* operators ====================
+
+% The procedure .FAPIhook redirects PS fonts to FAPI on necessity.
+% This depends on the following conditions :
+%
+% 1. If font dictionary has /FAPI entry, it is a font listed in FAPIconfig.FontPath,
+%    and must be build with .FAPIrebuildfont, or a copy of a font, which was
+%    built with .FAPIrebuildfont .
+%
+% 2. If the font dictionary has /PathLoad entry, and has no /FAPI entry,
+%    it is an installed PS font, which is described in lib/fontmap or
+%    in GS_FONTPATH. .loadfont inserts /PathLoad entry for this case
+%    (see gs_fonts.ps).
+%
+%    Installed fonts are being loaded with GS font loader,
+%    the they are passed to FAPI is same way as embedded fonts are.
+%    We do so because UFST cannot read fonts, which don't
+%    follow Type 1/42 file format strongly.
+%
+% 3. Executing .loadfont, we place /FAPI_hook_disable in the 0th
+%    element of some procedure on the execution stack - see gs_fonts.ps .
+%    If FAPI_hook finds /FAPI_hook_disable in there, 
+%    it knows that it is called for a disk font during 
+%    its internal definefont.
+%
+% 4. If font dictionary has no /FAPI entry, and has no /Path entry,
+%    and if we are not in .loadfont context, it is an embedded font.
+%
+% 5. Two entries to be defined in lib/FAPIconfig to control the hooking of PS fonts :
+%    HookDiskFonts and HookEmbeddedFonts .
+%    They specify arrays of font types (integers) to be redirected with FAPI.
+%    HookDiskFonts controls disk PS fonts (which fall into (2) and (3) ).
+%    HookEmbeddedFonts controls fonts being embedded into documents.
+%
+% 7. We apply the operator .passtoFAPI for checking whether FAPI can handle a font. 
+%    If so, we insert /FAPI entry into the font dictionary and convert it
+%    with .FAPIrebuildfont . Otherwise the font is handled with the native GS font renderer.
+
+/FAPI_hook_debug   % <proc> FAPI_hook_debug -
+FAPIDEBUG { {exec} } { {pop} } ifelse
+bind def
+ 
+/FAPI_hook_warn   % <proc> FAPI_hook_debug -
+QUIET { {pop} } { {exec} } ifelse
+bind def
+ 
+/FAPI_is_hook_disabled     % - FAPI_is_hook_disabled <bool>
+{ % checks whether execution stack contains packedarray started with /FAPI_hook_disable .
+  /FAPI_hook_disable /MappedCategoryRedefiner /ProcSet findresource /execstack_lookup get exec
+  null ne
+} bind def
+
+/FAPIhook_aux  %      <string|name> <font_dict> .FAPIhook <string|name> <font>
+{                                                     % name <<font>>
+  { (FAPIhook ) print 1 index = } //FAPI_hook_debug exec
+  dup /FAPI known {
+    { //PrintFontRef exec ( is mapped to FAPI=) print dup /FAPI get = } //FAPI_hook_warn exec
+    true //.FAPIrebuildfont //ChooseDecoding exec
+  } {
+    dup /PathLoad known dup {
+      { (PathLoad known for the font ) print //PrintFontRef exec (.) = } //FAPI_hook_debug exec
+    } {
+      pop //FAPI_is_hook_disabled exec dup
+      { pop
+        { (FAPIhook is in .loadfont context for the font ) print //PrintFontRef exec (.) = } //FAPI_hook_debug exec
+        true
+      } if
+    } ifelse
+    { /HookDiskFonts } { /HookEmbeddedFonts } ifelse
+    //Config exch get                                  % name <<font>> [types]
+    1 index //GetFontType exec //FindInArray exec      % name <<font>> bHook
+    { { (Trying to render the font ) print //PrintFontRef exec ( with FAPI...) = } //FAPI_hook_debug exec
+      //.FAPIpassfont {
+        { //PrintFontRef exec ( is being rendered with FAPI=) print dup /FAPI get = } //FAPI_hook_warn exec
+        false //.FAPIrebuildfont //ChooseDecoding exec
+      } {
+        { (Can't render ) print //PrintFontRef exec ( with FAPI, will do with native GS renderer.) = } //FAPI_hook_warn exec
+      } ifelse
+    } {
+      { (The font ) print //PrintFontRef exec ( doesn't need to render with FAPI.) = } //FAPI_hook_debug exec
+    } ifelse
+  } ifelse
+} bind def
+
+/FAPIhook  %      <string|name> <font_dict> .FAPIhook <string|name> <font>
+{ //is_device_compatible_to_FAPI exec
+  { //FAPIhook_aux exec
+  } {
+    { (FAPIhook is disabled for the current device.) = } //FAPI_hook_debug exec
+  } ifelse
+} bind def
+
+% ------------------ Redefine .buildfont* with FAPI : -----------------------
+
+/.buildfont1
+{ //.buildfont1 exec //FAPIhook exec
+} bind % 'odef' is below.
+
+/.buildfont2
+{ //.buildfont2 exec //FAPIhook exec
+} bind % 'odef' is below.
+
+/.buildfont42
+{ //.buildfont42 exec //FAPIhook exec
+} bind % 'odef' is below.
+
+/.buildfont9
+{ //.buildfont9 exec //FAPIhook exec
+} bind % 'odef' is below.
+
+/.buildfont10
+{ //.buildfont10 exec //FAPIhook exec
+} bind % 'odef' is below.
+
+/.buildfont11
+{ //.buildfont11 exec //FAPIhook exec
+} bind % 'odef' is below.
+
+end % the temporary dictionary for local binding.
+odef odef odef odef odef odef
+
+.setlanguagelevel
+
+%END FAPI

+ 11 - 13
sys/lib/ghostscript/gs_fform.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1995, 1996, 1998, 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_fform.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_fform.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Form caching implemented in PostScript.
 
 % This implementation doesn't do the right thing about halftone or

+ 399 - 0
sys/lib/ghostscript/gs_fntem.ps

@@ -0,0 +1,399 @@
+%    Copyright (C) 2000 artofcode LLC.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_fntem.ps,v 1.8 2004/10/25 15:11:37 igor Exp $
+% A procset for Postscript font emulation
+
+% The procedures must not depend on the presence of the
+% procset dictionary on the dictionary stack.
+
+languagelevel 2 .setlanguagelevel
+
+%========================= Process xlatmap ====================
+mark
+%% Replace 1 (xlatmap)
+(xlatmap) .runlibfile
+.dicttomark dup systemdict exch /.xlatmap_dict exch put
+
+% Convert it into a plain text to simplify the processing in C :
+% *(fontkind\0\0\ *(charmap\0decoding\0) ) \0
+
+() exch {
+  3 1 roll =string cvs concatstrings (\0\0) concatstrings
+  exch
+  { =string cvs concatstrings (\0) concatstrings
+  } forall
+} forall
+(\0) concatstrings
+systemdict exch /.xlatmap exch put
+
+/FontEmulationProcs 10 dict begin
+
+%-------------------------------Font--------------------------------
+
+
+/FontCommon  % - font_common -
+{ currentdict /PaintType known not {
+    /PaintType 0 def
+  } if
+  currentdict /Encoding .knownget not {
+    //StandardEncoding
+  } if
+  dup type /nametype eq {
+    /Encoding findresource
+  } if
+  /Encoding exch def
+} bind def
+
+/FontOptions 5 dict begin
+  /make_procs currentdict def
+  /NameKey /FontName def
+  /TypeKey /FontType def
+
+  1
+  { /FontMatrix [0.001 0 0 0.001 0 0] def
+    /FontBBox [-128 -128 1024 1024] def % zfapi.ps refines it.
+    /Private 0 dict def
+    /CharStrings << /.notdef () >> def
+    //FontCommon exec
+  } bind def
+
+  42
+  { /FontMatrix [1 0 0 1 0 0] def
+    /FontBBox [0 0 1 1] def % zfapi.ps refines it.
+    /CharStrings <<>> def
+    /sfnts [<00010000 0000 0000 0000 0000 0000>] def
+    /GlyphDirectory [] def
+    //FontCommon exec
+  } bind def
+
+  %fixme : more font types.
+
+currentdict end def
+
+%---------------------------CIDFont---------------------------
+
+/TranslateCSI   % <record> TranslateCSI <CSI>
+{ RESMPDEBUG { (fntem TranslateCSI beg ) = } if
+  begin
+  << /Registry (Adobe) 
+     /Ordering CSI aload pop 
+     /Supplement exch 
+  >>
+  end
+  RESMPDEBUG { (fntem TranslateCSI end ) = } if
+} bind def
+
+/CIDFontCommon
+{ /CIDSystemInfo currentdict //TranslateCSI exec def
+  currentdict /CSI undef
+  /FontBBox [-128 -128 1024 1024] def % zfapi.ps refines it.
+  /CIDCount 1 def % ChooseDecoding will set a reasonable value.
+} bind def
+
+% GFlyph substitution table for narrow, wide, proportional glyphs - 
+% used with TrueTypes.
+
+currentpacking false setpacking
+/SubstNWP << 
+
+  % Array format : orig_type, beg_CID, end_CID, subst_beg_CID, subst_type
+  % type = (n==narrow, w==wide, p==proportional).
+
+  /Japan1
+  { p 1 94 231 n    
+
+    p 17 26 780 w
+    p 34 59 790 w
+    p 66 91 816 w
+    w 842 842 7918 w  % fixme: These substitutions require to shift the glyph origin.
+    w 844 844 7919 w
+    w 846 846 7920 w
+    w 848 848 7921 w
+    w 850 850 7922 w
+    w 876 876 7923 w
+    w 908 908 7924 w
+    w 910 910 7925 w
+    w 912 912 7926 w
+    w 914 914 7927 w
+    w 925 925 7928 w
+    w 927 927 7929 w
+    w 929 929 7930 w
+    w 931 931 7931 w
+    w 933 933 7932 w
+    w 959 959 7933 w
+    w 991 991 7934 w
+    w 993 993 7935 w
+    w 995 995 7936 w
+    w 1002 1002 7937 w
+    w 1009 1009 7938 w
+    w 1010 1010 7939 w
+  } cvlit
+
+  /Japan2 1 index
+
+  /CNS1
+  { p 1 94 13648 n
+
+    p 17 26 333 w
+    p 34 59 365 w
+    p 66 91 391 w
+  } cvlit
+
+  /GB1
+  { p 2 94 814 n
+  
+    p 2 94 262 w
+
+    p 1 1 7716 n
+  } cvlit
+
+  /Korea1
+  { p  1 60 8094 n
+    p 62 94 8155 n
+
+    p  2 59 264 w
+    p 63 94 325 w
+  } cvlit
+
+  /Identity []
+
+>> def
+setpacking
+
+/CIDFontOptions 5 dict begin
+  /make_procs currentdict def
+  /NameKey /CIDFontName def
+  /TypeKey /CIDFontType def
+
+  0
+  { //CIDFontCommon exec
+    /FDArray [
+      14 dict begin
+        /FontName CIDFontName =string cvs (%) concatstrings cvn def
+        /FontType 1 def
+        /FontMatrix [0.001 0 0 0.001 0 0 ] def
+        /PaintType 0 def
+        /Private 0 dict def
+        currentdict
+      end
+    ] def
+    /GlyphDirectory [] def
+    /GDBytes 1 def
+    /FDBytes 0 def
+  } bind def
+
+  1
+  { //CIDFontCommon exec
+    /FontMatrix [1 0 0 1 0 0] def
+    /BuildGlyph {} def
+  } bind def
+
+  2
+  { //CIDFontCommon exec
+    /FontMatrix [1 0 0 1 0 0] def
+    /GDBytes 2 def
+    /CIDMap <0000> def
+    /sfnts [<00010000 0000 0000 0000 0000 0000>] def
+    /Encoding [] def
+    /CharStrings << /.notdef 0 >> def
+  } bind def
+
+currentdict end def
+
+/complete_instance  % <font_name> <FontDict> <Options> complete_FAPI_Font <font_name> <FontDict>
+{ begin
+  dup length dict copy
+  begin
+  1 index NameKey exch def
+  currentglobal true setglobal
+  make_procs TypeKey load .knownget {
+    exec
+  } { setglobal
+      /complete_instance cvx /invalidfont signalerror
+  } ifelse
+  setglobal
+  currentdict end
+  end
+} bind def
+
+/GetFilePath    % <scratch> <Name> <record> GetFilePath <filepath>
+{ exch pop                       % (scratch) <record>
+  /Path get                      % (scratch) (path)
+  exch copy
+  % What we make here it is not a complete PS resource.
+  % Unable to provide full conformity :
+  % the attempt to run this file may fail.
+} bind def
+
+/GetSize        % <Name> <record> GetSize <size>
+{ pop pop -1 % Unknown size.
+  % fixme: probably we could provide an estimation size for some fonts.
+} bind def
+
+/RecordVirtualMethodsStub 3 dict begin
+  /GetFilePath //GetFilePath def
+  /GetSize //GetSize def
+currentdict end def
+
+% ---------------------- Decoding helpers ----------------------------
+
+/encodingnames mark
+ StandardEncoding /StandardEncoding
+ ISOLatin1Encoding /ISOLatin1Encoding
+ SymbolEncoding /SymbolEncoding
+ DingbatsEncoding /DingbatsEncoding
+ /resourceforall where
+  { pop (*) { cvn dup findencoding exch } 1024 string /Encoding resourceforall }
+ if
+.dicttomark def
+
+/ChooseDecoding  % <font> ChooseDecoding <font>
+{ { % A loop for 'exit' context.
+    dup /Decoding .knownget {
+      dup type /nametype eq {
+        1 index /CIDFontType known { /CIDDecoding } { /Decoding } ifelse
+        findresource 1 index exch /Decoding exch put
+      } {
+        pop
+      } ifelse
+      dup /CIDFontType known {
+        dup dup /Decoding get /CIDCount get /CIDCount exch put
+      } if
+      exit
+    } if
+    dup /CIDFontType known {
+      % This is a hooked CID font, no need for Decoding.
+      exit
+    } if
+    % This works when the renderer can't choose character by name,
+    % and we cannot determine the charset.
+    % Probably this branch is to be removed after UFST problem is fixed.
+    dup /Encoding get                                    % <<font>> encoding
+    dup type /nametype eq {
+      /Decoding findresource 1 index exch /Decoding exch put
+    } {
+      dup //encodingnames
+      exch .knownget {
+        exch pop
+        /Decoding findresource 1 index exch /Decoding exch put
+      } {
+        % unknown encoding, convert it to decoding :
+        dup length dict begin
+        /.notdef 0 def
+        0 1 currentdict length 1 sub
+        { dup 2 index exch get 
+          dup /.notdef ne {
+            exch def
+          } {
+            pop pop
+          } ifelse
+        } for
+        pop
+        currentdict end
+        1 index exch /Decoding exch put
+      } ifelse
+    } ifelse
+    exit
+  } loop
+  dup /CIDFontType known {
+    dup /SubstNWP .knownget not {
+      dup /CIDSystemInfo get /Ordering get cvn
+    } if
+    dup type /nametype eq {
+      //SubstNWP exch get                              % <<font>> [SubstNWP]
+    } if
+    1 index exch /SubstNWP exch put
+  } if
+} bind def
+
+/PrintFontRef      % <string|name> <font> PrintFontRef <string|name> <font>
+{ dup /FontName known { (Font ) } { (CIDFont ) } ifelse print
+  1 index =string cvs print
+  dup /FontName .knownget not {
+    dup /CIDFontName get
+  } if                               % <string|name> <font> <fontname>
+  dup 3 index ne {
+    ( \( aliased from ) print
+    =string cvs print ( \)) print
+  } {
+    pop
+  } ifelse
+} bind def
+
+/GetFontType       % <font> GetFontType int
+{ dup /CIDFontType .knownget {
+    exch pop 9 add
+  } {
+    /FontType get
+  } ifelse
+} bind def
+
+/FindInArray    % <array> <elem> .array_find <bool>
+{ false 3 1 roll
+  exch {                      % false elem elem_i
+    1 index eq {              % false elem
+       pop true exch
+    } if
+  } forall
+  pop
+} bind def
+
+/ProvideUnicodeDecoding % <font> ProvideUnicodeDecoding <font>
+{
+  % If the font is maintained by FAPI, or if it is TT-emulated CID font,
+  % it already has /Decoding. But its value isn't guaranteeed to
+  % be an Unicode decoding. Since we can't determine whether 
+  % it is an Unicode decoding, we unconditionally load an appropriate Unicode decoding
+  % and attach it with /GlyphNames2Unicode entry.
+  %
+  % Another interesting case is when the font already has /GlyphNames2Unicode.
+  % The latter to be used instead. Note that /GlyphNames2Unicode
+  % appears only when type 32 fonts are disable (see .pdf_hook_DSC_Creator),
+  % but an automatic disabling is not implemented yet.
+
+  currentglobal true setglobal exch
+  dup /FontInfo known not {
+    dup /FontInfo 1 dict put
+  } if
+  { % A loop just for 'exit' context.
+    dup /FontInfo get /GlyphNames2Unicode known {
+      exit
+    } if
+    dup /CIDFontType known {
+      dup mark exch                                              % bool <font> [ <font>
+      dup /CIDSystemInfo get /Ordering get (.Unicode)            % bool <font> [ <font> () ()
+      concatstrings cvn                                          % bool <font> [ <font> /Name
+      /CIDDecoding { findresource } stopped {
+        % Can't provide a decoding, giving up without creating /GlyphNames2Unicode.
+        cleartomark exit
+      } if                                                       % bool <font> [ <font> <D>
+      exch /FontInfo get exch                                    % bool <font> [ <FI> <D>
+      /GlyphNames2Unicode exch
+      .forceput % FontInfo can be read-only.
+      pop                                                        % bool <font>
+      exit
+    } if
+    dup /FontInfo get                                            % bool <font> <FI>
+    /GlyphNames2Unicode /Unicode /Decoding findresource
+    .forceput % FontInfo can be read-only.
+    exit
+  } loop
+  exch setglobal
+} bind def
+
+currentdict end /ProcSet defineresource pop
+
+.setlanguagelevel

File diff suppressed because it is too large
+ 478 - 334
sys/lib/ghostscript/gs_fonts.ps


+ 14 - 16
sys/lib/ghostscript/gs_frsd.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_frsd.ps,v 1.4 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_frsd.ps,v 1.9 2005/08/25 15:34:08 ray Exp $
 % Implementation of ReusableStreamDecode filter.
 % This file must be loaded after gs_lev2.ps and gs_res.ps.
 
@@ -61,15 +59,15 @@ level2dict begin
     } if
     10 dict exch {
 		% Stack: dict filters parms CloseSource contdict file
-      dup 1000 string readstring
+      dup 64000 string readstring
       3 index dup length 4 -1 roll put not { exit } if
     } loop pop
 		% Concatenate the contents into one big string.
 		% Stack: dict filters parms CloseSource contdict
     0 1 index { length exch pop add } forall
-    .bigstring exch {
+    dup 65400 gt { .bytestring } { string } ifelse exch {
 		% Stack: dict filters parms CloseSource string index substring
-      exch 1000 mul exch 2 index 3 1 roll putinterval
+      exch 64000 mul exch 2 index 3 1 roll putinterval
     } forall
 		% Now create the stream on the string.
     1 index .reusablestream

+ 311 - 92
sys/lib/ghostscript/gs_icc.ps

@@ -1,116 +1,335 @@
-%    Copyright (C) 2001 Aladdin Enterprises.  All rights reserved.
+%    Copyright (C) 2001, 2002 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gs_icc.ps,v 1.2 2001/06/12 16:02:39 rayjj Exp $
-% PostScript portion of ICCBased color space support
-
-//userdict /.icc_comp_map_dict
-  << 1 /DeviceGray  3 /DeviceRGB  4 /DeviceCMYK >>
-put
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_icc.ps,v 1.10 2003/07/14 19:32:17 ray Exp $
+% ICCBased color space method dictionaries.
+% This assumes gs_ciecs2.ps has already been processed.
+
+%
+% Note that the substitution procedure in this routine will dynamically
+% check for support of ICCBased color space. If such support is not
+% provided, the alternative color space will be used.
+%
+% The validation routine in dictionary (cs_validate) performs a more
+% extensive validation than is done for other color spaces, because
+% .seticcspace does less checking than most other color space setting
+% operators.
+%
+
 
-colorspacedict /ICCBased
+.currentglobal true .setglobal
+.cspace_util begin
+
+%
+% A dictionary for mapping the number of components of an ICCBased color
+% space to the appropriate alternative color space. This is used only
+% if an alternative color space is not specifically provided.
+%
+/icc_comp_map_dict
+  mark 1 /DeviceGray 3 /DeviceRGB 4 /DeviceCMYK .dicttomark
+def
+
+%
+%   <array1>   get_icc_alternative_space   <name | array2>
+%
+% Get the alternative color space for an ICCBased color space.
+%
+/get_icc_alternative_space
   {
-    % Verify that the source object is an array, that it is at least of length
-    % two, and that the second entry is a readable dictionary. If we got this
-    % far, we know the top-level object exists and is readable, but it might
-    % be a dictionary.
-    dup type dup /arraytype ne exch /packedarraytype ne and
-      { /setcolorspace /typecheck signalerror }
-    if
-    dup length 2 lt
-      { /setcolorspace /rangecheck signalerror }
-    if
-    dup 1 get type /dicttype ne
-      { /setcolorspace /typecheck signalerror }
-    if
-    dup 1 get rcheck not
-      { /setcolorspace /invalidaccess signalerror }
-    if
-
-    % Verify that the dictionary defines the key N (number of components) and
-    %  entry is provided and has a legitimate value
-    dup 1 get /N .knownget
+    1 get dup /Alternate .knownget
+      { exch pop }
+      { /N get //icc_comp_map_dict exch get }
+    ifelse
+  }
+bind def
+
+
+colorspacedict
+/ICCBased
+  mark
+    /cs_potential_indexed_base true
+    /cs_potential_pattern_base true
+    /cs_potential_alternate true
+    /cs_potential_icc_alternate false
+    /cs_get_ncomps { 1 get /N get } bind
+
+    /cs_get_range
+      {
+        1 get dup /Range .knownget
+          { exch pop }
+          { /N get 2 mul //dflt_range_4 exch 0 exch getinterval }
+        ifelse
+      }
+    bind
+
+    /cs_get_default_color { 1 get /N get { 0 } repeat } bind
+
+    %
+    % For generating a gray, RGB, or CMYK equivalent color, we will
+    % assume that the alternative color space provides reasonable
+    % mapping.
+    /cs_get_currentgray
+      { //get_icc_alternative_space exec //.cs_get_currentgray exec }
+    bind
+    /cs_get_currentrgb
+      { //get_icc_alternative_space exec //.cs_get_currentrgb exec }
+    bind
+    /cs_get_currentcmyk
+      { //get_icc_alternative_space exec //.cs_get_currentcmyk exec }
+    bind
+
+    % a lot of validation is done by the cs_validate method
+    /cs_validate
       {
-        //.icc_comp_map_dict exch known not
-          { 
-            % generate the appropriate error
-            /setcolorspace 
-            1 index 1 get /N type type /integertype ne
-              { /typecheck }
-              { /rangecheck }
-            ifelse
-            signalerror
+        //check_cie_cspace exec
+        dup 1 get
+        dup /N get
+        dup type /integertype ne
+          //setcspace_typecheck
+        if
+        //icc_comp_map_dict exch known not
+          //setcspace_rangecheck
+        if
+        dup /DataSource get
+        dup type dup /stringtype ne exch /filetype ne and
+          //setcspace_typecheck
+        if
+        rcheck not
+          //setcspace_invalidaccess
+        if
+        dup /Range .knownget
+          {
+            //check_array exec
+              {
+                type dup /integertype ne exch /realtype ne and
+                  //setcspace_typecheck
+                if
+              }
+            forall
+          }
+        if
+        /Alternate .knownget
+          {
+            //.cs_validate exec
+            //.cs_potential_icc_alternate exec not
+              //setcspace_rangecheck
+            if
           }
         if
       }
-      { /setcolorspace /undefined signalerror }
-    ifelse
+    bind
 
-    % Verify DataSrouce and, if it is a string, convert it to a file
-    dup 1 get /DataSource .knownget
+    % substitute the Alternate space, if appropriate
+    /cs_substitute
       {
-        dup rcheck not
-          { pop /setcolorspace /invalidaccess signalerror }
-        if
-        type dup /stringtype eq
+        %
+        % A design problem in the Ghostscript graphic library color
+        % space code prevents an ICCBased color space from having an
+        % ICCBased alternative color space. This situation actually
+        % arises fairly frequently in PDF, as an ICCBased color space
+        % is used as the substitute color for a Device{Gray|RGB|CMYK}
+        % color space, which in turn are used as the alternative color
+        % space to another (or possibly even the same) ICCBased color
+        % space.
+        %
+        % This situation causes no fundamental problems, as
+        % Ghostscript nominally supports ICCBased color spaces, so the
+        % Alternate color space is not used. Where this is not true
+        % (primarily because the NOCIE option is selected), the code
+        % would (except for the design flaw noted above) select the
+        % Alternate of the Alternate color space.
+        %
+        % The code below works around this problem by suprressing
+        % color space substitution for alternative color spaces if
+        % the substituting space is an ICCBased color space.
+        %
+        dup //get_icc_alternative_space exec
+        //.cs_substitute exec
+        2 copy eq
+        1 index //.cs_potential_icc_alternate exec not
+        or
+          { pop pop dup }
           {
-            pop
-            2 array copy
-            dup 1
-             2 copy get dup length dict copy
-             dup /DataSource
-              2 copy get /ReusableStreamDecode filter
-             put
+            % retain just the new Alternate space
+            exch pop
+
+            % build all new structures in local VM
+            .currentglobal 3 1 roll //false .setglobal
+
+            % copy the original ICCBased color space array
+            1 index dup length array copy
+
+            % copy the ICCBased dictionary
+            dup 1 2 copy get dup length dict copy
+
+            % insert the new alterante color space
+            dup /Alternate 7 -1 roll put
+
+            % insert the new dictionary into the arra
             put
+
+            % restore the VM mode
+            3 -1 roll .setglobal
           }
+        ifelse
+      }
+    bind
+
+    %
+    % The current implementation of ICCBased color spaces requires the
+    % DataSource to be a file.
+    %
+    /cs_prepare
+      {
+        % make DataSource a file
+        dup 1 get /DataSource get type /stringtype eq
           {
-            /filetype ne
-              { /setcolorspace /typecheck signalerror }
+            % build all new structures in local VM
+            .currentglobal exch //false .setglobal
+
+            % check if we need to copy the color space and dictionary
+            2 copy eq
+              {
+                dup length array copy
+                dup 1 2 copy get dup length dict copy put
+              }
             if
+
+            % fetch DataSource, setting up stack for multiple puts
+            dup 1 2 copy get dup /DataSource 2 copy get
+
+            % convert the string into a file
+            /ReusableStreamDecode filter
+
+            % put the file into the dictioary, the dictionary into the array
+            put put
+
+            % restore the VM mode
+            exch .setglobal
           }
-        ifelse
+        if
       }
-      { /setcolorspace /undefined signalerror }
-    ifelse
+    bind
 
-    % set the alternate color space to be the current color space
-    dup 1 get /Alternate .knownget not
-      { dup 1 get /N get //.icc_comp_map_dict exch get }
-    if
-    setcolorspace
+    %
+    % Install the current color space.
+    %
+    % The current Ghostscript color space implementation requires that
+    % color spaces that provide a base or alternative color space set
+    % that base/alternative color space to be the current color space
+    % before attempting to set the original color space. This can cause
+    % difficulty if an ICCBased color space is being used as a substitute
+    % color space for a device-specific color space, and uses that same
+    % device-specific color space as an alternative space. For this
+    % reason, a special _setcolorspace_nosub operator is provided.
+    %
+    /cs_install
+      {
+        % set the alternative color space to be the current color space
+        dup //get_icc_alternative_space exec //_setcolorspace_nosub exec
 
-    % if CIE spaces are not use, just take the alternate space
-    NOCIE
-      { pop //null }
-      { % check for native support
+        % check for native support
         /.seticcspace where
-          { pop dup 1 get
-	    % Acrobat Reader silently ignores errors with ICC profiles
-	    % and uses the alternate color space -- do the same.
-	    mark exch { .seticcspace } stopped
-	      { cleartomark pop //null }
-	      { pop }
-	    ifelse
-	  }
-          { pop //null }
+          { pop //false }
+          { //true }
+        ifelse
+        NOCIE or
+          //pop_1       % do nothing
+          {
+            % Acrobat Reader silently ignores errors with ICC profiles
+            % and uses the alternate color space -- do the same.
+            mark exch 1 get
+              { .seticcspace }
+            .internalstopped
+            cleartomark
+          }
         ifelse
       }
-    ifelse
-  }
-bind put
+    bind
+
+    % for now, the alternative spaces for an ICCBased color space do 
+    % not require special preparation
+    /cs_prepare_color { dup 1 get /N get //check_num_stack exec pop } bind
+    /cs_complete_setcolor //pop_1
+
+  .dicttomark
+put
+
+end     % .cspace_util
+
+NOPSICC { (%END PSICC) .skipeof } if
+% Now set up ICC profile loading for PostScript %%BeginICCProfile sections.
+
+systemdict begin
+/.ProcessICCcomment { % file comment --  file comment
+  dup
+  (%%BeginICCProfile) anchorsearch {
+    pop pop
+    DEBUG { (.ProcessICCcomment found %%BeginICCProfile) print flush } if
+
+    % load an ICC profile defined as comments (hex encoded).
+    % Ends with %%End at the start of a line. Read the data into
+    % a bytestring to allow seeking. This string can be used as a
+    % seekable ReusableStreamDecode filter source by the ICC logic.
+    %
+    % Since .bigstring needs to know the size, we first read an array of
+    % strings each 64000 max length.
+    %
+    % stack: --file-- (%%BeginICCProfile: ...) 
+    1 index 0 (%%EndICCProfile) /SubFileDecode filter
+    [ { counttomark 1 add index
+        64000 string readhexstring
+        not { exit } if
+      } loop
+    ] exch closefile
+    0 1 index { length add } forall
+    .bigstring
+    exch 0 exch {
+      % stack: --file-- (%%BeginICCProfile: ...) --bytestring-- cur_index --string--
+      2 copy length add 	% calculate next string start point
+      3 1 roll 3 index 3 1 roll putinterval
+    } forall
+    pop				% discard length of bytestring
+    % make a seekable -file- out of the bytestring
+    mark /AsyncRead true .dicttomark /ReusableStreamDecode filter
+    % stack: --file-- (%%BeginICCProfile: ...) --icc_subfile-- 
+    /DeviceCMYK setcolorspace
+    << /DataSource 3 -1 roll
+       /N 4		% Try CMYK first
+    >> { .seticcspace } stopped {
+      /DeviceRGB setcolorspace
+      dup /N 3 put  { .seticcspace } stopped {
+        /DeviceGray setcolorspace
+        dup /N 1 put { .seticcspace } stopped {	% last choice
+          QUIET not { (   *** Unable to load ICC profile from PostScript DSC comments ***) = flush } if
+          pop
+        } if
+      } if
+    } if
+  } {
+    pop % Not interested in this DSC comment
+  } ifelse
+} bind def
+
+% Merge ProcessICCcomment with existing handler
+/.ProcessICCcomment load /exec load
+currentuserparams /ProcessDSCComment get 
+dup null eq {pop {pop pop}} if /exec load
+4 array astore cvx readonly
+<< /ProcessDSCComment 3 -1 roll >> setuserparams
 
-//userdict /.icc_comp_map_dict undef
+end	% systemdict
+%END PSICC
+.setglobal

+ 11 - 13
sys/lib/ghostscript/gs_il1_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1993, 1994, 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_il1_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_il1_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the ISO Latin-1 encoding vector.
 % The first half is the same as the standard encoding,
 % except for minus instead of hyphen at code 055.

+ 11 - 13
sys/lib/ghostscript/gs_il2_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_il2_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_il2_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the ISO Latin-2 (8859-2) encoding vector.
 
 % The original version of this encoding vector used Unicode names, rather

+ 656 - 0
sys/lib/ghostscript/gs_img.ps

@@ -0,0 +1,656 @@
+% (C) 2002 Artifex, Inc.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_img.ps,v 1.3 2002/10/08 00:49:48 dan Exp $
+% image, colorimage, and imagemask implementation
+
+%
+% The design of the overprint facility in Ghostscript requires that color
+% specifications include the color space from which they were expressed,
+% even after conversion to the device color model. Directly including this
+% information in color specifications is usually not efficient, and is
+% difficult to integrate into the existing code structure. The alternative
+% approach taken is to extend a state mechanism through the device
+% interface, and make the current color space, or more specifically,
+% certain information about the current color space, a property of this
+% state.
+%
+% For such a mechanism to work, it is necessary to identify all changes
+% to the current color space. This is accomplished in the graphic library
+% by funneling all changes to the current color space through the
+% gs_setcolorspace procedure. At the PostScript interpreter level, this
+% result is achieved by forcing color space changes through the
+% setcolorspace operator.
+%
+% Aside from explicit use of setcolorspace, PostScript provides a few
+% implicit methods of changing the current color space. The setgray,
+% setrgbcolor, and setcmykcolor operators implicitly set the color space
+% while explicitly setting the current color. Similarly, the colorimage
+% operator and the traditional form of the image operator (5 operands)
+% both temporarily modify the current color space while an image is
+% being processed. The current file is concerned with the implementation
+% of these two operators. In addition, the traditional form of the
+% imagemask operator (5 operands), while it does not affect the current
+% color space, is closely related to the image operator and thus is
+% implemented in this file as well.
+%
+% In this implementation, all sampled objects are passed through one of
+% the internal operators .image1, .imagemask1, .image1alpha, .image2,
+% .image3, or .image4, each of which handles a specific ImageType value.
+%
+% The procedures in this file are responsible for constructing
+% image dictionaries from a set of stack entries. This is, in principle,
+% a trivial exercise. In practice it appears to be far more complex,
+% primarily due to the need to reconstruct the original state in the
+% event of an error. This is a particular problem for operators such as
+% image, which include data source objects that may, directly or
+% indirectly, be procedures. When these procedures are executed, the
+% image operator's operands must have been cleared from the operand
+% stack. Hence, the operand stack cannot be used to store state
+% information. Similarly, the dictionary stack also cannot be used to
+% store state information, as the data source procedures may depend on
+% a particular dictionary being on the top of this stack.
+%
+% Adobe's PostScript implementations determine the extent to which the
+% interpreter state is restored in the event of an error by the point at
+% which the error is detected. Errors in the image/colorimage/imagemask
+% operators that are detected before the data source procedures are
+% executed restore the state in effect before the image was processed.
+% Those that are detected as part of running the data source procedures
+% only attempt to restore the state to that in effect at the start of
+% the operator that failed (or at the conclusion of the data source
+% procedure, if this procedure failed to push a string).
+%
+% The implementation given here follows the Adobe convention. The
+% mechanism used is as follows:
+%
+%   1. Check that the stack has a sufficient number of operands, and
+%      that enough of them have the proper type to allow construction
+%      of the image dictionary. Any errors at this point are handled
+%      in the conventional manner.
+%
+%   2. Build the image dictionary, in the process clearing the image/
+%      colorimage/imagemask operands from the stack. No errors can
+%      occur during this process.
+%
+%      (Special precautions could be taken during this step to handle
+%      a limitcheck or VMError during the building of the image
+%      dictionary, but this essentially never occurs in practice and, if
+%      it did, is very unlikely to leave a useable state. Hence, we don't
+%      bother with this possibility.)
+%
+%   3. The .image operator is executed in a stopped context. If it
+%      returns abnormally, a check is made to see if the uppermost
+%      operand on the stack is a color image dictionary. If so, the
+%      original stack is created anew using this dictionary. (Because
+%      the image operand works via colorimage, some additional special
+%      handling is required in this case.)
+%
+
+
+%
+% Create a dictionary of operators for specific image and image mask types.
+% Each of these will always handle ImageType 1. Additional types are added
+% as they are supported in specific interpreter levels or versions.
+%
+% These dictionaries are in systemdict for historical reasons.
+%
+.currentglobal true .setglobal
+systemdict begin
+/.imagetypes
+  5 dict
+  dup 1 /.image1 load put
+def
+/.imagemasktypes
+  5 dict
+  dup 1 /.imagemask1 load put
+def
+end
+.setglobal
+
+% 
+% Build a dictionary of utility procedures and constants for use in
+% impelementing the image operators. This dictionary is in global VM but
+% is maintained (during initialization) in userdict. It should be pushed
+% onto the dictionary stack when constructing image-related procedures
+% and pseudo-operators.
+%
+% This dictionary is removed from userdict when initialization is
+% completed.
+%
+.currentglobal true .setglobal
+userdict /img_utils_dict 30 dict put
+img_utils_dict begin
+
+
+%
+% Some useful local data structures:
+%
+%   img_csary maps the number of components in an image to the implied
+%       color space.
+%
+%   img_decary is a prototype Decode array; subintervals of this array
+%       may be used for fewer than 4 color components.
+%
+%   img_params_ary is a list of the parameters to be built in the image
+%       dictionary for a colorimage invocation. ImageType is given a
+%       fixed value; the other parameters are in stack order (IMG_NComps
+%       is the number of components).
+%
+%   img_mask_params_ary is the equivalent of img_params_ary for imagemask
+%       invocations. Polarity is a proxy for Decode, and is replaced
+%       by the Decode key in the image dictionary.
+%
+%   img_mask_check_ary is the set of parameters that must be present in
+%       an image dictionary generated by an imagemask invocation. This
+%       differs from img_mask_params_ary in that Decode replaces Polarity.
+%
+/img_csary [ null /DeviceGray null /DeviceRGB /DeviceCMYK ] def
+/img_decary [ 0 1  0 1  0 1  0 1 ] def
+
+/img_params_ary
+  [
+    /ImageType  /IMG_NComps  /MultipleDataSources  /DataSource
+    /ImageMatrix  /BitsPerComponent  /Height  /Width   /Decode
+  ]
+def
+/img_check_ary //img_params_ary def
+/img_unbuild_ary
+ //img_params_ary 1 1 index length 2 sub getinterval
+def
+
+/img_mask_params_ary
+  [ /ImageType  /DataSource  /ImageMatrix  /Polarity  /Height  /Width ]
+def
+/img_mask_check_ary
+  [
+    /ImageType  /BitsPerComponent
+    /DataSource  /ImageMatrix  /Decode  /Height  /Width
+  ]
+def
+/img_mask_unbuild_ary
+ //img_mask_check_ary 2 1 index length 2 sub getinterval
+def
+
+
+%
+%   <?any?>  <array>   img_check_keys   <?any?>  <bool>
+%
+% Verify that:
+%   that there are at least two entries on the stack, and
+%   the second (lower) entry is a dictionary, and
+%   that dictionary contains all of the keys in the array
+%
+% If any one of these conditions does not hold, pop the array and push
+% false; otherwise pop the array and push true. This utility is used by
+% the colorimage and imagematrix procedures to determine if .image left
+% the image dictionary on the stack after an abnormal return.
+%
+/img_check_keys
+  {
+    count 2 ge
+      {
+        1 index type /dicttype eq
+          {
+            true exch
+              {
+                2 index exch known and
+                dup not
+                  { exit }
+                if
+              }
+            forall
+          }
+          { pop //false }
+        ifelse
+      }
+      { pop //false }
+    ifelse
+  }
+.bind def
+
+%
+% Procedures to convert a set of stack entries to a dictionary. There is
+% a procedure associated with each key, though most keys use the same
+% procedure. The dictionary to be built is at the top of the dictionary
+% stack. Stack handling for the procedures is:
+%
+%   <?val0?> ... <?val(n - 1)?>  <key>   proc   -
+%
+% Parameters are handle in inverse-stack order, so inter-parameter
+% dependencies that on the stack can generally be used here.
+%
+/img_params_dict
+  mark
+    /ImageType { 1 def } .bind
+
+    /IMG_NComps { exch def } .bind      % number of components
+    /MultipleDataSources 1 index
+    /Width 1 index
+    /Height 1 index
+    /ImageMatrix 1 index
+    /BitsPerComponent 1 index
+    /DataSource 1 index
+
+    % Polarity is a proxy for Decode; it never appears in a dictionary
+    /Polarity
+      {
+        pop
+          { { 1 0 } }
+          { { 0 1 } }
+        ifelse
+        /Decode exch cvlit def
+      }
+    .bind
+
+    % the definition of Decode is based on the number of components
+    /Decode { //img_decary 0 IMG_NComps 2 mul getinterval def } .bind
+  .dicttomark
+def
+
+%
+%    <oper_0>  ...  <oper_n>  <array>   img_build_dict   <dict>
+%
+% Build a dictionary. This will always be done in local VM. The array is
+% a list of the keys to be associated with operands on the stack, in
+% inverse stack order (topmost element first). The caller should verify
+% that the dictionary can be built successfully (except for a possible
+% VMerror) before calling this routine.
+%
+/img_build_dict
+  {
+    % build the dictionary in local VM; all for 2 extra entries
+    .currentglobal false .setglobal
+    1 index length 2 add dict
+    exch .setglobal
+    begin
+
+    % process all keys in the array
+      { //img_params_dict 1 index get exec }
+    forall
+
+    % if BitsPerComponent is not yet defined, define it to be 1
+    currentdict /BitsPerComponent known not
+      { /BitsPerComponent 1 def }
+    if
+
+    currentdict end
+  }
+.bind def
+
+%
+%   <dict>  <array>   img_unbuild_dict   <oper_0>  ...  <oper_n>
+%
+% "Unbuild" a dictionary: spread the contents the dictionary back onto the
+% stack, in the inverse of the order indicated in the array (inverse is
+% used as this order is more convenient for img_build_dict, which is
+% expected to be invoked far more frequently).
+%
+/img_unbuild_dict
+  {
+    exch begin
+    dup length 1 sub -1 0
+      { 1 index exch get load exch }
+    for
+    pop
+    end
+  }
+.bind def
+
+
+%
+%   <width>  <height>  <bits/component>  <matrix>  <dsrc0> ...
+%   <multi>  <ncomp>  <has_alpha>
+%   img_build_image_dict
+%   <dict>  <has_alpha>
+%
+% Build the dictionary corresponding to a colorimage operand stack. This
+% routine will check just enough of the stack to verify that the
+% dictionary can be built, and will generate the appropriate error if this
+% is not the case.
+%
+% The <has_alpha> boolean is used to support the Next alphaimage extension.
+%
+% At the first level, errors in this procedure are reported as colorimage
+% errors. The error actually reported will usually be determined by the
+% pseudo-operator which invokes this routine.
+%
+/img_build_image_dict
+  {
+    % Veify that at least 8 operands are available, and that the top three
+    % operands have the expected types
+    count 8 lt
+      { /.colorimage cvx /stackunderflow signalerror }
+    if
+    3 copy
+    type /booleantype ne exch
+    type /integertype ne or exch
+    type /booleantype ne or
+      { /.colorimage cvx /typecheck signalerror }
+    if
+
+    % verify that the number of components is 1, 3, or 4
+    1 index 1 lt 2 index 2 eq or 2 index 4 gt or
+      { /.colorimage cvx /rangecheck signalerror }
+    if
+
+    % Verify that the required number of operands are present if multiple
+    % data sources are being used. If this test is successful, convert
+    % the data sources to an array (in local VM).
+    2 index
+      {
+        % if an alpha component is present, this adds one more component
+        2 copy
+          { 1 add }
+        if
+        dup count 9 sub gt
+          { /.colorimage cvx /stackunderflow signalerror }
+        if
+
+        % build the DataSource array in local VM
+        dup .currentglobal false .setglobal exch array exch .setglobal
+
+        % stack: <w> <h> <bps> <mtx> <d0> ... <multi> <n> <alpha> <n'> <array>
+        5 1 roll 4 add 3 roll astore 4 1 roll
+      }
+    if
+
+    % the image dictionary can be built; do so
+    % stack: <w> <h> <bps> <mtx> <dsrc|dsrc_array> <multi> <n> <alpha>
+    8 1 roll //img_params_ary //img_build_dict exec exch
+  }
+.bind def
+
+%
+%   <?dict?>
+%   img_unbuild_image_dict
+%   <width>  <height>  <bits/component>  <matrix>  <dsrc0> ...
+%   <multi>  <ncomp>
+%
+% If the top entry of the stack is a dictionary that has the keys required
+% by a colorimage dictionary, unpack that dictionary onto the stack.
+% Otherwise just leave things as they are. Note that the <has_alpha>
+% parameter is not pushd onto the stack.
+%
+/img_unbuild_image_dict
+  {
+    //img_check_ary //img_check_keys exec
+      {
+        //img_unbuild_ary //img_unbuild_dict exec
+        1 index type /booleantype eq
+          {
+            1 index
+              { 3 1 roll aload length 2 add -2 roll }
+            if
+          }
+        if
+      }
+    if
+  }
+.bind def
+
+
+%
+%   <width>  <height>  <polarity>  <matrix>  <dsrc>
+%   img_unbuild_imagemask_dict
+%   <dict>
+%
+% Build the dictionary corresponding to an imagemask stack. This routine
+% will verify that the appropriate number of operands are on the stack,
+% and that polarity is a boolean. This is all that is necessary to build
+% the dictionary.
+%
+/img_build_imagemask_dict
+  {
+    % check for proper number of operands
+    count 5 lt
+      { /imagemask load /stackunderflow signalerror }
+    if
+
+    % verify that polarity is a boolean
+    2 index type /booleantype ne
+      { /imagemask load /typecheck signalerror }
+    if
+
+    % the imagemask dictionary can be built; do so
+    //img_mask_params_ary //img_build_dict exec
+  }
+.bind def
+
+%
+%   <?dict?>
+%   img_unbuild_imagemask_dict
+%   <width>  <height>  <polarity>  <matrix>  <dsrc>
+%
+% If the top entry of the stack is a dictionary that has the keys rquired
+% by an imagemask dictionary, unpack that dictionary onto the stack.
+% Otherwise just leave things as they are.
+%
+/img_unbuild_imagemask_dict
+  {
+    //img_mask_check_ary //img_check_keys exec
+      {
+        //img_mask_unbuild_ary //img_unbuild_dict exec
+        3 -1 roll
+        dup type dup /arraytype eq exch /packedarraytype eq or
+        1 index rcheck and
+          { 0 get 1 eq }
+        if
+        3 1 roll
+      }
+    if
+  }
+.bind def
+
+
+%
+%   <width>  <height>  <bits/component>  <matrix>  <dsrc_0> ...
+%   <multi>  <ncomp>  <has_alpha>
+%   .colorimage 
+%   -
+%
+% Convert the image/colorimage operator from their traditional form to
+% the dictionary form. The <has_alpha> operand is used ot support the
+% Next alphaimage extension.
+%
+% Error handling for these operators is a bit complex, due to the stack
+% handling required of operators that potentially invoke procedures.
+% This problem is discussed in the comment above. The facts relevant to
+% this particular implementation are:
+%
+%   1. The .image1 (or .alphaimage) operator is executed in a stopped
+%      context, so that we can undo the gsave context in the event of
+%      an error.
+%
+%   2. In the event of an error, the stack is examined to see if the
+%      dictionary passed to .image1 (.alphaimage) is still present.
+%      If so, this dictionary is "unpacked" onto the stack to re-
+%      create the original stack. The <has_alpha> parameter is not
+%      pushed onto the stack, as it is not required for any of the
+%      pseudo-operators than invoke this procedure.
+%
+%   3. The use of pseudo-operators in this case may yield incorrect
+%      results for late-detected errors, as the stack depth will be
+%      restored (even though the stack is not). This is, however, no
+%      worse than the prior (level >= 2) code, so it should cause no
+%      new problems.
+%
+/.colorimage
+  {
+    % build the image dictionary
+    //img_build_image_dict exec
+
+    % execute .image1 in a stopped context
+      {
+        gsave
+        0 .setoverprintmode             % disable overprint mode for images
+        //img_csary 2 index /IMG_NComps get get setcolorspace
+          { .alphaimage }
+          { .image1 }
+        ifelse
+      }
+    stopped
+    grestore
+      {
+        //img_unbuild_image_dict exec
+        /.colorimage cvx $error /errorname get
+        signalerror
+      }
+    if
+  }
+.bind def
+
+
+% 
+%   <width>  <height>  <bits/component>  <matrix>  <dsrc_0> ...
+%   <multi>  <ncomp>
+%   colorimage 
+%   -
+%
+% Build the colorimage pseudo-operator only if setcolorscreen is visible.
+%
+systemdict /setcolorscreen .knownget
+  {
+    type /operatortype eq
+      {
+        /colorimage 
+          {
+             //false
+               //.colorimage
+             stopped
+               { /colorimage load  $error /errorname get signalerror }
+             if
+          }
+        .bind systemdict begin odef end
+      }
+    if
+  }
+if
+
+
+%
+%   width  height  bits_per_component  matrix  data_src   image   -
+%   
+%   <dict>   image   -
+%
+% Some special handling is required for ImageType 2 (Display PostScript
+% pixmap images) so as to set the appropriate color space as the current
+% color space.
+%
+/image
+  {
+    dup type /dicttype eq languagelevel 2 ge and
+      { 
+        dup /ImageType get dup 2 eq
+          {
+            % verify the ImageType 2 is supported
+            //.imagetypes exch known
+              {
+                %
+                % Set either DevicePixel or DeviceRGB as the current
+                % color space. DevicePixel is used if the image data is
+                % to be copied directly, with only a geometric
+                % transformation (PixelCopy true). The use of DeviceRGB
+                % in the alternate case is not, in general, correct, and
+                % reflects a current implementation limitation. Ideally,
+                % an intermediate color space should be used only if
+                % the source and destination color models vary; otherwise
+                % the native color space corresponding to the color model
+                % should be used.
+                %
+                % The mechanism to determine depth for the DevicePixel
+                % color space when BitsPerPixel is not available is 
+                % somewhat of a hack.
+                %
+                gsave
+                0 .setoverprintmode     % disable overprintmode for images
+                dup /PixelCopy .knownget dup
+                  { pop }
+                if
+                  {
+                      [
+                        /DevicePixel
+                        currentpagedevice dup /BitsPerPixel .knownget
+                          { exch pop }
+                          {
+                            /GrayValues .knownget not
+                              { 2 }     % try a guess
+                            if
+                            ln 2 ln div round cvi
+                          }
+                        ifelse
+                      ]
+                  }
+                  { /DeviceRGB }
+                ifelse
+                setcolorspace
+                //.imagetypes 2 get
+                stopped
+                grestore
+                  { /image load $error /errorname get signalerror }
+                if
+              }
+              { /image load /undefined signalerror }
+            ifelse
+          }
+          {
+            gsave
+            0 .setoverprintmode         % disable overprintmode for images
+            //.imagetypes exch get
+            stopped
+            grestore
+              { /image load $error /errorname get signalerror }
+            if
+          }
+        ifelse
+      }
+      { 
+        //false 1 //false
+          //.colorimage
+        stopped
+          { /image load $error /errorname get signalerror }
+        if
+      }
+    ifelse
+  }
+.bind systemdict begin odef end
+
+
+%
+%   width  height  polarity  matrix  datasrc   imagemask   -
+%
+% See the comment preceding the definition of .colorimage for information
+% as to the handling of error conditions.
+%
+/imagemask
+  {
+    dup type /dicttype eq languagelevel 2 ge and
+      { dup /ImageType get //.imagemasktypes exch get exec }
+      {
+        //img_build_imagemask_dict exec
+          { .imagemask1 }
+        stopped
+          {
+            //img_unbuild_imagemask_dict exec
+            /imagemask load $error /errorname get signalerror
+          }
+        if
+      }
+    ifelse
+  }
+.bind systemdict begin odef end
+
+end        % img_utils_dict
+.setglobal  % restore VM mode

+ 204 - 0
sys/lib/ghostscript/gs_indxd.ps

@@ -0,0 +1,204 @@
+%    Copyright (C) 2001, 2002 Aladdin Enterprises.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_indxd.ps,v 1.2 2002/11/13 20:23:10 alexcher Exp $
+% Indexed color space method dictionary
+
+
+% verify that Indexed color spaces are supported
+/.setindexedspace where
+  { pop }
+  { currentfile closefile }
+ifelse
+
+.currentglobal true .setglobal
+.cspace_util begin
+
+%
+%   <num>  <array>   restrict_index   <int>  <array>
+%
+% Restrict the operand to setcolor for an Indexed color space to be an
+% integer in the applicable range.
+%
+/restrict_index
+  {
+    exch round cvi
+    dup 0 lt
+      { pop 0 }
+      {
+        1 index 2 get 2 copy gt
+          { exch }
+        if
+        pop
+      } 
+    ifelse
+    exch
+  }
+bind def
+
+%
+%   <num>  <array>   get_indexed_base_color   <c1> ... <cn>  <array>
+%
+% Get the base color corresponding to an indexed color value.
+%
+/get_indexed_base_color
+  {
+    % just in case, set the index into the appropriate range
+    //restrict_index exec
+
+    % lookup in the string or use the lookup proc
+    mark 1 index 3 get dup type /stringtype eq
+      {
+        2 index 1 get //.cs_get_ncomps exec dup 6 -1 roll mul exch getinterval
+          { 255 div }
+        forall
+      }
+      { 4 -1 roll exch exec }
+    ifelse
+    counttomark 2 add -2 roll pop
+  }
+bind def
+
+
+colorspacedict
+/Indexed
+  mark
+    /cs_potential_indexed_base false
+    /cs_potential_pattern_base true
+    /cs_potential_alternate false
+    /cs_potential_icc_alternate false
+    /cs_get_ncomps //ncomps_1
+    /cs_get_range { 0 exch 2 get 2 array astore } bind
+    /cs_get_default_color { pop 0 } bind
+
+    /cs_get_currentgray
+      { //get_indexed_base_color exec 1 get //.cs_get_currentgray exec }
+    bind
+    /cs_get_currentrgb
+      { //get_indexed_base_color exec 1 get //.cs_get_currentrgb exec }
+    bind
+    /cs_get_currentcmyk
+      { //get_indexed_base_color exec 1 get //.cs_get_currentcmyk exec }
+    bind
+
+    % a lot of validation is done by the cs_validate method
+    /cs_validate
+      {
+        //check_array exec
+        dup 1 get //.cs_validate exec //.cs_potential_indexed_base exec not
+          //setcspace_rangecheck
+        if
+        dup 2 get dup type /integertype ne
+          //setcspace_typecheck
+          {
+            dup 0 lt exch 4095 gt or
+              //setcspace_rangecheck
+            if
+          }
+        ifelse
+        dup 3 get dup type /stringtype eq
+          {
+            length
+            1 index dup 2 get 1 add exch 1 get //.cs_get_ncomps exec mul
+            lt
+              //setcspace_rangecheck
+            if
+          }
+          {
+            //check_array exec xcheck not
+              //setcspace_typecheck
+            if
+          }
+        ifelse
+      }
+    bind
+
+    % substitute the base space if appropriate
+    /cs_substitute
+      {
+        dup 1 get //.cs_substitute exec 2 copy eq
+          { pop pop dup }
+          {
+            % retain only the new base space
+            exch pop
+
+            % build all new structures in local VM
+            .currentglobal 3 1 roll //false .setglobal
+
+            % construct a new array and insert the new base color space            
+            1 index dup length array copy dup 1 4 -1 roll put
+
+            % restore VM mode
+            3 -1 roll .setglobal
+          }
+        ifelse
+      }
+    bind
+
+    /cs_prepare {}
+
+    %
+    % Install the current color space. Note that the alternative color
+    % space will already have been set as the current color space.
+    %
+    % The current Ghostscript color space implementation requires that
+    % color spaces that provide a base or alternative color space set
+    % that base/alternative color space to be the current color space
+    % before attempting to set the original color space.
+    %
+    /cs_install
+      {
+        % save the current color space
+        currentcolorspace
+
+        % set the base color space as the current color space
+        1 index 1 get //forcesetcolorspace
+
+        % set the indexed color space; restore the earlier space on error
+        mark 2 index
+          { .setindexedspace }
+        stopped
+          { cleartomark setcolorspace stop }
+          { pop pop pop }
+        ifelse
+      }
+    bind
+
+    /cs_prepare_color //validate_1
+
+    %
+    % Adobe implementations always execute a lookup procedure when setcolor
+    % is invoked. Ghostscript samples the lookup procedure when
+    % setcolorspace is invoked, and then does not access it again. In the
+    % unlikely event that an application depends on the Adobe-specific
+    % behavior, it is replicated in this method.
+    %
+    /cs_complete_setcolor
+      {
+        3 get dup type /stringtype eq
+          { pop }
+          {
+            currentcolor exch exec
+            currentcolorspace 1 get //clear_setcolor_operands exec
+          }
+        ifelse
+      }
+    bind
+
+  .dicttomark
+put
+
+end     % .cspace_util
+.setglobal

File diff suppressed because it is too large
+ 485 - 152
sys/lib/ghostscript/gs_init.ps


+ 11 - 13
sys/lib/ghostscript/gs_kanji.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1994, 1995, 1996 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_kanji.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_kanji.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Scaffolding for Kanji fonts.  This is based on the Wadalab free font
 % from the University of Tokyo; it may not be appropriate for other
 % Kanji fonts.

+ 11 - 13
sys/lib/ghostscript/gs_ksb_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1994 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_ksb_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_ksb_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the KanjiSub encoding vector.
 /currentglobal where
  { pop currentglobal { setglobal } true setglobal }

+ 11 - 13
sys/lib/ghostscript/gs_l2img.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1995, 1996 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_l2img.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_l2img.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Emulate the Level 2 dictionary-based image operator in Level 1,
 % except for Interpolate (ignored) and MultipleDataSources = true;
 % also, we require that the data source be either a procedure of a

+ 192 - 194
sys/lib/ghostscript/gs_lev2.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1990, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gs_lev2.ps,v 1.7.2.2 2002/01/25 06:33:09 rayjj Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_lev2.ps,v 1.38 2005/10/04 17:51:52 ray Exp $
 % Initialization file for Level 2 functions.
 % When this is run, systemdict is still writable,
 % but (almost) everything defined here goes into level2dict.
@@ -71,14 +69,38 @@ level2dict begin
 
 % currentuser/systemparams creates and returns a dictionary in the
 % current VM.  The easiest way to make this work is to copy any composite
-% PostScript-level parameters to global VM.  Currently, the only such
-% parameters are strings.  In fact, we always copy string parameters,
-% so that we can be sure the contents won't be changed.
+% PostScript-level parameters to global VM.  Currently we have strings
+% as well as arrays. For arrays, we also need to copy any contents that
+% are in VM. Also copying string parameters insures the contents won't
+% be changed. Also be careful to preserve 'executable' state.
 /.copyparam {			% <value> .copyparam <value'>
+  dup type /arraytype eq {
+    .currentglobal true .setglobal exch 
+    dup wcheck exch dup xcheck exch		% original attributes
+    dup length array exch dup {	% stack: destination_array original_array original_array
+      dup type /arraytype eq {
+	dup 2 index ne {	% avoid recursion
+          .copyparam	% recurse to handle composite array elements
+        } {
+	  % this array self referenced, do it again (yuk!)
+	  pop 1 index		% get copy of destination array
+	} ifelse
+      } {
+        dup type /stringtype eq {
+	  .copyparam
+        } if 
+      }
+      ifelse 3 1 roll		% keep arrays on top
+    } forall pop astore
+    exch { cvx } if		% set executable state
+    exch not { readonly } if	% set readonly attribute as original
+    exch .setglobal
+  } if
   dup type /stringtype eq {
+    dup wcheck exch	% save attr for setting readonly
     .currentglobal true .setglobal
     1 index length string exch .setglobal
-    copy readonly
+    copy exch not { readonly } if
   } if
 } .bind def
 
@@ -119,6 +141,17 @@ end
 	pop dup .getuserparam
       } if
       .copyparam
+      % special protection for the security related parameters
+      [ /PermitFileReading /PermitFileWriting /PermitFileControl ]
+      { 2 index eq { % force all strings to readonly but make sure the
+		     % array is in the correct VM space (local/global).
+	currentglobal exch dup gcheck setglobal
+	dup length array exch { readonly exch } forall astore
+	exch setglobal
+        } if
+      } forall
+      % protect top level of parameters that we copied
+      dup type dup /arraytype eq exch /stringtype eq or { readonly } if
       /userparams .systemvar 3 1 roll .forceput  % userparams is read-only
     } {
       pop pop
@@ -181,6 +214,8 @@ end
     { //pssystemparams 2 index known
        {		% Stack: key newvalue
 	 .copyparam
+	 % protect top level parameters that we copied
+         dup type dup /arraytype eq exch /stringtype eq or { readonly } if
 	 //pssystemparams 3 1 roll .forceput	% pssystemparams is read-only
        }
        { pop pop
@@ -233,8 +268,13 @@ end
     type /arraytype eq {
       currentuserparams /LockFilePermissions get {
         5 { pop } repeat /setuserparams /invalidaccess signalerror
+      }{
+        % in addition to validating the value, ensure the value is read/only
+        dup { readonly exch } forall
+        .currentglobal exch dup gcheck .setglobal length array exch .setglobal
+	astore readonly
       }
-      if
+      ifelse
     } {
       5 { pop } repeat /setuserparams /typecheck signalerror
     }
@@ -293,9 +333,10 @@ psuserparams /ProcessComment {.checkprocesscomment} put
 } bind def
 /ProcessDSCComment null .definepsuserparam
 psuserparams /ProcessDSCComment {.checkprocesscomment} put
+/.loadingfont false def
 (%ProcessDSCComment) cvn {
   /ProcessDSCComment getuserparam
-  dup null eq { pop pop pop } { exec } ifelse
+  dup null eq .loadingfont or { pop pop pop } { exec } ifelse
 } bind def
 
 % ------ Miscellaneous ------ %
@@ -421,11 +462,13 @@ end		% serverdict
       pop
       serverdict /.jobsave save put
       serverdict /.jobsavelevel 1 put
+      .userdict /quit /stop load put
     } ifelse
 		% Reset the interpreter state.
   clear cleardictstack
   initgraphics
   false setglobal
+  2 vmreclaim	% Make sure GC'ed memory is reclaimed and freed.
 } bind def
 /.startjob {			% <exit_bool> <password> <finish_proc>
 				%   .startjob <ok_bool>
@@ -443,10 +486,17 @@ end		% serverdict
 /startjob {			% <exit_bool> <password> startjob <ok_bool>
 	% This is a hack.  We really need some way to indicate explicitly
 	% to the interpreter that we are under control of a job server.
-  .userdict /quit /stop load put
   { .startnewjob true } .startjob
 } odef
 
+% The procedure to undo the job encapsulation 
+/.endjob {
+  clear cleardictstack
+  serverdict /.jobsave get dup null eq { pop } { restore } ifelse
+  serverdict /.jobsave null put
+  2 vmreclaim   % recover local and global VM
+} odef
+
 systemdict begin
 /quit {				% - quit -
   //systemdict begin serverdict /.jobsave get null eq
@@ -486,6 +536,8 @@ currentsystemparams
 
 % The following do not depend on the presence of setpagedevice.
 /buildtime 1 index /BuildTime get def
+% Also define /buildtime in systemdict because Adobe does so and some fonts use it as ID
+systemdict /buildtime dup load put
 /byteorder 1 index /ByteOrder get def
 /checkpassword { .checkpassword 0 gt } bind def
 dup /DoStartPage known
@@ -575,13 +627,13 @@ currentdict end
 % defined here, rather than in gs_init.ps, because they require the
 % resource machinery.
 
-/devforall {		% <pattern> <proc> <scratch> devforall -
+/devforall {		% <proc> <scratch> devforall -
   exch {
     1 index currentdevparams
     /Type .knownget { /FileSystem eq } { false } ifelse
     { exec } { pop pop } ifelse
   } /exec load 3 packedarray cvx exch
-  (*) 3 1 roll ppstack flush /IODevice resourceforall
+  (*) 3 1 roll /IODevice resourceforall
 } odef
 /devstatus {		% <(%disk*%)> devstatus <searchable> <writable>
 			%   <hasNames> <mounted> <removable> <searchOrder>
@@ -592,7 +644,7 @@ currentdict end
       dup /IODevice resourcestatus {
 	pop pop dup currentdevparams
 	dup /Searchable get
-	exch dup /Writable get
+	exch dup /Writeable get
 	exch dup /HasNames get
 	exch dup /Mounted get
 	exch dup /Removable get
@@ -613,109 +665,30 @@ currentdict end
 
 % ------ Color spaces ------ %
 
-% Attempt to convert a tint transformation procedure to a type 4 Function.
-% The value <m> is the number  of function inputs
-% The current color space defines the number of function output values.
-% The current color space will be the alternate color space for the function.
-% If the conversion fails then build a color cube function.
-
-/.converttinttransform {	% [.. .. .. proc ] <m>
-				%   .converttinttransform [.. .. .. proc']
-  .currentglobal			% Save current global memory state
-  2 index gcheck .setglobal		% Set gobal mode to match the array's mode
-  4 dict				% Build a dictionary for our type 4 function
-    dup /FunctionType 4 put		% Set FunctionType
-    dup /Function 5 index 3 get put	% Set function expression
-		% Stack: orig m global func
-    dup /Domain
-    [ 5 index {0 1} repeat ] put	% set Domain values
-    dup /Range
-    [ mark currentcolor counttomark
-    dup 2 add 1 roll cleartomark	% # of components in alternate space
-    {0 1} repeat ] put			% Set Range values
-  { .buildfunction } .internalstopped	% Try to build a type 4 function
-  dup
-  {				% type 4 function failed - Collect data for a color cube
-    pop					% Remove duplicate copy of stopped status
-    pop					% Remove invalid type 4 function
-    1 index				% Get number of inputs
-    mark currentcolor counttomark	% Count number of output colors
-    dup 2 add 1 roll cleartomark	% # of components in alternate space
-    4 index 3 get			% Get tint transform function
-    { .buildcolorcube } .internalstopped 
-  } if
-  {					% Color cube build failed
-    pop pop pop exch pop exch pop	% Remove unused parameters
-    .setglobal				% Restore global state
-  } {					% Function build succeeded - install function
-					% Stack: orig m global func
-    3 -1 roll pop			% Stack: orig global func
-    2 index 4 array copy dup 3 4 -1 roll put
-    exch .setglobal exch pop
-  } ifelse
-} bind def
+% Move setcolorsapce, setcolor, and colorspacedict to level2dict
+level2dict /setcolorspace .cspace_util 1 index get put
+level2dict /setcolor .cspace_util 1 index get put
+level2dict /colorspacedict .cspace_util 1 index get put
 
-% Define the setcolorspace procedures:
-%	<colorspace> proc <colorspace'|null>
-% We have to define the dictionary first, so it can be bound into the
-% implementation procedure, but we can't populate it until the procedure
-% has been defined, so that the procedure can get bound into recursive calls.
-/colorspacedict 20 dict def
+% Add the level 2 color spaces
+% DevicePixel is actually a LanguageLevel 3 feature; it is here for
+% historical reasons.
+%% Replace 1 (gs_devpxl.ps) 
+(gs_devpxl.ps) runlibfile
 
-/.devcs [
-  /DeviceGray /DeviceRGB /DeviceCMYK /DevicePixel
-] readonly def
-/currentcolorspace {		% - currentcolorspace <array>
-  .currentcolorspace dup type /integertype eq {
-    //.devcs exch 1 getinterval
-  } if
-} odef
-currentdict /.devcs .undef
+%% Replace 1 (gs_ciecs2.ps)
+(gs_ciecs2.ps) runlibfile
+
+%% Replace 1 (gs_indxd.ps)
+(gs_indxd.ps) runlibfile
+
+%% Replace 1 (gs_sepr.ps)
+(gs_sepr.ps) runlibfile
+
+%% Replace 1 (gs_patrn.ps)
+(gs_patrn.ps) runlibfile
 
-/setcolorspace {		% <name|array> setcolorspace -
-  dup dup dup type /nametype ne { 0 get } if
-  //colorspacedict exch get exec
-  dup null eq { pop } { .setcolorspace } ifelse pop
-} odef
 
-colorspacedict
-  dup /DeviceGray { pop 0 setgray null } bind put
-  dup /DeviceRGB { pop 0 0 0 setrgbcolor null } bind put
-  /setcmykcolor where
-   { pop dup /DeviceCMYK { pop 0 0 0 1 setcmykcolor null } bind put
-   } if
-  /.setcieaspace where
-   { pop dup /CIEBasedA { NOCIE { pop 0 setgray null } { dup 1 get .setcieaspace } ifelse } bind put
-   } if
-  /.setcieabcspace where
-   { pop dup /CIEBasedABC { NOCIE { pop 0 0 0 setrgbcolor null } { dup 1 get .setcieabcspace } ifelse } bind put
-   } if
-  /.setciedefspace where
-   { pop dup /CIEBasedDEF { NOCIE { pop 0 0 0 setrgbcolor null } { dup 1 get .setciedefspace } ifelse } bind put
-   } if
-  /.setciedefgspace where
-   { pop dup /CIEBasedDEFG { NOCIE { pop 0 0 0 1 setcmykcolor null } { dup 1 get .setciedefgspace } ifelse } bind put
-   } if
-  /.setseparationspace where
-   { pop dup /Separation { dup 2 get setcolorspace dup 1 .converttinttransform .setseparationspace } bind put
-   } if
-  /.setindexedspace where
-   { pop dup /Indexed { dup 1 get setcolorspace dup .setindexedspace } bind put
-   } if
-  /.nullpatternspace [/Pattern] readonly def
-  /.setpatternspace where
-   { pop dup /Pattern
-      { dup type /nametype eq { pop //.nullpatternspace } if
-	dup length 1 gt { dup 1 get setcolorspace } if
-        dup .setpatternspace
-      } bind put
-   } if
-	% If DeviceN space is included, gs_ll3.ps registers it.
-  /.setdevicepixelspace where
-   { pop dup /DevicePixel { dup .setdevicepixelspace } bind put
-   } if
-  currentdict /.nullpatternspace .undef
-pop
 
 % ------ CIE color rendering ------ %
 
@@ -778,51 +751,38 @@ end
   dup .builddevicecolorrendering1 .setdevicecolorrendering1
 } .bind put
 
-% Initialize the default CIE rendering dictionary.
-% The most common CIE files seem to assume the "calibrated RGB color space"
-% described on p. 189 of the PostScript Language Reference Manual,
-% 2nd Edition; we simply invert this transformation back to RGB.
+% sRGB output CRD, D65 white point
 mark
-   /ColorRenderingType 1
-% We must make RangePQR and RangeLMN large enough so that values computed by
-% the assumed encoding MatrixLMN don't get clamped.
-   /RangePQR [0 0.9505 0 1 0 1.0890] readonly
-% This TransformPQR implements a relative colorimetric intent by scaling
-% the XYZ values relative to the white and black points.
+/ColorRenderingType 1
+/RangePQR [ -0.5 2 -0.5 2 -0.5 2 ] readonly
+
+% Bradford Cone Space
+/MatrixPQR [ 0.8951 -0.7502  0.0389
+	     0.2664  1.7135 -0.0685
+	    -0.1614  0.0367  1.0296] readonly
+
+/MatrixLMN [ 3.240449 -0.969265  0.055643
+	    -1.537136  1.876011 -0.204026
+	    -0.498531  0.041556  1.057229 ] readonly
+
+% Inverse sRGB gamma transform
+/EncodeABC [ { dup 0.00304 le
+                { 12.92321 mul }
+                { 1 2.4 div exp 1.055 mul 0.055 sub }
+               ifelse
+             } bind dup dup
+           ] readonly
+
+/WhitePoint [ 0.9505 1 1.0890 ] readonly % D65
+/BlackPoint [ 0 0 0 ] readonly
+
+% VonKries-like transform in Bradford Cone Space
    /TransformPQR
-     [ { 5 1 roll                    % p Ws Bs Wd Bd
-         4 {3 get 5 1 roll} repeat   % ws bs wd bd p 
-         3 index sub                 % ws bs wd bd p-bs 
-         1 index                     % ws bs wd bd p-bs bd
-         6 2 roll                    % p-bs bd ws bs wd bd 
-         sub                         % p-bs bd ws bs wd-bd 
-         5 1 roll                    % wd-bd p-bs bd ws bs  
-         sub                         % wd-bd p-bs bd ws-bs  
-         4 2 roll                    % bd ws-bs wd-bd p-bs 
-         mul                         % bd ws-bs (wd-bd)*(p-bs)
-         exch div add                % bd + (wd-bd)*(p-bs)/(ws-bs)
-       } bind
-       { 5 1 roll
-         4 {4 get 5 1 roll} repeat
-         3 index sub 1 index 6 2 roll sub 5 1 roll
-         sub 4 2 roll mul exch div add
-       } bind
-       { 5 1 roll
-         4 {5 get 5 1 roll} repeat
-         3 index sub 1 index 6 2 roll sub 5 1 roll
-         sub 4 2 roll mul exch div add
-       } bind
+     % The implementations have been moved to C for performance.
+     [ { .TransformPQR_scale_WB0 } bind
+       { .TransformPQR_scale_WB1 } bind 
+       { .TransformPQR_scale_WB2 } bind
      ] readonly
-   /RangeLMN [0 0.9505 0 1 0 1.0890] readonly
-   /MatrixABC
-    [ 3.24063 -0.96893  0.05571
-     -1.53721  1.87576 -0.20402
-     -0.49863  0.04152  1.05700
-    ] readonly
-   /EncodeABC [ {0 .max 0.45 exp} bind dup dup] readonly
-   /WhitePoint [0.9505 1 1.0890] readonly
-	% Some Genoa tests seem to require the presence of BlackPoint.
-   /BlackPoint [0 0 0] readonly
 .dicttomark setcolorrendering
 
 %END CRD
@@ -889,36 +849,74 @@ def
   } if setcolor
 } odef
 
-% Extend image and imagemask to accept dictionaries.
-% We must create .imagetypes and .imagemasktypes outside level2dict,
-% and leave some extra space because we're still in Level 1 mode.
-systemdict begin
-/.imagetypes 5 dict
-  dup 1 /.image1 load put
-def
-/.imagemasktypes 5 dict
-  dup 1 /.imagemask1 load put
-def
-end
+% The following functions emulate the actions of findcmykcustomcolor and
+% setcustomcolor.  These functions are described in Adobe's TN 5044.  That
+% same document also says "The following “operators” are not defined in the
+% PostScript Language Reference Manual, but should be used as pseudo-operators
+% in your PostScript language output. Separation applications from Adobe
+% Systems and other vendors will redefine these convention operators to
+% separate your documents.  Your application should conditionally define
+% procedures with these special names, as shown later in this document."
+%
+% We are providing these functions because we have found files created by
+% "QuarkXPress: pictwpstops filter 1.0" which produce bad shading dictionaries
+% if these operators are not defined. 
+
+% Conditionally disable the TN 5044 psuedo-ops if NO_TN5044 specified
+/NO_TN5044 where { pop (%END TN 5044 psuedo-ops) .skipeof } if
+
+% TN 5044 does not define the contents of the array.  We are simply putting
+% the values given into an array.  This is consistent with what we see when
+% testing with Adobe Distiller 6.0.
+%   <cyan> <magenta> <yellow> <black> <key> findcmykcustomcolor <array>
+/findcmykcustomcolor { 5 array astore } bind def
+
+% Build a tint transform function for use by setcustomcolor.  This function
+% is for a Separation color space which has a DeviceCMYK base color space
+% (i.e. 1 input and 4 outputs).  The input to buildcustomtinttransform is the
+% array created by findcmykcustomcolor.  The resulting function is:
+%   { dup cyan mul exch dup magenta mul exch dup yellow mul exch black mul }
+%   Where cyan, magenta, yellow, and black are values from the array.
+/buildcustomtinttransform	% <array> buildcustomtinttransform <function>
+{ [ /dup load 2 index 0 get /mul load
+  /exch load /dup load 6 index 1 get /mul load
+  /exch load /dup load 10 index 2 get /mul load
+  /exch load 13 index 3 get /mul load
+  ] cvx bind
+  exch pop			% Remove the input array
+} bind def
 
-/.image /image load def
-/image {
-  dup type /dicttype eq {
-    dup /ImageType get //.imagetypes exch get exec
-  } {
-    //.image
-  } ifelse
-} odef
-currentdict /.image undef
+% Set a custom color based upon a tint and array which describes the custom
+% color.  See findcmykcustomcolor.  First we create and then set a Separation
+% colorspace.  Then we set the specified color.
+% Note that older Adobe ProcSets apparently allow for 'null' as the tint
+% for some reason, so an alternate operational mode is tolerated:
+% 					    null setcustomcolor -
+/setcustomcolor			% <array> <tint> setcustomcolor -
+{ dup //null ne {
+    % Start building Separation colorspace
+    [ /Separation 3 index 4 get	% Get separation name from array's key
+    /DeviceCMYK
+    5 index buildcustomtinttransform ]	% build the tint transform function
+    setcolorspace			% Set the Separation color space as current
+    setcolor			% Set the tint as the current color
+    pop				% Remove the input array
+  }
+  { pop }	% 'null' as the tint is ignored
+  ifelse
+} bind def
 
-/.imagemask /imagemask load def
-/imagemask {
-  dup type /dicttype eq {
-    dup /ImageType get //.imagemasktypes exch get exec
-  } {
-    //.imagemask
-  } ifelse
-} odef
-currentdict /.imagemask undef
+% This proc is supposed to implement a version of overprinting. TN 5044 says
+% that this proc is not used by any shipping host-based application. We have
+% only found it being used in a proc set in files by Canvas from Deneba Systems.
+% Even their proc set does not actually do any overprinting.  However their
+% files crash if this is not defined.  Thus we have a copy of this proc but
+% we are simply checking for inputs being -1 and if so then we set the value
+% to 0.
+/setcmykoverprint {
+  4 { dup -1 eq { pop 0 } if 4 1 roll } repeat setcmykcolor
+} bind def
+
+%END TN 5044 psuedo-ops
 
 end				% level2dict

+ 11 - 13
sys/lib/ghostscript/gs_lgo_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1999, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_lgo_e.ps,v 1.3 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_lgo_e.ps,v 1.5 2002/02/21 21:49:28 giles Exp $
 % Define the Adobe "original" Latin glyph set.
 % This is not an Encoding strictly speaking, but we treat it like one.
 /currentglobal where

+ 11 - 13
sys/lib/ghostscript/gs_lgx_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_lgx_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_lgx_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the Adobe "extension" Latin glyph set.
 % This is not an Encoding strictly speaking, but we treat it like one.
 /currentglobal where

+ 44 - 174
sys/lib/ghostscript/gs_ll3.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1997, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gs_ll3.ps,v 1.10 2001/07/12 05:47:07 lpd Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_ll3.ps,v 1.20 2003/10/22 11:22:29 alexcher Exp $
 % Initialization file for PostScript LanguageLevel 3 functions.
 % This file must be loaded after gs_lev2.ps and gs_res.ps.
 % These definitions go into ll3dict or various ProcSets.
@@ -25,7 +23,7 @@ ll3dict begin
 
 % We need LanguageLevel 2 or higher in order to have setuserparams and
 % defineresource.
-languagelevel dup 2 max .setlanguagelevel
+languagelevel dup 2 .max .setlanguagelevel
 
 % ------ Idiom recognition ------ %
 
@@ -33,12 +31,10 @@ languagelevel dup 2 max .setlanguagelevel
 
 % Modify `bind' to apply idiom recognition afterwards.
 /.bindscratch 128 string def
-% Do the right thing if NOBIND or DELAYBIND is in effect.
-% Note also that since this definition of `bind' may get bound in,
+% Note that since this definition of `bind' may get bound in,
 % it has to function properly even at lower language levels,
 % where IdiomRecognition may not be defined.
-/bind load /.bind load ne
-/bind {		% <proc> bind <proc'>
+/.bind {		% <proc> .bind <proc'>
   //.bind currentuserparams /IdiomRecognition
   .knownget not { false } if {
     (*) {
@@ -60,11 +56,12 @@ languagelevel dup 2 max .setlanguagelevel
     } //.bindscratch /IdiomSet resourceforall
   } if
 } odef
-{ /.bind /bind load def
-  /bind { } def
-} if
 currentdict /.bindscratch .undef
 
+DELAYBIND NOBIND or not { 
+  /bind /.bind load def
+} if
+
 % ------ HalftoneTypes 6, 10, 16 and HalftoneMode ------ %
 
 % This code depends on an internal HalftoneType 7 with the following keys:
@@ -282,170 +279,43 @@ systemdict /.reuseparamdict undef
 /shfill {		% <shadingdict> shfill -
 	% Currently, .shfill requires that the color space
 	% in the pattern be the current color space.
-  dup gsave { .buildshading .shfill } stopped grestore { stop } if
+	% Disable overprintmode for shfill
+  dup gsave
+  0 .setoverprintmode { .buildshading .shfill } stopped
+  grestore { stop } if
   pop
 } odef
 
 % Establish an initial smoothness value that matches Adobe RIPs.
 0.02 setsmoothness
 
-% ------ UseCIEColor ------ %
-
-% The library maintains and detects the UseCIEColor device parameter,
-% but it doesn't have access to the resource dictionaries.  We also
-% want color space substitution to work in systems without a PostScript
-% interpreter.  Therefore, we eagerly inform the library of changes in
-% the (effective) ColorSpace category that might affect the operation of
-% UseCIEColor.  We must notice the following events:
-%	1) defineresource and undefineresource of the Default ColorSpaces.
-%	2) restore.
-%	3) Changes in current VM, which cause a different set of resources
-%	to become visible.
-% #1 is rare.  #2 is handled in C code.  If checking the ColorSpace
-% category on #3 turns out to be expensive, we can cache more information
-% about whether these operations actually affect UseCIEColor.
-
-% This operator implements color space substitution in the library:
-%	<index> <bool> .setsubstitutecolorspace -
-% <bool> = true means substitute the current color space for the one given
-% by <index>; <bool> = false means stop substituting.  Substitution is not
-% affected by grestore/setgstate, but it is affected by restore.
-
-% ColorSpace defineresource and undefineresource for the Default keys
-% call .definedefaultcs and .undefinedefaultcs.  See gs_res.ps.
-
-/.useciecolorkeydict mark
-  /UseCIEColor null
-.dicttomark readonly def
-/.definedefaultcs {	% <index> <value> .definedefaultcs -
-  currentcolorspace
-	% Temporarily disable color substitution, in case the substitute
-	% color space is or mentions a color space that is currently
-	%  being substituted.
-  currentdevice //.useciecolorkeydict .getdeviceparams exch pop exch pop
-  mark 5 -2 roll
-	% Stack: cspace UseCIEColor mark index value
-   { setcolorspace true .setsubstitutecolorspace }
-  stopped counttomark 1 add 1 roll cleartomark
-	% Stack: cspace UseCIEColor stopped?
-  3 1 roll
-  currentdevice null true mark /UseCIEColor 6 -1 roll .putdeviceparams pop pop
-  setcolorspace { stop } if
-} bind def
-currentdict /.useciecolorkeydict undef
-
-/.undefinedefaultcs {	% <index> .undefinedefaultcs -
-  false .setsubstitutecolorspace
-} bind def
-
-/.setdefaultcs {	% <index> <value|null> .setdefaultcs -
-  dup null eq { pop .undefinedefaultcs } { .definedefaultcs } ifelse
-} bind def
-
-/.getdefaultcs {	% <key> .getdefaultcs <value|null>
-  .GetInstance { 0 get } { null } ifelse
-} bind def
-
-/.setglobal {		% <bool> .setglobal -
-  dup .currentglobal ne {
-	% If there are no local definitions of the Default keys,
-	% changing VM can't affect the definition of any resource.
-    /.localcsdefaults .uservar {
-	% We only want to change substitutions for color spaces
-	% whose definitions are actually changing.
-      /ColorSpace /Category findresource begin
-      /DefaultGray .getdefaultcs
-      /DefaultRGB .getdefaultcs
-      /DefaultCMYK .getdefaultcs
-      end
-      3 index .setglobal
-      /ColorSpace /Category findresource begin
-      /DefaultGray .getdefaultcs
-      /DefaultRGB .getdefaultcs
-      /DefaultCMYK .getdefaultcs
-      end
-			% Stack: bool oldgray oldrgb oldcmyk
-			%   newgray newrgb newcmyk
-      dup 4 index ne { 2 exch .setdefaultcs } { pop } ifelse
-      dup 4 index ne { 1 exch .setdefaultcs } { pop } ifelse
-      dup 4 index ne { 0 exch .setdefaultcs } { pop } ifelse
-      pop pop pop pop
-    } {
-      .setglobal
-    } ifelse
-  } {
-    .setglobal
-  } ifelse
-} .bind odef		% bind in .setglobal
-
-
-% Define default device color spaces to allow substitution
-% on UseCIEColor == true :
-
-/DefaultGray
-[ /CIEBasedA
-  3 dict begin
-     /WhitePoint [ 0.9505 1.0 1.089 ] def
-     /DecodeLMN  [ { 1.8 exp } { 1.8 exp } { 1.8 exp } ] def
-     /MatrixLMN  [ 0.4439 0.2522 0.0436 0.3341 0.6371 0.1387 0.1725 0.1107 0.9067 ] def
-  currentdict end
-]
-/ColorSpace defineresource pop
-
-/DefaultRGB
-[ /CIEBasedABC
-  3 dict begin
-     /WhitePoint [ 0.9505 1.0 1.089 ] def
-     /DecodeLMN  [ { 1.8 exp } { 1.8 exp } { 1.8 exp } ]  def
-     /MatrixLMN  [ 0.4439 0.2522 0.0436 0.3341 0.6371 0.1387 0.1725 0.1107 0.9067 ] def
-  currentdict end
-]
-/ColorSpace defineresource pop
-
-/DefaultCMYK
-[ /CIEBasedDEFG
-  4 dict begin
-     /WhitePoint [ 0.9505 1.0 1.089 ] def
-     /Table [ 2 2 2 2
-            % Trivial table :
-            % [
-            %   [ < FFFFFF 000000 FFFF00 000000>
-            %     < FF00FF 000000 FF0000 000000> ]
-            %   [ < 00FFFF 000000 00FF00 000000>
-            %     < 0000FF 000000 000000 000000> ]
-            % ]
-
-            % AcrobatReader-compatible table :
-              [
-                [ < FFFFFF 000000 FFFF00 000000>
-                  < EA007F 000000 FC000F 000000> ]
-
-                [ < 00A0C8 000000 008436 000000>
-                  < 00007C 000000 000000 000000> ]
-              ]
-            ] def
-     /DecodeLMN [ { 1.8 exp } { 1.8 exp } { 1.8 exp } ] def
-     /MatrixLMN [ 0.4439 0.2522 0.0436 0.3341 0.6371 0.1387 0.1725 0.1107 0.9067 ] def
-  currentdict end
-]
-/ColorSpace defineresource pop
-
-
 % ------ DeviceN color space ------ %
 
-% This isn't quite right, because the ColorSpaceFamily resource will exist
-% even with languagelevel < 3, but it's close enough.
+%% Replace 1 (gs_ciecs3.ps)
+(gs_ciecs3.ps) runlibfile
 
-/.setdevicenspace where {
-  pop colorspacedict /DeviceN {
-    dup 2 get setcolorspace dup
-    dup 1 get length		% # of components
-    .converttinttransform .setdevicenspace
-  } bind put
-} if
+%% Replace 1 (gs_devn.ps)
+(gs_devn.ps) runlibfile
 
 % ------ Miscellaneous ------ %
 
+% Make the setoverprintmode and currentoverprintmode operators visible (3015)
+% Because of the requirements of PDF, the .currentoverprintmode and
+% .setoverprintmode operators have integer parameters.  Thus wee need to
+% convert the Postscript bool parameters to integers.
+%
+/setoverprintmode 		% bool setoverprint -
+{
+  { 1 } { 0 } ifelse		% convert bool to integer
+  //.setoverprintmode
+} odef
+
+/currentoverprintmode 		% - currentoverprintmode bool
+{
+  //.currentoverprintmode
+  0 ne				% convert integers to bool
+} odef
+
 % Define additional user and system parameters.
 /HalftoneMode 0 .definepsuserparam
 /MaxSuperScreen 1016 .definepsuserparam

+ 11 - 13
sys/lib/ghostscript/gs_mex_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1994, 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_mex_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_mex_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the MacExpert encoding vector.
 /currentglobal where
  { pop currentglobal { setglobal } true setglobal }

+ 11 - 13
sys/lib/ghostscript/gs_mgl_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1999, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_mgl_e.ps,v 1.3 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_mgl_e.ps,v 1.5 2002/02/21 21:49:28 giles Exp $
 % Define the Macintosh standard glyph encoding vector.
 % This is not an Encoding strictly speaking, but we treat it like one.
 /currentglobal where

+ 11 - 13
sys/lib/ghostscript/gs_mro_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1994, 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_mro_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_mro_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the MacRoman encoding vector.
 /currentglobal where
  { pop currentglobal { setglobal } true setglobal }

+ 299 - 0
sys/lib/ghostscript/gs_patrn.ps

@@ -0,0 +1,299 @@
+%    Copyright (C) 2001, 2002 Aladdin Enterprises.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_patrn.ps,v 1.2 2002/11/13 20:23:10 alexcher Exp $
+% Pattern color space method dictionary.
+
+
+% verify that Pattern color spaces are supported
+/.setpatternspace where
+  { pop }
+  { currentfile closefile }
+ifelse
+
+.currentglobal true .setglobal
+.cspace_util begin
+
+%
+%   <name1 | array1>   get_pattern_base_cspace   <null | name2 | array2>
+%
+% If the Pattern color space has a base color space, push that base
+% color space onto the stack. Otherwise, push a null object.
+%
+/get_pattern_base_cspace
+  {
+    dup type /nametype eq
+      { pop //null }
+      {
+        dup length 1 gt
+          { 1 get }
+          { pop //null }
+        ifelse
+      }
+    ifelse
+  }
+bind def
+
+
+%
+%   <dict>   has_base_color   <bool>
+%
+% Determine if a Pattern "color" includes a base color. This is the case
+% if the pattern dictionary has PatternType 1 and PaintType 2.
+%
+/has_base_color
+  {
+    dup //null eq
+      { pop //false }
+      {
+        dup /PatternType get 1 eq
+          { /PaintType get 2 eq }
+          { pop //false }
+        ifelse
+      }
+    ifelse
+  }
+bind def
+
+%
+%   <c1> ... <cn>  <pattern_dict>  <pattern_cspace>
+%   get_pattern_base_color
+%   <c1> ... <cn>  <base_cspace>  true
+% or
+%   <?c1?> ... <?cn?>  <dict>  <pattern>
+%   get_pattern_base_color
+%   false
+%
+% If a pattern dictionary has a base color, set up that base color and
+% color space, and push true. Otherwise, just push false. It is assumed
+% that if the pattern includes a base color, the Pattern color space
+% has a base color space.
+%
+/get_pattern_base_color
+  {
+    exch //has_base_color exec
+      { 1 get //true }
+      { pop //false }
+    ifelse
+  }
+bind def
+
+
+colorspacedict
+/Pattern
+  mark
+    /cs_potential_indexed_base false
+    /cs_potential_pattern_base false
+    /cs_potential_alternate false
+    /cs_potential_icc_alternate false
+
+    %
+    % We employ the same convention for describing the number of
+    % components in a Pattern color space as is used by the graphic
+    % library. For pattern spaces with no underlying color space,
+    % the result is -1. If a Pattern space has an underlying color
+    % space with n components, the result is -(n + 1).
+    %
+    /cs_get_ncomps
+      {
+        //get_pattern_base_cspace exec dup //null eq
+          { pop 0 }
+          //.cs_get_ncomps
+        ifelse
+        1 add neg
+      }
+    bind
+
+    % there is no "range" for a Pattern color space
+    /cs_get_range { {} cvlit } bind
+
+    /cs_get_default_color { pop //null } bind
+
+    /cs_get_currentgray
+      {
+        //get_pattern_base_color exec
+          //.cs_get_currentgray
+          { 0 }
+        ifelse
+      }
+    bind
+
+    /cs_get_currentrgb
+      {
+        //get_pattern_base_color exec
+          //.cs_get_currentrgb
+          { 0 0 0 }
+        ifelse
+      }
+    bind
+
+    /cs_get_currentcmyk
+      {
+        //get_pattern_base_color exec
+          //.cs_get_currentcmyk
+          { 0 0 0 1.0 }
+        ifelse
+      }
+    bind
+
+    /cs_validate
+      {
+        dup //get_pattern_base_cspace exec dup //null eq
+          { pop }
+          {
+            //.cs_validate exec //.cs_potential_pattern_base exec not
+              //setcspace_rangecheck
+            if
+          }
+        ifelse
+      }
+    bind
+
+    % substitute the base space if appropriate
+    /cs_substitute
+      {
+        dup //get_pattern_base_cspace exec dup //null eq
+          { pop dup }
+          {
+            //.cs_substitute exec 2 copy eq
+              { pop pop dup }
+              {
+                % retain only the new alternate space
+                exch pop
+
+                % build all new structures in local VM
+               .currentglobal 3 1 roll //false .setglobal
+
+                % construct a new array and insert the new base color space 
+                1 index dup length array copy dup 1 4 -1 roll put
+
+                % restore VM mode
+                3 -1 roll .setglobal
+              }
+            ifelse
+          }
+        ifelse
+      }
+    bind
+
+    /cs_prepare {}
+
+    %
+    % Install the current color space.
+    %
+    % The current Ghostscript color space implementation requires that
+    % color spaces that provide a base or alternative color space set
+    % that base/alternative color space to be the current color space
+    % before attempting to set the original color space.
+    %
+    % In principle, the only errors that are possible for .setpatternspace
+    % (given that setcolorspace itself is legal) are limitcheck and/or
+    % VMerror. The Ghostscript implementation allows a few others, so 
+    % we go through the full code to restore the current color space in
+    % the event of an error.
+    %
+    /cs_install
+      {
+        dup //get_pattern_base_cspace exec dup //null eq
+          {
+            pop
+            dup type /nametype eq
+              { pop { /Pattern } cvlit }
+            if
+            .setpatternspace
+          }
+          {
+            % save the current color space
+            currentcolorspace
+
+            % set the base color space as the current color space
+            exch //forcesetcolorspace
+
+            % set the pattern color space; restore the earlier space on error
+            mark 2 index
+              { .setpatternspace }
+            stopped
+              { cleartomark setcolorspace stop }
+              { pop pop pop }
+            ifelse
+          }
+        ifelse
+      }
+    bind
+
+
+    %
+    % Pattern dictionaries generated by makepattern will include an
+    % Implementation entry whose value is an internal data structure.
+    % Such structures are given executable type names that match their
+    % internal structure names. The names used for pattern
+    % implementations are gs_pattern1_instance_t and
+    % gs_pattern2_instance_t. It is unfortunate to have to expose such
+    % internal names at this level, but not easily avoided.
+    %
+    /cs_prepare_color
+      {
+        % verify that the topmost operand is a pattern dictionary
+        1 index dup type /dicttype ne
+          {
+            //null ne
+              //setcspace_typecheck
+            if
+            pop
+          }
+          {
+            dup /Implementation .knownget
+              {
+                type dup dup
+                /gs_pattern1_instance_t ne exch /gs_pattern2_instance_t ne and
+                exch xcheck not
+                or
+                  //setcspace_typecheck
+                if
+              }
+              //setcspace_typecheck
+            ifelse
+
+            % check if base color space operands are present
+            dup /PatternType get 1 eq
+              {
+                /PaintType get 2 eq
+                  {
+                    % verify that a base color space exists
+                    //get_pattern_base_cspace exec dup //null eq
+                      //setcspace_rangecheck
+                    if
+                    exch 1 index //.cs_get_ncomps exec
+                    exch 1 index 3 add 1 roll
+                    //check_num_stack exec
+                    //.cs_get_ncomps exec 1 add -1 roll
+                  }
+                  { pop }
+                ifelse
+              }
+              { pop pop }
+            ifelse
+          }
+        ifelse
+      }
+    bind
+
+    /cs_complete_setcolor //pop_1
+
+  .dicttomark
+put
+
+end     % .cspace_util
+.setglobal

+ 11 - 13
sys/lib/ghostscript/gs_pdf_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1994, 1997, 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_pdf_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_pdf_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the PDFDoc encoding vector.
 /currentglobal where
  { pop currentglobal { setglobal } true setglobal }

+ 406 - 87
sys/lib/ghostscript/gs_pdfwr.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1996, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gs_pdfwr.ps,v 1.11 2001/05/04 20:59:33 alexcher Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_pdfwr.ps,v 1.52 2005/10/20 13:04:16 leonardo Exp $
 % PDF writer additions to systemdict.
 
 % This file should be included iff the pdfwrite "device" is included
@@ -23,28 +21,37 @@
 
 % ---------------- Predefined configurations ---------------- %
 
-% These correspond to the 3 predefined settings in Acrobat Distiller 4,
-% plus a "default" setting.
+% These correspond to the 4 predefined settings in Acrobat Distiller 5,
+% plus a "default" setting that doesn't downsample images.
+
+/.a2112 [2 1 1 2] readonly def
+/.a1111 [1 1 1 1] readonly def
+/.standardfonts [
+  /Courier /Courier-Bold /Courier-Oblique /Courier-BoldOblique
+  /Helvetica /Helvetica-Bold /Helvetica-Oblique /Helvetica-BoldOblique
+  /Times-Roman /Times-Bold /Times-Italic /Times-BoldItalic
+  /Symbol /ZapfDingbats
+] readonly def
 
-% Parameters common to all configurations.
-% Note that we don't set AlwaysEmbed or NeverEmbed, since the default values
-% depend on the CompatibilityLevel and are initialized internally.
+% Parameters common to all non-default configurations.
+% Note that the default configuration overrides a few of these.
 /.defaultImageDict mark
   /QFactor 0.9 /Blend 1
-  /HSamples [2 1 1 2] /VSamples [2 1 1 2]
+  /HSamples .a2112 /VSamples .a2112
 .dicttomark readonly def
 /.distillercommon mark
-  /ASCII85EncodePages false
+  /AlwaysEmbed []
   /AntiAliasColorImages false
   /AntiAliasGrayImages false
   /AntiAliasMonoImages false
+  /ASCII85EncodePages false
   /AutoFilterColorImages true
   /AutoFilterGrayImages true
-  /AutoFilterMonoImages true
   /AutoPositionEPSFiles true
   /Binding /Left
-	% What to do about the CalxxxProfiles?
-  /ColorACSImageDict .defaultImageDict
+  /CalCMYKProfile (None)		% (U.S. Web Coated (SWOP) v2)
+  /CalGrayProfile (None)		% (Dot Gain 20%)  
+  /CalRGBProfile (None)			% (sRGB IEC61966-2.1)
   /ColorImageDepth -1
   /ColorImageDict .defaultImageDict
   /ColorImageDownsampleThreshold 1.5
@@ -61,12 +68,11 @@
   /EncodeGrayImages true
   /EncodeMonoImages true
   /EndPage -1
-  /GrayACSImageDict .defaultImageDict
   /GrayImageDepth -1
   /GrayImageDict .defaultImageDict
   /GrayImageDownsampleThreshold 1.5
   /GrayImageFilter /DCTEncode
-  /ImageMemory 500000
+  /ImageMemory 524288
   /LockDistillerParams false
   /MaxSubsetPct 100
   /MonoImageDepth -1
@@ -75,13 +81,14 @@
   .dicttomark readonly
   /MonoImageDownsampleThreshold 1.5
   /MonoImageFilter /CCITTFaxEncode
+  /OffOptimizations 0
   /OPM 1
   /Optimize true
   /ParseDSCComments true
   /ParseDSCCommentsForDocInfo true
   /PreserveCopyPage true
-  /PreserveEPSInfo true
   /PreserveHalftoneInfo false
+  /sRGBProfile (None)			% (sRGB IEC61966-2.1)
   /StartPage 1
   /SubsetFonts true
   /TransferFunctionInfo /Preserve
@@ -94,47 +101,95 @@
 /default mark
   /AutoRotatePages /PageByPage
   /CannotEmbedFontPolicy /Warning
-  /DownsampleColorImages false
-  /DownsampleGrayImages false
-  /DownsampleMonoImages false
-  /Optimize false
+  /ColorACSImageDict .defaultImageDict
+  /ColorConversionStrategy /LeaveColorUnchanged
+%  /ColorImageDownsampleType
+%  /ColorImageResolution
+%  /CompatibilityLevel
+  /CreateJobTicket false
+  /DoThumbnails false
+  /DownsampleColorImages false		% override
+  /DownsampleGrayImages false		% override
+  /DownsampleMonoImages false		% override
+  /EmbedAllFonts true
+  /GrayACSImageDict .defaultImageDict
+%  /GrayImageDownsampleType
+%  /GrayImageResolution
+%  /MonoImageDownsampleType
+%  /MonoImageResolution
+  /NeverEmbed .standardfonts
+  /Optimize false			% override
+  /PreserveEPSInfo true
+  /PreserveOPIComments true
+  /PreserveOverprintSettings true
+  /UCRandBGInfo /Preserve
 .dicttomark readonly
 
+/.screenACSImageDict mark
+  /QFactor 0.76 /Blend 1 /ColorTransform 1
+  /HSamples .a2112 /VSamples .a2112
+.dicttomark readonly def
 /screen mark
   /AutoRotatePages /PageByPage
+%  /CalGrayProfile (None)
   /CannotEmbedFontPolicy /Warning
+  /ColorACSImageDict .screenACSImageDict
   /ColorConversionStrategy /sRGB
   /ColorImageDownsampleType /Average
   /ColorImageResolution 72
-  /CompatibilityLevel 1.2
+  /CompatibilityLevel 1.3
   /CreateJobTicket false
   /DoThumbnails false
-  /DownsampleColorImages true
-  /DownsampleGrayImages true
-  /DownsampleMonoImages true
-  /EmbedAllFonts false
+  /EmbedAllFonts true
+  /GrayACSImageDict .screenACSImageDict
   /GrayImageDownsampleType /Average
   /GrayImageResolution 72
   /MonoImageDownsampleType /Average
   /MonoImageResolution 300
-  /ParseDSCCommentsForDocInfo false
+  /NeverEmbed .standardfonts
+  /PreserveEPSInfo false
+  /PreserveOPIComments false
+  /PreserveOverprintSettings false
+  /UCRandBGInfo /Remove
+.dicttomark readonly
+
+/ebook mark
+  /AutoRotatePages /All
+%  /CalGrayProfile (None)
+  /CannotEmbedFontPolicy /Warning
+  /ColorACSImageDict .screenACSImageDict
+  /ColorConversionStrategy /sRGB
+  /ColorImageDownsampleType /Bicubic
+  /ColorImageResolution 150
+  /CompatibilityLevel 1.4
+  /CreateJobTicket false
+  /DoThumbnails false
+  /EmbedAllFonts true
+  /GrayACSImageDict .screenACSImageDict
+  /GrayImageDownsampleType /Bicubic
+  /GrayImageResolution 150
+  /MonoImageDownsampleType /Bicubic
+  /MonoImageResolution 300
+  /NeverEmbed .standardfonts
+  /PreserveEPSInfo false
   /PreserveOPIComments false
   /PreserveOverprintSettings false
   /UCRandBGInfo /Remove
 .dicttomark readonly
 
 /.printerACSImageDict mark
-  /QFactor 0.55 /Blend 1
-  /HSamples [2 1 1 2] /VSamples [2 1 1 2]
+  /QFactor 0.4 /Blend 1 /ColorTransform 1
+  /HSamples .a1111 /VSamples .a1111
 .dicttomark readonly def
 /printer mark
   /AutoRotatePages /None
+%  /CalGrayProfile (None)
   /CannotEmbedFontPolicy /Warning
   /ColorACSImageDict .printerACSImageDict
   /ColorConversionStrategy /UseDeviceIndependentColor
   /ColorImageDownsampleType /Bicubic
   /ColorImageResolution 300
-  /CompatibilityLevel 1.3
+  /CompatibilityLevel 1.4
   /CreateJobTicket true
   /DoThumbnails false
   /EmbedAllFonts true
@@ -143,15 +198,16 @@
   /GrayImageResolution 300
   /MonoImageDownsampleType /Bicubic
   /MonoImageResolution 1200
-  /ParseDSCCommentsForDocInfo true
+  /NeverEmbed []
+  /PreserveEPSInfo true
   /PreserveOPIComments true
   /PreserveOverprintSettings true
   /UCRandBGInfo /Preserve
 .dicttomark readonly
 
 /.prepressACSImageDict mark
-  /QFactor 0.25
-  /HSamples [1 1 1 1] /VSamples [1 1 1 1]
+  /QFactor 0.15 /Blend 1 /ColorTransform 1
+  /HSamples .a1111 /VSamples .a1111
 .dicttomark readonly def
 /prepress mark
   /AutoRotatePages /None
@@ -160,7 +216,7 @@
   /ColorConversionStrategy /LeaveColorUnchanged
   /ColorImageDownsampleType /Bicubic
   /ColorImageResolution 300
-  /CompatibilityLevel 1.3
+  /CompatibilityLevel 1.4
   /CreateJobTicket true
   /DoThumbnails true
   /EmbedAllFonts true
@@ -169,12 +225,44 @@
   /GrayImageResolution 300
   /MonoImageDownsampleType /Bicubic
   /MonoImageResolution 1200
-  /ParseDSCCommentsForDocInfo true
+  /NeverEmbed []
+  /PreserveEPSInfo true
   /PreserveOPIComments true
   /PreserveOverprintSettings true
   /UCRandBGInfo /Preserve
 .dicttomark readonly
 
+% Define distiller settings for the ps2write device and for the ps2ps2 script :
+/PSL2Printer mark
+  /AutoRotatePages /None
+  /CannotEmbedFontPolicy /Error
+  /ColorACSImageDict .prepressACSImageDict
+  /ColorConversionStrategy /LeaveColorUnchanged
+  /ColorImageDownsampleType /Bicubic
+  /ColorImageResolution 600
+  /CompatibilityLevel 1.2 % Always 1.2 with ps2write.
+  % /CreateJobTicket true % Not sure
+  /DoThumbnails false
+  /EmbedAllFonts true
+  /GrayACSImageDict .prepressACSImageDict
+  /GrayImageDownsampleType /Bicubic
+  /GrayImageResolution 600
+  /MonoImageDownsampleType /Bicubic
+  /MonoImageResolution 1200
+  /NeverEmbed []
+  /PreserveEPSInfo true
+  /PreserveOPIComments true
+  /PreserveOverprintSettings true
+  /UCRandBGInfo /Preserve
+
+  /PreserveHalftoneInfo true 
+  /TransferFunctionInfo /Preserve 
+  /MaxViewerMemorySize 8000000 
+  /CompressPages false 
+  /CompressFonts false 
+  /ASCII85EncodePages true 
+.dicttomark readonly
+
 .dicttomark readonly def
 
 % ---------------- End of predefined configurations ---------------- %
@@ -184,12 +272,63 @@
 /.setpdfwrite {		% - .setpdfwrite -
 		% Set a large VM threshold to reduce garbage collection.
   currentuserparams /VMThreshold get 3000000 .max setvmthreshold
-		% Install a level of 'save' to reduce font loading.
-  save pop
 } bind def
 
 % ---------------- pdfmark and DSC processing ---------------- %
 
+/.write_small_positive_real  % <file> <real> .write_small_positive_real -
+{ % The argument must be grater than 0 and must be strongly samller than 0.1.
+  % The conversion isn't simple due to the low (24 bits) precision 
+  % of the floating point arithmetics in Postscript.
+  % For best result we first use the 1e8 factor since its binary 
+  % representation 101111101011110000100000000 well rounds into 14 significant
+  % bits :         101111101011110000000000000 .
+  1 index (.) writestring
+  { dup 100000000 mul 
+    dup 10 mul 1 ge {
+      % Will need not greater than 0.1 due to a rounding below.
+      pop exit
+    } if
+    exch pop
+    1 index (00000000) writestring
+  } loop
+  % Now it is not smaller than 1e-9, use simple digitizing.
+  { dup 10 mul 
+    dup 10 mul 1 ge { 
+      pop exit 
+    } if
+    exch pop
+    1 index (0) writestring
+  } loop
+  % Now 0.01 <= n < 0.1, but rounding may give 0.1 .
+  % Convert to integer with 7 digits precision :
+  100000000 % precision factor 1e8       % f n r
+  dup 10 idiv 3 1 roll mul 0.5 add cvi   % f r' N
+  2 copy le {
+    % The rounding overflows, suppress it.
+    % Note it carries out an additional digit,
+    % that's why we needed <0.1 above.
+    pop pop (1) writestring
+  } {
+    % Didn't cary out, put 0.
+    2 index (0) writestring
+    exch                                 % f N r
+    % Continue the simple digitizing :
+    { 10 idiv dup                        % f N r' r'
+      2 index exch idiv                  % f N r' d
+      (0123456789) exch 1 getinterval    % f N r' (d)
+      3 index exch writestring           % f N r'
+      dup 3 2 roll exch mod              % f r' N'
+      dup 0 eq { 
+        % Don't write trailing zeros.
+        exit 
+      } if
+      exch                               % f N' r'
+    } loop
+    pop pop pop
+  } ifelse
+} bind def
+
 % Encode values to pass for the /pdfmark or /DSC pseudo-parameter.
 /.pdf===dict mark
   /arraytype
@@ -209,11 +348,44 @@
       }
      forall (>>) writestring
    } bind
+  /nametype {
+    % If the name string includes any non-regular characters,
+    % write it with two preceding and one following null character(s).
+    % (Null characters in the name itself are not allowed.)
+    % This non-standard escape convention is required for passing names
+    % that include non-regular characters, because PostScript provides
+    % no way to do this.  The pdf_scan_token procedure in the C code of
+    % the pdfwrite driver is currently the only place that recognizes
+    % this convention.
+    dup .namestring (\000\011\012\014\015 %()/<>[]{}) .stringbreak null ne {
+      dup .namestring (\000) .stringbreak null ne {
+	/rangecheck signalerror
+      } if
+      1 index <0000> writestring 1 index exch write===only 0 write
+    } {
+      write===only
+    } ifelse
+  } bind
+  /realtype {
+    % Prevent using floating point format - see Bug 688167.
+    dup dup 0 lt { neg } if 0.01 lt {
+      dup 0 eq {
+        pop (0) writestring
+      } {
+        dup 0 lt {
+          1 index (-) writestring neg
+        } if
+        .write_small_positive_real
+      } ifelse
+    } {
+      write===only
+    } ifelse
+  } bind
 .dicttomark readonly def
 /pdf===only {	% <file> <obj> pdf===only -
   .pdf===dict 1 index type .knownget { exec } { write===only } ifelse
 } bind def
-/.pdfcvbuf 10 string def	% enough for most arguments
+/.pdfcvbuf 30 string def	% enough for most arguments
 userdict /.pdfcvstring () put
 /.pdfcvs {		% <obj> .pdfcvs <string>
   currentglobal exch false .setglobal
@@ -272,7 +444,7 @@ userdict /.pdfcvstring () put
 		% Read the file into a sequence of strings.
 		% This isn't great, but it's simple.
 	  {
-	    dup 1000 string readstring not { exch exit } if
+	    dup 64000 string readstring not { exch exit } if
 	    exch
 	  } loop closefile
 	} if
@@ -292,27 +464,75 @@ userdict /.pdfcvstring () put
     .systemvar exch signalerror
 } bind def
 /pdfmark {		% -mark- <key> <value> ... <markname> pdfmark -
-  counttomark 1 add copy
-  //.pdfmarkparams 1 index .knownget { exec } { .pdfcvsall } ifelse
-  mark /pdfmark 3 -1 roll .pdfputparams
-  dup type /booleantype ne {
-    /pdfmark .pdfparamerror
-  } if cleartomark
+  dup /SP eq {
+    % A hack for synchronizing the clipping path.
+    gsave 
+    [1 0 0 1 0 0] setmatrix 0 setlinewidth
+    newpath -3 -3 moveto closepath stroke % Paints outside the device bbox.
+    grestore
+  } if
+  dup /PS eq systemdict /PDFX .knownget not { false } if and {
+    % Execute it since PDF/X doesn't allow to embed it.
+    { dup mark eq {
+        pop exit
+      } if
+      1 index /DataSource eq {
+        cvx exec
+      } {
+        pop pop
+      } ifelse
+    } loop
+  } {
+    counttomark 1 add copy
+    //.pdfmarkparams 1 index .knownget { exec } { .pdfcvsall } ifelse
+    mark /pdfmark 3 -1 roll .pdfputparams
+    dup type /booleantype ne {
+      /pdfmark .pdfparamerror
+    } if cleartomark
+  } ifelse
 } odef
 userdict /pdfmark .undef
 currentdict /.pdfmarkparams .undef
 
+
+%	<dict> .hook_DSC_Creator -
+/.pdf_hook_DSC_Creator
+{
+  % If the Creator is PScript5.dll, disable the 32 /FontType resource for
+  % handling GlyphNames2Unicode. Since /FontType category can't redefine,
+  % we can do only with redefining the operator 'resourcestatus'.
+  currentdevice .devicename /pdfwrite eq {
+    /Creator .knownget {
+      (PScript5.dll) search {
+        pop pop
+        systemdict /resourcestatus dup
+        { dup /FontType eq 2 index 32 eq and {
+            pop pop false
+          } {
+            resourcestatus
+          } ifelse
+        } bind .makeoperator .forceput
+      } if
+      pop
+    } if
+  } {
+    pop
+  } ifelse
+} 
+bind def
+
 % Use the DSC processing hook to pass DSC comments to the driver.
 % We use a pseudo-parameter named DSC whose value is an array:
 %	/key1 (value1) ... /type
 /.pdfdsc_dict 2 dict def
 /.pdfdsc {	% <file> <DSC string> <dsc dict> [<prev proc>] .pdfdsc -
-  0 get dup null ne { 4 copy exch pop exec } { pop } ifelse 3 -1 roll pop
+  0 get dup null ne { 4 copy exch pop exec pop } { pop } ifelse 3 -1 roll pop
 		% Stack: <dsc string> <dsc dict>
   20 .localvmdict 1 index { 3 copy put pop pop } forall
   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
@@ -331,12 +551,19 @@ currentdict /.pdfmarkparams .undef
     pop pop pop
   } ifelse
 } bind def
+currentdict /.pdf_hook_DSC_Creator undef
 /.initialize_dsc_parser where {
-  pop 2 dict dup .initialize_dsc_parser readonly
-  currentuserparams /ProcessDSCComment get
-  1 array astore	% in case the value is executable
-  //.pdfdsc /exec load 4 array astore cvx readonly
-  << /ProcessDSCComment 3 -1 roll >> setuserparams
+  pop
+  3000 % priority 
+  {
+    currentglobal true setglobal
+    2 dict dup .initialize_dsc_parser readonly
+    currentuserparams /ProcessDSCComment get
+    1 array astore	% in case the value is executable
+    //.pdfdsc /exec load 4 array astore cvx readonly
+    << /ProcessDSCComment 3 -1 roll >> setuserparams
+    setglobal
+  } bind .schedule_init
 } if
 
 % ---------------- {set,current}distillerparams ---------------- %
@@ -382,6 +609,7 @@ currentdict /.pdfmarkparams .undef
   /AutoPositionEPSFiles { }
   /PreserveCopyPage { }
   /UsePrologue { }
+  /OffOptimizations { }
 		% Color sampled image parameters
   /ColorACSImageDict { }
   /AntiAliasColorImages { }
@@ -445,22 +673,29 @@ currentdict /.pdfmarkparams .undef
   /SubsetFonts { }
 .dicttomark readonly def
 /.distillerdevice
- { currentdevice .devicename /pdfwrite eq
+ { currentdevice .devicename dup /pdfwrite eq exch /ps2write eq or
     { currentdevice }
     { /pdfwrite finddevice }
    ifelse
  } bind def
-/setdistillerparams {		% <dict> setdistillerparams -
-  .distillerdevice null false mark 4 index {
+
+% Some badly designed PostScript files only expect the current/set
+% distillerparams operators to exist in a distiller. Since we have
+% this as a runtime option, we enable these operators IFF the
+% currentdevice is pdfwrite. Also, we mask their existence in 
+% systemdict so that 'where' and 'known' don't show them unless
+% the currentdevice is pdfwrite.
+/.setdistillerparams {		% <dict> setdistillerparams -
+  .distillerdevice //null false mark 4 index {
     //.distillerparamkeys 2 index .knownget { exec } { pop pop } ifelse
-  } forall .putdeviceparams
+  } forall .putdeviceparamsonly
   dup type /booleantype ne {
     /setdistillerparams .pdfparamerror
   } {
     pop pop pop
   } ifelse
 } odef
-/currentdistillerparams {	% - currentdistillerparams <dict>
+/.currentdistillerparams {	% - currentdistillerparams <dict>
   .distillerdevice //.distillerparamkeys .getdeviceparams .dicttomark
 		% Patch StartPage and EndPage
 		% ****** NOTE: StartPage and EndPage are disabled because
@@ -469,28 +704,112 @@ currentdict /.pdfmarkparams .undef
 %  currentdict dup /PDFStartPage undef /PDFEndPage undef
 %  def def currentdict end
 } odef
+/setdistillerparams {
+  currentdevice .devicename dup /pdfwrite ne exch /ps2write ne and {
+    /setdistillerparams /undefined signalerror
+  } if
+  .setdistillerparams
+} bind odef
+/currentdistillerparams {
+  currentdevice .devicename dup /pdfwrite ne exch /ps2write ne and {
+    /currentdistillerparams /undefined signalerror
+  } if
+  .currentdistillerparams
+} bind odef
 
-% Patch 'where' so that the distillerparams operators are only visible
-% if the pdfwrite device is the current one, for the benefit of badly
-% designed PostScript files that "know" they have to do something different
-% if a distiller is processing them.
-.wheredict /currentdistillerparams {
-  currentdevice .devicename /pdfwrite eq {
+% Patch 'where' so that the distiller operators are only visible
+% if the pdfwrite device is the current one.
+{ currentdevice .devicename dup /pdfwrite eq exch /ps2write eq or{
     .where
   } {
     .where pop dup //systemdict eq { pop false } { true } ifelse
   } ifelse
-} bind put
-.wheredict /setdistillerparams .wheredict /currentdistillerparams get put
-
-% Set a predefined configuration if PDFSETTINGS is defined.
-/PDFSETTINGS where { pop /PDFSETTINGS load } { /default } ifelse
-.distillersettings exch get
-% Don't override parameters defined on the command line.
-dup length .distillercommon length add dict begin
-.distillercommon 2 {
-  {
-    systemdict 2 index known { pop pop } { def } ifelse
-  } forall
-} repeat
-currentdict end setdistillerparams
+} bind
+{ /currentdistillerparams /setdistillerparams /pdfmark }
+{ .wheredict exch 2 index put } forall pop
+
+% Patch 'known' to hide the systemdict version of distiller operators
+% unless the currentdevice is pdfwrite.
+/known {
+  /currentdistillerparams 1 index eq /setdistillerparams 2 index eq or 
+  /pdfmark 2 index eq or {
+    systemdict 2 index eq {	% only mask the operator in systemdict
+      known currentdevice .devicename dup /pdfwrite ne exch /ps2write ne and { pop false } if
+  } {
+    known
+  } ifelse
+  } {
+    known
+  } ifelse
+} .bind odef
+
+1000 % priority
+{
+  % Note, this may not work if the initial device is not pdfwrite
+  % and may require the use of -dProvideUnicode on the command line.
+  currentdevice .devicename /pdfwrite eq
+  systemdict /ProvideUnicode .knownget not { false } if or {
+    currentglobal true setglobal
+    systemdict /.setupUnicodeDecoder known {
+      /Unicode /Decoding resourcestatus {
+        pop pop
+        /Unicode /Decoding findresource
+        .setupUnicodeDecoder
+      } {
+        QUIET not {
+          (WARNING: /Unicode /Decoding resource is not accessible but it is useful for generating ToUnicode CMap.) =
+        } if
+      } ifelse
+    } if
+    setglobal
+  } if
+} bind .schedule_init
+
+1010 % priority
+{
+    % Set a predefined configuration in the distiller device (pdfwrite)
+    /PDFSETTINGS where { 
+      pop /PDFSETTINGS load 
+    } { 
+      currentdevice .devicename /ps2write eq { /PSL2Printer } { /default } ifelse
+    } ifelse
+    .distillersettings exch get
+    % Don't override parameters defined on the command line.
+    dup length .distillercommon length add dict begin
+    .distillercommon 2 {
+      {
+        systemdict 2 index known { pop pop } { def } ifelse
+      } forall
+    } repeat
+    currentdict end .setdistillerparams
+    .distillerdevice //null false mark .putdeviceparams 
+    dup type /booleantype eq not { cleartomark pop } if pop pop
+} bind .schedule_init
+
+1011 % priority
+{
+    % Set a path to library files (ps2write)
+    currentdevice .devicename /ps2write eq {
+      mark
+      systemdict /OPDFReadProcsetPath .knownget not {
+        (gs_mgl_e.ps) (gs_mro_e.ps) (gs_agl.ps) (opdfread.ps) % Reverse order !
+        () counttomark 1 sub {
+          exch
+          .libfile { .filename } { false } ifelse not {
+            (Configuration error : library file opdfread.ps not found !) =
+            (opdfread.ps) /undefinedfilename signalerror
+          } if
+          .filenamelistseparator concatstrings concatstrings
+        } repeat
+      } if
+      /OPDFReadProcsetPath exch .dicttomark setpagedevice
+   } if
+} bind .schedule_init
+
+2000 % priority
+{ % Note, this may not work if the initial device is not pdfwrite
+  currentdevice .devicename dup /pdfwrite eq exch /ps2write eq or {
+    % Inform the device with initial graphic state. See gdev_pdf_fill_path.
+    newpath fill
+  } if
+} bind .schedule_init

+ 12 - 14
sys/lib/ghostscript/gs_pfile.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1994, 1995 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_pfile.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_pfile.ps,v 1.5 2003/08/08 18:45:05 ray Exp $
 % Runtime support for minimum-space fonts and packed files.
 
 % ****** NOTE: This file must be kept consistent with
@@ -44,7 +42,7 @@
 	% by reading it into a buffer.  We rely on the fact that
 	% save/restore don't affect file positions.
 	% Stack: istart ilength dfilter
-   save exch 1000 string
+   save exch 64000 string
 	% Stack: istart ilength save dfilter scratch
    4 index 1 index length idiv { 2 copy readstring pop pop } repeat
    2 copy 0 8 -1 roll 2 index length mod getinterval readstring pop pop pop

+ 11 - 13
sys/lib/ghostscript/gs_rdlin.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_rdlin.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_rdlin.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Patch for systems with readline support in the interpreter.
 
 % Disable the prompt message, since readline will generate it.

+ 196 - 77
sys/lib/ghostscript/gs_res.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gs_res.ps,v 1.16 2001/10/01 05:56:58 lpd Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_res.ps,v 1.38 2004/10/26 17:07:18 igor Exp $
 % Initialization file for Level 2 resource machinery.
 % When this is run, systemdict is still writable,
 % but (almost) everything defined here goes into level2dict.
@@ -196,37 +194,18 @@ odef
 	4 1 roll pop pop pop
 } bind odef
 % We must prevent resourceforall from automatically restoring the stacks,
-% because we don't want the stacks restored if proc causes an error.
-% On the other hand, resourceforall is defined in the PLRM as an operator,
-% so it must have type /operatortype.  We hack this by taking advantage of
-% the fact that the interpreter optimizes tail calls, so stack protection
-% doesn't apply to the very last token of an operator procedure.
+% because we don't want the stacks restored if proc causes an error or
+% executes a 'stop'. On the other hand, resourceforall is defined in the
+% PLRM as an operator, so it must have type /operatortype.  We hack this
+% by taking advantage of the fact that the interpreter optimizes tail
+% calls, so stack protection doesn't apply to the very last token of an
+% operator procedure.
 /resourceforall1 {	% <template> <proc> <scratch> <category> resourceforall1 -
 	dup /Category findresource begin
 	/ResourceForAll load
-		% Make sure we can recover the original operands.
-		% We must create the array in local VM, in case any of the
-		% operands are local.
-		% Stack: ...operands... proc
-	5 copy pop .currentglobal false .setglobal 5 1 roll
-	4 packedarray exch .setglobal count
-		% Stack: ...operands... proc saved count
-	4 -1 roll pop		% pop the category
-	/stopped load 3 1 roll
-	3 .execn
-		% Stack: ... stopped saved count
-	3 -1 roll {
-	  .currentstackprotect {
-		% The count is the original stack depth + 2.
-	    count exch 4 sub sub { exch pop } repeat
-	    aload pop end
-	  } {
-		% Don't restore the stacks.
-	    pop pop
-	  } ifelse stop
-	} {
-	  pop pop end
-	} ifelse
+	% Stack: <template> <proc> <scratch> <category> proc
+	exch pop		% pop the category
+	exec end
 } bind def
 /resourceforall {	% <template> <proc> <scratch> <category> resourceforall1 -
 	//resourceforall1 exec		% see above
@@ -243,18 +222,80 @@ odef
 % Define the system parameters used for the Generic implementation of
 % ResourceFileName.
 systemdict begin
+
+%     - .default_resource_dir <string>
+/.default_resource_dir {
+  .file_name_parent .file_name_directory_separator concatstrings
+  (Resource) concatstrings
+  /LIBPATH .systemvar {
+    dup .file_name_current eq {
+      pop
+    } {
+      1 index false .file_name_combine {
+        exch pop exit
+      } {
+        pop pop
+      } ifelse
+    } ifelse
+  } forall
+} bind def
+
+%  <path> <name> <string> .resource_dir_name <path> <name> <string>
+/.resource_dir_name
+{  systemdict 2 index .knownget {
+     exch pop
+     systemdict 1 index undef
+   } {
+     dup () ne {
+     .file_name_directory_separator concatstrings
+    } if
+    2 index exch false .file_name_combine not {
+      (Error: .default_resource_dir returned ) print exch print ( that can't combine with ) print =
+      /.default_resource_dir /configurationerror .signalerror
+    } if
+  } ifelse
+} bind def
+
 currentdict /pssystemparams known not {
   /pssystemparams 10 dict readonly def
 } if
 pssystemparams begin
-  /FontResourceDir (/Resource/Font/) readonly .forcedef	% pssys'params is r-o
-  /GenericResourceDir (/Resource/) readonly .forcedef	% pssys'params is r-o
-  /GenericResourcePathSep (/) readonly .forcedef	% pssys'params is r-o
+  .default_resource_dir
+  /FontResourceDir (Font) .resource_dir_name
+     readonly .forcedef	% pssys'params is r-o
+  /GenericResourceDir () .resource_dir_name
+     readonly .forcedef	% pssys'params is r-o
+  pop % .default_resource_dir
+  /GenericResourcePathSep
+  	.file_name_separator readonly .forcedef		% pssys'params is r-o
+  (%diskFontResourceDir) cvn (/Resource/Font/) readonly .forcedef	% pssys'params is r-o
+  (%diskGenericResourceDir) cvn (/Resource/) readonly .forcedef	% pssys'params is r-o
 end
 end
 
+% Check if GenericResourceDir presents in LIBPATH.
+
+% The value of GenericResourceDir must end with directory separator.
+% We use .file_name_combine to check it. 
+% Comments use OpenVMS syntax, because it is the most complicated case.
+(x) pssystemparams /GenericResourcePathSep get
+(y) concatstrings concatstrings dup length              % (x]y) l1
+pssystemparams /GenericResourceDir get dup length exch  % (x]y) l1 l2 (dir)
+3 index true .file_name_combine not {
+  exch
+  (File name ) print print ( cant combine with ) print =
+  /GenericResourceDir cvx /configurationerror signalerror
+} if
+dup length                                              % (x]y) l1 l2 (dir.x]y) l
+4 2 roll add                                            % (x]y) (dir.x]y) l ll
+ne {
+  (GenericResourceDir value does not end with directory separator.\n) =
+  /GenericResourceDir cvx /configurationerror signalerror
+} if
+pop pop
+
 % Define the generic algorithm for computing resource file names.
-/.rfnstring 100 string def
+/.rfnstring 8192 string def
 /.genericrfn		% <key> <scratch> <prefix> .genericrfn <filename>
  { 3 -1 roll //.rfnstring cvs concatstrings exch copy
  } bind def
@@ -294,7 +335,9 @@ end
   2 copy 0 get .stringmatch {
     dup 3 get begin .LocalInstances end 2 index known not {
       .enumerateresource
-    } if
+    } {
+      pop pop
+    } ifelse
   } {
     pop pop
   } ifelse
@@ -339,7 +382,7 @@ end
 	   { /defineresource load /typecheck signalerror
 	   }
 	ifelse
-} bind executeonly		% executeonly to prevent access to .forcedef
+} .bind executeonly		% executeonly to prevent access to .forcedef
 /UndefineResource
 	{  { dup 2 index .knownget
 	      { dup 1 get 1 ge
@@ -391,8 +434,6 @@ end
 	.ResourceFile { closefile 2 -1 true } { pop false } ifelse
 } bind
 /ResourceForAll {
-		% **************** Doesn't present instance groups in
-		% **************** the correct order yet.
 		% Construct a new procedure to hold the arguments.
 		% All objects constructed here must be in local VM to avoid
 		% a possible invalidaccess.
@@ -411,21 +452,76 @@ end
 	//.globalresourceforall {exec} 0 get 3 .localpackedarray cvx
 	.Instances exch cvx {forall} 0 get 1 index 0 get
 	currentdict end 3 .execn begin
-	currentdict /ResourceFileName known {
-		% Finally, do instances stored on files.
-	  dup 0 get 100 string ResourceFileName
-	  dup length 2 index 0 get length sub 3 -1 roll
-	  //.externalresourceforall {exec} 0 get 4 .localpackedarray cvx
-	  100 string {filenameforall} 0 get
-	  currentdict end 2 .execn begin null	% for pop
-	} if pop
+        mark                                             % args [
+        Category .namestring .file_name_separator concatstrings
+        2 index 0 get                                    % args [ (c/) (t)
+        dup length 3 1 roll                              % args [ l (c/) (t)
+        concatstrings                                    % args [ l (c/t)
+	[ 
+	  /LIBPATH .systemvar 2 index
+	  .generate_dir_list_templates                   % args (t) [ l [(pt)]
+	    % also add on the Resources as specified by the GenericResourceDir
+          [ currentsystemparams /GenericResourceDir get]
+	  counttomark 1 add index .generate_dir_list_templates
+            % Resource files on OpenVMS requires a separate template (gs:[dir.*]*)
+          [ currentsystemparams /GenericResourceDir get]
+	  counttomark 1 add index .file_name_separator (*)
+          concatstrings concatstrings .generate_dir_list_templates
+	  ] exch pop
+	{                                                % args [ l (pt)
+	  dup length 2 index sub exch                    % args [ l Lp (pt)
+
+	  {                                              % args [ l Lp (pf)
+	    dup length                                   % args [ l Lp (pf) Lpf
+	    2 index sub                                  % args [ l Lp (pf) Lf
+	    2 index exch                                 % args [ l Lp (pf) Lp Lf
+	    getinterval cvn dup                          % args [ l Lp /n /n
+	    4 2 roll                                     % args [ /n /n l Lp
+	  } //.rfnstring filenameforall
+	  pop                                            % args [ l /n1 /n1 ... /nN /nN l
+	} forall                                         % args [ l /n1 /n1 ... /nN /nN
+	pop
+	.dicttomark % An easy way to exclude duplicates. % args <</n/n>>
+	  % {
+	  { pop } 0 get
+          2 index 2 get { cvs 0 } aload pop 5 index
+          //.externalresourceforall {exec} 0 get
+          % }
+        7 .localpackedarray cvx
+        3 2 roll pop % args
+	{ forall } 0 get
+  	currentdict end 2 .execn begin
 } bind
 /ResourceFileName
-	{ /GenericResourceDir getsystemparam 
-	  Category .namestring concatstrings
-	  /GenericResourcePathSep getsystemparam concatstrings
-	  .genericrfn
-	} bind
+	  {                                             % /in (scr)
+	    exch //.rfnstring cvs                       % (scr) (n)
+            /GenericResourcePathSep getsystemparam exch % (scr) (/) (n)
+            Category .namestring                        % (scr) (/) (n) (c)
+            3 1 roll                                    % (scr) (c) (/) (n)
+	    concatstrings concatstrings                 % (scr) (c/n)
+            /GenericResourceDir getsystemparam .file_name_is_absolute not {
+              /GenericResourceDir getsystemparam exch concatstrings
+	      findlibfile
+	      {                                         % (scr) (p/c/n) file
+	        pop exch copy true                      % (p/c/n) true
+	      } {                                       % (scr) (c/n)
+	        false                                   % (scr) (c/n) false
+	      } ifelse
+	    } {                                         % (scr) (c/n)
+	      false                                     % (scr) (c/n) false
+	    } ifelse
+	    not {                                       % (scr) (c/n)
+              /GenericResourceDir getsystemparam        % (scr) (c/n) (d/)
+              dup length exch                           % (scr) (c/n) Ld (d/)
+              3 index copy pop                          % (scr') (c/n) Ld
+              1 index length                            % (scr') (c/n) Ld Lcn
+              3 index 3 copy pop                        % (scr') (c/n) Ld Lcn (scr') Ld Lcn
+              getinterval                               % (scr') (c/n) Ld Lcn (scr[Ld:Lcn])
+              4 3 roll exch                             % (scr') Ld Lcn (c/n) (scr[Ld:Lcn])
+              copy pop                                  % (scr'') Ld Lcn
+              add 0 exch getinterval                    % (scr''[0:Ld+Lcn])
+	    } if
+	  } bind
 
 		% Additional entries
 
@@ -492,21 +588,39 @@ end
 	 ifelse
 	} bind
 /.ResourceFile
-	{ currentdict /ResourceFileName known
-	   { mark 1 index 100 string { ResourceFileName }
-	     .internalstopped
-	      { cleartomark false }
-	      { exch pop findlibfile
-		 { exch pop exch pop true }
-		 { pop false }
-		ifelse
-	      }
-	     ifelse
-	   }
-	   { false }
-	  ifelse
+        {
+          Category //.rfnstring cvs length                      % key l
+          dup //.rfnstring dup length 2 index sub               % key l l (buf) L-l
+          3 2 roll exch getinterval                             % key l ()
+          .file_name_directory_separator exch copy length add   % key l1
+          dup //.rfnstring dup length 2 index sub               % key l1 l1 (buf) L-l
+          3 2 roll exch getinterval                             % key l1 ()
+          2 index exch cvs length add                           % key l2
+          //.rfnstring exch 0 exch getinterval                  % key (relative_path)
+          .libfile {
+            exch pop true
+          } {
+            pop
+            currentdict /ResourceFileName known {
+	      mark 1 index //.rfnstring { ResourceFileName } .internalstopped {
+	        cleartomark false
+	      } {
+	        dup status {
+	          pop pop pop pop
+	          (r) file
+	          exch pop exch pop true
+	        } {
+	          cleartomark false
+	        } ifelse
+	      } ifelse
+	     } {
+	       pop false
+	     } ifelse
+          } ifelse
 	} bind
 
+
+
 .dicttomark
 /Category defineresource pop
 
@@ -884,7 +998,7 @@ end				% level2dict
   systemdict /ColorRendering .knownget {
     /ColorRendering exch /ProcSet defineresource pop
     systemdict /ColorRendering undef
-    /Default currentcolorrendering /ColorRendering defineresource pop
+    /DefaultColorRendering currentcolorrendering /ColorRendering defineresource pop
   } if
 	% ColorSpace resources
   systemdict /CIEsRGB .knownget {
@@ -927,3 +1041,8 @@ end				% level2dict
 	% clean up
   systemdict /.fixresources undef
 } bind def
+
+%% Replace 1 (gs_resmp.ps)
+(gs_resmp.ps)  dup runlibfile VMDEBUG
+%% Replace 1 (gs_resst.ps)
+(gs_resst.ps)  dup runlibfile VMDEBUG

+ 522 - 0
sys/lib/ghostscript/gs_resmp.ps

@@ -0,0 +1,522 @@
+%    Copyright (C) 2000 artofcode LLC.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_resmp.ps,v 1.11 2004/10/25 15:11:37 igor Exp $
+% A procset to redefine a resource category with a resource map.
+
+% Public entries :
+ 
+% Redefine - a procedure for redefining a resource category with a map.
+%    Methods for interpreting the resource map to be provided by client 
+%    in the argument dictionary.
+%
+%    Note that the procedure Redefine is idempotential :
+%    consequtive calls to it will not replace the category methods,
+%    but will merge resource maps. If an interleaving redefinition
+%    needs to cancel the idempotentity, it must remove the entry
+%    /.IsRedefinedWithMap from the category dictionary.
+
+% MakeResourceEnumerator - this procedure is useful for
+%    redefining any category. It provides a proper order of instances
+%    and proper stacks during resourceforall.
+
+% BindWithCurrentdict - a procedure for generating temporary procedures 
+%    from templates, binding them with a local dictionary.
+
+% execstack_lookup - a procedure for communicating through the execution stack.
+%    It allows for a callee to get an information from an indirect caller.
+
+% The procedures are designed for exeution witout putting
+% the procset instance onto the dictionary stack.
+
+languagelevel 2 .setlanguagelevel
+currentglobal true setglobal
+
+/MappedCategoryRedefiner 10 dict begin % The procset.
+
+currentpacking false setpacking
+
+/InstanceEnumeratorPattern   %  - InstanceEnumeratorPattern ...
+{  
+  % This is a pattern for enumeration procedure to be built dynamically,
+  % applying BindWithCurrentdict with a temporary dictionary.
+  % The following names will be replaced with specific objects
+  % during BindWithCurrentdict :
+  % en_local_dict - a dictionary for storing the local integer variable 'status'.
+  % scr - the scratch string argument of resourceforall;
+  % proc - the procedure argument of resourceforall;
+  % InstancesStatus - a dictionary that maps resource instance names to their status value;
+  % Category - the category to be enumerated.
+
+  % When this procedure is called from ResourceForAll, the category is the current dictionary.
+  % We remove it from the dictionary stack before performing the enumeration
+  % to provide the <proc> to write to the underlying dictionary,
+  % and put it back after the enumeration is completed.
+  end
+  { 
+    0 1 2 {
+      en_local_dict exch /status exch put
+      InstancesStatus {                                            
+        en_local_dict /status get eq {
+          scr cvs                           % ... (Font)
+          proc exec                         %
+        } {
+          pop
+        } ifelse                            % ...
+      } forall
+    } for                                   % ...
+  } stopped
+  Category begin
+  { stop } if
+} bind def
+
+% An auxiliary proc for BindWithCurrentdict :
+/.BindAux    % <proc> BindAux <proc>
+{ 0 exec
+} bind def
+
+setpacking
+
+/BindWithCurrentdict     % <proc> BindWithCurrentdict <proc>
+{  
+  % Make a copy of the given procedure, binding in the values of all names
+  % defined in currentdict.
+  % Caution1 : this code cannot handle procedures that were already
+  %            bound recursively.
+  % Caution2 : this code don't bind packedarrays. This was done
+  %            intentionally for a termination of the procedure tree.
+
+  dup length array copy
+  dup length 1 sub -1 0 {                      
+    2 copy get                            % {precopy} i {elem}
+    dup dup type /arraytype eq exch xcheck and {
+                                          % {precopy} i {elem}
+      //.BindAux exec                     % {precopy} i {elem_copy}
+      2 index 3 1 roll put                % {precopy}
+    } {
+      dup dup type /nametype eq exch xcheck and {
+                                          % {precopy} i {elem}
+        currentdict exch .knownget {            
+          2 index 3 1 roll put            % {precopy}
+        } {                                            
+          pop
+        } ifelse
+      } {
+        pop pop
+      } ifelse
+    } ifelse                              % {precopy}
+  } for                                   % {copy}
+  cvx
+} bind def
+
+//.BindAux 0 //BindWithCurrentdict put   % bind the recursive call in 'Bind'.
+
+/MakeResourceEnumerator   % <proc> <scr> <InstancesStatus> MakeResourceEnumerator <Enumerator>
+{
+  % Build the enumeration procedure :
+
+  % Since the resourceforall procedure may leave values on the operand stack,
+  % we cannot simply store the enumerator's local data on the stack.
+  % We also cannot use a static dictionary to store local variables,
+  % because of possible recursion in the resourceforall procedure.
+  % To work around this, we create a copy of the enumeration procedure and
+  % bind it dynamically with a temporary dictionary, which contains
+  % local variables for the currently executing instance of resourceforall.
+
+  currentdict                    % Category
+  6 dict begin % the temporary dictionary
+    /Category exch def           %
+    /InstancesStatus exch def
+    /scr exch def
+    /proc exch def
+    /en_local_dict currentdict def
+    //InstanceEnumeratorPattern //BindWithCurrentdict exec     % Enumerator
+    /status 0 def % variable for the current status to enumerate - do not bind with it !
+  end
+
+} bind def
+
+/execstack_lookup     % <object> execstack_lookup <object1>
+                      % <object> execstack_lookup null
+{ % Checks whether execution stack contains a procedure starting with <object>,
+  % and retrives the 2nd element of the procedure,
+  % or null if the procedure was not found.
+  %
+  % Since 'execstack' actually renders subarrays of procedures,
+  % the pattern for recognition must be like this :
+  %
+  %   { <object> <object1>
+  %     CallSomething
+  %   } loop
+  %
+  % The solution with 'loop' depends on how GS implements cycles,
+  % so it must not appear in documents, which are required to be interpreter independent.
+  % Any other type of cycles are also acceptable.
+  % If no repitition is really needed, just insert 'exit' into its body.
+  % If <object> <object1> are not needed for the caller, insert "pop pop" after them.
+  % If <object1> is really unuseful, the pattern may be simplified :
+  %
+  %   { <object> pop
+  %     CallSomething
+  %     exit
+  %   } loop
+  %
+  % It will retrieve 'pop' or 'null'.
+  %
+  % Note that 2 topmost execstack elements are the execstack_lookup procedure and its caller.
+  % We don't check them.
+
+  currentglobal false setglobal                    % <object> bGlobal
+  countexecstack array execstack                   % <object> bGlobal [execstack]
+  dup null exch                                    % <object> bGlobal [execstack] null [execstack]
+  length 3 sub -1 0 {                              % <object> bGlobal [execstack] null i
+    2 index exch get                               % <object> bGlobal [execstack] null proc
+    dup type dup /packedarraytype eq exch /arraytype eq or {
+      dup length 1 gt {                            % <object> bGlobal [execstack] null proc
+        dup 0 get                                  % <object> bGlobal [execstack] null proc elem0
+        5 index eq {                               % <object> bGlobal [execstack] null proc
+          1 get                                    % <object> bGlobal [execstack] null object1
+          exch pop exit                            % <object> bGlobal [execstack] object1
+        } {
+          pop
+        } ifelse
+      } {
+        pop                                        % <object> bGlobal [execstack] false
+      } ifelse
+    } {
+      pop                                          % <object> bGlobal [execstack] false
+    } ifelse
+  } for                                            % <object> bGlobal [execstack] bResult
+  exch pop exch setglobal exch pop                 % bResult
+} bind def
+
+currentpacking false setpacking
+/MethodsToRedefine 5 dict begin
+
+    % Procedures in this dictionary really are patterns for new category methods.
+    % The following names will be replaced with specific objects during BindWithCurrentdict :
+    %   .map - the map dictionary;
+    %   DefineResource, ResourceStatus, ResourceFileName, FindResource, ResourceForAll 
+    %        - procedures from the original resource category.
+
+    /FindResource  % <Name> FindResource <dict>
+    { RESMPDEBUG { (resmp FindResource beg ) print dup = } if
+      dup ResourceStatus exec {
+        pop 2 lt
+      } {
+        false
+      } ifelse                             % bInVirtualMemory
+      { FindResource exec
+      } {
+        dup dup .map exch .knownget {      % /Name /Name <<record>>
+          dup dup /RecordVirtualMethods get /IsActive get exec {
+            1 index .getvminstance {       % /Name /Name <<record>> holder
+              1 get 1 eq
+            } {
+              true
+            } ifelse                       % /Name /Name <<record>> bStatusIs1
+            4 1 roll                       % bStatusIs1 /Name /Name <<record>>
+            dup /RecordVirtualMethods get /MakeInstance get exec
+                                           % bStatusIs1 /Name /Name Instance size
+            5 1 roll                       % size bStatusIs1 /Name /Name Instance
+            DefineResource exec            % size bStatusIs1 /Name Instance
+            % Make ResourceStatus to return correct values for this instance :
+            % Hack: we replace status values in the instance holder :
+            exch .getvminstance pop        % size bStatusIs1 Instance holder
+            dup 5 -1 roll 2 exch put       % bStatusIs1 Instance holder
+            3 2 roll {                     % Instance holder
+              1 1 put                      % Instance
+            } {
+              pop
+            } ifelse                       % Instance
+          } {                              % /Name /Name <<record>>
+            pop pop FindResource exec            
+          } ifelse
+        } {                                % /Name /Name
+          pop FindResource exec            
+        } ifelse
+      } ifelse
+      RESMPDEBUG { (resmp FindResource end) = } if
+    } bind def
+
+    /ResourceStatus   % <Name> ResourceStatus <status> <size> true
+                      % <Name> ResourceStatus false
+    { RESMPDEBUG { (resmp ResourceStatus beg ) print dup == } if
+      dup ResourceStatus exec {            % /Name status size
+        1 index 2 lt {
+          % In VM - return with it.
+          3 2 roll pop true
+        } {
+          % Not in VM.
+          exch pop exch                    % size /Name
+          dup .map exch .knownget {        % size /Name <<record>>
+            dup dup /RecordVirtualMethods get /IsActive get exec {
+              3 2 roll pop                 % /Name <<record>>
+              dup /RecordVirtualMethods get /GetSize get exec 2 exch true
+            } {                            % size /Name <<record>>
+              pop pop 2 exch true
+            } ifelse
+          } {                              % size /Name
+            pop 2 exch true
+          } ifelse
+        } ifelse
+      } {                                  % /Name
+        dup .map exch .knownget {          % /Name <<record>>
+          dup dup /RecordVirtualMethods get /IsActive get exec {
+            dup /RecordVirtualMethods get /GetSize get exec 2 exch true
+          } {                              % /Name <<record>>
+            pop pop false
+          } ifelse
+        } {                                % /Name
+          pop false
+        } ifelse
+      } ifelse
+      RESMPDEBUG { (resmp ResourceStatus end) = } if
+    } bind def
+
+    /ResourceFileName  % <Name> <scratch> ResourceFileName <string>
+    { RESMPDEBUG { (resmp ResourceFileName beg ) print 1 index = } if
+      exch                                                    % (scratch) /Name
+      .map 1 index .knownget {                                % (scratch) /Name <<record>>
+      	RESMPDEBUG { (resmp ResourceFileName : have a map record.) = } if
+        dup dup /RecordVirtualMethods get /IsActive get exec {
+          RESMPDEBUG { (resmp ResourceFileName : record is active.) = } if
+          dup /RecordVirtualMethods get /GetFilePath get exec % (string)
+          RESMPDEBUG { (resmp ResourceFileName : retrieving ) print dup = } if
+        } {                                                   % (scratch) /Name <<record>>
+          RESMPDEBUG { (resmp ResourceFileName : record is NOT active.) = } if
+          pop exch ResourceFileName exec
+          RESMPDEBUG { (resmp ResourceFileName : retrieving ) print dup = } if
+        } ifelse
+      } { 
+        RESMPDEBUG { (resmp ResourceFileName : have NO map record.) = } if
+        exch ResourceFileName exec
+        RESMPDEBUG { (resmp ResourceFileName : retrieving ) print dup = } if
+      } ifelse
+      RESMPDEBUG { (resmp ResourceFileName end) = } if
+    } bind def
+
+    /ResourceForAll  % <template> <proc> <scratch> ResourceForAll -
+    { RESMPDEBUG { (resmp ResourceForAll beg ) print 2 index = } if
+      % Create InstancesStatus dictionary :
+      20 dict % IS - Instances Status
+      4 1 roll                            % <<IS>> (templ) {proc} (sctarch)
+                                          % <<IS>> bOrder (templ) {proc} (sctarch)
+      % Check if we are under another ResourceForAll :
+      /.DisableResourceOrdering //execstack_lookup exec null eq 4 1 roll
+
+      % Put underlying resources to the InstancesStatus dictionary :
+      currentdict % the category
+      begin % ResourceForAll removes it locally.
+      2 index
+      { cvn                               % <<IS>> bOrder (templ) {proc} (sctarch) /Name
+        4 index {
+          dup ResourceStatus exec {pop 6 index 3 1 roll put} {pop} ifelse
+        } {
+          5 index exch 2 put % Don't need the ordering, put '2' as a scratch.
+        } ifelse
+      }
+      2 index ResourceForAll exec         % <<IS>> bOrder (templ) {proc} (sctarch)
+      4 3 roll pop                        % <<IS>> (templ) {proc} (sctarch)
+      end
+
+      % Put .map entries to the InstancesStatus dictionary :
+      4 -1 roll begin                     % (templ) {proc} (sctarch)
+      .map {                              % (templ) {proc} (sctarch) /Name record
+         dup dup /RecordVirtualMethods get /IsActive get exec {
+           pop                            % (templ) {proc} (sctarch) /Name
+           dup currentdict exch known {
+             pop
+           } {
+             dup 2 index cvs              % (templ) {proc} (sctarch) /Name (Name)
+             4 index .stringmatch {       % (templ) {proc} (sctarch) /Name
+               2 def % It is not in VM.
+             } {
+               pop
+             } ifelse
+           } ifelse
+        } {                               % (templ) {proc} (sctarch) /Name record
+          pop pop
+        } ifelse
+      } forall                            % (templ) {proc} (sctarch)
+
+      % prepare stacks for the enumeration :
+      3 2 roll pop                        % {proc} (sctarch)
+      currentdict end                     % {proc} (scratch) <<IS>>
+
+      % Make the enumerator and apply it :
+      //MakeResourceEnumerator exec exec
+      RESMPDEBUG { (resmp ResourceForAll end)= } if
+    } bind def
+
+    /GetCIDSystemInfoFromMap   % <Name> GetCIDSystemInfoFromMap <Name>
+                               % <Name> GetCIDSystemInfoFromMap <dict>
+    { RESMPDEBUG { (resmp GetCIDSystemInfoFromMap beg ) print dup = } if
+      % This is a special function for communicating with GetCIDSystemInfo in gs_cidcm.ps .
+      dup .map exch .knownget {
+        RESMPDEBUG { (resmp GetCIDSystemInfoFromMap : have a map record.) = } if
+        dup /RecordVirtualMethods get /GetCSI get exec
+        dup null ne {
+          RESMPDEBUG { (resmp GetCIDSystemInfoFromMap : retrieving a dict.) = } if
+          exch
+        } if
+        pop
+      } if
+      RESMPDEBUG { (resmp GetCIDSystemInfoFromMap end) = } if
+    } bind def
+
+currentdict end def
+setpacking
+
+/Redefine     % <OptionsDict> Redefine -
+{ % Before calling this proc, the OptionsDict must specify options for
+  % the catregory to be redefined :
+  % CategoryName - a name of category to redefine;
+  % MapFileName - a string for the resource map file name;
+  % VerifyMap - a procedure :
+  %   <raw_map> VerifyMap -
+  %   - checks the map for consistency
+  % PreprocessRecord  - a procedure :
+  %   <map> <Name> <raw_record> PreprocessRecord <map> <Name> <record> true
+  %   <map> <Name> <raw_record> PreprocessRecord <map> <Name> <raw_record> false
+  %   - converts a map record into a dictionary;
+  %   It must add RecordVirtualMethods dictionary to the record :
+  %     MakeInstance - a procedure :
+  %         <Name> <record> MakeInstance <Name> <Instance> <size>
+  %         - converts the record to resource instance;
+  %     GetFilePath - a procedure for ResourceFileName :
+  %         <scratch> <Name> <record> GetFilePath <filepath>
+  %     GetSize - a procedure for ResourceStatus :
+  %         <Name> <record> GetSize <size>
+  %     GetCSI - a procedure for obtaining CIDSystemInfo dictionary from the record :
+  %         <record> GetCSI <CSI>
+  %         <record> GetCSI null
+  %     IsActive - a procedure for skipping records depending on the current device :
+  %         <record> IsActive <bool>
+  %     Also it is allowed to contain additional entries for client's needs.
+  % The OptionsDict is also used for storing some local variables.
+
+  % If a category is being redefined several times with this function,
+  % each redefinition must either use an unique map file,
+  % or the map file should be scanned by the last redefinition
+  % (and must be defined in the last one with /MapFileName).
+  % This happens so because we must accumulate all variants of
+  % methods before scanning the map. We would like to delay
+  % the scanning until all redefinitions are done, but it requires
+  % to implement a queue of "refinish" methods and execute it
+  % at very end of the prelude.
+
+  begin % OptionsDict
+  CategoryName /Category findresource /OldCategory exch def
+  OldCategory /.IsRedefinedWithMap known {
+    % Already redefined with map - don't redefine, but enhance the map.
+    OldCategory /NewCategory exch def
+  } {
+    % Redefine with a new category instance.
+    OldCategory dup length dict 
+    dup /.PreprocessRecord 4 dict put
+    copy /NewCategory exch def
+  } ifelse
+
+  % Provide the 'or' logic for PreprocessRecord,
+  % to allow different record types to be mixed in a single map file.
+  % We do this with building a dictionary of PreprocessRecord procedures,
+  % which come from different calls to Redefine :
+  NewCategory /.PreprocessRecord get dup length % <<pr>> l  
+  currentdict /PreprocessRecord get .growput
+
+  currentdict /MapFileName known {
+    MapFileName .libfile {
+      1 dict begin
+      /; {} def
+      mark exch cvx exec .dicttomark           % <<map>>
+      end
+      dup VerifyMap                            % <<map>>
+    } {
+      QUIET not {
+        currentdict /IsMapFileOptional .knownget not { false } if not {
+          (Warning: the map file ) print dup =string cvs print ( was not found.) =
+        } if
+      } if
+      pop 0 dict                               % <<map>>
+    } ifelse
+  } {
+    currentdict /.map .knownget not { 
+      0 dict                                   % <<map>>
+    } if
+  } ifelse
+
+  % Preprocess entries :
+  dup NewCategory /.PreprocessRecord get       % <<map>> <<map>> <<pr>>
+  3 1 roll {                                   % <<pr>> <<map>> /Name raw_record
+    false 3 1 roll                             % <<pr>> <<map>> false /Name raw_record 
+    4 index {                                  % <<pr>> <<map>> false /Name raw_record i {pr}
+      exch pop                                 % <<pr>> <<map>> false /Name raw_record {pr}
+      exec {                                   % <<pr>> <<map>> false /Name record
+        3 -1 roll pop true 3 1 roll            % <<pr>> <<map>> true /Name record
+        exit
+      } if                                     % <<pr>> <<map>> false /Name raw_record
+    } forall
+    3 2 roll {                                 % <<pr>> <<map>> /Name record
+      2 index 3 1 roll put                     % <<pr>> <<map>>
+    } {
+      exch                                     % <<pr>> <<map>> raw_record /Name
+      (Incorrect record ) print =string cvs print ( of the map file ) print MapFileName =string cvs print (.) =
+      end % Pops OptionsDict from dstack.
+      pop pop pop                              %
+      /Redefine cvx /undefinedresource signalerror
+    } ifelse
+  } forall                                     % <<pr>> <<map>>
+  exch pop                                     % <<map>>
+
+
+  % Add the map :
+  OldCategory /.IsRedefinedWithMap known {     % <<map>>
+    % Just add to the old map :
+    OldCategory /.map get copy pop             %
+  } {                                          % <<map>>
+    % Store the map to both the category and OptionsDict :
+    dup NewCategory exch /.map exch put
+    /.map exch def                             %
+  } ifelse
+  OldCategory /.IsRedefinedWithMap known not {
+    % Copy old methods to OptionsDict :
+    [ /DefineResource /ResourceStatus /ResourceFileName 
+      /FindResource /ResourceForAll
+    ] {
+      dup OldCategory exch get def
+    } forall
+    
+    % Build new methods :
+    //MethodsToRedefine {
+      //BindWithCurrentdict exec NewCategory 3 1 roll put  
+    } forall
+    CategoryName /CIDFont ne {
+      NewCategory /GetCIDSystemInfoFromMap undef
+      % This is some ugly, sorry.
+    } if
+    % Redefine the category :
+    NewCategory /.IsRedefinedWithMap true put
+    CategoryName NewCategory /Category defineresource pop
+  } if
+  end % OptionsDict
+} bind executeonly def
+
+currentdict /PutPreprocessRecord .undef
+
+currentdict end
+/ProcSet defineresource pop
+
+setglobal .setlanguagelevel

+ 156 - 0
sys/lib/ghostscript/gs_resst.ps

@@ -0,0 +1,156 @@
+%    Copyright (C) 2000 artofcode LLC.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_resst.ps,v 1.3 2003/08/08 18:45:05 ray Exp $
+% Redefine generic category with static resource table.
+
+languagelevel 2 .setlanguagelevel
+
+15 dict begin    % a temporary dictionary for local binding.
+
+/sep (/) def %  The %static%  device uses platform independent paths.
+
+/tempstring 8192 string def
+
+/IsMyRecord      % <raw_record> IsMyRecord <raw_record> bool
+{ dup type /dicttype eq { dup /StaticFilePos known } { false } ifelse
+} bind def
+
+/append_string    % <scratch> <index> <string> append_string <scratch> <index> 
+{
+   dup length 3 index 3 index 2 index getinterval   % (scratch) index (string) l (scr_substr)
+   3 2 roll exch copy pop add                       % (scratch) index'
+} bind def
+
+/StaticResourceRecordVirtualMethods 4 dict begin
+
+  /GetFilePath    % <scratch> <Name> <record> GetFilePath <filepath>
+  { pop exch                                                % /Name (scratch)
+    (%static%) dup length exch 2 index copy pop             % /Name (scratch) l
+    //sep //append_string exec                              % /Name (scratch) l
+    Category //tempstring cvs //append_string exec          % /Name (scratch) l
+    //sep //append_string exec                              % /Name (scratch) l
+    3 2 roll //tempstring cvs                               % (scratch) l (Name)
+    //append_string exec                                    % (scratch) l
+    0 exch getinterval                                      % (path)
+  } bind def
+
+  /MakeInstance   % <Name> <record> MakeInstance <Name> <Instance> <size>
+  {
+    begin
+      STRESDEBUG { (Loading a static resource ) print dup = } if
+      8192 string 2 index 2 index //GetFilePath exec
+      (r) file run
+      STRESDEBUG { (Completed loading the static resource ) print dup = } if
+      StaticFileEnd StaticFilePos sub
+    end
+    1 index Category findresource
+    exch
+  } bind def
+
+  /GetSize        % <Name> <record> GetSize <size>
+  {
+    % WARNING : this retrives file sise rather than VM size
+    begin
+    pop
+    StaticFileEnd StaticFilePos sub
+    end
+  } bind def
+
+  /IsActive       % <record> IsActive <bool>
+  { pop true
+  } bind def
+
+currentdict end def
+
+mark
+/MappedCategoryRedefiner /ProcSet findresource begin
+
+/.StaticResourcesBeg % <end_string> <no_of_resources> <category_name> .StaticResourcesBeg <category_name>
+%     Puts .map dictionary to dstack.
+{
+  STRESDEBUG { (Starting static resources for category ) print dup = } if
+  dup /Category resourcestatus {
+    pop pop exch dict begin exch pop
+  } {
+    STRESDEBUG { (Skipping the resources because the category isn't defined.) = } if
+    pop pop .skipeof
+  } ifelse
+} bind
+
+/.StaticResourcesEnd % <category_name> .StaticResourcesEnd -
+%     Removes .map dictionary from dstack.
+{
+  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>
+    % Save it for garbager and for debug purpose :
+    dup systemdict exch /.io_static_root exch put          % /CatName <map> <map> <dir>
+    dup .setup_io_static                                   % /CatName <map> <map> <dir>
+  } if                                                     % /CatName <map> <map> <dir>
+  exch 3 index exch put                                    % /CatName <map>
+  14 dict begin
+    /.map exch def                                         % /CatName
+    /CategoryName exch def                                 %
+    /IsMapFileOptional true def
+    /VerifyMap  { pop } bind def
+    /PreprocessRecord  % <map> <Name> <raw_record> PreprocessRecord <map> <Name> <record> <bool>
+    { //IsMyRecord exec dup {
+        pop dup /RecordVirtualMethods //StaticResourceRecordVirtualMethods put
+        true
+      } if
+    } bind def
+  currentdict end
+  //Redefine exec
+} bind
+
+end  % MappedCategoryRedefiner
+end  % the temporary dictionary for local binding.
+
+/.BeginResource  % <instance_name> BeginResource <instance_name> 
+%     Puts a record dictionary to dstack.
+{
+  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 .
+    4 dict begin
+    /StaticFilePos exch def    
+  } {
+    % We are in COMPILE_INITS=0 .
+    pop
+  } ifelse
+  (%END_RESOURCE) .skipeof
+} bind
+
+/.EndResource  % <instance_name> EndResource -
+%     Removes a record dictionary from dstack.
+{
+  currentdict /StaticFilePos known {
+    /StaticFileEnd currentfile fileposition
+    (.EndResource) length sub
+    def
+    STRESDEBUG { ( from position ) print StaticFilePos =string cvs print ( to position ) print StaticFileEnd = } if
+    currentdict end def
+  } {
+    pop
+    STRESDEBUG { ( ignored with COMPILE_INITS=0. ) = } if
+  } ifelse
+} bind
+
+.dicttomark /StaticCategoryRedefiner exch /ProcSet defineresource pop
+
+.setlanguagelevel

+ 267 - 0
sys/lib/ghostscript/gs_sepr.ps

@@ -0,0 +1,267 @@
+%    Copyright (C) 2001, 2002 Aladdin Enterprises.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_sepr.ps,v 1.3 2003/04/26 18:40:16 dan Exp $
+% Separation color space method dictionary
+
+
+% verify that Separation color spaces are supported
+/.setseparationspace where
+  { pop }
+  { currentfile closefile }
+ifelse
+
+.currentglobal true .setglobal
+.cspace_util begin
+
+
+%
+%   <c1>  <array>   apply_sepr_tint_xform   <c1>' ... <cn>'  <array>
+%
+% Apply the tint transform for a Separation color space color intensity
+% value.
+%
+/apply_sepr_tint_xform
+  {
+    exch //bound_0_1 exec
+    mark exch 2 index 3 get exec
+    counttomark 2 add -2 roll pop
+  }
+bind def
+
+
+%
+%  <cspace_array>   build_tintxform_function   <cspace_array>  <proc>
+%
+% Convert a tint transformation into a function, if possible. If this is
+% successful, <proc> will be a function procedure (a two-element,
+% execute-only, executable array whose first element is the function
+% data structure and whose second element is the operator %execfunction.
+% If it is not successful, <proc> will be the same as the tint transform
+% in <cspace_array>.
+%
+% Note that, for PDF files, the tint transform will likely already be a
+% function-array. In this case, <proc> will be this array, and thus will
+% also be identical to the original tint transform.
+%
+% This procedure is used for both Separation and DeviceN color spaces.
+%
+/build_tintxform_function
+  {
+    dup 3 get dup .isencapfunction not
+      {
+        % Try a FunctionType 4 function first; build the function dictionary
+        % in local VM.
+        .currentglobal exch //false .setglobal
+	% Make the dictionary a couple of elements large in case this fails
+	% and we need the dictionary to build a sampled function.
+        6 dict begin
+        /FunctionType 4 def
+        /Function exch def
+        /Domain 2 index //.cs_get_range exec def
+        /Range 2 index 2 get //.cs_get_range exec def
+        currentdict end
+        { .buildfunction }
+        .internalstopped	% If .buildfunction fails then not type 4 func.
+        {			% If not then try building a sampled (type 0) func.
+	  % We are using the dictionary which was created before .buildfunction
+          dup /Order 3 put
+          dup /BitsPerSample 16 put
+          { .buildsampledfunction }
+          .internalstopped	% If .buildsamplefunction fails then invalid func.
+          {			% Failed - Create a dummy tint transform function
+	    % We are using the dictionary which was created before .buildfunction
+    	    dup /Function {} put    % Replace invalid tint transform with dummy
+    	    .buildfunction
+    	  }
+          if		% Check status from .buildsamplefunction/.internalstopped
+	}
+	if		% check status from .buildfunction/.intermalstopped
+        % restore the VM mode
+        exch .setglobal
+      }
+    if
+  }
+bind def
+
+%
+%  <array1>  <array2>   converttinttransform   <array1>  <array2'>
+%
+% Convert a Separation/DeviceN color space to use a function as a tint
+% transformation, if this is possible. Possible outcomes are:
+%
+%  1. The tint transform already is a function, or is a procedure that
+%     cannot be converted to a function. In either case, <array2> is
+%     left unchanged (<array2> == <array2'>).
+%
+%  2. The tint transform is not already a function but can be converted
+%     to a function, and <array1> != <array2>. In this case, <array2>
+%     is modified directly.
+%
+%  3. The tint transform is not already a function but can be converted
+%     to a function, and <array1> == <array2>. In this case, <array2>
+%     is copied, and the copy is modified (i.e., after the operation
+%     <array1> != <array2>
+%
+% This slightly complex approach avoids creating an extra color space
+% array unnecessarily.
+%
+/converttinttransform
+  {
+    % convert the tint transform to a fucntion
+    //build_tintxform_function exec
+
+    % see if anything needs to be modified
+    1 index 3 get 2 copy eq
+      { pop pop }
+      {
+        pop
+
+        % see if the color space must be copied
+        3 copy pop eq
+          {
+            % copy the array into local VM
+            .currentglobal //false .setglobal
+            3 -1 roll dup length array copy 3 1 roll
+            .setglobal
+          }
+        if
+        1 index exch 3 exch put
+      }
+    ifelse
+  }
+bind def
+
+
+colorspacedict
+/Separation
+  mark
+    /cs_potential_indexed_base true
+    /cs_potential_pattern_base true
+    /cs_potential_alternate false
+    /cs_potential_icc_alternate false
+    /cs_get_ncomps //ncomps_1
+    /cs_get_range //get_range_1
+    /cs_get_default_color { pop 1 } bind
+
+    /cs_get_currentgray
+      { //apply_sepr_tint_xform exec 2 get //.cs_get_currentgray exec }
+    bind
+    /cs_get_currentrgb
+      { //apply_sepr_tint_xform exec 2 get //.cs_get_currentrgb exec }
+    bind
+    /cs_get_currentcmyk
+      { //apply_sepr_tint_xform exec 2 get //.cs_get_currentcmyk exec }
+    bind
+
+    % a lot of validation is done by the cs_validate method
+    /cs_validate
+      {
+        //check_array exec
+        dup 1 get type dup /nametype ne exch /stringtype ne and
+          //setcspace_typecheck
+        if
+        dup 2 get //.cs_validate exec //.cs_potential_alternate exec not
+          //setcspace_rangecheck
+        if
+        dup 3 get //check_array exec xcheck not
+          //setcspace_typecheck
+        if
+      }
+    bind
+
+    % substitute the base space if appropriate
+    /cs_substitute
+      {
+        dup 2 get //.cs_substitute exec 2 copy eq
+          { pop pop dup }
+          {
+            % retain only the new alternate space
+            exch pop
+
+            % build all new structures in local VM
+            .currentglobal 3 1 roll //false .setglobal
+
+            % construct a new array and insert the new base color space
+            1 index dup length array copy dup 2 4 -1 roll put
+
+            % restore VM mode
+            3 -1 roll .setglobal
+          }
+        ifelse
+      }
+    bind
+
+    %
+    % The Ghostscript interpreter works better when tinttransform procedures
+    % are translated into functions. Attempt to do that here.
+    %
+    /cs_prepare //converttinttransform
+
+    %
+    % Install the current color space.
+    %
+    % The current Ghostscript color space implementation requires that
+    % color spaces that provide a base or alternative color space set
+    % that base/alternative color space to be the current color space
+    % before attempting to set the original color space.
+    %
+    /cs_install
+      {
+        % save the current color space
+        currentcolorspace
+
+        % set the base color space as the current color space
+        1 index 2 get //forcesetcolorspace
+
+        % set the indexed color space; restore the earlier space on error
+        mark 2 index
+          { .setseparationspace }
+        stopped
+          { cleartomark setcolorspace stop }
+          { pop pop pop }
+        ifelse
+      }
+    bind
+
+    /cs_prepare_color //validate_1
+
+    %
+    % If a Separation color space is not supported in native mode by
+    % the current process color model, Adobe implementations will always
+    % execute the tint transform procedure when setcolor is invoked.
+    % Ghostscript may have turned this transform into a sampled function,
+    % and even if this is not the case, will have sampled the transform
+    % when the color space is first set. Some applications may depend
+    % on the Adobe behavior, so we implement it via the
+    % cs_complete_setcolor method.
+    %
+    /cs_complete_setcolor
+      {
+        .usealternate
+          {
+            currentcolor exch 3 get exec
+            currentcolorspace 2 get //clear_setcolor_operands exec
+          }
+          { pop }
+        ifelse
+      }
+    bind
+
+  .dicttomark
+put
+
+end     % .cspace_util
+.setglobal

+ 167 - 80
sys/lib/ghostscript/gs_setpd.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1994, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gs_setpd.ps,v 1.8.2.1 2002/01/25 06:33:09 rayjj Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_setpd.ps,v 1.27 2005/06/09 19:47:18 ray Exp $
 % The current implementation of setpagedevice has the following limitations:
 %	- It doesn't attempt to "interact with the user" for Policy = 2.
 
@@ -32,7 +30,7 @@ level2dict begin
 /.beginpage {		% - .beginpage -
   .currentshowpagecount {
     .currentpagedevice pop
-    dup null ne { /BeginPage .knownget } { pop false } ifelse {
+    dup //null ne { /BeginPage .knownget } { pop //false } ifelse {
 		% Stack: ... pagecount proc
        count 2 .execn
 		% Stack: ... ..???.. oldcount
@@ -47,7 +45,7 @@ level2dict begin
 /.endpage {		% <reason> .endpage <print_bool>
   .currentshowpagecount {
     1 index .currentpagedevice pop
-    dup null ne { /EndPage .knownget } { pop false } ifelse {
+    dup //null ne { /EndPage .knownget } { pop //false } ifelse {
 		% Stack: ... reason pagecount reason proc
       count 2 .execn
 		% Stack: ... ..???.. print oldcount
@@ -98,11 +96,11 @@ level2dict begin
  {	% Since setpagedevice doesn't create new device objects,
 	% we must (carefully) reinstall the old parameters in
 	% the same device.
-   .currentpagedevice pop null currentdevice null .trysetparams
+   .currentpagedevice pop //null currentdevice //null .trysetparams
    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
     }
@@ -113,7 +111,7 @@ level2dict begin
  } bind def
 
 /.uninstallpagedevice
- { 2 .endpage { .currentnumcopies false .outputpage } if
+ { 2 .endpage { .currentnumcopies //false .outputpage } if
    nulldevice
  } bind def
 
@@ -154,10 +152,10 @@ level2dict begin
 % null and a fixed empty directionary.
 /.nullpagedevice 0 dict readonly def
 /.currentpagedevice {
-  //.currentpagedevice exch dup null eq { pop //.nullpagedevice } if exch
+  //.currentpagedevice exch dup //null eq { pop //.nullpagedevice } if exch
 } bind odef
 /.setpagedevice {
-  dup //.nullpagedevice eq { pop null } if //.setpagedevice
+  dup //.nullpagedevice eq { pop //null } if //.setpagedevice
 } bind odef
 
 % ---------------- Auxiliary definitions ---------------- %
@@ -179,16 +177,38 @@ level2dict begin
 .dicttomark readonly def
 % Note that the values of .requiredattrs are executed, not just fetched.
 /.requiredattrs mark
-  /PageDeviceName null
+  /PageDeviceName //null
   /PageOffset [0 0] readonly
-% We define InputAttributes and OutputAttributes with a single
-% dummy media type that handles pages of any size.
-% Devices that care will override this.
+% We populate InputAttributes with all of the known page sizes 
+% followed by a dummy media type that handles pages of any size.
+% This will create some duplicates, but that only slightly slows
+% down the media selection (loop is in zmedia2.c).
+%
+% Some PostScript creators assume that slot 0 is the default media
+% size and some can't handle a non-standard 4-element array which
+% is a 'range' type page size (always put last).
+%
+% Real Devices that can only handle specific page sizes will override this.
   /InputAttributes {
-    mark 0
-	% Since sizes match within 5 user units, we need to set the smallest
-	% PageSize to 6 units so that [0 0] will fail.
-    mark /PageSize [6 dup 16#7ffff dup] .dicttomark
+    mark
+    % First put the device's default page size in slot 0
+    % This satifies those that have devices built with a4 as the default
+    0 mark /PageSize currentdevice /PageSize gsgetdeviceprop .dicttomark
+    statusdict /.pagetypenames get {
+      counttomark 1 sub 2 idiv exch mark exch /PageSize exch
+      % stack: mark --dict-- --dict-- ... key mark /PageSize pagetypename
+      % see note above about pagetype executable array contents.
+      load dup 0 get exch 1 get 2 array astore .dicttomark
+    } forall
+    % If NORANGEPAGESIZE is defined, (-dNORANGEPAGESIZE), then don't add
+    % the 'match any' PageSize entry
+    systemdict /NORANGEPAGESIZE known not {
+      % Add one last entry which is the 4 element range array (non-standard)
+      counttomark 2 idiv 
+	% PageSize with either dimension 0 will be detected in
+	% match_page_size, so we can allow it here
+      mark /PageSize [0 dup 16#7ffff dup] .dicttomark
+    } if
     .dicttomark
   }
   (%MediaSource) 0
@@ -200,6 +220,8 @@ level2dict begin
   /BeginPage {{.callbeginpage}} bind
   /EndPage {{.callendpage}} bind
   /Policies .defaultpolicies
+  /ImagingBBox //null		% default value
+  /UseCIEColor /.getuseciecolor load
 .dicttomark readonly def
 
 % Define currentpagedevice so it creates the dictionary on demand if needed,
@@ -209,9 +231,12 @@ level2dict begin
 /.dynamicppkeys mark
   /.MediaSize dup		% because it changes when PageSize is set
   /PageCount dup
+  /Colors dup
+  /BitsPerPixel dup
+  /ColorValues dup
 .dicttomark readonly def
 /.makecurrentpagedevice {	% - .makecurrentpagedevice <dict>
-  currentdevice null .getdeviceparams
+  currentdevice //null .getdeviceparams
 	% Make the dictionary large enough to add defaulted entries.
   counttomark 2 idiv .requiredattrs length add dict
   counttomark 2 idiv { dup 4 2 roll put } repeat exch pop
@@ -222,7 +247,21 @@ level2dict begin
   .currentglobal exch dup gcheck .setglobal
   .requiredattrs {
     2 index 2 index known {
-      pop pop
+      1 index /Policies eq {
+	% Merge policies from the device driver with defaults
+	2 index             % <<>> /key value <<>>
+	3 2 roll get        % <<>> value <<policies>>
+	exch {                
+	  2 index 2 index known { 
+	    pop pop
+	  } { 
+	    2 index 3 1 roll put
+	  } ifelse
+	} forall
+	pop
+      } {
+	pop pop
+      } ifelse
     } {
       exec 2 index 3 1 roll put
     } ifelse
@@ -238,11 +277,15 @@ level2dict begin
 		% we must update the page device dictionary.
       currentdevice //.dynamicppkeys .getdeviceparams .dicttomark {
 		% Stack: current key value
-	    2 index 2 index .knownget { 1 index ne } { true } ifelse
+	    2 index 2 index .knownget { 1 index ne } { //true } ifelse
 	     { 2 index wcheck not
 		{	% This is the first entry being updated.
 			% Copy the dictionary to make it writable.
-		  3 -1 roll dup length dict .copydict
+		  3 -1 roll
+		  currentglobal 1 index dup gcheck currentglobal and setglobal
+		  length dict
+		  exch setglobal
+		  .copydict
 		  3 1 roll
 		}
 	       if
@@ -252,12 +295,21 @@ level2dict begin
 	     }
 	    ifelse
       } forall
+      % If the device is the distiller device, update distillerparams that
+      % may have been changed by setdistillerparams
+      currentdevice .devicename /pdfwrite eq {
+	currentdistillerparams {
+	      % Stack: current key value
+	  2 index 2 index .knownget { 1 index ne } { //true } ifelse
+	  { 2 index 3 1 roll put } { pop pop } ifelse
+	} forall
+      } if
 		% If the dictionary was global and is now local, copy
 		% any global subsidiary dictionaries to local VM.  This
 		% too is to work around the Word Perfect bug (see above).
       dup gcheck not {
 	dup {
-	  dup type /dicttype eq { dup gcheck } { false } ifelse {
+	  dup type /dicttype eq { dup gcheck } { //false } ifelse {
 		% Copy-on-write, see above.
 	    2 index wcheck not {
 	      3 -1 roll dup length dict .copydict
@@ -299,11 +351,11 @@ level2dict begin
 %	<merged> <key> <new_value> -proc- <merged> <key> <new_value'>
 /.mergespecial mark
   /InputAttributes
-   { dup null eq
-      { pop null
+   { dup //null eq
+      { pop //null
       }
       { 3 copy pop .knownget
-	 { dup null eq
+	 { dup //null eq
 	    { pop dup length dict }
 	    { dup length 2 index length add dict .copydict }
 	   ifelse
@@ -325,7 +377,7 @@ level2dict begin
 
 % Define the keys used in input attribute matching.
 /.inputattrkeys [
-  /PageSize /MediaColor /MediaWeight /MediaType /InsertSheet
+  /PageSize /MediaColor /MediaWeight /MediaType /InsertSheet /ManualFeed
 	% The following are documented in Adobe's supplement for v2017.
   /LeadingEdge /MediaClass
 ] readonly def
@@ -355,46 +407,52 @@ level2dict begin
 % The procedure leaves all its operands on the stack and returns
 % true iff the key/value pair should be presented to .putdeviceparams.
 /.presentspecial mark
-  .dynamicppkeys { pop false } forall
+  .dynamicppkeys { pop //false } forall
 			% We must ignore an explicit request for .MediaSize,
 			% because media matching always handles this.
-  /.MediaSize false
-  /Name false
-  /OutputDevice false
-  /PageDeviceName false
-  /PageOffset false
-  /PageSize false		% obsolete alias for .MediaSize
-  /InputAttributes false
+  /.MediaSize //false
+  /Name //false
+  /OutputDevice //false
+  /PageDeviceName //false
+  /PageOffset //false
+  /PageSize //false		% obsolete alias for .MediaSize
+  /InputAttributes //false
   .inputattrkeys
     { dup /PageSize eq
        { pop }
-       { { 2 index /InputAttributes .knownget { null eq } { true } ifelse } }
+       { { 2 index /InputAttributes .knownget { //null eq } { //true } ifelse } }
       ifelse
     }
   forall
-  .inputselectionkeys { false } forall
-  /OutputAttributes false
+  .inputselectionkeys { //false } forall
+  /OutputAttributes //false
   .outputattrkeys
-    { { 2 index /OutputAttributes .knownget { null eq } { true } ifelse } }
+    { { 2 index /OutputAttributes .knownget { //null eq } { //true } ifelse } }
   forall
-  /Install false
-  /BeginPage false
-  /EndPage false
-  /Policies false
+  /Install //false
+  /BeginPage //false
+  /EndPage //false
+  /Policies //false
 	% Our extensions:
   /HWColorMap
     {			% HACK: don't transmit the color map, because
 			% window systems can change the color map on their own
 			% incrementally.  Someday we'll have a better
 			% solution for this....
-      false
+      //false
     }
-  /ViewerPreProcess false
+  /ViewerPreProcess //false
+  /ImagingBBox //false	% This prevents the ImagingBBox value in the setpagedevice
+			% from affecting the device's ImagingBBox parameter, but
+			% does retain a 'shadow' copy at the PostScript level.
+			% This is done for Adobe compatibility since Adobe does
+			% render marks outside the ImagingBBox (and QuarkXpress
+			% relies on it).
 .dicttomark readonly def
 
 % Define access to device defaults.
 /.defaultdeviceparams
- { finddevice null .getdeviceparams
+ { finddevice //null .getdeviceparams
  } bind def
 
 % Select media (input or output).  The hard work is done in an operator:
@@ -419,8 +477,8 @@ level2dict begin
       ifelse
        {	% Stack: <orig> <request> <merged> <failed> <attrkey>
 	 3 index 1 index .knownget
-	  { 5 index 2 index .knownget { ne } { pop true } ifelse }
-	  { true }
+	  { 5 index 2 index .knownget { ne } { pop //true } ifelse }
+	  { //true }
 	 ifelse		% Stack: ... <failed> <attrkey> <report>
 	  { 2 copy /rangecheck put }
 	 if pop
@@ -448,7 +506,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 }
@@ -511,15 +569,15 @@ DEBUG { (Rolling back.) = pstack flush } if
 % Try setting the device parameters from the merged request.
 /.trysetparams		% <merged> <(ignored)> <device> <Policies>
 			%   .trysetparams
- { true 4 index .prepareparams
+ { //true 4 index .prepareparams
 			% Add the computed .MediaSize.
 			% Stack: merged (ignored) device Policies -true-
 			%   -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
@@ -534,8 +592,8 @@ DEBUG { (Result of putting.) = pstack flush } if
      dup /PageSize .knownget
       { exch pop } { /PolicyNotFound get } ifelse	% PageSize policy,
 							% affects scaling
-   3 index /Orientation .knownget not { null } if
-   4 index /RollFedMedia .knownget not { false } if
+   3 index /Orientation .knownget not { //null } if
+   4 index /RollFedMedia .knownget not { //false } if
    matrix .matchpagesize not {
 		% This is a "can't happen" condition!
      /setpagedevice load /rangecheck signalerror
@@ -555,18 +613,18 @@ 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.
       2 index /OutputDevice .knownget
        {	% A specific OutputDevice was requested.
 	 2 copy eq
-	  { pop pop null }
+	  { pop pop //null }
 	  { exch pop }
 	 ifelse
        }
-       { pop null
+       { pop //null
        }
       ifelse
     }
@@ -575,7 +633,7 @@ DEBUG { (Checking.) = pstack flush } if
       1 index /OutputDevice .knownget not { .defaultdevicename } if
     }
    ifelse
-   dup null eq
+   dup //null eq
     { pop
     }
     { exch pop .defaultdeviceparams
@@ -597,7 +655,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
@@ -633,7 +691,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
@@ -650,7 +708,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 }
@@ -666,7 +724,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
@@ -686,10 +744,10 @@ 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
+    { 1 //true .outputpage
       (>>setpagedevice, press <return> to continue<<\n) .confirm
     }
    if
@@ -698,15 +756,41 @@ DEBUG { (Installing.) = pstack flush } if
    .setdevice pop
    .setpagedevice
 
+		% Implement UseCIEColor directly if this is a LL3 system.
+		% The color substitution feature is now implemented in
+		% the interpreter, and this is used as an optimization.
+		%
+		% NB: This shoud be the only use of the .setuseciecolor
+		%     operator anywhere.
+		%
+		% If UseCIEColor is transitioned to false, set some
+		% color space other than /DeviceGray, to insure that
+		% initgraphics will actually perform a setcolorspace
+		% operation (there is an optimization in setcolorspace
+		% that does nothing if the operand and current color
+		% spaces are the same, and UseCIEColor is false).
+
+    /.setuseciecolor where
+      {
+        pop 1 index /UseCIEColor .knownget
+          {
+            dup .setuseciecolor not
+              { /DeviceRGB setcolorspace }
+            if
+          }
+        if
+      }
+    if
+
 		% Merge the request into the current page device,
 		% unless we're changing the OutputDevice.
 		% Stack: mark ... <merged> <failed>
    exch currentpagedevice dup length 2 index length add dict
 		% Stack: mark ... <failed> <merged> <current> <newdict>
    2 index /OutputDevice .knownget {
-     2 index /OutputDevice .knownget not { null } if eq
+     2 index /OutputDevice .knownget not { //null } if eq
    } {
-     true
+     //true
    } ifelse {
 		% Same OutputDevice, merge the dictionaries.
      .copydict
@@ -728,7 +812,7 @@ DEBUG { (Installing.) = pstack flush } if
 		% We must install the new page device dictionary
 		% before calling the Install procedure.
   dup .setpagedevice
-  .setdefaultscreen	% Set the default screen before calling Install.
+  .setdefaulthalftone	% Set the default screen before calling Install.
   dup /Install .knownget {
     { .execinstall } stopped { .postinstall stop } { .postinstall } ifelse
   } {
@@ -754,12 +838,15 @@ DEBUG { (Installing.) = pstack flush } if
 /.postinstall {		% mark ... <failed> <merged> .postinstall -
    matrix currentmatrix .setdefaultmatrix
 		% Erase and initialize the page.
-   erasepage initgraphics
+   initgraphics
+   currentoverprint //false setoverprint 1 setcolor
+   .fillpage
+   0 setcolor setoverprint
    .beginpage
 
 		% 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

+ 46 - 39
sys/lib/ghostscript/gs_statd.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1989, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gs_statd.ps,v 1.5 2001/05/30 21:14:35 rayjj Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_statd.ps,v 1.14 2003/12/17 09:45:58 ray Exp $
 % This file provides statusdict, serverdict, and assorted LaserWriter
 % operators, mostly for the benefit of poorly designed PostScript programs
 % that 'know' they are running on a LaserWriter.
@@ -39,8 +37,10 @@ end
 /.setpagesize { /statusdict .systemvar begin .setpagesize end } bind def
 userdict begin
 		% Page sizes defined by Adobe documentation
+		% Note: these executable arrays should all begin with two
+		% integers which are the width and height (see gs_setpd.ps).
  /11x17 {792 1224 //.setpagesize exec} bind def  % 11x17 portrait
- /a3 {842 1190 //.setpagesize exec} bind def
+ /a3 {842 1191 //.setpagesize exec} bind def
  /a4 {595 842 //.setpagesize exec} bind def
 % a4small should be a4 with an ImagingBBox of [25 25 570 817].
  /a4small /a4 load def
@@ -57,41 +57,41 @@ userdict begin
 STRICT { (%END SIZES) .skipeof } if
 		% Other page sizes
 	% ISO standard paper sizes
- /a0 {2380 3368 //.setpagesize exec} bind def
- /a1 {1684 2380 //.setpagesize exec} bind def
- /a2 {1190 1684 //.setpagesize exec} bind def
-% /a3 {842 1190 //.setpagesize exec} bind def	% defined by Adobe
+ /a0 {2384 3370 //.setpagesize exec} bind def
+ /a1 {1684 2384 //.setpagesize exec} bind def
+ /a2 {1191 1684 //.setpagesize exec} bind def
+% /a3 {842 1191 //.setpagesize exec} bind def	% defined by Adobe
 % /a4 {595 842 //.setpagesize exec} bind def	% defined by Adobe
- /a5 {421 595 //.setpagesize exec} bind def
- /a6 {297 421 //.setpagesize exec} bind def
+ /a5 {420 595 //.setpagesize exec} bind def
+ /a6 {297 420 //.setpagesize exec} bind def
  /a7 {210 297 //.setpagesize exec} bind def
  /a8 {148 210 //.setpagesize exec} bind def
  /a9 {105 148 //.setpagesize exec} bind def
- /a10 {74 105 //.setpagesize exec} bind def
+ /a10 {73 105 //.setpagesize exec} bind def
 % ISO and JIS B sizes are different....
- /isob0 {2836 4008 //.setpagesize exec} bind def
+ /isob0 {2835 4008 //.setpagesize exec} bind def
  /b0 /isob0 load def
- /isob1 {2004 2836 //.setpagesize exec} bind def
+ /isob1 {2004 2835 //.setpagesize exec} bind def
  /b1 /isob1 load def
- /isob2 {1418 2004 //.setpagesize exec} bind def
+ /isob2 {1417 2004 //.setpagesize exec} bind def
  /b2 /isob2 load def
- /isob3 {1002 1418 //.setpagesize exec} bind def
+ /isob3 {1001 1417 //.setpagesize exec} bind def
  /b3 /isob3 load def
- /isob4 {709 1002 //.setpagesize exec} bind def
+ /isob4 {709 1001 //.setpagesize exec} bind def
  /b4 /isob4 load def
- /isob5 {501 709 //.setpagesize exec} bind def
+ /isob5 {499 709 //.setpagesize exec} bind def
  /b5 /isob5 load def
- /isob6 {354 501 //.setpagesize exec} bind def
+ /isob6 {354 499 //.setpagesize exec} bind def
  /b6 /isob6 load def
- /jisb0 {2916 4128 //.setpagesize exec} bind def
- /jisb1 {2064 2916 //.setpagesize exec} bind def
- /jisb2 {1458 2064 //.setpagesize exec} bind def
- /jisb3 {1032 1458 //.setpagesize exec} bind def
+ /jisb0 {2920 4127 //.setpagesize exec} bind def
+ /jisb1 {2064 2920 //.setpagesize exec} bind def
+ /jisb2 {1460 2064 //.setpagesize exec} bind def
+ /jisb3 {1032 1460 //.setpagesize exec} bind def
  /jisb4 {729 1032 //.setpagesize exec} bind def
  /jisb5 {516 729 //.setpagesize exec} bind def
  /jisb6 {363 516 //.setpagesize exec} bind def
- /c0 {2600 3677 //.setpagesize exec} bind def
- /c1 {1837 2600 //.setpagesize exec} bind def
+ /c0 {2599 3677 //.setpagesize exec} bind def
+ /c1 {1837 2599 //.setpagesize exec} bind def
  /c2 {1298 1837 //.setpagesize exec} bind def
  /c3 {918 1298 //.setpagesize exec} bind def
  /c4 {649 918 //.setpagesize exec} bind def
@@ -107,6 +107,8 @@ STRICT { (%END SIZES) .skipeof } if
  /flsa {612 936 //.setpagesize exec} bind def  % U.S. foolscap
  /flse {612 936 //.setpagesize exec} bind def  % European foolscap
  /halfletter {396 612 //.setpagesize exec} bind def
+	% minimum of a4 and letter (a4 width, letter length)
+ /pa4 {595 792 //.setpagesize exec} bind def
 % /tabloid {792 1224 //.setpagesize exec} bind def  % 11x17 portrait
 % /csheet {1224 1584 //.setpagesize exec} bind def % ANSI C 17x22
 % /dsheet {1584 2448 //.setpagesize exec} bind def % ANSI D 22x34
@@ -120,7 +122,7 @@ statusdict begin
 % Define the pagetype values for the known page formats.
 % The values for all but letter and note are arbitrary.
 /.pagetypenames
- { /letter /note	%do not change this line, needed by 'setpagetype'
+ [ /letter /note	%do not change this line, needed by 'setpagetype'
    /legal /lettersmall
    /11x17 /ledger
    /a4small /a3 /a4
@@ -132,8 +134,9 @@ STRICT { (%END SIZES) .skipeof } if
    /flsa /flse /halfletter
    /isob0 /isob1 /isob2 /isob3 /isob4 /isob5 /isob6
    /jisb0 /jisb1 /jisb2 /jisb3 /jisb4 /jisb5 /jisb6
+   /pa4
 %END SIZES
- } cvlit readonly def
+ ] cvlit readonly def
 
 %%%%%% The following items were suggested by a user as useful.
 
@@ -190,8 +193,10 @@ STRICT { (%END SIZES) .skipeof } if
  /checkpassword {statusdict begin .password eq end} bind def
  /defaulttimeouts {statusdict begin .timeouts aload pop end} bind def
  /diskonline {
-    false (%disk*%) { pop not exit } 100 string /IODevice resourceforall
+    false (%disk*%) { pop not exit } 8192 string /IODevice resourceforall
  } bind def
+ /diskstatus {10240 2097152 } bind odef %  - diskstatus <free> <total> (in 1024 byte pages)
+
 %/dostartpage
  /eescratch {pop 0} bind def
  /idlefonts {statusdict begin mark .idlefonts aload pop end} bind def
@@ -258,7 +263,8 @@ STRICT { (%END SIZES) .skipeof } if
 		% The Adobe documentation only defines setpagetype
 		% (a Level 1 operator) as accepting the values 0 and 1,
 		% so we do too.
-      dup .pagetypenames 0 2 getinterval exch get //systemdict exch get exec
+      dup .pagetypenames 0 2 getinterval exch get
+      //systemdict /userdict get exch get cvx exec
       /pagetype exch def
     end
   } bind def
@@ -311,6 +317,7 @@ end	% statusdict
 systemdict begin
 .currentglobal true .setglobal
 
+/devformat true def
 /devforall {		% <pattern> <proc> <scratch> devforall -
   exch {
     1 index currentdevparams

+ 11 - 13
sys/lib/ghostscript/gs_std_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1993, 1994 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_std_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_std_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the standard encoding vector.
 /StandardEncoding
 % \00x

+ 180 - 0
sys/lib/ghostscript/gs_stres.ps

@@ -0,0 +1,180 @@
+%    Copyright (C) 2000 artofcode LLC.  All rights reserved.
+% 
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+% 
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
+% 
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_stres.ps,v 1.7 2003/11/23 10:16:40 igor Exp $
+% Pick up static resources.
+% Please strongly follow the format of this file.
+
+currentglobal true setglobal
+/StaticCategoryRedefiner /ProcSet findresource begin
+
+
+%========== Decoding category =======================================================
+
+(%END_DECODING_CATEGORY) 1 /Decoding .StaticResourcesBeg
+
+/Unicode .BeginResource
+%% Replace 0 (../Resource/Decoding/Unicode)
+%END_RESOURCE
+.EndResource
+
+/StandardEncoding .BeginResource
+%% Replace 0 (../Resource/Decoding/StandardEncoding)
+%END_RESOURCE
+.EndResource
+
+/Latin1 .BeginResource
+%% Replace 0 (../Resource/Decoding/Latin1)
+%END_RESOURCE
+.EndResource
+
+.StaticResourcesEnd
+%END_DECODING_CATEGORY
+
+
+%========== CMap category ===========================================================
+
+
+(%END_CMAP_CATEGORY) 20 /CMap .StaticResourcesBeg
+
+%------The following CMaps are used for for generating CIDDecoding resources --------
+
+/90ms-RKSJ-H .BeginResource
+%% Replace%0 (../Resource/CMap/90ms-RKSJ-H)
+%END_RESOURCE
+.EndResource
+
+
+/90ms-RKSJ-V .BeginResource
+%% Replace%0 (../Resource/CMap/90ms-RKSJ-V)
+%END_RESOURCE
+.EndResource
+
+
+/ETen-B5-H .BeginResource
+%% Replace%0 (../Resource/CMap/ETen-B5-H)
+%END_RESOURCE
+.EndResource
+
+/ETen-B5-V .BeginResource
+%% Replace%0 (../Resource/CMap/ETen-B5-V)
+%END_RESOURCE
+.EndResource
+
+/GBK-EUC-H .BeginResource
+%% Replace%0 (../Resource/CMap/GBK-EUC-H)
+%END_RESOURCE
+.EndResource
+
+/GBK-EUC-V .BeginResource
+%% Replace%0 (../Resource/CMap/GBK-EUC-H)
+%END_RESOURCE
+.EndResource
+
+/KSC-Johab-H .BeginResource
+%% Replace%0 (../Resource/CMap/KSC-Johab-H)
+%END_RESOURCE
+.EndResource
+
+/KSC-Johab-V .BeginResource
+%% Replace%0 (../Resource/CMap/KSC-Johab-V)
+%END_RESOURCE
+.EndResource
+
+/KSCms-UHC-H .BeginResource
+%% Replace%0 (../Resource/CMap/KSCms-UHC-H)
+%END_RESOURCE
+.EndResource
+
+/KSCms-UHC-V .BeginResource
+%% Replace%0 (../Resource/CMap/KSCms-UHC-V)
+%END_RESOURCE
+.EndResource
+
+/UniCNS-UCS2-H .BeginResource
+%% Replace%0 (../Resource/CMap/UniCNS-UCS2-H)
+%END_RESOURCE
+.EndResource
+
+/UniCNS-UCS2-V .BeginResource
+%% Replace%0 (../Resource/CMap/UniCNS-UCS2-V)
+%END_RESOURCE
+.EndResource
+
+/UniGB-UCS2-H .BeginResource
+%% Replace%0 (../Resource/CMap/UniGB-UCS2-H)
+%END_RESOURCE
+.EndResource
+
+/UniGB-UCS2-V .BeginResource
+%% Replace%0 (../Resource/CMap/UniGB-UCS2-V)
+%END_RESOURCE
+.EndResource
+
+/UniHojo-UCS2-H .BeginResource
+%% Replace%0 (../Resource/CMap/UniHojo-UCS2-H)
+%END_RESOURCE
+.EndResource
+
+/UniJIS-UCS2-H .BeginResource
+%% Replace%0 (../Resource/CMap/UniJIS-UCS2-H)
+%END_RESOURCE
+.EndResource
+
+/UniJIS-UCS2-V .BeginResource
+%% Replace%0 (../Resource/CMap/UniJIS-UCS2-V)
+%END_RESOURCE
+.EndResource
+
+/UniKS-UCS2-H .BeginResource
+%% Replace%0 (../Resource/CMap/UniKS-UCS2-H)
+%END_RESOURCE
+.EndResource
+
+/UniKS-UCS2-V .BeginResource
+%% Replace%0 (../Resource/CMap/UniKS-UCS2-V)
+%END_RESOURCE
+.EndResource
+
+%------End of CMaps used for for generating CIDDecoding resources --------
+
+.StaticResourcesEnd
+%END_CMAP_CATEGORY
+
+%========== ColorSpace category =======================================================
+
+(%END_CSPACE_CATEGORY) 1 /ColorSpace .StaticResourcesBeg
+
+/DefaultGray .BeginResource
+%% Replace 0 (../Resource/ColorSpace/DefaultGray)
+%END_RESOURCE
+.EndResource
+
+/DefaultRGB .BeginResource
+%% Replace 0 (../Resource/ColorSpace/DefaultRGB)
+%END_RESOURCE
+.EndResource
+
+/DefaultCMYK .BeginResource
+%% Replace 0 (../Resource/ColorSpace/DefaultCMYK)
+%END_RESOURCE
+.EndResource
+
+.StaticResourcesEnd
+%END_CSPACE_CATEGORY
+
+
+end % StaticCategoryRedefiner
+setglobal

+ 11 - 13
sys/lib/ghostscript/gs_sym_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1991, 1994, 1998, 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_sym_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_sym_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the Symbol encoding vector.
 /currentglobal where
  { pop currentglobal { setglobal } true setglobal }

+ 13 - 15
sys/lib/ghostscript/gs_trap.ps

@@ -1,28 +1,26 @@
 %    Copyright (C) 1999, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gs_trap.ps,v 1.3 2000/09/19 18:29:11 lpd Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_trap.ps,v 1.6 2002/06/02 12:03:28 mpsuzuki Exp $
 % PostScript LanguageLevel 3 in-RIP trapping support.
 
 ll3dict begin
 
 % We need LanguageLevel 2 or higher in order to have setuserparams and
 % defineresource.
-languagelevel dup 2 max .setlanguagelevel
+languagelevel dup 2 .max .setlanguagelevel
 
 % ------ Trapping ------ %
 

File diff suppressed because it is too large
+ 541 - 169
sys/lib/ghostscript/gs_ttf.ps


+ 13 - 15
sys/lib/ghostscript/gs_typ32.ps

@@ -1,27 +1,25 @@
 %    Copyright (C) 1997 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gs_typ32.ps,v 1.3 2001/08/06 10:19:42 igorm Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gs_typ32.ps,v 1.6 2002/06/02 12:03:28 mpsuzuki Exp $
 % Initialization file for Type 32 fonts.
 
 % ------ Type 32 fonts ------ %
 
 % We need LanguageLevel 2 or higher in order to have defineresource.
-languagelevel dup 2 max .setlanguagelevel
+languagelevel dup 2 .max .setlanguagelevel
 
 /BitmapFontInit mark
 

+ 15 - 14
sys/lib/ghostscript/gs_typ42.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1996 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_typ42.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_typ42.ps,v 1.7 2004/12/16 12:34:56 igor Exp $
 % Type 42 font support code.
 
 % Here are the BuildChar and BuildGlyph implementation for Type 42 fonts.
@@ -34,7 +32,10 @@
     dup CharStrings exch .knownget not
      { 2 copy eq { exch pop /.notdef exch } if
        QUIET not
-	{ (Substituting .notdef for ) print = flush }
+	{ (Substituting .notdef for ) print
+	  =string cvs print ( in the font ) print
+	  1 index /FontName get = flush
+	}
 	{ pop }
        ifelse
        /.notdef CharStrings /.notdef get

+ 48 - 26
sys/lib/ghostscript/gs_type1.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1994, 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_type1.ps,v 1.5 2001/08/06 16:47:43 igorm Exp $
+% $Id: gs_type1.ps,v 1.16 2004/12/15 23:21:33 igor Exp $
 % Type 1 font support code.
 
 % The standard representation for PostScript compatible fonts is described
@@ -28,10 +26,9 @@
 % that these entries are present in the built-in fonts.)
 /.buildfont1
  {
-   false 1 index /FontBBox .knownget {
-     { 0 ne { not exit } if } forall
-   } if
-   { dup /FontInfo known not
+   dup .fontbbox {
+     pop pop pop pop
+     dup /FontInfo known not
       { .growfontdict dup /FontInfo 2 dict put }
      if
      dup dup /FontInfo get dup dup
@@ -40,15 +37,13 @@
       }
       { dup length 2 add dict .copydict
         dup /UnderlinePosition known not
-         { dup /UnderlinePosition 3 index /FontBBox .knownget
-            { 1 get 2 div }			% 1/2 the font descent
-	    { -100 } ifelse put
+         { dup /UnderlinePosition 3 index /FontBBox get
+           1 get 2 div put 			% 1/2 the font descent
          }
         if
         dup /UnderlineThickness known not
-         { dup /UnderlineThickness 3 index /FontBBox .knownget
-            { dup 3 get exch 1 get sub 20 div }	% 1/20 the font height
-    	    { 50 } ifelse put
+         { dup /UnderlineThickness 3 index /FontBBox get
+           dup 3 get exch 1 get sub 20 div put 	% 1/20 the font height
          }
         if
         1 index /FontInfo get wcheck not { readonly } if
@@ -84,6 +79,10 @@ ifelse
    DISKFONTS { end } if
    cleartomark
  } bind def
+ % container for CloseSource flag (default true to prevent buildup of file handles)
+ /closesourcedict mark
+   /CloseSource true
+ .dicttomark readonly def
 /.loadfont1 {		% <file> .loadfont1 <errorflag>
   {	% We would like to use `false /PFBDecode filter',
 	% but this occasionally produces a whitespace character as
@@ -95,7 +94,7 @@ ifelse
 	% we have to create a procedure to close the file reliably.
     dup read not { -1 } if
     2 copy unread 16#80 eq {
-	dup true /PFBDecode filter cvx
+	dup //closesourcedict //true /PFBDecode filter cvx
 	exch .currentresourcefile eq {
 	  dup /.execasresource .systemvar
 	} {
@@ -108,6 +107,8 @@ ifelse
     } ifelse
   } stopped
 } bind def
+% undefine a dict that is only used internally, and is immediately bound
+currentdict /closesourcedict .undef
 
 % Here are the BuildChar and BuildGlyph implementation for Type 1 fonts.
 % The names %Type1BuildChar and %Type1BuildGlyph are known to the interpreter.
@@ -127,15 +128,19 @@ ifelse
     dup CharStrings exch .knownget not {
       2 copy eq { exch pop /.notdef exch } if
        QUIET not
-	{ (Substituting .notdef for ) print = flush }
+	{ (Substituting .notdef for ) print
+	  =string cvs print ( in the font ) print
+	  1 index /FontName get = flush
+	}
 	{ pop }
        ifelse
        /.notdef CharStrings /.notdef get
     } if
   end
 } bind def
-% CCRun is an undocumented procedure provided for Type 4 and Type 0 fonts.
+
 1183615869 internaldict begin
+% CCRun is an undocumented procedure provided for Type 4 and Type 0 fonts.
 % Apparently there are two different argument lists for CCRun.
 % Handling the one with the extra Private dictionary requires fabricating
 % a Type 1 font on the fly, since we aren't currently prepared to parse the
@@ -165,6 +170,23 @@ ifelse
     3 index /Encoding get exch get
   } if exch .type1execchar
 } bind def
+
+% setweightvector is an undocumented procedure that force writes
+% weight vector to the font. Do extra checks for safety.
+/setweightvector { % <font> <vector> setweightvector -
+  dup type dup /arraytype ne exch /packedarraytype ne and
+  2 index type /dicttype ne or {
+    /setweightvector cvx /typecheck signalerror
+  } if
+  1 index /FontType known not {
+    /setweightvector cvx /invalidfont signalerror
+  } if
+  dup gcheck 2 index gcheck not and {
+    /setweightvector cvx /invalidaccess signalerror
+  } if
+  2 copy /WeightVector exch .forceput
+  .setweightvector
+} .bind executeonly def 
 end
 
 % Register the font types for definefont.

+ 11 - 13
sys/lib/ghostscript/gs_wan_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1994, 1996, 1997, 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_wan_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_wan_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the WinAnsi encoding vector.
 /currentglobal where
  { pop currentglobal { setglobal } true setglobal }

+ 11 - 13
sys/lib/ghostscript/gs_wl1_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1996 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_wl1_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_wl1_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the Windows 3.1 Latin 1 encoding vector (H-P Symbol set 19U).
 /currentglobal where
  { pop currentglobal { setglobal } true setglobal }

+ 11 - 13
sys/lib/ghostscript/gs_wl2_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1996 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_wl2_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_wl2_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the Windows 3.1 Latin 2 encoding vector (H-P Symbol set 9E).
 /currentglobal where
  { pop currentglobal { setglobal } true setglobal }

+ 11 - 13
sys/lib/ghostscript/gs_wl5_e.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1996 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gs_wl5_e.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gs_wl5_e.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Define the Windows 3.1 Latin 5 encoding vector (H-P Symbol set 5T).
 /currentglobal where
  { pop currentglobal { setglobal } true setglobal }

+ 20 - 21
sys/lib/ghostscript/gslp.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1991, 1995, 1996, 1997, 1998, 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: gslp.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: gslp.ps,v 1.7 2005/05/07 22:56:56 ray Exp $
 % gslp.ps - format and print text
 
 % This utility provides functionality approximately equivalent to the Unix
@@ -311,7 +309,7 @@ lpdict begin
 /showline3 {	% xlimit string -> xlimit leftover_string
 		% (finds line break / tab / formfeed)
   1 index tx sub
-    cwx div 0.1 add cvi 0 max 1 index length min
+    cwx div 0.1 add cvi 0 .max 1 index length .min
   1 index 0 3 -1 roll getinterval
 	% look for \f or \t
   StringFF search { exch pop exch pop } if
@@ -459,7 +457,7 @@ lpdict begin
      exch MarginLeft add
      exch MarginBottom add plength add topskip sub
      /pagey exch def /pagex exch def
-   plength pskip sub lheight div cvi MaxLines min
+   plength pskip sub lheight div cvi MaxLines .min
      dup /colines exch def
      Columns mul /llength exch def
    grestore
@@ -481,7 +479,7 @@ lpdict begin
    $error /recordstacks false put
 
 % Initialize for the first page.
-   /lbuf 1000 string def
+   /lbuf 64000 string def
    /pindex 1 def
    beginpage
 
@@ -503,6 +501,7 @@ lpdict begin
 	 exch not { exit } if
        }
       ifelse
+      pindex PageLast gt { exit } if
     } loop
    pop
 
@@ -525,10 +524,10 @@ end
 
 lpdict begin
 
-/splitfn		% (FontNNN) -> <font>
+/splitfn		% (FontNN.NN) -> <font>
  { dup /arg exch def length
     { dup 0 le { exit } if
-      dup 1 sub arg exch get dup 48 ge exch 59 le and not { exit } if
+      dup 1 sub arg exch get dup 48 ge 1 index 59 le and exch 46 eq or not { exit } if
       1 sub
     } loop
    arg exch 0 exch getinterval dup cvn find-latin-font
@@ -563,7 +562,7 @@ lpdict begin
     } def
 /--add-to-space { cvr /AddToSpace exch def } def
 /--add-to-width { cvr /AddToWidth exch def } def
-/--columns { cvi 1 max /Columns exch def } def
+/--columns { cvi 1 .max /Columns exch def } def
 /--detect { /DetectFileType true def } def
 /--first-page { cvi /PageFirst exch def } def
 /--footing-center { /FootingCenter exch def   /Footers true def } def
@@ -645,7 +644,7 @@ lpdict begin
    ifelse
  } bind def
 
-/lpcstring 100 string def
+/lpcstring 8192 string def
 
 end
 

+ 21 - 18
sys/lib/ghostscript/gsnup.ps

@@ -1,22 +1,20 @@
 %!
 %    Copyright (C) 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: gsnup.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: gsnup.ps,v 1.5 2005/06/07 19:24:33 ray Exp $
 % Prefix this to very well-behaved PostScript files for n-up printing.
 
 /cdef { 1 index where { pop pop } { def } ifelse } def
@@ -55,7 +53,7 @@ false setglobal
 } bind def
 <<
   /BeginPage {
-    .BP .Nx .Ny .max
+    .Nx .Ny .max
     gsave
       initclip clippath pathbbox exch 4 -1 roll sub 3 1 roll exch sub
     grestore
@@ -72,12 +70,17 @@ false setglobal
     translate
 		% Stack: nmax
     1 exch div dup scale
+    .BP
   }
   /EndPage {
-    .ELevel 0 vmstatus pop pop put
-    .Ps 0 .Pn 1 add .Nx .Ny mul mod put    
-    .Pn 0 eq {
-      .EP
+    dup 2 lt {
+      .ELevel 0 vmstatus pop pop put
+      .Ps 0 .Pn 1 add .Nx .Ny mul mod put    
+      .Pn 0 eq {
+        .EP
+      } {
+        pop pop false
+      } ifelse
     } {
       pop pop false
     } ifelse

+ 1 - 1
sys/lib/ghostscript/ht_ccsto.ps

@@ -8,7 +8,7 @@
 % PostScript halftone dictionaries, and hereby places this file in the
 % public domain as well.
 
-% $Id: ht_ccsto.ps,v 1.1 2000/03/09 08:40:40 lpd Exp $
+% $Id: ht_ccsto.ps,v 1.3 2002/02/21 21:49:28 giles Exp $
 % This file defines a /StochasticDefault Type 5 Halftone.
 
 % Note that the Black array is used for Default, Black, and Gray

+ 11 - 13
sys/lib/ghostscript/image-qa.ps

@@ -1,22 +1,20 @@
 %!PS
 %    Copyright (C) 2000 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 %
-% $Id: image-qa.ps,v 1.3 2001/04/04 04:54:53 rayjj Exp $
+% $Id: image-qa.ps,v 1.5 2002/02/21 21:49:28 giles Exp $
 % Tests for the image operators
 
 % Specifications for Image operator testing.

+ 11 - 13
sys/lib/ghostscript/impath.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1992, 1996 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: impath.ps,v 1.3 2000/12/28 17:06:07 alexcher Exp $
+% $Id: impath.ps,v 1.5 2002/02/21 21:49:28 giles Exp $
 % impath.ps
 % Reverse-rasterize a bitmap to produce a Type 1 outline.
 % (This was formerly a Ghostscript operator implemented in C.)

+ 11 - 13
sys/lib/ghostscript/jispaper.ps

@@ -1,21 +1,19 @@
 %    Copyright (C) 1999 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
-% $Id: jispaper.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% $Id: jispaper.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Select JIS B paper sizes for b0...b6.
 
 userdict begin

+ 3 - 1
sys/lib/ghostscript/landscap.ps

@@ -1,5 +1,6 @@
 %!
 %  landscap.ps
+%
 % This file can be prepended to most PostScript pages to force 
 % rotation to "landscape" mode.
 %
@@ -13,7 +14,8 @@
 % below, the lower left hand corner is aligned.  When viewed, this 
 % corner will have moved to the urx,lly corner.
 %
-%  James E. Burns, 3/8/93, burns@nova.bellcore.com
+%  originally by James E. Burns, 3/8/93, burns@nova.bellcore.com
+%  $Id: landscap.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 %
 gsave clippath pathbbox grestore
 4 dict begin

+ 1 - 0
sys/lib/ghostscript/level1.ps

@@ -1,2 +1,3 @@
 %!
+% $Id: level1.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 /.setlanguagelevel where { pop 1 .setlanguagelevel } if

+ 12 - 14
sys/lib/ghostscript/lines.ps

@@ -1,22 +1,20 @@
 %!
 %   Copyright (C) 1989, 1990, 1992, 1994, 1996 Aladdin Enterprises.  All rights reserved.
 % 
-% This file is part of AFPL Ghostscript.
+% This software is provided AS-IS with no warranty, either express or
+% implied.
 % 
-% AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
-% distributor accepts any responsibility for the consequences of using it, or
-% for whether it serves any particular purpose or works at all, unless he or
-% she says so in writing.  Refer to the Aladdin Free Public License (the
-% "License") for full details.
+% This software is distributed under license and may not be copied,
+% modified or distributed except as expressly authorized under the terms
+% of the license contained in the file LICENSE in this distribution.
 % 
-% Every copy of AFPL Ghostscript must include a copy of the License, normally
-% in a plain ASCII text file named PUBLIC.  The License grants you the right
-% to copy, modify and redistribute AFPL Ghostscript, but only under certain
-% conditions described in the License.  Among other things, the License
-% requires that the copyright notice and this notice be preserved on all
-% copies.
-
-% $Id: lines.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
+% For more information about licensing, please refer to
+% http://www.ghostscript.com/licensing/. For information on
+% commercial licensing, go to http://www.artifex.com/licensing/ or
+% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+
+% $Id: lines.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
 % Test line rendering (stroke).
 
 % Exercise the miter limit.  The left column of lines should bevel at

Some files were not shown because too many files changed in this diff