home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / DOCS / GCCDOC / DOC / LIB-CARD.TEX < prev    next >
LaTeX Document  |  1991-09-24  |  66.7 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: LaTeX Document (document/latex).

You can browse this item here: LIB-CARD.TEX

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
100% dexvert Texinfo Document (document/texInfo) 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 TeX document text default
99% file LaTeX document, ASCII text default
100% perlTextCheck Likely Text (Perl) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime text/x-matlab default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000010| 25 25 25 25 25 25 25 25 | 25 25 25 25 20 2d 2a 2d |%%%%%%%%|%%%% -*-|
|00000020| 20 4d 6f 64 65 3a 20 54 | 65 58 20 2d 2a 2d 20 25 | Mode: T|eX -*- %|
|00000030| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000040| 25 25 25 25 25 25 25 25 | 25 0a 25 25 20 6c 69 62 |%%%%%%%%|%.%% lib|
|00000050| 2d 63 61 72 64 2e 74 65 | 78 20 2d 2d 20 52 65 66 |-card.te|x -- Ref|
|00000060| 65 72 65 6e 63 65 20 43 | 61 72 64 20 66 6f 72 20 |erence C|ard for |
|00000070| 41 74 61 72 69 20 53 54 | 20 47 4e 55 20 43 20 4c |Atari ST| GNU C L|
|00000080| 69 62 72 61 72 79 20 46 | 75 6e 63 74 69 6f 6e 73 |ibrary F|unctions|
|00000090| 0a 25 25 09 09 20 20 20 | 54 68 69 73 20 66 69 6c |.%%.. |This fil|
|000000a0| 65 20 69 73 20 74 6f 20 | 62 65 20 70 72 6f 63 65 |e is to |be proce|
|000000b0| 73 73 65 64 20 62 79 20 | 70 6c 61 69 6e 20 54 65 |ssed by |plain Te|
|000000c0| 58 2e 0a 25 25 0a 25 25 | 20 43 6f 70 79 72 69 67 |X..%%.%%| Copyrig|
|000000d0| 68 74 20 28 43 29 20 31 | 39 39 30 2c 31 39 39 31 |ht (C) 1|990,1991|
|000000e0| 09 46 72 61 6e 6b 20 52 | 69 64 64 65 72 62 75 73 |.Frank R|idderbus|
|000000f0| 63 68 0a 25 25 0a 25 25 | 20 54 68 69 73 20 74 65 |ch.%%.%%| This te|
|00000100| 78 74 20 69 73 20 66 72 | 65 65 20 73 6f 66 74 77 |xt is fr|ee softw|
|00000110| 61 72 65 3b 20 79 6f 75 | 20 63 61 6e 20 72 65 64 |are; you| can red|
|00000120| 69 73 74 72 69 62 75 74 | 65 20 69 74 20 61 6e 64 |istribut|e it and|
|00000130| 2f 6f 72 20 6d 6f 64 69 | 66 79 0a 25 25 20 69 74 |/or modi|fy.%% it|
|00000140| 20 75 6e 64 65 72 20 74 | 68 65 20 74 65 72 6d 73 | under t|he terms|
|00000150| 20 6f 66 20 74 68 65 20 | 47 4e 55 20 47 65 6e 65 | of the |GNU Gene|
|00000160| 72 61 6c 20 50 75 62 6c | 69 63 20 4c 69 63 65 6e |ral Publ|ic Licen|
|00000170| 73 65 20 61 73 20 70 75 | 62 6c 69 73 68 65 64 20 |se as pu|blished |
|00000180| 62 79 0a 25 25 20 74 68 | 65 20 46 72 65 65 20 53 |by.%% th|e Free S|
|00000190| 6f 66 74 77 61 72 65 20 | 46 6f 75 6e 64 61 74 69 |oftware |Foundati|
|000001a0| 6f 6e 3b 20 65 69 74 68 | 65 72 20 76 65 72 73 69 |on; eith|er versi|
|000001b0| 6f 6e 20 31 2c 20 6f 72 | 20 61 6e 79 20 6c 61 74 |on 1, or| any lat|
|000001c0| 65 72 20 76 65 72 73 69 | 6f 6e 2e 0a 25 25 20 0a |er versi|on..%% .|
|000001d0| 25 25 20 54 68 69 73 20 | 70 72 6f 67 72 61 6d 20 |%% This |program |
|000001e0| 28 74 65 78 74 29 20 69 | 73 20 64 69 73 74 72 69 |(text) i|s distri|
|000001f0| 62 75 74 65 64 20 69 6e | 20 74 68 65 20 68 6f 70 |buted in| the hop|
|00000200| 65 20 74 68 61 74 20 69 | 74 20 77 69 6c 6c 20 62 |e that i|t will b|
|00000210| 65 20 75 73 65 66 75 6c | 2c 0a 25 25 20 62 75 74 |e useful|,.%% but|
|00000220| 20 57 49 54 48 4f 55 54 | 20 41 4e 59 20 57 41 52 | WITHOUT| ANY WAR|
|00000230| 52 41 4e 54 59 3b 20 77 | 69 74 68 6f 75 74 20 65 |RANTY; w|ithout e|
|00000240| 76 65 6e 20 74 68 65 20 | 69 6d 70 6c 69 65 64 20 |ven the |implied |
|00000250| 77 61 72 72 61 6e 74 79 | 20 6f 66 0a 25 25 20 4d |warranty| of.%% M|
|00000260| 45 52 43 48 41 4e 54 41 | 42 49 4c 49 54 59 20 6f |ERCHANTA|BILITY o|
|00000270| 72 20 46 49 54 4e 45 53 | 53 20 46 4f 52 20 41 20 |r FITNES|S FOR A |
|00000280| 50 41 52 54 49 43 55 4c | 41 52 20 50 55 52 50 4f |PARTICUL|AR PURPO|
|00000290| 53 45 2e 20 20 53 65 65 | 20 74 68 65 0a 25 25 20 |SE. See| the.%% |
|000002a0| 47 4e 55 20 47 65 6e 65 | 72 61 6c 20 50 75 62 6c |GNU Gene|ral Publ|
|000002b0| 69 63 20 4c 69 63 65 6e | 73 65 20 66 6f 72 20 6d |ic Licen|se for m|
|000002c0| 6f 72 65 20 64 65 74 61 | 69 6c 73 2e 0a 25 25 20 |ore deta|ils..%% |
|000002d0| 0a 25 25 20 41 64 64 69 | 74 69 6f 6e 61 6c 2c 20 |.%% Addi|tional, |
|000002e0| 49 20 64 65 63 6c 61 72 | 65 20 74 68 69 73 20 72 |I declar|e this r|
|000002f0| 65 66 65 72 65 6e 63 65 | 20 63 61 72 64 20 70 6f |eference| card po|
|00000300| 73 74 63 61 72 64 77 61 | 72 65 2e 20 49 66 20 79 |stcardwa|re. If y|
|00000310| 6f 75 20 66 69 6e 64 0a | 25 25 20 74 68 69 73 20 |ou find.|%% this |
|00000320| 72 65 66 65 72 65 6e 63 | 65 20 63 61 72 64 20 75 |referenc|e card u|
|00000330| 73 65 66 75 6c 6c 2c 20 | 70 6c 65 61 73 65 20 73 |sefull, |please s|
|00000340| 65 6e 64 20 61 20 73 69 | 6d 70 6c 65 20 70 6f 73 |end a si|mple pos|
|00000350| 74 63 61 72 64 20 74 6f | 20 74 68 65 0a 25 25 20 |tcard to| the.%% |
|00000360| 61 64 64 72 65 73 73 20 | 6d 65 6e 74 69 6f 6e 65 |address |mentione|
|00000370| 64 20 62 65 6c 6f 77 2e | 0a 25 25 0a 25 25 20 41 |d below.|.%%.%% A|
|00000380| 75 74 68 6f 72 20 20 20 | 20 20 20 20 20 20 20 3a |uthor | :|
|00000390| 20 46 72 61 6e 6b 20 52 | 69 64 64 65 72 62 75 73 | Frank R|idderbus|
|000003a0| 63 68 0a 25 25 20 43 72 | 65 61 74 65 64 20 4f 6e |ch.%% Cr|eated On|
|000003b0| 20 20 20 20 20 20 3a 20 | 4d 6f 6e 20 4d 61 72 20 | : |Mon Mar |
|000003c0| 31 32 20 31 30 3a 35 35 | 3a 33 38 20 31 39 39 30 |12 10:55|:38 1990|
|000003d0| 0a 25 25 20 4c 61 73 74 | 20 4d 6f 64 69 66 69 65 |.%% Last| Modifie|
|000003e0| 64 20 42 79 3a 20 46 72 | 61 6e 6b 20 52 69 64 64 |d By: Fr|ank Ridd|
|000003f0| 65 72 62 75 73 63 68 0a | 25 25 20 4c 61 73 74 20 |erbusch.|%% Last |
|00000400| 4d 6f 64 69 66 69 65 64 | 20 4f 6e 3a 20 53 75 6e |Modified| On: Sun|
|00000410| 20 4d 61 79 20 31 39 20 | 31 33 3a 31 30 3a 30 30 | May 19 |13:10:00|
|00000420| 20 31 39 39 31 0a 25 25 | 20 55 70 64 61 74 65 20 | 1991.%%| Update |
|00000430| 43 6f 75 6e 74 20 20 20 | 20 3a 20 31 31 34 0a 25 |Count | : 114.%|
|00000440| 25 20 53 74 61 74 75 73 | 20 20 20 20 20 20 20 20 |% Status| |
|00000450| 20 20 3a 20 52 65 6c 65 | 61 73 65 64 2e 0a 25 25 | : Rele|ased..%%|
|00000460| 20 43 4f 4d 4d 45 4e 54 | 53 0a 25 25 20 20 20 20 | COMMENT|S.%% |
|00000470| 54 68 65 20 6d 61 74 68 | 65 6d 61 74 69 63 61 6c |The math|ematical|
|00000480| 20 66 75 6e 63 74 69 6f | 6e 20 73 65 63 74 69 6f | functio|n sectio|
|00000490| 6e 20 63 6f 75 6c 64 20 | 74 61 6b 65 20 73 6f 6d |n could |take som|
|000004a0| 65 20 61 64 64 69 74 69 | 6f 6e 61 6c 0a 25 25 20 |e additi|onal.%% |
|000004b0| 20 20 20 65 78 70 6c 61 | 6e 61 74 69 6f 6e 73 2c | expla|nations,|
|000004c0| 20 62 75 74 20 74 68 65 | 6e 20 49 27 6d 20 61 66 | but the|n I'm af|
|000004d0| 72 61 69 64 20 49 27 76 | 65 20 74 6f 20 66 69 6c |raid I'v|e to fil|
|000004e0| 6c 20 61 6e 6f 74 68 65 | 72 20 63 6f 6d 70 6c 65 |l anothe|r comple|
|000004f0| 74 65 0a 25 25 20 20 20 | 20 70 61 67 65 20 28 31 |te.%% | page (1|
|00000500| 32 20 70 61 67 65 73 20 | 61 6b 61 20 32 34 20 63 |2 pages |aka 24 c|
|00000510| 6f 6c 75 6d 6e 73 20 69 | 73 20 71 75 69 74 65 20 |olumns i|s quite |
|00000520| 65 6e 6f 75 67 68 29 2e | 20 41 6c 73 6f 20 73 6f |enough).| Also so|
|00000530| 6d 65 0a 25 25 20 20 20 | 20 66 75 6e 63 74 69 6f |me.%% | functio|
|00000540| 6e 73 20 69 6e 20 74 68 | 65 20 73 69 67 6e 61 6c |ns in th|e signal|
|00000550| 73 20 73 65 63 74 69 6f | 6e 20 61 72 65 20 6d 69 |s sectio|n are mi|
|00000560| 73 73 69 6e 67 20 61 20 | 65 78 70 6c 61 6e 61 74 |ssing a |explanat|
|00000570| 69 6f 6e 2e 20 54 68 65 | 0a 25 25 20 20 20 20 6d |ion. The|.%% m|
|00000580| 6f 74 69 76 61 74 69 6f | 6e 20 62 65 68 69 6e 64 |otivatio|n behind|
|00000590| 20 74 68 69 73 20 72 6f | 75 74 69 6e 65 73 20 69 | this ro|utines i|
|000005a0| 73 20 6e 6f 74 20 31 30 | 30 25 20 63 6c 65 61 72 |s not 10|0% clear|
|000005b0| 20 74 6f 20 6d 65 2e 20 | 46 6f 72 0a 25 25 20 20 | to me. |For.%% |
|000005c0| 20 20 61 64 64 69 74 6f | 6e 61 6c 20 68 69 6e 74 | addito|nal hint|
|000005d0| 73 20 61 62 6f 75 74 20 | 74 68 69 73 20 6d 75 6c |s about |this mul|
|000005e0| 74 69 63 6f 6c 75 6d 6e | 20 66 6f 72 6d 61 74 20 |ticolumn| format |
|000005f0| 73 65 65 20 74 68 65 20 | 63 6f 6d 6d 65 6e 74 20 |see the |comment |
|00000600| 69 6e 0a 25 25 20 20 20 | 20 74 68 65 20 66 69 6c |in.%% | the fil|
|00000610| 65 20 76 61 72 6d 61 63 | 72 6f 2e 74 65 78 2e 0a |e varmac|ro.tex..|
|00000620| 25 25 20 48 49 53 54 4f | 52 59 20 0a 25 25 20 31 |%% HISTO|RY .%% 1|
|00000630| 38 2d 4d 61 79 2d 31 39 | 39 31 09 09 46 72 61 6e |8-May-19|91..Fran|
|00000640| 6b 20 52 69 64 64 65 72 | 62 75 73 63 68 09 0a 25 |k Ridder|busch..%|
|00000650| 25 20 20 20 20 4c 61 73 | 74 20 4d 6f 64 69 66 69 |% Las|t Modifi|
|00000660| 65 64 3a 20 53 61 74 20 | 4d 61 79 20 31 38 20 31 |ed: Sat |May 18 1|
|00000670| 33 3a 30 39 3a 32 32 20 | 31 39 39 31 20 23 31 31 |3:09:22 |1991 #11|
|00000680| 30 20 28 6e 69 6c 29 0a | 25 25 20 20 20 20 55 70 |0 (nil).|%% Up|
|00000690| 64 61 74 65 64 20 74 6f | 20 6d 61 74 63 68 20 4a |dated to| match J|
|000006a0| 2e 52 2e 42 61 6d 6d 69 | 27 73 20 72 65 63 65 6e |.R.Bammi|'s recen|
|000006b0| 74 20 73 65 6e 74 20 64 | 69 66 66 73 2e 20 49 6e |t sent d|iffs. In|
|000006c0| 63 6c 75 73 69 6f 6e 20 | 6f 66 0a 25 25 20 20 20 |clusion |of.%% |
|000006d0| 20 4d 69 4e 54 20 61 6e | 64 20 54 54 20 73 74 75 | MiNT an|d TT stu|
|000006e0| 66 66 2e 20 28 4c 69 62 | 72 61 72 69 65 73 20 61 |ff. (Lib|raries a|
|000006f0| 6e 64 20 68 65 61 64 65 | 72 73 20 61 74 20 70 61 |nd heade|rs at pa|
|00000700| 74 63 68 6c 65 76 65 6c | 20 36 35 29 0a 25 25 20 |tchlevel| 65).%% |
|00000710| 32 2d 4d 61 79 2d 31 39 | 39 31 09 09 46 72 61 6e |2-May-19|91..Fran|
|00000720| 6b 20 52 69 64 64 65 72 | 62 75 73 63 68 20 54 33 |k Ridder|busch T3|
|00000730| 35 09 0a 25 25 20 20 20 | 20 4e 6f 77 20 75 73 65 |5..%% | Now use|
|00000740| 73 20 76 61 72 6d 61 63 | 72 6f 2e 74 65 78 20 66 |s varmac|ro.tex f|
|00000750| 6f 72 20 61 6c 6c 20 6d | 61 63 72 6f 73 2e 20 44 |or all m|acros. D|
|00000760| 65 66 69 6e 69 74 69 6f | 6e 73 20 66 72 6f 6d 20 |efinitio|ns from |
|00000770| 74 68 69 73 20 66 69 6c | 65 0a 25 25 20 20 20 20 |this fil|e.%% |
|00000780| 68 61 76 65 20 62 65 65 | 6e 20 6d 6f 76 65 64 20 |have bee|n moved |
|00000790| 74 6f 20 74 68 61 74 20 | 66 69 6c 65 2e 20 4e 6f |to that |file. No|
|000007a0| 77 20 75 73 69 6e 67 20 | 5c 66 75 6e 63 74 69 6f |w using |\functio|
|000007b0| 6e 20 69 6e 73 74 65 61 | 64 20 6f 66 0a 25 25 20 |n instea|d of.%% |
|000007c0| 20 20 20 5c 66 75 6e 63 | 20 61 6e 64 20 5c 6c 66 | \func| and \lf|
|000007d0| 75 6e 63 2e 0a 25 25 20 | 31 36 2d 4e 6f 76 2d 31 |unc..%% |16-Nov-1|
|000007e0| 39 39 30 09 09 46 72 61 | 6e 6b 20 52 69 64 64 65 |990..Fra|nk Ridde|
|000007f0| 72 62 75 73 63 68 0a 25 | 25 20 20 20 20 47 6f 74 |rbusch.%|% Got|
|00000800| 20 33 20 63 6f 6c 75 6d | 6e 73 20 66 6f 72 6d 61 | 3 colum|ns forma|
|00000810| 74 20 77 6f 72 6b 69 6e | 67 20 61 6e 64 20 6e 65 |t workin|g and ne|
|00000820| 77 20 69 6e 63 6c 75 64 | 65 20 70 72 65 73 65 6e |w includ|e presen|
|00000830| 74 61 74 69 6f 6e 0a 25 | 25 20 20 32 2d 4d 61 79 |tation.%|% 2-May|
|00000840| 2d 31 39 39 30 09 09 46 | 72 61 6e 6b 20 52 69 64 |-1990..F|rank Rid|
|00000850| 64 65 72 62 75 73 63 68 | 0a 25 25 20 20 20 20 46 |derbusch|.%% F|
|00000860| 69 64 64 6c 69 6e 67 20 | 77 69 74 68 20 74 68 65 |iddling |with the|
|00000870| 20 66 6f 72 6d 61 74 20 | 61 6e 64 20 69 6e 73 65 | format |and inse|
|00000880| 72 74 61 74 69 6f 6e 20 | 6f 66 20 73 79 73 76 61 |rtation |of sysva|
|00000890| 72 73 0a 25 25 20 20 31 | 2d 4d 61 79 2d 31 39 39 |rs.%% 1|-May-199|
|000008a0| 30 09 09 46 72 61 6e 6b | 20 52 69 64 64 65 72 62 |0..Frank| Ridderb|
|000008b0| 75 73 63 68 0a 25 25 20 | 20 20 20 49 6e 73 65 72 |usch.%% | Inser|
|000008c0| 74 69 6e 67 20 72 65 6d | 61 72 6b 73 20 61 62 6f |ting rem|arks abo|
|000008d0| 75 74 20 66 67 65 74 73 | 20 61 6e 64 20 67 65 74 |ut fgets| and get|
|000008e0| 73 20 63 6f 6e 63 65 72 | 6e 69 6e 67 20 74 68 65 |s concer|ning the|
|000008f0| 20 4e 4c 20 63 68 61 72 | 61 63 74 65 72 2e 0a 25 | NL char|acter..%|
|00000900| 25 20 32 39 2d 41 70 72 | 2d 31 39 39 30 09 09 46 |% 29-Apr|-1990..F|
|00000910| 72 61 6e 6b 20 52 69 64 | 64 65 72 62 75 73 63 68 |rank Rid|derbusch|
|00000920| 0a 25 25 20 20 20 20 49 | 6e 63 6c 75 64 69 6e 67 |.%% I|ncluding|
|00000930| 20 74 68 65 20 76 74 35 | 32 20 65 73 63 61 70 65 | the vt5|2 escape|
|00000940| 20 73 65 71 75 65 6e 63 | 65 73 0a 25 25 20 32 34 | sequenc|es.%% 24|
|00000950| 2d 41 70 72 2d 31 39 39 | 30 09 09 4a 77 61 68 61 |-Apr-199|0..Jwaha|
|00000960| 72 20 52 2e 20 42 61 6d | 6d 69 0a 25 25 20 20 20 |r R. Bam|mi.%% |
|00000970| 20 43 6f 72 72 65 63 74 | 69 6f 6e 73 20 26 20 61 | Correct|ions & a|
|00000980| 64 64 69 74 69 6f 6e 61 | 6c 20 66 75 6e 63 74 69 |dditiona|l functi|
|00000990| 6f 6e 73 20 28 6c 69 6e | 65 61 2c 20 6c 73 74 61 |ons (lin|ea, lsta|
|000009a0| 74 2c 20 70 72 6f 66 69 | 6c 69 6e 67 2c 20 65 74 |t, profi|ling, et|
|000009b0| 63 29 0a 25 25 20 31 31 | 2d 4d 61 72 2d 31 39 39 |c).%% 11|-Mar-199|
|000009c0| 30 20 20 20 20 20 20 20 | 20 20 20 46 72 61 6e 6b |0 | Frank|
|000009d0| 20 52 69 64 64 65 72 62 | 75 73 63 68 0a 25 25 20 | Ridderb|usch.%% |
|000009e0| 20 20 20 53 74 61 72 74 | 69 6e 67 20 70 6f 69 6e | Start|ing poin|
|000009f0| 74 2e 20 43 72 65 61 74 | 69 6e 67 20 6d 61 63 72 |t. Creat|ing macr|
|00000a00| 6f 73 20 5c 66 75 6e 63 | 2e 20 5c 6c 66 75 6e 63 |os \func|. \lfunc|
|00000a10| 20 61 6e 64 20 5c 65 78 | 70 6c 2e 0a 25 25 0a 25 | and \ex|pl..%%.%|
|00000a20| 25 20 20 20 20 50 6c 65 | 61 73 65 20 73 65 6e 64 |% Ple|ase send|
|00000a30| 20 61 6e 79 20 63 6f 6d | 6d 65 6e 74 73 20 61 62 | any com|ments ab|
|00000a40| 6f 75 74 20 6d 69 73 73 | 69 6e 67 20 66 65 61 74 |out miss|ing feat|
|00000a50| 75 72 65 73 20 6f 72 20 | 74 68 69 6e 67 73 20 74 |ures or |things t|
|00000a60| 6f 0a 25 25 20 20 20 20 | 69 6e 63 6c 75 64 65 20 |o.%% |include |
|00000a70| 74 6f 3a 0a 25 25 20 20 | 20 20 45 6d 61 69 6c 3a |to:.%% | Email:|
|00000a80| 0a 25 25 09 72 69 64 64 | 65 72 62 75 73 63 68 2e |.%%.ridd|erbusch.|
|00000a90| 6b 64 40 73 6e 69 2d 75 | 73 61 2e 63 6f 6d 20 28 |kd@sni-u|sa.com (|
|00000aa0| 41 6d 65 72 69 63 61 20 | 28 4e 6f 72 74 68 20 26 |America |(North &|
|00000ab0| 20 53 6f 75 74 68 29 29 | 0a 25 25 20 20 20 20 20 | South))|.%% |
|00000ac0| 20 72 69 64 64 65 72 62 | 75 73 63 68 2e 6b 64 40 | ridderb|usch.kd@|
|00000ad0| 73 6e 69 2e 64 65 20 20 | 20 20 20 20 28 52 65 73 |sni.de | (Res|
|00000ae0| 74 20 6f 66 20 57 6f 72 | 6c 64 29 0a 25 25 0a 25 |t of Wor|ld).%%.%|
|00000af0| 25 20 20 20 20 53 6e 61 | 69 6c 3a 0a 25 25 09 46 |% Sna|il:.%%.F|
|00000b00| 72 61 6e 6b 20 52 69 64 | 64 65 72 62 75 73 63 68 |rank Rid|derbusch|
|00000b10| 09 54 65 6c 2e 3a 20 28 | 30 34 39 29 2d 35 32 35 |.Tel.: (|049)-525|
|00000b20| 34 20 36 37 30 36 36 0a | 25 25 09 53 61 6e 64 65 |4 67066.|%%.Sande|
|00000b30| 72 20 53 74 72 2e 20 31 | 37 0a 25 25 09 57 2d 34 |r Str. 1|7.%%.W-4|
|00000b40| 37 39 30 20 50 61 64 65 | 72 62 6f 72 6e 0a 25 25 |790 Pade|rborn.%%|
|00000b50| 09 47 65 72 6d 61 6e 79 | 0a 25 25 25 25 25 25 25 |.Germany|.%%%%%%%|
|00000b60| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000b70| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000b80| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000b90| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000ba0| 25 25 25 25 25 25 25 25 | 0a 0a 25 20 52 65 66 65 |%%%%%%%%|..% Refe|
|00000bb0| 72 65 6e 63 65 20 43 61 | 72 64 20 66 6f 72 20 47 |rence Ca|rd for G|
|00000bc0| 4e 55 20 43 20 4c 69 62 | 72 61 72 79 20 6f 6e 20 |NU C Lib|rary on |
|00000bd0| 74 68 65 20 41 74 61 72 | 69 20 53 54 0a 25 2a 2a |the Atar|i ST.%**|
|00000be0| 73 74 61 72 74 20 6f 66 | 20 68 65 61 64 65 72 0a |start of| header.|
|00000bf0| 5c 6e 65 77 63 6f 75 6e | 74 5c 63 6f 6c 75 6d 6e |\newcoun|t\column|
|00000c00| 73 70 65 72 70 61 67 65 | 0a 0a 25 20 54 68 69 73 |sperpage|..% This|
|00000c10| 20 66 69 6c 65 20 63 61 | 6e 20 62 65 20 70 72 69 | file ca|n be pri|
|00000c20| 6e 74 65 64 20 77 69 74 | 68 20 31 2c 20 32 2c 20 |nted wit|h 1, 2, |
|00000c30| 6f 72 20 33 20 63 6f 6c | 75 6d 6e 73 20 70 65 72 |or 3 col|umns per|
|00000c40| 20 70 61 67 65 20 28 73 | 65 65 20 62 65 6c 6f 77 | page (s|ee below|
|00000c50| 29 2e 0a 25 20 53 70 65 | 63 69 66 79 20 68 6f 77 |)..% Spe|cify how|
|00000c60| 20 6d 61 6e 79 20 79 6f | 75 20 77 61 6e 74 20 68 | many yo|u want h|
|00000c70| 65 72 65 2e 20 20 4e 6f | 74 68 69 6e 67 20 65 6c |ere. No|thing el|
|00000c80| 73 65 20 6e 65 65 64 73 | 20 74 6f 20 62 65 20 63 |se needs| to be c|
|00000c90| 68 61 6e 67 65 64 2e 0a | 0a 5c 63 6f 6c 75 6d 6e |hanged..|.\column|
|00000ca0| 73 70 65 72 70 61 67 65 | 3d 32 0a 0a 5c 64 65 66 |sperpage|=2..\def|
|00000cb0| 5c 76 65 72 73 69 6f 6e | 6e 75 6d 62 65 72 7b 32 |\version|number{2|
|00000cc0| 2e 30 7d 0a 5c 64 65 66 | 5c 79 65 61 72 7b 31 39 |.0}.\def|\year{19|
|00000cd0| 39 31 7d 0a 5c 64 65 66 | 5c 76 65 72 73 69 6f 6e |91}.\def|\version|
|00000ce0| 7b 4d 61 79 20 5c 79 65 | 61 72 5c 20 76 5c 76 65 |{May \ye|ar\ v\ve|
|00000cf0| 72 73 69 6f 6e 6e 75 6d | 62 65 72 7d 0a 0a 5c 64 |rsionnum|ber}..\d|
|00000d00| 65 66 5c 73 68 6f 72 74 | 63 6f 70 79 72 69 67 68 |ef\short|copyrigh|
|00000d10| 74 6e 6f 74 69 63 65 7b | 5c 76 73 6b 69 70 20 31 |tnotice{|\vskip 1|
|00000d20| 65 78 20 70 6c 75 73 20 | 32 20 66 69 6c 6c 0a 20 |ex plus |2 fill. |
|00000d30| 20 5c 63 65 6e 74 65 72 | 6c 69 6e 65 7b 5c 73 6d | \center|line{\sm|
|00000d40| 61 6c 6c 20 5c 63 6f 70 | 79 72 69 67 68 74 5c 20 |all \cop|yright\ |
|00000d50| 5c 79 65 61 72 5c 20 46 | 72 61 6e 6b 20 52 69 64 |\year\ F|rank Rid|
|00000d60| 64 65 72 62 75 73 63 68 | 0a 20 20 50 65 72 6d 69 |derbusch|. Permi|
|00000d70| 73 73 69 6f 6e 73 20 6f | 6e 20 62 61 63 6b 2e 20 |ssions o|n back. |
|00000d80| 20 76 5c 76 65 72 73 69 | 6f 6e 6e 75 6d 62 65 72 | v\versi|onnumber|
|00000d90| 7d 7d 0a 0a 5c 64 65 66 | 5c 63 6f 70 79 72 69 67 |}}..\def|\copyrig|
|00000da0| 68 74 6e 6f 74 69 63 65 | 7b 0a 5c 76 73 6b 69 70 |htnotice|{.\vskip|
|00000db0| 20 31 65 78 20 70 6c 75 | 73 20 32 20 66 69 6c 6c | 1ex plu|s 2 fill|
|00000dc0| 5c 62 65 67 69 6e 67 72 | 6f 75 70 5c 73 6d 61 6c |\begingr|oup\smal|
|00000dd0| 6c 0a 5c 63 65 6e 74 65 | 72 6c 69 6e 65 7b 43 6f |l.\cente|rline{Co|
|00000de0| 70 79 72 69 67 68 74 20 | 5c 63 6f 70 79 72 69 67 |pyright |\copyrig|
|00000df0| 68 74 5c 20 5c 79 65 61 | 72 5c 20 46 72 61 6e 6b |ht\ \yea|r\ Frank|
|00000e00| 20 52 69 64 64 65 72 62 | 75 73 63 68 7d 0a 5c 63 | Ridderb|usch}.\c|
|00000e10| 65 6e 74 65 72 6c 69 6e | 65 7b 54 68 69 73 20 6d |enterlin|e{This m|
|00000e20| 75 6c 74 69 63 6f 6c 75 | 6d 6e 20 66 6f 72 6d 61 |ulticolu|mn forma|
|00000e30| 74 20 77 61 73 20 6f 72 | 69 67 69 6e 61 6c 6c 79 |t was or|iginally|
|00000e40| 20 64 65 73 69 67 6e 65 | 64 7d 0a 5c 63 65 6e 74 | designe|d}.\cent|
|00000e50| 65 72 6c 69 6e 65 7b 62 | 79 20 53 74 65 70 68 65 |erline{b|y Stephe|
|00000e60| 6e 20 47 69 6c 64 65 61 | 20 61 6e 64 20 6d 6f 64 |n Gildea| and mod|
|00000e70| 69 66 69 65 64 20 74 6f | 20 66 69 74 20 74 68 65 |ified to| fit the|
|00000e80| 20 41 74 61 72 69 20 53 | 54 7d 0a 5c 63 65 6e 74 | Atari S|T}.\cent|
|00000e90| 65 72 6c 69 6e 65 7b 6c | 69 62 72 61 72 79 20 66 |erline{l|ibrary f|
|00000ea0| 75 6e 63 74 69 6f 6e 73 | 20 62 79 20 46 72 61 6e |unctions| by Fran|
|00000eb0| 6b 20 52 69 64 64 65 72 | 62 75 73 63 68 7d 0a 0a |k Ridder|busch}..|
|00000ec0| 50 65 72 6d 69 73 73 69 | 6f 6e 20 69 73 20 67 72 |Permissi|on is gr|
|00000ed0| 61 6e 74 65 64 20 74 6f | 20 6d 61 6b 65 20 61 6e |anted to| make an|
|00000ee0| 64 20 64 69 73 74 72 69 | 62 75 74 65 20 63 6f 70 |d distri|bute cop|
|00000ef0| 69 65 73 20 6f 66 0a 74 | 68 69 73 20 63 61 72 64 |ies of.t|his card|
|00000f00| 20 70 72 6f 76 69 64 65 | 64 20 74 68 65 20 63 6f | provide|d the co|
|00000f10| 70 79 72 69 67 68 74 20 | 6e 6f 74 69 63 65 20 61 |pyright |notice a|
|00000f20| 6e 64 20 74 68 69 73 20 | 70 65 72 6d 69 73 73 69 |nd this |permissi|
|00000f30| 6f 6e 20 6e 6f 74 69 63 | 65 0a 61 72 65 20 70 72 |on notic|e.are pr|
|00000f40| 65 73 65 72 76 65 64 20 | 6f 6e 20 61 6c 6c 20 63 |eserved |on all c|
|00000f50| 6f 70 69 65 73 2e 0a 0a | 5c 65 6e 64 67 72 6f 75 |opies...|\endgrou|
|00000f60| 70 7d 0a 0a 5c 69 6e 70 | 75 74 20 76 61 72 6d 61 |p}..\inp|ut varma|
|00000f70| 63 72 6f 0a 0a 5c 6f 76 | 65 72 66 75 6c 6c 72 75 |cro..\ov|erfullru|
|00000f80| 6c 65 3d 30 70 74 20 25 | 20 61 76 6f 69 64 20 75 |le=0pt %| avoid u|
|00000f90| 67 6c 79 20 62 6c 61 63 | 6b 20 62 6f 78 65 73 0a |gly blac|k boxes.|
|00000fa0| 0a 25 2a 2a 65 6e 64 20 | 6f 66 20 68 65 61 64 65 |.%**end |of heade|
|00000fb0| 72 0a 0c 0a 5c 74 69 74 | 6c 65 7b 54 6f 73 2d 2d |r...\tit|le{Tos--|
|00000fc0| 47 4e 55 20 43 20 4c 69 | 62 72 61 72 79 20 46 75 |GNU C Li|brary Fu|
|00000fd0| 6e 63 74 69 6f 6e 73 7d | 0a 0a 54 68 69 73 20 72 |nctions}|..This r|
|00000fe0| 65 66 65 72 65 6e 63 65 | 20 63 61 72 64 20 64 65 |eference| card de|
|00000ff0| 73 63 72 69 62 65 73 20 | 74 68 65 20 61 76 61 69 |scribes |the avai|
|00001000| 6c 61 62 6c 65 20 6c 69 | 62 72 61 72 79 20 66 75 |lable li|brary fu|
|00001010| 6e 63 74 69 6f 6e 73 20 | 6f 66 20 47 4e 55 20 43 |nctions |of GNU C|
|00001020| 0a 6f 6e 20 74 68 65 20 | 41 74 61 72 69 20 53 54 |.on the |Atari ST|
|00001030| 20 61 6e 64 20 69 73 20 | 63 75 72 72 65 6e 74 6c | and is |currentl|
|00001040| 79 20 62 61 73 65 64 20 | 6f 6e 20 74 68 65 20 6c |y based |on the l|
|00001050| 69 62 72 61 72 79 20 66 | 72 6f 6d 0a 4a 77 61 68 |ibrary f|rom.Jwah|
|00001060| 61 72 7e 52 2e 20 42 61 | 6d 6d 69 20 61 74 20 70 |ar~R. Ba|mmi at p|
|00001070| 61 74 63 68 6c 65 76 65 | 6c 20 36 35 2e 20 46 6f |atchleve|l 65. Fo|
|00001080| 72 20 74 68 65 20 6d 6f | 73 74 20 70 61 72 74 20 |r the mo|st part |
|00001090| 74 68 65 20 66 75 6e 63 | 74 69 6f 6e 73 0a 61 72 |the func|tions.ar|
|000010a0| 65 20 61 6c 70 68 61 62 | 65 74 69 63 61 6c 6c 79 |e alphab|etically|
|000010b0| 20 73 6f 72 74 65 64 20 | 62 79 20 66 75 6e 63 74 | sorted |by funct|
|000010c0| 69 6f 6e 20 6e 61 6d 65 | 2e 0a 0a 53 6f 6d 65 20 |ion name|...Some |
|000010d0| 6f 66 20 74 68 65 20 6d | 65 6e 74 69 6f 6e 65 64 |of the m|entioned|
|000010e0| 20 66 75 6e 63 74 69 6f | 6e 73 20 61 72 65 20 6f | functio|ns are o|
|000010f0| 6e 6c 79 20 61 76 61 69 | 6c 61 62 6c 65 2c 20 77 |nly avai|lable, w|
|00001100| 68 65 6e 20 4d 69 4e 54 | 2c 20 74 68 65 20 54 4f |hen MiNT|, the TO|
|00001110| 53 0a 6d 75 6c 74 69 74 | 61 73 6b 69 6e 67 20 65 |S.multit|asking e|
|00001120| 78 74 65 6e 73 69 6f 6e | 20 66 72 6f 6d 20 45 72 |xtension| from Er|
|00001130| 69 63 7e 52 2e 20 53 6d | 69 74 68 20 69 73 20 72 |ic~R. Sm|ith is r|
|00001140| 75 6e 6e 69 6e 67 2c 20 | 6f 72 20 69 66 20 79 6f |unning, |or if yo|
|00001150| 75 0a 68 61 76 65 20 61 | 20 54 54 5c 6e 75 6c 6c |u.have a| TT\null|
|00001160| 2e 20 20 54 68 65 20 65 | 61 72 6c 69 65 72 20 61 |. The e|arlier a|
|00001170| 72 65 20 6d 61 72 6b 65 | 64 20 77 69 74 68 20 60 |re marke|d with `|
|00001180| 60 28 4d 69 4e 54 29 27 | 27 2c 20 74 68 65 20 6c |`(MiNT)'|', the l|
|00001190| 61 74 74 65 72 20 77 69 | 74 68 0a 60 60 28 54 54 |atter wi|th.``(TT|
|000011a0| 29 27 27 2e 5c 70 61 72 | 0a 5c 6d 65 64 73 6b 69 |)''.\par|.\medski|
|000011b0| 70 0a 5c 72 65 77 72 69 | 74 65 74 6f 63 66 69 6c |p.\rewri|tetocfil|
|000011c0| 65 66 61 6c 73 65 0a 5c | 72 65 61 64 74 6f 63 66 |efalse.\|readtocf|
|000011d0| 69 6c 65 0a 5c 6d 65 64 | 73 6b 69 70 0a 41 64 64 |ile.\med|skip.Add|
|000011e0| 69 74 69 6f 6e 61 6c 6c | 79 2c 20 74 68 69 73 20 |itionall|y, this |
|000011f0| 72 65 66 65 72 65 6e 63 | 65 20 63 61 72 64 20 69 |referenc|e card i|
|00001200| 73 20 70 6f 73 74 63 61 | 72 64 77 61 72 65 2e 20 |s postca|rdware. |
|00001210| 49 66 20 79 6f 75 20 66 | 69 6e 64 20 69 74 0a 75 |If you f|ind it.u|
|00001220| 73 65 66 75 6c 6c 2c 20 | 73 65 6e 64 20 61 20 70 |sefull, |send a p|
|00001230| 6f 73 74 63 61 72 64 20 | 74 6f 20 74 68 69 73 20 |ostcard |to this |
|00001240| 61 64 64 72 65 73 73 3a | 20 46 72 61 6e 6b 20 52 |address:| Frank R|
|00001250| 69 64 64 65 72 62 75 73 | 63 68 2c 20 53 61 6e 64 |idderbus|ch, Sand|
|00001260| 65 72 0a 53 74 72 2e 7e | 31 37 2c 20 57 2d 34 37 |er.Str.~|17, W-47|
|00001270| 39 30 7e 50 61 64 65 72 | 62 6f 72 6e 2c 20 47 65 |90~Pader|born, Ge|
|00001280| 72 6d 61 6e 79 2e 0a 0a | 25 25 25 25 25 25 25 25 |rmany...|%%%%%%%%|
|00001290| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000012a0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000012b0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000012c0| 25 25 25 25 0a 0c 0a 5c | 73 65 63 74 69 6f 6e 7b |%%%%...\|section{|
|000012d0| 53 74 61 6e 64 61 72 64 | 20 49 2f 4f 7d 0a 0a 5c |Standard| I/O}..\|
|000012e0| 23 69 6e 63 6c 75 64 65 | 20 5c 3c 73 74 64 69 6f |#include| \<stdio|
|000012f0| 2e 68 3e 0a 0a 7b 5c 6c | 65 66 74 73 6b 69 70 3d |.h>..{\l|eftskip=|
|00001300| 5c 6d 79 69 6e 64 65 6e | 74 20 54 68 65 20 66 6f |\myinden|t The fo|
|00001310| 6c 6c 6f 77 69 6e 67 20 | 61 6c 69 61 73 65 73 20 |llowing |aliases |
|00001320| 66 6f 72 20 73 6f 6d 65 | 20 6f 66 20 74 68 65 20 |for some| of the |
|00001330| 62 65 6c 6f 77 0a 66 75 | 6e 63 74 69 6f 6e 73 20 |below.fu|nctions |
|00001340| 61 72 65 20 64 65 66 69 | 6e 65 64 2e 5c 70 61 72 |are defi|ned.\par|
|00001350| 7d 0a 0a 5c 62 65 67 69 | 6e 69 6e 64 65 6e 74 65 |}..\begi|nindente|
|00001360| 64 6b 65 79 73 0a 5c 70 | 61 72 61 6c 69 67 6e 20 |dkeys.\p|aralign |
|00001370| 74 6f 20 5c 68 73 69 7a | 65 7b 23 5c 74 61 62 73 |to \hsiz|e{#\tabs|
|00001380| 6b 69 70 3d 31 30 70 74 | 20 70 6c 75 73 20 31 20 |kip=10pt| plus 1 |
|00001390| 66 69 6c 5c 68 66 69 6c | 26 23 5c 68 66 69 6c 5c |fil\hfil|&#\hfil\|
|000013a0| 63 72 0a 20 20 5c 74 77 | 6f 63 6f 6c 7b 67 65 74 |cr. \tw|ocol{get|
|000013b0| 63 7d 7b 66 67 65 74 63 | 7d 0a 20 20 5c 74 77 6f |c}{fgetc|}. \two|
|000013c0| 63 6f 6c 7b 75 6e 67 65 | 74 63 7d 7b 66 75 6e 67 |col{unge|tc}{fung|
|000013d0| 65 74 63 7d 0a 20 20 5c | 74 77 6f 63 6f 6c 7b 70 |etc}. \|twocol{p|
|000013e0| 75 74 63 7d 7b 66 70 75 | 74 63 7d 0a 20 20 5c 74 |utc}{fpu|tc}. \t|
|000013f0| 77 6f 63 6f 6c 7b 67 65 | 74 63 68 61 72 28 29 7d |wocol{ge|tchar()}|
|00001400| 7b 66 67 65 74 63 28 73 | 74 64 69 6e 29 7d 0a 20 |{fgetc(s|tdin)}. |
|00001410| 20 5c 74 77 6f 63 6f 6c | 7b 75 6e 67 65 74 63 68 | \twocol|{ungetch|
|00001420| 61 72 28 63 29 7d 7b 66 | 75 6e 67 65 74 63 28 28 |ar(c)}{f|ungetc((|
|00001430| 63 29 2c 73 74 64 69 6e | 29 7d 0a 20 20 5c 74 77 |c),stdin|)}. \tw|
|00001440| 6f 63 6f 6c 7b 70 75 74 | 63 68 61 72 28 63 29 7d |ocol{put|char(c)}|
|00001450| 7b 66 70 75 74 63 28 28 | 63 29 2c 73 74 64 6f 75 |{fputc((|c),stdou|
|00001460| 74 29 7d 0a 7d 5c 65 6e | 64 69 6e 64 65 6e 74 65 |t)}.}\en|dindente|
|00001470| 64 6b 65 79 73 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |dkeys..\|function|
|00001480| 7b 76 6f 69 64 20 63 6c | 65 61 72 65 72 72 28 46 |{void cl|earerr(F|
|00001490| 49 4c 45 20 5c 2a 66 70 | 29 3b 7d 0a 5c 65 78 70 |ILE \*fp|);}.\exp|
|000014a0| 6c 7b 43 6c 65 61 72 20 | 65 72 72 6f 72 20 61 6e |l{Clear |error an|
|000014b0| 64 20 45 4f 46 20 73 74 | 61 74 75 73 20 6f 66 20 |d EOF st|atus of |
|000014c0| 73 74 72 65 61 6d 20 7b | 5c 73 6c 20 66 70 7d 2e |stream {|\sl fp}.|
|000014d0| 20 28 4d 61 63 72 6f 29 | 7d 0a 0a 5c 66 75 6e 63 | (Macro)|}..\func|
|000014e0| 74 69 6f 6e 7b 69 6e 74 | 20 66 63 6c 6f 73 65 28 |tion{int| fclose(|
|000014f0| 46 49 4c 45 20 5c 2a 66 | 70 29 3b 7d 0a 5c 65 78 |FILE \*f|p);}.\ex|
|00001500| 70 6c 7b 43 6c 6f 73 65 | 20 74 68 65 20 73 74 72 |pl{Close| the str|
|00001510| 65 61 6d 20 7b 5c 73 6c | 20 66 70 7d 2e 7d 0a 0a |eam {\sl| fp}.}..|
|00001520| 5c 66 75 6e 63 74 69 6f | 6e 7b 46 49 4c 45 20 5c |\functio|n{FILE \|
|00001530| 2a 66 64 6f 70 65 6e 28 | 69 6e 74 20 66 64 2c 20 |*fdopen(|int fd, |
|00001540| 63 6f 6e 73 74 7e 63 68 | 61 72 20 5c 2a 6d 6f 64 |const~ch|ar \*mod|
|00001550| 65 29 3b 7d 0a 5c 65 78 | 70 6c 7b 43 6f 6e 6e 65 |e);}.\ex|pl{Conne|
|00001560| 63 74 20 61 20 66 69 6c | 65 70 6f 69 6e 74 65 72 |ct a fil|epointer|
|00001570| 20 74 6f 20 74 68 65 20 | 66 69 6c 65 64 65 73 63 | to the |filedesc|
|00001580| 72 69 70 74 6f 72 20 7b | 5c 73 6c 20 66 64 7d 20 |riptor {|\sl fd} |
|00001590| 77 69 74 68 20 6d 6f 64 | 65 0a 7b 5c 73 6c 20 6d |with mod|e.{\sl m|
|000015a0| 6f 64 65 7d 2e 7d 0a 0a | 5c 66 75 6e 63 74 69 6f |ode}.}..|\functio|
|000015b0| 6e 7b 69 6e 74 20 66 65 | 6f 66 28 46 49 4c 45 20 |n{int fe|of(FILE |
|000015c0| 5c 2a 66 70 29 3b 7d 0a | 5c 65 78 70 6c 7b 54 65 |\*fp);}.|\expl{Te|
|000015d0| 73 74 20 45 4f 46 20 73 | 74 61 74 75 73 20 6f 66 |st EOF s|tatus of|
|000015e0| 20 73 74 72 65 61 6d 20 | 7b 5c 73 6c 20 66 70 7d | stream |{\sl fp}|
|000015f0| 2e 20 28 4d 61 63 72 6f | 29 7d 0a 0a 5c 66 75 6e |. (Macro|)}..\fun|
|00001600| 63 74 69 6f 6e 7b 69 6e | 74 20 66 65 72 72 6f 72 |ction{in|t ferror|
|00001610| 28 46 49 4c 45 20 5c 2a | 66 70 29 3b 7d 0a 5c 65 |(FILE \*|fp);}.\e|
|00001620| 78 70 6c 7b 54 65 73 74 | 20 65 72 72 6f 72 20 73 |xpl{Test| error s|
|00001630| 74 61 74 75 73 20 6f 66 | 20 73 74 72 65 61 6d 20 |tatus of| stream |
|00001640| 7b 5c 73 6c 20 66 70 7d | 2e 20 28 4d 61 63 72 6f |{\sl fp}|. (Macro|
|00001650| 29 7d 0a 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 69 6e |)}..\fun|ction{in|
|00001660| 74 20 66 66 6c 75 73 68 | 28 46 49 4c 45 20 5c 2a |t fflush|(FILE \*|
|00001670| 66 70 29 3b 7d 0a 5c 65 | 78 70 6c 7b 57 72 69 74 |fp);}.\e|xpl{Writ|
|00001680| 65 20 64 61 74 61 20 66 | 72 6f 6d 20 69 6e 74 65 |e data f|rom inte|
|00001690| 72 6e 61 6c 20 62 75 66 | 66 65 72 20 6f 66 20 73 |rnal buf|fer of s|
|000016a0| 74 72 65 61 6d 20 7b 5c | 73 6c 20 66 70 7d 20 74 |tream {\|sl fp} t|
|000016b0| 6f 20 74 68 65 20 66 69 | 6c 65 2e 7d 0a 0a 5c 66 |o the fi|le.}..\f|
|000016c0| 75 6e 63 74 69 6f 6e 7b | 69 6e 74 20 66 67 65 74 |unction{|int fget|
|000016d0| 63 28 46 49 4c 45 20 5c | 2a 66 70 29 3b 7d 0a 5c |c(FILE \|*fp);}.\|
|000016e0| 65 78 70 6c 7b 47 65 74 | 20 61 20 63 68 61 72 61 |expl{Get| a chara|
|000016f0| 63 74 65 72 20 66 72 6f | 6d 20 73 74 72 65 61 6d |cter fro|m stream|
|00001700| 20 7b 5c 73 6c 20 66 70 | 7d 2e 7d 0a 0a 5c 66 75 | {\sl fp|}.}..\fu|
|00001710| 6e 63 74 69 6f 6e 7b 69 | 6e 74 20 66 67 65 74 70 |nction{i|nt fgetp|
|00001720| 6f 73 28 46 49 4c 45 20 | 5c 2a 66 70 2c 20 66 70 |os(FILE |\*fp, fp|
|00001730| 6f 73 5c 5f 74 20 5c 2a | 70 74 72 29 3b 7d 0a 5c |os\_t \*|ptr);}.\|
|00001740| 65 78 70 6c 7b 50 75 74 | 20 74 68 65 20 63 75 72 |expl{Put| the cur|
|00001750| 72 65 6e 74 20 70 6f 73 | 69 74 69 6f 6e 20 6f 66 |rent pos|ition of|
|00001760| 20 74 68 65 20 66 69 6c | 65 70 6f 69 6e 74 65 72 | the fil|epointer|
|00001770| 20 6f 66 20 73 74 72 65 | 61 6d 20 7b 5c 73 6c 20 | of stre|am {\sl |
|00001780| 66 70 7d 0a 69 6e 74 6f | 20 74 68 65 20 61 64 64 |fp}.into| the add|
|00001790| 72 65 73 73 20 7b 5c 73 | 6c 20 70 74 72 7d 2e 7d |ress {\s|l ptr}.}|
|000017a0| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 63 68 61 72 |..\funct|ion{char|
|000017b0| 20 5c 2a 66 67 65 74 73 | 28 63 68 61 72 20 5c 2a | \*fgets|(char \*|
|000017c0| 62 75 66 2c 20 69 6e 74 | 20 6d 61 78 2c 20 46 49 |buf, int| max, FI|
|000017d0| 4c 45 20 5c 2a 66 70 29 | 3b 7d 0a 5c 65 78 70 6c |LE \*fp)|;}.\expl|
|000017e0| 7b 47 65 74 20 61 20 73 | 74 72 69 6e 67 20 69 6e |{Get a s|tring in|
|000017f0| 63 6c 75 64 69 6e 67 20 | 74 68 65 20 4e 4c 20 63 |cluding |the NL c|
|00001800| 68 61 72 61 63 74 65 72 | 20 66 72 6f 6d 20 73 74 |haracter| from st|
|00001810| 72 65 61 6d 20 7b 5c 73 | 6c 20 66 70 7d 0a 77 69 |ream {\s|l fp}.wi|
|00001820| 74 68 20 7b 5c 73 6c 20 | 6d 61 78 7d 20 62 79 74 |th {\sl |max} byt|
|00001830| 65 20 69 6e 74 6f 20 7b | 5c 73 6c 20 62 75 66 7d |e into {|\sl buf}|
|00001840| 2e 7d 0a 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 69 6e |.}..\fun|ction{in|
|00001850| 74 20 66 69 6c 65 6e 6f | 28 46 49 4c 45 20 5c 2a |t fileno|(FILE \*|
|00001860| 66 70 29 3b 7d 0a 5c 65 | 78 70 6c 7b 47 65 74 20 |fp);}.\e|xpl{Get |
|00001870| 66 69 6c 65 64 65 73 63 | 72 69 70 74 6f 72 20 6f |filedesc|riptor o|
|00001880| 66 20 73 74 72 65 61 6d | 20 7b 5c 73 6c 20 66 70 |f stream| {\sl fp|
|00001890| 7d 2e 20 28 4d 61 63 72 | 6f 29 7d 0a 0a 5c 66 75 |}. (Macr|o)}..\fu|
|000018a0| 6e 63 74 69 6f 6e 7b 46 | 49 4c 45 20 5c 2a 66 6f |nction{F|ILE \*fo|
|000018b0| 70 65 6e 28 63 6f 6e 73 | 74 7e 63 68 61 72 20 5c |pen(cons|t~char \|
|000018c0| 2a 66 6e 61 6d 65 2c 20 | 63 6f 6e 73 74 7e 63 68 |*fname, |const~ch|
|000018d0| 61 72 20 5c 2a 6d 6f 64 | 65 29 3b 7d 0a 5c 65 78 |ar \*mod|e);}.\ex|
|000018e0| 70 6c 7b 4f 70 65 6e 20 | 66 69 6c 65 20 7b 5c 73 |pl{Open |file {\s|
|000018f0| 6c 20 66 6e 61 6d 65 7d | 20 77 69 74 68 20 6d 6f |l fname}| with mo|
|00001900| 64 65 20 7b 5c 73 6c 20 | 6d 6f 64 65 7d 20 66 6f |de {\sl |mode} fo|
|00001910| 72 20 73 74 72 65 61 6d | 20 49 2f 4f 2e 7d 0a 0a |r stream| I/O.}..|
|00001920| 5c 66 75 6e 63 74 69 6f | 6e 7b 69 6e 74 20 66 70 |\functio|n{int fp|
|00001930| 75 74 63 28 69 6e 74 20 | 63 2c 20 46 49 4c 45 20 |utc(int |c, FILE |
|00001940| 5c 2a 66 70 29 3b 7d 0a | 5c 65 78 70 6c 7b 57 72 |\*fp);}.|\expl{Wr|
|00001950| 69 74 65 20 61 20 63 68 | 61 72 61 63 74 65 72 20 |ite a ch|aracter |
|00001960| 7b 5c 73 6c 20 63 7d 20 | 69 6e 74 6f 20 73 74 72 |{\sl c} |into str|
|00001970| 65 61 6d 20 7b 5c 73 6c | 20 66 70 7d 2e 7d 0a 0a |eam {\sl| fp}.}..|
|00001980| 5c 66 75 6e 63 74 69 6f | 6e 7b 69 6e 74 20 66 70 |\functio|n{int fp|
|00001990| 75 74 73 28 63 6f 6e 73 | 74 7e 63 68 61 72 20 5c |uts(cons|t~char \|
|000019a0| 2a 62 75 66 2c 20 46 49 | 4c 45 20 5c 2a 66 70 29 |*buf, FI|LE \*fp)|
|000019b0| 3b 7d 0a 5c 65 78 70 6c | 7b 57 72 69 74 65 20 74 |;}.\expl|{Write t|
|000019c0| 68 65 20 73 74 72 69 6e | 67 20 69 6e 20 7b 5c 73 |he strin|g in {\s|
|000019d0| 6c 20 62 75 66 7d 20 69 | 6e 74 6f 20 73 74 72 65 |l buf} i|nto stre|
|000019e0| 61 6d 20 7b 5c 73 6c 20 | 66 70 7d 2e 7d 0a 0a 5c |am {\sl |fp}.}..\|
|000019f0| 66 75 6e 63 74 69 6f 6e | 7b 73 69 7a 65 5c 5f 74 |function|{size\_t|
|00001a00| 20 66 72 65 61 64 28 76 | 6f 69 64 20 5c 2a 62 75 | fread(v|oid \*bu|
|00001a10| 66 2c 20 73 69 7a 65 5c | 5f 74 20 73 7a 2c 20 73 |f, size\|_t sz, s|
|00001a20| 69 7a 65 5c 5f 74 20 6e | 6f 2c 20 46 49 4c 45 20 |ize\_t n|o, FILE |
|00001a30| 5c 2a 66 70 29 3b 7d 0a | 5c 65 78 70 6c 7b 52 65 |\*fp);}.|\expl{Re|
|00001a40| 61 64 20 7b 5c 73 6c 20 | 6e 6f 7d 20 69 74 65 6d |ad {\sl |no} item|
|00001a50| 73 20 6f 66 20 73 69 7a | 65 20 7b 5c 73 6c 20 73 |s of siz|e {\sl s|
|00001a60| 7a 7d 20 66 72 6f 6d 20 | 73 74 72 65 61 6d 20 7b |z} from |stream {|
|00001a70| 5c 73 6c 20 66 70 7d 20 | 69 6e 74 6f 20 0a 7b 5c |\sl fp} |into .{\|
|00001a80| 73 6c 20 62 75 66 7d 2e | 7d 0a 0a 5c 66 75 6e 63 |sl buf}.|}..\func|
|00001a90| 74 69 6f 6e 7b 46 49 4c | 45 20 5c 2a 66 72 65 6f |tion{FIL|E \*freo|
|00001aa0| 70 65 6e 28 63 6f 6e 73 | 74 7e 63 68 61 72 20 5c |pen(cons|t~char \|
|00001ab0| 2a 66 6e 61 6d 65 2c 20 | 63 6f 6e 73 74 7e 63 68 |*fname, |const~ch|
|00001ac0| 61 72 20 5c 2a 6d 6f 64 | 65 2c 20 46 49 4c 45 20 |ar \*mod|e, FILE |
|00001ad0| 5c 2a 66 70 29 3b 7d 0a | 5c 65 78 70 6c 7b 52 65 |\*fp);}.|\expl{Re|
|00001ae0| 6f 70 65 6e 20 7b 5c 73 | 6c 20 66 70 7d 20 77 69 |open {\s|l fp} wi|
|00001af0| 74 68 20 66 69 6c 65 20 | 7b 5c 73 6c 20 66 6e 61 |th file |{\sl fna|
|00001b00| 6d 65 7d 20 61 6e 64 20 | 6d 6f 64 65 20 7b 5c 73 |me} and |mode {\s|
|00001b10| 6c 20 6d 6f 64 65 7d 2e | 7d 0a 0a 5c 66 75 6e 63 |l mode}.|}..\func|
|00001b20| 74 69 6f 6e 7b 69 6e 74 | 20 66 73 65 65 6b 28 46 |tion{int| fseek(F|
|00001b30| 49 4c 45 20 5c 2a 66 70 | 2c 20 6c 6f 6e 67 20 70 |ILE \*fp|, long p|
|00001b40| 6f 73 2c 20 69 6e 74 20 | 77 68 65 6e 63 65 29 3b |os, int |whence);|
|00001b50| 7d 0a 5c 65 78 70 6c 7b | 4d 6f 76 65 20 74 68 65 |}.\expl{|Move the|
|00001b60| 20 74 68 65 20 66 69 6c | 65 70 6f 69 6e 74 65 72 | the fil|epointer|
|00001b70| 20 66 72 6f 6d 20 73 74 | 72 65 61 6d 20 7b 5c 73 | from st|ream {\s|
|00001b80| 6c 20 66 70 7d 20 74 6f | 20 70 6f 73 69 74 69 6f |l fp} to| positio|
|00001b90| 6e 20 7b 5c 73 6c 20 70 | 6f 73 7d 0a 72 65 6c 61 |n {\sl p|os}.rela|
|00001ba0| 74 69 76 20 74 6f 20 7b | 5c 73 6c 20 77 68 65 6e |tiv to {|\sl when|
|00001bb0| 63 65 7d 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |ce}.}..\|function|
|00001bc0| 7b 69 6e 74 20 66 73 65 | 74 70 6f 73 28 46 49 4c |{int fse|tpos(FIL|
|00001bd0| 45 20 5c 2a 66 70 2c 20 | 66 70 6f 73 5c 5f 74 20 |E \*fp, |fpos\_t |
|00001be0| 5c 2a 70 74 72 29 3b 7d | 0a 5c 65 78 70 6c 7b 53 |\*ptr);}|.\expl{S|
|00001bf0| 65 74 20 74 68 65 20 70 | 6f 73 69 74 69 6f 6e 20 |et the p|osition |
|00001c00| 6f 66 20 74 68 65 20 66 | 69 6c 65 70 6f 69 6e 74 |of the f|ilepoint|
|00001c10| 65 72 20 6f 66 20 73 74 | 72 65 61 6d 20 7b 5c 73 |er of st|ream {\s|
|00001c20| 6c 20 66 70 7d 20 74 6f | 20 74 68 65 0a 76 61 6c |l fp} to| the.val|
|00001c30| 75 65 20 61 74 20 61 64 | 64 72 65 73 73 20 7b 5c |ue at ad|dress {\|
|00001c40| 73 6c 20 70 74 72 7d 2e | 7d 0a 0a 5c 66 75 6e 63 |sl ptr}.|}..\func|
|00001c50| 74 69 6f 6e 7b 6c 6f 6e | 67 20 66 74 65 6c 6c 28 |tion{lon|g ftell(|
|00001c60| 46 49 4c 45 20 5c 2a 66 | 70 29 3b 7d 0a 5c 65 78 |FILE \*f|p);}.\ex|
|00001c70| 70 6c 7b 47 65 74 20 74 | 68 65 20 63 75 72 72 65 |pl{Get t|he curre|
|00001c80| 6e 74 20 70 6f 73 69 74 | 69 6f 6e 20 6f 66 20 74 |nt posit|ion of t|
|00001c90| 68 65 20 66 69 6c 65 70 | 6f 69 6e 74 65 72 20 66 |he filep|ointer f|
|00001ca0| 72 6f 6d 20 73 74 72 65 | 61 6d 20 7b 5c 73 6c 20 |rom stre|am {\sl |
|00001cb0| 66 70 7d 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |fp}.}..\|function|
|00001cc0| 7b 69 6e 74 20 66 75 6e | 67 65 74 63 28 69 6e 74 |{int fun|getc(int|
|00001cd0| 20 63 2c 20 46 49 4c 45 | 20 5c 2a 66 70 29 3b 7d | c, FILE| \*fp);}|
|00001ce0| 0a 5c 65 78 70 6c 7b 50 | 75 73 68 20 74 68 65 20 |.\expl{P|ush the |
|00001cf0| 63 68 61 72 61 63 74 65 | 72 20 7b 5c 73 6c 20 63 |characte|r {\sl c|
|00001d00| 7d 20 62 61 63 6b 20 6f | 6e 74 6f 20 73 74 72 65 |} back o|nto stre|
|00001d10| 61 6d 20 7b 5c 73 6c 20 | 66 70 7d 2e 7d 0a 0a 5c |am {\sl |fp}.}..\|
|00001d20| 66 75 6e 63 74 69 6f 6e | 7b 73 69 7a 65 5c 5f 74 |function|{size\_t|
|00001d30| 20 66 77 72 69 74 65 28 | 63 6f 6e 73 74 7e 76 6f | fwrite(|const~vo|
|00001d40| 69 64 20 5c 2a 62 75 66 | 2c 20 73 69 7a 65 5c 5f |id \*buf|, size\_|
|00001d50| 74 20 73 69 7a 65 2c 20 | 73 69 7a 65 5c 5f 74 20 |t size, |size\_t |
|00001d60| 6e 6f 20 2c 20 46 49 4c | 45 20 5c 2a 66 70 29 3b |no , FIL|E \*fp);|
|00001d70| 7d 0a 5c 65 78 70 6c 7b | 57 72 69 74 65 20 7b 5c |}.\expl{|Write {\|
|00001d80| 73 6c 20 6e 6f 7d 20 69 | 74 65 6d 73 20 6f 66 20 |sl no} i|tems of |
|00001d90| 73 69 7a 65 20 7b 5c 73 | 6c 20 73 7a 7d 20 66 72 |size {\s|l sz} fr|
|00001da0| 6f 6d 20 7b 5c 73 6c 20 | 62 75 66 7d 20 69 6e 74 |om {\sl |buf} int|
|00001db0| 6f 20 73 74 72 65 61 6d | 0a 7b 5c 73 6c 20 66 70 |o stream|.{\sl fp|
|00001dc0| 7d 2e 7d 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 6c |}.}..\fu|nction{l|
|00001dd0| 6f 6e 67 20 67 65 74 6c | 28 46 49 4c 45 20 5c 2a |ong getl|(FILE \*|
|00001de0| 66 70 29 3b 7d 0a 5c 65 | 78 70 6c 7b 52 65 61 64 |fp);}.\e|xpl{Read|
|00001df0| 20 61 20 6c 6f 6e 67 20 | 76 61 6c 75 65 20 66 72 | a long |value fr|
|00001e00| 6f 6d 20 73 74 72 65 61 | 6d 20 7b 5c 73 6c 20 66 |om strea|m {\sl f|
|00001e10| 70 7d 2e 7d 0a 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |p}.}..\f|unction{|
|00001e20| 63 68 61 72 20 5c 2a 67 | 65 74 73 28 63 68 61 72 |char \*g|ets(char|
|00001e30| 20 5c 2a 62 75 66 29 3b | 7d 0a 5c 65 78 70 6c 7b | \*buf);|}.\expl{|
|00001e40| 47 65 74 20 61 20 73 74 | 72 69 6e 67 20 66 72 6f |Get a st|ring fro|
|00001e50| 6d 20 5c 3c 73 74 64 69 | 6e 3e 20 69 6e 74 6f 20 |m \<stdi|n> into |
|00001e60| 7b 5c 73 6c 20 62 75 66 | 7d 2e 20 54 68 65 20 4e |{\sl buf|}. The N|
|00001e70| 4c 20 63 68 61 72 61 63 | 74 65 72 20 69 73 20 0a |L charac|ter is .|
|00001e80| 64 69 73 63 61 72 64 65 | 64 2e 7d 0a 0a 5c 66 75 |discarde|d.}..\fu|
|00001e90| 6e 63 74 69 6f 6e 7b 73 | 68 6f 72 74 20 67 65 74 |nction{s|hort get|
|00001ea0| 77 28 46 49 4c 45 20 5c | 2a 66 70 29 3b 7d 0a 5c |w(FILE \|*fp);}.\|
|00001eb0| 65 78 70 6c 7b 52 65 61 | 64 20 61 20 73 68 6f 72 |expl{Rea|d a shor|
|00001ec0| 74 20 76 61 6c 75 65 20 | 66 72 6f 6d 20 73 74 72 |t value |from str|
|00001ed0| 65 61 6d 20 7b 5c 73 6c | 20 66 70 7d 2e 7d 0a 0a |eam {\sl| fp}.}..|
|00001ee0| 5c 66 75 6e 63 74 69 6f | 6e 7b 69 6e 74 20 70 63 |\functio|n{int pc|
|00001ef0| 6c 6f 73 65 28 46 49 4c | 45 20 5c 2a 66 70 29 3b |lose(FIL|E \*fp);|
|00001f00| 7d 0a 5c 65 78 70 6c 7b | 43 6c 6f 73 65 20 74 68 |}.\expl{|Close th|
|00001f10| 65 20 73 74 72 65 61 6d | 20 63 72 65 61 74 65 64 |e stream| created|
|00001f20| 20 62 79 20 7b 5c 62 66 | 20 70 6f 70 65 6e 28 29 | by {\bf| popen()|
|00001f30| 7d 2e 7d 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 76 |}.}..\fu|nction{v|
|00001f40| 6f 69 64 20 70 65 72 72 | 6f 72 28 63 6f 6e 73 74 |oid perr|or(const|
|00001f50| 7e 63 68 61 72 20 5c 2a | 73 74 72 29 3b 7d 0a 5c |~char \*|str);}.\|
|00001f60| 65 78 70 6c 7b 44 69 73 | 70 6c 61 79 20 65 72 72 |expl{Dis|play err|
|00001f70| 6f 72 20 6d 65 73 73 61 | 67 65 20 73 74 61 72 74 |or messa|ge start|
|00001f80| 69 6e 67 20 77 69 74 68 | 20 7b 5c 73 6c 20 73 74 |ing with| {\sl st|
|00001f90| 72 7d 20 64 65 70 65 6e | 64 69 6e 67 20 6f 6e 20 |r} depen|ding on |
|00001fa0| 7b 5c 73 6c 0a 65 72 72 | 6e 6f 7d 2e 7d 0a 0a 5c |{\sl.err|no}.}..\|
|00001fb0| 66 75 6e 63 74 69 6f 6e | 7b 46 49 4c 45 20 5c 2a |function|{FILE \*|
|00001fc0| 70 6f 70 65 6e 28 63 6f | 6e 73 74 7e 63 68 61 72 |popen(co|nst~char|
|00001fd0| 20 5c 2a 63 6f 6d 6d 61 | 6e 64 2c 20 63 6f 6e 73 | \*comma|nd, cons|
|00001fe0| 74 7e 63 68 61 72 20 5c | 2a 6d 6f 64 65 29 3b 7d |t~char \|*mode);}|
|00001ff0| 0a 5c 65 78 70 6c 7b 4f | 70 65 6e 20 61 20 70 69 |.\expl{O|pen a pi|
|00002000| 70 65 20 77 69 74 68 20 | 7b 5c 73 6c 20 6d 6f 64 |pe with |{\sl mod|
|00002010| 65 7d 20 74 6f 20 7b 5c | 73 6c 20 63 6f 6d 6d 61 |e} to {\|sl comma|
|00002020| 6e 64 7d 2e 20 28 46 61 | 6b 65 64 20 62 79 20 74 |nd}. (Fa|ked by t|
|00002030| 65 6d 70 6f 72 61 72 79 | 0a 66 69 6c 65 73 29 7d |emporary|.files)}|
|00002040| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 69 6e 74 20 |..\funct|ion{int |
|00002050| 70 72 69 6e 74 66 28 63 | 6f 6e 73 74 7e 63 68 61 |printf(c|onst~cha|
|00002060| 72 20 5c 2a 66 6d 74 2c | 20 24 5c 6c 64 6f 74 73 |r \*fmt,| $\ldots|
|00002070| 24 29 3b 7d 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 69 |$);}.\fu|nction{i|
|00002080| 6e 74 20 66 70 72 69 6e | 74 66 28 46 49 4c 45 20 |nt fprin|tf(FILE |
|00002090| 5c 2a 66 70 2c 20 63 6f | 6e 73 74 7e 63 68 61 72 |\*fp, co|nst~char|
|000020a0| 20 5c 2a 66 6d 74 2c 20 | 24 5c 6c 64 6f 74 73 24 | \*fmt, |$\ldots$|
|000020b0| 29 3b 7d 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 69 6e |);}.\fun|ction{in|
|000020c0| 74 20 73 70 72 69 6e 74 | 66 28 63 68 61 72 20 5c |t sprint|f(char \|
|000020d0| 2a 62 75 66 2c 20 63 6f | 6e 73 74 7e 63 68 61 72 |*buf, co|nst~char|
|000020e0| 20 5c 2a 66 6d 74 2c 20 | 24 5c 6c 64 6f 74 73 24 | \*fmt, |$\ldots$|
|000020f0| 29 3b 7d 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 69 6e |);}.\fun|ction{in|
|00002100| 74 20 76 70 72 69 6e 74 | 66 28 63 6f 6e 73 74 7e |t vprint|f(const~|
|00002110| 63 68 61 72 20 5c 2a 66 | 6d 74 2c 20 63 68 61 72 |char \*f|mt, char|
|00002120| 20 5c 2a 29 3b 7d 0a 5c | 66 75 6e 63 74 69 6f 6e | \*);}.\|function|
|00002130| 7b 69 6e 74 20 76 66 70 | 72 69 6e 74 66 28 46 49 |{int vfp|rintf(FI|
|00002140| 4c 45 20 5c 2a 66 70 2c | 20 63 6f 6e 73 74 7e 63 |LE \*fp,| const~c|
|00002150| 68 61 72 20 5c 2a 66 6d | 74 2c 20 63 68 61 72 20 |har \*fm|t, char |
|00002160| 5c 2a 29 3b 7d 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |\*);}.\f|unction{|
|00002170| 69 6e 74 20 76 73 70 72 | 69 6e 74 66 28 63 68 61 |int vspr|intf(cha|
|00002180| 72 20 5c 2a 62 75 66 2c | 20 63 6f 6e 73 74 7e 63 |r \*buf,| const~c|
|00002190| 68 61 72 20 5c 2a 66 6d | 74 2c 20 63 68 61 72 20 |har \*fm|t, char |
|000021a0| 5c 2a 29 3b 7d 0a 5c 65 | 78 70 6c 7b 46 6f 72 6d |\*);}.\e|xpl{Form|
|000021b0| 61 74 65 64 20 6f 75 74 | 70 75 74 20 74 6f 20 65 |ated out|put to e|
|000021c0| 69 74 68 65 72 20 5c 3c | 73 74 64 6f 75 74 3e 2c |ither \<|stdout>,|
|000021d0| 20 7b 5c 73 6c 20 66 70 | 7d 20 6f 72 20 7b 5c 73 | {\sl fp|} or {\s|
|000021e0| 6c 20 62 75 66 7d 20 77 | 69 74 68 20 66 69 78 65 |l buf} w|ith fixe|
|000021f0| 64 20 0a 6f 72 20 76 61 | 72 69 61 62 6c 65 20 6e |d .or va|riable n|
|00002200| 75 6d 62 65 72 20 6f 66 | 20 61 72 67 75 6d 65 6e |umber of| argumen|
|00002210| 74 73 2e 7d 0a 0a 7b 5c | 6c 65 66 74 73 6b 69 70 |ts.}..{\|leftskip|
|00002220| 3d 5c 6d 79 69 6e 64 65 | 6e 74 20 54 68 65 20 66 |=\myinde|nt The f|
|00002230| 6f 6c 6c 6f 77 69 6e 67 | 20 74 61 62 6c 65 20 6c |ollowing| table l|
|00002240| 69 73 74 73 20 74 68 65 | 20 69 64 65 6e 74 69 66 |ists the| identif|
|00002250| 79 69 6e 67 20 6c 65 74 | 74 65 72 73 20 6f 66 0a |ying let|ters of.|
|00002260| 74 68 65 20 7b 5c 73 6c | 20 66 6d 74 7d 20 73 74 |the {\sl| fmt} st|
|00002270| 72 69 6e 67 2e 5c 70 61 | 72 7d 0a 0a 5c 62 65 67 |ring.\pa|r}..\beg|
|00002280| 69 6e 69 6e 64 65 6e 74 | 65 64 6b 65 79 73 5c 62 |inindent|edkeys\b|
|00002290| 65 67 69 6e 74 68 72 65 | 65 63 6f 6c 75 6d 6e 0a |eginthre|ecolumn.|
|000022a0| 20 20 5c 74 68 72 65 65 | 63 6f 6c 72 75 6c 65 7b | \three|colrule{|
|000022b0| 73 63 61 6e 66 7d 7b 70 | 72 69 6e 74 66 7d 7b 4d |scanf}{p|rintf}{M|
|000022c0| 65 61 6e 69 6e 67 7d 0a | 20 20 5c 6e 6f 61 6c 69 |eaning}.| \noali|
|000022d0| 67 6e 7b 5c 68 72 75 6c | 65 7d 0a 20 20 5c 74 68 |gn{\hrul|e}. \th|
|000022e0| 72 65 65 63 6f 6c 72 75 | 6c 65 7b 64 7d 7b 64 2c |reecolru|le{d}{d,|
|000022f0| 69 7d 7b 44 65 63 69 6d | 61 6c 20 6e 75 6d 62 65 |i}{Decim|al numbe|
|00002300| 72 7d 0a 20 20 5c 74 68 | 72 65 65 63 6f 6c 72 75 |r}. \th|reecolru|
|00002310| 6c 65 7b 6f 7d 7b 6f 7d | 7b 4f 63 74 61 6c 20 6e |le{o}{o}|{Octal n|
|00002320| 75 6d 62 65 72 7d 0a 20 | 20 5c 74 68 72 65 65 63 |umber}. | \threec|
|00002330| 6f 6c 72 75 6c 65 7b 78 | 7d 7b 78 2c 58 7d 7b 48 |olrule{x|}{x,X}{H|
|00002340| 65 78 61 64 65 63 69 6d | 61 6c 20 6e 75 6d 62 65 |exadecim|al numbe|
|00002350| 72 7d 0a 20 20 5c 74 68 | 72 65 65 63 6f 6c 72 75 |r}. \th|reecolru|
|00002360| 6c 65 7b 75 7d 7b 75 7d | 7b 55 6e 73 69 67 6e 65 |le{u}{u}|{Unsigne|
|00002370| 64 20 64 65 63 69 6d 61 | 6c 20 6e 2e 7d 0a 20 20 |d decima|l n.}. |
|00002380| 5c 74 68 72 65 65 63 6f | 6c 72 75 6c 65 7b 62 7d |\threeco|lrule{b}|
|00002390| 7b 5c 6f 6d 69 74 7d 7b | 55 6e 73 69 67 6e 65 64 |{\omit}{|Unsigned|
|000023a0| 20 62 69 6e 61 72 79 20 | 69 6e 74 2e 7d 0a 20 20 | binary |int.}. |
|000023b0| 5c 74 68 72 65 65 63 6f | 6c 72 75 6c 65 7b 69 7d |\threeco|lrule{i}|
|000023c0| 7b 5c 6f 6d 69 74 7d 7b | 41 6e 79 20 62 61 73 65 |{\omit}{|Any base|
|000023d0| 20 6e 75 6d 2e 7d 0a 20 | 20 5c 74 68 72 65 65 63 | num.}. | \threec|
|000023e0| 6f 6c 72 75 6c 65 7b 44 | 7d 7b 44 7d 7b 4c 6f 6e |olrule{D|}{D}{Lon|
|000023f0| 67 20 44 65 63 69 6d 61 | 6c 20 6e 75 6d 62 65 72 |g Decima|l number|
|00002400| 7d 0a 20 20 5c 74 68 72 | 65 65 63 6f 6c 72 75 6c |}. \thr|eecolrul|
|00002410| 65 7b 4f 7d 7b 4f 7d 7b | 4c 6f 6e 67 20 4f 63 74 |e{O}{O}{|Long Oct|
|00002420| 61 6c 20 6e 75 6d 62 65 | 72 7d 0a 20 20 5c 74 68 |al numbe|r}. \th|
|00002430| 72 65 65 63 6f 6c 72 75 | 6c 65 7b 55 7d 7b 55 7d |reecolru|le{U}{U}|
|00002440| 7b 55 6e 73 69 67 6e 65 | 64 20 6c 6f 6e 67 20 64 |{Unsigne|d long d|
|00002450| 65 63 69 6d 61 6c 7d 0a | 20 20 5c 74 68 72 65 65 |ecimal}.| \three|
|00002460| 63 6f 6c 72 75 6c 65 7b | 58 7d 7b 5c 6f 6d 69 74 |colrule{|X}{\omit|
|00002470| 7d 7b 4c 6f 6e 67 20 48 | 65 78 61 64 65 63 69 6d |}{Long H|exadecim|
|00002480| 61 6c 7d 0a 20 20 5c 74 | 68 72 65 65 63 6f 6c 72 |al}. \t|hreecolr|
|00002490| 75 6c 65 7b 6c 64 2c 6c | 6f 2c 6c 78 7d 7b 6c 64 |ule{ld,l|o,lx}{ld|
|000024a0| 2c 6c 69 2c 6c 6f 2c 6c | 78 2c 6c 58 7d 7b 4c 6f |,li,lo,l|x,lX}{Lo|
|000024b0| 6e 67 20 24 5c 6c 64 6f | 74 73 24 20 6e 75 6d 62 |ng $\ldo|ts$ numb|
|000024c0| 65 72 7d 0a 20 20 5c 74 | 68 72 65 65 63 6f 6c 72 |er}. \t|hreecolr|
|000024d0| 75 6c 65 7b 6c 62 7d 7b | 5c 6f 6d 69 74 7d 7b 55 |ule{lb}{|\omit}{U|
|000024e0| 6e 73 69 67 6e 65 64 20 | 62 69 6e 61 72 79 20 6c |nsigned |binary l|
|000024f0| 6f 6e 67 7d 0a 20 20 5c | 74 68 72 65 65 63 6f 6c |ong}. \|threecol|
|00002500| 72 75 6c 65 7b 6c 69 7d | 7b 5c 6f 6d 69 74 7d 7b |rule{li}|{\omit}{|
|00002510| 41 6e 79 20 62 61 73 65 | 20 6e 75 6d 2e 20 6c 6f |Any base| num. lo|
|00002520| 6e 67 7d 0a 20 20 5c 74 | 68 72 65 65 63 6f 6c 72 |ng}. \t|hreecolr|
|00002530| 75 6c 65 7b 68 64 2c 68 | 6f 2c 68 78 7d 7b 64 2c |ule{hd,h|o,hx}{d,|
|00002540| 6f 2c 78 2c 58 7d 7b 53 | 68 6f 72 74 20 24 5c 6c |o,x,X}{S|hort $\l|
|00002550| 64 6f 74 73 24 20 6e 75 | 6d 62 65 72 7d 0a 20 20 |dots$ nu|mber}. |
|00002560| 5c 74 68 72 65 65 63 6f | 6c 72 75 6c 65 7b 63 7d |\threeco|lrule{c}|
|00002570| 7b 63 7d 7b 43 68 61 72 | 61 63 74 65 72 7d 0a 20 |{c}{Char|acter}. |
|00002580| 20 5c 74 68 72 65 65 63 | 6f 6c 72 75 6c 65 7b 73 | \threec|olrule{s|
|00002590| 7d 7b 73 7d 7b 53 74 72 | 69 6e 67 7d 0a 20 20 5c |}{s}{Str|ing}. \|
|000025a0| 74 68 72 65 65 63 6f 6c | 72 75 6c 65 7b 5c 6f 6d |threecol|rule{\om|
|000025b0| 69 74 7d 7b 70 7d 7b 50 | 6f 69 6e 74 65 72 7d 0a |it}{p}{P|ointer}.|
|000025c0| 20 20 5c 74 68 72 65 65 | 63 6f 6c 72 75 6c 65 7b | \three|colrule{|
|000025d0| 5b 24 5c 6c 64 6f 74 73 | 24 5d 7d 7b 5c 6f 6d 69 |[$\ldots|$]}{\omi|
|000025e0| 74 7d 7b 53 74 72 2e 20 | 63 6f 6e 73 69 73 74 2e |t}{Str. |consist.|
|000025f0| 20 6f 66 20 63 68 61 72 | 2e 7d 0a 20 20 5c 74 68 | of char|.}. \th|
|00002600| 72 65 65 63 6f 6c 72 75 | 6c 65 7b 65 2c 66 2c 67 |reecolru|le{e,f,g|
|00002610| 7d 7b 66 7d 7b 46 69 78 | 65 64 2d 70 6f 69 6e 74 |}{f}{Fix|ed-point|
|00002620| 20 6e 75 6d 62 65 72 7d | 0a 20 20 5c 74 68 72 65 | number}|. \thre|
|00002630| 65 63 6f 6c 72 75 6c 65 | 7b 65 2c 66 2c 67 7d 7b |ecolrule|{e,f,g}{|
|00002640| 65 2c 45 7d 7b 46 6c 6f | 61 74 69 6e 67 2d 70 6f |e,E}{Flo|ating-po|
|00002650| 69 6e 74 20 6e 75 6d 62 | 65 72 7d 0a 20 20 5c 74 |int numb|er}. \t|
|00002660| 68 72 65 65 63 6f 6c 72 | 75 6c 65 7b 6c 65 2c 6c |hreecolr|ule{le,l|
|00002670| 66 2c 6c 67 7d 7b 5c 6f | 6d 69 74 7d 7b 44 6f 75 |f,lg}{\o|mit}{Dou|
|00002680| 62 6c 65 20 70 72 65 63 | 2e 20 24 5c 6c 64 6f 74 |ble prec|. $\ldot|
|00002690| 73 24 20 6e 2e 7d 0a 20 | 20 5c 74 68 72 65 65 63 |s$ n.}. | \threec|
|000026a0| 6f 6c 72 75 6c 65 7b 45 | 2c 46 2c 47 7d 7b 5c 6f |olrule{E|,F,G}{\o|
|000026b0| 6d 69 74 7d 7b 44 6f 75 | 62 6c 65 20 70 72 65 63 |mit}{Dou|ble prec|
|000026c0| 2e 20 24 5c 6c 64 6f 74 | 73 24 20 6e 2e 7d 0a 20 |. $\ldot|s$ n.}. |
|000026d0| 20 5c 74 68 72 65 65 63 | 6f 6c 72 75 6c 65 7b 4c | \threec|olrule{L|
|000026e0| 65 2c 4c 66 2c 4c 67 7d | 7b 4c 65 2c 4c 45 2c 4c |e,Lf,Lg}|{Le,LE,L|
|000026f0| 66 7d 7b 4c 6f 6e 67 20 | 44 6f 75 62 6c 65 20 24 |f}{Long |Double $|
|00002700| 5c 6c 64 6f 74 73 24 20 | 6e 2e 7d 0a 20 20 5c 74 |\ldots$ |n.}. \t|
|00002710| 68 72 65 65 63 6f 6c 72 | 75 6c 65 7b 5c 6f 6d 69 |hreecolr|ule{\omi|
|00002720| 74 7d 7b 67 2c 47 2c 4c | 67 2c 4c 47 7d 7b 65 2f |t}{g,G,L|g,LG}{e/|
|00002730| 45 20 6f 72 20 66 20 2d | 20 73 68 6f 72 74 65 73 |E or f -| shortes|
|00002740| 74 20 75 73 65 64 7d 0a | 5c 65 6e 64 74 68 72 65 |t used}.|\endthre|
|00002750| 65 63 6f 6c 75 6d 6e 5c | 65 6e 64 69 6e 64 65 6e |ecolumn\|endinden|
|00002760| 74 65 64 6b 65 79 73 0a | 0a 5c 66 75 6e 63 74 69 |tedkeys.|.\functi|
|00002770| 6f 6e 7b 6c 6f 6e 67 20 | 70 75 74 6c 28 6c 6f 6e |on{long |putl(lon|
|00002780| 67 20 63 2c 20 46 49 4c | 45 20 5c 2a 66 70 29 3b |g c, FIL|E \*fp);|
|00002790| 7d 0a 5c 65 78 70 6c 7b | 4f 75 74 70 75 74 20 74 |}.\expl{|Output t|
|000027a0| 68 65 20 6c 6f 6e 67 20 | 76 61 6c 75 65 20 7b 5c |he long |value {\|
|000027b0| 73 6c 20 63 7d 20 69 6e | 74 6f 20 74 68 65 20 73 |sl c} in|to the s|
|000027c0| 74 72 65 61 6d 20 7b 5c | 73 6c 20 66 70 7d 2e 7d |tream {\|sl fp}.}|
|000027d0| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 69 6e 74 20 |..\funct|ion{int |
|000027e0| 70 75 74 73 28 63 6f 6e | 73 74 7e 63 68 61 72 20 |puts(con|st~char |
|000027f0| 5c 2a 62 75 66 29 3b 7d | 0a 5c 65 78 70 6c 7b 57 |\*buf);}|.\expl{W|
|00002800| 72 69 74 65 20 74 68 65 | 20 73 74 72 69 6e 67 20 |rite the| string |
|00002810| 69 6e 20 7b 5c 73 6c 20 | 62 75 66 7d 20 74 6f 20 |in {\sl |buf} to |
|00002820| 5c 3c 73 74 64 6f 75 74 | 3e 20 61 70 70 65 6e 64 |\<stdout|> append|
|00002830| 69 6e 67 20 61 20 4e 4c | 20 0a 63 68 61 72 61 63 |ing a NL| .charac|
|00002840| 74 65 72 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |ter.}..\|function|
|00002850| 7b 73 68 6f 72 74 20 70 | 75 74 77 28 73 68 6f 72 |{short p|utw(shor|
|00002860| 74 20 63 2c 20 46 49 4c | 45 20 5c 2a 66 70 29 3b |t c, FIL|E \*fp);|
|00002870| 7d 0a 5c 65 78 70 6c 7b | 4f 75 74 70 75 74 20 74 |}.\expl{|Output t|
|00002880| 68 65 20 73 68 6f 72 74 | 20 76 61 6c 75 65 20 7b |he short| value {|
|00002890| 5c 73 6c 20 63 7d 20 69 | 6e 74 6f 20 74 68 65 20 |\sl c} i|nto the |
|000028a0| 73 74 72 65 61 6d 20 7b | 5c 73 6c 20 66 70 7d 2e |stream {|\sl fp}.|
|000028b0| 7d 0a 0a 5c 66 75 6e 63 | 74 69 6f 6e 7b 69 6e 74 |}..\func|tion{int|
|000028c0| 20 72 65 6d 6f 76 65 28 | 63 6f 6e 73 74 7e 63 68 | remove(|const~ch|
|000028d0| 61 72 20 5c 2a 66 6e 61 | 6d 65 29 3b 7d 0a 5c 65 |ar \*fna|me);}.\e|
|000028e0| 78 70 6c 7b 52 65 6d 6f | 76 65 20 66 69 6c 65 20 |xpl{Remo|ve file |
|000028f0| 77 69 74 68 20 6e 61 6d | 65 20 7b 5c 73 6c 20 66 |with nam|e {\sl f|
|00002900| 6e 61 6d 65 7d 2e 7d 0a | 0a 5c 66 75 6e 63 74 69 |name}.}.|.\functi|
|00002910| 6f 6e 7b 69 6e 74 20 72 | 65 6e 61 6d 65 28 63 6f |on{int r|ename(co|
|00002920| 6e 73 74 7e 63 68 61 72 | 20 5c 2a 6f 6c 64 2c 20 |nst~char| \*old, |
|00002930| 63 6f 6e 73 74 7e 63 68 | 61 72 20 5c 2a 6e 65 77 |const~ch|ar \*new|
|00002940| 29 3b 7d 0a 5c 65 78 70 | 6c 7b 43 68 61 6e 67 65 |);}.\exp|l{Change|
|00002950| 20 6e 61 6d 65 20 6f 66 | 20 66 69 6c 65 20 66 72 | name of| file fr|
|00002960| 6f 6d 20 7b 5c 73 6c 20 | 6f 6c 64 7d 20 74 6f 20 |om {\sl |old} to |
|00002970| 7b 5c 73 6c 20 6e 65 77 | 7d 2e 7d 0a 0a 5c 66 75 |{\sl new|}.}..\fu|
|00002980| 6e 63 74 69 6f 6e 7b 76 | 6f 69 64 20 72 65 77 69 |nction{v|oid rewi|
|00002990| 6e 64 28 46 49 4c 45 20 | 5c 2a 66 70 29 3b 7d 0a |nd(FILE |\*fp);}.|
|000029a0| 5c 65 78 70 6c 7b 52 65 | 73 65 74 20 74 68 65 20 |\expl{Re|set the |
|000029b0| 66 69 6c 65 70 6f 69 6e | 74 65 72 20 66 72 6f 6d |filepoin|ter from|
|000029c0| 20 73 74 72 65 61 6d 20 | 7b 5c 73 6c 20 66 70 7d | stream |{\sl fp}|
|000029d0| 20 74 6f 20 70 6f 73 69 | 74 69 6f 6e 20 30 2e 7d | to posi|tion 0.}|
|000029e0| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 69 6e 74 20 |..\funct|ion{int |
|000029f0| 73 63 61 6e 66 28 63 6f | 6e 73 74 7e 63 68 61 72 |scanf(co|nst~char|
|00002a00| 20 5c 2a 66 6d 74 2c 20 | 24 5c 6c 64 6f 74 73 24 | \*fmt, |$\ldots$|
|00002a10| 29 3b 7d 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 69 6e |);}.\fun|ction{in|
|00002a20| 74 20 66 73 63 61 6e 66 | 28 46 49 4c 45 20 5c 2a |t fscanf|(FILE \*|
|00002a30| 66 70 2c 20 63 6f 6e 73 | 74 7e 63 68 61 72 20 5c |fp, cons|t~char \|
|00002a40| 2a 66 6d 74 2c 20 24 5c | 6c 64 6f 74 73 24 29 3b |*fmt, $\|ldots$);|
|00002a50| 7d 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 69 6e 74 20 |}.\funct|ion{int |
|00002a60| 73 73 63 61 6e 66 28 63 | 6f 6e 73 74 7e 63 68 61 |sscanf(c|onst~cha|
|00002a70| 72 20 5c 2a 62 75 66 2c | 20 63 6f 6e 73 74 7e 63 |r \*buf,| const~c|
|00002a80| 68 61 72 20 5c 2a 66 6d | 74 2c 20 24 5c 6c 64 6f |har \*fm|t, $\ldo|
|00002a90| 74 73 24 29 3b 7d 0a 5c | 65 78 70 6c 7b 46 6f 72 |ts$);}.\|expl{For|
|00002aa0| 6d 61 74 65 64 20 69 6e | 70 75 74 20 66 72 6f 6d |mated in|put from|
|00002ab0| 20 65 69 74 68 65 72 20 | 5c 3c 73 74 64 69 6e 3e | either |\<stdin>|
|00002ac0| 2c 20 7b 5c 73 6c 20 66 | 70 7d 20 6f 72 20 7b 5c |, {\sl f|p} or {\|
|00002ad0| 73 6c 20 62 75 66 7d 2e | 20 28 46 6f 72 0a 61 20 |sl buf}.| (For.a |
|00002ae0| 64 65 73 63 72 69 70 74 | 69 6f 6e 20 6f 66 20 74 |descript|ion of t|
|00002af0| 68 65 20 6c 65 74 74 65 | 72 73 20 69 6e 20 74 68 |he lette|rs in th|
|00002b00| 65 20 7b 5c 73 6c 20 66 | 6d 74 7d 20 73 74 72 69 |e {\sl f|mt} stri|
|00002b10| 6e 67 20 73 65 65 20 7b | 5c 62 66 20 70 72 69 6e |ng see {|\bf prin|
|00002b20| 74 66 7d 2e 29 7d 0a 0a | 5c 66 75 6e 63 74 69 6f |tf}.)}..|\functio|
|00002b30| 6e 7b 76 6f 69 64 20 73 | 65 74 62 75 66 28 46 49 |n{void s|etbuf(FI|
|00002b40| 4c 45 20 5c 2a 66 70 2c | 20 63 68 61 72 20 5c 2a |LE \*fp,| char \*|
|00002b50| 62 75 66 29 3b 7d 0a 5c | 65 78 70 6c 7b 53 65 74 |buf);}.\|expl{Set|
|00002b60| 20 62 75 66 66 65 72 20 | 6f 66 20 73 74 72 65 61 | buffer |of strea|
|00002b70| 6d 20 7b 5c 73 6c 20 66 | 70 7d 20 74 6f 20 7b 5c |m {\sl f|p} to {\|
|00002b80| 73 6c 20 62 75 66 7d 2e | 7d 0a 0a 54 68 65 20 66 |sl buf}.|}..The f|
|00002b90| 6f 6c 6c 6f 77 69 6e 67 | 20 66 75 6e 63 74 69 6f |ollowing| functio|
|00002ba0| 6e 73 20 61 72 65 20 64 | 65 66 69 6e 65 64 20 61 |ns are d|efined a|
|00002bb0| 73 20 6d 61 63 72 6f 73 | 2e 0a 0a 5c 66 75 6e 63 |s macros|...\func|
|00002bc0| 74 69 6f 6e 7b 69 6e 74 | 20 73 65 74 76 62 75 66 |tion{int| setvbuf|
|00002bd0| 28 46 49 4c 45 20 5c 2a | 66 70 2c 20 63 68 61 72 |(FILE \*|fp, char|
|00002be0| 20 5c 2a 62 75 66 2c 20 | 69 6e 74 20 6d 6f 64 65 | \*buf, |int mode|
|00002bf0| 2c 20 73 69 7a 65 5c 5f | 74 20 73 7a 29 3b 7d 0a |, size\_|t sz);}.|
|00002c00| 5c 65 78 70 6c 7b 53 65 | 74 20 62 75 66 66 65 72 |\expl{Se|t buffer|
|00002c10| 20 6f 66 20 73 74 72 65 | 61 6d 20 7b 5c 73 6c 20 | of stre|am {\sl |
|00002c20| 66 70 7d 20 74 6f 20 7b | 5c 73 6c 20 62 75 66 7d |fp} to {|\sl buf}|
|00002c30| 20 77 69 74 68 20 73 69 | 7a 65 20 7b 5c 73 6c 20 | with si|ze {\sl |
|00002c40| 73 7a 7d 20 61 6e 64 0a | 6d 6f 64 65 20 7b 5c 73 |sz} and.|mode {\s|
|00002c50| 6c 20 6d 6f 64 65 7d 2e | 7d 0a 0a 5c 66 75 6e 63 |l mode}.|}..\func|
|00002c60| 74 69 6f 6e 7b 46 49 4c | 45 20 5c 2a 74 6d 70 66 |tion{FIL|E \*tmpf|
|00002c70| 69 6c 65 28 76 6f 69 64 | 29 3b 7d 0a 5c 65 78 70 |ile(void|);}.\exp|
|00002c80| 6c 7b 43 72 65 61 74 65 | 20 61 20 74 65 6d 70 6f |l{Create| a tempo|
|00002c90| 72 61 72 79 20 66 69 6c | 65 2e 20 46 69 6c 65 20 |rary fil|e. File |
|00002ca0| 69 73 20 64 65 6c 65 74 | 65 64 20 6f 6e 20 6e 6f |is delet|ed on no|
|00002cb0| 72 6d 61 6c 20 74 65 72 | 6d 69 6e 61 74 69 6f 6e |rmal ter|mination|
|00002cc0| 2e 7d 0a 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 63 68 |.}..\fun|ction{ch|
|00002cd0| 61 72 20 5c 2a 74 6d 70 | 6e 61 6d 28 63 68 61 72 |ar \*tmp|nam(char|
|00002ce0| 20 5c 2a 62 75 66 29 3b | 7d 0a 5c 65 78 70 6c 7b | \*buf);|}.\expl{|
|00002cf0| 43 72 65 61 74 65 20 61 | 20 73 74 72 69 6e 67 20 |Create a| string |
|00002d00| 66 6f 72 20 61 20 74 65 | 6d 70 6f 72 61 72 79 20 |for a te|mporary |
|00002d10| 66 69 6c 65 6e 61 6d 65 | 2e 7d 0a 0a 5c 66 75 6e |filename|.}..\fun|
|00002d20| 63 74 69 6f 6e 7b 76 6f | 69 64 20 5c 5f 62 69 6e |ction{vo|id \_bin|
|00002d30| 6d 6f 64 65 28 69 6e 74 | 20 62 6f 6f 6c 29 3b 7d |mode(int| bool);}|
|00002d40| 0a 5c 65 78 70 6c 7b 53 | 65 74 20 64 65 66 61 75 |.\expl{S|et defau|
|00002d50| 6c 74 20 6f 70 65 6e 20 | 6d 6f 64 65 20 74 6f 20 |lt open |mode to |
|00002d60| 62 69 6e 61 72 79 20 28 | 62 6f 6f 6c 20 3d 20 74 |binary (|bool = t|
|00002d70| 72 75 65 29 20 6f 72 20 | 74 65 78 74 2e 7d 0a 0a |rue) or |text.}..|
|00002d80| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002d90| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002da0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002db0| 25 25 25 25 25 25 25 25 | 25 25 25 25 0a 0c 0a 5c |%%%%%%%%|%%%%...\|
|00002dc0| 73 65 63 74 69 6f 6e 7b | 49 2f 4f 20 43 6f 6e 74 |section{|I/O Cont|
|00002dd0| 72 6f 6c 7d 0a 0a 5c 23 | 69 6e 63 6c 75 64 65 20 |rol}..\#|include |
|00002de0| 5c 3c 69 6f 63 74 6c 2e | 68 3e 0a 0a 5c 66 75 6e |\<ioctl.|h>..\fun|
|00002df0| 63 74 69 6f 6e 7b 69 6e | 74 20 69 6f 63 74 6c 28 |ction{in|t ioctl(|
|00002e00| 69 6e 74 20 66 64 2c 20 | 69 6e 74 20 63 6d 64 2c |int fd, |int cmd,|
|00002e10| 20 76 6f 69 64 20 5c 2a | 61 72 67 29 3b 7d 0a 5c | void \*|arg);}.\|
|00002e20| 65 78 70 6c 7b 53 65 74 | 20 6f 72 20 69 6e 71 75 |expl{Set| or inqu|
|00002e30| 69 72 65 20 69 2f 6f 20 | 64 65 70 65 6e 64 65 6e |ire i/o |dependen|
|00002e40| 64 20 70 61 72 61 6d 65 | 74 65 72 2e 7d 0a 0a 5c |d parame|ter.}..\|
|00002e50| 66 75 6e 63 74 69 6f 6e | 7b 69 6e 74 20 73 74 74 |function|{int stt|
|00002e60| 79 28 69 6e 74 20 66 64 | 2c 20 73 74 72 75 63 74 |y(int fd|, struct|
|00002e70| 20 73 67 74 74 79 62 20 | 5c 2a 5c 5f 74 74 79 29 | sgttyb |\*\_tty)|
|00002e80| 3b 7d 0a 5c 66 75 6e 63 | 74 69 6f 6e 7b 69 6e 74 |;}.\func|tion{int|
|00002e90| 20 67 74 74 79 28 69 6e | 74 20 66 64 2c 20 73 74 | gtty(in|t fd, st|
|00002ea0| 72 75 63 74 20 73 67 74 | 74 79 62 20 5c 2a 5c 5f |ruct sgt|tyb \*\_|
|00002eb0| 74 74 79 29 3b 7d 0a 5c | 65 78 70 6c 7b 53 65 74 |tty);}.\|expl{Set|
|00002ec0| 20 6f 72 20 69 6e 71 75 | 69 72 65 20 69 2f 6f 20 | or inqu|ire i/o |
|00002ed0| 70 61 72 61 6d 65 74 65 | 72 73 20 66 6f 72 20 64 |paramete|rs for d|
|00002ee0| 65 73 63 72 69 70 74 6f | 72 20 7b 5c 73 6c 20 66 |escripto|r {\sl f|
|00002ef0| 64 7d 2e 7d 0a 5c 6d 65 | 64 73 6b 69 70 0a 5c 23 |d}.}.\me|dskip.\#|
|00002f00| 69 6e 63 6c 75 64 65 20 | 5c 3c 66 63 6e 74 6c 2e |include |\<fcntl.|
|00002f10| 68 3e 0a 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 69 6e |h>..\fun|ction{in|
|00002f20| 74 20 66 63 6e 74 6c 28 | 69 6e 74 20 66 64 2c 20 |t fcntl(|int fd, |
|00002f30| 69 6e 74 20 63 6d 64 2c | 20 76 6f 69 64 20 5c 2a |int cmd,| void \*|
|00002f40| 61 72 67 29 3b 7d 0a 5c | 65 78 70 6c 7b 53 65 74 |arg);}.\|expl{Set|
|00002f50| 20 6f 72 20 69 6e 71 75 | 69 72 65 20 66 69 6c 65 | or inqu|ire file|
|00002f60| 20 69 2f 6f 20 64 65 70 | 65 6e 64 65 6e 64 20 70 | i/o dep|endend p|
|00002f70| 61 72 61 6d 65 74 65 72 | 20 28 4d 69 4e 54 29 2e |arameter| (MiNT).|
|00002f80| 7d 0a 0a 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |}..%%%%%|%%%%%%%%|
|00002f90| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002fa0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002fb0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 0a |%%%%%%%%|%%%%%%%.|
|00002fc0| 0c 0a 5c 73 65 63 74 69 | 6f 6e 7b 4d 65 6d 6f 72 |..\secti|on{Memor|
|00002fd0| 79 20 4d 61 6e 61 67 65 | 6d 65 6e 74 7d 0a 0a 5c |y Manage|ment}..\|
|00002fe0| 23 69 6e 63 6c 75 64 65 | 20 5c 3c 73 74 64 6c 69 |#include| \<stdli|
|00002ff0| 62 2e 68 3e 0a 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |b.h>..\f|unction{|
|00003000| 76 6f 69 64 20 5c 2a 63 | 61 6c 6c 6f 63 28 73 69 |void \*c|alloc(si|
|00003010| 7a 65 5c 5f 74 20 6e 6f | 2c 20 73 69 7a 65 5c 5f |ze\_t no|, size\_|
|00003020| 74 20 73 7a 29 3b 7d 0a | 5c 65 78 70 6c 7b 41 6c |t sz);}.|\expl{Al|
|00003030| 6c 6f 63 61 74 65 20 61 | 6e 64 20 69 6e 69 74 69 |locate a|nd initi|
|00003040| 61 6c 69 7a 65 20 6d 65 | 6d 6f 72 79 20 66 6f 72 |alize me|mory for|
|00003050| 20 7b 5c 73 6c 20 6e 6f | 7d 20 69 74 65 6d 73 20 | {\sl no|} items |
|00003060| 6f 66 20 73 69 7a 65 20 | 7b 5c 73 6c 20 73 69 7a |of size |{\sl siz|
|00003070| 65 7d 2e 7d 0a 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |e}.}..\f|unction{|
|00003080| 76 6f 69 64 20 5c 2a 6d | 61 6c 6c 6f 63 28 73 69 |void \*m|alloc(si|
|00003090| 7a 65 5c 5f 74 20 73 7a | 29 3b 7d 0a 5c 65 78 70 |ze\_t sz|);}.\exp|
|000030a0| 6c 7b 41 6c 6c 6f 63 61 | 74 65 20 7b 5c 73 6c 20 |l{Alloca|te {\sl |
|000030b0| 73 7a 7d 20 62 79 74 65 | 73 20 6f 66 20 6d 65 6d |sz} byte|s of mem|
|000030c0| 6f 72 79 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |ory.}..\|function|
|000030d0| 7b 76 6f 69 64 20 5c 2a | 72 65 61 6c 6c 6f 63 28 |{void \*|realloc(|
|000030e0| 76 6f 69 64 20 5c 2a 70 | 74 72 2c 20 73 69 7a 65 |void \*p|tr, size|
|000030f0| 5c 5f 74 20 73 7a 29 3b | 7d 0a 5c 65 78 70 6c 7b |\_t sz);|}.\expl{|
|00003100| 52 65 73 69 7a 65 20 6d | 65 6d 6f 72 79 20 70 6f |Resize m|emory po|
|00003110| 69 6e 74 65 64 20 74 6f | 20 62 79 20 7b 5c 73 6c |inted to| by {\sl|
|00003120| 20 70 74 72 7d 20 74 6f | 20 73 69 7a 65 20 7b 5c | ptr} to| size {\|
|00003130| 73 6c 20 73 7a 7d 2e 7d | 0a 0a 5c 66 75 6e 63 74 |sl sz}.}|..\funct|
|00003140| 69 6f 6e 7b 76 6f 69 64 | 20 66 72 65 65 28 76 6f |ion{void| free(vo|
|00003150| 69 64 20 5c 2a 70 74 72 | 29 3b 7d 0a 5c 65 78 70 |id \*ptr|);}.\exp|
|00003160| 6c 7b 46 72 65 65 20 6d | 65 6d 6f 72 79 20 6f 62 |l{Free m|emory ob|
|00003170| 74 61 69 6e 65 64 20 62 | 79 20 7b 5c 62 66 20 63 |tained b|y {\bf c|
|00003180| 61 6c 6c 6f 63 7d 2c 20 | 7b 5c 62 66 20 6d 61 6c |alloc}, |{\bf mal|
|00003190| 6c 6f 63 7d 20 6f 72 20 | 7b 5c 62 66 20 72 65 61 |loc} or |{\bf rea|
|000031a0| 6c 6c 6f 63 7d 2e 7d 0a | 0a 5c 66 75 6e 63 74 69 |lloc}.}.|.\functi|
|000031b0| 6f 6e 7b 76 6f 69 64 20 | 5c 2a 61 6c 6c 6f 63 61 |on{void |\*alloca|
|000031c0| 28 73 69 7a 65 5c 5f 74 | 20 73 7a 29 3b 7d 0a 5c |(size\_t| sz);}.\|
|000031d0| 65 78 70 6c 7b 41 6c 6c | 6f 63 61 74 65 20 7b 5c |expl{All|ocate {\|
|000031e0| 73 6c 20 73 7a 7d 20 62 | 79 74 65 73 20 66 72 6f |sl sz} b|ytes fro|
|000031f0| 6d 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 66 75 |m the cu|rrent fu|
|00003200| 6e 63 74 69 6f 6e 20 73 | 74 61 63 6b 2e 7d 0a 0a |nction s|tack.}..|
|00003210| 5c 66 75 6e 63 74 69 6f | 6e 7b 76 6f 69 64 20 5c |\functio|n{void \|
|00003220| 5f 6d 61 6c 6c 6f 63 7a | 65 72 6f 28 69 6e 74 20 |_mallocz|ero(int |
|00003230| 62 6f 6f 6c 29 3b 7d 0a | 5c 65 78 70 6c 7b 5a 65 |bool);}.|\expl{Ze|
|00003240| 72 6f 20 61 6c 6c 6f 63 | 61 74 65 64 20 6d 65 6d |ro alloc|ated mem|
|00003250| 6f 72 79 20 62 6c 6f 63 | 6b 73 2e 20 44 65 66 61 |ory bloc|ks. Defa|
|00003260| 75 6c 74 20 24 3d 3d 24 | 20 66 61 6c 73 65 2e 7d |ult $==$| false.}|
|00003270| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 76 6f 69 64 |..\funct|ion{void|
|00003280| 20 5c 5f 6d 61 6c 6c 6f | 63 43 68 75 6e 6b 53 69 | \_mallo|cChunkSi|
|00003290| 7a 65 28 73 69 7a 65 5c | 5f 74 20 53 69 7a 29 3b |ze(size\|_t Siz);|
|000032a0| 7d 0a 5c 65 78 70 6c 7b | 47 65 74 20 6d 65 6d 6f |}.\expl{|Get memo|
|000032b0| 72 79 20 66 72 6f 6d 20 | 4f 53 20 69 6e 20 61 74 |ry from |OS in at|
|000032c0| 6c 65 61 73 74 20 7b 5c | 73 6c 20 53 69 7a 7d 20 |least {\|sl Siz} |
|000032d0| 73 69 7a 65 64 20 62 6c | 6f 63 6b 73 2e 20 44 65 |sized bl|ocks. De|
|000032e0| 66 61 75 6c 74 0a 24 3d | 3d 24 20 34 4b 7d 0a 5c |fault.$=|=$ 4K}.\|
|000032f0| 6d 65 64 73 6b 69 70 0a | 5c 23 69 6e 63 6c 75 64 |medskip.|\#includ|
|00003300| 65 20 5c 3c 6d 65 6d 6f | 72 79 2e 68 3e 0a 0a 5c |e \<memo|ry.h>..\|
|00003310| 66 75 6e 63 74 69 6f 6e | 7b 76 6f 69 64 20 5c 2a |function|{void \*|
|00003320| 63 6c 61 6c 6c 6f 63 28 | 6c 6f 6e 67 20 6e 6f 2c |clalloc(|long no,|
|00003330| 20 6c 6f 6e 67 20 73 7a | 29 3b 7d 0a 5c 66 75 6e | long sz|);}.\fun|
|00003340| 63 74 69 6f 6e 7b 76 6f | 69 64 20 5c 2a 6d 6c 61 |ction{vo|id \*mla|
|00003350| 6c 6c 6f 63 28 6c 6f 6e | 67 20 73 7a 29 3b 7d 0a |lloc(lon|g sz);}.|
|00003360| 5c 66 75 6e 63 74 69 6f | 6e 7b 76 6f 69 64 20 5c |\functio|n{void \|
|00003370| 2a 72 65 6c 61 6c 6c 6f | 63 28 76 6f 69 64 20 5c |*relallo|c(void \|
|00003380| 2a 70 74 72 2c 20 6c 6f | 6e 67 20 73 7a 29 3b 7d |*ptr, lo|ng sz);}|
|00003390| 0a 5c 65 78 70 6c 7b 41 | 70 61 72 74 20 66 72 6f |.\expl{A|part fro|
|000033a0| 6d 20 74 68 65 20 61 62 | 6f 76 65 20 66 75 6e 63 |m the ab|ove func|
|000033b0| 74 69 6f 6e 73 2c 20 74 | 68 65 73 65 20 74 68 72 |tions, t|hese thr|
|000033c0| 65 65 20 66 75 6e 63 74 | 69 6f 6e 73 20 61 72 65 |ee funct|ions are|
|000033d0| 0a 61 64 64 69 74 69 6f | 6e 61 6c 6c 79 20 64 65 |.additio|nally de|
|000033e0| 63 6c 61 72 65 64 20 69 | 6e 20 6d 65 6d 6f 72 79 |clared i|n memory|
|000033f0| 2e 68 20 61 6e 64 20 74 | 61 6b 65 20 7b 5c 73 6c |.h and t|ake {\sl|
|00003400| 20 6c 6f 6e 67 7d 20 61 | 72 67 75 6d 65 6e 74 73 | long} a|rguments|
|00003410| 2e 7d 0a 0a 25 25 25 25 | 25 25 25 25 25 25 25 25 |.}..%%%%|%%%%%%%%|
|00003420| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003430| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003440| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003450| 0a 0c 0a 5c 73 65 63 74 | 69 6f 6e 7b 43 68 61 72 |...\sect|ion{Char|
|00003460| 61 63 74 65 72 20 43 6c | 61 73 73 69 66 69 63 61 |acter Cl|assifica|
|00003470| 74 69 6f 6e 20 61 6e 64 | 20 43 6f 6e 76 65 72 73 |tion and| Convers|
|00003480| 69 6f 6e 7d 0a 0a 54 68 | 65 20 66 6f 6c 6c 6f 77 |ion}..Th|e follow|
|00003490| 69 6e 67 20 66 75 6e 63 | 74 69 6f 6e 73 20 72 65 |ing func|tions re|
|000034a0| 74 75 72 6e 20 24 5c 6e | 65 24 20 30 2c 20 69 66 |turn $\n|e$ 0, if|
|000034b0| 20 63 68 61 72 61 63 74 | 65 72 20 7b 5c 73 6c 20 | charact|er {\sl |
|000034c0| 63 7d 20 62 65 6c 6f 6e | 67 73 0a 74 6f 20 74 68 |c} belon|gs.to th|
|000034d0| 65 20 73 70 65 63 69 66 | 69 65 64 20 63 68 61 72 |e specif|ied char|
|000034e0| 61 63 74 65 72 20 73 65 | 74 3b 20 30 20 6f 74 68 |acter se|t; 0 oth|
|000034f0| 65 72 77 69 73 65 2e 0a | 0a 5c 23 69 6e 63 6c 75 |erwise..|.\#inclu|
|00003500| 64 65 20 5c 3c 63 74 79 | 70 65 2e 68 3e 0a 0a 5c |de \<cty|pe.h>..\|
|00003510| 70 61 72 61 6c 69 67 6e | 7b 7b 5c 62 66 20 23 7d |paralign|{{\bf #}|
|00003520| 28 7b 5c 73 6c 20 63 7d | 29 5c 68 66 69 6c 5c 71 |({\sl c}|)\hfil\q|
|00003530| 75 61 64 26 23 5c 68 66 | 69 6c 5c 63 72 0a 20 20 |uad&#\hf|il\cr. |
|00003540| 5c 6f 6d 69 74 5c 72 6d | 20 66 75 6e 63 74 69 6f |\omit\rm| functio|
|00003550| 6e 5c 68 66 69 6c 5c 71 | 75 61 64 26 73 65 74 5c |n\hfil\q|uad&set\|
|00003560| 63 72 5c 6e 6f 61 6c 69 | 67 6e 7b 5c 76 73 6b 69 |cr\noali|gn{\vski|
|00003570| 70 20 33 70 74 7d 0a 20 | 20 5c 74 77 6f 63 6f 6c |p 3pt}. | \twocol|
|00003580| 7b 69 73 61 6c 6e 75 6d | 7d 7b 4c 65 74 74 65 72 |{isalnum|}{Letter|
|00003590| 20 6f 72 20 44 69 67 69 | 74 7d 0a 20 20 5c 74 77 | or Digi|t}. \tw|
|000035a0| 6f 63 6f 6c 7b 69 73 61 | 6c 70 68 61 7d 7b 4c 65 |ocol{isa|lpha}{Le|
|000035b0| 74 74 65 72 7d 0a 20 20 | 5c 74 77 6f 63 6f 6c 7b |tter}. |\twocol{|
|000035c0| 69 73 61 73 63 69 69 7d | 7b 41 53 43 49 49 20 63 |isascii}|{ASCII c|
|000035d0| 68 61 72 61 63 74 65 72 | 20 28 43 6f 64 65 73 3a |haracter| (Codes:|
|000035e0| 20 30 24 5c 6c 64 6f 74 | 73 24 30 31 37 37 29 7d | 0$\ldot|s$0177)}|
|000035f0| 0a 20 20 5c 74 77 6f 63 | 6f 6c 7b 69 73 63 6e 74 |. \twoc|ol{iscnt|
|00003600| 72 6c 7d 7b 43 6f 6e 74 | 72 6f 6c 20 63 68 61 72 |rl}{Cont|rol char|
|00003610| 61 63 74 65 72 20 28 43 | 6f 64 65 73 3a 20 30 24 |acter (C|odes: 0$|
|00003620| 5c 6c 64 6f 74 73 24 30 | 33 37 2c 20 30 31 37 37 |\ldots$0|37, 0177|
|00003630| 29 7d 0a 20 20 5c 74 77 | 6f 63 6f 6c 7b 69 73 64 |)}. \tw|ocol{isd|
|00003640| 69 67 69 74 7d 7b 44 69 | 67 69 74 7d 0a 20 20 5c |igit}{Di|git}. \|
|00003650| 74 77 6f 63 6f 6c 7b 69 | 73 67 72 61 70 68 7d 7b |twocol{i|sgraph}{|
|00003660| 50 72 69 6e 74 61 62 6c | 65 20 63 68 61 72 61 63 |Printabl|e charac|
|00003670| 74 65 72 20 65 78 63 65 | 70 74 20 73 70 61 63 65 |ter exce|pt space|
|00003680| 7d 0a 20 20 5c 74 77 6f | 63 6f 6c 7b 69 73 6c 6f |}. \two|col{islo|
|00003690| 77 65 72 7d 7b 4c 6f 77 | 65 72 63 61 73 65 20 6c |wer}{Low|ercase l|
|000036a0| 65 74 74 65 72 7d 0a 20 | 20 5c 74 77 6f 63 6f 6c |etter}. | \twocol|
|000036b0| 7b 69 73 70 72 69 6e 74 | 7d 7b 50 72 69 6e 74 61 |{isprint|}{Printa|
|000036c0| 62 6c 65 20 63 68 61 72 | 61 63 74 65 72 7d 0a 20 |ble char|acter}. |
|000036d0| 20 5c 74 77 6f 63 6f 6c | 7b 69 73 70 75 6e 63 74 | \twocol|{ispunct|
|000036e0| 7d 7b 50 75 6e 63 74 75 | 61 74 69 6f 6e 20 63 68 |}{Punctu|ation ch|
|000036f0| 61 72 2e 20 28 6e 6f 74 | 20 6c 65 74 74 65 72 2c |ar. (not| letter,|
|00003700| 20 64 69 67 69 74 20 6f | 72 20 63 6f 6e 74 72 6f | digit o|r contro|
|00003710| 6c 29 7d 0a 20 20 5c 74 | 77 6f 63 6f 6c 7b 69 73 |l)}. \t|wocol{is|
|00003720| 73 70 61 63 65 7d 7b 53 | 70 61 63 65 2c 20 54 61 |space}{S|pace, Ta|
|00003730| 62 2c 20 43 52 2c 20 4e | 4c 2c 20 56 54 2c 20 46 |b, CR, N|L, VT, F|
|00003740| 46 20 6f 72 20 42 53 7d | 0a 20 20 5c 74 77 6f 63 |F or BS}|. \twoc|
|00003750| 6f 6c 7b 69 73 75 70 70 | 65 72 7d 7b 55 70 70 65 |ol{isupp|er}{Uppe|
|00003760| 72 63 61 73 65 20 6c 65 | 74 74 65 72 7d 0a 20 20 |rcase le|tter}. |
|00003770| 5c 74 77 6f 63 6f 6c 7b | 69 73 78 64 69 67 69 74 |\twocol{|isxdigit|
|00003780| 7d 7b 48 65 78 61 64 65 | 63 69 6d 61 6c 20 64 69 |}{Hexade|cimal di|
|00003790| 67 69 74 7d 0a 20 20 5c | 74 77 6f 63 6f 6c 7b 69 |git}. \|twocol{i|
|000037a0| 73 77 68 69 74 65 7d 7b | 73 61 6d 65 20 61 73 20 |swhite}{|same as |
|000037b0| 69 73 70 61 63 65 28 29 | 7d 0a 20 20 5c 74 77 6f |ispace()|}. \two|
|000037c0| 63 6f 6c 7b 69 73 6f 64 | 69 67 69 74 7d 7b 4f 63 |col{isod|igit}{Oc|
|000037d0| 74 61 6c 20 64 69 67 69 | 74 7d 0a 20 20 5c 74 77 |tal digi|t}. \tw|
|000037e0| 6f 63 6f 6c 7b 69 73 63 | 79 6d 66 7d 7b 43 68 61 |ocol{isc|ymf}{Cha|
|000037f0| 72 61 63 74 65 72 20 73 | 74 61 72 74 69 6e 67 20 |racter s|tarting |
|00003800| 61 20 43 20 69 64 65 6e | 74 69 66 69 65 72 7d 0a |a C iden|tifier}.|
|00003810| 20 20 5c 74 77 6f 63 6f | 6c 7b 69 73 63 79 6d 7d | \twoco|l{iscym}|
|00003820| 7b 43 68 61 72 61 63 74 | 65 72 73 20 63 6f 6e 74 |{Charact|ers cont|
|00003830| 69 6e 75 69 6e 67 20 61 | 20 43 20 69 64 65 6e 74 |inuing a| C ident|
|00003840| 69 66 69 65 72 7d 0a 7d | 0a 0a 43 68 61 72 61 63 |ifier}.}|..Charac|
|00003850| 74 65 72 20 63 6f 6e 76 | 65 72 73 69 6f 6e 20 66 |ter conv|ersion f|
|00003860| 75 6e 63 74 69 6f 6e 73 | 0a 0a 5c 70 61 72 61 6c |unctions|..\paral|
|00003870| 69 67 6e 7b 7b 5c 62 66 | 20 23 7d 28 7b 5c 73 6c |ign{{\bf| #}({\sl|
|00003880| 20 63 7d 29 5c 68 66 69 | 6c 5c 71 75 61 64 26 23 | c})\hfi|l\quad&#|
|00003890| 5c 68 66 69 6c 5c 63 72 | 0a 20 20 5c 6f 6d 69 74 |\hfil\cr|. \omit|
|000038a0| 5c 72 6d 20 66 75 6e 63 | 74 69 6f 6e 5c 68 66 69 |\rm func|tion\hfi|
|000038b0| 6c 5c 71 75 61 64 26 4d | 65 61 6e 69 6e 67 5c 63 |l\quad&M|eaning\c|
|000038c0| 72 5c 6e 6f 61 6c 69 67 | 6e 7b 5c 76 73 6b 69 70 |r\noalig|n{\vskip|
|000038d0| 20 33 70 74 7d 0a 20 20 | 5c 74 77 6f 63 6f 6c 7b | 3pt}. |\twocol{|
|000038e0| 74 6f 75 70 70 65 72 7d | 7b 43 6f 6e 76 65 72 74 |toupper}|{Convert|
|000038f0| 20 74 6f 20 75 70 70 65 | 72 63 61 73 65 20 6c 65 | to uppe|rcase le|
|00003900| 74 74 65 72 7d 0a 20 20 | 5c 74 77 6f 63 6f 6c 7b |tter}. |\twocol{|
|00003910| 5c 5f 74 6f 75 70 70 65 | 72 7d 7b 43 6f 6e 76 65 |\_touppe|r}{Conve|
|00003920| 72 74 20 74 6f 20 75 70 | 70 65 72 63 61 73 65 20 |rt to up|percase |
|00003930| 6c 65 74 74 65 72 20 28 | 6d 61 63 72 6f 29 7d 0a |letter (|macro)}.|
|00003940| 20 20 5c 74 77 6f 63 6f | 6c 7b 74 6f 6c 6f 77 65 | \twoco|l{tolowe|
|00003950| 72 7d 7b 43 6f 6e 76 65 | 72 74 20 74 6f 20 6c 6f |r}{Conve|rt to lo|
|00003960| 77 65 72 63 61 73 65 20 | 6c 65 74 74 65 72 7d 0a |wercase |letter}.|
|00003970| 20 20 5c 74 77 6f 63 6f | 6c 7b 5c 5f 74 6f 6c 6f | \twoco|l{\_tolo|
|00003980| 77 65 72 7d 7b 43 6f 6e | 76 65 72 74 20 74 6f 20 |wer}{Con|vert to |
|00003990| 6c 6f 77 65 72 63 61 73 | 65 20 6c 65 74 74 65 72 |lowercas|e letter|
|000039a0| 20 28 6d 61 63 72 6f 29 | 7d 0a 20 20 5c 74 77 6f | (macro)|}. \two|
|000039b0| 63 6f 6c 7b 74 6f 69 6e | 74 7d 7b 43 6f 6e 76 65 |col{toin|t}{Conve|
|000039c0| 72 74 20 64 69 67 69 74 | 20 74 6f 20 69 6e 74 65 |rt digit| to inte|
|000039d0| 67 65 72 7d 0a 7d 0a 0a | 25 25 25 25 25 25 25 25 |ger}.}..|%%%%%%%%|
|000039e0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000039f0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003a00| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00003a10| 25 25 25 25 0a 0c 0a 5c | 73 65 63 74 69 6f 6e 7b |%%%%...\|section{|
|00003a20| 53 74 72 69 6e 67 20 48 | 61 6e 64 6c 69 6e 67 7d |String H|andling}|
|00003a30| 0a 0a 5c 23 69 6e 63 6c | 75 64 65 20 5c 3c 73 74 |..\#incl|ude \<st|
|00003a40| 72 69 6e 67 2e 68 3e 0a | 0a 5c 66 75 6e 63 74 69 |ring.h>.|.\functi|
|00003a50| 6f 6e 7b 69 6e 74 20 62 | 63 6d 70 28 63 6f 6e 73 |on{int b|cmp(cons|
|00003a60| 74 7e 76 6f 69 64 20 5c | 2a 70 74 72 31 2c 20 63 |t~void \|*ptr1, c|
|00003a70| 6f 6e 73 74 7e 76 6f 69 | 64 20 5c 2a 70 74 72 32 |onst~voi|d \*ptr2|
|00003a80| 2c 20 73 69 7a 65 5c 5f | 74 20 6e 6f 29 3b 7d 0a |, size\_|t no);}.|
|00003a90| 5c 65 78 70 6c 7b 43 6f | 6d 70 61 72 65 20 7b 5c |\expl{Co|mpare {\|
|00003aa0| 73 6c 20 6e 6f 7d 20 6f | 66 20 62 79 74 65 73 20 |sl no} o|f bytes |
|00003ab0| 61 74 20 70 6f 73 69 74 | 69 6f 6e 20 7b 5c 73 6c |at posit|ion {\sl|
|00003ac0| 20 70 74 72 31 7d 20 77 | 69 74 68 20 7b 5c 73 6c | ptr1} w|ith {\sl|
|00003ad0| 20 70 74 72 32 7d 2e 7d | 0a 0a 5c 66 75 6e 63 74 | ptr2}.}|..\funct|
|00003ae0| 69 6f 6e 7b 76 6f 69 64 | 20 62 63 6f 70 79 28 63 |ion{void| bcopy(c|
|00003af0| 6f 6e 73 74 7e 76 6f 69 | 64 20 5c 2a 73 72 63 2c |onst~voi|d \*src,|
|00003b00| 20 76 6f 69 64 20 5c 2a | 64 73 74 2c 20 73 69 7a | void \*|dst, siz|
|00003b10| 65 5c 5f 74 20 6c 65 6e | 29 3b 7d 0a 5c 65 78 70 |e\_t len|);}.\exp|
|00003b20| 6c 7b 43 6f 70 79 20 7b | 5c 73 6c 20 6c 65 6e 7d |l{Copy {|\sl len}|
|00003b30| 20 62 79 74 65 73 20 66 | 72 6f 6d 20 70 6f 73 69 | bytes f|rom posi|
|00003b40| 74 69 6f 6e 20 7b 5c 73 | 6c 20 73 72 63 7d 20 74 |tion {\s|l src} t|
|00003b50| 6f 20 7b 5c 73 6c 20 64 | 73 74 7d 2e 7d 0a 0a 5c |o {\sl d|st}.}..\|
|00003b60| 66 75 6e 63 74 69 6f 6e | 7b 76 6f 69 64 20 62 7a |function|{void bz|
|00003b70| 65 72 6f 28 76 6f 69 64 | 20 5c 2a 64 73 74 2c 20 |ero(void| \*dst, |
|00003b80| 73 69 7a 65 5c 5f 74 20 | 6c 65 6e 29 3b 7d 0a 5c |size\_t |len);}.\|
|00003b90| 65 78 70 6c 7b 53 65 74 | 20 7b 5c 73 6c 20 6c 65 |expl{Set| {\sl le|
|00003ba0| 6e 7d 20 62 79 74 65 73 | 20 61 74 20 70 6f 73 69 |n} bytes| at posi|
|00003bb0| 74 69 6f 6e 20 7b 5c 73 | 6c 20 64 73 74 7d 20 74 |tion {\s|l dst} t|
|00003bc0| 6f 20 30 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |o 0.}..\|function|
|00003bd0| 7b 63 68 61 72 20 5c 2a | 69 6e 64 65 78 28 63 6f |{char \*|index(co|
|00003be0| 6e 73 74 7e 63 68 61 72 | 20 5c 2a 73 74 72 2c 20 |nst~char| \*str, |
|00003bf0| 69 6e 74 20 63 68 61 72 | 77 29 3b 7d 0a 5c 65 78 |int char|w);}.\ex|
|00003c00| 70 6c 7b 53 61 6d 65 20 | 61 73 20 7b 5c 62 66 20 |pl{Same |as {\bf |
|00003c10| 73 74 72 63 68 72 7d 2e | 7d 0a 0a 5c 66 75 6e 63 |strchr}.|}..\func|
|00003c20| 74 69 6f 6e 7b 76 6f 69 | 64 20 5c 2a 6d 65 6d 63 |tion{voi|d \*memc|
|00003c30| 63 70 79 28 76 6f 69 64 | 20 5c 2a 64 73 74 2c 20 |cpy(void| \*dst, |
|00003c40| 63 6f 6e 73 74 7e 76 6f | 69 64 20 5c 2a 73 72 63 |const~vo|id \*src|
|00003c50| 2c 20 69 6e 74 20 75 63 | 68 61 72 73 74 6f 70 2c |, int uc|harstop,|
|00003c60| 20 73 69 7a 65 5c 5f 74 | 20 6e 6f 29 3b 7d 0a 5c | size\_t| no);}.\|
|00003c70| 65 78 70 6c 7b 43 6f 70 | 79 20 63 68 61 72 61 63 |expl{Cop|y charac|
|00003c80| 74 65 72 73 20 66 72 6f | 6d 20 7b 5c 73 6c 20 73 |ters fro|m {\sl s|
|00003c90| 72 63 7d 20 74 6f 20 7b | 5c 73 6c 20 64 73 74 7d |rc} to {|\sl dst}|
|00003ca0| 20 75 6e 74 69 6c 20 63 | 68 61 72 61 63 74 65 72 | until c|haracter|
|00003cb0| 20 7b 5c 73 6c 0a 75 63 | 68 61 72 5c 2d 73 74 6f | {\sl.uc|har\-sto|
|00003cc0| 70 7d 2c 20 62 75 74 20 | 63 6f 70 79 20 61 74 20 |p}, but |copy at |
|00003cd0| 6d 6f 73 74 20 7b 5c 73 | 6c 20 6e 6f 7d 20 62 79 |most {\s|l no} by|
|00003ce0| 74 65 73 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |tes.}..\|function|
|00003cf0| 7b 76 6f 69 64 20 5c 2a | 6d 65 6d 63 68 72 28 63 |{void \*|memchr(c|
|00003d00| 6f 6e 73 74 7e 76 6f 69 | 64 20 5c 2a 70 74 72 2c |onst~voi|d \*ptr,|
|00003d10| 20 69 6e 74 20 75 63 68 | 61 72 77 61 6e 74 65 64 | int uch|arwanted|
|00003d20| 2c 20 73 69 7a 65 5c 5f | 74 20 6e 6f 29 3b 7d 0a |, size\_|t no);}.|
|00003d30| 5c 65 78 70 6c 7b 46 69 | 6e 64 20 63 68 61 72 61 |\expl{Fi|nd chara|
|00003d40| 63 74 65 72 20 7b 5c 73 | 6c 20 75 63 68 61 72 77 |cter {\s|l ucharw|
|00003d50| 61 6e 74 65 64 7d 20 69 | 6e 20 61 72 65 61 20 61 |anted} i|n area a|
|00003d60| 74 20 7b 5c 73 6c 20 70 | 74 72 7d 2c 20 62 75 74 |t {\sl p|tr}, but|
|00003d70| 0a 63 6f 6d 70 61 72 65 | 20 61 74 20 6d 6f 73 74 |.compare| at most|
|00003d80| 20 7b 5c 73 6c 20 6e 6f | 7d 20 63 68 61 72 61 63 | {\sl no|} charac|
|00003d90| 74 65 72 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |ter.}..\|function|
|00003da0| 7b 69 6e 74 20 6d 65 6d | 63 6d 70 28 63 6f 6e 73 |{int mem|cmp(cons|
|00003db0| 74 7e 76 6f 69 64 20 5c | 2a 70 74 72 31 2c 20 63 |t~void \|*ptr1, c|
|00003dc0| 6f 6e 73 74 7e 76 6f 69 | 64 20 5c 2a 70 74 72 32 |onst~voi|d \*ptr2|
|00003dd0| 2c 20 73 69 7a 65 5c 5f | 74 20 6e 6f 29 3b 7d 0a |, size\_|t no);}.|
|00003de0| 5c 65 78 70 6c 7b 43 6f | 6d 70 61 72 65 20 7b 5c |\expl{Co|mpare {\|
|00003df0| 73 6c 20 6e 6f 7d 20 62 | 79 74 65 73 20 66 72 6f |sl no} b|ytes fro|
|00003e00| 6d 20 6d 65 6d 6f 72 79 | 20 61 72 65 61 20 61 74 |m memory| area at|
|00003e10| 20 7b 5c 73 6c 20 70 74 | 72 31 7d 20 77 69 74 68 | {\sl pt|r1} with|
|00003e20| 20 61 72 65 61 0a 61 74 | 20 7b 5c 73 6c 20 70 74 | area.at| {\sl pt|
|00003e30| 72 32 7d 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |r2}.}..\|function|
|00003e40| 7b 76 6f 69 64 20 5c 2a | 6d 65 6d 63 70 79 28 76 |{void \*|memcpy(v|
|00003e50| 6f 69 64 20 5c 2a 64 73 | 74 2c 20 63 6f 6e 73 74 |oid \*ds|t, const|
|00003e60| 7e 76 6f 69 64 20 5c 2a | 73 72 63 2c 20 73 69 7a |~void \*|src, siz|
|00003e70| 65 5c 5f 74 20 6e 6f 29 | 3b 7d 0a 5c 65 78 70 6c |e\_t no)|;}.\expl|
|00003e80| 7b 43 6f 70 79 20 7b 5c | 73 6c 20 6e 6f 7d 20 6f |{Copy {\|sl no} o|
|00003e90| 66 20 62 79 74 65 73 20 | 66 72 6f 6d 20 61 72 65 |f bytes |from are|
|00003ea0| 61 20 61 74 20 7b 5c 73 | 6c 20 73 72 63 7d 20 74 |a at {\s|l src} t|
|00003eb0| 6f 20 7b 5c 73 6c 20 64 | 73 74 7d 2e 7d 0a 0a 5c |o {\sl d|st}.}..\|
|00003ec0| 66 75 6e 63 74 69 6f 6e | 7b 76 6f 69 64 20 5c 2a |function|{void \*|
|00003ed0| 6d 65 6d 73 65 74 28 76 | 6f 69 64 20 5c 2a 70 74 |memset(v|oid \*pt|
|00003ee0| 72 2c 20 69 6e 74 20 75 | 63 68 61 72 66 69 6c 6c |r, int u|charfill|
|00003ef0| 2c 20 73 69 7a 65 5c 5f | 74 20 6e 6f 29 3b 7d 0a |, size\_|t no);}.|
|00003f00| 5c 65 78 70 6c 7b 53 65 | 74 20 7b 5c 73 6c 20 6e |\expl{Se|t {\sl n|
|00003f10| 6f 7d 20 6f 66 20 62 79 | 74 65 73 20 61 74 20 70 |o} of by|tes at p|
|00003f20| 6f 73 69 74 69 6f 6e 20 | 7b 5c 73 6c 20 70 74 72 |osition |{\sl ptr|
|00003f30| 7d 20 74 6f 20 63 68 61 | 72 61 63 74 65 72 20 7b |} to cha|racter {|
|00003f40| 5c 73 6c 0a 75 63 68 61 | 72 66 69 6c 6c 7d 2e 7d |\sl.ucha|rfill}.}|
|00003f50| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 63 68 61 72 |..\funct|ion{char|
|00003f60| 20 5c 2a 72 69 6e 64 65 | 78 28 63 6f 6e 73 74 7e | \*rinde|x(const~|
|00003f70| 63 68 61 72 20 5c 2a 73 | 74 72 2c 20 69 6e 74 20 |char \*s|tr, int |
|00003f80| 63 68 61 72 77 29 3b 7d | 0a 5c 65 78 70 6c 7b 53 |charw);}|.\expl{S|
|00003f90| 61 6d 65 20 61 73 20 7b | 5c 62 66 20 73 74 72 72 |ame as {|\bf strr|
|00003fa0| 63 68 72 7d 2e 7d 0a 0a | 5c 66 75 6e 63 74 69 6f |chr}.}..|\functio|
|00003fb0| 6e 7b 63 68 61 72 20 5c | 2a 73 74 72 63 61 74 28 |n{char \|*strcat(|
|00003fc0| 63 68 61 72 20 5c 2a 64 | 73 74 2c 20 63 6f 6e 73 |char \*d|st, cons|
|00003fd0| 74 7e 63 68 61 72 20 5c | 2a 73 72 63 29 3b 7d 0a |t~char \|*src);}.|
|00003fe0| 5c 65 78 70 6c 7b 43 6f | 6e 63 61 74 65 6e 61 74 |\expl{Co|ncatenat|
|00003ff0| 65 20 74 68 65 20 73 74 | 72 69 6e 67 20 61 74 20 |e the st|ring at |
|00004000| 7b 5c 73 6c 20 73 72 63 | 7d 20 74 6f 20 74 68 65 |{\sl src|} to the|
|00004010| 20 73 74 72 69 6e 67 20 | 61 74 20 7b 5c 73 6c 20 | string |at {\sl |
|00004020| 64 73 74 7d 2e 7d 0a 0a | 5c 66 75 6e 63 74 69 6f |dst}.}..|\functio|
|00004030| 6e 7b 63 68 61 72 20 5c | 2a 73 74 72 63 68 72 28 |n{char \|*strchr(|
|00004040| 63 6f 6e 73 74 7e 63 68 | 61 72 20 5c 2a 73 74 72 |const~ch|ar \*str|
|00004050| 2c 20 69 6e 74 20 63 68 | 61 72 77 29 3b 7d 0a 5c |, int ch|arw);}.\|
|00004060| 65 78 70 6c 7b 46 69 6e | 64 20 66 69 72 73 74 20 |expl{Fin|d first |
|00004070| 6f 63 63 75 72 65 6e 63 | 65 20 6f 66 20 63 68 61 |occurenc|e of cha|
|00004080| 72 61 63 74 65 72 20 7b | 5c 73 6c 20 63 68 61 72 |racter {|\sl char|
|00004090| 77 7d 20 69 6e 20 73 74 | 72 69 6e 67 20 7b 5c 73 |w} in st|ring {\s|
|000040a0| 6c 20 73 74 72 7d 2e 7d | 0a 0a 5c 66 75 6e 63 74 |l str}.}|..\funct|
|000040b0| 69 6f 6e 7b 69 6e 74 20 | 73 74 72 63 6d 70 28 63 |ion{int |strcmp(c|
|000040c0| 6f 6e 73 74 7e 63 68 61 | 72 20 5c 2a 73 74 72 31 |onst~cha|r \*str1|
|000040d0| 2c 20 63 6f 6e 73 74 7e | 63 68 61 72 20 5c 2a 73 |, const~|char \*s|
|000040e0| 74 72 32 29 3b 7d 0a 5c | 65 78 70 6c 7b 43 6f 6d |tr2);}.\|expl{Com|
|000040f0| 70 61 72 65 20 73 74 72 | 69 6e 67 20 7b 5c 73 6c |pare str|ing {\sl|
|00004100| 20 73 74 72 31 7d 20 77 | 69 74 68 20 73 74 72 69 | str1} w|ith stri|
|00004110| 6e 67 20 7b 5c 73 6c 20 | 73 74 72 31 7d 2e 7d 0a |ng {\sl |str1}.}.|
|00004120| 0a 5c 66 75 6e 63 74 69 | 6f 6e 7b 63 68 61 72 20 |.\functi|on{char |
|00004130| 5c 2a 73 74 72 63 70 79 | 28 63 68 61 72 20 5c 2a |\*strcpy|(char \*|
|00004140| 64 73 74 2c 20 63 6f 6e | 73 74 7e 63 68 61 72 20 |dst, con|st~char |
|00004150| 5c 2a 73 72 63 29 3b 7d | 0a 5c 65 78 70 6c 7b 43 |\*src);}|.\expl{C|
|00004160| 6f 70 79 20 73 74 72 69 | 6e 67 20 61 74 20 7b 5c |opy stri|ng at {\|
|00004170| 73 6c 20 73 72 63 7d 20 | 74 6f 20 7b 5c 73 6c 20 |sl src} |to {\sl |
|00004180| 64 73 74 7d 2e 7d 0a 0a | 5c 66 75 6e 63 74 69 6f |dst}.}..|\functio|
|00004190| 6e 7b 73 69 7a 65 5c 5f | 74 20 73 74 72 63 73 70 |n{size\_|t strcsp|
|000041a0| 6e 28 63 6f 6e 73 74 7e | 63 68 61 72 20 5c 2a 73 |n(const~|char \*s|
|000041b0| 74 72 2c 20 63 6f 6e 73 | 74 7e 63 68 61 72 20 5c |tr, cons|t~char \|
|000041c0| 2a 72 65 6a 29 3b 7d 0a | 5c 65 78 70 6c 7b 46 69 |*rej);}.|\expl{Fi|
|000041d0| 6e 64 20 6c 65 6e 67 74 | 68 20 6f 66 20 69 6e 69 |nd lengt|h of ini|
|000041e0| 74 69 61 6c 20 73 65 67 | 6d 65 6e 74 20 6f 66 20 |tial seg|ment of |
|000041f0| 7b 5c 73 6c 20 73 74 72 | 7d 20 63 6f 6e 73 69 73 |{\sl str|} consis|
|00004200| 74 69 6e 67 20 65 6e 74 | 69 72 65 6c 79 0a 6f 66 |ting ent|irely.of|
|00004210| 20 63 68 61 72 61 63 74 | 65 72 73 20 6e 6f 74 20 | charact|ers not |
|00004220| 66 72 6f 6d 20 7b 5c 73 | 6c 20 72 65 6a 7d 2e 7d |from {\s|l rej}.}|
|00004230| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 63 68 61 72 |..\funct|ion{char|
|00004240| 20 5c 2a 73 74 72 64 75 | 70 28 63 6f 6e 73 74 7e | \*strdu|p(const~|
|00004250| 63 68 61 72 20 5c 2a 73 | 74 72 29 3b 7d 0a 5c 65 |char \*s|tr);}.\e|
|00004260| 78 70 6c 7b 52 65 74 75 | 72 6e 20 61 20 64 75 70 |xpl{Retu|rn a dup|
|00004270| 6c 69 63 61 74 65 20 6f | 66 20 73 74 72 69 6e 67 |licate o|f string|
|00004280| 20 7b 5c 73 6c 20 73 74 | 72 7d 2e 7d 0a 0a 5c 66 | {\sl st|r}.}..\f|
|00004290| 75 6e 63 74 69 6f 6e 7b | 63 68 61 72 20 5c 2a 73 |unction{|char \*s|
|000042a0| 74 72 65 72 72 6f 72 28 | 69 6e 74 20 65 72 72 6e |trerror(|int errn|
|000042b0| 6f 29 3b 7d 0a 5c 65 78 | 70 6c 7b 4d 61 70 20 65 |o);}.\ex|pl{Map e|
|000042c0| 72 72 6f 72 20 6e 75 6d | 62 65 72 20 7b 5c 73 6c |rror num|ber {\sl|
|000042d0| 20 65 72 72 6e 6f 7d 20 | 74 6f 20 64 65 73 63 72 | errno} |to descr|
|000042e0| 69 70 74 69 76 65 20 73 | 74 72 69 6e 67 2e 7d 0a |iptive s|tring.}.|
|000042f0| 0a 5c 66 75 6e 63 74 69 | 6f 6e 7b 73 69 7a 65 5c |.\functi|on{size\|
|00004300| 5f 74 20 73 74 72 6c 65 | 6e 28 63 6f 6e 73 74 7e |_t strle|n(const~|
|00004310| 63 68 61 72 20 5c 2a 73 | 74 72 29 3b 7d 0a 5c 65 |char \*s|tr);}.\e|
|00004320| 78 70 6c 7b 52 65 74 75 | 72 6e 20 6c 65 6e 67 74 |xpl{Retu|rn lengt|
|00004330| 68 20 6f 66 20 73 74 72 | 69 6e 67 20 7b 5c 73 6c |h of str|ing {\sl|
|00004340| 20 73 74 72 7d 2e 7d 0a | 0a 5c 66 75 6e 63 74 69 | str}.}.|.\functi|
|00004350| 6f 6e 7b 63 68 61 72 20 | 5c 2a 73 74 72 6c 77 72 |on{char |\*strlwr|
|00004360| 28 63 68 61 72 20 5c 2a | 73 74 72 29 3b 7d 0a 5c |(char \*|str);}.\|
|00004370| 65 78 70 6c 7b 43 68 61 | 6e 67 65 20 61 6c 6c 20 |expl{Cha|nge all |
|00004380| 63 68 61 72 61 63 74 65 | 72 20 66 72 6f 6d 20 73 |characte|r from s|
|00004390| 74 72 69 6e 67 20 7b 5c | 73 6c 20 73 74 72 7d 20 |tring {\|sl str} |
|000043a0| 74 6f 20 6c 6f 77 65 72 | 63 61 73 65 2e 7d 0a 0a |to lower|case.}..|
|000043b0| 5c 66 75 6e 63 74 69 6f | 6e 7b 63 68 61 72 20 5c |\functio|n{char \|
|000043c0| 2a 73 74 72 6e 63 61 74 | 28 63 68 61 72 20 5c 2a |*strncat|(char \*|
|000043d0| 64 73 74 2c 20 63 6f 6e | 73 74 7e 63 68 61 72 20 |dst, con|st~char |
|000043e0| 5c 2a 73 72 63 2c 20 73 | 69 7a 65 5c 5f 74 20 6e |\*src, s|ize\_t n|
|000043f0| 6f 29 3b 7d 0a 5c 65 78 | 70 6c 7b 43 6f 6e 63 61 |o);}.\ex|pl{Conca|
|00004400| 74 65 6e 61 74 65 20 74 | 68 65 20 73 74 72 69 6e |tenate t|he strin|
|00004410| 67 20 61 74 20 7b 5c 73 | 6c 20 73 72 63 7d 20 74 |g at {\s|l src} t|
|00004420| 6f 20 74 68 65 20 73 74 | 72 69 6e 67 20 61 74 20 |o the st|ring at |
|00004430| 7b 5c 73 6c 20 64 73 74 | 7d 2c 20 62 75 74 20 63 |{\sl dst|}, but c|
|00004440| 6f 70 79 0a 61 74 20 6d | 6f 73 74 20 7b 5c 73 6c |opy.at m|ost {\sl|
|00004450| 20 6e 6f 7d 20 63 68 61 | 72 61 63 74 65 72 2e 7d | no} cha|racter.}|
|00004460| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 69 6e 74 20 |..\funct|ion{int |
|00004470| 73 74 72 6e 63 6d 70 28 | 63 6f 6e 73 74 7e 63 68 |strncmp(|const~ch|
|00004480| 61 72 20 5c 2a 73 74 72 | 31 2c 20 63 6f 6e 73 74 |ar \*str|1, const|
|00004490| 7e 63 68 61 72 20 5c 2a | 73 74 72 32 2c 20 73 69 |~char \*|str2, si|
|000044a0| 7a 65 5c 5f 74 20 6e 6f | 29 3b 7d 0a 5c 65 78 70 |ze\_t no|);}.\exp|
|000044b0| 6c 7b 43 6f 6d 70 61 72 | 65 20 73 74 72 69 6e 67 |l{Compar|e string|
|000044c0| 20 7b 5c 73 6c 20 73 74 | 72 31 7d 20 77 69 74 68 | {\sl st|r1} with|
|000044d0| 20 73 74 72 69 6e 67 20 | 7b 5c 73 6c 20 73 74 72 | string |{\sl str|
|000044e0| 31 7d 2c 20 62 75 74 20 | 63 6f 6d 70 61 72 65 20 |1}, but |compare |
|000044f0| 61 74 20 6d 6f 73 74 0a | 7b 5c 73 6c 20 6e 6f 7d |at most.|{\sl no}|
|00004500| 20 63 68 61 72 61 63 74 | 65 72 2e 7d 0a 0a 5c 66 | charact|er.}..\f|
|00004510| 75 6e 63 74 69 6f 6e 7b | 63 68 61 72 20 5c 2a 73 |unction{|char \*s|
|00004520| 74 72 6e 63 70 79 28 63 | 68 61 72 20 5c 2a 64 73 |trncpy(c|har \*ds|
|00004530| 74 2c 20 63 6f 6e 73 74 | 7e 63 68 61 72 20 5c 2a |t, const|~char \*|
|00004540| 73 72 63 2c 20 73 69 7a | 65 5c 5f 74 20 6e 6f 29 |src, siz|e\_t no)|
|00004550| 3b 7d 0a 5c 65 78 70 6c | 7b 43 6f 70 79 20 73 74 |;}.\expl|{Copy st|
|00004560| 72 69 6e 67 20 61 74 20 | 7b 5c 73 6c 20 73 72 63 |ring at |{\sl src|
|00004570| 7d 20 74 6f 20 7b 5c 73 | 6c 20 64 73 74 7d 2c 20 |} to {\s|l dst}, |
|00004580| 62 75 74 20 61 74 20 6d | 6f 73 74 20 7b 73 6c 20 |but at m|ost {sl |
|00004590| 6e 6f 7d 20 63 68 61 72 | 61 63 74 65 72 2e 7d 0a |no} char|acter.}.|
|000045a0| 0a 5c 66 75 6e 63 74 69 | 6f 6e 7b 63 68 61 72 20 |.\functi|on{char |
|000045b0| 5c 2a 73 74 72 70 62 72 | 6b 28 63 6f 6e 73 74 7e |\*strpbr|k(const~|
|000045c0| 63 68 61 72 20 5c 2a 73 | 74 72 2c 20 63 6f 6e 73 |char \*s|tr, cons|
|000045d0| 74 7e 63 68 61 72 20 5c | 2a 62 72 65 61 6b 61 74 |t~char \|*breakat|
|000045e0| 29 3b 7d 0a 5c 65 78 70 | 6c 7b 46 69 72 73 74 20 |);}.\exp|l{First |
|000045f0| 6f 63 63 75 72 72 65 6e | 63 65 20 6f 66 20 61 20 |occurren|ce of a |
|00004600| 63 68 61 72 61 63 74 65 | 72 20 66 72 6f 6d 20 73 |characte|r from s|
|00004610| 74 72 69 6e 67 20 7b 5c | 73 6c 20 62 72 65 61 6b |tring {\|sl break|
|00004620| 61 74 7d 20 69 6e 20 73 | 74 72 69 6e 67 0a 7b 5c |at} in s|tring.{\|
|00004630| 73 6c 20 73 74 72 7d 2e | 7d 0a 0a 5c 66 75 6e 63 |sl str}.|}..\func|
|00004640| 74 69 6f 6e 7b 63 68 61 | 72 20 5c 2a 73 74 72 72 |tion{cha|r \*strr|
|00004650| 63 68 72 28 63 6f 6e 73 | 74 7e 63 68 61 72 20 5c |chr(cons|t~char \|
|00004660| 2a 73 74 72 2c 20 69 6e | 74 20 63 68 61 72 77 29 |*str, in|t charw)|
|00004670| 3b 7d 0a 5c 65 78 70 6c | 7b 46 69 6e 64 20 6c 61 |;}.\expl|{Find la|
|00004680| 73 74 20 6f 63 63 75 72 | 65 6e 63 65 20 6f 66 20 |st occur|ence of |
|00004690| 63 68 61 72 61 63 74 65 | 72 20 7b 5c 73 6c 20 63 |characte|r {\sl c|
|000046a0| 68 61 72 77 7d 20 69 6e | 20 73 74 72 69 6e 67 20 |harw} in| string |
|000046b0| 7b 5c 73 6c 20 73 74 72 | 7d 2e 7d 0a 0a 5c 66 75 |{\sl str|}.}..\fu|
|000046c0| 6e 63 74 69 6f 6e 7b 63 | 68 61 72 20 5c 2a 73 74 |nction{c|har \*st|
|000046d0| 72 72 65 76 28 63 68 61 | 72 20 5c 2a 73 74 72 29 |rrev(cha|r \*str)|
|000046e0| 3b 7d 0a 5c 65 78 70 6c | 7b 52 65 76 65 72 73 65 |;}.\expl|{Reverse|
|000046f0| 20 61 6c 6c 20 63 68 61 | 72 63 74 65 72 73 20 69 | all cha|rcters i|
|00004700| 6e 20 73 74 72 69 6e 67 | 20 7b 5c 73 6c 20 73 74 |n string| {\sl st|
|00004710| 72 7d 2e 20 46 69 72 73 | 74 20 63 68 61 72 61 63 |r}. Firs|t charac|
|00004720| 74 65 72 0a 62 65 63 6f | 6d 65 73 20 6c 61 73 74 |ter.beco|mes last|
|00004730| 20 63 68 61 72 61 63 74 | 65 72 2e 7d 0a 0a 5c 66 | charact|er.}..\f|
|00004740| 75 6e 63 74 69 6f 6e 7b | 73 69 7a 65 5c 5f 74 20 |unction{|size\_t |
|00004750| 73 74 72 73 70 6e 28 63 | 6f 6e 73 74 7e 63 68 61 |strspn(c|onst~cha|
|00004760| 72 20 5c 2a 73 74 72 2c | 20 63 6f 6e 73 74 7e 63 |r \*str,| const~c|
|00004770| 68 61 72 20 5c 2a 61 63 | 63 65 70 74 29 3b 7d 0a |har \*ac|cept);}.|
|00004780| 5c 65 78 70 6c 7b 46 69 | 6e 64 20 6c 65 6e 67 74 |\expl{Fi|nd lengt|
|00004790| 68 20 6f 66 20 69 6e 69 | 74 69 61 6c 20 73 65 67 |h of ini|tial seg|
|000047a0| 6d 65 6e 74 20 6f 66 20 | 7b 5c 73 6c 20 73 74 72 |ment of |{\sl str|
|000047b0| 7d 20 63 6f 6e 73 69 73 | 74 69 6e 67 20 65 6e 74 |} consis|ting ent|
|000047c0| 69 72 65 6c 79 0a 6f 66 | 20 63 68 61 72 61 63 74 |irely.of| charact|
|000047d0| 65 72 73 20 66 72 6f 6d | 20 7b 5c 73 6c 20 61 63 |ers from| {\sl ac|
|000047e0| 63 65 70 74 7d 2e 7d 0a | 0a 5c 66 75 6e 63 74 69 |cept}.}.|.\functi|
|000047f0| 6f 6e 7b 63 68 61 72 20 | 5c 2a 73 74 72 73 74 72 |on{char |\*strstr|
|00004800| 28 63 6f 6e 73 74 7e 63 | 68 61 72 20 5c 2a 73 74 |(const~c|har \*st|
|00004810| 72 2c 20 63 6f 6e 73 74 | 7e 63 68 61 72 20 5c 2a |r, const|~char \*|
|00004820| 77 61 6e 74 65 64 29 3b | 7d 0a 5c 65 78 70 6c 7b |wanted);|}.\expl{|
|00004830| 46 69 6e 64 20 66 69 72 | 73 74 20 6f 63 63 75 72 |Find fir|st occur|
|00004840| 65 6e 63 65 20 6f 66 20 | 73 74 72 69 6e 67 20 7b |ence of |string {|
|00004850| 5c 73 6c 20 77 61 6e 74 | 65 64 7d 20 69 6e 20 73 |\sl want|ed} in s|
|00004860| 74 72 69 6e 67 20 7b 5c | 73 6c 0a 73 74 72 7d 2e |tring {\|sl.str}.|
|00004870| 7d 20 0a 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 63 68 |} ..\fun|ction{ch|
|00004880| 61 72 20 5c 2a 73 74 72 | 74 6f 6b 28 63 68 61 72 |ar \*str|tok(char|
|00004890| 20 5c 2a 73 74 72 2c 20 | 63 6f 6e 73 74 7e 63 68 | \*str, |const~ch|
|000048a0| 61 72 20 5c 2a 64 65 6c | 69 6d 29 3b 7d 0a 5c 65 |ar \*del|im);}.\e|
|000048b0| 78 70 6c 7b 52 65 74 72 | 69 65 76 65 20 66 69 65 |xpl{Retr|ieve fie|
|000048c0| 6c 64 73 20 66 72 6f 6d | 20 73 74 72 69 6e 67 20 |lds from| string |
|000048d0| 7b 5c 73 6c 20 73 74 72 | 7d 2c 20 74 68 61 74 20 |{\sl str|}, that |
|000048e0| 61 72 65 20 64 65 6c 69 | 6d 69 74 65 64 20 62 79 |are deli|mited by|
|000048f0| 0a 63 68 61 72 61 63 74 | 65 72 73 20 66 72 6f 6d |.charact|ers from|
|00004900| 20 73 74 72 69 6e 67 20 | 7b 5c 73 6c 20 64 65 6c | string |{\sl del|
|00004910| 69 6d 7d 2e 7d 0a 0a 25 | 25 25 25 25 25 25 25 25 |im}.}..%|%%%%%%%%|
|00004920| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004930| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004940| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004950| 25 25 25 0a 0c 0a 5c 73 | 65 63 74 69 6f 6e 7b 50 |%%%...\s|ection{P|
|00004960| 72 6f 63 65 73 73 20 4d | 61 6e 61 67 65 6d 65 6e |rocess M|anagemen|
|00004970| 74 7d 0a 0a 5c 23 69 6e | 63 6c 75 64 65 20 5c 3c |t}..\#in|clude \<|
|00004980| 73 74 64 6c 69 62 2e 68 | 3e 0a 0a 5c 66 75 6e 63 |stdlib.h|>..\func|
|00004990| 74 69 6f 6e 7b 76 6f 69 | 64 20 61 62 6f 72 74 28 |tion{voi|d abort(|
|000049a0| 29 3b 7d 0a 5c 65 78 70 | 6c 7b 49 6d 6d 65 64 69 |);}.\exp|l{Immedi|
|000049b0| 61 74 6c 79 20 61 62 6f | 72 74 20 74 68 65 20 72 |atly abo|rt the r|
|000049c0| 75 6e 6e 69 6e 67 20 70 | 72 6f 67 72 61 6d 2e 7d |unning p|rogram.}|
|000049d0| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 69 6e 74 20 |..\funct|ion{int |
|000049e0| 61 74 65 78 69 74 28 76 | 6f 69 64 20 28 5c 2a 66 |atexit(v|oid (\*f|
|000049f0| 75 6e 63 29 28 29 29 3b | 7d 0a 5c 65 78 70 6c 7b |unc)());|}.\expl{|
|00004a00| 52 65 67 69 73 74 65 72 | 20 61 20 66 75 6e 63 74 |Register| a funct|
|00004a10| 69 6f 6e 20 66 6f 72 20 | 65 78 65 63 75 74 69 6f |ion for |executio|
|00004a20| 6e 20 6f 6e 20 74 65 72 | 6d 69 6e 61 74 69 6f 6e |n on ter|mination|
|00004a30| 2e 7d 0a 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 76 6f |.}..\fun|ction{vo|
|00004a40| 69 64 20 65 78 69 74 28 | 69 6e 74 20 72 65 74 29 |id exit(|int ret)|
|00004a50| 3b 7d 0a 5c 65 78 70 6c | 7b 45 78 69 74 20 63 75 |;}.\expl|{Exit cu|
|00004a60| 72 72 65 6e 74 20 70 72 | 6f 63 65 73 73 20 77 69 |rrent pr|ocess wi|
|00004a70| 74 68 20 72 65 74 75 72 | 6e 20 76 61 6c 75 65 20 |th retur|n value |
|00004a80| 7b 5c 73 6c 20 72 65 74 | 7d 2e 7d 0a 0a 5c 66 75 |{\sl ret|}.}..\fu|
|00004a90| 6e 63 74 69 6f 6e 7b 69 | 6e 74 20 73 79 73 74 65 |nction{i|nt syste|
|00004aa0| 6d 28 63 6f 6e 73 74 7e | 63 68 61 72 20 5c 2a 70 |m(const~|char \*p|
|00004ab0| 72 6f 67 29 3b 7d 0a 5c | 65 78 70 6c 7b 45 78 65 |rog);}.\|expl{Exe|
|00004ac0| 63 75 74 65 20 63 6f 6d | 6d 61 6e 64 20 7b 5c 73 |cute com|mand {\s|
|00004ad0| 6c 20 70 72 6f 67 7d 20 | 70 61 73 73 65 64 20 61 |l prog} |passed a|
|00004ae0| 73 20 61 20 73 74 72 69 | 6e 67 2e 7d 0a 5c 6d 65 |s a stri|ng.}.\me|
|00004af0| 64 73 6b 69 70 0a 5c 23 | 69 6e 63 6c 75 64 65 20 |dskip.\#|include |
|00004b00| 5c 3c 70 72 6f 63 65 73 | 73 2e 68 3e 0a 0a 5c 66 |\<proces|s.h>..\f|
|00004b10| 75 6e 63 74 69 6f 6e 7b | 69 6e 74 20 73 70 61 77 |unction{|int spaw|
|00004b20| 6e 6c 28 69 6e 74 20 6d | 6f 64 65 2c 20 63 68 61 |nl(int m|ode, cha|
|00004b30| 72 20 5c 2a 70 61 74 68 | 2c 20 24 5c 6c 64 6f 74 |r \*path|, $\ldot|
|00004b40| 73 24 29 3b 7d 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |s$);}.\f|unction{|
|00004b50| 69 6e 74 20 73 70 61 77 | 6e 76 28 69 6e 74 20 6d |int spaw|nv(int m|
|00004b60| 6f 64 65 2c 20 63 68 61 | 72 20 5c 2a 70 61 74 68 |ode, cha|r \*path|
|00004b70| 2c 20 63 68 61 72 20 7b | 5c 2a 5c 2a 7d 61 72 67 |, char {|\*\*}arg|
|00004b80| 76 29 3b 7d 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 69 |v);}.\fu|nction{i|
|00004b90| 6e 74 20 73 70 61 77 6e | 6c 65 28 69 6e 74 20 6d |nt spawn|le(int m|
|00004ba0| 6f 64 65 2c 20 63 68 61 | 72 20 5c 2a 70 61 74 68 |ode, cha|r \*path|
|00004bb0| 2c 20 24 5c 6c 64 6f 74 | 73 24 29 3b 7d 0a 5c 66 |, $\ldot|s$);}.\f|
|00004bc0| 75 6e 63 74 69 6f 6e 7b | 69 6e 74 20 73 70 61 77 |unction{|int spaw|
|00004bd0| 6e 76 65 28 69 6e 74 20 | 6d 6f 64 65 2c 20 63 68 |nve(int |mode, ch|
|00004be0| 61 72 20 5c 2a 70 61 74 | 68 2c 20 63 68 61 72 20 |ar \*pat|h, char |
|00004bf0| 7b 5c 2a 5c 2a 7d 61 72 | 67 76 2c 20 63 68 61 72 |{\*\*}ar|gv, char|
|00004c00| 20 7b 5c 2a 5c 2a 7d 65 | 6e 76 70 29 3b 7d 0a 5c | {\*\*}e|nvp);}.\|
|00004c10| 65 78 70 6c 7b 53 70 61 | 77 6e 20 61 20 6e 65 77 |expl{Spa|wn a new|
|00004c20| 20 70 72 6f 63 65 73 73 | 2e 20 28 4f 6e 6c 79 20 | process|. (Only |
|00004c30| 7b 5c 74 74 20 50 5c 5f | 57 41 49 54 7d 20 69 73 |{\tt P\_|WAIT} is|
|00004c40| 20 61 6c 6c 6f 77 65 64 | 20 66 6f 72 20 7b 5c 73 | allowed| for {\s|
|00004c50| 6c 0a 6d 6f 64 65 7d 29 | 2e 7d 0a 0a 5c 66 75 6e |l.mode})|.}..\fun|
|00004c60| 63 74 69 6f 6e 7b 69 6e | 74 20 73 70 61 77 6e 76 |ction{in|t spawnv|
|00004c70| 70 28 69 6e 74 20 6d 6f | 64 65 2c 20 63 68 61 72 |p(int mo|de, char|
|00004c80| 20 5c 2a 6e 61 6d 65 2c | 20 63 68 61 72 20 7b 5c | \*name,| char {\|
|00004c90| 2a 5c 2a 7d 61 72 67 76 | 29 3b 7d 0a 5c 66 75 6e |*\*}argv|);}.\fun|
|00004ca0| 63 74 69 6f 6e 7b 69 6e | 74 20 73 70 61 77 6e 6c |ction{in|t spawnl|
|00004cb0| 70 28 69 6e 74 20 6d 6f | 64 65 2c 20 63 68 61 72 |p(int mo|de, char|
|00004cc0| 20 5c 2a 6e 61 6d 65 2c | 20 24 5c 6c 64 6f 74 73 | \*name,| $\ldots|
|00004cd0| 24 29 3b 7d 0a 5c 65 78 | 70 6c 7b 45 78 65 63 75 |$);}.\ex|pl{Execu|
|00004ce0| 74 65 20 61 20 70 72 6f | 67 72 61 6d 20 6f 6e 20 |te a pro|gram on |
|00004cf0| 74 68 65 20 64 65 66 61 | 75 74 6c 20 73 79 73 74 |the defa|utl syst|
|00004d00| 65 6d 20 65 78 65 63 75 | 74 69 6f 6e 20 70 61 74 |em execu|tion pat|
|00004d10| 68 2e 20 28 54 68 65 0a | 63 75 72 72 65 6e 74 20 |h. (The.|current |
|00004d20| 64 69 72 65 63 74 6f 72 | 79 20 69 73 20 61 6c 77 |director|y is alw|
|00004d30| 61 79 73 20 73 65 61 72 | 63 68 65 64 20 66 69 72 |ays sear|ched fir|
|00004d40| 73 74 2e 29 7d 0a 0a 25 | 25 25 25 25 25 25 25 25 |st.)}..%|%%%%%%%%|
|00004d50| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004d60| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004d70| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004d80| 25 25 25 0a 0c 0a 5c 73 | 65 63 74 69 6f 6e 7b 44 |%%%...\s|ection{D|
|00004d90| 61 74 65 20 61 6e 64 20 | 54 69 6d 65 7d 0a 0a 5c |ate and |Time}..\|
|00004da0| 23 69 6e 63 6c 75 64 65 | 20 5c 3c 74 69 6d 65 2e |#include| \<time.|
|00004db0| 68 3e 0a 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 63 68 |h>..\fun|ction{ch|
|00004dc0| 61 72 20 5c 2a 61 73 63 | 74 69 6d 65 28 63 6f 6e |ar \*asc|time(con|
|00004dd0| 73 74 7e 73 74 72 75 63 | 74 20 74 6d 20 5c 2a 74 |st~struc|t tm \*t|
|00004de0| 29 3b 7d 0a 5c 65 78 70 | 6c 7b 43 6f 6e 76 65 72 |);}.\exp|l{Conver|
|00004df0| 74 20 60 60 74 69 6d 65 | 27 27 20 73 74 72 75 63 |t ``time|'' struc|
|00004e00| 74 75 72 65 20 74 6f 20 | 61 20 73 74 72 69 6e 67 |ture to |a string|
|00004e10| 2e 7d 0a 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 63 6c |.}..\fun|ction{cl|
|00004e20| 6f 63 6b 5c 5f 74 20 63 | 6c 6f 63 6b 28 29 3b 7d |ock\_t c|lock();}|
|00004e30| 0a 5c 65 78 70 6c 7b 52 | 65 74 75 72 6e 20 70 72 |.\expl{R|eturn pr|
|00004e40| 6f 63 65 73 73 20 74 69 | 6d 65 20 75 73 65 64 20 |ocess ti|me used |
|00004e50| 73 6f 20 66 61 72 20 69 | 6e 20 75 6e 69 74 73 20 |so far i|n units |
|00004e60| 6f 66 20 43 4c 4b 5c 5f | 54 43 4b 20 74 69 63 6b |of CLK\_|TCK tick|
|00004e70| 73 20 70 65 72 0a 73 65 | 63 6f 6e 64 20 28 75 6e |s per.se|cond (un|
|00004e80| 64 65 72 20 54 4f 53 2c | 20 32 30 30 20 70 65 72 |der TOS,| 200 per|
|00004e90| 20 73 65 63 6f 6e 64 29 | 2e 7d 0a 0a 5c 66 75 6e | second)|.}..\fun|
|00004ea0| 63 74 69 6f 6e 7b 63 68 | 61 72 20 5c 2a 63 74 69 |ction{ch|ar \*cti|
|00004eb0| 6d 65 28 63 6f 6e 73 74 | 7e 69 6d 65 5c 5f 74 20 |me(const|~ime\_t |
|00004ec0| 5c 2a 74 29 3b 7d 0a 5c | 65 78 70 6c 7b 43 6f 6e |\*t);}.\|expl{Con|
|00004ed0| 76 65 72 74 20 74 69 6d | 65 20 69 6e 20 73 65 63 |vert tim|e in sec|
|00004ee0| 6f 6e 64 73 20 73 69 6e | 63 65 20 31 39 37 30 20 |onds sin|ce 1970 |
|00004ef0| 74 6f 20 61 20 73 74 72 | 69 6e 67 2e 7d 0a 0a 5c |to a str|ing.}..\|
|00004f00| 66 75 6e 63 74 69 6f 6e | 7b 64 6f 75 62 6c 65 20 |function|{double |
|00004f10| 64 69 66 66 74 69 6d 65 | 28 74 69 6d 65 5c 5f 74 |difftime|(time\_t|
|00004f20| 20 74 31 2c 20 74 69 6d | 65 5c 5f 74 20 74 32 29 | t1, tim|e\_t t2)|
|00004f30| 3b 7d 0a 5c 65 78 70 6c | 7b 52 65 74 75 72 6e 20 |;}.\expl|{Return |
|00004f40| 64 69 66 66 65 72 65 6e | 63 65 20 62 65 74 77 65 |differen|ce betwe|
|00004f50| 65 6e 20 74 77 6f 20 60 | 60 74 69 6d 65 5c 5f 74 |en two `|`time\_t|
|00004f60| 27 27 20 74 79 70 65 73 | 2e 7d 0a 0a 5c 66 75 6e |'' types|.}..\fun|
|00004f70| 63 74 69 6f 6e 7b 73 74 | 72 75 63 74 7e 74 6d 20 |ction{st|ruct~tm |
|00004f80| 5c 2a 67 6d 74 69 6d 65 | 28 63 6f 6e 73 74 7e 69 |\*gmtime|(const~i|
|00004f90| 6d 65 5c 5f 74 20 5c 2a | 74 29 3b 7d 0a 5c 65 78 |me\_t \*|t);}.\ex|
|00004fa0| 70 6c 7b 47 65 74 20 74 | 68 65 20 47 72 65 65 6e |pl{Get t|he Green|
|00004fb0| 77 69 63 68 20 4d 65 61 | 6e 20 74 69 6d 65 2e 7d |wich Mea|n time.}|
|00004fc0| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 73 74 72 75 |..\funct|ion{stru|
|00004fd0| 63 74 7e 74 6d 20 5c 2a | 6c 6f 63 61 6c 74 69 6d |ct~tm \*|localtim|
|00004fe0| 65 28 63 6f 6e 73 74 7e | 69 6d 65 5c 5f 74 20 5c |e(const~|ime\_t \|
|00004ff0| 2a 74 29 3b 7d 0a 5c 65 | 78 70 6c 7b 43 6f 6e 76 |*t);}.\e|xpl{Conv|
|00005000| 65 72 74 20 67 69 76 65 | 6e 20 74 69 6d 65 20 69 |ert give|n time i|
|00005010| 6e 20 73 65 63 6f 6e 64 | 73 20 73 69 6e 63 65 20 |n second|s since |
|00005020| 31 39 37 30 20 74 6f 20 | 6c 6f 63 61 6c 20 74 69 |1970 to |local ti|
|00005030| 6d 65 2e 7d 0a 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |me.}..\f|unction{|
|00005040| 74 69 6d 65 5c 5f 74 20 | 6d 6b 74 69 6d 65 28 63 |time\_t |mktime(c|
|00005050| 6f 6e 73 74 7e 73 74 72 | 75 63 74 20 74 6d 20 5c |onst~str|uct tm \|
|00005060| 2a 74 29 3b 7d 0a 5c 65 | 78 70 6c 7b 54 61 6b 65 |*t);}.\e|xpl{Take|
|00005070| 20 61 20 74 69 6d 65 20 | 73 74 72 75 63 74 75 72 | a time |structur|
|00005080| 65 20 61 6e 64 20 63 6f | 6e 76 65 72 74 20 69 74 |e and co|nvert it|
|00005090| 20 69 6e 74 6f 20 72 65 | 70 72 65 73 65 6e 74 61 | into re|presenta|
|000050a0| 74 69 6f 6e 20 60 60 73 | 65 63 6f 6e 64 73 0a 73 |tion ``s|econds.s|
|000050b0| 69 6e 63 65 20 6d 69 64 | 6e 69 67 68 74 20 4a 61 |ince mid|night Ja|
|000050c0| 6e 75 61 72 79 20 31 20 | 31 39 37 30 2c 20 47 4d |nuary 1 |1970, GM|
|000050d0| 54 27 27 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |T''.}..\|function|
|000050e0| 7b 73 69 7a 65 5c 5f 74 | 20 73 74 72 66 74 69 6d |{size\_t| strftim|
|000050f0| 65 28 63 68 61 72 20 5c | 2a 73 2c 20 73 69 7a 65 |e(char \|*s, size|
|00005100| 5c 5f 74 20 6d 61 78 73 | 69 7a 65 2c 20 63 6f 6e |\_t maxs|ize, con|
|00005110| 73 74 7e 63 68 61 72 20 | 5c 2a 66 6f 72 6d 61 74 |st~char |\*format|
|00005120| 2c 0a 63 6f 6e 73 74 7e | 73 74 72 75 63 74 20 74 |,.const~|struct t|
|00005130| 6d 20 5c 2a 74 69 6d 65 | 70 74 72 29 3b 7d 0a 5c |m \*time|ptr);}.\|
|00005140| 65 78 70 6c 7b 50 72 69 | 6e 74 20 66 6f 72 6d 61 |expl{Pri|nt forma|
|00005150| 74 74 65 64 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |tted inf|ormation|
|00005160| 20 61 62 6f 75 74 20 61 | 20 67 69 76 65 6e 20 74 | about a| given t|
|00005170| 69 6d 65 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |ime.}..\|function|
|00005180| 7b 74 69 6d 65 5c 5f 74 | 20 74 69 6d 65 28 74 69 |{time\_t| time(ti|
|00005190| 6d 65 5c 5f 74 20 5c 2a | 74 29 3b 7d 0a 5c 65 78 |me\_t \*|t);}.\ex|
|000051a0| 70 6c 7b 52 65 74 75 72 | 6e 20 74 69 6d 65 20 69 |pl{Retur|n time i|
|000051b0| 6e 20 73 65 63 6f 6e 64 | 73 20 73 69 6e 63 65 20 |n second|s since |
|000051c0| 6d 69 64 6e 69 67 68 74 | 20 4a 61 6e 75 61 72 79 |midnight| January|
|000051d0| 20 31 20 31 39 37 30 2c | 20 47 4d 54 2e 7d 0a 0a | 1 1970,| GMT.}..|
|000051e0| 5c 66 75 6e 63 74 69 6f | 6e 7b 76 6f 69 64 20 74 |\functio|n{void t|
|000051f0| 7a 73 65 74 28 29 3b 7d | 0a 5c 65 78 70 6c 7b 53 |zset();}|.\expl{S|
|00005200| 65 74 20 74 68 65 20 74 | 69 6d 65 7a 6f 6e 65 20 |et the t|imezone |
|00005210| 61 6e 64 20 64 73 74 20 | 66 6c 61 67 20 74 6f 20 |and dst |flag to |
|00005220| 74 68 65 20 6c 6f 63 61 | 6c 20 72 75 6c 65 73 20 |the loca|l rules |
|00005230| 28 64 65 70 65 6e 64 69 | 6e 67 20 6f 6e 0a 65 6e |(dependi|ng on.en|
|00005240| 76 69 72 6f 6e 6d 65 6e | 74 20 76 61 72 69 61 62 |vironmen|t variab|
|00005250| 6c 65 20 60 60 54 5a 27 | 27 29 2e 7d 0a 0a 25 25 |le ``TZ'|').}..%%|
|00005260| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005270| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005280| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005290| 25 25 25 25 25 25 25 25 | 25 25 0a 0c 0a 5c 73 65 |%%%%%%%%|%%...\se|
|000052a0| 63 74 69 6f 6e 7b 46 69 | 6c 65 20 61 6e 64 20 44 |ction{Fi|le and D|
|000052b0| 69 72 65 63 74 6f 72 79 | 20 49 6e 66 6f 72 6d 61 |irectory| Informa|
|000052c0| 74 69 6f 6e 7d 0a 0a 5c | 23 69 6e 63 6c 75 64 65 |tion}..\|#include|
|000052d0| 20 5c 3c 74 79 70 65 73 | 2e 68 3e 5c 70 61 72 0a | \<types|.h>\par.|
|000052e0| 5c 23 69 6e 63 6c 75 64 | 65 20 5c 3c 73 74 61 74 |\#includ|e \<stat|
|000052f0| 2e 68 3e 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 69 |.h>..\fu|nction{i|
|00005300| 6e 74 20 20 66 73 74 61 | 74 28 69 6e 74 20 66 64 |nt fsta|t(int fd|
|00005310| 2c 20 73 74 72 75 63 74 | 20 73 74 61 74 20 5c 2a |, struct| stat \*|
|00005320| 69 6e 66 6f 29 3b 7d 0a | 5c 65 78 70 6c 7b 4f 62 |info);}.|\expl{Ob|
|00005330| 74 61 69 6e 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |tain inf|ormation|
|00005340| 20 61 62 6f 75 74 20 66 | 69 6c 65 20 61 73 73 6f | about f|ile asso|
|00005350| 73 69 61 74 65 64 20 77 | 69 74 68 20 66 69 6c 65 |siated w|ith file|
|00005360| 64 65 73 63 72 69 70 74 | 6f 72 20 7b 5c 73 6c 20 |descript|or {\sl |
|00005370| 66 64 7d 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |fd}.}..\|function|
|00005380| 7b 69 6e 74 20 20 6c 73 | 74 61 74 28 63 6f 6e 73 |{int ls|tat(cons|
|00005390| 74 7e 63 68 61 72 20 5c | 2a 66 6e 61 6d 65 2c 20 |t~char \|*fname, |
|000053a0| 73 74 72 75 63 74 20 73 | 74 61 74 20 5c 2a 69 6e |struct s|tat \*in|
|000053b0| 66 6f 29 3b 7d 0a 5c 65 | 78 70 6c 7b 4c 69 6b 65 |fo);}.\e|xpl{Like|
|000053c0| 20 7b 5c 73 6c 20 73 74 | 61 74 7d 20 62 75 74 20 | {\sl st|at} but |
|000053d0| 72 65 74 75 72 6e 20 69 | 6e 66 6f 20 61 62 6f 75 |return i|nfo abou|
|000053e0| 74 20 7b 5c 73 6c 20 73 | 79 6d 62 6f 6c 69 63 20 |t {\sl s|ymbolic |
|000053f0| 6c 69 6e 6b 73 7d 2e 7d | 0a 0a 5c 66 75 6e 63 74 |links}.}|..\funct|
|00005400| 69 6f 6e 7b 69 6e 74 20 | 20 73 74 61 74 28 63 6f |ion{int | stat(co|
|00005410| 6e 73 74 7e 63 68 61 72 | 20 5c 2a 66 6e 61 6d 65 |nst~char| \*fname|
|00005420| 2c 20 73 74 72 75 63 74 | 20 73 74 61 74 20 5c 2a |, struct| stat \*|
|00005430| 69 6e 66 6f 29 3b 7d 0a | 5c 65 78 70 6c 7b 4f 62 |info);}.|\expl{Ob|
|00005440| 74 61 69 6e 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |tain inf|ormation|
|00005450| 20 61 62 6f 75 74 20 66 | 69 6c 65 20 7b 5c 73 6c | about f|ile {\sl|
|00005460| 20 66 6e 61 6d 65 7d 2e | 7d 0a 5c 6d 65 64 73 6b | fname}.|}.\medsk|
|00005470| 69 70 0a 5c 23 69 6e 63 | 6c 75 64 65 20 5c 3c 64 |ip.\#inc|lude \<d|
|00005480| 69 72 65 6e 74 2e 68 3e | 0a 0a 5c 66 75 6e 63 74 |irent.h>|..\funct|
|00005490| 69 6f 6e 7b 69 6e 74 20 | 63 6c 6f 73 65 64 69 72 |ion{int |closedir|
|000054a0| 28 44 49 52 20 5c 2a 64 | 69 72 70 29 3b 7d 0a 5c |(DIR \*d|irp);}.\|
|000054b0| 65 78 70 6c 7b 43 6c 6f | 73 65 20 64 69 72 65 63 |expl{Clo|se direc|
|000054c0| 74 6f 72 79 20 61 73 73 | 6f 73 69 61 74 65 64 20 |tory ass|osiated |
|000054d0| 77 69 74 68 20 7b 5c 73 | 6c 20 64 69 72 70 7d 2e |with {\s|l dirp}.|
|000054e0| 7d 0a 0a 5c 66 75 6e 63 | 74 69 6f 6e 7b 44 49 52 |}..\func|tion{DIR|
|000054f0| 20 5c 2a 6f 70 65 6e 64 | 69 72 28 63 6f 6e 73 74 | \*opend|ir(const|
|00005500| 7e 63 68 61 72 20 5c 2a | 64 69 72 6e 61 6d 65 29 |~char \*|dirname)|
|00005510| 3b 7d 0a 5c 65 78 70 6c | 7b 4f 70 65 6e 20 64 69 |;}.\expl|{Open di|
|00005520| 72 65 63 74 6f 72 79 20 | 7b 5c 73 6c 20 64 69 72 |rectory |{\sl dir|
|00005530| 6e 61 6d 65 7d 20 66 6f | 72 20 72 65 61 64 69 6e |name} fo|r readin|
|00005540| 67 2e 7d 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 73 |g.}..\fu|nction{s|
|00005550| 74 72 75 63 74 7e 64 69 | 72 65 6e 74 20 5c 2a 72 |truct~di|rent \*r|
|00005560| 65 61 64 64 69 72 28 44 | 49 52 20 5c 2a 64 69 72 |eaddir(D|IR \*dir|
|00005570| 70 29 3b 7d 0a 5c 65 78 | 70 6c 7b 52 65 61 64 20 |p);}.\ex|pl{Read |
|00005580| 61 6e 20 65 6e 74 72 79 | 20 66 72 6f 6d 20 64 69 |an entry| from di|
|00005590| 72 65 63 74 6f 72 79 20 | 61 73 73 6f 73 69 61 74 |rectory |assosiat|
|000055a0| 65 64 20 77 69 74 68 20 | 7b 5c 73 6c 20 64 69 72 |ed with |{\sl dir|
|000055b0| 70 7d 2e 7d 0a 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |p}.}..\f|unction{|
|000055c0| 76 6f 69 64 20 72 65 77 | 69 6e 64 64 69 72 28 44 |void rew|inddir(D|
|000055d0| 49 52 20 5c 2a 64 69 72 | 70 29 3b 7d 0a 5c 65 78 |IR \*dir|p);}.\ex|
|000055e0| 70 6c 7b 53 65 65 6b 20 | 74 6f 20 74 68 65 20 62 |pl{Seek |to the b|
|000055f0| 65 67 69 6e 6e 69 6e 67 | 20 6f 66 20 64 69 72 65 |eginning| of dire|
|00005600| 63 74 6f 72 79 20 61 73 | 73 6f 73 69 61 74 65 64 |ctory as|sosiated|
|00005610| 20 77 69 74 68 20 7b 5c | 73 6c 20 64 69 72 70 7d | with {\|sl dirp}|
|00005620| 2e 7d 0a 0a 5c 66 75 6e | 63 74 69 6f 6e 7b 76 6f |.}..\fun|ction{vo|
|00005630| 69 64 20 73 65 65 6b 64 | 69 72 28 44 49 52 20 5c |id seekd|ir(DIR \|
|00005640| 2a 64 69 72 70 2c 20 6f | 66 66 5c 5f 74 20 6c 6f |*dirp, o|ff\_t lo|
|00005650| 63 29 3b 7d 0a 5c 65 78 | 70 6c 7b 53 65 65 6b 20 |c);}.\ex|pl{Seek |
|00005660| 74 6f 20 70 6f 73 69 74 | 69 6f 6e 20 7b 5c 73 6c |to posit|ion {\sl|
|00005670| 20 6c 6f 63 7d 20 69 6e | 20 74 68 65 20 64 69 72 | loc} in| the dir|
|00005680| 65 63 74 6f 72 79 20 61 | 73 73 6f 73 69 61 74 65 |ectory a|ssosiate|
|00005690| 64 20 77 69 74 68 20 7b | 5c 73 6c 0a 64 69 72 70 |d with {|\sl.dirp|
|000056a0| 7d 2e 7d 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 6f |}.}..\fu|nction{o|
|000056b0| 66 66 5c 5f 74 20 74 65 | 6c 6c 64 69 72 28 44 49 |ff\_t te|lldir(DI|
|000056c0| 52 20 5c 2a 64 69 72 70 | 29 3b 7d 0a 5c 65 78 70 |R \*dirp|);}.\exp|
|000056d0| 6c 7b 47 65 74 20 74 68 | 65 20 63 75 72 72 65 6e |l{Get th|e curren|
|000056e0| 74 20 70 6f 73 69 74 69 | 6f 6e 20 69 6e 20 64 69 |t positi|on in di|
|000056f0| 72 65 63 74 6f 72 79 20 | 61 73 73 6f 73 69 61 74 |rectory |assosiat|
|00005700| 65 64 20 77 69 74 68 20 | 7b 5c 73 6c 0a 64 69 72 |ed with |{\sl.dir|
|00005710| 70 7d 2e 7d 20 0a 5c 6d | 65 64 73 6b 69 70 0a 5c |p}.} .\m|edskip.\|
|00005720| 23 69 6e 63 6c 75 64 65 | 20 5c 3c 66 74 77 2e 68 |#include| \<ftw.h|
|00005730| 3e 0a 0a 5c 66 75 6e 63 | 74 69 6f 6e 7b 69 6e 74 |>..\func|tion{int|
|00005740| 20 66 74 77 28 63 68 61 | 72 20 5c 2a 70 61 74 68 | ftw(cha|r \*path|
|00005750| 2c 20 69 6e 74 20 28 5c | 2a 66 6e 29 28 29 2c 20 |, int (\|*fn)(), |
|00005760| 69 6e 74 20 70 61 72 61 | 6d 29 3b 7d 0a 5c 65 78 |int para|m);}.\ex|
|00005770| 70 6c 7b 52 65 63 75 72 | 73 69 76 65 6c 79 20 77 |pl{Recur|sively w|
|00005780| 61 6c 6b 20 74 72 65 65 | 20 72 6f 6f 74 65 64 20 |alk tree| rooted |
|00005790| 61 74 20 7b 5c 73 6c 20 | 70 61 74 68 7d 20 61 70 |at {\sl |path} ap|
|000057a0| 70 6c 79 69 6e 67 20 66 | 75 6e 63 74 69 6f 6e 20 |plying f|unction |
|000057b0| 7b 5c 73 6c 20 66 6e 7d | 2e 7d 0a 0a 0a 25 25 25 |{\sl fn}|.}...%%%|
|000057c0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000057d0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000057e0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000057f0| 25 25 25 25 25 25 25 25 | 25 0a 0c 0a 5c 73 65 63 |%%%%%%%%|%...\sec|
|00005800| 74 69 6f 6e 7b 52 65 67 | 75 6c 61 72 20 45 78 70 |tion{Reg|ular Exp|
|00005810| 72 65 73 73 69 6f 6e 73 | 7d 0a 0a 5c 23 69 6e 63 |ressions|}..\#inc|
|00005820| 6c 75 64 65 20 5c 3c 72 | 65 67 65 78 70 2e 68 3e |lude \<r|egexp.h>|
|00005830| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 72 65 67 65 |..\funct|ion{rege|
|00005840| 78 70 20 5c 2a 72 65 67 | 63 6f 6d 70 28 63 68 61 |xp \*reg|comp(cha|
|00005850| 72 20 5c 2a 65 78 70 29 | 3b 7d 0a 5c 65 78 70 6c |r \*exp)|;}.\expl|
|00005860| 7b 43 6f 6d 70 69 6c 65 | 20 61 20 72 65 67 75 6c |{Compile| a regul|
|00005870| 61 72 20 65 78 70 72 65 | 73 73 69 6f 6e 20 69 6e |ar expre|ssion in|
|00005880| 74 6f 20 61 6e 20 69 6e | 74 65 72 6e 61 6c 20 63 |to an in|ternal c|
|00005890| 6f 64 65 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |ode.}..\|function|
|000058a0| 7b 69 6e 74 20 72 65 67 | 65 78 65 63 28 72 65 67 |{int reg|exec(reg|
|000058b0| 65 78 70 20 5c 2a 70 72 | 6f 67 2c 20 63 68 61 72 |exp \*pr|og, char|
|000058c0| 20 5c 2a 73 74 72 69 6e | 67 2c 20 69 6e 74 20 62 | \*strin|g, int b|
|000058d0| 6f 6c 66 6c 61 67 29 3b | 7d 0a 5c 65 78 70 6c 7b |olflag);|}.\expl{|
|000058e0| 4d 61 74 63 68 20 74 68 | 65 20 70 72 65 76 69 6f |Match th|e previo|
|000058f0| 75 73 6c 79 20 63 6f 6d | 70 69 6c 65 64 20 65 78 |usly com|piled ex|
|00005900| 70 72 65 73 73 69 6f 6e | 20 7b 5c 73 6c 20 70 72 |pression| {\sl pr|
|00005910| 6f 67 7d 20 61 67 61 69 | 6e 73 74 20 74 68 65 0a |og} agai|nst the.|
|00005920| 7b 5c 73 6c 20 73 74 72 | 69 6e 67 7d 2e 7d 0a 0a |{\sl str|ing}.}..|
|00005930| 5c 66 75 6e 63 74 69 6f | 6e 7b 76 6f 69 64 20 72 |\functio|n{void r|
|00005940| 65 67 73 75 62 28 72 65 | 67 65 78 70 20 5c 2a 70 |egsub(re|gexp \*p|
|00005950| 72 6f 67 2c 20 63 68 61 | 72 20 5c 2a 73 6f 75 72 |rog, cha|r \*sour|
|00005960| 63 65 2c 20 63 68 61 72 | 20 5c 2a 64 65 73 74 29 |ce, char| \*dest)|
|00005970| 3b 7d 0a 5c 65 78 70 6c | 7b 53 75 62 73 74 69 74 |;}.\expl|{Substit|
|00005980| 75 74 65 20 74 68 65 20 | 70 72 65 76 69 6f 75 73 |ute the |previous|
|00005990| 6c 79 20 6d 61 74 63 68 | 65 64 20 65 78 70 72 65 |ly match|ed expre|
|000059a0| 73 73 69 6f 6e 20 7b 5c | 73 6c 20 70 72 6f 67 7d |ssion {\|sl prog}|
|000059b0| 20 77 69 74 68 0a 7b 5c | 73 6c 20 73 6f 75 72 63 | with.{\|sl sourc|
|000059c0| 65 7d 2e 20 54 68 65 20 | 72 65 73 75 6c 74 20 69 |e}. The |result i|
|000059d0| 73 20 63 6f 70 69 65 64 | 20 74 6f 20 7b 5c 73 6c |s copied| to {\sl|
|000059e0| 20 64 65 73 74 7d 2e 7d | 0a 0a 5c 66 75 6e 63 74 | dest}.}|..\funct|
|000059f0| 69 6f 6e 7b 76 6f 69 64 | 20 72 65 67 64 75 6d 70 |ion{void| regdump|
|00005a00| 28 72 65 67 65 78 70 20 | 5c 2a 72 29 3b 7d 0a 5c |(regexp |\*r);}.\|
|00005a10| 65 78 70 6c 7b 44 75 6d | 70 20 74 68 65 20 72 65 |expl{Dum|p the re|
|00005a20| 67 75 6c 61 72 20 65 78 | 70 72 65 73 73 69 6f 6e |gular ex|pression|
|00005a30| 20 7b 5c 73 6c 20 72 7d | 20 6f 6e 74 6f 20 5c 3c | {\sl r}| onto \<|
|00005a40| 73 74 64 6f 75 74 3e 20 | 69 6e 20 76 61 67 75 65 |stdout> |in vague|
|00005a50| 6c 79 0a 63 6f 6d 70 72 | 65 68 65 6e 73 69 62 6c |ly.compr|ehensibl|
|00005a60| 65 20 66 6f 72 6d 2e 7d | 0a 0a 25 25 25 25 25 25 |e form.}|..%%%%%%|
|00005a70| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005a80| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005a90| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005aa0| 25 25 25 25 25 25 0a 0c | 0a 5c 73 65 63 74 69 6f |%%%%%%..|.\sectio|
|00005ab0| 6e 7b 53 65 74 6a 6d 70 | 20 5c 26 20 53 69 67 6e |n{Setjmp| \& Sign|
|00005ac0| 61 6c 20 53 74 75 66 66 | 7d 0a 0a 5c 23 69 6e 63 |al Stuff|}..\#inc|
|00005ad0| 6c 75 64 65 20 5c 3c 73 | 65 74 6a 6d 70 2e 68 3e |lude \<s|etjmp.h>|
|00005ae0| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 69 6e 74 20 |..\funct|ion{int |
|00005af0| 73 65 74 6a 6d 70 28 6a | 6d 70 5c 5f 62 75 66 20 |setjmp(j|mp\_buf |
|00005b00| 62 75 66 29 3b 7d 0a 5c | 65 78 70 6c 7b 50 72 65 |buf);}.\|expl{Pre|
|00005b10| 70 61 72 65 20 62 75 66 | 66 65 72 20 7b 5c 73 6c |pare buf|fer {\sl|
|00005b20| 20 62 75 66 7d 20 66 6f | 72 20 6e 6f 6e 20 6c 6f | buf} fo|r non lo|
|00005b30| 63 61 6c 20 67 6f 74 6f | 20 76 69 61 20 7b 5c 62 |cal goto| via {\b|
|00005b40| 66 20 6c 6f 6e 67 6a 6d | 70 7d 28 29 2e 7d 0a 0a |f longjm|p}().}..|
|00005b50| 5c 66 75 6e 63 74 69 6f | 6e 7b 76 6f 69 64 20 6c |\functio|n{void l|
|00005b60| 6f 6e 67 6a 6d 70 28 6a | 6d 70 5c 5f 62 75 66 20 |ongjmp(j|mp\_buf |
|00005b70| 62 75 66 2c 20 69 6e 74 | 20 72 76 29 3b 7d 0a 5c |buf, int| rv);}.\|
|00005b80| 65 78 70 6c 7b 52 65 74 | 75 72 6e 20 74 6f 20 70 |expl{Ret|urn to p|
|00005b90| 72 65 76 69 6f 75 73 6c | 79 20 73 61 76 65 64 20 |reviousl|y saved |
|00005ba0| 63 6f 6e 74 65 78 74 20 | 7b 5c 73 6c 20 62 75 66 |context |{\sl buf|
|00005bb0| 7d 20 77 69 74 68 20 72 | 65 74 75 72 6e 20 76 61 |} with r|eturn va|
|00005bc0| 6c 75 65 0a 7b 5c 73 6c | 20 72 76 7d 2e 7d 0a 0a |lue.{\sl| rv}.}..|
|00005bd0| 5c 66 75 6e 63 74 69 6f | 6e 7b 69 6e 74 20 63 61 |\functio|n{int ca|
|00005be0| 74 63 68 28 6a 6d 70 5c | 5f 62 75 66 20 69 64 2c |tch(jmp\|_buf id,|
|00005bf0| 20 69 6e 74 20 28 2a 66 | 6e 29 28 76 6f 69 64 29 | int (*f|n)(void)|
|00005c00| 29 3b 7d 0a 5c 65 78 70 | 6c 7b 7d 0a 0a 5c 66 75 |);}.\exp|l{}..\fu|
|00005c10| 6e 63 74 69 6f 6e 7b 76 | 6f 69 64 20 74 68 72 6f |nction{v|oid thro|
|00005c20| 77 28 6a 6d 70 5c 5f 62 | 75 66 20 69 64 2c 20 69 |w(jmp\_b|uf id, i|
|00005c30| 6e 74 20 72 76 29 3b 7d | 0a 5c 65 78 70 6c 7b 7d |nt rv);}|.\expl{}|
|00005c40| 0a 5c 6d 65 64 73 6b 69 | 70 0a 0a 5c 23 69 6e 63 |.\medski|p..\#inc|
|00005c50| 6c 75 64 65 20 5c 3c 73 | 69 67 6e 61 6c 2e 68 3e |lude \<s|ignal.h>|
|00005c60| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 7b 5c 5f 5c |..\funct|ion{{\_\|
|00005c70| 5f 53 69 67 66 75 6e 63 | 7d 20 73 69 67 6e 61 6c |_Sigfunc|} signal|
|00005c80| 28 69 6e 74 20 73 69 67 | 2c 20 5c 5f 5c 5f 53 69 |(int sig|, \_\_Si|
|00005c90| 67 66 75 6e 63 20 66 75 | 6e 63 29 3b 7d 0a 5c 65 |gfunc fu|nc);}.\e|
|00005ca0| 78 70 6c 7b 49 6e 73 74 | 61 6c 6c 20 74 68 65 20 |xpl{Inst|all the |
|00005cb0| 68 61 6e 64 6c 65 72 20 | 7b 5c 73 6c 20 66 75 6e |handler |{\sl fun|
|00005cc0| 63 7d 20 66 6f 72 20 73 | 69 67 6e 61 6c 20 7b 5c |c} for s|ignal {\|
|00005cd0| 73 6c 20 73 69 67 7d 2e | 7d 0a 0a 5c 66 75 6e 63 |sl sig}.|}..\func|
|00005ce0| 74 69 6f 6e 7b 69 6e 74 | 20 72 61 69 73 65 28 69 |tion{int| raise(i|
|00005cf0| 6e 74 20 73 69 67 29 3b | 7d 0a 5c 65 78 70 6c 7b |nt sig);|}.\expl{|
|00005d00| 7d 0a 0a 5c 66 75 6e 63 | 74 69 6f 6e 7b 6c 6f 6e |}..\func|tion{lon|
|00005d10| 67 20 73 69 67 73 65 74 | 6d 61 73 6b 28 6c 6f 6e |g sigset|mask(lon|
|00005d20| 67 20 6d 61 73 6b 29 3b | 7d 0a 5c 65 78 70 6c 7b |g mask);|}.\expl{|
|00005d30| 28 4d 69 4e 54 29 7d 0a | 0a 5c 66 75 6e 63 74 69 |(MiNT)}.|.\functi|
|00005d40| 6f 6e 7b 6c 6f 6e 67 20 | 73 69 67 62 6c 6f 63 6b |on{long |sigblock|
|00005d50| 28 6c 6f 6e 67 20 6d 61 | 73 6b 29 3b 7d 0a 5c 65 |(long ma|sk);}.\e|
|00005d60| 78 70 6c 7b 28 4d 69 4e | 54 29 7d 0a 0a 25 25 25 |xpl{(MiN|T)}..%%%|
|00005d70| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005d80| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005d90| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005da0| 25 25 25 25 25 25 25 25 | 25 0a 0c 0a 5c 73 65 63 |%%%%%%%%|%...\sec|
|00005db0| 74 69 6f 6e 7b 55 2a 49 | 58 20 43 6f 6d 70 61 74 |tion{U*I|X Compat|
|00005dc0| 69 62 69 6c 69 74 79 20 | 52 6f 75 74 69 6e 65 73 |ibility |Routines|
|00005dd0| 7d 0a 0a 5c 23 69 6e 63 | 6c 75 64 65 20 5c 3c 75 |}..\#inc|lude \<u|
|00005de0| 6e 69 73 74 64 2e 68 3e | 0a 0a 5c 66 75 6e 63 74 |nistd.h>|..\funct|
|00005df0| 69 6f 6e 7b 76 6f 69 64 | 20 5c 5f 65 78 69 74 28 |ion{void| \_exit(|
|00005e00| 69 6e 74 20 72 65 74 29 | 3b 7d 0a 5c 65 78 70 6c |int ret)|;}.\expl|
|00005e10| 7b 45 78 69 74 20 74 68 | 65 20 63 75 72 72 65 6e |{Exit th|e curren|
|00005e20| 74 20 70 72 6f 63 65 73 | 73 20 77 69 74 68 6f 75 |t proces|s withou|
|00005e30| 74 20 63 6c 65 61 6e 69 | 6e 67 20 75 70 2e 20 28 |t cleani|ng up. (|
|00005e40| 54 68 69 73 20 69 73 20 | 61 20 7b 5c 62 66 0a 50 |This is |a {\bf.P|
|00005e50| 74 65 72 6d 28 29 7d 29 | 7d 0a 0a 5c 66 75 6e 63 |term()})|}..\func|
|00005e60| 74 69 6f 6e 7b 69 6e 74 | 20 61 63 63 65 73 73 28 |tion{int| access(|
|00005e70| 63 6f 6e 73 74 7e 63 68 | 61 72 20 5c 2a 66 6e 61 |const~ch|ar \*fna|
|00005e80| 6d 65 2c 20 69 6e 74 20 | 6d 6f 64 65 29 3b 7d 0a |me, int |mode);}.|
|00005e90| 5c 65 78 70 6c 7b 43 68 | 65 63 6b 2c 20 69 66 20 |\expl{Ch|eck, if |
|00005ea0| 66 69 6c 65 20 7b 5c 73 | 6c 20 66 6e 61 6d 65 7d |file {\s|l fname}|
|00005eb0| 20 69 73 20 61 63 63 65 | 73 73 61 62 6c 65 20 77 | is acce|ssable w|
|00005ec0| 69 74 68 20 6d 6f 64 65 | 20 7b 5c 73 6c 20 6d 6f |ith mode| {\sl mo|
|00005ed0| 64 65 7d 2e 7d 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |de}.}..\|function|
|00005ee0| 7b 69 6e 74 20 63 68 64 | 69 72 28 63 6f 6e 73 74 |{int chd|ir(const|
|00005ef0| 7e 63 68 61 72 20 5c 2a | 64 6e 61 6d 65 29 3b 7d |~char \*|dname);}|
|00005f00| 0a 5c 65 78 70 6c 7b 43 | 68 61 6e 65 20 74 68 65 |.\expl{C|hane the|
|00005f10| 20 63 75 72 72 65 6e 74 | 20 77 6f 72 6b 69 6e 67 | current| working|
|00005f20| 20 64 69 72 65 63 74 6f | 72 79 20 74 6f 20 7b 5c | directo|ry to {\|
|00005f30| 73 6c 20 64 6e 61 6d 65 | 7d 20 69 6e 63 6c 75 64 |sl dname|} includ|
|00005f40| 69 6e 67 20 64 72 69 76 | 65 0a 73 70 65 63 69 66 |ing driv|e.specif|
|00005f50| 69 63 61 74 69 6f 6e 2e | 7d 0a 0a 5c 66 75 6e 63 |ication.|}..\func|
|00005f60| 74 69 6f 6e 7b 69 6e 74 | 20 63 68 6d 6f 64 28 63 |tion{int| chmod(c|
|00005f70| 6f 6e 73 74 7e 63 68 61 | 72 20 5c 2a 66 6e 61 6d |onst~cha|r \*fnam|
|00005f80| 65 2c 20 69 6e 74 20 6d | 6f 64 65 29 3b 7d 0a 5c |e, int m|ode);}.\|
|00005f90| 65 78 70 6c 7b 43 68 61 | 6e 67 65 20 70 65 72 6d |expl{Cha|nge perm|
|00005fa0| 69 73 73 69 6f 6e 73 20 | 6f 66 20 66 69 6c 65 20 |issions |of file |
|00005fb0| 7b 5c 73 6c 20 66 6e 61 | 6d 65 7d 20 74 6f 20 7b |{\sl fna|me} to {|
|00005fc0| 5c 73 6c 20 6d 6f 64 65 | 7d 2e 7d 0a 0a 5c 66 75 |\sl mode|}.}..\fu|
|00005fd0| 6e 63 74 69 6f 6e 7b 69 | 6e 74 20 63 68 6f 77 6e |nction{i|nt chown|
|00005fe0| 28 63 6f 6e 73 74 7e 63 | 68 61 72 20 5c 2a 66 6e |(const~c|har \*fn|
|00005ff0| 61 6d 65 2c 20 69 6e 74 | 20 75 69 64 2c 20 69 6e |ame, int| uid, in|
|00006000| 74 20 67 69 64 29 3b 7d | 0a 5c 65 78 70 6c 7b 43 |t gid);}|.\expl{C|
|00006010| 68 61 6e 67 65 20 6f 77 | 6e 65 72 20 61 6e 64 20 |hange ow|ner and |
|00006020| 67 72 6f 75 70 20 6f 66 | 20 66 69 6c 65 20 7b 5c |group of| file {\|
|00006030| 73 6c 20 66 6e 61 6d 65 | 7d 2e 20 28 46 61 6b 65 |sl fname|}. (Fake|
|00006040| 20 66 6f 72 20 6e 6f 77 | 29 7d 0a 0a 5c 66 75 6e | for now|)}..\fun|
|00006050| 63 74 69 6f 6e 7b 69 6e | 74 20 63 6c 6f 73 65 28 |ction{in|t close(|
|00006060| 69 6e 74 20 66 64 29 3b | 7d 0a 5c 65 78 70 6c 7b |int fd);|}.\expl{|
|00006070| 43 6c 6f 73 65 20 74 68 | 65 20 66 69 6c 65 20 61 |Close th|e file a|
|00006080| 73 73 6f 73 69 61 74 65 | 64 20 77 69 74 68 20 66 |ssosiate|d with f|
|00006090| 69 6c 65 20 64 65 73 63 | 72 69 70 74 6f 72 20 7b |ile desc|riptor {|
|000060a0| 5c 73 6c 20 66 64 7d 2e | 7d 0a 0a 5c 66 75 6e 63 |\sl fd}.|}..\func|
|000060b0| 74 69 6f 6e 7b 69 6e 74 | 20 63 72 65 61 74 28 63 |tion{int| creat(c|
|000060c0| 6f 6e 73 74 7e 63 68 61 | 72 20 5c 2a 66 6e 61 6d |onst~cha|r \*fnam|
|000060d0| 65 2c 20 75 6e 73 69 67 | 6e 65 64 20 6d 6f 64 65 |e, unsig|ned mode|
|000060e0| 29 3b 7d 0a 5c 65 78 70 | 6c 7b 43 72 65 61 74 65 |);}.\exp|l{Create|
|000060f0| 20 74 68 65 20 66 69 6c | 65 20 7b 5c 73 6c 20 66 | the fil|e {\sl f|
|00006100| 6e 61 6d 65 7d 20 77 69 | 74 68 20 6d 6f 64 65 20 |name} wi|th mode |
|00006110| 7b 5c 73 6c 20 6d 6f 64 | 65 7d 2e 7d 0a 0a 5c 66 |{\sl mod|e}.}..\f|
|00006120| 75 6e 63 74 69 6f 6e 7b | 69 6e 74 20 64 75 70 28 |unction{|int dup(|
|00006130| 69 6e 74 20 66 64 29 3b | 7d 0a 5c 65 78 70 6c 7b |int fd);|}.\expl{|
|00006140| 44 75 70 6c 69 63 61 74 | 65 20 66 69 6c 65 64 65 |Duplicat|e filede|
|00006150| 73 63 72 69 70 74 6f 72 | 20 7b 5c 73 6c 20 66 64 |scriptor| {\sl fd|
|00006160| 7d 2e 7d 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 69 |}.}..\fu|nction{i|
|00006170| 6e 74 20 64 75 70 32 28 | 69 6e 74 20 66 64 31 2c |nt dup2(|int fd1,|
|00006180| 20 69 6e 74 20 66 64 32 | 29 3b 7d 0a 5c 65 78 70 | int fd2|);}.\exp|
|00006190| 6c 7b 44 75 70 6c 69 63 | 61 74 65 20 66 69 6c 65 |l{Duplic|ate file|
|000061a0| 64 65 73 63 72 69 70 74 | 6f 72 20 7b 5c 73 6c 20 |descript|or {\sl |
|000061b0| 66 64 31 7d 20 74 6f 20 | 7b 5c 73 6c 20 66 64 32 |fd1} to |{\sl fd2|
|000061c0| 7d 2e 7d 0a 0a 5c 66 75 | 6e 63 74 69 6f 6e 7b 69 |}.}..\fu|nction{i|
|000061d0| 6e 74 20 65 78 65 63 76 | 65 28 63 68 61 72 20 5c |nt execv|e(char \|
|000061e0| 2a 70 61 74 68 2c 20 63 | 68 61 72 20 7b 5c 2a 5c |*path, c|har {\*\|
|000061f0| 2a 7d 61 72 67 76 2c 20 | 63 68 61 72 20 7b 5c 2a |*}argv, |char {\*|
|00006200| 5c 2a 7d 65 6e 76 70 29 | 3b 7d 0a 5c 66 75 6e 63 |\*}envp)|;}.\func|
|00006210| 74 69 6f 6e 7b 69 6e 74 | 20 65 78 65 63 76 28 63 |tion{int| execv(c|
|00006220| 68 61 72 20 5c 2a 70 61 | 74 68 2c 20 63 68 61 72 |har \*pa|th, char|
|00006230| 20 7b 5c 2a 5c 2a 7d 61 | 72 67 76 29 3b 7d 0a 5c | {\*\*}a|rgv);}.\|
|00006240| 65 78 70 6c 7b 45 78 65 | 63 75 74 65 20 61 20 6e |expl{Exe|cute a n|
|00006250| 65 77 20 70 72 6f 63 65 | 73 73 20 66 72 6f 6d 20 |ew proce|ss from |
|00006260| 7b 5c 73 6c 20 70 61 74 | 68 7d 20 61 66 74 65 72 |{\sl pat|h} after|
|00006270| 20 61 20 7b 5c 73 6c 20 | 66 6f 72 6b 28 29 7d 2e | a {\sl |fork()}.|
|00006280| 7d 0a 0a 5c 66 75 6e 63 | 74 69 6f 6e 7b 69 6e 74 |}..\func|tion{int|
|00006290| 20 66 6f 72 6b 28 29 3b | 7d 0a 5c 66 75 6e 63 74 | fork();|}.\funct|
|000062a0| 69 6f 6e 7b 69 6e 74 20 | 76 66 6f 72 6b 28 29 3b |ion{int |vfork();|
|000062b0| 7d 0a 5c 65 78 70 6c 7b | 53 69 6d 75 6c 61 74 65 |}.\expl{|Simulate|
|000062c0| 20 61 20 6e 6f 6e 20 6d | 75 6c 5c 2d 74 69 5c 2d | a non m|ul\-ti\-|
|000062d0| 74 61 73 6b 5c 2d 69 6e | 67 20 66 6f 72 6b 2e 20 |task\-in|g fork. |
|000062e0| 7b 5c 73 6c 20 76 66 6f | 72 6b 7d 20 73 68 61 72 |{\sl vfo|rk} shar|
|000062f0| 65 73 0a 64 61 74 61 20 | 2b 20 73 74 61 63 6b 20 |es.data |+ stack |
|00006300| 77 69 74 68 20 70 61 72 | 65 6e 74 2e 7d 0a 0a 5c |with par|ent.}..\|
|00006310| 66 75 6e 63 74 69 6f 6e | 7b 63 68 61 72 20 5c 2a |function|{char \*|
|00006320| 67 65 74 63 77 64 28 63 | 68 61 72 20 5c 2a 62 75 |getcwd(c|har \*bu|
|00006330| 66 2c 20 69 6e 74 20 73 | 69 7a 65 29 3b 7d 0a 5c |f, int s|ize);}.\|
|00006340| 66 75 6e 63 74 69 6f 6e | 7b 63 68 61 72 20 5c 2a |function|{char \*|
|00006350| 67 65 74 77 64 28 63 68 | 61 72 20 5c 2a 62 75 66 |getwd(ch|ar \*buf|
|00006360| 29 3b 7d 0a 5c 65 78 70 | 6c 7b 47 65 74 20 74 68 |);}.\exp|l{Get th|
|00006370| 65 20 63 75 72 72 65 6e | 74 20 77 6f 72 6b 69 6e |e curren|t workin|
|00006380| 67 20 64 69 72 65 63 74 | 6f 72 79 2e 7d 0a 0a 5c |g direct|ory.}..\|
|00006390| 66 75 6e 63 74 69 6f 6e | 7b 69 6e 74 20 67 65 74 |function|{int get|
|000063a0| 67 69 64 28 29 3b 7d 0a | 5c 66 75 6e 63 74 69 6f |gid();}.|\functio|
|000063b0| 6e 7b 69 6e 74 20 67 65 | 74 75 69 64 28 29 3b 7d |n{int ge|tuid();}|
|000063c0| 0a 5c 65 78 70 6c 7b 47 | 65 74 20 75 73 65 72 20 |.\expl{G|et user |
|000063d0| 61 6e 64 20 67 72 6f 75 | 70 20 69 64 27 73 2e 20 |and grou|p id's. |
|000063e0| 28 46 61 6b 65 20 66 6f | 72 20 6e 6f 77 2c 20 72 |(Fake fo|r now, r|
|000063f0| 65 74 75 72 6e 69 6e 67 | 20 61 6c 73 77 61 79 73 |eturning| alsways|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.