home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: LHArc Archive
(archive/lha).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LHArc Archive (archive/lha)
| magic
| Supported |
100%
| file
| LHarc 1.x/ARX archive data [lh0], with "libnix.texi"
| default
| |
99%
| file
| data
| default
| |
100%
| TrID
| LHARC/LZARK compressed archive (generic)
| default
| |
100%
| lsar
| LZH
| default
| |
100%
| gt2
| LZH Archiv gefunden (Auflistung ist deaktiviert)
| default
| |
100%
| detectItEasy
| Archive: LHA archive (.LHA)(-lh0-)
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 21 f5 2d 6c 68 30 2d 0a | b3 00 00 0a b3 00 00 2b |!.-lh0-.|.......+|
|00000010| 08 8d 1d 02 00 0b 6c 69 | 62 6e 69 78 2e 74 65 78 |......li|bnix.tex|
|00000020| 69 ce f7 5c 69 6e 70 75 | 74 20 74 65 78 69 6e 66 |i..\inpu|t texinf|
|00000030| 6f 0a 40 73 65 74 66 69 | 6c 65 6e 61 6d 65 20 6c |o.@setfi|lename l|
|00000040| 69 62 6e 69 78 2e 69 6e | 66 6f 0a 40 73 65 74 74 |ibnix.in|fo.@sett|
|00000050| 69 74 6c 65 20 6c 69 62 | 6e 69 78 20 2d 20 61 20 |itle lib|nix - a |
|00000060| 73 74 61 74 69 63 20 6c | 69 62 72 61 72 79 20 66 |static l|ibrary f|
|00000070| 6f 72 20 47 43 43 20 6f | 6e 20 74 68 65 20 61 6d |or GCC o|n the am|
|00000080| 69 67 61 0a 40 73 65 74 | 63 68 61 70 74 65 72 6e |iga.@set|chaptern|
|00000090| 65 77 70 61 67 65 20 6f | 64 64 0a 0a 40 69 66 69 |ewpage o|dd..@ifi|
|000000a0| 6e 66 6f 0a 54 68 69 73 | 20 69 73 20 6c 69 62 6e |nfo.This| is libn|
|000000b0| 69 78 2e 74 65 78 69 20 | 74 68 65 20 64 6f 63 75 |ix.texi |the docu|
|000000c0| 6d 65 6e 74 61 74 69 6f | 6e 20 6f 66 20 74 68 65 |mentatio|n of the|
|000000d0| 20 6c 69 62 6e 69 78 20 | 6c 69 62 72 61 72 79 2e | libnix |library.|
|000000e0| 0a 53 69 6e 63 65 20 74 | 68 69 73 20 64 6f 63 75 |.Since t|his docu|
|000000f0| 6d 65 6e 74 20 69 73 20 | 70 61 72 74 20 6f 66 20 |ment is |part of |
|00000100| 74 68 65 20 6c 69 62 6e | 69 78 20 70 61 63 6b 61 |the libn|ix packa|
|00000110| 67 65 20 69 74 20 73 74 | 61 6e 64 73 0a 75 6e 64 |ge it st|ands.und|
|00000120| 65 72 20 74 68 65 20 73 | 61 6d 65 20 63 6f 70 79 |er the s|ame copy|
|00000130| 72 69 67 68 74 20 61 73 | 20 74 68 65 20 6c 69 62 |right as| the lib|
|00000140| 72 61 72 79 20 69 74 73 | 65 6c 66 2c 20 69 2e 65 |rary its|elf, i.e|
|00000150| 2e 20 69 74 27 73 20 0a | 70 75 62 6c 69 63 20 64 |. it's .|public d|
|00000160| 6f 6d 61 69 6e 2e 0a 40 | 65 6e 64 20 69 66 69 6e |omain..@|end ifin|
|00000170| 66 6f 0a 40 74 69 74 6c | 65 70 61 67 65 0a 40 74 |fo.@titl|epage.@t|
|00000180| 69 74 6c 65 20 6c 69 62 | 6e 69 78 0a 40 73 75 62 |itle lib|nix.@sub|
|00000190| 74 69 74 6c 65 20 61 20 | 73 74 61 74 69 63 20 6c |title a |static l|
|000001a0| 69 62 72 61 72 79 20 66 | 6f 72 20 47 43 43 20 6f |ibrary f|or GCC o|
|000001b0| 6e 20 74 68 65 20 61 6d | 69 67 61 0a 40 61 75 74 |n the am|iga.@aut|
|000001c0| 68 6f 72 20 4d 61 74 74 | 68 69 61 73 20 46 6c 65 |hor Matt|hias Fle|
|000001d0| 69 73 63 68 65 72 20 26 | 20 47 75 6e 74 68 65 72 |ischer &| Gunther|
|000001e0| 20 4e 69 6b 6c 0a 40 65 | 6e 64 20 74 69 74 6c 65 | Nikl.@e|nd title|
|000001f0| 70 61 67 65 0a 0a 40 6e | 6f 64 65 20 54 6f 70 2c |page..@n|ode Top,|
|00000200| 44 65 73 63 72 69 70 74 | 69 6f 6e 2c 28 64 69 72 |Descript|ion,(dir|
|00000210| 29 2c 28 64 69 72 29 0a | 40 69 66 69 6e 66 6f 0a |),(dir).|@ifinfo.|
|00000220| 54 68 69 73 20 69 73 20 | 74 68 65 20 64 6f 63 75 |This is |the docu|
|00000230| 6d 65 6e 74 61 74 69 6f | 6e 20 6f 66 20 6c 69 62 |mentatio|n of lib|
|00000240| 6e 69 78 2e 20 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |nix. The| followi|
|00000250| 6e 67 20 69 73 20 61 20 | 6c 69 73 74 0a 6f 66 20 |ng is a |list.of |
|00000260| 63 68 61 70 74 65 72 73 | 2e 20 59 6f 75 20 6e 65 |chapters|. You ne|
|00000270| 65 64 20 6e 6f 74 20 72 | 65 61 64 20 61 6c 6c 20 |ed not r|ead all |
|00000280| 6f 66 20 74 68 65 6d 20 | 2d 20 62 75 74 20 72 65 |of them |- but re|
|00000290| 61 64 69 6e 67 0a 74 68 | 65 20 63 68 61 70 74 65 |ading.th|e chapte|
|000002a0| 72 20 46 65 61 74 75 72 | 65 73 20 69 73 20 72 65 |r Featur|es is re|
|000002b0| 63 6f 6d 6d 65 6e 64 65 | 64 2e 0a 40 65 6e 64 20 |commende|d..@end |
|000002c0| 69 66 69 6e 66 6f 0a 0a | 40 6d 65 6e 75 0a 2a 20 |ifinfo..|@menu.* |
|000002d0| 44 65 73 63 72 69 70 74 | 69 6f 6e 3a 3a 20 20 20 |Descript|ion:: |
|000002e0| 20 20 20 57 68 61 74 20 | 69 73 20 6c 69 62 6e 69 | What |is libni|
|000002f0| 78 3f 0a 2a 20 4d 6f 74 | 69 76 61 74 69 6f 6e 3a |x?.* Mot|ivation:|
|00000300| 3a 20 20 20 20 20 20 20 | 57 68 79 20 61 20 6e 65 |: |Why a ne|
|00000310| 77 20 6c 69 62 72 61 72 | 79 3f 0a 2a 20 41 75 74 |w librar|y?.* Aut|
|00000320| 68 6f 72 73 3a 3a 20 20 | 20 20 20 20 20 20 20 20 |hors:: | |
|00000330| 57 68 6f 20 64 69 64 20 | 69 74 3f 0a 2a 20 44 69 |Who did |it?.* Di|
|00000340| 73 63 6c 61 69 6d 65 72 | 3a 3a 20 20 20 20 20 20 |sclaimer|:: |
|00000350| 20 43 6f 70 79 72 69 67 | 68 74 20 61 6e 64 20 6f | Copyrig|ht and o|
|00000360| 74 68 65 72 20 6c 65 67 | 61 6c 20 73 74 75 66 66 |ther leg|al stuff|
|00000370| 2e 0a 2a 20 4e 61 6d 69 | 6e 67 3a 3a 20 20 20 20 |..* Nami|ng:: |
|00000380| 20 20 20 20 20 20 20 4e | 61 6d 69 6e 67 20 63 6f | N|aming co|
|00000390| 6e 76 65 6e 74 69 6f 6e | 73 2e 0a 2a 20 55 73 61 |nvention|s..* Usa|
|000003a0| 67 65 3a 3a 20 20 20 20 | 20 20 20 20 20 20 20 20 |ge:: | |
|000003b0| 48 6f 77 20 74 6f 20 75 | 73 65 20 69 74 20 3b 2d |How to u|se it ;-|
|000003c0| 29 0a 2a 20 46 65 61 74 | 75 72 65 73 3a 3a 20 20 |).* Feat|ures:: |
|000003d0| 20 20 20 20 20 20 20 44 | 65 74 61 69 6c 73 20 6f | D|etails o|
|000003e0| 66 20 74 68 65 20 69 6d | 70 6c 65 6d 65 6e 74 61 |f the im|plementa|
|000003f0| 74 69 6f 6e 20 28 61 6e | 64 20 6d 6f 72 65 29 2e |tion (an|d more).|
|00000400| 0a 2a 20 53 70 65 63 69 | 61 6c 20 73 74 61 72 74 |.* Speci|al start|
|00000410| 75 70 73 3a 3a 20 48 6f | 77 20 74 6f 20 77 72 69 |ups:: Ho|w to wri|
|00000420| 74 65 20 73 68 61 72 65 | 64 20 6c 69 62 72 61 72 |te share|d librar|
|00000430| 69 65 73 20 61 6e 64 20 | 64 65 76 69 63 65 73 20 |ies and |devices |
|00000440| 77 69 74 68 20 67 63 63 | 2e 0a 2a 20 53 65 74 20 |with gcc|..* Set |
|00000450| 65 6c 65 6d 65 6e 74 73 | 3a 3a 20 20 20 20 20 41 |elements|:: A|
|00000460| 20 6e 69 63 65 20 66 65 | 61 74 75 72 65 20 6f 66 | nice fe|ature of|
|00000470| 20 67 6e 75 20 6c 64 2e | 0a 2a 20 4c 69 62 72 61 | gnu ld.|.* Libra|
|00000480| 72 79 20 62 61 73 65 73 | 3a 3a 20 20 20 20 41 6e |ry bases|:: An|
|00000490| 64 20 68 6f 77 20 74 68 | 65 79 20 77 6f 72 6b 2e |d how th|ey work.|
|000004a0| 0a 2a 20 67 65 74 61 34 | 3a 3a 20 20 20 20 20 20 |.* geta4|:: |
|000004b0| 20 20 20 20 20 20 53 6f | 6d 65 20 77 6f 72 64 73 | So|me words|
|000004c0| 20 6f 6e 20 63 6f 64 65 | 20 61 6e 64 20 64 61 74 | on code| and dat|
|000004d0| 61 20 6d 6f 64 65 6c 73 | 0a 2a 20 46 41 51 73 3a |a models|.* FAQs:|
|000004e0| 3a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 46 72 |: | Fr|
|000004f0| 65 71 75 65 6e 74 6c 79 | 20 61 73 6b 65 64 20 71 |equently| asked q|
|00000500| 75 65 73 74 69 6f 6e 73 | 20 61 6e 64 20 61 6e 73 |uestions| and ans|
|00000510| 77 65 72 73 2e 0a 40 65 | 6e 64 20 6d 65 6e 75 0a |wers..@e|nd menu.|
|00000520| 40 6e 6f 64 65 20 44 65 | 73 63 72 69 70 74 69 6f |@node De|scriptio|
|00000530| 6e 2c 4d 6f 74 69 76 61 | 74 69 6f 6e 2c 54 6f 70 |n,Motiva|tion,Top|
|00000540| 2c 54 6f 70 0a 40 63 68 | 61 70 74 65 72 20 57 68 |,Top.@ch|apter Wh|
|00000550| 61 74 20 69 73 20 6c 69 | 62 6e 69 78 3f 0a 0a 6c |at is li|bnix?..l|
|00000560| 69 62 6e 69 78 20 69 73 | 20 61 20 73 74 61 74 69 |ibnix is| a stati|
|00000570| 63 20 28 69 2e 65 2e 20 | 6c 69 6e 6b 29 20 6c 69 |c (i.e. |link) li|
|00000580| 62 72 61 72 79 20 66 6f | 72 20 75 73 61 67 65 20 |brary fo|r usage |
|00000590| 6f 6e 20 61 6d 69 67 61 | 20 63 6f 6d 70 75 74 65 |on amiga| compute|
|000005a0| 72 73 0a 74 6f 67 65 74 | 68 65 72 20 77 69 74 68 |rs.toget|her with|
|000005b0| 20 67 63 63 20 32 2e 33 | 2e 33 20 6f 72 20 61 62 | gcc 2.3|.3 or ab|
|000005c0| 6f 76 65 2e 20 49 74 20 | 69 73 20 76 65 72 79 20 |ove. It |is very |
|000005d0| 61 6d 69 67 61 6c 69 6b | 65 20 61 6e 64 20 63 6f |amigalik|e and co|
|000005e0| 6e 74 61 69 6e 73 0a 61 | 20 6c 6f 74 20 6f 66 20 |ntains.a| lot of |
|000005f0| 66 65 61 74 75 72 65 73 | 20 73 6f 6d 65 20 70 65 |features| some pe|
|00000600| 6f 70 6c 65 20 6d 69 73 | 73 65 64 20 69 6e 20 69 |ople mis|sed in i|
|00000610| 78 65 6d 75 6c 2e 6c 69 | 62 72 61 72 79 3a 0a 0a |xemul.li|brary:..|
|00000620| 40 69 74 65 6d 69 7a 65 | 20 40 62 75 6c 6c 65 74 |@itemize| @bullet|
|00000630| 0a 40 69 74 65 6d 0a 61 | 75 74 6f 2d 6f 70 65 6e |.@item.a|uto-open|
|00000640| 2d 6c 69 62 72 61 72 79 | 20 66 65 61 74 75 72 65 |-library| feature|
|00000650| 0a 40 69 74 65 6d 0a 53 | 41 53 20 63 6f 6d 70 61 |.@item.S|AS compa|
|00000660| 74 69 62 6c 65 20 68 61 | 6e 64 6c 69 6e 67 20 6f |tible ha|ndling o|
|00000670| 66 20 57 42 20 73 74 61 | 72 74 75 70 20 6d 65 73 |f WB sta|rtup mes|
|00000680| 73 61 67 65 0a 40 69 74 | 65 6d 0a 61 75 74 6f 2d |sage.@it|em.auto-|
|00000690| 64 65 74 61 63 68 20 73 | 74 61 72 74 75 70 20 63 |detach s|tartup c|
|000006a0| 6f 64 65 0a 40 69 74 65 | 6d 0a 69 73 20 76 65 72 |ode.@ite|m.is ver|
|000006b0| 79 20 73 68 6f 72 74 0a | 40 69 74 65 6d 0a 64 6f |y short.|@item.do|
|000006c0| 65 73 20 6e 6f 74 20 72 | 65 71 75 69 72 65 20 61 |es not r|equire a|
|000006d0| 20 73 68 61 72 65 64 20 | 6c 69 62 72 61 72 79 0a | shared |library.|
|000006e0| 40 69 74 65 6d 0a 69 73 | 20 50 44 20 69 6e 73 74 |@item.is| PD inst|
|000006f0| 65 61 64 20 6f 66 20 47 | 4c 50 4c 0a 40 69 74 65 |ead of G|LPL.@ite|
|00000700| 6d 0a 61 6e 64 20 6d 75 | 63 68 20 6d 6f 72 65 0a |m.and mu|ch more.|
|00000710| 40 65 6e 64 20 69 74 65 | 6d 69 7a 65 0a 0a 53 6f |@end ite|mize..So|
|00000720| 20 69 66 20 79 6f 75 20 | 77 61 6e 74 20 74 6f 20 | if you |want to |
|00000730| 77 72 69 74 65 20 61 6d | 69 67 61 20 73 70 65 63 |write am|iga spec|
|00000740| 69 66 69 63 20 70 72 6f | 67 72 61 6d 73 20 6f 72 |ific pro|grams or|
|00000750| 20 69 66 20 79 6f 75 20 | 6f 6e 6c 79 20 6e 65 65 | if you |only nee|
|00000760| 64 20 41 4e 53 49 20 73 | 75 70 70 6f 72 74 0a 69 |d ANSI s|upport.i|
|00000770| 6e 73 74 65 61 64 20 6f | 66 20 75 6e 69 78 20 63 |nstead o|f unix c|
|00000780| 6f 6d 70 61 74 69 62 69 | 6c 69 74 79 20 2d 20 61 |ompatibi|lity - a|
|00000790| 6e 64 20 69 66 20 79 6f | 75 20 64 6f 6e 27 74 20 |nd if yo|u don't |
|000007a0| 77 61 6e 74 20 74 6f 20 | 72 65 64 69 73 74 72 69 |want to |redistri|
|000007b0| 62 75 74 65 20 69 78 65 | 6d 75 6c 2e 6c 69 62 72 |bute ixe|mul.libr|
|000007c0| 61 72 79 20 2d 0a 74 68 | 69 73 20 63 61 6e 20 62 |ary -.th|is can b|
|000007d0| 65 20 79 6f 75 72 20 63 | 68 6f 69 63 65 2e 0a 0a |e your c|hoice...|
|000007e0| 42 75 74 20 62 65 20 61 | 77 61 72 65 20 2d 20 6c |But be a|ware - l|
|000007f0| 69 62 6e 69 78 20 72 65 | 71 75 69 72 65 73 20 41 |ibnix re|quires A|
|00000800| 6d 69 67 61 20 4f 53 20 | 32 2e 30 20 6f 72 20 68 |miga OS |2.0 or h|
|00000810| 69 67 68 65 72 20 3a 28 | 2e 0a 0a 40 6e 6f 64 65 |igher :(|...@node|
|00000820| 20 4d 6f 74 69 76 61 74 | 69 6f 6e 2c 41 75 74 68 | Motivat|ion,Auth|
|00000830| 6f 72 73 2c 44 65 73 63 | 72 69 70 74 69 6f 6e 2c |ors,Desc|ription,|
|00000840| 54 6f 70 0a 40 63 68 61 | 70 74 65 72 20 57 68 79 |Top.@cha|pter Why|
|00000850| 20 61 20 6e 65 77 20 6c | 69 62 72 61 72 79 3f 0a | a new l|ibrary?.|
|00000860| 0a 41 20 66 65 77 20 6d | 6f 6e 74 68 73 20 61 67 |.A few m|onths ag|
|00000870| 6f 20 49 20 64 65 63 69 | 64 65 64 20 74 6f 20 69 |o I deci|ded to i|
|00000880| 6e 73 74 61 6c 6c 20 74 | 68 65 20 67 63 63 20 70 |nstall t|he gcc p|
|00000890| 61 63 6b 61 67 65 20 6f | 6e 20 6d 79 20 61 6d 69 |ackage o|n my ami|
|000008a0| 67 61 20 74 6f 20 0a 72 | 65 63 6f 6d 70 69 6c 65 |ga to .r|ecompile|
|000008b0| 20 73 6f 6d 65 20 70 72 | 6f 67 72 61 6d 73 20 77 | some pr|ograms w|
|000008c0| 69 74 68 20 69 74 2e 20 | 49 20 66 6f 75 6e 64 20 |ith it. |I found |
|000008d0| 6f 75 74 20 73 6f 6f 6e | 20 74 68 61 74 20 74 68 |out soon| that th|
|000008e0| 65 72 65 20 61 72 65 20 | 73 6f 6d 65 0a 74 68 69 |ere are |some.thi|
|000008f0| 6e 67 73 20 74 68 61 74 | 20 6d 61 6b 65 20 69 74 |ngs that| make it|
|00000900| 20 68 61 72 64 20 74 6f | 20 77 72 69 74 65 20 61 | hard to| write a|
|00000910| 6d 69 67 61 20 73 70 65 | 63 69 66 69 63 20 70 72 |miga spe|cific pr|
|00000920| 6f 67 72 61 6d 73 20 77 | 69 74 68 20 67 63 63 0a |ograms w|ith gcc.|
|00000930| 61 6e 64 20 69 78 65 6d | 75 6c 2e 6c 69 62 72 61 |and ixem|ul.libra|
|00000940| 72 79 20 2d 20 66 69 72 | 73 74 20 6f 66 20 61 6c |ry - fir|st of al|
|00000950| 6c 20 74 68 65 20 6c 69 | 62 72 61 72 79 20 69 74 |l the li|brary it|
|00000960| 73 65 6c 66 2e 20 69 78 | 65 6d 75 6c 2e 6c 69 62 |self. ix|emul.lib|
|00000970| 72 61 72 79 0a 69 73 20 | 61 20 76 65 72 79 20 6e |rary.is |a very n|
|00000980| 69 63 65 20 74 68 69 6e | 67 20 69 66 20 79 6f 75 |ice thin|g if you|
|00000990| 20 77 61 6e 74 20 74 6f | 20 70 6f 72 74 20 75 6e | want to| port un|
|000009a0| 69 78 20 70 72 6f 67 72 | 61 6d 73 20 61 6e 64 20 |ix progr|ams and |
|000009b0| 69 74 27 73 20 74 68 65 | 0a 62 61 63 6b 62 6f 6e |it's the|.backbon|
|000009c0| 65 20 6f 66 20 74 68 65 | 20 77 68 6f 6c 65 20 67 |e of the| whole g|
|000009d0| 63 63 20 65 6e 76 69 72 | 6f 6e 6d 65 6e 74 2c 20 |cc envir|onment, |
|000009e0| 62 75 74 20 69 74 27 73 | 20 72 69 64 69 63 75 6c |but it's| ridicul|
|000009f0| 6f 75 73 20 74 6f 20 68 | 61 76 65 20 0a 73 75 63 |ous to h|ave .suc|
|00000a00| 68 20 61 20 6c 61 72 67 | 65 20 73 68 61 72 65 64 |h a larg|e shared|
|00000a10| 20 6c 69 62 72 61 72 79 | 20 69 6e 63 6c 75 64 65 | library| include|
|00000a20| 64 20 6a 75 73 74 20 74 | 6f 20 70 72 6f 63 65 73 |d just t|o proces|
|00000a30| 73 20 74 68 65 20 77 6f | 72 6b 62 65 6e 63 68 20 |s the wo|rkbench |
|00000a40| 0a 73 74 61 72 74 75 70 | 20 6d 65 73 73 61 67 65 |.startup| message|
|00000a50| 20 69 66 20 79 6f 75 20 | 77 61 6e 74 20 74 6f 20 | if you |want to |
|00000a60| 77 72 69 74 65 20 61 6d | 69 67 61 20 73 70 65 63 |write am|iga spec|
|00000a70| 69 66 69 63 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |ific app|lication|
|00000a80| 73 2e 0a 0a 53 6f 20 49 | 20 74 72 69 65 64 20 6f |s...So I| tried o|
|00000a90| 75 74 20 73 6f 6d 65 20 | 6f 66 20 74 68 65 20 6f |ut some |of the o|
|00000aa0| 74 68 65 72 20 67 63 63 | 20 70 61 63 6b 61 67 65 |ther gcc| package|
|00000ab0| 73 20 61 72 6f 75 6e 64 | 20 2d 20 65 76 65 6e 20 |s around| - even |
|00000ac0| 67 65 72 6c 69 62 20 2d | 20 62 75 74 0a 6e 6f 6e |gerlib -| but.non|
|00000ad0| 65 20 6f 66 20 74 68 65 | 6d 20 64 69 64 20 65 78 |e of the|m did ex|
|00000ae0| 61 63 74 6c 79 20 77 68 | 61 74 20 49 20 77 61 6e |actly wh|at I wan|
|00000af0| 74 65 64 20 69 74 20 74 | 6f 20 64 6f 2e 0a 0a 53 |ted it t|o do...S|
|00000b00| 6f 20 49 20 64 65 63 69 | 64 65 64 20 74 6f 20 77 |o I deci|ded to w|
|00000b10| 72 69 74 65 20 6d 79 20 | 6f 77 6e 2e 20 49 20 6b |rite my |own. I k|
|00000b20| 6e 65 77 20 74 68 61 74 | 20 49 20 77 61 73 20 6f |new that| I was o|
|00000b30| 6e 20 74 68 65 20 72 69 | 67 68 74 20 77 61 79 20 |n the ri|ght way |
|00000b40| 61 74 20 74 68 65 0a 74 | 69 6d 65 20 49 20 70 6c |at the.t|ime I pl|
|00000b50| 61 63 65 64 20 61 20 6d | 69 6e 69 73 63 75 6c 65 |aced a m|iniscule|
|00000b60| 20 73 74 61 72 74 75 70 | 20 66 6f 72 20 67 63 63 | startup| for gcc|
|00000b70| 20 6f 6e 20 74 68 65 20 | 61 6d 69 6e 65 74 20 61 | on the |aminet a|
|00000b80| 6e 64 20 67 6f 74 20 61 | 20 6c 6f 74 0a 6f 66 20 |nd got a| lot.of |
|00000b90| 72 65 73 6f 6e 61 6e 63 | 65 20 28 61 6e 64 20 65 |resonanc|e (and e|
|00000ba0| 76 65 6e 20 61 20 63 6f | 2d 61 75 74 68 6f 72 29 |ven a co|-author)|
|00000bb0| 2e 0a 0a 53 6f 20 68 65 | 72 65 20 69 74 20 69 73 |...So he|re it is|
|00000bc0| 2e 20 49 74 27 73 20 76 | 65 72 79 20 61 6d 69 67 |. It's v|ery amig|
|00000bd0| 61 6c 69 6b 65 2c 20 69 | 74 20 64 6f 65 73 6e 27 |alike, i|t doesn'|
|00000be0| 74 20 73 75 70 70 6f 72 | 74 20 75 6e 69 78 2d 66 |t suppor|t unix-f|
|00000bf0| 65 61 74 75 72 65 73 0a | 28 6e 6f 6d 65 6e 20 65 |eatures.|(nomen e|
|00000c00| 73 74 20 6f 6d 65 6e 20 | 2d 20 69 74 27 73 20 6e |st omen |- it's n|
|00000c10| 61 6d 65 20 69 73 20 6c | 69 62 6e 69 78 20 3d 20 |ame is l|ibnix = |
|00000c20| 4e 6f 20 49 58 65 6d 75 | 6c 2c 20 74 68 61 6e 6b |No IXemu|l, thank|
|00000c30| 20 79 6f 75 20 50 68 69 | 6c 69 70 70 65 29 0a 62 | you Phi|lippe).b|
|00000c40| 75 74 20 74 68 61 74 27 | 73 20 65 78 61 63 74 6c |ut that'|s exactl|
|00000c50| 79 20 74 68 65 20 67 6f | 61 6c 20 6f 66 20 69 74 |y the go|al of it|
|00000c60| 2e 0a 0a 4d 61 74 74 68 | 69 61 73 0a 0a 40 6e 6f |...Matth|ias..@no|
|00000c70| 64 65 20 41 75 74 68 6f | 72 73 2c 44 69 73 63 6c |de Autho|rs,Discl|
|00000c80| 61 69 6d 65 72 2c 4d 6f | 74 69 76 61 74 69 6f 6e |aimer,Mo|tivation|
|00000c90| 2c 54 6f 70 0a 40 63 68 | 61 70 74 65 72 20 41 75 |,Top.@ch|apter Au|
|00000ca0| 74 68 6f 72 73 0a 0a 49 | 66 20 79 6f 75 20 77 61 |thors..I|f you wa|
|00000cb0| 6e 74 20 74 6f 20 63 68 | 61 6e 67 65 20 61 6e 79 |nt to ch|ange any|
|00000cc0| 74 68 69 6e 67 20 69 6e | 20 74 68 65 20 6c 69 62 |thing in| the lib|
|00000cd0| 72 61 72 79 20 70 6c 65 | 61 73 65 20 63 6f 6e 74 |rary ple|ase cont|
|00000ce0| 61 63 74 20 6f 6e 65 20 | 6f 66 20 75 73 20 66 69 |act one |of us fi|
|00000cf0| 72 73 74 20 2d 20 0a 77 | 65 20 6b 6e 6f 77 20 68 |rst - .w|e know h|
|00000d00| 6f 77 20 74 6f 20 64 6f | 20 69 74 20 62 65 73 74 |ow to do| it best|
|00000d10| 20 73 69 6e 63 65 20 77 | 65 20 77 72 6f 74 65 20 | since w|e wrote |
|00000d20| 69 74 2e 20 49 66 20 79 | 6f 75 20 77 61 6e 74 20 |it. If y|ou want |
|00000d30| 74 6f 20 72 65 70 6f 72 | 74 0a 62 75 67 73 20 70 |to repor|t.bugs p|
|00000d40| 6c 65 61 73 65 20 63 6f | 6e 74 61 63 74 20 75 73 |lease co|ntact us|
|00000d50| 2c 20 74 6f 6f 2e 20 49 | 66 20 77 65 20 64 6f 6e |, too. I|f we don|
|00000d60| 27 74 20 6b 6e 6f 77 20 | 61 62 6f 75 74 20 74 68 |'t know |about th|
|00000d70| 65 6d 20 77 65 20 63 61 | 6e 6e 6f 74 20 66 69 78 |em we ca|nnot fix|
|00000d80| 20 74 68 65 6d 2e 0a 0a | 4d 61 74 74 68 69 61 73 | them...|Matthias|
|00000d90| 20 46 6c 65 69 73 63 68 | 65 72 0a 40 2a 66 6c 65 | Fleisch|er.@*fle|
|00000da0| 69 73 63 68 72 40 40 69 | 7a 66 6d 2e 75 6e 69 2d |ischr@@i|zfm.uni-|
|00000db0| 73 74 75 74 74 67 61 72 | 74 2e 64 65 0a 0a 47 75 |stuttgar|t.de..Gu|
|00000dc0| 6e 74 68 65 72 20 4e 69 | 6b 6c 0a 40 2a 67 6e 69 |nther Ni|kl.@*gni|
|00000dd0| 6b 6c 40 40 69 6e 66 6f | 72 6d 61 74 69 6b 2e 75 |kl@@info|rmatik.u|
|00000de0| 6e 69 2d 72 6f 73 74 6f | 63 6b 2e 64 65 0a 0a 49 |ni-rosto|ck.de..I|
|00000df0| 20 77 61 6e 74 20 74 6f | 20 74 68 61 6e 6b 20 65 | want to| thank e|
|00000e00| 73 70 65 63 69 61 6c 6c | 79 20 47 65 72 68 61 72 |speciall|y Gerhar|
|00000e10| 64 20 4d fc 6c 6c 65 72 | 20 28 74 68 65 20 61 75 |d M.ller| (the au|
|00000e20| 74 68 6f 72 20 6f 66 20 | 67 65 72 6c 69 62 29 20 |thor of |gerlib) |
|00000e30| 2d 20 77 65 20 77 6f 72 | 6b 65 64 0a 68 61 72 64 |- we wor|ked.hard|
|00000e40| 20 74 6f 67 65 74 68 65 | 72 20 74 6f 20 62 65 20 | togethe|r to be |
|00000e50| 63 6f 6d 70 61 74 69 62 | 6c 65 20 2d 20 6a 75 73 |compatib|le - jus|
|00000e60| 74 20 77 61 69 74 20 66 | 6f 72 20 68 69 73 20 6e |t wait f|or his n|
|00000e70| 65 78 74 20 72 65 6c 65 | 61 73 65 2e 0a 41 6e 64 |ext rele|ase..And|
|00000e80| 20 50 68 69 6c 69 70 70 | 65 20 42 72 61 6e 64 20 | Philipp|e Brand |
|00000e90| 2d 20 49 20 75 73 65 20 | 67 63 63 20 32 2e 33 2e |- I use |gcc 2.3.|
|00000ea0| 33 20 72 61 74 68 65 72 | 20 74 68 61 6e 20 67 63 |3 rather| than gc|
|00000eb0| 63 20 32 2e 35 2e 38 20 | 62 75 74 20 74 68 65 20 |c 2.5.8 |but the |
|00000ec0| 6e 61 6d 65 0a 6c 69 62 | 6e 69 78 20 77 61 73 20 |name.lib|nix was |
|00000ed0| 6a 75 73 74 20 68 69 73 | 20 69 64 65 61 2e 0a 0a |just his| idea...|
|00000ee0| 40 6e 6f 64 65 20 44 69 | 73 63 6c 61 69 6d 65 72 |@node Di|sclaimer|
|00000ef0| 2c 4e 61 6d 69 6e 67 2c | 41 75 74 68 6f 72 73 2c |,Naming,|Authors,|
|00000f00| 54 6f 70 0a 40 63 68 61 | 70 74 65 72 20 44 69 73 |Top.@cha|pter Dis|
|00000f10| 63 6c 61 69 6d 65 72 0a | 0a 54 68 69 73 20 70 61 |claimer.|.This pa|
|00000f20| 63 6b 61 67 65 20 69 73 | 20 70 75 62 6c 69 63 20 |ckage is| public |
|00000f30| 64 6f 6d 61 69 6e 2e 20 | 54 68 61 74 20 6d 65 61 |domain. |That mea|
|00000f40| 6e 73 20 74 68 61 74 20 | 79 6f 75 20 63 61 6e 20 |ns that |you can |
|00000f50| 63 6f 70 79 2c 20 75 73 | 65 20 61 6e 64 20 6d 6f |copy, us|e and mo|
|00000f60| 64 69 66 79 20 69 74 0a | 77 69 74 68 6f 75 74 20 |dify it.|without |
|00000f70| 61 6e 79 20 70 72 6f 62 | 6c 65 6d 73 20 61 6e 64 |any prob|lems and|
|00000f80| 20 74 68 61 74 20 79 6f | 75 20 63 61 6e 20 67 65 | that yo|u can ge|
|00000f90| 74 20 69 74 20 66 6f 72 | 20 66 72 65 65 2e 20 49 |t it for| free. I|
|00000fa0| 66 20 79 6f 75 20 61 63 | 74 75 61 6c 6c 79 0a 70 |f you ac|tually.p|
|00000fb0| 61 69 64 20 66 6f 72 20 | 67 65 74 74 69 6e 67 20 |aid for |getting |
|00000fc0| 69 74 20 74 68 69 73 20 | 69 73 20 63 6f 6d 70 6c |it this |is compl|
|00000fd0| 65 74 65 6c 79 20 79 6f | 75 72 20 66 61 75 6c 74 |etely yo|ur fault|
|00000fe0| 20 2d 20 49 20 64 69 64 | 6e 27 74 20 73 65 65 20 | - I did|n't see |
|00000ff0| 61 20 63 65 6e 74 0a 6f | 66 20 74 68 61 74 20 6d |a cent.o|f that m|
|00001000| 6f 6e 65 79 2e 20 49 74 | 20 61 6c 73 6f 20 6d 65 |oney. It| also me|
|00001010| 61 6e 73 20 74 68 61 74 | 20 49 20 63 61 6e 6e 6f |ans that| I canno|
|00001020| 74 20 62 65 20 6d 61 64 | 65 20 72 65 73 70 6f 6e |t be mad|e respon|
|00001030| 73 69 62 6c 65 20 66 6f | 72 20 61 6e 79 20 64 61 |sible fo|r any da|
|00001040| 6d 61 67 65 0a 72 65 73 | 75 6c 74 69 6e 67 20 6f |mage.res|ulting o|
|00001050| 75 74 20 6f 66 20 74 68 | 65 20 75 73 65 20 6f 66 |ut of th|e use of|
|00001060| 20 69 74 20 2d 20 79 6f | 75 20 73 69 6d 70 6c 79 | it - yo|u simply|
|00001070| 20 73 68 6f 75 6c 64 6e | 27 74 20 74 72 75 73 74 | shouldn|'t trust|
|00001080| 20 61 6e 79 74 68 69 6e | 67 20 79 6f 75 20 64 69 | anythin|g you di|
|00001090| 64 6e 27 74 0a 70 61 79 | 20 66 6f 72 20 3a 2d 29 |dn't.pay| for :-)|
|000010a0| 2e 0a 0a 40 6e 6f 64 65 | 20 4e 61 6d 69 6e 67 2c |...@node| Naming,|
|000010b0| 55 73 61 67 65 2c 44 69 | 73 63 6c 61 69 6d 65 72 |Usage,Di|sclaimer|
|000010c0| 2c 54 6f 70 0a 40 63 68 | 61 70 74 65 72 20 4e 61 |,Top.@ch|apter Na|
|000010d0| 6d 69 6e 67 20 63 6f 6e | 76 65 6e 74 69 6f 6e 73 |ming con|ventions|
|000010e0| 0a 0a 54 68 69 73 20 6c | 69 62 72 61 72 79 20 69 |..This l|ibrary i|
|000010f0| 73 20 6e 6f 74 20 6f 6e | 6c 79 20 66 6f 72 20 74 |s not on|ly for t|
|00001100| 68 65 20 65 6e 64 20 75 | 73 65 72 20 62 75 74 20 |he end u|ser but |
|00001110| 61 6c 73 6f 20 66 6f 72 | 20 74 68 65 20 6c 69 62 |also for| the lib|
|00001120| 72 61 72 79 0a 70 72 6f | 67 72 61 6d 6d 65 72 20 |rary.pro|grammer |
|00001130| 28 69 66 20 79 6f 75 20 | 77 61 6e 74 20 74 6f 20 |(if you |want to |
|00001140| 77 72 69 74 65 20 79 6f | 75 72 20 6f 77 6e 20 73 |write yo|ur own s|
|00001150| 74 61 72 74 75 70 2c 20 | 65 74 63 29 2e 0a 0a 49 |tartup, |etc)...I|
|00001160| 66 20 79 6f 75 20 77 61 | 6e 74 20 74 6f 20 77 72 |f you wa|nt to wr|
|00001170| 69 74 65 20 63 6f 64 65 | 20 66 6f 72 20 69 74 20 |ite code| for it |
|00001180| 79 6f 75 20 73 68 6f 75 | 6c 64 20 62 65 20 61 77 |you shou|ld be aw|
|00001190| 61 72 65 20 6f 66 20 74 | 68 65 20 6e 6f 72 6d 61 |are of t|he norma|
|000011a0| 6c 0a 6e 61 6d 69 6e 67 | 20 63 6f 6e 76 65 6e 74 |l.naming| convent|
|000011b0| 69 6f 6e 73 20 66 6f 72 | 20 41 4e 53 49 20 6c 69 |ions for| ANSI li|
|000011c0| 62 72 61 72 69 65 73 3a | 0a 0a 40 69 74 65 6d 69 |braries:|..@itemi|
|000011d0| 7a 65 20 40 62 75 6c 6c | 65 74 0a 40 69 74 65 6d |ze @bull|et.@item|
|000011e0| 0a 4e 61 6d 65 73 20 77 | 69 74 68 20 6e 6f 20 75 |.Names w|ith no u|
|000011f0| 6e 64 65 72 73 63 6f 72 | 65 20 40 73 61 6d 70 7b |nderscor|e @samp{|
|00001200| 66 6f 6f 7d 20 61 72 65 | 20 41 4e 53 49 20 6f 72 |foo} are| ANSI or|
|00001210| 20 50 4f 53 49 58 20 63 | 6f 6d 70 6c 69 61 6e 74 | POSIX c|ompliant|
|00001220| 20 2d 20 74 68 65 72 65 | 20 69 73 20 61 62 73 6f | - there| is abso|
|00001230| 6c 75 74 65 6c 79 0a 6e | 6f 20 72 69 73 6b 20 69 |lutely.n|o risk i|
|00001240| 6e 20 75 73 69 6e 67 20 | 74 68 65 6d 2e 20 49 66 |n using |them. If|
|00001250| 20 79 6f 75 20 75 73 65 | 20 6f 6e 6c 79 20 74 68 | you use| only th|
|00001260| 65 73 65 20 79 6f 75 20 | 63 61 6e 20 77 72 69 74 |ese you |can writ|
|00001270| 65 20 70 6f 72 74 61 62 | 6c 65 0a 70 72 6f 67 72 |e portab|le.progr|
|00001280| 61 6d 73 2e 0a 40 69 74 | 65 6d 0a 4e 61 6d 65 73 |ams..@it|em.Names|
|00001290| 20 77 69 74 68 20 61 20 | 73 69 6e 67 6c 65 20 75 | with a |single u|
|000012a0| 6e 64 65 72 73 63 6f 72 | 65 20 40 73 61 6d 70 7b |nderscor|e @samp{|
|000012b0| 5f 66 6f 6f 7d 20 61 72 | 65 20 41 4e 53 49 20 65 |_foo} ar|e ANSI e|
|000012c0| 78 74 65 6e 73 69 6f 6e | 73 20 66 6f 72 20 74 68 |xtension|s for th|
|000012d0| 65 0a 65 6e 64 20 75 73 | 65 72 2e 20 55 73 75 61 |e.end us|er. Usua|
|000012e0| 6c 6c 79 20 74 68 65 79 | 20 61 72 65 20 76 65 72 |lly they| are ver|
|000012f0| 79 20 63 6f 6d 6d 6f 6e | 20 6f 6e 20 63 65 72 74 |y common| on cert|
|00001300| 61 69 6e 20 73 79 73 74 | 65 6d 73 20 62 75 74 20 |ain syst|ems but |
|00001310| 6e 6f 74 20 75 73 65 64 | 20 6f 6e 0a 6f 74 68 65 |not used| on.othe|
|00001320| 72 73 2e 0a 40 69 74 65 | 6d 0a 4e 61 6d 65 73 20 |rs..@ite|m.Names |
|00001330| 77 69 74 68 20 74 77 6f | 20 75 6e 64 65 72 73 63 |with two| undersc|
|00001340| 6f 72 65 73 20 40 73 61 | 6d 70 7b 5f 5f 66 6f 6f |ores @sa|mp{__foo|
|00001350| 7d 20 61 72 65 20 66 6f | 72 20 74 68 65 20 6c 69 |} are fo|r the li|
|00001360| 62 72 61 72 79 20 70 72 | 6f 67 72 61 6d 6d 65 72 |brary pr|ogrammer|
|00001370| 73 20 6f 6e 6c 79 2e 0a | 49 66 20 74 68 65 79 20 |s only..|If they |
|00001380| 61 72 65 20 6e 6f 74 20 | 64 6f 63 75 6d 65 6e 74 |are not |document|
|00001390| 65 64 20 79 6f 75 20 63 | 61 6e 6e 6f 74 20 72 65 |ed you c|annot re|
|000013a0| 6c 79 20 6f 6e 20 74 68 | 65 6d 2e 20 41 6e 64 20 |ly on th|em. And |
|000013b0| 65 76 65 6e 20 69 66 20 | 74 68 65 79 20 61 72 65 |even if |they are|
|000013c0| 0a 79 6f 75 20 73 68 6f | 75 6c 64 20 75 73 65 20 |.you sho|uld use |
|000013d0| 74 68 65 6d 20 6f 6e 6c | 79 20 66 6f 72 20 77 72 |them onl|y for wr|
|000013e0| 69 74 69 6e 67 20 6c 69 | 62 72 61 72 79 20 63 6f |iting li|brary co|
|000013f0| 64 65 2e 0a 40 65 6e 64 | 20 69 74 65 6d 69 7a 65 |de..@end| itemize|
|00001400| 0a 0a 54 68 65 72 65 20 | 69 73 20 6f 6e 6c 79 20 |..There |is only |
|00001410| 6f 6e 65 20 65 78 63 65 | 70 74 69 6f 6e 20 6f 66 |one exce|ption of|
|00001420| 20 74 68 65 73 65 20 63 | 6f 6e 76 65 6e 74 69 6f | these c|onventio|
|00001430| 6e 73 20 28 40 73 61 6d | 70 7b 5f 5f 63 68 6b 61 |ns (@sam|p{__chka|
|00001440| 62 6f 72 74 28 29 7d 29 | 0a 61 6e 64 20 74 68 69 |bort()})|.and thi|
|00001450| 73 20 69 73 20 66 6f 72 | 20 63 6f 6d 70 61 74 69 |s is for| compati|
|00001460| 62 69 6c 69 74 79 20 72 | 65 61 73 6f 6e 73 2e 0a |bility r|easons..|
|00001470| 20 0a 40 6e 6f 64 65 20 | 55 73 61 67 65 2c 46 65 | .@node |Usage,Fe|
|00001480| 61 74 75 72 65 73 2c 4e | 61 6d 69 6e 67 2c 54 6f |atures,N|aming,To|
|00001490| 70 0a 40 63 68 61 70 74 | 65 72 20 55 73 61 67 65 |p.@chapt|er Usage|
|000014a0| 0a 0a 54 68 65 20 75 73 | 61 67 65 20 6f 66 20 74 |..The us|age of t|
|000014b0| 68 69 73 20 6c 69 62 72 | 61 72 79 20 69 73 20 6c |his libr|ary is l|
|000014c0| 69 6b 65 20 61 6e 79 20 | 6f 74 68 65 72 20 6c 69 |ike any |other li|
|000014d0| 6e 6b 20 6c 69 62 72 61 | 72 79 2e 20 54 68 65 20 |nk libra|ry. The |
|000014e0| 6f 6e 6c 79 0a 69 6d 70 | 6f 72 74 61 6e 74 20 74 |only.imp|ortant t|
|000014f0| 68 69 6e 67 20 69 73 20 | 74 68 65 20 72 69 67 68 |hing is |the righ|
|00001500| 74 20 6c 69 6e 6b 61 67 | 65 20 6f 72 64 65 72 3a |t linkag|e order:|
|00001510| 0a 0a 40 65 6e 75 6d 65 | 72 61 74 65 0a 40 69 74 |..@enume|rate.@it|
|00001520| 65 6d 0a 54 68 65 20 73 | 74 61 72 74 75 70 20 63 |em.The s|tartup c|
|00001530| 6f 64 65 20 68 61 73 20 | 74 6f 20 62 65 20 75 73 |ode has |to be us|
|00001540| 65 64 20 66 69 72 73 74 | 20 3a 2d 29 0a 40 69 74 |ed first| :-).@it|
|00001550| 65 6d 0a 54 68 65 20 73 | 74 75 62 73 2d 6c 69 62 |em.The s|tubs-lib|
|00001560| 72 61 72 79 20 68 61 73 | 20 74 6f 20 62 65 20 75 |rary has| to be u|
|00001570| 73 65 64 20 6c 61 73 74 | 20 73 69 6e 63 65 20 69 |sed last| since i|
|00001580| 74 20 63 6f 6e 74 61 69 | 6e 73 20 74 68 65 20 6c |t contai|ns the l|
|00001590| 69 62 72 61 72 79 20 62 | 61 73 65 20 70 6f 69 6e |ibrary b|ase poin|
|000015a0| 74 65 72 73 2e 0a 40 69 | 74 65 6d 0a 54 68 65 20 |ters..@i|tem.The |
|000015b0| 63 6f 6d 6d 61 6e 64 6c | 69 6e 65 20 70 61 72 73 |commandl|ine pars|
|000015c0| 65 72 20 73 68 6f 75 6c | 64 20 62 65 20 75 73 65 |er shoul|d be use|
|000015d0| 64 20 61 66 74 65 72 20 | 79 6f 75 72 20 63 6f 64 |d after |your cod|
|000015e0| 65 20 62 75 74 20 62 65 | 66 6f 72 65 20 6d 6f 73 |e but be|fore mos|
|000015f0| 74 20 0a 6f 74 68 65 72 | 20 74 68 69 6e 67 73 20 |t .other| things |
|00001600| 6f 72 20 79 6f 75 20 77 | 69 6c 6c 20 72 75 6e 20 |or you w|ill run |
|00001610| 69 6e 74 6f 20 70 72 6f | 62 6c 65 6d 73 2e 0a 40 |into pro|blems..@|
|00001620| 65 6e 64 20 65 6e 75 6d | 65 72 61 74 65 0a 0a 4e |end enum|erate..N|
|00001630| 6f 72 6d 61 6c 6c 79 20 | 74 68 69 73 20 69 73 20 |ormally |this is |
|00001640| 68 61 6e 64 6c 65 64 20 | 62 79 20 74 68 65 20 73 |handled |by the s|
|00001650| 70 65 63 73 20 66 69 6c | 65 20 6f 66 20 67 63 63 |pecs fil|e of gcc|
|00001660| 2e 20 54 68 65 72 65 20 | 69 73 20 61 20 73 61 6d |. There |is a sam|
|00001670| 70 6c 65 20 73 70 65 63 | 73 20 66 69 6c 65 0a 69 |ple spec|s file.i|
|00001680| 6e 20 74 68 69 73 20 70 | 61 63 6b 61 67 65 20 28 |n this p|ackage (|
|00001690| 61 6e 64 20 61 6e 20 41 | 52 65 78 78 20 73 63 72 |and an A|Rexx scr|
|000016a0| 69 70 74 20 74 6f 20 63 | 68 61 6e 67 65 20 6d 6f |ipt to c|hange mo|
|000016b0| 73 74 20 6e 6f 6e 73 74 | 61 6e 64 61 72 64 20 73 |st nonst|andard s|
|000016c0| 70 65 63 73 20 66 69 6c | 65 73 29 2e 0a 42 79 20 |pecs fil|es)..By |
|000016d0| 69 6e 73 74 61 6c 6c 69 | 6e 67 20 69 74 20 67 63 |installi|ng it gc|
|000016e0| 63 20 77 69 6c 6c 20 61 | 75 74 6f 6d 61 74 69 63 |c will a|utomatic|
|000016f0| 61 6c 6c 79 20 67 65 74 | 20 61 20 6e 65 77 20 6f |ally get| a new o|
|00001700| 70 74 69 6f 6e 0a 40 73 | 61 6d 70 7b 2d 6e 6f 69 |ption.@s|amp{-noi|
|00001710| 78 65 6d 75 6c 7d 2e 20 | 42 79 20 75 73 69 6e 67 |xemul}. |By using|
|00001720| 20 74 68 69 73 20 6f 70 | 74 69 6f 6e 20 79 6f 75 | this op|tion you|
|00001730| 20 63 68 6f 6f 73 65 20 | 74 68 69 73 20 6c 69 62 | choose |this lib|
|00001740| 72 61 72 79 20 70 61 63 | 6b 61 67 65 2e 0a 53 75 |rary pac|kage..Su|
|00001750| 63 68 20 6f 70 74 69 6f | 6e 73 20 61 72 65 20 63 |ch optio|ns are c|
|00001760| 61 6c 6c 65 64 20 66 6c | 61 76 6f 75 72 73 2e 0a |alled fl|avours..|
|00001770| 0a 40 63 6f 64 65 7b 67 | 63 63 20 28 2d 66 62 61 |.@code{g|cc (-fba|
|00001780| 73 65 72 65 6c 29 20 28 | 2d 72 65 73 69 64 65 6e |serel) (|-residen|
|00001790| 74 29 20 2d 6e 6f 69 78 | 65 6d 75 6c 20 59 4f 55 |t) -noix|emul YOU|
|000017a0| 52 5f 4f 42 4a 45 43 54 | 53 20 28 2d 6e 69 78 5f |R_OBJECT|S (-nix_|
|000017b0| 6d 61 69 6e 29 20 28 2d | 6c 6d 29 7d 0a 0a 49 66 |main) (-|lm)}..If|
|000017c0| 20 79 6f 75 20 75 73 65 | 20 40 73 61 6d 70 7b 2d | you use| @samp{-|
|000017d0| 6c 6e 69 78 5f 6d 61 69 | 6e 7d 20 79 6f 75 20 67 |lnix_mai|n} you g|
|000017e0| 65 74 20 61 20 64 69 66 | 66 65 72 65 6e 74 20 63 |et a dif|ferent c|
|000017f0| 6f 6d 6d 61 6e 64 6c 69 | 6e 65 20 70 61 72 73 65 |ommandli|ne parse|
|00001800| 72 2e 0a 40 73 61 6d 70 | 7b 2d 6c 6d 7d 20 75 73 |r..@samp|{-lm} us|
|00001810| 65 73 20 74 68 65 20 6d | 61 74 68 20 6c 69 62 72 |es the m|ath libr|
|00001820| 61 72 79 2e 0a 0a 42 65 | 20 61 77 61 72 65 20 74 |ary...Be| aware t|
|00001830| 68 61 74 20 74 68 65 20 | 66 6f 72 6d 61 74 74 65 |hat the |formatte|
|00001840| 64 20 49 2f 4f 2d 66 75 | 6e 63 74 69 6f 6e 73 20 |d I/O-fu|nctions |
|00001850| 6e 65 65 64 20 74 68 65 | 20 6d 61 74 68 20 6c 69 |need the| math li|
|00001860| 62 72 61 72 69 65 73 0a | 74 6f 20 77 6f 72 6b 20 |braries.|to work |
|00001870| 63 6f 72 72 65 63 74 6c | 79 20 66 6f 72 20 66 6c |correctl|y for fl|
|00001880| 6f 61 74 69 6e 67 20 70 | 6f 69 6e 74 20 6e 75 6d |oating p|oint num|
|00001890| 62 65 72 73 2e 20 57 69 | 74 68 6f 75 74 20 74 68 |bers. Wi|thout th|
|000018a0| 65 20 6d 61 74 68 0a 6c | 69 62 72 61 72 69 65 73 |e math.l|ibraries|
|000018b0| 20 79 6f 75 20 67 65 74 | 20 6f 6e 6c 79 20 66 6c | you get| only fl|
|000018c0| 6f 61 74 69 6e 67 20 70 | 6f 69 6e 74 20 73 75 70 |oating p|oint sup|
|000018d0| 70 6f 72 74 20 66 6f 72 | 20 73 69 6d 70 6c 65 20 |port for| simple |
|000018e0| 6f 70 65 72 61 74 6f 72 | 73 0a 6c 69 6b 65 20 40 |operator|s.like @|
|000018f0| 73 61 6d 70 7b 2b 7d 2c | 20 40 73 61 6d 70 7b 2a |samp{+},| @samp{*|
|00001900| 7d 2c 20 63 61 73 74 73 | 20 61 6e 64 20 74 68 61 |}, casts| and tha|
|00001910| 74 20 6c 69 6b 65 2e 0a | 0a 49 66 20 79 6f 75 20 |t like..|.If you |
|00001920| 64 6f 6e 27 74 20 75 73 | 65 20 74 68 65 20 61 73 |don't us|e the as|
|00001930| 73 65 6d 62 6c 65 72 20 | 69 6e 6c 69 6e 65 20 66 |sembler |inline f|
|00001940| 75 6e 63 74 69 6f 6e 73 | 20 6f 66 20 67 63 63 20 |unctions| of gcc |
|00001950| 79 6f 75 20 77 69 6c 6c | 20 68 61 76 65 0a 74 6f |you will| have.to|
|00001960| 20 75 73 65 20 40 73 61 | 6d 70 7b 6c 69 62 61 6d | use @sa|mp{libam|
|00001970| 69 67 61 2e 61 7d 20 69 | 66 20 79 6f 75 20 77 61 |iga.a} i|f you wa|
|00001980| 6e 74 20 74 6f 20 75 73 | 65 20 61 6e 79 20 41 6d |nt to us|e any Am|
|00001990| 69 67 61 20 4f 53 20 66 | 75 6e 63 74 69 6f 6e 2e |iga OS f|unction.|
|000019a0| 0a 42 65 20 61 77 61 72 | 65 20 74 68 61 74 20 74 |.Be awar|e that t|
|000019b0| 68 65 20 40 73 61 6d 70 | 7b 6c 69 62 61 6d 69 67 |he @samp|{libamig|
|000019c0| 61 2e 61 7d 20 74 68 61 | 74 20 63 6f 6d 65 73 20 |a.a} tha|t comes |
|000019d0| 77 69 74 68 20 6c 69 62 | 6e 69 78 20 69 73 20 6f |with lib|nix is o|
|000019e0| 6e 6c 79 20 61 0a 64 75 | 6d 6d 79 20 6c 69 62 72 |nly a.du|mmy libr|
|000019f0| 61 72 79 20 2d 20 49 20 | 63 61 6e 6e 6f 74 20 64 |ary - I |cannot d|
|00001a00| 69 73 74 72 69 62 75 74 | 65 20 40 73 61 6d 70 7b |istribut|e @samp{|
|00001a10| 6c 69 62 61 6d 69 67 61 | 2e 61 7d 2e 20 42 75 74 |libamiga|.a}. But|
|00001a20| 20 79 6f 75 20 63 61 6e | 0a 62 75 69 6c 64 20 6f | you can|.build o|
|00001a30| 6e 65 20 79 6f 75 72 73 | 65 6c 66 20 69 66 20 79 |ne yours|elf if y|
|00001a40| 6f 75 20 75 6e 70 61 63 | 6b 20 74 68 65 20 73 6f |ou unpac|k the so|
|00001a50| 75 72 63 65 73 2e 20 54 | 68 69 73 20 77 69 6c 6c |urces. T|his will|
|00001a60| 20 74 61 6b 65 20 73 6f | 6d 65 20 68 6f 75 72 73 | take so|me hours|
|00001a70| 2c 0a 74 68 65 72 65 66 | 6f 72 65 20 69 74 27 73 |,.theref|ore it's|
|00001a80| 20 6e 6f 74 20 70 61 72 | 74 20 6f 66 20 74 68 65 | not par|t of the|
|00001a90| 20 69 6e 73 74 61 6c 6c | 61 74 69 6f 6e 20 70 72 | install|ation pr|
|00001aa0| 6f 63 65 64 75 72 65 2e | 0a 0a 46 6f 72 20 63 6f |ocedure.|..For co|
|00001ab0| 6d 70 69 6c 69 6e 67 20 | 61 34 2d 72 65 6c 61 74 |mpiling |a4-relat|
|00001ac0| 69 76 65 20 70 72 6f 67 | 72 61 6d 73 20 79 6f 75 |ive prog|rams you|
|00001ad0| 20 73 68 6f 75 6c 64 20 | 63 68 6f 6f 73 65 20 74 | should |choose t|
|00001ae0| 68 65 0a 40 73 61 6d 70 | 7b 2d 66 62 61 73 65 72 |he.@samp|{-fbaser|
|00001af0| 65 6c 7d 20 6f 70 74 69 | 6f 6e 2e 20 59 6f 75 20 |el} opti|on. You |
|00001b00| 67 65 74 20 72 65 73 69 | 64 65 6e 74 20 28 70 75 |get resi|dent (pu|
|00001b10| 72 65 29 20 70 72 6f 67 | 72 61 6d 73 20 69 66 0a |re) prog|rams if.|
|00001b20| 79 6f 75 20 73 65 74 20 | 74 68 65 20 40 73 61 6d |you set |the @sam|
|00001b30| 70 7b 2d 72 65 73 69 64 | 65 6e 74 7d 20 6f 70 74 |p{-resid|ent} opt|
|00001b40| 69 6f 6e 2e 20 41 6e 79 | 74 68 69 6e 67 20 65 6c |ion. Any|thing el|
|00001b50| 73 65 20 6e 65 63 65 73 | 73 61 72 79 20 66 6f 72 |se neces|sary for|
|00001b60| 20 74 68 65 73 65 20 6f | 70 74 69 6f 6e 73 0a 69 | these o|ptions.i|
|00001b70| 73 20 68 61 6e 64 6c 65 | 64 20 62 79 20 74 68 65 |s handle|d by the|
|00001b80| 20 73 70 65 63 73 2d 66 | 69 6c 65 20 28 63 68 6f | specs-f|ile (cho|
|00001b90| 6f 73 69 6e 67 20 74 68 | 65 20 72 69 67 68 74 20 |osing th|e right |
|00001ba0| 73 74 61 72 74 75 70 73 | 20 61 6e 64 20 6c 69 62 |startups| and lib|
|00001bb0| 72 61 72 69 65 73 29 2e | 0a 0a 49 66 20 79 6f 75 |raries).|..If you|
|00001bc0| 20 64 6f 6e 27 74 20 77 | 61 6e 74 20 74 6f 20 72 | don't w|ant to r|
|00001bd0| 65 70 6c 61 63 65 20 79 | 6f 75 72 20 73 70 65 63 |eplace y|our spec|
|00001be0| 73 20 66 69 6c 65 20 79 | 6f 75 20 63 61 6e 20 73 |s file y|ou can s|
|00001bf0| 74 69 6c 6c 20 75 73 65 | 20 74 68 69 73 0a 70 61 |till use| this.pa|
|00001c00| 63 6b 61 67 65 20 69 66 | 20 79 6f 75 20 63 61 6c |ckage if| you cal|
|00001c10| 6c 20 65 76 65 72 79 74 | 68 69 6e 67 20 62 79 20 |l everyt|hing by |
|00001c20| 68 61 6e 64 3a 0a 0a 40 | 63 6f 64 65 7b 67 63 63 |hand:..@|code{gcc|
|00001c30| 20 2d 6e 6f 73 74 64 6c | 69 62 20 6e 63 72 74 30 | -nostdl|ib ncrt0|
|00001c40| 2e 6f 20 59 4f 55 52 5f | 4f 42 4a 45 43 54 53 20 |.o YOUR_|OBJECTS |
|00001c50| 6c 69 62 6e 69 78 6d 61 | 69 6e 2e 61 20 28 6c 69 |libnixma|in.a (li|
|00001c60| 62 6d 2e 61 29 20 6c 69 | 62 6e 69 78 2e 61 0a 6c |bm.a) li|bnix.a.l|
|00001c70| 69 62 73 74 75 62 73 2e | 61 7d 0a 0a 42 75 74 20 |ibstubs.|a}..But |
|00001c80| 74 68 61 74 27 73 20 6e | 6f 74 20 74 68 65 20 72 |that's n|ot the r|
|00001c90| 65 63 6f 6d 6d 65 6e 64 | 65 64 20 77 61 79 2e 20 |ecommend|ed way. |
|00001ca0| 54 68 65 72 65 66 6f 72 | 65 20 49 20 64 6f 6e 27 |Therefor|e I don'|
|00001cb0| 74 20 65 78 70 6c 61 69 | 6e 20 74 68 69 73 20 69 |t explai|n this i|
|00001cc0| 6e 0a 64 65 74 61 69 6c | 20 68 65 72 65 20 2d 20 |n.detail| here - |
|00001cd0| 75 73 65 20 74 68 65 20 | 40 73 61 6d 70 7b 2d 76 |use the |@samp{-v|
|00001ce0| 7d 20 6f 70 74 69 6f 6e | 20 6f 66 20 67 63 63 20 |} option| of gcc |
|00001cf0| 66 6f 72 20 6d 6f 72 65 | 20 64 65 74 61 69 6c 73 |for more| details|
|00001d00| 2e 0a 0a 40 6e 6f 64 65 | 20 46 65 61 74 75 72 65 |...@node| Feature|
|00001d10| 73 2c 53 70 65 63 69 61 | 6c 20 73 74 61 72 74 75 |s,Specia|l startu|
|00001d20| 70 73 2c 55 73 61 67 65 | 2c 54 6f 70 0a 40 63 68 |ps,Usage|,Top.@ch|
|00001d30| 61 70 74 65 72 20 46 65 | 61 74 75 72 65 73 20 2d |apter Fe|atures -|
|00001d40| 20 77 68 61 74 20 79 6f | 75 20 67 65 74 0a 0a 54 | what yo|u get..T|
|00001d50| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 6c 69 73 |he follo|wing lis|
|00001d60| 74 20 63 6f 6e 74 61 69 | 6e 73 20 74 68 65 20 65 |t contai|ns the e|
|00001d70| 6c 65 6d 65 6e 74 73 20 | 6f 66 20 74 68 69 73 20 |lements |of this |
|00001d80| 70 61 63 6b 61 67 65 20 | 69 6e 0a 74 68 65 20 72 |package |in.the r|
|00001d90| 69 67 68 74 20 6c 69 6e | 6b 61 67 65 20 6f 72 64 |ight lin|kage ord|
|00001da0| 65 72 2e 20 54 68 69 73 | 20 6d 65 61 6e 73 20 69 |er. This| means i|
|00001db0| 66 20 79 6f 75 20 66 6f | 6c 6c 6f 77 20 74 68 65 |f you fo|llow the|
|00001dc0| 20 6c 69 73 74 20 66 72 | 6f 6d 0a 74 6f 70 20 74 | list fr|om.top t|
|00001dd0| 6f 20 62 6f 74 74 6f 6d | 20 61 6e 64 20 74 61 6b |o bottom| and tak|
|00001de0| 65 20 6f 6e 65 20 66 69 | 6c 65 20 6f 66 20 65 61 |e one fi|le of ea|
|00001df0| 63 68 20 6d 65 6e 75 20 | 65 6e 74 72 79 20 79 6f |ch menu |entry yo|
|00001e00| 75 20 77 69 6c 6c 20 67 | 65 74 0a 61 20 77 6f 72 |u will g|et.a wor|
|00001e10| 6b 69 6e 67 20 63 6f 6e | 66 69 67 75 72 61 74 69 |king con|figurati|
|00001e20| 6f 6e 2e 0a 0a 40 6d 65 | 6e 75 0a 2a 20 53 74 61 |on...@me|nu.* Sta|
|00001e30| 72 74 75 70 20 63 6f 64 | 65 73 3a 3a 20 20 20 20 |rtup cod|es:: |
|00001e40| 20 20 44 6f 65 73 20 61 | 6c 6c 20 77 6f 72 6b 20 | Does a|ll work |
|00001e50| 6e 65 63 65 73 73 61 72 | 79 20 66 6f 72 20 73 74 |necessar|y for st|
|00001e60| 61 72 74 75 70 2e 0a 20 | 20 59 6f 75 72 20 6f 62 |artup.. | Your ob|
|00001e70| 6a 65 63 74 73 20 20 20 | 20 20 20 20 20 20 4e 65 |jects | Ne|
|00001e80| 65 64 20 49 20 73 61 79 | 20 61 6e 79 74 68 69 6e |ed I say| anythin|
|00001e90| 67 20 61 62 6f 75 74 20 | 74 68 61 74 3f 0a 2a 20 |g about |that?.* |
|00001ea0| 43 6f 6d 6d 61 6e 64 6c | 69 6e 65 20 70 61 72 73 |Commandl|ine pars|
|00001eb0| 65 72 3a 3a 20 43 61 6c | 63 75 6c 61 74 65 73 20 |er:: Cal|culates |
|00001ec0| 61 72 67 63 20 61 6e 64 | 20 61 72 67 76 2e 0a 20 |argc and| argv.. |
|00001ed0| 20 6c 69 62 6d 2e 61 20 | 20 20 20 20 20 20 20 20 | libm.a | |
|00001ee0| 20 20 20 20 20 20 54 68 | 65 20 6d 61 74 68 20 6c | Th|e math l|
|00001ef0| 69 62 72 61 72 79 20 28 | 6f 70 74 69 6f 6e 61 6c |ibrary (|optional|
|00001f00| 29 2e 0a 2a 20 6c 69 62 | 6e 69 78 2e 61 3a 3a 20 |)..* lib|nix.a:: |
|00001f10| 20 20 20 20 20 20 20 20 | 20 20 54 68 65 20 6c 69 | | The li|
|00001f20| 62 72 61 72 79 20 69 74 | 73 65 6c 66 2e 0a 2a 20 |brary it|self..* |
|00001f30| 6c 69 62 61 6d 69 67 61 | 2e 61 3a 3a 20 20 20 20 |libamiga|.a:: |
|00001f40| 20 20 20 20 20 49 66 20 | 79 6f 75 20 68 61 76 65 | If |you have|
|00001f50| 20 6f 6e 65 2e 0a 2a 20 | 6c 69 62 73 74 75 62 73 | one..* |libstubs|
|00001f60| 2e 61 3a 3a 20 20 20 20 | 20 20 20 20 20 54 68 65 |.a:: | The|
|00001f70| 20 6c 69 62 72 61 72 79 | 20 62 61 73 65 73 2e 0a | library| bases..|
|00001f80| 2a 20 6d 69 73 63 3a 3a | 20 20 20 20 20 20 20 20 |* misc::| |
|00001f90| 20 20 20 20 20 20 20 41 | 75 74 6f 20 64 65 74 61 | A|uto deta|
|00001fa0| 63 68 69 6e 67 2c 20 73 | 74 61 63 6b 20 65 78 74 |ching, s|tack ext|
|00001fb0| 65 6e 73 69 6f 6e 2e 0a | 40 65 6e 64 20 6d 65 6e |ension..|@end men|
|00001fc0| 75 0a 0a 40 6e 6f 64 65 | 20 53 74 61 72 74 75 70 |u..@node| Startup|
|00001fd0| 20 63 6f 64 65 73 2c 43 | 6f 6d 6d 61 6e 64 6c 69 | codes,C|ommandli|
|00001fe0| 6e 65 20 70 61 72 73 65 | 72 2c 46 65 61 74 75 72 |ne parse|r,Featur|
|00001ff0| 65 73 2c 46 65 61 74 75 | 72 65 73 0a 40 63 68 61 |es,Featu|res.@cha|
|00002000| 70 74 65 72 20 53 74 61 | 72 74 75 70 20 63 6f 64 |pter Sta|rtup cod|
|00002010| 65 73 0a 0a 54 68 65 72 | 65 20 69 73 20 61 20 6c |es..Ther|e is a l|
|00002020| 6f 74 20 6f 66 20 77 6f | 72 6b 20 74 6f 20 64 6f |ot of wo|rk to do|
|00002030| 20 62 65 66 6f 72 65 20 | 79 6f 75 72 20 40 73 61 | before |your @sa|
|00002040| 6d 70 7b 6d 61 69 6e 7d | 20 66 75 6e 63 74 69 6f |mp{main}| functio|
|00002050| 6e 0a 63 61 6e 20 62 65 | 20 63 61 6c 6c 65 64 20 |n.can be| called |
|00002060| 2d 20 6f 70 65 6e 20 73 | 68 61 72 65 64 20 6c 69 |- open s|hared li|
|00002070| 62 72 61 72 69 65 73 2c | 20 6f 70 65 6e 20 73 74 |braries,| open st|
|00002080| 64 69 6e 2c 20 73 74 64 | 6f 75 74 2c 20 65 74 63 |din, std|out, etc|
|00002090| 2e 0a 44 65 70 65 6e 64 | 69 6e 67 20 6f 6e 20 74 |..Depend|ing on t|
|000020a0| 68 65 20 63 6f 6d 70 69 | 6c 65 72 20 6f 70 74 69 |he compi|ler opti|
|000020b0| 6f 6e 73 20 61 6e 64 20 | 74 68 65 20 41 4e 53 49 |ons and |the ANSI|
|000020c0| 20 66 75 6e 63 74 69 6f | 6e 73 20 79 6f 75 20 75 | functio|ns you u|
|000020d0| 73 65 2e 0a 54 68 69 73 | 20 77 6f 72 6b 20 69 73 |se..This| work is|
|000020e0| 20 64 6f 6e 65 20 62 79 | 20 74 68 65 20 73 74 61 | done by| the sta|
|000020f0| 72 74 75 70 20 63 6f 64 | 65 2e 0a 0a 40 6d 65 6e |rtup cod|e...@men|
|00002100| 75 0a 2a 20 53 74 61 72 | 74 75 70 20 69 6e 74 65 |u.* Star|tup inte|
|00002110| 72 66 61 63 65 3a 3a 20 | 0a 2a 20 53 74 61 72 74 |rface:: |.* Start|
|00002120| 75 70 20 75 73 61 67 65 | 3a 3a 0a 40 65 6e 64 20 |up usage|::.@end |
|00002130| 6d 65 6e 75 0a 0a 54 6f | 20 67 65 74 20 61 20 73 |menu..To| get a s|
|00002140| 68 6f 72 74 20 73 74 61 | 72 74 75 70 20 61 6c 6c |hort sta|rtup all|
|00002150| 20 74 68 65 20 6e 65 63 | 65 73 73 61 72 79 20 6d | the nec|essary m|
|00002160| 6f 64 75 6c 65 73 20 61 | 72 65 20 6f 70 74 69 6f |odules a|re optio|
|00002170| 6e 61 6c 20 2d 0a 74 68 | 65 79 20 67 65 74 20 6f |nal -.th|ey get o|
|00002180| 6e 6c 79 20 6c 69 6e 6b | 65 64 20 69 6e 20 69 66 |nly link|ed in if|
|00002190| 20 79 6f 75 20 75 73 65 | 20 74 68 65 6d 2e 20 54 | you use| them. T|
|000021a0| 68 65 72 65 20 61 72 65 | 20 32 20 65 78 63 65 70 |here are| 2 excep|
|000021b0| 74 69 6f 6e 73 0a 66 72 | 6f 6d 20 74 68 69 73 20 |tions.fr|om this |
|000021c0| 28 73 69 6e 63 65 20 74 | 68 65 20 6c 69 6e 6b 65 |(since t|he linke|
|000021d0| 72 20 63 61 6e 6e 6f 74 | 20 63 68 65 63 6b 20 66 |r cannot| check f|
|000021e0| 6f 72 20 69 74 29 3a 0a | 0a 40 69 74 65 6d 69 7a |or it):.|.@itemiz|
|000021f0| 65 20 40 62 75 6c 6c 65 | 74 0a 40 69 74 65 6d 0a |e @bulle|t.@item.|
|00002200| 54 68 65 20 63 6f 6d 6d | 61 6e 64 6c 69 6e 65 20 |The comm|andline |
|00002210| 70 61 72 73 65 72 2e 20 | 49 74 20 63 61 6e 20 62 |parser. |It can b|
|00002220| 65 20 64 65 61 63 74 69 | 76 61 74 65 64 20 62 79 |e deacti|vated by|
|00002230| 20 64 65 63 6c 61 72 69 | 6e 67 0a 0a 40 63 6f 64 | declari|ng..@cod|
|00002240| 65 7b 5f 5f 6e 6f 63 6f | 6d 6d 61 6e 64 6c 69 6e |e{__noco|mmandlin|
|00002250| 65 7d 0a 0a 73 6f 6d 65 | 77 68 65 72 65 20 69 6e |e}..some|where in|
|00002260| 20 79 6f 75 72 20 70 72 | 6f 67 72 61 6d 20 28 74 | your pr|ogram (t|
|00002270| 68 65 20 74 79 70 65 20 | 64 6f 65 73 6e 27 74 20 |he type |doesn't |
|00002280| 6d 61 74 74 65 72 29 2e | 0a 40 69 74 65 6d 0a 54 |matter).|.@item.T|
|00002290| 68 65 20 73 68 61 72 65 | 64 2d 6c 69 62 72 61 72 |he share|d-librar|
|000022a0| 79 2d 6f 70 65 6e 69 6e | 67 20 6d 6f 64 75 6c 65 |y-openin|g module|
|000022b0| 2e 20 59 6f 75 20 73 68 | 6f 75 6c 64 20 6e 6f 74 |. You sh|ould not|
|000022c0| 20 64 69 73 61 62 6c 65 | 20 69 74 20 75 6e 6c 65 | disable| it unle|
|000022d0| 73 73 0a 79 6f 75 20 6b | 6e 6f 77 20 77 68 61 74 |ss.you k|now what|
|000022e0| 20 79 6f 75 20 61 72 65 | 20 64 6f 69 6e 67 20 73 | you are| doing s|
|000022f0| 69 6e 63 65 20 6d 6f 73 | 74 20 6c 69 62 72 61 72 |ince mos|t librar|
|00002300| 79 20 66 75 6e 63 74 69 | 6f 6e 73 20 64 65 70 65 |y functi|ons depe|
|00002310| 6e 64 20 6f 6e 20 69 74 | 2e 0a 40 65 6e 64 20 69 |nd on it|..@end i|
|00002320| 74 65 6d 69 7a 65 0a 0a | 54 68 65 20 73 74 61 72 |temize..|The star|
|00002330| 74 75 70 20 63 6f 64 65 | 73 20 69 74 73 65 6c 66 |tup code|s itself|
|00002340| 20 61 72 65 20 77 72 69 | 74 74 65 6e 20 69 6e 20 | are wri|tten in |
|00002350| 61 73 73 65 6d 62 6c 79 | 20 74 6f 20 62 65 20 61 |assembly| to be a|
|00002360| 73 20 73 68 6f 72 74 20 | 61 73 0a 70 6f 73 73 69 |s short |as.possi|
|00002370| 62 6c 65 2e 0a 0a 48 65 | 72 65 20 69 73 20 61 20 |ble...He|re is a |
|00002380| 6c 69 74 74 6c 65 20 70 | 72 6f 67 72 61 6d 20 74 |little p|rogram t|
|00002390| 6f 20 67 65 74 20 74 68 | 65 20 70 6f 69 6e 74 3a |o get th|e point:|
|000023a0| 0a 0a 40 65 78 61 6d 70 | 6c 65 0a 23 69 6e 63 6c |..@examp|le.#incl|
|000023b0| 75 64 65 20 3c 69 6e 6c | 69 6e 65 2f 65 78 65 63 |ude <inl|ine/exec|
|000023c0| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 64 6f |.h>.#inc|lude <do|
|000023d0| 73 2f 64 6f 73 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |s/dos.h>|.#includ|
|000023e0| 65 20 3c 69 6e 6c 69 6e | 65 2f 64 6f 73 2e 68 3e |e <inlin|e/dos.h>|
|000023f0| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 77 6f 72 6b 62 |.#includ|e <workb|
|00002400| 65 6e 63 68 2f 77 6f 72 | 6b 62 65 6e 63 68 2e 68 |ench/wor|kbench.h|
|00002410| 3e 0a 0a 69 6e 74 20 5f | 5f 6e 6f 63 6f 6d 6d 61 |>..int _|_nocomma|
|00002420| 6e 64 6c 69 6e 65 3d 31 | 3b 20 2f 2a 20 44 69 73 |ndline=1|; /* Dis|
|00002430| 61 62 6c 65 20 63 6f 6d | 6d 61 6e 64 6c 69 6e 65 |able com|mandline|
|00002440| 20 70 61 72 73 69 6e 67 | 20 20 2a 2f 0a 69 6e 74 | parsing| */.int|
|00002450| 20 5f 5f 69 6e 69 74 6c | 69 62 72 61 72 69 65 73 | __initl|ibraries|
|00002460| 3d 30 3b 20 2f 2a 20 44 | 69 73 61 62 6c 65 20 61 |=0; /* D|isable a|
|00002470| 75 74 6f 2d 6c 69 62 72 | 61 72 79 2d 6f 70 65 6e |uto-libr|ary-open|
|00002480| 69 6e 67 20 2a 2f 0a 0a | 73 74 72 75 63 74 20 4c |ing */..|struct L|
|00002490| 69 62 72 61 72 79 20 2a | 44 4f 53 42 61 73 65 3d |ibrary *|DOSBase=|
|000024a0| 4e 55 4c 4c 3b 0a 0a 65 | 78 74 65 72 6e 20 73 74 |NULL;..e|xtern st|
|000024b0| 72 75 63 74 20 57 42 53 | 74 61 72 74 75 70 20 2a |ruct WBS|tartup *|
|000024c0| 5f 57 42 65 6e 63 68 4d | 73 67 3b 0a 0a 69 6e 74 |_WBenchM|sg;..int|
|000024d0| 20 6d 61 69 6e 28 76 6f | 69 64 29 0a 40 7b 20 69 | main(vo|id).@{ i|
|000024e0| 66 28 5f 57 42 65 6e 63 | 68 4d 73 67 3d 3d 4e 55 |f(_WBenc|hMsg==NU|
|000024f0| 4c 4c 29 0a 20 20 40 7b | 20 69 66 28 28 44 4f 53 |LL). @{| if((DOS|
|00002500| 42 61 73 65 3d 4f 70 65 | 6e 4c 69 62 72 61 72 79 |Base=Ope|nLibrary|
|00002510| 28 22 64 6f 73 2e 6c 69 | 62 72 61 72 79 22 2c 33 |("dos.li|brary",3|
|00002520| 37 29 29 21 3d 4e 55 4c | 4c 29 0a 20 20 20 20 40 |7))!=NUL|L). @|
|00002530| 7b 20 57 72 69 74 65 28 | 4f 75 74 70 75 74 28 29 |{ Write(|Output()|
|00002540| 2c 22 48 65 6c 6c 6f 20 | 77 6f 72 6c 64 5c 6e 22 |,"Hello |world\n"|
|00002550| 2c 31 32 29 3b 0a 20 20 | 20 20 20 20 43 6c 6f 73 |,12);. | Clos|
|00002560| 65 4c 69 62 72 61 72 79 | 28 44 4f 53 42 61 73 65 |eLibrary|(DOSBase|
|00002570| 29 3b 20 40 7d 20 40 7d | 0a 20 20 72 65 74 75 72 |); @} @}|. retur|
|00002580| 6e 20 30 3b 0a 40 7d 0a | 40 65 6e 64 20 65 78 61 |n 0;.@}.|@end exa|
|00002590| 6d 70 6c 65 0a 0a 63 6f | 6d 70 69 6c 65 64 20 61 |mple..co|mpiled a|
|000025a0| 6e 64 20 6c 69 6e 6b 65 | 64 20 77 69 74 68 0a 0a |nd linke|d with..|
|000025b0| 40 63 6f 64 65 7b 67 63 | 63 20 2d 6e 6f 69 78 65 |@code{gc|c -noixe|
|000025c0| 6d 75 6c 20 2d 73 20 2d | 4f 32 20 2d 66 62 61 73 |mul -s -|O2 -fbas|
|000025d0| 65 72 65 6c 20 68 65 6c | 6c 6f 77 6f 72 6c 64 2e |erel hel|loworld.|
|000025e0| 63 7d 0a 0a 67 69 76 65 | 73 20 61 6e 20 65 78 65 |c}..give|s an exe|
|000025f0| 63 75 74 61 62 6c 65 20 | 6f 66 20 34 39 32 20 62 |cutable |of 492 b|
|00002600| 79 74 65 73 2e 20 41 6e | 64 20 74 68 69 73 20 77 |ytes. An|d this w|
|00002610| 69 74 68 20 74 68 65 20 | 6e 6f 72 6d 61 6c 20 40 |ith the |normal @|
|00002620| 73 61 6d 70 7b 6d 61 69 | 6e 7d 0a 66 75 6e 63 74 |samp{mai|n}.funct|
|00002630| 69 6f 6e 21 0a 0a 53 6f | 20 79 6f 75 20 6e 65 76 |ion!..So| you nev|
|00002640| 65 72 20 6e 65 65 64 20 | 74 6f 20 74 72 79 20 74 |er need |to try t|
|00002650| 6f 20 77 72 69 74 65 20 | 61 20 70 72 6f 67 72 61 |o write |a progra|
|00002660| 6d 20 77 69 74 68 6f 75 | 74 20 61 20 73 74 61 72 |m withou|t a star|
|00002670| 74 75 70 20 63 6f 64 65 | 2e 0a 0a 40 6e 6f 64 65 |tup code|...@node|
|00002680| 20 53 74 61 72 74 75 70 | 20 69 6e 74 65 72 66 61 | Startup| interfa|
|00002690| 63 65 2c 53 74 61 72 74 | 75 70 20 75 73 61 67 65 |ce,Start|up usage|
|000026a0| 2c 53 74 61 72 74 75 70 | 20 63 6f 64 65 73 2c 53 |,Startup| codes,S|
|000026b0| 74 61 72 74 75 70 20 63 | 6f 64 65 73 0a 40 63 68 |tartup c|odes.@ch|
|000026c0| 61 70 74 65 72 20 53 74 | 61 72 74 75 70 20 63 6f |apter St|artup co|
|000026d0| 64 65 20 69 6e 74 65 72 | 66 61 63 65 0a 0a 54 68 |de inter|face..Th|
|000026e0| 65 20 73 74 61 72 74 75 | 70 20 63 6f 64 65 73 20 |e startu|p codes |
|000026f0| 64 6f 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |do the f|ollowing|
|00002700| 3a 0a 0a 40 69 74 65 6d | 69 7a 65 20 40 62 75 6c |:..@item|ize @bul|
|00002710| 6c 65 74 0a 40 69 74 65 | 6d 0a 54 68 65 79 20 63 |let.@ite|m.They c|
|00002720| 61 74 63 68 20 74 68 65 | 20 77 6f 72 6b 62 65 6e |atch the| workben|
|00002730| 63 68 20 73 74 61 72 74 | 75 70 20 6d 65 73 73 61 |ch start|up messa|
|00002740| 67 65 20 61 6e 64 20 70 | 6c 61 63 65 20 69 74 20 |ge and p|lace it |
|00002750| 69 6e 74 6f 20 74 68 65 | 0a 76 61 72 69 61 62 6c |into the|.variabl|
|00002760| 65 20 0a 0a 40 63 6f 64 | 65 7b 65 78 74 65 72 6e |e ..@cod|e{extern|
|00002770| 20 73 74 72 75 63 74 20 | 57 42 53 74 61 72 74 75 | struct |WBStartu|
|00002780| 70 20 2a 5f 57 42 65 6e | 63 68 4d 73 67 7d 0a 0a |p *_WBen|chMsg}..|
|00002790| 79 6f 75 20 63 61 6e 20 | 73 69 6d 70 6c 79 20 6c |you can |simply l|
|000027a0| 6f 6f 6b 20 69 6e 74 6f | 20 74 68 69 73 20 70 6c |ook into| this pl|
|000027b0| 61 63 65 20 28 61 6e 64 | 20 74 65 73 74 20 66 6f |ace (and| test fo|
|000027c0| 72 20 61 20 40 73 61 6d | 70 7b 4e 55 4c 4c 7d 20 |r a @sam|p{NULL} |
|000027d0| 70 6f 69 6e 74 65 72 29 | 20 74 6f 20 0a 63 68 65 |pointer)| to .che|
|000027e0| 63 6b 20 69 66 20 79 6f | 75 72 20 70 72 6f 67 72 |ck if yo|ur progr|
|000027f0| 61 6d 20 77 61 73 20 73 | 74 61 72 74 65 64 20 66 |am was s|tarted f|
|00002800| 72 6f 6d 20 57 42 2e 20 | 49 66 20 74 68 69 73 20 |rom WB. |If this |
|00002810| 69 73 20 61 20 40 73 61 | 6d 70 7b 4e 55 4c 4c 7d |is a @sa|mp{NULL}|
|00002820| 20 70 6f 69 6e 74 65 72 | 0a 0a 40 63 6f 64 65 7b | pointer|..@code{|
|00002830| 65 78 74 65 72 6e 20 63 | 68 61 72 20 2a 5f 5f 63 |extern c|har *__c|
|00002840| 6f 6d 6d 61 6e 64 6c 69 | 6e 65 7d 0a 0a 63 6f 6e |ommandli|ne}..con|
|00002850| 74 61 69 6e 73 20 74 68 | 65 20 28 40 73 61 6d 70 |tains th|e (@samp|
|00002860| 7b 5c 6e 7d 20 74 65 72 | 6d 69 6e 61 74 65 64 29 |{\n} ter|minated)|
|00002870| 20 70 61 72 61 6d 65 74 | 65 72 73 20 6f 66 20 74 | paramet|ers of t|
|00002880| 68 65 20 63 6f 6d 6d 61 | 6e 64 6c 69 6e 65 2e 0a |he comma|ndline..|
|00002890| 40 69 74 65 6d 0a 54 68 | 65 79 20 63 61 6c 6c 20 |@item.Th|ey call |
|000028a0| 61 6c 6c 20 66 75 6e 63 | 74 69 6f 6e 73 20 69 6e |all func|tions in|
|000028b0| 20 74 68 65 20 0a 0a 40 | 63 6f 64 65 7b 6c 6f 6e | the ..@|code{lon|
|000028c0| 67 20 5f 5f 49 4e 49 54 | 5f 4c 49 53 54 5f 5f 5b |g __INIT|_LIST__[|
|000028d0| 5d 3b 7d 0a 0a 77 69 74 | 68 20 61 73 63 65 6e 64 |];}..wit|h ascend|
|000028e0| 69 6e 67 20 70 72 69 6f | 72 69 74 79 2e 0a 40 69 |ing prio|rity..@i|
|000028f0| 74 65 6d 0a 54 68 65 79 | 20 63 61 6c 6c 20 74 68 |tem.They| call th|
|00002900| 65 20 66 75 6e 63 74 69 | 6f 6e 0a 0a 40 63 6f 64 |e functi|on..@cod|
|00002910| 65 7b 69 6e 74 20 6d 61 | 69 6e 28 69 6e 74 20 61 |e{int ma|in(int a|
|00002920| 72 67 63 2c 63 68 61 72 | 20 2a 61 72 67 76 5b 5d |rgc,char| *argv[]|
|00002930| 29 7d 0a 0a 59 6f 75 20 | 63 61 6e 20 65 78 69 74 |)}..You |can exit|
|00002940| 20 62 79 20 73 69 6d 70 | 6c 79 20 66 61 6c 6c 69 | by simp|ly falli|
|00002950| 6e 67 20 74 68 72 6f 75 | 67 68 20 74 68 65 20 65 |ng throu|gh the e|
|00002960| 6e 64 20 6f 66 20 40 73 | 61 6d 70 7b 6d 61 69 6e |nd of @s|amp{main|
|00002970| 7d 20 6f 72 20 62 79 20 | 63 61 6c 6c 69 6e 67 0a |} or by |calling.|
|00002980| 0a 40 63 6f 64 65 7b 5f | 5f 76 6f 6c 61 74 69 6c |.@code{_|_volatil|
|00002990| 65 20 76 6f 69 64 20 65 | 78 69 74 28 69 6e 74 20 |e void e|xit(int |
|000029a0| 72 65 74 75 72 6e 63 6f | 64 65 29 7d 0a 0a 77 68 |returnco|de)}..wh|
|000029b0| 69 63 68 20 64 6f 65 73 | 20 74 68 65 20 63 6c 65 |ich does| the cle|
|000029c0| 61 6e 75 70 3a 0a 40 69 | 74 65 6d 0a 49 74 20 63 |anup:.@i|tem.It c|
|000029d0| 61 6c 6c 73 20 61 6c 6c | 20 66 75 6e 63 74 69 6f |alls all| functio|
|000029e0| 6e 73 20 69 6e 20 74 68 | 65 0a 0a 40 63 6f 64 65 |ns in th|e..@code|
|000029f0| 7b 6c 6f 6e 67 20 5f 5f | 45 58 49 54 5f 4c 49 53 |{long __|EXIT_LIS|
|00002a00| 54 5f 5f 5b 5d 3b 7d 0a | 0a 77 69 74 68 20 64 65 |T__[];}.|.with de|
|00002a10| 73 63 65 6e 64 69 6e 67 | 20 70 72 69 6f 72 69 74 |scending| priorit|
|00002a20| 79 2e 0a 40 69 74 65 6d | 0a 49 74 20 72 65 70 6c |y..@item|.It repl|
|00002a30| 79 73 20 74 68 65 20 57 | 42 20 73 74 61 72 74 75 |ys the W|B startu|
|00002a40| 70 20 6d 65 73 73 61 67 | 65 20 69 66 20 6e 65 63 |p messag|e if nec|
|00002a50| 65 73 73 61 72 79 2c 20 | 72 65 73 65 74 73 20 74 |essary, |resets t|
|00002a60| 68 65 20 73 74 61 63 6b | 70 6f 69 6e 74 65 72 0a |he stack|pointer.|
|00002a70| 61 6e 64 20 72 65 74 75 | 72 6e 73 20 74 6f 20 74 |and retu|rns to t|
|00002a80| 68 65 20 73 68 65 6c 6c | 2e 0a 40 65 6e 64 20 69 |he shell|..@end i|
|00002a90| 74 65 6d 69 7a 65 0a 0a | 40 73 61 6d 70 7b 5f 5f |temize..|@samp{__|
|00002aa0| 49 4e 49 54 5f 4c 49 53 | 54 5f 5f 7d 20 61 6e 64 |INIT_LIS|T__} and|
|00002ab0| 20 40 73 61 6d 70 7b 5f | 5f 45 58 49 54 5f 4c 49 | @samp{_|_EXIT_LI|
|00002ac0| 53 54 5f 5f 7d 20 61 72 | 65 20 74 77 6f 20 73 65 |ST__} ar|e two se|
|00002ad0| 74 20 65 6c 65 6d 65 6e | 74 73 0a 77 68 69 63 68 |t elemen|ts.which|
|00002ae0| 20 61 72 65 20 61 20 73 | 70 65 63 69 61 6c 69 74 | are a s|pecialit|
|00002af0| 79 20 6f 66 20 74 68 65 | 20 67 6e 75 20 6c 64 2e |y of the| gnu ld.|
|00002b00| 20 53 69 6e 63 65 20 65 | 76 65 72 79 74 68 69 6e | Since e|verythin|
|00002b10| 67 20 74 68 61 74 20 6e | 65 65 64 73 0a 69 6e 69 |g that n|eeds.ini|
|00002b20| 74 69 61 6c 69 7a 61 74 | 69 6f 6e 20 77 6f 72 6b |tializat|ion work|
|00002b30| 73 20 6f 76 65 72 20 74 | 68 65 73 65 20 74 77 6f |s over t|hese two|
|00002b40| 20 6c 69 73 74 73 20 74 | 68 65 20 62 61 72 65 20 | lists t|he bare |
|00002b50| 73 74 61 72 74 75 70 73 | 20 61 72 65 0a 76 65 72 |startups| are.ver|
|00002b60| 79 20 73 68 6f 72 74 2e | 20 49 6e 20 66 61 63 74 |y short.| In fact|
|00002b70| 20 74 68 65 79 20 61 72 | 65 20 65 76 65 6e 20 73 | they ar|e even s|
|00002b80| 68 6f 72 74 65 72 20 74 | 68 65 6e 20 73 6f 6d 65 |horter t|hen some|
|00002b90| 20 6c 6f 77 2d 6c 65 76 | 65 6c 2d 73 74 61 72 74 | low-lev|el-start|
|00002ba0| 75 70 73 0a 0a 59 6f 75 | 20 63 61 6e 20 65 61 73 |ups..You| can eas|
|00002bb0| 69 6c 79 20 61 64 64 20 | 79 6f 75 72 0a 6f 77 6e |ily add |your.own|
|00002bc0| 20 66 75 6e 63 74 69 6f | 6e 73 20 74 6f 20 74 68 | functio|ns to th|
|00002bd0| 65 20 73 74 61 72 74 75 | 70 20 70 72 6f 63 65 64 |e startu|p proced|
|00002be0| 75 72 65 20 62 79 20 75 | 73 69 6e 67 20 74 68 65 |ure by u|sing the|
|00002bf0| 20 6d 61 63 72 6f 73 0a | 69 6e 20 74 68 65 20 66 | macros.|in the f|
|00002c00| 69 6c 65 20 40 73 61 6d | 70 7b 68 65 61 64 65 72 |ile @sam|p{header|
|00002c10| 73 2f 73 74 61 62 73 2e | 68 7d 2e 20 50 72 69 6f |s/stabs.|h}. Prio|
|00002c20| 72 69 74 79 20 76 61 6c | 75 65 73 0a 3c 3d 30 20 |rity val|ues.<=0 |
|00002c30| 61 72 65 20 72 65 73 65 | 72 76 65 64 20 66 6f 72 |are rese|rved for|
|00002c40| 20 6c 69 62 72 61 72 79 | 20 69 6d 70 6c 65 6d 65 | library| impleme|
|00002c50| 6e 74 6f 72 73 2e 0a 0a | 40 6e 6f 64 65 20 53 74 |ntors...|@node St|
|00002c60| 61 72 74 75 70 20 75 73 | 61 67 65 2c 2c 53 74 61 |artup us|age,,Sta|
|00002c70| 72 74 75 70 20 69 6e 74 | 65 72 66 61 63 65 2c 53 |rtup int|erface,S|
|00002c80| 74 61 72 74 75 70 20 63 | 6f 64 65 73 0a 40 63 68 |tartup c|odes.@ch|
|00002c90| 61 70 74 65 72 20 53 74 | 61 72 74 75 70 20 63 6f |apter St|artup co|
|00002ca0| 64 65 20 75 73 61 67 65 | 0a 0a 54 68 65 72 65 20 |de usage|..There |
|00002cb0| 61 72 65 20 63 75 72 72 | 65 6e 74 6c 79 20 33 20 |are curr|ently 3 |
|00002cc0| 73 74 61 72 74 75 70 20 | 63 6f 64 65 73 20 69 6e |startup |codes in|
|00002cd0| 20 74 68 69 73 20 70 61 | 63 6b 61 67 65 20 28 6d | this pa|ckage (m|
|00002ce0| 61 79 62 65 20 74 68 65 | 72 65 20 77 69 6c 6c 20 |aybe the|re will |
|00002cf0| 62 65 20 6d 6f 72 65 0a | 69 6e 20 74 68 65 20 66 |be more.|in the f|
|00002d00| 75 74 75 72 65 29 2e 20 | 44 65 70 65 6e 64 69 6e |uture). |Dependin|
|00002d10| 67 20 6f 6e 20 74 68 65 | 20 63 6f 64 65 20 61 6e |g on the| code an|
|00002d20| 64 20 64 61 74 61 20 6d | 6f 64 65 6c 20 79 6f 75 |d data m|odel you|
|00002d30| 20 75 73 65 20 61 6e 64 | 20 73 6f 6d 65 20 6f 74 | use and| some ot|
|00002d40| 68 65 72 0a 74 68 69 6e | 67 73 20 79 6f 75 20 73 |her.thin|gs you s|
|00002d50| 68 6f 75 6c 64 20 63 68 | 6f 6f 73 65 20 6f 6e 65 |hould ch|oose one|
|00002d60| 20 6f 66 20 74 68 65 6d | 3a 0a 0a 40 74 61 62 6c | of them|:..@tabl|
|00002d70| 65 20 40 73 61 6d 70 0a | 40 69 74 65 6d 20 6e 63 |e @samp.|@item nc|
|00002d80| 72 74 30 2e 6f 0a 54 68 | 69 73 20 69 73 20 74 68 |rt0.o.Th|is is th|
|00002d90| 65 20 6e 6f 72 6d 61 6c | 20 28 69 2e 65 2e 20 6c |e normal| (i.e. l|
|00002da0| 61 72 67 65 20 63 6f 64 | 65 2c 20 6c 61 72 67 65 |arge cod|e, large|
|00002db0| 20 64 61 74 61 20 6d 6f | 64 65 6c 29 20 73 74 61 | data mo|del) sta|
|00002dc0| 72 74 75 70 2e 0a 49 74 | 20 63 6f 6e 74 61 69 6e |rtup..It| contain|
|00002dd0| 73 20 61 20 40 73 61 6d | 70 7b 67 65 74 61 34 28 |s a @sam|p{geta4(|
|00002de0| 29 7d 20 65 6e 74 72 79 | 20 70 6f 69 6e 74 20 74 |)} entry| point t|
|00002df0| 6f 20 65 6e 61 62 6c 65 | 20 79 6f 75 20 74 6f 20 |o enable| you to |
|00002e00| 75 73 65 20 6f 6e 65 20 | 73 6f 75 72 63 65 0a 66 |use one |source.f|
|00002e10| 6f 72 20 74 77 6f 20 63 | 6f 64 65 20 6d 6f 64 65 |or two c|ode mode|
|00002e20| 6c 73 2e 20 54 68 65 72 | 65 20 69 73 20 6e 6f 20 |ls. Ther|e is no |
|00002e30| 6f 74 68 65 72 20 6e 65 | 65 64 20 66 6f 72 20 74 |other ne|ed for t|
|00002e40| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 2e 0a 40 69 |his func|tion..@i|
|00002e50| 74 65 6d 20 6e 62 63 72 | 74 30 2e 6f 0a 54 68 69 |tem nbcr|t0.o.Thi|
|00002e60| 73 20 6f 6e 65 20 69 73 | 20 66 6f 72 20 63 6f 6d |s one is| for com|
|00002e70| 70 69 6c 69 6e 67 20 73 | 6d 61 6c 6c 20 64 61 74 |piling s|mall dat|
|00002e80| 61 20 6d 6f 64 65 6c 20 | 28 61 34 20 72 65 6c 61 |a model |(a4 rela|
|00002e90| 74 69 76 65 29 20 70 72 | 6f 67 72 61 6d 73 2e 0a |tive) pr|ograms..|
|00002ea0| 54 68 65 72 65 20 69 73 | 20 61 20 40 73 61 6d 70 |There is| a @samp|
|00002eb0| 7b 67 65 74 61 34 28 29 | 7d 20 65 6e 74 72 79 20 |{geta4()|} entry |
|00002ec0| 74 68 61 74 20 70 6c 61 | 63 65 73 20 74 68 65 20 |that pla|ces the |
|00002ed0| 72 69 67 68 74 20 69 6e | 66 6f 72 6d 61 74 69 6f |right in|formatio|
|00002ee0| 6e 20 69 6e 74 6f 20 61 | 34 2e 0a 55 73 65 20 74 |n into a|4..Use t|
|00002ef0| 68 69 73 20 73 74 61 72 | 74 75 70 20 63 6f 64 65 |his star|tup code|
|00002f00| 20 69 66 20 79 6f 75 20 | 63 6f 6d 70 69 6c 65 64 | if you |compiled|
|00002f10| 20 77 69 74 68 20 40 73 | 61 6d 70 7b 2d 66 62 61 | with @s|amp{-fba|
|00002f20| 73 65 72 65 6c 7d 2e 0a | 40 69 74 65 6d 20 6e 72 |serel}..|@item nr|
|00002f30| 63 72 74 30 2e 6f 0a 54 | 68 69 73 20 73 74 61 72 |crt0.o.T|his star|
|00002f40| 74 75 70 20 63 6f 64 65 | 20 61 6c 6c 6f 63 61 74 |tup code| allocat|
|00002f50| 65 73 20 61 20 6e 65 77 | 20 64 61 74 61 20 61 72 |es a new| data ar|
|00002f60| 65 61 20 65 76 65 72 79 | 20 74 69 6d 65 20 79 6f |ea every| time yo|
|00002f70| 75 20 63 61 6c 6c 20 69 | 74 2e 0a 45 76 65 6e 20 |u call i|t..Even |
|00002f80| 69 66 20 79 6f 75 20 64 | 6f 6e 27 74 20 63 61 6c |if you d|on't cal|
|00002f90| 6c 20 69 74 20 61 74 20 | 61 6c 6c 20 74 68 65 20 |l it at |all the |
|00002fa0| 64 61 74 61 20 61 72 65 | 20 69 73 20 74 68 65 72 |data are| is ther|
|00002fb0| 65 20 6f 6e 63 65 2e 0a | 54 68 69 73 20 67 69 76 |e once..|This giv|
|00002fc0| 65 73 20 79 6f 75 20 6d | 75 6c 74 69 65 6e 74 72 |es you m|ultientr|
|00002fd0| 61 6e 74 20 61 6e 64 20 | 72 65 65 6e 74 72 61 6e |ant and |reentran|
|00002fe0| 74 20 63 6f 64 65 2e 0a | 54 68 65 72 65 66 6f 72 |t code..|Therefor|
|00002ff0| 65 20 74 68 69 73 20 73 | 74 61 72 74 75 70 20 63 |e this s|tartup c|
|00003000| 6f 64 65 20 69 73 20 66 | 6f 72 20 63 6f 6d 70 69 |ode is f|or compi|
|00003010| 6c 69 6e 67 20 72 65 73 | 69 64 65 6e 74 20 28 70 |ling res|ident (p|
|00003020| 75 72 65 29 20 70 72 6f | 67 72 61 6d 73 2e 0a 52 |ure) pro|grams..R|
|00003030| 65 73 69 64 65 6e 74 20 | 70 72 6f 67 72 61 6d 73 |esident |programs|
|00003040| 20 61 72 65 20 61 6c 77 | 61 79 73 20 73 6d 61 6c | are alw|ays smal|
|00003050| 6c 20 64 61 74 61 20 6d | 6f 64 65 6c 20 69 66 20 |l data m|odel if |
|00003060| 79 6f 75 20 6c 65 74 20 | 74 68 65 20 63 6f 6d 70 |you let |the comp|
|00003070| 69 6c 65 72 20 0a 64 6f | 20 74 68 65 20 77 6f 72 |iler .do| the wor|
|00003080| 6b 2e 0a 0a 54 68 65 72 | 65 20 69 73 20 6e 6f 20 |k...Ther|e is no |
|00003090| 40 73 61 6d 70 7b 67 65 | 74 61 34 28 29 7d 20 65 |@samp{ge|ta4()} e|
|000030a0| 6e 74 72 79 20 2d 20 49 | 20 6a 75 73 74 20 64 6f |ntry - I| just do|
|000030b0| 6e 27 74 20 6b 6e 6f 77 | 20 68 6f 77 20 74 68 69 |n't know| how thi|
|000030c0| 73 20 63 6f 75 6c 64 20 | 62 65 20 64 6f 6e 65 2e |s could |be done.|
|000030d0| 0a 28 49 66 20 79 6f 75 | 20 73 74 61 72 74 20 79 |.(If you| start y|
|000030e0| 6f 75 72 20 63 6f 64 65 | 20 31 30 20 74 69 6d 65 |our code| 10 time|
|000030f0| 73 20 61 6e 64 20 77 61 | 6e 74 20 74 6f 20 61 63 |s and wa|nt to ac|
|00003100| 63 65 73 73 20 67 6c 6f | 62 61 6c 20 64 61 74 61 |cess glo|bal data|
|00003110| 20 0a 6f 75 74 20 6f 66 | 20 61 20 68 6f 6f 6b 20 | .out of| a hook |
|00003120| 79 6f 75 20 63 61 6e 6e | 6f 74 20 74 65 6c 6c 20 |you cann|ot tell |
|00003130| 77 68 69 63 68 20 6f 6e | 65 20 6f 66 20 74 68 65 |which on|e of the|
|00003140| 20 31 30 20 64 61 74 61 | 20 61 72 65 61 73 20 74 | 10 data| areas t|
|00003150| 6f 20 75 73 65 20 0a 62 | 65 63 61 75 73 65 20 79 |o use .b|ecause y|
|00003160| 6f 75 20 77 61 6e 74 20 | 74 6f 20 61 63 63 65 73 |ou want |to acces|
|00003170| 73 20 74 68 65 20 64 61 | 74 61 20 66 72 6f 6d 20 |s the da|ta from |
|00003180| 61 20 64 69 66 66 65 72 | 65 6e 74 20 74 61 73 6b |a differ|ent task|
|00003190| 21 29 0a 40 65 6e 64 20 | 74 61 62 6c 65 0a 0a 40 |!).@end |table..@|
|000031a0| 6e 6f 64 65 20 43 6f 6d | 6d 61 6e 64 6c 69 6e 65 |node Com|mandline|
|000031b0| 20 70 61 72 73 65 72 2c | 6c 69 62 6e 69 78 2e 61 | parser,|libnix.a|
|000031c0| 2c 53 74 61 72 74 75 70 | 20 63 6f 64 65 73 2c 46 |,Startup| codes,F|
|000031d0| 65 61 74 75 72 65 73 0a | 40 63 68 61 70 74 65 72 |eatures.|@chapter|
|000031e0| 20 43 6f 6d 6d 61 6e 64 | 6c 69 6e 65 20 70 61 72 | Command|line par|
|000031f0| 73 65 72 0a 0a 54 68 65 | 72 65 20 61 72 65 20 63 |ser..The|re are c|
|00003200| 75 72 72 65 6e 74 6c 79 | 20 32 20 63 6f 6d 6d 61 |urrently| 2 comma|
|00003210| 6e 64 6c 69 6e 65 20 70 | 61 72 73 65 72 20 6d 6f |ndline p|arser mo|
|00003220| 64 75 6c 65 73 20 69 6e | 20 74 68 65 20 6c 69 62 |dules in| the lib|
|00003230| 6e 69 78 20 70 61 63 6b | 61 67 65 2e 0a 59 6f 75 |nix pack|age..You|
|00003240| 20 63 61 6e 20 65 61 73 | 69 6c 79 20 77 72 69 74 | can eas|ily writ|
|00003250| 65 20 79 6f 75 72 20 6f | 77 6e 20 62 79 20 6c 6f |e your o|wn by lo|
|00003260| 6f 6b 69 6e 67 20 69 6e | 74 6f 20 74 68 65 20 65 |oking in|to the e|
|00003270| 78 61 6d 70 6c 65 73 0a | 0a 40 74 61 62 6c 65 20 |xamples.|.@table |
|00003280| 40 63 6f 64 65 0a 40 69 | 74 65 6d 20 6c 69 62 6e |@code.@i|tem libn|
|00003290| 69 78 6d 61 69 6e 2e 61 | 0a 54 68 69 73 20 69 73 |ixmain.a|.This is|
|000032a0| 20 74 68 65 20 6e 6f 72 | 6d 61 6c 20 6f 6e 65 2c | the nor|mal one,|
|000032b0| 20 69 2e 65 2e 20 69 74 | 20 64 6f 65 73 20 61 6c | i.e. it| does al|
|000032c0| 6c 20 74 68 65 20 77 6f | 72 6b 20 6e 65 63 65 73 |l the wo|rk neces|
|000032d0| 73 61 72 79 20 66 6f 72 | 0a 41 4e 53 49 20 63 6f |sary for|.ANSI co|
|000032e0| 6d 70 61 74 69 62 69 6c | 69 74 79 20 61 6e 64 20 |mpatibil|ity and |
|000032f0| 67 69 76 65 73 20 79 6f | 75 20 74 68 65 20 6e 6f |gives yo|u the no|
|00003300| 72 6d 61 6c 20 40 73 61 | 6d 70 7b 6d 61 69 6e 7d |rmal @sa|mp{main}|
|00003310| 20 63 61 6c 6c 69 6e 67 | 0a 63 6f 6e 76 65 6e 74 | calling|.convent|
|00003320| 69 6f 6e 2e 20 59 6f 75 | 20 63 61 6e 20 73 68 75 |ion. You| can shu|
|00003330| 74 20 64 6f 77 6e 20 74 | 68 65 20 63 6f 6d 6d 61 |t down t|he comma|
|00003340| 6e 64 6c 69 6e 65 20 70 | 61 72 73 69 6e 67 20 28 |ndline p|arsing (|
|00003350| 69 66 20 79 6f 75 20 77 | 61 6e 74 0a 74 6f 20 75 |if you w|ant.to u|
|00003360| 73 65 20 74 68 65 20 61 | 6d 69 67 61 20 4f 53 20 |se the a|miga OS |
|00003370| 63 6f 6d 6d 61 6e 64 6c | 69 6e 65 20 70 61 72 73 |commandl|ine pars|
|00003380| 65 72 29 20 62 79 20 64 | 65 63 6c 61 72 69 6e 67 |er) by d|eclaring|
|00003390| 0a 0a 40 63 6f 64 65 7b | 5f 5f 6e 6f 63 6f 6d 6d |..@code{|__nocomm|
|000033a0| 61 6e 64 6c 69 6e 65 7d | 0a 0a 73 6f 6d 65 77 68 |andline}|..somewh|
|000033b0| 65 72 65 20 69 6e 20 79 | 6f 75 72 20 63 6f 64 65 |ere in y|our code|
|000033c0| 20 28 74 68 65 20 74 79 | 70 65 20 6f 66 20 69 74 | (the ty|pe of it|
|000033d0| 20 61 63 74 75 61 6c 6c | 79 20 64 6f 65 73 6e 27 | actuall|y doesn'|
|000033e0| 74 20 6d 61 74 74 65 72 | 29 2e 20 54 68 69 73 0a |t matter|). This.|
|000033f0| 73 70 61 72 65 73 20 73 | 6f 6d 65 20 62 79 74 65 |spares s|ome byte|
|00003400| 73 20 61 6e 64 20 69 73 | 20 63 6f 6d 70 61 74 69 |s and is| compati|
|00003410| 62 6c 65 20 74 6f 20 65 | 76 65 72 79 20 6f 74 68 |ble to e|very oth|
|00003420| 65 72 20 63 6f 6d 70 69 | 6c 65 72 2e 0a 0a 41 6e |er compi|ler...An|
|00003430| 64 20 79 6f 75 20 63 61 | 6e 20 64 65 63 6c 61 72 |d you ca|n declar|
|00003440| 65 20 79 6f 75 72 20 6f | 77 6e 20 57 42 20 73 68 |e your o|wn WB sh|
|00003450| 65 6c 6c 20 77 69 6e 64 | 6f 77 20 62 79 20 64 65 |ell wind|ow by de|
|00003460| 63 6c 61 72 69 6e 67 20 | 61 0a 0a 40 63 6f 64 65 |claring |a..@code|
|00003470| 7b 63 68 61 72 20 5f 5f | 73 74 64 69 6f 77 69 6e |{char __|stdiowin|
|00003480| 5b 5d 7d 0a 0a 76 61 72 | 69 61 62 6c 65 20 73 6f |[]}..var|iable so|
|00003490| 6d 65 77 68 65 72 65 20 | 69 6e 20 79 6f 75 72 20 |mewhere |in your |
|000034a0| 63 6f 64 65 20 28 62 75 | 74 20 6f 6e 6c 79 20 69 |code (bu|t only i|
|000034b0| 66 20 79 6f 75 20 70 61 | 72 73 65 20 74 68 65 20 |f you pa|rse the |
|000034c0| 63 6f 6d 6d 61 6e 64 6c | 69 6e 65 20 2d 0a 77 69 |commandl|ine -.wi|
|000034d0| 74 68 6f 75 74 20 74 68 | 65 20 63 6f 6d 6d 61 6e |thout th|e comman|
|000034e0| 64 6c 69 6e 65 20 70 61 | 72 73 65 72 20 79 6f 75 |dline pa|rser you|
|000034f0| 20 67 65 74 20 6e 6f 20 | 77 69 6e 64 6f 77 20 61 | get no |window a|
|00003500| 74 20 61 6c 6c 21 29 2e | 0a 0a 40 69 74 65 6d 20 |t all!).|..@item |
|00003510| 6c 69 62 6e 69 78 5f 6d | 61 69 6e 2e 61 0a 54 68 |libnix_m|ain.a.Th|
|00003520| 69 73 20 69 73 20 61 20 | 73 70 65 63 69 61 6c 20 |is is a |special |
|00003530| 76 65 72 73 69 6f 6e 20 | 6f 66 20 61 20 63 6f 6d |version |of a com|
|00003540| 6d 61 6e 64 6c 69 6e 65 | 20 70 61 72 73 65 72 20 |mandline| parser |
|00003550| 2d 20 69 74 20 64 6f 65 | 73 6e 27 74 20 63 61 6c |- it doe|sn't cal|
|00003560| 6c 0a 74 68 65 20 6e 6f | 72 6d 61 6c 20 40 73 61 |l.the no|rmal @sa|
|00003570| 6d 70 7b 6d 61 69 6e 7d | 20 62 75 74 0a 0a 40 63 |mp{main}| but..@c|
|00003580| 6f 64 65 7b 69 6e 74 20 | 6d 61 69 6e 28 63 68 61 |ode{int |main(cha|
|00003590| 72 20 2a 63 6f 6d 6d 61 | 6e 64 6c 69 6e 65 29 7d |r *comma|ndline)}|
|000035a0| 0a 0a 40 73 61 6d 70 7b | 63 6f 6d 6d 61 6e 64 6c |..@samp{|commandl|
|000035b0| 69 6e 65 7d 20 69 73 20 | 74 68 65 20 63 6f 6d 70 |ine} is |the comp|
|000035c0| 6c 65 74 65 20 63 6f 6d | 6d 61 6e 64 6c 69 6e 65 |lete com|mandline|
|000035d0| 20 2d 20 69 6e 63 6c 75 | 64 69 6e 67 20 74 68 65 | - inclu|ding the|
|000035e0| 20 71 75 6f 74 65 64 0a | 66 69 6c 65 6e 61 6d 65 | quoted.|filename|
|000035f0| 20 6f 66 20 79 6f 75 72 | 20 70 72 6f 67 72 61 6d | of your| program|
|00003600| 20 28 69 74 27 73 20 6f | 6e 6c 79 20 71 75 6f 74 | (it's o|nly quot|
|00003610| 65 64 2c 20 6e 6f 74 20 | 65 73 63 61 70 65 64 20 |ed, not |escaped |
|00003620| 2d 20 74 68 69 73 20 69 | 73 0a 66 6f 72 20 63 6f |- this i|s.for co|
|00003630| 6d 70 61 74 69 62 69 6c | 69 74 79 20 72 65 61 73 |mpatibil|ity reas|
|00003640| 6f 6e 73 20 3a 2d 28 20 | 29 2e 20 59 6f 75 20 6d |ons :-( |). You m|
|00003650| 69 67 68 74 20 74 68 69 | 6e 6b 20 74 68 65 20 6e |ight thi|nk the n|
|00003660| 61 6d 65 20 6f 66 20 74 | 68 65 20 67 61 6d 65 0a |ame of t|he game.|
|00003670| 73 68 6f 75 6c 64 20 62 | 65 20 40 73 61 6d 70 7b |should b|e @samp{|
|00003680| 5f 6d 61 69 6e 7d 20 61 | 6e 64 20 6e 6f 74 20 40 |_main} a|nd not @|
|00003690| 73 61 6d 70 7b 6d 61 69 | 6e 7d 20 2d 20 61 6e 64 |samp{mai|n} - and|
|000036a0| 20 79 6f 75 20 61 72 65 | 20 63 6f 6d 70 6c 65 74 | you are| complet|
|000036b0| 65 6c 79 0a 72 69 67 68 | 74 2e 20 59 6f 75 20 63 |ely.righ|t. You c|
|000036c0| 61 6e 20 75 73 65 20 40 | 73 61 6d 70 7b 5f 6d 61 |an use @|samp{_ma|
|000036d0| 69 6e 7d 20 66 6f 72 20 | 40 73 61 6d 70 7b 6d 61 |in} for |@samp{ma|
|000036e0| 69 6e 7d 20 61 6e 64 20 | 40 73 61 6d 70 7b 5f 65 |in} and |@samp{_e|
|000036f0| 78 69 74 7d 20 66 6f 72 | 0a 40 73 61 6d 70 7b 65 |xit} for|.@samp{e|
|00003700| 78 69 74 7d 20 2d 20 74 | 68 65 72 65 20 61 72 65 |xit} - t|here are|
|00003710| 20 73 79 6d 62 6f 6c 20 | 72 65 64 69 72 65 63 74 | symbol |redirect|
|00003720| 69 6f 6e 73 20 66 6f 72 | 20 74 68 65 73 65 20 61 |ions for| these a|
|00003730| 6e 64 20 74 68 65 20 6c | 69 6e 6b 65 72 0a 64 6f |nd the l|inker.do|
|00003740| 65 73 20 74 68 65 20 77 | 6f 72 6b 2e 20 0a 0a 54 |es the w|ork. ..T|
|00003750| 68 69 73 20 63 6f 6d 6d | 61 6e 64 6c 69 6e 65 20 |his comm|andline |
|00003760| 70 61 72 73 65 72 20 69 | 73 20 75 73 65 66 75 6c |parser i|s useful|
|00003770| 20 66 6f 72 20 63 6f 6d | 70 61 74 69 62 69 6c 69 | for com|patibili|
|00003780| 74 79 2e 0a 59 6f 75 20 | 63 61 6e 20 75 73 65 20 |ty..You |can use |
|00003790| 69 74 20 61 73 20 61 20 | 73 65 63 6f 6e 64 20 65 |it as a |second e|
|000037a0| 78 61 6d 70 6c 65 20 6f | 72 20 66 6f 72 20 72 65 |xample o|r for re|
|000037b0| 63 6f 6d 70 69 6c 69 6e | 67 20 50 44 20 70 72 6f |compilin|g PD pro|
|000037c0| 67 72 61 6d 73 20 74 68 | 61 74 20 0a 75 73 65 20 |grams th|at .use |
|000037d0| 74 68 65 20 73 69 6e 67 | 6c 65 20 61 72 67 75 6d |the sing|le argum|
|000037e0| 65 6e 74 2e 20 59 6f 75 | 20 63 61 6e 6e 6f 74 20 |ent. You| cannot |
|000037f0| 75 73 65 20 69 74 20 66 | 6f 72 20 63 6f 6d 70 69 |use it f|or compi|
|00003800| 6c 69 6e 67 20 41 4e 53 | 49 20 63 6f 64 65 2e 0a |ling ANS|I code..|
|00003810| 40 65 6e 64 20 74 61 62 | 6c 65 0a 0a 40 6e 6f 64 |@end tab|le..@nod|
|00003820| 65 20 6c 69 62 6e 69 78 | 2e 61 2c 6c 69 62 61 6d |e libnix|.a,libam|
|00003830| 69 67 61 2e 61 2c 43 6f | 6d 6d 61 6e 64 6c 69 6e |iga.a,Co|mmandlin|
|00003840| 65 20 70 61 72 73 65 72 | 2c 46 65 61 74 75 72 65 |e parser|,Feature|
|00003850| 73 0a 40 63 68 61 70 74 | 65 72 20 53 6f 6d 65 20 |s.@chapt|er Some |
|00003860| 41 4e 53 49 20 28 6d 69 | 73 29 66 65 61 74 75 72 |ANSI (mi|s)featur|
|00003870| 65 73 0a 0a 49 20 73 75 | 70 70 6f 73 65 20 79 6f |es..I su|ppose yo|
|00003880| 75 20 61 72 65 20 66 61 | 6d 69 6c 69 61 72 20 77 |u are fa|miliar w|
|00003890| 69 74 68 20 43 20 61 6e | 64 20 65 73 70 65 63 69 |ith C an|d especi|
|000038a0| 61 6c 6c 79 20 41 4e 53 | 49 20 43 20 2d 20 69 66 |ally ANS|I C - if|
|000038b0| 20 6e 6f 74 0a 79 6f 75 | 20 73 68 6f 75 6c 64 20 | not.you| should |
|000038c0| 72 65 61 64 20 61 20 67 | 6f 6f 64 20 62 6f 6f 6b |read a g|ood book|
|000038d0| 20 61 62 6f 75 74 20 69 | 74 20 0a 40 66 6f 6f 74 | about i|t .@foot|
|000038e0| 6e 6f 74 65 7b 49 20 72 | 65 63 6f 6d 6d 65 6e 64 |note{I r|ecommend|
|000038f0| 20 74 68 69 73 20 6f 6e | 65 3a 0a 0a 42 72 69 61 | this on|e:..Bria|
|00003900| 6e 20 57 2e 20 4b 65 72 | 6e 69 67 68 61 6e 2c 20 |n W. Ker|nighan, |
|00003910| 44 65 6e 6e 69 73 20 4d | 2e 52 69 74 63 68 69 65 |Dennis M|.Ritchie|
|00003920| 3a 0a 40 2a 54 68 65 20 | 43 20 50 72 6f 67 72 61 |:.@*The |C Progra|
|00003930| 6d 6d 69 6e 67 20 4c 61 | 6e 67 75 61 67 65 20 28 |mming La|nguage (|
|00003940| 53 65 63 6f 6e 64 20 45 | 64 69 74 69 6f 6e 29 0a |Second E|dition).|
|00003950| 40 2a 50 72 65 6e 74 69 | 63 65 20 48 61 6c 6c 2c |@*Prenti|ce Hall,|
|00003960| 20 45 6e 67 6c 65 77 6f | 6f 64 20 43 6c 69 66 66 | Englewo|od Cliff|
|00003970| 73 2c 20 31 39 38 38 7d | 2e 0a 54 68 69 73 20 63 |s, 1988}|..This c|
|00003980| 68 61 70 74 65 72 20 6f | 6e 6c 79 20 63 6f 6e 74 |hapter o|nly cont|
|00003990| 61 69 6e 73 20 73 6f 6d | 65 20 73 70 65 63 69 61 |ains som|e specia|
|000039a0| 6c 20 66 65 61 74 75 72 | 65 73 20 6f 66 20 74 68 |l featur|es of th|
|000039b0| 65 0a 69 6d 70 6c 65 6d | 65 6e 74 61 74 69 6f 6e |e.implem|entation|
|000039c0| 20 2d 20 79 6f 75 20 73 | 68 6f 75 6c 64 20 6b 6e | - you s|hould kn|
|000039d0| 6f 77 20 74 68 65 73 65 | 20 69 66 20 79 6f 75 20 |ow these| if you |
|000039e0| 77 61 6e 74 20 74 6f 0a | 75 73 65 20 74 68 69 73 |want to.|use this|
|000039f0| 20 6c 69 62 72 61 72 79 | 2e 0a 0a 40 6d 65 6e 75 | library|...@menu|
|00003a00| 0a 2a 20 4c 6f 63 61 6c | 65 3a 3a 0a 2a 20 46 6f |.* Local|e::.* Fo|
|00003a10| 72 6d 61 74 74 65 64 20 | 49 2f 4f 3a 3a 0a 2a 20 |rmatted |I/O::.* |
|00003a20| 61 74 6f 66 20 73 74 72 | 74 6f 64 3a 3a 0a 2a 20 |atof str|tod::.* |
|00003a30| 4d 65 6d 6f 72 79 20 6d | 61 6e 61 67 65 6d 65 6e |Memory m|anagemen|
|00003a40| 74 3a 3a 0a 2a 20 53 74 | 61 6e 64 61 72 64 20 49 |t::.* St|andard I|
|00003a50| 2f 4f 3a 3a 0a 2a 20 53 | 69 67 6e 61 6c 20 68 61 |/O::.* S|ignal ha|
|00003a60| 6e 64 6c 69 6e 67 3a 3a | 0a 2a 20 73 65 74 6a 6d |ndling::|.* setjm|
|00003a70| 70 20 6c 6f 6e 67 6a 6d | 70 3a 3a 0a 2a 20 63 74 |p longjm|p::.* ct|
|00003a80| 79 70 65 3a 3a 0a 2a 20 | 63 6c 6f 63 6b 3a 3a 0a |ype::.* |clock::.|
|00003a90| 2a 20 4d 75 6c 74 69 62 | 79 74 65 20 63 68 61 72 |* Multib|yte char|
|00003aa0| 61 63 74 65 72 20 66 75 | 6e 63 74 69 6f 6e 73 3a |acter fu|nctions:|
|00003ab0| 3a 0a 40 65 6e 64 20 6d | 65 6e 75 0a 0a 40 6e 6f |:.@end m|enu..@no|
|00003ac0| 64 65 20 4c 6f 63 61 6c | 65 2c 46 6f 72 6d 61 74 |de Local|e,Format|
|00003ad0| 74 65 64 20 49 2f 4f 2c | 6c 69 62 6e 69 78 2e 61 |ted I/O,|libnix.a|
|00003ae0| 2c 6c 69 62 6e 69 78 2e | 61 0a 40 63 68 61 70 74 |,libnix.|a.@chapt|
|00003af0| 65 72 20 4c 6f 63 61 6c | 65 0a 0a 4f 6e 65 20 66 |er Local|e..One f|
|00003b00| 65 61 74 75 72 65 20 6f | 66 20 61 20 63 6f 6d 70 |eature o|f a comp|
|00003b10| 6c 65 74 65 20 41 4e 53 | 49 20 63 6f 6d 70 61 74 |lete ANS|I compat|
|00003b20| 69 62 6c 65 20 6c 69 62 | 72 61 72 79 20 69 73 20 |ible lib|rary is |
|00003b30| 6c 6f 63 61 6c 65 20 73 | 75 70 70 6f 72 74 2e 20 |locale s|upport. |
|00003b40| 54 68 65 0a 41 4e 53 49 | 20 73 74 61 6e 64 61 72 |The.ANSI| standar|
|00003b50| 64 20 6f 6e 6c 79 20 6b | 6e 6f 77 73 20 6f 66 20 |d only k|nows of |
|00003b60| 74 77 6f 20 6c 6f 63 61 | 6c 65 73 3a 0a 0a 40 69 |two loca|les:..@i|
|00003b70| 74 65 6d 69 7a 65 20 40 | 62 75 6c 6c 65 74 0a 40 |temize @|bullet.@|
|00003b80| 69 74 65 6d 0a 22 43 22 | 20 6c 6f 63 61 6c 65 20 |item."C"| locale |
|00003b90| 28 6e 6f 72 6d 61 6c 20 | 43 20 62 65 68 61 76 69 |(normal |C behavi|
|00003ba0| 6f 75 72 29 2e 0a 40 69 | 74 65 6d 0a 44 65 66 61 |our)..@i|tem.Defa|
|00003bb0| 75 6c 74 20 6c 6f 63 61 | 6c 65 2e 0a 40 65 6e 64 |ult loca|le..@end|
|00003bc0| 20 69 74 65 6d 69 7a 65 | 0a 0a 45 76 65 72 79 20 | itemize|..Every |
|00003bd0| 6f 74 68 65 72 20 6c 6f | 63 61 6c 65 20 64 65 70 |other lo|cale dep|
|00003be0| 65 6e 64 73 20 76 65 72 | 79 20 68 65 61 76 69 6c |ends ver|y heavil|
|00003bf0| 79 20 6f 6e 20 74 68 65 | 20 69 6d 70 6c 65 6d 65 |y on the| impleme|
|00003c00| 6e 74 61 74 69 6f 6e 2e | 0a 0a 54 6f 20 64 6f 20 |ntation.|..To do |
|00003c10| 6c 6f 63 61 6c 65 20 73 | 75 70 70 6f 72 74 20 6f |locale s|upport o|
|00003c20| 6e 20 74 68 65 20 61 6d | 69 67 61 20 49 20 64 65 |n the am|iga I de|
|00003c30| 63 69 64 65 64 20 74 6f | 20 75 73 65 20 6c 6f 63 |cided to| use loc|
|00003c40| 61 6c 65 2e 6c 69 62 72 | 61 72 79 20 28 77 68 61 |ale.libr|ary (wha|
|00003c50| 74 20 65 6c 73 65 29 2e | 0a 54 68 69 73 20 6d 65 |t else).|.This me|
|00003c60| 61 6e 73 20 74 68 61 74 | 20 79 6f 75 20 6e 6f 72 |ans that| you nor|
|00003c70| 6d 61 6c 6c 79 20 68 61 | 76 65 20 6f 6e 6c 79 20 |mally ha|ve only |
|00003c80| 74 68 65 73 65 20 74 77 | 6f 20 6c 6f 63 61 6c 65 |these tw|o locale|
|00003c90| 73 20 2d 20 74 6f 20 68 | 61 76 65 20 6d 6f 72 65 |s - to h|ave more|
|00003ca0| 20 74 68 61 6e 20 74 68 | 61 74 0a 79 6f 75 20 6d | than th|at.you m|
|00003cb0| 75 73 74 20 6d 61 6b 65 | 20 73 6f 6d 65 20 65 78 |ust make| some ex|
|00003cc0| 74 72 61 20 70 72 65 66 | 65 72 65 6e 63 65 73 20 |tra pref|erences |
|00003cd0| 66 69 6c 65 73 20 77 69 | 74 68 20 74 68 65 20 6c |files wi|th the l|
|00003ce0| 6f 63 61 6c 65 20 70 72 | 65 66 65 72 65 6e 63 65 |ocale pr|eference|
|00003cf0| 73 20 65 64 69 74 6f 72 | 0a 61 6e 64 20 67 69 76 |s editor|.and giv|
|00003d00| 65 20 74 68 65 20 70 61 | 74 68 20 6f 66 20 74 68 |e the pa|th of th|
|00003d10| 65 73 65 20 74 6f 20 74 | 68 65 20 73 65 74 6c 6f |ese to t|he setlo|
|00003d20| 63 61 6c 65 28 29 2d 63 | 61 6c 6c 2e 20 49 66 20 |cale()-c|all. If |
|00003d30| 79 6f 75 20 64 6f 20 6e | 6f 74 20 68 61 76 65 20 |you do n|ot have |
|00003d40| 6c 6f 63 61 6c 65 2e 6c | 69 62 72 61 72 79 0a 79 |locale.l|ibrary.y|
|00003d50| 6f 75 20 77 69 6c 6c 20 | 67 65 74 20 6f 6e 6c 79 |ou will |get only|
|00003d60| 20 22 43 22 20 6c 6f 63 | 61 6c 65 2e 20 54 68 69 | "C" loc|ale. Thi|
|00003d70| 73 20 69 73 20 74 68 65 | 20 64 65 66 61 75 6c 74 |s is the| default|
|00003d80| 20 74 68 65 6e 20 3a 2d | 28 2e 0a 0a 41 6e 6f 74 | then :-|(...Anot|
|00003d90| 68 65 72 20 69 6d 70 6f | 72 74 61 6e 74 20 70 6f |her impo|rtant po|
|00003da0| 69 6e 74 20 69 73 20 74 | 68 61 74 20 74 68 65 20 |int is t|hat the |
|00003db0| 41 4e 53 49 20 73 74 61 | 6e 64 61 72 64 20 72 65 |ANSI sta|ndard re|
|00003dc0| 71 75 69 72 65 73 20 74 | 68 65 20 64 65 66 61 75 |quires t|he defau|
|00003dd0| 6c 74 20 6c 6f 63 61 6c | 65 20 74 6f 20 62 65 0a |lt local|e to be.|
|00003de0| 6c 6f 61 64 65 64 20 61 | 74 20 70 72 6f 67 72 61 |loaded a|t progra|
|00003df0| 6d 20 73 74 61 72 74 75 | 70 2e 20 69 2e 65 2e 20 |m startu|p. i.e. |
|00003e00| 69 66 20 79 6f 75 20 75 | 73 65 20 67 65 72 6d 61 |if you u|se germa|
|00003e10| 6e 20 6c 6f 63 61 6c 65 | 20 28 66 6f 72 20 65 78 |n locale| (for ex|
|00003e20| 61 6d 70 6c 65 29 20 79 | 6f 75 20 0a 77 69 6c 6c |ample) y|ou .will|
|00003e30| 20 6a 75 73 74 20 67 65 | 74 20 69 74 20 2d 20 70 | just ge|t it - p|
|00003e40| 72 69 6e 74 66 20 61 6e | 64 20 73 63 61 6e 66 20 |rintf an|d scanf |
|00003e50| 77 69 6c 6c 20 6e 6f 74 | 20 77 6f 72 6b 20 61 73 |will not| work as|
|00003e60| 20 65 78 70 65 63 74 65 | 64 20 62 75 74 20 75 73 | expecte|d but us|
|00003e70| 65 20 74 68 65 0a 64 65 | 63 69 6d 61 6c 20 63 6f |e the.de|cimal co|
|00003e80| 6d 6d 61 20 40 73 61 6d | 70 7b 2c 7d 20 69 6e 73 |mma @sam|p{,} ins|
|00003e90| 74 65 61 64 20 6f 66 20 | 74 68 65 20 64 65 63 69 |tead of |the deci|
|00003ea0| 6d 61 6c 20 70 6f 69 6e | 74 20 40 73 61 6d 70 7b |mal poin|t @samp{|
|00003eb0| 2e 7d 20 66 6f 72 20 74 | 68 65 69 72 20 66 6c 6f |.} for t|heir flo|
|00003ec0| 61 74 69 6e 67 20 0a 70 | 6f 69 6e 74 20 6e 75 6d |ating .p|oint num|
|00003ed0| 62 65 72 73 2c 20 63 74 | 79 70 65 20 66 75 6e 63 |bers, ct|ype func|
|00003ee0| 74 69 6f 6e 73 20 77 69 | 6c 6c 20 62 65 68 61 76 |tions wi|ll behav|
|00003ef0| 65 20 64 69 66 66 65 72 | 65 6e 74 6c 79 2c 20 74 |e differ|ently, t|
|00003f00| 6f 6f 2e 0a 0a 54 68 69 | 73 20 63 61 6e 20 62 65 |oo...Thi|s can be|
|00003f10| 20 76 65 72 79 20 61 6e | 6e 6f 79 69 6e 67 20 69 | very an|noying i|
|00003f20| 66 20 79 6f 75 20 64 6f | 6e 27 74 20 77 61 6e 74 |f you do|n't want|
|00003f30| 20 74 6f 20 75 73 65 20 | 41 4e 53 49 20 6c 6f 63 | to use |ANSI loc|
|00003f40| 61 6c 65 20 62 75 74 20 | 72 61 74 68 65 72 0a 6c |ale but |rather.l|
|00003f50| 6f 63 61 6c 65 2e 6c 69 | 62 72 61 72 79 20 28 77 |ocale.li|brary (w|
|00003f60| 68 69 63 68 20 69 73 20 | 6e 6f 74 20 70 6f 72 74 |hich is |not port|
|00003f70| 61 62 6c 65 20 62 75 74 | 20 49 4d 48 4f 20 6d 75 |able but| IMHO mu|
|00003f80| 63 68 20 62 65 74 74 65 | 72 29 20 6f 72 20 69 66 |ch bette|r) or if|
|00003f90| 0a 79 6f 75 20 64 6f 6e | 27 74 20 6e 65 65 64 20 |.you don|'t need |
|00003fa0| 6c 6f 63 61 6c 65 20 73 | 75 70 70 6f 72 74 2e 20 |locale s|upport. |
|00003fb0| 41 6e 64 20 65 76 65 6e | 20 64 61 6e 67 65 72 6f |And even| dangero|
|00003fc0| 75 73 20 69 66 20 79 6f | 75 20 64 6f 6e 27 74 0a |us if yo|u don't.|
|00003fd0| 74 65 73 74 20 79 6f 75 | 72 20 70 72 6f 67 72 61 |test you|r progra|
|00003fe0| 6d 20 75 6e 64 65 72 20 | 64 69 66 66 65 72 65 6e |m under |differen|
|00003ff0| 74 20 6c 6f 63 61 6c 65 | 73 2e 0a 0a 54 6f 20 67 |t locale|s...To g|
|00004000| 65 74 20 61 72 6f 75 6e | 64 20 74 68 69 73 20 70 |et aroun|d this p|
|00004010| 72 6f 62 6c 65 6d 20 49 | 20 64 65 63 69 64 65 64 |roblem I| decided|
|00004020| 20 74 6f 20 64 6f 20 73 | 6f 6d 65 20 6e 61 73 74 | to do s|ome nast|
|00004030| 79 20 74 68 69 6e 67 3a | 0a 54 6f 20 67 65 74 20 |y thing:|.To get |
|00004040| 6c 6f 63 61 6c 65 20 73 | 75 70 70 6f 72 74 20 79 |locale s|upport y|
|00004050| 6f 75 20 68 61 76 65 20 | 74 6f 20 6d 61 6b 65 20 |ou have |to make |
|00004060| 75 70 20 61 20 72 65 66 | 65 72 65 6e 63 65 20 74 |up a ref|erence t|
|00004070| 6f 20 73 65 74 6c 6f 63 | 61 6c 65 2e 20 59 6f 75 |o setloc|ale. You|
|00004080| 20 63 61 6e 20 64 6f 0a | 74 68 69 73 20 62 79 20 | can do.|this by |
|00004090| 6a 75 73 74 20 63 61 6c | 6c 69 6e 67 20 0a 0a 73 |just cal|ling ..s|
|000040a0| 65 74 6c 6f 63 61 6c 65 | 28 4c 43 5f 41 4c 4c 2c |etlocale|(LC_ALL,|
|000040b0| 22 43 22 29 3b 0a 0a 69 | 6d 6d 65 64 69 61 74 65 |"C");..i|mmediate|
|000040c0| 6c 79 20 61 66 74 65 72 | 20 70 72 6f 67 72 61 6d |ly after| program|
|000040d0| 20 73 74 61 72 74 75 70 | 2e 20 28 41 6e 64 20 67 | startup|. (And g|
|000040e0| 65 74 20 22 43 22 20 6c | 6f 63 61 6c 65 20 74 68 |et "C" l|ocale th|
|000040f0| 65 6e 20 61 66 74 65 72 | 20 70 72 6f 67 72 61 6d |en after| program|
|00004100| 20 73 74 61 72 74 20 77 | 68 69 63 68 0a 69 73 20 | start w|hich.is |
|00004110| 61 20 6d 75 63 68 20 62 | 65 74 74 65 72 20 63 68 |a much b|etter ch|
|00004120| 6f 69 63 65 29 2e 20 4f | 72 20 62 79 20 6a 75 73 |oice). O|r by jus|
|00004130| 74 20 75 73 69 6e 67 20 | 73 65 74 6c 6f 63 61 6c |t using |setlocal|
|00004140| 65 20 61 6e 79 77 68 65 | 72 65 20 69 6e 20 79 6f |e anywhe|re in yo|
|00004150| 75 72 20 70 72 6f 67 72 | 61 6d 20 2d 0a 79 6f 75 |ur progr|am -.you|
|00004160| 20 77 69 6c 6c 20 67 65 | 74 20 64 65 66 61 75 6c | will ge|t defaul|
|00004170| 74 20 6c 6f 63 61 6c 65 | 20 61 74 20 70 72 6f 67 |t locale| at prog|
|00004180| 72 61 6d 20 73 74 61 72 | 74 75 70 20 74 68 65 6e |ram star|tup then|
|00004190| 2e 0a 0a 40 6e 6f 64 65 | 20 46 6f 72 6d 61 74 74 |...@node| Formatt|
|000041a0| 65 64 20 49 2f 4f 2c 61 | 74 6f 66 20 73 74 72 74 |ed I/O,a|tof strt|
|000041b0| 6f 64 2c 4c 6f 63 61 6c | 65 2c 6c 69 62 6e 69 78 |od,Local|e,libnix|
|000041c0| 2e 61 0a 40 63 68 61 70 | 74 65 72 20 46 6f 72 6d |.a.@chap|ter Form|
|000041d0| 61 74 74 65 64 20 49 2f | 4f 0a 0a 54 68 65 20 66 |atted I/|O..The f|
|000041e0| 6f 72 6d 61 74 74 65 64 | 20 49 2f 4f 20 73 70 65 |ormatted| I/O spe|
|000041f0| 63 69 66 69 63 61 74 69 | 6f 6e 73 20 61 72 65 20 |cificati|ons are |
|00004200| 61 6c 6c 20 74 68 65 72 | 65 20 28 72 65 6d 65 6d |all ther|e (remem|
|00004210| 62 65 72 3a 20 74 68 69 | 73 20 6c 69 62 72 61 72 |ber: thi|s librar|
|00004220| 79 20 74 72 69 65 73 20 | 74 6f 0a 62 65 20 41 4e |y tries |to.be AN|
|00004230| 53 49 20 63 6f 6d 70 6c | 69 61 6e 74 29 2e 20 42 |SI compl|iant). B|
|00004240| 75 74 20 74 68 65 72 65 | 20 61 72 65 20 74 77 6f |ut there| are two|
|00004250| 20 74 68 69 6e 67 73 20 | 79 6f 75 20 73 68 6f 75 | things |you shou|
|00004260| 6c 64 20 6b 6e 6f 77 20 | 61 62 6f 75 74 20 74 68 |ld know |about th|
|00004270| 65 6d 3a 0a 0a 40 69 74 | 65 6d 69 7a 65 20 40 62 |em:..@it|emize @b|
|00004280| 75 6c 6c 65 74 0a 40 69 | 74 65 6d 0a 54 68 65 20 |ullet.@i|tem.The |
|00004290| 66 6f 72 6d 61 74 74 65 | 64 20 49 2f 4f 20 69 73 |formatte|d I/O is|
|000042a0| 20 61 66 66 65 63 74 65 | 64 20 62 79 20 74 68 65 | affecte|d by the|
|000042b0| 20 73 65 74 6c 6f 63 61 | 6c 65 28 29 20 63 61 6c | setloca|le() cal|
|000042c0| 6c 20 2d 20 74 68 69 73 | 20 69 73 20 6e 6f 20 62 |l - this| is no b|
|000042d0| 75 67 2c 0a 6a 75 73 74 | 20 61 6e 20 41 4e 53 49 |ug,.just| an ANSI|
|000042e0| 20 66 65 61 74 75 72 65 | 2e 0a 40 69 74 65 6d 0a | feature|..@item.|
|000042f0| 48 61 6c 66 20 6f 66 20 | 74 68 65 20 63 6f 64 65 |Half of |the code|
|00004300| 20 6f 66 20 61 20 66 75 | 6c 6c 20 62 6c 6f 77 6e | of a fu|ll blown|
|00004310| 20 70 72 69 6e 74 66 20 | 68 61 6e 64 6c 65 73 20 | printf |handles |
|00004320| 66 6c 6f 61 74 69 6e 67 | 20 70 6f 69 6e 74 20 6e |floating| point n|
|00004330| 75 6d 62 65 72 73 20 2d | 0a 62 75 74 20 6e 6f 74 |umbers -|.but not|
|00004340| 20 65 76 65 72 79 62 6f | 64 79 20 6e 65 65 64 73 | everybo|dy needs|
|00004350| 20 74 68 65 6d 2e 20 53 | 6f 20 74 68 65 72 65 20 | them. S|o there |
|00004360| 61 72 65 20 74 77 6f 20 | 66 75 6e 63 74 69 6f 6e |are two |function|
|00004370| 73 20 66 6f 72 20 62 6f | 74 68 0a 40 73 61 6d 70 |s for bo|th.@samp|
|00004380| 7b 76 66 70 72 69 6e 74 | 66 7d 20 61 6e 64 20 40 |{vfprint|f} and @|
|00004390| 73 61 6d 70 7b 76 66 73 | 63 61 6e 66 7d 20 2d 20 |samp{vfs|canf} - |
|000043a0| 6f 6e 65 20 69 6e 20 40 | 73 61 6d 70 7b 6c 69 62 |one in @|samp{lib|
|000043b0| 6e 69 78 2e 61 7d 20 6e | 6f 74 20 69 6e 63 6c 75 |nix.a} n|ot inclu|
|000043c0| 64 69 6e 67 0a 66 6c 6f | 61 74 69 6e 67 20 70 6f |ding.flo|ating po|
|000043d0| 69 6e 74 20 73 75 70 70 | 6f 72 74 20 61 6e 64 20 |int supp|ort and |
|000043e0| 6f 6e 65 20 69 6e 20 40 | 73 61 6d 70 7b 6c 69 62 |one in @|samp{lib|
|000043f0| 6d 2e 61 7d 20 69 6e 63 | 6c 75 64 69 6e 67 20 66 |m.a} inc|luding f|
|00004400| 6c 6f 61 74 69 6e 67 0a | 70 6f 69 6e 74 20 73 75 |loating.|point su|
|00004410| 70 70 6f 72 74 2e 0a 0a | 53 6f 20 69 66 20 79 6f |pport...|So if yo|
|00004420| 75 20 77 61 6e 74 20 74 | 6f 20 75 73 65 20 6f 6e |u want t|o use on|
|00004430| 65 20 6f 66 20 74 68 65 | 20 66 6f 72 6d 61 74 74 |e of the| formatt|
|00004440| 65 64 20 49 2f 4f 20 73 | 70 65 63 69 66 69 65 72 |ed I/O s|pecifier|
|00004450| 73 20 66 6f 72 20 66 6c | 6f 61 74 73 0a 79 6f 75 |s for fl|oats.you|
|00004460| 20 73 68 6f 75 6c 64 20 | 6c 69 6e 6b 20 77 69 74 | should |link wit|
|00004470| 68 20 74 68 65 20 6d 61 | 74 68 20 6c 69 62 72 61 |h the ma|th libra|
|00004480| 72 79 20 40 73 61 6d 70 | 7b 2d 6c 6d 7d 2e 0a 40 |ry @samp|{-lm}..@|
|00004490| 65 6e 64 20 69 74 65 6d | 69 7a 65 0a 0a 40 6e 6f |end item|ize..@no|
|000044a0| 64 65 20 61 74 6f 66 20 | 73 74 72 74 6f 64 2c 4d |de atof |strtod,M|
|000044b0| 65 6d 6f 72 79 20 6d 61 | 6e 61 67 65 6d 65 6e 74 |emory ma|nagement|
|000044c0| 2c 46 6f 72 6d 61 74 74 | 65 64 20 49 2f 4f 2c 6c |,Formatt|ed I/O,l|
|000044d0| 69 62 6e 69 78 2e 61 0a | 40 63 68 61 70 74 65 72 |ibnix.a.|@chapter|
|000044e0| 20 61 74 6f 66 20 73 74 | 72 74 6f 64 0a 0a 54 68 | atof st|rtod..Th|
|000044f0| 65 20 74 77 6f 20 66 75 | 6e 63 74 69 6f 6e 73 20 |e two fu|nctions |
|00004500| 40 73 61 6d 70 7b 61 74 | 6f 66 7d 20 61 6e 64 20 |@samp{at|of} and |
|00004510| 40 73 61 6d 70 7b 73 74 | 72 74 6f 64 7d 20 72 65 |@samp{st|rtod} re|
|00004520| 71 75 69 72 65 20 61 20 | 77 6f 72 6b 69 6e 67 0a |quire a |working.|
|00004530| 40 73 61 6d 70 7b 25 66 | 7d 20 73 70 65 63 69 66 |@samp{%f|} specif|
|00004540| 69 65 72 20 69 6e 20 40 | 73 61 6d 70 7b 76 66 73 |ier in @|samp{vfs|
|00004550| 63 61 6e 66 7d 20 2d 20 | 74 68 65 72 65 66 6f 72 |canf} - |therefor|
|00004560| 65 20 74 68 65 79 0a 72 | 65 71 75 69 72 65 20 74 |e they.r|equire t|
|00004570| 68 65 20 66 6f 72 6d 61 | 74 74 65 64 20 49 2f 4f |he forma|tted I/O|
|00004580| 20 66 75 6e 63 74 69 6f | 6e 73 20 69 6e 20 74 68 | functio|ns in th|
|00004590| 65 20 6d 61 74 68 20 6c | 69 62 72 61 72 79 2e 0a |e math l|ibrary..|
|000045a0| 53 69 6e 63 65 20 40 73 | 61 6d 70 7b 6c 69 62 6d |Since @s|amp{libm|
|000045b0| 2e 61 7d 20 69 73 20 6c | 69 6e 6b 65 64 20 62 65 |.a} is l|inked be|
|000045c0| 66 6f 72 65 20 40 73 61 | 6d 70 7b 6c 69 62 6e 69 |fore @sa|mp{libni|
|000045d0| 78 2e 61 7d 20 74 68 65 | 73 65 0a 74 77 6f 20 66 |x.a} the|se.two f|
|000045e0| 75 6e 63 74 69 6f 6e 73 | 20 68 61 76 65 20 62 65 |unctions| have be|
|000045f0| 65 6e 20 67 6f 6e 65 20 | 69 6e 74 6f 20 74 68 65 |en gone |into the|
|00004600| 20 6d 61 74 68 20 6c 69 | 62 72 61 72 79 2e 0a 0a | math li|brary...|
|00004610| 40 6e 6f 64 65 20 4d 65 | 6d 6f 72 79 20 6d 61 6e |@node Me|mory man|
|00004620| 61 67 65 6d 65 6e 74 2c | 53 74 61 6e 64 61 72 64 |agement,|Standard|
|00004630| 20 49 2f 4f 2c 61 74 6f | 66 20 73 74 72 74 6f 64 | I/O,ato|f strtod|
|00004640| 2c 6c 69 62 6e 69 78 2e | 61 0a 40 63 68 61 70 74 |,libnix.|a.@chapt|
|00004650| 65 72 20 4d 65 6d 6f 72 | 79 20 6d 61 6e 61 67 65 |er Memor|y manage|
|00004660| 6d 65 6e 74 0a 0a 4d 6f | 73 74 20 6f 66 20 74 68 |ment..Mo|st of th|
|00004670| 65 20 6d 65 6d 6f 72 79 | 20 6d 61 6e 61 67 65 6d |e memory| managem|
|00004680| 65 6e 74 20 6f 66 20 74 | 68 69 73 20 6c 69 62 72 |ent of t|his libr|
|00004690| 61 72 79 20 72 75 6e 73 | 20 74 68 72 6f 75 67 68 |ary runs| through|
|000046a0| 20 6d 61 6c 6c 6f 63 28 | 29 2e 0a 4f 6e 6c 79 20 | malloc(|)..Only |
|000046b0| 74 68 65 20 63 6f 6d 6d | 61 6e 64 6c 69 6e 65 20 |the comm|andline |
|000046c0| 70 61 72 73 65 72 20 75 | 73 65 73 20 41 6c 6c 6f |parser u|ses Allo|
|000046d0| 63 56 65 63 28 29 20 2d | 20 73 6f 20 79 6f 75 20 |cVec() -| so you |
|000046e0| 63 61 6e 20 75 73 65 20 | 69 74 20 77 69 74 68 6f |can use |it witho|
|000046f0| 75 74 0a 68 61 76 69 6e | 67 20 74 68 65 20 6d 61 |ut.havin|g the ma|
|00004700| 6c 6c 6f 63 20 66 75 6e | 63 74 69 6f 6e 20 73 6f |lloc fun|ction so|
|00004710| 6d 65 77 65 72 65 20 69 | 6e 20 79 6f 75 72 20 70 |mewere i|n your p|
|00004720| 72 6f 67 72 61 6d 2e 0a | 0a 54 68 65 20 6d 65 6d |rogram..|.The mem|
|00004730| 6f 72 79 20 6d 61 6e 61 | 67 65 6d 65 6e 74 20 75 |ory mana|gement u|
|00004740| 73 65 73 20 61 20 6c 6f | 63 61 6c 20 28 74 6f 20 |ses a lo|cal (to |
|00004750| 74 68 69 73 20 74 61 73 | 6b 29 20 6d 65 6d 6f 72 |this tas|k) memor|
|00004760| 79 20 70 6f 6f 6c 20 74 | 6f 20 72 65 64 75 63 65 |y pool t|o reduce|
|00004770| 0a 6d 65 6d 6f 72 79 20 | 66 72 61 67 6d 65 6e 74 |.memory |fragment|
|00004780| 61 74 69 6f 6e 2e 20 49 | 74 20 75 73 65 73 20 74 |ation. I|t uses t|
|00004790| 68 65 20 73 79 73 74 65 | 6d 20 66 75 6e 63 74 69 |he syste|m functi|
|000047a0| 6f 6e 73 20 74 6f 20 64 | 6f 20 73 6f 20 28 6e 6f |ons to d|o so (no|
|000047b0| 74 20 74 68 65 0a 6e 65 | 77 20 70 6f 6f 6c 65 64 |t the.ne|w pooled|
|000047c0| 20 6d 65 6d 6f 72 79 20 | 66 75 6e 63 74 69 6f 6e | memory |function|
|000047d0| 73 20 62 75 74 20 6a 75 | 73 74 20 74 68 65 20 6f |s but ju|st the o|
|000047e0| 6c 64 65 72 20 41 6c 6c | 6f 63 61 74 65 28 29 2c |lder All|ocate(),|
|000047f0| 20 44 65 61 6c 6c 6f 63 | 61 74 65 28 29 20 70 61 | Dealloc|ate() pa|
|00004800| 69 72 0a 77 68 69 63 68 | 20 61 72 65 20 74 68 65 |ir.which| are the|
|00004810| 20 3c 33 2e 30 20 66 61 | 6c 6c 62 61 63 6b 20 66 | <3.0 fa|llback f|
|00004820| 6f 72 20 6c 69 62 61 6d | 69 67 61 2e 61 27 73 20 |or libam|iga.a's |
|00004830| 70 6f 6f 6c 65 64 20 6d | 65 6d 6f 72 79 20 66 75 |pooled m|emory fu|
|00004840| 6e 63 74 69 6f 6e 73 2c | 20 74 6f 6f 29 0a 73 6f |nctions,| too).so|
|00004850| 20 74 68 65 72 65 20 73 | 68 6f 75 6c 64 20 62 65 | there s|hould be|
|00004860| 20 6e 6f 20 70 72 6f 62 | 6c 65 6d 73 20 77 69 74 | no prob|lems wit|
|00004870| 68 20 69 74 20 2d 20 74 | 68 65 73 65 20 66 75 6e |h it - t|hese fun|
|00004880| 63 74 69 6f 6e 73 20 61 | 72 65 20 74 65 73 74 65 |ctions a|re teste|
|00004890| 64 20 76 65 72 79 20 67 | 6f 6f 64 2e 0a 0a 54 68 |d very g|ood...Th|
|000048a0| 65 20 64 65 66 61 75 6c | 74 20 62 6c 6f 63 6b 73 |e defaul|t blocks|
|000048b0| 69 7a 65 20 66 6f 72 20 | 6d 65 6d 6f 72 79 20 61 |ize for |memory a|
|000048c0| 6c 6c 6f 63 61 74 69 6f | 6e 73 20 69 73 20 31 36 |llocatio|ns is 16|
|000048d0| 33 38 34 20 62 79 74 65 | 73 20 2d 20 65 71 75 69 |384 byte|s - equi|
|000048e0| 76 61 6c 65 6e 74 0a 74 | 6f 20 34 20 4d 4d 55 20 |valent.t|o 4 MMU |
|000048f0| 70 61 67 65 73 2e 20 42 | 69 67 67 65 72 20 61 6c |pages. B|igger al|
|00004900| 6c 6f 63 61 74 69 6f 6e | 73 20 61 72 65 20 62 6c |location|s are bl|
|00004910| 6f 77 6e 20 75 70 20 74 | 6f 20 61 20 6d 75 6c 74 |own up t|o a mult|
|00004920| 69 70 6c 65 20 6f 66 20 | 34 30 39 36 20 62 79 74 |iple of |4096 byt|
|00004930| 65 73 2e 0a 53 6f 20 64 | 6f 6e 27 74 20 62 65 20 |es..So d|on't be |
|00004940| 61 6c 61 72 6d 65 64 20 | 69 66 20 79 6f 75 72 20 |alarmed |if your |
|00004950| 70 72 6f 67 72 61 6d 20 | 75 73 65 73 20 6d 6f 72 |program |uses mor|
|00004960| 65 20 6d 65 6d 6f 72 79 | 20 74 68 65 6e 20 65 78 |e memory| then ex|
|00004970| 70 65 63 74 65 64 2e 0a | 0a 49 66 20 79 6f 75 20 |pected..|.If you |
|00004980| 64 6f 6e 27 74 20 6c 69 | 6b 65 20 74 68 69 73 20 |don't li|ke this |
|00004990| 76 61 6c 75 65 20 28 69 | 66 20 79 6f 75 20 75 73 |value (i|f you us|
|000049a0| 65 20 62 69 67 67 65 72 | 20 70 6f 72 74 69 6f 6e |e bigger| portion|
|000049b0| 73 20 66 72 65 71 75 65 | 6e 74 6c 79 20 6f 72 20 |s freque|ntly or |
|000049c0| 6f 6e 6c 79 0a 75 73 65 | 20 76 65 72 79 20 6c 69 |only.use| very li|
|000049d0| 74 74 6c 65 20 6d 65 6d | 6f 72 79 29 20 79 6f 75 |ttle mem|ory) you|
|000049e0| 20 63 61 6e 20 72 65 70 | 6c 61 63 65 20 69 74 20 | can rep|lace it |
|000049f0| 62 79 20 64 65 63 6c 61 | 72 69 6e 67 0a 0a 40 63 |by decla|ring..@c|
|00004a00| 6f 64 65 7b 75 6e 73 69 | 67 6e 65 64 20 6c 6f 6e |ode{unsi|gned lon|
|00004a10| 67 20 5f 4d 53 54 45 50 | 7d 0a 0a 59 6f 75 20 73 |g _MSTEP|}..You s|
|00004a20| 68 6f 75 6c 64 20 75 73 | 65 20 61 20 6d 75 6c 74 |hould us|e a mult|
|00004a30| 69 70 6c 65 20 6f 66 20 | 4d 4d 55 20 70 61 67 65 |iple of |MMU page|
|00004a40| 73 2e 20 49 66 20 79 6f | 75 20 64 6f 6e 27 74 20 |s. If yo|u don't |
|00004a50| 75 73 65 20 61 20 66 75 | 6c 6c 20 4d 4d 55 20 70 |use a fu|ll MMU p|
|00004a60| 61 67 65 0a 79 6f 75 20 | 67 61 69 6e 20 6e 6f 74 |age.you |gain not|
|00004a70| 68 69 6e 67 20 2d 20 6d | 61 6c 6c 6f 63 20 72 6f |hing - m|alloc ro|
|00004a80| 75 6e 64 73 20 75 70 20 | 61 6e 79 77 61 79 2e 0a |unds up |anyway..|
|00004a90| 0a 40 6e 6f 64 65 20 53 | 74 61 6e 64 61 72 64 20 |.@node S|tandard |
|00004aa0| 49 2f 4f 2c 53 69 67 6e | 61 6c 20 68 61 6e 64 6c |I/O,Sign|al handl|
|00004ab0| 69 6e 67 2c 4d 65 6d 6f | 72 79 20 6d 61 6e 61 67 |ing,Memo|ry manag|
|00004ac0| 65 6d 65 6e 74 2c 6c 69 | 62 6e 69 78 2e 61 0a 40 |ement,li|bnix.a.@|
|00004ad0| 63 68 61 70 74 65 72 20 | 53 74 61 6e 64 61 72 64 |chapter |Standard|
|00004ae0| 20 49 2f 4f 20 2d 20 77 | 68 65 72 65 20 73 74 64 | I/O - w|here std|
|00004af0| 69 6e 2c 20 73 74 64 6f | 75 74 2c 20 73 74 64 65 |in, stdo|ut, stde|
|00004b00| 72 72 20 63 6f 6d 65 20 | 66 72 6f 6d 0a 0a 32 20 |rr come |from..2 |
|00004b10| 6f 66 20 74 68 65 20 33 | 20 73 74 61 6e 64 61 72 |of the 3| standar|
|00004b20| 64 20 49 2f 4f 20 73 74 | 72 65 61 6d 73 20 61 72 |d I/O st|reams ar|
|00004b30| 65 20 6e 6f 20 72 65 61 | 6c 20 70 72 6f 62 6c 65 |e no rea|l proble|
|00004b40| 6d 3a 0a 0a 40 69 74 65 | 6d 69 7a 65 20 40 62 75 |m:..@ite|mize @bu|
|00004b50| 6c 6c 65 74 0a 40 69 74 | 65 6d 0a 40 73 61 6d 70 |llet.@it|em.@samp|
|00004b60| 7b 73 74 64 69 6e 7d 20 | 69 73 20 73 65 74 20 74 |{stdin} |is set t|
|00004b70| 6f 20 74 68 65 20 76 61 | 6c 75 65 20 74 68 65 20 |o the va|lue the |
|00004b80| 40 73 61 6d 70 7b 49 6e | 70 75 74 28 29 7d 20 66 |@samp{In|put()} f|
|00004b90| 75 6e 63 74 69 6f 6e 20 | 6f 66 20 40 73 61 6d 70 |unction |of @samp|
|00004ba0| 7b 64 6f 73 2e 6c 69 62 | 72 61 72 79 7d 0a 73 65 |{dos.lib|rary}.se|
|00004bb0| 72 76 65 73 2c 0a 40 69 | 74 65 6d 0a 40 73 61 6d |rves,.@i|tem.@sam|
|00004bc0| 70 7b 73 74 64 6f 75 74 | 7d 20 69 73 20 73 65 74 |p{stdout|} is set|
|00004bd0| 20 74 6f 20 74 68 65 20 | 40 73 61 6d 70 7b 4f 75 | to the |@samp{Ou|
|00004be0| 74 70 75 74 28 29 7d 20 | 76 61 6c 75 65 2e 0a 40 |tput()} |value..@|
|00004bf0| 65 6e 64 20 69 74 65 6d | 69 7a 65 0a 0a 42 6f 74 |end item|ize..Bot|
|00004c00| 68 20 73 74 72 65 61 6d | 73 20 61 72 65 20 6d 61 |h stream|s are ma|
|00004c10| 6e 61 67 65 64 20 62 79 | 20 74 68 65 20 4f 53 20 |naged by| the OS |
|00004c20| 61 6e 64 20 74 68 65 20 | 6c 69 62 72 61 72 79 20 |and the |library |
|00004c30| 6e 65 65 64 20 6e 6f 74 | 20 74 61 6b 65 20 6d 75 |need not| take mu|
|00004c40| 63 68 0a 63 61 72 65 20 | 61 62 6f 75 74 20 74 68 |ch.care |about th|
|00004c50| 65 6d 2e 20 42 75 74 20 | 40 73 61 6d 70 7b 73 74 |em. But |@samp{st|
|00004c60| 64 65 72 72 7d 20 69 73 | 20 61 20 64 69 66 66 65 |derr} is| a diffe|
|00004c70| 72 65 6e 74 20 74 68 69 | 6e 67 20 73 69 6e 63 65 |rent thi|ng since|
|00004c80| 0a 74 68 65 72 65 20 69 | 73 20 6e 6f 20 40 73 61 |.there i|s no @sa|
|00004c90| 6d 70 7b 45 72 72 70 75 | 74 28 29 7d 20 3b 2d 29 |mp{Errpu|t()} ;-)|
|00004ca0| 20 66 75 6e 63 74 69 6f | 6e 2e 20 53 6f 20 40 73 | functio|n. So @s|
|00004cb0| 61 6d 70 7b 73 74 64 65 | 72 72 7d 20 69 73 20 68 |amp{stde|rr} is h|
|00004cc0| 61 6e 64 6c 65 64 0a 61 | 73 20 66 6f 6c 6c 6f 77 |andled.a|s follow|
|00004cd0| 73 3a 0a 0a 40 65 6e 75 | 6d 65 72 61 74 65 0a 40 |s:..@enu|merate.@|
|00004ce0| 69 74 65 6d 0a 49 66 20 | 40 73 61 6d 70 7b 70 72 |item.If |@samp{pr|
|00004cf0| 6f 63 65 73 73 2d 3e 70 | 72 5f 43 45 53 7d 20 69 |ocess->p|r_CES} i|
|00004d00| 73 20 73 65 74 2c 20 74 | 68 69 73 20 76 61 6c 75 |s set, t|his valu|
|00004d10| 65 20 69 73 20 74 61 6b | 65 6e 2e 20 54 68 65 72 |e is tak|en. Ther|
|00004d20| 65 20 61 72 65 20 6e 6f | 74 0a 6d 75 63 68 20 73 |e are no|t.much s|
|00004d30| 68 65 6c 6c 73 20 74 68 | 61 74 20 73 65 74 20 74 |hells th|at set t|
|00004d40| 68 69 73 20 76 61 6c 75 | 65 20 73 6f 20 6d 6f 73 |his valu|e so mos|
|00004d50| 74 20 6f 66 20 74 68 65 | 20 74 69 6d 65 20 74 68 |t of the| time th|
|00004d60| 69 73 20 6c 65 61 64 73 | 20 74 6f 20 4e 55 4c 4c |is leads| to NULL|
|00004d70| 2e 0a 40 69 74 65 6d 0a | 49 66 20 74 68 69 73 20 |..@item.|If this |
|00004d80| 64 69 64 6e 27 74 20 77 | 6f 72 6b 20 61 6e 64 20 |didn't w|ork and |
|00004d90| 79 6f 75 72 20 70 72 6f | 67 72 61 6d 20 77 61 73 |your pro|gram was|
|00004da0| 20 73 74 61 72 74 65 64 | 20 66 72 6f 6d 20 43 4c | started| from CL|
|00004db0| 49 20 74 68 65 20 6c 69 | 62 72 61 72 79 0a 6f 70 |I the li|brary.op|
|00004dc0| 65 6e 73 20 40 73 61 6d | 70 7b 4f 70 65 6e 28 22 |ens @sam|p{Open("|
|00004dd0| 2a 22 2c 4d 4f 44 45 5f | 4e 45 57 46 49 4c 45 29 |*",MODE_|NEWFILE)|
|00004de0| 7d 2e 0a 54 68 69 73 20 | 6f 70 65 6e 73 20 74 68 |}..This |opens th|
|00004df0| 65 20 6c 61 73 74 20 69 | 6e 74 65 72 61 63 74 69 |e last i|nteracti|
|00004e00| 76 65 20 74 65 72 6d 69 | 6e 61 6c 20 61 74 74 61 |ve termi|nal atta|
|00004e10| 63 68 65 64 20 74 6f 20 | 73 74 64 6f 75 74 2c 20 |ched to |stdout, |
|00004e20| 69 2e 65 2e 0a 69 66 20 | 79 6f 75 20 75 73 65 20 |i.e..if |you use |
|00004e30| 74 68 65 20 6e 6f 72 6d | 61 6c 20 41 6d 69 67 61 |the norm|al Amiga|
|00004e40| 20 73 68 65 6c 6c 20 61 | 6e 64 20 72 65 64 69 72 | shell a|nd redir|
|00004e50| 65 63 74 20 79 6f 75 72 | 20 6f 75 74 70 75 74 20 |ect your| output |
|00004e60| 74 6f 20 61 20 66 69 6c | 65 20 79 6f 75 20 0a 67 |to a fil|e you .g|
|00004e70| 65 74 20 74 68 65 20 74 | 65 72 6d 69 6e 61 6c 2c |et the t|erminal,|
|00004e80| 20 69 66 20 79 6f 75 20 | 72 65 64 69 72 65 63 74 | if you |redirect|
|00004e90| 20 79 6f 75 72 20 6f 75 | 74 70 75 74 20 74 6f 20 | your ou|tput to |
|00004ea0| 40 73 61 6d 70 7b 4e 49 | 4c 3a 7d 20 79 6f 75 20 |@samp{NI|L:} you |
|00004eb0| 67 65 74 20 40 73 61 6d | 70 7b 4e 49 4c 3a 7d 2e |get @sam|p{NIL:}.|
|00004ec0| 0a 40 69 74 65 6d 0a 49 | 66 20 74 68 69 73 20 64 |.@item.I|f this d|
|00004ed0| 69 64 6e 27 74 20 77 6f | 72 6b 20 74 6f 6f 20 28 |idn't wo|rk too (|
|00004ee0| 79 6f 75 20 6e 65 76 65 | 72 20 6b 6e 6f 77 29 20 |you neve|r know) |
|00004ef0| 6f 72 20 79 6f 75 72 20 | 70 72 6f 67 72 61 6d 20 |or your |program |
|00004f00| 77 61 73 20 73 74 61 72 | 74 65 64 20 66 72 6f 6d |was star|ted from|
|00004f10| 20 57 42 0a 79 6f 75 20 | 73 69 6d 70 6c 79 20 67 | WB.you |simply g|
|00004f20| 65 74 20 74 68 65 20 73 | 61 6d 65 20 73 74 72 65 |et the s|ame stre|
|00004f30| 61 6d 20 61 73 20 69 6e | 20 40 73 61 6d 70 7b 73 |am as in| @samp{s|
|00004f40| 74 64 6f 75 74 7d 2e 0a | 40 65 6e 64 20 65 6e 75 |tdout}..|@end enu|
|00004f50| 6d 65 72 61 74 65 0a 0a | 40 6e 6f 64 65 20 53 69 |merate..|@node Si|
|00004f60| 67 6e 61 6c 20 68 61 6e | 64 6c 69 6e 67 2c 73 65 |gnal han|dling,se|
|00004f70| 74 6a 6d 70 20 6c 6f 6e | 67 6a 6d 70 2c 53 74 61 |tjmp lon|gjmp,Sta|
|00004f80| 6e 64 61 72 64 20 49 2f | 4f 2c 6c 69 62 6e 69 78 |ndard I/|O,libnix|
|00004f90| 2e 61 0a 40 63 68 61 70 | 74 65 72 20 53 69 67 6e |.a.@chap|ter Sign|
|00004fa0| 61 6c 20 68 61 6e 64 6c | 69 6e 67 0a 0a 54 68 65 |al handl|ing..The|
|00004fb0| 72 65 20 69 73 20 6f 6e | 6c 79 20 73 75 70 70 6f |re is on|ly suppo|
|00004fc0| 72 74 20 66 6f 72 20 74 | 68 65 20 74 77 6f 20 73 |rt for t|he two s|
|00004fd0| 69 67 6e 61 6c 73 20 53 | 49 47 41 42 52 54 20 61 |ignals S|IGABRT a|
|00004fe0| 6e 64 20 53 49 47 49 4e | 54 2e 20 54 68 65 20 6c |nd SIGIN|T. The l|
|00004ff0| 69 62 72 61 72 79 0a 6b | 6e 6f 77 73 20 6f 66 20 |ibrary.k|nows of |
|00005000| 73 6f 6d 65 20 6f 74 68 | 65 72 20 73 69 67 6e 61 |some oth|er signa|
|00005010| 6c 73 20 62 75 74 20 63 | 61 6e 6e 6f 74 20 67 65 |ls but c|annot ge|
|00005020| 6e 65 72 61 74 65 20 74 | 68 65 6d 2e 20 54 68 65 |nerate t|hem. The|
|00005030| 20 73 75 70 70 6f 72 74 | 20 66 6f 72 0a 53 49 47 | support| for.SIG|
|00005040| 41 42 52 54 20 69 73 20 | 73 69 6d 70 6c 65 20 2d |ABRT is |simple -|
|00005050| 20 62 75 74 20 53 49 47 | 49 4e 54 20 69 73 20 61 | but SIG|INT is a|
|00005060| 20 63 6f 6d 70 6c 65 74 | 65 6c 79 20 64 69 66 66 | complet|ely diff|
|00005070| 65 72 65 6e 74 20 74 68 | 69 6e 67 3a 0a 0a 59 6f |erent th|ing:..Yo|
|00005080| 75 20 63 61 6e 6e 6f 74 | 20 75 73 65 20 65 78 65 |u cannot| use exe|
|00005090| 63 20 73 69 67 6e 61 6c | 20 68 61 6e 64 6c 65 72 |c signal| handler|
|000050a0| 73 20 73 69 6e 63 65 20 | 74 68 65 79 20 61 72 65 |s since |they are|
|000050b0| 20 63 61 6c 6c 65 64 20 | 61 74 20 61 6e 79 20 74 | called |at any t|
|000050c0| 69 6d 65 20 2d 0a 65 76 | 65 6e 20 69 6e 20 74 68 |ime -.ev|en in th|
|000050d0| 65 20 6d 69 64 64 6c 65 | 20 6f 66 20 61 20 6c 69 |e middle| of a li|
|000050e0| 62 72 61 72 79 20 63 61 | 6c 6c 2e 20 41 6e 64 20 |brary ca|ll. And |
|000050f0| 69 66 20 79 6f 75 72 20 | 6c 69 62 72 61 72 79 20 |if your |library |
|00005100| 6a 75 73 74 20 62 6c 6f | 63 6b 65 64 0a 61 20 70 |just blo|cked.a p|
|00005110| 72 69 76 61 74 65 20 73 | 65 6d 61 70 68 6f 72 65 |rivate s|emaphore|
|00005120| 20 61 6e 64 20 79 6f 75 | 20 6a 75 6d 70 20 6f 75 | and you| jump ou|
|00005130| 74 20 6f 66 20 74 68 65 | 20 6c 69 62 72 61 72 79 |t of the| library|
|00005140| 20 63 6f 64 65 20 79 6f | 75 20 77 69 6c 6c 20 67 | code yo|u will g|
|00005150| 65 74 20 61 20 6e 69 63 | 65 0a 64 65 61 64 6c 6f |et a nic|e.deadlo|
|00005160| 63 6b 20 3a 2d 28 2e 20 | 28 41 6e 64 20 66 6f 72 |ck :-(. |(And for|
|00005170| 20 70 65 6f 70 6c 65 20 | 77 68 6f 20 64 6f 6e 27 | people |who don'|
|00005180| 74 20 6b 6e 6f 77 3a 20 | 73 69 67 6e 61 6c 20 68 |t know: |signal h|
|00005190| 61 6e 64 6c 65 72 73 20 | 61 72 65 20 62 6f 67 75 |andlers |are bogu|
|000051a0| 73 0a 75 70 74 6f 20 4f | 53 20 32 2e 30 20 28 65 |s.upto O|S 2.0 (e|
|000051b0| 76 65 6e 20 74 68 65 72 | 65 20 79 6f 75 20 6e 65 |ven ther|e you ne|
|000051c0| 65 64 20 61 20 67 6f 6f | 64 20 73 65 74 70 61 74 |ed a goo|d setpat|
|000051d0| 63 68 29 29 2e 0a 0a 53 | 6f 20 53 49 47 49 4e 54 |ch))...S|o SIGINT|
|000051e0| 20 28 43 54 52 4c 2d 43 | 29 20 69 73 20 6a 75 73 | (CTRL-C|) is jus|
|000051f0| 74 20 70 6f 6c 6c 65 64 | 20 61 74 20 74 68 65 20 |t polled| at the |
|00005200| 73 74 61 72 74 20 6f 66 | 20 6d 6f 73 74 20 49 2f |start of| most I/|
|00005210| 4f 2d 66 75 6e 63 74 69 | 6f 6e 73 20 62 79 0a 63 |O-functi|ons by.c|
|00005220| 61 6c 6c 69 6e 67 20 74 | 68 65 20 66 75 6e 63 74 |alling t|he funct|
|00005230| 69 6f 6e 20 0a 0a 40 63 | 6f 64 65 7b 76 6f 69 64 |ion ..@c|ode{void|
|00005240| 20 5f 5f 63 68 6b 61 62 | 6f 72 74 28 76 6f 69 64 | __chkab|ort(void|
|00005250| 29 7d 0a 0a 4f 74 68 65 | 72 20 73 69 67 6e 61 6c |)}..Othe|r signal|
|00005260| 73 20 61 72 65 20 65 76 | 65 6e 20 6d 6f 72 65 20 |s are ev|en more |
|00005270| 64 69 66 66 69 63 75 6c | 74 20 74 6f 20 69 6d 70 |difficul|t to imp|
|00005280| 6c 65 6d 65 6e 74 3a 0a | 0a 40 69 74 65 6d 69 7a |lement:.|.@itemiz|
|00005290| 65 20 40 62 75 6c 6c 65 | 74 0a 40 69 74 65 6d 0a |e @bulle|t.@item.|
|000052a0| 53 49 47 53 45 47 56 20 | 73 69 6d 70 6c 79 20 64 |SIGSEGV |simply d|
|000052b0| 6f 65 73 6e 27 74 20 65 | 78 69 73 74 20 2d 20 61 |oesn't e|xist - a|
|000052c0| 6e 64 20 69 66 20 69 74 | 20 64 6f 65 73 20 69 74 |nd if it| does it|
|000052d0| 27 73 20 64 75 65 0a 74 | 6f 20 61 20 56 4d 20 73 |'s due.t|o a VM s|
|000052e0| 79 73 74 65 6d 20 61 6e | 64 20 73 68 6f 75 6c 64 |ystem an|d should|
|000052f0| 20 6e 6f 74 20 62 65 20 | 67 65 6e 65 72 61 74 65 | not be |generate|
|00005300| 64 2e 0a 40 69 74 65 6d | 0a 53 49 47 46 50 45 20 |d..@item|.SIGFPE |
|00005310| 69 73 20 6e 6f 74 20 67 | 65 6e 65 72 61 74 65 64 |is not g|enerated|
|00005320| 20 62 79 20 74 68 65 20 | 6d 61 74 68 20 6c 69 62 | by the |math lib|
|00005330| 72 61 72 69 65 73 20 2d | 20 73 6f 20 69 74 20 77 |raries -| so it w|
|00005340| 6f 75 6c 64 0a 62 65 20 | 61 20 62 61 64 20 74 68 |ould.be |a bad th|
|00005350| 69 6e 67 20 74 6f 20 67 | 65 6e 65 72 61 74 65 20 |ing to g|enerate |
|00005360| 69 74 20 62 79 20 74 68 | 65 20 6d 61 74 68 65 6d |it by th|e mathem|
|00005370| 61 74 69 63 61 6c 20 63 | 6f 70 72 6f 63 65 73 73 |atical c|oprocess|
|00005380| 6f 72 2e 0a 40 69 74 65 | 6d 0a 53 49 47 49 4c 4c |or..@ite|m.SIGILL|
|00005390| 20 73 68 6f 75 6c 64 20 | 6e 65 76 65 72 20 68 61 | should |never ha|
|000053a0| 70 70 65 6e 20 2d 20 79 | 6f 75 72 20 70 72 6f 67 |ppen - y|our prog|
|000053b0| 72 61 6d 20 6d 75 73 74 | 20 62 65 20 66 61 75 6c |ram must| be faul|
|000053c0| 74 79 20 69 66 20 79 6f | 75 20 67 65 74 20 6f 6e |ty if yo|u get on|
|000053d0| 65 2e 0a 4d 6f 73 74 20 | 6f 66 20 74 68 65 20 74 |e..Most |of the t|
|000053e0| 69 6d 65 20 74 68 69 73 | 20 68 61 70 70 65 6e 73 |ime this| happens|
|000053f0| 20 69 66 20 79 6f 75 20 | 74 72 79 20 74 6f 20 72 | if you |try to r|
|00005400| 75 6e 20 61 20 36 38 30 | 32 30 2b 20 63 6f 6d 70 |un a 680|20+ comp|
|00005410| 69 6c 65 64 20 70 72 6f | 67 72 61 6d 0a 6f 6e 20 |iled pro|gram.on |
|00005420| 61 20 70 6c 61 69 6e 20 | 36 38 30 30 30 2e 0a 40 |a plain |68000..@|
|00005430| 69 74 65 6d 0a 53 49 47 | 54 45 52 4d 20 63 6f 75 |item.SIG|TERM cou|
|00005440| 6c 64 6e 27 74 20 62 65 | 20 64 69 73 61 62 6c 65 |ldn't be| disable|
|00005450| 64 20 2d 20 65 76 65 6e | 20 69 66 20 69 74 20 77 |d - even| if it w|
|00005460| 61 73 20 74 68 65 72 65 | 20 3b 2d 29 2e 0a 40 65 |as there| ;-)..@e|
|00005470| 6e 64 20 69 74 65 6d 69 | 7a 65 0a 0a 59 6f 75 20 |nd itemi|ze..You |
|00005480| 63 61 6e 20 64 69 73 61 | 62 6c 65 20 43 54 52 4c |can disa|ble CTRL|
|00005490| 2d 43 20 68 61 6e 64 6c | 69 6e 67 20 62 79 20 72 |-C handl|ing by r|
|000054a0| 65 70 6c 61 63 69 6e 67 | 20 40 73 61 6d 70 7b 5f |eplacing| @samp{_|
|000054b0| 5f 63 68 6b 61 62 6f 72 | 74 7d 20 77 69 74 68 20 |_chkabor|t} with |
|000054c0| 61 20 64 6f 2d 6e 6f 74 | 68 69 6e 67 20 0a 73 74 |a do-not|hing .st|
|000054d0| 75 62 20 66 75 6e 63 74 | 69 6f 6e 20 2d 20 62 75 |ub funct|ion - bu|
|000054e0| 74 20 74 68 65 72 65 20 | 69 73 20 61 20 62 65 74 |t there |is a bet|
|000054f0| 74 65 72 20 77 61 79 2e | 20 4a 75 73 74 20 63 61 |ter way.| Just ca|
|00005500| 6c 6c 0a 0a 40 63 6f 64 | 65 7b 73 69 67 6e 61 6c |ll..@cod|e{signal|
|00005510| 28 53 49 47 49 4e 54 2c | 53 49 47 5f 49 47 4e 29 |(SIGINT,|SIG_IGN)|
|00005520| 7d 0a 0a 52 65 70 6c 61 | 63 69 6e 67 20 5f 5f 63 |}..Repla|cing __c|
|00005530| 68 6b 61 62 6f 72 74 20 | 69 73 20 75 73 65 64 20 |hkabort |is used |
|00005540| 76 65 72 79 20 6f 66 74 | 65 6e 20 62 79 20 61 6d |very oft|en by am|
|00005550| 69 67 61 2d 70 72 6f 67 | 72 61 6d 73 20 61 6e 64 |iga-prog|rams and|
|00005560| 20 69 66 0a 79 6f 75 72 | 20 61 70 70 6c 69 63 61 | if.your| applica|
|00005570| 74 69 6f 6e 20 64 6f 65 | 73 20 6e 6f 74 20 6e 65 |tion doe|s not ne|
|00005580| 65 64 20 43 54 52 4c 2d | 43 20 68 61 6e 64 6c 69 |ed CTRL-|C handli|
|00005590| 6e 67 20 61 74 20 61 6c | 6c 20 61 6e 64 20 69 73 |ng at al|l and is|
|000055a0| 0a 61 6d 69 67 61 20 73 | 70 65 63 69 66 69 63 20 |.amiga s|pecific |
|000055b0| 79 6f 75 20 63 61 6e 20 | 75 73 65 20 74 68 69 73 |you can |use this|
|000055c0| 2e 20 54 68 65 20 73 65 | 63 6f 6e 64 20 6d 65 74 |. The se|cond met|
|000055d0| 68 6f 64 20 69 73 20 74 | 68 65 0a 41 4e 53 49 20 |hod is t|he.ANSI |
|000055e0| 73 74 61 6e 64 61 72 64 | 20 6d 65 74 68 6f 64 20 |standard| method |
|000055f0| 61 6e 64 20 77 6f 72 6b | 73 20 6f 6e 20 61 6c 6c |and work|s on all|
|00005600| 20 74 79 70 65 73 20 6f | 66 20 6d 61 63 68 69 6e | types o|f machin|
|00005610| 65 73 2e 0a 0a 40 6e 6f | 64 65 20 73 65 74 6a 6d |es...@no|de setjm|
|00005620| 70 20 6c 6f 6e 67 6a 6d | 70 2c 63 74 79 70 65 2c |p longjm|p,ctype,|
|00005630| 53 69 67 6e 61 6c 20 68 | 61 6e 64 6c 69 6e 67 2c |Signal h|andling,|
|00005640| 6c 69 62 6e 69 78 2e 61 | 0a 40 63 68 61 70 74 65 |libnix.a|.@chapte|
|00005650| 72 20 73 65 74 6a 6d 70 | 2c 20 6c 6f 6e 67 6a 6d |r setjmp|, longjm|
|00005660| 70 0a 0a 54 68 69 73 20 | 6c 69 62 72 61 72 79 20 |p..This |library |
|00005670| 69 73 20 63 6f 6d 70 61 | 74 69 62 6c 65 20 74 6f |is compa|tible to|
|00005680| 20 74 68 65 20 68 65 61 | 64 65 72 20 66 69 6c 65 | the hea|der file|
|00005690| 73 20 74 68 61 74 20 63 | 6f 6d 65 20 77 69 74 68 |s that c|ome with|
|000056a0| 20 67 63 63 20 2d 0a 61 | 6e 64 20 74 68 65 20 6a | gcc -.a|nd the j|
|000056b0| 6d 70 5f 62 75 66 20 69 | 6e 20 74 68 65 72 65 20 |mp_buf i|n there |
|000056c0| 69 73 20 6e 6f 74 20 6c | 61 72 67 65 20 65 6e 6f |is not l|arge eno|
|000056d0| 75 67 68 20 66 6f 72 20 | 74 68 65 20 46 50 55 20 |ugh for |the FPU |
|000056e0| 72 65 67 69 73 74 65 72 | 73 2e 0a 53 6f 20 74 68 |register|s..So th|
|000056f0| 65 79 20 61 72 65 20 6e | 6f 74 20 72 65 73 74 6f |ey are n|ot resto|
|00005700| 72 65 64 21 20 54 68 65 | 20 41 4e 53 49 20 73 74 |red! The| ANSI st|
|00005710| 61 6e 64 61 72 64 20 64 | 6f 65 73 6e 27 74 20 65 |andard d|oesn't e|
|00005720| 76 65 6e 20 72 65 71 75 | 69 72 65 20 74 6f 0a 72 |ven requ|ire to.r|
|00005730| 65 73 74 6f 72 65 20 61 | 6e 79 20 6f 66 20 74 68 |estore a|ny of th|
|00005740| 65 20 6f 74 68 65 72 20 | 6c 6f 63 61 6c 20 76 61 |e other |local va|
|00005750| 72 69 61 62 6c 65 73 20 | 28 74 68 65 79 20 61 72 |riables |(they ar|
|00005760| 65 20 72 65 73 74 6f 72 | 65 64 20 3a 2d 29 20 29 |e restor|ed :-) )|
|00005770| 2c 0a 73 6f 20 74 68 69 | 73 20 69 73 20 4e 4f 20 |,.so thi|s is NO |
|00005780| 69 6e 63 6f 6d 70 61 74 | 69 62 69 6c 69 74 79 20 |incompat|ibility |
|00005790| 74 6f 20 74 68 65 20 41 | 4e 53 49 20 73 74 61 6e |to the A|NSI stan|
|000057a0| 64 61 72 64 2e 0a 0a 40 | 6e 6f 64 65 20 63 74 79 |dard...@|node cty|
|000057b0| 70 65 2c 63 6c 6f 63 6b | 2c 73 65 74 6a 6d 70 20 |pe,clock|,setjmp |
|000057c0| 6c 6f 6e 67 6a 6d 70 2c | 6c 69 62 6e 69 78 2e 61 |longjmp,|libnix.a|
|000057d0| 0a 40 63 68 61 70 74 65 | 72 20 63 74 79 70 65 2e |.@chapte|r ctype.|
|000057e0| 68 20 66 75 6e 63 74 69 | 6f 6e 73 0a 0a 49 66 20 |h functi|ons..If |
|000057f0| 79 6f 75 20 6c 6f 6f 6b | 20 69 6e 74 6f 20 63 74 |you look| into ct|
|00005800| 79 70 65 2e 68 20 79 6f | 75 20 77 69 6c 6c 20 73 |ype.h yo|u will s|
|00005810| 65 65 20 74 68 61 74 20 | 74 68 65 20 66 75 6e 63 |ee that |the func|
|00005820| 74 69 6f 6e 73 20 69 6e | 20 74 68 65 72 65 20 61 |tions in| there a|
|00005830| 72 65 0a 6a 75 73 74 20 | 6d 61 63 72 6f 73 20 2d |re.just |macros -|
|00005840| 20 61 6e 64 20 74 68 61 | 74 20 74 68 65 79 20 61 | and tha|t they a|
|00005850| 72 65 20 64 75 70 6c 69 | 63 61 74 65 20 69 6e 20 |re dupli|cate in |
|00005860| 74 68 65 20 6c 69 62 72 | 61 72 79 20 61 73 20 66 |the libr|ary as f|
|00005870| 75 6e 63 74 69 6f 6e 73 | 2e 0a 54 68 69 73 20 69 |unctions|..This i|
|00005880| 73 20 4e 4f 54 20 61 20 | 6d 69 73 74 61 6b 65 2e |s NOT a |mistake.|
|00005890| 20 54 68 65 20 41 4e 53 | 49 20 73 74 61 6e 64 61 | The ANS|I standa|
|000058a0| 72 64 20 72 65 71 75 69 | 72 65 73 20 73 75 63 68 |rd requi|res such|
|000058b0| 20 6d 61 63 72 6f 73 20 | 74 6f 20 62 65 0a 64 75 | macros |to be.du|
|000058c0| 70 6c 69 63 61 74 65 20 | 61 73 20 66 75 6e 63 74 |plicate |as funct|
|000058d0| 69 6f 6e 73 2e 0a 0a 41 | 6e 64 20 72 65 6d 65 6d |ions...A|nd remem|
|000058e0| 62 65 72 3a 20 54 68 65 | 73 65 20 66 75 6e 63 74 |ber: The|se funct|
|000058f0| 69 6f 6e 73 20 61 72 65 | 20 61 66 66 65 63 74 65 |ions are| affecte|
|00005900| 64 20 62 79 20 74 68 65 | 20 73 65 74 6c 6f 63 61 |d by the| setloca|
|00005910| 6c 65 28 29 20 63 61 6c | 6c 2e 0a 0a 40 6e 6f 64 |le() cal|l...@nod|
|00005920| 65 20 63 6c 6f 63 6b 2c | 4d 75 6c 74 69 62 79 74 |e clock,|Multibyt|
|00005930| 65 20 63 68 61 72 61 63 | 74 65 72 20 66 75 6e 63 |e charac|ter func|
|00005940| 74 69 6f 6e 73 2c 63 74 | 79 70 65 2c 6c 69 62 6e |tions,ct|ype,libn|
|00005950| 69 78 2e 61 0a 40 63 68 | 61 70 74 65 72 20 54 68 |ix.a.@ch|apter Th|
|00005960| 65 20 63 6c 6f 63 6b 20 | 66 75 6e 63 74 69 6f 6e |e clock |function|
|00005970| 0a 0a 54 68 65 20 63 6c | 6f 63 6b 28 29 20 66 75 |..The cl|ock() fu|
|00005980| 6e 63 74 69 6f 6e 27 73 | 20 77 6f 72 6b 20 69 73 |nction's| work is|
|00005990| 20 74 6f 20 6d 65 61 73 | 75 72 65 20 70 72 6f 63 | to meas|ure proc|
|000059a0| 65 73 73 6f 72 20 74 69 | 6d 65 20 66 6f 72 20 74 |essor ti|me for t|
|000059b0| 68 65 20 73 70 65 63 69 | 66 69 63 0a 74 61 73 6b |he speci|fic.task|
|000059c0| 20 2d 20 62 75 74 20 74 | 68 65 72 65 20 69 73 20 | - but t|here is |
|000059d0| 6e 6f 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 6c |no infor|mation l|
|000059e0| 69 6b 65 20 74 68 69 73 | 20 69 6e 20 74 68 65 20 |ike this| in the |
|000059f0| 61 6d 69 67 61 20 4f 53 | 20 3a 2d 28 2e 0a 53 6f |amiga OS| :-(..So|
|00005a00| 20 69 74 20 6a 75 73 74 | 20 6d 65 61 73 75 72 65 | it just| measure|
|00005a10| 73 20 74 68 65 20 74 69 | 6d 65 20 66 72 6f 6d 20 |s the ti|me from |
|00005a20| 70 72 6f 67 72 61 6d 20 | 73 74 61 72 74 20 6f 6e |program |start on|
|00005a30| 20 2d 20 61 6e 64 20 69 | 73 20 63 6f 6d 70 61 74 | - and i|s compat|
|00005a40| 69 62 6c 65 20 77 69 74 | 68 0a 74 68 69 73 20 62 |ible wit|h.this b|
|00005a50| 65 68 61 76 69 6f 75 72 | 20 74 6f 20 61 6c 6c 20 |ehaviour| to all |
|00005a60| 73 69 6e 67 6c 65 20 74 | 61 73 6b 69 6e 67 20 4f |single t|asking O|
|00005a70| 53 73 20 61 72 6f 75 6e | 64 2e 0a 0a 40 6e 6f 64 |Ss aroun|d...@nod|
|00005a80| 65 20 4d 75 6c 74 69 62 | 79 74 65 20 63 68 61 72 |e Multib|yte char|
|00005a90| 61 63 74 65 72 20 66 75 | 6e 63 74 69 6f 6e 73 2c |acter fu|nctions,|
|00005aa0| 2c 63 6c 6f 63 6b 2c 6c | 69 62 6e 69 78 2e 61 0a |,clock,l|ibnix.a.|
|00005ab0| 40 63 68 61 70 74 65 72 | 20 4d 75 6c 74 69 62 79 |@chapter| Multiby|
|00005ac0| 74 65 20 63 68 61 72 61 | 63 74 65 72 20 66 75 6e |te chara|cter fun|
|00005ad0| 63 74 69 6f 6e 73 0a 0a | 54 68 65 20 6d 75 6c 74 |ctions..|The mult|
|00005ae0| 69 62 79 74 65 20 63 68 | 61 72 61 63 74 65 72 20 |ibyte ch|aracter |
|00005af0| 66 75 6e 63 74 69 6f 6e | 73 20 61 72 65 20 61 6c |function|s are al|
|00005b00| 6c 20 74 68 65 72 65 20 | 2d 20 62 75 74 20 73 69 |l there |- but si|
|00005b10| 6e 63 65 20 74 68 65 0a | 41 6d 69 67 61 20 4f 53 |nce the.|Amiga OS|
|00005b20| 20 75 73 65 73 20 6e 6f | 20 6f 74 68 65 72 20 63 | uses no| other c|
|00005b30| 68 61 72 61 63 74 65 72 | 20 73 65 74 20 74 68 61 |haracter| set tha|
|00005b40| 6e 20 45 43 4d 41 20 4c | 61 74 69 6e 20 49 20 74 |n ECMA L|atin I t|
|00005b50| 68 65 79 20 73 69 6d 75 | 6c 61 74 65 0a 6a 75 73 |hey simu|late.jus|
|00005b60| 74 20 22 43 22 20 6c 6f | 63 61 6c 65 2e 20 54 68 |t "C" lo|cale. Th|
|00005b70| 69 73 20 6d 65 61 6e 73 | 20 74 68 65 79 20 64 6f |is means| they do|
|00005b80| 20 6e 6f 74 68 69 6e 67 | 20 75 73 65 66 75 6c 2e | nothing| useful.|
|00005b90| 0a 0a 40 6e 6f 64 65 20 | 6c 69 62 73 74 75 62 73 |..@node |libstubs|
|00005ba0| 2e 61 2c 6d 69 73 63 2c | 6c 69 62 61 6d 69 67 61 |.a,misc,|libamiga|
|00005bb0| 2e 61 2c 46 65 61 74 75 | 72 65 73 0a 40 63 68 61 |.a,Featu|res.@cha|
|00005bc0| 70 74 65 72 20 6c 69 62 | 73 74 75 62 73 20 2d 20 |pter lib|stubs - |
|00005bd0| 61 75 74 6f 6d 61 74 69 | 63 20 6c 69 62 72 61 72 |automati|c librar|
|00005be0| 79 20 6f 70 65 6e 69 6e | 67 0a 0a 54 68 65 20 41 |y openin|g..The A|
|00005bf0| 6d 69 67 61 20 4f 53 20 | 73 68 61 72 65 64 20 6c |miga OS |shared l|
|00005c00| 69 62 72 61 72 69 65 73 | 20 61 72 65 20 61 20 6e |ibraries| are a n|
|00005c10| 69 63 65 20 74 68 69 6e | 67 2e 20 41 6c 6c 20 74 |ice thin|g. All t|
|00005c20| 68 65 20 74 61 73 6b 73 | 20 63 61 6e 0a 75 73 65 |he tasks| can.use|
|00005c30| 20 74 68 65 6d 20 69 6e | 20 70 61 72 61 6c 6c 65 | them in| paralle|
|00005c40| 6c 2c 20 74 68 65 79 20 | 65 61 74 20 75 70 20 6d |l, they |eat up m|
|00005c50| 65 6d 6f 72 79 20 6f 6e | 6c 79 20 69 66 20 79 6f |emory on|ly if yo|
|00005c60| 75 20 75 73 65 20 74 68 | 65 6d 20 61 6e 64 0a 74 |u use th|em and.t|
|00005c70| 68 65 79 20 61 72 65 20 | 73 69 6d 70 6c 65 20 74 |hey are |simple t|
|00005c80| 6f 20 75 73 65 20 2d 20 | 61 6e 64 20 61 6c 6c 20 |o use - |and all |
|00005c90| 74 68 69 73 20 77 6f 72 | 6b 73 20 65 76 65 6e 20 |this wor|ks even |
|00005ca0| 77 69 74 68 6f 75 74 20 | 61 0a 6d 65 6d 6f 72 79 |without |a.memory|
|00005cb0| 20 6d 61 6e 61 67 65 6d | 65 6e 74 20 75 6e 69 74 | managem|ent unit|
|00005cc0| 20 28 4d 4d 55 29 2e 0a | 0a 41 6e 6f 74 68 65 72 | (MMU)..|.Another|
|00005cd0| 20 6e 69 63 65 20 66 65 | 61 74 75 72 65 20 69 73 | nice fe|ature is|
|00005ce0| 20 74 68 65 20 66 61 63 | 74 20 74 68 61 74 20 79 | the fac|t that y|
|00005cf0| 6f 75 20 63 61 6e 20 6f | 70 65 6e 20 74 68 65 6d |ou can o|pen them|
|00005d00| 20 75 6e 64 65 72 0a 70 | 72 6f 67 72 61 6d 20 63 | under.p|rogram c|
|00005d10| 6f 6e 74 72 6f 6c 2c 20 | 69 2e 65 2e 20 79 6f 75 |ontrol, |i.e. you|
|00005d20| 20 63 61 6e 20 74 61 6b | 65 20 73 6f 6d 65 20 61 | can tak|e some a|
|00005d30| 63 74 69 6f 6e 20 69 66 | 20 74 68 65 79 20 64 6f |ction if| they do|
|00005d40| 20 6e 6f 74 0a 65 78 69 | 73 74 20 2d 20 77 61 72 | not.exi|st - war|
|00005d50| 6e 20 74 68 65 20 75 73 | 65 72 2c 20 64 69 73 61 |n the us|er, disa|
|00005d60| 62 6c 65 20 73 6f 6d 65 | 20 66 65 61 74 75 72 65 |ble some| feature|
|00005d70| 73 2c 20 65 74 63 2e 20 | 54 68 69 73 20 6e 69 63 |s, etc. |This nic|
|00005d80| 65 20 0a 66 65 61 74 75 | 72 65 20 62 65 63 6f 6d |e .featu|re becom|
|00005d90| 65 73 20 61 20 6d 69 73 | 66 65 61 74 75 72 65 20 |es a mis|feature |
|00005da0| 69 66 20 79 6f 75 20 6f | 6e 6c 79 20 6e 65 65 64 |if you o|nly need|
|00005db0| 20 61 20 63 65 72 74 61 | 69 6e 20 6c 69 73 74 0a | a certa|in list.|
|00005dc0| 6f 66 20 66 75 6e 63 74 | 69 6f 6e 73 20 74 68 61 |of funct|ions tha|
|00005dd0| 74 20 61 72 65 20 74 68 | 65 72 65 20 61 6c 6c 20 |t are th|ere all |
|00005de0| 74 68 65 20 74 69 6d 65 | 20 2d 20 65 78 65 63 2c |the time| - exec,|
|00005df0| 20 64 6f 73 2c 20 69 6e | 74 75 69 74 69 6f 6e 20 | dos, in|tuition |
|00005e00| 2d 0a 79 6f 75 20 73 74 | 69 6c 6c 20 68 61 76 65 |-.you st|ill have|
|00005e10| 20 74 6f 20 6f 70 65 6e | 20 74 68 65 20 73 68 61 | to open| the sha|
|00005e20| 72 65 64 20 6c 69 62 72 | 61 72 69 65 73 2e 0a 0a |red libr|aries...|
|00005e30| 53 6f 20 6d 6f 73 74 20 | 41 6d 69 67 61 20 63 6f |So most |Amiga co|
|00005e40| 6d 70 69 6c 65 72 73 20 | 68 61 76 65 20 61 20 66 |mpilers |have a f|
|00005e50| 65 61 74 75 72 65 20 63 | 61 6c 6c 65 64 20 61 75 |eature c|alled au|
|00005e60| 74 6f 6d 61 74 69 63 20 | 6c 69 62 72 61 72 79 0a |tomatic |library.|
|00005e70| 6f 70 65 6e 69 6e 67 20 | 66 65 61 74 75 72 65 2e |opening |feature.|
|00005e80| 20 54 68 69 73 20 6d 65 | 61 6e 73 20 74 68 61 74 | This me|ans that|
|00005e90| 20 61 6c 6c 20 6c 69 62 | 72 61 72 69 65 73 20 79 | all lib|raries y|
|00005ea0| 6f 75 20 72 65 66 65 72 | 65 6e 63 65 0a 28 62 79 |ou refer|ence.(by|
|00005eb0| 20 63 61 6c 6c 69 6e 67 | 20 6f 6e 65 20 6f 66 20 | calling| one of |
|00005ec0| 74 68 65 20 66 75 6e 63 | 74 69 6f 6e 73 29 20 62 |the func|tions) b|
|00005ed0| 75 74 20 64 6f 6e 27 74 | 20 6f 70 65 6e 20 79 6f |ut don't| open yo|
|00005ee0| 75 72 73 65 6c 66 20 67 | 65 74 0a 6f 70 65 6e 65 |urself g|et.opene|
|00005ef0| 64 20 66 6f 72 20 79 6f | 75 20 62 79 20 74 68 65 |d for yo|u by the|
|00005f00| 20 63 6f 6d 70 69 6c 65 | 72 2e 0a 0a 40 6d 65 6e | compile|r...@men|
|00005f10| 75 0a 2a 20 41 75 74 6f | 2d 6c 69 62 72 61 72 79 |u.* Auto|-library|
|00005f20| 2d 6f 70 65 6e 69 6e 67 | 20 75 73 61 67 65 3a 3a |-opening| usage::|
|00005f30| 20 20 20 20 20 48 6f 77 | 20 74 6f 20 75 73 65 20 | How| to use |
|00005f40| 69 74 2e 0a 2a 20 41 75 | 74 6f 2d 6c 69 62 72 61 |it..* Au|to-libra|
|00005f50| 72 79 2d 6f 70 65 6e 69 | 6e 67 20 69 6e 74 65 72 |ry-openi|ng inter|
|00005f60| 66 61 63 65 3a 3a 20 48 | 6f 77 20 69 74 20 77 6f |face:: H|ow it wo|
|00005f70| 72 6b 73 2e 0a 40 65 6e | 64 20 6d 65 6e 75 0a 0a |rks..@en|d menu..|
|00005f80| 40 6e 6f 64 65 20 41 75 | 74 6f 2d 6c 69 62 72 61 |@node Au|to-libra|
|00005f90| 72 79 2d 6f 70 65 6e 69 | 6e 67 20 75 73 61 67 65 |ry-openi|ng usage|
|00005fa0| 2c 41 75 74 6f 2d 6c 69 | 62 72 61 72 79 2d 6f 70 |,Auto-li|brary-op|
|00005fb0| 65 6e 69 6e 67 20 69 6e | 74 65 72 66 61 63 65 2c |ening in|terface,|
|00005fc0| 6c 69 62 73 74 75 62 73 | 2e 61 2c 6c 69 62 73 74 |libstubs|.a,libst|
|00005fd0| 75 62 73 2e 61 0a 40 63 | 68 61 70 74 65 72 20 55 |ubs.a.@c|hapter U|
|00005fe0| 73 61 67 65 0a 0a 54 6f | 20 75 73 65 20 74 68 69 |sage..To| use thi|
|00005ff0| 73 20 66 65 61 74 75 72 | 65 20 79 6f 75 20 68 61 |s featur|e you ha|
|00006000| 76 65 20 74 6f 20 64 6f | 20 6e 6f 74 68 69 6e 67 |ve to do| nothing|
|00006010| 20 28 74 68 65 72 65 66 | 6f 72 65 20 69 74 27 73 | (theref|ore it's|
|00006020| 20 63 61 6c 6c 65 64 0a | 61 75 74 6f 6d 61 74 69 | called.|automati|
|00006030| 63 29 2e 20 42 75 74 20 | 79 6f 75 20 63 61 6e 20 |c). But |you can |
|00006040| 63 6f 6e 74 72 6f 6c 20 | 74 68 65 20 6c 69 62 72 |control |the libr|
|00006050| 61 72 79 20 76 65 72 73 | 69 6f 6e 20 69 66 20 79 |ary vers|ion if y|
|00006060| 6f 75 20 77 69 73 68 0a | 62 79 20 64 65 63 6c 61 |ou wish.|by decla|
|00006070| 72 69 6e 67 0a 0a 40 63 | 6f 64 65 7b 6c 6f 6e 67 |ring..@c|ode{long|
|00006080| 20 5f 5f 6f 73 6c 69 62 | 76 65 72 73 69 6f 6e 3b | __oslib|version;|
|00006090| 7d 0a 0a 73 6f 6d 65 77 | 68 65 72 65 20 69 6e 20 |}..somew|here in |
|000060a0| 79 6f 75 72 20 70 72 6f | 67 72 61 6d 2e 20 42 75 |your pro|gram. Bu|
|000060b0| 74 20 64 6f 6e 27 74 20 | 73 65 74 20 74 68 69 73 |t don't |set this|
|000060c0| 20 6c 6f 77 65 72 20 74 | 68 61 6e 20 33 37 20 2d | lower t|han 37 -|
|000060d0| 20 6d 6f 73 74 20 66 75 | 6e 63 74 69 6f 6e 73 0a | most fu|nctions.|
|000060e0| 6f 66 20 6c 69 62 6e 69 | 78 20 28 69 6e 63 6c 75 |of libni|x (inclu|
|000060f0| 64 69 6e 67 20 74 68 65 | 20 63 6f 6d 6d 61 6e 64 |ding the| command|
|00006100| 6c 69 6e 65 20 70 61 72 | 73 65 72 73 29 20 6e 65 |line par|sers) ne|
|00006110| 65 64 20 33 37 20 6f 72 | 20 6d 6f 72 65 2e 0a 0a |ed 37 or| more...|
|00006120| 40 6e 6f 64 65 20 41 75 | 74 6f 2d 6c 69 62 72 61 |@node Au|to-libra|
|00006130| 72 79 2d 6f 70 65 6e 69 | 6e 67 20 69 6e 74 65 72 |ry-openi|ng inter|
|00006140| 66 61 63 65 2c 2c 41 75 | 74 6f 2d 6c 69 62 72 61 |face,,Au|to-libra|
|00006150| 72 79 2d 6f 70 65 6e 69 | 6e 67 20 75 73 61 67 65 |ry-openi|ng usage|
|00006160| 2c 6c 69 62 73 74 75 62 | 73 2e 61 0a 40 63 68 61 |,libstub|s.a.@cha|
|00006170| 70 74 65 72 20 49 6e 74 | 65 72 66 61 63 65 0a 0a |pter Int|erface..|
|00006180| 49 6d 70 6c 65 6d 65 6e | 74 69 6e 67 20 73 75 63 |Implemen|ting suc|
|00006190| 68 20 61 20 66 65 61 74 | 75 72 65 20 69 73 20 6e |h a feat|ure is n|
|000061a0| 6f 20 68 61 72 64 20 77 | 6f 72 6b 20 69 66 20 79 |o hard w|ork if y|
|000061b0| 6f 75 20 6b 6e 6f 77 20 | 68 6f 77 20 2d 20 74 68 |ou know |how - th|
|000061c0| 69 73 0a 69 6d 70 6c 65 | 6d 65 6e 74 61 74 69 6f |is.imple|mentatio|
|000061d0| 6e 20 75 73 65 73 20 61 | 20 28 6e 6f 74 20 73 6f |n uses a| (not so|
|000061e0| 20 67 6f 6f 64 20 6b 6e | 6f 77 6e 29 20 66 65 61 | good kn|own) fea|
|000061f0| 74 75 72 65 20 6f 66 20 | 74 68 65 20 67 6e 75 20 |ture of |the gnu |
|00006200| 6c 69 6e 6b 65 72 0a 63 | 61 6c 6c 65 64 20 73 65 |linker.c|alled se|
|00006210| 74 20 65 6c 65 6d 65 6e | 74 73 3a 0a 0a 40 65 6e |t elemen|ts:..@en|
|00006220| 75 6d 65 72 61 74 65 0a | 40 69 74 65 6d 0a 59 6f |umerate.|@item.Yo|
|00006230| 75 20 77 72 69 74 65 20 | 61 20 6c 69 62 72 61 72 |u write |a librar|
|00006240| 79 20 65 6e 74 72 79 20 | 66 6f 72 20 65 76 65 72 |y entry |for ever|
|00006250| 79 20 6c 69 62 72 61 72 | 79 20 62 61 73 65 20 61 |y librar|y base a|
|00006260| 6e 64 20 6c 69 6e 6b 20 | 74 68 69 73 20 6c 69 62 |nd link |this lib|
|00006270| 72 61 72 79 20 61 73 20 | 74 68 65 0a 6c 61 73 74 |rary as |the.last|
|00006280| 20 6f 6e 65 2e 20 54 68 | 69 73 20 6d 65 61 6e 73 | one. Th|is means|
|00006290| 20 74 68 61 74 20 74 68 | 65 20 6c 69 6e 6b 65 72 | that th|e linker|
|000062a0| 20 75 73 65 73 20 74 68 | 69 73 20 6c 69 62 72 61 | uses th|is libra|
|000062b0| 72 79 20 66 6f 72 20 65 | 76 65 72 79 20 6c 69 62 |ry for e|very lib|
|000062c0| 72 61 72 79 20 62 61 73 | 65 0a 70 6f 69 6e 74 65 |rary bas|e.pointe|
|000062d0| 72 20 74 68 61 74 20 69 | 73 20 6e 6f 74 20 64 65 |r that i|s not de|
|000062e0| 66 69 6e 65 64 20 62 75 | 74 20 72 65 66 65 72 65 |fined bu|t refere|
|000062f0| 6e 63 65 64 20 73 6f 6d | 65 77 68 65 72 65 2e 0a |nced som|ewhere..|
|00006300| 40 69 74 65 6d 0a 59 6f | 75 20 74 65 6c 6c 20 74 |@item.Yo|u tell t|
|00006310| 68 65 20 6c 69 6e 6b 65 | 72 20 74 6f 20 63 6f 6c |he linke|r to col|
|00006320| 6c 65 63 74 20 74 68 65 | 73 65 20 6c 69 62 72 61 |lect the|se libra|
|00006330| 72 79 20 62 61 73 65 73 | 20 74 6f 67 65 74 68 65 |ry bases| togethe|
|00006340| 72 20 69 6e 74 6f 20 61 | 20 73 65 74 20 65 6c 65 |r into a| set ele|
|00006350| 6d 65 6e 74 2e 0a 40 69 | 74 65 6d 0a 59 6f 75 20 |ment..@i|tem.You |
|00006360| 77 72 69 74 65 20 61 20 | 66 75 6e 63 74 69 6f 6e |write a |function|
|00006370| 20 74 68 61 74 20 6f 70 | 65 6e 73 20 61 6c 6c 20 | that op|ens all |
|00006380| 6c 69 62 72 61 72 69 65 | 73 20 69 6e 20 74 68 65 |librarie|s in the|
|00006390| 20 73 65 74 20 65 6c 65 | 6d 65 6e 74 20 61 74 0a | set ele|ment at.|
|000063a0| 70 72 6f 67 72 61 6d 20 | 73 74 61 72 74 20 61 6e |program |start an|
|000063b0| 64 20 63 6c 65 61 6e 73 | 20 74 68 65 6d 20 75 70 |d cleans| them up|
|000063c0| 20 6c 61 74 65 72 2e 0a | 40 65 6e 64 20 65 6e 75 | later..|@end enu|
|000063d0| 6d 65 72 61 74 65 0a 0a | 53 6f 6d 65 20 64 65 74 |merate..|Some det|
|000063e0| 61 69 6c 73 3a 0a 0a 54 | 68 65 72 65 20 61 72 65 |ails:..T|here are|
|000063f0| 20 74 77 6f 20 6f 62 6a | 65 63 74 20 66 69 6c 65 | two obj|ect file|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.