home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / compsrcs / misc / volume04 / psinter1.pch < prev    next >
Encoding:
Internet Message Format  |  1991-08-27  |  43.5 KB

  1. Path: uunet!lll-winken!lll-tis!ames!necntc!ncoast!allbery
  2. From: jgm@k.gp.cs.cmu.edu (John Myers)
  3. Newsgroups: comp.sources.misc
  4. Subject: v04i006: Postscript interpreter patches (1 of 2)
  5. Message-ID: <12088@ncoast.UUCP>
  6. Date: 28 Jul 88 23:41:41 GMT
  7. Sender: allbery@ncoast.UUCP
  8. Reply-To: jgm@k.gp.cs.cmu.edu (John Myers)
  9. Organization: System/Technology Development Corp.
  10. Lines: 1449
  11. Approved: allbery@ncoast.UUCP
  12.  
  13. Posting-number: Volume 4, Issue 6
  14. Submitted-by: "John Myers" <jgm@k.gp.cs.cmu.edu>
  15. Archive-name: psinter-patch1
  16.  
  17. These patches make several bug fixes and enhancements to the Postscript
  18. interpreter that was posted to comp.sources.unix.  They include a
  19. driver for X11 and some speedups that I picked up off of Barry Shein.
  20.  
  21. Please read the instructions at the beginning of each of the patches
  22. before applying them.
  23.  
  24. Bugs fixed:
  25.  
  26. Half-implemented the missing operator "vmstatus".  The number of savelevels is
  27. correct (as far as the broken implementation of "save" and "restore" allow),
  28. but the amount of memory used and free is a lie.
  29.  
  30. Implemented the missing operator "noaccess".
  31.  
  32. Fixed a bug in the operator "stopped".  Previously it only worked on arrays,
  33. but now it works on any executable object.
  34.  
  35. Fixed the parsing bug for reals with a trailing period (e.g. "4.") which
  36. resulted in the "undefined in operater exec" errors reported to the net.
  37.  
  38. Changed an occurance of the variable "signed" to "signedp" as the former is an
  39. ANSI C keyword.
  40.  
  41. Added a version of the missing file postscript/demos/buildcachefont.ps
  42.  
  43. Fixed operators kshow, translate, scale, rotate, reversepath
  44.  
  45. Casted NULL to appropriate type when it was passed as a parameter.
  46.  
  47. Removed unused variables.
  48.  
  49. The fourth parameter to the "framedevice" is no longer ignored.  psrc
  50. has been modified so that if a driver defines the postscript operator
  51. "outputpage", it will be called instead of the "beep and wait for
  52. input" routine when the copypage or showpage command is executed.
  53.  
  54. Enhancements made:
  55.  
  56. Macroized PanicIf()
  57.  
  58. Changed "undefined in operator exec" errors to instead report 
  59. "undefined in operator foo", where "foo" is the operator that was undefined.
  60.  
  61. Fixed imagemask to deal better with images that have to be shrunk.  Bitmapped
  62. fonts intended for 300 dpi printers look much better now.
  63. (Change courtesy of Christopher Cox, cc4b@andrew.cmu.edu)
  64.  
  65. Tweaked makefile to deal better with sun3.
  66.  
  67. Added "getenv" operator.  The syntax is:
  68.     <string> getenv <string> <true>
  69. if the environment variable exists, or
  70.     <string> getenv <false>
  71. if it does not.
  72.  
  73. Each driver must now define the character pointer "DriverType".  The
  74. value of this variable is placed in the string produced by the
  75. "version" operator.
  76.  
  77. Added operators letter, note, and legal.
  78.  
  79. Barry Shein's speedups have been incorporated.
  80.  
  81. A version of the X11 driver is included.
  82.  
  83.                 John G. Myers
  84.                 jm36@andrew.cmu.edu
  85.  
  86. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Cut Here =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  87. #! /bin/sh
  88. # This is a shell archive.  Remove anything before this line, then unpack
  89. # it by saving it into a file and typing "sh file".  To overwrite existing
  90. # files, type "sh file -c".  You can also feed this as standard input via
  91. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  92. # will see the following message at the end:
  93. #        "End of shell archive."
  94. # Contents:  ps.diff.v1 ps.diff.v2
  95. # Wrapped by jm36@cycle4.andrew.cmu.edu on Thu Jul 28 19:38:29 1988
  96. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  97. if test -f ps.diff.v1 -a "${1}" != "-c" ; then 
  98.   echo shar: Will not over-write existing file \"ps.diff.v1\"
  99. else
  100. echo shar: Extracting \"ps.diff.v1\" \(20227 characters\)
  101. sed "s/^X//" >ps.diff.v1 <<'END_OF_ps.diff.v1'
  102. XThis is a patch for Crispin Goswell's postscript interpreter, which
  103. Xwas posted to comp.sources.unix a while back.  If you don't have the
  104. Xinterpreter, you can get it from one of the comp.sources.unix
  105. Xarchives.
  106. X
  107. XSoon after the interpreter was posted, I posted these fixes to
  108. Xcomp.sources.bugs, but they unfortunately had lines wrapped by our
  109. Xmailer.  This first patch is equivalent to that posting (modulo line
  110. Xwrapping) and if you successfully applied that posting, you can skip
  111. Xto the next patch.
  112. X
  113. XTo install this, you need the 'patch' program which is also available
  114. Xfrom the comp.sources.unix archives.
  115. X
  116. XChange directories to the top-level postscript directory (the one with
  117. Xthe file "MANIFEST" in it) and apply this patch with the command:
  118. X
  119. Xpatch -p0 <ps.diff.v1
  120. X
  121. X                _.John G. Myers
  122. X                jm36+@andrew.cmu.edu
  123. X
  124. X*** /dev/null    Mon Jul 25 01:14:13 1988
  125. X--- CHANGES.JGM    Thu Jul 28 12:24:55 1988
  126. X***************
  127. X*** 0 ****
  128. X--- 1,47 -----
  129. X+ Here is a patch that makes several bug fixes and enhancements to the Postscript
  130. X+ interpreter recently posted.  The changes are:
  131. X+ 
  132. X+ 
  133. X+ Bugs fixed:
  134. X+ 
  135. X+ Half-implemented the missing operator "vmstatus".  The number of savelevels is
  136. X+ correct (as far as the broken implementation of "save" and "restore" allow),
  137. X+ but the amount of memory used and free is a lie.
  138. X+ 
  139. X+ Implemented the missing operator "noaccess".
  140. X+ 
  141. X+ Fixed a bug in the operator "stopped".  Previously it only worked on arrays,
  142. X+ but now it works on any executable object.
  143. X+ 
  144. X+ Fixed the parsing bug for reals with a trailing period (e.g. "4.") which
  145. X+ resulted in the "undefined in operater exec" errors reported to the net.
  146. X+ 
  147. X+ Changed an occurance of the variable "signed" to "signedp" as the former is an
  148. X+ ANSI C keyword.
  149. X+ 
  150. X+ Added a version of the missing file postscript/demos/buildcachefont.ps
  151. X+ 
  152. X+ 
  153. X+ Enhancements made:
  154. X+ 
  155. X+ Macroized PanicIf()
  156. X+ 
  157. X+ Changed "undefined in operator exec" errors to instead report 
  158. X+ "undefined in operator foo", where "foo" is the operator that was undefined.
  159. X+ 
  160. X+ Fixed imagemask to deal better with images that have to be shrunk.  Bitmapped
  161. X+ fonts intended for 300 dpi printers look much better now.
  162. X+ (Change courtesy of Christopher Cox, cc4b@andrew.cmu.edu)
  163. X+ 
  164. X+ Tweaked makefile to deal better with sun3.
  165. X+ 
  166. X+ Added "getenv" operator.  The syntax is:
  167. X+     <string> getenv <string> <true>
  168. X+ if the environment variable exists, or
  169. X+     <string> getenv <false>
  170. X+ if it does not.
  171. X+ 
  172. X+ 
  173. X+                 John G. Myers
  174. X+                 jm36@andrew.cmu.edu
  175. X+                 jgm@k.gp.cs.cmu.edu
  176. Xdiff -cr orig/postscript/psrc ./postscript/psrc
  177. X*** orig/postscript/psrc    Sun Jan  3 14:22:51 1988
  178. X--- ./postscript/psrc    Sun Dec 13 22:58:09 1987
  179. X***************
  180. X*** 10,17 ****
  181. X  
  182. X  /bind {} def
  183. X  
  184. X! /save { gsave /save } def
  185. X! /restore { grestore pop } def
  186. X  /raise { errordict exch get exec } def
  187. X  
  188. X  /beep ( ) dup 0 7 put def
  189. X--- 10,21 ----
  190. X  
  191. X  /bind {} def
  192. X  
  193. X! %% Start mods by jgm
  194. X! /$$SAVELEVEL 0 def
  195. X! /save { gsave /save /$$SAVELEVEL $$SAVELEVEL 1 add def } def
  196. X! /restore { grestore pop /$$SAVELEVEL $$SAVELEVEL 1 sub def } def
  197. X! /vmstatus { $$SAVELEVEL 10000 10000 } def
  198. X! %% End mods by jgm
  199. X  /raise { errordict exch get exec } def
  200. X  
  201. X  /beep ( ) dup 0 7 put def
  202. Xdiff -cr orig/source/array.c ./source/array.c
  203. X*** orig/source/array.c    Sun Jan  3 14:21:55 1988
  204. X--- ./source/array.c    Sat Dec 12 01:05:28 1987
  205. X***************
  206. X*** 17,22 ****
  207. X--- 17,23 ----
  208. X  
  209. X  static int forAll (), ForAll (), PReadOnly (), PExecOnly (), PrCheck (), PwCheck ();
  210. X  static int PutInterval (), GetInterval (), Put (), Get (), Length (), Copy (), Eq ();
  211. X+ static int PNoAccess (); /*jgm*/
  212. X  
  213. X  int ExecArray ();
  214. X  Object Marker;
  215. X***************
  216. X*** 53,58 ****
  217. X--- 54,60 ----
  218. X       TypeInstallOp (Array, "length",         PLength,    1, 1, 0, 0, Array);
  219. X       TypeInstallOp (Array, "copy",         Copy,        2, 0, 0, 0, Array, Array);
  220. X       TypeInstallOp (Array, "forall",     ForAll,        2, 0, 0, 4, Array, Array);
  221. X+      TypeInstallOp (Array, "noaccess",     PNoAccess,    1, 1, 0, 0, Array); /*jgm*/
  222. X       TypeInstallOp (Array, "executeonly",     PExecOnly,    1, 1, 0, 0, Array);
  223. X       TypeInstallOp (Array, "readonly",     PReadOnly,    1, 1, 0, 0, Array);
  224. X       TypeInstallOp (Array, "rcheck",     PrCheck,    1, 1, 0, 0, Array);
  225. X***************
  226. X*** 385,390 ****
  227. X--- 387,398 ----
  228. X                body[i] = Pop (OpStack);
  229. X            return Push (OpStack, array);
  230. X        }
  231. X+  }
  232. X+ 
  233. X+ /* PNoAccess by jgm */
  234. X+ static int PNoAccess (item) Object item;
  235. X+  {
  236. X+      return Push (OpStack, NoAccess (item));
  237. X   }
  238. X  
  239. X  static int PExecOnly (item) Object item;
  240. Xdiff -cr orig/source/cache.c ./source/cache.c
  241. X*** orig/source/cache.c    Sun Jan  3 14:22:42 1988
  242. X--- ./source/cache.c    Thu Dec 10 21:26:47 1987
  243. X***************
  244. X*** 501,512 ****
  245. X      if ((ccache = SearchCache (m, BodyFontID (DictLoad (gstate->font, Fid)))) == NULL)
  246. X           return Error (PInvFont);
  247. X       
  248. X-       Message (disk_name);
  249. X      VOID sprintf (disk_name,
  250. X           "%s/cache/%.*s/%3d%3d%3d%3d",
  251. X           library,
  252. X           lengthName (font_name), BodyName (font_name),
  253. X           (int) right.vx, (int) right.vy, (int) bottom.vx, (int) bottom.vy);
  254. X       
  255. X       if ((fp = fopen (disk_name, "w")) == NULL)
  256. X           return Error (PInvFileAccess);
  257. X--- 501,512 ----
  258. X      if ((ccache = SearchCache (m, BodyFontID (DictLoad (gstate->font, Fid)))) == NULL)
  259. X           return Error (PInvFont);
  260. X       
  261. X      VOID sprintf (disk_name,
  262. X           "%s/cache/%.*s/%3d%3d%3d%3d",
  263. X           library,
  264. X           lengthName (font_name), BodyName (font_name),
  265. X           (int) right.vx, (int) right.vy, (int) bottom.vx, (int) bottom.vy);
  266. X+       Message (disk_name); /* moved from before to after prev line -- jgm */
  267. X       
  268. X       if ((fp = fopen (disk_name, "w")) == NULL)
  269. X           return Error (PInvFileAccess);
  270. Xdiff -cr orig/source/config.c ./source/config.c
  271. X*** orig/source/config.c    Sun Jan  3 14:19:54 1988
  272. X--- ./source/config.c    Fri Jan  1 13:58:10 1988
  273. X***************
  274. X*** 87,91 ****
  275. X       Install ("polytype",        DictFrom (Poly));
  276. X      Install ("fonttype",        DictFrom (FontID));
  277. X      
  278. X!     Install ("version",    StringFrom ("Version 1.4"));
  279. X   }
  280. X--- 87,91 ----
  281. X       Install ("polytype",        DictFrom (Poly));
  282. X      Install ("fonttype",        DictFrom (FontID));
  283. X      
  284. X!     Install ("version",    StringFrom ("Version 1.4 with mods by jgm")); /* jgm */
  285. X   }
  286. Xdiff -cr orig/source/control.c ./source/control.c
  287. X*** orig/source/control.c    Sun Jan  3 14:26:55 1988
  288. X--- ./source/control.c    Sun Dec 13 23:13:46 1987
  289. X***************
  290. X*** 65,71 ****
  291. X       InstallOp ("loop",    PLoop,        1, 0, 0, 4, Array);
  292. X      InstallOp ("exit",    PExit,        0, 0, 0, 0);
  293. X       InstallOp ("stop",    PStop,        0, 1, 0, 0);
  294. X!      InstallOp ("stopped",    PStopped,    1, 1, 0, 3, Array);
  295. X       InstallOp ("quit",    PQuit,         0, 0, 0, 0);
  296. X       InstallOp ("start",    PStart,     0, 0, 0, 0);
  297. X       InstallOp ("countexecstack",
  298. X--- 65,72 ----
  299. X       InstallOp ("loop",    PLoop,        1, 0, 0, 4, Array);
  300. X      InstallOp ("exit",    PExit,        0, 0, 0, 0);
  301. X       InstallOp ("stop",    PStop,        0, 1, 0, 0);
  302. X!     /* Changed from "Array" to "Poly" --jgm*/
  303. X!      InstallOp ("stopped",    PStopped,    1, 1, 0, 3, Poly);
  304. X       InstallOp ("quit",    PQuit,         0, 0, 0, 0);
  305. X       InstallOp ("start",    PStart,     0, 0, 0, 0);
  306. X       InstallOp ("countexecstack",
  307. Xdiff -cr orig/source/dictionary.c ./source/dictionary.c
  308. X*** orig/source/dictionary.c    Sun Jan  3 14:22:55 1988
  309. X--- ./source/dictionary.c    Sat Dec 12 01:06:49 1987
  310. X***************
  311. X*** 23,28 ****
  312. X--- 23,29 ----
  313. X  static int PDict (), PBegin (), PEnd (), PDef (), PStore (), PKnown (), PLoad ();
  314. X  static int PrCheck (), PwCheck (), PReadOnly (), EqDict (); 
  315. X  static int PWhere (), PMaxLength (), PCurrentDict (); 
  316. X+ static int PNoAccess (); /*jgm*/
  317. X  
  318. X  static int hash_tries = 0, hash_collisions = 0, hash_attempts = 0;
  319. X  static int PHashStats (), PDictHash ();
  320. X***************
  321. X*** 57,62 ****
  322. X--- 58,64 ----
  323. X      TypeInstallOp (Dictionary, "length",     LengthDict,    1, 1, 0, 0, Dictionary);
  324. X      TypeInstallOp (Dictionary, "copy",     CopyDict,    2, 0, 0, 0, Dictionary, Dictionary);
  325. X      TypeInstallOp (Dictionary, "forall",     ForDict,    2, 0, 0, 4, Dictionary, Array);
  326. X+      TypeInstallOp (Dictionary, "noaccess",     PNoAccess,    1, 1, 0, 0, Dictionary); /*jgm*/
  327. X       TypeInstallOp (Dictionary, "readonly",     PReadOnly,    1, 1, 0, 0, Dictionary);
  328. X       TypeInstallOp (Dictionary, "rcheck",     PrCheck,    1, 1, 0, 0, Dictionary);
  329. X       TypeInstallOp (Dictionary, "wcheck",     PwCheck,    1, 1, 0, 0, Dictionary);
  330. X***************
  331. X*** 511,516 ****
  332. X--- 513,524 ----
  333. X  static int PCurrentDict ()
  334. X   {
  335. X        return Push (OpStack, Top (DictStack));
  336. X+  }
  337. X+ 
  338. X+ /* PNoAccess by jgm */
  339. X+ static int PNoAccess (item) Object item;
  340. X+  {
  341. X+      return Push (OpStack, NoAccess (item));
  342. X   }
  343. X  
  344. X  static int PReadOnly (item) Object item;
  345. Xdiff -cr orig/source/image.c ./source/image.c
  346. X*** orig/source/image.c    Sun Jan  3 14:22:32 1988
  347. X--- ./source/image.c    Mon Dec 28 18:17:04 1987
  348. X***************
  349. X*** 353,363 ****
  350. X      else
  351. X       {
  352. X           middle2 = NewBitmapHardware (dwidth, h);
  353. X!         for (i = 0; i < dwidth; i++)
  354. X!             BitBlt (from,     middle2,
  355. X!                 NewDevicePoint ((int) (i/xscale), 0), NewDevicePoint (i, 0),
  356. X                  NewDevicePoint (1, h),
  357. X                  ROP_OR);
  358. X       }
  359. X      
  360. X      if (dheight > h)
  361. X--- 353,365 ----
  362. X      else
  363. X       {
  364. X           middle2 = NewBitmapHardware (dwidth, h);
  365. X!         /* begin changes by cc4b --jgm */
  366. X!         for (i = 0; i < w; i++)
  367. X!             BitBlt( from,  middle2,
  368. X!                 NewDevicePoint (i, 0), NewDevicePoint( (int) (i * xscale), 0),
  369. X                  NewDevicePoint (1, h),
  370. X                  ROP_OR);
  371. X+         /* end changes by cc4b --jgm */
  372. X       }
  373. X      
  374. X      if (dheight > h)
  375. X***************
  376. X*** 382,392 ****
  377. X      else
  378. X       {
  379. X          high2 = NewBitmapHardware (dwidth, dheight);
  380. X!         for (i = 0; i < dheight; i++)
  381. X!             BitBlt (middle2, high2,
  382. X!                 NewDevicePoint (0, (int) (i/yscale)), NewDevicePoint (0, i),
  383. X                  NewDevicePoint (dwidth, 1),
  384. X                  ROP_OR);
  385. X       }
  386. X       return high2;
  387. X   }
  388. X--- 384,397 ----
  389. X      else
  390. X       {
  391. X          high2 = NewBitmapHardware (dwidth, dheight);
  392. X! 
  393. X!         /* begin changes by cc4b --jgm */
  394. X!         for (i = 0; i < h; i++ )
  395. X!             BitBlt( middle2, high2,
  396. X!                 NewDevicePoint (0, i), NewDevicePoint( 0, (int) (i * yscale)),
  397. X                  NewDevicePoint (dwidth, 1),
  398. X                  ROP_OR);
  399. X+         /* end changes by cc4b  --jgm */
  400. X       }
  401. X       return high2;
  402. X   }
  403. Xdiff -cr orig/source/integer.c ./source/integer.c
  404. X*** orig/source/integer.c    Sun Jan  3 14:21:32 1988
  405. X--- ./source/integer.c    Thu Dec 10 20:44:17 1987
  406. X***************
  407. X*** 72,80 ****
  408. X  
  409. X  int StrictMul (a, b) int a, b;
  410. X   {
  411. X!      int atop, abot, btop, bbot, sum, signed;
  412. X       
  413. X!      signed = (a < 0) != (b < 0);
  414. X       a = a < 0 ? -a : a;
  415. X       b = b < 0 ? -b : b;
  416. X       abot = a & LowMask;
  417. X--- 72,81 ----
  418. X  
  419. X  int StrictMul (a, b) int a, b;
  420. X   {
  421. X!     /* Variable signed changed to signedp by jgm for ANSI C */
  422. X!      int atop, abot, btop, bbot, sum, signedp;
  423. X       
  424. X!      signedp = (a < 0) != (b < 0);
  425. X       a = a < 0 ? -a : a;
  426. X       b = b < 0 ? -b : b;
  427. X       abot = a & LowMask;
  428. X***************
  429. X*** 86,92 ****
  430. X       sum = ((unsigned) sum >> Word2) + atop * btop;
  431. X       if (sum != 0 || a * b < 0)
  432. X           kill (getpid (), SIGFPE);
  433. X!      return signed ? -a * b : a * b;
  434. X   }
  435. X  
  436. X  int StrictAdd (a, b) int a, b;
  437. X--- 87,93 ----
  438. X       sum = ((unsigned) sum >> Word2) + atop * btop;
  439. X       if (sum != 0 || a * b < 0)
  440. X           kill (getpid (), SIGFPE);
  441. X!      return signedp ? -a * b : a * b;
  442. X   }
  443. X  
  444. X  int StrictAdd (a, b) int a, b;
  445. Xdiff -cr orig/source/main.c ./source/main.c
  446. X*** orig/source/main.c    Sun Jan  3 14:22:13 1988
  447. X--- ./source/main.c    Sun Dec 13 00:40:04 1987
  448. X***************
  449. X*** 187,210 ****
  450. X                 Object newitem;
  451. X                 
  452. X                 newitem = Load (item);
  453. X!                if (TypeOf (newitem) != Condition)
  454. X!                     item = newitem;
  455. X!                
  456. X!                if (!xCheck (item))
  457. X!                  res = Push (OpStack, item);
  458. X!               else if (TypeOf (item) == Operator)
  459. X!                   res = ExecOperator (item);
  460. X!               else if (TypeOf (item) == Array)
  461. X!                   res = ExecArray (item);
  462. X!               else if (TypeOf (item) == File)
  463. X!                   res = ExecFile (item);
  464. X!             else
  465. X!                {
  466. X!                   res = Push (OpStack, item);
  467. X!                    exop = Lookup (TypeOf (item), execName);
  468. X!                    if (TypeOf (exop) != Condition)
  469. X!                        VOID Push (ExecStack, exop);
  470. X!                 }
  471. X              }
  472. X            else
  473. X             {
  474. X--- 187,216 ----
  475. X                 Object newitem;
  476. X                 
  477. X                 newitem = Load (item);
  478. X!             /* begin jgm */
  479. X!             if (TypeOf (newitem) == Condition) {
  480. X!                 VOID Push(OpStack, item);
  481. X!                 res = Push(ExecStack, DictLoad(ErrorDict,PUndefined));
  482. X!             } else {
  483. X!                 /* end jgm */
  484. X!                 item = newitem;
  485. X! 
  486. X!                 if (!xCheck (item))
  487. X!                 res = Push (OpStack, item);
  488. X!                 else if (TypeOf (item) == Operator)
  489. X!                 res = ExecOperator (item);
  490. X!                 else if (TypeOf (item) == Array)
  491. X!                 res = ExecArray (item);
  492. X!                 else if (TypeOf (item) == File)
  493. X!                 res = ExecFile (item);
  494. X!                 else
  495. X!                 {
  496. X!                 res = Push (OpStack, item);
  497. X!                 exop = Lookup (TypeOf (item), execName);
  498. X!                 if (TypeOf (exop) != Condition)
  499. X!                     VOID Push (ExecStack, exop);
  500. X!                 }
  501. X!             } /* jgm */
  502. X              }
  503. X            else
  504. X             {
  505. X***************
  506. X*** 340,350 ****
  507. X           return TRUE;
  508. X   }
  509. X  
  510. X! PanicIf (cond, s) int cond; char *s;
  511. X!  {
  512. X!      if (cond)
  513. X!          Panic (s);
  514. X!  }
  515. X  
  516. X  Panic (s) char *s;
  517. X   {
  518. X--- 346,358 ----
  519. X           return TRUE;
  520. X   }
  521. X  
  522. X! #ifdef needed /* Macroized --jgm */
  523. X! XPanicIf (cond, s) int cond; char *s;
  524. X! X {
  525. X! X     if (cond)
  526. X! X         Panic (s);
  527. X! X }
  528. X! #endif
  529. X  
  530. X  Panic (s) char *s;
  531. X   {
  532. X***************
  533. X*** 392,397 ****
  534. X--- 400,416 ----
  535. X      return o;
  536. X   }
  537. X  
  538. X+ /* NoAccess by jgm */
  539. X+ Object NoAccess (o) Object o;
  540. X+  {
  541. X+      if (o.type == Dictionary)
  542. X+          o.u.Dictionary->dict_flags &= ~(READABLE | WRITEABLE | EXECUTABLE);
  543. X+      else
  544. X+          o.flags &= ~(READABLE | WRITEABLE | EXECUTABLE);
  545. X+      return o;
  546. X+  }
  547. X+ 
  548. X+ 
  549. X  Object ExecOnly (o) Object o;
  550. X   {
  551. X       if (o.type == Dictionary)
  552. X***************
  553. X*** 398,404 ****
  554. X           o.u.Dictionary->dict_flags &= ~(READABLE | WRITEABLE);
  555. X       else
  556. X           o.flags &= ~(READABLE | WRITEABLE);
  557. X!      return ReadOnly (o);
  558. X   }
  559. X  
  560. X  Object ReadOnly (o) Object o;
  561. X--- 417,423 ----
  562. X           o.u.Dictionary->dict_flags &= ~(READABLE | WRITEABLE);
  563. X       else
  564. X           o.flags &= ~(READABLE | WRITEABLE);
  565. X!      return o;   /* Removed redundant call to ReadOnly -- jgm */
  566. X   }
  567. X  
  568. X  Object ReadOnly (o) Object o;
  569. Xdiff -cr orig/source/main.h ./source/main.h
  570. X*** orig/source/main.h    Sun Jan  3 14:19:59 1988
  571. X--- ./source/main.h    Sat Dec 12 00:58:43 1987
  572. X***************
  573. X*** 74,79 ****
  574. X--- 74,80 ----
  575. X       Object overflow, underflow, *stack_body;
  576. X   } *Stack, StackOb;
  577. X   
  578. X+ Object NoAccess (); /* jgm */
  579. X  Object SameFlags (), MakeObject (), Cvx (), Cvlit (), ReadOnly (), WriteOnly (), ExecOnly ();
  580. X  int OpCheck (), min (), rCheck (), wCheck (), xCheck ();
  581. X  Object MakeArray (), ParseArray (), getArray (), getIArray (), *BodyArray ();
  582. X***************
  583. X*** 164,166 ****
  584. X--- 165,170 ----
  585. X      ((getchbuf = getc (BodyFile(file)->f.f_ptr)), \
  586. X          ((getchbuf != EOF) ? getchbuf : ((BodyFile(file)->available = 0), Close (file), EOF))) \
  587. X      : GeneralGetch (file))
  588. X+ 
  589. X+ /* Next line --jgm */
  590. X+ #define PanicIf(flag,s) do { if (flag) Panic(s); } while (0)
  591. Xdiff -cr orig/source/math.c ./source/math.c
  592. X*** orig/source/math.c    Sun Jan  3 14:20:43 1988
  593. X--- ./source/math.c    Fri Dec 11 22:54:46 1987
  594. X***************
  595. X*** 108,113 ****
  596. X--- 108,115 ----
  597. X        {
  598. X            int olength = length, dval;
  599. X            
  600. X+         if (length == 0) return MakeReal (sign * (double)ival); /*jgm*/
  601. X+ 
  602. X          fval = ival;
  603. X           dval = ParseInteger (&s, &length, 10);
  604. X           fval += dval * pow (10.0, (float)(length - olength));
  605. Xdiff -cr orig/source/makefile ./source/makefile
  606. X*** orig/source/makefile    Sun Jan  3 14:19:33 1988
  607. X--- ./source/makefile    Sun Jan  3 15:37:00 1988
  608. X***************
  609. X*** 4,16 ****
  610. X  LIBS=libww.a -lsuntool -lsunwindow -lpixrect -g
  611. X  GRAPHICS=cache.o colour.o device.o fill.o font.o gsave.o image.o mat.o matrix.o\
  612. X      pat.o path.o state.o stroke.o
  613. X  CFLAGS=-O
  614. X  
  615. X  PS:    $(OBJECTS) $(GRAPHICS) hard.o canon.a
  616. X      cc $(CFLAGS)  $(OBJECTS) $(GRAPHICS) hard.o canon.a -lm `libs` -o PS
  617. X  
  618. X! sunPS:    $(OBJECTS) $(GRAPHICS) hard.o canon.a pixrect
  619. X!     cc $(CFLAGS)  $(OBJECTS) $(GRAPHICS) hard.o canon.a -lm -lpixrect -o sunPS
  620. X  
  621. X  CPS:    $(OBJECTS) $(GRAPHICS) colour-ww.o trapezoid.o canon.o
  622. X      cc $(CFLAGS)  $(OBJECTS) $(GRAPHICS) colour-ww.o canon.o trapezoid.o -lm `libs` -o CPS
  623. X--- 4,23 ----
  624. X  LIBS=libww.a -lsuntool -lsunwindow -lpixrect -g
  625. X  GRAPHICS=cache.o colour.o device.o fill.o font.o gsave.o image.o mat.o matrix.o\
  626. X      pat.o path.o state.o stroke.o
  627. X+ 
  628. X+ # For SUN with 68881
  629. X+ #CFLAGS=-O -f68881
  630. X+ 
  631. X+ # For others
  632. X  CFLAGS=-O
  633. X  
  634. X+ #default: sunPS
  635. X+ 
  636. X  PS:    $(OBJECTS) $(GRAPHICS) hard.o canon.a
  637. X      cc $(CFLAGS)  $(OBJECTS) $(GRAPHICS) hard.o canon.a -lm `libs` -o PS
  638. X  
  639. X! sunPS:    $(OBJECTS) $(GRAPHICS) pixrect.o canon.a
  640. X!     cc $(CFLAGS)  $(OBJECTS) $(GRAPHICS) pixrect.o canon.a -lm -lpixrect -o sunPS
  641. X  
  642. X  CPS:    $(OBJECTS) $(GRAPHICS) colour-ww.o trapezoid.o canon.o
  643. X      cc $(CFLAGS)  $(OBJECTS) $(GRAPHICS) colour-ww.o canon.o trapezoid.o -lm `libs` -o CPS
  644. X***************
  645. X*** 31,39 ****
  646. X  all:    PS postscript viewer
  647. X  
  648. X  ww:    ww.o wwlib installww
  649. X- 
  650. X- pixrect:    pixrect.o
  651. X-     cp pixrect.o hard.o
  652. X  
  653. X  sun:    ww wwsun
  654. X  
  655. X--- 38,43 ----
  656. Xdiff -cr orig/source/misc.c ./source/misc.c
  657. X*** orig/source/misc.c    Sun Jan  3 14:19:36 1988
  658. X--- ./source/misc.c    Sun Dec 13 22:03:56 1987
  659. X***************
  660. X*** 17,27 ****
  661. X--- 17,29 ----
  662. X  #endif
  663. X  
  664. X  static int PUserTime ();
  665. X+ static int PGetEnv (); /*jgm*/
  666. X       
  667. X  InitMisc ()
  668. X   {
  669. X        InstallOp ("usertime",    PUserTime,    0, 1, 0, 0);
  670. X       InstallOp ("==",     PolyFirst,     1, 1, 0, 0, Poly);
  671. X+     InstallOp ("getenv",    PGetEnv,    1, 1, 0, 0, String); /*jgm*/
  672. X    }
  673. X  
  674. X  static int PUserTime ()
  675. X***************
  676. X*** 32,34 ****
  677. X--- 34,49 ----
  678. X      times (&tbuf);
  679. X       return Push (OpStack, MakeInteger ((int) (tbuf.tms_utime * 1000 / HZ)));
  680. X   }
  681. X+ 
  682. X+ /* PGetEnv by jgm */
  683. X+ static int PGetEnv(string) Object string;
  684. X+ {
  685. X+     char *s, *getenv();
  686. X+ 
  687. X+     s = getenv(BodyString(string));
  688. X+ 
  689. X+     if (s != NULL) {
  690. X+     VOID Push(OpStack, MakeString(s, strlen(s)));
  691. X+     }
  692. X+ 
  693. X+     return Push(OpStack, MakeBoolean(s != NULL));
  694. Xdiff -cr orig/source/string.c ./source/string.c
  695. X*** orig/source/string.c    Sun Jan  3 14:23:16 1988
  696. X--- ./source/string.c    Sat Dec 12 01:32:44 1987
  697. X***************
  698. X*** 22,27 ****
  699. X--- 22,28 ----
  700. X  static int Exec (), Token (), PString (), Search (), AnchorSearch (), Copy (), EqEq ();
  701. X  static int Length (), ForAll (), Get (), Put (), GetInterval (), PutInterval (), Eq (), Lt (), Le (), Gt (), Ge (), PrCheck (), PwCheck ();
  702. X  static int Cvi (), Cvr (), Cvs (), PReadOnly (), PExecOnly ();
  703. X+ static int PNoAccess (); /* jgm */
  704. X  
  705. X  InitString ()
  706. X   {
  707. X***************
  708. X*** 45,50 ****
  709. X--- 46,52 ----
  710. X       TypeInstallOp (String, "put",         Put,        3, 0, 0, 0, String, Integer, Integer);
  711. X       TypeInstallOp (String, "getinterval",     GetInterval,    3, 1, 0, 0, String, Integer, Integer);
  712. X       TypeInstallOp (String, "putinterval",     PutInterval,    3, 0, 0, 0, String, Integer, String);
  713. X+      TypeInstallOp (String, "noaccess",     PNoAccess,    1, 1, 0, 0, String); /*jgm*/
  714. X       TypeInstallOp (String, "executeonly",     PExecOnly,    1, 1, 0, 0, String);
  715. X       TypeInstallOp (String, "readonly",     PReadOnly,    1, 1, 0, 0, String);
  716. X       TypeInstallOp (String, "rcheck",     PrCheck,    1, 1, 0, 0, String);
  717. X***************
  718. X*** 530,535 ****
  719. X--- 532,543 ----
  720. X      VOID Push (OpStack, False);
  721. X      
  722. X      return TRUE;
  723. X+  }
  724. X+ 
  725. X+ /* PNoAccess by jgm */
  726. X+ static int PNoAccess (item) Object item;
  727. X+  {
  728. X+      return Push (OpStack, NoAccess (item));
  729. X   }
  730. X  
  731. X  static int PExecOnly (item) Object item;
  732. Xdiff -cr orig/source/viewer.c ./source/viewer.c
  733. X*** orig/source/viewer.c    Sun Jan  3 14:21:58 1988
  734. X--- ./source/viewer.c    Thu Dec 10 23:12:55 1987
  735. X***************
  736. X*** 310,318 ****
  737. X       return res;
  738. X   }
  739. X  
  740. X! PanicIf (flag, s) int flag; char *s;
  741. X   {
  742. X-      if (flag)
  743. X           fprintf (stderr, "Viewer panic: %s\n", s),
  744. X           exit (1);
  745. X   }
  746. X--- 310,318 ----
  747. X       return res;
  748. X   }
  749. X  
  750. X! /* Removed conditional & changed PanicIf to Panic --jgm */
  751. X! Panic (s) char *s;
  752. X   {
  753. X           fprintf (stderr, "Viewer panic: %s\n", s),
  754. X           exit (1);
  755. X   }
  756. X*** /dev/null    Mon Jul 25 01:14:13 1988
  757. X--- postscript/demos/buildcachefont.ps    Thu Jul 28 12:25:02 1988
  758. X***************
  759. X*** 0 ****
  760. X--- 1,19 -----
  761. X+ %!
  762. X+ %% Build the font cache
  763. X+ %% By John G. Myers
  764. X+ 
  765. X+ % fontname pointsize cachefont --
  766. X+ /cachefont {
  767. X+     exch findfont exch scalefont setfont
  768. X+     5 5 moveto
  769. X+     ( !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ) show
  770. X+     ([\\]^_`abcdefghijklmnopqrstuvwxyz{|}~) show
  771. X+     (\251\252\256\257\261\267\272\320) show
  772. X+     savecurrentfont
  773. X+     erasepage
  774. X+ } def
  775. X+ 
  776. X+ [  /Times-Roman /Helvetica /Times-Bold /Times-Italic /Helvetica-Oblique ]
  777. X+ { dup 10 cachefont dup 12 cachefont 14 cachefont }
  778. X+ forall
  779. X+ 
  780. END_OF_ps.diff.v1
  781. if test 20227 -ne `wc -c <ps.diff.v1`; then
  782.     echo shar: \"ps.diff.v1\" unpacked with wrong size!
  783. fi
  784. # end of overwriting check
  785. fi
  786. if test -f ps.diff.v2 -a "${1}" != "-c" ; then 
  787.   echo shar: Will not over-write existing file \"ps.diff.v2\"
  788. else
  789. echo shar: Extracting \"ps.diff.v2\" \(18523 characters\)
  790. sed "s/^X//" >ps.diff.v2 <<'END_OF_ps.diff.v2'
  791. XMake sure you have already applied either 'ps.diff.v1' or my
  792. Xoriginal posting to comp.sources.bugs.
  793. X
  794. XTo apply this, you need the 'patch' program which is available from
  795. Xthe comp.sources.unix archives.
  796. X
  797. XChange directories to the top-level postscript directory (the one with
  798. Xthe file "MANIFEST" in it) and apply this patch with the command:
  799. X
  800. Xpatch -p0 <ps.diff.v2
  801. X
  802. X                _.John G. Myers
  803. X                jm36+@andrew.cmu.edu
  804. X
  805. X*** /usr/tmp/ps/CHANGES.JGM    Thu Jul 28 13:53:12 1988
  806. X--- ./CHANGES.JGM    Thu Jul 28 14:58:10 1988
  807. X***************
  808. X*** 1,6 ****
  809. X! Here is a patch that makes several bug fixes and enhancements to the Postscript
  810. X  interpreter recently posted.  The changes are:
  811. X  
  812. X  
  813. X  Bugs fixed:
  814. X  
  815. X--- 1,7 ----
  816. X! These patches make several bug fixes and enhancements to the Postscript
  817. X  interpreter recently posted.  The changes are:
  818. X  
  819. X+                   Version 1:
  820. X  
  821. X  Bugs fixed:
  822. X  
  823. X***************
  824. X*** 41,46 ****
  825. X--- 42,64 ----
  826. X      <string> getenv <false>
  827. X  if it does not.
  828. X  
  829. X+                   Version 2:
  830. X+ 
  831. X+ Bugs fixed:
  832. X+ 
  833. X+ Fixed operators kshow, translate, scale, rotate, reversepath
  834. X+ 
  835. X+ Casted NULL to appropriate type when it was passed as a parameter.
  836. X+ 
  837. X+ Removed unused variables.
  838. X+ 
  839. X+ Enhancements made:
  840. X+ 
  841. X+ Each driver must now define the character pointer "DriverType".  The
  842. X+ value of this variable is placed in the string produced by the
  843. X+ "version" operator.
  844. X+ 
  845. X+ Added operators letter, note, and legal.
  846. X  
  847. X                  John G. Myers
  848. X                  jm36@andrew.cmu.edu
  849. Xdiff -cr ./doc/hard-interface /cmu/math/jm36/src/ps/doc/hard-interface
  850. X*** ./doc/hard-interface    Fri Apr  1 22:41:07 1988
  851. X--- /cmu/math/jm36/src/ps/doc/hard-interface    Mon Mar 28 20:25:28 1988
  852. X***************
  853. X*** 15,20 ****
  854. X--- 15,29 ----
  855. X   *    may be expected to be NULL.
  856. X   */
  857. X  
  858. X+ /* Begin jgm */
  859. X+ /*
  860. X+  *    DriverType contains a pointer to a string naming the device that this
  861. X+  *     is a driver for.  The given string will show up in the "version"
  862. X+  *    operator.
  863. X+  */
  864. X+ char *DriverType = "";
  865. X+ /* End jgm */
  866. X+ 
  867. X  /************************* CREATION OF WINDOWS AND BITMAPS *******************/
  868. X  
  869. X  struct hardware *InitHardware () {}
  870. Xdiff -cr ./doc/hard-interface.c /cmu/math/jm36/src/ps/doc/hard-interface.c
  871. X*** ./doc/hard-interface.c    Fri Apr  1 22:42:05 1988
  872. X--- /cmu/math/jm36/src/ps/doc/hard-interface.c    Mon Mar 28 20:24:19 1988
  873. X***************
  874. X*** 17,22 ****
  875. X--- 17,31 ----
  876. X   *    of access that PostScript is interested in. Any Hardware parameter may be expected to be NULL.
  877. X   */
  878. X  
  879. X+ /* Begin jgm */
  880. X+ /*
  881. X+  *    DriverType contains a pointer to a string naming the device that this
  882. X+  *     is a driver for.  The given string will show up in the "version"
  883. X+  *    operator.
  884. X+  */
  885. X+ char *DriverType = "";
  886. X+ /* End jgm */
  887. X+ 
  888. X  /*********************************** CREATION OF WINDOWS AND BITMAPS *******************/
  889. X  
  890. X  struct hardware *InitHardware () {}
  891. Xdiff -cr ./postscript/psrc /cmu/math/jm36/src/ps/postscript/psrc
  892. X*** ./postscript/psrc    Fri Apr  1 22:48:12 1988
  893. X--- /cmu/math/jm36/src/ps/postscript/psrc    Wed Mar 23 23:05:53 1988
  894. X***************
  895. X*** 125,130 ****
  896. X--- 141,148 ----
  897. X  } def
  898. X  
  899. X  /kshow {
  900. X+     exch    % jgm
  901. X+ 
  902. X      showdict begin /p exch def
  903. X          dup length 0 ne {
  904. X              dup 0 get /last exch def
  905. X***************
  906. X*** 132,137 ****
  907. X--- 150,156 ----
  908. X              dup length 1 sub 1 exch getinterval {
  909. X                  last exch dup /last exch def
  910. X                  /p load exec
  911. X+                 ( ) dup 0 last put show  % jgm
  912. X              } forall
  913. X          } if
  914. X      end
  915. X***************
  916. X*** 467,472 ****
  917. X--- 493,526 ----
  918. X      [ 0 f f 0 0 0] w h [] framedevice
  919. X      end
  920. X  } def
  921. X+ 
  922. X+ % Begin additions --jgm
  923. X+ 
  924. X+ /letter {
  925. X+     5 dict begin
  926. X+     /m [1.13889 0 0 -1.13889 0 0] def
  927. X+     /f m 0 get def
  928. X+     /h 11 72 mul f mul cvi def
  929. X+     /w 8.5 72 mul f mul 8 div cvi def
  930. X+     m 5 h put
  931. X+     m w h [] framedevice
  932. X+     end
  933. X+ } def
  934. X+ 
  935. X+ /note { letter } def
  936. X+ 
  937. X+ /legal {
  938. X+     5 dict begin
  939. X+     /m [1.13889 0 0 -1.13889 0 0] def
  940. X+     /f m 0 get def
  941. X+     /h 14 72 mul f mul cvi def
  942. X+     /w 8.5 72 mul f mul 8 div cvi def
  943. X+     m 5 h put
  944. X+     m w h [] framedevice
  945. X+     end
  946. X+ } def
  947. X+ 
  948. X+ % End additions --jgm
  949. X  
  950. X  /ascii-set ( !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~) def
  951. X  
  952. Xdiff -cr ./source/X.c /cmu/math/jm36/src/ps/source/X.c
  953. X*** ./source/X.c    Fri Apr  1 22:44:35 1988
  954. X--- /cmu/math/jm36/src/ps/source/X.c    Fri Mar 11 23:39:36 1988
  955. X***************
  956. X*** 17,22 ****
  957. X--- 17,24 ----
  958. X  #define TRANSFER_SIZE    256
  959. X  #define XMAX        65535
  960. X  
  961. X+ char *DriverType = "X10"; /* jgm */
  962. X+ 
  963. X  static int transfer [TRANSFER_SIZE + 1];
  964. X  
  965. X  static unsigned char reverse [0x100];
  966. Xdiff -cr ./source/array.c /cmu/math/jm36/src/ps/source/array.c
  967. X*** ./source/array.c    Fri Apr  1 22:48:17 1988
  968. X--- /cmu/math/jm36/src/ps/source/array.c    Sun Mar  6 17:16:25 1988
  969. X***************
  970. X*** 85,94 ****
  971. X--- 85,96 ----
  972. X       return res;
  973. X   }
  974. X  
  975. X+ #ifdef notdef /* jgm */
  976. X  static Object *Body (item) Object item;
  977. X   {
  978. X       return item.u.Array;
  979. X   }
  980. X+ #endif /* jgm */
  981. X  
  982. X  #define Body(a) ((a).u.Array)
  983. X  
  984. Xdiff -cr ./source/config.c /cmu/math/jm36/src/ps/source/config.c
  985. X*** ./source/config.c    Fri Apr  1 22:48:20 1988
  986. X--- /cmu/math/jm36/src/ps/source/config.c    Sat Mar 12 00:08:51 1988
  987. X***************
  988. X*** 20,30 ****
  989. X  Type Real, Name, Operator, String, Poly, Float, FontID;
  990. X  
  991. X  extern Object Absent, Nil, SysDict;
  992. X  
  993. X! char default_library[] = "/usr/ral/lib/postscript";
  994. X  
  995. X  Init ()
  996. X   {    
  997. X      Nil     = MakeObject ((Type) 0);
  998. X      Null          = Nil.type = MakeType (SizeNull);
  999. X      EmptyDict (Null);    /* needed because of this recursion */
  1000. X--- 20,33 ----
  1001. X  Type Real, Name, Operator, String, Poly, Float, FontID;
  1002. X  
  1003. X  extern Object Absent, Nil, SysDict;
  1004. X+ extern char *DriverType;
  1005. X  
  1006. X! char default_library[] = "/usr/ral/lib/postscript";
  1007. X  
  1008. X  Init ()
  1009. X   {    
  1010. X+     char versionbuf[1024]; /* --jgm */
  1011. X+ 
  1012. X      Nil     = MakeObject ((Type) 0);
  1013. X      Null          = Nil.type = MakeType (SizeNull);
  1014. X      EmptyDict (Null);    /* needed because of this recursion */
  1015. X***************
  1016. X*** 87,91 ****
  1017. X       Install ("polytype",        DictFrom (Poly));
  1018. X      Install ("fonttype",        DictFrom (FontID));
  1019. X      
  1020. X!     Install ("version",    StringFrom ("Version 1.4 with mods by jgm")); /* jgm */
  1021. X   }
  1022. X--- 90,98 ----
  1023. X       Install ("polytype",        DictFrom (Poly));
  1024. X      Install ("fonttype",        DictFrom (FontID));
  1025. X      
  1026. X!     /* Begin jgm */
  1027. X!     strcpy(versionbuf, DriverType);
  1028. X!     strcat(versionbuf, " version 1.4 with jgm mods v2");
  1029. X!     Install ("version",    StringFrom (versionbuf));
  1030. X!     /* End jgm */
  1031. X   }
  1032. Xdiff -cr ./source/device.c /cmu/math/jm36/src/ps/source/device.c
  1033. X*** ./source/device.c    Fri Apr  1 22:41:29 1988
  1034. X--- /cmu/math/jm36/src/ps/source/device.c    Sun Mar  6 17:29:48 1988
  1035. X***************
  1036. X*** 200,206 ****
  1037. X           UnlinkDevice (d);
  1038. X        }
  1039. X       else
  1040. X!          */BitBlt (NULL, res->dev, NewDevicePoint (0, 0), NewDevicePoint (0, 0), ex, ROP_FALSE);
  1041. X       
  1042. X       return res;
  1043. X   }
  1044. X--- 200,206 ----
  1045. X           UnlinkDevice (d);
  1046. X        }
  1047. X       else
  1048. X!          */BitBlt ((struct hardware *)NULL, res->dev, NewDevicePoint (0, 0), NewDevicePoint (0, 0), ex, ROP_FALSE); /* cast NULL --jgm */
  1049. X       
  1050. X       return res;
  1051. X   }
  1052. Xdiff -cr ./source/file.c /cmu/math/jm36/src/ps/source/file.c
  1053. X*** ./source/file.c    Fri Apr  1 22:45:31 1988
  1054. X--- /cmu/math/jm36/src/ps/source/file.c    Sun Mar  6 17:16:15 1988
  1055. X***************
  1056. X*** 168,184 ****
  1057. X--- 168,188 ----
  1058. X  
  1059. X  #define Getc(a) getc(a)
  1060. X  
  1061. X+ #ifdef notdef /* jgm */
  1062. X  static int Getchar ()
  1063. X   {
  1064. X       return Getc (stdin);
  1065. X   }
  1066. X+ #endif /* jgm */
  1067. X  
  1068. X  #define Getchar getchar
  1069. X  
  1070. X+ #ifdef notdef /* jgm */
  1071. X  static int Status (file) Object file;
  1072. X   {
  1073. X       return Body (file)->available;
  1074. X   }
  1075. X+ #endif /* jgm */
  1076. X  
  1077. X  #define Status(f) (Body(f)->available)
  1078. X  
  1079. X***************
  1080. X*** 306,312 ****
  1081. X       Cbreak (FALSE);
  1082. X   }
  1083. X  
  1084. X! static cbreak = FALSE, echoing = TRUE;
  1085. X  
  1086. X  /*ARGSUSED*/
  1087. X  Cbreak (cond) int cond;
  1088. X--- 310,316 ----
  1089. X       Cbreak (FALSE);
  1090. X   }
  1091. X  
  1092. X! static /* cbreak = FALSE, (removed --jgm) */ echoing = TRUE;
  1093. X  
  1094. X  /*ARGSUSED*/
  1095. X  Cbreak (cond) int cond;
  1096. Xdiff -cr ./source/fill.c /cmu/math/jm36/src/ps/source/fill.c
  1097. X*** ./source/fill.c    Fri Apr  1 22:44:44 1988
  1098. X--- /cmu/math/jm36/src/ps/source/fill.c    Sun Mar  6 17:46:45 1988
  1099. X***************
  1100. X*** 149,155 ****
  1101. X       UnlinkDevice (gstate->clipdevice);
  1102. X        gstate->clipdevice = NULL;
  1103. X        
  1104. X!      SetClipHardware (gstate->device->dev, NULL);
  1105. X      
  1106. X      return TRUE;
  1107. X   }
  1108. X--- 149,155 ----
  1109. X       UnlinkDevice (gstate->clipdevice);
  1110. X        gstate->clipdevice = NULL;
  1111. X        
  1112. X!      SetClipHardware (gstate->device->dev, (struct hardware *)NULL); /* cast NULL --jgm */
  1113. X      
  1114. X      return TRUE;
  1115. X   }
  1116. X***************
  1117. X*** 226,232 ****
  1118. X  static int FillIt (path_a, rule_a, path_b, rule_b, emitfn)
  1119. X      Path path_a, path_b; int (*rule_a)(), (*rule_b)(); void (*emitfn)();
  1120. X   {
  1121. X!     Path new;
  1122. X      static int edgecmp ();
  1123. X      static void Trapezoids (), BuildEdgeList ();
  1124. X      
  1125. X--- 226,232 ----
  1126. X  static int FillIt (path_a, rule_a, path_b, rule_b, emitfn)
  1127. X      Path path_a, path_b; int (*rule_a)(), (*rule_b)(); void (*emitfn)();
  1128. X   {
  1129. X!     /* Path new; (unused --jgm) */
  1130. X      static int edgecmp ();
  1131. X      static void Trapezoids (), BuildEdgeList ();
  1132. X      
  1133. X***************
  1134. X*** 288,298 ****
  1135. X   {
  1136. X      struct edge *up_edge;
  1137. X      int i, count_a = 0, count_b = 0;
  1138. X!     static void RemoveEdges ();
  1139. X      
  1140. X      for (i = 0; i < ninteresting; i++)
  1141. X       {
  1142. X!          static void Emit ();
  1143. X           int d_a = 0, d_b = 0;
  1144. X           
  1145. X           if (interesting[i]->clip)
  1146. X--- 288,298 ----
  1147. X   {
  1148. X      struct edge *up_edge;
  1149. X      int i, count_a = 0, count_b = 0;
  1150. X!     /* static void RemoveEdges (); (unused --jgm) */
  1151. X      
  1152. X      for (i = 0; i < ninteresting; i++)
  1153. X       {
  1154. X!          /* static void Emit (); (unused --jgm) */
  1155. X           int d_a = 0, d_b = 0;
  1156. X           
  1157. X           if (interesting[i]->clip)
  1158. Xdiff -cr ./source/font.c /cmu/math/jm36/src/ps/source/font.c
  1159. X*** ./source/font.c    Fri Apr  1 22:45:11 1988
  1160. X--- /cmu/math/jm36/src/ps/source/font.c    Sun Mar  6 17:11:46 1988
  1161. X***************
  1162. X*** 535,541 ****
  1163. X       for (;;)
  1164. X       {
  1165. X           int code = *++s;
  1166. X!          HardPoint offset, cp;
  1167. X           
  1168. X           offset = Adjust (DExtToInt (last_width), code);
  1169. X          loc.hx += offset.hx;
  1170. X--- 535,541 ----
  1171. X       for (;;)
  1172. X       {
  1173. X           int code = *++s;
  1174. X!          HardPoint offset/* , cp (unused --jgm) */;
  1175. X           
  1176. X           offset = Adjust (DExtToInt (last_width), code);
  1177. X          loc.hx += offset.hx;
  1178. Xdiff -cr ./source/gsave.c /cmu/math/jm36/src/ps/source/gsave.c
  1179. X*** ./source/gsave.c    Fri Apr  1 22:39:48 1988
  1180. X--- /cmu/math/jm36/src/ps/source/gsave.c    Sun Mar  6 17:34:40 1988
  1181. X***************
  1182. X*** 75,81 ****
  1183. X                SetScreen (gstate->screen.frequency, gstate->screen.rotation, gstate->screen.thresh);
  1184. X            if (tflag)
  1185. X                SetTransfer (gstate->transfer.tran);
  1186. X!           SetClipHardware (gstate->device->dev, (gstate->clipdevice ? gstate->clipdevice->dev : NULL));
  1187. X       }
  1188. X       
  1189. X       return TRUE;
  1190. X--- 75,81 ----
  1191. X                SetScreen (gstate->screen.frequency, gstate->screen.rotation, gstate->screen.thresh);
  1192. X            if (tflag)
  1193. X                SetTransfer (gstate->transfer.tran);
  1194. X!           SetClipHardware (gstate->device->dev, (gstate->clipdevice ? gstate->clipdevice->dev : (struct hardware *)NULL)); /* Cast NULL --jgm */
  1195. X       }
  1196. X       
  1197. X       return TRUE;
  1198. Xdiff -cr ./source/image.c /cmu/math/jm36/src/ps/source/image.c
  1199. X*** ./source/image.c    Fri Apr  1 22:48:26 1988
  1200. X--- /cmu/math/jm36/src/ps/source/image.c    Sun Mar  6 17:34:36 1988
  1201. X***************
  1202. X*** 250,256 ****
  1203. X                      FillMask (mask, i, dep);
  1204. X                     
  1205. X                     BitBlt (from, mask, NewDevicePoint (0, 0), NewDevicePoint (0, 0), HardwareExtent (from), ROP_NXOR);
  1206. X!                    BitBlt (NULL, temp, NewDevicePoint (0, 0), NewDevicePoint (0, 0), HardwareExtent (temp), ROP_TRUE);
  1207. X                      for (j = 0; j < dep; j++)
  1208. X                          BitBlt (mask, temp, NewDevicePoint (j, 0), NewDevicePoint (0, 0), HardwareExtent (mask), ROP_AND);
  1209. X                      for (j = 0; j < w; j++)
  1210. X--- 250,256 ----
  1211. X                      FillMask (mask, i, dep);
  1212. X                     
  1213. X                     BitBlt (from, mask, NewDevicePoint (0, 0), NewDevicePoint (0, 0), HardwareExtent (from), ROP_NXOR);
  1214. X!                    BitBlt ((struct  hardware *)NULL, temp, NewDevicePoint (0, 0), NewDevicePoint (0, 0), HardwareExtent (temp), ROP_TRUE);  /* cast NULL --jgm */
  1215. X                      for (j = 0; j < dep; j++)
  1216. X                          BitBlt (mask, temp, NewDevicePoint (j, 0), NewDevicePoint (0, 0), HardwareExtent (mask), ROP_AND);
  1217. X                      for (j = 0; j < w; j++)
  1218. Xdiff -cr ./source/matrix.c /cmu/math/jm36/src/ps/source/matrix.c
  1219. X*** ./source/matrix.c    Fri Apr  1 22:43:11 1988
  1220. X--- /cmu/math/jm36/src/ps/source/matrix.c    Wed Mar 23 22:40:28 1988
  1221. X***************
  1222. X*** 126,131 ****
  1223. X--- 126,132 ----
  1224. X  static int PTranslate ()
  1225. X   {
  1226. X       Object tx, ty, mat;
  1227. X+     Matrix m;
  1228. X       float x, y;
  1229. X       
  1230. X       if (!OpCheck (2, 1))
  1231. X***************
  1232. X*** 136,141 ****
  1233. X--- 137,144 ----
  1234. X                return Push (OpStack, mat), Error (PInvAccess);
  1235. X           else if (lengthArray (mat) != 6)
  1236. X                return Push (OpStack, mat), Error (PRangeCheck);
  1237. X+         else if    (!ExtractMatrix    (&m, mat))  /* --jgm */
  1238. X+                 return Push (OpStack, mat), Error (PTypeCheck); /* --jgm */
  1239. X           else
  1240. X            {
  1241. X                ty = Pop (OpStack);
  1242. X***************
  1243. X*** 153,159 ****
  1244. X                else
  1245. X                     return Push (OpStack, tx), Push (OpStack, ty), Push (OpStack, mat), Error (PTypeCheck);
  1246. X               
  1247. X!               VOID AssignMatrix (mat, NewMatrix (1.0, 0.0, 0.0, 1.0, x, y));
  1248. X                
  1249. X                return Push (OpStack, mat);
  1250. X            }
  1251. X--- 156,164 ----
  1252. X                else
  1253. X                     return Push (OpStack, tx), Push (OpStack, ty), Push (OpStack, mat), Error (PTypeCheck);
  1254. X               
  1255. X! /*              VOID AssignMatrix (mat, NewMatrix (1.0, 0.0, 0.0, 1.0, x, y)); WRONG --jgm */
  1256. X!               VOID AssignMatrix (mat, Translate(m, x, y)); /* --jgm */
  1257. X! 
  1258. X                
  1259. X                return Push (OpStack, mat);
  1260. X            }
  1261. X***************
  1262. X*** 178,184 ****
  1263. X  static int PScale ()
  1264. X   {
  1265. X       Object tx, ty, mat;
  1266. X!      float x, y;
  1267. X       
  1268. X       if (!OpCheck (2, 1))
  1269. X           return FALSE;
  1270. X--- 183,190 ----
  1271. X  static int PScale ()
  1272. X   {
  1273. X       Object tx, ty, mat;
  1274. X!     Matrix m; /* --jgm */
  1275. X!     float x, y;
  1276. X       
  1277. X       if (!OpCheck (2, 1))
  1278. X           return FALSE;
  1279. X***************
  1280. X*** 188,193 ****
  1281. X--- 194,201 ----
  1282. X                return Push (OpStack, mat), Error (PInvAccess);
  1283. X           else if (lengthArray (mat) != 6)
  1284. X                return Push (OpStack, mat), Error (PRangeCheck);
  1285. X+         else if    (!ExtractMatrix    (&m, mat))  /* --jgm */
  1286. X+                 return Push (OpStack, mat), Error (PTypeCheck); /* --jgm */
  1287. X           else
  1288. X            {
  1289. X               ty = Pop (OpStack);
  1290. X***************
  1291. X*** 205,211 ****
  1292. X                else
  1293. X                     return Push (OpStack, tx), Push (OpStack, ty), Push (OpStack, mat), Error (PTypeCheck);
  1294. X               
  1295. X!               VOID AssignMatrix (mat, NewMatrix (x, 0.0, 0.0, y, 0.0, 0.0));
  1296. X                
  1297. X                return Push (OpStack, mat);
  1298. X            }
  1299. X--- 213,220 ----
  1300. X                else
  1301. X                     return Push (OpStack, tx), Push (OpStack, ty), Push (OpStack, mat), Error (PTypeCheck);
  1302. X               
  1303. X! /*              VOID AssignMatrix (mat, NewMatrix (x, 0.0, 0.0, y, 0.0, 0.0)); WRONG --jgm */
  1304. X!               VOID AssignMatrix (mat, Scale(m, x, y)); /* --jgm */
  1305. X                
  1306. X                return Push (OpStack, mat);
  1307. X            }
  1308. X***************
  1309. X*** 249,256 ****
  1310. X                    a = BodyReal (ang);
  1311. X                else
  1312. X                    return Push (OpStack, ang), Push (OpStack, mat), Error (PTypeCheck);
  1313. X!               
  1314. X!               VOID AssignMatrix (mat, NewMatrix (cos(a), sin(a), -sin(a), -cos(a), 0.0, 0.0));
  1315. X                
  1316. X                return Push (OpStack, mat);
  1317. X            }
  1318. X--- 258,265 ----
  1319. X                    a = BodyReal (ang);
  1320. X                else
  1321. X                    return Push (OpStack, ang), Push (OpStack, mat), Error (PTypeCheck);
  1322. X!               a = Rad(a); /* jgm */
  1323. X!               VOID AssignMatrix (mat, NewMatrix (cos(a), sin(a), -sin(a), cos(a), 0.0, 0.0)); /* last "-cos" changed to "cos" --jgm */
  1324. X                
  1325. X                return Push (OpStack, mat);
  1326. X            }
  1327. Xdiff -cr ./source/name.c /cmu/math/jm36/src/ps/source/name.c
  1328. X*** ./source/name.c    Fri Apr  1 22:39:54 1988
  1329. X--- /cmu/math/jm36/src/ps/source/name.c    Sun Mar  6 17:16:20 1988
  1330. X***************
  1331. X*** 107,113 ****
  1332. X  
  1333. X  static int HashName (s, length) unsigned char *s; int length;
  1334. X   {
  1335. X!     int i, res = 0;
  1336. X      
  1337. X      while (length--)
  1338. X          res += *s++;
  1339. X--- 107,113 ----
  1340. X  
  1341. X  static int HashName (s, length) unsigned char *s; int length;
  1342. X   {
  1343. X!     int /* i, (unused --jgm) */ res = 0;
  1344. X      
  1345. X      while (length--)
  1346. X          res += *s++;
  1347. Xdiff -cr ./source/operator.c /cmu/math/jm36/src/ps/source/operator.c
  1348. X*** ./source/operator.c    Fri Apr  1 22:41:54 1988
  1349. X--- /cmu/math/jm36/src/ps/source/operator.c    Sun Mar  6 17:16:23 1988
  1350. X***************
  1351. X*** 69,75 ****
  1352. X   {
  1353. X       Object res;
  1354. X       struct op_struct *op;
  1355. X!      int i;
  1356. X       res = Cvx (MakeObject (Operator));
  1357. X       res.u.Operator = op = (struct op_struct *) Malloc (sizeof (struct op_struct));
  1358. X      
  1359. X--- 69,75 ----
  1360. X   {
  1361. X       Object res;
  1362. X       struct op_struct *op;
  1363. X!      /* int i; (unused --jgm) */
  1364. X       res = Cvx (MakeObject (Operator));
  1365. X       res.u.Operator = op = (struct op_struct *) Malloc (sizeof (struct op_struct));
  1366. X      
  1367. X***************
  1368. X*** 130,139 ****
  1369. X--- 130,141 ----
  1370. X       TypeInstall (type, name, res);
  1371. X   }
  1372. X  
  1373. X+ #ifdef notdef /* jgm */
  1374. X  static struct op_struct *Body (item) Object item;
  1375. X   {
  1376. X       return item.u.Operator;
  1377. X   }
  1378. X+ #endif /* jgm */
  1379. X  
  1380. X  #define Body(op)    ((op).u.Operator)
  1381. X  
  1382. Xdiff -cr ./source/path.c /cmu/math/jm36/src/ps/source/path.c
  1383. X*** ./source/path.c    Fri Apr  1 22:43:14 1988
  1384. X--- /cmu/math/jm36/src/ps/source/path.c    Sat Mar 19 17:00:52 1988
  1385. X***************
  1386. X*** 194,200 ****
  1387. X       
  1388. X       if ((res = ReversePath (gstate->path)) == NULL)
  1389. X           return Error (PLimitCheck);
  1390. X!       SetPath (&gstate->path, res);
  1391. X       return TRUE;    
  1392. X   }
  1393. X  
  1394. X--- 194,201 ----
  1395. X       
  1396. X       if ((res = ReversePath (gstate->path)) == NULL)
  1397. X           return Error (PLimitCheck);
  1398. X!       /* SetPath (&gstate->path, res); --jgm */
  1399. X!     gstate->path = res; /* Don't free gstate->path twice. --jgm */
  1400. X       return TRUE;    
  1401. X   }
  1402. X  
  1403. Xdiff -cr ./source/pixrect.c /cmu/math/jm36/src/ps/source/pixrect.c
  1404. X*** ./source/pixrect.c    Fri Apr  1 22:40:34 1988
  1405. X--- /cmu/math/jm36/src/ps/source/pixrect.c    Fri Mar 11 23:35:16 1988
  1406. X***************
  1407. X*** 15,20 ****
  1408. X--- 15,22 ----
  1409. X  #include "canon.h"
  1410. X  #include <pixrect/pixrect_hs.h>
  1411. X  
  1412. X+ char *DriverType = "Sun pixrect"; /* jgm */
  1413. X+ 
  1414. X  int rop_map [] =
  1415. X   {
  1416. X       PIX_SRC & PIX_NOT (PIX_SRC),
  1417. Xdiff -cr ./source/state.c /cmu/math/jm36/src/ps/source/state.c
  1418. X*** ./source/state.c    Fri Apr  1 22:43:34 1988
  1419. X--- /cmu/math/jm36/src/ps/source/state.c    Sun Mar  6 17:33:19 1988
  1420. X***************
  1421. X*** 114,120 ****
  1422. X  
  1423. X  int ErasePage ()
  1424. X   {
  1425. X!     Paint (NULL, gstate->device->dev,
  1426. X          NewDevicePoint (0, 0), NewDevicePoint (0, 0),
  1427. X          HardwareExtent (gstate->device->dev),
  1428. X          White);
  1429. X--- 114,120 ----
  1430. X  
  1431. X  int ErasePage ()
  1432. X   {
  1433. X!     Paint ((struct hardware *)NULL, gstate->device->dev, /* cast NULL --jgm */
  1434. X          NewDevicePoint (0, 0), NewDevicePoint (0, 0),
  1435. X          HardwareExtent (gstate->device->dev),
  1436. X          White);
  1437. Xdiff -cr ./source/ww.c /cmu/math/jm36/src/ps/source/ww.c
  1438. X*** ./source/ww.c    Fri Apr  1 22:41:00 1988
  1439. X--- /cmu/math/jm36/src/ps/source/ww.c    Fri Mar 11 23:39:23 1988
  1440. X***************
  1441. X*** 14,19 ****
  1442. X--- 14,21 ----
  1443. X  #include "canon.h"
  1444. X  #include "wwinfo.h"
  1445. X  
  1446. X+ char *DriverType = "ww"; /* jgm */
  1447. X+ 
  1448. X  static void xxrasterop ();
  1449. X  
  1450. X  static struct hardware *NewHardware ();
  1451. END_OF_ps.diff.v2
  1452. if test 18523 -ne `wc -c <ps.diff.v2`; then
  1453.     echo shar: \"ps.diff.v2\" unpacked with wrong size!
  1454. fi
  1455. # end of overwriting check
  1456. fi
  1457. echo shar: End of shell archive.
  1458. exit 0
  1459. -- 
  1460. _.John G. Myers        Internet: John.Myers@cs.cmu.edu
  1461.             LoseNet:  ...!seismo!inhp4!wiscvm.wisc.edu!give!up
  1462. "The world is full of bozos.  Some of them even have PhD's in Computer Science"
  1463.