home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1993-04-10 | 125.8 KB | 2,952 lines
Newsgroups: comp.sources.unix From: ross@spam.adelaide.edu.au (Ross Williams) Subject: v26i123: funnelweb - a tool for literate programming in C, Part03/20 Sender: unix-sources-moderator@vix.com Approved: paul@vix.com Submitted-By: ross@spam.adelaide.edu.au (Ross Williams) Posting-Number: Volume 26, Issue 123 Archive-Name: funnelweb/part03 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 3 (of 20)." # Contents: answers/pr02.lis answers/sc09.lis answers/sc22.lis # answers/sc24.lis answers/sc27.lis answers/sc29.lis # hackman/h_ch0.tex hackman/h_manual.aux hackman/h_manual.log # sources/as.h sources/clock.h sources/help_gnu.c sources/memory.h # sources/misc.c sources/misc.h sources/option.h sources/section.h # sources/texhead.c sources/texhead.h # Wrapped by vixie@gw.home.vix.com on Sun Apr 11 11:00:11 1993 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'answers/pr02.lis' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'answers/pr02.lis'\" else echo shar: Extracting \"'answers/pr02.lis'\" \(5398 characters\) sed "s/^X//" >'answers/pr02.lis' <<'END_OF_FILE' XFUNNELWEB LISTING FILE X====================== X Dump of mapped file "<<Suppressed>>". X MEMORY DUMP OF MAPPED FILE X========================== X X+-------------------------------------------------+------------------+ X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | X+-------------------------------------------------+------------------+ X| 50 52 30 32 3A 20 54 65 73 74 20 74 68 65 20 70 | PR02: Test the p | X| 61 72 73 69 6E 67 20 6F 66 20 74 79 70 65 73 65 | arsing of typese | X| 74 74 65 72 20 64 69 72 65 63 74 69 76 65 73 2E | tter directives. | X| 0A 0A 31 2E 20 54 65 73 74 20 70 61 72 73 69 6E | ..1. Test parsin | X| 67 20 6F 66 20 6E 65 77 20 70 61 67 65 20 64 69 | g of new page di | X| 72 65 63 74 69 76 65 2E 0A 40 74 20 6E 65 77 5F | rective..@t new_ | X| 70 61 67 65 0A 0A 32 2E 20 54 65 73 74 20 70 61 | page..2. Test pa | X| 72 73 69 6E 67 20 6F 66 20 74 61 62 6C 65 20 6F | rsing of table o | X| 66 20 63 6F 6E 74 65 6E 74 73 20 64 69 72 65 63 | f contents direc | X| 74 69 76 65 2E 0A 40 74 20 74 61 62 6C 65 5F 6F | tive..@t table_o | X| 66 5F 63 6F 6E 74 65 6E 74 73 0A 0A 33 2E 20 54 | f_contents..3. T | X| 65 73 74 20 70 61 72 73 69 6E 67 20 6F 66 20 76 | est parsing of v | X| 73 6B 69 70 20 64 69 72 65 63 74 69 76 65 2E 0A | skip directive.. | X| 40 74 20 76 73 6B 69 70 20 33 32 20 6D 6D 0A 0A | @t vskip 32 mm.. | X| 34 2E 20 54 65 73 74 20 70 61 72 73 69 6E 67 20 | 4. Test parsing | X| 6F 66 20 74 69 74 6C 65 20 64 69 72 65 63 74 69 | of title directi | X| 76 65 2E 0A 40 74 20 74 69 74 6C 65 20 74 69 74 | ve..@t title tit | X| 6C 65 66 6F 6E 74 20 6C 65 66 74 20 22 53 6C 6F | lefont left "Slo | X| 74 68 22 0A 0A | th".. | X+-------------------------------------------------+------------------+ X X X=========================== Start of LINE LIST DUMP ============================ X Globl Local| Text X-----------+-------------------------------------------------------------------- X00001 00001| PR02: Test the parsing of typesetter directives.<010> X00002 00002| <010> X00003 00003| 1. Test parsing of new page directive.<010> X00004 00004| @t new_page<010> X00005 00005| <010> X00006 00006| 2. Test parsing of table of contents directive.<010> X00007 00007| @t table_of_contents<010> X00008 00008| <010> X00009 00009| 3. Test parsing of vskip directive.<010> X00010 00010| @t vskip 32 mm<010> X00011 00011| <010> X00012 00012| 4. Test parsing of title directive.<010> X00013 00013| @t title titlefont left "Sloth"<010> X00014 00014| <010> X00015 00015| <End-Of-File><010> X-----------+-------------------------------------------------------------------- Globl Local| Text X X============================ End of LINE LIST DUMP ============================= X X X=========================== Start of TOKEN LIST DUMP =========================== X Summary: There are 10 tokens in the token list. X Line[Column]: Token Description X------------------------------- X X0001[01]: Text. Text scrap[Grey]="PR02: Test the parsing of typesetter directives.<010> X<010> X1. Test parsing of new page directive.<010> X" X0004[01]: @t.. Newpage. X0005[01]: Text. Text scrap[Grey]="<010> X2. Test parsing of table of contents directive.<010> X" X0007[01]: @t.. TOC. X0008[01]: Text. Text scrap[Grey]="<010> X3. Test parsing of vskip directive.<010> X" X0010[01]: @t.. Vertical skip. Vertical space skipped=32mm. X0011[01]: Text. Text scrap[Grey]="<010> X4. Test parsing of title directive.<010> X" X0013[01]: @t.. Title. Font=Title, Alignment=Left. Title text follows: Text scrap[Grey]="Sloth" X0014[01]: Text. Text scrap[White]="<010> X" X0015[01]: End Of File. X============================ End of TOKEN LIST DUMP ============================ X X X========================== Start of MACRO TABLE DUMP =========================== X X X=========================== End of MACRO TABLE DUMP ============================ X X X========================= Start of DOCUMENT LIST DUMP ========================== X X TEXT COMPONENT: Pos(L,C)=(1,1). X X-- Start of Text Scrap List -- Text scrap[Grey]="PR02: Test the parsing of typesetter directives.<010> X<010> X1. Test parsing of new page directive.<010> X" X--- End of Text Scrap List --- X X TYPESETTER DIRECTIVE COMPONENT: New page. X TEXT COMPONENT: Pos(L,C)=(5,1). X X-- Start of Text Scrap List -- Text scrap[Grey]="<010> X2. Test parsing of table of contents directive.<010> X" X--- End of Text Scrap List --- X X TYPESETTER DIRECTIVE COMPONENT: Table of contents. X TEXT COMPONENT: Pos(L,C)=(8,1). X X-- Start of Text Scrap List -- Text scrap[Grey]="<010> X3. Test parsing of vskip directive.<010> X" X--- End of Text Scrap List --- X X TYPESETTER DIRECTIVE COMPONENT: Vertical skip by 32 mm. X TEXT COMPONENT: Pos(L,C)=(11,1). X X-- Start of Text Scrap List -- Text scrap[Grey]="<010> X4. Test parsing of title directive.<010> X" X--- End of Text Scrap List --- X X TYPESETTER DIRECTIVE COMPONENT: Font=Title, Alignment=Left. Title text follows: Text scrap[Grey]="Sloth" X TEXT COMPONENT: Pos(L,C)=(14,1). X X-- Start of Text Scrap List -- Text scrap[White]="<010> X" X--- End of Text Scrap List --- X X X========================== End of DOCUMENT LIST DUMP =========================== X XE: No macros defined. XE: No output files specified. X Global Local| Input File X------------+------------------------------------------------------------------- X................. X------------+------------------------------------------------------------------- X There were 2 Errors. END_OF_FILE if test 5398 -ne `wc -c <'answers/pr02.lis'`; then echo shar: \"'answers/pr02.lis'\" unpacked with wrong size! fi # end of 'answers/pr02.lis' fi if test -f 'answers/sc09.lis' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'answers/sc09.lis'\" else echo shar: Extracting \"'answers/sc09.lis'\" \(5222 characters\) sed "s/^X//" >'answers/sc09.lis' <<'END_OF_FILE' XFUNNELWEB LISTING FILE X====================== X Dump of mapped file "<<Suppressed>>". X MEMORY DUMP OF MAPPED FILE X========================== X X+-------------------------------------------------+------------------+ X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | X+-------------------------------------------------+------------------+ X| 53 43 30 39 3A 20 44 65 74 65 63 74 69 6F 6E 20 | SC09: Detection | X| 6F 66 20 63 6F 6E 74 72 6F 6C 20 63 68 61 72 61 | of control chara | X| 63 74 65 72 73 2E 0A 0A 53 43 30 39 2E 31 20 54 | cters...SC09.1 T | X| 65 73 74 20 74 68 61 74 20 63 6F 6E 74 72 6F 6C | est that control | X| 20 63 68 61 72 61 63 74 65 72 73 20 61 72 65 20 | characters are | X| 64 65 74 65 63 74 65 64 20 61 6E 64 20 72 65 70 | detected and rep | X| 6C 61 63 65 64 20 62 79 20 22 3F 22 2E 0A 53 43 | laced by "?"..SC | X| 30 39 2E 32 20 54 65 73 74 20 6E 6F 6E 20 70 72 | 09.2 Test non pr | X| 69 6E 74 61 62 6C 65 20 74 68 61 74 20 68 61 73 | intable that has | X| 20 61 20 6D 6E 65 6D 6F 6E 69 63 2E 0A 0A 54 68 | a mnemonic...Th | X| 65 72 65 20 69 73 20 61 20 74 61 62 20 62 65 74 | ere is a tab bet | X| 77 65 65 6E 20 74 68 65 73 65 20 74 77 6F 20 62 | ween these two b | X| 61 72 73 20 7C 09 7C 20 77 68 69 63 68 20 73 68 | ars |.| which sh | X| 6F 75 6C 64 20 63 6F 6D 65 20 6F 75 74 20 61 73 | ould come out as | X| 20 22 3F 22 2E 0A 54 68 65 20 61 62 6F 76 65 20 | "?"..The above | X| 65 72 72 6F 72 20 6D 65 73 73 61 67 65 20 73 68 | error message sh | X| 6F 75 6C 64 20 63 6F 6E 74 61 69 6E 20 74 68 65 | ould contain the | X| 20 6D 6E 65 6D 6F 6E 69 63 20 22 48 54 22 2E 0A | mnemonic "HT".. | X| 0A 53 43 30 39 2E 33 20 54 65 73 74 20 6E 6F 6E | .SC09.3 Test non | X| 20 70 72 69 6E 74 61 62 6C 65 20 74 68 61 74 20 | printable that | X| 68 61 73 20 6E 6F 20 6D 6E 65 6D 6F 6E 69 63 2E | has no mnemonic. | X| 0A 0A 54 68 65 72 65 20 69 73 20 61 20 6E 6F 6E | ..There is a non | X| 2D 6D 6E 65 6D 6F 6E 69 63 20 63 6F 6E 74 72 6F | -mnemonic contro | X| 6C 20 63 68 61 72 61 63 74 65 72 20 62 65 74 77 | l character betw | X| 65 65 6E 20 74 68 65 73 65 20 62 61 72 73 20 7C | een these bars | | X| EA 7C 2E 0A | .|.. | X+-------------------------------------------------+------------------+ X X X=========================== Start of LINE LIST DUMP ============================ X Globl Local| Text X-----------+-------------------------------------------------------------------- X00001 00001| SC09: Detection of control characters.<010> X00002 00002| <010> X00003 00003| SC09.1 Test that control characters are detected and replaced by "?".<010> X00004 00004| SC09.2 Test non printable that has a mnemonic.<010> X00005 00005| <010> X00006 00006| There is a tab between these two bars |?| which should come out as "?".<010> X00007 00007| The above error message should contain the mnemonic "HT".<010> X00008 00008| <010> X00009 00009| SC09.3 Test non printable that has no mnemonic.<010> X00010 00010| <010> X00011 00011| There is a non-mnemonic control character between these bars |?|.<010> X00012 00012| <End-Of-File><010> X-----------+-------------------------------------------------------------------- Globl Local| Text X X============================ End of LINE LIST DUMP ============================= X X X=========================== Start of TOKEN LIST DUMP =========================== X Summary: There are 2 tokens in the token list. X Line[Column]: Token Description X------------------------------- X X0001[01]: Text. Text scrap[Grey]="SC09: Detection of control characters.<010> X<010> SC09.1 Test that control characters are detected and replaced by "?".<010> SC09.2 Test non printable that has a mnemonic.<010> X<010> There is a tab between these two bars |?| which should come out as "?".<010> The above error message should contain the mnemonic "HT".<010> X<010> SC09.3 Test non printable that has no mnemonic.<010> X<010> There is a non-mnemonic control character between these bars |?|.<010> X" X0012[01]: End Of File. X============================ End of TOKEN LIST DUMP ============================ X Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). X Global Local| Input File X------------+------------------------------------------------------------------- X 1 1| SC09: Detection of control characters. X 2 2| X 3 3| SC09.1 Test that control characters are detected and replaced by "?". X 4 4| SC09.2 Test non printable that has a mnemonic. X 5 5| X 6 6| There is a tab between these two bars |?| which should come out as "?". X Error|........................................^Non printable character (Sym=HT, Dec=009, Hex=09, Oct=011). X 7 7| The above error message should contain the mnemonic "HT". X 8 8| X 9 9| SC09.3 Test non printable that has no mnemonic. X 10 10| X 11 11| There is a non-mnemonic control character between these bars |?|. X Error|...............................................................^Non printable character (Sym=<none>, Dec=234, Hex=EA, Oct=352). X | <End-Of-File> X------------+------------------------------------------------------------------- X There were 2 Errors. END_OF_FILE if test 5222 -ne `wc -c <'answers/sc09.lis'`; then echo shar: \"'answers/sc09.lis'\" unpacked with wrong size! fi # end of 'answers/sc09.lis' fi if test -f 'answers/sc22.lis' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'answers/sc22.lis'\" else echo shar: Extracting \"'answers/sc22.lis'\" \(7638 characters\) sed "s/^X//" >'answers/sc22.lis' <<'END_OF_FILE' XFUNNELWEB LISTING FILE X====================== X Dump of mapped file "<<Suppressed>>". X MEMORY DUMP OF MAPPED FILE X========================== X X+-------------------------------------------------+------------------+ X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | X+-------------------------------------------------+------------------+ X| 53 43 32 32 3A 20 54 65 73 74 20 73 79 6E 74 61 | SC22: Test synta | X| 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 69 6E | x checking of in | X| 70 75 74 20 6C 69 6E 65 20 6C 65 6E 67 74 68 20 | put line length | X| 70 72 61 67 6D 61 2E 0A 0A 31 2E 20 54 65 73 74 | pragma...1. Test | X| 20 6E 6F 74 20 74 68 72 65 65 20 61 72 67 75 6D | not three argum | X| 65 6E 74 73 2E 0A 40 70 20 6D 61 78 69 6D 75 6D | ents..@p maximum | X| 5F 69 6E 70 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 | _input_line_leng | X| 74 68 0A 40 70 20 6D 61 78 69 6D 75 6D 5F 69 6E | th.@p maximum_in | X| 70 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 74 68 20 | put_line_length | X| 3D 0A 40 70 20 6D 61 78 69 6D 75 6D 5F 69 6E 70 | =.@p maximum_inp | X| 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 74 68 20 3D | ut_line_length = | X| 20 78 78 78 20 79 79 79 0A 0A 32 2E 20 54 65 73 | xxx yyy..2. Tes | X| 74 20 73 65 63 6F 6E 64 20 61 72 67 75 6D 65 6E | t second argumen | X| 74 20 6E 6F 74 20 22 3D 22 2E 0A 40 70 20 6D 61 | t not "="..@p ma | X| 78 69 6D 75 6D 5F 69 6E 70 75 74 5F 6C 69 6E 65 | ximum_input_line | X| 5F 6C 65 6E 67 74 68 20 78 20 73 6C 6F 74 68 0A | _length x sloth. | X| 0A 33 2E 20 54 65 73 74 20 76 61 6C 75 65 20 6F | .3. Test value o | X| 66 20 69 6E 66 69 6E 69 74 79 2E 0A 40 70 20 6D | f infinity..@p m | X| 61 78 69 6D 75 6D 5F 69 6E 70 75 74 5F 6C 69 6E | aximum_input_lin | X| 65 5F 6C 65 6E 67 74 68 20 3D 20 69 6E 66 69 6E | e_length = infin | X| 69 74 79 0A 0A 34 2E 20 54 65 73 74 20 6E 6F 6E | ity..4. Test non | X| 2D 64 65 63 69 6D 61 6C 20 64 69 67 69 74 20 69 | -decimal digit i | X| 6E 20 6E 75 6D 62 65 72 2E 0A 40 70 20 6D 61 78 | n number..@p max | X| 69 6D 75 6D 5F 69 6E 70 75 74 5F 6C 69 6E 65 5F | imum_input_line_ | X| 6C 65 6E 67 74 68 20 3D 20 32 65 66 0A 0A 35 2E | length = 2ef..5. | X| 20 54 65 73 74 20 6E 75 6D 62 65 72 20 69 73 20 | Test number is | X| 6D 6F 72 65 20 74 68 61 6E 20 65 69 67 68 74 20 | more than eight | X| 64 69 67 69 74 73 20 6C 6F 6E 67 2E 0A 40 70 20 | digits long..@p | X| 6D 61 78 69 6D 75 6D 5F 69 6E 70 75 74 5F 6C 69 | maximum_input_li | X| 6E 65 5F 6C 65 6E 67 74 68 20 3D 20 31 32 33 34 | ne_length = 1234 | X| 35 36 37 38 39 0A 0A 36 2E 20 54 65 73 74 20 6E | 56789..6. Test n | X| 75 6D 62 65 72 20 69 73 20 65 78 61 63 74 6C 79 | umber is exactly | X| 20 65 69 67 68 74 20 64 69 67 69 74 73 20 6C 6F | eight digits lo | X| 6E 67 2E 0A 40 70 20 6D 61 78 69 6D 75 6D 5F 69 | ng..@p maximum_i | X| 6E 70 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 74 68 | nput_line_length | X| 20 3D 20 31 32 33 34 35 36 37 38 0A 0A 0A | = 12345678... | X+-------------------------------------------------+------------------+ X X X=========================== Start of LINE LIST DUMP ============================ X Globl Local| Text X-----------+-------------------------------------------------------------------- X00001 00001| SC22: Test syntax checking of input line length pragma.<010> X00002 00002| <010> X00003 00003| 1. Test not three arguments.<010> X00004 00004| @p maximum_input_line_length<010> X00005 00005| @p maximum_input_line_length =<010> X00006 00006| @p maximum_input_line_length = xxx yyy<010> X00007 00007| <010> X00008 00008| 2. Test second argument not "=".<010> X00009 00009| @p maximum_input_line_length x sloth<010> X00010 00010| <010> X00011 00011| 3. Test value of infinity.<010> X00012 00012| @p maximum_input_line_length = infinity<010> X00013 00013| <010> X00014 00014| 4. Test non-decimal digit in number.<010> X00015 00015| @p maximum_input_line_length = 2ef<010> X00016 00016| <010> X00017 00017| 5. Test number is more than eight digits long.<010> X00018 00018| @p maximum_input_line_length = 123456789<010> X00019 00019| <010> X00020 00020| 6. Test number is exactly eight digits long.<010> X00021 00021| @p maximum_input_line_length = 12345678<010> X00022 00022| <010> X00023 00023| <010> X00024 00024| <End-Of-File><010> X-----------+-------------------------------------------------------------------- Globl Local| Text X X============================ End of LINE LIST DUMP ============================= X X X=========================== Start of TOKEN LIST DUMP =========================== X Summary: There are 8 tokens in the token list. X Line[Column]: Token Description X------------------------------- X X0001[01]: Text. Text scrap[Grey]="SC22: Test syntax checking of input line length pragma.<010> X<010> X1. Test not three arguments.<010> X" X0007[01]: Text. Text scrap[Grey]="<010> X2. Test second argument not "=".<010> X" X0010[01]: Text. Text scrap[Grey]="<010> X3. Test value of infinity.<010> X" X0013[01]: Text. Text scrap[Grey]="<010> X4. Test non-decimal digit in number.<010> X" X0016[01]: Text. Text scrap[Grey]="<010> X5. Test number is more than eight digits long.<010> X" X0019[01]: Text. Text scrap[Grey]="<010> X6. Test number is exactly eight digits long.<010> X" X0022[01]: Text. Text scrap[White]="<010> X<010> X" X0024[01]: End Of File. X============================ End of TOKEN LIST DUMP ============================ X Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). X Global Local| Input File X------------+------------------------------------------------------------------- X 1 1| SC22: Test syntax checking of input line length pragma. X 2 2| X 3 3| 1. Test not three arguments. X 4 4| @p maximum_input_line_length X Error|.^This pragma has the wrong number of arguments. X |.^The correct format is: "@p maximum_input_line_length = <num>|infinity". X |.^Pragma ignored. X 5 5| @p maximum_input_line_length = X Error|.^This pragma has the wrong number of arguments. X |.^The correct format is: "@p maximum_input_line_length = <num>|infinity". X |.^Pragma ignored. X 6 6| @p maximum_input_line_length = xxx yyy X Error|.^This pragma has the wrong number of arguments. X |.^The correct format is: "@p maximum_input_line_length = <num>|infinity". X |.^Pragma ignored. X 7 7| X 8 8| 2. Test second argument not "=". X 9 9| @p maximum_input_line_length x sloth X |.^The correct format is: "@p maximum_input_line_length = <num>|infinity". X |.^Pragma ignored. X Error|..............................^Expecting "=". X 10 10| X 11 11| 3. Test value of infinity. X 12 12| @p maximum_input_line_length = infinity X 13 13| X 14 14| 4. Test non-decimal digit in number. X 15 15| @p maximum_input_line_length = 2ef X Error|.................................^Illegal digit. Value must consist entirely of decimal digits. X |.................................^You can also use the value "infinity". X |.................................^Pragma ignored. X 16 16| X 17 17| 5. Test number is more than eight digits long. X 18 18| @p maximum_input_line_length = 123456789 X Error|................................^Too many digits. The maximum is eight. X |................................^Pragma ignored. X 19 19| X 20 20| 6. Test number is exactly eight digits long. X 21 21| @p maximum_input_line_length = 12345678 X 22 22| X 23 23| X | <End-Of-File> X------------+------------------------------------------------------------------- X There were 6 Errors. END_OF_FILE if test 7638 -ne `wc -c <'answers/sc22.lis'`; then echo shar: \"'answers/sc22.lis'\" unpacked with wrong size! fi # end of 'answers/sc22.lis' fi if test -f 'answers/sc24.lis' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'answers/sc24.lis'\" else echo shar: Extracting \"'answers/sc24.lis'\" \(7027 characters\) sed "s/^X//" >'answers/sc24.lis' <<'END_OF_FILE' XFUNNELWEB LISTING FILE X====================== X Dump of mapped file "<<Suppressed>>". X MEMORY DUMP OF MAPPED FILE X========================== X X+-------------------------------------------------+------------------+ X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | X+-------------------------------------------------+------------------+ X| 53 43 32 33 3A 20 54 65 73 74 20 73 79 6E 74 61 | SC23: Test synta | X| 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 69 6E | x checking of in | X| 64 65 6E 74 61 74 69 6F 6E 20 70 72 61 67 6D 61 | dentation pragma | X| 2E 0A 0A 31 2E 20 54 65 73 74 20 6E 6F 74 20 74 | ...1. Test not t | X| 68 72 65 65 20 61 72 67 75 6D 65 6E 74 73 2E 0A | hree arguments.. | X| 40 70 20 69 6E 64 65 6E 74 61 74 69 6F 6E 0A 40 | @p indentation.@ | X| 70 20 69 6E 64 65 6E 74 61 74 69 6F 6E 20 3D 0A | p indentation =. | X| 40 70 20 69 6E 64 65 6E 74 61 74 69 6F 6E 20 3D | @p indentation = | X| 20 78 78 78 20 79 79 79 0A 0A 32 2E 20 54 65 73 | xxx yyy..2. Tes | X| 74 20 73 65 63 6F 6E 64 20 61 72 67 75 6D 65 6E | t second argumen | X| 74 20 6E 6F 74 20 22 3D 22 2E 0A 40 70 20 69 6E | t not "="..@p in | X| 64 65 6E 74 61 74 69 6F 6E 20 78 20 73 6C 6F 74 | dentation x slot | X| 68 0A 0A 33 2E 20 54 65 73 74 20 74 68 69 72 64 | h..3. Test third | X| 20 61 72 67 75 6D 65 6E 74 20 69 73 20 6E 6F 74 | argument is not | X| 20 6C 65 67 61 6C 2E 0A 40 70 20 69 6E 64 65 6E | legal..@p inden | X| 74 61 74 69 6F 6E 20 3D 20 73 6C 6F 74 68 0A 0A | tation = sloth.. | X| 34 2E 20 54 65 73 74 20 74 68 69 72 64 20 61 72 | 4. Test third ar | X| 67 75 6D 65 6E 74 20 69 73 20 6E 6F 6E 65 2E 0A | gument is none.. | X| 40 70 20 69 6E 64 65 6E 74 61 74 69 6F 6E 20 3D | @p indentation = | X| 20 6E 6F 6E 65 0A 0A 35 2E 20 54 65 73 74 20 74 | none..5. Test t | X| 68 69 72 64 20 61 72 67 75 6D 65 6E 74 20 69 73 | hird argument is | X| 20 62 6C 61 6E 6B 2E 0A 36 2E 20 54 65 73 74 20 | blank..6. Test | X| 70 72 61 67 6D 61 20 6F 70 70 6F 73 65 73 20 65 | pragma opposes e | X| 61 72 6C 69 65 72 20 70 72 61 67 6D 61 2E 0A 40 | arlier pragma..@ | X| 70 20 69 6E 64 65 6E 74 61 74 69 6F 6E 20 3D 20 | p indentation = | X| 62 6C 61 6E 6B 0A 0A 37 2E 20 54 65 73 74 20 70 | blank..7. Test p | X| 72 61 67 6D 61 20 64 6F 65 73 20 6E 6F 74 20 6F | ragma does not o | X| 70 70 6F 73 65 20 65 61 72 6C 69 65 72 20 70 72 | ppose earlier pr | X| 61 67 6D 61 2E 0A 40 70 20 69 6E 64 65 6E 74 61 | agma..@p indenta | X| 74 69 6F 6E 20 3D 20 6E 6F 6E 65 0A 0A | tion = none.. | X+-------------------------------------------------+------------------+ X X X=========================== Start of LINE LIST DUMP ============================ X Globl Local| Text X-----------+-------------------------------------------------------------------- X00001 00001| SC23: Test syntax checking of indentation pragma.<010> X00002 00002| <010> X00003 00003| 1. Test not three arguments.<010> X00004 00004| @p indentation<010> X00005 00005| @p indentation =<010> X00006 00006| @p indentation = xxx yyy<010> X00007 00007| <010> X00008 00008| 2. Test second argument not "=".<010> X00009 00009| @p indentation x sloth<010> X00010 00010| <010> X00011 00011| 3. Test third argument is not legal.<010> X00012 00012| @p indentation = sloth<010> X00013 00013| <010> X00014 00014| 4. Test third argument is none.<010> X00015 00015| @p indentation = none<010> X00016 00016| <010> X00017 00017| 5. Test third argument is blank.<010> X00018 00018| 6. Test pragma opposes earlier pragma.<010> X00019 00019| @p indentation = blank<010> X00020 00020| <010> X00021 00021| 7. Test pragma does not oppose earlier pragma.<010> X00022 00022| @p indentation = none<010> X00023 00023| <010> X00024 00024| <End-Of-File><010> X-----------+-------------------------------------------------------------------- Globl Local| Text X X============================ End of LINE LIST DUMP ============================= X X X=========================== Start of TOKEN LIST DUMP =========================== X Summary: There are 8 tokens in the token list. X Line[Column]: Token Description X------------------------------- X X0001[01]: Text. Text scrap[Grey]="SC23: Test syntax checking of indentation pragma.<010> X<010> X1. Test not three arguments.<010> X" X0007[01]: Text. Text scrap[Grey]="<010> X2. Test second argument not "=".<010> X" X0010[01]: Text. Text scrap[Grey]="<010> X3. Test third argument is not legal.<010> X" X0013[01]: Text. Text scrap[Grey]="<010> X4. Test third argument is none.<010> X" X0016[01]: Text. Text scrap[Grey]="<010> X5. Test third argument is blank.<010> X6. Test pragma opposes earlier pragma.<010> X" X0020[01]: Text. Text scrap[Grey]="<010> X7. Test pragma does not oppose earlier pragma.<010> X" X0023[01]: Text. Text scrap[White]="<010> X" X0024[01]: End Of File. X============================ End of TOKEN LIST DUMP ============================ X Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). X Global Local| Input File X------------+------------------------------------------------------------------- X 1 1| SC23: Test syntax checking of indentation pragma. X 2 2| X 3 3| 1. Test not three arguments. X 4 4| @p indentation X Error|.^This indentation pragma has the wrong number of arguments. X |.^The correct format is: "@p indentation = none|blank". X |.^Pragma ignored. X 5 5| @p indentation = X Error|.^This indentation pragma has the wrong number of arguments. X |.^The correct format is: "@p indentation = none|blank". X |.^Pragma ignored. X 6 6| @p indentation = xxx yyy X Error|.^This indentation pragma has the wrong number of arguments. X |.^The correct format is: "@p indentation = none|blank". X |.^Pragma ignored. X 7 7| X 8 8| 2. Test second argument not "=". X 9 9| @p indentation x sloth X |.^The correct format is: "@p indentation = none|blank". X |.^Pragma ignored. X Error|................^Expecting "=". X 10 10| X 11 11| 3. Test third argument is not legal. X 12 12| @p indentation = sloth X |.^The correct format is: "@p indentation = none|blank". X |.^Pragma ignored. X Error|..................^Expecting either "none" or "blank". X 13 13| X 14 14| 4. Test third argument is none. X 15 15| @p indentation = none X |.^This pragma is opposed by the pragma at line 19. X 16 16| X 17 17| 5. Test third argument is blank. X 18 18| 6. Test pragma opposes earlier pragma. X 19 19| @p indentation = blank X Error|.^This pragma opposes the pragma at line 15. X |.^You can have as many indentation pragmas as you like, X |.^but they all have to be the same! X |.^Pragma ignored. X 20 20| X 21 21| 7. Test pragma does not oppose earlier pragma. X 22 22| @p indentation = none X 23 23| X | <End-Of-File> X------------+------------------------------------------------------------------- X There were 6 Errors. END_OF_FILE if test 7027 -ne `wc -c <'answers/sc24.lis'`; then echo shar: \"'answers/sc24.lis'\" unpacked with wrong size! fi # end of 'answers/sc24.lis' fi if test -f 'answers/sc27.lis' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'answers/sc27.lis'\" else echo shar: Extracting \"'answers/sc27.lis'\" \(6024 characters\) sed "s/^X//" >'answers/sc27.lis' <<'END_OF_FILE' XFUNNELWEB LISTING FILE X====================== X Dump of mapped file "<<Suppressed>>". X MEMORY DUMP OF MAPPED FILE X========================== X X+-------------------------------------------------+------------------+ X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | X+-------------------------------------------------+------------------+ X| 53 43 32 37 3A 20 54 65 73 74 20 73 79 6E 74 61 | SC27: Test synta | X| 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 76 73 | x checking of vs | X| 6B 69 70 20 74 79 70 65 73 65 74 74 69 6E 67 20 | kip typesetting | X| 64 69 72 65 63 74 69 76 65 2E 0A 0A 31 2E 20 54 | directive...1. T | X| 65 73 74 20 6E 6F 74 20 65 78 61 63 74 6C 79 20 | est not exactly | X| 74 68 72 65 65 20 61 72 67 75 6D 65 6E 74 73 20 | three arguments | X| 28 69 6E 63 6C 75 64 65 73 20 76 73 6B 69 70 29 | (includes vskip) | X| 2E 0A 40 74 20 76 73 6B 69 70 0A 40 74 20 76 73 | ..@t vskip.@t vs | X| 6B 69 70 20 6F 6E 65 0A 40 74 20 76 73 6B 69 70 | kip one.@t vskip | X| 20 6F 6E 65 20 74 77 6F 20 74 68 72 65 65 20 66 | one two three f | X| 6F 75 72 0A 0A 32 2E 20 54 65 73 74 20 74 68 69 | our..2. Test thi | X| 72 64 20 61 72 67 75 6D 65 6E 74 20 6E 6F 74 20 | rd argument not | X| 22 6D 6D 22 2E 0A 40 74 20 76 73 6B 69 70 20 33 | "mm"..@t vskip 3 | X| 32 20 78 78 0A 0A 33 2E 20 54 65 73 74 20 73 65 | 2 xx..3. Test se | X| 63 6F 6E 64 20 61 72 67 75 6D 65 6E 74 20 68 61 | cond argument ha | X| 73 20 62 61 64 20 64 69 67 69 74 2E 0A 40 74 20 | s bad digit..@t | X| 76 73 6B 69 70 20 33 66 20 6D 6D 0A 0A 34 2E 20 | vskip 3f mm..4. | X| 54 65 73 74 20 6E 75 6D 62 65 72 20 68 61 73 20 | Test number has | X| 6D 6F 72 65 20 74 68 61 6E 20 74 68 72 65 65 20 | more than three | X| 64 69 67 69 74 73 0A 0A 40 74 20 76 73 6B 69 70 | digits..@t vskip | X| 20 34 33 35 35 20 6D 6D 0A 0A 35 2E 20 54 65 73 | 4355 mm..5. Tes | X| 74 20 61 20 6C 65 67 61 6C 20 6F 6E 65 20 74 6F | t a legal one to | X| 6F 2E 0A 40 74 20 76 73 6B 69 70 20 32 30 20 6D | o..@t vskip 20 m | X| 6D 0A 0A | m.. | X+-------------------------------------------------+------------------+ X X X=========================== Start of LINE LIST DUMP ============================ X Globl Local| Text X-----------+-------------------------------------------------------------------- X00001 00001| SC27: Test syntax checking of vskip typesetting directive.<010> X00002 00002| <010> X00003 00003| 1. Test not exactly three arguments (includes vskip).<010> X00004 00004| @t vskip<010> X00005 00005| @t vskip one<010> X00006 00006| @t vskip one two three four<010> X00007 00007| <010> X00008 00008| 2. Test third argument not "mm".<010> X00009 00009| @t vskip 32 xx<010> X00010 00010| <010> X00011 00011| 3. Test second argument has bad digit.<010> X00012 00012| @t vskip 3f mm<010> X00013 00013| <010> X00014 00014| 4. Test number has more than three digits<010> X00015 00015| <010> X00016 00016| @t vskip 4355 mm<010> X00017 00017| <010> X00018 00018| 5. Test a legal one too.<010> X00019 00019| @t vskip 20 mm<010> X00020 00020| <010> X00021 00021| <End-Of-File><010> X-----------+-------------------------------------------------------------------- Globl Local| Text X X============================ End of LINE LIST DUMP ============================= X X X=========================== Start of TOKEN LIST DUMP =========================== X Summary: There are 8 tokens in the token list. X Line[Column]: Token Description X------------------------------- X X0001[01]: Text. Text scrap[Grey]="SC27: Test syntax checking of vskip typesetting directive.<010> X<010> X1. Test not exactly three arguments (includes vskip).<010> X" X0007[01]: Text. Text scrap[Grey]="<010> X2. Test third argument not "mm".<010> X" X0010[01]: Text. Text scrap[Grey]="<010> X3. Test second argument has bad digit.<010> X" X0013[01]: Text. Text scrap[Grey]="<010> X4. Test number has more than three digits<010> X<010> X" X0017[01]: Text. Text scrap[Grey]="<010> X5. Test a legal one too.<010> X" X0019[01]: @t.. Vertical skip. Vertical space skipped=20mm. X0020[01]: Text. Text scrap[White]="<010> X" X0021[01]: End Of File. X============================ End of TOKEN LIST DUMP ============================ X Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). X Global Local| Input File X------------+------------------------------------------------------------------- X 1 1| SC27: Test syntax checking of vskip typesetting directive. X 2 2| X 3 3| 1. Test not exactly three arguments (includes vskip). X 4 4| @t vskip X Error|.^This directive has the wrong number of arguments. X |.^The correct format is: "@t vskip <num> mm". X |.^Directive ignored. X 5 5| @t vskip one X Error|.^This directive has the wrong number of arguments. X |.^The correct format is: "@t vskip <num> mm". X |.^Directive ignored. X 6 6| @t vskip one two three four X Error|.^This directive has the wrong number of arguments. X |.^The correct format is: "@t vskip <num> mm". X |.^Directive ignored. X 7 7| X 8 8| 2. Test third argument not "mm". X 9 9| @t vskip 32 xx X |.^The correct format is: "@t vskip <num> mm". X |.^Directive ignored. X Error|.............^Expecting "mm". X 10 10| X 11 11| 3. Test second argument has bad digit. X 12 12| @t vskip 3f mm X Error|...........^Illegal digit. X |...........^Value must consist entirely of decimal digits. X |...........^Directive ignored. X 13 13| X 14 14| 4. Test number has more than three digits X 15 15| X 16 16| @t vskip 4355 mm X Error|..........^Too many digits. The maximum is three. X |..........^Directive ignored. X 17 17| X 18 18| 5. Test a legal one too. X 19 19| @t vskip 20 mm X 20 20| X | <End-Of-File> X------------+------------------------------------------------------------------- X There were 6 Errors. END_OF_FILE if test 6024 -ne `wc -c <'answers/sc27.lis'`; then echo shar: \"'answers/sc27.lis'\" unpacked with wrong size! fi # end of 'answers/sc27.lis' fi if test -f 'answers/sc29.lis' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'answers/sc29.lis'\" else echo shar: Extracting \"'answers/sc29.lis'\" \(6904 characters\) sed "s/^X//" >'answers/sc29.lis' <<'END_OF_FILE' XFUNNELWEB LISTING FILE X====================== X Dump of mapped file "<<Suppressed>>". X MEMORY DUMP OF MAPPED FILE X========================== X X+-------------------------------------------------+------------------+ X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | X+-------------------------------------------------+------------------+ X| 53 43 32 39 3A 20 54 65 73 74 20 73 79 6E 74 61 | SC29: Test synta | X| 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 74 79 | x checking of ty | X| 70 65 73 65 74 74 65 72 20 70 72 61 67 6D 61 2E | pesetter pragma. | X| 0A 0A 31 2E 20 54 65 73 74 20 6E 6F 74 20 74 68 | ..1. Test not th | X| 72 65 65 20 61 72 67 75 6D 65 6E 74 73 2E 0A 40 | ree arguments..@ | X| 70 20 74 79 70 65 73 65 74 74 65 72 0A 40 70 20 | p typesetter.@p | X| 74 79 70 65 73 65 74 74 65 72 20 3D 0A 40 70 20 | typesetter =.@p | X| 74 79 70 65 73 65 74 74 65 72 20 3D 20 78 78 78 | typesetter = xxx | X| 20 79 79 79 0A 0A 32 2E 20 54 65 73 74 20 73 65 | yyy..2. Test se | X| 63 6F 6E 64 20 61 72 67 75 6D 65 6E 74 20 6E 6F | cond argument no | X| 74 20 22 3D 22 2E 0A 40 70 20 74 79 70 65 73 65 | t "="..@p typese | X| 74 74 65 72 20 78 20 73 6C 6F 74 68 0A 0A 33 2E | tter x sloth..3. | X| 20 54 65 73 74 20 74 68 69 72 64 20 61 72 67 75 | Test third argu | X| 6D 65 6E 74 20 69 73 20 6E 6F 74 20 6C 65 67 61 | ment is not lega | X| 6C 2E 0A 40 70 20 74 79 70 65 73 65 74 74 65 72 | l..@p typesetter | X| 20 3D 20 73 6C 6F 74 68 0A 0A 34 2E 20 54 65 73 | = sloth..4. Tes | X| 74 20 74 68 69 72 64 20 61 72 67 75 6D 65 6E 74 | t third argument | X| 20 69 73 20 6E 6F 6E 65 2E 0A 40 70 20 74 79 70 | is none..@p typ | X| 65 73 65 74 74 65 72 20 3D 20 6E 6F 6E 65 0A 0A | esetter = none.. | X| 35 2E 20 54 65 73 74 20 74 68 69 72 64 20 61 72 | 5. Test third ar | X| 67 75 6D 65 6E 74 20 69 73 20 74 65 78 2E 0A 36 | gument is tex..6 | X| 2E 20 54 65 73 74 20 70 72 61 67 6D 61 20 6F 70 | . Test pragma op | X| 70 6F 73 65 73 20 65 61 72 6C 69 65 72 20 70 72 | poses earlier pr | X| 61 67 6D 61 2E 0A 40 70 20 74 79 70 65 73 65 74 | agma..@p typeset | X| 74 65 72 20 3D 20 74 65 78 0A 0A 37 2E 20 54 65 | ter = tex..7. Te | X| 73 74 20 70 72 61 67 6D 61 20 64 6F 65 73 20 6E | st pragma does n | X| 6F 74 20 6F 70 70 6F 73 65 20 65 61 72 6C 69 65 | ot oppose earlie | X| 72 20 70 72 61 67 6D 61 2E 0A 40 70 20 74 79 70 | r pragma..@p typ | X| 65 73 65 74 74 65 72 20 3D 20 6E 6F 6E 65 0A 0A | esetter = none.. | X+-------------------------------------------------+------------------+ X X X=========================== Start of LINE LIST DUMP ============================ X Globl Local| Text X-----------+-------------------------------------------------------------------- X00001 00001| SC29: Test syntax checking of typesetter pragma.<010> X00002 00002| <010> X00003 00003| 1. Test not three arguments.<010> X00004 00004| @p typesetter<010> X00005 00005| @p typesetter =<010> X00006 00006| @p typesetter = xxx yyy<010> X00007 00007| <010> X00008 00008| 2. Test second argument not "=".<010> X00009 00009| @p typesetter x sloth<010> X00010 00010| <010> X00011 00011| 3. Test third argument is not legal.<010> X00012 00012| @p typesetter = sloth<010> X00013 00013| <010> X00014 00014| 4. Test third argument is none.<010> X00015 00015| @p typesetter = none<010> X00016 00016| <010> X00017 00017| 5. Test third argument is tex.<010> X00018 00018| 6. Test pragma opposes earlier pragma.<010> X00019 00019| @p typesetter = tex<010> X00020 00020| <010> X00021 00021| 7. Test pragma does not oppose earlier pragma.<010> X00022 00022| @p typesetter = none<010> X00023 00023| <010> X00024 00024| <End-Of-File><010> X-----------+-------------------------------------------------------------------- Globl Local| Text X X============================ End of LINE LIST DUMP ============================= X X X=========================== Start of TOKEN LIST DUMP =========================== X Summary: There are 8 tokens in the token list. X Line[Column]: Token Description X------------------------------- X X0001[01]: Text. Text scrap[Grey]="SC29: Test syntax checking of typesetter pragma.<010> X<010> X1. Test not three arguments.<010> X" X0007[01]: Text. Text scrap[Grey]="<010> X2. Test second argument not "=".<010> X" X0010[01]: Text. Text scrap[Grey]="<010> X3. Test third argument is not legal.<010> X" X0013[01]: Text. Text scrap[Grey]="<010> X4. Test third argument is none.<010> X" X0016[01]: Text. Text scrap[Grey]="<010> X5. Test third argument is tex.<010> X6. Test pragma opposes earlier pragma.<010> X" X0020[01]: Text. Text scrap[Grey]="<010> X7. Test pragma does not oppose earlier pragma.<010> X" X0023[01]: Text. Text scrap[White]="<010> X" X0024[01]: End Of File. X============================ End of TOKEN LIST DUMP ============================ X Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). X Global Local| Input File X------------+------------------------------------------------------------------- X 1 1| SC29: Test syntax checking of typesetter pragma. X 2 2| X 3 3| 1. Test not three arguments. X 4 4| @p typesetter X Error|.^This typesetter pragma has the wrong number of arguments. X |.^The correct format is: "@p typesetter = none|tex". X |.^Pragma ignored. X 5 5| @p typesetter = X Error|.^This typesetter pragma has the wrong number of arguments. X |.^The correct format is: "@p typesetter = none|tex". X |.^Pragma ignored. X 6 6| @p typesetter = xxx yyy X Error|.^This typesetter pragma has the wrong number of arguments. X |.^The correct format is: "@p typesetter = none|tex". X |.^Pragma ignored. X 7 7| X 8 8| 2. Test second argument not "=". X 9 9| @p typesetter x sloth X |.^The correct format is: "@p typesetter = none|tex". X |.^Pragma ignored. X Error|...............^Expecting "=". X 10 10| X 11 11| 3. Test third argument is not legal. X 12 12| @p typesetter = sloth X |.^The correct format is: "@p typesetter = none|tex". X |.^Pragma ignored. X Error|.................^Expecting either "none" or "tex". X 13 13| X 14 14| 4. Test third argument is none. X 15 15| @p typesetter = none X |.^This pragma is opposed by the pragma at line 19. X 16 16| X 17 17| 5. Test third argument is tex. X 18 18| 6. Test pragma opposes earlier pragma. X 19 19| @p typesetter = tex X Error|.^This pragma opposes the pragma at line 15. X |.^You can have as many typesetter pragmas as you like, X |.^but they all have to be the same! X |.^Pragma ignored. X 20 20| X 21 21| 7. Test pragma does not oppose earlier pragma. X 22 22| @p typesetter = none X 23 23| X | <End-Of-File> X------------+------------------------------------------------------------------- X There were 6 Errors. END_OF_FILE if test 6904 -ne `wc -c <'answers/sc29.lis'`; then echo shar: \"'answers/sc29.lis'\" unpacked with wrong size! fi # end of 'answers/sc29.lis' fi if test -f 'hackman/h_ch0.tex' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'hackman/h_ch0.tex'\" else echo shar: Extracting \"'hackman/h_ch0.tex'\" \(6015 characters\) sed "s/^X//" >'hackman/h_ch0.tex' <<'END_OF_FILE' X%==============================================================================% X% Start of Ch0.tex % X%==============================================================================% X% X% Copyright X% --------- X% Copyright (C) 1992 Ross N. Williams. X% This file contains a chapter of the FunnelWeb Hacker's Manual. X% See the main TeX file for this manual for further information. X% X%==============================================================================% X X\vbox{\relax} X\vfill X X\hrule X X\medskip X Copyright \copyright{} 1992 Ross~N.~Williams. X\xn{Ross}{Williams}\xx{copyright}{notice} X Permission is granted to make and distribute verbatim copies of this manual provided that the copyright notice and this permission notice are preserved on all copies.\note{This paragraph was copied from the GNU Emacs manual to avoid my having to get a legal opinion on something I could cook up.} X X\medskip X X\hrule X X\newpage X X%============================================================================== X X\tableofcontents X X\newpage X X%============================================================================== X X%I am not using LaTeX's figures and tables numbering so these are commented out. X%\pseudochapter{List of Figures} X%\pseudochapter{List of Tables} X X%============================================================================== X X% No forward. X%\pseudochapter{Foreword} X%\x{foreword} X X%============================================================================== X X\pseudochapter{Preface} X\x{preface} X This manual is for hackers! Anyone who wants to bash, diddle, frob, grind, mangle, patch, poke, toggle, twiddle, zap, or generally hack FunnelWeb should at least take a look at this manual. X This document has been created to serve two purposes: X X\begin{enumerate} X X\item To act as a repository for specific design and implementation information not appropriate to be included in program comments. X X\item To guide those interested in modifying the program. X X\end{enumerate} X As a result, this document has grown in fits and starts. This manual is not a particularly polished or well-balanced document but it should be of assistance to those (including myself) involved with modifying FunnelWeb. X X\bigskip X X\leftline{\b{Ross~N.~Williams}} X\leftline{\b{Adelaide, Australia}} X\leftline{\b{May~1992}} X X%============================================================================== X X\pseudochapter{Acknowledgements} X\x{acknowledgements} X Many thanks to \b{David Hulse}\xn{David}{Hulse} X(\p{dave@cs.adelaide.edu.au}) for translating the original version of FunnelWeb X(FunnelWeb~V1) from Ada\x{Ada} into~C and getting it to work on Unix and a PC. The C code written by David (FunnelWeb~V2) formed the basis of FunnelWeb~V3, but was entirely rewritten during the intensive refinement and feature-injection period leading up to this release (FunnelWeb~V3 is about three times the size of FunnelWeb~V2). Nevertheless, without this important first translation step, I would probably not have found the motivation to develop FunnelWeb to its present state. X Thanks go to \b{Simon Hackett}\xn{Simon}{Hackett} X(\p{simon@internode.com.au}) of Internode Systems Pty Ltd for the use of his Sun, Mac, and PC, for assistance in porting XFunnelWeb to the Sun and PC, and for helpful discussions. X Thanks go to \b{Jeremy Begg}\xn{Jeremy}{Begg} X(\p{jeremy@vsm.com.au}) of VSM Software Services for the use of his VAX, and for assistance with the VMS-specific code. X Thanks to \b{Barry Dwyer}\xn{Barry}{Dwyer} (\p{dwyer@cs.adelaide.edu.au}) and \b{Roger Brissenden}\xn{Roger}{Brissenden} (\p{rjb@koala.harvard.edu}) for trying out FunnelWeb Version~1 in 1987 and providing valuable feedback. X Thanks to Donald Knuth\xn{Donald}{Knuth} for establishing the idea of literate programming in the first place. X X\bigskip X X\leftline{\b{Ross~N.~Williams}} X\leftline{\b{Adelaide, Australia}} X\leftline{\b{May~1992}} X X%============================================================================== X X\pseudochapter{Presentation Notes} X\x{presentation notes} X X\thing{References:} All references are set in bold and are cited in square brackets in the form X\b{[}$<$\i{firstauthor}$><$\i{year}$>$\b{]}. All references cited in the text appear in the reference list and the index. X X\thing{Special terms:} New or important terminology has been set in bold face and appears in the index. X X\thing{Typesetting:} This\x{typesetting} document was prepared by the author using Andrew Trevorrow's\xn{Andrew}{Trevorrow} (\p{akt150@cscgpo.anu.edu.au})\checked{} implementation (OzTeX\x{OzTeX}) of the X\TeX{}/\LaTeX{}\paper{Knuth84}\paper{Lamport86}\x{TeX}\x{LaTeX} typesetting system running on a Macintosh-SE.\x{Macintosh} X X\thing{Graphics:} All diagrams have been constructed out of text using the \LaTeX{}\x{LaTeX} \p{verbatim} environment so as to allow this document to be disseminated electronically and printed using \LaTeX{} without access to the author's drawing tools. X X% I think I've got rid of all the fix-it-up footnotes. X%\thing{Correction footnotes:} Footnotes\x{footnotes} X%commencing with dots ($\bullet$) are X%notes to remind the author about something in the document that must be X%attended to.\fix{This is an example of such a footnote.} These footnotes X%will be attended to and eliminated in later versions. X X\thing{Known typesetting problems:} While every attempt has been made to give a good presentation within the time available, some shortcuts have had to be taken. In particular, the author has been unable to work out how to get \LaTeX{} to suppress blank pages at the start of chapters. X X%============================================================================== X X% No abstract. X%\pseudochapter{Abstract} X%\x{abstract} X X%==============================================================================% X% End of Ch0.tex % X%==============================================================================% END_OF_FILE if test 6015 -ne `wc -c <'hackman/h_ch0.tex'`; then echo shar: \"'hackman/h_ch0.tex'\" unpacked with wrong size! fi # end of 'hackman/h_ch0.tex' fi if test -f 'hackman/h_manual.aux' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'hackman/h_manual.aux'\" else echo shar: Extracting \"'hackman/h_manual.aux'\" \(7539 characters\) sed "s/^X//" >'hackman/h_manual.aux' <<'END_OF_FILE' X\relax X\@writefile{toc}{\string\contentsline\space {chapter}{Preface}{5}} X\@writefile{toc}{\string\contentsline\space {chapter}{Acknowledgements}{7}} X\@writefile{toc}{\string\contentsline\space {chapter}{Presentation Notes}{9}} X\@writefile{toc}{\string\contentsline\space {chapter}{\string\numberline\space {1}FunnelWeb Design}{11}} X\@writefile{lof}{\string\addvspace\space {10pt}} X\@writefile{lot}{\string\addvspace\space {10pt}} X\newlabel{chapdesign}{{1}{11}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {1.1}Motivation for FunnelWeb}{11}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {1.2}Indentation}{12}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {1.3}Review of FunnelWeb Syntax}{14}} X\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {1.3.1}Review of Macro Definition Syntax}{14}} X\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {1.3.2}Review of Macro Call Syntax}{16}} X\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {1.3.3}Review of Parameterized Macro Call Syntax}{16}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {1.4}Document Structuring}{16}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {1.5}Discussion of Some Miscellaneous Issues}{18}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {1.6}Automated Regression Testing}{18}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {1.7}Command Line Interface}{18}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {1.8}File Name Management}{19}} X\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {1.8.1}Filename Extensions}{20}} X\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {1.8.2}Filename Inheritance}{20}} X\@writefile{toc}{\string\contentsline\space {subsection}{\string\numberline\space {1.8.3}Portable Structure of File Names}{21}} X\newlabel{portablefilenames}{{1.8.3}{21}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {1.9}Specifying Constraints on the Number of Instantiations}{22}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {1.10}The Relationship Between Document Structure and Macro Structure}{23}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {1.11}Diagnostic Messages}{25}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {1.12}Summary}{25}} X\@writefile{toc}{\string\contentsline\space {chapter}{\string\numberline\space {2}FunnelWeb Implementation}{27}} X\@writefile{lof}{\string\addvspace\space {10pt}} X\@writefile{lot}{\string\addvspace\space {10pt}} X\newlabel{chapimplementation}{{2}{27}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {2.1}Introduction}{27}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {2.2}History of FunnelWeb Implementations}{27}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {2.3}Why FunnelWeb Wasn't Used to Write Itself}{28}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {2.4}Coding Style}{28}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {2.5}Use of Memory}{29}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {2.6}The Heap}{29}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {2.7}The Stack}{30}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {2.8}Static Variables}{30}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {2.9}Implementing Text Indentation}{30}} X\@writefile{toc}{\string\contentsline\space {chapter}{\string\numberline\space {3}FunnelWeb Modification}{35}} X\@writefile{lof}{\string\addvspace\space {10pt}} X\@writefile{lot}{\string\addvspace\space {10pt}} X\newlabel{chapmod}{{3}{35}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {3.1}Introduction}{35}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {3.2}The Danger of Modifying Languages}{35}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {3.3}Authority vs User Security}{36}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {3.4}What I Want to Protect}{37}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {3.5}Modifying the Manuals}{38}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {3.6}How Copyright Law Works}{38}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {3.7}Management of the Official FunnelWeb}{39}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {3.8}A GNU Version?}{41}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {3.9}Summary}{41}} X\@writefile{toc}{\string\contentsline\space {chapter}{\string\numberline\space {4}FunnelWeb Future}{43}} X\@writefile{lof}{\string\addvspace\space {10pt}} X\@writefile{lot}{\string\addvspace\space {10pt}} X\newlabel{chapfuture}{{4}{43}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.1}Documentation}{43}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.2}Command Line Interface}{43}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.3}Shell Interpreter}{43}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.4}Language Design}{44}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.5}Scanner/Mapper}{44}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.6}Parser}{45}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.7}Analyser}{45}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.8}Tangle}{45}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.9}Weave}{45}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.10}Lister}{46}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.11}Diagnostics}{47}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.12}Speed}{47}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.13}Correctness}{47}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.14}Test Suite}{47}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.15}Machine-Specific Changes}{48}} X\@writefile{toc}{\string\contentsline\space {section}{\string\numberline\space {4.16}Summary}{48}} X\@writefile{toc}{\string\contentsline\space {chapter}{\string\numberline\space {A}GNU General Public License Version 2}{49}} X\@writefile{lof}{\string\addvspace\space {10pt}} X\@writefile{lot}{\string\addvspace\space {10pt}} X\@writefile{toc}{\string\contentsline\space {chapter}{\string\numberline\space {B}References}{57}} X\@writefile{lof}{\string\addvspace\space {10pt}} X\@writefile{lot}{\string\addvspace\space {10pt}} X\@writefile{toc}{\string\contentsline\space {chapter}{Index}{57}} END_OF_FILE if test 7539 -ne `wc -c <'hackman/h_manual.aux'`; then echo shar: \"'hackman/h_manual.aux'\" unpacked with wrong size! fi # end of 'hackman/h_manual.aux' fi if test -f 'hackman/h_manual.log' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'hackman/h_manual.log'\" else echo shar: Extracting \"'hackman/h_manual.log'\" \(4470 characters\) sed "s/^X//" >'hackman/h_manual.log' <<'END_OF_FILE' This is TeX, Version 3.0 (preloaded format=lplain 90.9.16) 27 MAY 1992 12:56 X**&LaTeX h_manual.tex X(h_manual.tex LaTeX Version 2.09 <13 Jun 1989> X(:TeX-inputs:book.sty Document Style `book' <24 May 89>. X(:TeX-inputs:bk10.sty) X\descriptionmargin=\dimen99 X\c@part=\count78 X\c@chapter=\count79 X\c@section=\count80 X\c@subsection=\count81 X\c@subsubsection=\count82 X\c@paragraph=\count83 X\c@subparagraph=\count84 X\c@figure=\count85 X\c@table=\count86 X) (:TeX-inputs:titlepage.sty) [0 X X X] X\@indexfile=\write3 X Writing index file h_manual.idx X(h_manual.aux) X(h_ch0.tex [1] [2 X X] (h_manual.toc [3]) X\tf@toc=\write4 X [4] [5 X X] [6 X X] Underfull \hbox (badness 10000) in paragraph at lines 120--123 X[]\tenrm Thanks to \tenbf Barry Dwyer[][] \tenrm (\tentt dwyer@cs.adelaide.edu. au\tenrm ) and \tenbf Roger Bris-senden[][] X X\hbox(7.5+2.5)x426.79134, glue set 5.25278 X.\hbox(0.0+0.0)x0.0 X.\tenrm T X.\tenrm h X.\tenrm a X.\tenrm n X.etc. X X[7] [8 X X] Underfull \hbox (badness 5652) in paragraph at lines 146--152 X[]\tenbf Typesetting: \tenrm This[] doc-u-ment was pre-pared by the au-thor us- ing An-drew Trevor- X X\hbox(6.94444+1.94444)x426.79134, glue set 3.83969 X.\hbox(0.0+0.0)x0.0 X.\tenbf T X.\kern-0.31944 X.\tenbf y X.\tenbf p X.etc. X X Underfull \hbox (badness 1117) in paragraph at lines 146--152 X\tenrm row's[][] (\tentt akt150@cscgpo.anu.edu.au\tenrm ) im-ple-men-ta-tion (O z-TeX[]) of the T[]X/L[]T[]X\tenbf [Knuth84][] X X\hbox(7.5+3.01385)x426.79134, glue set 2.23746 X.\tenrm r X.\tenrm o X.\kern-0.27779 X.\tenrm w X.\tenrm ' X.etc. X X) (h_ch1.tex [9] [10 X X] Chapter 1. X[11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24]) X(h_ch2.tex [25] [26 X X] Chapter 2. X[27] [28] [29] [30] [31] [32]) (h_ch3.tex [33] [34 X X] Chapter 3. X[35] [36] [37] [38] [39] [40]) (h_ch4.tex [41] [42 X X] Chapter 4. X[43] [44] [45] [46] [47]) (h_cha.tex [48] Appendix A. X[49 X X] Underfull \vbox (badness 10000) has occurred while \output is active X\vbox(682.86613+0.0)x426.79134 X.\glue(\topskip) 10.0 X.\hbox(0.0+0.0)x0.0 X.\glue(\parskip) 0.0 X.\glue(\baselineskip) 5.88889 X.\hbox(6.11111+2.22223)x426.79134, glue set 80.29436fil X..\hbox(0.0+0.0)x0.0 X..\penalty 10000 X..\glue 5.24995 X..\penalty 10000 X..\glue 5.24995 X..etc. X.etc. X X [50] Underfull \vbox (badness 10000) has occurred while \output is active X\vbox(682.86613+0.0)x426.79134 X.\glue(\topskip) 10.0 X.\hbox(0.0+0.0)x0.0 X.\glue(\parskip) 0.0 X.\glue(\baselineskip) 5.88889 X.\hbox(6.11111+2.22223)x426.79134, glue set 64.5445fil X..\hbox(0.0+0.0)x0.0 X..\penalty 10000 X..\glue 5.24995 X..\penalty 10000 X..\glue 5.24995 X..etc. X.etc. X X [51] Underfull \vbox (badness 10000) has occurred while \output is active X\vbox(682.86613+0.0)x426.79134 X.\glue(\topskip) 3.88889 X.\hbox(6.11111+0.0)x426.79134, glue set 64.5445fil X..\hbox(0.0+0.0)x0.0 X..\penalty 10000 X..\glue 5.24995 X..\penalty 10000 X..\glue 5.24995 X..etc. X.\glue(\parskip) 0.0 X.\glue(\baselineskip) 5.88889 X.\hbox(6.11111+2.22223)x426.79134, glue set 164.29362fil X..\hbox(0.0+0.0)x0.0 X..\penalty 10000 X..\glue 5.24995 X..\penalty 10000 X..\glue 5.24995 X..etc. X.etc. X X [52] Underfull \vbox (badness 10000) has occurred while \output is active X\vbox(682.86613+0.0)x426.79134 X.\glue(\topskip) 3.88889 X.\hbox(6.11111+2.22223)x426.79134, glue set 59.29454fil X..\hbox(0.0+0.0)x0.0 X..\tentt L X..\tentt i X..\tentt c X..\tentt e X..etc. X.\glue(\parskip) 0.0 X.\glue(\baselineskip) 3.66666 X.\hbox(6.11111+2.22223)x426.79134, glue set 90.79427fil X..\hbox(0.0+0.0)x0.0 X..\tentt m X..\tentt a X..\tentt y X..\penalty 10000 X..etc. X.etc. X X [53] Underfull \vbox (badness 10000) has occurred while \output is active X\vbox(682.86613+0.0)x426.79134 X.\glue(\topskip) 3.88889 X.\hbox(6.11111+1.38887)x426.79134, glue set 38.29472fil X..\hbox(0.0+0.0)x0.0 X..\penalty 10000 X..\glue 5.24995 X..\penalty 10000 X..\glue 5.24995 X..etc. X.\glue(\parskip) 0.0 X.\glue(\baselineskip) 4.50002 X.\hbox(6.11111+1.38887)x426.79134, glue set 48.79463fil X..\hbox(0.0+0.0)x0.0 X..\tentt F X..\tentt O X..\tentt R X..\penalty 10000 X..etc. X.etc. X X [54] X[55] [56 X X] Appendix B. X[57] (h_manual.sin [58 X X] [59] [60]) [61 X X]) (h_manual.aux) ) Here is how much of TeX's memory you used: X 220 strings out of 1960 X 1908 string characters out of 13235 X 54264 words of memory out of 60001 X 2151 multiletter control sequences out of 2500 X 19914 words of font info for 75 fonts, out of 27000 for 100 X 14 hyphenation exceptions out of 307 X 15i,6n,15p,200b,226s stack positions out of 200i,40n,60p,500b,600s X Output written on h_manual.dvi (62 pages, 181584 bytes). END_OF_FILE if test 4470 -ne `wc -c <'hackman/h_manual.log'`; then echo shar: \"'hackman/h_manual.log'\" unpacked with wrong size! fi # end of 'hackman/h_manual.log' fi if test -f 'sources/as.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sources/as.h'\" else echo shar: Extracting \"'sources/as.h'\" \(6214 characters\) sed "s/^X//" >'sources/as.h' <<'END_OF_FILE' X/*############################################################################## X XFUNNNELWEB COPYRIGHT X==================== XFunnelWeb is a literate-programming macro preprocessor. X Copyright (C) 1992 Ross N. Williams. X X Ross N. Williams X ross@spam.adelaide.edu.au X 16 Lerwick Avenue, Hazelwood Park 5066, Australia. X This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation. X This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. X You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can FTP the license from prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. X Programmers: X RNW Ross N. Williams ross@spam.adelaide.edu.au X Changes: X 07-May-1992 RNW Program prepared for release under GNU GPL V2. X X##############################################################################*/ X X X/******************************************************************************/ X/* AS.H */ X/******************************************************************************/ X/* */ X/* ASSERTION PACKAGE */ X/* ================= */ X/* This package contains macros and functions that support assertions. An */ X/* assertion is a boolean condition that is supposed always to be true at a */ X/* particular point during program execution. An assertion statement tests */ X/* such a condition and bombs the program if it is false; better to be */ X/* alerted to such a condition rather than suffer and erroneous execution. */ X/* */ X/* Standard C supports asertions with the <assert.h> header file providing */ X/* the "assert" macro. Unfortunately, this does not meet the needs of */ X/* FunnelWeb for two reasons: */ X/* */ X/* 1) Portability is emphasised in FunnelWeb and the assert macro is fairly */ X/* recent. Its only argument is the boolean condition, which means that */ X/* without the ANSI macros __FILE__ and __LINE__, the macro would be */ X/* unable to indicate where an assertion failure occurred, in a non-ANSI */ X/* environment. */ X/* */ X/* 2) There is only one assert macro and it can be either on or off, the */ X/* implication being that in production code, it should be turned off. In */ X/* contrast, the execution speed of the assert macro will usually matter */ X/* only in a small portion of the code as, in most programs, a small */ X/* portion of the code accounts for most of the execution time. By having */ X/* two categories of assertion, we can leave most of the assertions turned */ X/* on in the production program. */ X/* */ X/* This reasoning leads to the slightly different assertion facilty provided */ X/* by this package. Here, there are two assertion routines/macros, HOT */ X/* assertions for HOT code (code in a program hot spot) and COLD assertions */ X/* for COLD code (not in a hot spot). Only the HOT assertions can be turned */ X/* off. */ X/* */ X/******************************************************************************/ X X/* Ensure that the body of this header file is included at most once. */ X#ifndef DONE_AS X#define DONE_AS X X/******************************************************************************/ X X#include "style.h" X X/******************************************************************************/ X X/* The following #define determines whether hot assertions are to be turned */ X/* on or off. Set to 0 for OFF and 1 for ON. */ X/* Note: I have left hot assertions on in the production version as FunnelWeb */ X/* doesn't go slowly enough to make me want to turn it off. */ X#define AS_DOHOT 1 X X/******************************************************************************/ X XEXPORT void as_bomb P_((char *)); X/* This function writes out its argument string and then bombs the program. */ X/* It should be called at any point where it has been determined that an */ X/* illegal condition has been detected. The other assertion routines/macros */ X/* call this function. */ X X/* The following two macros define hot and cold assertions. Be sure never to */ X/* call them with arguments with side effects! */ X#define as_cold(e,s) {if (!(e)) as_bomb(s);} X X#if AS_DOHOT X#define as_hot(e,s) {if (!(e)) as_bomb(s);} X#define AS_HCODE(CODE) {CODE} X#else X#define as_hot(e,s) ((void) 0) X#define AS_HCODE(CODE) ((void) 0) X#endif X X/******************************************************************************/ X X/* For #ifndef preventing multiple inclusion of the body of this header file. */ X#endif X X/******************************************************************************/ X/* AS.H */ X/******************************************************************************/ END_OF_FILE if test 6214 -ne `wc -c <'sources/as.h'`; then echo shar: \"'sources/as.h'\" unpacked with wrong size! fi # end of 'sources/as.h' fi if test -f 'sources/clock.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sources/clock.h'\" else echo shar: Extracting \"'sources/clock.h'\" \(5042 characters\) sed "s/^X//" >'sources/clock.h' <<'END_OF_FILE' X/*############################################################################## X XFUNNNELWEB COPYRIGHT X==================== XFunnelWeb is a literate-programming macro preprocessor. X Copyright (C) 1992 Ross N. Williams. X X Ross N. Williams X ross@spam.adelaide.edu.au X 16 Lerwick Avenue, Hazelwood Park 5066, Australia. X This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation. X This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. X You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can FTP the license from prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. X Programmers: X RNW Ross N. Williams ross@spam.adelaide.edu.au X Changes: X 07-May-1992 RNW Program prepared for release under GNU GPL V2. X X##############################################################################*/ X X X/******************************************************************************/ X/* CLOCK.H */ X/******************************************************************************/ X/* */ X/* This package implements a clock abstraction that is used to generate */ X/* timing statistics which are useful for performance tuning. The package */ X/* allows the measurement of both real and CPU time. This package gets its */ X/* raw information from the tim_cpu() and tim_real() functions of the machine */ X/* dependent module "machin". */ X/* */ X/******************************************************************************/ X X/* Ensure that the body of this header file is included at most once. */ X#ifndef DONE_CLOCK X#define DONE_CLOCK X X/******************************************************************************/ X X#include "style.h" X X/******************************************************************************/ X X/* The following clock type is supposed to be an ADT so don't frob any of its */ X/* fields manually! */ typedef struct X { X ulong ck_mhead; /* Magic number helps detect corruptions. */ X bool ck_run; /* TRUE iff the clock is running. */ X float ck_csum; /* Accumulated CPU time. */ X float ck_rsum; /* Accumulated real time. */ X float ck_csta; /* ck_run => CPU time when clock was started. */ X float ck_rsta; /* ck_run => Real time when clock was started. */ X ulong ck_mtail; /* Magic number helps detect corruptions. */ X } ck_t; X typedef ck_t *p_ck_t; X X/******************************************************************************/ X XEXPORT void ck_ini P_((p_ck_t)); X/* Initializes the clock. After this call, the argument clock will be in the */ X/* STOPPED state and all its registers will be zero. A clock must be */ X/* initialized before any other operations are performed on it. */ X XEXPORT void ck_start P_((p_ck_t)); X/* Changes the clock from the STOPPED state to the RUNNING state. Starts */ X/* accumulating real time and CPU time on its registers. */ X/* Raises an error if the clock is not in the STOPPED state. */ X XEXPORT void ck_stop P_((p_ck_t)); X/* Changes the clock from the RUNNING state to the STOPPED state. Stops */ X/* accumulating real time and CPU time on its registers. */ X/* Raises an error if the clock is not in the RUNNING state. */ X XEXPORT float ck_cpu P_((p_ck_t)); X/* Returns the number of seconds of CPU time accumulated on the clock. */ X/* Raises an error if the clock is not in the STOPPED state. */ X XEXPORT float ck_real P_((p_ck_t)); X/* Returns the number of seconds of real time accumulated on the clock. */ X/* Raises an error if the clock is not in the STOPPED state. */ X X/******************************************************************************/ X X/* For #ifndef preventing multiple inclusion of the body of this header file. */ X#endif X X/******************************************************************************/ X/* End of CLOCK.H */ X/******************************************************************************/ END_OF_FILE if test 5042 -ne `wc -c <'sources/clock.h'`; then echo shar: \"'sources/clock.h'\" unpacked with wrong size! fi # end of 'sources/clock.h' fi if test -f 'sources/help_gnu.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sources/help_gnu.c'\" else echo shar: Extracting \"'sources/help_gnu.c'\" \(4941 characters\) sed "s/^X//" >'sources/help_gnu.c' <<'END_OF_FILE' X/*############################################################################## X XFUNNNELWEB COPYRIGHT X==================== XFunnelWeb is a literate-programming macro preprocessor. X Copyright (C) 1992 Ross N. Williams. X X Ross N. Williams X ross@spam.adelaide.edu.au X 16 Lerwick Avenue, Hazelwood Park 5066, Australia. X This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation. X This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. X You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can FTP the license from prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. X Programmers: X RNW Ross N. Williams ross@spam.adelaide.edu.au X Changes: X 07-May-1992 RNW Program prepared for release under GNU GPL V2. X X##############################################################################*/ X X X/******************************************************************************/ X/* HELP_GNU.C */ X/******************************************************************************/ X/* */ X/* REPRESENTING MESSAGES AS C CODE */ X/* =============================== */ X/* Experience has shown that it is much more reliable to code text messages */ X/* into a program than to expect the program to track down text files */ X/* containing the messages at run time. Worthwhile for smallish files (such */ X/* as these help messages) at least. For this reason, all the messages in */ X/* this module are represented by code (e.g. as in printf statements). */ X/* */ X/* There is no difficulty turning a short message into code; simply place it */ X/* in output statements. However, large messages (e.g. the GNU license) are */ X/* more tedious, and also present more of a problem if it is necessary to */ X/* change them substantially at a later date. This problem has been solved in */ X/* FunnelWeb by writing a small program that reads a text file and writes out */ X/* C code that writes the text file. The files involved are: */ X/* */ X/* help_gnu.mes - The original message. */ X/* help_gnu.c - C code to write out the original message. */ X/* */ X/* To turn help_gnu.mes into help_gnu.c, give the following command in */ X/* FunnelWeb interactive mode: codify help_gnu.txt help_gnu.c */ X/* */ X/******************************************************************************/ X X#include "style.h" X X#include "help_gnu.h" X X/******************************************************************************/ X X/* This module contains many many output statements that call an output */ X/* function. To neaten up all these calls, we define a global variable to */ X/* hold a pointer to the function and simple macro to write output using */ X/* the function. */ LOCVAR void (*pf) P_((char *)); X X#define WX(STR) (*pf)(STR);(*pf)("\n") X#define WY(STR) (*pf)(STR) X X/******************************************************************************/ X XEXPORT void hel_gnu (p_outf) void (*p_outf) P_((char *)); X{ X pf=p_outf; X WY("\n"); X WY("FunnelWeb License\n"); X WY("-----------------\n"); X WY("FunnelWeb is distributed under the following license.\n"); X WY("\n"); X WY("--<Start of GNU License>--\n"); X#include "help_gnu.ctx" X WY("--<End of GNU License>--\n"); X WY("\n"); X WY("If all that scrolled off your screen too quickly, don't worry. You can\n"); X WY("capture this message (or any other FunnelWeb output) in a file by\n"); X WY("specifying the +J option when you invoke FunnelWeb. For example:\n"); X WY("\n"); X WY(" fw +hlicense +jresult.txt\n"); X WY("\n"); X} X X/******************************************************************************/ X/* End of HELP_GNU.C */ X/******************************************************************************/ END_OF_FILE if test 4941 -ne `wc -c <'sources/help_gnu.c'`; then echo shar: \"'sources/help_gnu.c'\" unpacked with wrong size! fi # end of 'sources/help_gnu.c' fi if test -f 'sources/memory.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sources/memory.h'\" else echo shar: Extracting \"'sources/memory.h'\" \(6298 characters\) sed "s/^X//" >'sources/memory.h' <<'END_OF_FILE' X/*############################################################################## X XFUNNNELWEB COPYRIGHT X==================== XFunnelWeb is a literate-programming macro preprocessor. X Copyright (C) 1992 Ross N. Williams. X X Ross N. Williams X ross@spam.adelaide.edu.au X 16 Lerwick Avenue, Hazelwood Park 5066, Australia. X This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation. X This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. X You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can FTP the license from prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. X Programmers: X RNW Ross N. Williams ross@spam.adelaide.edu.au X Changes: X 07-May-1992 RNW Program prepared for release under GNU GPL V2. X X##############################################################################*/ X X X/******************************************************************************/ X/* MEMORY.H */ X/******************************************************************************/ X/* */ X/* Introduction */ X/* ------------ */ X/* This package provides a memory management facility for FunnelWeb. */ X/* The conventional MALLOC does not suit the needs of FunnelWeb. The */ X/* following notes give an idea of why: */ X/* */ X/* 1. At the times where FunnelWeb requires memory, it is nearly always */ X/* the case that failure to provide the memory should result in a bomb. */ X/* It therefore makes sense to wrap MALLOC up inside another function */ X/* that, at the very least, checks the status from malloc and bombs */ X/* the program if the requested memory is not available. */ X/* */ X/* 2. Because FunnelWeb proper can be invoked an indefinite number of */ X/* times from the FunnelWeb command interpreter, it is very important */ X/* to reclaim all the memory used by each invocation. This could be */ X/* done by explicitly tearing apart the data structures constructed */ X/* for each run. However, this is very messy, requiring detailed */ X/* knowledge of the data structures. A far simpler, safer scheme is to */ X/* arrange for a memory manager to keep track of all the memory that it */ X/* allocates and to provide a single call to free it all. This facility */ X/* is provided by this package. */ X/* */ X/* 3. In addition to the TEMPORARY memory allocations described in (2) above, */ X/* it should also be possible to make permanent allocations. */ X/* */ X/* 4. FunnelWeb uses linked lists a lot and hence will make many requests */ X/* for small chunks of memory (e.g 10 bytes). Legend has it that some */ X/* malloc libraries are very inefficient in this case, and that it is */ X/* better to use malloc to allocate a large chunk of memory and dole it */ X/* out yourself. This package does this too. */ X/* */ X/* For all these reasons, FunnelWeb memory management has been handed over to */ X/* this package which provides services that satisfy the conditions outlined */ X/* above. */ X/* */ X/******************************************************************************/ X X/* Ensure that the body of this header file is included at most once. */ X#ifndef DONE_MEMORY X#define DONE_MEMORY X X/******************************************************************************/ X X#include "style.h" X X/******************************************************************************/ X XEXPORT p_void mm_perm P_((size_t)); X/* Allocates a block of memory of the specified size (specified in bytes) and */ X/* returns a pointer to the new block of memory. Bombs the program if the */ X/* memory is not available. Memory allocated using mm_perm is permanently */ X/* allocated and cannot be freed. */ X XEXPORT p_void mm_temp P_((size_t)); X/* Allocates a block of memory of the specified size (specified in bytes) and */ X/* returns a pointer to the new block of memory. Bombs the program if the */ X/* memory is not available. Memory allocated using this function can later be */ X/* freed in its entirely by making a call to mm_zapt. */ X XEXPORT void mm_zapt P_((void)); X/* This function can be called at any time. Its effect is to free up all the */ X/* memory allocated using mm_temp since the last call to mm_zapt or the start */ X/* of the program, whichever is the more recent. */ X X/******************************************************************************/ X X/* For #ifndef preventing multiple inclusion of the body of this header file. */ X#endif X X/******************************************************************************/ X/* End of MEMORY.H */ X/******************************************************************************/ END_OF_FILE if test 6298 -ne `wc -c <'sources/memory.h'`; then echo shar: \"'sources/memory.h'\" unpacked with wrong size! fi # end of 'sources/memory.h' fi if test -f 'sources/misc.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sources/misc.c'\" else echo shar: Extracting \"'sources/misc.c'\" \(6635 characters\) sed "s/^X//" >'sources/misc.c' <<'END_OF_FILE' X/*############################################################################## X XFUNNNELWEB COPYRIGHT X==================== XFunnelWeb is a literate-programming macro preprocessor. X Copyright (C) 1992 Ross N. Williams. X X Ross N. Williams X ross@spam.adelaide.edu.au X 16 Lerwick Avenue, Hazelwood Park 5066, Australia. X This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation. X This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. X You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can FTP the license from prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. X Programmers: X RNW Ross N. Williams ross@spam.adelaide.edu.au X Changes: X 07-May-1992 RNW Program prepared for release under GNU GPL V2. X X##############################################################################*/ X X X/******************************************************************************/ X/* MISC.C */ X/******************************************************************************/ X X#include <ctype.h> X#include "style.h" X X#include "as.h" X#include "data.h" X#include "memory.h" X#include "misc.h" X#include "writfile.h" X X/******************************************************************************/ X XEXPORT void wr_s (s) char *s; {wf_wr(&f_s,s);} XEXPORT void wr_j (s) char *s; {wf_wr(&f_j,s);} XEXPORT void wr_l (s) char *s; {wf_wr(&f_l,s);} X XEXPORT void wl_s (s) char *s; {wf_wr(&f_s,s); wf_wr(&f_s,"\n");} XEXPORT void wl_j (s) char *s; {wf_wr(&f_j,s); wf_wr(&f_j,"\n");} XEXPORT void wl_l (s) char *s; {wf_wr(&f_l,s); wf_wr(&f_l,"\n");} X XEXPORT void wr_sj (s) char *s; {wr_s(s); wr_j(s);} XEXPORT void wl_sj (s) char *s; {wl_s(s); wl_j(s);} X XEXPORT void wr_sjl(s) char *s; {wr_s(s); wr_j(s); wr_l(s);} XEXPORT void wl_sjl(s) char *s; {wl_s(s); wl_j(s); wl_l(s);} X X/******************************************************************************/ X XEXPORT char *chabbrev(ch) int ch; X{ X switch (ch) X { X case 0: return "NUL"; X case 1: return "SOH"; X case 2: return "STX"; X case 3: return "ETX"; X case 4: return "EOT"; X case 5: return "ENQ"; X case 6: return "ACK"; X case 7: return "BEL"; X case 8: return "BS"; X case 9: return "HT"; X case 10: return "LF"; X case 11: return "VT"; X case 12: return "FF"; X case 13: return "CR"; X case 14: return "SO"; X case 15: return "SI"; X case 16: return "DLE"; X case 17: return "DC1"; X case 18: return "DC2"; X case 19: return "DC3"; X case 20: return "DC4"; X case 21: return "NAK"; X case 22: return "SYN"; X case 23: return "ETB"; X case 24: return "CAN"; X case 25: return "EM"; X case 26: return "SUB"; X case 27: return "ESC"; X case 28: return "FS"; X case 29: return "GS"; X case 30: return "RS"; X case 31: return "US"; X case 127:return "DEL"; X default: return ""; X } X} X X/******************************************************************************/ X XEXPORT sign signof(n) long n; X{ X if (n<0) return -1; X if (n>0) return 1; X return 0; X} X X/******************************************************************************/ X XEXPORT char * eq_files(name1,name2,p_result) char *name1; char *name2; bool *p_result; X{ X FILE *file1; X FILE *file2; X X /* The following three lines define two comparison buffers. The next part of */ X /* the two files being compared are read into these buffers and compared. */ X /* Using the buffers allows bulk reads, which speeds things up considerably. */ X#define CMPBUFSIZ 16384 X STAVAR ubyte_ *buf1 = NULL; X STAVAR ubyte_ *buf2 = NULL; X X /* Set the default result to be FALSE (no match). */ X *p_result=FALSE; X X /* Allocate the comparison buffers if they are not already allocated. */ X if (buf1 == NULL) X { X buf1=(ubyte_ *) mm_perm((size_t) CMPBUFSIZ); X buf2=(ubyte_ *) mm_perm((size_t) CMPBUFSIZ); X } X X /* Open, for binary reading, the two files to be compared. */ X file1=fopen(name1,"rb"); X if (file1 == FOPEN_F) X return "Error opening the first file."; X file2=fopen(name2,"rb"); X if (file2 == FOPEN_F) X {fclose(file1);return "Error opening the second file.";} X X while (TRUE) X { /* Compare a chunk. */ X size_t len1; X size_t len2; X X /* Read a chunk from each file. */ X len1=fread(buf1,(size_t) 1,(size_t) CMPBUFSIZ,file1); X len2=fread(buf2,(size_t) 1,(size_t) CMPBUFSIZ,file2); X if (ferror(file1)) X return "Compare: Error reading the first file."; X if (ferror(file2)) X return "Compare: Error reading the second file."; X X /* Compare the two chunks. */ X if (len1 != len2) break; X if (len1 == 0) {*p_result=TRUE; break;} X if (memcmp(buf1,buf2,(size_t) len1) != 0) break; X } X X if (fclose(file1) == FCLOSE_F) X {*p_result=FALSE; return "Error closing the first file.";} X if (fclose(file2) == FCLOSE_F) X {*p_result=FALSE; return "Error closing the second file.";} X X /* If we have reached this point, we can be sure that no errors occurred. */ X return NULL; X} X X/******************************************************************************/ X XEXPORT bool fexists(fn) char *fn; X{ X FILE *file; X bool success; X X file=fopen(fn,"rb"); X if (file==NULL) X return FALSE; X X success= (fclose(file) != FCLOSE_F); X as_cold(success, X "fexists: Error closing file whose existence is being tested!"); X X return TRUE; X} X X/******************************************************************************/ X XEXPORT char *fn_temp() X{ X STAVAR uword filnum=1; X STAVAR fn_t fn; X do X { X sprintf(fn,"fwtf%04lu.tmp",(ulong) filnum); X filnum++; X } X while (fexists(fn)); X return fn; X} X X/******************************************************************************/ X XEXPORT void strupper(s) char *s; X{ X while (*s != EOS) X { X *s=toupper(*s); X s++; X } X} X X/******************************************************************************/ X/* End of MISC.C */ X/******************************************************************************/ END_OF_FILE if test 6635 -ne `wc -c <'sources/misc.c'`; then echo shar: \"'sources/misc.c'\" unpacked with wrong size! fi # end of 'sources/misc.c' fi if test -f 'sources/misc.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sources/misc.h'\" else echo shar: Extracting \"'sources/misc.h'\" \(5875 characters\) sed "s/^X//" >'sources/misc.h' <<'END_OF_FILE' X/*############################################################################## X XFUNNNELWEB COPYRIGHT X==================== XFunnelWeb is a literate-programming macro preprocessor. X Copyright (C) 1992 Ross N. Williams. X X Ross N. Williams X ross@spam.adelaide.edu.au X 16 Lerwick Avenue, Hazelwood Park 5066, Australia. X This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation. X This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. X You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can FTP the license from prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. X Programmers: X RNW Ross N. Williams ross@spam.adelaide.edu.au X Changes: X 07-May-1992 RNW Program prepared for release under GNU GPL V2. X X##############################################################################*/ X X X/******************************************************************************/ X/* MISC.H */ X/******************************************************************************/ X/* */ X/* This package contains a ragbag of FunnelWeb-specific functions that didn't */ X/* seem to have a home anywhere else. */ X/* */ X/******************************************************************************/ X X#include "style.h" X X#include "data.h" X X/******************************************************************************/ X X/* The following functions each write a string to one or more output streams. */ X/* The code is as follows: */ X/* wr - means write the string only. */ X/* wl - means write the string followed by a '\n'. */ X/* s - The f_s output stream (the console/screen). */ X/* j - The f_j output stream (the journal file). */ X/* l - The f_l output stream (the listing file). */ X/* These functions are hard wired to the f_s, f_j, and f_l global variables. */ X XEXPORT void wr_s P_((char *)); XEXPORT void wr_j P_((char *)); XEXPORT void wr_l P_((char *)); X XEXPORT void wl_s P_((char *)); XEXPORT void wl_j P_((char *)); XEXPORT void wl_l P_((char *)); X XEXPORT void wr_sj P_((char *)); XEXPORT void wl_sj P_((char *)); X XEXPORT void wr_sjl P_((char *)); XEXPORT void wl_sjl P_((char *)); X X/******************************************************************************/ X XEXPORT char *chabbrev P_((int)); X/* If the argument is non-printable in the range [0,127], returns a pointer */ X/* to a constant string containing the mnemonic abbreviation for the */ X/* character (e.g. 10="LF"). Otherwise returns the empty string. */ X X/******************************************************************************/ X XEXPORT sign signof P_((long)); X/* Returns -1 if its argument is negative. */ X/* Returns 0 if its argument is zero. */ X/* Returns 1 if its argument is positive. */ X X/******************************************************************************/ X XEXPORT char * eq_files P_((char *,char *,bool *)); X/* Performs an exact binary comparison of the files named name1 and name2. */ X/* If there is no error during the comparison, returns NULL and the boolean */ X/* parameter carries the result of the comparison with TRUE=>Files identical. */ X/* If there is an error during the comparison, the boolean parameter is set */ X/* to FALSE and the function returns a pointer to a string describing the */ X/* error in terms of "the first file" and "the second file". */ X X/******************************************************************************/ X XEXPORT bool fexists P_((char *)); X/* Returns TRUE iff a file of the name given in the parameter exists. */ X/* (Does this by attempting to open the file. If it succeeds, it closes it */ X/* again). */ X X/******************************************************************************/ X XEXPORT char *fn_temp P_((void)); X/* Creates a filename (not containing a directory component) for which there */ X/* is no corresponding file in the current directory. */ X/* Returns a pointer to a static array containing the filename. */ X/* Each time this function is called, the new filename overwrites the old. */ X/* This function was created after it was discovered that, on some systems, */ X/* the standard library function "tmpnam" returns the name of a file in the */ X/* /tmp partition. This would not be a problem were it not for the fact that */ X/* generally, files cannot be renamed across partitions! */ X X/******************************************************************************/ X XEXPORT void strupper P_((char *)); X/* Converts all lower case letters in the argument string to upper case. */ X X/******************************************************************************/ X/* End of MISC.H */ X/******************************************************************************/ END_OF_FILE if test 5875 -ne `wc -c <'sources/misc.h'`; then echo shar: \"'sources/misc.h'\" unpacked with wrong size! fi # end of 'sources/misc.h' fi if test -f 'sources/option.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sources/option.h'\" else echo shar: Extracting \"'sources/option.h'\" \(7760 characters\) sed "s/^X//" >'sources/option.h' <<'END_OF_FILE' X/*############################################################################## X XFUNNNELWEB COPYRIGHT X==================== XFunnelWeb is a literate-programming macro preprocessor. X Copyright (C) 1992 Ross N. Williams. X X Ross N. Williams X ross@spam.adelaide.edu.au X 16 Lerwick Avenue, Hazelwood Park 5066, Australia. X This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation. X This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. X You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can FTP the license from prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. X Programmers: X RNW Ross N. Williams ross@spam.adelaide.edu.au X Changes: X 07-May-1992 RNW Program prepared for release under GNU GPL V2. X X##############################################################################*/ X X X/******************************************************************************/ X/* OPTION.H */ X/******************************************************************************/ X X/* Ensure that the body of this header file is included at most once. */ X#ifndef DONE_OPTION X#define DONE_OPTION X X/******************************************************************************/ X X#include "style.h" X X#include "machin.h" X#include "help.h" X X/******************************************************************************/ X X/* THE B7 OPTION */ X/* ------------- */ X/* When FunnelWeb was first ported to different machines and the regression */ X/* testing was activated, a most irritating occurance was the failure of the */ X/* results of tests on different machines to compare, because of minor */ X/* differences in implementation. For example, error messages that contained */ X/* file names would differ because the directory name on different machines */ X/* was different. Another example was error messages that quoted */ X/* implementation limits. This problem was solved by creating the B7 option */ X/* which instructs FunnelWeb to suppress all output that is */ X/* non-deterministic, machine specific, or which in any other way would cause */ X/* an unncessary failure of the test suite. */ X X/* The following symbol provides a simple replacement for filenames in error */ X/* messages. */ X#define SUPPNAME "<<Suppressed>>" X#define SUPPVAL "<<Suppressed>>" X X/******************************************************************************/ X X/* The following structure stores all the information that can be */ X/* communicated in one or more command lines. An important aspect of the */ X/* structure is that it is totally self contained; it does not contain any */ X/* pointers to outside structures such as command lines. */ X/* The rather strange field names are explained as follows: */ X/* 1) Local names must be distinct to 8 characters (for portability). */ X/* 2) All structure field names should be unique (for portability). */ X/* Some of the older compilers use a single field structure name space. */ X/* 3) The op_ is used as a prefix for entities in this whole package. */ X/* 4) The next letter is the option letter itself. It is not intended that */ X/* the command line option names be tightly bound to the internal */ X/* identifier names -- the command line names are just convenient. */ X/* 5) The next letter gives the type: [B]oolean, [S]tring, [I]nteger. */ X typedef struct X { X bool op_f_b; /* The input file. */ X fn_t op_f_s; X X bool op_j_b; /* The journal file. */ X fn_t op_j_s; X X fn_t op_i_s; /* Include file (default). */ X X bool op_o_b; /* Product files (default). */ X fn_t op_o_s; X X bool op_t_b; /* Typeset file (default). */ X fn_t op_t_s; X X bool op_l_b; /* Listing file (default). */ X fn_t op_l_s; X X bool op_d_b; /* Delete output files that have not changed? */ X X uword op_c_i; /* Lines of error context in listing file. */ X X bool op_q_b; /* Quiet mode. Console chatter suppressed if turned on. */ X X bool op_s_b; /* Send errors to the screen with specified context. */ X uword op_s_i; X X bool op_w_b; /* Set maximum line length of product files. */ X uword op_w_i; X X bool op_x_b; /* Execute specified file in FunnelWeb shell. */ X fn_t op_x_s; X X bool op_k_b; /* Interactive (keyboard) mode. */ X X /* Dump flags: */ X bool op_b1_b; /* Dump input file image. */ X bool op_b2_b; /* Dump line list. */ X bool op_b3_b; /* Dump token list. */ X bool op_b4_b; /* Dump macro table. */ X bool op_b5_b; /* Dump document list. */ X bool op_b6_b; /* Dump time summary. */ X bool op_b7_b; /* Don't write anything non-deterministic or machine */ X /* specific. This option is designed to assist in */ X /* regression testing. */ X X bool op_h_b; /* Help messages. */ X hn_t op_h_s; X } op_t; X typedef op_t *p_op_t; X X/******************************************************************************/ X XEXPORT void op_ini P_((p_op_t)); X/* Initializes the specified options structure with default values. */ X/* This includes ALL the fields of the structure. If, for example, the */ X/* default value of op_l_b is FALSE, op_l_s will be set to the empty string. */ X XEXPORT bool op_add P_((p_op_t,p_cl_t,void (*)(char *))); X/* Parses the specified command line and places the information given in the */ X/* command line into specific fields of the options structure. The options */ X/* structure should be entirely defined upon entry, as this parsing function */ X/* only ADDS information present in the command line. Call op_ini if you */ X/* don't want to initialize all the fields manually. */ X/* The comline string should start with the leading command (e.g. "fw"). */ X/* However, he leading command is ignored. */ X/* Returns FALSE: One or more syntax errors have been detected. One or error */ X/* messages have been written using the funtion argument. */ X/* *p_op unchanged. */ X/* Returns TRUE : No syntax errors. Comline information placed in *p_op. */ X XEXPORT void op_wri P_((p_op_t,void (*)(char *))); X/* Writes a text representation of the specified options record using the */ X/* function argument. */ X X/******************************************************************************/ X X/* For #ifndef preventing multiple inclusion of the body of this header file. */ X#endif X X/******************************************************************************/ X/* End of OPTION.H */ X/******************************************************************************/ X END_OF_FILE if test 7760 -ne `wc -c <'sources/option.h'`; then echo shar: \"'sources/option.h'\" unpacked with wrong size! fi # end of 'sources/option.h' fi if test -f 'sources/section.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sources/section.h'\" else echo shar: Extracting \"'sources/section.h'\" \(5771 characters\) sed "s/^X//" >'sources/section.h' <<'END_OF_FILE' X/*############################################################################## X XFUNNNELWEB COPYRIGHT X==================== XFunnelWeb is a literate-programming macro preprocessor. X Copyright (C) 1992 Ross N. Williams. X X Ross N. Williams X ross@spam.adelaide.edu.au X 16 Lerwick Avenue, Hazelwood Park 5066, Australia. X This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation. X This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. X You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can FTP the license from prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. X Programmers: X RNW Ross N. Williams ross@spam.adelaide.edu.au X Changes: X 07-May-1992 RNW Program prepared for release under GNU GPL V2. X X##############################################################################*/ X X X/******************************************************************************/ X/* SECTION.H */ X/******************************************************************************/ X/* */ X/* This package provides a very simple, very small abstraction for a section */ X/* number. A section number is a hierarchical group of numbers such as is */ X/* used to number the sections in documents. For example: 4.5.1.3 is a */ X/* section number. This package provides an abstraction for these numbers */ X/* that assists in their incrementing at different levels and in writing them */ X/* out. The package also checks for hierarchical inconsistencies. */ X/* */ X/******************************************************************************/ X X/* Ensure that the body of this header file is included at most once. */ X#ifndef DONE_SECTION X#define DONE_SECTION X X/******************************************************************************/ X X#include "style.h" X X/******************************************************************************/ X X/* The following constant defines the maximum number of levels that a */ X/* FunnelWeb document can have. @A corresponds to level 1. */ X#define SECLEV_MAX 5 X X/* The following constant defines the maximum length of a string representing */ X/* a section. This is calculated as the maximum number of levels multiplied */ X/* by 1 (for the separating dots) plus a safe size for a decimal number. */ X#define SECSTR_MAX (SECLEV_MAX*(1+10)) X X/* The following structure stores a single section number. The sc_level */ X/* field is the level of this field and is in the range [1,SECLEV_MAX]. The */ X/* sc_num field is defined only for elements [1,level] and contains the */ X/* hierarchy number at each level. */ X/* Example: For SECLEVMAX=4 and "3.4.1", level=3 and num=[?,3,4,1,?]. */ X/* Note: The first question mark is for element zero which is always unknown. */ typedef struct X { X ulong sn_magic; /* Used to detect uninitialized sn objects. */ X ubyte_ sn_lev; /* Level number of section. */ X uword_ sn_num[SECLEV_MAX+1]; /* Hierarchical level numbers. */ X } sn_t; X typedef sn_t *p_sn_t; X X/******************************************************************************/ X XEXPORT void sn_ini P_((p_sn_t)); X/* Initializes the specified section object to the empty section at level 0. */ X/* All sections must be initialized before any other operations are performed.*/ X XEXPORT void sn_set P_((p_sn_t,ubyte)); X/* Sets the specified section to 1.1.1.1.1.1... at the given level. */ X/* Example: sn_set(p_sn,3) yields a section set to 1.1.1. */ X/* Raises an error if the specified level is out of range. */ X XEXPORT void sn_inc P_((p_sn_t,ubyte)); X/* Increments the number of the specified section object at the specified */ X/* level. This also has the effect of setting all lower levels to 0. For */ X/* example, 3.4.5.1 followed by sn_inc(&sn,2) would become 3.5. */ X/* Raises an error if the level is two or more lower than the current level */ X/* Example: You can't increment 2.4.1 at level 5. */ X/* Raises an error if the specified level is out of range. */ X/* Raises an error if a number at any level becomes too large (>60000). */ X XEXPORT ubyte sn_lev P_((p_sn_t)); X/* Returns the level number of the specified section. */ X XEXPORT void sn_str P_((p_sn_t,char *)); X/* Writes a textual representation of the specified section into the given */ X/* string. The string must be able to hold at least SECSTRMAX characters. */ X X/******************************************************************************/ X X/* For #ifndef preventing multiple inclusion of the body of this header file. */ X#endif X X/******************************************************************************/ X/* End of SECTION.H */ X/******************************************************************************/ X END_OF_FILE if test 5771 -ne `wc -c <'sources/section.h'`; then echo shar: \"'sources/section.h'\" unpacked with wrong size! fi # end of 'sources/section.h' fi if test -f 'sources/texhead.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sources/texhead.c'\" else echo shar: Extracting \"'sources/texhead.c'\" \(5266 characters\) sed "s/^X//" >'sources/texhead.c' <<'END_OF_FILE' X/*############################################################################## X XFUNNNELWEB COPYRIGHT X==================== XFunnelWeb is a literate-programming macro preprocessor. X Copyright (C) 1992 Ross N. Williams. X X Ross N. Williams X ross@spam.adelaide.edu.au X 16 Lerwick Avenue, Hazelwood Park 5066, Australia. X This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation. X This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. X You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can FTP the license from prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. X Programmers: X RNW Ross N. Williams ross@spam.adelaide.edu.au X Changes: X 07-May-1992 RNW Program prepared for release under GNU GPL V2. X X##############################################################################*/ X X X/******************************************************************************/ X/* TEXHEAD.C */ X/******************************************************************************/ X/* */ X/* TEX HEADER PACKAGE */ X/* ================== */ X/* This package contains a single function that writes the TeX header */ X/* (containing all the Weave macros) to the specified stream. The package */ X/* consists of: */ X/* */ X/* texhead.tex - The header file ("source code" for texhead.ctx). */ X/* texhead.ctx - Automatically generated C code based on texhead.tex. */ X/* texhead.h - Exported header file containing function definition. */ X/* texhead.c - Contains the function body and the codified header file. */ X/* */ X/* WARNING: THE ONLY FILE THAT SHOULD EVER BE MODIFIED BY HAND IS TEXHEAD.TEX.*/ X/* From this can be generated a new version of texhead.ctx. Here's how: */ X/* 1. Edit texhead.tex as desired. */ X/* 2. Fire up the FunnelWeb shell and give the command: */ X/* codify texhead.tex texhead.ctx */ X/* */ X/******************************************************************************/ X X#include "style.h" X X#include "texhead.h" X#include "writfile.h" X X/******************************************************************************/ X XEXPORT void tex_head(p_wf) p_wf_t p_wf; X/* Writes the FunnelWeb TeX header block to the argument stream. */ X{ X X /*############################################################################# X IMPORTANT COPYRIGHT NOTICE X -------------------------- X The set of FunnelWeb TeX definitions, embodied in C code in the file X included by the #include directive below, is a public domain work. X X Notwithstanding the fact that the public domain set of FunnelWeb TeX X definitions is represented in the form of strings in C code #included by the X FunnelWeb literate-programming preprocessor program released under GNU General X Public License Version 2, the set of TeX definitions themselves do not fall X under GNU license. Instead, the set of FunnelWeb TeX definitions is classified X as a public domain work that is distributed with FunnelWeb as a "separate X work". The set of definitions is included as strings in the FunnelWeb code for X the sole reason that this organization avoids FunnelWeb having to locate the X file at run time. Thus, when FunnelWeb writes the set of TeX definitions to a X .TeX output file, it is not generating a work based on itself, but is merely X copying a public domain file (which it happened to represent in the form of X code rather than data) into the output file. X X The motivation for rigorously clarifying the status of the set of X FunnelWeb TeX definitions is that it will appear in TeX output files X generated by FunnelWeb, and I do not want any output files generated by X FunnelWeb to be under any copyright restrictions. X X -- Ross N. Williams, 5:42pm 07-May-1992, Adelaide, Australia. X X #############################################################################*/ X X#define WX(STR) wf_wl(p_wf,STR) X X#include "texhead.ctx" X} X X/******************************************************************************/ X/* End of TEXHEAD.C */ X/******************************************************************************/ END_OF_FILE if test 5266 -ne `wc -c <'sources/texhead.c'`; then echo shar: \"'sources/texhead.c'\" unpacked with wrong size! fi # end of 'sources/texhead.c' fi if test -f 'sources/texhead.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'sources/texhead.h'\" else echo shar: Extracting \"'sources/texhead.h'\" \(7043 characters\) sed "s/^X//" >'sources/texhead.h' <<'END_OF_FILE' X/*############################################################################## X XFUNNNELWEB COPYRIGHT X==================== XFunnelWeb is a literate-programming macro preprocessor. X Copyright (C) 1992 Ross N. Williams. X X Ross N. Williams X ross@spam.adelaide.edu.au X 16 Lerwick Avenue, Hazelwood Park 5066, Australia. X This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation. X This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. X You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can FTP the license from prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. X Programmers: X RNW Ross N. Williams ross@spam.adelaide.edu.au X Changes: X 07-May-1992 RNW Program prepared for release under GNU GPL V2. X X##############################################################################*/ X X X/******************************************************************************/ X/* TEXHEAD.H */ X/******************************************************************************/ X/* */ X/* TEX HEADER PACKAGE */ X/* ================== */ X/* This package contains a single function that writes the TeX header */ X/* (containing all the Weave macros) to the specified stream. The package */ X/* consists of: */ X/* */ X/* texhead.tex - The header file ("source code" for texhead.ctx). */ X/* texhead.ctx - C code automatically generated by texhead.tex. */ X/* texhead.h - This file, containing a function definition. */ X/* texhead.c - Contains a function body. */ X/* */ X/* The first version of FunnelWeb (1986) generated TeX output files that used */ X/* a collection of macros to neaten and simplify the bulk of the TeX output */ X/* file. For example, the macro \fwbtx provided a simple way to specify */ X/* verbatim text. This system worked extremely well, the only inconvenience */ X/* being that each FunnelWeb TeX output file had to "\input" the TeX header */ X/* file containing all the macros. At the time, this seemed a sensible */ X/* factorization of the macros, and, within the limited environment in which */ X/* FunnelWeb was operating, worked well. */ X/* */ X/* In NEW, IMPROVED FunnelWeb, "\input"ing the header file has the potential */ X/* to cause lots of problems, the major ones being: */ X/* */ X/* - The header file would have to be installed as part of the FunnelWeb */ X/* system. Currently this means that it would be the ONLY other file */ X/* necessary apart from the FunnelWeb executable. It would be far more */ X/* desirable to avoid having to install the header file. */ X/* */ X/* - The header file would have to be referred to somehow by the TeX file. */ X/* As it makes sense to have only one copy of the header file on a machine, */ X/* TeX files would have to refer to that copy. This would require one of a */ X/* number of messy machine-specific mechanisms such as (VMS) logical name */ X/* translation or environment variable translation. */ X/* */ X/* - TeX files could not be easily moved to other machines (particularly */ X/* those not running FunnelWeb themselves) without also sending the header */ X/* file. */ X/* */ X/* - If FunnelWeb and the header file were ever jointly modified, the dynamic */ X/* binding of old TeX files would mean that they may no longer be printable.*/ X/* */ X/* For all these reasons, the decision was made to write the library of TeX */ X/* macros at the start of each TeX output file, thus making each TeX output */ X/* file entirely self-contained. To do this, the header file had to be */ X/* converted into a sequence of C output statments. To this end, a new */ X/* FunnelWeb shell command CODIFY was added that performs this transformation.*/ X/* CODIFY could have been a separate utility program, but if it was, it might */ X/* somehow be separated from the rest of FunnelWeb during distribution. By */ X/* building CODIFY into FunnelWeb itself, this possibility is eliminated. */ X/* */ X/* This package encapsulates the automatically generated C code. This header */ X/* file defines a function that writes it to a specified stream. The package */ X/* body texhead.c contains the body of the function which consists mainly of */ X/* a #include of the automatically generated C code in texhead.ctx. */ X/* */ X/******************************************************************************/ X X/* Ensure that the body of this header file is included at most once. */ X#ifndef DONE_TEXH X#define DONE_TEXH X X/******************************************************************************/ X X#include "style.h" X X#include "writfile.h" X X/******************************************************************************/ X XEXPORT void tex_head P_((p_wf_t)); X/* Writes the FunnelWeb TeX header block to the argument stream. */ X X/******************************************************************************/ X X/* For #ifndef preventing multiple inclusion of the body of this header file. */ X#endif X X/******************************************************************************/ X/* End of TEXHEAD.H */ X/******************************************************************************/ END_OF_FILE if test 7043 -ne `wc -c <'sources/texhead.h'`; then echo shar: \"'sources/texhead.h'\" unpacked with wrong size! fi # end of 'sources/texhead.h' fi echo shar: End of archive 3 \(of 20\). cp /dev/null ark3isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 20 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0