home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume37 / lout / part12 < prev    next >
Encoding:
Text File  |  1993-06-19  |  82.6 KB  |  2,582 lines

  1. Newsgroups: comp.sources.misc
  2. From: jeff@joyce.cs.su.oz.au (Jeff Kingston)
  3. Subject: v37i110:  lout - Lout document formatting system, v2, Part12/30
  4. Message-ID: <1993Jun1.051916.25866@sparky.imd.sterling.com>
  5. X-Md4-Signature: adfbf685f822e3087b06fc500b554929
  6. Sender: kent@sparky.imd.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Tue, 1 Jun 1993 05:19:16 GMT
  9. Approved: kent@sparky.imd.sterling.com
  10.  
  11. Submitted-by: jeff@joyce.cs.su.oz.au (Jeff Kingston)
  12. Posting-number: Volume 37, Issue 110
  13. Archive-name: lout/part12
  14. Environment: UNIX
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # Contents:  lout/font0/TimesIta.AFM lout/include/fig_prepend
  21. #   lout/z13.c lout/z25.c
  22. # Wrapped by kent@sparky on Sun May 30 19:43:56 1993
  23. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 12 (of 30)."'
  26. if test -f 'lout/font0/TimesIta.AFM' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'lout/font0/TimesIta.AFM'\"
  28. else
  29.   echo shar: Extracting \"'lout/font0/TimesIta.AFM'\" \(15725 characters\)
  30.   sed "s/^X//" >'lout/font0/TimesIta.AFM' <<'END_OF_FILE'
  31. XStartFontMetrics 2.0
  32. XComment Copyright (c) 1984 Adobe Systems Incorporated.     All Rights Reserved.
  33. XComment Creation Date:Sun Feb 8 03:54:53 PST 1987
  34. XFontName Times-Italic
  35. XEncodingScheme AdobeStandardEncoding
  36. XFullName Times Italic
  37. XFamilyName Times
  38. XWeight Medium
  39. XItalicAngle -15.5
  40. XIsFixedPitch false
  41. XUnderlinePosition -96
  42. XUnderlineThickness 48
  43. XVersion 001.002
  44. XNotice Times is a trademark of Allied Corporation.
  45. XFontBBox -176 -252 990 930
  46. XCapHeight 660
  47. XXHeight 446
  48. XDescender -206
  49. XAscender 684
  50. XStartCharMetrics 228
  51. XC 32 ; WX 250 ; N space ; B 0 0 0 0 ;
  52. XC 33 ; WX 333 ; N exclam ; B 46 -10 296 670 ;
  53. XC 34 ; WX 420 ; N quotedbl ; B 107 442 402 673 ;
  54. XC 35 ; WX 500 ; N numbersign ; B -7 -6 508 683 ;
  55. XC 36 ; WX 500 ; N dollar ; B 13 -102 481 735 ;
  56. XC 37 ; WX 833 ; N percent ; B 63 -14 770 682 ;
  57. XC 38 ; WX 778 ; N ampersand ; B 60 -22 698 673 ;
  58. XC 39 ; WX 333 ; N quoteright ; B 69 458 206 678 ;
  59. XC 40 ; WX 333 ; N parenleft ; B 41 -180 312 662 ;
  60. XC 41 ; WX 333 ; N parenright ; B 19 -178 286 664 ;
  61. XC 42 ; WX 500 ; N asterisk ; B 60 268 434 684 ;
  62. XC 43 ; WX 675 ; N plus ; B 85 0 589 505 ;
  63. XC 44 ; WX 250 ; N comma ; B 57 -126 194 94 ;
  64. XC 45 ; WX 333 ; N hyphen ; B 55 192 276 254 ;
  65. XC 46 ; WX 250 ; N period ; B 75 -10 175 90 ;
  66. XC 47 ; WX 278 ; N slash ; B 2 -14 252 641 ;
  67. XC 48 ; WX 500 ; N zero ; B 19 -9 470 683 ;
  68. XC 49 ; WX 500 ; N one ; B 31 0 390 684 ;
  69. XC 50 ; WX 500 ; N two ; B -7 0 429 682 ;
  70. XC 51 ; WX 500 ; N three ; B -7 -12 443 682 ;
  71. XC 52 ; WX 500 ; N four ; B -8 0 454 681 ;
  72. XC 53 ; WX 500 ; N five ; B -12 -15 462 666 ;
  73. XC 54 ; WX 500 ; N six ; B 24 -8 497 685 ;
  74. XC 55 ; WX 500 ; N seven ; B 56 -12 512 666 ;
  75. XC 56 ; WX 500 ; N eight ; B 12 -7 475 681 ;
  76. XC 57 ; WX 500 ; N nine ; B 10 -18 470 684 ;
  77. XC 58 ; WX 333 ; N colon ; B 86 -10 284 444 ;
  78. XC 59 ; WX 333 ; N semicolon ; B 63 -124 292 441 ;
  79. XC 60 ; WX 675 ; N less ; B 83 -7 592 515 ;
  80. XC 61 ; WX 675 ; N equal ; B 85 125 589 383 ;
  81. XC 62 ; WX 675 ; N greater ; B 82 -7 591 515 ;
  82. XC 63 ; WX 500 ; N question ; B 105 -10 439 670 ;
  83. XC 64 ; WX 920 ; N at ; B 39 -191 866 648 ;
  84. XC 65 ; WX 611 ; N A ; B -45 0 564 672 ;
  85. XC 66 ; WX 611 ; N B ; B -28 0 562 660 ;
  86. XC 67 ; WX 667 ; N C ; B 33 -23 653 672 ;
  87. XC 68 ; WX 722 ; N D ; B -27 0 671 660 ;
  88. XC 69 ; WX 611 ; N E ; B -17 0 609 660 ;
  89. XC 70 ; WX 611 ; N F ; B -17 0 609 660 ;
  90. XC 71 ; WX 722 ; N G ; B 31 -23 701 672 ;
  91. XC 72 ; WX 722 ; N H ; B -26 0 742 660 ;
  92. XC 73 ; WX 333 ; N I ; B -26 0 357 660 ;
  93. XC 74 ; WX 444 ; N J ; B -36 -22 479 660 ;
  94. XC 75 ; WX 667 ; N K ; B -15 0 702 660 ;
  95. XC 76 ; WX 556 ; N L ; B -32 0 535 660 ;
  96. XC 77 ; WX 833 ; N M ; B -24 0 850 660 ;
  97. XC 78 ; WX 667 ; N N ; B -36 -12 698 660 ;
  98. XC 79 ; WX 722 ; N O ; B 42 -23 676 671 ;
  99. XC 80 ; WX 611 ; N P ; B -16 0 582 660 ;
  100. XC 81 ; WX 722 ; N Q ; B 41 -186 681 671 ;
  101. XC 82 ; WX 611 ; N R ; B -32 0 566 660 ;
  102. XC 83 ; WX 500 ; N S ; B 9 -22 483 674 ;
  103. XC 84 ; WX 556 ; N T ; B 32 0 602 660 ;
  104. XC 85 ; WX 722 ; N U ; B 77 -21 747 660 ;
  105. XC 86 ; WX 611 ; N V ; B 44 -20 659 660 ;
  106. XC 87 ; WX 833 ; N W ; B 35 -20 875 660 ;
  107. XC 88 ; WX 611 ; N X ; B -45 0 633 660 ;
  108. XC 89 ; WX 556 ; N Y ; B 44 0 600 660 ;
  109. XC 90 ; WX 556 ; N Z ; B -19 0 581 660 ;
  110. XC 91 ; WX 389 ; N bracketleft ; B 22 -170 391 654 ;
  111. XC 92 ; WX 278 ; N backslash ; B 2 -12 252 651 ;
  112. XC 93 ; WX 389 ; N bracketright ; B -31 -170 341 654 ;
  113. XC 94 ; WX 422 ; N asciicircum ; B 0 254 503 660 ;
  114. XC 95 ; WX 500 ; N underscore ; B -9 -252 510 -206 ;
  115. XC 96 ; WX 333 ; N quoteleft ; B 149 457 286 677 ;
  116. XC 97 ; WX 500 ; N a ; B 15 -11 474 446 ;
  117. XC 98 ; WX 500 ; N b ; B 24 -12 475 682 ;
  118. XC 99 ; WX 444 ; N c ; B 32 -11 420 446 ;
  119. XC 100 ; WX 500 ; N d ; B 15 -11 521 684 ;
  120. XC 101 ; WX 444 ; N e ; B 34 -13 412 446 ;
  121. XC 102 ; WX 278 ; N f ; B -148 -207 415 684 ; L i fi ; L l fl ;
  122. XC 103 ; WX 500 ; N g ; B 10 -209 471 445 ;
  123. XC 104 ; WX 500 ; N h ; B 23 -10 473 684 ;
  124. XC 105 ; WX 278 ; N i ; B 43 -10 263 660 ;
  125. XC 106 ; WX 278 ; N j ; B -109 -207 287 660 ;
  126. XC 107 ; WX 444 ; N k ; B 16 -12 460 685 ;
  127. XC 108 ; WX 278 ; N l ; B 41 -10 276 685 ;
  128. XC 109 ; WX 722 ; N m ; B 11 -10 698 447 ;
  129. XC 110 ; WX 500 ; N n ; B 23 -10 471 447 ;
  130. XC 111 ; WX 500 ; N o ; B 27 -13 467 448 ;
  131. XC 112 ; WX 500 ; N p ; B -75 -206 465 446 ;
  132. XC 113 ; WX 500 ; N q ; B 20 -206 483 445 ;
  133. XC 114 ; WX 389 ; N r ; B 24 0 392 446 ;
  134. XC 115 ; WX 389 ; N s ; B 16 -14 367 446 ;
  135. XC 116 ; WX 278 ; N t ; B 38 -10 288 548 ;
  136. XC 117 ; WX 500 ; N u ; B 42 -11 472 447 ;
  137. XC 118 ; WX 444 ; N v ; B 24 -11 423 444 ;
  138. XC 119 ; WX 667 ; N w ; B 14 -10 650 447 ;
  139. XC 120 ; WX 444 ; N x ; B -31 -10 450 446 ;
  140. XC 121 ; WX 444 ; N y ; B -27 -209 420 445 ;
  141. XC 122 ; WX 389 ; N z ; B 2 0 380 434 ;
  142. XC 123 ; WX 400 ; N braceleft ; B 65 -179 411 675 ;
  143. XC 124 ; WX 275 ; N bar ; B -22 -188 251 670 ;
  144. XC 125 ; WX 400 ; N braceright ; B -66 -179 300 675 ;
  145. XC 126 ; WX 541 ; N asciitilde ; B 18 169 522 340 ;
  146. XC 161 ; WX 389 ; N exclamdown ; B 59 -213 317 468 ;
  147. XC 162 ; WX 500 ; N cent ; B 62 -146 449 564 ;
  148. XC 163 ; WX 500 ; N sterling ; B -5 -9 498 672 ;
  149. XC 164 ; WX 167 ; N fraction ; B -176 -15 338 672 ;
  150. XC 165 ; WX 500 ; N yen ; B 13 0 609 684 ;
  151. XC 166 ; WX 500 ; N florin ; B 3 -189 492 688 ;
  152. XC 167 ; WX 500 ; N section ; B 42 -96 455 743 ;
  153. XC 168 ; WX 500 ; N currency ; B 3 105 498 604 ;
  154. XC 169 ; WX 214 ; N quotesingle ; B 99 453 247 678 ;
  155. XC 170 ; WX 556 ; N quotedblleft ; B 166 457 510 677 ;
  156. XC 171 ; WX 500 ; N guillemotleft ; B 54 39 444 400 ;
  157. XC 172 ; WX 333 ; N guilsinglleft ; B 60 39 285 400 ;
  158. XC 173 ; WX 333 ; N guilsinglright ; B 49 34 269 406 ;
  159. XC 174 ; WX 500 ; N fi ; B -136 -207 468 684 ;
  160. XC 175 ; WX 500 ; N fl ; B -140 -207 509 684 ;
  161. XC 177 ; WX 500 ; N endash ; B -3 194 501 242 ;
  162. XC 178 ; WX 500 ; N dagger ; B 92 -93 480 734 ;
  163. XC 179 ; WX 500 ; N daggerdbl ; B 20 -93 482 743 ;
  164. XC 180 ; WX 250 ; N periodcentered ; B 75 192 199 316 ;
  165. XC 182 ; WX 523 ; N paragraph ; B 87 -196 533 675 ;
  166. XC 183 ; WX 350 ; N bullet ; B 50 175 300 425 ;
  167. XC 184 ; WX 333 ; N quotesinglbase ; B 83 -126 220 94 ;
  168. XC 185 ; WX 556 ; N quotedblbase ; B 63 -126 407 94 ;
  169. XC 186 ; WX 556 ; N quotedblright ; B 68 458 412 678 ;
  170. XC 187 ; WX 500 ; N guillemotright ; B 59 34 442 406 ;
  171. XC 188 ; WX 889 ; N ellipsis ; B 62 -10 828 90 ;
  172. XC 189 ; WX 1000 ; N perthousand ; B 9 -65 990 690 ;
  173. XC 191 ; WX 500 ; N questiondown ; B 55 -215 395 462 ;
  174. XC 193 ; WX 333 ; N grave ; B 160 491 333 659 ;
  175. XC 194 ; WX 333 ; N acute ; B 154 501 375 680 ;
  176. XC 195 ; WX 333 ; N circumflex ; B 96 495 374 669 ;
  177. XC 196 ; WX 333 ; N tilde ; B 114 518 386 639 ;
  178. XC 197 ; WX 333 ; N macron ; B 120 543 380 603 ;
  179. XC 198 ; WX 333 ; N breve ; B 140 512 401 645 ;
  180. XC 199 ; WX 333 ; N dotaccent ; B 112 515 222 625 ;
  181. XC 200 ; WX 333 ; N dieresis ; B 117 534 389 634 ;
  182. XC 202 ; WX 333 ; N ring ; B 239 509 433 703 ;
  183. XC 203 ; WX 333 ; N cedilla ; B -30 -206 214 0 ;
  184. XC 205 ; WX 333 ; N hungarumlaut ; B 62 532 348 749 ;
  185. XC 206 ; WX 333 ; N ogonek ; B -44 -159 169 40 ;
  186. XC 207 ; WX 333 ; N caron ; B 138 495 422 669 ;
  187. XC 208 ; WX 889 ; N emdash ; B -65 194 945 242 ;
  188. XC 225 ; WX 889 ; N AE ; B -46 0 889 660 ;
  189. XC 227 ; WX 276 ; N ordfeminine ; B 32 300 310 677 ;
  190. XC 232 ; WX 556 ; N Lslash ; B 0 0 567 660 ;
  191. XC 233 ; WX 722 ; N Oslash ; B 40 -110 683 738 ;
  192. XC 234 ; WX 944 ; N OE ; B 30 -10 943 668 ;
  193. XC 235 ; WX 310 ; N ordmasculine ; B 45 301 310 679 ;
  194. XC 241 ; WX 667 ; N ae ; B 24 -12 638 448 ;
  195. XC 245 ; WX 278 ; N dotlessi ; B 47 -10 226 447 ;
  196. XC 248 ; WX 278 ; N lslash ; B 0 -10 264 685 ;
  197. XC 249 ; WX 500 ; N oslash ; B 28 -132 468 560 ;
  198. XC 250 ; WX 667 ; N oe ; B 26 -15 643 445 ;
  199. XC 251 ; WX 500 ; N germandbls ; B -167 -209 492 684 ;
  200. XC -1 ; WX 611 ; N Aacute ; B -45 0 564 907 ;
  201. XC -1 ; WX 611 ; N Acircumflex ; B -45 0 564 896 ;
  202. XC -1 ; WX 611 ; N Adieresis ; B -45 0 564 861 ;
  203. XC -1 ; WX 611 ; N Agrave ; B -45 0 564 886 ;
  204. XC -1 ; WX 611 ; N Aring ; B -45 0 564 930 ;
  205. XC -1 ; WX 611 ; N Atilde ; B -45 0 564 866 ;
  206. XC -1 ; WX 667 ; N Ccedilla ; B 33 -206 653 672 ;
  207. XC -1 ; WX 611 ; N Eacute ; B -17 0 609 907 ;
  208. XC -1 ; WX 611 ; N Ecircumflex ; B -17 0 609 896 ;
  209. XC -1 ; WX 611 ; N Edieresis ; B -17 0 609 861 ;
  210. XC -1 ; WX 611 ; N Egrave ; B -17 0 609 886 ;
  211. XC -1 ; WX 722 ; N Eth ; B -27 0 671 660 ;
  212. XC -1 ; WX 333 ; N Iacute ; B -26 0 389 907 ;
  213. XC -1 ; WX 333 ; N Icircumflex ; B -26 0 388 896 ;
  214. XC -1 ; WX 333 ; N Idieresis ; B -26 0 403 861 ;
  215. XC -1 ; WX 333 ; N Igrave ; B -26 0 357 886 ;
  216. XC -1 ; WX 667 ; N Ntilde ; B -36 -12 698 866 ;
  217. XC -1 ; WX 722 ; N Oacute ; B 42 -23 676 907 ;
  218. XC -1 ; WX 722 ; N Ocircumflex ; B 42 -23 676 896 ;
  219. XC -1 ; WX 722 ; N Odieresis ; B 42 -23 676 861 ;
  220. XC -1 ; WX 722 ; N Ograve ; B 42 -23 676 886 ;
  221. XC -1 ; WX 722 ; N Otilde ; B 42 -23 676 866 ;
  222. XC -1 ; WX 500 ; N Scaron ; B 9 -22 506 896 ;
  223. XC -1 ; WX 611 ; N Thorn ; B -16 0 547 660 ;
  224. XC -1 ; WX 722 ; N Uacute ; B 77 -21 747 907 ;
  225. XC -1 ; WX 722 ; N Ucircumflex ; B 77 -21 747 896 ;
  226. XC -1 ; WX 722 ; N Udieresis ; B 77 -21 747 861 ;
  227. XC -1 ; WX 722 ; N Ugrave ; B 77 -21 747 886 ;
  228. XC -1 ; WX 556 ; N Yacute ; B 44 0 600 894 ;
  229. XC -1 ; WX 556 ; N Ydieresis ; B 44 0 600 861 ;
  230. XC -1 ; WX 556 ; N Zcaron ; B -19 0 581 896 ;
  231. XC -1 ; WX 500 ; N aacute ; B 15 -11 474 680 ;
  232. XC -1 ; WX 500 ; N acircumflex ; B 15 -11 474 669 ;
  233. XC -1 ; WX 500 ; N adieresis ; B 15 -11 479 634 ;
  234. XC -1 ; WX 500 ; N agrave ; B 15 -11 474 659 ;
  235. XC -1 ; WX 500 ; N aring ; B 15 -11 474 703 ;
  236. XC -1 ; WX 500 ; N atilde ; B 15 -11 476 639 ;
  237. XC -1 ; WX 275 ; N brokenbar ; B -22 -188 251 670 ;
  238. XC -1 ; WX 444 ; N ccedilla ; B 32 -206 420 446 ;
  239. XC -1 ; WX 760 ; N copyright ; B 40 -22 719 672 ;
  240. XC -1 ; WX 400 ; N degree ; B 70 384 370 684 ;
  241. XC -1 ; WX 675 ; N divide ; B 85 0 589 505 ;
  242. XC -1 ; WX 444 ; N eacute ; B 34 -13 444 680 ;
  243. XC -1 ; WX 444 ; N ecircumflex ; B 34 -13 443 669 ;
  244. XC -1 ; WX 444 ; N edieresis ; B 34 -13 458 634 ;
  245. XC -1 ; WX 444 ; N egrave ; B 34 -13 412 659 ;
  246. XC -1 ; WX 500 ; N eth ; B 27 -13 487 682 ;
  247. XC -1 ; WX 278 ; N iacute ; B 47 -10 341 680 ;
  248. XC -1 ; WX 278 ; N icircumflex ; B 47 -10 340 669 ;
  249. XC -1 ; WX 278 ; N idieresis ; B 47 -10 355 634 ;
  250. XC -1 ; WX 278 ; N igrave ; B 47 -10 299 659 ;
  251. XC -1 ; WX 675 ; N logicalnot ; B 85 113 589 383 ;
  252. XC -1 ; WX 675 ; N minus ; B 85 222 589 286 ;
  253. XC -1 ; WX 500 ; N mu ; B -60 -206 472 446 ;
  254. XC -1 ; WX 675 ; N multiply ; B 85 0 589 504 ;
  255. XC -1 ; WX 500 ; N ntilde ; B 23 -10 471 639 ;
  256. XC -1 ; WX 500 ; N oacute ; B 27 -13 467 680 ;
  257. XC -1 ; WX 500 ; N ocircumflex ; B 27 -13 467 669 ;
  258. XC -1 ; WX 500 ; N odieresis ; B 27 -13 479 634 ;
  259. XC -1 ; WX 500 ; N ograve ; B 27 -13 467 659 ;
  260. XC -1 ; WX 750 ; N onehalf ; B 30 -15 720 684 ;
  261. XC -1 ; WX 750 ; N onequarter ; B 30 -15 720 684 ;
  262. XC -1 ; WX 300 ; N onesuperior ; B 43 274 277 683 ;
  263. XC -1 ; WX 500 ; N otilde ; B 27 -13 476 639 ;
  264. XC -1 ; WX 675 ; N plusminus ; B 85 0 589 645 ;
  265. XC -1 ; WX 760 ; N registered ; B 40 -22 719 672 ;
  266. XC -1 ; WX 389 ; N scaron ; B 16 -14 450 669 ;
  267. XC -1 ; WX 500 ; N thorn ; B -75 -206 465 682 ;
  268. XC -1 ; WX 750 ; N threequarters ; B 30 -15 720 684 ;
  269. XC -1 ; WX 300 ; N threesuperior ; B 13 267 306 684 ;
  270. XC -1 ; WX 980 ; N trademark ; B 35 268 945 672 ;
  271. XC -1 ; WX 300 ; N twosuperior ; B 8 274 292 684 ;
  272. XC -1 ; WX 500 ; N uacute ; B 42 -11 472 680 ;
  273. XC -1 ; WX 500 ; N ucircumflex ; B 42 -11 472 669 ;
  274. XC -1 ; WX 500 ; N udieresis ; B 42 -11 473 634 ;
  275. XC -1 ; WX 500 ; N ugrave ; B 42 -11 472 659 ;
  276. XC -1 ; WX 444 ; N yacute ; B -27 -209 431 680 ;
  277. XC -1 ; WX 444 ; N ydieresis ; B -27 -209 445 634 ;
  278. XC -1 ; WX 389 ; N zcaron ; B 2 0 450 669 ;
  279. XEndCharMetrics
  280. XStartKernData
  281. XStartKernPairs 120
  282. X
  283. XKPX A y -55
  284. XKPX A w -55
  285. XKPX A v -55
  286. XKPX A space -18
  287. XKPX A quoteright -37
  288. XKPX A Y -55
  289. XKPX A W -37
  290. XKPX A V -50
  291. XKPX A T -37
  292. X
  293. XKPX F period -129
  294. XKPX F comma -129
  295. XKPX F A -129
  296. X
  297. XKPX L y -30
  298. XKPX L space -18
  299. XKPX L quoteright -37
  300. XKPX L Y -20
  301. XKPX L W -37
  302. XKPX L V -37
  303. XKPX L T -20
  304. X
  305. XKPX P space -18
  306. XKPX P period -129
  307. XKPX P comma -129
  308. XKPX P A -129
  309. X
  310. XKPX R y -18
  311. XKPX R Y -18
  312. XKPX R W -18
  313. XKPX R V -18
  314. XKPX R T 0
  315. X
  316. XKPX T y -74
  317. XKPX T w -74
  318. XKPX T u -55
  319. XKPX T space -18
  320. XKPX T semicolon -65
  321. XKPX T s -92
  322. XKPX T r -55
  323. XKPX T period -74
  324. XKPX T o -92
  325. XKPX T i -55
  326. XKPX T hyphen -74
  327. XKPX T e -92
  328. XKPX T comma -74
  329. XKPX T colon -55
  330. XKPX T c -92
  331. XKPX T a -92
  332. XKPX T O -18
  333. XKPX T A -74
  334. X
  335. XKPX V y -92
  336. XKPX V u -74
  337. XKPX V space -18
  338. XKPX V semicolon -74
  339. XKPX V r -74
  340. XKPX V period -129
  341. XKPX V o -111
  342. XKPX V i -74
  343. XKPX V hyphen -55
  344. XKPX V e -111
  345. XKPX V comma -129
  346. XKPX V colon -65
  347. XKPX V a -111
  348. XKPX V O -30
  349. XKPX V A -74
  350. X
  351. XKPX W y -92
  352. XKPX W u -55
  353. XKPX W semicolon -65
  354. XKPX W r -55
  355. XKPX W period -92
  356. XKPX W o -92
  357. XKPX W i -55
  358. XKPX W hyphen -37
  359. XKPX W e -92
  360. XKPX W comma -92
  361. XKPX W colon -65
  362. XKPX W a -92
  363. XKPX W A -70
  364. X
  365. XKPX Y v -92
  366. XKPX Y u -92
  367. XKPX Y semicolon -65
  368. XKPX Y q -111
  369. XKPX Y period -92
  370. XKPX Y p -92
  371. XKPX Y o -92
  372. XKPX Y i -74
  373. XKPX Y hyphen -74
  374. XKPX Y e -92
  375. XKPX Y comma -92
  376. XKPX Y colon -65
  377. XKPX Y a -92
  378. XKPX Y A -70
  379. X
  380. XKPX f quoteright 92
  381. X
  382. XKPX one one -74
  383. X
  384. XKPX quoteleft quoteleft -111
  385. X
  386. XKPX quoteright t -111
  387. XKPX quoteright space -111
  388. XKPX quoteright s -129
  389. XKPX quoteright quoteright -111
  390. X
  391. XKPX r y 0
  392. XKPX r x 0
  393. XKPX r w 0
  394. XKPX r v 0
  395. XKPX r u 0
  396. XKPX r t 0
  397. XKPX r r 0
  398. XKPX r quoteright 37
  399. XKPX r q -37
  400. XKPX r period -111
  401. XKPX r o -37
  402. XKPX r hyphen -20
  403. XKPX r h -18
  404. XKPX r g -37
  405. XKPX r e -37
  406. XKPX r d -37
  407. XKPX r comma -111
  408. XKPX r c -37
  409. X
  410. XKPX space A -18
  411. X
  412. XKPX v period -74
  413. XKPX v comma -74
  414. X
  415. XKPX w period -74
  416. XKPX w comma -74
  417. X
  418. XKPX y period -55
  419. XKPX y comma -55
  420. XEndKernPairs
  421. XEndKernData
  422. XStartComposites 58
  423. XCC Zcaron 2 ; PCC Z 0 0 ; PCC caron 111 227 ;
  424. XCC zcaron 2 ; PCC z 0 0 ; PCC caron 28 0 ;
  425. XCC Scaron 2 ; PCC S 0 0 ; PCC caron 83 227 ;
  426. XCC scaron 2 ; PCC s 0 0 ; PCC caron 28 0 ;
  427. XCC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 188 0 ;
  428. XCC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 61 0 ;
  429. XCC Yacute 2 ; PCC Y 0 0 ; PCC acute 111 214 ;
  430. XCC yacute 2 ; PCC y 0 0 ; PCC acute 55 0 ;
  431. XCC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 111 227 ;
  432. XCC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 55 0 ;
  433. XCC Uacute 2 ; PCC U 0 0 ; PCC acute 228 227 ;
  434. XCC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 228 227 ;
  435. XCC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 228 227 ;
  436. XCC Ugrave 2 ; PCC U 0 0 ; PCC grave 228 227 ;
  437. XCC uacute 2 ; PCC u 0 0 ; PCC acute 83 0 ;
  438. XCC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 83 0 ;
  439. XCC udieresis 2 ; PCC u 0 0 ; PCC dieresis 83 0 ;
  440. XCC ugrave 2 ; PCC u 0 0 ; PCC grave 83 0 ;
  441. XCC Iacute 2 ; PCC I 0 0 ; PCC acute 14 227 ;
  442. XCC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 14 227 ;
  443. XCC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 14 227 ;
  444. XCC Igrave 2 ; PCC I 0 0 ; PCC grave 14 227 ;
  445. XCC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -34 0 ;
  446. XCC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -34 0 ;
  447. XCC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -34 0 ;
  448. XCC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -34 0 ;
  449. XCC Eacute 2 ; PCC E 0 0 ; PCC acute 160 227 ;
  450. XCC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 160 227 ;
  451. XCC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 160 227 ;
  452. XCC Egrave 2 ; PCC E 0 0 ; PCC grave 160 227 ;
  453. XCC eacute 2 ; PCC e 0 0 ; PCC acute 68 0 ;
  454. XCC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 68 0 ;
  455. XCC edieresis 2 ; PCC e 0 0 ; PCC dieresis 68 0 ;
  456. XCC egrave 2 ; PCC e 0 0 ; PCC grave 68 0 ;
  457. XCC Aacute 2 ; PCC A 0 0 ; PCC acute 146 227 ;
  458. XCC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 146 227 ;
  459. XCC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 146 227 ;
  460. XCC Agrave 2 ; PCC A 0 0 ; PCC grave 146 227 ;
  461. XCC aacute 2 ; PCC a 0 0 ; PCC acute 89 0 ;
  462. XCC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 89 0 ;
  463. XCC adieresis 2 ; PCC a 0 0 ; PCC dieresis 89 0 ;
  464. XCC agrave 2 ; PCC a 0 0 ; PCC grave 89 0 ;
  465. XCC Oacute 2 ; PCC O 0 0 ; PCC acute 221 227 ;
  466. XCC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 221 227 ;
  467. XCC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 221 227 ;
  468. XCC Ograve 2 ; PCC O 0 0 ; PCC grave 221 227 ;
  469. XCC oacute 2 ; PCC o 0 0 ; PCC acute 89 0 ;
  470. XCC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 89 0 ;
  471. XCC odieresis 2 ; PCC o 0 0 ; PCC dieresis 89 0 ;
  472. XCC ograve 2 ; PCC o 0 0 ; PCC grave 89 0 ;
  473. XCC Atilde 2 ; PCC A 0 0 ; PCC tilde 146 227 ;
  474. XCC atilde 2 ; PCC a 0 0 ; PCC tilde 89 0 ;
  475. XCC Ntilde 2 ; PCC N 0 0 ; PCC tilde 181 227 ;
  476. XCC ntilde 2 ; PCC n 0 0 ; PCC tilde 76 0 ;
  477. XCC Otilde 2 ; PCC O 0 0 ; PCC tilde 221 227 ;
  478. XCC otilde 2 ; PCC o 0 0 ; PCC tilde 89 0 ;
  479. XCC Aring 2 ; PCC A 0 0 ; PCC ring 80 227 ;
  480. XCC aring 2 ; PCC a 0 0 ; PCC ring 29 0 ;
  481. XEndComposites
  482. XEndFontMetrics
  483. END_OF_FILE
  484.   if test 15725 -ne `wc -c <'lout/font0/TimesIta.AFM'`; then
  485.     echo shar: \"'lout/font0/TimesIta.AFM'\" unpacked with wrong size!
  486.   fi
  487.   # end of 'lout/font0/TimesIta.AFM'
  488. fi
  489. if test -f 'lout/include/fig_prepend' -a "${1}" != "-c" ; then 
  490.   echo shar: Will not clobber existing file \"'lout/include/fig_prepend'\"
  491. else
  492.   echo shar: Extracting \"'lout/include/fig_prepend'\" \(22299 characters\)
  493.   sed "s/^X//" >'lout/include/fig_prepend' <<'END_OF_FILE'
  494. X%%BeginResource: procset LoutFigPrependGraphic
  495. X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  496. X%                                                                    %
  497. X%  PostScript @SysPrependGraphic file for @Fig  Jeffrey H. Kingston  %
  498. X%  Version 2.0 (includes CIRCUM label)                 January 1992  %
  499. X%                                                                    %
  500. X%  To assist in avoiding name clashes, the names of all symbols      %
  501. X%  defined here begin with "lfig".  However, this is not feasible    %
  502. X%  with user-defined labels and some labels used by users.           %
  503. X%                                                                    %
  504. X%  <point>      is two numbers, a point.                             %
  505. X%  <length>     is one number, a length                              %
  506. X%  <angle>      is one number, an angle in degrees                   %
  507. X%  <dashlength> is one number, the preferred length of a dash        %
  508. X%                                                                    %
  509. X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  510. X
  511. Xerrordict begin
  512. X   /handleerror
  513. X   {
  514. X      {  /Times-Roman findfont 8 pt scalefont setfont
  515. X     0 setgray 4 pt 4 pt moveto
  516. X     $error /errorname get
  517. X     dup lfigdict exch known
  518. X     { lfigdict exch get }
  519. X     { 30 string cvs } ifelse
  520. X     show
  521. X     (  Command: ) show
  522. X     $error /command get 30 string cvs show
  523. X      } stopped {} if
  524. X      showpage stop
  525. X   } def
  526. Xend
  527. X
  528. X% concat strings: <string> <string> lfigconcat <string>
  529. X% must be defined outside lfigdict since used in lfigpromotelabels
  530. X/lfigconcat
  531. X{ 2 copy length exch length add string
  532. X  dup 0 4 index putinterval
  533. X  dup 3 index length 3 index putinterval
  534. X  3 1 roll pop pop
  535. X} def
  536. X
  537. X% <string> lfigdebugprint -
  538. X% must be defined outside lfigdict since used in arbitrary places
  539. X% /lfigdebugprint
  540. X% { print
  541. X%   (;  operand stack:\n) print
  542. X%   count copy
  543. X%   count 2 idiv
  544. X%   { ==
  545. X%     (\n) print
  546. X%   } repeat
  547. X%   (\n) print
  548. X% } def
  549. X
  550. X/lfigdict 120 dict def
  551. Xlfigdict begin
  552. X
  553. X% error messages
  554. X/dictfull (dictfull error:  too many labels?) def
  555. X/dictstackoverflow (dictstackoverflow error:  labels nested too deeply?) def
  556. X/execstackoverflow (execstackoverflow error:  figure nested too deeply?) def
  557. X/limitcheck (limitcheck error:  figure nested too deeply or too large?) def
  558. X/syntaxerror (syntaxerror error:  syntax error in text of figure?) def
  559. X/typecheck (typecheck error:  syntax error in text of figure?) def
  560. X/undefined (undefined error:  unknown or misspelt label?) def
  561. X/VMError (VMError error:  run out of memory?) def
  562. X
  563. X% push pi onto stack:  - lfigpi <num>
  564. X/lfigpi 3.14159 def
  565. X
  566. X% arc directions
  567. X/clockwise     false def
  568. X/anticlockwise true  def
  569. X
  570. X% maximum of two numbers:  <num> <num> lfigmax <num>
  571. X/lfigmax { 2 copy gt { pop } { exch pop } ifelse } def
  572. X
  573. X% minimum of two numbers:  <num> <num> lfigmin <num>
  574. X/lfigmin { 2 copy lt { pop } { exch pop } ifelse } def
  575. X
  576. X% add two points:  <point> <point> lfigpadd <point>
  577. X/lfigpadd { exch 3 1 roll add 3 1 roll add exch } def
  578. X
  579. X% subtract first point from second:  <point> <point> lfigpsub <point>
  580. X/lfigpsub { 3 2 roll sub 3 1 roll exch sub exch } def
  581. X
  582. X% max two points:  <point> <point> lfigpmax <point>
  583. X/lfigpmax { exch 3 1 roll lfigmax 3 1 roll lfigmax exch } def
  584. X
  585. X% min two points:  <point> <point> lfigpmin <point>
  586. X/lfigpmin { exch 3 1 roll lfigmin 3 1 roll lfigmin exch } def
  587. X
  588. X% scalar multiplication: <point> <num> lfigpmul <point>
  589. X/lfigpmul { dup 3 1 roll mul 3 1 roll mul exch } def
  590. X
  591. X% point at angle and distance:  <point> <length> <angle> lfigatangle <point>
  592. X/lfigatangle { 2 copy cos mul 3 1 roll sin mul lfigpadd } def
  593. X
  594. X% angle from one point to another:  <point> <point> lfigangle <angle>
  595. X/lfigangle { lfigpsub 2 copy 0 eq exch 0 eq and {pop} {exch atan} ifelse } def
  596. X
  597. X% distance between two points:  <point> <point> lfigdistance <length>
  598. X/lfigdistance { lfigpsub dup mul exch dup mul add sqrt } def
  599. X
  600. X% difference in x coords: <point> <point> lfigxdistance <length>
  601. X/lfigxdistance { pop 3 1 roll pop sub } def
  602. X
  603. X%difference in y coords: <point> <point> lfigydistance <length>
  604. X/lfigydistance { 3 1 roll pop sub exch pop } def
  605. X
  606. X% stroke a solid line:  <length> <dashlength> lfigsolid -
  607. X/lfigsolid
  608. X{  pop pop [] 0 setdash stroke
  609. X} def
  610. X
  611. X% stroke a lfigdashed line:   <length> <dashlength> lfigdashed -
  612. X/lfigdashed
  613. X{  2 copy div 2 le 1 index 0 le or
  614. X   {  exch pop 1 pt lfigmax [ exch dup ] 0 setdash }
  615. X   {  dup [ exch 4 2 roll 2 copy div
  616. X      1 sub 2 div ceiling dup 4 1 roll
  617. X      1 add mul sub exch div ] 0 setdash
  618. X   } ifelse stroke
  619. X} def
  620. X
  621. X% stroke a lfigcdashed line:  <length> <dashlength> lfigcdashed -
  622. X/lfigcdashed
  623. X{  2 copy le 1 index 0 le or
  624. X   {  exch pop 1 pt lfigmax [ exch dup ] copy 0 get 2 div setdash }
  625. X   { dup [ 4 2 roll exch 2 copy exch div
  626. X     2 div ceiling div 1 index sub
  627. X     ] exch 2 div setdash
  628. X   } ifelse stroke
  629. X} def
  630. X
  631. X% stroke a dotted line:  <length> <dashlength> lfigdotted -
  632. X/lfigdotted
  633. X{  dup 0 le
  634. X   {  exch pop 1 pt lfigmax [ exch 0 exch ] 0 setdash }
  635. X   { 1 index exch div ceiling div
  636. X     [ 0 3 2 roll ] 0 setdash
  637. X   } ifelse stroke
  638. X} def
  639. X
  640. X% stroke a noline line:  <length> <dashlength> lfignoline -
  641. X/lfignoline
  642. X{ pop pop
  643. X} def
  644. X
  645. X% painting (i.e. filling): - lfigwhite - (etc.)
  646. X/lfigwhite   { 1.0  setgray fill } def
  647. X/lfiglight   { 0.95 setgray fill } def
  648. X/lfiggrey    { 0.9  setgray fill } def
  649. X/lfiggray    { 0.9  setgray fill } def
  650. X/lfigdark    { 0.7  setgray fill } def
  651. X/lfigblack   { 0.0  setgray fill } def
  652. X/lfignopaint {                   } def
  653. X
  654. X% line caps (and joins, not currently used)
  655. X/lfigbutt       0 def
  656. X/lfiground      1 def
  657. X/lfigprojecting 2 def
  658. X/lfigmiter      0 def
  659. X/lfigbevel      2 def
  660. X
  661. X% shape and labels of the @Box symbol
  662. X/lfigbox
  663. X{
  664. X   0     0     /SW  lfigpointdef
  665. X   xsize 0     /SE  lfigpointdef
  666. X   xsize ysize /NE  lfigpointdef
  667. X   0     ysize /NW  lfigpointdef
  668. X   SE 0.5 lfigpmul /S   lfigpointdef
  669. X   NW 0.5 lfigpmul /W   lfigpointdef
  670. X   W SE lfigpadd   /E   lfigpointdef
  671. X   S NW lfigpadd   /N   lfigpointdef
  672. X   NE 0.5 lfigpmul /CTR lfigpointdef
  673. X   [ CTR NE lfigpsub /lfigboxcircum cvx ] lfigcircumdef
  674. X   SW SE NE NW SW
  675. X} def
  676. X
  677. X% shape and labels of the @Square symbol
  678. X/lfigsquare
  679. X{
  680. X   xsize ysize 0.5 lfigpmul /CTR lfigpointdef
  681. X   CTR xsize xsize ysize ysize lfigpmax 0.5 lfigpmul lfigpadd /NE lfigpointdef
  682. X   CTR 0 0 CTR NE lfigdistance 135 lfigatangle lfigpadd /NW lfigpointdef
  683. X   CTR 0 0 CTR NE lfigdistance 225 lfigatangle lfigpadd /SW lfigpointdef
  684. X   CTR 0 0 CTR NE lfigdistance 315 lfigatangle lfigpadd /SE lfigpointdef
  685. X   SW 0.5 lfigpmul SE 0.5 lfigpmul lfigpadd /S lfigpointdef
  686. X   NW 0.5 lfigpmul NE 0.5 lfigpmul lfigpadd /N lfigpointdef
  687. X   SW 0.5 lfigpmul NW 0.5 lfigpmul lfigpadd /W lfigpointdef
  688. X   SE 0.5 lfigpmul NE 0.5 lfigpmul lfigpadd /E lfigpointdef
  689. X   [ CTR NE lfigpsub /lfigboxcircum cvx ] lfigcircumdef
  690. X   SW SE NE NW SW
  691. X} def
  692. X
  693. X% shape and labels of the @Diamond symbol
  694. X/lfigdiamond
  695. X{
  696. X   xsize 0 0.5 lfigpmul /S   lfigpointdef
  697. X   0 ysize 0.5 lfigpmul /W   lfigpointdef
  698. X   S W         lfigpadd /CTR lfigpointdef
  699. X   CTR W       lfigpadd /N   lfigpointdef
  700. X   CTR S       lfigpadd /E   lfigpointdef
  701. X   [ xsize ysize 0.5 lfigpmul /lfigdiamondcircum cvx ] lfigcircumdef
  702. X   S E N W S
  703. X} def
  704. X
  705. X% shape and labels of the @Ellipse symbol
  706. X/lfigellipse
  707. X{
  708. X   xsize 0 0.5 lfigpmul /S   lfigpointdef
  709. X   0 ysize 0.5 lfigpmul /W   lfigpointdef
  710. X   S W         lfigpadd /CTR lfigpointdef
  711. X   CTR W       lfigpadd /N   lfigpointdef
  712. X   CTR S       lfigpadd /E   lfigpointdef
  713. X   CTR xsize 0 0.3536 lfigpmul lfigpadd 0 ysize 0.3536 lfigpmul lfigpadd /NE lfigpointdef
  714. X   0 ysize 0.3536 lfigpmul CTR xsize 0 0.3536 lfigpmul lfigpadd lfigpsub /SE lfigpointdef
  715. X   xsize 0 0.3536 lfigpmul CTR lfigpsub 0 ysize 0.3536 lfigpmul lfigpadd /NW lfigpointdef
  716. X   0 ysize 0.3536 lfigpmul xsize 0 0.3536 lfigpmul CTR lfigpsub lfigpsub /SW lfigpointdef
  717. X   [ xsize ysize 0.5 lfigpmul /lfigellipsecircum cvx ] lfigcircumdef
  718. X   S [ CTR ] E [ CTR ] N [ CTR ] W [ CTR ] S
  719. X} def
  720. X
  721. X% shape and labels of the @Circle symbol
  722. X/lfigcircle
  723. X{
  724. X   xsize ysize 0.5 lfigpmul /CTR lfigpointdef
  725. X   CTR xsize 0 ysize 0 lfigpmax 0.5 lfigpmul lfigpadd /E lfigpointdef
  726. X   CTR 0 0 CTR E lfigdistance 45 lfigatangle lfigpadd /NE lfigpointdef
  727. X   CTR 0 0 CTR E lfigdistance 90 lfigatangle lfigpadd /N lfigpointdef
  728. X   CTR 0 0 CTR E lfigdistance 135 lfigatangle lfigpadd /NW lfigpointdef
  729. X   CTR 0 0 CTR E lfigdistance 180 lfigatangle lfigpadd /W lfigpointdef
  730. X   CTR 0 0 CTR E lfigdistance 225 lfigatangle lfigpadd /SW lfigpointdef
  731. X   CTR 0 0 CTR E lfigdistance 270 lfigatangle lfigpadd /S lfigpointdef
  732. X   CTR 0 0 CTR E lfigdistance 315 lfigatangle lfigpadd /SE lfigpointdef
  733. X   [ S E lfigpsub /lfigellipsecircum cvx ] lfigcircumdef
  734. X   S [ CTR ] E [ CTR ] N [ CTR ] W [ CTR ] S
  735. X} def
  736. X
  737. X% shape and labels of the @HLine and @HArrow symbols
  738. X/lfighline
  739. X{
  740. X   0 ymark lfigprevious /FROM lfigpointdef
  741. X   xsize ymark lfigprevious /TO lfigpointdef
  742. X} def
  743. X
  744. X% shape and labels of the @VLine and @VArrow symbols
  745. X/lfigvline
  746. X{
  747. X   xmark ysize lfigprevious /FROM lfigpointdef
  748. X   xmark 0 lfigprevious /TO lfigpointdef
  749. X} def
  750. X
  751. X% points of a polygon around base with given no of sides, vert init angle:
  752. X% <sides> <angle> figpolygon <point> ... <point>
  753. X/lfigpolygon
  754. X{  xsize ysize 0.5 lfigpmul /CTR lfigpointdef
  755. X   90 sub CTR 2 copy lfigmax 5 3 roll
  756. X   [ 4 copy pop /lfigpolycircum cvx ] lfigcircumdef
  757. X   exch dup 360 exch div exch
  758. X   1 1  3 2 roll
  759. X   {  4 string cvs (P) exch lfigconcat cvn
  760. X      6 copy pop pop lfigatangle 2 copy 10 2 roll
  761. X      3 2 roll lfigpointdef
  762. X      dup 3 1 roll add exch
  763. X   }  for
  764. X   pop lfigatangle
  765. X} def
  766. X
  767. X% next array element:  <array> <index> lfiggetnext <array> <index> <any> true
  768. X%                                               or <array> <index> false
  769. X/lfiggetnext
  770. X{  2 copy exch length ge
  771. X   { false }
  772. X   { 2 copy get exch 1 add exch true } ifelse
  773. X} def
  774. X
  775. X% check whether thing is number:  <any> lfigisnumbertype <any> <bool>
  776. X/lfigisnumbertype
  777. X{  dup type dup
  778. X   /integertype eq exch /realtype eq or
  779. X} def
  780. X
  781. X% check whether thing is an array:  <any> lfigisarraytype <any> <bool>
  782. X/lfigisarraytype { dup type /arraytype eq } def
  783. X
  784. X% get next item:  <array> <index> lfiggetnextitem <array> <index> 0
  785. X%                                              or <array> <index> <array> 1
  786. X%                                              or <array> <index> <point> 2
  787. X/lfiggetnextitem
  788. X{   lfiggetnext
  789. X    {    lfigisarraytype
  790. X    {   1
  791. X    }
  792. X    {   lfigisnumbertype
  793. X        {    3 1 roll
  794. X        lfiggetnext
  795. X        {   lfigisnumbertype
  796. X            {    4 3 roll exch  2
  797. X            }
  798. X            {    pop 3 2 roll pop  0
  799. X            } ifelse
  800. X        }
  801. X        {   3 2 roll pop  0
  802. X        } ifelse
  803. X        }
  804. X        {    pop 0
  805. X        } ifelse
  806. X    } ifelse
  807. X    }
  808. X    {    0
  809. X    } ifelse
  810. X} def
  811. X
  812. X% set arc path:  bool x1 y1  x2 y2  x0 y0  lfigsetarc  <angle> <angle> <dist>
  813. X% the path goes from x1 y1 to x2 y2 about centre x0 y0,
  814. X% anticlockwise if bool is true else clockwise.
  815. X% The orientations of backwards pointing and forwards pointing
  816. X% arrowheads are returned in the two angles, and
  817. X% the length of the arc is returned in <dist>.
  818. X/lfigsetarc
  819. X{
  820. X  20 dict begin
  821. X     matrix currentmatrix 8 1 roll
  822. X     2 copy translate 2 copy 8 2 roll
  823. X     4 2 roll lfigpsub 6 2 roll lfigpsub
  824. X     dup /y1 exch def dup mul /y1s exch def
  825. X     dup /x1 exch def dup mul /x1s exch def
  826. X     dup /y2 exch def dup mul /y2s exch def
  827. X     dup /x2 exch def dup mul /x2s exch def
  828. X
  829. X     y1s y2s eq
  830. X     {    -1
  831. X     }
  832. X     {    y1s x2s mul y2s x1s mul sub y1s y2s sub div
  833. X     } ifelse
  834. X     /da exch def
  835. X
  836. X     x1s x2s eq
  837. X     {    -1
  838. X     }
  839. X     {    x1s y2s mul x2s y1s mul sub x1s x2s sub div
  840. X     } ifelse
  841. X     /db exch def
  842. X
  843. X     da 0 gt db 0 gt and
  844. X     {    /LMax da sqrt db sqrt lfigmax def
  845. X    /scalex da sqrt LMax div def
  846. X    /scaley db sqrt LMax div def
  847. X    scalex scaley scale
  848. X    0 0 LMax
  849. X    0 0 x1 scalex mul y1 scaley mul lfigangle
  850. X    0 0 x2 scalex mul y2 scaley mul lfigangle
  851. X    2 copy eq { 360 add } if
  852. X    2 copy 8 2 roll
  853. X    5 index { arc } { arcn } ifelse
  854. X    2 index 1 index
  855. X    { 90 sub } { 90 add } ifelse
  856. X    dup sin scaley mul exch cos scalex mul atan
  857. X    2 index 2 index
  858. X    { 90 add } { 90 sub } ifelse
  859. X    dup sin scaley mul exch cos scalex mul atan
  860. X    5 2 roll  % res1 res2 ang1 ang2 anticlockwise
  861. X    { exch sub } { sub } ifelse
  862. X    dup 0 le { 360 add } if  lfigpi mul LMax mul 180 div
  863. X     }
  864. X     {    0 0 x1 y1 lfigdistance 0 0 x2 y2 lfigdistance eq
  865. X    0 0 x1 y1 lfigdistance 0 gt and
  866. X    {    0 0
  867. X        0 0 x1 y1 lfigdistance
  868. X        0 0 x1 y1 lfigangle
  869. X        0 0 x2 y2 lfigangle
  870. X        2 copy eq { 360 add } if
  871. X        2 copy 8 2 roll
  872. X        5 index { arc } { arcn } ifelse
  873. X        2 index 1 index
  874. X        { 90 sub } { 90 add } ifelse
  875. X        2 index 2 index
  876. X        { 90 add } { 90 sub } ifelse
  877. X        5 2 roll % res1 res2 ang1 ang2 clockwise
  878. X        { exch sub } { sub } ifelse
  879. X        dup 0 le { 360 add } if lfigpi mul 0 0 x1 y1 lfigdistance mul 180 div
  880. X    }
  881. X    {    x2 y2 lineto pop
  882. X        x2 y2 x1 y1 lfigangle
  883. X        x1 y1 x2 y2 lfigangle
  884. X        x1 y1 x2 y2 lfigdistance
  885. X    } ifelse
  886. X     } ifelse
  887. X     4 -1 roll setmatrix
  888. X   end
  889. X} def
  890. X
  891. X% lfigsetcurve: set up a Bezier curve from x0 y0 to x3 y3
  892. X% and return arrowhead angles and length of curve (actually 0)
  893. X% x0 y0 x1 y1 x2 y2 x3 y3 lfigsetcurve <angle> <angle> <length>
  894. X/lfigsetcurve
  895. X{ 8 copy curveto pop pop
  896. X  lfigangle
  897. X  5 1 roll
  898. X  4 2 roll lfigangle
  899. X  exch
  900. X  0
  901. X} def
  902. X
  903. X% lfigpaintpath: paint a path of the given shape
  904. X% /paint [ shape ] lfigpaintpath -
  905. X/lfigpaintpath
  906. X{
  907. X  10 dict begin
  908. X    0 newpath
  909. X    /prevseen false def
  910. X    /curveseen false def
  911. X    { lfiggetnextitem
  912. X      dup 0 eq { pop exit }
  913. X      { 1 eq
  914. X        { /curveseen true def
  915. X      /curve exch def
  916. X      curve length 0 eq { /curveseen false def } if
  917. X        }
  918. X        { /ycurr exch def
  919. X      /xcurr exch def
  920. X      prevseen
  921. X      { curveseen
  922. X        { curve length 4 eq
  923. X          { xprev yprev
  924. X        curve 0 get curve 1 get
  925. X        curve 2 get curve 3 get
  926. X        xcurr ycurr
  927. X        lfigsetcurve pop pop pop
  928. X          }
  929. X          { xprev yprev xcurr ycurr
  930. X            curve length 1 ge { curve 0 get } { 0 } ifelse
  931. X            curve length 2 ge { curve 1 get } { 0 } ifelse
  932. X            curve length 3 ge { curve 2 get } { true } ifelse
  933. X            7 1 roll
  934. X            lfigsetarc pop pop pop
  935. X          } ifelse
  936. X        }
  937. X        { xcurr ycurr lineto
  938. X        } ifelse
  939. X      }
  940. X      { xcurr ycurr moveto
  941. X      } ifelse
  942. X      /xprev xcurr def
  943. X      /yprev ycurr def
  944. X      /prevseen true def
  945. X      /curveseen false def
  946. X        } ifelse
  947. X      } ifelse
  948. X    } loop pop pop cvx exec
  949. X  end
  950. X} def
  951. X
  952. X% stroke a path of the given shape in the given linestyle and dash length.
  953. X% Return the origin and angle of the backward and forward arrow heads.
  954. X% dashlength /linestyle [shape] lfigdopath  [<point> <angle>] [<point> <angle>] 
  955. X/lfigdopath
  956. X{
  957. X  10 dict begin
  958. X    0
  959. X    /prevseen  false def
  960. X    /curveseen false def
  961. X    /backarrow []    def
  962. X    /fwdarrow  []    def
  963. X    {
  964. X    lfiggetnextitem
  965. X    dup 0 eq { pop exit }
  966. X    {
  967. X        1 eq
  968. X        {    /curveseen true def
  969. X        /curve exch def
  970. X        curve length 0 eq { /prevseen false def } if
  971. X        }
  972. X        {    /ycurr exch def
  973. X        /xcurr exch def
  974. X        prevseen
  975. X        {   newpath xprev yprev moveto
  976. X            curveseen
  977. X            {    curve length 4 eq
  978. X            {   xprev yprev
  979. X                curve 0 get curve 1 get
  980. X                curve 2 get curve 3 get
  981. X                xcurr ycurr lfigsetcurve
  982. X            }
  983. X            {   xprev yprev xcurr ycurr
  984. X                curve length 1 ge { curve 0 get } { 0 } ifelse
  985. X                curve length 2 ge { curve 1 get } { 0 } ifelse
  986. X                curve length 3 ge { curve 2 get } { true } ifelse
  987. X                7 1 roll
  988. X                lfigsetarc
  989. X            } ifelse
  990. X            }
  991. X            {    xcurr ycurr lineto
  992. X            xcurr ycurr xprev yprev lfigangle dup 180 sub
  993. X            xprev yprev xcurr ycurr lfigdistance
  994. X            } ifelse
  995. X            6 index 6 index cvx exec
  996. X            [ xprev yprev 5 -1 roll ]
  997. X            backarrow length 0 eq
  998. X            { /backarrow exch def }
  999. X            { pop } ifelse
  1000. X            [ xcurr ycurr 4 -1 roll ] /fwdarrow exch def
  1001. X        } if
  1002. X        /xprev xcurr def
  1003. X        /yprev ycurr def
  1004. X        /prevseen true def
  1005. X        /curveseen false def
  1006. X        } ifelse
  1007. X    } ifelse
  1008. X    } loop
  1009. X    pop pop pop pop
  1010. X    backarrow length 0 eq { [ 0 0 0 ] } { backarrow } ifelse
  1011. X    fwdarrow  length 0 eq { [ 0 0 0 ] } { fwdarrow  } ifelse
  1012. X  end
  1013. X} def
  1014. X
  1015. X% lfigdoarrow: draw an arrow head of given form
  1016. X% dashlength /lstyle /pstyle hfrac height width [ <point> <angle> ] lfigdoarrow -
  1017. X/lfigdoarrow
  1018. X{  matrix currentmatrix 8 1 roll
  1019. X   dup 0 get 1 index 1 get translate
  1020. X   2 get rotate
  1021. X   [ 2 index neg 2 index 0 0
  1022. X     3 index 3 index neg
  1023. X     1 index 10 index mul 0
  1024. X     7 index 7 index ]
  1025. X   4 1 roll pop pop pop
  1026. X   dup 3 1 roll
  1027. X   gsave lfigpaintpath grestore lfigdopath pop pop
  1028. X   setmatrix
  1029. X} def
  1030. X
  1031. X% arrow head styles
  1032. X/lfigopen     0.0 def
  1033. X/lfighalfopen 0.5 def
  1034. X/lfigclosed   1.0 def
  1035. X
  1036. X% stroke no arrows, forward, back, and both
  1037. X/lfignoarrow { pop pop pop pop pop pop pop pop                        } def
  1038. X/lfigforward { 7 -1 roll lfigdoarrow pop                              } def
  1039. X/lfigback    { 8 -2 roll pop lfigdoarrow                              } def
  1040. X/lfigboth    { 8 -1 roll 7 copy lfigdoarrow pop 7 -1 roll lfigdoarrow } def
  1041. X
  1042. X% lfigprevious: return previous point on path
  1043. X/lfigprevious
  1044. X{ lfigisnumbertype
  1045. X  { 2 copy }
  1046. X  { lfigisarraytype
  1047. X    { 2 index 2 index }
  1048. X    { 0 0 }
  1049. X    ifelse
  1050. X  } ifelse
  1051. X} def
  1052. X
  1053. X% label a point in 2nd top dictionary:  <point> /name lfigpointdef -
  1054. X/lfigpointdef
  1055. X{
  1056. X  % (Entering lfigpointdef) lfigdebugprint
  1057. X  [ 4 2 roll transform
  1058. X    /itransform cvx ] cvx
  1059. X    currentdict end
  1060. X    3 1 roll
  1061. X    % currentdict length currentdict maxlength lt
  1062. X    % { def }
  1063. X    % { exec moveto (too many labels) show stop }
  1064. X    % ifelse
  1065. X    def
  1066. X    begin
  1067. X  % (Leaving lfigpointdef) lfigdebugprint
  1068. X} def
  1069. X
  1070. X% promote labels from second top to third top dictionary
  1071. X% <string> lfigpromotelabels -
  1072. X/lfigpromotelabels
  1073. X{
  1074. X  % (Entering lfigpromotelabels) lfigdebugprint
  1075. X  currentdict end exch currentdict end
  1076. X  { exch 20 string cvs 2 index
  1077. X    (@) lfigconcat exch lfigconcat cvn exch def
  1078. X  } forall pop begin
  1079. X  % (Leaving lfigpromotelabels) lfigdebugprint
  1080. X} def
  1081. X
  1082. X% show labels (except CIRCUM): - lfigshowlabels -
  1083. X/lfigshowlabels
  1084. X{
  1085. X  % (Entering lfigshowlabels) lfigdebugprint
  1086. X  currentdict end
  1087. X    currentdict
  1088. X    { 1 index 20 string cvs (CIRCUM) search % if CIRCUM in key
  1089. X      { pop pop pop pop pop }
  1090. X      { pop cvx exec 2 copy
  1091. X        newpath 1.5 pt 0 360 arc
  1092. X        0 setgray fill
  1093. X        /Times-Roman findfont 8 pt scalefont setfont
  1094. X        moveto 0.2 cm 0.1 cm rmoveto 20 string cvs show
  1095. X      }
  1096. X      ifelse
  1097. X    } forall
  1098. X  begin
  1099. X  % (Leaving lfigshowlabels) lfigdebugprint
  1100. X} def
  1101. X
  1102. X% fix an angle to between 0 and 360 degrees:  <angle> lfigfixangle <angle>
  1103. X/lfigfixangle
  1104. X{
  1105. X  % (Entering lfigfixangle) lfigdebugprint
  1106. X  { dup 0 ge { exit } if
  1107. X    360 add
  1108. X  } loop
  1109. X  { dup 360 lt { exit } if
  1110. X    360 sub
  1111. X  } loop
  1112. X  % (Leaving lfigfixangle) lfigdebugprint
  1113. X} def
  1114. X
  1115. X% find point on circumference of box:  alpha a b lfigboxcircum x y
  1116. X/lfigboxcircum
  1117. X{
  1118. X  % (Entering lfigboxcircum) lfigdebugprint
  1119. X  4 dict begin
  1120. X    /b exch def
  1121. X    /a exch def
  1122. X    lfigfixangle /alpha exch def
  1123. X    0 0 a b lfigangle /theta exch def
  1124. X
  1125. X    % if alpha <= theta, return (a, a*tan(alpha))
  1126. X    alpha theta le
  1127. X    { a  a alpha sin mul alpha cos div }
  1128. X    {
  1129. X      % else if alpha <= 180 - theta, return (b*cot(alpha), b)
  1130. X      alpha 180 theta sub le
  1131. X      { b alpha cos mul alpha sin div  b }
  1132. X      {
  1133. X        % else if alpha <= 180 + theta, return (-a, -a*tan(alpha))
  1134. X        alpha 180 theta add le
  1135. X        { a neg  a neg alpha sin mul alpha cos div }
  1136. X        {
  1137. X      % else if alpha <= 360 - theta, return (-b*cot(alpha), -b)
  1138. X      alpha 360 theta sub le
  1139. X          { b neg alpha cos mul alpha sin div  b neg }
  1140. X      {
  1141. X        % else 360 - theta <= alpha, return (a, a*tan(alpha))
  1142. X        a  a alpha sin mul alpha cos div
  1143. X      } ifelse
  1144. X        } ifelse
  1145. X      } ifelse
  1146. X    } ifelse
  1147. X  end
  1148. X  % (Leaving lfigboxcircum) lfigdebugprint
  1149. X} def
  1150. X
  1151. X% find point on circumference of diamond:  alpha a b lfigdiamondcircum x y
  1152. X/lfigdiamondcircum
  1153. X{
  1154. X  % (Entering lfigdiamondcircum) lfigdebugprint
  1155. X  4 dict begin
  1156. X    /b exch def
  1157. X    /a exch def
  1158. X    lfigfixangle /alpha exch def
  1159. X    b alpha cos abs mul  a alpha sin abs mul  add  /denom exch def
  1160. X    a b mul alpha cos mul denom div
  1161. X    a b mul alpha sin mul denom div
  1162. X  end
  1163. X  % (Leaving lfigdiamondcircum) lfigdebugprint
  1164. X} def
  1165. X
  1166. X% find point on circumference of ellipse:  alpha a b lfigellipsecircum x y
  1167. X/lfigellipsecircum
  1168. X{
  1169. X  % (Entering lfigellipsecircum) lfigdebugprint
  1170. X  4 dict begin
  1171. X    /b exch def
  1172. X    /a exch def
  1173. X    lfigfixangle /alpha exch def
  1174. X    b alpha cos mul dup mul  a alpha sin mul dup mul  add sqrt /denom exch def
  1175. X    a b mul alpha cos mul denom div
  1176. X    a b mul alpha sin mul denom div
  1177. X  end
  1178. X  % (Leaving lfigellipsecircum) lfigdebugprint
  1179. X} def
  1180. X
  1181. X% find point of intersection of two lines each defined by two points
  1182. X% x1 y1 x2 y2  x3 y3 x4 y4  lfiglineintersect x y
  1183. X/lfiglineintersect
  1184. X{
  1185. X  % (Entering lfiglineintersect) lfigdebugprint
  1186. X  13 dict begin
  1187. X    /y4 exch def
  1188. X    /x4 exch def
  1189. X    /y3 exch def
  1190. X    /x3 exch def
  1191. X    /y2 exch def
  1192. X    /x2 exch def
  1193. X    /y1 exch def
  1194. X    /x1 exch def
  1195. X    x2 x1 sub /x21 exch def
  1196. X    x4 x3 sub /x43 exch def
  1197. X    y2 y1 sub /y21 exch def
  1198. X    y4 y3 sub /y43 exch def
  1199. X    y21 x43 mul y43 x21 mul sub /det exch def
  1200. X  
  1201. X    % calculate x 
  1202. X    y21 x43 mul x1 mul
  1203. X    y43 x21 mul x3 mul sub
  1204. X    y3 y1 sub x21 mul x43 mul add
  1205. X    det div
  1206. X
  1207. X    % calculate y
  1208. X    x21 y43 mul y1 mul
  1209. X    x43 y21 mul y3 mul sub
  1210. X    x3 x1 sub y21 mul y43 mul add
  1211. X    det neg div
  1212. X
  1213. X  end
  1214. X  % (Leaving lfiglineintersect) lfigdebugprint
  1215. X} def
  1216. X
  1217. X% find point on circumference of polygon
  1218. X% alpha radius num theta lfigpolycircum x y
  1219. X/lfigpolycircum
  1220. X{
  1221. X  % (Entering lfigpolycircum) lfigdebugprint
  1222. X  13 dict begin
  1223. X    /theta exch def
  1224. X    /num exch def
  1225. X    /radius exch def
  1226. X    /alpha exch def
  1227. X
  1228. X    % calculate delta, the angle from theta to alpha
  1229. X    alpha theta sub lfigfixangle
  1230. X
  1231. X    % calculate the angle which is the multiple of 360/num closest to delta
  1232. X    360 num div div truncate 360 num div mul theta add /anglea exch def
  1233. X
  1234. X    % calculate the next multiple of 360/num after anglea
  1235. X    anglea 360 num div add /angleb exch def
  1236. X
  1237. X    % intersect the line through these two points with the alpha line
  1238. X    anglea cos anglea sin  angleb cos angleb sin
  1239. X    0 0  alpha cos 2 mul alpha sin 2 mul
  1240. X    lfiglineintersect radius lfigpmul
  1241. X
  1242. X  end
  1243. X  % (Leaving lfigpolycircum) lfigdebugprint
  1244. X} def
  1245. X
  1246. X% add CIRCUM operator with this body:  <array> lfigcircumdef -
  1247. X/lfigcircumdef
  1248. X{   % (Entering lfigcircumdef) lfigdebugprint
  1249. X    /CIRCUM exch cvx
  1250. X    currentdict end
  1251. X    3 1 roll
  1252. X    % currentdict length currentdict maxlength lt
  1253. X    % { def }
  1254. X    % { exec moveto (too many labels) show stop }
  1255. X    % ifelse
  1256. X    def
  1257. X    begin
  1258. X    % (Leaving lfigcircumdef) lfigdebugprint
  1259. X} def
  1260. X
  1261. Xend
  1262. X%%EndResource
  1263. END_OF_FILE
  1264.   if test 22299 -ne `wc -c <'lout/include/fig_prepend'`; then
  1265.     echo shar: \"'lout/include/fig_prepend'\" unpacked with wrong size!
  1266.   fi
  1267.   # end of 'lout/include/fig_prepend'
  1268. fi
  1269. if test -f 'lout/z13.c' -a "${1}" != "-c" ; then 
  1270.   echo shar: Will not clobber existing file \"'lout/z13.c'\"
  1271. else
  1272.   echo shar: Extracting \"'lout/z13.c'\" \(20116 characters\)
  1273.   sed "s/^X//" >'lout/z13.c' <<'END_OF_FILE'
  1274. X/*@z13.c:Object Breaking:BreakObject()@***************************************/
  1275. X/*                                                                           */
  1276. X/*  LOUT: A HIGH-LEVEL LANGUAGE FOR DOCUMENT FORMATTING (VERSION 2.03)       */
  1277. X/*  COPYRIGHT (C) 1993 Jeffrey H. Kingston                                   */
  1278. X/*                                                                           */
  1279. X/*  Jeffrey H. Kingston (jeff@cs.su.oz.au)                                   */
  1280. X/*  Basser Department of Computer Science                                    */
  1281. X/*  The University of Sydney 2006                                            */
  1282. X/*  AUSTRALIA                                                                */
  1283. X/*                                                                           */
  1284. X/*  This program is free software; you can redistribute it and/or modify     */
  1285. X/*  it under the terms of the GNU General Public License as published by     */
  1286. X/*  the Free Software Foundation; either version 1, or (at your option)      */
  1287. X/*  any later version.                                                       */
  1288. X/*                                                                           */
  1289. X/*  This program is distributed in the hope that it will be useful,          */
  1290. X/*  but WITHOUT ANY WARRANTY; without even the implied warranty of           */
  1291. X/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            */
  1292. X/*  GNU General Public License for more details.                             */
  1293. X/*                                                                           */
  1294. X/*  You should have received a copy of the GNU General Public License        */
  1295. X/*  along with this program; if not, write to the Free Software              */
  1296. X/*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                */
  1297. X/*                                                                           */
  1298. X/*  FILE:         z13.c                                                      */
  1299. X/*  MODULE:       Object Breaking                                            */
  1300. X/*  EXTERNS:      BreakObject()                                              */
  1301. X/*                                                                           */
  1302. X/*****************************************************************************/
  1303. X#include "externs"
  1304. X
  1305. X
  1306. X/*****************************************************************************/
  1307. X/*                                                                           */
  1308. X/*  static BreakJoinedGroup(start, stop, m, c, res_back, res_fwd)            */
  1309. X/*                                                                           */
  1310. X/*  Break joined group of components of a VCAT, beginning from Child(start)  */
  1311. X/*  inclusive and ending at Child(stop) inclusive.  Break component m first  */
  1312. X/*  because it is the widest.                                                */
  1313. X/*                                                                           */
  1314. X/*****************************************************************************/
  1315. X
  1316. Xstatic BreakJoinedGroup(start, stop, m, c, res_back, res_fwd)
  1317. XOBJECT start, stop, m;  CONSTRAINT *c;  LENGTH *res_back, *res_fwd;
  1318. X{ OBJECT y, z, link;  LENGTH b, f, mb, mf;  CONSTRAINT yc;
  1319. X  ifdebug(DOB, D, Child(y, start));
  1320. X  ifdebug(DOB, D, Child(z, stop));
  1321. X  debug3(DOB, D, "BreakJoinedGroup( -> %s, -> %s, %s, -, -)",
  1322. X    EchoObject(null, y), EchoObject(null, z), EchoConstraint(c));
  1323. X  CopyConstraint(yc, *c);
  1324. X  if( m != nil )
  1325. X  { m = BreakObject(m, &yc);
  1326. X    b = back(m, COL);
  1327. X    f = fwd(m, COL);
  1328. X    SetConstraint(yc, min(bc(yc), bfc(yc)-f), bfc(yc), min(fc(yc), bfc(yc)-b));
  1329. X  }
  1330. X  else b = f = 0;
  1331. X  for( link = start;  link != NextDown(stop);  link = NextDown(link) )
  1332. X  { Child(y, link);
  1333. X    if( !is_definite(type(y)) || y == m )  continue;
  1334. X    y = BreakObject(y, &yc);
  1335. X    b = max(b, back(y, COL));
  1336. X    f = max(f, fwd(y, COL));
  1337. X    SetConstraint(yc, min(bc(yc), bfc(yc)-f), bfc(yc), min(fc(yc), bfc(yc)-b));
  1338. X  }
  1339. X  assert( FitsConstraint(b, f, *c), "BreakJoinedGroup: result doesn't fit!" );
  1340. X  *res_back = b;  *res_fwd = f;
  1341. X  debug2(DOB,D,"BreakJoinedGroup returning (%s, %s)",
  1342. X    EchoLength(b), EchoLength(f));
  1343. X} /* end BreakJoinedGroup */
  1344. X
  1345. X
  1346. X/*@@**************************************************************************/
  1347. X/*                                                                           */
  1348. X/*  static OBJECT BreakVcat(x, c)                                            */
  1349. X/*                                                                           */
  1350. X/*  Break a VCAT to satisfy constraint c.  This is tedious because every     */
  1351. X/*  group of components between //  ...  // must be broken separately.       */
  1352. X/*                                                                           */
  1353. X/*****************************************************************************/
  1354. X
  1355. XOBJECT BreakVcat(x, c)
  1356. XOBJECT x;  CONSTRAINT *c;
  1357. X{ OBJECT y, link, start_group, m;  LENGTH b, f; int dble_fwd;  CONSTRAINT tc;
  1358. X  BOOLEAN dble_found;
  1359. X  debug2(DOB, D, "[ BreakVcat(%s, %s)", EchoObject(null, x), EchoConstraint(c));
  1360. X  assert(Down(x) != x, "BreakVcat: Down(x) == x!" );
  1361. X  SetConstraint(tc, MAX_LEN, min(bfc(*c), fc(*c)), MAX_LEN);
  1362. X  
  1363. X  dble_found = FALSE;  dble_fwd = 0;  start_group = nil;
  1364. X  for( link = Down(x);  link != x;  link = NextDown(link) )
  1365. X  {
  1366. X    Child(y, link);
  1367. X    if( is_index(type(y)) )  continue;
  1368. X    if( type(y) == GAP_OBJ )
  1369. X    { assert( start_group != nil, "BreakVcat: start_group == nil!" );
  1370. X      if( !join(gap(y)) )
  1371. X      {
  1372. X    /* finish off and break this group */
  1373. X    if( !FitsConstraint(b, f, tc) )
  1374. X      BreakJoinedGroup(start_group, link, m, &tc, &b, &f);
  1375. X    dble_found = TRUE;
  1376. X    dble_fwd = max(dble_fwd, b + f);
  1377. X    start_group = nil;
  1378. X    debug1(DOB, D, "  end group, dble_fwd: %s", EchoLength(dble_fwd));
  1379. X      }
  1380. X    }
  1381. X    else if( start_group == nil )
  1382. X    {    
  1383. X      /* start new group */
  1384. X      b = back(y, COL);
  1385. X      f = fwd(y, COL);
  1386. X      start_group = link;
  1387. X      m = y;
  1388. X      debug3(DOB, D, "  starting group: %s (%s, %s)",
  1389. X    EchoObject(null, y), EchoLength(b), EchoLength(f));
  1390. X    }
  1391. X    else
  1392. X    {
  1393. X      /* continue with current group */
  1394. X      b = max(b, back(y, COL));
  1395. X      f = max(f, fwd(y, COL));
  1396. X      if( fwd(y, COL) > fwd(m, COL) )  m = y;
  1397. X      debug4(DOB, D, "  in group: %s%s (%s, %s)", m == y ? "new max " : "",
  1398. X    EchoObject(null, y), EchoLength(b), EchoLength(f));
  1399. X    }
  1400. X  }
  1401. X  assert( start_group != nil, "BreakVcat: start_group == nil (2)!" );
  1402. X
  1403. X  if( dble_found )
  1404. X  {    
  1405. X    /* finish off and break this last group, and set sizes of x */
  1406. X    if( !FitsConstraint(b, f, tc) )
  1407. X      BreakJoinedGroup(start_group, LastDown(x), m, &tc, &b, &f);
  1408. X    dble_fwd = max(dble_fwd, b + f);
  1409. X    debug1(DOB, D, "  ending last group, dble_fwd: %s",EchoLength(dble_fwd));
  1410. X    back(x, COL) = 0;  fwd(x, COL) = min(MAX_LEN, dble_fwd);
  1411. X  }
  1412. X  else
  1413. X  {
  1414. X    /* finish off and break this last and only group, and set sizes of x */
  1415. X    debug2(DOB, D, "  BreakVcat ending last and only group (%s, %s)",
  1416. X    EchoLength(b), EchoLength(f));
  1417. X    BreakJoinedGroup(start_group, LastDown(x), m, c, &b, &f);
  1418. X    back(x, COL) = b;  fwd(x, COL) = f;
  1419. X  }
  1420. X
  1421. X  debug1(DOB, D, "] BreakVcat returning %s", EchoObject(null, x));
  1422. X  debug2(DOB, D, "  (size is %s, %s)",
  1423. X    EchoLength(back(x, COL)), EchoLength(fwd(x, COL)));
  1424. X  return x;
  1425. X} /* end BreakVcat */
  1426. X
  1427. X/*@@**************************************************************************/
  1428. X/*                                                                           */
  1429. X/*  static OBJECT BreakTable(x, c)                                           */
  1430. X/*                                                                           */
  1431. X/*  Break table (HCAT) x to satisfy constraint c.                            */
  1432. X/*                                                                           */
  1433. X/*  Outline of algorithm:                                                    */
  1434. X/*                                                                           */
  1435. X/*     bcount = number of components to left of mark;                        */
  1436. X/*     fcount = no. of components on and right of mark;                      */
  1437. X/*     bwidth = what back(x) would be if all components had size (0, 0);     */
  1438. X/*     fwidth = what fwd(x) would be if all components had size (0, 0);      */
  1439. X/*     Set all components of x to Unbroken (broken(y) holds this flag);      */
  1440. X/*     while( an Unbroken component of x exists )                            */
  1441. X/*     {   my = the Unbroken component of x of minimum width;                */
  1442. X/*         mc = desirable constraint for my (see below);                     */
  1443. X/*         BreakObject(my, &mc);                                             */
  1444. X/*         Set my to Broken and update bcount, fcount, bwidth, fwidth        */
  1445. X/*            to reflect the actual size of my, now broken;                  */
  1446. X/*     }                                                                     */
  1447. X/*                                                                           */
  1448. X/*  The constraint mc is chosen in an attempt to ensure that:                */
  1449. X/*                                                                           */
  1450. X/*     a)  Any sufficiently narrow components will not break;                */
  1451. X/*     b)  All broken components will have the same bfc(mc), if possible;    */
  1452. X/*     c)  All available space is used.                                      */
  1453. X/*                                                                           */
  1454. X/*****************************************************************************/
  1455. X
  1456. Xstatic OBJECT BreakTable(x, c)
  1457. XOBJECT x;  CONSTRAINT *c;
  1458. X{ LENGTH bwidth, fwidth;    /* running back(x) and fwd(x)             */
  1459. X  int    bcount, fcount;    /* running no. of components             */
  1460. X  OBJECT mlink, my;        /* minimum-width unbroken component         */
  1461. X  BOOLEAN ratm;            /* TRUE when my has a mark to its right      */
  1462. X  int    mside;            /* my's side of the mark: BACK, ON or FWD    */
  1463. X  LENGTH msize;            /* my's size (minimal among unbroken)         */
  1464. X  CONSTRAINT mc;        /* desirable constraint for my             */
  1465. X  OBJECT pg, prec_def;        /* preceding definite object of my           */
  1466. X  OBJECT sg, succ_def;        /* succeeding definite object of my          */
  1467. X  LENGTH pd_extra, sd_extra;    /* space availiable for free each side of my */
  1468. X  LENGTH av_colsize;        /* the size of each unbroken component       */
  1469. X                /* if they are all assigned equal width      */
  1470. X  LENGTH fwd_max, back_max;    /* maximum space available forward of or     */
  1471. X                /* back of the mark, when columns are even   */
  1472. X  LENGTH col_size;        /* the column size actually used in breaking */
  1473. X  LENGTH beffect, feffect;    /* the amount bwidth, fwidth must increase   */
  1474. X                /* when my is broken                 */
  1475. X  OBJECT link, y, prev, g;  LENGTH tmp, tmp2;
  1476. X
  1477. X  debug2(DOB,DD,"[ BreakTable( %s, %s )", EchoObject(null,x),EchoConstraint(c));
  1478. X
  1479. X  /* Initialise csize, bcount, fcount, bwidth, fwidth and broken(y) */
  1480. X  bcount = fcount = 0;  bwidth = fwidth = 0;  prev = nil;
  1481. X  Child(y, Down(x));
  1482. X  assert( type(y) != GAP_OBJ, "BreakTable: GAP_OBJ!" );
  1483. X  assert( !is_index(type(y)), "BreakTable: index!" );
  1484. X  broken(y) = is_indefinite(type(y));
  1485. X  if( !broken(y) )  prev = y, fcount = 1;
  1486. X
  1487. X  for( link = NextDown(Down(x));  link != x;  link = NextDown(NextDown(link)) )
  1488. X  {
  1489. X    /* find the next gap g and following child y */
  1490. X    Child(g, link);
  1491. X    assert( type(g) == GAP_OBJ, "BreakTable: GAP_OBJ!" );
  1492. X    assert( NextDown(link) != x, "BreakTable: GAP_OBJ is last!" );
  1493. X    Child(y, NextDown(link));
  1494. X
  1495. X    assert( type(y) != GAP_OBJ, "BreakTable: GAP_OBJ!" );
  1496. X    assert( !is_index(type(y)), "BreakTable: index!" );
  1497. X    broken(y) = is_indefinite(type(y));
  1498. X    if( !broken(y) )
  1499. X    { if( prev == nil )  fcount = 1;
  1500. X      else if( mark(gap(g)) )
  1501. X      {    bcount += fcount;
  1502. X    bwidth += fwidth + MinGap(0, 0, 0, &gap(g));
  1503. X    fcount  = 1;  fwidth = 0;
  1504. X      }
  1505. X      else
  1506. X      {    fwidth += MinGap(0, 0, 0, &gap(g));
  1507. X    fcount += 1;
  1508. X      }
  1509. X      prev = y;
  1510. X    }
  1511. X  }
  1512. X
  1513. X  /* if column gaps alone are too wide, kill them all */
  1514. X  if( !FitsConstraint(bwidth, fwidth, *c) )
  1515. X  { Error(WARN, &fpos(x), "object too wide: reducing column gaps to 0i");
  1516. X    for( link = Down(x);  link != x;  link = NextDown(link) )
  1517. X    { Child(g, link);
  1518. X      if( type(g) == GAP_OBJ )
  1519. X      {    SetGap(gap(g), mark(gap(g)), join(gap(g)), FIXED_UNIT, EDGE_MODE, 0);
  1520. X      }
  1521. X    }
  1522. X    bwidth = fwidth = 0;
  1523. X  }
  1524. X
  1525. X  /* break each column, from smallest to largest */
  1526. X  while( bcount + fcount > 0 && FitsConstraint(bwidth, fwidth, *c) )
  1527. X  {
  1528. X    debug2(DOB,DD, "bcount: %d;  bwidth: %s", bcount, EchoLength(bwidth));
  1529. X    debug2(DOB,DD, "fcount: %d;  fwidth: %s", fcount, EchoLength(fwidth));
  1530. X
  1531. X    /* find a minimal-width unbroken component my */
  1532. X    my = nil;  msize = size(x, COL);       /* an upper bound for size(y) */
  1533. X    for( link = Down(x);  ;  link = NextDown(link) )
  1534. X    { Child(y, link);
  1535. X      assert( type(y) != GAP_OBJ, "BreakTable: type(y) == GAP_OBJ!" );
  1536. X      if( !broken(y) && (size(y, COL) < msize || my == nil) )
  1537. X      {    msize = size(y, COL);
  1538. X    my = y;  mlink = link;
  1539. X    ratm = FALSE;
  1540. X      }
  1541. X
  1542. X      /* next gap */
  1543. X      link = NextDown(link);
  1544. X      if( link == x )  break;
  1545. X      Child(g, link);
  1546. X      assert( type(g) == GAP_OBJ, "BreakTable: type(g) != GAP_OBJ!" );
  1547. X      if( mark(gap(g)) )  ratm = TRUE;
  1548. X    }
  1549. X    debug2(DOB, DD, "my (%s): %s", Image(mside), EchoObject(null, my));
  1550. X
  1551. X    /* find neighbouring definite objects and resulting pd_extra and sd_extra */
  1552. X    SetNeighbours(mlink, ratm, &pg, &prec_def, &sg, &succ_def, &mside);
  1553. X    pd_extra = pg == nil ? 0 :
  1554. X      ExtraGap(broken(prec_def) ? fwd(prec_def,COL) : 0, 0, &gap(pg), BACK);
  1555. X    sd_extra = sg == nil ? 0 :
  1556. X      ExtraGap(0, broken(succ_def) ? back(succ_def,COL) : 0, &gap(sg), FWD);
  1557. X    debug2(DOB, DD, "pd_extra:   %s;  sd_extra:      %s",
  1558. X        EchoLength(pd_extra), EchoLength(sd_extra) );
  1559. X
  1560. X    /* calculate desirable constraints for my */
  1561. X    av_colsize = (bfc(*c) - bwidth - fwidth) / (bcount + fcount);
  1562. X    debug1(DOB, DD, "av_colsize = %s", EchoLength(av_colsize));
  1563. X    switch( mside )
  1564. X    {
  1565. X
  1566. X      case BACK:
  1567. X      
  1568. X    back_max = min(bc(*c), bwidth + av_colsize * bcount);
  1569. X    col_size = (back_max - bwidth) / bcount;
  1570. X    SetConstraint(mc, col_size + pd_extra, col_size + pd_extra + sd_extra,
  1571. X            col_size + sd_extra );
  1572. X    break;
  1573. X
  1574. X
  1575. X      case ON:
  1576. X      
  1577. X    fwd_max = min(fc(*c), fwidth + av_colsize * fcount);
  1578. X    col_size = (fwd_max - fwidth) / fcount;
  1579. X    SetConstraint(mc, pd_extra, MAX_LEN, col_size + sd_extra);
  1580. X    break;
  1581. X
  1582. X
  1583. X      case FWD:
  1584. X      
  1585. X    fwd_max = min(fc(*c), fwidth + av_colsize * fcount);
  1586. X    col_size = (fwd_max - fwidth) / fcount;
  1587. X    SetConstraint(mc, col_size + pd_extra, col_size + pd_extra + sd_extra,
  1588. X            col_size + sd_extra );
  1589. X    break;
  1590. X
  1591. X
  1592. X      default:
  1593. X      
  1594. X    Error(INTERN, no_fpos, "BreakTable found illegal side");
  1595. X    break;
  1596. X    }
  1597. X
  1598. X    /* now break my according to these constraints, and accept it */
  1599. X    my = BreakObject(my, &mc);  broken(my) = TRUE;
  1600. X
  1601. X    /* calculate the effect of accepting my on bwidth and fwidth */
  1602. X    if( pg != nil )
  1603. X    { tmp = broken(prec_def) ? fwd(prec_def, COL) : 0;
  1604. X      beffect = MinGap(tmp, back(my, COL), fwd(my, COL), &gap(pg)) -
  1605. X            MinGap(tmp, 0,             0,            &gap(pg));
  1606. X    }
  1607. X    else beffect = back(my, COL);
  1608. X
  1609. X    if( sg != nil )
  1610. X    { tmp = broken(succ_def) ? back(succ_def, COL) : 0;
  1611. X      tmp2 = broken(succ_def) ? fwd(succ_def, COL) : 0;
  1612. X      feffect = MinGap(fwd(my, COL), tmp, tmp2, &gap(sg)) -
  1613. X            MinGap(0,            tmp, tmp2, &gap(sg));
  1614. X    }
  1615. X    else feffect = fwd(my, COL);
  1616. X
  1617. X    switch( mside )
  1618. X    {
  1619. X    case BACK:    bwidth += beffect + feffect;
  1620. X            bcount--;
  1621. X            break;
  1622. X    
  1623. X    case ON:    bwidth += beffect;  fwidth += feffect;
  1624. X            fcount--;
  1625. X            break;
  1626. X
  1627. X    case FWD:    fwidth += beffect + feffect;
  1628. X            fcount--;
  1629. X            break;
  1630. X    
  1631. X    default:    Error(INTERN, no_fpos, "BreakTable found illegal side");
  1632. X            break;
  1633. X    }
  1634. X
  1635. X  } /* end while */
  1636. X
  1637. X  back(x, COL) = bwidth;
  1638. X  fwd(x, COL) = fwidth;
  1639. X
  1640. X  debug1(DOB, DD,  "] BreakTable returning %s", EchoObject(null, x));
  1641. X  debug2(DOB, DD, "  (size is %s, %s)",
  1642. X    EchoLength(bwidth), EchoLength(fwidth));
  1643. X  return x;
  1644. X} /* end BreakTable */
  1645. X
  1646. X
  1647. X/*@@**************************************************************************/
  1648. X/*                                                                           */
  1649. X/*  OBJECT BreakObject(x, c)                                                 */
  1650. X/*                                                                           */
  1651. X/*  Break lines of object x so that it satisfies constraint c.               */
  1652. X/*                                                                           */
  1653. X/*****************************************************************************/
  1654. X
  1655. XOBJECT BreakObject(x, c)
  1656. XOBJECT x;  CONSTRAINT *c;
  1657. X{ OBJECT y;  CONSTRAINT yc, tc;
  1658. X  /***
  1659. X  debug1(DOB, DD,  "[ BreakObject( %s )", EchoObject(null, x));
  1660. X  debug3(DOB, DD, "  (size %s,%s; constraint %s)",
  1661. X    EchoLength(back(x, COL)), EchoLength(fwd(x, COL)), EchoConstraint(c));
  1662. X  ***/
  1663. X  debug3(DOB, DD,  "[ BreakObject(x (%s,%s),  %s), x =",
  1664. X    EchoLength(back(x, COL)), EchoLength(fwd(x, COL)), EchoConstraint(c));
  1665. X  ifdebug(DOB, DD, EchoObject(stderr, x));
  1666. X
  1667. X  if( FitsConstraint(back(x, COL), fwd(x, COL), *c) )
  1668. X  { debug0(DOB, DD, "] BreakObject returning (fits).");
  1669. X    return x;
  1670. X  }
  1671. X  switch( type(x) )
  1672. X  {
  1673. X
  1674. X    case ROTATE:
  1675. X    
  1676. X      Error(WARN, &fpos(x), "%s deleted (too wide; cannot break %s)",
  1677. X    KW_ROTATE, KW_ROTATE);
  1678. X      y = MakeWord("", &fpos(x));
  1679. X      back(y, COL) = fwd(y, COL) = 0;
  1680. X      ReplaceNode(y, x);
  1681. X      DisposeObject(x);
  1682. X      x = y;
  1683. X      break;
  1684. X
  1685. X
  1686. X    case SCALE:
  1687. X
  1688. X      InvScaleConstraint(&yc, bc(constraint(x)), c);
  1689. X      Child(y, Down(x));
  1690. X      y = BreakObject(y, &yc);
  1691. X      back(x, COL) = (back(y, COL) * bc(constraint(x))) / SF;
  1692. X      fwd(x, COL) =  (fwd(y, COL)  * bc(constraint(x))) / SF;
  1693. X      break;
  1694. X
  1695. X
  1696. X    case WORD:
  1697. X    
  1698. X      Error(WARN, &fpos(x), "word %s deleted (too wide)",string(x));
  1699. X      y = MakeWord("", &fpos(x));
  1700. X      back(y, COL) = fwd(y, COL) = 0;
  1701. X      ReplaceNode(y, x);
  1702. X      DisposeObject(x);
  1703. X      x = y;
  1704. X      break;
  1705. X
  1706. X
  1707. X    case WIDE:
  1708. X    
  1709. X      Error(WARN, &fpos(x), "%s %s reduced (too wide)",
  1710. X    EchoLength(bfc(constraint(x))), KW_WIDE);
  1711. X      MinConstraint(&constraint(x), c);
  1712. X      Child(y, Down(x));
  1713. X      y = BreakObject(y, &constraint(x));
  1714. X      back(x, COL) = back(y, COL);
  1715. X      fwd(x, COL) = fwd(y, COL);
  1716. X      EnlargeToConstraint(&back(x, COL), &fwd(x, COL), &constraint(x));
  1717. X      break;
  1718. X
  1719. X
  1720. X    case INCGRAPHIC:
  1721. X    case SINCGRAPHIC:
  1722. X
  1723. X      Error(WARN, &fpos(x), "%s or %s deleted (too wide)", KW_INCGRAPHIC,
  1724. X    KW_SINCGRAPHIC);
  1725. X      y = MakeWord("", &fpos(x));
  1726. X      back(y, COL) = fwd(y, COL) = 0;
  1727. X      ReplaceNode(y, x);
  1728. X      DisposeObject(x);
  1729. X      x = y;
  1730. X      break;
  1731. X
  1732. X
  1733. X    case HIGH:
  1734. X    case VSCALE:
  1735. X    case HCONTRACT: 
  1736. X    case VCONTRACT:
  1737. X    case HEXPAND: 
  1738. X    case VEXPAND:
  1739. X    case PADJUST: 
  1740. X    case HADJUST: 
  1741. X    case VADJUST:
  1742. X    case ONE_ROW:
  1743. X    case ONE_COL:
  1744. X    
  1745. X      assert( Down(x) == LastDown(x), "BreakObject: downs!" );
  1746. X      Child(y, Down(x));
  1747. X      y = BreakObject(y, c);
  1748. X      back(x, COL) = back(y, COL);
  1749. X      fwd(x, COL) = fwd(y, COL);
  1750. X      break;
  1751. X
  1752. X
  1753. X    case GRAPHIC:
  1754. X    
  1755. X      Child(y, LastDown(x));
  1756. X      y = BreakObject(y, c);
  1757. X      back(x, COL) = back(y, COL);
  1758. X      fwd(x, COL) = fwd(y, COL);
  1759. X      break;
  1760. X
  1761. X
  1762. X    case SPLIT:
  1763. X    
  1764. X      Child(y, DownDim(x, COL));
  1765. X      y = BreakObject(y, c);
  1766. X      back(x, COL) = back(y, COL);
  1767. X      fwd(x, COL) = fwd(y, COL);
  1768. X      break;
  1769. X
  1770. X
  1771. X    case ACAT:
  1772. X    
  1773. X      x = FillObject(x, c);
  1774. X      break;
  1775. X
  1776. X
  1777. X    case HCAT:
  1778. X    
  1779. X      x = BreakTable(x, c);
  1780. X      break;
  1781. X
  1782. X
  1783. X    case COL_THR:
  1784. X    
  1785. X      BreakJoinedGroup(Down(x), LastDown(x), nil, c, &back(x,COL), &fwd(x,COL));
  1786. X      break;
  1787. X
  1788. X
  1789. X    case VCAT:
  1790. X    
  1791. X      x = BreakVcat(x, c);
  1792. X      break;
  1793. X            
  1794. X
  1795. X    default:
  1796. X    
  1797. X      Error(INTERN, &fpos(x), "BreakObject: %s!", Image(type(x)) );
  1798. X      break;
  1799. X
  1800. X  }
  1801. X  assert( back(x, COL) >= 0, "BreakObject: back(x, COL) < 0!" );
  1802. X  assert( fwd(x, COL) >= 0, "BreakObject: fwd(x, COL) < 0!" );
  1803. X  debug1(DOB, DD,  "] BreakObject returning %s", EchoObject(null, x));
  1804. X  debug2(DOB, DD, "  (size is %s, %s)",
  1805. X    EchoLength(back(x, COL)), EchoLength(fwd(x, COL)));
  1806. X  return x;
  1807. X} /* end BreakObject */
  1808. END_OF_FILE
  1809.   if test 20116 -ne `wc -c <'lout/z13.c'`; then
  1810.     echo shar: \"'lout/z13.c'\" unpacked with wrong size!
  1811.   fi
  1812.   # end of 'lout/z13.c'
  1813. fi
  1814. if test -f 'lout/z25.c' -a "${1}" != "-c" ; then 
  1815.   echo shar: Will not clobber existing file \"'lout/z25.c'\"
  1816. else
  1817.   echo shar: Extracting \"'lout/z25.c'\" \(20719 characters\)
  1818.   sed "s/^X//" >'lout/z25.c' <<'END_OF_FILE'
  1819. X/*@z25.c:Object Echo:EchoObject()@********************************************/
  1820. X/*                                                                           */
  1821. X/*  LOUT: A HIGH-LEVEL LANGUAGE FOR DOCUMENT FORMATTING (VERSION 2.03)       */
  1822. X/*  COPYRIGHT (C) 1993 Jeffrey H. Kingston                                   */
  1823. X/*                                                                           */
  1824. X/*  Jeffrey H. Kingston (jeff@cs.su.oz.au)                                   */
  1825. X/*  Basser Department of Computer Science                                    */
  1826. X/*  The University of Sydney 2006                                            */
  1827. X/*  AUSTRALIA                                                                */
  1828. X/*                                                                           */
  1829. X/*  This program is free software; you can redistribute it and/or modify     */
  1830. X/*  it under the terms of the GNU General Public License as published by     */
  1831. X/*  the Free Software Foundation; either version 1, or (at your option)      */
  1832. X/*  any later version.                                                       */
  1833. X/*                                                                           */
  1834. X/*  This program is distributed in the hope that it will be useful,          */
  1835. X/*  but WITHOUT ANY WARRANTY; without even the implied warranty of           */
  1836. X/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            */
  1837. X/*  GNU General Public License for more details.                             */
  1838. X/*                                                                           */
  1839. X/*  You should have received a copy of the GNU General Public License        */
  1840. X/*  along with this program; if not, write to the Free Software              */
  1841. X/*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                */
  1842. X/*                                                                           */
  1843. X/*  FILE:         z25.c                                                      */
  1844. X/*  MODULE:       Object Echo                                                */
  1845. X/*  EXTERNS:      EchoObject()                                               */
  1846. X/*                                                                           */
  1847. X/*****************************************************************************/
  1848. X#include "externs"
  1849. X#if DEBUG_ON
  1850. X
  1851. Xstatic    int    limit;            /* column where newline is needed    */
  1852. Xstatic    int    indent;            /* current indent                    */
  1853. Xstatic    int    col;            /* current output column             */
  1854. Xstatic    FILE    *fp;            /* current output file               */
  1855. X
  1856. X#define    moveright()    (indent += 3)
  1857. X#define    moveleft()    (indent -= 3)
  1858. X
  1859. X
  1860. X/*****************************************************************************/
  1861. X/*                                                                           */
  1862. X/*  static print(x)                                                          */
  1863. X/*                                                                           */
  1864. X/*  Print the string x onto the appropriate output.                          */
  1865. X/*                                                                           */
  1866. X/*****************************************************************************/
  1867. X
  1868. Xstatic print(x)
  1869. Xunsigned char *x;
  1870. X{ col += strlen(x);
  1871. X  if( fp == null ) AppendString(x);
  1872. X  else fputs(x, fp);
  1873. X} /* end print */
  1874. X
  1875. X
  1876. X/*****************************************************************************/
  1877. X/*                                                                           */
  1878. X/*  static printnum(x)                                                       */
  1879. X/*                                                                           */
  1880. X/*  Print the number x onto the appropriate output.                          */
  1881. X/*                                                                           */
  1882. X/*****************************************************************************/
  1883. X
  1884. Xstatic printnum(x)
  1885. Xint x;
  1886. X{ static unsigned char buff[20];
  1887. X  sprintf(buff, "%d", x);
  1888. X  print(buff);
  1889. X} /* end printnum */
  1890. X
  1891. X
  1892. X/*****************************************************************************/
  1893. X/*                                                                           */
  1894. X/*  static tab(x)                                                            */
  1895. X/*                                                                           */
  1896. X/*  Tab to column x, or anyway insert at least one space.                    */
  1897. X/*                                                                           */
  1898. X/*****************************************************************************/
  1899. X
  1900. Xstatic tab(x)
  1901. Xint x;
  1902. X{  do
  1903. X     print(" ");
  1904. X   while( col < x );
  1905. X} /* end tab */
  1906. X
  1907. X
  1908. X/*@@**************************************************************************/
  1909. X/*                                                                           */
  1910. X/*  static newline()                                                         */
  1911. X/*                                                                           */
  1912. X/*  Echo a newline to the appropriate output (unless output is a string).    */
  1913. X/*  Correct indenting and right limits are maintained, if possible.          */
  1914. X/*                                                                           */
  1915. X/*****************************************************************************/
  1916. X
  1917. Xstatic newline()
  1918. X{ if( fp == null )  AppendString(" ");
  1919. X  else
  1920. X  { fputs("\n", fp);
  1921. X    fflush(fp);
  1922. X    for( col = 0;  col < indent;  col++ )  fputs(" ", fp);
  1923. X  }
  1924. X} /* end newline */
  1925. X
  1926. X
  1927. X/*****************************************************************************/
  1928. X/*                                                                           */
  1929. X/*  static space(n)                                                          */
  1930. X/*                                                                           */
  1931. X/*  Echo n spaces to the appropriate output.                                 */
  1932. X/*  Correct indenting and right limits are maintained, if possible.          */
  1933. X/*                                                                           */
  1934. X/*****************************************************************************/
  1935. X
  1936. Xstatic space(n)
  1937. Xint n;
  1938. X{ int i;
  1939. X  if( fp == null )
  1940. X    for( i = 0;  i < n;  i++ )  AppendString(" ");
  1941. X  else if( col + n > limit )
  1942. X  { fputs("\n", fp);
  1943. X    for( col = 0;  col < n-1;  col++ )  fputs(" ", fp);
  1944. X  }
  1945. X  else for( i = 0;  i < n;  col++, i++ )  fputs(" ", fp);
  1946. X} /* end space */
  1947. X
  1948. X
  1949. X/*@@**************************************************************************/
  1950. X/*                                                                           */
  1951. X/*  static echo(x, outer_prec)                                               */
  1952. X/*                                                                           */
  1953. X/*  Echo x.  The result will be enclosed in braces only if its precedence    */
  1954. X/*  is less than or equal to outer_prec (words and parameterless closures    */
  1955. X/*  are taken to have infinite precedence, i.e. never enclosed in braces).   */
  1956. X/*                                                                           */
  1957. X/*****************************************************************************/
  1958. X
  1959. Xstatic echo(x, outer_prec)
  1960. XOBJECT x;  unsigned outer_prec;
  1961. X{ OBJECT link, y, tmp, sym;
  1962. X  unsigned char str[10], *op;  int prec, i;
  1963. X  BOOLEAN npar_seen, name_printed, lbr_printed, braces_needed;
  1964. X
  1965. X  switch( type(x) )
  1966. X  {
  1967. X
  1968. X    case DEAD:
  1969. X
  1970. X    print("#dead");
  1971. X    break;
  1972. X
  1973. X    case UNATTACHED:
  1974. X    
  1975. X    print( "#unattached " );
  1976. X    moveright();
  1977. X    if( Down(x) != x )
  1978. X    { Child(y, Down(x));
  1979. X      if( y != x ) echo(y, NO_PREC);
  1980. X      else print("<child is self!>");
  1981. X    }
  1982. X    else print("<no child!>");
  1983. X    moveleft();
  1984. X    break;
  1985. X
  1986. X
  1987. X    case EXPAND_IND:
  1988. X    case GALL_PREC:
  1989. X    case GALL_FOLL:
  1990. X    case GALL_TARG:
  1991. X    case CROSS_PREC:
  1992. X    case CROSS_FOLL:
  1993. X    case CROSS_TARG:
  1994. X    case RECURSIVE:
  1995. X    
  1996. X    print("#"); print(Image(type(x))); print(" ");
  1997. X    echo(actual(x), NO_PREC);
  1998. X    break;
  1999. X
  2000. X        
  2001. X    case RECEPTIVE:
  2002. X    case RECEIVING:
  2003. X    
  2004. X    print(type(x) == RECEIVING ? "#receiving " : "#receptive ");
  2005. X    if( external(actual(x)) )  print("(external) ");
  2006. X    if( threaded(actual(x)) )  print("(threaded) ");
  2007. X    if( blocked(x) )           print("(blocked) " );
  2008. X    if( trigger_externs(x) )   print("(trigger_externs) " );
  2009. X    if( non_blocking(x) )      print("(non_blocking) " );
  2010. X    print( type(actual(x)) == CLOSURE ?
  2011. X        SymName(actual(actual(x))) : Image(type(actual(x))) );
  2012. X    print(" ");
  2013. X    for( link = Down(x);  link != x;  link = NextDown(link) )
  2014. X    { Child(y, link);
  2015. X      moveright();
  2016. X      echo(y, NO_PREC);
  2017. X      moveleft();
  2018. X    }
  2019. X    break;
  2020. X
  2021. X
  2022. X    case PRECEDES:
  2023. X    
  2024. X    print("#precedes");
  2025. X    break;
  2026. X
  2027. X
  2028. X    case FOLLOWS:
  2029. X    
  2030. X    print("#follows");
  2031. X    if( blocked(x) )  print(" (blocked)");
  2032. X    Child(y, Down(x));
  2033. X    if( Up(y) == LastUp(y) )  print(" (no precedes!)");
  2034. X    break;
  2035. X
  2036. X
  2037. X    case HEAD:
  2038. X    
  2039. X    print("Galley ");  print(SymName(actual(x)));
  2040. X    print(" into ");   print(SymName(whereto(x)));
  2041. X    for( link = Down(x);  link != x;  link = NextDown(link) )
  2042. X    { Child(y, link);
  2043. X      newline();
  2044. X      echo(y, type(y) == GAP_OBJ ? VCAT : VCAT_PREC);
  2045. X    }
  2046. X    break;
  2047. X
  2048. X
  2049. X    case ROW_THR:
  2050. X
  2051. X    print("{R ");
  2052. X    for( link = Down(x);  link != x;  link = NextDown(link) )
  2053. X    { Child(y, link);
  2054. X      echo(y, VCAT_PREC);
  2055. X      newline();
  2056. X      if( NextDown(link) != x )  print("/R ");
  2057. X    }
  2058. X    print("R}");
  2059. X    break;
  2060. X
  2061. X
  2062. X    case COL_THR:
  2063. X
  2064. X    print("{C ");
  2065. X    for( link = Down(x);  link != x;  link = NextDown(link) )
  2066. X    { Child(y, link);
  2067. X      echo(y, HCAT_PREC);
  2068. X      newline();
  2069. X      if( NextDown(link) != x )  print("|C ");
  2070. X    }
  2071. X    print("C}");
  2072. X    break;
  2073. X
  2074. X
  2075. X    case VCAT: op = (unsigned char *) "/", prec = VCAT_PREC;  goto ETC;
  2076. X    case HCAT: op = (unsigned char *) "|", prec = HCAT_PREC;  goto ETC;
  2077. X    case ACAT: op = (unsigned char *) "&", prec = ACAT_PREC;  goto ETC;
  2078. X    
  2079. X    ETC:
  2080. X    if( Down(x) == x )
  2081. X    { print(op);
  2082. X      print("<empty>");
  2083. X      break;
  2084. X    }
  2085. X    if( prec <= outer_prec ) print("{ ");
  2086. X    /* *** if( Down(x) == LastDown(x) )  print(op);  must be manifested */
  2087. X    for( link = Down(x);  link != x;  link = NextDown(link) )
  2088. X    { Child(y, link);
  2089. X      if( is_index(type(y)) )
  2090. X        newline();
  2091. X      else if( (type(y) == GAP_OBJ && type(x) != ACAT) )
  2092. X        newline();
  2093. X      if( type(y) == GAP_OBJ )  echo(y, type(x));
  2094. X      else echo(y, prec);
  2095. X    }
  2096. X    if( prec <= outer_prec )  print(" }");
  2097. X    break;
  2098. X
  2099. X
  2100. X    case GAP_OBJ:
  2101. X
  2102. X    /* in this case the outer_prec argument is VCAT, HCAT or ACAT */
  2103. X    if( Down(x) != x )
  2104. X    { if( outer_prec == ACAT )  print(" ");
  2105. X      print( EchoCatOp(outer_prec, mark(gap(x)), join(gap(x))) );
  2106. X      Child(y, Down(x));
  2107. X      echo(y, FORCE_PREC);
  2108. X      print(" ");
  2109. X    }
  2110. X    else if( outer_prec == ACAT )
  2111. X    { for( i = 1;  i <= vspace(x);  i++ )  newline();
  2112. X      for( i = 1;  i <= hspace(x);  i++ )  print(" ");
  2113. X    }
  2114. X    else
  2115. X    { print( EchoCatOp(outer_prec, mark(gap(x)), join(gap(x))) );
  2116. X      print( EchoGap(&gap(x)) );
  2117. X      print(" ");
  2118. X    }
  2119. X    break;
  2120. X
  2121. X
  2122. X    case WORD:
  2123. X    
  2124. X    if( strlen(string(x)) == 0 )
  2125. X    { print(KW_LBR);
  2126. X      print(KW_RBR);
  2127. X    }
  2128. X    else print( string(x) );
  2129. X    break;
  2130. X
  2131. X
  2132. X    case ENV:
  2133. X    
  2134. X    /* debug only */
  2135. X    print("<");
  2136. X    for( link = Down(x);  link != x;  link = NextDown(link) )
  2137. X    { Child(y, link);
  2138. X      if( type(y) == CLOSURE )
  2139. X      { print( SymName(actual(y)) );
  2140. X        echo(GetEnv(y), NO_PREC);
  2141. X      }
  2142. X      else if( type(y) == ENV )  echo(y, NO_PREC);
  2143. X      else print(Image(type(y)));
  2144. X      if( NextDown(link) != x )  print(" ");
  2145. X    }
  2146. X    print(">");
  2147. X    break;
  2148. X
  2149. X
  2150. X    case CROSS:
  2151. X
  2152. X    assert( Down(x) != x, "echo: CROSS Down(x)!" );
  2153. X    Child(y, Down(x));
  2154. X    if( type(y) == CLOSURE )  print(SymName(actual(y)));
  2155. X    else
  2156. X    { print(KW_LBR);
  2157. X      echo(y, NO_PREC);
  2158. X      print(KW_RBR);
  2159. X    }
  2160. X    print(KW_CROSS);
  2161. X    if( NextDown(Down(x)) != x )
  2162. X    { Child(y, NextDown(Down(x)));
  2163. X      echo(y, NO_PREC);
  2164. X    }
  2165. X    else print("??");
  2166. X    break;
  2167. X
  2168. X
  2169. X    case CLOSURE:
  2170. X    
  2171. X    sym = actual(x);
  2172. X    braces_needed =
  2173. X        precedence(sym) <= outer_prec && (has_lpar(sym) || has_rpar(sym));
  2174. X
  2175. X    /* print brace if needed */
  2176. X    if( braces_needed )  print(KW_LBR), print(" ");
  2177. X
  2178. X    npar_seen = FALSE;  name_printed = FALSE;
  2179. X    for( link = Down(x); link != x;  link = NextDown(link) )
  2180. X    { Child(y, link);
  2181. X      if( type(y) == PAR )
  2182. X      { assert( Down(y) != y, "EchoObject: Down(PAR)!" );
  2183. X        switch( type(actual(y)) )
  2184. X        {
  2185. X         case LPAR:    Child(tmp, Down(y));
  2186. X            echo(tmp, (unsigned) precedence(sym));
  2187. X            print(" ");
  2188. X            break;
  2189. X
  2190. X         case NPAR:    if( !name_printed )
  2191. X            { print(SymName(sym));
  2192. X              if( external(x) || threaded(x) )
  2193. X              { print(" #");
  2194. X                if( external(x) )  print(" external");
  2195. X                if( threaded(x) )  print(" threaded");
  2196. X                newline();
  2197. X              }
  2198. X              name_printed = TRUE;
  2199. X            }
  2200. X            newline();  print("  ");
  2201. X            print( SymName(actual(y)) );
  2202. X            print(" ");  print(KW_LBR);  print(" ");
  2203. X            Child(tmp, Down(y));
  2204. X            echo(tmp, NO_PREC);
  2205. X            print(" ");  print(KW_RBR);
  2206. X            npar_seen = TRUE;
  2207. X            break;
  2208. X
  2209. X         case RPAR:    if( !name_printed )
  2210. X            { print(SymName(sym));
  2211. X              if( external(x) || threaded(x) )
  2212. X              { print(" #");
  2213. X                if( external(x) )  print(" external");
  2214. X                if( threaded(x) )  print(" threaded");
  2215. X                newline();
  2216. X              }
  2217. X              name_printed = TRUE;
  2218. X            }
  2219. X            if( npar_seen ) newline();
  2220. X            else print(" ");
  2221. X            Child(tmp, Down(y));
  2222. X            if( has_body(sym) )
  2223. X            { print(KW_LBR);  print(" ");
  2224. X              echo(tmp, NO_PREC);
  2225. X              print(" ");  print(KW_RBR);
  2226. X            }
  2227. X            else echo(tmp, (unsigned) precedence(sym));
  2228. X            break;
  2229. X    
  2230. X         default:    Error(INTERN, &fpos(y), "echo: %s",
  2231. X                    Image(type(actual(y))) );
  2232. X            break;
  2233. X
  2234. X        }
  2235. X      }
  2236. X    }
  2237. X    if( !name_printed )
  2238. X    { print( SymName(sym) );
  2239. X      if( external(x) || threaded(x) )
  2240. X      { print(" #");
  2241. X        if( external(x) )  print(" external");
  2242. X        if( threaded(x) )  print(" threaded");
  2243. X        newline();
  2244. X      }
  2245. X    }
  2246. X
  2247. X    /* print closing brace if needed */
  2248. X    if( braces_needed ) print(" "), print(KW_RBR);
  2249. X    break;
  2250. X
  2251. X
  2252. X    case SPLIT:
  2253. X    
  2254. X    /* this should occur only in debug output case */
  2255. X    print(KW_SPLIT);  moveright();
  2256. X    Child(y, DownDim(x, COL));
  2257. X    print(" ");
  2258. X    echo(y, FORCE_PREC);
  2259. X    moveleft();
  2260. X    break;
  2261. X
  2262. X
  2263. X    case PAR:
  2264. X    
  2265. X    /* this should occur only in debug output case */
  2266. X    print("par ");  print(SymName(actual(x)));
  2267. X    break;
  2268. X
  2269. X
  2270. X    case CR_LIST:
  2271. X
  2272. X    print("(");
  2273. X    for( link = Down(x);  link != x;  link = NextDown(link) )
  2274. X    { Child(y, link);
  2275. X      echo(y, NO_PREC);
  2276. X      if( NextDown(link) != x )  print(", ");
  2277. X    }
  2278. X    print(")");
  2279. X    break;
  2280. X
  2281. X
  2282. X    case MACRO:
  2283. X    
  2284. X    newline();  print(KW_MACRO);
  2285. X    print(" ");  print(SymName(x));
  2286. X    if( sym_body(x) != nil )
  2287. X    { newline();  print(KW_LBR);
  2288. X      y = sym_body(x);
  2289. X      do
  2290. X      { for( i = 1;  i <= vspace(y);  i++ )  newline();
  2291. X        for( i = 1;  i <= hspace(y);  i++ )  print(" ");
  2292. X        print(EchoToken(y));
  2293. X        y = succ(y, PARENT);
  2294. X      } while( y != sym_body(x) );
  2295. X      newline();  print(KW_RBR);
  2296. X    }
  2297. X    else print(" "), print(KW_LBR), print(KW_RBR);
  2298. X    if( visible(x) )  print(" # (visible)");
  2299. X    break;
  2300. X
  2301. X
  2302. X    case NPAR:
  2303. X    case LOCAL:
  2304. X    
  2305. X    /* print predefined operators in abbreviated form */
  2306. X    if( sym_body(x) == nil && enclosing(x) != nil )
  2307. X    { tab(3); print("# sys ");
  2308. X      print(SymName(x));
  2309. X      break;
  2310. X    }
  2311. X
  2312. X    /* print def line and miscellaneous debug info */
  2313. X    if( type(x) == LOCAL ) newline();
  2314. X    print(type(x) == NPAR ? KW_NAMED : KW_DEF);
  2315. X    print(" ");  print( SymName(x) );
  2316. X    if( recursive(x) || indefinite(x) || visible(x) ||
  2317. X        is_extern_target(x) || uses_extern_target(x) || uses_galley(x) )
  2318. X    { tab(25);  print("#");
  2319. X      if( visible(x)  )  print(" visible");
  2320. X      if( recursive(x)  )  print(" recursive");
  2321. X      if( indefinite(x) )  print(" indefinite");
  2322. X      if( is_extern_target(x) )  print(" is_extern_target");
  2323. X      if( uses_extern_target(x) )  print(" uses_extern_target");
  2324. X      if( uses_galley(x) )  print(" uses_galley");
  2325. X    }
  2326. X
  2327. X    /* print uses list, if necessary */
  2328. X    if( uses(x) != nil || dirty(x) )
  2329. X    { newline();  print("   # ");
  2330. X      if( dirty(x) ) print("dirty, ");
  2331. X      print("uses");
  2332. X      if( uses(x) != nil )
  2333. X      { tmp = next(uses(x));
  2334. X        do
  2335. X        { print(" "), print( SymName(item(tmp)) );
  2336. X          tmp = next(tmp);
  2337. X        } while( tmp != next(uses(x)) );
  2338. X      }
  2339. X      /* ***
  2340. X      for( tmp = uses(x);  tmp != nil;  tmp = next(tmp) )
  2341. X      { print(" "), print( SymName(item(tmp)) );
  2342. X      }
  2343. X      *** */
  2344. X    }
  2345. X
  2346. X    /* print precedence, if necessary */
  2347. X    if( precedence(x) != DEFAULT_PREC )
  2348. X    { newline();  print("   ");  print(KW_PRECEDENCE);
  2349. X      sprintf(str, " %d", precedence(x));
  2350. X      print(str);
  2351. X    }
  2352. X
  2353. X    /* print associativity, if necessary */
  2354. X    if( !right_assoc(x) )
  2355. X    { newline();  print("   ");
  2356. X      print(KW_ASSOC);  print(" ");  print(KW_LEFT);
  2357. X    }
  2358. X
  2359. X    /* print named parameters and local objects */
  2360. X    lbr_printed = FALSE;
  2361. X    for( link = Down(x);  link != x;  link = NextDown(link) )
  2362. X    { Child(y, link);
  2363. X      assert( enclosing(y) == x, "echo: enclosing(y) != x!" );
  2364. X      switch( type(y) )
  2365. X      {
  2366. X        case LPAR:
  2367. X        case RPAR:    newline();  print("   ");
  2368. X            print( type(y) == LPAR ? KW_LEFT :
  2369. X                has_body(x) ? KW_BODY : KW_RIGHT);
  2370. X            print(" ");
  2371. X            print( SymName(y) );
  2372. X            print("   # uses_count = ");
  2373. X            printnum(uses_count(y));
  2374. X            if( visible(y) )  print(" (visible)");
  2375. X            break;
  2376. X
  2377. X        case NPAR:    moveright();  newline();
  2378. X            echo(y, NO_PREC);
  2379. X            print("   # uses_count = ");
  2380. X            printnum(uses_count(y));
  2381. X            moveleft();
  2382. X            break;
  2383. X
  2384. X        case MACRO:
  2385. X        case LOCAL:    if( !lbr_printed )
  2386. X            { newline();
  2387. X              print(KW_LBR);
  2388. X              lbr_printed = TRUE;
  2389. X            }
  2390. X            moveright();
  2391. X            echo(y, NO_PREC);
  2392. X            moveleft();  newline();
  2393. X            break;
  2394. X
  2395. X        default:    Error(FATAL, &fpos(y), "echo: type(y) = %s",
  2396. X                    Image(type(y)));
  2397. X            break;
  2398. X      }
  2399. X    }
  2400. X    if( type(x) == NPAR && Down(x) == x )  print(" ");
  2401. X    else newline();
  2402. X    if( !lbr_printed )
  2403. X    { print(KW_LBR);  print("  ");
  2404. X      lbr_printed = TRUE;
  2405. X    }
  2406. X    else print("   ");
  2407. X
  2408. X    /* print body */
  2409. X    moveright();
  2410. X    if( sym_body(x) != nil )  echo(sym_body(x), NO_PREC);
  2411. X    moveleft();  if( type(x) == LOCAL ) newline();
  2412. X    print(KW_RBR);
  2413. X    break;
  2414. X
  2415. X
  2416. X    case ONE_COL:
  2417. X    case ONE_ROW:
  2418. X    case HCONTRACT:
  2419. X    case VCONTRACT:
  2420. X    case HEXPAND:
  2421. X    case VEXPAND:
  2422. X    case PADJUST:
  2423. X    case HADJUST:
  2424. X    case VADJUST:
  2425. X    case HSCALE:
  2426. X    case VSCALE:
  2427. X    case NEXT:
  2428. X    case WIDE:
  2429. X    case HIGH:
  2430. X    case INCGRAPHIC:
  2431. X    case SINCGRAPHIC:
  2432. X    case GRAPHIC:
  2433. X    case ROTATE:
  2434. X    case SCALE:
  2435. X    case CASE:
  2436. X    case YIELD:
  2437. X    case FONT:
  2438. X    case SPACE:
  2439. X    case BREAK:
  2440. X    case OPEN:
  2441. X    case TAGGED:
  2442. X    
  2443. X    /* print enclosing left brace if needed */
  2444. X    braces_needed = (DEFAULT_PREC <= outer_prec);
  2445. X    if( braces_needed )  print(KW_LBR), print(" ");
  2446. X
  2447. X    /* print left parameter */
  2448. X    if( Down(x) != LastDown(x) )
  2449. X    { Child(y, Down(x));
  2450. X      echo(y, max(outer_prec, DEFAULT_PREC));
  2451. X      print(" ");
  2452. X    }
  2453. X
  2454. X    print(Image(type(x)));
  2455. X
  2456. X    /* print right parameter */
  2457. X    assert( LastDown(x) != x, "echo: right parameter of predefined!" );
  2458. X    print(" ");
  2459. X    Child(y, LastDown(x));
  2460. X    echo(y, type(x)==OPEN ? FORCE_PREC : max(outer_prec,DEFAULT_PREC));
  2461. X    if( braces_needed )  print(" "), print(KW_RBR);
  2462. X    break;
  2463. X
  2464. X
  2465. X    case NULL_CLOS:
  2466. X    
  2467. X    print(Image(type(x)));
  2468. X    break;
  2469. X
  2470. X
  2471. X    case CR_ROOT:
  2472. X
  2473. X    for( link = Down(x);  link != x;  link = NextDown(link) )
  2474. X    { Child(y, link);
  2475. X      echo(y, NO_PREC);  newline();
  2476. X    }
  2477. X    break;
  2478. X
  2479. X
  2480. X    case CROSS_SYM:
  2481. X
  2482. X    print("Cross-references for ");
  2483. X    print(SymName(symb(x)));  newline();
  2484. X    switch( target_state(x) )
  2485. X    {
  2486. X      case 0:    print("NO_TARGET");
  2487. X            break;
  2488. X
  2489. X      case 1:    print("SEEN_TARGET ");
  2490. X            printnum(target_seq(x));
  2491. X            print(": ");
  2492. X            echo(target_val(x), NO_PREC);
  2493. X            break;
  2494. X
  2495. X      case 2:    print("WRITTEN_TARGET ");
  2496. X            printnum(target_seq(x));
  2497. X            print(": to file ");
  2498. X            print(FileName(target_file(x)));
  2499. X            print(" at ");
  2500. X            printnum(target_pos(x));
  2501. X            break;
  2502. X    
  2503. X      default:    print("ILLEGAL!");
  2504. X            break;
  2505. X    }
  2506. X    newline();
  2507. X    for( link = Down(x);  link != x;  link = NextDown(link) )
  2508. X    { Child(y, link);
  2509. X      print("   ");
  2510. X      if( gall_rec(y) )  print("gall_rec!");
  2511. X      else print(string(y));
  2512. X      newline();
  2513. X    }
  2514. X    break;
  2515. X
  2516. X
  2517. X    default:
  2518. X    
  2519. X    Error(INTERN, no_fpos, "echo found %s", Image(type(x)));
  2520. X    break;
  2521. X
  2522. X  } /* end switch */
  2523. X} /* end echo */
  2524. X
  2525. X
  2526. X/*@@**************************************************************************/
  2527. X/*                                                                           */
  2528. X/*  unsigned char *EchoObject(file_ptr, x)                                   */
  2529. X/*                                                                           */
  2530. X/*  Send an image of unsized object x to result (if file_ptr is null) or to  */
  2531. X/*  file file_ptr if file_ptr is not null.                                   */
  2532. X/*                                                                           */
  2533. X/*****************************************************************************/
  2534. X
  2535. Xunsigned char *EchoObject(file_ptr, x)
  2536. XFILE *file_ptr;  OBJECT x;
  2537. X{ debug0(DOE, D, "EchoObject()");
  2538. X  fp = file_ptr;
  2539. X  col = 0;
  2540. X  indent = 0;
  2541. X  limit  = 60;
  2542. X  if( fp == null )
  2543. X  { BeginString();
  2544. X    if( x == nil )  AppendString("<nil>");
  2545. X    else echo(x, type(x) == GAP_OBJ ? VCAT : 0);
  2546. X    return EndString();
  2547. X  }
  2548. X  else
  2549. X  { if( x != nil )
  2550. X    { echo(x, type(x) == GAP_OBJ ? VCAT : 0);
  2551. X      fprintf(file_ptr, "\n");
  2552. X    }
  2553. X    else fprintf(file_ptr, "<nil>\n");
  2554. X    debug0(DOE, D, "EchoObject returning");
  2555. X    return (unsigned char *) "";
  2556. X  }
  2557. X} /* end EchoObject */
  2558. X#endif
  2559. END_OF_FILE
  2560.   if test 20719 -ne `wc -c <'lout/z25.c'`; then
  2561.     echo shar: \"'lout/z25.c'\" unpacked with wrong size!
  2562.   fi
  2563.   # end of 'lout/z25.c'
  2564. fi
  2565. echo shar: End of archive 12 \(of 30\).
  2566. cp /dev/null ark12isdone
  2567. MISSING=""
  2568. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do
  2569.     if test ! -f ark${I}isdone ; then
  2570.     MISSING="${MISSING} ${I}"
  2571.     fi
  2572. done
  2573. if test "${MISSING}" = "" ; then
  2574.     echo You have unpacked all 30 archives.
  2575.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2576. else
  2577.     echo You still must unpack the following archives:
  2578.     echo "        " ${MISSING}
  2579. fi
  2580. exit 0
  2581. exit 0 # Just in case...
  2582.