home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1992-10-10 | 9.9 KB | [ TEXT/MPS ]
open in: MacOS 8.1
extracted
|
Win98
extracted
|
DOS
extracted
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary ).
You can browse this item here: link.c
id metadata key value macFileType [ TEXT] macFileCreator [ MPS ]
hex view +--------+-------------------------+-------------------------+--------+--------+ |00000000| 00 06 6c 69 6e 6b 2e 63 | 00 00 00 00 00 00 00 00 |..link.c|........| |00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......| |00000050| 00 00 00 00 00 24 83 00 | 00 01 ac a6 fc 9e d8 a6 |.....$..|........| |00000060| fc 9e d8 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 a2 53 00 00 |........|.....S..| |00000080| 2f 2a 0d 20 2a 20 6c 69 | 6e 6b 2e 63 20 2d 2d 20 |/*. * li|nk.c -- | |00000090| 6c 69 6e 6b 65 72 20 6d | 61 69 6e 20 70 72 6f 67 |linker m|ain prog| |000000a0| 72 61 6d 20 74 68 61 74 | 20 63 6f 6e 74 72 6f 6c |ram that| control| |000000b0| 73 20 74 68 65 20 6c 69 | 6e 6b 69 6e 67 20 70 72 |s the li|nking pr| |000000c0| 6f 63 65 73 73 2e 0d 20 | 2a 2f 0d 0d 23 69 6e 63 |ocess.. |*/..#inc| |000000d0| 6c 75 64 65 20 22 6c 69 | 6e 6b 2e 68 22 0d 23 69 |lude "li|nk.h".#i| |000000e0| 6e 63 6c 75 64 65 20 22 | 74 70 72 6f 74 6f 2e 68 |nclude "|tproto.h| |000000f0| 22 0d 23 69 6e 63 6c 75 | 64 65 20 22 67 6c 6f 62 |".#inclu|de "glob| |00000100| 61 6c 73 2e 68 22 0d 23 | 69 6e 63 6c 75 64 65 20 |als.h".#|include | |00000110| 22 3a 3a 68 3a 68 65 61 | 64 65 72 2e 68 22 0d 0d |"::h:hea|der.h"..| |00000120| 23 69 66 64 65 66 20 48 | 65 61 64 65 72 0d 23 69 |#ifdef H|eader.#i| |00000130| 6e 63 6c 75 64 65 20 22 | 68 64 72 2e 68 22 0d 0d |nclude "|hdr.h"..| |00000140| 23 69 66 6e 64 65 66 20 | 4d 61 78 48 65 61 64 65 |#ifndef |MaxHeade| |00000150| 72 0d 23 64 65 66 69 6e | 65 20 4d 61 78 48 65 61 |r.#defin|e MaxHea| |00000160| 64 65 72 20 4d 61 78 48 | 64 72 0d 23 65 6e 64 69 |der MaxH|dr.#endi| |00000170| 66 09 09 09 09 09 2f 2a | 20 4d 61 78 48 65 61 64 |f...../*| MaxHead| |00000180| 65 72 20 2a 2f 0d 0d 23 | 65 6e 64 69 66 09 09 09 |er */..#|endif...| |00000190| 09 09 2f 2a 20 48 65 61 | 64 65 72 20 2a 2f 0d 0d |../* Hea|der */..| |000001a0| 2f 2a 0d 20 2a 20 50 72 | 6f 74 6f 74 79 70 65 2e |/*. * Pr|ototype.| |000001b0| 0d 20 2a 2f 0d 0d 68 69 | 64 64 65 6e 09 6e 6f 76 |. */..hi|dden.nov| |000001c0| 61 6c 75 65 09 73 65 74 | 65 78 65 09 50 61 72 61 |alue.set|exe.Para| |000001d0| 6d 73 28 28 63 68 61 72 | 20 2a 66 6e 61 6d 65 29 |ms((char| *fname)| |000001e0| 29 3b 0d 0d 0d 2f 2a 0d | 20 2a 20 54 68 65 20 66 |);.../*.| * The f| |000001f0| 6f 6c 6c 6f 77 69 6e 67 | 20 63 6f 64 65 20 69 73 |ollowing| code is| |00000200| 20 6f 70 65 72 61 74 69 | 6e 67 2d 73 79 73 74 65 | operati|ng-syste| |00000210| 6d 20 64 65 70 65 6e 64 | 65 6e 74 20 5b 40 6c 69 |m depend|ent [@li| |00000220| 6e 6b 2e 30 31 5d 2e 20 | 20 49 6e 63 6c 75 64 65 |nk.01]. | Include| |00000230| 0d 20 2a 20 20 73 79 73 | 74 65 6d 2d 64 65 70 65 |. * sys|tem-depe| |00000240| 6e 64 65 6e 74 20 66 69 | 6c 65 73 20 61 6e 64 20 |ndent fi|les and | |00000250| 64 65 63 6c 61 72 61 74 | 69 6f 6e 73 2e 0d 20 2a |declarat|ions.. *| |00000260| 2f 0d 0d 23 69 66 20 50 | 4f 52 54 0d 20 20 20 2f |/..#if P|ORT. /| |00000270| 2a 20 6e 6f 74 68 69 6e | 67 20 74 6f 20 64 6f 20 |* nothin|g to do | |00000280| 2a 2f 0d 44 65 6c 69 62 | 65 72 61 74 65 20 53 79 |*/.Delib|erate Sy| |00000290| 6e 74 61 78 20 45 72 72 | 6f 72 0d 23 65 6e 64 69 |ntax Err|or.#endi| |000002a0| 66 09 09 09 09 09 2f 2a | 20 50 4f 52 54 20 2a 2f |f...../*| PORT */| |000002b0| 0d 0d 23 69 66 20 41 4d | 49 47 41 20 7c 7c 20 41 |..#if AM|IGA || A| |000002c0| 54 41 52 49 5f 53 54 20 | 7c 7c 20 4d 41 43 49 4e |TARI_ST ||| MACIN| |000002d0| 54 4f 53 48 20 7c 7c 20 | 56 4d 20 7c 7c 20 56 4d |TOSH || |VM || VM| |000002e0| 53 0d 20 20 20 2f 2a 20 | 6e 6f 74 68 69 6e 67 20 |S. /* |nothing | |000002f0| 74 6f 20 64 6f 20 2a 2f | 0d 23 65 6e 64 69 66 09 |to do */|.#endif.| |00000300| 09 09 09 09 2f 2a 20 41 | 4d 49 47 41 20 7c 7c 20 |..../* A|MIGA || | |00000310| 41 54 41 52 49 5f 53 54 | 20 7c 7c 20 2e 2e 2e 20 |ATARI_ST| || ... | |00000320| 2a 2f 0d 0d 23 69 66 20 | 41 52 4d 0d 23 69 6e 63 |*/..#if |ARM.#inc| |00000330| 6c 75 64 65 20 22 6b 65 | 72 6e 65 6c 2e 68 22 0d |lude "ke|rnel.h".| |00000340| 23 69 6e 63 6c 75 64 65 | 20 22 73 77 69 73 2e 68 |#include| "swis.h| |00000350| 22 0d 23 65 6e 64 69 66 | 09 09 09 09 09 2f 2a 20 |".#endif|...../* | |00000360| 41 52 4d 20 2a 2f 0d 0d | 0d 23 69 66 20 4d 53 44 |ARM */..|.#if MSD| |00000370| 4f 53 0d 23 69 66 20 4d | 49 43 52 4f 53 4f 46 54 |OS.#if M|ICROSOFT| |00000380| 20 7c 7c 20 54 55 52 42 | 4f 0d 23 69 6e 63 6c 75 | || TURB|O.#inclu| |00000390| 64 65 20 3c 66 63 6e 74 | 6c 2e 68 3e 0d 23 65 6e |de <fcnt|l.h>.#en| |000003a0| 64 69 66 09 09 09 09 09 | 2f 2a 20 4d 49 43 52 4f |dif.....|/* MICRO| |000003b0| 53 4f 46 54 20 7c 7c 20 | 54 55 52 42 4f 20 2a 2f |SOFT || |TURBO */| |000003c0| 0d 23 65 6e 64 69 66 09 | 09 09 09 09 2f 2a 20 4d |.#endif.|..../* M| |000003d0| 53 44 4f 53 20 2a 2f 0d | 0d 23 69 66 20 4d 56 53 |SDOS */.|.#if MVS| |000003e0| 0d 63 68 61 72 20 2a 72 | 6f 75 74 6e 61 6d 65 3b |.char *r|outname;| |000003f0| 09 09 09 09 2f 2a 20 72 | 65 61 6c 20 6f 75 74 70 |..../* r|eal outp| |00000400| 75 74 20 66 69 6c 65 20 | 6e 61 6d 65 20 2a 2f 0d |ut file |name */.| |00000410| 23 65 6e 64 69 66 09 09 | 09 09 09 2f 2a 20 4d 56 |#endif..|.../* MV| |00000420| 53 20 2a 2f 0d 0d 23 69 | 66 20 4f 53 32 0d 23 69 |S */..#i|f OS2.#i| |00000430| 66 20 4d 49 43 52 4f 53 | 4f 46 54 20 7c 7c 20 43 |f MICROS|OFT || C| |00000440| 53 45 54 32 0d 23 69 6e | 63 6c 75 64 65 20 3c 66 |SET2.#in|clude <f| |00000450| 63 6e 74 6c 2e 68 3e 0d | 23 65 6e 64 69 66 09 09 |cntl.h>.|#endif..| |00000460| 09 09 09 2f 2a 20 4d 49 | 43 52 4f 53 4f 46 54 20 |.../* MI|CROSOFT | |00000470| 7c 7c 20 43 53 45 54 32 | 20 2a 2f 0d 23 65 6e 64 ||| CSET2| */.#end| |00000480| 69 66 09 09 09 09 09 2f | 2a 20 4f 53 32 20 2a 2f |if...../|* OS2 */| |00000490| 0d 0d 23 69 66 20 55 4e | 49 58 0d 23 69 66 64 65 |..#if UN|IX.#ifde| |000004a0| 66 20 43 52 41 59 0d 23 | 64 65 66 69 6e 65 20 77 |f CRAY.#|define w| |000004b0| 6f 72 64 20 77 6f 72 64 | 5f 66 75 62 61 72 0d 23 |ord word|_fubar.#| |000004c0| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 2f 74 79 70 |include |<sys/typ| |000004d0| 65 73 2e 68 3e 0d 23 69 | 6e 63 6c 75 64 65 20 3c |es.h>.#i|nclude <| |000004e0| 73 79 73 2f 73 74 61 74 | 2e 68 3e 0d 23 75 6e 64 |sys/stat|.h>.#und| |000004f0| 65 66 20 77 6f 72 64 0d | 23 65 6c 73 65 09 09 09 |ef word.|#else...| |00000500| 09 09 2f 2a 20 43 52 41 | 59 20 2a 2f 0d 23 69 66 |../* CRA|Y */.#if| |00000510| 6e 64 65 66 20 58 57 69 | 6e 64 6f 77 73 0d 23 69 |ndef XWi|ndows.#i| |00000520| 6e 63 6c 75 64 65 20 3c | 73 79 73 2f 74 79 70 65 |nclude <|sys/type| |00000530| 73 2e 68 3e 0d 23 65 6e | 64 69 66 09 09 09 09 09 |s.h>.#en|dif.....| |00000540| 2f 2a 20 58 57 69 6e 64 | 6f 77 73 20 2a 2f 0d 23 |/* XWind|ows */.#| |00000550| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 2f 73 74 61 |include |<sys/sta| |00000560| 74 2e 68 3e 0d 23 65 6e | 64 69 66 09 09 09 09 09 |t.h>.#en|dif.....| |00000570| 2f 2a 20 43 52 41 59 20 | 2a 2f 0d 23 65 6e 64 69 |/* CRAY |*/.#endi| |00000580| 66 09 09 09 09 09 2f 2a | 20 55 4e 49 58 20 2a 2f |f...../*| UNIX */| |00000590| 0d 0d 2f 2a 0d 20 2a 20 | 45 6e 64 20 6f 66 20 6f |../*. * |End of o| |000005a0| 70 65 72 61 74 69 6e 67 | 2d 73 79 73 74 65 6d 20 |perating|-system | |000005b0| 73 70 65 63 69 66 69 63 | 20 63 6f 64 65 2e 0d 20 |specific| code.. | |000005c0| 2a 2f 0d 0d 46 49 4c 45 | 20 2a 69 6e 66 69 6c 65 |*/..FILE| *infile| |000005d0| 3b 09 09 09 09 2f 2a 20 | 69 6e 70 75 74 20 66 69 |;..../* |input fi| |000005e0| 6c 65 20 28 2e 75 31 20 | 6f 72 20 2e 75 32 29 20 |le (.u1 |or .u2) | |000005f0| 2a 2f 0d 46 49 4c 45 20 | 2a 6f 75 74 66 69 6c 65 |*/.FILE |*outfile| |00000600| 3b 09 09 09 09 2f 2a 20 | 69 6e 74 65 72 70 72 65 |;..../* |interpre| |00000610| 74 65 72 20 63 6f 64 65 | 20 6f 75 74 70 75 74 20 |ter code| output | |00000620| 66 69 6c 65 20 2a 2f 0d | 0d 23 69 66 64 65 66 20 |file */.|.#ifdef | |00000630| 44 65 42 75 67 4c 69 6e | 6b 65 72 0d 46 49 4c 45 |DeBugLin|ker.FILE| |00000640| 20 2a 64 62 67 66 69 6c | 65 3b 09 09 09 09 2f 2a | *dbgfil|e;..../*| |00000650| 20 64 65 62 75 67 20 66 | 69 6c 65 20 2a 2f 0d 73 | debug f|ile */.s| |00000660| 74 61 74 69 63 20 63 68 | 61 72 20 64 62 67 6e 61 |tatic ch|ar dbgna| |00000670| 6d 65 5b 4d 61 78 46 69 | 6c 65 4e 61 6d 65 5d 3b |me[MaxFi|leName];| |00000680| 09 2f 2a 20 64 65 62 75 | 67 20 66 69 6c 65 20 6e |./* debu|g file n| |00000690| 61 6d 65 20 2a 2f 0d 23 | 65 6e 64 69 66 09 09 09 |ame */.#|endif...| |000006a0| 09 09 2f 2a 20 44 65 42 | 75 67 4c 69 6e 6b 65 72 |../* DeB|ugLinker| |000006b0| 20 2a 2f 0d 0d 63 68 61 | 72 20 69 6e 6e 61 6d 65 | */..cha|r inname| |000006c0| 5b 4d 61 78 46 69 6c 65 | 4e 61 6d 65 5d 3b 09 09 |[MaxFile|Name];..| |000006d0| 2f 2a 20 69 6e 70 75 74 | 20 66 69 6c 65 20 6e 61 |/* input| file na| |000006e0| 6d 65 20 2a 2f 0d 73 74 | 61 74 69 63 20 63 68 61 |me */.st|atic cha| |000006f0| 72 20 69 63 6e 6e 61 6d | 65 5b 4d 61 78 46 69 6c |r icnnam|e[MaxFil| |00000700| 65 4e 61 6d 65 5d 3b 09 | 2f 2a 20 69 63 6f 6e 20 |eName];.|/* icon | |00000710| 73 6f 75 72 63 65 20 66 | 69 6c 65 20 6e 61 6d 65 |source f|ile name| |00000720| 20 2a 2f 0d 0d 73 74 72 | 75 63 74 20 6c 66 69 6c | */..str|uct lfil| |00000730| 65 20 2a 6c 6c 66 69 6c | 65 73 20 3d 20 4e 55 4c |e *llfil|es = NUL| |00000740| 4c 3b 09 09 2f 2a 20 4c | 69 73 74 20 6f 66 20 66 |L;../* L|ist of f| |00000750| 69 6c 65 73 20 74 6f 20 | 6c 69 6e 6b 20 2a 2f 0d |iles to |link */.| |00000760| 0d 23 69 66 64 65 66 20 | 45 76 65 6e 74 4d 6f 6e |.#ifdef |EventMon| |00000770| 0d 69 6e 74 20 63 6f 6c | 6d 6e 6f 20 3d 20 30 3b |.int col|mno = 0;| |00000780| 09 09 09 09 2f 2a 20 63 | 75 72 72 65 6e 74 20 73 |..../* c|urrent s| |00000790| 6f 75 72 63 65 20 70 72 | 6f 67 72 61 6d 20 63 6f |ource pr|ogram co| |000007a0| 6c 6d 20 6e 75 6d 62 65 | 72 20 2a 2f 0d 23 65 6e |lm numbe|r */.#en| |000007b0| 64 69 66 09 09 09 09 09 | 2f 2a 20 45 76 65 6e 74 |dif.....|/* Event| |000007c0| 4d 6f 6e 20 2a 2f 0d 0d | 69 6e 74 20 6c 69 6e 65 |Mon */..|int line| |000007d0| 6e 6f 20 3d 20 30 3b 09 | 09 09 09 2f 2a 20 63 75 |no = 0;.|.../* cu| |000007e0| 72 72 65 6e 74 20 73 6f | 75 72 63 65 20 70 72 6f |rrent so|urce pro| |000007f0| 67 72 61 6d 20 6c 69 6e | 65 20 6e 75 6d 62 65 72 |gram lin|e number| |00000800| 20 2a 2f 0d 69 6e 74 20 | 66 61 74 61 6c 73 20 3d | */.int |fatals =| |00000810| 20 30 3b 09 09 09 09 2f | 2a 20 6e 75 6d 62 65 72 | 0;..../|* number| |00000820| 20 6f 66 20 65 72 72 6f | 72 73 20 65 6e 63 6f 75 | of erro|rs encou| |00000830| 6e 74 65 72 65 64 20 2a | 2f 0d 0c 0d 2f 2a 0d 20 |ntered *|/.../*. | |00000840| 2a 20 20 69 6c 69 6e 6b | 20 2d 20 6c 69 6e 6b 20 |* ilink| - link | |00000850| 61 20 6e 75 6d 62 65 72 | 20 6f 66 20 66 69 6c 65 |a number| of file| |00000860| 73 2c 20 72 65 74 75 72 | 6e 69 6e 67 20 65 72 72 |s, retur|ning err| |00000870| 6f 72 20 63 6f 75 6e 74 | 0d 20 2a 2f 0d 69 6e 74 |or count|. */.int| |00000880| 20 69 6c 69 6e 6b 28 69 | 66 69 6c 65 73 2c 6f 75 | ilink(i|files,ou| |00000890| 74 6e 61 6d 65 29 0d 63 | 68 61 72 20 2a 2a 69 66 |tname).c|har **if| |000008a0| 69 6c 65 73 3b 0d 63 68 | 61 72 20 2a 6f 75 74 6e |iles;.ch|ar *outn| |000008b0| 61 6d 65 3b 0d 20 20 20 | 7b 0d 0d 23 69 66 64 65 |ame;. |{..#ifde| |000008c0| 66 20 58 76 65 72 0d 78 | 76 65 72 28 6c 69 6e 6b |f Xver.x|ver(link| |000008d0| 2e 31 29 0d 23 65 6e 64 | 69 66 09 09 09 09 09 2f |.1).#end|if...../| |000008e0| 2a 20 58 76 65 72 20 2a | 2f 0d 0d 20 20 20 69 6e |* Xver *|/.. in| |000008f0| 74 20 69 3b 0d 20 20 20 | 73 74 72 75 63 74 20 6c |t i;. |struct l| |00000900| 66 69 6c 65 20 2a 6c 66 | 2c 2a 6c 66 6c 73 3b 0d |file *lf|,*lfls;.| |00000910| 20 20 20 63 68 61 72 20 | 2a 66 69 6c 65 6e 61 6d | char |*filenam| |00000920| 65 3b 09 09 09 2f 2a 20 | 6e 61 6d 65 20 6f 66 20 |e;.../* |name of | |00000930| 63 75 72 72 65 6e 74 20 | 69 6e 70 75 74 20 66 69 |current |input fi| |00000940| 6c 65 20 2a 2f 0d 0d 20 | 20 20 6c 69 6e 69 74 28 |le */.. | linit(| |00000950| 29 3b 09 09 09 09 2f 2a | 20 69 6e 69 74 69 61 6c |);..../*| initial| |00000960| 69 7a 65 20 6d 65 6d 6f | 72 79 20 73 74 72 75 63 |ize memo|ry struc| |00000970| 74 75 72 65 73 20 2a 2f | 0d 20 20 20 77 68 69 6c |tures */|. whil| |00000980| 65 20 28 2a 69 66 69 6c | 65 73 29 0d 20 20 20 20 |e (*ifil|es). | |00000990| 20 20 61 6c 73 6f 6c 69 | 6e 6b 28 2a 69 66 69 6c | alsoli|nk(*ifil| |000009a0| 65 73 2b 2b 29 3b 09 09 | 2f 2a 20 6d 61 6b 65 20 |es++);..|/* make | |000009b0| 69 6e 69 74 69 61 6c 20 | 6c 69 73 74 20 6f 66 20 |initial |list of | |000009c0| 66 69 6c 65 73 20 2a 2f | 0d 0d 20 20 20 2f 2a 0d |files */|.. /*.| |000009d0| 20 20 20 20 2a 20 50 68 | 61 73 65 20 49 3a 20 6c | * Ph|ase I: l| |000009e0| 6f 61 64 20 67 6c 6f 62 | 61 6c 20 69 6e 66 6f 72 |oad glob|al infor| |000009f0| 6d 61 74 69 6f 6e 20 63 | 6f 6e 74 61 69 6e 65 64 |mation c|ontained| |00000a00| 20 69 6e 20 2e 75 32 20 | 66 69 6c 65 73 20 69 6e | in .u2 |files in| |00000a10| 74 6f 0d 20 20 20 20 2a | 20 20 64 61 74 61 20 73 |to. *| data s| |00000a20| 74 72 75 63 74 75 72 65 | 73 2e 0d 20 20 20 20 2a |tructure|s.. *| |00000a30| 0d 20 20 20 20 2a 20 54 | 68 65 20 6c 69 73 74 20 |. * T|he list | |00000a40| 6f 66 20 66 69 6c 65 73 | 20 74 6f 20 6c 69 6e 6b |of files| to link| |00000a50| 20 69 73 20 6d 61 69 6e | 74 61 69 6e 65 64 20 61 | is main|tained a| |00000a60| 73 20 61 20 71 75 65 75 | 65 20 77 69 74 68 20 6c |s a queu|e with l| |00000a70| 6c 66 69 6c 65 73 0d 20 | 20 20 20 2a 20 20 61 73 |lfiles. | * as| |00000a80| 20 74 68 65 20 62 61 73 | 65 2e 20 20 6c 66 20 6d | the bas|e. lf m| |00000a90| 6f 76 65 73 20 61 6c 6f | 6e 67 20 74 68 65 20 6c |oves alo|ng the l| |00000aa0| 69 73 74 2e 20 20 45 61 | 63 68 20 66 69 6c 65 20 |ist. Ea|ch file | |00000ab0| 69 73 20 70 72 6f 63 65 | 73 73 65 64 0d 20 20 20 |is proce|ssed. | |00000ac0| 20 2a 20 20 69 6e 20 74 | 75 72 6e 20 62 79 20 66 | * in t|urn by f| |00000ad0| 6f 72 6d 69 6e 67 20 2e | 75 32 20 61 6e 64 20 2e |orming .|u2 and .| |00000ae0| 69 63 6e 20 6e 61 6d 65 | 73 20 66 72 6f 6d 20 65 |icn name|s from e| |00000af0| 61 63 68 20 66 69 6c 65 | 20 6e 61 6d 65 2c 20 65 |ach file| name, e| |00000b00| 61 63 68 0d 20 20 20 20 | 2a 20 20 6f 66 20 77 68 |ach. |* of wh| |00000b10| 69 63 68 20 65 6e 64 73 | 20 69 6e 20 2e 75 31 2e |ich ends| in .u1.| |00000b20| 20 20 54 68 65 20 2e 75 | 32 20 66 69 6c 65 20 69 | The .u|2 file i| |00000b30| 73 20 6f 70 65 6e 65 64 | 20 61 6e 64 20 67 6c 6f |s opened| and glo| |00000b40| 62 61 6c 73 20 69 73 20 | 63 61 6c 6c 65 64 0d 20 |bals is |called. | |00000b50| 20 20 20 2a 20 20 74 6f | 20 70 72 6f 63 65 73 73 | * to| process| |00000b60| 20 69 74 2e 20 20 57 68 | 65 6e 20 74 68 65 20 65 | it. Wh|en the e| |00000b70| 6e 64 20 6f 66 20 74 68 | 65 20 6c 69 73 74 20 69 |nd of th|e list i| |00000b80| 73 20 72 65 61 63 68 65 | 64 2c 20 6c 66 20 62 65 |s reache|d, lf be| |00000b90| 63 6f 6d 65 73 0d 20 20 | 20 20 2a 20 20 4e 55 4c |comes. | * NUL| |00000ba0| 4c 20 61 6e 64 20 74 68 | 65 20 6c 6f 6f 70 20 69 |L and th|e loop i| |00000bb0| 73 20 74 65 72 6d 69 6e | 61 74 65 64 2c 20 63 6f |s termin|ated, co| |00000bc0| 6d 70 6c 65 74 69 6e 67 | 20 70 68 61 73 65 20 49 |mpleting| phase I| |00000bd0| 2e 20 20 4e 6f 74 65 20 | 74 68 61 74 0d 20 20 20 |. Note |that. | |00000be0| 20 2a 20 20 6c 69 6e 6b | 20 69 6e 73 74 72 75 63 | * link| instruc| |00000bf0| 74 69 6f 6e 73 20 69 6e | 20 74 68 65 20 2e 75 32 |tions in| the .u2| |00000c00| 20 66 69 6c 65 20 63 61 | 75 73 65 20 66 69 6c 65 | file ca|use file| |00000c10| 73 20 74 6f 20 62 65 20 | 61 64 64 65 64 20 74 6f |s to be |added to| |00000c20| 20 6c 69 73 74 0d 20 20 | 20 20 2a 20 20 6f 66 20 | list. | * of | |00000c30| 66 69 6c 65 73 20 74 6f | 20 6c 69 6e 6b 2e 0d 20 |files to| link.. | |00000c40| 20 20 20 2a 2f 0d 20 20 | 20 66 6f 72 20 28 6c 66 | */. | for (lf| |00000c50| 20 3d 20 6c 6c 66 69 6c | 65 73 3b 20 6c 66 20 21 | = llfil|es; lf !| |00000c60| 3d 20 4e 55 4c 4c 3b 20 | 6c 66 20 3d 20 6c 66 2d |= NULL; |lf = lf-| |00000c70| 3e 6c 66 5f 6c 69 6e 6b | 29 20 7b 0d 20 20 20 20 |>lf_link|) {. | |00000c80| 20 20 66 69 6c 65 6e 61 | 6d 65 20 3d 20 6c 66 2d | filena|me = lf-| |00000c90| 3e 6c 66 5f 6e 61 6d 65 | 3b 0d 20 20 20 20 20 20 |>lf_name|;. | |00000ca0| 6d 61 6b 65 6e 61 6d 65 | 28 69 6e 6e 61 6d 65 2c |makename|(inname,| |00000cb0| 20 53 6f 75 72 63 65 44 | 69 72 2c 20 66 69 6c 65 | SourceD|ir, file| |00000cc0| 6e 61 6d 65 2c 20 55 32 | 53 75 66 66 69 78 29 3b |name, U2|Suffix);| |00000cd0| 0d 20 20 20 20 20 20 6d | 61 6b 65 6e 61 6d 65 28 |. m|akename(| |00000ce0| 69 63 6e 6e 61 6d 65 2c | 20 54 61 72 67 65 74 44 |icnname,| TargetD| |00000cf0| 69 72 2c 20 66 69 6c 65 | 6e 61 6d 65 2c 20 53 6f |ir, file|name, So| |00000d00| 75 72 63 65 53 75 66 66 | 69 78 29 3b 0d 0d 23 69 |urceSuff|ix);..#i| |00000d10| 66 20 4d 56 53 20 7c 7c | 20 56 4d 0d 2f 2a 0d 20 |f MVS ||| VM./*. | |00000d20| 2a 20 45 76 65 6e 20 74 | 68 6f 75 67 68 20 74 68 |* Even t|hough th| |00000d30| 65 20 75 63 6f 64 65 20 | 64 61 74 61 20 69 73 20 |e ucode |data is | |00000d40| 61 6c 6c 20 72 65 61 73 | 6f 6e 61 62 6c 65 20 74 |all reas|onable t| |00000d50| 65 78 74 20 63 68 61 72 | 61 63 74 65 72 73 2c 20 |ext char|acters, | |00000d60| 75 73 65 0d 20 2a 20 20 | 6f 66 20 74 65 78 74 20 |use. * |of text | |00000d70| 49 2f 4f 20 6d 61 79 20 | 63 61 75 73 65 20 70 72 |I/O may |cause pr| |00000d80| 6f 62 6c 65 6d 73 20 69 | 66 20 61 20 6c 69 6e 65 |oblems i|f a line| |00000d90| 20 69 73 20 6c 61 72 67 | 65 72 20 74 68 61 6e 20 | is larg|er than | |00000da0| 4c 52 45 43 4c 2e 0d 20 | 2a 20 20 54 68 69 73 20 |LRECL.. |* This | |00000db0| 69 73 20 6c 69 6b 65 6c | 79 20 74 6f 20 62 65 20 |is likel|y to be | |00000dc0| 74 72 75 65 20 77 69 74 | 68 20 61 6e 79 20 63 6f |true wit|h any co| |00000dd0| 6d 70 69 6c 65 72 2c 20 | 74 68 6f 75 67 68 20 74 |mpiler, |though t| |00000de0| 68 65 20 70 72 65 63 69 | 73 65 0d 20 2a 20 20 64 |he preci|se. * d| |00000df0| 69 73 61 73 74 65 72 20 | 77 68 69 63 68 20 72 65 |isaster |which re| |00000e00| 73 75 6c 74 73 20 6d 61 | 79 20 76 61 72 79 2e 0d |sults ma|y vary..| |00000e10| 20 2a 2f 0d 20 20 20 20 | 20 20 69 6e 66 69 6c 65 | */. | infile| |00000e20| 20 3d 20 66 6f 70 65 6e | 28 69 6e 6e 61 6d 65 2c | = fopen|(inname,| |00000e30| 20 52 65 61 64 42 69 6e | 61 72 79 29 3b 0d 23 65 | ReadBin|ary);.#e| |00000e40| 6c 73 65 0d 20 20 20 20 | 20 20 69 6e 66 69 6c 65 |lse. | infile| |00000e50| 20 3d 20 66 6f 70 65 6e | 28 69 6e 6e 61 6d 65 2c | = fopen|(inname,| |00000e60| 20 52 65 61 64 54 65 78 | 74 29 3b 0d 23 65 6e 64 | ReadTex|t);.#end| |00000e70| 69 66 09 09 09 09 09 2f | 2a 20 4d 56 53 20 7c 7c |if...../|* MVS ||| |00000e80| 20 56 4d 20 2a 2f 0d 0d | 20 20 20 20 20 20 69 66 | VM */..| if| |00000e90| 20 28 69 6e 66 69 6c 65 | 20 3d 3d 20 4e 55 4c 4c | (infile| == NULL| |00000ea0| 29 0d 20 20 20 20 20 20 | 20 20 20 71 75 69 74 66 |). | quitf| |00000eb0| 28 22 63 61 6e 6e 6f 74 | 20 6f 70 65 6e 20 25 73 |("cannot| open %s| |00000ec0| 22 2c 69 6e 6e 61 6d 65 | 29 3b 0d 20 20 20 20 20 |",inname|);. | |00000ed0| 20 72 65 61 64 67 6c 6f | 62 28 29 3b 0d 20 20 20 | readglo|b();. | |00000ee0| 20 20 20 66 63 6c 6f 73 | 65 28 69 6e 66 69 6c 65 | fclos|e(infile| |00000ef0| 29 3b 0d 20 20 20 20 20 | 20 7d 0d 0d 20 20 20 2f |);. | }.. /| |00000f00| 2a 20 50 68 61 73 65 20 | 49 49 3a 20 72 65 73 6f |* Phase |II: reso| |00000f10| 6c 76 65 20 75 6e 64 65 | 63 6c 61 72 65 64 20 76 |lve unde|clared v| |00000f20| 61 72 69 61 62 6c 65 73 | 20 61 6e 64 20 67 65 6e |ariables| and gen| |00000f30| 65 72 61 74 65 20 63 6f | 64 65 2e 20 2a 2f 0d 0d |erate co|de. */..| |00000f40| 20 20 20 2f 2a 0d 20 20 | 20 20 2a 20 4f 70 65 6e | /*. | * Open| |00000f50| 20 74 68 65 20 6f 75 74 | 70 75 74 20 66 69 6c 65 | the out|put file| |00000f60| 2e 0d 20 20 20 20 2a 2f | 0d 0d 23 69 66 20 4d 56 |.. */|..#if MV| |00000f70| 53 0d 20 20 20 72 6f 75 | 74 6e 61 6d 65 20 3d 20 |S. rou|tname = | |00000f80| 6f 75 74 6e 61 6d 65 3b | 0d 20 20 20 6f 75 74 66 |outname;|. outf| |00000f90| 69 6c 65 20 3d 20 74 6d | 70 66 69 6c 65 28 29 3b |ile = tm|pfile();| |00000fa0| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 77 72 69 74 | | /* writ| |00000fb0| 65 20 69 63 6f 64 65 20 | 74 6f 20 74 65 6d 70 6f |e icode |to tempo| |00000fc0| 72 61 72 79 20 66 69 6c | 65 20 74 6f 0d 20 20 20 |rary fil|e to. | |00000fd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | | |00000fe0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | | |00000ff0| 61 76 6f 69 64 20 66 73 | 65 65 6b 2d 50 44 53 20 |avoid fs|eek-PDS | |00001000| 6c 69 6d 69 74 61 74 69 | 6f 6e 73 20 2a 2f 0d 23 |limitati|ons */.#| |00001010| 65 6c 73 65 09 09 09 09 | 09 2f 2a 20 4d 56 53 20 |else....|./* MVS | |00001020| 2a 2f 0d 20 20 20 6f 75 | 74 66 69 6c 65 20 3d 20 |*/. ou|tfile = | |00001030| 66 6f 70 65 6e 28 6f 75 | 74 6e 61 6d 65 2c 20 57 |fopen(ou|tname, W| |00001040| 72 69 74 65 42 69 6e 61 | 72 79 29 3b 0d 23 65 6e |riteBina|ry);.#en| |00001050| 64 69 66 09 09 09 09 09 | 2f 2a 20 4d 56 53 20 2a |dif.....|/* MVS *| |00001060| 2f 0d 0d 2f 2a 0d 20 2a | 20 54 68 65 20 66 6f 6c |/../*. *| The fol| |00001070| 6c 6f 77 69 6e 67 20 63 | 6f 64 65 20 69 73 20 6f |lowing c|ode is o| |00001080| 70 65 72 61 74 69 6e 67 | 2d 73 79 73 74 65 6d 20 |perating|-system | |00001090| 64 65 70 65 6e 64 65 6e | 74 20 5b 40 6c 69 6e 6b |dependen|t [@link| |000010a0| 2e 30 32 5d 2e 20 20 53 | 65 74 0d 20 2a 20 20 75 |.02]. S|et. * u| |000010b0| 6e 74 72 61 6e 73 6c 61 | 74 65 64 20 6d 6f 64 65 |ntransla|ted mode| |000010c0| 20 69 66 20 6e 65 63 65 | 73 73 61 72 79 2e 0d 20 | if nece|ssary.. | |000010d0| 2a 2f 0d 0d 23 69 66 20 | 50 4f 52 54 0d 20 20 20 |*/..#if |PORT. | |000010e0| 2f 2a 20 70 72 6f 62 61 | 62 6c 79 20 6e 6f 74 68 |/* proba|bly noth| |000010f0| 69 6e 67 20 2a 2f 0d 44 | 65 6c 69 62 65 72 61 74 |ing */.D|eliberat| |00001100| 65 20 53 79 6e 74 61 78 | 20 45 72 72 6f 72 0d 23 |e Syntax| Error.#| |00001110| 65 6e 64 69 66 09 09 09 | 09 09 2f 2a 20 50 4f 52 |endif...|../* POR| |00001120| 54 20 2a 2f 0d 0d 23 69 | 66 20 41 4d 49 47 41 20 |T */..#i|f AMIGA | |00001130| 7c 7c 20 41 52 4d 20 7c | 7c 20 41 54 41 52 49 5f ||| ARM ||| ATARI_| |00001140| 53 54 20 7c 7c 20 4d 41 | 43 49 4e 54 4f 53 48 20 |ST || MA|CINTOSH | |00001150| 7c 7c 20 4d 56 53 20 7c | 7c 20 55 4e 49 58 20 7c ||| MVS ||| UNIX || |00001160| 7c 20 56 4d 20 7c 7c 20 | 56 4d 53 0d 20 20 20 2f || VM || |VMS. /| |00001170| 2a 20 6e 6f 74 68 69 6e | 67 20 74 6f 20 64 6f 20 |* nothin|g to do | |00001180| 2a 2f 0d 23 65 6e 64 69 | 66 09 09 09 09 09 2f 2a |*/.#endi|f...../*| |00001190| 20 41 4d 49 47 41 20 7c | 7c 20 41 52 4d 20 7c 7c | AMIGA ||| ARM ||| |000011a0| 20 41 54 41 52 49 5f 53 | 54 20 7c 7c 20 2e 2e 2e | ATARI_S|T || ...| |000011b0| 20 2a 2f 0d 0d 23 69 66 | 20 4d 53 44 4f 53 0d 0d | */..#if| MSDOS..| |000011c0| 23 69 66 20 4c 41 54 54 | 49 43 45 0d 20 20 20 66 |#if LATT|ICE. f| |000011d0| 6d 6f 64 65 28 6f 75 74 | 66 69 6c 65 2c 31 29 3b |mode(out|file,1);| |000011e0| 09 09 09 2f 2a 20 73 65 | 74 20 66 6f 72 20 75 6e |.../* se|t for un| |000011f0| 74 72 61 6e 73 6c 61 74 | 65 64 20 6d 6f 64 65 20 |translat|ed mode | |00001200| 2a 2f 0d 23 65 6e 64 69 | 66 09 09 09 09 09 2f 2a |*/.#endi|f...../*| |00001210| 20 4c 41 54 54 49 43 45 | 20 2a 2f 0d 23 69 66 20 | LATTICE| */.#if | |00001220| 4d 49 43 52 4f 53 4f 46 | 54 20 7c 7c 20 54 55 52 |MICROSOF|T || TUR| |00001230| 42 4f 0d 20 20 20 73 65 | 74 6d 6f 64 65 28 66 69 |BO. se|tmode(fi| |00001240| 6c 65 6e 6f 28 6f 75 74 | 66 69 6c 65 29 2c 4f 5f |leno(out|file),O_| |00001250| 42 49 4e 41 52 59 29 3b | 09 2f 2a 20 73 65 74 20 |BINARY);|./* set | |00001260| 66 6f 72 20 75 6e 74 72 | 61 6e 73 6c 61 74 65 64 |for untr|anslated| |00001270| 20 6d 6f 64 65 20 2a 2f | 0d 23 65 6e 64 69 66 09 | mode */|.#endif.| |00001280| 09 09 09 09 2f 2a 20 4d | 49 43 52 4f 53 4f 46 54 |..../* M|ICROSOFT| |00001290| 20 7c 7c 20 54 55 52 42 | 4f 20 2a 2f 0d 23 65 6e | || TURB|O */.#en| |000012a0| 64 69 66 09 09 09 09 09 | 2f 2a 20 4d 53 44 4f 53 |dif.....|/* MSDOS| |000012b0| 20 2a 2f 0d 0d 23 69 66 | 20 4f 53 32 0d 23 69 66 | */..#if| OS2.#if| |000012c0| 20 4d 49 43 52 4f 53 4f | 46 54 20 7c 7c 20 43 53 | MICROSO|FT || CS| |000012d0| 45 54 32 0d 20 20 20 73 | 65 74 6d 6f 64 65 28 66 |ET2. s|etmode(f| |000012e0| 69 6c 65 6e 6f 28 6f 75 | 74 66 69 6c 65 29 2c 4f |ileno(ou|tfile),O| |000012f0| 5f 42 49 4e 41 52 59 29 | 3b 0d 23 65 6e 64 69 66 |_BINARY)|;.#endif| |00001300| 09 09 09 09 09 2f 2a 20 | 4d 49 43 52 4f 53 4f 46 |...../* |MICROSOF| |00001310| 54 20 7c 7c 20 43 53 45 | 54 32 20 2a 2f 0d 23 65 |T || CSE|T2 */.#e| |00001320| 6e 64 69 66 09 09 09 09 | 09 2f 2a 20 4f 53 32 20 |ndif....|./* OS2 | |00001330| 2a 2f 0d 0d 2f 2a 0d 20 | 2a 20 45 6e 64 20 6f 66 |*/../*. |* End of| |00001340| 20 6f 70 65 72 61 74 69 | 6e 67 2d 73 79 73 74 65 | operati|ng-syste| |00001350| 6d 20 73 70 65 63 69 66 | 69 63 20 63 6f 64 65 2e |m specif|ic code.| |00001360| 0d 20 2a 2f 0d 20 0d 20 | 20 20 69 66 20 28 6f 75 |. */. . | if (ou| |00001370| 74 66 69 6c 65 20 3d 3d | 20 4e 55 4c 4c 29 20 0d |tfile ==| NULL) .| |00001380| 20 20 20 20 20 20 71 75 | 69 74 66 28 22 63 61 6e | qu|itf("can| |00001390| 6e 6f 74 20 63 72 65 61 | 74 65 20 25 73 22 2c 6f |not crea|te %s",o| |000013a0| 75 74 6e 61 6d 65 29 3b | 0d 0d 23 69 66 64 65 66 |utname);|..#ifdef| |000013b0| 20 48 65 61 64 65 72 0d | 20 20 20 2f 2a 0d 20 20 | Header.| /*. | |000013c0| 20 20 2a 20 4f 70 65 6e | 20 48 65 61 64 65 72 2c | * Open| Header,| |000013d0| 20 77 68 69 63 68 20 63 | 6f 6e 74 61 69 6e 73 20 | which c|ontains | |000013e0| 74 68 65 20 73 74 61 72 | 74 2d 75 70 20 70 72 6f |the star|t-up pro| |000013f0| 67 72 61 6d 20 61 6e 64 | 20 63 6f 70 79 20 69 74 |gram and| copy it| |00001400| 20 74 6f 20 74 68 65 0d | 20 20 20 20 2a 20 20 6f | to the.| * o| |00001410| 75 74 70 75 74 20 66 69 | 6c 65 2e 20 20 54 68 65 |utput fi|le. The| |00001420| 6e 2c 20 77 72 69 74 65 | 20 6f 75 74 20 6e 75 6c |n, write| out nul| |00001430| 6c 20 62 79 74 65 73 20 | 74 6f 20 70 61 73 74 20 |l bytes |to past | |00001440| 74 68 65 20 65 6e 64 20 | 6f 66 20 74 68 65 0d 20 |the end |of the. | |00001450| 20 20 20 2a 20 20 73 74 | 61 72 74 2d 75 70 20 70 | * st|art-up p| |00001460| 72 6f 67 72 61 6d 2e 0d | 20 20 20 20 2a 2f 0d 20 |rogram..| */. | |00001470| 20 20 7b 0d 20 20 20 69 | 6e 74 20 68 73 69 7a 65 | {. i|nt hsize| |00001480| 3b 0d 20 20 20 63 68 61 | 72 20 68 6e 61 6d 65 5b |;. cha|r hname[| |00001490| 4d 61 78 46 69 6c 65 4e | 61 6d 65 5d 3b 0d 20 20 |MaxFileN|ame];. | |000014a0| 20 63 68 61 72 20 68 64 | 72 64 61 74 5b 4d 61 78 | char hd|rdat[Max| |000014b0| 48 65 61 64 65 72 2b 31 | 5d 3b 0d 0d 20 20 20 66 |Header+1|];.. f| |000014c0| 77 72 69 74 65 28 69 63 | 6f 6e 78 68 64 72 2c 20 |write(ic|onxhdr, | |000014d0| 73 69 7a 65 6f 66 28 63 | 68 61 72 29 2c 20 4d 61 |sizeof(c|har), Ma| |000014e0| 78 48 65 61 64 65 72 2c | 20 6f 75 74 66 69 6c 65 |xHeader,| outfile| |000014f0| 29 3b 0d 0d 20 20 20 7d | 0d 23 65 6e 64 69 66 09 |);.. }|.#endif.| |00001500| 09 09 09 09 2f 2a 20 48 | 65 61 64 65 72 20 2a 2f |..../* H|eader */| |00001510| 0d 0d 20 20 20 66 6f 72 | 20 28 69 20 3d 20 73 69 |.. for| (i = si| |00001520| 7a 65 6f 66 28 73 74 72 | 75 63 74 20 68 65 61 64 |zeof(str|uct head| |00001530| 65 72 29 3b 20 69 2d 2d | 3b 29 0d 20 20 20 20 20 |er); i--|;). | |00001540| 20 70 75 74 63 28 30 2c | 20 6f 75 74 66 69 6c 65 | putc(0,| outfile| |00001550| 29 3b 0d 20 20 20 66 66 | 6c 75 73 68 28 6f 75 74 |);. ff|lush(out| |00001560| 66 69 6c 65 29 3b 0d 20 | 20 20 69 66 20 28 66 65 |file);. | if (fe| |00001570| 72 72 6f 72 28 6f 75 74 | 66 69 6c 65 29 20 21 3d |rror(out|file) !=| |00001580| 20 30 29 0d 20 20 20 20 | 20 20 71 75 69 74 28 22 | 0). | quit("| |00001590| 75 6e 61 62 6c 65 20 74 | 6f 20 77 72 69 74 65 20 |unable t|o write | |000015a0| 74 6f 20 69 63 6f 64 65 | 20 66 69 6c 65 22 29 3b |to icode| file");| |000015b0| 0d 0d 23 69 66 64 65 66 | 20 44 65 42 75 67 4c 69 |..#ifdef| DeBugLi| |000015c0| 6e 6b 65 72 0d 20 20 20 | 2f 2a 0d 20 20 20 20 2a |nker. |/*. *| |000015d0| 20 4f 70 65 6e 20 74 68 | 65 20 2e 75 78 20 66 69 | Open th|e .ux fi| |000015e0| 6c 65 20 69 66 20 64 65 | 62 75 67 67 69 6e 67 20 |le if de|bugging | |000015f0| 69 73 20 6f 6e 2e 0d 20 | 20 20 20 2a 2f 0d 20 20 |is on.. | */. | |00001600| 20 69 66 20 28 44 66 6c | 61 67 29 20 7b 0d 20 20 | if (Dfl|ag) {. | |00001610| 20 20 20 20 6d 61 6b 65 | 6e 61 6d 65 28 64 62 67 | make|name(dbg| |00001620| 6e 61 6d 65 2c 20 54 61 | 72 67 65 74 44 69 72 2c |name, Ta|rgetDir,| |00001630| 20 6c 6c 66 69 6c 65 73 | 2d 3e 6c 66 5f 6e 61 6d | llfiles|->lf_nam| |00001640| 65 2c 20 22 2e 75 78 22 | 29 3b 0d 20 20 20 20 20 |e, ".ux"|);. | |00001650| 20 64 62 67 66 69 6c 65 | 20 3d 20 66 6f 70 65 6e | dbgfile| = fopen| |00001660| 28 64 62 67 6e 61 6d 65 | 2c 20 57 72 69 74 65 54 |(dbgname|, WriteT| |00001670| 65 78 74 29 3b 0d 20 20 | 20 20 20 20 69 66 20 28 |ext);. | if (| |00001680| 64 62 67 66 69 6c 65 20 | 3d 3d 20 4e 55 4c 4c 29 |dbgfile |== NULL)| |00001690| 0d 20 20 20 20 20 20 20 | 20 20 71 75 69 74 66 28 |. | quitf(| |000016a0| 22 63 61 6e 6e 6f 74 20 | 63 72 65 61 74 65 20 25 |"cannot |create %| |000016b0| 73 22 2c 20 64 62 67 6e | 61 6d 65 29 3b 0d 20 20 |s", dbgn|ame);. | |000016c0| 20 20 20 20 7d 0d 23 65 | 6e 64 69 66 09 09 09 09 | }.#e|ndif....| |000016d0| 09 2f 2a 20 44 65 42 75 | 67 4c 69 6e 6b 65 72 20 |./* DeBu|gLinker | |000016e0| 2a 2f 0d 0d 20 20 20 2f | 2a 0d 20 20 20 20 2a 20 |*/.. /|*. * | |000016f0| 4c 6f 6f 70 20 74 68 72 | 6f 75 67 68 20 69 6e 70 |Loop thr|ough inp| |00001700| 75 74 20 66 69 6c 65 73 | 20 61 6e 64 20 67 65 6e |ut files| and gen| |00001710| 65 72 61 74 65 20 63 6f | 64 65 20 66 6f 72 20 65 |erate co|de for e| |00001720| 61 63 68 2e 0d 20 20 20 | 20 2a 2f 0d 20 20 20 6c |ach.. | */. l| |00001730| 66 6c 73 20 3d 20 6c 6c | 66 69 6c 65 73 3b 0d 20 |fls = ll|files;. | |00001740| 20 20 77 68 69 6c 65 20 | 28 6c 66 20 3d 20 67 65 | while |(lf = ge| |00001750| 74 6c 66 69 6c 65 28 26 | 6c 66 6c 73 29 29 20 7b |tlfile(&|lfls)) {| |00001760| 0d 20 20 20 20 20 20 66 | 69 6c 65 6e 61 6d 65 20 |. f|ilename | |00001770| 3d 20 6c 66 2d 3e 6c 66 | 5f 6e 61 6d 65 3b 0d 20 |= lf->lf|_name;. | |00001780| 20 20 20 20 20 6d 61 6b | 65 6e 61 6d 65 28 69 6e | mak|ename(in| |00001790| 6e 61 6d 65 2c 20 53 6f | 75 72 63 65 44 69 72 2c |name, So|urceDir,| |000017a0| 20 66 69 6c 65 6e 61 6d | 65 2c 20 55 31 53 75 66 | filenam|e, U1Suf| |000017b0| 66 69 78 29 3b 0d 20 20 | 20 20 20 20 6d 61 6b 65 |fix);. | make| |000017c0| 6e 61 6d 65 28 69 63 6e | 6e 61 6d 65 2c 20 54 61 |name(icn|name, Ta| |000017d0| 72 67 65 74 44 69 72 2c | 20 66 69 6c 65 6e 61 6d |rgetDir,| filenam| |000017e0| 65 2c 20 53 6f 75 72 63 | 65 53 75 66 66 69 78 29 |e, Sourc|eSuffix)| |000017f0| 3b 0d 0d 23 69 66 20 4d | 56 53 20 7c 7c 20 56 4d |;..#if M|VS || VM| |00001800| 0d 20 20 20 20 20 20 69 | 6e 66 69 6c 65 20 3d 20 |. i|nfile = | |00001810| 66 6f 70 65 6e 28 69 6e | 6e 61 6d 65 2c 20 52 65 |fopen(in|name, Re| |00001820| 61 64 42 69 6e 61 72 79 | 29 3b 0d 20 20 20 20 20 |adBinary|);. | |00001830| 20 69 66 20 28 69 6e 66 | 69 6c 65 20 21 3d 20 4e | if (inf|ile != N| |00001840| 55 4c 4c 29 20 20 20 20 | 20 20 20 20 20 2f 2a 20 |ULL) | /* | |00001850| 64 69 73 63 61 72 64 20 | 74 68 65 20 65 78 74 72 |discard |the extr| |00001860| 61 20 62 6c 61 6e 6b 20 | 77 65 20 68 61 64 20 2a |a blank |we had *| |00001870| 2f 0d 20 20 20 20 20 20 | 20 20 20 28 76 6f 69 64 |/. | (void| |00001880| 29 20 67 65 74 63 28 69 | 6e 66 69 6c 65 29 3b 20 |) getc(i|nfile); | |00001890| 20 20 20 20 2f 2a 20 74 | 6f 20 77 72 69 74 65 20 | /* t|o write | |000018a0| 74 6f 20 6d 61 6b 65 20 | 69 74 20 6e 6f 6e 2d 65 |to make |it non-e| |000018b0| 6d 70 74 79 20 20 2a 2f | 0d 23 65 6c 73 65 20 20 |mpty */|.#else | |000018c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | | |000018d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | | |000018e0| 20 2f 2a 20 4d 56 53 20 | 7c 7c 20 56 4d 20 2a 2f | /* MVS ||| VM */| |000018f0| 0d 20 20 20 20 20 20 69 | 6e 66 69 6c 65 20 3d 20 |. i|nfile = | |00001900| 66 6f 70 65 6e 28 69 6e | 6e 61 6d 65 2c 20 52 65 |fopen(in|name, Re| |00001910| 61 64 54 65 78 74 29 3b | 0d 23 65 6e 64 69 66 20 |adText);|.#endif | |00001920| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | | |00001930| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | | |00001940| 20 2f 2a 20 4d 56 53 20 | 7c 7c 20 56 4d 20 2a 2f | /* MVS ||| VM */| |00001950| 0d 0d 20 20 20 20 20 20 | 69 66 20 28 69 6e 66 69 |.. |if (infi| |00001960| 6c 65 20 3d 3d 20 4e 55 | 4c 4c 29 0d 20 20 20 20 |le == NU|LL). | |00001970| 20 20 20 20 20 71 75 69 | 74 66 28 22 63 61 6e 6e | qui|tf("cann| |00001980| 6f 74 20 6f 70 65 6e 20 | 25 73 22 2c 20 69 6e 6e |ot open |%s", inn| |00001990| 61 6d 65 29 3b 0d 20 20 | 20 20 20 20 67 65 6e 63 |ame);. | genc| |000019a0| 6f 64 65 28 29 3b 0d 0d | 23 69 66 64 65 66 20 58 |ode();..|#ifdef X| |000019b0| 76 65 72 0d 78 76 65 72 | 28 6c 69 6e 6b 2e 32 29 |ver.xver|(link.2)| |000019c0| 0d 23 65 6e 64 69 66 09 | 09 09 09 09 2f 2a 20 58 |.#endif.|..../* X| |000019d0| 76 65 72 20 2a 2f 0d 0d | 20 20 20 20 20 20 66 63 |ver */..| fc| |000019e0| 6c 6f 73 65 28 69 6e 66 | 69 6c 65 29 3b 0d 20 20 |lose(inf|ile);. | |000019f0| 20 20 20 20 7d 0d 0d 23 | 69 66 64 65 66 20 58 76 | }..#|ifdef Xv| |00001a00| 65 72 0d 78 76 65 72 28 | 6c 69 6e 6b 2e 33 29 0d |er.xver(|link.3).| |00001a10| 23 65 6e 64 69 66 09 09 | 09 09 09 2f 2a 20 58 76 |#endif..|.../* Xv| |00001a20| 65 72 20 2a 2f 0d 0d 20 | 20 20 67 65 6e 74 61 62 |er */.. | gentab| |00001a30| 6c 65 73 28 29 3b 09 09 | 2f 2a 20 47 65 6e 65 72 |les();..|/* Gener| |00001a40| 61 74 65 20 72 65 63 6f | 72 64 2c 20 66 69 65 6c |ate reco|rd, fiel| |00001a50| 64 2c 20 67 6c 6f 62 61 | 6c 2c 20 67 6c 6f 62 61 |d, globa|l, globa| |00001a60| 6c 20 6e 61 6d 65 73 2c | 0d 09 09 09 20 20 20 73 |l names,|.... s| |00001a70| 74 61 74 69 63 2c 20 61 | 6e 64 20 69 64 65 6e 74 |tatic, a|nd ident| |00001a80| 69 66 69 65 72 20 74 61 | 62 6c 65 73 2e 20 2a 2f |ifier ta|bles. */| |00001a90| 0d 20 20 20 66 63 6c 6f | 73 65 28 6f 75 74 66 69 |. fclo|se(outfi| |00001aa0| 6c 65 29 3b 0d 20 20 20 | 6c 6d 66 72 65 65 28 29 |le);. |lmfree()| |00001ab0| 3b 0d 20 20 20 69 66 20 | 28 66 61 74 61 6c 73 20 |;. if |(fatals | |00001ac0| 3e 20 30 29 0d 20 20 20 | 20 20 20 72 65 74 75 72 |> 0). | retur| |00001ad0| 6e 20 66 61 74 61 6c 73 | 3b 0d 20 20 20 73 65 74 |n fatals|;. set| |00001ae0| 65 78 65 28 6f 75 74 6e | 61 6d 65 29 3b 0d 20 20 |exe(outn|ame);. | |00001af0| 20 72 65 74 75 72 6e 20 | 30 3b 0d 20 20 20 7d 0d | return |0;. }.| |00001b00| 0c 0d 2f 2a 0d 20 2a 20 | 6c 77 61 72 6e 20 2d 20 |../*. * |lwarn - | |00001b10| 69 73 73 75 65 20 61 20 | 6c 69 6e 6b 65 72 20 77 |issue a |linker w| |00001b20| 61 72 6e 69 6e 67 20 6d | 65 73 73 61 67 65 2e 0d |arning m|essage..| |00001b30| 20 2a 2f 0d 6e 6f 76 61 | 6c 75 65 20 6c 77 61 72 | */.nova|lue lwar| |00001b40| 6e 28 73 31 2c 20 73 32 | 2c 20 73 33 29 0d 63 68 |n(s1, s2|, s3).ch| |00001b50| 61 72 20 2a 73 31 2c 20 | 2a 73 32 2c 20 2a 73 33 |ar *s1, |*s2, *s3| |00001b60| 3b 0d 20 20 20 7b 0d 20 | 20 20 66 70 72 69 6e 74 |;. {. | fprint| |00001b70| 66 28 73 74 64 65 72 72 | 2c 20 22 25 73 3a 20 22 |f(stderr|, "%s: "| |00001b80| 2c 20 69 63 6e 6e 61 6d | 65 29 3b 0d 20 20 20 69 |, icnnam|e);. i| |00001b90| 66 20 28 6c 69 6e 65 6e | 6f 29 0d 20 20 20 20 20 |f (linen|o). | |00001ba0| 20 66 70 72 69 6e 74 66 | 28 73 74 64 65 72 72 2c | fprintf|(stderr,| |00001bb0| 20 22 4c 69 6e 65 20 25 | 64 20 23 20 3a 22 2c 20 | "Line %|d # :", | |00001bc0| 6c 69 6e 65 6e 6f 29 3b | 0d 20 20 20 66 70 72 69 |lineno);|. fpri| |00001bd0| 6e 74 66 28 73 74 64 65 | 72 72 2c 20 22 5c 22 25 |ntf(stde|rr, "\"%| |00001be0| 73 5c 22 3a 20 25 73 25 | 73 5c 6e 22 2c 20 73 31 |s\": %s%|s\n", s1| |00001bf0| 2c 20 73 32 2c 20 73 33 | 29 3b 0d 20 20 20 66 66 |, s2, s3|);. ff| |00001c00| 6c 75 73 68 28 73 74 64 | 65 72 72 29 3b 0d 20 20 |lush(std|err);. | |00001c10| 20 7d 0d 0c 0d 2f 2a 0d | 20 2a 20 6c 66 61 74 61 | }.../*.| * lfata| |00001c20| 6c 20 2d 20 69 73 73 75 | 65 20 61 20 66 61 74 61 |l - issu|e a fata| |00001c30| 6c 20 6c 69 6e 6b 65 72 | 20 65 72 72 6f 72 20 6d |l linker| error m| |00001c40| 65 73 73 61 67 65 2e 0d | 20 2a 2f 0d 0d 6e 6f 76 |essage..| */..nov| |00001c50| 61 6c 75 65 20 6c 66 61 | 74 61 6c 28 73 31 2c 20 |alue lfa|tal(s1, | |00001c60| 73 32 29 0d 63 68 61 72 | 20 2a 73 31 2c 20 2a 73 |s2).char| *s1, *s| |00001c70| 32 3b 0d 20 20 20 7b 0d | 0d 20 20 20 66 70 72 69 |2;. {.|. fpri| |00001c80| 6e 74 66 28 73 74 64 65 | 72 72 2c 20 22 25 73 3a |ntf(stde|rr, "%s:| |00001c90| 20 22 2c 20 69 63 6e 6e | 61 6d 65 29 3b 0d 20 20 | ", icnn|ame);. | |00001ca0| 20 69 66 20 28 6c 69 6e | 65 6e 6f 29 0d 20 20 20 | if (lin|eno). | |00001cb0| 20 20 20 66 70 72 69 6e | 74 66 28 73 74 64 65 72 | fprin|tf(stder| |00001cc0| 72 2c 20 22 4c 69 6e 65 | 20 25 64 20 23 20 3a 20 |r, "Line| %d # : | |00001cd0| 22 2c 20 6c 69 6e 65 6e | 6f 29 3b 0d 20 20 20 66 |", linen|o);. f| |00001ce0| 70 72 69 6e 74 66 28 73 | 74 64 65 72 72 2c 20 22 |printf(s|tderr, "| |00001cf0| 5c 22 25 73 5c 22 3a 20 | 25 73 5c 6e 22 2c 20 73 |\"%s\": |%s\n", s| |00001d00| 31 2c 20 73 32 29 3b 0d | 20 20 20 66 61 74 61 6c |1, s2);.| fatal| |00001d10| 73 2b 2b 3b 0d 20 20 20 | 7d 0d 0c 0d 2f 2a 0d 20 |s++;. |}.../*. | |00001d20| 2a 20 73 65 74 65 78 65 | 20 2d 20 6d 61 72 6b 20 |* setexe| - mark | |00001d30| 74 68 65 20 6f 75 74 70 | 75 74 20 66 69 6c 65 20 |the outp|ut file | |00001d40| 61 73 20 65 78 65 63 75 | 74 61 62 6c 65 0d 20 2a |as execu|table. *| |00001d50| 2f 0d 0d 73 74 61 74 69 | 63 20 6e 6f 76 61 6c 75 |/..stati|c novalu| |00001d60| 65 20 73 65 74 65 78 65 | 28 66 6e 61 6d 65 29 0d |e setexe|(fname).| |00001d70| 63 68 61 72 20 2a 66 6e | 61 6d 65 3b 0d 20 20 20 |char *fn|ame;. | |00001d80| 7b 0d 0d 2f 2a 0d 20 2a | 20 54 68 65 20 66 6f 6c |{../*. *| The fol| |00001d90| 6c 6f 77 69 6e 67 20 63 | 6f 64 65 20 69 73 20 6f |lowing c|ode is o| |00001da0| 70 65 72 61 74 69 6e 67 | 2d 73 79 73 74 65 6d 20 |perating|-system | |00001db0| 64 65 70 65 6e 64 65 6e | 74 20 5b 40 6c 69 6e 6b |dependen|t [@link| |00001dc0| 2e 30 33 5d 2e 20 20 49 | 74 20 63 68 61 6e 67 65 |.03]. I|t change| |00001dd0| 73 20 74 68 65 0d 20 2a | 20 20 6d 6f 64 65 20 6f |s the. *| mode o| |00001de0| 66 20 65 78 65 63 75 74 | 61 62 6c 65 20 66 69 6c |f execut|able fil| |00001df0| 65 20 73 6f 20 74 68 61 | 74 20 69 74 20 63 61 6e |e so tha|t it can| |00001e00| 20 62 65 20 65 78 65 63 | 75 74 65 64 20 64 69 72 | be exec|uted dir| |00001e10| 65 63 74 6c 79 2e 0d 20 | 2a 2f 0d 0d 23 69 66 20 |ectly.. |*/..#if | |00001e20| 50 4f 52 54 0d 20 20 20 | 2f 2a 20 73 6f 6d 65 74 |PORT. |/* somet| |00001e30| 68 69 6e 67 20 69 73 20 | 6e 65 65 64 65 64 20 2a |hing is |needed *| |00001e40| 2f 0d 44 65 6c 69 62 65 | 72 61 74 65 20 53 79 6e |/.Delibe|rate Syn| |00001e50| 74 61 78 20 45 72 72 6f | 72 0d 23 65 6e 64 69 66 |tax Erro|r.#endif| |00001e60| 09 09 09 09 09 2f 2a 20 | 50 4f 52 54 20 2a 2f 0d |...../* |PORT */.| |00001e70| 0d 23 69 66 20 41 4d 49 | 47 41 0d 20 20 20 2f 2a |.#if AMI|GA. /*| |00001e80| 20 6e 6f 74 20 6e 65 63 | 65 73 73 61 72 79 20 2a | not nec|essary *| |00001e90| 2f 0d 23 65 6e 64 69 66 | 09 09 09 09 09 2f 2a 20 |/.#endif|...../* | |00001ea0| 41 4d 49 47 41 20 2a 2f | 0d 0d 23 69 66 20 41 52 |AMIGA */|..#if AR| |00001eb0| 4d 0d 20 20 20 7b 0d 20 | 20 20 20 20 20 5f 6b 65 |M. {. | _ke| |00001ec0| 72 6e 65 6c 5f 73 77 69 | 5f 72 65 67 73 20 72 65 |rnel_swi|_regs re| |00001ed0| 67 73 3b 0d 0d 20 20 20 | 20 20 20 72 65 67 73 2e |gs;.. | regs.| |00001ee0| 72 5b 30 5d 20 3d 20 33 | 31 3b 0d 20 20 20 20 20 |r[0] = 3|1;. | |00001ef0| 20 72 65 67 73 2e 72 5b | 31 5d 20 3d 20 28 69 6e | regs.r[|1] = (in| |00001f00| 74 29 22 49 63 6f 6e 22 | 3b 0d 20 20 20 20 20 20 |t)"Icon"|;. | |00001f10| 69 66 20 28 5f 6b 65 72 | 6e 65 6c 5f 73 77 69 28 |if (_ker|nel_swi(| |00001f20| 4f 53 5f 46 53 43 6f 6e | 74 72 6f 6c 2c 26 72 65 |OS_FSCon|trol,&re| |00001f30| 67 73 2c 26 72 65 67 73 | 29 20 3d 3d 20 4e 55 4c |gs,®s|) == NUL| |00001f40| 4c 29 0d 20 20 20 20 20 | 20 7b 0d 20 20 20 20 20 |L). | {. | |00001f50| 20 20 20 20 72 65 67 73 | 2e 72 5b 30 5d 20 3d 20 | regs|.r[0] = | |00001f60| 31 38 3b 0d 20 20 20 20 | 20 20 20 20 20 72 65 67 |18;. | reg| |00001f70| 73 2e 72 5b 31 5d 20 3d | 20 28 69 6e 74 29 66 6e |s.r[1] =| (int)fn| |00001f80| 61 6d 65 3b 0d 20 20 20 | 20 20 20 20 20 20 5f 6b |ame;. | _k| |00001f90| 65 72 6e 65 6c 5f 73 77 | 69 28 4f 53 5f 46 69 6c |ernel_sw|i(OS_Fil| |00001fa0| 65 2c 26 72 65 67 73 2c | 26 72 65 67 73 29 3b 0d |e,®s,|®s);.| |00001fb0| 20 20 20 20 20 20 7d 0d | 20 20 20 7d 0d 23 65 6e | }.| }.#en| |00001fc0| 64 69 66 09 09 09 09 09 | 2f 2a 20 41 52 4d 20 2a |dif.....|/* ARM *| |00001fd0| 2f 0d 0d 23 69 66 20 41 | 54 41 52 49 5f 53 54 20 |/..#if A|TARI_ST | |00001fe0| 7c 7c 20 4d 53 44 4f 53 | 20 7c 7c 20 4d 56 53 20 ||| MSDOS| || MVS | |00001ff0| 7c 7c 20 4f 53 32 20 7c | 7c 20 56 4d 20 7c 7c 20 ||| OS2 ||| VM || | |00002000| 56 4d 53 20 0d 20 20 20 | 2f 2a 20 63 61 6e 27 74 |VMS . |/* can't| |00002010| 20 62 65 20 6d 61 64 65 | 20 65 78 65 63 75 74 61 | be made| executa| |00002020| 62 6c 65 20 2a 2f 0d 20 | 20 20 2f 2a 20 6e 6f 74 |ble */. | /* not| |00002030| 65 3a 20 56 4d 53 20 66 | 69 6c 65 73 20 63 61 6e |e: VMS f|iles can| |00002040| 27 74 20 62 65 20 6d 61 | 64 65 20 65 78 65 63 75 |'t be ma|de execu| |00002050| 74 61 62 6c 65 2c 20 62 | 75 74 20 73 65 65 20 22 |table, b|ut see "| |00002060| 69 65 78 65 2e 63 6f 6d | 22 20 75 6e 64 65 72 20 |iexe.com|" under | |00002070| 56 4d 53 2e 20 2a 2f 0d | 23 65 6e 64 69 66 09 09 |VMS. */.|#endif..| |00002080| 09 09 09 2f 2a 20 41 54 | 41 52 49 5f 53 54 20 7c |.../* AT|ARI_ST || |00002090| 7c 20 4d 53 44 4f 53 20 | 7c 7c 20 56 4d 53 20 2a || MSDOS ||| VMS *| |000020a0| 2f 0d 0d 23 69 66 20 4d | 41 43 49 4e 54 4f 53 48 |/..#if M|ACINTOSH| |000020b0| 0d 23 69 66 20 4d 50 57 | 0d 20 20 20 2f 2a 20 4e |.#if MPW|. /* N| |000020c0| 6f 74 68 69 6e 67 20 74 | 6f 20 64 6f 20 68 65 72 |othing t|o do her| |000020d0| 65 20 2d 2d 20 66 69 6c | 65 20 69 73 20 73 65 74 |e -- fil|e is set| |000020e0| 20 74 6f 20 74 79 70 65 | 20 54 45 58 54 0d 20 20 | to type| TEXT. | |000020f0| 20 20 20 20 28 73 6f 20 | 69 74 20 63 61 6e 20 62 | (so |it can b| |00002100| 65 20 65 78 65 63 75 74 | 65 64 20 61 73 20 61 20 |e execut|ed as a | |00002110| 73 63 72 69 70 74 29 20 | 69 6e 20 74 6d 61 69 6e |script) |in tmain| |00002120| 2e 63 2e 0d 20 20 20 2a | 2f 0d 2f 2a 20 23 70 72 |.c.. *|/./* #pr| |00002130| 61 67 6d 61 20 75 6e 75 | 73 65 64 28 66 6e 61 6d |agma unu|sed(fnam| |00002140| 65 29 20 2a 2f 0d 23 65 | 6e 64 69 66 09 09 09 09 |e) */.#e|ndif....| |00002150| 09 2f 2a 20 4d 50 57 20 | 2a 2f 0d 23 65 6e 64 69 |./* MPW |*/.#endi| |00002160| 66 09 09 09 09 09 2f 2a | 20 4d 41 43 49 4e 54 4f |f...../*| MACINTO| |00002170| 53 48 20 2a 2f 0d 0d 23 | 69 66 20 4d 53 44 4f 53 |SH */..#|if MSDOS| |00002180| 0d 23 69 66 20 4c 41 54 | 54 49 43 45 20 7c 7c 20 |.#if LAT|TICE || | |00002190| 4d 49 43 52 4f 53 4f 46 | 54 20 7c 7c 20 54 55 52 |MICROSOF|T || TUR| |000021a0| 42 4f 0d 20 20 20 63 68 | 6d 6f 64 28 66 6e 61 6d |BO. ch|mod(fnam| |000021b0| 65 2c 30 37 35 35 29 3b | 09 2f 2a 20 70 72 6f 62 |e,0755);|./* prob| |000021c0| 61 62 6c 79 20 63 6f 75 | 6c 64 20 62 65 20 73 6d |ably cou|ld be sm| |000021d0| 61 72 74 65 72 2e 2e 2e | 20 2a 2f 0d 23 65 6e 64 |arter...| */.#end| |000021e0| 69 66 09 09 09 09 09 2f | 2a 20 4c 41 54 54 49 43 |if...../|* LATTIC| |000021f0| 45 20 7c 7c 20 4d 49 43 | 52 4f 53 4f 46 54 20 7c |E || MIC|ROSOFT || |00002200| 7c 20 54 55 52 42 4f 20 | 2a 2f 0d 23 69 66 20 4d || TURBO |*/.#if M| |00002210| 57 43 0d 20 20 20 2f 2a | 20 63 61 6e 27 74 20 68 |WC. /*| can't h| |00002220| 61 6e 64 6c 65 20 2a 2f | 0d 23 65 6e 64 69 66 09 |andle */|.#endif.| |00002230| 09 09 09 09 2f 2a 20 4d | 57 43 20 2a 2f 0d 23 65 |..../* M|WC */.#e| |00002240| 6e 64 69 66 09 09 09 09 | 09 2f 2a 20 4d 53 44 4f |ndif....|./* MSDO| |00002250| 53 20 2a 2f 0d 0d 23 69 | 66 20 55 4e 49 58 0d 20 |S */..#i|f UNIX. | |00002260| 20 20 20 20 20 7b 0d 20 | 20 20 20 20 20 73 74 72 | {. | str| |00002270| 75 63 74 20 73 74 61 74 | 20 73 74 62 75 66 3b 0d |uct stat| stbuf;.| |00002280| 20 20 20 20 20 20 69 6e | 74 20 75 2c 20 72 2c 20 | in|t u, r, | |00002290| 6d 3b 0d 20 20 20 20 20 | 20 2f 2a 0d 20 20 20 20 |m;. | /*. | |000022a0| 20 20 20 2a 20 53 65 74 | 20 65 61 63 68 20 6f 66 | * Set| each of| |000022b0| 20 74 68 65 20 74 68 72 | 65 65 20 65 78 65 63 75 | the thr|ee execu| |000022c0| 74 65 20 62 69 74 73 20 | 28 6f 77 6e 65 72 2c 67 |te bits |(owner,g| |000022d0| 72 6f 75 70 2c 6f 74 68 | 65 72 29 20 69 66 20 61 |roup,oth|er) if a| |000022e0| 6c 6c 6f 77 65 64 20 62 | 79 0d 20 20 20 20 20 20 |llowed b|y. | |000022f0| 20 2a 20 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | * the |current | |00002300| 75 6d 61 73 6b 20 61 6e | 64 20 69 66 20 74 68 65 |umask an|d if the| |00002310| 20 63 6f 72 72 65 73 70 | 6f 6e 64 69 6e 67 20 72 | corresp|onding r| |00002320| 65 61 64 20 62 69 74 20 | 69 73 20 73 65 74 3b 20 |ead bit |is set; | |00002330| 64 6f 20 6e 6f 74 0d 20 | 20 20 20 20 20 20 2a 20 |do not. | * | |00002340| 20 63 6c 65 61 72 20 61 | 6e 79 20 62 69 74 73 20 | clear a|ny bits | |00002350| 61 6c 72 65 61 64 79 20 | 73 65 74 2e 0d 20 20 20 |already |set.. | |00002360| 20 20 20 20 2a 2f 0d 20 | 20 20 20 20 20 75 6d 61 | */. | uma| |00002370| 73 6b 28 75 20 3d 20 75 | 6d 61 73 6b 28 30 29 29 |sk(u = u|mask(0))| |00002380| 3b 09 09 2f 2a 20 67 65 | 74 20 61 6e 64 20 72 65 |;../* ge|t and re| |00002390| 73 74 6f 72 65 20 75 6d | 61 73 6b 20 2a 2f 0d 20 |store um|ask */. | |000023a0| 20 20 20 20 20 69 66 20 | 28 73 74 61 74 28 66 6e | if |(stat(fn| |000023b0| 61 6d 65 2c 26 73 74 62 | 75 66 29 20 3d 3d 20 30 |ame,&stb|uf) == 0| |000023c0| 29 20 20 7b 09 2f 2a 20 | 6d 75 73 74 20 66 69 72 |) {./* |must fir| |000023d0| 73 74 20 72 65 61 64 20 | 65 78 69 73 74 69 6e 67 |st read |existing| |000023e0| 20 6d 6f 64 65 20 2a 2f | 0d 20 20 20 20 20 20 20 | mode */|. | |000023f0| 20 20 72 20 3d 20 28 73 | 74 62 75 66 2e 73 74 5f | r = (s|tbuf.st_| |00002400| 6d 6f 64 65 20 26 20 30 | 34 34 34 29 20 3e 3e 20 |mode & 0|444) >> | |00002410| 32 3b 09 2f 2a 20 67 65 | 74 20 26 20 70 6f 73 69 |2;./* ge|t & posi| |00002420| 74 69 6f 6e 20 72 65 61 | 64 20 62 69 74 73 20 2a |tion rea|d bits *| |00002430| 2f 0d 20 20 20 20 20 20 | 20 20 20 6d 20 3d 20 73 |/. | m = s| |00002440| 74 62 75 66 2e 73 74 5f | 6d 6f 64 65 20 7c 20 28 |tbuf.st_|mode | (| |00002450| 72 20 26 20 7e 75 29 3b | 09 09 2f 2a 20 73 65 74 |r & ~u);|../* set| |00002460| 20 65 78 65 63 75 74 65 | 20 62 69 74 73 20 2a 2f | execute| bits */| |00002470| 0d 20 20 20 20 20 20 20 | 20 20 63 68 6d 6f 64 28 |. | chmod(| |00002480| 66 6e 61 6d 65 2c 6d 29 | 3b 09 09 20 2f 2a 20 63 |fname,m)|;.. /* c| |00002490| 68 61 6e 67 65 20 66 69 | 6c 65 20 6d 6f 64 65 20 |hange fi|le mode | |000024a0| 2a 2f 0d 20 20 20 20 20 | 20 20 20 20 7d 0d 20 20 |*/. | }. | |000024b0| 20 20 20 20 7d 0d 23 65 | 6e 64 69 66 09 09 09 09 | }.#e|ndif....| |000024c0| 09 2f 2a 20 55 4e 49 58 | 20 2a 2f 0d 0d 2f 2a 0d |./* UNIX| */../*.| |000024d0| 20 2a 20 45 6e 64 20 6f | 66 20 6f 70 65 72 61 74 | * End o|f operat| |000024e0| 69 6e 67 2d 73 79 73 74 | 65 6d 20 73 70 65 63 69 |ing-syst|em speci| |000024f0| 66 69 63 20 63 6f 64 65 | 2e 0d 20 2a 2f 0d 20 20 |fic code|.. */. | |00002500| 20 7d 0d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 | }......|........| |00002510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00002520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00002530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00002540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00002550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00002560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00002570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00002580| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>| |00002590| 32 00 04 00 00 16 00 01 | 08 69 6e 69 74 5f 6c 65 |2.......|.init_le| |000025a0| 78 06 72 74 74 6c 65 78 | 05 08 00 01 00 02 09 10 |x.rttlex|........| |000025b0| 06 6c 69 6e 6b 2e 63 2d | 02 00 00 00 54 45 58 54 |.link.c-|....TEXT| |000025c0| 4d 50 53 20 00 00 00 00 | 00 00 00 00 00 00 36 62 |MPS ....|......6b| |000025d0| 00 00 54 45 58 54 4d 50 | 53 20 00 00 00 00 00 00 |..TEXTMP|S ......| |000025e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000025f0| 00 00 a6 e0 04 c1 00 00 | 24 83 00 00 01 ac 03 f4 |........|$.......| |00002600| 03 d8 03 bc 03 a0 03 84 | 03 68 03 4c 03 30 03 14 |........|.h.L.0..| |00002610| 02 f8 02 dc 02 c0 02 a4 | 02 88 02 6c 02 50 02 34 |........|...l.P.4| |00002620| 02 18 01 fc 01 e0 01 c4 | 01 a8 01 8c 01 70 01 54 |........|.....p.T| |00002630| 01 38 01 1c 01 00 00 e4 | 00 c8 00 ac 00 90 00 74 |.8......|.......t| |00002640| 00 58 00 3c 09 10 00 9a | 00 04 08 48 07 ee 07 c8 |.X.<....|...H....| |00002650| 07 ac 07 90 07 74 07 58 | 07 3c 07 20 07 04 06 e8 |.....t.X|.<. ....| |00002660| 06 cc 06 b0 06 94 06 80 | 06 6c 06 50 06 34 06 18 |........|.l.P.4..| |00002670| 05 fc 05 e0 05 c4 05 a8 | 05 8c 05 70 05 54 05 38 |........|...p.T.8| |00002680| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 20 6c 69 |...H..Mo|naco. li| |00002690| 6e 6b 69 6e 67 20 70 72 | 6f 63 65 73 73 2e 0d 20 |nking pr|ocess.. | |000026a0| 2a 2f 0d 0d 23 69 00 06 | 00 08 00 2a 00 03 01 53 |*/..#i..|...*...S| |000026b0| 01 fd 00 50 00 20 01 53 | 01 bd a6 fc 66 98 00 00 |...P. .S|....f...| |000026c0| 14 73 00 00 14 73 00 00 | 13 29 01 00 00 00 00 1e |.s...s..|.)......| |000026d0| 00 2a 00 03 01 53 01 fd | 00 50 00 20 01 53 01 bd |.*...S..|.P. .S..| |000026e0| 00 00 13 29 00 00 00 00 | 00 00 00 00 00 00 00 00 |...)....|........| |000026f0| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 00 47 |.....n..|.n...>.G| |00002700| 1a 60 07 5a 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |.`.Z....|.>..MPSR| |00002710| 00 01 00 0a 03 ed ff ff | 00 00 00 00 00 00 00 00 |........|........| |00002720| 03 f0 ff ff 00 00 00 4c | 00 49 15 e8 00 00 00 00 |.......L|.I......| |00002730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00002740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00002750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00002760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00002770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| +--------+-------------------------+-------------------------+--------+--------+