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
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| C source text
| default
| |
98%
| file
| LaTeX document, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 67 72 61 70 68 69 63 | 73 2e 67 6e 75 70 6c 6f |.graphic|s.gnuplo|
|00000020| 74 0a 50 61 74 68 3a 20 | 73 70 61 72 6b 79 21 75 |t.Path: |sparky!u|
|00000030| 75 6e 65 74 21 63 73 2e | 75 74 65 78 61 73 2e 65 |unet!cs.|utexas.e|
|00000040| 64 75 21 74 6f 72 6e 21 | 77 61 74 73 65 72 76 32 |du!torn!|watserv2|
|00000050| 2e 75 77 61 74 65 72 6c | 6f 6f 2e 63 61 21 77 61 |.uwaterl|oo.ca!wa|
|00000060| 74 6d 61 74 68 21 6e 65 | 75 6d 61 6e 6e 2e 75 77 |tmath!ne|umann.uw|
|00000070| 61 74 65 72 6c 6f 6f 2e | 63 61 21 73 73 63 6c 69 |aterloo.|ca!sscli|
|00000080| 66 74 0a 46 72 6f 6d 3a | 20 73 73 63 6c 69 66 74 |ft.From:| ssclift|
|00000090| 40 6e 65 75 6d 61 6e 6e | 2e 75 77 61 74 65 72 6c |@neumann|.uwaterl|
|000000a0| 6f 6f 2e 63 61 20 28 53 | 69 6d 6f 6e 20 43 6c 69 |oo.ca (S|imon Cli|
|000000b0| 66 74 29 0a 53 75 62 6a | 65 63 74 3a 20 52 65 3a |ft).Subj|ect: Re:|
|000000c0| 20 52 75 6e 6e 69 6e 67 | 20 47 6e 75 70 6c 6f 74 | Running| Gnuplot|
|000000d0| 20 66 72 6f 6d 20 46 4f | 52 54 52 41 4e 2c 20 28 | from FO|RTRAN, (|
|000000e0| 61 6e 64 20 43 29 0a 4d | 65 73 73 61 67 65 2d 49 |and C).M|essage-I|
|000000f0| 44 3a 20 3c 42 78 47 45 | 49 4a 2e 4d 47 46 40 6d |D: <BxGE|IJ.MGF@m|
|00000100| 61 74 68 2e 75 77 61 74 | 65 72 6c 6f 6f 2e 63 61 |ath.uwat|erloo.ca|
|00000110| 3e 0a 53 75 6d 6d 61 72 | 79 3a 20 55 73 65 20 70 |>.Summar|y: Use p|
|00000120| 6f 70 65 6e 2e 0a 53 65 | 6e 64 65 72 3a 20 6e 65 |open..Se|nder: ne|
|00000130| 77 73 40 6d 61 74 68 2e | 75 77 61 74 65 72 6c 6f |ws@math.|uwaterlo|
|00000140| 6f 2e 63 61 20 28 4e 65 | 77 73 20 4f 77 6e 65 72 |o.ca (Ne|ws Owner|
|00000150| 29 0a 4f 72 67 61 6e 69 | 7a 61 74 69 6f 6e 3a 20 |).Organi|zation: |
|00000160| 55 6e 69 76 65 72 73 69 | 74 79 20 6f 66 20 57 61 |Universi|ty of Wa|
|00000170| 74 65 72 6c 6f 6f 0a 44 | 61 74 65 3a 20 4d 6f 6e |terloo.D|ate: Mon|
|00000180| 2c 20 39 20 4e 6f 76 20 | 31 39 39 32 20 31 34 3a |, 9 Nov |1992 14:|
|00000190| 34 39 3a 33 31 20 47 4d | 54 0a 4c 69 6e 65 73 3a |49:31 GM|T.Lines:|
|000001a0| 20 32 36 32 0a 0a 49 27 | 76 65 20 6e 6f 74 69 63 | 262..I'|ve notic|
|000001b0| 65 64 20 61 20 66 65 77 | 20 70 65 6f 70 6c 65 20 |ed a few| people |
|000001c0| 74 72 79 69 6e 67 20 74 | 6f 20 72 75 6e 20 47 6e |trying t|o run Gn|
|000001d0| 75 70 6c 6f 74 20 66 72 | 6f 6d 20 61 20 70 72 6f |uplot fr|om a pro|
|000001e0| 67 72 61 6d 2e 20 20 49 | 20 6c 6f 6f 6b 65 64 0a |gram. I| looked.|
|000001f0| 61 74 20 74 68 69 73 20 | 70 72 6f 62 6c 65 6d 20 |at this |problem |
|00000200| 61 20 66 65 77 20 77 65 | 65 6b 73 20 61 67 6f 2c |a few we|eks ago,|
|00000210| 20 77 68 65 6e 20 49 20 | 77 61 6e 74 65 64 20 70 | when I |wanted p|
|00000220| 6c 6f 74 74 65 64 20 6f | 75 74 70 75 74 20 74 6f |lotted o|utput to|
|00000230| 20 64 69 73 70 6c 61 79 | 0a 69 6e 74 65 72 6d 65 | display|.interme|
|00000240| 64 69 61 74 65 20 73 74 | 61 67 65 20 73 6f 6c 75 |diate st|age solu|
|00000250| 74 69 6f 6e 73 20 66 72 | 6f 6d 20 61 20 66 6c 75 |tions fr|om a flu|
|00000260| 69 64 20 64 79 6e 61 6d | 69 63 73 20 63 6f 64 65 |id dynam|ics code|
|00000270| 2e 20 20 41 66 74 65 72 | 20 63 6f 6e 73 75 6c 74 |. After| consult|
|00000280| 69 6e 67 0a 77 69 74 68 | 20 6c 6f 63 61 6c 20 67 |ing.with| local g|
|00000290| 75 72 75 73 2c 20 74 68 | 65 79 20 70 6f 69 6e 74 |urus, th|ey point|
|000002a0| 65 64 20 6d 65 20 74 6f | 20 74 68 65 20 55 6e 69 |ed me to| the Uni|
|000002b0| 78 20 70 6f 70 65 6e 20 | 63 6f 6d 6d 61 6e 64 73 |x popen |commands|
|000002c0| 2e 20 20 49 20 77 72 6f | 74 65 20 74 68 69 73 0a |. I wro|te this.|
|000002d0| 73 69 6d 70 6c 65 20 73 | 65 74 20 6f 66 20 77 72 |simple s|et of wr|
|000002e0| 61 70 70 65 72 20 66 75 | 6e 63 74 69 6f 6e 73 2c |apper fu|nctions,|
|000002f0| 20 6d 65 61 6e 74 20 74 | 6f 20 62 65 20 6c 69 6e | meant t|o be lin|
|00000300| 6b 65 64 20 74 6f 20 53 | 75 6e 20 34 2f 36 37 30 |ked to S|un 4/670|
|00000310| 20 46 6f 72 74 72 61 6e | 2c 0a 61 6e 64 20 63 61 | Fortran|,.and ca|
|00000320| 6c 6c 65 64 20 61 73 20 | 53 55 42 52 4f 55 54 49 |lled as |SUBROUTI|
|00000330| 4e 45 27 73 2e 20 20 54 | 68 65 73 65 20 77 69 6c |NE's. T|hese wil|
|00000340| 6c 20 70 72 6f 62 61 62 | 6c 79 20 77 6f 72 6b 20 |l probab|ly work |
|00000350| 77 69 74 68 20 6f 74 68 | 65 72 20 55 6e 69 78 20 |with oth|er Unix |
|00000360| 62 6f 78 65 73 2e 0a 0a | 49 20 63 6f 6d 70 69 6c |boxes...|I compil|
|00000370| 65 64 20 74 68 65 20 73 | 6f 75 72 63 65 20 77 69 |ed the s|ource wi|
|00000380| 74 68 0a 20 20 67 63 63 | 20 2d 63 20 70 69 70 65 |th. gcc| -c pipe|
|00000390| 4c 69 62 2e 63 0a 77 68 | 69 63 68 20 63 72 65 61 |Lib.c.wh|ich crea|
|000003a0| 74 65 73 20 70 69 70 65 | 4c 69 62 2e 6f 2e 20 20 |tes pipe|Lib.o. |
|000003b0| 54 68 65 6e 20 49 20 6a | 75 73 74 20 6c 69 6e 6b |Then I j|ust link|
|000003c0| 20 74 68 69 73 20 77 69 | 74 68 20 6d 79 20 46 6f | this wi|th my Fo|
|000003d0| 72 74 72 61 6e 20 70 72 | 6f 67 72 61 6d 0a 20 20 |rtran pr|ogram. |
|000003e0| 66 37 37 20 2d 4f 32 20 | 6d 79 46 6f 72 74 72 61 |f77 -O2 |myFortra|
|000003f0| 6e 53 6f 75 72 63 65 2e | 6f 20 70 69 70 65 4c 69 |nSource.|o pipeLi|
|00000400| 62 2e 6f 20 2d 6f 20 6d | 79 50 72 6f 67 72 61 6d |b.o -o m|yProgram|
|00000410| 45 78 65 63 75 74 61 62 | 6c 65 0a 0a 57 68 61 74 |Executab|le..What|
|00000420| 20 74 68 65 20 6c 69 62 | 72 61 72 79 20 64 6f 65 | the lib|rary doe|
|00000430| 73 20 69 73 20 73 65 74 | 20 75 70 20 74 6f 20 32 |s is set| up to 2|
|00000440| 30 20 70 72 6f 67 72 61 | 6d 73 20 67 6f 69 6e 67 |0 progra|ms going|
|00000450| 20 28 6c 69 6b 65 20 67 | 6e 75 70 6c 6f 74 29 2c | (like g|nuplot),|
|00000460| 20 74 68 65 6e 0a 61 6c | 6c 6f 77 73 20 79 6f 75 | then.al|lows you|
|00000470| 20 74 6f 20 73 65 6e 64 | 20 74 6f 20 74 68 65 6d | to send| to them|
|00000480| 20 61 73 20 69 66 20 74 | 68 65 20 70 72 6f 67 72 | as if t|he progr|
|00000490| 61 6d 20 77 65 72 65 20 | 74 79 70 69 6e 67 20 6f |am were |typing o|
|000004a0| 6e 20 74 68 65 20 63 6f | 6d 6d 61 6e 64 0a 6c 69 |n the co|mmand.li|
|000004b0| 6e 65 2e 20 20 49 27 76 | 65 20 69 6e 63 6c 75 64 |ne. I'v|e includ|
|000004c0| 65 64 20 61 20 62 72 69 | 65 66 20 73 65 74 20 6f |ed a bri|ef set o|
|000004d0| 66 20 64 6f 63 73 20 61 | 66 74 65 72 20 74 68 65 |f docs a|fter the|
|000004e0| 20 73 6f 75 72 63 65 20 | 63 6f 64 65 2c 20 69 6e | source |code, in|
|000004f0| 20 6c 61 74 65 78 0a 66 | 6f 72 6d 61 74 2e 20 20 | latex.f|ormat. |
|00000500| 54 68 65 72 65 20 69 73 | 20 6e 6f 20 66 61 63 69 |There is| no faci|
|00000510| 6c 69 74 79 20 74 6f 20 | 77 61 74 63 68 20 74 68 |lity to |watch th|
|00000520| 65 20 6f 75 74 70 75 74 | 20 6f 66 20 61 20 70 72 |e output| of a pr|
|00000530| 6f 67 72 61 6d 2e 0a 0a | 48 65 6c 70 20 79 6f 75 |ogram...|Help you|
|00000540| 72 73 65 6c 66 2e 2e 2e | 0a 0a 2d 2d 2d 2d 2d 2d |rself...|..------|
|00000550| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000560| 2d 2d 2d 2d 2d 2d 53 6f | 75 72 63 65 20 43 6f 64 |------So|urce Cod|
|00000570| 65 2c 20 43 75 74 20 68 | 65 72 65 2d 2d 2d 2d 2d |e, Cut h|ere-----|
|00000580| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000590| 2d 2d 2d 2d 2d 0a 2f 2a | 0a 20 20 70 69 70 65 4c |-----./*|. pipeL|
|000005a0| 69 62 2e 63 0a 0a 20 20 | 62 79 20 53 69 6d 6f 6e |ib.c.. |by Simon|
|000005b0| 20 43 6c 69 66 74 0a 20 | 20 55 6e 69 76 65 72 73 | Clift. | Univers|
|000005c0| 69 74 79 20 6f 66 20 57 | 61 74 65 72 6c 6f 6f 2c |ity of W|aterloo,|
|000005d0| 20 43 53 20 44 65 70 74 | 2e 2c 20 53 63 69 43 6f | CS Dept|., SciCo|
|000005e0| 6d 20 47 72 6f 75 70 0a | 0a 20 20 55 73 65 20 74 |m Group.|. Use t|
|000005f0| 68 69 73 20 61 74 20 79 | 6f 75 72 20 6f 77 6e 20 |his at y|our own |
|00000600| 72 69 73 6b 2e 0a 0a 20 | 20 41 20 73 6d 61 6c 6c |risk... | A small|
|00000610| 20 6c 69 62 72 61 72 79 | 20 6f 66 20 66 75 6e 63 | library| of func|
|00000620| 74 69 6f 6e 73 20 74 6f | 20 61 6c 6c 6f 77 20 46 |tions to| allow F|
|00000630| 4f 52 54 52 41 4e 20 37 | 37 20 6f 6e 20 74 68 65 |ORTRAN 7|7 on the|
|00000640| 20 53 75 6e 20 74 6f 20 | 75 73 65 0a 20 20 70 69 | Sun to |use. pi|
|00000650| 70 65 73 20 74 6f 20 74 | 61 6c 6b 20 74 6f 20 6f |pes to t|alk to o|
|00000660| 74 68 65 72 20 70 72 6f | 67 72 61 6d 73 20 69 6e |ther pro|grams in|
|00000670| 74 65 72 61 63 74 69 76 | 65 6c 79 2e 0a 0a 2a 2f |teractiv|ely...*/|
|00000680| 0a 0a 23 69 6e 63 6c 75 | 64 65 20 3c 73 74 64 69 |..#inclu|de <stdi|
|00000690| 6f 2e 68 3e 0a 0a 0a 2f | 2a 0a 20 20 41 6c 6c 6f |o.h>.../|*. Allo|
|000006a0| 77 20 61 6e 20 61 72 72 | 61 79 20 6f 66 20 66 69 |w an arr|ay of fi|
|000006b0| 6c 65 20 64 65 73 63 72 | 69 70 74 6f 72 73 0a 2a |le descr|iptors.*|
|000006c0| 2f 0a 0a 23 64 65 66 69 | 6e 65 09 4d 61 78 50 69 |/..#defi|ne.MaxPi|
|000006d0| 70 65 73 09 09 32 30 0a | 23 64 65 66 69 6e 65 09 |pes..20.|#define.|
|000006e0| 50 69 70 65 4f 70 65 6e | 09 09 2d 31 0a 23 64 65 |PipeOpen|..-1.#de|
|000006f0| 66 69 6e 65 09 50 69 70 | 65 43 6c 6f 73 65 64 09 |fine.Pip|eClosed.|
|00000700| 09 30 0a 0a 46 49 4c 45 | 09 09 2a 70 69 70 65 73 |.0..FILE|..*pipes|
|00000710| 5b 4d 61 78 50 69 70 65 | 73 5d 3b 0a 69 6e 74 09 |[MaxPipe|s];.int.|
|00000720| 09 70 69 70 65 73 5f 6f | 70 65 6e 5b 4d 61 78 50 |.pipes_o|pen[MaxP|
|00000730| 69 70 65 73 5d 3b 09 09 | 2f 2a 20 73 74 61 74 75 |ipes];..|/* statu|
|00000740| 73 20 2a 2f 0a 0a 2f 2a | 0a 20 20 70 6c 69 6e 69 |s */../*|. plini|
|00000750| 74 5f 0a 0a 20 20 49 6e | 69 74 69 61 6c 69 7a 65 |t_.. In|itialize|
|00000760| 20 70 69 70 65 73 20 73 | 79 73 74 65 6d 0a 2a 2f | pipes s|ystem.*/|
|00000770| 0a 0a 76 6f 69 64 20 70 | 6c 69 6e 69 74 5f 28 20 |..void p|linit_( |
|00000780| 76 6f 69 64 20 29 0a 7b | 0a 09 69 6e 74 20 09 69 |void ).{|..int .i|
|00000790| 3b 0a 0a 09 66 6f 72 28 | 20 69 3d 30 20 3b 20 69 |;...for(| i=0 ; i|
|000007a0| 20 3c 20 4d 61 78 50 69 | 70 65 73 20 3b 20 69 2b | < MaxPi|pes ; i+|
|000007b0| 2b 20 29 20 7b 0a 09 09 | 70 69 70 65 73 5f 6f 70 |+ ) {...|pipes_op|
|000007c0| 65 6e 5b 69 5d 20 3d 20 | 50 69 70 65 43 6c 6f 73 |en[i] = |PipeClos|
|000007d0| 65 64 3b 0a 09 7d 0a 7d | 0a 0a 2f 2a 0a 20 20 70 |ed;..}.}|../*. p|
|000007e0| 6c 6f 70 65 6e 5f 0a 0a | 20 20 4f 70 65 6e 20 61 |lopen_..| Open a|
|000007f0| 20 70 69 70 65 20 74 6f | 20 61 20 70 72 6f 67 72 | pipe to| a progr|
|00000800| 61 6d 20 67 69 76 65 6e | 20 74 68 65 20 73 74 61 |am given| the sta|
|00000810| 72 74 75 70 20 63 6f 6d | 6d 61 6e 64 2c 20 61 6e |rtup com|mand, an|
|00000820| 64 20 65 69 74 68 65 72 | 20 22 72 22 20 6f 72 20 |d either| "r" or |
|00000830| 22 77 22 0a 0a 20 20 53 | 74 61 74 75 73 20 76 61 |"w".. S|tatus va|
|00000840| 72 69 61 62 6c 65 20 20 | 20 73 74 61 74 20 3d 20 |riable | stat = |
|00000850| 50 69 70 65 20 6e 75 6d | 62 65 72 20 6f 6e 20 73 |Pipe num|ber on s|
|00000860| 75 63 63 65 73 73 66 75 | 6c 20 6f 70 65 6e 2c 20 |uccessfu|l open, |
|00000870| 2d 31 20 6f 74 68 65 72 | 77 69 73 65 0a 2a 2f 0a |-1 other|wise.*/.|
|00000880| 0a 76 6f 69 64 20 70 6c | 6f 70 65 6e 5f 28 20 63 |.void pl|open_( c|
|00000890| 68 61 72 20 2a 20 63 6f | 6d 6d 61 6e 64 2c 20 63 |har * co|mmand, c|
|000008a0| 68 61 72 20 2a 20 6d 6f | 64 65 2c 20 69 6e 74 20 |har * mo|de, int |
|000008b0| 2a 20 73 74 61 74 20 29 | 0a 7b 0a 09 69 6e 74 09 |* stat )|.{..int.|
|000008c0| 69 3b 0a 0a 09 66 6f 72 | 28 20 69 3d 30 20 3b 20 |i;...for|( i=0 ; |
|000008d0| 69 20 3c 20 4d 61 78 50 | 69 70 65 73 20 3b 20 69 |i < MaxP|ipes ; i|
|000008e0| 2b 2b 20 29 20 7b 0a 09 | 09 69 66 28 20 70 69 70 |++ ) {..|.if( pip|
|000008f0| 65 73 5f 6f 70 65 6e 5b | 69 5d 20 3d 3d 20 50 69 |es_open[|i] == Pi|
|00000900| 70 65 43 6c 6f 73 65 64 | 20 29 20 7b 0a 09 09 09 |peClosed| ) {....|
|00000910| 62 72 65 61 6b 3b 0a 09 | 09 7d 0a 09 7d 0a 0a 09 |break;..|.}..}...|
|00000920| 69 66 28 20 69 20 3d 3d | 20 4d 61 78 50 69 70 65 |if( i ==| MaxPipe|
|00000930| 73 20 29 20 7b 0a 09 09 | 2a 73 74 61 74 20 3d 20 |s ) {...|*stat = |
|00000940| 2d 31 3b 0a 09 7d 20 65 | 6c 73 65 20 7b 0a 09 09 |-1;..} e|lse {...|
|00000950| 70 69 70 65 73 5b 69 5d | 20 3d 20 70 6f 70 65 6e |pipes[i]| = popen|
|00000960| 28 20 63 6f 6d 6d 61 6e | 64 2c 20 6d 6f 64 65 20 |( comman|d, mode |
|00000970| 29 3b 0a 09 09 2a 73 74 | 61 74 20 3d 20 28 69 2b |);...*st|at = (i+|
|00000980| 31 29 3b 0a 09 7d 0a 7d | 0a 0a 2f 2a 20 0a 20 20 |1);..}.}|../* . |
|00000990| 70 6c 77 72 69 74 5f 0a | 0a 20 20 57 72 69 74 65 |plwrit_.|. Write|
|000009a0| 20 61 20 73 74 72 69 6e | 67 20 74 6f 20 61 20 70 | a strin|g to a p|
|000009b0| 69 70 65 2e 0a 0a 2a 2f | 0a 0a 76 6f 69 64 20 70 |ipe...*/|..void p|
|000009c0| 6c 77 72 69 74 5f 28 20 | 69 6e 74 20 2a 20 70 69 |lwrit_( |int * pi|
|000009d0| 70 65 4e 75 6d 2c 20 63 | 68 61 72 20 2a 20 73 74 |peNum, c|har * st|
|000009e0| 72 69 6e 67 4f 75 74 20 | 29 0a 7b 0a 09 66 70 72 |ringOut |).{..fpr|
|000009f0| 69 6e 74 66 28 20 70 69 | 70 65 73 5b 2a 70 69 70 |intf( pi|pes[*pip|
|00000a00| 65 4e 75 6d 2d 31 5d 2c | 20 22 25 73 5c 6e 22 2c |eNum-1],| "%s\n",|
|00000a10| 20 73 74 72 69 6e 67 4f | 75 74 20 29 3b 0a 7d 0a | stringO|ut );.}.|
|00000a20| 0a 2f 2a 0a 20 20 70 6c | 66 6c 75 73 5f 0a 0a 20 |./*. pl|flus_.. |
|00000a30| 20 46 6c 75 73 68 20 61 | 20 70 69 70 65 27 73 20 | Flush a| pipe's |
|00000a40| 6f 75 74 70 75 74 0a 2a | 2f 0a 0a 76 6f 69 64 20 |output.*|/..void |
|00000a50| 70 6c 66 6c 75 73 5f 28 | 20 69 6e 74 20 2a 70 69 |plflus_(| int *pi|
|00000a60| 70 65 4e 75 6d 20 29 0a | 7b 0a 09 66 66 6c 75 73 |peNum ).|{..fflus|
|00000a70| 68 28 20 70 69 70 65 73 | 5b 20 2a 70 69 70 65 4e |h( pipes|[ *pipeN|
|00000a80| 75 6d 20 2d 20 31 20 5d | 20 29 3b 0a 7d 0a 0a 2f |um - 1 ]| );.}../|
|00000a90| 2a 0a 20 20 70 6c 63 6c | 6f 73 5f 0a 0a 20 20 43 |*. plcl|os_.. C|
|00000aa0| 6c 6f 73 65 20 61 20 70 | 69 70 65 0a 2a 2f 0a 0a |lose a p|ipe.*/..|
|00000ab0| 76 6f 69 64 20 70 6c 63 | 6c 6f 73 5f 28 20 69 6e |void plc|los_( in|
|00000ac0| 74 20 2a 20 70 69 70 65 | 4e 75 6d 20 29 0a 7b 0a |t * pipe|Num ).{.|
|00000ad0| 09 70 63 6c 6f 73 65 28 | 20 70 69 70 65 73 5b 2a |.pclose(| pipes[*|
|00000ae0| 70 69 70 65 4e 75 6d 2d | 31 5d 20 29 3b 0a 7d 0a |pipeNum-|1] );.}.|
|00000af0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000b00| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 45 6e 64 20 6f 66 20 |--------|-End of |
|00000b10| 53 6f 75 72 63 65 20 43 | 6f 64 65 2c 20 43 75 74 |Source C|ode, Cut|
|00000b20| 20 68 65 72 65 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d | here---|--------|
|00000b30| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 0a 2d 2d 2d 2d |--------|---.----|
|00000b40| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000b50| 2d 2d 2d 2d 2d 4c 61 54 | 65 58 20 44 6f 63 75 6d |-----LaT|eX Docum|
|00000b60| 65 6e 74 61 74 69 6f 6e | 2c 20 43 75 74 20 68 65 |entation|, Cut he|
|00000b70| 72 65 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |re------|--------|
|00000b80| 2d 2d 2d 2d 2d 2d 2d 0a | 5c 64 6f 63 75 6d 65 6e |-------.|\documen|
|00000b90| 74 73 74 79 6c 65 5b 66 | 75 6c 6c 70 61 67 65 2c |tstyle[f|ullpage,|
|00000ba0| 31 31 70 74 5d 7b 61 72 | 74 69 63 6c 65 7d 0a 5c |11pt]{ar|ticle}.\|
|00000bb0| 62 65 67 69 6e 7b 64 6f | 63 75 6d 65 6e 74 7d 0a |begin{do|cument}.|
|00000bc0| 0a 5c 74 69 74 6c 65 7b | 41 20 53 6d 61 6c 6c 20 |.\title{|A Small |
|00000bd0| 46 37 37 20 50 69 70 65 | 73 20 4c 69 62 72 61 72 |F77 Pipe|s Librar|
|00000be0| 79 7d 0a 5c 61 75 74 68 | 6f 72 7b 53 69 6d 6f 6e |y}.\auth|or{Simon|
|00000bf0| 20 43 6c 69 66 74 7d 0a | 5c 64 61 74 65 7b 53 65 | Clift}.|\date{Se|
|00000c00| 70 74 65 6d 62 65 72 20 | 32 35 74 68 2c 20 31 39 |ptember |25th, 19|
|00000c10| 39 32 7d 0a 0a 5c 6d 61 | 6b 65 74 69 74 6c 65 0a |92}..\ma|ketitle.|
|00000c20| 0a 5c 73 65 63 74 69 6f | 6e 7b 57 68 61 74 20 50 |.\sectio|n{What P|
|00000c30| 69 70 65 4c 69 62 20 44 | 6f 65 73 7d 0a 0a 49 20 |ipeLib D|oes}..I |
|00000c40| 72 65 63 65 6e 74 6c 79 | 20 65 6e 63 6f 75 6e 74 |recently| encount|
|00000c50| 65 72 65 64 20 74 68 65 | 20 70 72 6f 62 6c 65 6d |ered the| problem|
|00000c60| 20 6f 66 20 77 61 6e 74 | 69 6e 67 20 6d 79 20 46 | of want|ing my F|
|00000c70| 6f 72 74 72 61 6e 20 37 | 37 20 70 72 6f 67 72 61 |ortran 7|7 progra|
|00000c80| 6d 73 20 74 6f 20 0a 73 | 65 6e 64 20 69 6e 73 74 |ms to .s|end inst|
|00000c90| 72 75 63 74 69 6f 6e 73 | 20 74 6f 20 6f 74 68 65 |ructions| to othe|
|00000ca0| 72 20 70 72 6f 67 72 61 | 6d 73 2c 20 69 6e 20 70 |r progra|ms, in p|
|00000cb0| 61 72 74 69 63 75 6c 61 | 72 2c 20 74 68 65 20 47 |articula|r, the G|
|00000cc0| 6e 75 50 6c 6f 74 20 70 | 61 63 6b 61 67 65 2e 0a |nuPlot p|ackage..|
|00000cd0| 41 66 74 65 72 20 63 6f | 6e 73 75 6c 74 69 6e 67 |After co|nsulting|
|00000ce0| 20 77 69 74 68 20 4b 65 | 6e 20 57 65 6c 6c 73 63 | with Ke|n Wellsc|
|00000cf0| 68 20 6f 66 20 4d 46 43 | 46 20 68 65 20 73 75 67 |h of MFC|F he sug|
|00000d00| 67 65 73 74 65 64 20 49 | 20 74 72 79 20 74 6f 20 |gested I| try to |
|00000d10| 75 73 65 20 74 68 65 0a | 55 6e 69 78 20 7b 5c 74 |use the.|Unix {\t|
|00000d20| 74 20 70 6f 70 65 6e 28 | 29 7d 20 66 61 63 69 6c |t popen(|)} facil|
|00000d30| 69 74 69 65 73 2c 20 77 | 68 69 63 68 20 61 6c 6c |ities, w|hich all|
|00000d40| 6f 77 20 6f 6e 65 20 70 | 72 6f 67 72 61 6d 20 74 |ow one p|rogram t|
|00000d50| 6f 20 73 74 61 72 74 20 | 61 6e 6f 74 68 65 72 0a |o start |another.|
|00000d60| 61 6e 64 20 73 65 6e 64 | 20 74 6f 20 69 74 2c 20 |and send| to it, |
|00000d70| 6a 75 73 74 20 61 73 20 | 69 66 20 69 74 20 68 61 |just as |if it ha|
|00000d80| 64 20 62 65 65 6e 20 70 | 61 72 74 20 6f 66 20 61 |d been p|art of a|
|00000d90| 20 74 72 61 64 69 74 69 | 6f 6e 61 6c 20 63 6f 6d | traditi|onal com|
|00000da0| 6d 61 6e 64 0a 6c 69 6e | 65 20 70 69 70 65 2e 0a |mand.lin|e pipe..|
|00000db0| 0a 54 68 65 73 65 20 66 | 75 6e 63 74 69 6f 6e 73 |.These f|unctions|
|00000dc0| 20 63 61 6e 6e 6f 74 20 | 62 65 20 75 73 65 64 20 | cannot |be used |
|00000dd0| 64 69 72 65 63 74 6c 79 | 20 66 72 6f 6d 20 46 6f |directly| from Fo|
|00000de0| 72 74 72 61 6e 2c 20 73 | 6f 20 49 20 77 72 6f 74 |rtran, s|o I wrot|
|00000df0| 65 20 61 20 73 6d 61 6c | 6c 0a 6c 69 62 72 61 72 |e a smal|l.librar|
|00000e00| 79 20 6f 66 20 77 72 61 | 70 70 65 72 20 66 75 6e |y of wra|pper fun|
|00000e10| 63 74 69 6f 6e 73 20 74 | 68 61 74 20 61 72 65 20 |ctions t|hat are |
|00000e20| 46 6f 72 74 72 61 6e 20 | 37 37 20 63 61 6c 6c 61 |Fortran |77 calla|
|00000e30| 62 6c 65 2e 20 20 49 74 | 20 61 6c 6c 6f 77 73 20 |ble. It| allows |
|00000e40| 75 70 0a 74 6f 20 32 30 | 20 70 69 70 65 64 20 63 |up.to 20| piped c|
|00000e50| 6f 6d 6d 75 6e 69 63 61 | 74 69 6f 6e 73 20 63 68 |ommunica|tions ch|
|00000e60| 61 6e 6e 65 6c 73 20 61 | 74 20 74 68 65 20 6d 6f |annels a|t the mo|
|00000e70| 6d 65 6e 74 2c 20 61 6e | 64 20 66 6f 72 20 74 68 |ment, an|d for th|
|00000e80| 65 20 6d 6f 6d 65 6e 74 | 0a 6f 6e 6c 79 20 61 6c |e moment|.only al|
|00000e90| 6c 6f 77 73 20 79 6f 75 | 20 74 6f 20 77 72 69 74 |lows you| to writ|
|00000ea0| 65 20 74 6f 20 74 68 65 | 73 65 20 63 68 61 6e 6e |e to the|se chann|
|00000eb0| 65 6c 73 2e 0a 0a 5c 73 | 65 63 74 69 6f 6e 7b 48 |els...\s|ection{H|
|00000ec0| 6f 77 20 74 6f 20 75 73 | 65 20 50 69 70 65 4c 69 |ow to us|e PipeLi|
|00000ed0| 62 7d 0a 0a 55 73 69 6e | 67 20 70 69 70 65 6c 69 |b}..Usin|g pipeli|
|00000ee0| 62 20 72 65 71 75 69 72 | 65 73 20 74 68 61 74 20 |b requir|es that |
|00000ef0| 79 6f 75 20 64 65 63 6c | 61 72 65 20 61 6e 20 49 |you decl|are an I|
|00000f00| 4e 54 45 47 45 52 20 66 | 6f 72 20 65 61 63 68 20 |NTEGER f|or each |
|00000f10| 70 69 70 65 20 79 6f 75 | 20 77 69 73 68 0a 74 6f |pipe you| wish.to|
|00000f20| 20 75 73 65 2c 20 74 6f | 20 77 6f 72 6b 20 61 73 | use, to| work as|
|00000f30| 20 61 20 70 69 70 65 20 | 6e 75 6d 62 65 72 20 68 | a pipe |number h|
|00000f40| 6f 6c 64 65 72 2e 20 20 | 41 6c 6c 20 61 63 63 65 |older. |All acce|
|00000f50| 73 73 65 73 20 74 6f 20 | 74 68 65 20 72 6f 75 74 |sses to |the rout|
|00000f60| 69 6e 65 73 20 61 72 65 | 0a 6d 61 64 65 20 61 73 |ines are|.made as|
|00000f70| 20 46 6f 72 74 72 61 6e | 20 73 75 62 72 6f 75 74 | Fortran| subrout|
|00000f80| 69 6e 65 20 63 61 6c 6c | 73 2e 0a 0a 42 65 66 6f |ine call|s...Befo|
|00000f90| 72 65 20 75 73 69 6e 67 | 20 74 68 65 20 70 69 70 |re using| the pip|
|00000fa0| 65 73 20 79 6f 75 20 6d | 75 73 74 20 63 61 6c 6c |es you m|ust call|
|00000fb0| 20 74 68 65 20 69 6e 69 | 74 69 61 6c 69 7a 61 74 | the ini|tializat|
|00000fc0| 69 6f 6e 20 66 75 6e 63 | 74 69 6f 6e 2e 0a 5c 62 |ion func|tion..\b|
|00000fd0| 65 67 69 6e 7b 76 65 72 | 62 61 74 69 6d 7d 0a 20 |egin{ver|batim}. |
|00000fe0| 20 20 20 20 20 43 41 4c | 4c 20 70 6c 69 6e 69 74 | CAL|L plinit|
|00000ff0| 28 29 0a 5c 65 6e 64 7b | 76 65 72 62 61 74 69 6d |().\end{|verbatim|
|00001000| 7d 0a 0a 54 6f 20 6f 70 | 65 6e 20 61 20 70 69 70 |}..To op|en a pip|
|00001010| 65 20 79 6f 75 20 6e 65 | 65 64 20 74 6f 20 6b 6e |e you ne|ed to kn|
|00001020| 6f 77 20 77 68 61 74 20 | 42 6f 75 72 6e 65 20 53 |ow what |Bourne S|
|00001030| 68 65 6c 6c 20 28 7b 5c | 74 74 20 73 68 7d 29 20 |hell ({\|tt sh}) |
|00001040| 63 6f 6d 6d 61 6e 64 0a | 79 6f 75 20 77 61 6e 74 |command.|you want|
|00001050| 20 74 6f 20 70 69 70 65 | 20 74 6f 2e 20 20 59 6f | to pipe| to. Yo|
|00001060| 75 20 6d 61 79 20 73 74 | 6f 72 65 20 74 68 69 73 |u may st|ore this|
|00001070| 20 61 73 20 61 20 63 68 | 61 72 61 63 74 65 72 20 | as a ch|aracter |
|00001080| 76 61 72 69 61 62 6c 65 | 2c 20 6f 72 0a 75 73 65 |variable|, or.use|
|00001090| 20 61 20 6c 69 74 65 72 | 61 6c 20 73 74 72 69 6e | a liter|al strin|
|000010a0| 67 20 69 6e 20 74 68 65 | 20 63 61 6c 6c 2e 0a 5c |g in the| call..\|
|000010b0| 62 65 67 69 6e 7b 76 65 | 72 62 61 74 69 6d 7d 0a |begin{ve|rbatim}.|
|000010c0| 43 0a 43 20 54 68 65 20 | 43 4f 4d 4d 4e 44 20 73 |C.C The |COMMND s|
|000010d0| 74 72 69 6e 67 20 6d 61 | 79 20 62 65 20 61 6e 79 |tring ma|y be any|
|000010e0| 20 6c 65 6e 67 74 68 0a | 43 0a 20 20 20 20 20 20 | length.|C. |
|000010f0| 43 48 41 52 41 43 54 45 | 52 20 63 6f 6d 6d 6e 64 |CHARACTE|R commnd|
|00001100| 2a 38 30 0a 20 20 20 20 | 20 20 49 4e 54 45 47 45 |*80. | INTEGE|
|00001110| 52 20 20 20 70 69 70 6e | 75 6d 0a 0a 20 20 20 20 |R pipn|um.. |
|00001120| 20 20 43 41 4c 4c 20 70 | 6c 6f 70 65 6e 28 20 63 | CALL p|lopen( c|
|00001130| 6f 6d 6d 6e 64 2c 20 27 | 77 27 2c 20 70 69 70 6e |ommnd, '|w', pipn|
|00001140| 75 6d 20 29 0a 5c 65 6e | 64 7b 76 65 72 62 61 74 |um ).\en|d{verbat|
|00001150| 69 6d 7d 0a 54 68 65 20 | 7b 5c 74 74 20 63 6f 6d |im}.The |{\tt com|
|00001160| 6d 6e 64 7d 20 73 70 65 | 63 69 66 69 65 64 20 63 |mnd} spe|cified c|
|00001170| 6f 6d 6d 61 6e 64 20 77 | 69 6c 6c 20 62 65 20 73 |ommand w|ill be s|
|00001180| 74 61 72 74 65 64 20 62 | 79 20 74 68 65 20 42 6f |tarted b|y the Bo|
|00001190| 75 72 6e 65 20 53 68 65 | 6c 6c 2e 0a 54 68 65 20 |urne She|ll..The |
|000011a0| 27 77 27 20 73 70 65 63 | 69 66 69 65 73 20 74 68 |'w' spec|ifies th|
|000011b0| 61 74 20 79 6f 75 20 77 | 69 73 68 20 74 6f 20 77 |at you w|ish to w|
|000011c0| 72 69 74 65 20 74 6f 20 | 74 68 69 73 20 70 69 70 |rite to |this pip|
|000011d0| 65 2e 20 20 49 6e 20 66 | 75 74 75 72 65 20 76 65 |e. In f|uture ve|
|000011e0| 72 73 69 6f 6e 73 2c 0a | 72 65 61 64 61 62 6c 65 |rsions,.|readable|
|000011f0| 20 70 69 70 65 73 20 6d | 61 79 20 62 65 20 69 6d | pipes m|ay be im|
|00001200| 70 6c 65 6d 65 6e 74 65 | 64 2e 20 20 54 68 65 20 |plemente|d. The |
|00001210| 70 69 70 65 20 6e 75 6d | 62 65 72 20 79 6f 75 20 |pipe num|ber you |
|00001220| 72 65 63 65 69 76 65 20 | 28 31 2d 32 30 29 0a 77 |receive |(1-20).w|
|00001230| 69 6c 6c 20 62 65 20 73 | 74 6f 72 65 64 20 69 6e |ill be s|tored in|
|00001240| 20 7b 5c 74 74 20 70 69 | 70 6e 75 6d 7d 0a 0a 54 | {\tt pi|pnum}..T|
|00001250| 6f 20 77 72 69 74 65 20 | 74 6f 20 61 20 70 69 70 |o write |to a pip|
|00001260| 65 2c 20 75 73 65 20 74 | 68 65 20 74 68 65 20 7b |e, use t|he the {|
|00001270| 5c 74 74 20 70 6c 77 72 | 69 74 7d 20 66 75 6e 63 |\tt plwr|it} func|
|00001280| 74 69 6f 6e 2e 0a 5c 62 | 65 67 69 6e 7b 76 65 72 |tion..\b|egin{ver|
|00001290| 62 61 74 69 6d 7d 0a 43 | 0a 43 20 54 68 65 20 73 |batim}.C|.C The s|
|000012a0| 74 72 69 6e 67 20 63 61 | 6e 20 62 65 20 61 6e 79 |tring ca|n be any|
|000012b0| 20 6c 65 6e 67 74 68 0a | 43 0a 09 43 48 41 52 41 | length.|C..CHARA|
|000012c0| 43 54 45 52 20 73 74 72 | 69 6e 67 2a 38 30 0a 09 |CTER str|ing*80..|
|000012d0| 49 4e 54 45 47 45 52 20 | 20 20 70 69 70 6e 75 6d |INTEGER | pipnum|
|000012e0| 0a 0a 09 43 41 4c 4c 20 | 70 6c 77 72 69 74 28 20 |...CALL |plwrit( |
|000012f0| 70 69 70 6e 75 6d 2c 20 | 73 74 72 69 6e 67 20 29 |pipnum, |string )|
|00001300| 0a 09 43 41 4c 4c 20 70 | 6c 77 72 69 74 28 20 70 |..CALL p|lwrit( p|
|00001310| 69 70 6e 75 6d 2c 20 27 | 41 20 6c 69 74 65 72 61 |ipnum, '|A litera|
|00001320| 6c 20 73 74 72 69 6e 67 | 20 74 6f 20 73 65 6e 64 |l string| to send|
|00001330| 27 20 29 0a 5c 65 6e 64 | 7b 76 65 72 62 61 74 69 |' ).\end|{verbati|
|00001340| 6d 7d 0a 54 68 65 20 76 | 61 72 69 61 62 6c 65 20 |m}.The v|ariable |
|00001350| 7b 5c 74 74 20 70 69 70 | 6e 75 6d 7d 20 6d 75 73 |{\tt pip|num} mus|
|00001360| 74 20 63 6f 6e 74 61 69 | 6e 20 74 68 65 20 6e 75 |t contai|n the nu|
|00001370| 6d 62 65 72 20 6f 66 20 | 61 20 61 20 76 61 6c 69 |mber of |a a vali|
|00001380| 64 2c 20 6f 70 65 6e 0a | 70 69 70 65 2e 20 20 54 |d, open.|pipe. T|
|00001390| 68 65 20 63 6f 6e 74 65 | 6e 74 73 20 6f 66 20 7b |he conte|nts of {|
|000013a0| 5c 74 74 20 73 74 72 69 | 6e 67 7d 20 77 69 6c 6c |\tt stri|ng} will|
|000013b0| 20 62 65 20 73 65 6e 74 | 20 74 6f 20 74 68 65 20 | be sent| to the |
|000013c0| 70 72 6f 67 72 61 6d 20 | 62 65 69 6e 67 0a 70 69 |program |being.pi|
|000013d0| 70 65 64 20 74 6f 2e 20 | 20 4e 6f 74 65 20 74 68 |ped to. | Note th|
|000013e0| 61 74 20 74 68 65 20 73 | 74 72 69 6e 67 20 6d 61 |at the s|tring ma|
|000013f0| 79 20 61 6c 73 6f 20 62 | 65 20 61 20 6c 69 74 65 |y also b|e a lite|
|00001400| 72 61 6c 2e 0a 0a 54 68 | 65 20 6f 75 74 70 75 74 |ral...Th|e output|
|00001410| 20 6f 66 20 74 68 65 20 | 7b 5c 74 74 20 70 6c 77 | of the |{\tt plw|
|00001420| 72 69 74 7d 20 63 6f 6d | 6d 61 6e 64 20 77 6f 6e |rit} com|mand won|
|00001430| 27 74 20 62 65 20 73 65 | 65 6e 20 62 79 20 74 68 |'t be se|en by th|
|00001440| 65 20 65 78 65 63 75 74 | 65 64 0a 63 6f 6d 6d 61 |e execut|ed.comma|
|00001450| 6e 64 20 75 6e 74 69 6c | 20 65 69 74 68 65 72 20 |nd until| either |
|00001460| 74 68 65 20 6f 75 74 70 | 75 74 20 62 75 66 66 65 |the outp|ut buffe|
|00001470| 72 20 69 73 20 66 75 6c | 6c 2c 20 61 6e 64 20 55 |r is ful|l, and U|
|00001480| 6e 69 78 20 66 6c 75 73 | 68 65 73 20 69 74 2c 20 |nix flus|hes it, |
|00001490| 6f 72 0a 75 6e 74 69 6c | 20 79 6f 75 20 69 73 73 |or.until| you iss|
|000014a0| 75 65 20 74 68 65 20 7b | 5c 74 74 20 70 6c 66 6c |ue the {|\tt plfl|
|000014b0| 75 73 7d 20 63 6f 6d 6d | 61 6e 64 2e 0a 5c 62 65 |us} comm|and..\be|
|000014c0| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0a 09 49 |gin{verb|atim}..I|
|000014d0| 4e 54 45 47 45 52 20 20 | 20 70 69 70 6e 75 6d 0a |NTEGER | pipnum.|
|000014e0| 0a 09 43 41 4c 4c 20 70 | 6c 66 6c 75 73 28 20 70 |..CALL p|lflus( p|
|000014f0| 69 70 6e 75 6d 20 29 0a | 5c 65 6e 64 7b 76 65 72 |ipnum ).|\end{ver|
|00001500| 62 61 74 69 6d 7d 0a 54 | 68 65 20 7b 5c 74 74 20 |batim}.T|he {\tt |
|00001510| 70 69 70 6e 75 6d 7d 20 | 76 61 72 69 61 62 6c 65 |pipnum} |variable|
|00001520| 20 6d 75 73 74 20 63 6f | 6e 74 61 69 6e 20 74 68 | must co|ntain th|
|00001530| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 61 20 76 61 |e number| of a va|
|00001540| 6c 69 64 2c 20 6f 70 65 | 6e 20 70 69 70 65 2e 0a |lid, ope|n pipe..|
|00001550| 0a 54 6f 20 63 6c 6f 73 | 65 20 61 20 70 69 70 65 |.To clos|e a pipe|
|00001560| 2c 20 75 73 65 20 74 68 | 65 20 7b 5c 74 74 20 70 |, use th|e {\tt p|
|00001570| 6c 63 6c 6f 73 7d 20 63 | 6f 6d 6d 61 6e 64 2e 0a |lclos} c|ommand..|
|00001580| 5c 62 65 67 69 6e 7b 76 | 65 72 62 61 74 69 6d 7d |\begin{v|erbatim}|
|00001590| 0a 09 49 4e 54 45 47 45 | 52 20 20 20 70 69 70 6e |..INTEGE|R pipn|
|000015a0| 75 6d 0a 0a 09 43 41 4c | 4c 20 70 6c 63 6c 6f 73 |um...CAL|L plclos|
|000015b0| 28 20 70 69 70 6e 75 6d | 20 29 0a 5c 65 6e 64 7b |( pipnum| ).\end{|
|000015c0| 76 65 72 62 61 74 69 6d | 7d 0a 54 68 69 73 20 77 |verbatim|}.This w|
|000015d0| 69 6c 6c 20 63 6c 6f 73 | 65 20 74 68 65 20 6f 70 |ill clos|e the op|
|000015e0| 65 6e 20 70 69 70 65 20 | 77 68 6f 73 65 20 6e 75 |en pipe |whose nu|
|000015f0| 6d 62 65 72 20 69 73 20 | 69 6e 20 7b 5c 74 74 20 |mber is |in {\tt |
|00001600| 70 69 70 6e 75 6d 7d 2c | 20 66 6c 75 73 68 69 6e |pipnum},| flushin|
|00001610| 67 0a 74 68 65 20 6f 75 | 74 70 75 74 20 69 6e 20 |g.the ou|tput in |
|00001620| 74 68 65 20 70 72 6f 63 | 65 73 73 2e 0a 0a 5c 73 |the proc|ess...\s|
|00001630| 75 62 73 65 63 74 69 6f | 6e 7b 4c 69 6e 6b 69 6e |ubsectio|n{Linkin|
|00001640| 67 20 50 69 70 65 4c 69 | 62 7d 0a 0a 41 74 20 70 |g PipeLi|b}..At p|
|00001650| 72 65 73 65 6e 74 20 79 | 6f 75 20 75 73 65 20 50 |resent y|ou use P|
|00001660| 69 70 65 4c 69 62 20 62 | 79 20 6c 69 6e 6b 69 6e |ipeLib b|y linkin|
|00001670| 67 20 74 68 65 20 7b 5c | 74 74 20 2e 6f 7d 20 6f |g the {\|tt .o} o|
|00001680| 62 6a 65 63 74 20 66 69 | 6c 65 20 74 6f 20 79 6f |bject fi|le to yo|
|00001690| 75 72 0a 46 6f 72 74 72 | 61 6e 20 50 72 6f 67 72 |ur.Fortr|an Progr|
|000016a0| 61 6d 2e 20 20 54 68 65 | 20 73 6f 75 72 63 65 20 |am. The| source |
|000016b0| 63 6f 64 65 20 61 6e 64 | 20 6f 62 6a 65 63 74 20 |code and| object |
|000016c0| 66 69 6c 65 20 61 72 65 | 20 69 6e 20 74 68 65 20 |file are| in the |
|000016d0| 64 69 72 65 63 74 6f 72 | 79 0a 7b 5c 74 74 20 2f |director|y.{\tt /|
|000016e0| 75 2f 73 63 69 63 6f 6d | 2f 63 6f 64 65 2f 50 69 |u/scicom|/code/Pi|
|000016f0| 70 65 4c 69 62 7d 2e 0a | 0a 5c 73 65 63 74 69 6f |peLib}..|.\sectio|
|00001700| 6e 7b 41 20 53 61 6d 70 | 6c 65 20 50 72 6f 67 72 |n{A Samp|le Progr|
|00001710| 61 6d 7d 0a 0a 54 68 69 | 73 20 73 61 6d 70 6c 65 |am}..Thi|s sample|
|00001720| 20 70 72 6f 67 72 61 6d | 20 69 73 20 69 6e 63 6c | program| is incl|
|00001730| 75 64 65 64 20 69 6e 20 | 74 68 65 20 73 61 6d 65 |uded in |the same|
|00001740| 20 64 69 72 65 63 74 6f | 72 79 20 61 73 20 74 68 | directo|ry as th|
|00001750| 65 20 6c 69 62 72 61 72 | 79 20 63 6f 64 65 2e 0a |e librar|y code..|
|00001760| 5c 62 65 67 69 6e 7b 76 | 65 72 62 61 74 69 6d 7d |\begin{v|erbatim}|
|00001770| 0a 43 0a 43 20 20 41 20 | 53 61 6d 70 6c 65 20 70 |.C.C A |Sample p|
|00001780| 72 6f 67 72 61 6d 20 66 | 6f 72 20 50 69 70 65 4c |rogram f|or PipeL|
|00001790| 69 62 0a 43 0a 09 49 4e | 54 45 47 45 52 20 70 69 |ib.C..IN|TEGER pi|
|000017a0| 70 65 6e 75 6d 0a 09 43 | 48 41 52 41 43 54 45 52 |penum..C|HARACTER|
|000017b0| 20 64 75 6d 6d 79 2a 31 | 0a 43 0a 43 20 49 6e 69 | dummy*1|.C.C Ini|
|000017c0| 74 69 61 6c 69 7a 65 20 | 74 68 65 20 6c 69 62 72 |tialize |the libr|
|000017d0| 61 72 79 0a 43 0a 09 43 | 41 4c 4c 20 70 6c 69 6e |ary.C..C|ALL plin|
|000017e0| 69 74 28 29 0a 43 0a 43 | 20 4f 70 65 6e 20 61 20 |it().C.C| Open a |
|000017f0| 73 74 72 65 61 6d 20 74 | 6f 20 74 68 65 20 47 6e |stream t|o the Gn|
|00001800| 75 50 6c 6f 74 20 70 72 | 6f 67 72 61 6d 0a 43 0a |uPlot pr|ogram.C.|
|00001810| 09 43 41 4c 4c 20 70 6c | 6f 70 65 6e 28 27 67 6e |.CALL pl|open('gn|
|00001820| 75 70 6c 6f 74 27 2c 20 | 27 77 27 2c 20 70 69 70 |uplot', |'w', pip|
|00001830| 65 6e 75 6d 29 0a 09 50 | 52 49 4e 54 20 2a 2c 27 |enum)..P|RINT *,'|
|00001840| 4f 70 65 6e 65 64 20 67 | 6e 75 70 6c 6f 74 20 70 |Opened g|nuplot p|
|00001850| 69 70 65 20 23 20 27 2c | 20 70 69 70 65 6e 75 6d |ipe # ',| pipenum|
|00001860| 0a 43 0a 43 20 57 72 69 | 74 65 20 73 6f 6d 65 20 |.C.C Wri|te some |
|00001870| 47 6e 75 50 6c 6f 74 20 | 63 6f 6d 6d 61 6e 64 73 |GnuPlot |commands|
|00001880| 0a 43 0a 09 43 41 4c 4c | 20 70 6c 77 72 69 74 28 |.C..CALL| plwrit(|
|00001890| 70 69 70 65 6e 75 6d 2c | 20 27 73 65 74 20 64 20 |pipenum,| 'set d |
|000018a0| 73 20 6c 27 29 0a 09 43 | 41 4c 4c 20 70 6c 77 72 |s l')..C|ALL plwr|
|000018b0| 69 74 28 70 69 70 65 6e | 75 6d 2c 20 27 70 6c 6f |it(pipen|um, 'plo|
|000018c0| 74 20 73 69 6e 28 78 29 | 27 29 0a 43 0a 43 20 46 |t sin(x)|').C.C F|
|000018d0| 6c 75 73 68 20 74 68 65 | 20 6f 75 74 70 75 74 20 |lush the| output |
|000018e0| 73 6f 20 74 68 61 74 20 | 77 65 20 77 69 6c 6c 20 |so that |we will |
|000018f0| 73 65 65 20 74 68 65 20 | 67 72 61 70 68 0a 43 0a |see the |graph.C.|
|00001900| 09 43 41 4c 4c 20 70 6c | 66 6c 75 73 28 70 69 70 |.CALL pl|flus(pip|
|00001910| 65 6e 75 6d 29 0a 43 0a | 43 20 57 61 69 74 20 66 |enum).C.|C Wait f|
|00001920| 6f 72 20 74 68 65 20 75 | 73 65 72 2e 0a 43 0a 09 |or the u|ser..C..|
|00001930| 50 52 49 4e 54 20 2a 2c | 27 45 6e 74 65 72 20 61 |PRINT *,|'Enter a|
|00001940| 20 63 68 61 72 61 63 74 | 65 72 20 61 6e 64 20 70 | charact|er and p|
|00001950| 72 65 73 73 20 72 65 74 | 75 72 6e 2e 27 0a 09 52 |ress ret|urn.'..R|
|00001960| 45 41 44 20 2a 2c 64 75 | 6d 6d 79 0a 43 0a 43 20 |EAD *,du|mmy.C.C |
|00001970| 43 6c 6f 73 65 20 74 68 | 65 20 70 69 70 65 0a 43 |Close th|e pipe.C|
|00001980| 0a 09 43 41 4c 4c 20 70 | 6c 63 6c 6f 73 28 70 69 |..CALL p|lclos(pi|
|00001990| 70 65 6e 75 6d 29 0a 43 | 0a 09 45 4e 44 0a 5c 65 |penum).C|..END.\e|
|000019a0| 6e 64 7b 76 65 72 62 61 | 74 69 6d 7d 0a 0a 5c 65 |nd{verba|tim}..\e|
|000019b0| 6e 64 7b 64 6f 63 75 6d | 65 6e 74 7d 0a 2d 2d 2d |nd{docum|ent}.---|
|000019c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000019d0| 2d 2d 2d 2d 2d 45 6e 64 | 20 6f 66 20 4c 61 54 65 |-----End| of LaTe|
|000019e0| 58 20 44 6f 63 73 2c 20 | 43 75 74 20 68 65 72 65 |X Docs, |Cut here|
|000019f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001a00| 2d 2d 2d 0a 2d 2d 0a 53 | 69 6d 6f 6e 20 43 6c 69 |---.--.S|imon Cli|
|00001a10| 66 74 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |ft | |
|00001a20| 20 20 20 20 20 20 7c 20 | 22 57 69 66 65 20 69 73 | | |"Wife is|
|00001a30| 20 6d 79 20 73 74 61 74 | 75 73 2c 20 6e 6f 74 20 | my stat|us, not |
|00001a40| 6d 79 20 6a 6f 62 20 64 | 65 73 63 72 69 70 74 69 |my job d|escripti|
|00001a50| 6f 6e 2e 22 20 0a 53 63 | 69 65 6e 74 69 66 69 63 |on." .Sc|ientific|
|00001a60| 20 43 6f 6d 70 75 74 61 | 74 69 6f 6e 20 47 72 6f | Computa|tion Gro|
|00001a70| 75 70 20 20 20 7c 20 20 | 20 20 20 20 20 20 20 20 |up | | |
|00001a80| 20 20 20 20 20 20 20 20 | 20 20 20 20 4b 61 72 65 | | Kare|
|00001a90| 6e 20 43 6c 69 66 74 0a | 44 65 70 61 72 74 6d 65 |n Clift.|Departme|
|00001aa0| 6e 74 20 6f 66 20 43 6f | 6d 70 75 74 65 72 20 53 |nt of Co|mputer S|
|00001ab0| 63 69 65 6e 63 65 20 0a | 55 6e 69 76 65 72 73 69 |cience .|Universi|
|00001ac0| 74 79 20 6f 66 20 57 61 | 74 65 72 6c 6f 6f 2c 20 |ty of Wa|terloo, |
|00001ad0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001ae0| 20 20 20 20 20 73 73 63 | 6c 69 66 74 40 6e 65 75 | ssc|lift@neu|
|00001af0| 6d 61 6e 6e 2e 75 77 61 | 74 65 72 6c 6f 6f 2e 63 |mann.uwa|terloo.c|
|00001b00| 61 0a 57 61 74 65 72 6c | 6f 6f 2c 20 4f 6e 74 61 |a.Waterl|oo, Onta|
|00001b10| 72 69 6f 2c 20 4e 32 4c | 20 33 47 31 20 20 20 20 |rio, N2L| 3G1 |
|00001b20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 28 | | (|
|00001b30| 35 31 39 29 20 38 38 35 | 2d 31 32 31 31 20 78 33 |519) 885|-1211 x3|
|00001b40| 34 36 39 0a | |469. | |
+--------+-------------------------+-------------------------+--------+--------+