home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / groff / grot / psfig.diff < prev    next >
Encoding:
Text File  |  1991-04-30  |  3.2 KB  |  113 lines

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