home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2006 < prev    next >
Internet Message Format  |  1990-12-28  |  26KB

  1. From: hot@integow.uucp (Roland van Hout)
  2. Newsgroups: alt.sources
  3. Subject: PD plot(4) librarys (and hercules driver for interactive 386) part 3 of 9
  4. Message-ID: <1391@integow.uucp>
  5. Date: 28 Oct 90 03:53:10 GMT
  6.  
  7.  
  8. #!/bin/sh
  9. # This is part 03 of a multipart archive
  10. if touch 2>&1 | fgrep '[-amc]' > /dev/null
  11.  then TOUCH=touch
  12.  else TOUCH=true
  13. fi
  14. # ============= libplot/lp/charset.0 ==============
  15. echo "x - extracting libplot/lp/charset.0 (Text)"
  16. sed 's/^X//' << 'SHAR_EOF' > libplot/lp/charset.0 &&
  17. X   2,0, 100, 0,0, -100, 0,2, 100, 0,6, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ! */
  18. X   1,6, 100, 1,2, -100, 1,-2, 100, 1,2, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* " */
  19. X   1,1, 100, 0,6, -100, 2,0, 100, 0,-6, -100, 1,2, 100, -4,0, -100, 0,2, 100, 4,0, -200,-200,-200,-200,-200 /* # */
  20. X   0,2, 100, 1,-1, 2,0, 1,1, 0,1, -4,2, 0,1, 1,1, 2,0, 1,-1, -100, -2,2, 100, 0,-8, -200 /* $ */
  21. X   0,2, 100, 3,4, -100, -2,0, 100, -1,-1, 0,1, 1,0, -100, 2,-3, 100, 0,-1, -1,0, 1,1, -200,-200,-200 /* % */
  22. X   4,0, 100, -3,5, 0,2, 1,1, 1,-1, 0,-2, -3,-2, 0,-2, 1,-1, 2,0, 1,2, -200,-200,-200,-200,-200 /* & */
  23. X   1,6, 100, 1,2, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ' */
  24. X   3,0, 100, -1,2, 0,4, 1,2, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ( */
  25. X   1,0, 100, 1,2, 0,4, -1,2, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ) */
  26. X   0,2, 100, 4,4, -100, -4,0, 100, 4,-4, -100, -2,0, 100, 0,4, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* * */
  27. X   2,2, 100, 0,4, -100, -2,-2, 100, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* + */
  28. X   2,0, 100, -1,0, 0,1, 1,0, 0,-1, -1,-1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* , */
  29. X   0,4, 100, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* - */
  30. X   1,0, 100, 0,1, 1,0, 0,-1, -1,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* . */
  31. X   0,1, 100, 3,6, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* / */
  32. X   1,0, 100, -1,3, 0,2, 1,3, 2,0, 1,-3, 0,-2, -1,-3, -2,0, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* 0 */
  33. X   1,0, 100, 2,0, -1,0, 0,8, -1,-1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* 1 */
  34. X   4,0, 100, -4,0, 0,1, 1,2, 2,1, 1,1, 0,2, -1,1, -2,0, -1,-1, 0,-1, -200,-200,-200,-200,-200 /* 2 */
  35. X   0,1, 100, 1,-1, 2,0, 1,1, 0,2, -1,1, -2,0, 2,0, 1,1, 0,2, -1,1, -2,0, -1,-1, -200 /* 3 */
  36. X   4,0, 100, 0,8, 0,-4, -4,0, 1,4, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* 4 */
  37. X   0,1, 100, 1,-1, 2,0, 1,1, 0,2, -1,1, -3,0, 0,4, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* 5 */
  38. X   0,4, 100, 3,0, 1,-1, 0,-2, -1,-1, -2,0, -1,1, 0,6, 1,1, 2,0, 1,-1, -200,-200,-200,-200,-200 /* 6 */
  39. X   1,0, 100, 3,8, -4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* 7 */
  40. X   0,1, 100, 0,2, 4,2, 0,2, -1,1, -2,0, -1,-1, 0,-2, 4,-2, 0,-2, -1,-1, -2,0, -1,1, -200 /* 8 */
  41. X   4,0, 100, 0,8, -3,0, -1,-1, 0,-2, 1,-1, 2,0, 1,1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* 9 */
  42. X   1,0, 100, 0,1, 1,0, 0,-1, -1,0, -100, 0,4, 100, 0,1, 1,0, 0,-1, -1,0, -200,-200,-200,-200,-200 /* : */
  43. X   2,0, 100, -1,0, 0,1, 1,0, 0,-1, -1,-1, -100, 0,5, 100, 0,1, 1,0, 0,-1, -1,0, -200,-200,-200 /* ; */
  44. X   4,1, 100, -3,3, 3,3, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* < */
  45. X   0,3, 100, 4,0, -100, 0,2, 100, -4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* = */
  46. X   0,1, 100, 3,3, -3,3, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* > */
  47. X   2,0, 100, 0,0, -100, 0,2, 100, 0,1, 2,2, 0,2, -1,1, -2,0, -1-1, -200,-200,-200,-200,-200,-200,-200 /* ? */
  48. X   4,1, 100, -3,0, -1,1, 0,4, 1,1, 2,0, 1,-1, 0,-2, -1,-1, -1,0, 0,2, 2,1, -200, -200, -200 /* @ */
  49. X   100, 0,5, 2,3, 2,-3, 0,-5, -100, 0,4, 100, -4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* A */
  50. X   0,4, 100, 3,0, 1,-1, 0,-2, -1,-1, -3,0, 0,8, 3,0, 1,-1, 0,-2, -1,-1, -200,-200,-200,-200,-200 /* B */
  51. X   4,1, 100, -1,-1, -2,0, -1,1, 0,6, 1,1, 2,0, 1,-1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* C */
  52. X   100, 0,8, 3,0, 1,-1, 0,-6, -1,-1, -3,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* D */
  53. X   4,0, 100, -4,0, 0,4, 3,0, -3,0, 0,4, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* E */
  54. X   100, 0,4, 3,0, -3,0, 0,4, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* F */
  55. X   2,3, 100, 2,0, 0,-2, -1,-1, -2,0, -1,1, 0,6, 1,1, 2,0, 1,-1, -200,-200,-200,-200,-200,-200,-200 /* G */
  56. X   100, 0,8, 0,-4, 4,0, 0,4, 0,-8, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* H */
  57. X   1,0, 100, 2,0, -1,0, 0,8, 1,0, -2,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* I */
  58. X   0,2, 100, 0,-1, 1,-1, 2,0, 1,1, 0,7, -1,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* J */
  59. X   100, 0,8, 0,-4, 4,4, -4,-4, 4,-4, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* K */
  60. X   4,0, 100, -4,0, 0,8, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* L */
  61. X   100, 0,8, 2,-3, 2,3, 0,-8, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* M */
  62. X   100, 0,8, 4,-8, 0,8, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* N */
  63. X   0,1, 100, 0,6, 1,1, 2,0, 1,-1, 0,-6, -1,-1, -2,0, -1,1, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* O */
  64. X   100, 0,8, 3,0, 1,-1, 0,-2, -1,-1, -3,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* P */
  65. X   0,1, 100, 0,6, 1,1, 2,0, 1,-1, 0,-6, -1,-1, -2,0, -1,1, -100, 2,1, 100, 2,-2, -200,-200,-200 /* Q */
  66. X   100, 0,8, 3,0, 1,-1, 0,-2, -1,-1, -3,0, 2,0, 2,-4, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* R */
  67. X   0,1, 100, 1,-1, 2,0, 1,1, 0,2, -1,1, -2,0, -1,1, 0,2, 1,1, 2,0, 1,-1, -200,-200,-200 /* S */
  68. X   2,0, 100, 0,8, -2,0, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* T */
  69. X   0,8, 100, 0,-7, 1,-1, 2,0, 1,1, 0,-1, 0,8, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* U */
  70. X   0,8, 100, 1,-5, 1,-3, 1,3, 1,5, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* V */
  71. X   0,8, 100, 0,-6, 1,-2, 1,3, 0,1, 0,-1, 1,-3, 1,2, 0,6, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* W */
  72. X   100, 4,8, -100, -4,0, 100, 4,-8, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* X */
  73. X   2,0, 100, 0,5, -2,3, 2,-3, 2,3, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* Y */
  74. X   0,8, 100, 4,0, -4,-8, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* Z */
  75. X   3,0, 100, -1,0, 0,8, 1,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* [ */
  76. X   0,7, 100, 3,-6, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* \ */
  77. X   1,0, 100, 1,0, 0,8, -1,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ] */
  78. X   0,6, 100, 2,2, 2,-2, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ^ */
  79. X   100, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* _ */
  80. X   2,8, 100, 1,-2, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ` */
  81. X   4,1, 100, -1,-1, -2,0, -1,1, 0,2, 1,2, 3,0, 0,-5, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* a */
  82. X   0,8, 100, 0,-8, 0,1, 1,-1, 2,0, 1,1, 0,3, -1,1, -3,0, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* b */
  83. X   4,1, 100, -1,-1, -2,0, -1,1, 0,3, 1,1, 2,0, 1,-1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* c */
  84. X   4,8, 100, 0,-8, 0,1, -1,-1, -2,0, -1,1, 0,3, 1,1, 3,0, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* d */
  85. X   4,1, 100, -1,-1, -2,0, -1,1, 0,3, 1,1, 2,0, 1,-1, 0,-1, -4,0, -200,-200,-200,-200,-200,-200,-200 /* e */
  86. X   1,0, 100, 0,7, 1,1, 1,0, 1,-1, -100, -2,-3, 100, -2,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* f */
  87. X   4,1, 100, -1,-1, -2,0, -1,1, 0,3, 1,1, 3,0, 0,-7, -1,-1, -2,0, -1,1, -200,-200,-200,-200,-200 /* g */
  88. X   100, 0,8, 0,-4, 1,1, 2,0, 1,-1, 0,-4, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* h */
  89. X   1,0, 100, 2,0, -1,0, 0,5, -100, 0,2, 100, 0,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* i */
  90. X   0,-2, 100, 1,-1, 1,0, 1,1, 0,7, -100, 0,2, 100, 0,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* j */
  91. X   100, 0,8, 0,-5, 4,2, -2,-1, 2,-4, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* k */
  92. X   1,0, 100, 2,0, -1,0, 0,8, -1,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* l */
  93. X   100, 0,5, 0,-1, 1,1, 1,0, 0,-5, 0,4, 1,1, 1,0, 0,-5, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* m */
  94. X   100, 0,5, 0,-1, 1,1, 2,0, 1,-1, 0,-4, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* n */
  95. X   1,0, 100, -1,1, 0,3, 1,1, 2,0, 1,-1, 0,-3, -1,-1, -2,0, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* o */
  96. X   0,-3, 100, 0,8, 3,0, 1,-1, 0,-3, -1,-1, -2,0, -1,1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* p */
  97. X   4,1, 100, -1,-1, -2,0, -1,1, 0,3, 1,1, 3,0, 0,-8, -1,0, 2,0, -200,-200,-200,-200,-200,-200,-200 /* q */
  98. X   100, 0,5, 0,-2, 2,2, 2,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* r */
  99. X   0,1, 100, 1,-1, 2,0, 1,1, 0,1, -4,1, 0,1, 1,1, 2,0, 1,-1, -200,-200,-200,-200,-200,-200,-200 /* s */
  100. X   2,0, 100, 0,8, -100, -2,-3, 100, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* t */
  101. X   0,5, 100, 0,-4, 1,-1, 2,0, 1,1, 0,-1, 0,5, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* u */
  102. X   0,5, 100, 2,-5, 2,5, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* v */
  103. X   0,5, 100, 0,-3, 1,-2, 1,3, 0,2, 0,-2, 1,-3, 1,2, 0,3, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* w */
  104. X   100, 4,5, -100, -4,0, 100, 4,-5, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* x */
  105. X   0,5, 100, 2,-5, -2,-3, 2,3, 2,5, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* y */
  106. X   4,0, 100, -4,0, 4,5, -4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* z */
  107. X   3,0, 100, -1,1, 0,2, -1,1, 1,1, 0,2, 1,1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* { */
  108. X   2,0, 100, 0,8, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* | */
  109. X   1,0, 100, 1,1, 0,2, 1,1, -1,1, 0,2, -1,1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* } */
  110. X   1,6, 100, 1,1, 1,-1, 1,1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ~ */
  111. SHAR_EOF
  112. $TOUCH -am 0706211890 libplot/lp/charset.0 &&
  113. chmod 0644 libplot/lp/charset.0 ||
  114. echo "restore of libplot/lp/charset.0 failed"
  115. set `wc -c libplot/lp/charset.0`;Wc_c=$1
  116. if test "$Wc_c" != "11475"; then
  117.     echo original size 11475, current size $Wc_c
  118. fi
  119. # ============= libplot/lp/circle.c ==============
  120. echo "x - extracting libplot/lp/circle.c (Text)"
  121. sed 's/^X//' << 'SHAR_EOF' > libplot/lp/circle.c &&
  122. X/*
  123. X * do_ci.c
  124. X *
  125. X * Copyright (c) 1988 Environmental Defense Fund, Inc.
  126. X */
  127. X
  128. X#include <stdio.h>
  129. X#include <math.h>
  130. X#include "plotlp.h"
  131. X#ifdef TESTVER
  132. X#include "dbgvars.h"
  133. X#endif
  134. X
  135. X#define DEGREES_TO_RADIANS 3.1415926535898 / 180.0
  136. X
  137. Xcircle(x,y,r)
  138. Xint x,y,r;
  139. X{
  140. X    POINT   t,
  141. X            t0,
  142. X            t1;
  143. X    float   radius;
  144. X    int     i_radius,
  145. X            chordangle;
  146. X    int     i;
  147. X
  148. X#ifdef TESTVER
  149. X    int     xwas_on;        /* for debugging */
  150. X
  151. X    /* turn debug2 off, if necessary, for the duration of do_CI() */
  152. X    if (debug2x) {
  153. X    xwas_on = TRUE;
  154. X    debug2x = FALSE;
  155. X    } else {
  156. X    xwas_on = FALSE;
  157. X    }
  158. X#endif
  159. X
  160. X
  161. X    radius=r*gxscrunch;
  162. X
  163. X    if (scaling) {
  164. X    i_radius = (int) (radius * x_scaler);
  165. X    if (i_radius < 0)
  166. X        i_radius -= 1;
  167. X    } else
  168. X    i_radius = (int) radius;
  169. X    current.x=x*gxscrunch;current.y=y*gyscrunch;
  170. X        current.x += offx; current.y += offy;
  171. X    t.x = t0.x = i_radius + current.x;
  172. X    t.y = t0.y = current.y;
  173. X    chordangle=1;
  174. X    for (i = chordangle; i < 360; i += chordangle) {
  175. X    t1.x = (double) radius *cos((double) i
  176. X        *       DEGREES_TO_RADIANS) + current.x;
  177. X    t1.y = (double) radius *sin((double) i
  178. X        *       DEGREES_TO_RADIANS) + current.y;
  179. X
  180. X    put_seg(t, t1);
  181. X    t = t1;
  182. X    }
  183. X    /* plot last full or partial chord; chordangle may not be a factor of 360 */
  184. X    put_seg(t, t0);
  185. X
  186. X#ifdef TESTVER            /* reset debug2x if necessary */
  187. X    if (xwas_on) {
  188. X    debug2x = TRUE;
  189. X    }
  190. X#endif
  191. X}
  192. SHAR_EOF
  193. $TOUCH -am 1010212988 libplot/lp/circle.c &&
  194. chmod 0644 libplot/lp/circle.c ||
  195. echo "restore of libplot/lp/circle.c failed"
  196. set `wc -c libplot/lp/circle.c`;Wc_c=$1
  197. if test "$Wc_c" != "1407"; then
  198.     echo original size 1407, current size $Wc_c
  199. fi
  200. # ============= libplot/lp/const.h ==============
  201. echo "x - extracting libplot/lp/const.h (Text)"
  202. sed 's/^X//' << 'SHAR_EOF' > libplot/lp/const.h &&
  203. X/*
  204. X * const.h
  205. X *
  206. X * Copyright (c) 1988 Environmental Defense Fund, Inc.
  207. X */
  208. X
  209. Xtypedef struct {
  210. X    int     x,
  211. X            y;
  212. X} POINT;
  213. X
  214. X#define PA 0
  215. X#define PR 1
  216. X#define PD 2
  217. X#define PU 3
  218. X
  219. X#define ESC 27
  220. X
  221. X#define TRUE 1
  222. X#define FALSE 0
  223. X
  224. X/* LINE TYPES */
  225. X#define DOTS 0
  226. X#define SHORT_DASH 1
  227. X#define BROKN_1 2
  228. X#define BROKN_2 3
  229. X#define BROKN_DOT 4
  230. X#define BROKN_DASH 5
  231. X#define BROKN_2DASH 6
  232. X#define SOLID 7
  233. X
  234. X/* FILL TYPES: values assigned to var fill_type */
  235. X#define BI_SOLID 1
  236. X#define UNI_SOLID 2
  237. X#define PARALLEL 3
  238. X#define CROSS_HATCH 4
  239. X
  240. X/* Charater set defines */
  241. X#define CHAR_ELEM 28
  242. X#define NUM_CHAR 94
  243. X
  244. X/* Printer model: values of global var 'printer' */
  245. X#define EPSON    1        /* Epson LQ 1500 */
  246. X#define LASERLOW 2        /* HP LaserJet Plus low sized 5" x 6" */
  247. X#define IBM_PRO  3        /* IBM Proprinter */
  248. X#define LASERMED 4        /* HP LaserJet Plus med sized 8" x 6" */
  249. X#define LASERHIGH 5        /* HP LaserJet Plus extra large 8" x 11"*/
  250. X
  251. X#define BITMAPSIZE 935000
  252. SHAR_EOF
  253. $TOUCH -am 1007125888 libplot/lp/const.h &&
  254. chmod 0644 libplot/lp/const.h ||
  255. echo "restore of libplot/lp/const.h failed"
  256. set `wc -c libplot/lp/const.h`;Wc_c=$1
  257. if test "$Wc_c" != "951"; then
  258.     echo original size 951, current size $Wc_c
  259. fi
  260. # ============= libplot/lp/dbgvars.h ==============
  261. echo "x - extracting libplot/lp/dbgvars.h (Text)"
  262. sed 's/^X//' << 'SHAR_EOF' > libplot/lp/dbgvars.h &&
  263. X/*
  264. X * dbgvars.h
  265. X *
  266. X * Copyright (c) 1988 Environmental Defense Fund, Inc.
  267. X *
  268. X * the home for these vars is set_dbgs.c
  269. X */
  270. X
  271. X#include <stdio.h>
  272. X
  273. Xextern FILE *errfp;
  274. X
  275. Xextern int debug1c,
  276. X        debug1f,
  277. X        debug2,
  278. X        debug2x,
  279. X        debug3,
  280. X        debug4,
  281. X        debug5,
  282. X        debug6,
  283. X        debug7,
  284. X        debug8,
  285. X        debug9;
  286. SHAR_EOF
  287. $TOUCH -am 1007125888 libplot/lp/dbgvars.h &&
  288. chmod 0644 libplot/lp/dbgvars.h ||
  289. echo "restore of libplot/lp/dbgvars.h failed"
  290. set `wc -c libplot/lp/dbgvars.h`;Wc_c=$1
  291. if test "$Wc_c" != "346"; then
  292.     echo original size 346, current size $Wc_c
  293. fi
  294. # ============= libplot/lp/ep_map.c ==============
  295. echo "x - extracting libplot/lp/ep_map.c (Text)"
  296. sed 's/^X//' << 'SHAR_EOF' > libplot/lp/ep_map.c &&
  297. X/*
  298. X * ep_map.c
  299. X *
  300. X * Copyright (c) 1988 Environmental Defense Fund, Inc.
  301. X */
  302. X
  303. X#include <stdio.h>
  304. X#include "const.h"
  305. X#include "fillcnst.h"
  306. X
  307. X#ifdef TESTVER
  308. X#include <signal.h>
  309. X#include "dbgvars.h"
  310. X#endif
  311. X
  312. X/* Constants */
  313. X/* SCALEX = 10.15 (inches) / 10366 (plotter units) * 180 (dots/inch) */
  314. X#define SCALEX 0.1762492
  315. X/* SCALEY = 7.8 (inches) / 7963 (plotter units) * 180 (dots/inch) */
  316. X#define SCALEY 0.1763154
  317. X
  318. X#define YLIM 1404
  319. X#define XLIM 231
  320. X
  321. X#define ROUNDER 0.0
  322. X
  323. X#ifdef TESTVER
  324. X#define PUT_BIT(x, y) map[(tempindex = (tempy = y) + YLIM * ((tempx = x) >> 3))] |= BITS[x & 7];
  325. X#else
  326. X#define PUT_BIT(x, y) map[y + YLIM * (x >> 3)] |= BITS[x & 7]
  327. X#endif
  328. X
  329. X#define ABS(x) ( (x) > 0.0 ? (x) : -(x) )
  330. X
  331. Xstatic char BITS[] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
  332. X
  333. X/* move bit map to maps.c for combined printer version --- */
  334. X/* char   map[XLIM * YLIM]; */
  335. Xextern char map[];
  336. X
  337. X#ifdef TESTVER
  338. Xstatic int tempindex,
  339. X        tempx,
  340. X        tempy;
  341. Xstatic POINT tempp1,
  342. X        tempp2;
  343. X
  344. Xep_catch()
  345. X{
  346. X    fprintf(stderr, "Segmentation violation\n");
  347. X    fprintf(stderr, "tempindex = %d x = %d y = %d p1 = %d,%d p2 = %d,%d\n", tempindex, tempx, tempy, tempp1.x, tempp1.y, tempp2.x, tempp2.y);
  348. X    ep_dump_map(FALSE);
  349. X    exit(1);
  350. X}
  351. X
  352. Xepcatchi()
  353. X{
  354. X    ep_dump_map(FALSE);
  355. X    exit(1);
  356. X}
  357. X
  358. X#endif
  359. X
  360. X
  361. Xep_put_seg(p1, p2)
  362. X    POINT   p1,
  363. X            p2;
  364. X{
  365. X    double  diffx,
  366. X            diffy,
  367. X            change_ratio;
  368. X    register int x,
  369. X            y;
  370. X    register int inc;
  371. X
  372. X#ifdef TESTVER
  373. X    if (debug2 || debug2x) {
  374. X    fprintf(errfp, "p1 ( %d, %d );   p2 ( %d, %d )\n",
  375. X        p1.x, p1.y, p2.x, p2.y);
  376. X    }
  377. X#if 0
  378. X    signal(SIGSEGV, ep_catch);
  379. X    signal(SIGINT, epcatchi);
  380. X#endif
  381. X    tempp1 = p1;
  382. X    tempp2 = p2;
  383. X#endif
  384. X
  385. X    p1.x = SCALEX * (double) p1.x + ROUNDER;
  386. X    p2.x = SCALEX * (double) p2.x + ROUNDER;
  387. X    p1.y = SCALEY * (double) p1.y + ROUNDER;
  388. X    p2.y = SCALEY * (double) p2.y + ROUNDER;
  389. X
  390. X    diffx = p2.x - p1.x;
  391. X    diffy = p2.y - p1.y;
  392. X
  393. X    if (diffx != 0.0 && diffy != 0.0) {
  394. X    if (ABS(diffx) > ABS(diffy)) {
  395. X        inc = (diffx < 0) ? -1 : 1;
  396. X        change_ratio = diffy / diffx;
  397. X        for (x = p1.x; x != p2.x; x += inc) {
  398. X        y = (x - p1.x) * change_ratio + p1.y + ROUNDER;
  399. X        PUT_BIT(x, y);
  400. X        }
  401. X        PUT_BIT(p2.x, p2.y);
  402. X    } else {
  403. X        inc = (diffy < 0) ? -1 : 1;
  404. X        change_ratio = diffx / diffy;
  405. X        for (y = p1.y; y != p2.y; y += inc) {
  406. X        x = (y - p1.y) * change_ratio + p1.x + ROUNDER;
  407. X        PUT_BIT(x, y);
  408. X        }
  409. X        PUT_BIT(p2.x, p2.y);
  410. X    }
  411. X    } else {
  412. X    if (diffx) {        /* horizontal line */
  413. X        y = p1.y;
  414. X        inc = (diffx < 0) ? -1 : 1;
  415. X        for (x = p1.x; x != p2.x; x += inc) {
  416. X        PUT_BIT(x, y);
  417. X        }
  418. X        PUT_BIT(p2.x, y);
  419. X    } else {
  420. X        x = p1.x;
  421. X        inc = (diffy < 0) ? -1 : 1;
  422. X        for (y = p1.y; y != p2.y; y += inc) {
  423. X        PUT_BIT(x, y);
  424. X        }
  425. X        PUT_BIT(x, p2.y);
  426. X    }
  427. X    }
  428. X}
  429. X
  430. X
  431. X/* LEFT_CUTOFF is the number of dot rows along left edge of page to skip over.
  432. X *    shifts image to the left by that many dot rows on the hardcopy page */
  433. X#define LEFT_CUTOFF  72
  434. X
  435. Xep_dump_map(to_printer)
  436. X    int     to_printer;
  437. X{
  438. X    register int k;
  439. X    int     map_max = XLIM * YLIM;
  440. X    int     i,
  441. X            j;
  442. X    char    hdr[5];
  443. X    register char *pm0,
  444. X           *pm1,
  445. X           *pm2,
  446. X           *pb;
  447. X    char    buf[180];
  448. X    int     non_blank;
  449. X    short int lim;
  450. X
  451. X#ifndef TESTVER
  452. X    to_printer = TRUE;
  453. X#endif
  454. X
  455. X    if (to_printer) {
  456. X    hdr[0] = ESC;
  457. X    hdr[1] = '3';
  458. X    hdr[2] = 24;        /* Spacing at 24/180 inch per line */
  459. X    write(1, hdr, 3);
  460. X    hdr[1] = '*';
  461. X    hdr[2] = 39;        /* Triple density, 24 pins */
  462. X    hdr[3] = (YLIM - LEFT_CUTOFF) & 0x0ff;
  463. X    hdr[4] = ((YLIM - LEFT_CUTOFF) >> 8) & 0x0ff;
  464. X    for (k = 0; k < map_max; k += 3 * YLIM) {
  465. X        write(1, hdr, 5);
  466. X        pm0 = &map[k + LEFT_CUTOFF];
  467. X        pm1 = &map[k + YLIM + LEFT_CUTOFF];
  468. X        pm2 = &map[k + (2 * YLIM) + LEFT_CUTOFF];
  469. X        lim = YLIM - LEFT_CUTOFF;
  470. X        while ((lim -= 60) >= 0) {
  471. X        pb = buf;
  472. X        for (i = 0; i < 60; i++) {
  473. X            *pb++ = *pm0++;
  474. X            *pb++ = *pm1++;
  475. X            *pb++ = *pm2++;
  476. X        }
  477. X        write(1, buf, 180);
  478. X        fflush(stdout);
  479. X        }
  480. X
  481. X        if (lim < 0)
  482. X        for (lim += 60; lim > 0; lim--) {
  483. X            pb = buf;
  484. X            *pb++ = *pm0++;
  485. X            *pb++ = *pm1++;
  486. X            *pb++ = *pm2++;
  487. X            write(1, buf, 3);
  488. X            fflush(stdout);
  489. X        }
  490. X        write(1, "\n\r", 2);/* LF and CR to end line */
  491. X    }
  492. X    hdr[0] = '\f';        /* Initialize the printer */
  493. X    write(1, hdr, 1);
  494. X    fflush(stdout);
  495. X    hdr[0] = ESC;        /* Initialize the printer */
  496. X    hdr[1] = '@';
  497. X    write(1, hdr, 2);
  498. X    fflush(stdout);
  499. X#ifdef TESTVER
  500. X    fclose(errfp);
  501. X#endif
  502. X
  503. X    }
  504. X#ifdef TESTVER
  505. X    else {
  506. X    FILE   *tty,
  507. X           *ttyout;
  508. X    int     dump_start,
  509. X            dump_stop;
  510. X
  511. X    if ((tty = fopen(TTY, "r")) == NULL) {
  512. X        perror(TTY);
  513. X        exit(10);
  514. X    }
  515. X    if ((ttyout = fopen(TTY, "w")) == NULL) {
  516. X        perror(TTY);
  517. X        exit(10);
  518. X    }
  519. X    fprintf(ttyout, "Enter start bit:");
  520. X    fflush(ttyout);
  521. X    fscanf(tty, "%d", &dump_start);
  522. X    dump_stop = dump_start + 79;
  523. X    non_blank = 0;
  524. X    pb = buf;
  525. X    for (k = 0; k < XLIM * YLIM; k += YLIM) {
  526. X        for (i = 0; i < 8; i++) {
  527. X        for (j = k + dump_start; j < k + dump_stop; j++) {
  528. X            if (map[j] & BITS[i]) {
  529. X            sprintf(pb, ".");
  530. X            non_blank = 1;
  531. X            } else {
  532. X            sprintf(pb, " ");
  533. X            }
  534. X            pb++;
  535. X        }
  536. X        if (non_blank) {
  537. X            sprintf(pb, "\n\000");
  538. X            printf("%s", buf);
  539. X        }
  540. X        non_blank = 0;
  541. X        pb = buf;
  542. X        }
  543. X    }
  544. X    }
  545. X#endif
  546. X
  547. X}
  548. X
  549. X
  550. Xep_init_map()
  551. X{
  552. X    register int k;
  553. X    int     map_max = XLIM * YLIM;
  554. X    register char *mp;
  555. X
  556. X#ifdef TRUESOLID
  557. X    extern double PUs_per_dot;    /* declared in file filltype.c */
  558. X
  559. X    PUs_per_dot = 1.0 / SCALEX;    /* used by fix_fill() in file filltype.c */
  560. X#endif
  561. X
  562. X    mp = map;
  563. X    for (k = 0; k < map_max; k++) {
  564. X    *mp++ = 0;
  565. X    }
  566. X}
  567. SHAR_EOF
  568. $TOUCH -am 1007125888 libplot/lp/ep_map.c &&
  569. chmod 0644 libplot/lp/ep_map.c ||
  570. echo "restore of libplot/lp/ep_map.c failed"
  571. set `wc -c libplot/lp/ep_map.c`;Wc_c=$1
  572. if test "$Wc_c" != "5595"; then
  573.     echo original size 5595, current size $Wc_c
  574. fi
  575. # ============= libplot/lp/fillcnst.h ==============
  576. echo "x - extracting libplot/lp/fillcnst.h (Text)"
  577. sed 's/^X//' << 'SHAR_EOF' > libplot/lp/fillcnst.h &&
  578. X/*
  579. X * fillcnst.h
  580. X *
  581. X * Copyright (c) 1988 Environmental Defense Fund, Inc.
  582. X */
  583. X
  584. X#define DEG_TO_RAD  0.017453292    /* pi/180  */
  585. X#define PI          3.1415926535898
  586. X#define PI_2        1.5707962    /* pi/2; approx 180 deg  */
  587. X#define PI_4        0.7853981    /* pi/4; approx  90 deg  */
  588. X#define PI_9        0.3490658    /* pi/9; approx  20 deg  */
  589. X
  590. X/* values stored in global vars C_A, C_B, A_B  */
  591. X#define GENR        0        /* non-special angle relationship */
  592. X#define PARL        1        /* segment & hatch line parallel */
  593. X#define VERT        2        /* segment is vertical */
  594. X#define HORZ        3        /* segment is horizontal */
  595. X
  596. Xtypedef struct {
  597. X    double  xx,
  598. X            yy;
  599. X} FPOINT;
  600. X
  601. X/*
  602. X * fill_type / fill_angle combos: values for hatching and filler
  603. X *    these are values assigned to vars fill and fixed_fill
  604. X */
  605. X#define SOLIDFILL   0
  606. X#define CROSS_0     4
  607. X#define CROSS_45    1
  608. X#define PARLL_0     2
  609. X#define PARLL_45    5
  610. X#define PARLL_90    6
  611. X#define PARLL_135   3
  612. X#define OTHER      -1
  613. SHAR_EOF
  614. $TOUCH -am 1007125888 libplot/lp/fillcnst.h &&
  615. chmod 0644 libplot/lp/fillcnst.h ||
  616. echo "restore of libplot/lp/fillcnst.h failed"
  617. set `wc -c libplot/lp/fillcnst.h`;Wc_c=$1
  618. if test "$Wc_c" != "975"; then
  619.     echo original size 975, current size $Wc_c
  620. fi
  621. # ============= libplot/lp/fillvars.h ==============
  622. echo "x - extracting libplot/lp/fillvars.h (Text)"
  623. sed 's/^X//' << 'SHAR_EOF' > libplot/lp/fillvars.h &&
  624. X/*
  625. X * fillvars.h
  626. X *
  627. X * Copyright (c) 1988 Environmental Defense Fund, Inc.
  628. X *
  629. X * the home for these vars is hatch.c
  630. X */
  631. X
  632. Xextern int hatch_degs;        /* hatch angle in degrees */
  633. Xextern double hatch_rads;    /* hatch angle in radians */
  634. Xextern double x_shift;
  635. Xextern double chg_x_CA,
  636. X        chg_y_CA,
  637. X        chg_x_CB,
  638. X        chg_y_CB,
  639. X        chg_x_AB,
  640. X        chg_y_AB;
  641. X
  642. X/*
  643. X * status of line segment: vertical (VERT), horizontal (HORZ), 
  644. X * parallel to the hatch lines (PARL), or generic (GENR) -- non-special
  645. X */
  646. Xextern int C_A,
  647. X        C_B,
  648. X        A_B;
  649. X
  650. X/* variables used by fix_fill(), which is called from do_FT and do_SP */
  651. Xextern int fill,
  652. X        fixed_fill,
  653. X        pen_number,
  654. X        spacing;
  655. SHAR_EOF
  656. $TOUCH -am 1007125888 libplot/lp/fillvars.h &&
  657. chmod 0644 libplot/lp/fillvars.h ||
  658. echo "restore of libplot/lp/fillvars.h failed"
  659. set `wc -c libplot/lp/fillvars.h`;Wc_c=$1
  660. if test "$Wc_c" != "700"; then
  661.     echo original size 700, current size $Wc_c
  662. fi
  663. echo "End of part 3, continue with part 4"
  664. exit 0
  665.  
  666.  
  667.  
  668.  
  669.  
  670. -- 
  671. UUCP: ..!uunet!mcsun!hp4nl!integow!hot    or  hot@integow.UUCP or hot@hot.mug
  672. Roland van Hout, Sr. software engineer, Integrity software consultants, 
  673.          Pelmolenlaan 16, 3447 GW Woerden, Netherlands,
  674.             tel +31 3480-30131, fax +31 3480-30182
  675.