home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Corel 10 Texture (image/corel10Texture)
| ext
| Unsupported |
1%
| dexvert
| Croteam texture file (image/croteamTextureFile)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text, with CRLF line terminators
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| detectItEasy
| Format: plain text[CRLF]
| default (weak)
| |
100%
| xdgMime
| text/x-matlab
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |%=======|========|
|00000010| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000020| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000030| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000040| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 25 |========|=======%|
|00000050| 0d 0a 25 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |..% | |
|00000060| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000070| 20 53 74 61 72 74 20 6f | 66 20 43 68 32 2e 74 65 | Start o|f Ch2.te|
|00000080| 78 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |x | |
|00000090| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000000a0| 20 25 0d 0a 25 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d | %..%===|========|
|000000b0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000c0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000e0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000f0| 3d 3d 3d 25 0d 0a 25 0d | 0a 25 20 43 6f 70 79 72 |===%..%.|.% Copyr|
|00000100| 69 67 68 74 0d 0a 25 20 | 2d 2d 2d 2d 2d 2d 2d 2d |ight..% |--------|
|00000110| 2d 0d 0a 25 20 43 6f 70 | 79 72 69 67 68 74 20 28 |-..% Cop|yright (|
|00000120| 43 29 20 31 39 39 32 20 | 52 6f 73 73 20 4e 2e 20 |C) 1992 |Ross N. |
|00000130| 57 69 6c 6c 69 61 6d 73 | 2e 0d 0a 25 20 54 68 69 |Williams|...% Thi|
|00000140| 73 20 66 69 6c 65 20 63 | 6f 6e 74 61 69 6e 73 20 |s file c|ontains |
|00000150| 61 20 63 68 61 70 74 65 | 72 20 6f 66 20 74 68 65 |a chapte|r of the|
|00000160| 20 46 75 6e 6e 65 6c 57 | 65 62 20 48 61 63 6b 65 | FunnelW|eb Hacke|
|00000170| 72 27 73 20 4d 61 6e 75 | 61 6c 2e 0d 0a 25 20 53 |r's Manu|al...% S|
|00000180| 65 65 20 74 68 65 20 6d | 61 69 6e 20 54 65 58 20 |ee the m|ain TeX |
|00000190| 66 69 6c 65 20 66 6f 72 | 20 74 68 69 73 20 6d 61 |file for| this ma|
|000001a0| 6e 75 61 6c 20 66 6f 72 | 20 66 75 72 74 68 65 72 |nual for| further|
|000001b0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 2e 0d 0a 25 | informa|tion...%|
|000001c0| 0d 0a 25 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |..%=====|========|
|000001d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000001e0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000001f0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000200| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000210| 3d 25 0d 0a 0d 0a 5c 63 | 68 61 70 74 65 72 7b 46 |=%....\c|hapter{F|
|00000220| 75 6e 6e 65 6c 57 65 62 | 20 49 6d 70 6c 65 6d 65 |unnelWeb| Impleme|
|00000230| 6e 74 61 74 69 6f 6e 7d | 0d 0a 5c 6c 61 62 65 6c |ntation}|..\label|
|00000240| 7b 63 68 61 70 69 6d 70 | 6c 65 6d 65 6e 74 61 74 |{chapimp|lementat|
|00000250| 69 6f 6e 7d 5c 78 78 7b | 46 75 6e 6e 65 6c 57 65 |ion}\xx{|FunnelWe|
|00000260| 62 7d 7b 69 6d 70 6c 65 | 6d 65 6e 74 61 74 69 6f |b}{imple|mentatio|
|00000270| 6e 7d 0d 0a 0d 0a 5c 73 | 65 63 74 69 6f 6e 7b 49 |n}....\s|ection{I|
|00000280| 6e 74 72 6f 64 75 63 74 | 69 6f 6e 7d 0d 0a 0d 0a |ntroduct|ion}....|
|00000290| 54 68 69 73 20 63 68 61 | 70 74 65 72 20 63 6f 6e |This cha|pter con|
|000002a0| 74 61 69 6e 73 20 6e 6f | 74 65 73 20 6f 6e 20 74 |tains no|tes on t|
|000002b0| 68 65 20 61 63 74 75 61 | 6c 20 43 20 63 6f 64 65 |he actua|l C code|
|000002c0| 20 74 68 61 74 20 69 6d | 70 6c 65 6d 65 6e 74 73 | that im|plements|
|000002d0| 0d 0a 46 75 6e 6e 65 6c | 57 65 62 7e 56 33 2e 20 |..Funnel|Web~V3. |
|000002e0| 54 68 69 73 20 63 68 61 | 70 74 65 72 20 69 73 20 |This cha|pter is |
|000002f0| 72 61 74 68 65 72 20 70 | 61 74 63 68 79 2e 20 49 |rather p|atchy. I|
|00000300| 74 20 68 61 73 20 61 63 | 74 65 64 20 6d 61 69 6e |t has ac|ted main|
|00000310| 6c 79 20 61 73 0d 0a 61 | 20 64 75 6d 70 69 6e 67 |ly as..a| dumping|
|00000320| 20 67 72 6f 75 6e 64 20 | 66 6f 72 20 69 64 65 61 | ground |for idea|
|00000330| 73 20 74 68 61 74 20 49 | 20 62 6f 74 68 65 72 65 |s that I| bothere|
|00000340| 64 20 74 6f 20 77 72 69 | 74 65 20 61 62 6f 75 74 |d to wri|te about|
|00000350| 20 64 75 72 69 6e 67 0d | 0a 64 65 76 65 6c 6f 70 | during.|.develop|
|00000360| 6d 65 6e 74 2e 0d 0a 0d | 0a 5c 73 65 63 74 69 6f |ment....|.\sectio|
|00000370| 6e 7b 48 69 73 74 6f 72 | 79 20 6f 66 20 46 75 6e |n{Histor|y of Fun|
|00000380| 6e 65 6c 57 65 62 20 49 | 6d 70 6c 65 6d 65 6e 74 |nelWeb I|mplement|
|00000390| 61 74 69 6f 6e 73 7d 0d | 0a 5c 78 78 7b 46 75 6e |ations}.|.\xx{Fun|
|000003a0| 6e 65 6c 57 65 62 7d 7b | 68 69 73 74 6f 72 79 7d |nelWeb}{|history}|
|000003b0| 5c 78 7b 46 75 6e 6e 65 | 6c 57 65 62 20 76 65 72 |\x{Funne|lWeb ver|
|000003c0| 73 69 6f 6e 20 31 7d 5c | 78 7b 46 75 6e 6e 65 6c |sion 1}\|x{Funnel|
|000003d0| 57 65 62 20 76 65 72 73 | 69 6f 6e 20 32 7d 25 0d |Web vers|ion 2}%.|
|000003e0| 0a 5c 78 7b 46 75 6e 6e | 65 6c 57 65 62 20 76 65 |.\x{Funn|elWeb ve|
|000003f0| 72 73 69 6f 6e 20 33 7d | 0d 0a 0d 0a 54 68 65 20 |rsion 3}|....The |
|00000400| 66 69 72 73 74 20 69 6d | 70 6c 65 6d 65 6e 74 61 |first im|plementa|
|00000410| 74 69 6f 6e 20 6f 66 20 | 46 75 6e 6e 65 6c 57 65 |tion of |FunnelWe|
|00000420| 62 20 28 46 75 6e 6e 65 | 6c 57 65 62 7e 56 31 29 |b (Funne|lWeb~V1)|
|00000430| 20 77 61 73 20 77 72 69 | 74 74 65 6e 20 69 6e 0d | was wri|tten in.|
|00000440| 0a 41 64 61 5c 78 7b 41 | 64 61 7d 0d 0a 69 6e 20 |.Ada\x{A|da}..in |
|00000450| 44 65 63 65 6d 62 65 72 | 20 31 39 38 36 2e 20 54 |December| 1986. T|
|00000460| 68 65 20 70 72 6f 6a 65 | 63 74 20 77 61 73 20 69 |he proje|ct was i|
|00000470| 6e 69 74 69 61 6c 6c 79 | 20 63 61 6e 6e 65 64 20 |nitially| canned |
|00000480| 61 73 20 72 65 71 75 69 | 72 69 6e 67 20 74 6f 6f |as requi|ring too|
|00000490| 0d 0a 6d 75 63 68 20 74 | 69 6d 65 2c 20 62 75 74 |..much t|ime, but|
|000004a0| 20 77 61 73 20 72 65 73 | 75 72 72 65 63 74 65 64 | was res|urrected|
|000004b0| 20 77 68 65 6e 20 49 20 | 64 65 63 69 64 65 64 20 | when I |decided |
|000004c0| 74 6f 20 63 6f 6d 6d 69 | 74 20 74 6f 0d 0a 41 64 |to commi|t to..Ad|
|000004d0| 61 5c 70 61 70 65 72 7b | 55 53 44 4f 44 38 33 7d |a\paper{|USDOD83}|
|000004e0| 20 61 6e 64 0d 0a 72 65 | 61 6c 69 7a 65 64 20 74 | and..re|alized t|
|000004f0| 68 61 74 20 49 20 6e 65 | 65 64 65 64 20 61 20 70 |hat I ne|eded a p|
|00000500| 72 6f 67 72 61 6d 20 74 | 6f 20 77 72 69 74 65 20 |rogram t|o write |
|00000510| 74 6f 20 68 65 6c 70 20 | 6d 65 20 74 6f 20 6c 65 |to help |me to le|
|00000520| 61 72 6e 20 41 64 61 2e | 0d 0a 46 75 6e 6e 65 6c |arn Ada.|..Funnel|
|00000530| 57 65 62 7e 56 31 20 77 | 61 73 2c 20 69 6e 20 66 |Web~V1 w|as, in f|
|00000540| 61 63 74 2c 20 6d 79 20 | 66 69 72 73 74 20 41 64 |act, my |first Ad|
|00000550| 61 20 70 72 6f 67 72 61 | 6d 2e 20 49 74 20 74 6f |a progra|m. It to|
|00000560| 6f 6b 20 61 62 6f 75 74 | 20 6f 6e 65 0d 0a 6d 6f |ok about| one..mo|
|00000570| 6e 74 68 20 74 6f 20 77 | 72 69 74 65 2e 0d 0a 0d |nth to w|rite....|
|00000580| 0a 46 75 6e 6e 65 6c 57 | 65 62 7e 56 31 20 77 61 |.FunnelW|eb~V1 wa|
|00000590| 73 20 75 73 65 64 20 69 | 6e 74 65 6e 73 69 76 65 |s used i|ntensive|
|000005a0| 6c 79 20 62 79 20 6d 79 | 73 65 6c 66 20 74 6f 20 |ly by my|self to |
|000005b0| 77 72 69 74 65 20 41 64 | 61 20 70 72 6f 67 72 61 |write Ad|a progra|
|000005c0| 6d 73 0d 0a 66 72 6f 6d | 20 4a 61 6e 75 61 72 79 |ms..from| January|
|000005d0| 7e 31 39 38 36 20 74 6f | 20 4a 75 6c 79 7e 31 39 |~1986 to| July~19|
|000005e0| 38 39 20 61 74 20 77 68 | 69 63 68 20 74 69 6d 65 |89 at wh|ich time|
|000005f0| 0d 0a 49 20 66 69 6e 69 | 73 68 65 64 20 6d 79 20 |..I fini|shed my |
|00000600| 50 68 2e 44 2e 5c 78 7b | 50 68 2e 44 2e 7d 20 61 |Ph.D.\x{|Ph.D.} a|
|00000610| 6e 64 20 6c 6f 73 74 20 | 61 63 63 65 73 73 20 74 |nd lost |access t|
|00000620| 6f 0d 0a 74 68 65 20 56 | 41 58 2e 20 44 75 72 69 |o..the V|AX. Duri|
|00000630| 6e 67 20 74 68 69 73 20 | 74 69 6d 65 20 61 74 20 |ng this |time at |
|00000640| 6c 65 61 73 74 20 74 77 | 65 6e 74 79 20 74 68 6f |least tw|enty tho|
|00000650| 75 73 61 6e 64 20 6c 69 | 6e 65 73 20 6f 66 20 63 |usand li|nes of c|
|00000660| 6f 64 65 20 77 65 72 65 | 20 67 65 6e 65 72 61 74 |ode were| generat|
|00000670| 65 64 0d 0a 75 73 69 6e | 67 20 46 75 6e 6e 65 6c |ed..usin|g Funnel|
|00000680| 57 65 62 2e 20 48 61 72 | 64 6c 79 20 61 6e 79 6f |Web. Har|dly anyo|
|00000690| 6e 65 20 62 75 74 20 6d | 79 73 65 6c 66 20 75 73 |ne but m|yself us|
|000006a0| 65 64 0d 0a 46 75 6e 6e | 65 6c 57 65 62 2e 5c 78 |ed..Funn|elWeb.\x|
|000006b0| 78 7b 46 75 6e 6e 65 6c | 57 65 62 7d 7b 70 61 73 |x{Funnel|Web}{pas|
|000006c0| 74 20 75 73 65 7d 0d 0a | 0d 0a 41 66 74 65 72 20 |t use}..|..After |
|000006d0| 6c 6f 73 69 6e 67 20 61 | 63 63 65 73 73 20 74 6f |losing a|ccess to|
|000006e0| 20 41 64 61 20 61 6e 64 | 20 74 68 65 20 56 61 78 | Ada and| the Vax|
|000006f0| 20 28 61 6e 64 20 68 65 | 6e 63 65 20 74 6f 20 46 | (and he|nce to F|
|00000700| 75 6e 6e 65 6c 57 65 62 | 29 2c 20 49 20 77 61 73 |unnelWeb|), I was|
|00000710| 20 66 6f 72 63 65 64 0d | 0a 62 61 63 6b 20 74 6f | forced.|.back to|
|00000720| 20 70 72 6f 67 72 61 6d | 6d 69 6e 67 20 74 68 65 | program|ming the|
|00000730| 20 6e 6f 6e 2d 6c 69 74 | 65 72 61 74 65 20 77 61 | non-lit|erate wa|
|00000740| 79 2e 20 46 72 6f 6d 20 | 74 69 6d 65 20 74 6f 20 |y. From |time to |
|00000750| 74 69 6d 65 20 49 20 66 | 6f 75 6e 64 20 74 68 61 |time I f|ound tha|
|00000760| 74 20 49 0d 0a 6e 65 65 | 64 65 64 20 74 6f 20 75 |t I..nee|ded to u|
|00000770| 73 65 20 73 6f 6d 65 20 | 6f 66 20 6d 79 20 6f 6c |se some |of my ol|
|00000780| 64 20 70 72 6f 67 72 61 | 6d 73 20 74 68 61 74 20 |d progra|ms that |
|00000790| 49 20 68 61 64 20 77 72 | 69 74 74 65 6e 20 75 73 |I had wr|itten us|
|000007a0| 69 6e 67 20 41 64 61 20 | 61 6e 64 0d 0a 46 75 6e |ing Ada |and..Fun|
|000007b0| 6e 65 6c 57 65 62 2e 20 | 49 20 6b 6e 65 77 20 74 |nelWeb. |I knew t|
|000007c0| 68 61 74 20 41 64 61 20 | 77 6f 75 6c 64 20 62 65 |hat Ada |would be|
|000007d0| 63 6f 6d 65 20 61 76 61 | 69 6c 61 62 6c 65 20 6f |come ava|ilable o|
|000007e0| 6e 20 6d 6f 72 65 20 6d | 61 63 68 69 6e 65 73 2c |n more m|achines,|
|000007f0| 20 62 75 74 0d 0a 63 65 | 72 74 61 69 6e 6c 79 20 | but..ce|rtainly |
|00000800| 46 75 6e 6e 65 6c 57 65 | 62 20 77 6f 75 6c 64 6e |FunnelWe|b wouldn|
|00000810| 27 74 2e 20 49 20 72 65 | 63 6f 67 6e 69 73 65 64 |'t. I re|cognised|
|00000820| 20 61 20 73 74 72 6f 6e | 67 20 6e 65 65 64 20 66 | a stron|g need f|
|00000830| 6f 72 20 61 20 70 6f 72 | 74 61 62 6c 65 0d 0a 76 |or a por|table..v|
|00000840| 65 72 73 69 6f 6e 20 6f | 66 20 46 75 6e 6e 65 6c |ersion o|f Funnel|
|00000850| 57 65 62 20 77 72 69 74 | 74 65 6e 20 69 6e 7e 43 |Web writ|ten in~C|
|00000860| 20 62 75 74 20 64 69 64 | 6e 27 74 20 68 61 76 65 | but did|n't have|
|00000870| 20 74 68 65 20 74 69 6d | 65 20 6f 72 20 65 6e 65 | the tim|e or ene|
|00000880| 72 67 79 0d 0a 74 6f 20 | 63 72 65 61 74 65 20 6f |rgy..to |create o|
|00000890| 6e 65 2e 0d 0a 0d 0a 41 | 62 6f 75 74 20 74 68 69 |ne.....A|bout thi|
|000008a0| 73 20 74 69 6d 65 20 28 | 6c 61 74 65 20 31 39 38 |s time (|late 198|
|000008b0| 39 29 2c 20 44 61 76 69 | 64 20 48 75 6c 73 65 2c |9), Davi|d Hulse,|
|000008c0| 5c 78 6e 7b 44 61 76 69 | 64 7d 7b 48 75 6c 73 65 |\xn{Davi|d}{Hulse|
|000008d0| 7d 0d 0a 61 74 20 74 68 | 65 20 74 69 6d 65 20 61 |}..at th|e time a|
|000008e0| 20 73 74 75 64 65 6e 74 | 20 69 6e 0d 0a 43 6f 6d | student| in..Com|
|000008f0| 70 75 74 65 72 20 53 63 | 69 65 6e 63 65 20 61 74 |puter Sc|ience at|
|00000900| 20 74 68 65 20 55 6e 69 | 76 65 72 73 69 74 79 20 | the Uni|versity |
|00000910| 6f 66 20 41 64 65 6c 61 | 69 64 65 2c 5c 78 78 7b |of Adela|ide,\xx{|
|00000920| 55 6e 69 76 65 72 73 69 | 74 79 7d 7b 41 64 65 6c |Universi|ty}{Adel|
|00000930| 61 69 64 65 7d 0d 0a 76 | 6f 6c 75 6e 74 65 65 72 |aide}..v|olunteer|
|00000940| 65 64 20 74 6f 20 74 72 | 61 6e 73 6c 61 74 65 20 |ed to tr|anslate |
|00000950| 74 68 65 20 34 30 30 30 | 20 6c 69 6e 65 20 41 64 |the 4000| line Ad|
|00000960| 61 20 76 65 72 73 69 6f | 6e 20 6f 66 20 46 75 6e |a versio|n of Fun|
|00000970| 6e 65 6c 57 65 62 20 69 | 6e 74 6f 7e 43 2e 0d 0a |nelWeb i|nto~C...|
|00000980| 54 6f 20 6d 79 20 6b 6e | 6f 77 6c 65 64 67 65 20 |To my kn|owledge |
|00000990| 74 68 69 73 20 74 72 61 | 6e 73 6c 61 74 69 6f 6e |this tra|nslation|
|000009a0| 20 70 72 6f 63 65 73 73 | 20 74 6f 6f 6b 20 61 62 | process| took ab|
|000009b0| 6f 75 74 20 74 68 72 65 | 65 20 77 65 65 6b 73 0d |out thre|e weeks.|
|000009c0| 0a 28 69 6e 20 44 65 63 | 65 6d 62 65 72 20 31 39 |.(in Dec|ember 19|
|000009d0| 38 39 29 2e 20 54 68 65 | 20 72 65 73 75 6c 74 20 |89). The| result |
|000009e0| 77 61 73 20 63 61 6c 6c | 65 64 20 46 75 6e 6e 65 |was call|ed Funne|
|000009f0| 6c 57 65 62 7e 56 32 20 | 61 6e 64 20 77 61 73 0d |lWeb~V2 |and was.|
|00000a00| 0a 66 6f 72 6d 61 6c 6c | 79 20 73 69 67 6e 65 64 |.formall|y signed|
|00000a10| 20 69 6e 74 6f 20 74 68 | 65 20 70 75 62 6c 69 63 | into th|e public|
|00000a20| 20 64 6f 6d 61 69 6e 20 | 6f 6e 20 35 7e 4d 61 79 | domain |on 5~May|
|00000a30| 20 31 39 39 32 2e 0d 0a | 0d 0a 49 6e 20 67 65 6e | 1992...|..In gen|
|00000a40| 65 72 61 6c 2c 20 44 61 | 76 69 64 20 48 75 6c 73 |eral, Da|vid Huls|
|00000a50| 65 20 64 69 64 20 61 20 | 67 6f 6f 64 20 6a 6f 62 |e did a |good job|
|00000a60| 2e 20 48 6f 77 65 76 65 | 72 2c 20 74 68 65 20 72 |. Howeve|r, the r|
|00000a70| 65 73 75 6c 74 61 6e 74 | 20 63 6f 64 65 0d 0a 73 |esultant| code..s|
|00000a80| 75 66 66 65 72 65 64 20 | 66 72 6f 6d 20 6f 6e 65 |uffered |from one|
|00000a90| 20 6f 72 20 66 65 77 20 | 73 65 72 69 6f 75 73 20 | or few |serious |
|00000aa0| 64 65 66 65 63 74 73 2c | 20 74 68 65 20 6d 6f 73 |defects,| the mos|
|00000ab0| 74 20 73 65 72 69 6f 75 | 73 20 6f 66 20 77 68 69 |t seriou|s of whi|
|00000ac0| 63 68 20 77 61 73 0d 0a | 61 20 6c 61 63 6b 20 6f |ch was..|a lack o|
|00000ad0| 66 20 70 6f 72 74 61 62 | 69 6c 69 74 79 2e 0d 0a |f portab|ility...|
|00000ae0| 0d 0a 4c 61 63 6b 20 6f | 66 20 70 6f 72 74 61 62 |..Lack o|f portab|
|00000af0| 69 6c 69 74 79 20 6f 66 | 20 74 68 65 20 43 7e 63 |ility of| the C~c|
|00000b00| 6f 64 65 2c 20 63 6f 6d | 62 69 6e 65 64 20 77 69 |ode, com|bined wi|
|00000b10| 74 68 20 74 68 65 20 6e | 65 65 64 20 66 6f 72 20 |th the n|eed for |
|00000b20| 61 20 72 61 74 68 65 72 | 0d 0a 73 6f 6c 69 64 20 |a rather|..solid |
|00000b30| 64 65 73 69 67 6e 20 72 | 65 76 69 65 77 2c 20 63 |design r|eview, c|
|00000b40| 6f 6d 62 69 6e 65 64 20 | 77 69 74 68 20 74 68 65 |ombined |with the|
|00000b50| 20 6e 65 65 64 20 74 6f | 0d 0a 73 74 72 65 6e 67 | need to|..streng|
|00000b60| 74 68 65 6e 20 74 68 65 | 20 70 72 6f 67 72 61 6d |then the| program|
|00000b70| 20 74 6f 20 62 72 69 6e | 67 20 69 74 20 75 70 20 | to brin|g it up |
|00000b80| 74 6f 20 70 72 6f 64 75 | 63 74 69 6f 6e 20 73 74 |to produ|ction st|
|00000b90| 61 6e 64 61 72 64 2c 20 | 72 65 73 75 6c 74 65 64 |andard, |resulted|
|00000ba0| 0d 0a 69 6e 20 6d 79 20 | 70 65 72 66 6f 72 6d 69 |..in my |performi|
|00000bb0| 6e 67 20 61 20 63 6f 6d | 70 6c 65 74 65 20 72 65 |ng a com|plete re|
|00000bc0| 77 6f 72 6b 69 6e 67 20 | 6f 66 20 74 68 65 20 63 |working |of the c|
|00000bd0| 6f 64 65 2e 20 54 68 65 | 20 43 20 63 6f 64 65 20 |ode. The| C code |
|00000be0| 77 61 73 0d 0a 65 6e 74 | 69 72 65 6c 79 2c 20 62 |was..ent|irely, b|
|00000bf0| 75 74 20 69 6e 63 72 65 | 6d 65 6e 74 61 6c 6c 79 |ut incre|mentally|
|00000c00| 2c 20 72 65 70 6c 61 63 | 65 64 20 6f 72 20 72 65 |, replac|ed or re|
|00000c10| 66 6f 72 6d 61 74 74 65 | 64 2e 0d 0a 54 68 65 20 |formatte|d...The |
|00000c20| 63 6f 64 65 20 77 61 73 | 20 61 6c 73 6f 20 73 74 |code was| also st|
|00000c30| 72 65 6e 67 74 68 65 6e | 65 64 20 61 6e 64 20 6e |rengthen|ed and n|
|00000c40| 65 77 20 66 65 61 74 75 | 72 65 73 20 77 65 72 65 |ew featu|res were|
|00000c50| 20 61 64 64 65 64 2e 0d | 0a 54 68 69 73 20 70 72 | added..|.This pr|
|00000c60| 6f 63 65 73 73 20 74 6f | 6f 6b 20 61 62 6f 75 74 |ocess to|ok about|
|00000c70| 20 74 77 6f 20 6d 6f 6e | 74 68 73 20 28 4e 6f 76 | two mon|ths (Nov|
|00000c80| 65 6d 62 65 72 20 61 6e | 64 20 44 65 63 65 6d 62 |ember an|d Decemb|
|00000c90| 65 72 20 31 39 39 31 29 | 2e 0d 0a 41 20 66 75 72 |er 1991)|...A fur|
|00000ca0| 74 68 65 72 20 74 77 6f | 20 6d 6f 6e 74 68 73 20 |ther two| months |
|00000cb0| 28 61 70 70 72 6f 78 29 | 20 77 65 72 65 20 73 70 |(approx)| were sp|
|00000cc0| 65 6e 74 20 77 72 69 74 | 69 6e 67 20 64 6f 63 75 |ent writ|ing docu|
|00000cd0| 6d 65 6e 74 61 74 69 6f | 6e 2c 20 63 6f 6e 73 74 |mentatio|n, const|
|00000ce0| 72 75 63 74 69 6e 67 0d | 0a 61 20 72 65 67 72 65 |ructing.|.a regre|
|00000cf0| 73 73 69 6f 6e 20 74 65 | 73 74 20 73 75 69 74 65 |ssion te|st suite|
|00000d00| 2c 20 70 6f 72 74 69 6e | 67 20 74 68 65 20 70 72 |, portin|g the pr|
|00000d10| 6f 67 72 61 6d 20 74 6f | 20 64 69 66 66 65 72 65 |ogram to| differe|
|00000d20| 6e 74 20 6d 61 63 68 69 | 6e 65 73 2c 0d 0a 61 6e |nt machi|nes,..an|
|00000d30| 64 20 73 6f 72 74 69 6e | 67 20 6f 75 74 20 74 68 |d sortin|g out th|
|00000d40| 65 20 6c 65 67 61 6c 20 | 69 73 73 75 65 73 20 69 |e legal |issues i|
|00000d50| 6e 76 6f 6c 76 65 64 20 | 69 6e 20 69 74 73 20 72 |nvolved |in its r|
|00000d60| 65 6c 65 61 73 65 2e 0d | 0a 0d 0a 49 20 77 6f 75 |elease..|...I wou|
|00000d70| 6c 64 20 6c 69 6b 65 20 | 74 6f 20 74 61 6b 65 20 |ld like |to take |
|00000d80| 74 68 69 73 20 6f 70 70 | 6f 72 74 75 6e 69 74 79 |this opp|ortunity|
|00000d90| 20 74 6f 20 72 65 63 6f | 72 64 20 61 20 64 65 62 | to reco|rd a deb|
|00000da0| 74 20 6f 66 20 67 72 61 | 74 69 74 75 64 65 20 74 |t of gra|titude t|
|00000db0| 6f 0d 0a 44 61 76 69 64 | 20 48 75 6c 73 65 20 77 |o..David| Hulse w|
|00000dc0| 68 6f 20 74 72 61 6e 73 | 6c 61 74 65 64 20 46 75 |ho trans|lated Fu|
|00000dd0| 6e 6e 65 6c 57 65 62 20 | 66 72 6f 6d 20 41 64 61 |nnelWeb |from Ada|
|00000de0| 20 74 6f 7e 43 2e 20 41 | 6c 74 68 6f 75 67 68 20 | to~C. A|lthough |
|00000df0| 6d 79 0d 0a 72 65 77 6f | 72 6b 69 6e 67 20 6f 66 |my..rewo|rking of|
|00000e00| 20 68 69 73 20 43 7e 63 | 6f 64 65 20 6f 62 6c 69 | his C~c|ode obli|
|00000e10| 74 65 72 61 74 65 64 20 | 6d 6f 73 74 20 6f 66 20 |terated |most of |
|00000e20| 68 69 73 20 63 6f 64 65 | 2c 0d 0a 68 69 73 20 74 |his code|,..his t|
|00000e30| 72 61 6e 73 6c 61 74 69 | 6f 6e 20 77 61 73 20 70 |ranslati|on was p|
|00000e40| 69 76 6f 74 61 6c 20 74 | 6f 20 74 68 65 20 64 65 |ivotal t|o the de|
|00000e50| 76 65 6c 6f 70 6d 65 6e | 74 20 70 72 6f 63 65 73 |velopmen|t proces|
|00000e60| 73 2e 0d 0a 57 69 74 68 | 6f 75 74 20 68 69 73 20 |s...With|out his |
|00000e70| 65 66 66 6f 72 74 20 69 | 6e 20 6d 6f 76 69 6e 67 |effort i|n moving|
|00000e80| 20 66 72 6f 6d 20 41 64 | 61 20 74 6f 7e 43 2c 20 | from Ad|a to~C, |
|00000e90| 49 27 6d 20 6e 6f 74 20 | 73 75 72 65 20 74 68 61 |I'm not |sure tha|
|00000ea0| 74 20 49 0d 0a 77 6f 75 | 6c 64 20 68 61 76 65 20 |t I..wou|ld have |
|00000eb0| 6d 75 73 74 65 72 65 64 | 20 74 68 65 20 65 6e 65 |mustered| the ene|
|00000ec0| 72 67 79 20 61 6e 64 20 | 74 69 6d 65 20 74 6f 20 |rgy and |time to |
|00000ed0| 63 6f 6d 70 6c 65 74 65 | 20 74 68 65 20 70 72 6f |complete| the pro|
|00000ee0| 63 65 73 73 20 61 6e 64 | 0d 0a 62 72 69 6e 67 20 |cess and|..bring |
|00000ef0| 46 75 6e 6e 65 6c 57 65 | 62 20 75 70 20 74 6f 20 |FunnelWe|b up to |
|00000f00| 69 74 73 20 63 75 72 72 | 65 6e 74 20 73 74 61 6e |its curr|ent stan|
|00000f10| 64 61 72 64 2e 0d 0a 0d | 0a 5c 73 65 63 74 69 6f |dard....|.\sectio|
|00000f20| 6e 7b 57 68 79 20 46 75 | 6e 6e 65 6c 57 65 62 20 |n{Why Fu|nnelWeb |
|00000f30| 57 61 73 6e 27 74 20 55 | 73 65 64 20 74 6f 20 57 |Wasn't U|sed to W|
|00000f40| 72 69 74 65 20 49 74 73 | 65 6c 66 7d 0d 0a 5c 78 |rite Its|elf}..\x|
|00000f50| 78 7b 46 75 6e 6e 65 6c | 57 65 62 7d 7b 77 72 69 |x{Funnel|Web}{wri|
|00000f60| 74 69 6e 67 20 69 74 73 | 65 6c 66 7d 0d 0a 0d 0a |ting its|elf}....|
|00000f70| 41 66 74 65 72 20 4b 6e | 75 74 68 20 63 72 65 61 |After Kn|uth crea|
|00000f80| 74 65 64 20 74 68 65 20 | 57 65 62 20 6c 69 74 65 |ted the |Web lite|
|00000f90| 72 61 74 65 20 70 72 65 | 70 72 6f 63 65 73 73 69 |rate pre|processi|
|00000fa0| 6e 67 20 73 79 73 74 65 | 6d 2c 20 68 65 0d 0a 72 |ng syste|m, he..r|
|00000fb0| 65 2d 77 72 6f 74 65 20 | 69 74 20 75 73 69 6e 67 |e-wrote |it using|
|00000fc0| 20 57 65 62 20 61 6e 64 | 20 64 69 73 74 72 69 62 | Web and| distrib|
|00000fd0| 75 74 65 64 20 74 68 65 | 20 73 6f 75 72 63 65 20 |uted the| source |
|00000fe0| 63 6f 64 65 20 69 6e 20 | 57 65 62 20 73 6f 75 72 |code in |Web sour|
|00000ff0| 63 65 20 66 6f 72 6d 2e | 0d 0a 54 6f 20 61 6c 6c |ce form.|..To all|
|00001000| 6f 77 20 74 68 65 20 57 | 65 62 20 73 6f 75 72 63 |ow the W|eb sourc|
|00001010| 65 20 63 6f 64 65 20 74 | 6f 20 62 65 20 74 61 6e |e code t|o be tan|
|00001020| 67 6c 65 64 20 62 79 20 | 75 73 65 72 73 20 6e 6f |gled by |users no|
|00001030| 74 20 79 65 74 20 68 61 | 76 69 6e 67 20 61 0d 0a |t yet ha|ving a..|
|00001040| 63 6f 70 79 20 6f 66 20 | 57 65 62 2c 20 68 65 20 |copy of |Web, he |
|00001050| 61 6c 73 6f 20 69 6e 63 | 6c 75 64 65 64 20 74 68 |also inc|luded th|
|00001060| 65 20 74 61 6e 67 6c 65 | 64 20 50 61 73 63 61 6c |e tangle|d Pascal|
|00001070| 20 63 6f 64 65 20 66 6f | 72 20 74 68 65 20 54 61 | code fo|r the Ta|
|00001080| 6e 67 6c 65 72 2e 0d 0a | 0d 0a 57 68 69 6c 65 20 |ngler...|..While |
|00001090| 74 68 69 73 20 61 70 70 | 72 6f 61 63 68 20 69 73 |this app|roach is|
|000010a0| 20 68 65 72 6f 69 63 20 | 61 6e 64 20 73 65 72 76 | heroic |and serv|
|000010b0| 65 73 20 74 6f 20 63 6f | 6e 76 65 79 20 61 20 63 |es to co|nvey a c|
|000010c0| 6f 6d 6d 69 74 6d 65 6e | 74 20 61 6e 64 0d 0a 61 |ommitmen|t and..a|
|000010d0| 20 63 6f 6e 66 69 64 65 | 6e 63 65 20 69 6e 20 6c | confide|nce in l|
|000010e0| 69 74 65 72 61 74 65 20 | 70 72 6f 67 72 61 6d 6d |iterate |programm|
|000010f0| 69 6e 67 2c 20 69 74 20 | 73 65 65 6d 65 64 20 74 |ing, it |seemed t|
|00001100| 6f 20 6d 65 20 74 68 61 | 74 20 77 72 69 74 69 6e |o me tha|t writin|
|00001110| 67 20 46 75 6e 6e 65 6c | 57 65 62 0d 0a 69 6e 20 |g Funnel|Web..in |
|00001120| 46 75 6e 6e 65 6c 57 65 | 62 20 77 6f 75 6c 64 20 |FunnelWe|b would |
|00001130| 73 69 6d 70 6c 79 20 62 | 65 20 61 73 6b 69 6e 67 |simply b|e asking|
|00001140| 20 66 6f 72 20 74 72 6f | 75 62 6c 65 2e 5c 78 78 | for tro|uble.\xx|
|00001150| 7b 74 72 6f 75 62 6c 65 | 7d 7b 61 73 6b 69 6e 67 |{trouble|}{asking|
|00001160| 20 66 6f 72 7d 0d 0a 46 | 6f 72 20 61 20 73 74 61 | for}..F|or a sta|
|00001170| 72 74 2c 20 69 74 20 77 | 6f 75 6c 64 20 62 65 0d |rt, it w|ould be.|
|00001180| 0a 76 65 72 79 20 68 61 | 72 64 20 74 6f 20 6d 6f |.very ha|rd to mo|
|00001190| 64 69 66 79 20 61 6e 79 | 20 66 65 61 74 75 72 65 |dify any| feature|
|000011a0| 20 6f 66 20 46 75 6e 6e | 65 6c 57 65 62 20 74 68 | of Funn|elWeb th|
|000011b0| 61 74 20 68 61 64 20 62 | 65 65 6e 20 75 73 65 64 |at had b|een used|
|000011c0| 20 74 6f 20 77 72 69 74 | 65 0d 0a 46 75 6e 6e 65 | to writ|e..Funne|
|000011d0| 6c 57 65 62 2c 20 61 6e | 64 20 74 68 65 20 74 68 |lWeb, an|d the th|
|000011e0| 6f 75 67 68 74 20 6f 66 | 20 77 68 61 74 20 77 6f |ought of| what wo|
|000011f0| 75 6c 64 20 68 61 70 70 | 65 6e 20 69 66 20 74 68 |uld happ|en if th|
|00001200| 65 20 77 6f 72 6b 69 6e | 67 20 65 78 65 63 75 74 |e workin|g execut|
|00001210| 61 62 6c 65 0d 0a 62 65 | 63 61 6d 65 20 69 6e 6f |able..be|came ino|
|00001220| 70 65 72 61 74 69 76 65 | 20 66 6f 72 20 73 6f 6d |perative| for som|
|00001230| 65 20 72 65 61 73 6f 6e | 20 64 6f 65 73 20 6e 6f |e reason| does no|
|00001240| 74 20 62 65 61 72 20 74 | 68 69 6e 6b 69 6e 67 20 |t bear t|hinking |
|00001250| 75 70 6f 6e 2e 0d 0a 0d | 0a 4f 6e 65 20 6d 69 6c |upon....|.One mil|
|00001260| 6c 69 6f 6e 20 62 69 6c | 6c 69 6f 6e 20 63 6f 6d |lion bil|lion com|
|00001270| 70 75 74 65 72 20 70 72 | 6f 67 72 61 6d 73 20 77 |puter pr|ograms w|
|00001280| 65 72 65 20 77 72 69 74 | 74 65 6e 20 69 6e 20 74 |ere writ|ten in t|
|00001290| 68 65 20 6e 6f 6e 2d 6c | 69 74 65 72 61 74 65 0d |he non-l|iterate.|
|000012a0| 0a 73 74 79 6c 65 20 62 | 65 66 6f 72 65 20 46 75 |.style b|efore Fu|
|000012b0| 6e 6e 65 6c 57 65 62 20 | 77 61 73 20 63 72 65 61 |nnelWeb |was crea|
|000012c0| 74 65 64 2e 20 57 68 79 | 20 6e 6f 74 20 6f 6e 65 |ted. Why| not one|
|000012d0| 20 6d 6f 72 65 3f 0d 0a | 0d 0a 5c 73 65 63 74 69 | more?..|..\secti|
|000012e0| 6f 6e 7b 43 6f 64 69 6e | 67 20 53 74 79 6c 65 7d |on{Codin|g Style}|
|000012f0| 0d 0a 5c 78 78 7b 63 6f | 64 69 6e 67 7d 7b 73 74 |..\xx{co|ding}{st|
|00001300| 79 6c 65 7d 0d 0a 0d 0a | 41 6c 74 68 6f 75 67 68 |yle}....|Although|
|00001310| 20 46 75 6e 6e 65 6c 57 | 65 62 20 77 61 73 6e 27 | FunnelW|eb wasn'|
|00001320| 74 20 63 6f 64 65 64 20 | 75 6e 64 65 72 20 61 6e |t coded |under an|
|00001330| 79 20 70 61 72 74 69 63 | 75 6c 61 72 20 63 6f 64 |y partic|ular cod|
|00001340| 69 6e 67 20 73 74 61 6e | 64 61 72 64 2c 0d 0a 69 |ing stan|dard,..i|
|00001350| 74 20 77 61 73 20 63 6f | 64 65 64 20 69 6e 20 61 |t was co|ded in a|
|00001360| 63 63 6f 72 64 61 6e 63 | 65 20 77 69 74 68 20 61 |ccordanc|e with a|
|00001370| 20 66 61 69 72 6c 79 20 | 73 74 72 69 63 74 20 70 | fairly |strict p|
|00001380| 65 72 73 6f 6e 61 6c 20 | 73 74 79 6c 65 20 6f 66 |ersonal |style of|
|00001390| 20 43 0d 0a 77 68 69 63 | 68 20 64 65 76 65 6c 6f | C..whic|h develo|
|000013a0| 70 65 64 20 64 75 72 69 | 6e 67 20 74 68 65 20 64 |ped duri|ng the d|
|000013b0| 65 76 65 6c 6f 70 6d 65 | 6e 74 20 6f 66 20 46 75 |evelopme|nt of Fu|
|000013c0| 6e 6e 65 6c 57 65 62 2e | 20 54 68 69 73 20 73 74 |nnelWeb.| This st|
|000013d0| 79 6c 65 20 77 61 73 0d | 0a 73 75 62 73 65 71 75 |yle was.|.subsequ|
|000013e0| 65 6e 74 6c 79 20 65 6d | 62 6f 64 69 65 64 20 69 |ently em|bodied i|
|000013f0| 6e 20 61 20 72 65 61 6c | 20 43 20 63 6f 64 69 6e |n a real| C codin|
|00001400| 67 20 73 74 61 6e 64 61 | 72 64 20 70 72 65 70 61 |g standa|rd prepa|
|00001410| 72 65 64 20 66 6f 72 20 | 74 68 65 0d 0a 53 6f 75 |red for |the..Sou|
|00001420| 74 68 5c 78 7b 53 6f 75 | 74 68 20 41 75 73 74 72 |th\x{Sou|th Austr|
|00001430| 61 6c 69 61 6e 20 47 6f | 76 65 72 6e 6d 65 6e 74 |alian Go|vernment|
|00001440| 20 44 65 70 61 72 74 6d | 65 6e 74 20 6f 66 20 4c | Departm|ent of L|
|00001450| 61 6e 64 73 7d 0d 0a 41 | 75 73 74 72 61 6c 69 61 |ands}..A|ustralia|
|00001460| 6e 20 47 6f 76 65 72 6e | 6d 65 6e 74 0d 0a 44 65 |n Govern|ment..De|
|00001470| 70 61 72 74 6d 65 6e 74 | 20 6f 66 20 4c 61 6e 64 |partment| of Land|
|00001480| 73 2e 5c 66 6f 6f 74 6e | 6f 74 65 7b 54 68 65 20 |s.\footn|ote{The |
|00001490| 73 74 61 6e 64 61 72 64 | 0d 0a 69 73 20 63 75 72 |standard|..is cur|
|000014a0| 72 65 6e 74 6c 79 20 75 | 6e 61 76 61 69 6c 61 62 |rently u|navailab|
|000014b0| 6c 65 2c 20 62 75 74 20 | 69 73 20 6c 69 6b 65 6c |le, but |is likel|
|000014c0| 79 20 74 6f 20 62 65 20 | 72 65 6c 65 61 73 65 64 |y to be |released|
|000014d0| 20 6f 72 0d 0a 70 75 62 | 6c 69 73 68 65 64 20 65 | or..pub|lished e|
|000014e0| 76 65 6e 74 75 61 6c 6c | 79 2e 7d 20 55 6e 66 6f |ventuall|y.} Unfo|
|000014f0| 72 74 75 6e 61 74 65 6c | 79 2c 20 46 75 6e 6e 65 |rtunatel|y, Funne|
|00001500| 6c 57 65 62 20 77 61 73 | 20 6e 6f 74 0d 0a 66 6f |lWeb was| not..fo|
|00001510| 72 6d 61 6c 6c 79 20 64 | 65 76 65 6c 6f 70 65 64 |rmally d|eveloped|
|00001520| 20 75 6e 64 65 72 20 74 | 68 65 20 73 74 61 6e 64 | under t|he stand|
|00001530| 61 72 64 20 61 6e 64 20 | 73 6f 20 73 6f 6d 65 20 |ard and |so some |
|00001540| 68 6f 6c 65 73 20 72 65 | 6d 61 69 6e 20 69 6e 0d |holes re|main in.|
|00001550| 0a 46 75 6e 6e 65 6c 57 | 65 62 27 73 20 63 6f 64 |.FunnelW|eb's cod|
|00001560| 69 6e 67 20 73 74 79 6c | 65 2e 20 54 68 69 73 20 |ing styl|e. This |
|00001570| 73 65 63 74 69 6f 6e 20 | 61 69 6d 73 20 74 6f 20 |section |aims to |
|00001580| 64 65 73 63 72 69 62 65 | 20 73 6f 6d 65 20 6f 66 |describe| some of|
|00001590| 20 74 68 65 20 6d 6f 72 | 65 0d 0a 69 6d 70 6f 72 | the mor|e..impor|
|000015a0| 74 61 6e 74 20 61 73 70 | 65 63 74 73 20 6f 66 20 |tant asp|ects of |
|000015b0| 74 68 65 20 63 6f 64 69 | 6e 67 20 73 74 79 6c 65 |the codi|ng style|
|000015c0| 2e 0d 0a 0d 0a 5c 74 68 | 69 6e 67 7b 50 6f 72 74 |.....\th|ing{Port|
|000015d0| 61 62 69 6c 69 74 79 3a | 7d 20 54 68 69 73 5c 78 |ability:|} This\x|
|000015e0| 7b 70 6f 72 74 61 62 69 | 6c 69 74 79 7d 0d 0a 77 |{portabi|lity}..w|
|000015f0| 61 73 20 61 20 6d 61 6a | 6f 72 20 67 6f 61 6c 20 |as a maj|or goal |
|00001600| 6f 66 20 74 68 65 20 46 | 75 6e 6e 65 6c 57 65 62 |of the F|unnelWeb|
|00001610| 20 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 2e | impleme|ntation.|
|00001620| 0d 0a 54 77 6f 20 65 78 | 63 65 6c 6c 65 6e 74 20 |..Two ex|cellent |
|00001630| 62 6f 6f 6b 73 20 67 75 | 69 64 65 64 20 74 68 69 |books gu|ided thi|
|00001640| 73 20 6d 6f 76 65 20 74 | 6f 20 70 6f 72 74 61 62 |s move t|o portab|
|00001650| 69 6c 69 74 79 2e 0d 0a | 54 68 65 79 20 77 65 72 |ility...|They wer|
|00001660| 65 20 5c 70 61 70 65 72 | 7b 52 61 62 69 6e 6f 77 |e \paper|{Rabinow|
|00001670| 69 74 7a 39 30 7d 20 28 | 77 68 69 63 68 20 64 65 |itz90} (|which de|
|00001680| 61 6c 73 20 77 69 74 68 | 20 43 20 63 6f 64 65 20 |als with| C code |
|00001690| 69 74 73 65 6c 66 29 0d | 0a 61 6e 64 20 5c 70 61 |itself).|.and \pa|
|000016a0| 70 65 72 7b 48 6f 72 74 | 6f 6e 39 30 7d 20 28 77 |per{Hort|on90} (w|
|000016b0| 68 69 63 68 20 64 65 61 | 6c 73 20 77 69 74 68 20 |hich dea|ls with |
|000016c0| 74 68 65 20 70 6f 72 74 | 61 62 69 6c 69 74 79 20 |the port|ability |
|000016d0| 6f 66 20 76 61 72 69 6f | 75 73 20 6c 69 62 72 61 |of vario|us libra|
|000016e0| 72 79 0d 0a 63 61 6c 6c | 73 29 2e 20 4f 74 68 65 |ry..call|s). Othe|
|000016f0| 72 20 77 6f 72 6b 73 20 | 73 75 63 68 20 61 73 20 |r works |such as |
|00001700| 5c 70 61 70 65 72 7b 4b | 65 72 6e 69 67 68 61 6e |\paper{K|ernighan|
|00001710| 38 38 7d 20 61 6e 64 0d | 0a 5c 70 61 70 65 72 7b |88} and.|.\paper{|
|00001720| 41 4e 53 49 7d 20 77 65 | 72 65 20 61 6c 73 6f 20 |ANSI} we|re also |
|00001730| 68 65 6c 70 66 75 6c 2e | 0d 0a 0d 0a 5c 74 68 69 |helpful.|....\thi|
|00001740| 6e 67 7b 49 64 65 6e 74 | 69 66 69 65 72 73 3a 7d |ng{Ident|ifiers:}|
|00001750| 20 5c 70 61 70 65 72 7b | 52 61 62 69 6e 6f 77 69 | \paper{|Rabinowi|
|00001760| 74 7a 39 30 7d 5c 78 7b | 69 64 65 6e 74 69 66 69 |tz90}\x{|identifi|
|00001770| 65 72 7d 7b 6c 65 6e 67 | 74 68 7d 0d 0a 73 70 65 |er}{leng|th}..spe|
|00001780| 63 69 66 69 65 73 20 74 | 68 61 74 20 66 6f 72 0d |cifies t|hat for.|
|00001790| 0a 77 69 64 65 20 70 6f | 72 74 61 62 69 6c 69 74 |.wide po|rtabilit|
|000017a0| 79 2c 20 69 64 65 6e 74 | 69 66 69 65 72 73 20 6f |y, ident|ifiers o|
|000017b0| 66 20 62 6c 6f 63 6b 20 | 61 6e 64 20 66 69 6c 65 |f block |and file|
|000017c0| 20 73 63 6f 70 65 20 73 | 68 6f 75 6c 64 20 62 65 | scope s|hould be|
|000017d0| 20 75 6e 69 71 75 65 20 | 74 6f 0d 0a 65 69 67 68 | unique |to..eigh|
|000017e0| 74 20 63 68 61 72 61 63 | 74 65 72 73 2c 20 61 6e |t charac|ters, an|
|000017f0| 64 20 69 64 65 6e 74 69 | 66 69 65 72 73 20 6f 66 |d identi|fiers of|
|00001800| 20 70 72 6f 67 72 61 6d | 20 73 63 6f 70 65 20 73 | program| scope s|
|00001810| 68 6f 75 6c 64 20 62 65 | 20 75 6e 69 71 75 65 20 |hould be| unique |
|00001820| 74 6f 0d 0a 73 69 78 20 | 63 68 61 72 61 63 74 65 |to..six |characte|
|00001830| 72 73 2e 20 49 20 68 61 | 76 65 20 67 6f 6e 65 20 |rs. I ha|ve gone |
|00001840| 66 75 72 74 68 65 72 20 | 69 6e 20 46 75 6e 6e 65 |further |in Funne|
|00001850| 6c 57 65 62 20 61 6e 64 | 20 61 63 74 75 61 6c 6c |lWeb and| actuall|
|00001860| 79 20 6d 61 64 65 20 74 | 68 65 73 65 0d 0a 72 65 |y made t|hese..re|
|00001870| 73 74 72 69 63 74 69 6f | 6e 73 20 61 63 74 75 61 |strictio|ns actua|
|00001880| 6c 20 6c 69 6d 69 74 73 | 20 6f 6e 20 69 64 65 6e |l limits| on iden|
|00001890| 74 69 66 69 65 72 20 6c | 65 6e 67 74 68 2e 0d 0a |tifier l|ength...|
|000018a0| 0d 0a 42 65 63 61 75 73 | 65 20 6e 61 6d 65 73 20 |..Becaus|e names |
|000018b0| 6d 75 73 74 20 62 65 20 | 73 6f 20 73 68 6f 72 74 |must be |so short|
|000018c0| 2c 20 61 20 73 79 73 74 | 65 6d 20 6f 66 20 61 62 |, a syst|em of ab|
|000018d0| 62 72 65 76 69 61 74 69 | 6f 6e 73 20 77 61 73 20 |breviati|ons was |
|000018e0| 64 65 76 65 6c 6f 70 65 | 64 20 74 6f 0d 0a 6f 72 |develope|d to..or|
|000018f0| 67 61 6e 69 7a 65 20 74 | 68 65 20 69 64 65 6e 74 |ganize t|he ident|
|00001900| 69 66 69 65 72 73 20 75 | 73 65 64 20 77 69 74 68 |ifiers u|sed with|
|00001910| 69 6e 20 46 75 6e 6e 65 | 6c 57 65 62 2e 20 45 61 |in Funne|lWeb. Ea|
|00001920| 63 68 20 61 62 62 72 65 | 76 69 61 74 69 6f 6e 20 |ch abbre|viation |
|00001930| 63 6f 6e 73 69 73 74 73 | 0d 0a 6f 66 20 61 20 6c |consists|..of a l|
|00001940| 65 74 74 65 72 20 70 61 | 69 72 2e 20 48 65 72 65 |etter pa|ir. Here|
|00001950| 20 61 72 65 20 5c 69 7b | 73 6f 6d 65 7d 20 6f 66 | are \i{|some} of|
|00001960| 20 74 68 65 20 61 62 62 | 72 65 76 69 61 74 69 6f | the abb|reviatio|
|00001970| 6e 73 0d 0a 75 73 65 64 | 3a 5c 78 78 7b 69 64 65 |ns..used|:\xx{ide|
|00001980| 6e 74 69 66 69 65 72 7d | 7b 61 62 62 72 65 76 69 |ntifier}|{abbrevi|
|00001990| 61 74 69 6f 6e 73 7d 0d | 0a 0d 0a 5c 62 65 67 69 |ations}.|...\begi|
|000019a0| 6e 7b 76 65 72 62 61 74 | 69 6d 7d 0d 0a 62 70 20 |n{verbat|im}..bp |
|000019b0| 2d 20 42 6f 64 79 20 50 | 61 72 74 2e 0d 0a 63 6d |- Body P|art...cm|
|000019c0| 20 2d 20 43 6f 6d 70 61 | 72 65 2e 20 55 73 65 64 | - Compa|re. Used|
|000019d0| 20 74 6f 20 70 72 65 66 | 69 78 20 63 6f 6d 70 61 | to pref|ix compa|
|000019e0| 72 69 73 6f 6e 20 72 6f | 75 74 69 6e 65 73 20 74 |rison ro|utines t|
|000019f0| 68 61 74 20 72 65 74 75 | 72 6e 20 5b 2d 31 2c 30 |hat retu|rn [-1,0|
|00001a00| 2c 31 5d 2e 0d 0a 64 63 | 20 2d 20 44 6f 63 75 6d |,1]...dc| - Docum|
|00001a10| 65 6e 74 20 63 6f 6d 70 | 6f 6e 65 6e 74 2e 0d 0a |ent comp|onent...|
|00001a20| 64 6d 20 2d 20 44 75 6d | 70 20 70 61 63 6b 61 67 |dm - Dum|p packag|
|00001a30| 65 2e 0d 0a 65 6c 20 2d | 20 45 6c 65 6d 65 6e 74 |e...el -| Element|
|00001a40| 2e 0d 0a 65 71 20 2d 20 | 45 71 75 61 6c 2e 20 55 |...eq - |Equal. U|
|00001a50| 73 65 64 20 74 6f 20 70 | 72 65 66 69 78 20 63 6f |sed to p|refix co|
|00001a60| 6d 70 61 72 69 73 6f 6e | 20 72 6f 75 74 69 6e 65 |mparison| routine|
|00001a70| 73 20 74 68 61 74 20 72 | 65 74 75 72 6e 20 61 20 |s that r|eturn a |
|00001a80| 62 6f 6f 6c 65 61 6e 2e | 0d 0a 65 78 20 2d 20 45 |boolean.|..ex - E|
|00001a90| 78 70 72 65 73 73 69 6f | 6e 2e 0d 0a 66 20 20 2d |xpressio|n...f -|
|00001aa0| 20 47 6c 6f 62 61 6c 20 | 66 69 6c 65 73 2e 0d 0a | Global |files...|
|00001ab0| 6c 6c 20 2d 20 4c 69 73 | 74 20 6f 66 20 6c 69 73 |ll - Lis|t of lis|
|00001ac0| 74 73 2e 0d 0a 6c 6e 20 | 2d 20 4c 69 6e 65 20 72 |ts...ln |- Line r|
|00001ad0| 65 63 6f 72 64 2e 0d 0a | 6c 73 20 2d 20 4c 69 73 |ecord...|ls - Lis|
|00001ae0| 74 20 50 61 63 6b 61 67 | 65 2e 0d 0a 6c 72 20 2d |t Packag|e...lr -|
|00001af0| 20 4c 69 73 74 65 72 20 | 70 61 63 6b 61 67 65 2e | Lister |package.|
|00001b00| 0d 0a 6d 61 20 2d 20 4d | 61 63 72 6f 2e 0d 0a 6d |..ma - M|acro...m|
|00001b10| 63 20 2d 20 4d 61 63 72 | 6f 20 43 61 6c 6c 2e 0d |c - Macr|o Call..|
|00001b20| 0a 6d 6e 20 2d 20 4d 61 | 63 72 6f 20 4e 61 6d 65 |.mn - Ma|cro Name|
|00001b30| 2e 0d 0a 6f 70 20 2d 20 | 4f 70 74 69 6f 6e 73 20 |...op - |Options |
|00001b40| 70 61 63 6b 61 67 65 2e | 0d 0a 70 72 20 2d 20 50 |package.|..pr - P|
|00001b50| 61 72 73 65 72 2e 0d 0a | 70 73 20 2d 20 50 6f 73 |arser...|ps - Pos|
|00001b60| 69 74 69 6f 6e 20 72 65 | 63 6f 72 64 2e 0d 0a 73 |ition re|cord...s|
|00001b70| 63 20 2d 20 53 63 72 61 | 70 20 72 65 63 6f 72 64 |c - Scra|p record|
|00001b80| 2e 0d 0a 73 6e 20 2d 20 | 53 65 63 74 69 6f 6e 2e |...sn - |Section.|
|00001b90| 0d 0a 74 62 20 2d 20 54 | 61 62 6c 65 20 70 61 63 |..tb - T|able pac|
|00001ba0| 6b 61 67 65 2e 0d 0a 74 | 79 20 2d 20 54 79 70 65 |kage...t|y - Type|
|00001bb0| 73 65 74 74 65 72 20 64 | 69 72 65 63 74 69 76 65 |setter d|irective|
|00001bc0| 2e 0d 0a 77 66 20 2d 20 | 57 72 69 74 65 20 66 69 |...wf - |Write fi|
|00001bd0| 6c 65 20 70 61 63 6b 61 | 67 65 2e 0d 0a 77 6c 20 |le packa|ge...wl |
|00001be0| 2d 20 57 72 69 74 65 20 | 77 69 74 68 20 45 4f 4c |- Write |with EOL|
|00001bf0| 20 28 6d 69 73 63 2e 63 | 29 2e 0d 0a 77 72 20 2d | (misc.c|)...wr -|
|00001c00| 20 57 72 69 74 65 20 20 | 20 20 20 20 20 20 20 20 | Write | |
|00001c10| 28 6d 69 73 63 2e 63 29 | 2e 0d 0a 5c 65 6e 64 7b |(misc.c)|...\end{|
|00001c20| 76 65 72 62 61 74 69 6d | 7d 0d 0a 0d 0a 5c 74 68 |verbatim|}....\th|
|00001c30| 69 6e 67 7b 50 6f 69 6e | 74 65 72 73 3a 7d 20 56 |ing{Poin|ters:} V|
|00001c40| 61 72 69 61 62 6c 65 73 | 20 6f 72 20 74 79 70 65 |ariables| or type|
|00001c50| 73 20 64 65 6e 6f 74 69 | 6e 67 0d 0a 70 6f 69 6e |s denoti|ng..poin|
|00001c60| 74 65 72 73 5c 78 78 7b | 70 6f 69 6e 74 65 72 73 |ters\xx{|pointers|
|00001c70| 7d 7b 6e 61 6d 69 6e 67 | 7d 20 73 74 61 72 74 20 |}{naming|} start |
|00001c80| 77 69 74 68 20 5c 64 71 | 70 7b 70 5c 5f 7d 2e 0d |with \dq|p{p\_}..|
|00001c90| 0a 0d 0a 5c 74 68 69 6e | 67 7b 54 79 70 65 73 3a |...\thin|g{Types:|
|00001ca0| 7d 20 4e 61 6d 65 73 20 | 64 65 6e 6f 74 69 6e 67 |} Names |denoting|
|00001cb0| 20 74 79 70 65 73 20 65 | 6e 64 20 69 6e 20 5c 64 | types e|nd in \d|
|00001cc0| 71 70 7b 5c 5f 74 7d 2e | 0d 0a 54 68 75 73 2c 20 |qp{\_t}.|..Thus, |
|00001cd0| 61 20 74 79 70 65 20 66 | 6f 72 20 61 20 70 6f 69 |a type f|or a poi|
|00001ce0| 6e 74 65 72 20 74 6f 20 | 61 20 74 61 62 6c 65 20 |nter to |a table |
|00001cf0| 77 6f 75 6c 64 20 62 65 | 20 6e 61 6d 65 64 0d 0a |would be| named..|
|00001d00| 5c 70 7b 70 5c 5f 74 62 | 5c 5f 74 7d 2e 5c 78 78 |\p{p\_tb|\_t}.\xx|
|00001d10| 7b 74 79 70 65 73 7d 7b | 6e 61 6d 69 6e 67 7d 0d |{types}{|naming}.|
|00001d20| 0a 0d 0a 5c 74 68 69 6e | 67 7b 46 69 6c 65 20 6e |...\thin|g{File n|
|00001d30| 61 6d 65 73 3a 7d 20 41 | 6c 6c 20 66 69 6c 65 73 |ames:} A|ll files|
|00001d40| 5c 78 78 7b 66 69 6c 65 | 6e 61 6d 65 73 7d 7b 6c |\xx{file|names}{l|
|00001d50| 65 6e 67 74 68 7d 0d 0a | 75 73 65 64 20 69 6e 20 |ength}..|used in |
|00001d60| 46 75 6e 6e 65 6c 57 65 | 62 20 68 61 76 65 20 66 |FunnelWe|b have f|
|00001d70| 69 6c 65 20 6e 61 6d 65 | 73 20 74 68 61 74 20 61 |ile name|s that a|
|00001d80| 72 65 0d 0a 66 72 6f 6d | 20 6f 6e 65 20 74 6f 20 |re..from| one to |
|00001d90| 65 69 67 68 74 20 63 68 | 61 72 61 63 74 65 72 73 |eight ch|aracters|
|00001da0| 20 6c 6f 6e 67 20 61 6e | 64 20 66 69 6c 65 20 65 | long an|d file e|
|00001db0| 78 74 65 6e 73 69 6f 6e | 73 20 74 68 61 74 20 61 |xtension|s that a|
|00001dc0| 72 65 20 66 72 6f 6d 20 | 6f 6e 65 20 74 6f 0d 0a |re from |one to..|
|00001dd0| 74 68 72 65 65 20 63 68 | 61 72 61 63 74 65 72 73 |three ch|aracters|
|00001de0| 20 6c 6f 6e 67 2e 20 54 | 68 69 73 20 65 6e 73 75 | long. T|his ensu|
|00001df0| 72 65 73 20 74 68 61 74 | 20 74 68 65 20 66 69 6c |res that| the fil|
|00001e00| 65 73 20 63 61 6e 20 62 | 65 20 70 6f 72 74 61 62 |es can b|e portab|
|00001e10| 6c 79 20 6d 6f 76 65 64 | 0d 0a 74 6f 20 61 6c 6c |ly moved|..to all|
|00001e20| 20 6b 69 6e 64 73 20 6f | 66 20 6d 61 63 68 69 6e | kinds o|f machin|
|00001e30| 65 73 2c 20 65 76 65 6e | 20 4d 53 44 4f 53 21 5c |es, even| MSDOS!\|
|00001e40| 78 7b 4d 53 44 4f 53 7d | 0d 0a 0d 0a 5c 73 65 63 |x{MSDOS}|....\sec|
|00001e50| 74 69 6f 6e 7b 55 73 65 | 20 6f 66 20 4d 65 6d 6f |tion{Use| of Memo|
|00001e60| 72 79 7d 0d 0a 5c 78 78 | 7b 75 73 65 20 6f 66 7d |ry}..\xx|{use of}|
|00001e70| 7b 6d 65 6d 6f 72 79 7d | 0d 0a 0d 0a 46 75 6e 6e |{memory}|....Funn|
|00001e80| 65 6c 57 65 62 20 69 73 | 20 6e 6f 74 20 61 20 6d |elWeb is| not a m|
|00001e90| 65 6d 6f 72 79 2d 73 74 | 72 65 73 73 65 64 20 70 |emory-st|ressed p|
|00001ea0| 72 6f 67 72 61 6d 2e 20 | 48 6f 77 65 76 65 72 2c |rogram. |However,|
|00001eb0| 20 64 75 72 69 6e 67 20 | 69 74 73 20 64 65 76 65 | during |its deve|
|00001ec0| 6c 6f 70 6d 65 6e 74 2c | 0d 0a 70 72 6f 62 6c 65 |lopment,|..proble|
|00001ed0| 6d 73 20 77 69 74 68 20 | 74 68 65 20 6d 61 6e 61 |ms with |the mana|
|00001ee0| 67 65 6d 65 6e 74 20 6f | 66 20 6d 65 6d 6f 72 79 |gement o|f memory|
|00001ef0| 20 73 65 65 6d 65 64 20 | 74 6f 20 63 72 6f 70 20 | seemed |to crop |
|00001f00| 75 70 20 61 67 61 69 6e | 20 61 6e 64 20 61 67 61 |up again| and aga|
|00001f10| 69 6e 2e 0d 0a 54 68 69 | 73 20 73 65 63 74 69 6f |in...Thi|s sectio|
|00001f20| 6e 20 64 6f 63 75 6d 65 | 6e 74 73 20 73 6f 6d 65 |n docume|nts some|
|00001f30| 20 6f 66 20 74 68 65 73 | 65 20 70 72 6f 62 6c 65 | of thes|e proble|
|00001f40| 6d 73 20 61 6e 64 20 74 | 68 65 20 73 6f 6c 75 74 |ms and t|he solut|
|00001f50| 69 6f 6e 73 20 61 64 6f | 70 74 65 64 2e 0d 0a 0d |ions ado|pted....|
|00001f60| 0a 54 68 65 72 65 20 61 | 72 65 20 74 68 72 65 65 |.There a|re three|
|00001f70| 20 70 6c 61 63 65 73 20 | 77 68 65 72 65 20 6d 65 | places |where me|
|00001f80| 6d 6f 72 79 20 63 61 6e | 20 62 65 20 6f 62 74 61 |mory can| be obta|
|00001f90| 69 6e 65 64 3a 20 74 68 | 65 20 68 65 61 70 2c 20 |ined: th|e heap, |
|00001fa0| 74 68 65 20 73 74 61 63 | 6b 2c 0d 0a 61 6e 64 20 |the stac|k,..and |
|00001fb0| 66 72 6f 6d 20 73 74 61 | 74 69 63 20 76 61 72 69 |from sta|tic vari|
|00001fc0| 61 62 6c 65 73 2e 20 54 | 68 65 20 66 6f 6c 6c 6f |ables. T|he follo|
|00001fd0| 77 69 6e 67 20 74 68 72 | 65 65 20 73 65 63 74 69 |wing thr|ee secti|
|00001fe0| 6f 6e 73 20 64 65 61 6c | 20 77 69 74 68 20 65 61 |ons deal| with ea|
|00001ff0| 63 68 0d 0a 6f 66 20 74 | 68 65 73 65 20 61 72 65 |ch..of t|hese are|
|00002000| 61 73 2e 0d 0a 0d 0a 5c | 73 65 63 74 69 6f 6e 7b |as.....\|section{|
|00002010| 54 68 65 20 48 65 61 70 | 7d 0d 0a 5c 78 78 7b 68 |The Heap|}..\xx{h|
|00002020| 65 61 70 7d 7b 6d 65 6d | 6f 72 79 7d 0d 0a 0d 0a |eap}{mem|ory}....|
|00002030| 4f 6e 65 20 6f 66 20 74 | 68 65 20 67 72 65 61 74 |One of t|he great|
|00002040| 20 66 72 75 73 74 72 61 | 74 69 6f 6e 73 20 6f 66 | frustra|tions of|
|00002050| 20 62 65 69 6e 67 20 61 | 20 75 73 65 72 20 69 73 | being a| user is|
|00002060| 20 74 6f 20 66 69 6e 64 | 20 74 68 61 74 20 61 20 | to find| that a |
|00002070| 63 6f 6d 70 75 74 65 72 | 0d 0a 70 72 6f 67 72 61 |computer|..progra|
|00002080| 6d 20 69 73 20 63 6f 6d | 70 6c 61 69 6e 69 6e 67 |m is com|plaining|
|00002090| 20 61 62 6f 75 74 20 6c | 61 63 6b 20 6f 66 20 6d | about l|ack of m|
|000020a0| 65 6d 6f 72 79 20 77 68 | 65 6e 20 6f 6e 65 20 6b |emory wh|en one k|
|000020b0| 6e 6f 77 73 20 66 75 6c | 6c 20 77 65 6c 6c 20 74 |nows ful|l well t|
|000020c0| 68 61 74 0d 0a 6f 6e 65 | 20 68 61 73 20 61 6c 6c |hat..one| has all|
|000020d0| 6f 63 61 74 65 64 20 61 | 74 20 6c 65 61 73 74 20 |ocated a|t least |
|000020e0| 74 65 6e 20 74 69 6d 65 | 73 20 61 73 20 6d 75 63 |ten time|s as muc|
|000020f0| 68 20 6d 65 6d 6f 72 79 | 20 74 6f 20 74 68 65 20 |h memory| to the |
|00002100| 70 72 6f 67 72 61 6d 20 | 61 73 20 69 74 0d 0a 77 |program |as it..w|
|00002110| 6f 75 6c 64 20 65 76 65 | 72 20 6e 65 65 64 20 74 |ould eve|r need t|
|00002120| 6f 20 64 6f 20 69 74 73 | 20 6a 6f 62 2e 20 54 68 |o do its| job. Th|
|00002130| 65 20 72 65 61 73 6f 6e | 20 66 6f 72 20 73 75 63 |e reason| for suc|
|00002140| 68 20 65 72 72 6f 72 20 | 6d 65 73 73 61 67 65 73 |h error |messages|
|00002150| 20 75 73 75 61 6c 6c 79 | 0d 0a 68 61 73 20 74 6f | usually|..has to|
|00002160| 20 64 6f 20 77 69 74 68 | 20 74 68 65 20 70 72 6f | do with| the pro|
|00002170| 67 72 61 6d 6d 65 72 20 | 73 65 74 74 69 6e 67 20 |grammer |setting |
|00002180| 61 20 66 69 78 65 64 20 | 5c 64 71 7b 72 65 61 73 |a fixed |\dq{reas|
|00002190| 6f 6e 61 62 6c 65 7d 20 | 6c 69 6d 69 74 20 74 6f |onable} |limit to|
|000021a0| 0d 0a 61 20 70 61 72 74 | 69 63 75 6c 61 72 20 64 |..a part|icular d|
|000021b0| 61 74 61 20 73 74 72 75 | 63 74 75 72 65 20 61 6e |ata stru|cture an|
|000021c0| 64 20 74 68 65 6e 20 6c | 6f 63 6b 69 6e 67 20 69 |d then l|ocking i|
|000021d0| 74 20 75 70 20 69 6e 74 | 6f 20 61 6e 20 61 72 72 |t up int|o an arr|
|000021e0| 61 79 20 77 68 6f 73 65 | 0d 0a 62 6f 75 6e 64 20 |ay whose|..bound |
|000021f0| 69 73 20 73 70 65 63 69 | 66 69 65 64 20 62 79 20 |is speci|fied by |
|00002200| 61 20 63 6f 6e 73 74 61 | 6e 74 2e 20 57 68 69 6c |a consta|nt. Whil|
|00002210| 65 20 74 68 65 20 75 73 | 65 20 6f 66 20 61 72 72 |e the us|e of arr|
|00002220| 61 79 73 20 63 61 6e 20 | 69 6e 63 72 65 61 73 65 |ays can |increase|
|00002230| 20 74 68 65 0d 0a 73 70 | 65 65 64 20 6f 66 20 61 | the..sp|eed of a|
|00002240| 20 70 72 6f 67 72 61 6d | 2c 20 69 74 20 61 6c 73 | program|, it als|
|00002250| 6f 20 6d 65 61 6e 73 20 | 74 68 61 74 20 74 68 65 |o means |that the|
|00002260| 20 75 73 65 72 20 63 61 | 6e 6e 6f 74 20 69 6e 63 | user ca|nnot inc|
|00002270| 72 65 61 73 65 20 74 68 | 65 20 63 61 70 61 63 69 |rease th|e capaci|
|00002280| 74 79 0d 0a 6f 66 20 74 | 68 65 20 70 72 6f 67 72 |ty..of t|he progr|
|00002290| 61 6d 20 77 69 74 68 6f | 75 74 20 6f 62 74 61 69 |am witho|ut obtai|
|000022a0| 6e 69 6e 67 20 74 68 65 | 20 73 6f 75 72 63 65 20 |ning the| source |
|000022b0| 63 6f 64 65 20 61 6e 64 | 20 72 65 63 6f 6d 70 69 |code and| recompi|
|000022c0| 6c 69 6e 67 20 69 74 2c | 0d 0a 77 68 69 63 68 20 |ling it,|..which |
|000022d0| 69 73 20 75 73 75 61 6c | 6c 79 20 61 20 64 61 75 |is usual|ly a dau|
|000022e0| 6e 74 69 6e 67 20 6f 70 | 74 69 6f 6e 2e 0d 0a 0d |nting op|tion....|
|000022f0| 0a 54 68 65 20 61 6c 74 | 65 72 6e 61 74 69 76 65 |.The alt|ernative|
|00002300| 20 69 73 20 74 6f 20 75 | 73 65 20 74 68 65 20 68 | is to u|se the h|
|00002310| 65 61 70 20 66 6f 72 20 | 61 6c 6c 20 64 61 74 61 |eap for |all data|
|00002320| 20 73 74 72 75 63 74 75 | 72 65 73 20 74 68 61 74 | structu|res that|
|00002330| 20 63 61 6e 0d 0a 67 72 | 6f 77 20 69 6e 20 70 72 | can..gr|ow in pr|
|00002340| 6f 70 6f 72 74 69 6f 6e | 20 74 6f 20 74 68 65 20 |oportion| to the |
|00002350| 73 69 7a 65 20 6f 66 20 | 74 68 65 20 75 73 65 72 |size of |the user|
|00002360| 27 73 20 69 6e 70 75 74 | 2e 20 54 68 69 73 20 72 |'s input|. This r|
|00002370| 75 6c 65 20 68 61 73 20 | 62 65 65 6e 0d 0a 66 6f |ule has |been..fo|
|00002380| 6c 6c 6f 77 65 64 20 72 | 69 67 6f 72 6f 75 73 6c |llowed r|igorousl|
|00002390| 79 20 69 6e 20 46 75 6e | 6e 65 6c 57 65 62 2e 20 |y in Fun|nelWeb. |
|000023a0| 54 68 69 73 20 6d 65 61 | 6e 73 20 74 68 61 74 20 |This mea|ns that |
|000023b0| 61 73 20 6d 65 6d 6f 72 | 79 20 73 70 61 63 65 73 |as memor|y spaces|
|000023c0| 0d 0a 69 6e 63 72 65 61 | 73 65 2c 20 75 73 65 72 |..increa|se, user|
|000023d0| 73 20 77 69 6c 6c 20 62 | 65 20 61 62 6c 65 20 74 |s will b|e able t|
|000023e0| 6f 20 68 61 6e 64 20 74 | 68 65 69 72 20 76 65 72 |o hand t|heir ver|
|000023f0| 73 69 6f 6e 20 6f 66 20 | 46 75 6e 6e 65 6c 57 65 |sion of |FunnelWe|
|00002400| 62 20 6d 6f 72 65 0d 0a | 6d 65 6d 6f 72 79 20 77 |b more..|memory w|
|00002410| 69 74 68 6f 75 74 20 68 | 61 76 69 6e 67 20 74 6f |ithout h|aving to|
|00002420| 20 72 65 63 6f 6d 70 69 | 6c 65 20 69 74 2e 0d 0a | recompi|le it...|
|00002430| 0d 0a 5c 74 6f 70 69 63 | 62 72 65 61 6b 0d 0a 0d |..\topic|break...|
|00002440| 0a 53 6f 6d 65 20 70 72 | 6f 62 6c 65 6d 73 20 61 |.Some pr|oblems a|
|00002450| 72 6f 73 65 20 65 61 72 | 6c 79 20 6f 6e 20 74 68 |rose ear|ly on th|
|00002460| 65 20 4d 61 63 69 6e 74 | 6f 73 68 5c 78 7b 4d 61 |e Macint|osh\x{Ma|
|00002470| 63 69 6e 74 6f 73 68 7d | 0d 0a 69 6e 20 74 68 65 |cintosh}|..in the|
|00002480| 20 75 73 65 20 6f 66 20 | 74 68 65 20 68 65 61 70 | use of |the heap|
|00002490| 2e 20 49 74 20 73 65 65 | 6d 73 0d 0a 74 68 61 74 |. It see|ms..that|
|000024a0| 20 73 6f 6d 65 20 6f 66 | 20 74 68 65 20 61 6c 6c | some of| the all|
|000024b0| 6f 63 61 74 69 6f 6e 73 | 20 49 20 77 61 73 20 61 |ocations| I was a|
|000024c0| 74 74 65 6d 70 74 69 6e | 67 20 74 6f 20 6d 61 6b |ttemptin|g to mak|
|000024d0| 65 20 77 65 72 65 20 66 | 61 69 6c 69 6e 67 20 66 |e were f|ailing f|
|000024e0| 6f 72 20 73 6f 6d 65 0d | 0a 6f 62 73 63 75 72 65 |or some.|.obscure|
|000024f0| 20 72 65 61 73 6f 6e 2c | 20 70 6f 73 73 69 62 6c | reason,| possibl|
|00002500| 79 20 6d 79 20 66 61 75 | 6c 74 2e 20 57 68 61 74 |y my fau|lt. What|
|00002510| 65 76 65 72 20 69 74 20 | 77 61 73 2c 20 69 74 20 |ever it |was, it |
|00002520| 77 65 6e 74 20 61 77 61 | 79 20 77 68 65 6e 20 49 |went awa|y when I|
|00002530| 0d 0a 72 65 70 6c 61 63 | 65 64 20 64 69 72 65 63 |..replac|ed direc|
|00002540| 74 20 63 61 6c 6c 73 20 | 74 6f 20 5c 70 7b 6d 61 |t calls |to \p{ma|
|00002550| 6c 6c 6f 63 7d 5c 78 7b | 6d 61 6c 6c 6f 63 7d 0d |lloc}\x{|malloc}.|
|00002560| 0a 77 69 74 68 20 63 61 | 6c 6c 73 20 74 6f 20 61 |.with ca|lls to a|
|00002570| 20 6d 69 6e 69 20 70 61 | 63 6b 61 67 65 20 49 20 | mini pa|ckage I |
|00002580| 77 72 6f 74 65 0d 0a 28 | 63 61 6c 6c 65 64 20 5c |wrote..(|called \|
|00002590| 70 7b 6d 65 6d 6f 72 79 | 7d 29 20 74 68 61 74 20 |p{memory|}) that |
|000025a0| 61 6c 6c 6f 63 61 74 65 | 64 20 6c 61 72 67 65 20 |allocate|d large |
|000025b0| 63 68 75 6e 6b 73 20 6f | 66 20 6d 65 6d 6f 72 79 |chunks o|f memory|
|000025c0| 20 61 6e 64 20 74 68 65 | 6e 20 64 6f 6c 65 64 20 | and the|n doled |
|000025d0| 6f 75 74 0d 0a 73 6d 61 | 6c 6c 20 70 69 65 63 65 |out..sma|ll piece|
|000025e0| 73 20 61 73 20 72 65 71 | 75 69 72 65 64 20 62 79 |s as req|uired by|
|000025f0| 20 74 68 65 20 72 65 73 | 74 20 6f 66 20 74 68 65 | the res|t of the|
|00002600| 0d 0a 70 72 6f 67 72 61 | 6d 2e 5c 78 78 7b 6d 65 |..progra|m.\xx{me|
|00002610| 6d 6f 72 79 7d 7b 70 61 | 63 6b 61 67 65 7d 0d 0a |mory}{pa|ckage}..|
|00002620| 0d 0a 48 61 76 69 6e 67 | 20 61 20 70 61 63 6b 61 |..Having| a packa|
|00002630| 67 65 20 74 6f 20 6d 61 | 6e 61 67 65 20 61 6c 6c |ge to ma|nage all|
|00002640| 20 74 68 65 20 6d 65 6d | 6f 72 79 20 61 6c 6c 6f | the mem|ory allo|
|00002650| 63 61 74 69 6f 6e 20 68 | 61 64 20 74 77 6f 20 6f |cation h|ad two o|
|00002660| 74 68 65 72 20 62 65 6e | 65 66 69 74 73 2e 0d 0a |ther ben|efits...|
|00002670| 0d 0a 46 69 72 73 74 2c | 20 6f 6e 6c 79 20 6f 6e |..First,| only on|
|00002680| 65 20 63 68 65 63 6b 20 | 77 61 73 20 72 65 71 75 |e check |was requ|
|00002690| 69 72 65 64 20 69 6e 20 | 74 68 65 20 65 6e 74 69 |ired in |the enti|
|000026a0| 72 65 20 70 72 6f 67 72 | 61 6d 20 74 6f 20 73 65 |re progr|am to se|
|000026b0| 65 20 69 66 20 6d 65 6d | 6f 72 79 0d 0a 68 61 64 |e if mem|ory..had|
|000026c0| 20 72 75 6e 20 6f 75 74 | 20 28 69 6e 20 74 68 65 | run out| (in the|
|000026d0| 20 6d 65 6d 6f 72 79 20 | 70 61 63 6b 61 67 65 29 | memory |package)|
|000026e0| 2c 20 61 6e 64 20 69 66 | 20 74 68 61 74 20 66 61 |, and if| that fa|
|000026f0| 69 6c 65 64 2c 20 74 68 | 65 20 70 72 6f 67 72 61 |iled, th|e progra|
|00002700| 6d 20 63 6f 75 6c 64 0d | 0a 62 65 20 62 72 6f 75 |m could.|.be brou|
|00002710| 67 68 74 20 74 6f 20 61 | 20 73 63 72 65 61 6d 69 |ght to a| screami|
|00002720| 6e 67 20 68 61 6c 74 2e | 20 54 68 69 73 20 6f 72 |ng halt.| This or|
|00002730| 67 61 6e 69 7a 61 74 69 | 6f 6e 20 77 61 73 20 66 |ganizati|on was f|
|00002740| 61 72 20 70 72 65 66 65 | 72 61 62 6c 65 20 74 6f |ar prefe|rable to|
|00002750| 0d 0a 68 61 76 69 6e 67 | 20 65 61 63 68 20 70 69 |..having| each pi|
|00002760| 65 63 65 20 6f 66 20 63 | 6f 64 65 20 74 68 61 74 |ece of c|ode that|
|00002770| 20 6e 65 65 64 65 64 20 | 74 6f 20 61 6c 6c 6f 63 | needed |to alloc|
|00002780| 61 74 65 20 6d 65 6d 6f | 72 79 20 68 61 76 69 6e |ate memo|ry havin|
|00002790| 67 20 74 6f 20 63 68 65 | 63 6b 0d 0a 74 6f 20 73 |g to che|ck..to s|
|000027a0| 65 65 20 69 66 20 5c 70 | 7b 6d 61 6c 6c 6f 63 7d |ee if \p|{malloc}|
|000027b0| 20 68 61 64 20 66 61 69 | 6c 65 64 2e 0d 0a 0d 0a | had fai|led.....|
|000027c0| 53 65 63 6f 6e 64 2c 20 | 74 68 65 20 64 65 63 69 |Second, |the deci|
|000027d0| 73 69 6f 6e 20 74 6f 20 | 63 6f 6e 73 74 72 75 63 |sion to |construc|
|000027e0| 74 20 61 20 6d 69 6e 69 | 2d 73 68 65 6c 6c 20 77 |t a mini|-shell w|
|000027f0| 69 74 68 69 6e 20 46 75 | 6e 6e 65 6c 57 65 62 20 |ithin Fu|nnelWeb |
|00002800| 74 6f 0d 0a 73 75 70 70 | 6f 72 74 20 72 65 67 72 |to..supp|ort regr|
|00002810| 65 73 73 69 6f 6e 20 74 | 65 73 74 69 6e 67 20 6d |ession t|esting m|
|00002820| 65 61 6e 74 20 74 68 61 | 74 20 46 75 6e 6e 65 6c |eant tha|t Funnel|
|00002830| 57 65 62 20 70 72 6f 70 | 65 72 20 63 6f 75 6c 64 |Web prop|er could|
|00002840| 20 62 65 20 72 75 6e 0d | 0a 6d 61 6e 79 20 74 69 | be run.|.many ti|
|00002850| 6d 65 73 20 69 6e 20 61 | 6e 79 20 67 69 76 65 6e |mes in a|ny given|
|00002860| 20 69 6e 76 6f 63 61 74 | 69 6f 6e 20 6f 66 20 46 | invocat|ion of F|
|00002870| 75 6e 6e 65 6c 57 65 62 | 2e 20 41 73 20 61 20 63 |unnelWeb|. As a c|
|00002880| 6f 6e 73 65 71 75 65 6e | 63 65 20 69 74 20 77 61 |onsequen|ce it wa|
|00002890| 73 0d 0a 6e 65 63 65 73 | 73 61 72 79 20 74 6f 20 |s..neces|sary to |
|000028a0| 6d 61 6b 65 20 73 75 72 | 65 20 74 68 61 74 20 74 |make sur|e that t|
|000028b0| 68 65 72 65 20 77 61 73 | 20 6e 6f 20 6d 65 6d 6f |here was| no memo|
|000028c0| 72 79 0d 0a 6c 65 61 6b | 61 67 65 5c 78 78 7b 6d |ry..leak|age\xx{m|
|000028d0| 65 6d 6f 72 79 7d 7b 6c | 65 61 6b 61 67 65 7d 20 |emory}{l|eakage} |
|000028e0| 62 65 74 77 65 65 6e 20 | 69 6e 76 6f 63 61 74 69 |between |invocati|
|000028f0| 6f 6e 73 0d 0a 6f 66 20 | 46 75 6e 6e 65 6c 57 65 |ons..of |FunnelWe|
|00002900| 62 20 70 72 6f 70 65 72 | 2e 20 54 68 69 73 20 77 |b proper|. This w|
|00002910| 61 73 20 61 63 63 6f 6d | 70 6c 69 73 68 65 64 20 |as accom|plished |
|00002920| 62 79 20 72 65 77 6f 72 | 6b 69 6e 67 20 74 68 65 |by rewor|king the|
|00002930| 20 6d 65 6d 6f 72 79 20 | 70 61 63 6b 61 67 65 0d | memory |package.|
|00002940| 0a 74 6f 20 6f 70 65 72 | 61 74 65 20 61 20 77 61 |.to oper|ate a wa|
|00002950| 74 65 72 6d 61 72 6b 20 | 73 79 73 74 65 6d 2e 20 |termark |system. |
|00002960| 54 68 65 20 75 73 65 72 | 20 6f 66 20 74 68 65 20 |The user| of the |
|00002970| 70 61 63 6b 61 67 65 2c | 20 77 68 65 6e 20 72 65 |package,| when re|
|00002980| 71 75 65 73 74 69 6e 67 | 0d 0a 6d 65 6d 6f 72 79 |questing|..memory|
|00002990| 2c 20 63 6f 75 6c 64 20 | 72 65 71 75 65 73 74 20 |, could |request |
|000029a0| 5c 64 71 7b 74 65 6d 70 | 6f 72 61 72 79 7d 20 6f |\dq{temp|orary} o|
|000029b0| 72 20 5c 64 71 7b 70 65 | 72 6d 61 6e 65 6e 74 7d |r \dq{pe|rmanent}|
|000029c0| 2e 20 49 66 20 70 65 72 | 6d 61 6e 65 6e 74 2c 20 |. If per|manent, |
|000029d0| 74 68 65 0d 0a 6d 65 6d | 6f 72 79 20 70 61 63 6b |the..mem|ory pack|
|000029e0| 61 67 65 20 66 6f 72 67 | 6f 74 20 74 68 61 74 20 |age forg|ot that |
|000029f0| 69 74 20 68 61 64 20 61 | 6c 6c 6f 63 61 74 65 64 |it had a|llocated|
|00002a00| 20 74 68 65 20 6d 65 6d | 6f 72 79 2e 20 49 66 20 | the mem|ory. If |
|00002a10| 74 65 6d 70 6f 72 61 72 | 79 2c 20 74 68 65 0d 0a |temporar|y, the..|
|00002a20| 6d 65 6d 6f 72 79 20 70 | 61 63 6b 61 67 65 20 70 |memory p|ackage p|
|00002a30| 6c 61 63 65 73 20 74 68 | 65 20 61 6c 6c 6f 63 61 |laces th|e alloca|
|00002a40| 74 65 64 20 62 6c 6f 63 | 6b 20 6f 6e 20 61 20 6c |ted bloc|k on a l|
|00002a50| 69 73 74 2e 20 54 68 65 | 72 65 20 77 61 73 20 74 |ist. The|re was t|
|00002a60| 68 65 6e 20 61 0d 0a 66 | 75 6e 63 74 69 6f 6e 20 |hen a..f|unction |
|00002a70| 69 6e 20 74 68 65 20 6d | 65 6d 6f 72 79 20 70 61 |in the m|emory pa|
|00002a80| 63 6b 61 67 65 20 74 68 | 61 74 20 63 6f 75 6c 64 |ckage th|at could|
|00002a90| 20 62 65 20 63 61 6c 6c | 65 64 20 74 6f 20 64 65 | be call|ed to de|
|00002aa0| 61 6c 6c 6f 63 61 74 65 | 20 61 6c 6c 20 74 68 65 |allocate| all the|
|00002ab0| 0d 0a 74 65 6d 70 6f 72 | 61 72 79 20 6d 65 6d 6f |..tempor|ary memo|
|00002ac0| 72 79 2e 20 54 68 75 73 | 2c 20 73 6f 20 6c 6f 6e |ry. Thus|, so lon|
|00002ad0| 67 20 61 73 20 61 6c 6c | 20 72 65 71 75 65 73 74 |g as all| request|
|00002ae0| 73 20 66 6f 72 20 6d 65 | 6d 6f 72 79 20 77 69 74 |s for me|mory wit|
|00002af0| 68 69 6e 20 46 75 6e 6e | 65 6c 57 65 62 0d 0a 70 |hin Funn|elWeb..p|
|00002b00| 72 6f 70 65 72 20 77 65 | 72 65 20 66 6f 72 20 74 |roper we|re for t|
|00002b10| 65 6d 70 6f 72 61 72 79 | 20 6d 65 6d 6f 72 79 2c |emporary| memory,|
|00002b20| 20 61 6e 64 20 74 68 61 | 74 20 6d 65 6d 6f 72 79 | and tha|t memory|
|00002b30| 20 77 61 73 20 66 72 65 | 65 64 20 61 74 20 74 68 | was fre|ed at th|
|00002b40| 65 20 65 6e 64 20 6f 66 | 0d 0a 65 76 65 72 79 20 |e end of|..every |
|00002b50| 72 75 6e 2c 20 6f 6e 65 | 20 63 6f 75 6c 64 20 62 |run, one| could b|
|00002b60| 65 20 73 75 72 65 20 74 | 68 61 74 20 74 68 65 72 |e sure t|hat ther|
|00002b70| 65 20 77 61 73 20 6e 6f | 20 6d 65 6d 6f 72 79 20 |e was no| memory |
|00002b80| 6c 65 61 6b 61 67 65 2e | 0d 0a 0d 0a 5c 73 65 63 |leakage.|....\sec|
|00002b90| 74 69 6f 6e 7b 54 68 65 | 20 53 74 61 63 6b 7d 0d |tion{The| Stack}.|
|00002ba0| 0a 5c 78 78 7b 73 74 61 | 63 6b 7d 7b 6d 65 6d 6f |.\xx{sta|ck}{memo|
|00002bb0| 72 79 7d 5c 78 78 7b 73 | 74 61 63 6b 7d 7b 73 69 |ry}\xx{s|tack}{si|
|00002bc0| 7a 65 7d 0d 0a 0d 0a 46 | 6f 72 20 61 20 77 68 69 |ze}....F|or a whi|
|00002bd0| 6c 65 20 64 75 72 69 6e | 67 20 74 68 65 20 64 65 |le durin|g the de|
|00002be0| 76 65 6c 6f 70 6d 65 6e | 74 20 6f 66 20 46 75 6e |velopmen|t of Fun|
|00002bf0| 6e 65 6c 57 65 62 20 61 | 20 70 61 72 74 69 63 75 |nelWeb a| particu|
|00002c00| 6c 61 72 6c 79 20 6e 61 | 73 74 79 20 62 75 67 0d |larly na|sty bug.|
|00002c10| 0a 70 72 6f 76 65 64 20 | 65 78 74 72 65 6d 65 6c |.proved |extremel|
|00002c20| 79 20 68 61 72 64 20 74 | 6f 20 66 69 6e 64 2e 20 |y hard t|o find. |
|00002c30| 54 68 65 20 73 79 6d 70 | 74 6f 6d 20 77 61 73 20 |The symp|tom was |
|00002c40| 74 68 61 74 20 46 75 6e | 6e 65 6c 57 65 62 20 77 |that Fun|nelWeb w|
|00002c50| 6f 75 6c 64 20 63 72 61 | 73 68 2c 0d 0a 73 6f 6d |ould cra|sh,..som|
|00002c60| 65 74 69 6d 65 73 20 61 | 74 20 72 61 6e 64 6f 6d |etimes a|t random|
|00002c70| 2c 20 62 75 74 20 6d 6f | 72 65 20 6f 66 74 65 6e |, but mo|re often|
|00002c80| 20 75 70 6f 6e 20 65 6e | 74 65 72 69 6e 67 20 61 | upon en|tering a|
|00002c90| 20 70 61 72 74 69 63 75 | 6c 61 72 20 66 75 6e 63 | particu|lar func|
|00002ca0| 74 69 6f 6e 2e 0d 0a 49 | 6e 20 74 68 65 20 65 6e |tion...I|n the en|
|00002cb0| 64 20 61 62 6f 75 74 20 | 61 20 64 61 79 20 6f 66 |d about |a day of|
|00002cc0| 20 73 70 65 63 69 66 69 | 63 20 64 65 62 75 67 67 | specifi|c debugg|
|00002cd0| 69 6e 67 20 77 61 73 20 | 72 65 71 75 69 72 65 64 |ing was |required|
|00002ce0| 20 62 65 66 6f 72 65 20 | 74 68 65 20 70 72 6f 62 | before |the prob|
|00002cf0| 6c 65 6d 0d 0a 77 61 73 | 20 74 72 61 63 6b 65 64 |lem..was| tracked|
|00002d00| 20 64 6f 77 6e 20 74 6f | 20 61 20 73 74 61 63 6b | down to| a stack|
|00002d10| 20 70 72 6f 62 6c 65 6d | 2e 20 49 74 20 74 75 72 | problem|. It tur|
|00002d20| 6e 65 64 20 6f 75 74 20 | 74 68 61 74 20 73 6f 6d |ned out |that som|
|00002d30| 65 68 6f 77 0d 0a 28 65 | 69 74 68 65 72 20 74 68 |ehow..(e|ither th|
|00002d40| 65 20 66 61 75 6c 74 20 | 6f 66 20 74 68 65 20 4d |e fault |of the M|
|00002d50| 61 63 69 6e 74 6f 73 68 | 20 6f 72 20 74 68 65 20 |acintosh| or the |
|00002d60| 54 48 49 4e 4b 7e 43 20 | 6c 61 6e 67 75 61 67 65 |THINK~C |language|
|00002d70| 20 73 79 73 74 65 6d 29 | 2c 20 6f 6e 6c 79 0d 0a | system)|, only..|
|00002d80| 36 4b 20 77 61 73 20 62 | 65 69 6e 67 20 61 6c 6c |6K was b|eing all|
|00002d90| 6f 63 61 74 65 64 20 66 | 6f 72 20 73 74 61 63 6b |ocated f|or stack|
|00002da0| 20 73 70 61 63 65 21 21 | 21 21 21 21 21 0d 0a 0d | space!!|!!!!!...|
|00002db0| 0a 54 68 69 73 20 65 78 | 70 65 72 69 65 6e 63 65 |.This ex|perience|
|00002dc0| 20 6c 65 64 20 6d 65 20 | 69 6d 6d 65 64 69 61 74 | led me |immediat|
|00002dd0| 65 6c 79 20 74 6f 20 67 | 6f 20 74 68 72 6f 75 67 |ely to g|o throug|
|00002de0| 68 20 74 68 65 20 65 6e | 74 69 72 65 20 70 72 6f |h the en|tire pro|
|00002df0| 67 72 61 6d 20 61 6e 64 | 0d 0a 65 6c 69 6d 69 6e |gram and|..elimin|
|00002e00| 61 74 65 20 28 6f 72 20 | 72 65 6d 6f 76 65 20 74 |ate (or |remove t|
|00002e10| 6f 20 74 68 65 20 68 65 | 61 70 29 20 61 6e 79 20 |o the he|ap) any |
|00002e20| 61 75 74 6f 6d 61 74 69 | 63 20 76 61 72 69 61 62 |automati|c variab|
|00002e30| 6c 65 20 64 65 63 6c 61 | 72 61 74 69 6f 6e 73 20 |le decla|rations |
|00002e40| 74 68 61 74 0d 0a 75 73 | 65 64 20 6d 6f 72 65 20 |that..us|ed more |
|00002e50| 74 68 61 6e 20 6f 6e 65 | 20 68 75 6e 64 72 65 64 |than one| hundred|
|00002e60| 20 6f 72 20 73 6f 20 62 | 79 74 65 73 2e 0d 0a 0d | or so b|ytes....|
|00002e70| 0a 54 68 65 20 6c 65 73 | 73 6f 6e 20 69 73 20 63 |.The les|son is c|
|00002e80| 6c 65 61 72 6c 79 20 74 | 68 61 74 20 43 7e 70 72 |learly t|hat C~pr|
|00002e90| 6f 67 72 61 6d 73 20 74 | 68 61 74 20 75 73 65 20 |ograms t|hat use |
|00002ea0| 6d 6f 72 65 20 74 68 61 | 6e 20 61 20 66 65 77 20 |more tha|n a few |
|00002eb0| 74 68 6f 75 73 61 6e 64 | 20 62 79 74 65 73 20 6f |thousand| bytes o|
|00002ec0| 66 0d 0a 73 74 61 63 6b | 20 73 70 61 63 65 20 61 |f..stack| space a|
|00002ed0| 72 65 20 72 69 73 6b 69 | 6e 67 20 74 68 65 69 72 |re riski|ng their|
|00002ee0| 20 70 6f 72 74 61 62 69 | 6c 69 74 79 2e 20 41 6c | portabi|lity. Al|
|00002ef0| 6c 20 6c 61 72 67 65 20 | 64 61 74 61 20 73 74 72 |l large |data str|
|00002f00| 75 63 74 75 72 65 73 20 | 73 68 6f 75 6c 64 20 62 |uctures |should b|
|00002f10| 65 0d 0a 70 6c 61 63 65 | 64 20 69 6e 20 74 68 65 |e..place|d in the|
|00002f20| 20 68 65 61 70 2e 0d 0a | 0d 0a 5c 73 65 63 74 69 | heap...|..\secti|
|00002f30| 6f 6e 7b 53 74 61 74 69 | 63 20 56 61 72 69 61 62 |on{Stati|c Variab|
|00002f40| 6c 65 73 7d 0d 0a 5c 78 | 78 7b 6d 65 6d 6f 72 79 |les}..\x|x{memory|
|00002f50| 7d 7b 73 74 61 74 69 63 | 7d 5c 78 78 7b 73 74 61 |}{static|}\xx{sta|
|00002f60| 74 69 63 7d 7b 76 61 72 | 69 61 62 6c 65 73 7d 0d |tic}{var|iables}.|
|00002f70| 0a 0d 0a 53 74 61 74 69 | 63 20 76 61 72 69 61 62 |...Stati|c variab|
|00002f80| 6c 65 73 20 61 6c 73 6f | 20 70 72 6f 76 65 64 20 |les also| proved |
|00002f90| 61 20 70 72 6f 62 6c 65 | 6d 20 6f 6e 20 74 68 65 |a proble|m on the|
|00002fa0| 20 4d 61 63 69 6e 74 6f | 73 68 2e 0d 0a 49 74 20 | Macinto|sh...It |
|00002fb0| 74 75 72 6e 73 20 6f 75 | 74 20 74 68 61 74 0d 0a |turns ou|t that..|
|00002fc0| 74 68 65 20 4d 61 63 69 | 6e 74 6f 73 68 5c 78 7b |the Maci|ntosh\x{|
|00002fd0| 4d 61 63 69 6e 74 6f 73 | 68 7d 20 54 48 49 4e 4b |Macintos|h} THINK|
|00002fe0| 7e 43 20 63 6f 6d 70 69 | 6c 65 72 5c 78 78 7b 54 |~C compi|ler\xx{T|
|00002ff0| 68 69 6e 6b 43 7d 7b 63 | 6f 6d 70 69 6c 65 72 7d |hinkC}{c|ompiler}|
|00003000| 0d 0a 64 6f 65 73 20 6e | 6f 74 20 61 6c 6c 6f 77 |..does n|ot allow|
|00003010| 20 6d 6f 72 65 20 74 68 | 61 6e 20 33 32 4b 20 6f | more th|an 32K o|
|00003020| 66 20 73 74 61 74 69 63 | 73 0d 0a 5c 69 7b 69 6e |f static|s..\i{in|
|00003030| 20 74 68 65 20 65 6e 74 | 69 72 65 20 70 72 6f 67 | the ent|ire prog|
|00003040| 72 61 6d 7d 2e 20 46 6f | 72 20 61 20 77 68 69 6c |ram}. Fo|r a whil|
|00003050| 65 20 74 68 69 73 20 72 | 65 73 74 72 69 63 74 69 |e this r|estricti|
|00003060| 6f 6e 20 77 61 73 0d 0a | 61 20 73 65 72 69 6f 75 |on was..|a seriou|
|00003070| 73 20 74 68 72 65 61 74 | 20 74 6f 20 74 68 65 20 |s threat| to the |
|00003080| 70 72 6f 67 72 61 6d 20 | 61 73 20 69 74 20 77 61 |program |as it wa|
|00003090| 73 20 64 69 73 63 6f 76 | 65 72 65 64 20 74 68 61 |s discov|ered tha|
|000030a0| 74 20 63 6f 6e 73 74 61 | 6e 74 20 73 74 72 69 6e |t consta|nt strin|
|000030b0| 67 73 0d 0a 77 65 72 65 | 20 69 6e 63 6c 75 64 65 |gs..were| include|
|000030c0| 64 20 69 6e 20 74 68 69 | 73 20 74 6f 74 61 6c 21 |d in thi|s total!|
|000030d0| 20 48 6f 77 65 76 65 72 | 2c 20 73 6f 6d 65 20 73 | However|, some s|
|000030e0| 65 61 72 63 68 69 6e 67 | 20 72 65 76 65 61 6c 65 |earching| reveale|
|000030f0| 64 20 61 20 63 6f 6d 70 | 69 6c 65 72 0d 0a 6f 70 |d a comp|iler..op|
|00003100| 74 69 6f 6e 20 74 68 61 | 74 20 72 65 6d 6f 76 65 |tion tha|t remove|
|00003110| 64 20 74 68 65 20 73 74 | 72 69 6e 67 73 20 66 72 |d the st|rings fr|
|00003120| 6f 6d 20 74 68 65 20 73 | 74 61 74 69 63 20 63 61 |om the s|tatic ca|
|00003130| 74 65 67 6f 72 79 2e 0d | 0a 0d 0a 4e 65 76 65 72 |tegory..|...Never|
|00003140| 74 68 65 6c 65 73 73 2c | 20 74 68 65 20 33 32 4b |theless,| the 32K|
|00003150| 20 6c 69 6d 69 74 20 69 | 73 20 72 61 74 68 65 72 | limit i|s rather|
|00003160| 20 73 65 76 65 72 65 2e | 20 41 67 61 69 6e 2c 20 | severe.| Again, |
|00003170| 69 74 20 73 65 65 6d 73 | 20 74 68 61 74 20 66 6f |it seems| that fo|
|00003180| 72 0d 0a 70 6f 72 74 61 | 62 69 6c 69 74 79 20 72 |r..porta|bility r|
|00003190| 65 61 73 6f 6e 73 2c 20 | 43 7e 70 72 6f 67 72 61 |easons, |C~progra|
|000031a0| 6d 73 20 74 68 61 74 20 | 75 73 65 20 61 20 6c 6f |ms that |use a lo|
|000031b0| 74 20 6f 66 20 73 74 61 | 74 69 63 20 76 61 72 69 |t of sta|tic vari|
|000031c0| 61 62 6c 65 73 20 61 72 | 65 20 72 69 73 6b 69 6e |ables ar|e riskin|
|000031d0| 67 0d 0a 74 68 65 69 72 | 20 70 6f 72 74 61 62 69 |g..their| portabi|
|000031e0| 6c 69 74 79 2e 20 41 73 | 20 61 20 72 65 73 75 6c |lity. As| a resul|
|000031f0| 74 2c 20 74 68 65 20 46 | 75 6e 6e 65 6c 57 65 62 |t, the F|unnelWeb|
|00003200| 20 63 6f 64 65 20 61 76 | 6f 69 64 73 20 73 74 61 | code av|oids sta|
|00003210| 74 69 63 20 76 61 72 69 | 61 62 6c 65 73 0d 0a 77 |tic vari|ables..w|
|00003220| 68 65 72 65 20 70 6f 73 | 73 69 62 6c 65 20 69 6e |here pos|sible in|
|00003230| 20 66 61 76 6f 75 72 20 | 6f 66 20 74 68 65 20 68 | favour |of the h|
|00003240| 65 61 70 2e 0d 0a 0d 0a | 5c 73 65 63 74 69 6f 6e |eap.....|\section|
|00003250| 7b 49 6d 70 6c 65 6d 65 | 6e 74 69 6e 67 20 54 65 |{Impleme|nting Te|
|00003260| 78 74 20 49 6e 64 65 6e | 74 61 74 69 6f 6e 7d 0d |xt Inden|tation}.|
|00003270| 0a 5c 78 78 7b 74 65 78 | 74 7d 7b 69 6e 64 65 6e |.\xx{tex|t}{inden|
|00003280| 74 61 74 69 6f 6e 7d 0d | 0a 0d 0a 41 74 20 6f 6e |tation}.|...At on|
|00003290| 65 20 70 6f 69 6e 74 20 | 64 75 72 69 6e 67 20 74 |e point |during t|
|000032a0| 68 65 20 64 65 76 65 6c | 6f 70 6d 65 6e 74 20 6f |he devel|opment o|
|000032b0| 66 20 46 75 6e 6e 65 6c | 57 65 62 2c 20 74 65 78 |f Funnel|Web, tex|
|000032c0| 74 20 69 6e 64 65 6e 74 | 61 74 69 6f 6e 20 77 61 |t indent|ation wa|
|000032d0| 73 0d 0a 66 75 6c 6c 79 | 20 69 6d 70 6c 65 6d 65 |s..fully| impleme|
|000032e0| 6e 74 65 64 2e 20 48 6f | 77 65 76 65 72 2c 20 69 |nted. Ho|wever, i|
|000032f0| 74 20 77 61 73 20 73 75 | 62 73 65 71 75 65 6e 74 |t was su|bsequent|
|00003300| 6c 79 20 72 65 6d 6f 76 | 65 64 20 62 65 63 61 75 |ly remov|ed becau|
|00003310| 73 65 20 69 74 20 77 61 | 73 0d 0a 63 6f 6e 73 69 |se it wa|s..consi|
|00003320| 64 65 72 65 64 20 61 20 | 64 61 6e 67 65 72 6f 75 |dered a |dangerou|
|00003330| 73 20 66 65 61 74 75 72 | 65 2e 20 54 68 69 73 20 |s featur|e. This |
|00003340| 73 65 63 74 69 6f 6e 20 | 72 65 63 6f 72 64 73 20 |section |records |
|00003350| 74 68 65 20 77 61 79 20 | 69 6e 20 77 68 69 63 68 |the way |in which|
|00003360| 0d 0a 74 65 78 74 20 69 | 6e 64 65 6e 74 61 74 69 |..text i|ndentati|
|00003370| 6f 6e 20 77 61 73 20 69 | 6d 70 6c 65 6d 65 6e 74 |on was i|mplement|
|00003380| 65 64 20 73 6f 20 74 68 | 61 74 20 69 66 20 74 68 |ed so th|at if th|
|00003390| 65 20 66 65 61 74 75 72 | 65 20 65 76 65 72 20 68 |e featur|e ever h|
|000033a0| 61 73 20 74 6f 20 62 65 | 20 70 75 74 0d 0a 62 61 |as to be| put..ba|
|000033b0| 63 6b 2c 20 74 68 69 73 | 20 74 65 63 68 6e 69 71 |ck, this| techniq|
|000033c0| 75 65 20 63 61 6e 20 62 | 65 20 75 73 65 64 20 61 |ue can b|e used a|
|000033d0| 67 61 69 6e 2e 0d 0a 0d | 0a 0d 0a 31 2e 20 43 72 |gain....|...1. Cr|
|000033e0| 65 61 74 65 20 61 20 6e | 65 77 20 66 69 65 6c 64 |eate a n|ew field|
|000033f0| 20 69 6e 20 74 68 65 20 | 5c 70 7b 73 63 5c 5f 74 | in the |\p{sc\_t|
|00003400| 7d 20 72 65 63 6f 72 64 | 20 63 61 6c 6c 20 5c 70 |} record| call \p|
|00003410| 7b 73 63 5c 5f 70 6f 73 | 74 6e 7d 2e 0d 0a 0d 0a |{sc\_pos|tn}.....|
|00003420| 5c 62 65 67 69 6e 7b 76 | 65 72 62 61 74 69 6d 7d |\begin{v|erbatim}|
|00003430| 0d 0a 20 20 20 20 20 20 | 63 68 61 72 20 2a 73 63 |.. |char *sc|
|00003440| 5f 70 6f 73 74 6e 3b 20 | 2f 2a 20 50 6f 69 6e 74 |_postn; |/* Point|
|00003450| 65 72 20 69 6e 20 74 68 | 65 20 72 61 6e 67 65 20 |er in th|e range |
|00003460| 5b 73 63 5f 66 69 72 73 | 74 2c 73 63 5f 6c 61 73 |[sc_firs|t,sc_las|
|00003470| 74 2b 31 5d 2e 20 20 20 | 20 20 20 20 20 20 20 20 |t+1]. | |
|00003480| 2a 2f 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |*/.. | |
|00003490| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 49 74 20 | | /* It |
|000034a0| 69 73 20 74 68 65 20 6d | 69 6e 69 6d 75 6d 20 70 |is the m|inimum p|
|000034b0| 6f 73 73 69 62 6c 65 20 | 76 61 6c 75 65 20 6f 66 |ossible |value of|
|000034c0| 20 73 63 5f 70 6f 73 74 | 6e 20 66 6f 72 20 20 20 | sc_post|n for |
|000034d0| 20 20 2a 2f 0d 0a 20 20 | 20 20 20 20 20 20 20 20 | */.. | |
|000034e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 77 | | /* w|
|000034f0| 68 69 63 68 20 45 4f 4c | 20 64 6f 65 73 20 6e 6f |hich EOL| does no|
|00003500| 74 20 61 70 70 65 61 72 | 20 69 6e 20 2a 73 63 5f |t appear| in *sc_|
|00003510| 70 6f 73 74 6e 2e 2e 2a | 73 63 5f 6c 61 73 74 2e |postn..*|sc_last.|
|00003520| 20 20 20 20 2a 2f 0d 0a | 20 20 20 20 20 20 20 20 | */..| |
|00003530| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|00003540| 20 69 2e 65 2e 20 50 6f | 69 6e 74 73 20 74 6f 20 | i.e. Po|ints to |
|00003550| 74 68 65 20 62 79 74 65 | 20 66 6f 6c 6c 6f 77 69 |the byte| followi|
|00003560| 6e 67 20 74 68 65 20 66 | 69 72 73 74 20 45 4f 4c |ng the f|irst EOL|
|00003570| 20 69 6e 20 20 20 2a 2f | 0d 0a 20 20 20 20 20 20 | in */|.. |
|00003580| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003590| 2f 2a 20 74 68 65 20 73 | 63 72 61 70 20 6f 72 20 |/* the s|crap or |
|000035a0| 73 63 5f 66 69 72 73 74 | 20 69 66 20 45 4f 4c 20 |sc_first| if EOL |
|000035b0| 64 6f 65 73 20 6e 6f 74 | 20 61 70 70 65 61 72 2e |does not| appear.|
|000035c0| 20 20 20 20 20 20 20 20 | 2a 2f 0d 0a 5c 65 6e 64 | |*/..\end|
|000035d0| 7b 76 65 72 62 61 74 69 | 6d 7d 0d 0a 0d 0a 32 2e |{verbati|m}....2.|
|000035e0| 20 4d 6f 64 69 66 79 20 | 74 68 65 20 73 63 61 6e | Modify |the scan|
|000035f0| 6e 65 72 20 73 6f 20 74 | 68 61 74 20 69 74 20 67 |ner so t|hat it g|
|00003600| 65 6e 65 72 61 74 65 73 | 20 74 68 69 73 20 66 69 |enerates| this fi|
|00003610| 65 6c 64 2e 0d 0a 53 65 | 6e 64 74 65 78 74 20 73 |eld...Se|ndtext s|
|00003620| 68 6f 75 6c 64 20 62 65 | 20 6d 6f 64 69 66 69 65 |hould be| modifie|
|00003630| 64 20 73 6f 20 74 68 61 | 74 0d 0a 69 74 20 61 63 |d so tha|t..it ac|
|00003640| 63 65 70 74 73 20 61 6e | 20 61 72 67 75 6d 65 6e |cepts an| argumen|
|00003650| 74 20 66 6f 72 20 74 68 | 65 20 5c 70 7b 70 5c 5f |t for th|e \p{p\_|
|00003660| 70 6f 73 74 6e 7d 20 76 | 61 6c 75 65 2e 0d 0a 0d |postn} v|alue....|
|00003670| 0a 5c 62 65 67 69 6e 7b | 76 65 72 62 61 74 69 6d |.\begin{|verbatim|
|00003680| 7d 0d 0a 4c 4f 43 41 4c | 20 76 6f 69 64 20 73 65 |}..LOCAL| void se|
|00003690| 6e 64 74 65 78 74 20 50 | 5f 28 28 70 5f 70 73 5f |ndtext P|_((p_ps_|
|000036a0| 74 2c 63 68 61 72 20 2a | 2c 63 68 61 72 20 2a 2c |t,char *|,char *,|
|000036b0| 63 68 61 72 20 2a 2c 62 | 6f 6f 6c 29 29 3b 0d 0a |char *,b|ool));..|
|000036c0| 4c 4f 43 41 4c 20 76 6f | 69 64 20 73 65 6e 64 74 |LOCAL vo|id sendt|
|000036d0| 65 78 74 28 70 5f 74 6b | 70 73 2c 70 5f 66 69 72 |ext(p_tk|ps,p_fir|
|000036e0| 73 74 2c 70 5f 6c 61 73 | 74 2c 70 5f 70 6f 73 74 |st,p_las|t,p_post|
|000036f0| 6e 2c 69 73 5f 77 68 69 | 74 65 29 0d 0a 2f 2a 20 |n,is_whi|te)../* |
|00003700| 41 70 70 65 6e 64 73 20 | 61 20 74 65 78 74 20 74 |Appends |a text t|
|00003710| 6f 6b 65 6e 20 74 6f 20 | 74 68 65 20 65 6e 64 20 |oken to |the end |
|00003720| 6f 66 20 74 68 65 20 74 | 6f 6b 65 6e 20 6c 69 73 |of the t|oken lis|
|00003730| 74 2e 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |t. | |
|00003740| 20 20 20 20 20 20 20 20 | 20 20 20 2a 2f 0d 0a 2f | | */../|
|00003750| 2a 20 49 4e 3a 20 70 5f | 70 73 20 69 73 20 61 20 |* IN: p_|ps is a |
|00003760| 70 6f 69 6e 74 65 72 20 | 74 6f 20 61 20 70 6f 73 |pointer |to a pos|
|00003770| 69 74 69 6f 6e 20 73 74 | 72 75 63 74 75 72 65 20 |ition st|ructure |
|00003780| 67 69 76 69 6e 67 20 74 | 68 65 20 70 6f 73 69 74 |giving t|he posit|
|00003790| 69 6f 6e 20 6f 66 20 74 | 68 65 20 20 20 2a 2f 0d |ion of t|he */.|
|000037a0| 0a 2f 2a 20 20 20 20 20 | 66 69 72 73 74 20 63 68 |./* |first ch|
|000037b0| 61 72 61 63 74 65 72 20 | 6f 66 20 74 68 65 20 74 |aracter |of the t|
|000037c0| 6f 6b 65 6e 2e 20 20 20 | 20 20 20 20 20 20 20 20 |oken. | |
|000037d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000037e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2a | | *|
|000037f0| 2f 0d 0a 2f 2a 20 49 4e | 3a 20 70 5f 66 69 72 73 |/../* IN|: p_firs|
|00003800| 74 20 61 6e 64 20 70 5f | 6c 61 73 74 20 70 6f 69 |t and p_|last poi|
|00003810| 6e 74 20 74 6f 20 74 68 | 65 20 66 69 72 73 74 20 |nt to th|e first |
|00003820| 61 6e 64 20 6c 61 73 74 | 20 62 79 74 65 20 6f 66 |and last| byte of|
|00003830| 20 74 68 65 20 74 65 78 | 74 20 73 63 72 61 70 2e | the tex|t scrap.|
|00003840| 20 2a 2f 0d 0a 2f 2a 20 | 49 4e 3a 20 70 5f 70 6f | */../* |IN: p_po|
|00003850| 73 74 6e 20 68 61 73 20 | 74 68 65 20 73 61 6d 65 |stn has |the same|
|00003860| 20 64 65 66 69 6e 69 74 | 69 6f 6e 20 61 73 20 73 | definit|ion as s|
|00003870| 63 5f 70 6f 73 74 6e 20 | 28 73 65 65 20 66 77 64 |c_postn |(see fwd|
|00003880| 61 74 61 2e 68 29 2e 20 | 20 20 20 20 20 20 20 20 |ata.h). | |
|00003890| 20 20 20 2a 2f 0d 0a 2f | 2a 20 49 4e 3a 20 69 73 | */../|* IN: is|
|000038a0| 5f 77 68 69 74 65 20 73 | 68 6f 75 6c 64 20 62 65 |_white s|hould be|
|000038b0| 20 73 65 74 20 74 6f 20 | 54 52 55 45 20 69 66 66 | set to |TRUE iff|
|000038c0| 20 73 63 72 61 70 20 69 | 73 20 65 6e 74 69 72 65 | scrap i|s entire|
|000038d0| 6c 79 20 77 68 69 74 65 | 73 70 61 63 65 2e 20 20 |ly white|space. |
|000038e0| 20 20 20 20 20 2a 2f 0d | 0a 70 5f 70 73 5f 74 20 | */.|.p_ps_t |
|000038f0| 70 5f 74 6b 70 73 3b 0d | 0a 63 68 61 72 20 20 2a |p_tkps;.|.char *|
|00003900| 70 5f 66 69 72 73 74 3b | 0d 0a 63 68 61 72 20 20 |p_first;|..char |
|00003910| 2a 70 5f 6c 61 73 74 3b | 0d 0a 63 68 61 72 20 20 |*p_last;|..char |
|00003920| 2a 70 5f 70 6f 73 74 6e | 3b 0d 0a 62 6f 6f 6c 20 |*p_postn|;..bool |
|00003930| 20 20 69 73 5f 77 68 69 | 74 65 3b 0d 0a 7b 0d 0a | is_whi|te;..{..|
|00003940| 20 74 6b 5f 74 20 74 6f | 6b 65 6e 3b 0d 0a 20 0d | tk_t to|ken;.. .|
|00003950| 0a 20 2f 2a 20 45 6d 70 | 74 79 20 74 65 78 74 20 |. /* Emp|ty text |
|00003960| 73 63 72 61 70 73 20 73 | 68 6f 75 6c 64 20 6e 65 |scraps s|hould ne|
|00003970| 76 65 72 20 62 65 20 67 | 65 6e 65 72 61 74 65 64 |ver be g|enerated|
|00003980| 2e 20 2a 2f 0d 0a 20 61 | 73 73 65 72 74 28 70 5f |. */.. a|ssert(p_|
|00003990| 66 69 72 73 74 3c 3d 70 | 5f 6c 61 73 74 2c 22 73 |first<=p|_last,"s|
|000039a0| 65 6e 64 74 65 78 74 3a | 20 54 65 78 74 20 73 63 |endtext:| Text sc|
|000039b0| 72 61 70 20 62 6f 75 6e | 64 73 20 61 72 65 20 62 |rap boun|ds are b|
|000039c0| 61 64 2e 22 29 3b 0d 0a | 20 0d 0a 20 2f 2a 20 49 |ad.");..| .. /* I|
|000039d0| 66 20 63 68 3d 45 4f 4c | 20 74 68 65 6e 20 77 65 |f ch=EOL| then we|
|000039e0| 20 73 68 6f 75 6c 64 20 | 62 65 20 73 63 61 6e 6e | should |be scann|
|000039f0| 69 6e 67 20 6d 6f 72 65 | 20 74 65 78 74 2c 20 6e |ing more| text, n|
|00003a00| 6f 74 20 73 68 69 70 70 | 69 6e 67 20 69 74 21 20 |ot shipp|ing it! |
|00003a10| 2a 2f 0d 0a 20 61 73 73 | 65 72 74 28 63 68 21 3d |*/.. ass|ert(ch!=|
|00003a20| 45 4f 4c 2c 22 73 65 6e | 74 74 65 78 74 3a 20 53 |EOL,"sen|ttext: S|
|00003a30| 68 69 70 70 69 6e 67 20 | 74 65 78 74 20 77 68 69 |hipping |text whi|
|00003a40| 6c 65 20 73 74 69 6c 6c | 20 6d 6f 72 65 20 74 6f |le still| more to|
|00003a50| 20 73 63 61 6e 2e 22 29 | 3b 0d 0a 0d 0a 20 2f 2a | scan.")|;.... /*|
|00003a60| 20 43 68 65 63 6b 20 74 | 68 61 74 20 70 5f 70 6f | Check t|hat p_po|
|00003a70| 73 74 6e 20 69 73 20 69 | 6e 20 72 61 6e 67 65 2e |stn is i|n range.|
|00003a80| 20 53 65 65 20 64 65 66 | 69 6e 69 74 69 6f 6e 20 | See def|inition |
|00003a90| 69 6e 20 66 77 64 61 74 | 61 2e 68 2e 20 2a 2f 0d |in fwdat|a.h. */.|
|00003aa0| 0a 20 61 73 73 65 72 74 | 28 70 5f 66 69 72 73 74 |. assert|(p_first|
|00003ab0| 3c 3d 70 5f 70 6f 73 74 | 6e 20 26 26 20 70 5f 70 |<=p_post|n && p_p|
|00003ac0| 6f 73 74 6e 3c 3d 70 5f | 6c 61 73 74 2b 31 2c 0d |ostn<=p_|last+1,.|
|00003ad0| 0a 20 20 20 20 20 20 20 | 20 22 73 65 6e 64 74 65 |. | "sendte|
|00003ae0| 78 74 3a 20 70 5f 70 6f | 73 74 6e 20 69 73 20 6f |xt: p_po|stn is o|
|00003af0| 75 74 20 6f 66 20 72 61 | 6e 67 65 2e 22 29 3b 0d |ut of ra|nge.");.|
|00003b00| 0a 20 0d 0a 20 2f 2a 20 | 44 65 62 75 67 3a 20 43 |. .. /* |Debug: C|
|00003b10| 68 65 63 6b 20 74 68 65 | 20 70 5f 70 6f 73 74 6e |heck the| p_postn|
|00003b20| 20 66 69 65 6c 64 20 75 | 73 69 6e 67 20 61 20 62 | field u|sing a b|
|00003b30| 72 75 74 65 20 66 6f 72 | 63 65 20 63 68 65 63 6b |rute for|ce check|
|00003b40| 2e 20 2a 2f 0d 0a 20 7b | 0d 0a 20 20 63 68 61 72 |. */.. {|.. char|
|00003b50| 20 2a 69 2c 2a 6a 3b 0d | 0a 20 20 6a 3d 70 5f 66 | *i,*j;.|. j=p_f|
|00003b60| 69 72 73 74 3b 0d 0a 20 | 20 66 6f 72 20 28 69 3d |irst;.. | for (i=|
|00003b70| 70 5f 66 69 72 73 74 3b | 69 3c 3d 70 5f 6c 61 73 |p_first;|i<=p_las|
|00003b80| 74 3b 69 2b 2b 29 0d 0a | 20 20 20 20 20 69 66 20 |t;i++)..| if |
|00003b90| 28 2a 69 3d 3d 45 4f 4c | 29 0d 0a 20 20 20 20 20 |(*i==EOL|).. |
|00003ba0| 20 20 20 6a 3d 69 2b 31 | 3b 0d 0a 20 20 61 73 73 | j=i+1|;.. ass|
|00003bb0| 65 72 74 28 6a 3d 3d 70 | 5f 70 6f 73 74 6e 2c 22 |ert(j==p|_postn,"|
|00003bc0| 73 65 6e 64 74 65 78 74 | 3a 20 73 63 5f 70 6f 73 |sendtext|: sc_pos|
|00003bd0| 74 6e 20 66 69 65 6c 64 | 20 69 73 20 69 6e 63 6f |tn field| is inco|
|00003be0| 72 72 65 63 74 2e 22 29 | 3b 0d 0a 20 7d 0d 0a 0d |rrect.")|;.. }...|
|00003bf0| 0a 20 2f 2a 20 4c 6f 61 | 64 20 74 68 65 20 74 65 |. /* Loa|d the te|
|00003c00| 78 74 20 74 6f 6b 65 6e | 2e 20 2a 2f 0d 0a 20 74 |xt token|. */.. t|
|00003c10| 6f 6b 65 6e 2e 74 6b 5f | 6b 69 6e 64 20 20 20 20 |oken.tk_|kind |
|00003c20| 20 20 20 20 3d 20 54 4b | 5f 54 45 58 54 3b 0d 0a | = TK|_TEXT;..|
|00003c30| 20 41 53 53 49 47 4e 28 | 74 6f 6b 65 6e 2e 74 6b | ASSIGN(|token.tk|
|00003c40| 5f 70 73 2c 2a 70 5f 74 | 6b 70 73 29 3b 0d 0a 20 |_ps,*p_t|kps);.. |
|00003c50| 74 6f 6b 65 6e 2e 74 6b | 5f 73 63 2e 73 63 5f 66 |token.tk|_sc.sc_f|
|00003c60| 69 72 73 74 20 3d 20 70 | 5f 66 69 72 73 74 3b 0d |irst = p|_first;.|
|00003c70| 0a 20 74 6f 6b 65 6e 2e | 74 6b 5f 73 63 2e 73 63 |. token.|tk_sc.sc|
|00003c80| 5f 6c 61 73 74 20 20 3d | 20 70 5f 6c 61 73 74 3b |_last =| p_last;|
|00003c90| 0d 0a 20 74 6f 6b 65 6e | 2e 74 6b 5f 73 63 2e 73 |.. token|.tk_sc.s|
|00003ca0| 63 5f 70 6f 73 74 6e 20 | 3d 20 70 5f 70 6f 73 74 |c_postn |= p_post|
|00003cb0| 6e 3b 0d 0a 20 74 6f 6b | 65 6e 2e 74 6b 5f 77 68 |n;.. tok|en.tk_wh|
|00003cc0| 69 74 65 20 20 20 20 20 | 20 20 3d 20 69 73 5f 77 |ite | = is_w|
|00003cd0| 68 69 74 65 3b 0d 0a 20 | 74 6f 6b 65 6e 2e 74 6b |hite;.. |token.tk|
|00003ce0| 5f 70 61 72 6e 6f 20 20 | 20 20 20 20 20 3d 20 30 |_parno | = 0|
|00003cf0| 3b 0d 0a 20 6c 73 5f 61 | 64 64 28 74 6f 6b 65 6e |;.. ls_a|dd(token|
|00003d00| 5f 6c 69 73 74 2c 50 56 | 20 26 74 6f 6b 65 6e 29 |_list,PV| &token)|
|00003d10| 3b 20 20 20 0d 0a 7d 0d | 0a 5c 65 6e 64 7b 76 65 |; ..}.|.\end{ve|
|00003d20| 72 62 61 74 69 6d 7d 0d | 0a 0d 0a 54 68 65 6e 20 |rbatim}.|...Then |
|00003d30| 61 6c 6c 20 74 68 65 20 | 63 61 6c 6c 73 20 74 6f |all the |calls to|
|00003d40| 20 73 65 6e 64 74 65 78 | 74 20 68 61 76 65 20 74 | sendtex|t have t|
|00003d50| 6f 20 62 65 20 63 68 61 | 6e 67 65 64 3a 0d 0a 0d |o be cha|nged:...|
|00003d60| 0a 5c 62 65 67 69 6e 7b | 76 65 72 62 61 74 69 6d |.\begin{|verbatim|
|00003d70| 7d 0d 0a 2f 2a 20 40 20 | 69 6e 73 74 72 75 63 74 |}../* @ |instruct|
|00003d80| 73 20 46 75 6e 6e 65 6c | 57 65 62 20 74 6f 20 72 |s Funnel|Web to r|
|00003d90| 65 70 6c 61 63 65 20 74 | 68 65 20 73 70 65 63 69 |eplace t|he speci|
|00003da0| 61 6c 20 63 6f 6e 73 74 | 72 75 63 74 20 77 69 74 |al const|ruct wit|
|00003db0| 68 20 74 68 65 20 2a 2f | 0d 0a 2f 2a 20 73 70 65 |h the */|../* spe|
|00003dc0| 63 69 61 6c 20 63 68 61 | 72 61 63 74 65 72 2e 20 |cial cha|racter. |
|00003dd0| 4c 75 63 6b 69 6c 79 20 | 6f 6e 65 20 61 70 70 65 |Luckily |one appe|
|00003de0| 61 72 73 20 6a 75 73 74 | 20 62 65 66 6f 72 65 20 |ars just| before |
|00003df0| 74 68 65 20 40 20 21 21 | 20 20 20 20 20 2a 2f 0d |the @ !!| */.|
|00003e00| 0a 2f 2a 20 4e 6f 74 65 | 3a 20 46 41 4c 53 45 20 |./* Note|: FALSE |
|00003e10| 69 73 20 4f 4b 20 62 65 | 63 61 75 73 65 20 73 70 |is OK be|cause sp|
|00003e20| 61 63 65 20 69 73 20 6e | 6f 74 20 61 20 6c 65 67 |ace is n|ot a leg|
|00003e30| 61 6c 20 73 70 65 63 69 | 61 6c 63 68 2e 20 20 20 |al speci|alch. |
|00003e40| 20 20 20 20 2a 2f 0d 0a | 2f 2a 20 4e 6f 74 65 3a | */..|/* Note:|
|00003e50| 20 53 65 74 74 69 6e 67 | 20 70 61 72 61 6d 65 74 | Setting| paramet|
|00003e60| 65 72 20 70 5f 70 6f 73 | 74 6e 20 74 6f 20 70 5f |er p_pos|tn to p_|
|00003e70| 63 68 2d 31 20 69 73 20 | 4f 4b 20 61 73 20 45 4f |ch-1 is |OK as EO|
|00003e80| 4c 20 69 73 20 6e 6f 74 | 20 61 20 2a 2f 0d 0a 2f |L is not| a */../|
|00003e90| 2a 20 20 20 20 20 20 20 | 6c 65 67 61 6c 20 73 70 |* |legal sp|
|00003ea0| 65 63 69 61 6c 63 68 2e | 20 20 20 20 20 20 20 20 |ecialch.| |
|00003eb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003ec0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003ed0| 20 20 2a 2f 0d 0a 73 65 | 6e 64 74 65 78 74 28 26 | */..se|ndtext(&|
|00003ee0| 70 73 5f 73 70 65 63 2c | 70 5f 63 68 2d 31 2c 70 |ps_spec,|p_ch-1,p|
|00003ef0| 5f 63 68 2d 31 2c 70 5f | 63 68 2d 31 2c 46 41 4c |_ch-1,p_|ch-1,FAL|
|00003f00| 53 45 29 3b 0d 0a 62 72 | 65 61 6b 3b 0d 0a 0d 0a |SE);..br|eak;....|
|00003f10| 2f 2a 20 2b 20 69 6e 73 | 74 72 75 63 74 73 20 46 |/* + ins|tructs F|
|00003f20| 75 6e 6e 65 6c 57 65 62 | 20 74 6f 20 69 6e 73 65 |unnelWeb| to inse|
|00003f30| 72 74 20 61 6e 20 45 4f | 4c 2e 20 57 65 20 63 61 |rt an EO|L. We ca|
|00003f40| 6e 27 74 20 6c 6f 6f 6b | 20 74 6f 20 74 68 65 20 |n't look| to the |
|00003f50| 65 6e 64 20 6f 66 20 2a | 2f 0d 0a 2f 2a 20 74 68 |end of *|/../* th|
|00003f60| 65 20 70 72 65 76 69 6f | 75 73 20 6c 69 6e 65 20 |e previo|us line |
|00003f70| 74 6f 20 66 69 6e 64 20 | 61 6e 20 45 4f 4c 20 61 |to find |an EOL a|
|00003f80| 73 20 74 68 69 73 20 6d | 69 67 68 74 20 62 65 20 |s this m|ight be |
|00003f90| 74 68 65 20 66 69 72 73 | 74 20 6c 69 6e 65 2e 20 |the firs|t line. |
|00003fa0| 20 20 2a 2f 0d 0a 2f 2a | 20 52 75 6e 6e 69 6e 67 | */../*| Running|
|00003fb0| 20 61 68 65 61 64 20 74 | 6f 20 74 68 65 20 65 6e | ahead t|o the en|
|00003fc0| 64 20 6f 66 20 74 68 65 | 20 6c 69 6e 65 20 69 73 |d of the| line is|
|00003fd0| 20 65 78 70 65 6e 73 69 | 76 65 2c 20 61 6e 64 20 | expensi|ve, and |
|00003fe0| 68 61 76 69 6e 67 20 74 | 68 65 20 20 20 2a 2f 0d |having t|he */.|
|00003ff0| 0a 2f 2a 20 6c 69 6e 65 | 72 20 6d 69 6e 69 2d 70 |./* line|r mini-p|
|00004000| 61 63 6b 61 67 65 20 6d | 61 69 6e 74 61 69 6e 20 |ackage m|aintain |
|00004010| 61 20 76 61 72 69 61 62 | 6c 65 20 66 6f 72 20 69 |a variab|le for i|
|00004020| 74 20 77 6f 75 6c 64 20 | 62 65 20 65 78 74 72 61 |t would |be extra|
|00004030| 20 20 20 20 20 20 20 20 | 2a 2f 0d 0a 2f 2a 20 68 | |*/../* h|
|00004040| 6f 75 73 65 6b 65 65 70 | 69 6e 67 2e 20 49 6e 73 |ousekeep|ing. Ins|
|00004050| 74 65 61 64 20 6f 66 20 | 61 6c 6c 20 74 68 69 73 |tead of |all this|
|00004060| 2c 20 77 65 20 6a 75 73 | 74 20 70 6f 69 6e 74 20 |, we jus|t point |
|00004070| 74 6f 20 61 20 73 74 61 | 74 69 63 2e 20 20 20 20 |to a sta|tic. |
|00004080| 20 20 20 2a 2f 0d 0a 7b | 43 4f 4e 53 54 20 73 74 | */..{|CONST st|
|00004090| 61 74 69 63 20 63 68 61 | 72 20 73 74 61 74 65 6f |atic cha|r stateo|
|000040a0| 6c 20 3d 20 45 4f 4c 3b | 0d 0a 20 73 65 6e 64 74 |l = EOL;|.. sendt|
|000040b0| 65 78 74 28 26 70 73 5f | 73 70 65 63 2c 26 73 74 |ext(&ps_|spec,&st|
|000040c0| 61 74 65 6f 6c 2c 26 73 | 74 61 74 65 6f 6c 2c 28 |ateol,&s|tateol,(|
|000040d0| 26 73 74 61 74 65 6f 6c | 29 2b 31 2c 54 52 55 45 |&stateol|)+1,TRUE|
|000040e0| 29 3b 7d 0d 0a 62 72 65 | 61 6b 3b 0d 0a 0d 0a 2f |);}..bre|ak;..../|
|000040f0| 2a 20 49 66 20 77 65 20 | 68 69 74 20 73 6f 6d 65 |* If we |hit some|
|00004100| 74 68 69 6e 67 20 74 68 | 61 74 20 65 6e 64 73 20 |thing th|at ends |
|00004110| 61 20 74 65 78 74 20 74 | 6f 6b 65 6e 20 2a 2f 0d |a text t|oken */.|
|00004120| 0a 2f 2a 20 74 68 65 6e | 20 77 65 20 63 61 6e 20 |./* then| we can |
|00004130| 74 72 61 6e 73 6d 69 74 | 20 61 20 77 68 69 74 65 |transmit| a white|
|00004140| 20 74 65 78 74 20 74 6f | 6b 65 6e 2e 20 20 20 2a | text to|ken. *|
|00004150| 2f 0d 0a 69 66 20 28 63 | 68 3d 3d 73 70 65 63 69 |/..if (c|h==speci|
|00004160| 61 6c 63 68 20 7c 7c 20 | 63 68 3d 3d 45 4f 46 43 |alch || |ch==EOFC|
|00004170| 48 29 0d 0a 20 20 20 7b | 73 65 6e 64 74 65 78 74 |H).. {|sendtext|
|00004180| 28 26 70 73 5f 73 74 61 | 72 74 2c 70 5f 66 69 72 |(&ps_sta|rt,p_fir|
|00004190| 73 74 2c 70 5f 63 68 2d | 31 2c 4d 41 58 28 70 5f |st,p_ch-|1,MAX(p_|
|000041a0| 73 6f 6c 2c 70 5f 66 69 | 72 73 74 29 2c 54 52 55 |sol,p_fi|rst),TRU|
|000041b0| 45 29 3b 20 72 65 74 75 | 72 6e 3b 7d 0d 0a 20 20 |E); retu|rn;}.. |
|000041c0| 20 20 0d 0a 2f 2a 20 4f | 74 68 65 72 77 69 73 65 | ../* O|therwise|
|000041d0| 20 77 65 20 68 61 76 65 | 20 73 6f 6d 65 20 6d 6f | we have| some mo|
|000041e0| 72 65 20 28 6e 6f 6e 2d | 77 68 69 74 65 29 20 74 |re (non-|white) t|
|000041f0| 65 78 74 20 74 6f 20 73 | 63 61 6e 2e 20 2a 2f 0d |ext to s|can. */.|
|00004200| 0a 2f 2a 20 57 65 20 63 | 61 6e 20 74 68 65 6e 20 |./* We c|an then |
|00004210| 73 65 6e 64 20 61 20 6e | 6f 6e 2d 77 68 69 74 65 |send a n|on-white|
|00004220| 20 74 65 78 74 20 74 6f | 6b 65 6e 2e 20 20 20 20 | text to|ken. |
|00004230| 20 20 20 20 20 20 20 20 | 20 20 2a 2f 0d 0a 77 68 | | */..wh|
|00004240| 69 6c 65 20 28 63 68 21 | 3d 73 70 65 63 69 61 6c |ile (ch!|=special|
|00004250| 63 68 20 26 26 20 63 68 | 21 3d 45 4f 46 43 48 29 |ch && ch|!=EOFCH)|
|00004260| 0d 0a 20 20 20 4e 45 58 | 54 43 48 3b 0d 0a 73 65 |.. NEX|TCH;..se|
|00004270| 6e 64 74 65 78 74 28 26 | 70 73 5f 73 74 61 72 74 |ndtext(&|ps_start|
|00004280| 2c 70 5f 66 69 72 73 74 | 2c 70 5f 63 68 2d 31 2c |,p_first|,p_ch-1,|
|00004290| 4d 41 58 28 70 5f 73 6f | 6c 2c 70 5f 66 69 72 73 |MAX(p_so|l,p_firs|
|000042a0| 74 29 2c 46 41 4c 53 45 | 29 3b 0d 0a 5c 65 6e 64 |t),FALSE|);..\end|
|000042b0| 7b 76 65 72 62 61 74 69 | 6d 7d 0d 0a 0d 0a 54 68 |{verbati|m}....Th|
|000042c0| 65 20 64 75 6d 70 20 63 | 6f 64 65 20 6e 65 65 64 |e dump c|ode need|
|000042d0| 73 20 74 6f 20 62 65 20 | 63 68 61 6e 67 65 64 20 |s to be |changed |
|000042e0| 74 6f 6f 21 0d 0a 0d 0a | 5c 62 65 67 69 6e 7b 76 |too!....|\begin{v|
|000042f0| 65 72 62 61 74 69 6d 7d | 0d 0a 20 20 20 20 20 20 |erbatim}|.. |
|00004300| 20 20 77 66 5f 73 74 72 | 28 70 5f 77 66 2c 22 5c | wf_str|(p_wf,"\|
|00004310| 22 22 29 3b 0d 0a 61 73 | 73 65 72 74 28 74 6f 6b |"");..as|sert(tok|
|00004320| 65 6e 2d 3e 74 6b 5f 73 | 63 2e 73 63 5f 66 69 72 |en->tk_s|c.sc_fir|
|00004330| 73 74 20 21 3d 4e 55 4c | 4c 2c 22 64 6d 5f 74 6b |st !=NUL|L,"dm_tk|
|00004340| 6c 73 3a 20 4e 55 4c 4c | 20 70 74 72 31 2e 22 29 |ls: NULL| ptr1.")|
|00004350| 3b 0d 0a 61 73 73 65 72 | 74 28 74 6f 6b 65 6e 2d |;..asser|t(token-|
|00004360| 3e 74 6b 5f 73 63 2e 73 | 63 5f 6c 61 73 74 20 20 |>tk_sc.s|c_last |
|00004370| 21 3d 4e 55 4c 4c 2c 22 | 64 6d 5f 74 6b 6c 73 3a |!=NULL,"|dm_tkls:|
|00004380| 20 4e 55 4c 4c 20 70 74 | 72 32 2e 22 29 3b 0d 0a | NULL pt|r2.");..|
|00004390| 66 6f 72 20 28 69 3d 74 | 6f 6b 65 6e 2d 3e 74 6b |for (i=t|oken->tk|
|000043a0| 5f 73 63 2e 73 63 5f 66 | 69 72 73 74 3b 20 69 3c |_sc.sc_f|irst; i<|
|000043b0| 3d 74 6f 6b 65 6e 2d 3e | 74 6b 5f 73 63 2e 73 63 |=token->|tk_sc.sc|
|000043c0| 5f 6c 61 73 74 3b 20 69 | 2b 2b 29 0d 0a 20 20 7b |_last; i|++).. {|
|000043d0| 0d 0a 20 20 20 69 66 20 | 28 69 3d 3d 74 6f 6b 65 |.. if |(i==toke|
|000043e0| 6e 2d 3e 74 6b 5f 73 63 | 2e 73 63 5f 70 6f 73 74 |n->tk_sc|.sc_post|
|000043f0| 6e 29 0d 0a 20 20 20 20 | 20 20 77 66 5f 73 74 72 |n).. | wf_str|
|00004400| 28 70 5f 77 66 2c 22 3c | 70 6f 73 74 6e 3e 22 29 |(p_wf,"<|postn>")|
|00004410| 3b 0d 0a 20 20 20 69 66 | 20 28 2a 69 3d 3d 27 5c |;.. if| (*i=='\|
|00004420| 6e 27 29 0d 0a 20 20 20 | 20 20 20 77 66 5f 77 6c |n').. | wf_wl|
|00004430| 28 70 5f 77 66 2c 22 22 | 29 3b 0d 0a 20 20 20 65 |(p_wf,""|);.. e|
|00004440| 6c 73 65 0d 0a 20 20 20 | 20 20 20 64 6d 5f 62 79 |lse.. | dm_by|
|00004450| 74 65 28 70 5f 77 66 2c | 2a 28 28 75 62 79 74 65 |te(p_wf,|*((ubyte|
|00004460| 5f 20 2a 29 20 69 29 29 | 3b 0d 0a 20 20 7d 0d 0a |_ *) i))|;.. }..|
|00004470| 69 66 20 28 69 3d 3d 74 | 6f 6b 65 6e 2d 3e 74 6b |if (i==t|oken->tk|
|00004480| 5f 73 63 2e 73 63 5f 70 | 6f 73 74 6e 29 0d 0a 20 |_sc.sc_p|ostn).. |
|00004490| 20 20 77 66 5f 73 74 72 | 28 70 5f 77 66 2c 22 3c | wf_str|(p_wf,"<|
|000044a0| 70 6f 73 74 6e 3e 22 29 | 3b 0d 0a 77 66 5f 73 74 |postn>")|;..wf_st|
|000044b0| 72 28 70 5f 77 66 2c 22 | 5c 22 22 29 3b 0d 0a 7d |r(p_wf,"|\"");..}|
|000044c0| 0d 0a 5c 65 6e 64 7b 76 | 65 72 62 61 74 69 6d 7d |..\end{v|erbatim}|
|000044d0| 0d 0a 0d 0a 33 2e 20 4f | 76 65 72 20 69 6e 20 74 |....3. O|ver in t|
|000044e0| 68 65 20 54 61 6e 67 6c | 65 20 6d 6f 64 75 6c 65 |he Tangl|e module|
|000044f0| 2c 20 63 72 65 61 74 65 | 20 61 20 6d 61 73 73 69 |, create| a massi|
|00004500| 76 65 20 61 72 72 61 79 | 20 6f 66 20 70 6f 69 6e |ve array| of poin|
|00004510| 74 65 72 73 20 74 6f 20 | 73 63 72 61 70 73 0d 0a |ters to |scraps..|
|00004520| 74 6f 20 62 65 20 75 73 | 65 64 20 61 73 20 61 20 |to be us|ed as a |
|00004530| 73 74 61 63 6b 2e 20 4d | 61 69 6e 74 61 69 6e 20 |stack. M|aintain |
|00004540| 70 6f 69 6e 74 65 72 73 | 20 69 6e 74 6f 20 74 68 |pointers| into th|
|00004550| 65 20 73 74 61 63 6b 20 | 63 61 6c 6c 65 64 20 5c |e stack |called \|
|00004560| 70 7b 63 75 72 72 65 6e | 74 7d 20 61 6e 64 0d 0a |p{curren|t} and..|
|00004570| 5c 69 7b 62 61 73 65 7d | 20 28 73 69 6d 69 6c 61 |\i{base}| (simila|
|00004580| 72 20 74 6f 20 74 68 65 | 20 62 6c 61 6e 6b 20 69 |r to the| blank i|
|00004590| 6e 64 65 6e 74 61 74 69 | 6f 6e 20 76 61 72 69 61 |ndentati|on varia|
|000045a0| 62 6c 65 73 29 2e 20 49 | 6d 70 6c 65 6d 65 6e 74 |bles). I|mplement|
|000045b0| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 3a 0d | the fol|lowing:.|
|000045c0| 0a 0d 0a 5c 62 65 67 69 | 6e 7b 69 74 65 6d 69 7a |...\begi|n{itemiz|
|000045d0| 65 7d 0d 0a 0d 0a 5c 69 | 74 65 6d 20 54 6f 20 77 |e}....\i|tem To w|
|000045e0| 72 69 74 65 20 6f 75 74 | 20 61 20 73 63 72 61 70 |rite out| a scrap|
|000045f0| 2c 20 73 63 61 6e 20 69 | 74 20 62 79 74 65 20 62 |, scan i|t byte b|
|00004600| 79 20 62 79 74 65 2e 20 | 4f 75 74 70 75 74 20 65 |y byte. |Output e|
|00004610| 61 63 68 20 62 79 74 65 | 2e 20 57 68 65 6e 0d 0a |ach byte|. When..|
|00004620| 79 6f 75 20 68 69 74 20 | 61 6e 20 45 4f 4c 2c 20 |you hit |an EOL, |
|00004630| 70 6f 70 20 74 68 65 20 | 73 74 61 63 6b 20 62 61 |pop the |stack ba|
|00004640| 63 6b 20 74 6f 20 5c 70 | 7b 62 61 73 65 7d 2e 20 |ck to \p|{base}. |
|00004650| 54 68 65 6e 20 77 72 69 | 74 65 20 6f 75 74 20 61 |Then wri|te out a|
|00004660| 6e 20 45 4f 4c 0d 0a 66 | 6f 6c 6c 6f 77 65 64 20 |n EOL..f|ollowed |
|00004670| 62 79 20 74 68 65 20 73 | 74 61 63 6b 20 63 6f 6e |by the s|tack con|
|00004680| 74 65 6e 74 73 20 62 75 | 74 20 77 72 69 74 69 6e |tents bu|t writin|
|00004690| 67 20 65 61 63 68 20 73 | 63 72 61 70 20 6f 6e 6c |g each s|crap onl|
|000046a0| 79 20 66 72 6f 6d 20 5c | 70 7b 70 6f 73 74 6e 7d |y from \|p{postn}|
|000046b0| 20 74 6f 0d 0a 65 6e 64 | 20 65 6e 64 20 6f 66 20 | to..end| end of |
|000046c0| 65 61 63 68 20 73 63 72 | 61 70 2e 0d 0a 57 68 65 |each scr|ap...Whe|
|000046d0| 6e 20 79 6f 75 20 68 61 | 76 65 20 66 69 6e 69 73 |n you ha|ve finis|
|000046e0| 68 65 64 20 74 68 65 20 | 6e 65 77 20 73 63 72 61 |hed the |new scra|
|000046f0| 70 2c 20 70 75 73 68 20 | 69 74 20 6f 6e 20 74 68 |p, push |it on th|
|00004700| 65 20 73 74 61 63 6b 2e | 0d 0a 0d 0a 5c 69 74 65 |e stack.|....\ite|
|00004710| 6d 20 57 68 65 6e 20 79 | 6f 75 20 68 69 74 20 61 |m When y|ou hit a|
|00004720| 20 6e 65 77 20 6d 61 63 | 72 6f 20 74 6f 20 65 78 | new mac|ro to ex|
|00004730| 70 61 6e 64 2c 20 73 61 | 76 65 20 5c 70 7b 62 61 |pand, sa|ve \p{ba|
|00004740| 73 65 7d 2e 20 52 65 73 | 74 6f 72 65 20 69 74 20 |se}. Res|tore it |
|00004750| 6c 61 74 65 72 2e 20 20 | 20 0d 0a 0d 0a 5c 65 6e |later. | ....\en|
|00004760| 64 7b 69 74 65 6d 69 7a | 65 7d 0d 0a 0d 0a 54 68 |d{itemiz|e}....Th|
|00004770| 65 20 5c 70 7b 70 6f 73 | 74 6e 7d 20 66 69 65 6c |e \p{pos|tn} fiel|
|00004780| 64 20 73 6f 6c 76 65 73 | 20 74 68 65 20 62 69 67 |d solves| the big|
|00004790| 20 70 72 6f 62 6c 65 6d | 20 6f 66 0d 0a 68 6f 77 | problem| of..how|
|000047a0| 20 74 6f 20 63 6f 70 65 | 20 77 69 74 68 20 73 6f | to cope| with so|
|000047b0| 6d 65 74 68 69 6e 67 20 | 6c 69 6b 65 20 74 68 69 |mething |like thi|
|000047c0| 73 3a 0d 0a 0d 0a 5c 62 | 65 67 69 6e 7b 76 65 72 |s:....\b|egin{ver|
|000047d0| 62 61 74 69 6d 7d 0d 0a | 54 68 65 20 72 61 69 6e |batim}..|The rain|
|000047e0| 20 69 6e 20 53 70 61 69 | 6e 0d 0a 66 61 6c 6c 73 | in Spai|n..falls|
|000047f0| 20 6d 61 69 6e 6c 79 20 | 40 3c 6f 6e 20 74 68 65 | mainly |@<on the|
|00004800| 20 70 6c 61 69 6e 40 3e | 0d 0a 5c 65 6e 64 7b 76 | plain@>|..\end{v|
|00004810| 65 72 62 61 74 69 6d 7d | 0d 0a 0d 0a 54 68 65 20 |erbatim}|....The |
|00004820| 74 72 6f 75 62 6c 65 20 | 69 73 20 74 68 61 74 20 |trouble |is that |
|00004830| 77 65 20 77 61 6e 74 20 | 74 6f 20 74 65 78 74 20 |we want |to text |
|00004840| 69 6e 64 65 6e 74 20 74 | 68 65 20 6c 69 6e 65 73 |indent t|he lines|
|00004850| 20 69 6e 0d 0a 5c 70 7b | 40 3c 6f 6e 20 74 68 65 | in..\p{|@<on the|
|00004860| 20 70 6c 61 69 6e 40 3e | 7d 20 77 69 74 68 0d 0a | plain@>|} with..|
|00004870| 6a 75 73 74 20 5c 64 71 | 70 7b 66 61 6c 6c 73 20 |just \dq|p{falls |
|00004880| 6d 61 69 6e 6c 79 7e 7d | 2e 20 48 6f 77 65 76 65 |mainly~}|. Howeve|
|00004890| 72 2c 20 74 68 69 73 20 | 73 74 72 69 6e 67 20 69 |r, this |string i|
|000048a0| 73 20 6f 6e 6c 79 20 70 | 61 72 74 20 6f 66 20 61 |s only p|art of a|
|000048b0| 20 73 63 72 61 70 2e 20 | 54 68 65 0d 0a 73 6f 6c | scrap. |The..sol|
|000048c0| 75 74 69 6f 6e 20 69 73 | 20 74 6f 20 67 65 74 20 |ution is| to get |
|000048d0| 74 68 65 20 73 63 61 6e | 6e 65 72 20 74 6f 20 72 |the scan|ner to r|
|000048e0| 65 63 6f 72 64 2c 20 69 | 6e 20 74 68 65 20 5c 70 |ecord, i|n the \p|
|000048f0| 7b 70 6f 73 74 6e 7d 20 | 66 69 65 6c 64 20 6f 66 |{postn} |field of|
|00004900| 20 65 61 63 68 20 73 63 | 72 61 70 2c 0d 0a 74 68 | each sc|rap,..th|
|00004910| 65 20 70 6f 73 69 74 69 | 6f 6e 20 6f 66 20 74 68 |e positi|on of th|
|00004920| 65 20 66 69 72 73 74 20 | 62 79 74 65 20 77 69 74 |e first |byte wit|
|00004930| 68 20 61 20 45 4f 4c 2d | 66 72 65 65 20 72 75 6e |h a EOL-|free run|
|00004940| 20 74 6f 20 74 68 65 20 | 65 6e 64 20 6f 66 20 74 | to the |end of t|
|00004950| 68 65 20 73 63 72 61 70 | 2e 0d 0a 0d 0a 54 68 69 |he scrap|.....Thi|
|00004960| 73 20 73 63 68 65 6d 65 | 20 69 73 20 76 65 72 79 |s scheme| is very|
|00004970| 20 65 66 66 69 63 69 65 | 6e 74 20 62 65 63 61 75 | efficie|nt becau|
|00004980| 73 65 20 61 6c 6c 20 77 | 65 20 61 72 65 20 64 6f |se all w|e are do|
|00004990| 69 6e 67 20 69 73 20 70 | 75 73 68 69 6e 67 20 61 |ing is p|ushing a|
|000049a0| 6e 64 20 70 6f 70 70 69 | 6e 67 0d 0a 70 6f 69 6e |nd poppi|ng..poin|
|000049b0| 74 65 72 73 20 74 6f 20 | 73 63 72 61 70 73 20 6f |ters to |scraps o|
|000049c0| 6e 20 61 20 73 74 61 63 | 6b 20 61 72 72 61 79 2e |n a stac|k array.|
|000049d0| 20 54 68 65 20 6d 61 69 | 6e 20 64 69 73 61 64 76 | The mai|n disadv|
|000049e0| 61 6e 74 61 67 65 20 69 | 73 20 74 68 61 74 20 74 |antage i|s that t|
|000049f0| 68 65 0d 0a 61 72 72 61 | 79 20 6d 75 73 74 20 6e |he..arra|y must n|
|00004a00| 65 63 65 73 73 61 72 69 | 6c 79 20 62 65 20 66 69 |ecessari|ly be fi|
|00004a10| 6e 69 74 65 20 61 6e 64 | 20 77 6f 75 6c 64 20 69 |nite and| would i|
|00004a20| 6d 70 6f 73 65 20 61 20 | 6c 69 6d 69 74 20 6f 6e |mpose a |limit on|
|00004a30| 20 74 68 65 20 64 65 70 | 74 68 0d 0a 6f 66 20 69 | the dep|th..of i|
|00004a40| 6e 64 65 6e 74 61 74 69 | 6f 6e 20 6e 65 73 74 69 |ndentati|on nesti|
|00004a50| 6e 67 20 28 6e 6f 74 20 | 61 20 62 69 67 20 70 72 |ng (not |a big pr|
|00004a60| 6f 62 6c 65 6d 29 2e 0d | 0a 0d 0a 25 3d 3d 3d 3d |oblem)..|...%====|
|00004a70| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004a80| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004a90| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004aa0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004ab0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 25 0d 0a 25 20 20 |========|==%..% |
|00004ac0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004ad0| 20 20 20 20 20 20 20 20 | 20 20 20 20 53 74 61 72 | | Star|
|00004ae0| 74 20 6f 66 20 43 68 32 | 2e 74 65 78 20 20 20 20 |t of Ch2|.tex |
|00004af0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004b00| 20 20 20 20 20 20 20 20 | 20 20 20 20 25 0d 0a 25 | | %..%|
|00004b10| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004b20| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004b30| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004b40| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004b50| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 25 0d |========|======%.|
|00004b60| 0a | |. | |
+--------+-------------------------+-------------------------+--------+--------+