home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / funnlweb / part06 < prev    next >
Encoding:
Text File  |  1993-04-10  |  118.5 KB  |  2,922 lines

  1. Newsgroups: comp.sources.unix
  2. From: ross@spam.adelaide.edu.au (Ross Williams)
  3. Subject: v26i126: funnelweb - a tool for literate programming in C, Part06/20
  4. Sender: unix-sources-moderator@vix.com
  5. Approved: paul@vix.com
  6.  
  7. Submitted-By: ross@spam.adelaide.edu.au (Ross Williams)
  8. Posting-Number: Volume 26, Issue 126
  9. Archive-Name: funnelweb/part06
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 6 (of 20)."
  18. # Contents:  answers/pr01.lis answers/pr03.lis answers/sc17.lis
  19. #   answers/sc28.lis answers/wv01.tex sources/machin.h
  20. #   sources/memory.c sources/style.h
  21. # Wrapped by vixie@gw.home.vix.com on Sun Apr 11 11:00:18 1993
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'answers/pr01.lis' -a "${1}" != "-c" ; then 
  24.   echo shar: Will not clobber existing file \"'answers/pr01.lis'\"
  25. else
  26. echo shar: Extracting \"'answers/pr01.lis'\" \(14686 characters\)
  27. sed "s/^X//" >'answers/pr01.lis' <<'END_OF_FILE'
  28. XFUNNELWEB LISTING FILE
  29. X======================
  30. X
  31. Dump of mapped file "<<Suppressed>>".
  32. X
  33. MEMORY DUMP OF MAPPED FILE
  34. X==========================
  35. X
  36. X+-------------------------------------------------+------------------+
  37. X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |
  38. X+-------------------------------------------------+------------------+
  39. X| 50 52 30 31 3A 20 54 65 73 74 20 74 68 65 20 69 | PR01: Test the i |
  40. X| 6E 6C 69 6E 65 20 74 79 70 65 73 65 74 74 69 6E | nline typesettin |
  41. X| 67 20 66 65 61 74 75 72 65 73 2E 0A 0A 31 2E 20 | g features...1.  |
  42. X| 46 69 72 73 74 20 77 65 20 74 65 73 74 20 74 68 | First we test th |
  43. X| 65 20 6C 65 67 61 6C 20 75 73 65 20 6F 66 20 74 | e legal use of t |
  44. X| 68 65 20 40 7B 6C 69 74 65 72 61 6C 40 7D 20 63 | he @{literal@} c |
  45. X| 6F 6E 73 74 72 75 63 74 2E 0A 0A 32 2E 54 65 73 | onstruct...2.Tes |
  46. X| 74 20 40 7B 40 7D 20 28 69 6C 6C 65 67 61 6C 29 | t @{@} (illegal) |
  47. X| 2E 0A 40 41 40 3C 45 72 72 6F 72 20 52 65 63 6F | ..@A@<Error Reco |
  48. X| 76 65 72 79 20 50 6F 69 6E 74 40 3E 0A 0A 33 2E | very Point@>..3. |
  49. X| 20 54 65 73 74 20 74 68 65 20 63 6F 6E 73 74 72 |  Test the constr |
  50. X| 75 63 74 20 40 7B 61 63 72 6F 73 73 0A 20 20 20 | uct @{across.    |
  51. X| 6D 6F 72 65 20 74 68 61 6E 20 6F 6E 65 20 6C 69 | more than one li |
  52. X| 6E 65 40 7D 2E 0A 0A 34 2E 20 4E 6F 77 20 77 65 | ne@}...4. Now we |
  53. X| 20 74 65 73 74 20 74 68 65 20 63 6F 6E 73 74 72 |  test the constr |
  54. X| 75 63 74 20 77 69 74 68 20 6E 6F 6E 2D 74 65 78 | uct with non-tex |
  55. X| 74 20 66 6F 6C 6C 6F 77 69 6E 67 20 69 74 2E 0A | t following it.. |
  56. X| 20 20 20 40 7B 40 3C 73 6C 6F 74 68 40 3E 40 7D |    @{@<sloth@>@} |
  57. X| 0A 40 41 40 3C 45 72 72 6F 72 20 52 65 63 6F 76 | .@A@<Error Recov |
  58. X| 65 72 79 20 50 6F 69 6E 74 40 3E 0A 20 20 20 40 | ery Point@>.   @ |
  59. X| 7B 20 20 20 20 20 40 3E 20 20 20 40 7D 0A 40 41 | {     @>   @}.@A |
  60. X| 40 3C 45 72 72 6F 72 20 52 65 63 6F 76 65 72 79 | @<Error Recovery |
  61. X| 20 50 6F 69 6E 74 40 3E 0A 0A 35 2E 20 54 65 73 |  Point@>..5. Tes |
  62. X| 74 20 74 68 65 20 6C 65 67 61 6C 20 75 73 65 20 | t the legal use  |
  63. X| 6F 66 20 74 68 65 20 40 2F 65 6D 70 68 61 73 69 | of the @/emphasi |
  64. X| 73 40 2F 20 63 6F 6E 73 74 72 75 63 74 2E 0A 0A | s@/ construct... |
  65. X| 36 2E 54 65 73 74 20 40 2F 40 2F 20 28 69 6C 6C | 6.Test @/@/ (ill |
  66. X| 65 67 61 6C 29 2E 0A 40 41 40 3C 45 72 72 6F 72 | egal)..@A@<Error |
  67. X| 20 52 65 63 6F 76 65 72 79 20 50 6F 69 6E 74 40 |  Recovery Point@ |
  68. X| 3E 0A 0A 37 2E 20 54 65 73 74 20 74 68 65 20 63 | >..7. Test the c |
  69. X| 6F 6E 73 74 72 75 63 74 20 40 2F 61 63 72 6F 73 | onstruct @/acros |
  70. X| 73 0A 20 20 20 6D 6F 72 65 20 74 68 61 6E 20 6F | s.   more than o |
  71. X| 6E 65 20 6C 69 6E 65 40 2F 2E 0A 0A 38 2E 20 4E | ne line@/...8. N |
  72. X| 6F 77 20 77 65 20 74 65 73 74 20 74 68 65 20 63 | ow we test the c |
  73. X| 6F 6E 73 74 72 75 63 74 20 77 69 74 68 20 6E 6F | onstruct with no |
  74. X| 6E 2D 74 65 78 74 20 66 6F 6C 6C 6F 77 69 6E 67 | n-text following |
  75. X| 20 69 74 2E 0A 20 20 20 40 2F 40 3C 73 6C 6F 74 |  it..   @/@<slot |
  76. X| 68 40 3E 40 2F 0A 40 41 40 3C 45 72 72 6F 72 20 | h@>@/.@A@<Error  |
  77. X| 52 65 63 6F 76 65 72 79 20 50 6F 69 6E 74 40 3E | Recovery Point@> |
  78. X| 0A 20 20 20 40 2F 20 20 20 20 20 40 3C 20 20 20 | .   @/     @<    |
  79. X| 40 2F 0A 0A 0A 0A                               | @/....           |
  80. X+-------------------------------------------------+------------------+
  81. X
  82. X
  83. X=========================== Start of LINE LIST DUMP ============================
  84. X
  85. Globl Local| Text
  86. X-----------+--------------------------------------------------------------------
  87. X00001 00001| PR01: Test the inline typesetting features.<010>
  88. X00002 00002| <010>
  89. X00003 00003| 1. First we test the legal use of the @{literal@} construct.<010>
  90. X00004 00004| <010>
  91. X00005 00005| 2.Test @{@} (illegal).<010>
  92. X00006 00006| @A@<Error Recovery Point@><010>
  93. X00007 00007| <010>
  94. X00008 00008| 3. Test the construct @{across<010>
  95. X00009 00009|    more than one line@}.<010>
  96. X00010 00010| <010>
  97. X00011 00011| 4. Now we test the construct with non-text following it.<010>
  98. X00012 00012|    @{@<sloth@>@}<010>
  99. X00013 00013| @A@<Error Recovery Point@><010>
  100. X00014 00014|    @{     @>   @}<010>
  101. X00015 00015| @A@<Error Recovery Point@><010>
  102. X00016 00016| <010>
  103. X00017 00017| 5. Test the legal use of the @/emphasis@/ construct.<010>
  104. X00018 00018| <010>
  105. X00019 00019| 6.Test @/@/ (illegal).<010>
  106. X00020 00020| @A@<Error Recovery Point@><010>
  107. X00021 00021| <010>
  108. X00022 00022| 7. Test the construct @/across<010>
  109. X00023 00023|    more than one line@/.<010>
  110. X00024 00024| <010>
  111. X00025 00025| 8. Now we test the construct with non-text following it.<010>
  112. X00026 00026|    @/@<sloth@>@/<010>
  113. X00027 00027| @A@<Error Recovery Point@><010>
  114. X00028 00028|    @/     @<   @/<010>
  115. X00029 00029| <010>
  116. X00030 00030| <010>
  117. X00031 00031| <010>
  118. X00032 00032| <End-Of-File><010>
  119. X-----------+--------------------------------------------------------------------
  120. Globl Local| Text
  121. X
  122. X============================ End of LINE LIST DUMP =============================
  123. X
  124. X
  125. X=========================== Start of TOKEN LIST DUMP ===========================
  126. X
  127. Summary: There are 73 tokens in the token list.
  128. X
  129. Line[Column]: Token Description
  130. X-------------------------------
  131. X
  132. X0001[01]: Text. Text scrap[Grey]="PR01: Test the inline typesetting features.<010>
  133. X<010>
  134. X1. First we test the legal use of the "
  135. X0003[39]: @{ Open defn. 
  136. X0003[41]: Text. Text scrap[Grey]="literal"
  137. X0003[48]: @} Close defn. 
  138. X0003[50]: Text. Text scrap[Grey]=" construct.<010>
  139. X<010>
  140. X2.Test "
  141. X0005[08]: @{ Open defn. 
  142. X0005[10]: @} Close defn. 
  143. X0005[12]: Text. Text scrap[Grey]=" (illegal).<010>
  144. X"
  145. X0006[01]: @A New section (Level 1). 
  146. X0006[03]: @< Open name. 
  147. X0006[05]: Text. Text scrap[Grey]="Error Recovery Point"
  148. X0006[25]: @> Close name. 
  149. X0006[27]: Text. Text scrap[Grey]="<010>
  150. X<010>
  151. X3. Test the construct "
  152. X0008[23]: @{ Open defn. 
  153. X0008[25]: Text. Text scrap[Grey]="across<010>
  154. X   more than one line"
  155. X0009[22]: @} Close defn. 
  156. X0009[24]: Text. Text scrap[Grey]=".<010>
  157. X<010>
  158. X4. Now we test the construct with non-text following it.<010>
  159. X   "
  160. X0012[04]: @{ Open defn. 
  161. X0012[06]: @< Open name. 
  162. X0012[08]: Text. Text scrap[Grey]="sloth"
  163. X0012[13]: @> Close name. 
  164. X0012[15]: @} Close defn. 
  165. X0012[17]: Text. Text scrap[White]="<010>
  166. X"
  167. X0013[01]: @A New section (Level 1). 
  168. X0013[03]: @< Open name. 
  169. X0013[05]: Text. Text scrap[Grey]="Error Recovery Point"
  170. X0013[25]: @> Close name. 
  171. X0013[27]: Text. Text scrap[White]="<010>
  172. X   "
  173. X0014[04]: @{ Open defn. 
  174. X0014[06]: Text. Text scrap[White]="     "
  175. X0014[11]: @> Close name. 
  176. X0014[13]: Text. Text scrap[White]="   "
  177. X0014[16]: @} Close defn. 
  178. X0014[18]: Text. Text scrap[White]="<010>
  179. X"
  180. X0015[01]: @A New section (Level 1). 
  181. X0015[03]: @< Open name. 
  182. X0015[05]: Text. Text scrap[Grey]="Error Recovery Point"
  183. X0015[25]: @> Close name. 
  184. X0015[27]: Text. Text scrap[Grey]="<010>
  185. X<010>
  186. X5. Test the legal use of the "
  187. X0017[30]: @/ Emphasise. 
  188. X0017[32]: Text. Text scrap[Grey]="emphasis"
  189. X0017[40]: @/ Emphasise. 
  190. X0017[42]: Text. Text scrap[Grey]=" construct.<010>
  191. X<010>
  192. X6.Test "
  193. X0019[08]: @/ Emphasise. 
  194. X0019[10]: @/ Emphasise. 
  195. X0019[12]: Text. Text scrap[Grey]=" (illegal).<010>
  196. X"
  197. X0020[01]: @A New section (Level 1). 
  198. X0020[03]: @< Open name. 
  199. X0020[05]: Text. Text scrap[Grey]="Error Recovery Point"
  200. X0020[25]: @> Close name. 
  201. X0020[27]: Text. Text scrap[Grey]="<010>
  202. X<010>
  203. X7. Test the construct "
  204. X0022[23]: @/ Emphasise. 
  205. X0022[25]: Text. Text scrap[Grey]="across<010>
  206. X   more than one line"
  207. X0023[22]: @/ Emphasise. 
  208. X0023[24]: Text. Text scrap[Grey]=".<010>
  209. X<010>
  210. X8. Now we test the construct with non-text following it.<010>
  211. X   "
  212. X0026[04]: @/ Emphasise. 
  213. X0026[06]: @< Open name. 
  214. X0026[08]: Text. Text scrap[Grey]="sloth"
  215. X0026[13]: @> Close name. 
  216. X0026[15]: @/ Emphasise. 
  217. X0026[17]: Text. Text scrap[White]="<010>
  218. X"
  219. X0027[01]: @A New section (Level 1). 
  220. X0027[03]: @< Open name. 
  221. X0027[05]: Text. Text scrap[Grey]="Error Recovery Point"
  222. X0027[25]: @> Close name. 
  223. X0027[27]: Text. Text scrap[White]="<010>
  224. X   "
  225. X0028[04]: @/ Emphasise. 
  226. X0028[06]: Text. Text scrap[White]="     "
  227. X0028[11]: @< Open name. 
  228. X0028[13]: Text. Text scrap[White]="   "
  229. X0028[16]: @/ Emphasise. 
  230. X0028[18]: Text. Text scrap[White]="<010>
  231. X<010>
  232. X<010>
  233. X<010>
  234. X"
  235. X0032[01]: End Of File. 
  236. X============================ End of TOKEN LIST DUMP ============================
  237. X
  238. X
  239. X========================== Start of MACRO TABLE DUMP ===========================
  240. X
  241. X
  242. X=========================== End of MACRO TABLE DUMP ============================
  243. X
  244. X
  245. X========================= Start of DOCUMENT LIST DUMP ==========================
  246. X
  247. X
  248. TEXT COMPONENT: Pos(L,C)=(1,1). 
  249. X
  250. X-- Start of Text Scrap List --
  251. Text scrap[Grey]="PR01: Test the inline typesetting features.<010>
  252. X<010>
  253. X1. First we test the legal use of the "
  254. X--- End of Text Scrap List ---
  255. X
  256. X
  257. TYPESETTER DIRECTIVE COMPONENT:    Open  literal.
  258. X
  259. TEXT COMPONENT: Pos(L,C)=(3,41). 
  260. X
  261. X-- Start of Text Scrap List --
  262. Text scrap[Grey]="literal"
  263. X--- End of Text Scrap List ---
  264. X
  265. X
  266. TYPESETTER DIRECTIVE COMPONENT:    Close literal.
  267. X
  268. TEXT COMPONENT: Pos(L,C)=(3,50). 
  269. X
  270. X-- Start of Text Scrap List --
  271. Text scrap[Grey]=" construct.<010>
  272. X<010>
  273. X2.Test "
  274. X--- End of Text Scrap List ---
  275. X
  276. X
  277. TYPESETTER DIRECTIVE COMPONENT:    Open  literal.
  278. X
  279. TYPESETTER DIRECTIVE COMPONENT: 
  280. X   Section "1", Section name="Error Recovery Point".
  281. X
  282. TEXT COMPONENT: Pos(L,C)=(6,27). 
  283. X
  284. X-- Start of Text Scrap List --
  285. Text scrap[Grey]="<010>
  286. X<010>
  287. X3. Test the construct "
  288. X--- End of Text Scrap List ---
  289. X
  290. X
  291. TYPESETTER DIRECTIVE COMPONENT:    Open  literal.
  292. X
  293. TEXT COMPONENT: Pos(L,C)=(8,25). 
  294. X
  295. X-- Start of Text Scrap List --
  296. Text scrap[Grey]="across<010>
  297. X   more than one line"
  298. X--- End of Text Scrap List ---
  299. X
  300. X
  301. TYPESETTER DIRECTIVE COMPONENT:    Close literal.
  302. X
  303. TEXT COMPONENT: Pos(L,C)=(9,24). 
  304. X
  305. X-- Start of Text Scrap List --
  306. Text scrap[Grey]=".<010>
  307. X<010>
  308. X4. Now we test the construct with non-text following it.<010>
  309. X   "
  310. X--- End of Text Scrap List ---
  311. X
  312. X
  313. TYPESETTER DIRECTIVE COMPONENT:    Open  literal.
  314. X
  315. TYPESETTER DIRECTIVE COMPONENT: 
  316. X   Section "2", Section name="Error Recovery Point".
  317. X
  318. TEXT COMPONENT: Pos(L,C)=(13,27). 
  319. X
  320. X-- Start of Text Scrap List --
  321. Text scrap[White]="<010>
  322. X   "
  323. X--- End of Text Scrap List ---
  324. X
  325. X
  326. TYPESETTER DIRECTIVE COMPONENT:    Open  literal.
  327. X
  328. TEXT COMPONENT: Pos(L,C)=(14,6). 
  329. X
  330. X-- Start of Text Scrap List --
  331. Text scrap[White]="     "
  332. X--- End of Text Scrap List ---
  333. X
  334. X
  335. TYPESETTER DIRECTIVE COMPONENT: 
  336. X   Section "3", Section name="Error Recovery Point".
  337. X
  338. TEXT COMPONENT: Pos(L,C)=(15,27). 
  339. X
  340. X-- Start of Text Scrap List --
  341. Text scrap[Grey]="<010>
  342. X<010>
  343. X5. Test the legal use of the "
  344. X--- End of Text Scrap List ---
  345. X
  346. X
  347. TYPESETTER DIRECTIVE COMPONENT:    Open emphasise.
  348. X
  349. TEXT COMPONENT: Pos(L,C)=(17,32). 
  350. X
  351. X-- Start of Text Scrap List --
  352. Text scrap[Grey]="emphasis"
  353. X--- End of Text Scrap List ---
  354. X
  355. X
  356. TYPESETTER DIRECTIVE COMPONENT:    Close emphasise.
  357. X
  358. TEXT COMPONENT: Pos(L,C)=(17,42). 
  359. X
  360. X-- Start of Text Scrap List --
  361. Text scrap[Grey]=" construct.<010>
  362. X<010>
  363. X6.Test "
  364. X--- End of Text Scrap List ---
  365. X
  366. X
  367. TYPESETTER DIRECTIVE COMPONENT:    Open emphasise.
  368. X
  369. TYPESETTER DIRECTIVE COMPONENT: 
  370. X   Section "4", Section name="Error Recovery Point".
  371. X
  372. TEXT COMPONENT: Pos(L,C)=(20,27). 
  373. X
  374. X-- Start of Text Scrap List --
  375. Text scrap[Grey]="<010>
  376. X<010>
  377. X7. Test the construct "
  378. X--- End of Text Scrap List ---
  379. X
  380. X
  381. TYPESETTER DIRECTIVE COMPONENT:    Open emphasise.
  382. X
  383. TEXT COMPONENT: Pos(L,C)=(22,25). 
  384. X
  385. X-- Start of Text Scrap List --
  386. Text scrap[Grey]="across<010>
  387. X   more than one line"
  388. X--- End of Text Scrap List ---
  389. X
  390. X
  391. TYPESETTER DIRECTIVE COMPONENT:    Close emphasise.
  392. X
  393. TEXT COMPONENT: Pos(L,C)=(23,24). 
  394. X
  395. X-- Start of Text Scrap List --
  396. Text scrap[Grey]=".<010>
  397. X<010>
  398. X8. Now we test the construct with non-text following it.<010>
  399. X   "
  400. X--- End of Text Scrap List ---
  401. X
  402. X
  403. TYPESETTER DIRECTIVE COMPONENT:    Open emphasise.
  404. X
  405. TYPESETTER DIRECTIVE COMPONENT: 
  406. X   Section "5", Section name="Error Recovery Point".
  407. X
  408. TEXT COMPONENT: Pos(L,C)=(27,27). 
  409. X
  410. X-- Start of Text Scrap List --
  411. Text scrap[White]="<010>
  412. X   "
  413. X--- End of Text Scrap List ---
  414. X
  415. X
  416. TYPESETTER DIRECTIVE COMPONENT:    Open emphasise.
  417. X
  418. TEXT COMPONENT: Pos(L,C)=(28,6). 
  419. X
  420. X-- Start of Text Scrap List --
  421. Text scrap[White]="     "
  422. X--- End of Text Scrap List ---
  423. X
  424. X
  425. X========================== End of DOCUMENT LIST DUMP ===========================
  426. X
  427. X
  428. Global Local| Input File
  429. X------------+-------------------------------------------------------------------
  430. X     1     1| PR01: Test the inline typesetting features.
  431. X     2     2| 
  432. X     3     3| 1. First we test the legal use of the @{literal@} construct.
  433. X     4     4| 
  434. X     5     5| 2.Test @{@} (illegal).
  435. X       Error|..........^Text expected after open literal token "@{".
  436. X            |..........^Sorry, empty literal strings are not allowed.
  437. X            |..........^Skipping after error to the next major construct...
  438. X     6     6| @A@<Error Recovery Point@>
  439. X            |.^...skipped to here after the error.
  440. X     7     7| 
  441. X     8     8| 3. Test the construct @{across
  442. X     9     9|    more than one line@}.
  443. X    10    10| 
  444. X    11    11| 4. Now we test the construct with non-text following it.
  445. X    12    12|    @{@<sloth@>@}
  446. X       Error|......^Text expected after open literal token "@{".
  447. X            |......^Skipping after error to the next major construct...
  448. X    13    13| @A@<Error Recovery Point@>
  449. X            |.^...skipped to here after the error.
  450. X    14    14|    @{     @>   @}
  451. X       Error|...........^Expecting '@}'.
  452. X            |...........^Skipping after error to the next major construct...
  453. X    15    15| @A@<Error Recovery Point@>
  454. X            |.^...skipped to here after the error.
  455. X    16    16| 
  456. X    17    17| 5. Test the legal use of the @/emphasis@/ construct.
  457. X    18    18| 
  458. X    19    19| 6.Test @/@/ (illegal).
  459. X       Error|..........^Text expected after open emphasise token "@/".
  460. X            |..........^Sorry, empty emphasised strings are not allowed.
  461. X            |..........^Skipping after error to the next major construct...
  462. X    20    20| @A@<Error Recovery Point@>
  463. X            |.^...skipped to here after the error.
  464. X    21    21| 
  465. X    22    22| 7. Test the construct @/across
  466. X    23    23|    more than one line@/.
  467. X    24    24| 
  468. X    25    25| 8. Now we test the construct with non-text following it.
  469. X    26    26|    @/@<sloth@>@/
  470. X       Error|......^Text expected after open emphasise token "@/".
  471. X            |......^Skipping after error to the next major construct...
  472. X    27    27| @A@<Error Recovery Point@>
  473. X            |.^...skipped to here after the error.
  474. X    28    28|    @/     @<   @/
  475. X       Error|...........^Expecting '@/'.
  476. X            |...........^Skipping after error to the next major construct...
  477. X    29    29| 
  478. X    30    30| 
  479. X    31    31| 
  480. X            | <End-Of-File>
  481. X            |.^...skipped to here after the error.
  482. X------------+-------------------------------------------------------------------
  483. X
  484. There were 6 Errors.
  485. END_OF_FILE
  486. if test 14686 -ne `wc -c <'answers/pr01.lis'`; then
  487.     echo shar: \"'answers/pr01.lis'\" unpacked with wrong size!
  488. fi
  489. # end of 'answers/pr01.lis'
  490. fi
  491. if test -f 'answers/pr03.lis' -a "${1}" != "-c" ; then 
  492.   echo shar: Will not clobber existing file \"'answers/pr03.lis'\"
  493. else
  494. echo shar: Extracting \"'answers/pr03.lis'\" \(14101 characters\)
  495. sed "s/^X//" >'answers/pr03.lis' <<'END_OF_FILE'
  496. XFUNNELWEB LISTING FILE
  497. X======================
  498. X
  499. Dump of mapped file "<<Suppressed>>".
  500. X
  501. MEMORY DUMP OF MAPPED FILE
  502. X==========================
  503. X
  504. X+-------------------------------------------------+------------------+
  505. X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |
  506. X+-------------------------------------------------+------------------+
  507. X| 50 52 30 33 3A 20 54 65 73 74 20 74 68 65 20 70 | PR03: Test the p |
  508. X| 61 72 73 69 6E 67 20 61 6E 64 20 73 65 6D 61 6E | arsing and seman |
  509. X| 74 69 63 73 20 6F 66 20 73 65 63 74 69 6F 6E 73 | tics of sections |
  510. X| 2E 0A 0A 34 2E 20 54 65 73 74 20 66 69 72 73 74 | ...4. Test first |
  511. X| 20 73 65 63 74 69 6F 6E 20 6F 66 20 64 6F 63 75 |  section of docu |
  512. X| 6D 65 6E 74 20 69 73 20 6E 6F 74 20 3C 73 70 65 | ment is not <spe |
  513. X| 63 69 61 6C 3E 41 2E 0A 40 42 40 3C 54 68 69 73 | cial>A..@B@<This |
  514. X| 20 73 65 63 74 69 6F 6E 20 69 73 20 6F 75 74 20 |  section is out  |
  515. X| 6F 66 20 6F 72 64 65 72 20 28 61 6E 64 20 73 6F | of order (and so |
  516. X| 20 69 73 20 74 68 69 73 20 74 65 73 74 21 29 40 |  is this test!)@ |
  517. X| 3E 0A 0A 31 2E 20 54 65 73 74 20 73 65 63 74 69 | >..1. Test secti |
  518. X| 6F 6E 20 77 69 74 68 20 6E 6F 20 6E 61 6D 65 2E | on with no name. |
  519. X| 0A 40 41 20 54 68 69 73 20 73 65 63 74 69 6F 6E | .@A This section |
  520. X| 20 68 61 73 20 6E 6F 20 6E 61 6D 65 2E 0A 40 24 |  has no name..@$ |
  521. X| 40 3C 54 68 65 20 73 65 63 74 69 6F 6E 20 6E 61 | @<The section na |
  522. X| 6D 65 20 69 6E 68 65 72 69 74 73 20 74 68 65 20 | me inherits the  |
  523. X| 6E 61 6D 65 20 6F 66 20 74 68 69 73 20 6D 61 63 | name of this mac |
  524. X| 72 6F 40 3E 40 7B 57 61 6C 72 75 73 40 7D 0A 0A | ro@>@{Walrus@}.. |
  525. X| 32 2E 20 54 65 73 74 20 73 65 63 74 69 6F 6E 20 | 2. Test section  |
  526. X| 77 69 74 68 20 61 20 6E 61 6D 65 0A 40 41 40 3C | with a name.@A@< |
  527. X| 54 68 69 73 20 73 65 63 74 69 6F 6E 20 68 61 73 | This section has |
  528. X| 20 6E 6F 20 6E 61 6D 65 2E 40 3E 0A 0A 33 2E 20 |  no name.@>..3.  |
  529. X| 54 65 73 74 20 74 68 65 20 65 6E 74 69 72 65 20 | Test the entire  |
  530. X| 68 69 65 72 61 72 63 68 79 2E 0A 40 41 40 3C 4F | hierarchy..@A@<O |
  531. X| 6E 65 40 3E 0A 40 42 40 3C 54 77 6F 40 3E 0A 40 | ne@>.@B@<Two@>.@ |
  532. X| 43 40 3C 54 68 72 65 65 40 3E 0A 40 44 40 3C 46 | C@<Three@>.@D@<F |
  533. X| 6F 75 72 40 3E 0A 40 45 40 3C 46 69 76 65 40 3E | our@>.@E@<Five@> |
  534. X| 0A 0A 35 2E 20 54 65 73 74 20 64 65 74 65 63 74 | ..5. Test detect |
  535. X| 69 6F 6E 20 6F 66 20 64 69 73 63 6F 6E 74 69 6E | ion of discontin |
  536. X| 75 69 74 79 20 69 6E 20 6C 65 76 65 6C 73 2E 0A | uity in levels.. |
  537. X| 40 41 40 3C 4F 6E 65 40 3E 0A 40 43 40 3C 54 68 | @A@<One@>.@C@<Th |
  538. X| 72 65 65 40 3E 0A 40 45 40 3C 46 69 76 65 40 3E | ree@>.@E@<Five@> |
  539. X| 0A 0A 40 41 40 3C 4F 6E 65 40 3E 0A 40 42 40 3C | ..@A@<One@>.@B@< |
  540. X| 54 68 72 65 65 40 3E 0A 40 44 40 3C 46 69 76 65 | Three@>.@D@<Five |
  541. X| 40 3E 0A                                        | @>.              |
  542. X+-------------------------------------------------+------------------+
  543. X
  544. X
  545. X=========================== Start of LINE LIST DUMP ============================
  546. X
  547. Globl Local| Text
  548. X-----------+--------------------------------------------------------------------
  549. X00001 00001| PR03: Test the parsing and semantics of sections.<010>
  550. X00002 00002| <010>
  551. X00003 00003| 4. Test first section of document is not <special>A.<010>
  552. X00004 00004| @B@<This section is out of order (and so is this test!)@><010>
  553. X00005 00005| <010>
  554. X00006 00006| 1. Test section with no name.<010>
  555. X00007 00007| @A This section has no name.<010>
  556. X00008 00008| @$@<The section name inherits the name of this macro@>@{Walrus@}<010>
  557. X00009 00009| <010>
  558. X00010 00010| 2. Test section with a name<010>
  559. X00011 00011| @A@<This section has no name.@><010>
  560. X00012 00012| <010>
  561. X00013 00013| 3. Test the entire hierarchy.<010>
  562. X00014 00014| @A@<One@><010>
  563. X00015 00015| @B@<Two@><010>
  564. X00016 00016| @C@<Three@><010>
  565. X00017 00017| @D@<Four@><010>
  566. X00018 00018| @E@<Five@><010>
  567. X00019 00019| <010>
  568. X00020 00020| 5. Test detection of discontinuity in levels.<010>
  569. X00021 00021| @A@<One@><010>
  570. X00022 00022| @C@<Three@><010>
  571. X00023 00023| @E@<Five@><010>
  572. X00024 00024| <010>
  573. X00025 00025| @A@<One@><010>
  574. X00026 00026| @B@<Three@><010>
  575. X00027 00027| @D@<Five@><010>
  576. X00028 00028| <End-Of-File><010>
  577. X-----------+--------------------------------------------------------------------
  578. Globl Local| Text
  579. X
  580. X============================ End of LINE LIST DUMP =============================
  581. X
  582. X
  583. X=========================== Start of TOKEN LIST DUMP ===========================
  584. X
  585. Summary: There are 77 tokens in the token list.
  586. X
  587. Line[Column]: Token Description
  588. X-------------------------------
  589. X
  590. X0001[01]: Text. Text scrap[Grey]="PR03: Test the parsing and semantics of sections.<010>
  591. X<010>
  592. X4. Test first section of document is not <special>A.<010>
  593. X"
  594. X0004[01]: @B New section (Level 2). 
  595. X0004[03]: @< Open name. 
  596. X0004[05]: Text. Text scrap[Grey]="This section is out of order (and so is this test!)"
  597. X0004[56]: @> Close name. 
  598. X0004[58]: Text. Text scrap[Grey]="<010>
  599. X<010>
  600. X1. Test section with no name.<010>
  601. X"
  602. X0007[01]: @A New section (Level 1). 
  603. X0007[03]: Text. Text scrap[Grey]=" This section has no name.<010>
  604. X"
  605. X0008[01]: @$ Macro defn. 
  606. X0008[03]: @< Open name. 
  607. X0008[05]: Text. Text scrap[Grey]="The section name inherits the name of this macro"
  608. X0008[53]: @> Close name. 
  609. X0008[55]: @{ Open defn. 
  610. X0008[57]: Text. Text scrap[Grey]="Walrus"
  611. X0008[63]: @} Close defn. 
  612. X0008[65]: Text. Text scrap[Grey]="<010>
  613. X<010>
  614. X2. Test section with a name<010>
  615. X"
  616. X0011[01]: @A New section (Level 1). 
  617. X0011[03]: @< Open name. 
  618. X0011[05]: Text. Text scrap[Grey]="This section has no name."
  619. X0011[30]: @> Close name. 
  620. X0011[32]: Text. Text scrap[Grey]="<010>
  621. X<010>
  622. X3. Test the entire hierarchy.<010>
  623. X"
  624. X0014[01]: @A New section (Level 1). 
  625. X0014[03]: @< Open name. 
  626. X0014[05]: Text. Text scrap[Grey]="One"
  627. X0014[08]: @> Close name. 
  628. X0014[10]: Text. Text scrap[White]="<010>
  629. X"
  630. X0015[01]: @B New section (Level 2). 
  631. X0015[03]: @< Open name. 
  632. X0015[05]: Text. Text scrap[Grey]="Two"
  633. X0015[08]: @> Close name. 
  634. X0015[10]: Text. Text scrap[White]="<010>
  635. X"
  636. X0016[01]: @C New section (Level 3). 
  637. X0016[03]: @< Open name. 
  638. X0016[05]: Text. Text scrap[Grey]="Three"
  639. X0016[10]: @> Close name. 
  640. X0016[12]: Text. Text scrap[White]="<010>
  641. X"
  642. X0017[01]: @D New section (Level 4). 
  643. X0017[03]: @< Open name. 
  644. X0017[05]: Text. Text scrap[Grey]="Four"
  645. X0017[09]: @> Close name. 
  646. X0017[11]: Text. Text scrap[White]="<010>
  647. X"
  648. X0018[01]: @E New section (Level 5). 
  649. X0018[03]: @< Open name. 
  650. X0018[05]: Text. Text scrap[Grey]="Five"
  651. X0018[09]: @> Close name. 
  652. X0018[11]: Text. Text scrap[Grey]="<010>
  653. X<010>
  654. X5. Test detection of discontinuity in levels.<010>
  655. X"
  656. X0021[01]: @A New section (Level 1). 
  657. X0021[03]: @< Open name. 
  658. X0021[05]: Text. Text scrap[Grey]="One"
  659. X0021[08]: @> Close name. 
  660. X0021[10]: Text. Text scrap[White]="<010>
  661. X"
  662. X0022[01]: @C New section (Level 3). 
  663. X0022[03]: @< Open name. 
  664. X0022[05]: Text. Text scrap[Grey]="Three"
  665. X0022[10]: @> Close name. 
  666. X0022[12]: Text. Text scrap[White]="<010>
  667. X"
  668. X0023[01]: @E New section (Level 5). 
  669. X0023[03]: @< Open name. 
  670. X0023[05]: Text. Text scrap[Grey]="Five"
  671. X0023[09]: @> Close name. 
  672. X0023[11]: Text. Text scrap[White]="<010>
  673. X<010>
  674. X"
  675. X0025[01]: @A New section (Level 1). 
  676. X0025[03]: @< Open name. 
  677. X0025[05]: Text. Text scrap[Grey]="One"
  678. X0025[08]: @> Close name. 
  679. X0025[10]: Text. Text scrap[White]="<010>
  680. X"
  681. X0026[01]: @B New section (Level 2). 
  682. X0026[03]: @< Open name. 
  683. X0026[05]: Text. Text scrap[Grey]="Three"
  684. X0026[10]: @> Close name. 
  685. X0026[12]: Text. Text scrap[White]="<010>
  686. X"
  687. X0027[01]: @D New section (Level 4). 
  688. X0027[03]: @< Open name. 
  689. X0027[05]: Text. Text scrap[Grey]="Five"
  690. X0027[09]: @> Close name. 
  691. X0027[11]: Text. Text scrap[White]="<010>
  692. X"
  693. X0028[01]: End Of File. 
  694. X============================ End of TOKEN LIST DUMP ============================
  695. X
  696. X
  697. X========================== Start of MACRO TABLE DUMP ===========================
  698. X
  699. X
  700. X------------------- Start of Macro Dump --------------------
  701. Macro Name  : "The section name inherits the name of this macro"
  702. Defined?    : Yes.
  703. Parameters  : 0
  704. Additive?   : No.
  705. Zero Calls? : No.
  706. Many Calls? : No.
  707. Output File?: No.
  708. Call list   :
  709. Macro body  :
  710. X
  711. X--Start of List of Body Parts--
  712. This macro has 1 body part.
  713. Body part 1: Seqnum=1, Pos(L,C)=(8,3), Expression follows:
  714. X
  715. X---- Start of Expression ----
  716. X
  717. X----- Start Text Element -----
  718. Text scrap[Grey]="Walrus"
  719. X------ End Text Element ------
  720. X
  721. X----- End of Expression -----
  722. X
  723. X---End of List of Body Parts---
  724. X
  725. X-------------------- End of Macro Dump ---------------------
  726. X
  727. X
  728. X
  729. X=========================== End of MACRO TABLE DUMP ============================
  730. X
  731. X
  732. X========================= Start of DOCUMENT LIST DUMP ==========================
  733. X
  734. X
  735. TEXT COMPONENT: Pos(L,C)=(1,1). 
  736. X
  737. X-- Start of Text Scrap List --
  738. Text scrap[Grey]="PR03: Test the parsing and semantics of sections.<010>
  739. X<010>
  740. X4. Test first section of document is not <special>A.<010>
  741. X"
  742. X--- End of Text Scrap List ---
  743. X
  744. X
  745. TYPESETTER DIRECTIVE COMPONENT: 
  746. X   Section "1.2", Section name="This section is out of order (and so is this test!)".
  747. X
  748. TEXT COMPONENT: Pos(L,C)=(4,58). 
  749. X
  750. X-- Start of Text Scrap List --
  751. Text scrap[Grey]="<010>
  752. X<010>
  753. X1. Test section with no name.<010>
  754. X"
  755. X--- End of Text Scrap List ---
  756. X
  757. X
  758. TYPESETTER DIRECTIVE COMPONENT: 
  759. X   Section "2", Section name="The section name inherits the name of this macro".
  760. X
  761. TEXT COMPONENT: Pos(L,C)=(7,3). 
  762. X
  763. X-- Start of Text Scrap List --
  764. Text scrap[Grey]=" This section has no name.<010>
  765. X"
  766. X--- End of Text Scrap List ---
  767. X
  768. X
  769. MACRO DEFINITION COMPONENT: Pos(L,C)=(8,1). 
  770. Part 1 of macro @<The section name inherits the name of this macro@>.
  771. X
  772. TEXT COMPONENT: Pos(L,C)=(8,65). 
  773. X
  774. X-- Start of Text Scrap List --
  775. Text scrap[Grey]="<010>
  776. X<010>
  777. X2. Test section with a name<010>
  778. X"
  779. X--- End of Text Scrap List ---
  780. X
  781. X
  782. TYPESETTER DIRECTIVE COMPONENT: 
  783. X   Section "3", Section name="This section has no name.".
  784. X
  785. TEXT COMPONENT: Pos(L,C)=(11,32). 
  786. X
  787. X-- Start of Text Scrap List --
  788. Text scrap[Grey]="<010>
  789. X<010>
  790. X3. Test the entire hierarchy.<010>
  791. X"
  792. X--- End of Text Scrap List ---
  793. X
  794. X
  795. TYPESETTER DIRECTIVE COMPONENT: 
  796. X   Section "4", Section name="One".
  797. X
  798. TEXT COMPONENT: Pos(L,C)=(14,10). 
  799. X
  800. X-- Start of Text Scrap List --
  801. Text scrap[White]="<010>
  802. X"
  803. X--- End of Text Scrap List ---
  804. X
  805. X
  806. TYPESETTER DIRECTIVE COMPONENT: 
  807. X   Section "4.1", Section name="Two".
  808. X
  809. TEXT COMPONENT: Pos(L,C)=(15,10). 
  810. X
  811. X-- Start of Text Scrap List --
  812. Text scrap[White]="<010>
  813. X"
  814. X--- End of Text Scrap List ---
  815. X
  816. X
  817. TYPESETTER DIRECTIVE COMPONENT: 
  818. X   Section "4.1.1", Section name="Three".
  819. X
  820. TEXT COMPONENT: Pos(L,C)=(16,12). 
  821. X
  822. X-- Start of Text Scrap List --
  823. Text scrap[White]="<010>
  824. X"
  825. X--- End of Text Scrap List ---
  826. X
  827. X
  828. TYPESETTER DIRECTIVE COMPONENT: 
  829. X   Section "4.1.1.1", Section name="Four".
  830. X
  831. TEXT COMPONENT: Pos(L,C)=(17,11). 
  832. X
  833. X-- Start of Text Scrap List --
  834. Text scrap[White]="<010>
  835. X"
  836. X--- End of Text Scrap List ---
  837. X
  838. X
  839. TYPESETTER DIRECTIVE COMPONENT: 
  840. X   Section "4.1.1.1.1", Section name="Five".
  841. X
  842. TEXT COMPONENT: Pos(L,C)=(18,11). 
  843. X
  844. X-- Start of Text Scrap List --
  845. Text scrap[Grey]="<010>
  846. X<010>
  847. X5. Test detection of discontinuity in levels.<010>
  848. X"
  849. X--- End of Text Scrap List ---
  850. X
  851. X
  852. TYPESETTER DIRECTIVE COMPONENT: 
  853. X   Section "5", Section name="One".
  854. X
  855. TEXT COMPONENT: Pos(L,C)=(21,10). 
  856. X
  857. X-- Start of Text Scrap List --
  858. Text scrap[White]="<010>
  859. X"
  860. X--- End of Text Scrap List ---
  861. X
  862. X
  863. TYPESETTER DIRECTIVE COMPONENT: 
  864. X   Section "1.1.2", Section name="Three".
  865. X
  866. TEXT COMPONENT: Pos(L,C)=(22,12). 
  867. X
  868. X-- Start of Text Scrap List --
  869. Text scrap[White]="<010>
  870. X"
  871. X--- End of Text Scrap List ---
  872. X
  873. X
  874. TYPESETTER DIRECTIVE COMPONENT: 
  875. X   Section "1.1.1.1.2", Section name="Five".
  876. X
  877. TEXT COMPONENT: Pos(L,C)=(23,11). 
  878. X
  879. X-- Start of Text Scrap List --
  880. Text scrap[White]="<010>
  881. X<010>
  882. X"
  883. X--- End of Text Scrap List ---
  884. X
  885. X
  886. TYPESETTER DIRECTIVE COMPONENT: 
  887. X   Section "2", Section name="One".
  888. X
  889. TEXT COMPONENT: Pos(L,C)=(25,10). 
  890. X
  891. X-- Start of Text Scrap List --
  892. Text scrap[White]="<010>
  893. X"
  894. X--- End of Text Scrap List ---
  895. X
  896. X
  897. TYPESETTER DIRECTIVE COMPONENT: 
  898. X   Section "2.1", Section name="Three".
  899. X
  900. TEXT COMPONENT: Pos(L,C)=(26,12). 
  901. X
  902. X-- Start of Text Scrap List --
  903. Text scrap[White]="<010>
  904. X"
  905. X--- End of Text Scrap List ---
  906. X
  907. X
  908. TYPESETTER DIRECTIVE COMPONENT: 
  909. X   Section "1.1.1.2", Section name="Five".
  910. X
  911. TEXT COMPONENT: Pos(L,C)=(27,11). 
  912. X
  913. X-- Start of Text Scrap List --
  914. Text scrap[White]="<010>
  915. X"
  916. X--- End of Text Scrap List ---
  917. X
  918. X
  919. X========================== End of DOCUMENT LIST DUMP ===========================
  920. X
  921. X
  922. Global Local| Input File
  923. X------------+-------------------------------------------------------------------
  924. X     1     1| PR03: Test the parsing and semantics of sections.
  925. X     2     2| 
  926. X     3     3| 4. Test first section of document is not <special>A.
  927. X     4     4| @B@<This section is out of order (and so is this test!)@>
  928. X       Error|.^The first section in a document must be an @A section.
  929. X     5     5| 
  930. X     6     6| 1. Test section with no name.
  931. X     7     7| @A This section has no name.
  932. X     8     8| @$@<The section name inherits the name of this macro@>@{Walrus@}
  933. X     9     9| 
  934. X    10    10| 2. Test section with a name
  935. X    11    11| @A@<This section has no name.@>
  936. X    12    12| 
  937. X    13    13| 3. Test the entire hierarchy.
  938. X    14    14| @A@<One@>
  939. X    15    15| @B@<Two@>
  940. X    16    16| @C@<Three@>
  941. X    17    17| @D@<Four@>
  942. X    18    18| @E@<Five@>
  943. X    19    19| 
  944. X    20    20| 5. Test detection of discontinuity in levels.
  945. X    21    21| @A@<One@>
  946. X            |.^The next section (at line 22) is too deep.
  947. X    22    22| @C@<Three@>
  948. X       Error|.^This section is more than one level deeper than the last
  949. X            |.^section (at line 21). Example: @B followed by @D is not allowed.
  950. X            |.^The next section (at line 23) is too deep.
  951. X    23    23| @E@<Five@>
  952. X       Error|.^This section is more than one level deeper than the last
  953. X            |.^section (at line 22). Example: @B followed by @D is not allowed.
  954. X    24    24| 
  955. X    25    25| @A@<One@>
  956. X    26    26| @B@<Three@>
  957. X            |.^The next section (at line 27) is too deep.
  958. X    27    27| @D@<Five@>
  959. X       Error|.^This section is more than one level deeper than the last
  960. X            |.^section (at line 26). Example: @B followed by @D is not allowed.
  961. X            | <End-Of-File>
  962. X------------+-------------------------------------------------------------------
  963. X
  964. There were 4 Errors.
  965. END_OF_FILE
  966. if test 14101 -ne `wc -c <'answers/pr03.lis'`; then
  967.     echo shar: \"'answers/pr03.lis'\" unpacked with wrong size!
  968. fi
  969. # end of 'answers/pr03.lis'
  970. fi
  971. if test -f 'answers/sc17.lis' -a "${1}" != "-c" ; then 
  972.   echo shar: Will not clobber existing file \"'answers/sc17.lis'\"
  973. else
  974. echo shar: Extracting \"'answers/sc17.lis'\" \(14128 characters\)
  975. sed "s/^X//" >'answers/sc17.lis' <<'END_OF_FILE'
  976. XFUNNELWEB LISTING FILE
  977. X======================
  978. X
  979. Dump of mapped file "<<Suppressed>>".
  980. X
  981. MEMORY DUMP OF MAPPED FILE
  982. X==========================
  983. X
  984. X+-------------------------------------------------+------------------+
  985. X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |
  986. X+-------------------------------------------------+------------------+
  987. X| 53 43 31 37 3A 20 54 65 73 74 20 3C 73 70 65 63 | SC17: Test <spec |
  988. X| 69 61 6C 3E 23 2E 0A 0A 46 69 72 73 74 20 77 65 | ial>#...First we |
  989. X| 20 74 72 69 70 20 75 70 20 74 68 65 20 73 63 61 |  trip up the sca |
  990. X| 6E 6E 65 72 20 73 6F 20 6E 6F 20 66 75 72 74 68 | nner so no furth |
  991. X| 65 72 20 70 61 73 73 65 73 20 74 61 6B 65 20 70 | er passes take p |
  992. X| 6C 61 63 65 2E 0A 0A 40 0A 0A 31 2E 20 54 65 73 | lace...@..1. Tes |
  993. X| 74 20 77 69 74 68 20 61 6C 6C 20 70 6F 73 73 69 | t with all possi |
  994. X| 62 6C 65 20 70 72 69 6E 74 61 62 6C 65 20 63 68 | ble printable ch |
  995. X| 61 72 61 63 74 65 72 73 2E 0A 0A 40 23 21 20 40 | aracters...@#! @ |
  996. X| 23 22 20 40 23 23 20 40 23 24 20 40 23 25 20 40 | #" @## @#$ @#% @ |
  997. X| 23 26 20 40 23 27 20 40 23 28 20 40 23 29 20 40 | #& @#' @#( @#) @ |
  998. X| 23 2A 20 40 23 2B 20 40 23 2C 20 40 23 2D 20 40 | #* @#+ @#, @#- @ |
  999. X| 23 2E 20 40 23 2F 0A 40 23 30 20 40 23 31 20 40 | #. @#/.@#0 @#1 @ |
  1000. X| 23 32 20 40 23 33 20 40 23 34 20 40 23 35 20 40 | #2 @#3 @#4 @#5 @ |
  1001. X| 23 36 20 40 23 37 20 40 23 38 20 40 23 39 20 40 | #6 @#7 @#8 @#9 @ |
  1002. X| 23 3A 20 40 23 3B 20 40 23 3C 20 40 23 3D 20 40 | #: @#; @#< @#= @ |
  1003. X| 23 3E 0A 40 23 3F 20 40 23 40 20 40 23 41 20 40 | #>.@#? @#@ @#A @ |
  1004. X| 23 42 20 40 23 43 20 40 23 44 20 40 23 45 20 40 | #B @#C @#D @#E @ |
  1005. X| 23 46 20 40 23 47 20 40 23 48 20 40 23 49 20 40 | #F @#G @#H @#I @ |
  1006. X| 23 4A 20 40 23 4B 20 40 23 4C 20 40 23 4D 0A 40 | #J @#K @#L @#M.@ |
  1007. X| 23 4E 20 40 23 4F 20 40 23 50 20 40 23 51 20 40 | #N @#O @#P @#Q @ |
  1008. X| 23 52 20 40 23 53 20 40 23 54 20 40 23 55 20 40 | #R @#S @#T @#U @ |
  1009. X| 23 56 20 40 23 57 20 40 23 58 20 40 23 59 20 40 | #V @#W @#X @#Y @ |
  1010. X| 23 5A 20 40 23 5B 20 40 23 5C 0A 40 23 5D 20 40 | #Z @#[ @#\.@#] @ |
  1011. X| 23 5E 20 40 23 5F 20 40 23 60 20 40 23 61 20 40 | #^ @#_ @#` @#a @ |
  1012. X| 23 62 20 40 23 63 20 40 23 64 20 40 23 65 20 40 | #b @#c @#d @#e @ |
  1013. X| 23 66 20 40 23 67 20 40 23 68 20 40 23 69 20 40 | #f @#g @#h @#i @ |
  1014. X| 23 6A 20 40 23 6B 0A 40 23 6C 20 40 23 6D 20 40 | #j @#k.@#l @#m @ |
  1015. X| 23 6E 20 40 23 6F 20 40 23 70 20 40 23 71 20 40 | #n @#o @#p @#q @ |
  1016. X| 23 72 20 40 23 73 20 40 23 74 20 40 23 75 20 40 | #r @#s @#t @#u @ |
  1017. X| 23 76 20 40 23 77 20 40 23 78 20 40 23 79 20 40 | #v @#w @#x @#y @ |
  1018. X| 23 7A 0A 40 23 7B 20 40 23 7C 20 40 23 7D 20 40 | #z.@#{ @#| @#} @ |
  1019. X| 23 7E 0A 0A 32 2E 20 54 65 73 74 20 74 68 61 74 | #~..2. Test that |
  1020. X| 20 3C 73 70 65 63 69 61 6C 3E 23 3C 73 70 61 63 |  <special>#<spac |
  1021. X| 65 3E 20 69 73 20 66 6C 61 67 67 65 64 20 61 73 | e> is flagged as |
  1022. X| 20 61 6E 20 65 72 72 6F 72 2E 0A 0A 20 20 20 40 |  an error...   @ |
  1023. X| 23 20 20 20 20 20 40 21 20 53 68 6F 75 6C 64 20 | #     @! Should  |
  1024. X| 62 65 20 66 6C 61 67 67 65 64 20 61 73 20 61 6E | be flagged as an |
  1025. X| 20 65 72 72 6F 72 2E 0A 0A 33 2E 20 54 65 73 74 |  error...3. Test |
  1026. X| 20 74 68 61 74 20 3C 73 70 65 63 69 61 6C 3E 23 |  that <special># |
  1027. X| 45 4F 4C 20 69 73 20 66 6C 61 67 67 65 64 20 61 | EOL is flagged a |
  1028. X| 73 20 61 6E 20 65 72 72 6F 72 2E 0A 0A 20 20 20 | s an error...    |
  1029. X| 40 23 0A 0A                                     | @#..             |
  1030. X+-------------------------------------------------+------------------+
  1031. X
  1032. X
  1033. X=========================== Start of LINE LIST DUMP ============================
  1034. X
  1035. Globl Local| Text
  1036. X-----------+--------------------------------------------------------------------
  1037. X00001 00001| SC17: Test <special>#.<010>
  1038. X00002 00002| <010>
  1039. X00003 00003| First we trip up the scanner so no further passes take place.<010>
  1040. X00004 00004| <010>
  1041. X00005 00005| @<010>
  1042. X00006 00006| <010>
  1043. X00007 00007| 1. Test with all possible printable characters.<010>
  1044. X00008 00008| <010>
  1045. X00009 00009| @#! @#" @## @#$ @#% @#& @#' @#( @#) @#* @#+ @#, @#- @#. @#/<010>
  1046. X00010 00010| @#0 @#1 @#2 @#3 @#4 @#5 @#6 @#7 @#8 @#9 @#: @#; @#< @#= @#><010>
  1047. X00011 00011| @#? @#@ @#A @#B @#C @#D @#E @#F @#G @#H @#I @#J @#K @#L @#M<010>
  1048. X00012 00012| @#N @#O @#P @#Q @#R @#S @#T @#U @#V @#W @#X @#Y @#Z @#[ @#\<010>
  1049. X00013 00013| @#] @#^ @#_ @#` @#a @#b @#c @#d @#e @#f @#g @#h @#i @#j @#k<010>
  1050. X00014 00014| @#l @#m @#n @#o @#p @#q @#r @#s @#t @#u @#v @#w @#x @#y @#z<010>
  1051. X00015 00015| @#{ @#| @#} @#~<010>
  1052. X00016 00016| <010>
  1053. X00017 00017| 2. Test that <special>#<space> is flagged as an error.<010>
  1054. X00018 00018| <010>
  1055. X00019 00019|    @#     @! Should be flagged as an error.<010>
  1056. X00020 00020| <010>
  1057. X00021 00021| 3. Test that <special>#EOL is flagged as an error.<010>
  1058. X00022 00022| <010>
  1059. X00023 00023|    @#<010>
  1060. X00024 00024| <010>
  1061. X00025 00025| <End-Of-File><010>
  1062. X-----------+--------------------------------------------------------------------
  1063. Globl Local| Text
  1064. X
  1065. X============================ End of LINE LIST DUMP =============================
  1066. X
  1067. X
  1068. X=========================== Start of TOKEN LIST DUMP ===========================
  1069. X
  1070. Summary: There are 194 tokens in the token list.
  1071. X
  1072. Line[Column]: Token Description
  1073. X-------------------------------
  1074. X
  1075. X0001[01]: Text. Text scrap[Grey]="SC17: Test <special>#.<010>
  1076. X<010>
  1077. XFirst we trip up the scanner so no further passes take place.<010>
  1078. X<010>
  1079. X"
  1080. X0006[01]: Text. Text scrap[Grey]="<010>
  1081. X1. Test with all possible printable characters.<010>
  1082. X<010>
  1083. X"
  1084. X0009[01]: @# Name. Character='!'.
  1085. X0009[04]: Text. Text scrap[White]=" "
  1086. X0009[05]: @# Name. Character='"'.
  1087. X0009[08]: Text. Text scrap[White]=" "
  1088. X0009[09]: @# Name. Character='#'.
  1089. X0009[12]: Text. Text scrap[White]=" "
  1090. X0009[13]: @# Name. Character='$'.
  1091. X0009[16]: Text. Text scrap[White]=" "
  1092. X0009[17]: @# Name. Character='%'.
  1093. X0009[20]: Text. Text scrap[White]=" "
  1094. X0009[21]: @# Name. Character='&'.
  1095. X0009[24]: Text. Text scrap[White]=" "
  1096. X0009[25]: @# Name. Character='''.
  1097. X0009[28]: Text. Text scrap[White]=" "
  1098. X0009[29]: @# Name. Character='('.
  1099. X0009[32]: Text. Text scrap[White]=" "
  1100. X0009[33]: @# Name. Character=')'.
  1101. X0009[36]: Text. Text scrap[White]=" "
  1102. X0009[37]: @# Name. Character='*'.
  1103. X0009[40]: Text. Text scrap[White]=" "
  1104. X0009[41]: @# Name. Character='+'.
  1105. X0009[44]: Text. Text scrap[White]=" "
  1106. X0009[45]: @# Name. Character=','.
  1107. X0009[48]: Text. Text scrap[White]=" "
  1108. X0009[49]: @# Name. Character='-'.
  1109. X0009[52]: Text. Text scrap[White]=" "
  1110. X0009[53]: @# Name. Character='.'.
  1111. X0009[56]: Text. Text scrap[White]=" "
  1112. X0009[57]: @# Name. Character='/'.
  1113. X0009[60]: Text. Text scrap[White]="<010>
  1114. X"
  1115. X0010[01]: @# Name. Character='0'.
  1116. X0010[04]: Text. Text scrap[White]=" "
  1117. X0010[05]: @# Name. Character='1'.
  1118. X0010[08]: Text. Text scrap[White]=" "
  1119. X0010[09]: @# Name. Character='2'.
  1120. X0010[12]: Text. Text scrap[White]=" "
  1121. X0010[13]: @# Name. Character='3'.
  1122. X0010[16]: Text. Text scrap[White]=" "
  1123. X0010[17]: @# Name. Character='4'.
  1124. X0010[20]: Text. Text scrap[White]=" "
  1125. X0010[21]: @# Name. Character='5'.
  1126. X0010[24]: Text. Text scrap[White]=" "
  1127. X0010[25]: @# Name. Character='6'.
  1128. X0010[28]: Text. Text scrap[White]=" "
  1129. X0010[29]: @# Name. Character='7'.
  1130. X0010[32]: Text. Text scrap[White]=" "
  1131. X0010[33]: @# Name. Character='8'.
  1132. X0010[36]: Text. Text scrap[White]=" "
  1133. X0010[37]: @# Name. Character='9'.
  1134. X0010[40]: Text. Text scrap[White]=" "
  1135. X0010[41]: @# Name. Character=':'.
  1136. X0010[44]: Text. Text scrap[White]=" "
  1137. X0010[45]: @# Name. Character=';'.
  1138. X0010[48]: Text. Text scrap[White]=" "
  1139. X0010[49]: @# Name. Character='<'.
  1140. X0010[52]: Text. Text scrap[White]=" "
  1141. X0010[53]: @# Name. Character='='.
  1142. X0010[56]: Text. Text scrap[White]=" "
  1143. X0010[57]: @# Name. Character='>'.
  1144. X0010[60]: Text. Text scrap[White]="<010>
  1145. X"
  1146. X0011[01]: @# Name. Character='?'.
  1147. X0011[04]: Text. Text scrap[White]=" "
  1148. X0011[05]: @# Name. Character='@'.
  1149. X0011[08]: Text. Text scrap[White]=" "
  1150. X0011[09]: @# Name. Character='A'.
  1151. X0011[12]: Text. Text scrap[White]=" "
  1152. X0011[13]: @# Name. Character='B'.
  1153. X0011[16]: Text. Text scrap[White]=" "
  1154. X0011[17]: @# Name. Character='C'.
  1155. X0011[20]: Text. Text scrap[White]=" "
  1156. X0011[21]: @# Name. Character='D'.
  1157. X0011[24]: Text. Text scrap[White]=" "
  1158. X0011[25]: @# Name. Character='E'.
  1159. X0011[28]: Text. Text scrap[White]=" "
  1160. X0011[29]: @# Name. Character='F'.
  1161. X0011[32]: Text. Text scrap[White]=" "
  1162. X0011[33]: @# Name. Character='G'.
  1163. X0011[36]: Text. Text scrap[White]=" "
  1164. X0011[37]: @# Name. Character='H'.
  1165. X0011[40]: Text. Text scrap[White]=" "
  1166. X0011[41]: @# Name. Character='I'.
  1167. X0011[44]: Text. Text scrap[White]=" "
  1168. X0011[45]: @# Name. Character='J'.
  1169. X0011[48]: Text. Text scrap[White]=" "
  1170. X0011[49]: @# Name. Character='K'.
  1171. X0011[52]: Text. Text scrap[White]=" "
  1172. X0011[53]: @# Name. Character='L'.
  1173. X0011[56]: Text. Text scrap[White]=" "
  1174. X0011[57]: @# Name. Character='M'.
  1175. X0011[60]: Text. Text scrap[White]="<010>
  1176. X"
  1177. X0012[01]: @# Name. Character='N'.
  1178. X0012[04]: Text. Text scrap[White]=" "
  1179. X0012[05]: @# Name. Character='O'.
  1180. X0012[08]: Text. Text scrap[White]=" "
  1181. X0012[09]: @# Name. Character='P'.
  1182. X0012[12]: Text. Text scrap[White]=" "
  1183. X0012[13]: @# Name. Character='Q'.
  1184. X0012[16]: Text. Text scrap[White]=" "
  1185. X0012[17]: @# Name. Character='R'.
  1186. X0012[20]: Text. Text scrap[White]=" "
  1187. X0012[21]: @# Name. Character='S'.
  1188. X0012[24]: Text. Text scrap[White]=" "
  1189. X0012[25]: @# Name. Character='T'.
  1190. X0012[28]: Text. Text scrap[White]=" "
  1191. X0012[29]: @# Name. Character='U'.
  1192. X0012[32]: Text. Text scrap[White]=" "
  1193. X0012[33]: @# Name. Character='V'.
  1194. X0012[36]: Text. Text scrap[White]=" "
  1195. X0012[37]: @# Name. Character='W'.
  1196. X0012[40]: Text. Text scrap[White]=" "
  1197. X0012[41]: @# Name. Character='X'.
  1198. X0012[44]: Text. Text scrap[White]=" "
  1199. X0012[45]: @# Name. Character='Y'.
  1200. X0012[48]: Text. Text scrap[White]=" "
  1201. X0012[49]: @# Name. Character='Z'.
  1202. X0012[52]: Text. Text scrap[White]=" "
  1203. X0012[53]: @# Name. Character='['.
  1204. X0012[56]: Text. Text scrap[White]=" "
  1205. X0012[57]: @# Name. Character='\'.
  1206. X0012[60]: Text. Text scrap[White]="<010>
  1207. X"
  1208. X0013[01]: @# Name. Character=']'.
  1209. X0013[04]: Text. Text scrap[White]=" "
  1210. X0013[05]: @# Name. Character='^'.
  1211. X0013[08]: Text. Text scrap[White]=" "
  1212. X0013[09]: @# Name. Character='_'.
  1213. X0013[12]: Text. Text scrap[White]=" "
  1214. X0013[13]: @# Name. Character='`'.
  1215. X0013[16]: Text. Text scrap[White]=" "
  1216. X0013[17]: @# Name. Character='a'.
  1217. X0013[20]: Text. Text scrap[White]=" "
  1218. X0013[21]: @# Name. Character='b'.
  1219. X0013[24]: Text. Text scrap[White]=" "
  1220. X0013[25]: @# Name. Character='c'.
  1221. X0013[28]: Text. Text scrap[White]=" "
  1222. X0013[29]: @# Name. Character='d'.
  1223. X0013[32]: Text. Text scrap[White]=" "
  1224. X0013[33]: @# Name. Character='e'.
  1225. X0013[36]: Text. Text scrap[White]=" "
  1226. X0013[37]: @# Name. Character='f'.
  1227. X0013[40]: Text. Text scrap[White]=" "
  1228. X0013[41]: @# Name. Character='g'.
  1229. X0013[44]: Text. Text scrap[White]=" "
  1230. X0013[45]: @# Name. Character='h'.
  1231. X0013[48]: Text. Text scrap[White]=" "
  1232. X0013[49]: @# Name. Character='i'.
  1233. X0013[52]: Text. Text scrap[White]=" "
  1234. X0013[53]: @# Name. Character='j'.
  1235. X0013[56]: Text. Text scrap[White]=" "
  1236. X0013[57]: @# Name. Character='k'.
  1237. X0013[60]: Text. Text scrap[White]="<010>
  1238. X"
  1239. X0014[01]: @# Name. Character='l'.
  1240. X0014[04]: Text. Text scrap[White]=" "
  1241. X0014[05]: @# Name. Character='m'.
  1242. X0014[08]: Text. Text scrap[White]=" "
  1243. X0014[09]: @# Name. Character='n'.
  1244. X0014[12]: Text. Text scrap[White]=" "
  1245. X0014[13]: @# Name. Character='o'.
  1246. X0014[16]: Text. Text scrap[White]=" "
  1247. X0014[17]: @# Name. Character='p'.
  1248. X0014[20]: Text. Text scrap[White]=" "
  1249. X0014[21]: @# Name. Character='q'.
  1250. X0014[24]: Text. Text scrap[White]=" "
  1251. X0014[25]: @# Name. Character='r'.
  1252. X0014[28]: Text. Text scrap[White]=" "
  1253. X0014[29]: @# Name. Character='s'.
  1254. X0014[32]: Text. Text scrap[White]=" "
  1255. X0014[33]: @# Name. Character='t'.
  1256. X0014[36]: Text. Text scrap[White]=" "
  1257. X0014[37]: @# Name. Character='u'.
  1258. X0014[40]: Text. Text scrap[White]=" "
  1259. X0014[41]: @# Name. Character='v'.
  1260. X0014[44]: Text. Text scrap[White]=" "
  1261. X0014[45]: @# Name. Character='w'.
  1262. X0014[48]: Text. Text scrap[White]=" "
  1263. X0014[49]: @# Name. Character='x'.
  1264. X0014[52]: Text. Text scrap[White]=" "
  1265. X0014[53]: @# Name. Character='y'.
  1266. X0014[56]: Text. Text scrap[White]=" "
  1267. X0014[57]: @# Name. Character='z'.
  1268. X0014[60]: Text. Text scrap[White]="<010>
  1269. X"
  1270. X0015[01]: @# Name. Character='{'.
  1271. X0015[04]: Text. Text scrap[White]=" "
  1272. X0015[05]: @# Name. Character='|'.
  1273. X0015[08]: Text. Text scrap[White]=" "
  1274. X0015[09]: @# Name. Character='}'.
  1275. X0015[12]: Text. Text scrap[White]=" "
  1276. X0015[13]: @# Name. Character='~'.
  1277. X0015[16]: Text. Text scrap[Grey]="<010>
  1278. X<010>
  1279. X2. Test that <special>#<space> is flagged as an error.<010>
  1280. X<010>
  1281. X   "
  1282. X0019[07]: Text. Text scrap[White]="    "
  1283. X0020[01]: Text. Text scrap[Grey]="<010>
  1284. X3. Test that <special>#EOL is flagged as an error.<010>
  1285. X<010>
  1286. X   "
  1287. X0024[01]: Text. Text scrap[White]="<010>
  1288. X"
  1289. X0025[01]: End Of File. 
  1290. X============================ End of TOKEN LIST DUMP ============================
  1291. X
  1292. Macro table dump skipped (Parser was not invoked).
  1293. Document list dump skipped (Parser was not invoked).
  1294. X
  1295. Global Local| Input File
  1296. X------------+-------------------------------------------------------------------
  1297. X     1     1| SC17: Test <special>#.
  1298. X     2     2| 
  1299. X     3     3| First we trip up the scanner so no further passes take place.
  1300. X     4     4| 
  1301. X     5     5| @
  1302. X       Error|.^<special><endofline> is not a legal special sequence.
  1303. X     6     6| 
  1304. X     7     7| 1. Test with all possible printable characters.
  1305. X     8     8| 
  1306. X     9     9| @#! @#" @## @#$ @#% @#& @#' @#( @#) @#* @#+ @#, @#- @#. @#/
  1307. X    10    10| @#0 @#1 @#2 @#3 @#4 @#5 @#6 @#7 @#8 @#9 @#: @#; @#< @#= @#>
  1308. X    11    11| @#? @#@ @#A @#B @#C @#D @#E @#F @#G @#H @#I @#J @#K @#L @#M
  1309. X    12    12| @#N @#O @#P @#Q @#R @#S @#T @#U @#V @#W @#X @#Y @#Z @#[ @#\
  1310. X    13    13| @#] @#^ @#_ @#` @#a @#b @#c @#d @#e @#f @#g @#h @#i @#j @#k
  1311. X    14    14| @#l @#m @#n @#o @#p @#q @#r @#s @#t @#u @#v @#w @#x @#y @#z
  1312. X    15    15| @#{ @#| @#} @#~
  1313. X    16    16| 
  1314. X    17    17| 2. Test that <special>#<space> is flagged as an error.
  1315. X    18    18| 
  1316. X    19    19|    @#     @! Should be flagged as an error.
  1317. X       Error|......^Expecting a printable character.
  1318. X    20    20| 
  1319. X    21    21| 3. Test that <special>#EOL is flagged as an error.
  1320. X    22    22| 
  1321. X    23    23|    @#
  1322. X       Error|......^Expecting a printable character.
  1323. X    24    24| 
  1324. X            | <End-Of-File>
  1325. X------------+-------------------------------------------------------------------
  1326. X
  1327. There were 3 Errors.
  1328. END_OF_FILE
  1329. if test 14128 -ne `wc -c <'answers/sc17.lis'`; then
  1330.     echo shar: \"'answers/sc17.lis'\" unpacked with wrong size!
  1331. fi
  1332. # end of 'answers/sc17.lis'
  1333. fi
  1334. if test -f 'answers/sc28.lis' -a "${1}" != "-c" ; then 
  1335.   echo shar: Will not clobber existing file \"'answers/sc28.lis'\"
  1336. else
  1337. echo shar: Extracting \"'answers/sc28.lis'\" \(13334 characters\)
  1338. sed "s/^X//" >'answers/sc28.lis' <<'END_OF_FILE'
  1339. XFUNNELWEB LISTING FILE
  1340. X======================
  1341. X
  1342. Dump of mapped file "<<Suppressed>>".
  1343. X
  1344. MEMORY DUMP OF MAPPED FILE
  1345. X==========================
  1346. X
  1347. X+-------------------------------------------------+------------------+
  1348. X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |
  1349. X+-------------------------------------------------+------------------+
  1350. X| 53 43 32 38 3A 20 54 65 73 74 20 73 79 6E 74 61 | SC28: Test synta |
  1351. X| 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 74 69 | x checking of ti |
  1352. X| 74 6C 65 20 74 79 70 65 73 65 74 74 69 6E 67 20 | tle typesetting  |
  1353. X| 64 69 72 65 63 74 69 76 65 2E 0A 0A 31 2E 20 54 | directive...1. T |
  1354. X| 65 73 74 20 6C 65 73 73 20 74 68 61 6E 20 66 6F | est less than fo |
  1355. X| 75 72 20 61 72 67 75 6D 65 6E 74 73 20 28 69 6E | ur arguments (in |
  1356. X| 63 6C 75 64 65 73 20 74 69 74 6C 65 29 2E 0A 4E | cludes title)..N |
  1357. X| 6F 74 65 3A 20 54 68 65 20 74 69 74 6C 65 20 63 | ote: The title c |
  1358. X| 6F 6D 6D 61 6E 64 20 70 75 6C 6C 73 20 61 20 68 | ommand pulls a h |
  1359. X| 61 63 6B 20 74 72 65 61 74 69 6E 67 20 74 68 65 | ack treating the |
  1360. X| 20 72 65 73 74 20 6F 66 20 74 68 65 20 6C 69 6E |  rest of the lin |
  1361. X| 65 20 61 66 74 65 72 0A 74 77 6F 20 61 72 67 75 | e after.two argu |
  1362. X| 6D 65 6E 74 73 20 61 73 20 74 68 65 20 73 74 72 | ments as the str |
  1363. X| 69 6E 67 2E 20 53 6F 20 69 74 20 63 61 6E 27 74 | ing. So it can't |
  1364. X| 20 64 65 74 65 63 74 20 61 6E 20 45 58 43 45 53 |  detect an EXCES |
  1365. X| 53 20 6F 66 20 61 72 67 75 6D 65 6E 74 73 21 0A | S of arguments!. |
  1366. X| 40 74 20 74 69 74 6C 65 0A 40 74 20 74 69 74 6C | @t title.@t titl |
  1367. X| 65 20 74 77 6F 0A 40 74 20 74 69 74 6C 65 20 74 | e two.@t title t |
  1368. X| 77 6F 20 74 68 72 65 65 0A 0A 32 2E 20 54 65 73 | wo three..2. Tes |
  1369. X| 74 20 6F 75 74 20 62 61 64 20 66 6F 6E 74 2E 0A | t out bad font.. |
  1370. X| 40 74 20 74 69 74 6C 65 20 73 6C 6F 74 68 66 6F | @t title slothfo |
  1371. X| 6E 74 20 6C 65 66 74 20 22 53 6C 6F 74 68 22 0A | nt left "Sloth". |
  1372. X| 0A 33 2E 20 54 65 73 74 20 6F 75 74 20 62 61 64 | .3. Test out bad |
  1373. X| 20 61 6C 69 67 6E 6D 65 6E 74 2E 0A 40 74 20 74 |  alignment..@t t |
  1374. X| 69 74 6C 65 20 74 69 74 6C 65 66 6F 6E 74 20 77 | itle titlefont w |
  1375. X| 65 73 74 77 61 72 64 20 22 53 6C 6F 74 68 22 0A | estward "Sloth". |
  1376. X| 0A 34 2E 20 54 65 73 74 20 6F 75 74 20 66 75 6E | .4. Test out fun |
  1377. X| 6E 79 20 73 74 72 69 6E 67 73 2E 0A 40 74 20 74 | ny strings..@t t |
  1378. X| 69 74 6C 65 20 74 69 74 6C 65 66 6F 6E 74 20 6C | itle titlefont l |
  1379. X| 65 66 74 20 22 0A 40 74 20 74 69 74 6C 65 20 74 | eft ".@t title t |
  1380. X| 69 74 6C 65 66 6F 6E 74 20 6C 65 66 74 20 22 22 | itlefont left "" |
  1381. X| 0A 40 21 20 4E 6F 74 65 3A 20 54 68 65 20 66 6F | .@! Note: The fo |
  1382. X| 6C 6C 6F 77 69 6E 67 2C 20 62 65 6C 69 65 76 65 | llowing, believe |
  1383. X| 20 69 74 20 6F 72 20 6E 6F 74 2C 20 69 73 20 61 |  it or not, is a |
  1384. X| 63 74 75 61 6C 6C 79 20 4C 45 47 41 4C 21 0A 40 | ctually LEGAL!.@ |
  1385. X| 74 20 74 69 74 6C 65 20 74 69 74 6C 65 66 6F 6E | t title titlefon |
  1386. X| 74 20 6C 65 66 74 20 22 73 6C 6F 74 68 22 73 6C | t left "sloth"sl |
  1387. X| 6F 74 68 22 0A 0A 35 2E 20 54 65 73 74 20 6F 75 | oth"..5. Test ou |
  1388. X| 74 20 61 6C 6C 20 63 6F 6D 62 69 6E 61 74 69 6F | t all combinatio |
  1389. X| 6E 73 20 6F 66 20 66 6F 6E 74 20 61 6E 64 20 61 | ns of font and a |
  1390. X| 6C 69 67 6E 6D 65 6E 74 2E 0A 40 74 20 74 69 74 | lignment..@t tit |
  1391. X| 6C 65 20 74 69 74 6C 65 66 6F 6E 74 20 20 20 20 | le titlefont     |
  1392. X| 20 20 6C 65 66 74 20 20 20 22 53 6C 6F 74 68 22 |   left   "Sloth" |
  1393. X| 0A 40 74 20 74 69 74 6C 65 20 74 69 74 6C 65 66 | .@t title titlef |
  1394. X| 6F 6E 74 20 20 20 20 20 20 63 65 6E 74 72 65 20 | ont      centre  |
  1395. X| 22 53 6C 6F 74 68 22 0A 40 74 20 74 69 74 6C 65 | "Sloth".@t title |
  1396. X| 20 74 69 74 6C 65 66 6F 6E 74 20 20 20 20 20 20 |  titlefont       |
  1397. X| 72 69 67 68 74 20 20 22 53 6C 6F 74 68 22 0A 40 | right  "Sloth".@ |
  1398. X| 74 20 74 69 74 6C 65 20 73 6D 61 6C 6C 74 69 74 | t title smalltit |
  1399. X| 6C 65 66 6F 6E 74 20 6C 65 66 74 20 20 20 22 53 | lefont left   "S |
  1400. X| 6C 6F 74 68 22 0A 40 74 20 74 69 74 6C 65 20 73 | loth".@t title s |
  1401. X| 6D 61 6C 6C 74 69 74 6C 65 66 6F 6E 74 20 63 65 | malltitlefont ce |
  1402. X| 6E 74 72 65 20 22 53 6C 6F 74 68 22 0A 40 74 20 | ntre "Sloth".@t  |
  1403. X| 74 69 74 6C 65 20 73 6D 61 6C 6C 74 69 74 6C 65 | title smalltitle |
  1404. X| 66 6F 6E 74 20 72 69 67 68 74 20 20 22 53 6C 6F | font right  "Slo |
  1405. X| 74 68 22 0A 40 74 20 74 69 74 6C 65 20 6E 6F 72 | th".@t title nor |
  1406. X| 6D 61 6C 66 6F 6E 74 20 20 20 20 20 6C 65 66 74 | malfont     left |
  1407. X| 20 20 20 22 53 6C 6F 74 68 22 0A 40 74 20 74 69 |    "Sloth".@t ti |
  1408. X| 74 6C 65 20 6E 6F 72 6D 61 6C 66 6F 6E 74 20 20 | tle normalfont   |
  1409. X| 20 20 20 63 65 6E 74 72 65 20 22 53 6C 6F 74 68 |    centre "Sloth |
  1410. X| 22 0A 40 74 20 74 69 74 6C 65 20 6E 6F 72 6D 61 | ".@t title norma |
  1411. X| 6C 66 6F 6E 74 20 20 20 20 20 72 69 67 68 74 20 | lfont     right  |
  1412. X| 20 22 53 6C 6F 74 68 22 0A 0A 36 2E 20 54 65 73 |  "Sloth"..6. Tes |
  1413. X| 74 20 6D 69 73 73 70 65 6C 6C 69 6E 67 20 6F 66 | t misspelling of |
  1414. X| 20 63 65 6E 74 72 65 20 28 52 6F 73 73 27 73 20 |  centre (Ross's  |
  1415. X| 72 65 76 65 6E 67 65 29 2E 0A 40 74 20 74 69 74 | revenge)..@t tit |
  1416. X| 6C 65 20 6E 6F 72 6D 61 6C 66 6F 6E 74 20 20 20 | le normalfont    |
  1417. X| 20 20 63 65 6E 74 65 72 20 22 53 6C 6F 74 68 22 |   center "Sloth" |
  1418. X| 0A                                              | .                |
  1419. X+-------------------------------------------------+------------------+
  1420. X
  1421. X
  1422. X=========================== Start of LINE LIST DUMP ============================
  1423. X
  1424. Globl Local| Text
  1425. X-----------+--------------------------------------------------------------------
  1426. X00001 00001| SC28: Test syntax checking of title typesetting directive.<010>
  1427. X00002 00002| <010>
  1428. X00003 00003| 1. Test less than four arguments (includes title).<010>
  1429. X00004 00004| Note: The title command pulls a hack treating the rest of the line after<010>
  1430. X00005 00005| two arguments as the string. So it can't detect an EXCESS of arguments!<010>
  1431. X00006 00006| @t title<010>
  1432. X00007 00007| @t title two<010>
  1433. X00008 00008| @t title two three<010>
  1434. X00009 00009| <010>
  1435. X00010 00010| 2. Test out bad font.<010>
  1436. X00011 00011| @t title slothfont left "Sloth"<010>
  1437. X00012 00012| <010>
  1438. X00013 00013| 3. Test out bad alignment.<010>
  1439. X00014 00014| @t title titlefont westward "Sloth"<010>
  1440. X00015 00015| <010>
  1441. X00016 00016| 4. Test out funny strings.<010>
  1442. X00017 00017| @t title titlefont left "<010>
  1443. X00018 00018| @t title titlefont left ""<010>
  1444. X00019 00019| @! Note: The following, believe it or not, is actually LEGAL!<010>
  1445. X00020 00020| @t title titlefont left "sloth"sloth"<010>
  1446. X00021 00021| <010>
  1447. X00022 00022| 5. Test out all combinations of font and alignment.<010>
  1448. X00023 00023| @t title titlefont      left   "Sloth"<010>
  1449. X00024 00024| @t title titlefont      centre "Sloth"<010>
  1450. X00025 00025| @t title titlefont      right  "Sloth"<010>
  1451. X00026 00026| @t title smalltitlefont left   "Sloth"<010>
  1452. X00027 00027| @t title smalltitlefont centre "Sloth"<010>
  1453. X00028 00028| @t title smalltitlefont right  "Sloth"<010>
  1454. X00029 00029| @t title normalfont     left   "Sloth"<010>
  1455. X00030 00030| @t title normalfont     centre "Sloth"<010>
  1456. X00031 00031| @t title normalfont     right  "Sloth"<010>
  1457. X00032 00032| <010>
  1458. X00033 00033| 6. Test misspelling of centre (Ross's revenge).<010>
  1459. X00034 00034| @t title normalfont     center "Sloth"<010>
  1460. X00035 00035| <End-Of-File><010>
  1461. X-----------+--------------------------------------------------------------------
  1462. Globl Local| Text
  1463. X
  1464. X============================ End of LINE LIST DUMP =============================
  1465. X
  1466. X
  1467. X=========================== Start of TOKEN LIST DUMP ===========================
  1468. X
  1469. Summary: There are 18 tokens in the token list.
  1470. X
  1471. Line[Column]: Token Description
  1472. X-------------------------------
  1473. X
  1474. X0001[01]: Text. Text scrap[Grey]="SC28: Test syntax checking of title typesetting directive.<010>
  1475. X<010>
  1476. X1. Test less than four arguments (includes title).<010>
  1477. Note: The title command pulls a hack treating the rest of the line after<010>
  1478. two arguments as the string. So it can't detect an EXCESS of arguments!<010>
  1479. X"
  1480. X0009[01]: Text. Text scrap[Grey]="<010>
  1481. X2. Test out bad font.<010>
  1482. X"
  1483. X0012[01]: Text. Text scrap[Grey]="<010>
  1484. X3. Test out bad alignment.<010>
  1485. X"
  1486. X0015[01]: Text. Text scrap[Grey]="<010>
  1487. X4. Test out funny strings.<010>
  1488. X"
  1489. X0018[01]: @t.. Title. Font=Title, Alignment=Left. Title text follows:
  1490. Text scrap[Grey]=""
  1491. X0020[01]: @t.. Title. Font=Title, Alignment=Left. Title text follows:
  1492. Text scrap[Grey]="sloth"sloth"
  1493. X0021[01]: Text. Text scrap[Grey]="<010>
  1494. X5. Test out all combinations of font and alignment.<010>
  1495. X"
  1496. X0023[01]: @t.. Title. Font=Title, Alignment=Left. Title text follows:
  1497. Text scrap[Grey]="Sloth"
  1498. X0024[01]: @t.. Title. Font=Title, Alignment=Centre. Title text follows:
  1499. Text scrap[Grey]="Sloth"
  1500. X0025[01]: @t.. Title. Font=Title, Alignment=Right. Title text follows:
  1501. Text scrap[Grey]="Sloth"
  1502. X0026[01]: @t.. Title. Font=Small Title, Alignment=Left. Title text follows:
  1503. Text scrap[Grey]="Sloth"
  1504. X0027[01]: @t.. Title. Font=Small Title, Alignment=Centre. Title text follows:
  1505. Text scrap[Grey]="Sloth"
  1506. X0028[01]: @t.. Title. Font=Small Title, Alignment=Right. Title text follows:
  1507. Text scrap[Grey]="Sloth"
  1508. X0029[01]: @t.. Title. Font=Normal, Alignment=Left. Title text follows:
  1509. Text scrap[Grey]="Sloth"
  1510. X0030[01]: @t.. Title. Font=Normal, Alignment=Centre. Title text follows:
  1511. Text scrap[Grey]="Sloth"
  1512. X0031[01]: @t.. Title. Font=Normal, Alignment=Right. Title text follows:
  1513. Text scrap[Grey]="Sloth"
  1514. X0032[01]: Text. Text scrap[Grey]="<010>
  1515. X6. Test misspelling of centre (Ross's revenge).<010>
  1516. X"
  1517. X0035[01]: End Of File. 
  1518. X============================ End of TOKEN LIST DUMP ============================
  1519. X
  1520. Macro table dump skipped (Parser was not invoked).
  1521. Document list dump skipped (Parser was not invoked).
  1522. X
  1523. Global Local| Input File
  1524. X------------+-------------------------------------------------------------------
  1525. X     1     1| SC28: Test syntax checking of title typesetting directive.
  1526. X     2     2| 
  1527. X     3     3| 1. Test less than four arguments (includes title).
  1528. X     4     4| Note: The title command pulls a hack treating the rest of the line after
  1529. X     5     5| two arguments as the string. So it can't detect an EXCESS of arguments!
  1530. X     6     6| @t title
  1531. X       Error|.^This directive has too few arguments.
  1532. X            |.^The correct format is: "@t title <font> <align> <text>".
  1533. X            |.^   where <font>  = titlefont | smalltitlefont | normalfont.
  1534. X            |.^   and   <align> = left | centre | right.
  1535. X            |.^   and   <text>  = text delimited by double quotes.
  1536. X            |.^Directive ignored.
  1537. X     7     7| @t title two
  1538. X       Error|.^This directive has too few arguments.
  1539. X            |.^The correct format is: "@t title <font> <align> <text>".
  1540. X            |.^   where <font>  = titlefont | smalltitlefont | normalfont.
  1541. X            |.^   and   <align> = left | centre | right.
  1542. X            |.^   and   <text>  = text delimited by double quotes.
  1543. X            |.^Directive ignored.
  1544. X     8     8| @t title two three
  1545. X       Error|.^This directive has too few arguments.
  1546. X            |.^The correct format is: "@t title <font> <align> <text>".
  1547. X            |.^   where <font>  = titlefont | smalltitlefont | normalfont.
  1548. X            |.^   and   <align> = left | centre | right.
  1549. X            |.^   and   <text>  = text delimited by double quotes.
  1550. X            |.^Directive ignored.
  1551. X     9     9| 
  1552. X    10    10| 2. Test out bad font.
  1553. X    11    11| @t title slothfont left "Sloth"
  1554. X       Error|..........^Expecting one of {titlefont,smalltitlefont,normalfont}.
  1555. X            |..........^Directive ignored.
  1556. X    12    12| 
  1557. X    13    13| 3. Test out bad alignment.
  1558. X    14    14| @t title titlefont westward "Sloth"
  1559. X       Error|....................^Expecting one of {left,right,centre}.
  1560. X            |....................^Directive ignored.
  1561. X    15    15| 
  1562. X    16    16| 4. Test out funny strings.
  1563. X    17    17| @t title titlefont left "
  1564. X       Error|.........................^Text argument must be delimited by double quotes.
  1565. X            |.........................^Directive ignored.
  1566. X    18    18| @t title titlefont left ""
  1567. X    19    19| @! Note: The following, believe it or not, is actually LEGAL!
  1568. X    20    20| @t title titlefont left "sloth"sloth"
  1569. X    21    21| 
  1570. X    22    22| 5. Test out all combinations of font and alignment.
  1571. X    23    23| @t title titlefont      left   "Sloth"
  1572. X    24    24| @t title titlefont      centre "Sloth"
  1573. X    25    25| @t title titlefont      right  "Sloth"
  1574. X    26    26| @t title smalltitlefont left   "Sloth"
  1575. X    27    27| @t title smalltitlefont centre "Sloth"
  1576. X    28    28| @t title smalltitlefont right  "Sloth"
  1577. X    29    29| @t title normalfont     left   "Sloth"
  1578. X    30    30| @t title normalfont     centre "Sloth"
  1579. X    31    31| @t title normalfont     right  "Sloth"
  1580. X    32    32| 
  1581. X    33    33| 6. Test misspelling of centre (Ross's revenge).
  1582. X    34    34| @t title normalfont     center "Sloth"
  1583. X       Error|.........................^Expecting one of {left,right,centre}.
  1584. X            |.........................^Note: Centre is spelt centRE, not centER.
  1585. X            |.........................^      This is my revenge for years of getting error messages
  1586. X            |.........................^      from TeX whenever I accidentally wrote \centreline - Ross Williams.
  1587. X            |.........................^Directive ignored.
  1588. X            | <End-Of-File>
  1589. X------------+-------------------------------------------------------------------
  1590. X
  1591. There were 7 Errors.
  1592. END_OF_FILE
  1593. if test 13334 -ne `wc -c <'answers/sc28.lis'`; then
  1594.     echo shar: \"'answers/sc28.lis'\" unpacked with wrong size!
  1595. fi
  1596. # end of 'answers/sc28.lis'
  1597. fi
  1598. if test -f 'answers/wv01.tex' -a "${1}" != "-c" ; then 
  1599.   echo shar: Will not clobber existing file \"'answers/wv01.tex'\"
  1600. else
  1601. echo shar: Extracting \"'answers/wv01.tex'\" \(15563 characters\)
  1602. sed "s/^X//" >'answers/wv01.tex' <<'END_OF_FILE'
  1603. X
  1604. X%*******************************************************************************
  1605. X%*                    START OF AUTOMATICALLY GENERATED TEX FILE                *
  1606. X%*******************************************************************************
  1607. X%*                                                                             *
  1608. X%* This TeX file was automatically generated by the FunnelWeb preprocessor.    *
  1609. X%* You can typeset this file to produce printed documentation by running it    *
  1610. X%* through the TeX typesetter using a command such as:                         *
  1611. X%*    tex thisfilename                                                         *
  1612. X%* The resultant file thisfilename.dvi can be printed using a command such as: *
  1613. X%*    lpr -Pcslw -d thisfilename.dvi                                           *
  1614. X%*                                                                             *
  1615. X%* FunnelWeb is a preprocessor that allows programmers to weave programs and   *
  1616. X%* their documentation together in a single document. The FunnelWeb program    *
  1617. X%* analyses such documents producing both program files and typeset            *
  1618. X%* documentation such as this TeX file.                                        *
  1619. X%* FunnelWeb was created by Ross Williams.                                     *
  1620. X%*                                                                             *
  1621. X%* For more information on FunnelWeb look in the following FTP archive:        *
  1622. X%*    Machine  : sirius.itd.adelaide.edu.au [IP=129.127.40.3].                 *
  1623. X%*    Directory: ~pub/funnelweb/                                               *
  1624. X%*               (or some other appropriately named directory).                *
  1625. X%* or email Ross Williams at ross@spam.adelaide.edu.au                         *
  1626. X%*                                                                             *
  1627. X%*******************************************************************************
  1628. X
  1629. X
  1630. X%===================== Start of FunnelWeb TeX Definitions ======================
  1631. X
  1632. X
  1633. X% Version
  1634. X% -------
  1635. X% This is FunnelWeb TeX Macro Library Version 1.0.
  1636. X
  1637. X
  1638. X% Copyright
  1639. X% ---------
  1640. X% This set of FunnelWeb TeX definitions was written by Ross Williams and was
  1641. X% originally Copyright (C) 1992 Ross N. Williams.  However, I, Ross Williams,
  1642. X% hereby forego any claim to Copyright in this set of FunnelWeb TeX definitions
  1643. X% and hereby authorize that the set of TeX definitions pass into the public
  1644. X% domain. -- Ross N. Williams, 3:41pm 07-May-1992, Adelaide, Australia.
  1645. X
  1646. X
  1647. X% Modification
  1648. X% ------------
  1649. X% Please record all modifications to these TeX definitions here. Unless
  1650. X% otherwise specified, all modified definitions fall in the public domain too.
  1651. X%
  1652. X% Programmers:
  1653. X%    RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  1654. X%
  1655. X% Changes:
  1656. X%    07-May-1992  RNW  Prepared this work for public domain release.
  1657. X%
  1658. X
  1659. X
  1660. X% General Comments
  1661. X% ----------------
  1662. X% This set of TeX definitions exists for two reasons:
  1663. X%
  1664. X%    1. To shorten and neaten the FunnelWeb TeX output.
  1665. X%    2. To allow users to fiddle with the output format in their input files
  1666. X%       (by inserting redefining "\def"s) without having to resort to
  1667. X%       modifying the FunnelWeb code.
  1668. X%
  1669. X% The user is warned that these definitions may be changed from time to time
  1670. X% (but probably not much). The user should not be too sneaky. In particular,
  1671. X% users wishing to redefine some of these macros should do so in an explicitly
  1672. X% defined section at the top of their input file. This will mean that in the
  1673. X% event of problems, that section can simply be deleted or commented out to
  1674. X% allow the document to at least be typeset in the default format. Users should
  1675. X% limit themselves to redefining these macros in such a section and should
  1676. X% refrain from using the macros throughout their documents.
  1677. X
  1678. X
  1679. X% Environment Parameters
  1680. X% ----------------------
  1681. X% \tolerance tells TeX how tolerant it should be about making bad line and
  1682. X% page breaks. Here we set it to it's maximum, as
  1683. X%   1) Computer programs are likely to cause lots of bad breaks.
  1684. X%   2) In most cases the user would probably rather get the TeX file through
  1685. X%      TeX without any errors than fiddle with spacings for perfection.
  1686. X\tolerance=10000
  1687. X
  1688. X% I don't like indentation as it makes the page look more busy. Instead,
  1689. X% paragraphs are separated by a little space (see next).
  1690. X\parindent=0pt
  1691. X
  1692. X% In many cases, users will produce documents with long runs of paragraphs.
  1693. X% In order to space out these paragraphs, it is convenient to maintain a
  1694. X% prevailing non-zero \parskip (end-of-paragaph skip). The only trouble is
  1695. X% that the skip becomes a problem in macro definitions which require no skip
  1696. X% and so we have to turn the skip on and off. The following two macros
  1697. X% simplify this process.
  1698. X\def\fwparskipon{\parskip=\medskipamount}
  1699. X\def\fwparskipoff{\parskip=0pt}
  1700. X\fwparskipon
  1701. X
  1702. X% Setting raggedbottom allows TeX to leave a bit of space at the bottom of the
  1703. X% page in order to better vertically align the rest of the page (e.g. skips
  1704. X% won't stretch as much). It also means that headings are less likely to be
  1705. X% isolated at the bottom of the page without any following text.
  1706. X\raggedbottom
  1707. X
  1708. X
  1709. X% Fonts
  1710. X% -----
  1711. X% Most of the typeset output is set in 10pt roman and 10pt tt font.
  1712. X% The major extra font needs spring from titles and headings.
  1713. X% For portability's sake we use only the following fonts:
  1714. X%    cmr10
  1715. X%    cmbx10
  1716. X%    cmtt10
  1717. X% and some enlargements of them. These fonts are all "standard" fonts
  1718. X% in Plain TeX. See The TeXbook p.350.
  1719. X\font\fwfontnote=cmr7
  1720. X
  1721. X\font\fwfontnorm=cmr10
  1722. X\font\fwfontnorma=cmr10 scaled \magstep1
  1723. X\font\fwfontnormb=cmr10 scaled \magstep2
  1724. X
  1725. X\font\fwfontbold=cmbx10
  1726. X\font\fwfontbolda=cmbx10 scaled \magstep1
  1727. X\font\fwfontboldb=cmbx10 scaled \magstep2
  1728. X\font\fwfontboldc=cmbx10 scaled \magstep3
  1729. X\font\fwfontboldd=cmbx10 scaled \magstep4
  1730. X
  1731. X
  1732. X% Macros for Stylistic Details
  1733. X% ----------------------------
  1734. X% This section contains all the fiddly little macros for setting the details
  1735. X% of each macro definition.
  1736. X
  1737. X% Macro definitions are sandwiched by calls to these macros which can be used
  1738. X% to sort out the spacing before and after the macro definition.
  1739. X\def\fwbeginmacro{\fwparskipoff\bigskip}
  1740. X\def\fwendmacro{\fwparskipon\par}
  1741. X
  1742. X% These macros deal with the macro name and definition line.
  1743. X\def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$}
  1744. X\def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$}
  1745. X\def\fwzero#1{{\bf Z}}
  1746. X\def\fwmany#1{{\bf M}}
  1747. X\def\fwequals{ $\equiv$}
  1748. X\def\fwplusequals{ $+\equiv$}
  1749. X
  1750. X% Now for the actual body of the definition. It looks nice to have the tt
  1751. X% code indented a little. Again, we use macros instead of writing direct TeX,
  1752. X% so as to allow the user to fiddle this stuff to taste without having to
  1753. X% modify the FunnelWeb C code.
  1754. X\def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt}
  1755. X\def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt}
  1756. X\def\fwoquote{`}
  1757. X\def\fwcquote{'}
  1758. X\def\fwoparen{$($}
  1759. X\def\fwcomma{$,$}
  1760. X\def\fwcparen{$)$}
  1761. X\def\fwparam#1{$\diamond #1$}
  1762. X\def\fwparams#1{$(\diamond #1)$}
  1763. X
  1764. X% These macros deal with the notes that are appended at the end of each
  1765. X% macro definition. Note that even though \fwisafile,\fwusedin, and \fwseealso
  1766. X% have the same definition, they are given different names so as to allow the
  1767. X% user to redefine these macros to typeset each kind of information differently
  1768. X% if desired.
  1769. X\def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip}
  1770. X\def\fwnote#1{{\fwfontnote #1}\par}
  1771. X\def\fwisafile#1{\fwnote{#1}}
  1772. X\def\fwusedin#1{\fwnote{#1}}
  1773. X\def\fwseealso#1{\fwnote{#1}}
  1774. X\def\fwendmacronotes{\endgroup}
  1775. X
  1776. X
  1777. X% Macros to Typeset Program Code Verbatim
  1778. X% ---------------------------------------
  1779. X% This is by far the hairiest and most difficult part of the typesetting task
  1780. X% because we have to turn off most of TeX's natural instincts in order to
  1781. X% typeset the program text exactly as it appears in the input file.
  1782. X% Two macros are defined to pull this off: \fwbtx and \fwverbatimgobble.
  1783. X% Their code was inspired by the following sections of "The TeXbook":
  1784. X%    Appendix D: Dirty Tricks, 3.Verbatim listing, p.380-382.
  1785. X%    Appendix E: Example Formats, p.421.
  1786. X% The \fwbtx[ (for "FunnelWeb Begin TeXt") macro does most of the hard work.
  1787. X% The liberal use of "%" is because I don't understand TeX well enough to
  1788. X% understand when an end of line will cause trouble, and I am playing it safe.
  1789. X
  1790. X% Before defining the main \fwbtx macro, we have to stash away some definitions
  1791. X% in the hidden part of TeX's environment. Let's hope that these "hidden"
  1792. X% definitions don't affect anything except what is desired to be affected.
  1793. X
  1794. X% The tt font in which we wish to set the text has two Latin lurking ligatures!
  1795. X% These are ?` and !`. To disable them, we define the left quote when ACTIVE
  1796. X% to be defined in such a way as to prevent ligatures. The main TeX text will
  1797. X% normally not be exposed to this definition because normally the leftquote
  1798. X% character is not active. The \fwbtx macro temporarily makes the left quote
  1799. X% character active thus activating the deactivation of left quote ligatures.
  1800. X% See The TeXbook p.381.
  1801. X{\catcode`\`=\active \gdef`{\relax\lq}}
  1802. X
  1803. X% TeX is fairly carefree about spaces and so we have to make it more serious.
  1804. X% To do so we pull the same trick as above, setting up a definition for active
  1805. X% space, but only making space active during the span of the verbatim text.
  1806. X% In Plain TeX the active space is defined to be simply a space, but here we
  1807. X% define it to be a control space. This ensures that the space cannot
  1808. X% be gobbled up by one of TeX's mysterious mechanisms when activated.
  1809. X% See The TeXbook, p.381 and p.352.
  1810. X{\obeyspaces\global\let =\ }
  1811. X
  1812. X% Here is the main \fwbtx verbatim text macro.
  1813. X% Note: The order in which all these pieces of business have to be done is
  1814. X% still a partial mystery to me. Don't fiddle with this stuff unless you
  1815. X% think you know what you are doing.
  1816. X\def\fwbtx[{%
  1817. X%
  1818. X% The funnies involved in getting verbatim output are safely housed inside
  1819. X% this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used
  1820. X% instead of curly braces because we have to be able to signal the end of
  1821. X% this macro with a curly brace.
  1822. X\begingroup%
  1823. X%
  1824. X% \pars at the end of empty lines in the verbatim text won't come out normally
  1825. X% because TeX is in vertical mode and they get gobbled up. To prevent this,
  1826. X% we force \par to exit vertical mode first. See The TeXbook p.381.
  1827. X\def\par{\leavevmode\endgraf}%
  1828. X%
  1829. X% Activate the leftquote character so as to avoid ligatures (see above).
  1830. X\catcode`\`=\active%
  1831. X%
  1832. X% The \obeylines macro simply defines end of line (^M) to be \par. This ensures
  1833. X% that TeX will treat each verbatim line as a new paragraph.
  1834. X\obeylines%
  1835. X%
  1836. X% To get verbatim output, we have to desex all the special characters. This
  1837. X% is explained in detail in The TeXbook p.380.
  1838. X\def\do##1{\catcode`##1=12 }\dospecials%
  1839. X%
  1840. X% Activate the space character so as to make TeX treat blanks seriously.
  1841. X% This activation invokes an eralier definition (see above).
  1842. X\obeyspaces
  1843. X%
  1844. X% Interparagraph skips do not help the cause.
  1845. X% Note: We have to preserve the indentation though, as the code is actually
  1846. X% indented in the final output. See \fwodef in an earlier section.
  1847. X\parskip=0pt%
  1848. X%
  1849. X% We typeset the verbatim text in tt font (courier on the Macintosh) for a
  1850. X% number of reasons:
  1851. X%    - tt font has the same horizontal spacing for each character.
  1852. X%    - tt font covers the ASCII character set.
  1853. X%    - tt font doesn't have many surprises (e.g. ligatures).
  1854. X%    - tt font looks much what you might see on a computer terminal screen.
  1855. X\tt%
  1856. X%
  1857. X% Having set up an environment for verbatim, we are ready to use it.
  1858. X% By invoking \fwverbatimgobble, this \fwbtx macro gobbles up text verbatim (as
  1859. X% part of the parameter of \fwverbatimgobble) until it sees the termination
  1860. X% string "]fwetx=" (the "=" was thrown in to add obscurity as this sequence
  1861. X% must never occur in the verbatim text).
  1862. X\fwverbatimgobble}
  1863. X
  1864. X% The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text.
  1865. X\def\fwverbatimgobble#1]fwetx={#1\endgroup}
  1866. X
  1867. X
  1868. X% Table of Contents
  1869. X% -----------------
  1870. X% The five levels of table of contents that FunnelWeb supports are identified
  1871. X% by the five letters [A..E]. These are used throughout the following macros.
  1872. X
  1873. X% The following macros are utilities to the TOC macros to follow.
  1874. X\def\fwrule{\medskip\hrule\medskip}
  1875. X\def\fwqh{\hskip1.5em\relax}
  1876. X\def\fwbeforesec{\penalty-200\bigskip\medskip\par}
  1877. X
  1878. X% The following macros are used to typeset the table of contents.
  1879. X\def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule}
  1880. X\def\fwtoca#1#2{\leftline{{\bf #1 #2}}}
  1881. X\def\fwtocb#1#2{\leftline{\fwqh #1 #2}}
  1882. X\def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}}
  1883. X\def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}}
  1884. X\def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}}
  1885. X\def\fwtocfinish#1{\fwrule}
  1886. X
  1887. X% The following "library" macros define five different strengths of headings
  1888. X% which can be used later in the section macros.
  1889. X\def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip}
  1890. X\def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip}
  1891. X\def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip}
  1892. X\def\fwlibd#1#2{\fwbeforesec{\bf          #1 #2}\penalty200}
  1893. X\def\fwlibe#1#2{\fwbeforesec{\bf          #1 #2}}
  1894. X
  1895. X% Here are the macros that actually typeset the section headings throughout
  1896. X% the document. The fwlib system has been employed so as to easily allow the
  1897. X% user to redefine the strengths of headings to taste. For example, the
  1898. X% user could insert in the input document a similar set of definitions to these
  1899. X% but with the b..e headings set to \fwlibc. This would tone down the output.
  1900. X\def\fwseca#1#2{\fwliba{#1}{#2}}
  1901. X\def\fwsecb#1#2{\fwlibb{#1}{#2}}
  1902. X\def\fwsecc#1#2{\fwlibc{#1}{#2}}
  1903. X\def\fwsecd#1#2{\fwlibd{#1}{#2}}
  1904. X\def\fwsece#1#2{\fwlibe{#1}{#2}}
  1905. X
  1906. X
  1907. X% Support for Explicit Typesetting
  1908. X% --------------------------------
  1909. X% FunnelWeb supports pragmas and other constructs that allow
  1910. X% typesetter-independent typesetting commands to be given. The
  1911. X% following macros support these features.
  1912. X
  1913. X% The in-text literal @{sloth@} and emphasise @[walrus@] features.
  1914. X\def\fwlit#1{{\tt #1}}
  1915. X\def\fwemp#1{{\it #1}}
  1916. X
  1917. X% The "@p new_page" pragma.
  1918. X\def\fwnewpage{\vfill\eject}
  1919. X
  1920. X% The "@p vskip Nmm" pragma.
  1921. X\def\fwvskip#1{\null\vskip #1mm}
  1922. X
  1923. X% The "@p title <font> <align> <text>" pragma.
  1924. X\def\fwfontnormal#1{{\fwfontnorm {#1}}}
  1925. X\def\fwfonttitle#1{{\fwfontboldd {#1}}}
  1926. X\def\fwfontsmalltitle#1{{\fwfontboldb {#1}}}
  1927. X\def\fwleftline#1{\leftline{#1}}
  1928. X\def\fwcenterline#1{\centerline{#1}}
  1929. X\def\fwrightline#1{\rightline{#1}}
  1930. X
  1931. X
  1932. X% Support for Old FunnelWeb
  1933. X% -------------------------
  1934. X% The following macros were used extensively in the first version of
  1935. X% FunnelWeb and are retained so that these older input files will still
  1936. X% typeset cleanly.
  1937. X\def\p#1{{\tt #1}}  % P for Program text.
  1938. X\def\flagpage#1#2{
  1939. X   \null
  1940. X   \vfill
  1941. X   \centerline{\fwfontboldd #1}
  1942. X   \vskip 1cm
  1943. X   \centerline{\fwfontboldd #2}
  1944. X   \vfill
  1945. X   \null
  1946. X   \vfill
  1947. X}
  1948. X
  1949. X%====================== End of FunnelWeb TeX Definitions =======================
  1950. WV01: Test basic typeset file output mechanism.
  1951. X
  1952. X\fwseca{1}{A section for no particular reason}
  1953. X
  1954. X\fwbeginmacro
  1955. X\fwfilename{wv01.out}{1}\fwequals \fwodef \fwbtx[Some text for no particular reason.
  1956. X]fwetx=%
  1957. X\fwcdef 
  1958. X\fwbeginmacronotes
  1959. X\fwisafile{This macro is attached to an output file.}
  1960. X\fwendmacronotes
  1961. X\fwendmacro
  1962. X
  1963. X\bye
  1964. X
  1965. X
  1966. X%*******************************************************************************
  1967. X%*                    END OF AUTOMATICALLY GENERATED TEX FILE                  *
  1968. X%*******************************************************************************
  1969. X
  1970. END_OF_FILE
  1971. if test 15563 -ne `wc -c <'answers/wv01.tex'`; then
  1972.     echo shar: \"'answers/wv01.tex'\" unpacked with wrong size!
  1973. fi
  1974. # end of 'answers/wv01.tex'
  1975. fi
  1976. if test -f 'sources/machin.h' -a "${1}" != "-c" ; then 
  1977.   echo shar: Will not clobber existing file \"'sources/machin.h'\"
  1978. else
  1979. echo shar: Extracting \"'sources/machin.h'\" \(14389 characters\)
  1980. sed "s/^X//" >'sources/machin.h' <<'END_OF_FILE'
  1981. X/*##############################################################################
  1982. X
  1983. XFUNNNELWEB COPYRIGHT
  1984. X====================
  1985. XFunnelWeb is a literate-programming macro preprocessor.
  1986. X
  1987. Copyright (C) 1992 Ross N. Williams.
  1988. X
  1989. X   Ross N. Williams
  1990. X   ross@spam.adelaide.edu.au
  1991. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  1992. X
  1993. This program is free software; you can redistribute it and/or modify
  1994. it under the terms of Version 2 of the GNU General Public License as
  1995. published by the Free Software Foundation.
  1996. X
  1997. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  1998. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1999. See Version 2 of the GNU General Public License for more details.
  2000. X
  2001. You should have received a copy of Version 2 of the GNU General Public
  2002. License along with this program. If not, you can FTP the license from
  2003. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  2004. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2005. X
  2006. Section 2a of the license requires that all changes to this file be
  2007. recorded prominently in this file. Please record all changes here.
  2008. X
  2009. Programmers:
  2010. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  2011. X
  2012. Changes:
  2013. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  2014. X
  2015. X##############################################################################*/
  2016. X
  2017. X
  2018. X/******************************************************************************/
  2019. X/*                                    MACHIN.H                                */
  2020. X/******************************************************************************/
  2021. X/*                                                                            */
  2022. X/* WARNING: DO NOT ADD ANY PROGRAM DEPENDENT DEFINITIONS.                     */
  2023. X/*                                                                            */
  2024. X/* This module (machin.h and machin.c) contains definitions and objects       */
  2025. X/* whose values depends directly on the compilation and execution             */
  2026. X/* environment, but are otherwise independent from any particular computer    */
  2027. X/* program.                                                                   */
  2028. X/*                                                                            */
  2029. X/* The only difference between the purpose of this module and the "environ"   */
  2030. X/* module is that the "environ" module contains the "essentials" whereas this */
  2031. X/* module contains extra machine specific definitions and objects that will   */
  2032. X/* not be required by most user modules.                                      */
  2033. X/*                                                                            */
  2034. X/******************************************************************************/
  2035. X
  2036. X/* Ensure that the body of this header file is included at most once.         */
  2037. X#ifndef DONE_FWMACHIN
  2038. X#define DONE_FWMACHIN
  2039. X
  2040. X/******************************************************************************/
  2041. X
  2042. X#include <time.h>
  2043. X#include "style.h"
  2044. X
  2045. X/******************************************************************************/
  2046. X
  2047. X/* Machine Alignment Constraints                                              */
  2048. X/* -----------------------------                                              */
  2049. X/* Some machines require that objects of particular lengths be aligned in     */
  2050. X/* memory. For example, the 68000 will trap any attempt to access a word      */
  2051. X/* (16 bits or an int in THINK C) at an odd address. It is important that C   */
  2052. X/* programs that deal with memory at a low level be aware of such             */
  2053. X/* constraints. As the constraints are always at a power of two, we defined   */
  2054. X/* ALIGN_POWER to be the minimum power of two at which it is both safe and    */
  2055. X/* efficient to operate.                                                      */
  2056. X
  2057. X/* The Macintosh requires words and longs to be aligned on word boundaries.   */
  2058. X/* The PC is not fussy about alignment, but operates more efficiently at word */
  2059. X/* boundaries.                                                                */
  2060. X#if MAC | PC
  2061. X#define ALIGN_POWER (1L)
  2062. X#endif
  2063. X
  2064. X/* The Sun requires objects to be aligned on longword boundaries (=2^2).      */
  2065. X/* The VMS VAX doesn't care about alignment, but operates more efficiently on */
  2066. X/* longword boundaries.                                                       */
  2067. X#if SUN | VMS
  2068. X#define ALIGN_POWER (2L)
  2069. X#endif
  2070. X
  2071. X/******************************************************************************/
  2072. X
  2073. X/* Filenames                                                                  */
  2074. X/* ---------                                                                  */
  2075. X/* The length and structure of filenames varies from machine to machine. The  */
  2076. X/* differences addressed here are:                                            */
  2077. X/*    1) The character used to separate directory specs from filenames.       */
  2078. X/*    2) The maximum length of a filename.                                    */
  2079. X
  2080. X/* FN_DELIM must contain the character that separates directory specs from    */
  2081. X/* filenames. Notice that in the VMS case, it is "]", not "."                 */
  2082. X
  2083. X#if MAC
  2084. X#define FN_DELIM ':'
  2085. X#endif
  2086. X
  2087. X#if SUN
  2088. X#define FN_DELIM '/'
  2089. X#endif
  2090. X
  2091. X#if VAX
  2092. X#define FN_DELIM ']'
  2093. X#endif
  2094. X
  2095. X#if PC
  2096. X#define FN_DELIM '\\'
  2097. X#endif
  2098. X
  2099. X/* The rest of this section shouldn't have to be changed, unless you          */
  2100. X/* encounter a funny with your system's definition of FILENAME_MAX.           */
  2101. X
  2102. X/* FILENAME_MAX tells the maximum number of characters allowed in a filename  */
  2103. X/* on the target machine. This symbol is supposed to be defined in stdio.h    */
  2104. X/* (ANSI S7.9.1) so we don't want to override that. However, if it isn't, we  */
  2105. X/* need to define a safe default length.                                      */
  2106. X#ifndef FILENAME_MAX
  2107. X#define FILENAME_MAX 300
  2108. X#endif
  2109. X
  2110. X/* Some VAX compilers define FILENAME_MAX to be 39, which is the maximum      */
  2111. X/* length of the NAME part of a VMS filename. This is not appropriate, so we  */
  2112. X/* override it.                                                               */
  2113. X#if VMS
  2114. X#undef FILENAME_MAX
  2115. X#define FILENAME_MAX 255        /* Should really be NAM$C_MAXRSS              */
  2116. X#endif
  2117. X
  2118. X/* Now we can use the constant to define a filename type.                     */
  2119. X/* Note: For a while I defined "typedef fn_t *p_fn_t". However, this is a     */
  2120. X/* pointer to an array rather than (char *) and it caused no end of problems. */
  2121. typedef char fn_t[FILENAME_MAX+1];
  2122. typedef char *p_fn_t;
  2123. X
  2124. X/******************************************************************************/
  2125. X
  2126. X/* Command Lines                                                              */
  2127. X/* -------------                                                              */
  2128. X/* The maximum length of command line varies from machine to machine and we   */
  2129. X/* define symbols to reflect this. The reason why we don't just set this to a */
  2130. X/* high value and forget about it is that FunnelWeb sometimes places          */
  2131. X/* command line variables on the stack, and some machines (e.g. MAC under     */
  2132. X/* THINK-C don't provide much stack space. So we have to minimize this        */
  2133. X/* variable on those machines.                                                */
  2134. X
  2135. X/* We choose a small maximum command line on the Macintosh so as to avoid     */
  2136. X/* chewing up stack space when command lines have to be pushed.               */
  2137. X#if MAC
  2138. X#define COMLINE_MAX 300
  2139. X#endif
  2140. X
  2141. X/* On the Sun, 1024 is a normal command line and 2048 is safe. */
  2142. X#if SUN
  2143. X#define COMLINE_MAX 2048
  2144. X#endif
  2145. X
  2146. X/* On the VMS, 1024 is usually adequate. */
  2147. X#if VMS
  2148. X#define COMLINE_MAX 1024
  2149. X#endif
  2150. X
  2151. X/* On a PC, we assume this is enough. */
  2152. X#if PC
  2153. X#define COMLINE_MAX 300
  2154. X#endif
  2155. X
  2156. X/* Make sure that the value is not too low. */
  2157. X/* The value 300 is guaranteed by the command interpreter. */
  2158. X#if COMLINE_MAX < 300
  2159. X   #error COMLINE_MAX must be at least 300.
  2160. X#endif
  2161. X
  2162. X/* Now define a type for command lines.                                       */
  2163. X/* Note: For a while I defined "typedef cl_t *p_cl_t". However, this is a     */
  2164. X/* pointer to an array rather than (char *) and it caused no end of problems. */
  2165. typedef char cl_t[COMLINE_MAX+1];
  2166. typedef char *p_cl_t;
  2167. X
  2168. X/******************************************************************************/
  2169. X
  2170. X/* Line Termination                                                           */
  2171. X/* ----------------                                                           */
  2172. X
  2173. X/* FunnelWeb has special-case code to make reading input files faster on      */
  2174. X/* machines where the format of text files corresponds to the internal C      */
  2175. X/* text stream model. The UNIX_EOL #define should be activated if and only    */
  2176. X/* the host environment has text files consisting of a stream of bytes with   */
  2177. X/* a single LF (ASCII,decimal-10,hex-0A) character being used to terminate    */
  2178. X/* each line, and no special character to indicate end of file.               */
  2179. X/* This is the same format as is used in the Unix operating system.           */
  2180. X/* If you are in doubt about this, play it safe and define your environment   */
  2181. X/* to be non-Unix, as non-Unix will work on ALL systems (including Unix).     */
  2182. X
  2183. X#if MAC | VMS | PC
  2184. X/* These systems do NOT use Unix EOLs. */
  2185. X#define UNIX_EOL 0
  2186. X#endif
  2187. X
  2188. X#if SUN
  2189. X/* This should really be 1 on a SUN, but I haven't got around to debugging    */
  2190. X/* FunnelWeb with UNIX_EOL==1.                                                */
  2191. X#define UNIX_EOL 0
  2192. X#endif
  2193. X
  2194. X/******************************************************************************/
  2195. X
  2196. X/* MIssing Prototypes                                                         */
  2197. X/* ----------------                                                           */
  2198. X/* Compilers that are fussy about prototypes sometimes complain about calls   */
  2199. X/* to the standard libraries. These declarations solve this problem.          */
  2200. X
  2201. X#if SUN
  2202. int     fclose  P_((FILE *stream));
  2203. int     fputs   P_((const char *s, FILE *stream));
  2204. int     fputc   P_((int c, FILE *stream));
  2205. int     fflush  P_((FILE *stream));
  2206. int     remove  P_((const char *filename));
  2207. int     rename  P_((const char *oldname, const char *newname));
  2208. int     toupper P_((int));
  2209. int     sscanf  P_(());
  2210. int     fprintf P_(());
  2211. int     _filbuf P_(());
  2212. void    *memcpy P_((void *s1, void *s2, size_t n));
  2213. void    *memset P_((void *s,     int c, size_t n));
  2214. int     memcmp  P_((void *s1, void *s2, size_t n));
  2215. size_t  fread   P_((void *ptr, size_t size, size_t nobj, FILE *stream));
  2216. size_t  fwrite  P_((const void *ptr, size_t size, size_t nobj, FILE *stream));
  2217. clock_t clock   P_((void));
  2218. time_t  time    P_((time_t *tp));
  2219. int     printf  P_(());
  2220. X#endif
  2221. X
  2222. X/******************************************************************************/
  2223. X
  2224. XEXPORT void fn_ins P_((p_fn_t,char *));
  2225. X/* - The name stands for FileName INSert.                                     */
  2226. X/* - The first argument must be a pointer to an object of type fn_t           */
  2227. X/*   (containing an ordinary C character string).                             */
  2228. X/* - The second argument must be a pointer to an ordinary C character string. */
  2229. X/* - Both arguments must contain a full, partial, or empty filename spec.     */
  2230. X/* - We will refer to the arguments as f1 and f2.                             */
  2231. X/* - If there is a syntax error in either spec, fn_ins does nothing.          */
  2232. X/* - Otherwise, it:                                                           */
  2233. X/*      1. Analyses the two filename specifications into filename field .     */
  2234. X/*      2. Replaces each field in f1 by the corresponding field in f2, but    */
  2235. X/*         only if the corresponding field in f2 is non-empty.                */
  2236. X/*      3. Optionally [concession to VMS] it may then replace blank fields    */
  2237. X/*         in the resulting file spec in f1 by fields from the current        */
  2238. X/*         global "default" directory spec.                                   */
  2239. X/* The structure and fields of filenames will vary from machine to machine    */
  2240. X/* and so this is not important. However, every implementation must structure */
  2241. X/* the filename so that it will at least RECOGNISE a file extension           */
  2242. X/* (e.g. ".lis") field.                                                       */
  2243. X
  2244. X/******************************************************************************/
  2245. X
  2246. XEXPORT void getcline P_((int,char **,char *));
  2247. X/* Operating system environments vary a lot in the way in which their command */
  2248. X/* language interfaces are set up. The approach taken in FunnelWeb is to      */
  2249. X/* define a "standard" Unix-like command line syntax and then insist that     */
  2250. X/* other environments deliver such a command line as a single string.         */
  2251. X/* This function getcline must extract such a standard command line from its  */
  2252. X/* environment and copy it as a single string of not more than COMLINE_MAX    */
  2253. X/* characters into its third argument. A description of the "standard"        */
  2254. X/* command line can be found in the options package.                          */
  2255. X/* The first  argument is given to getcline and is argc from main().          */
  2256. X/* The second argument is given to getcline and is argv from main().          */
  2257. X/* These two arguments are given in case getcline needs them to assemble the  */
  2258. X/* command line (as opposed to calling e.g. VMS CLI routines).                */
  2259. X/* The third argument is the string into which the result should be placed.   */
  2260. X
  2261. X/******************************************************************************/
  2262. X
  2263. XEXPORT float tim_real P_((void));
  2264. X/* Returns the number of seconds between the present and an unspecified, but  */
  2265. X/* statically fixed time in the past.                                         */
  2266. X/* Returns 0.0 if this information is unavailable                             */
  2267. X
  2268. XEXPORT float tim_cpu P_((void));
  2269. X/* Returns the number of CPU seconds consumed between the present and an      */
  2270. X/* unspecified, but statically fixed time in the past.                        */
  2271. X/* Returns 0.0 if this information is unavailable                             */
  2272. X
  2273. X/******************************************************************************/
  2274. X
  2275. X/* For #ifndef preventing multiple inclusion of the body of this header file. */
  2276. X#endif
  2277. X
  2278. X/******************************************************************************/
  2279. X/*                                End of MACHIN.H                             */
  2280. X/******************************************************************************/
  2281. END_OF_FILE
  2282. if test 14389 -ne `wc -c <'sources/machin.h'`; then
  2283.     echo shar: \"'sources/machin.h'\" unpacked with wrong size!
  2284. fi
  2285. # end of 'sources/machin.h'
  2286. fi
  2287. if test -f 'sources/memory.c' -a "${1}" != "-c" ; then 
  2288.   echo shar: Will not clobber existing file \"'sources/memory.c'\"
  2289. else
  2290. echo shar: Extracting \"'sources/memory.c'\" \(14661 characters\)
  2291. sed "s/^X//" >'sources/memory.c' <<'END_OF_FILE'
  2292. X/*##############################################################################
  2293. X
  2294. XFUNNNELWEB COPYRIGHT
  2295. X====================
  2296. XFunnelWeb is a literate-programming macro preprocessor.
  2297. X
  2298. Copyright (C) 1992 Ross N. Williams.
  2299. X
  2300. X   Ross N. Williams
  2301. X   ross@spam.adelaide.edu.au
  2302. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  2303. X
  2304. This program is free software; you can redistribute it and/or modify
  2305. it under the terms of Version 2 of the GNU General Public License as
  2306. published by the Free Software Foundation.
  2307. X
  2308. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  2309. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  2310. See Version 2 of the GNU General Public License for more details.
  2311. X
  2312. You should have received a copy of Version 2 of the GNU General Public
  2313. License along with this program. If not, you can FTP the license from
  2314. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  2315. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2316. X
  2317. Section 2a of the license requires that all changes to this file be
  2318. recorded prominently in this file. Please record all changes here.
  2319. X
  2320. Programmers:
  2321. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  2322. X
  2323. Changes:
  2324. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  2325. X
  2326. X##############################################################################*/
  2327. X
  2328. X
  2329. X/******************************************************************************/
  2330. X/*                                  MEMORY.C                                  */
  2331. X/******************************************************************************/
  2332. X/*                                                                            */
  2333. X/* Implementation Overview                                                    */
  2334. X/* -----------------------                                                    */
  2335. X/* One of the tasks of this Memory Management (MM) package is to keep track   */
  2336. X/* of the memory that it has allocated so that it can all be deallocated      */
  2337. X/* later, in one go. To do this, the package keeps a linked list whose        */
  2338. X/* elements describe the blocks allocated. Two linked lists are kept, one for */
  2339. X/* temporary blocks and one for permanent blocks. Only the list for the       */
  2340. X/* temporary blocks is used for deallocation. Permanent blocks are arranged   */
  2341. X/* in a list so that the code for temporary blocks is also applicable.        */
  2342. X/*                                                                            */
  2343. X/* In order to avoid many calls to malloc() for small blocks of memory        */
  2344. X/* (legend has it that some implementations of malloc() are very slow in this */
  2345. X/* case), the MM package keeps a spare temporary and permanent block of       */
  2346. X/* length MM_BLOCK from which it allocates small blocks. Small is defined as  */
  2347. X/* <=MM_BLOCK/16. A separate malloc call is made for "Large" blocks greater   */
  2348. X/* than MM_BLOCK bytes. "Large" blocks less than MM_BLOCK bytes may or may    */
  2349. X/* not be allocated from a buffer block, depending on how much space is       */
  2350. X/* available. See the code for the full details.                              */
  2351. X/*                                                                            */
  2352. X/******************************************************************************/
  2353. X
  2354. X#include "style.h"
  2355. X
  2356. X#include "as.h"
  2357. X#include "machin.h"
  2358. X#include "memory.h"
  2359. X
  2360. X/******************************************************************************/
  2361. X
  2362. X/* The environ.h file contains a definition for ALIGN_POWER which is the      */
  2363. X/* exponent of the power of two corresponding to the machine's alignment      */
  2364. X/* requirements. The following two constants convert that constant to more    */
  2365. X/* useful forms. These definitions should never need to be changed.           */
  2366. X#define ALIGN_SIZE (1L<<ALIGN_POWER)
  2367. X#define ALIGN_MASK (ALIGN_SIZE-1)
  2368. X
  2369. X/* Because standard malloc() can be slow on some systems for large numbers of */
  2370. X/* calls requesting small blocks of memory, FunnelWeb's memory management     */
  2371. X/* package MM_* allocates memory in sizeable blocks and then allocates        */
  2372. X/* smaller blocks from these big blocks without reference to malloc(). The    */
  2373. X/* following #define tells the MM package how big the sizeable allocated      */
  2374. X/* blocks should be. The rule is then: if the requested block is greater than */
  2375. X/* MM_BLOCK/16, allocate it directly using malloc(), otherwise peel off some  */
  2376. X/* memory from the latest sizeable block allocated.                           */
  2377. X/* In practice, MM_BLOCK should be chosen to be about 1/10 to 1/20 of the     */
  2378. X/* memory available to FunnelWeb. The disadvantage of making it big is that   */
  2379. X/* when memory is tight, MM will be unable to allocate a full block and about */
  2380. X/* half a block of memory will be unusable. The disadvantage of making it too */
  2381. X/* small is that the linked lists tracking memory allocations will grow long  */
  2382. X/* and it will take a long time to free up memory between invocations of      */
  2383. X/* FunnelWeb proper. The value is not critical. A value of 31K should work    */
  2384. X/* well on most systems. 31K is chosen instead of 32K just to be on the safe  */
  2385. X/* side of 16 bits (so who's paranoid?).                                      */
  2386. X#define MM_BLOCK (31L*1024L)
  2387. X
  2388. X/* This definition provides the definition of the size of a "big" block; that */
  2389. X/* is, one that should possibly be treated differently from the others.       */
  2390. X/* The rule we use is that a big block is 1/16 of the standard block size.    */
  2391. X/* This results in a maximum memory wastage of 1/16 or about 7%.              */
  2392. X#define MM_BIG (MM_BLOCK >> 4)
  2393. X
  2394. X/* Magic numbers help us to detect corruptions. */
  2395. X#define MAGIC_HEAD  (83716343L)
  2396. X#define MAGIC_TAIL  (11172363L)
  2397. X
  2398. X/* Set MEMTRACE to TRUE to trace all memory operations. */
  2399. X#define MEMTRACE FALSE
  2400. X
  2401. X/******************************************************************************/
  2402. X
  2403. X/* The following structures define a type for the linked lists that keep      */
  2404. X/* track of the allocated blocks.                                             */
  2405. typedef struct mm_t_
  2406. X  {
  2407. X   ulong         mm_mhead; /* Magic number protecting beginning of record.    */
  2408. X   ubyte_       *mm_pblok; /* Pointer to the allocated block.                 */
  2409. X   ubyte_       *mm_pfree; /* Pointer to next free byte in block (ALIGNED).   */
  2410. X   ulong         mm_nfree; /* Number of unused bytes available in the block.  */
  2411. X   struct mm_t_ *mm_pnext; /* Pointer to the header for the next block.       */
  2412. X   ulong         mm_mtail; /* Magic number protecting end of record.          */
  2413. X  } mm_t;
  2414. X
  2415. typedef mm_t *p_mm_t;      /* Handy to have a pointer type too.               */
  2416. X
  2417. X/* The following two local variables point to the head of the temporary and   */
  2418. X/* permanent block lists. The first block in each list is that list's buffer. */
  2419. LOCVAR p_mm_t p_perm = NULL;
  2420. LOCVAR p_mm_t p_temp = NULL;
  2421. X
  2422. X/******************************************************************************/
  2423. X
  2424. LOCAL void mm_check P_((p_mm_t));
  2425. LOCAL void mm_check(p_mm)
  2426. X/* Checks the magic numbers in the specified block header object. */
  2427. p_mm_t p_mm;
  2428. X{
  2429. X as_cold(p_mm!=NULL,"mm_check: Null pointer.");
  2430. X as_cold(p_mm->mm_mhead==MAGIC_HEAD,"mm_check: Corrupted header.");
  2431. X as_cold(p_mm->mm_mtail==MAGIC_TAIL,"mm_check: Corrupted trailer.");
  2432. X}
  2433. X
  2434. X/******************************************************************************/
  2435. X
  2436. LOCAL void mm_align P_((p_mm_t));
  2437. LOCAL void mm_align(p_mm)
  2438. X/* Some machines are very fussy about the memory alignment of allocated       */
  2439. X/* objects. To solve this problem, the mm_pfree pointer is always kept at an  */
  2440. X/* "aligned" address. This function accepts a pointer to the header of a      */
  2441. X/* block whose mm_pfree pointer is possibly unaligned and consumes bytes      */
  2442. X/* until mm_pfree is aligned.                                                 */
  2443. p_mm_t p_mm;
  2444. X{
  2445. X ubyte bump;
  2446. X ubyte consume;
  2447. X
  2448. X mm_check(p_mm);
  2449. X
  2450. X /* Work out how many bytes are sticking out over the alignment boundary. */
  2451. X bump = ((ulong) p_mm->mm_pfree) & ALIGN_MASK;
  2452. X
  2453. X /* Return if the block is already aligned. */
  2454. X if (bump==0) return;
  2455. X
  2456. X /* Otherwise work out how many bytes we have to consume to become realigned. */
  2457. X consume=ALIGN_SIZE-bump;
  2458. X
  2459. X /* If there are not enough bytes left in the block to allow the free pointer */
  2460. X /* to be aligned, then simply set the available bytes to zero and return. It */
  2461. X /* doesn't matter if we don't achieve alignment in this case as if           */
  2462. X /* mm_nfree==0, nothing can ever be allocated at the misaligned address.     */
  2463. X if (consume>p_mm->mm_nfree) {p_mm->mm_nfree=0; return;}
  2464. X
  2465. X /* Consume the bytes required to align the free pointer. */
  2466. X p_mm->mm_pfree += consume;
  2467. X p_mm->mm_nfree -= consume;
  2468. X
  2469. X /* Check that we have properly aligned the free pointer. */
  2470. X as_cold((((ulong) p_mm->mm_pfree) & ALIGN_MASK)==0,
  2471. X         "mm_align: Failed to align.");
  2472. X}
  2473. X
  2474. X/******************************************************************************/
  2475. X
  2476. LOCAL p_mm_t mm_newblk P_((size_t));
  2477. LOCAL p_mm_t mm_newblk(blk_len)
  2478. X/* Creates a new block containing (after alignment) at least blk_len bytes.   */
  2479. X/* Returns a pointer to the header for the block.                             */
  2480. size_t blk_len;
  2481. X{
  2482. X p_mm_t  p_mm;
  2483. X ubyte_ *p_bl;
  2484. X
  2485. X /* Allocate the header and the block itself. Because we are guaranteeing     */
  2486. X /* that the resultant block will have at least blk_len bytes free, we have   */
  2487. X /* to take into account alignment and add in ALIGN_SIZE when requesting mem. */
  2488. X p_mm=(p_mm_t  ) malloc((size_t)         sizeof(mm_t));
  2489. X p_bl=(ubyte_ *) malloc((size_t) (blk_len+ALIGN_SIZE));
  2490. X if (p_mm==NULL || p_bl==NULL)
  2491. X   {
  2492. X    fprintf(stderr,"mm_newblk: Out of memory!\n");
  2493. X    fprintf(stderr,"FunnelWeb doesn't cope well when it runs out of memory.\n");
  2494. X    fprintf(stderr,"It falls in a heap just as it is about to now.\n");
  2495. X    as_bomb("Stand by for an ungraceful termination!");
  2496. X   }
  2497. X
  2498. X /* Fill in the fields of the block header. */
  2499. X p_mm->mm_mhead = MAGIC_HEAD;
  2500. X p_mm->mm_pblok = p_bl;
  2501. X p_mm->mm_pfree = p_bl;
  2502. X p_mm->mm_nfree = blk_len+ALIGN_SIZE;
  2503. X p_mm->mm_pnext = NULL;
  2504. X p_mm->mm_mtail = MAGIC_TAIL;
  2505. X
  2506. X /* Align the free pointer in the header block. */
  2507. X mm_align(p_mm);
  2508. X
  2509. X /* Return a pointer to the header block we created. */
  2510. X return p_mm;
  2511. X}
  2512. X
  2513. X/******************************************************************************/
  2514. X
  2515. LOCAL p_void mm_alloc P_((p_mm_t *,size_t));
  2516. LOCAL p_void mm_alloc(pp_mm,bytes)
  2517. X/* 'pp_mm' must be a pointer to either p_perm or p_temp.                      */
  2518. X/* 'bytes' is the number of bytes required.                                   */
  2519. X/* Allocates the required memory and returns an aligned pointer to it.        */
  2520. X/* Bombs the program if the memory is not available.                          */
  2521. p_mm_t *pp_mm;
  2522. size_t bytes;
  2523. X{
  2524. X p_mm_t p_from;    /* Pointer to header for block from which we finally alloc.*/
  2525. X ubyte_ *p_result; /* The result pointer returned to the caller.              */
  2526. X
  2527. X /* If the list is empty, create a "buffer block" and put it in the list.     */
  2528. X if (*pp_mm==NULL) *pp_mm=mm_newblk((size_t) MM_BLOCK);
  2529. X
  2530. X /* If there is room in the current buffer block, we can allocate directly.   */
  2531. X /* Note that we may be allocating a "big" block here, but as long as it fits */
  2532. X /* into the free space of the current buffer block, we don't care.           */
  2533. X if ((*pp_mm)->mm_nfree >= bytes) {p_from = *pp_mm; goto dole_out;}
  2534. X
  2535. X /* At this point we know that there is not enough space in the current       */
  2536. X /* buffer block. This could mean that we have an extra big allocation on our */
  2537. X /* hands in which case, we should malloc up a block specially for this       */
  2538. X /* request. It could also mean that we are running out of space in our       */
  2539. X /* buffer block in which case a new one must be allocated.                   */
  2540. X if (bytes >= MM_BIG)
  2541. X   {
  2542. X    /* If the request is BIG, allocate a special block for it and insert the  */
  2543. X    /* block in the block list just after the buffer block, leaving the       */
  2544. X    /* buffer block the first in the block list.                              */
  2545. X    p_mm_t p_tmp=mm_newblk(bytes);
  2546. X    p_tmp->mm_pnext=(*pp_mm)->mm_pnext;
  2547. X    (*pp_mm)->mm_pnext=p_tmp;
  2548. X    p_from=p_tmp;
  2549. X   }
  2550. X else
  2551. X   {
  2552. X    /* If the request is not big, our buffer block is probably too empty and  */
  2553. X    /* so it is time to create a new one. Allocate a new buffer block and     */
  2554. X    /* make it the new head of this block list. Note that by giving up on the */
  2555. X    /* previous buffer, we waste at most 1/16 of the block we are giving up   */
  2556. X    /* on. This cost is reasonable in exchange for all the speed this gives.  */
  2557. X    p_mm_t p_tmp=mm_newblk((size_t) MM_BLOCK);
  2558. X    p_tmp->mm_pnext=(*pp_mm);
  2559. X    (*pp_mm)=p_tmp;
  2560. X    p_from=p_tmp;
  2561. X   }
  2562. X
  2563. X dole_out:
  2564. X /* Jump here to dole out 'bytes' bytes from block 'p_from'. */
  2565. X p_result=p_from->mm_pfree;
  2566. X p_from->mm_pfree += bytes;
  2567. X p_from->mm_nfree -= bytes;
  2568. X mm_align(p_from);
  2569. X
  2570. X /* Ensure that the pointer being returned is properly aligned. */
  2571. X as_cold((((ulong) p_result) & ALIGN_MASK)==0,
  2572. X         "mm_alloc: Result is misaligned.");
  2573. X
  2574. X /* Return the result. */
  2575. X return (p_void) p_result;
  2576. X}
  2577. X
  2578. X/******************************************************************************/
  2579. X
  2580. XEXPORT p_void mm_perm(bytes)
  2581. size_t bytes;
  2582. X{
  2583. X#if MEMTRACE
  2584. X printf("TRACE: mm_perm: Allocating %lu bytes of permanent memory.\n",
  2585. X(ulong) bytes);
  2586. X#endif
  2587. X return mm_alloc(&p_perm,bytes);
  2588. X}
  2589. X
  2590. X/******************************************************************************/
  2591. X
  2592. XEXPORT p_void mm_temp(bytes)
  2593. size_t bytes;
  2594. X{
  2595. X#if MEMTRACE
  2596. X printf("TRACE: mm_temp: Allocating %lu bytes of temporary memory.\n",
  2597. X(ulong) bytes);
  2598. X#endif
  2599. X return mm_alloc(&p_temp,bytes);
  2600. X}
  2601. X
  2602. X/******************************************************************************/
  2603. X
  2604. XEXPORT void mm_zapt()
  2605. X/* This function frees all the memory blocks recorded in the temporary        */
  2606. X/* memory list. We choose to free them rather than merely re-using them       */
  2607. X/* directly because they may not all be the same size, and we want to give    */
  2608. X/* the built-in memory manager a chance to smooth out the heap.               */
  2609. X{
  2610. X#if MEMTRACE
  2611. X printf("TRACE: mm_zapt: Attempting to release all temporary memory.\n");
  2612. X#endif
  2613. X
  2614. X while (p_temp != NULL)
  2615. X   {
  2616. X    p_mm_t p_mm=p_temp;
  2617. X    mm_check(p_temp);
  2618. X#if MEMTRACE
  2619. X    printf("TRACE: mm_zapt: Deallocating a big chunk of temporary memory.\n");
  2620. X#endif
  2621. X    free(p_temp->mm_pblok);
  2622. X    p_temp=p_temp->mm_pnext;
  2623. X    free(p_mm);
  2624. X   }
  2625. X}
  2626. X
  2627. X/******************************************************************************/
  2628. X/*                             End of MEMORY.C                                */
  2629. X/******************************************************************************/
  2630. END_OF_FILE
  2631. if test 14661 -ne `wc -c <'sources/memory.c'`; then
  2632.     echo shar: \"'sources/memory.c'\" unpacked with wrong size!
  2633. fi
  2634. # end of 'sources/memory.c'
  2635. fi
  2636. if test -f 'sources/style.h' -a "${1}" != "-c" ; then 
  2637.   echo shar: Will not clobber existing file \"'sources/style.h'\"
  2638. else
  2639. echo shar: Extracting \"'sources/style.h'\" \(13281 characters\)
  2640. sed "s/^X//" >'sources/style.h' <<'END_OF_FILE'
  2641. X/*##############################################################################
  2642. X
  2643. XFUNNNELWEB COPYRIGHT
  2644. X====================
  2645. XFunnelWeb is a literate-programming macro preprocessor.
  2646. X
  2647. Copyright (C) 1992 Ross N. Williams.
  2648. X
  2649. X   Ross N. Williams
  2650. X   ross@spam.adelaide.edu.au
  2651. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  2652. X
  2653. This program is free software; you can redistribute it and/or modify
  2654. it under the terms of Version 2 of the GNU General Public License as
  2655. published by the Free Software Foundation.
  2656. X
  2657. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  2658. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  2659. See Version 2 of the GNU General Public License for more details.
  2660. X
  2661. You should have received a copy of Version 2 of the GNU General Public
  2662. License along with this program. If not, you can FTP the license from
  2663. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  2664. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2665. X
  2666. Section 2a of the license requires that all changes to this file be
  2667. recorded prominently in this file. Please record all changes here.
  2668. X
  2669. Programmers:
  2670. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  2671. X
  2672. Changes:
  2673. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  2674. X
  2675. X##############################################################################*/
  2676. X
  2677. X
  2678. X/******************************************************************************/
  2679. X/*                                    STYLE.H                                 */
  2680. X/******************************************************************************/
  2681. X/*                                                                            */
  2682. X/* WARNING: DO NOT ADD ANY MACHINE OR PROGRAM DEPENDENT DEFINITIONS.          */
  2683. X/*                                                                            */
  2684. X/* This style.h file contains program-independent, machine-independent        */
  2685. X/* definitions that assist C programming in general. Nothing in this file     */
  2686. X/* should require modification if this file is moved to a new machine or used */
  2687. X/* in a new computer program. However, it may use abstracted second-order     */
  2688. X/* definitions from the machine-dependent, program independent module         */
  2689. X/* "environ".                                                                 */
  2690. X/*                                                                            */
  2691. X/******************************************************************************/
  2692. X
  2693. X/* Ensure that the body of this header file is included at most once.         */
  2694. X#ifndef DONE_STYLE
  2695. X#define DONE_STYLE
  2696. X
  2697. X/******************************************************************************/
  2698. X
  2699. X/* System File Inclusions                                                     */
  2700. X/* ----------------------                                                     */
  2701. X/* In order to support a readable programming style, symbols such as TRUE and */
  2702. X/* NULL are essential. However, environments differ as to whether and where   */
  2703. X/* these symbols are defined. This can lead to multiple definition errors     */
  2704. X/* where (say) this style.h file is included in a .C file before <stdlib.h>.  */
  2705. X/* I did a quick survey of all the .C FunnelWeb modules and found the         */
  2706. X/* following:                                                                 */
  2707. X/*                                                                            */
  2708. X/*    Total files     = 54                                                    */
  2709. X/*    Number .C files = 22                                                    */
  2710. X/*    Number .H files = 32                                                    */
  2711. X/*    Used <stdlib.h> = 19                                                    */
  2712. X/*    Used <stdio.h>  = 16                                                    */
  2713. X/*    Used <string.h> = 12                                                    */
  2714. X/*    Used <ctype.h>  =  6                                                    */
  2715. X/*    Used <stddef.h> =  4                                                    */
  2716. X/*    Used <limits.h> =  2                                                    */
  2717. X/*    Used <setjmp.h> =  1                                                    */
  2718. X/*                                                                            */
  2719. X/* Most of these inclusions were in the .C files.                             */
  2720. X/* It therefore seemed sensible to include some very commonly used system     */
  2721. X/* header files here and header files that cause problems if not included     */
  2722. X/* before style.h (<stddef.h>).                                               */
  2723. X
  2724. X#include <stdio.h>
  2725. X#include <stdlib.h>
  2726. X#include <string.h>
  2727. X#include <stddef.h>
  2728. X
  2729. X/******************************************************************************/
  2730. X
  2731. X/* Although this file is machine independent, it still needs some generic     */
  2732. X/* definitions whose values vary from machine to machine (see above).         */
  2733. X#include "environ.h"
  2734. X
  2735. X/******************************************************************************/
  2736. X
  2737. X/* The following types provide a clear and consistent collection of names for */
  2738. X/* C's arithmetic types. Each name describes only the portable range that the */
  2739. X/* underlying type supports. As in C, there are no guarantees about the       */
  2740. X/* MAXIMUM size of each underlying type and these types can provide no        */
  2741. X/* guarantees either. In the normal case, they translate to the most speed    */
  2742. X/* efficient type that will support the specified range. However, to support  */
  2743. X/* the situations where space efficiency is required, types ending in         */
  2744. X/* underscores have been defined that strive to conserve memory.              */
  2745. X/* Note: The signedness of a type does not change when an _ is added.         */
  2746. X/*                                                                            */
  2747. X/* The following terminology may be a touch vaxcentric, but it works for me.  */
  2748. X/*    A BYTE is an  8 bit quantity.                                           */
  2749. X/*    A WORD is a  16 bit quantity.                                           */
  2750. X/*    A LONG is a  32 bit quantity.                                           */
  2751. X
  2752. typedef unsigned        ubyte  ; /* Unsigned, [0,255].                        */
  2753. typedef unsigned char   ubyte_ ; /* Unsigned, [0,255].         Space first.   */
  2754. typedef int             word   ; /* Signed  , [-32767,+32767].                */
  2755. typedef short           word_  ; /* Signed  , [-32767,+32767]. Space first.   */
  2756. typedef unsigned        uword  ; /* Unsigned, [0,65535].                      */
  2757. typedef unsigned short  uword_ ; /* Unsigned, [0,+65535].      Space first.   */
  2758. typedef unsigned long   ulong  ; /* Unsigned, [0,(2^32)-1].                   */
  2759. X
  2760. typedef unsigned        bool   ; /* Unsigned, [0,1].                          */
  2761. typedef unsigned char   bool_  ; /* Unsigned, [0,1].           Space first.   */
  2762. X
  2763. typedef int             sign   ; /* Signed  , [-1,0,1].                       */
  2764. X
  2765. X/******************************************************************************/
  2766. X
  2767. X/* C overloads the attribute keyword "static" horribly giving it meaning on   */
  2768. X/* both the scoping and lifetime dimensions.  This section gives definitions  */
  2769. X/* that clarify its use. If these macros are used, there should be no need    */
  2770. X/* for the keyword "static" in programs using this style file.                */
  2771. X
  2772. X/* The following macros assist in making the scope of functions clearer. In   */
  2773. X/* deciding on the names of these macros, I chose from the following lists:   */
  2774. X/*    file    scope: PRIVATE, LOCAL, HIDDEN.                                  */
  2775. X/*    program scope: EXPORT, PUBLIC, GLOBAL.                                  */
  2776. X/* In the end I chose LOCAL and EXPORT. Note: I didn't want to allow more     */
  2777. X/* than one form as that would have created too much confusion.               */
  2778. X#define LOCAL  static
  2779. X#define EXPORT
  2780. X
  2781. X/* It is desirable to use separate keywords for variables. This makes it      */
  2782. X/* easier to search for them without stopping at every function. There are    */
  2783. X/* four classes of variable that we wish to tag, along the two dimensions     */
  2784. X/* scope:(local,global) and lifetime:(permanent,temporary). In C, all         */
  2785. X/* variables declared outside of functions have permanent lifetime and so     */
  2786. X/* the following two names (which should be used only to tag variables not    */
  2787. X/* declared within a function) have been designed to emphasise the scope      */
  2788. X/* dimension which is the principal concern for these variables.              */
  2789. X#define LOCVAR static
  2790. X#define GLOVAR
  2791. X
  2792. X/* Variables local to functions always have local scope and so the dimension  */
  2793. X/* to emphasise is the lifetime. Automatic variables are the most common in   */
  2794. X/* C and it would be messy to declare them all using a keyword. Far better    */
  2795. X/* just to tag static local variables, emphasising their lifetime (STAtic).   */
  2796. X#define STAVAR static
  2797. X
  2798. X/******************************************************************************/
  2799. X
  2800. X/* The following definitions are useful for dealing with void.                */
  2801. X/* The typedefed definition "p_void" should always be used instead of         */
  2802. X/* "void *" so as to improve portability.                                     */
  2803. X/* The definition of "void" and "p_void" come from environ.h                  */
  2804. typedef p_void *p_p_void;
  2805. X#define PV     (p_void)
  2806. X#define PPV    (p_p_void)
  2807. X
  2808. X/******************************************************************************/
  2809. X
  2810. X/* The following symbols are more mnemonic than character escape sequences.   */
  2811. X#define EOS '\0'
  2812. X#define EOL '\n'
  2813. X
  2814. X/******************************************************************************/
  2815. X
  2816. X/* The ANSI library functions use many different techniques for returning     */
  2817. X/* status information. For example, fopen returns NULL upon failure, but      */
  2818. X/* fclose returns EOF upon failure. The result is that it is hard to          */
  2819. X/* proofread calls to these routines without constantly referring to the      */
  2820. X/* library manual. To avoid this problem, we define symbols with helpful      */
  2821. X/* names for the different values returned. This makes the code obvious.      */
  2822. X
  2823. X/* 07-Feb-1992: During porting I ran into a problem here with FPUTS_S. I had  */
  2824. X/* defined it to be zero, as stated in the THINK C V4 ANSI library guide.     */
  2825. X/* However, it turned out that fputs() returns EOF (-1) on failure and the    */
  2826. X/* value that it returns on success is non negative! (See ANSI (7.9.7.4)).    */
  2827. X/* Caught by an overspecification by the THINK C people! The lesson is that   */
  2828. X/* it is very important to make sure that each function's status check symbol */
  2829. X/* is defined on the "right" side (success or failure) - that is, the side    */
  2830. X/* for which a single value for that status is guaranteed portably.           */
  2831. X/* The following values have all been checked for this.                       */
  2832. X
  2833. X/* Note: _F=Failure, _S=Success, _FE=Failure or End of File.                  */
  2834. X
  2835. X#define FOPEN_F  (NULL)
  2836. X#define FSEEK_S     (0)
  2837. X#define FTELL_F   (-1L)
  2838. X#define FGETC_FE  (EOF)
  2839. X#define FGETS_FE (NULL)
  2840. X#define FPUTC_F   (EOF)
  2841. X#define FPUTS_F   (EOF)
  2842. X#define FFLUSH_S    (0)
  2843. X#define FCLOSE_F  (EOF)
  2844. X#define REMOVE_S    (0)
  2845. X#define RENAME_S    (0)
  2846. X#define MALLOC_F (NULL)
  2847. X
  2848. X/******************************************************************************/
  2849. X
  2850. X/* The following macro functions are handy. However, be sure not to hand them */
  2851. X/* an argument with a non-idempotent side effect!!! (e.g. MAX(a++,b)).        */
  2852. X#define MIN(A,B) ((A)<(B) ? (A) : (B))
  2853. X#define MAX(A,B) ((A)>(B) ? (A) : (B))
  2854. X
  2855. X/******************************************************************************/
  2856. X
  2857. X/* Some environments don't define some stuff we need so we do it here.        */
  2858. X/* Cautiously!                                                                */
  2859. X
  2860. X#ifndef FALSE
  2861. X#define FALSE (0)
  2862. X#endif
  2863. X
  2864. X#ifndef TRUE
  2865. X#define TRUE (1)
  2866. X#endif
  2867. X
  2868. X#ifndef EXIT_FAILURE
  2869. X#define EXIT_FAILURE (-1)
  2870. X#endif
  2871. X
  2872. X#ifndef EXIT_SUCCESS
  2873. X#define EXIT_SUCCESS (0)
  2874. X#endif
  2875. X
  2876. X/******************************************************************************/
  2877. X
  2878. X/* The standard library macro/function "isprint" can be too loose in some     */
  2879. X/* circumstances on some machines and it is convenient to define a macro      */
  2880. X/* that provides a more strict 7-bit ASCII definition of "printable".         */
  2881. X#define isascprn(ch) ((' '<=ch) && (ch<='~'))
  2882. X
  2883. X/******************************************************************************/
  2884. X
  2885. X/* Some compilers (GCC at least) complain about characters as a type in a     */
  2886. X/* function argument. The following typedef is a quick hack that lets me say  */
  2887. X/* that I really wanted the function argument to be a character, while        */
  2888. X/* actually supplying an integer.                                             */
  2889. typedef int intchar;
  2890. X
  2891. X/******************************************************************************/
  2892. X/* For #ifndef preventing multiple inclusion of the body of this header file. */
  2893. X#endif
  2894. X
  2895. X/******************************************************************************/
  2896. X/*                                End of STYLE.H                              */
  2897. X/******************************************************************************/
  2898. X
  2899. END_OF_FILE
  2900. if test 13281 -ne `wc -c <'sources/style.h'`; then
  2901.     echo shar: \"'sources/style.h'\" unpacked with wrong size!
  2902. fi
  2903. # end of 'sources/style.h'
  2904. fi
  2905. echo shar: End of archive 6 \(of 20\).
  2906. cp /dev/null ark6isdone
  2907. MISSING=""
  2908. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do
  2909.     if test ! -f ark${I}isdone ; then
  2910.     MISSING="${MISSING} ${I}"
  2911.     fi
  2912. done
  2913. if test "${MISSING}" = "" ; then
  2914.     echo You have unpacked all 20 archives.
  2915.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2916. else
  2917.     echo You still need to unpack the following archives:
  2918.     echo "        " ${MISSING}
  2919. fi
  2920. ##  End of shell archive.
  2921. exit 0
  2922.