/contrib/groff/src/devices/grops/psfig.diff

https://bitbucket.org/freebsd/freebsd-head/ · diff · 106 lines · 94 code · 12 blank · 0 comment · 0 complexity · 3dea56fc4a205ab62c3d04f10fbf2bd2 MD5 · raw file

  1. These are patches to makes psfig work with groff. They apply to the
  2. version of psfig in comp.sources.unix/Volume11. After applying them,
  3. psfig should be recompiled with -DGROFF. The resulting psfig will
  4. work only with groff, so you might want to install it under a
  5. different name. The output of this psfig must be processed using the
  6. macros in the file ../tmac/tmac.psfig. These will automatically add
  7. the necessary PostScript code to the prologue output by grops. Use of
  8. the `global' feature in psfig will result in non-conformant PostScript
  9. which will fail if processed by a page reversal program. Note that
  10. psfig is unsupported by me (I'm not interested in hearing about psfig
  11. problems.) For new documents, I recommend using the PostScript
  12. inclusion features provided by grops.
  13. James Clark
  14. jjc@jclark.com
  15. *** cmds.c.~1~ Thu Feb 14 16:09:45 1991
  16. --- cmds.c Mon Mar 4 12:49:26 1991
  17. ***************
  18. *** 245,253 ****
  19. --- 245,261 ----
  20. (void) sprintf(x, "%.2fp", fx);
  21. (void) sprintf(y, "%.2fp", fy);
  22. } else if (!*x) {
  23. + #ifndef GROFF
  24. (void) sprintf(x,"(%.2fp*%s/%.2fp)", fx, y, fy);
  25. + #else /* GROFF */
  26. + (void) sprintf(x,"(%.0fu*%s/%.0fu)", fx, y, fy);
  27. + #endif /* GROFF */
  28. } else if (!*y) {
  29. + #ifndef GROFF
  30. (void) sprintf(y,"(%.2fp*%s/%.2fp)", fy, x, fx);
  31. + #else /* GROFF */
  32. + (void) sprintf(y,"(%.0fu*%s/%.0fu)", fy, x, fx);
  33. + #endif /* GROFF */
  34. }
  35. /*
  36. *** troff.c.~1~ Thu Feb 14 16:09:48 1991
  37. --- troff.c Mon Mar 4 12:48:46 1991
  38. ***************
  39. *** 26,32 ****
  40. --- 26,36 ----
  41. }
  42. + #ifndef GROFF
  43. char incl_file_s[] = "\\X'f%s'";
  44. + #else /* GROFF */
  45. + char incl_file_s[] = "\\X'ps: file %s'";
  46. + #endif /* GROFF */
  47. includeFile(filenm)
  48. char *filenm; {
  49. printf(incl_file_s, filenm);
  50. ***************
  51. *** 40,52 ****
  52. --- 44,64 ----
  53. error("buffer overflow");
  54. }
  55. + #ifndef GROFF
  56. char endfig_s[] = "\\X'pendFig'";
  57. + #else /* GROFF */
  58. + char endfig_s[] = "\\X'ps: exec psfigend'";
  59. + #endif /* GROFF */
  60. endfig() {
  61. printf(endfig_s);
  62. }
  63. char startfig_s[] =
  64. + #ifndef GROFF
  65. "\\X'p\\w@\\h@%s@@'\\X'p\\w@\\h@%s@@'\\X'p%.2f'\\X'p%.2f'\\X'p%.2f'\\X'p%.2f'\\X'pstartFig'";
  66. + #else /* GROFF */
  67. + "\\X'ps: exec \\w@\\h@%s@@ \\w@\\h@%s@@ %.2f %.2f %.2f %.2f psfigstart'";
  68. + #endif /* GROFF */
  69. startfig(x, y, llx, lly, urx, ury)
  70. char *x, *y;
  71. ***************
  72. *** 57,63 ****
  73. --- 69,79 ----
  74. }
  75. emitDoClip() {
  76. + #ifndef GROFF
  77. printf("\\X'pdoclip'");
  78. + #else /* GROFF */
  79. + printf("\\X'ps: exec psfigclip'");
  80. + #endif /* GROFF */
  81. }
  82. flushX()
  83. ***************
  84. *** 116,122 ****
  85. --- 132,142 ----
  86. #define isWhite(ch) ((ch) == ' ' || (ch) == '\t' || (ch) == '\n')
  87. + #ifndef GROFF
  88. char literal_s[] = "\\X'p%s'";
  89. + #else /* GROFF */
  90. + char literal_s[] = "\\X'ps: exec %s'";
  91. + #endif /* GROFF */
  92. emitLiteral(text)
  93. char *text; {
  94. static char litbuf[BUFSZ];