home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / a_utils / perl / mac-perl / mcprl402.bin / Perl_src / array.c < prev    next >
MacBinary  |  1992-09-27  |  6.3 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Sun Sep 27 01:14:53 1992, modified Sun Sep 27 01:14:53 1992, creator 'MPS ', type ASCII, 5690 bytes "array.c" , at 0x16ba 428 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 07 61 72 72 61 79 2e | 63 00 00 00 00 00 00 00 |..array.|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 16 3a 00 | 00 01 ac a6 ea f3 cd a6 |......:.|........|
|00000060| ea f3 cd 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 38 63 00 00 |........|....8c..|
|00000080| 2f 2a 20 24 52 43 53 66 | 69 6c 65 3a 20 61 72 72 |/* $RCSf|ile: arr|
|00000090| 61 79 2e 63 2c 76 20 24 | 24 52 65 76 69 73 69 6f |ay.c,v $|$Revisio|
|000000a0| 6e 3a 20 34 2e 30 2e 31 | 2e 33 20 24 24 44 61 74 |n: 4.0.1|.3 $$Dat|
|000000b0| 65 3a 20 39 32 2f 30 36 | 2f 30 38 20 31 31 3a 34 |e: 92/06|/08 11:4|
|000000c0| 35 3a 30 35 20 24 0d 20 | 2a 0d 20 2a 20 20 20 20 |5:05 $. |*. * |
|000000d0| 43 6f 70 79 72 69 67 68 | 74 20 28 63 29 20 31 39 |Copyrigh|t (c) 19|
|000000e0| 39 31 2c 20 4c 61 72 72 | 79 20 57 61 6c 6c 0d 20 |91, Larr|y Wall. |
|000000f0| 2a 0d 20 2a 20 20 20 20 | 59 6f 75 20 6d 61 79 20 |*. * |You may |
|00000100| 64 69 73 74 72 69 62 75 | 74 65 20 75 6e 64 65 72 |distribu|te under|
|00000110| 20 74 68 65 20 74 65 72 | 6d 73 20 6f 66 20 65 69 | the ter|ms of ei|
|00000120| 74 68 65 72 20 74 68 65 | 20 47 4e 55 20 47 65 6e |ther the| GNU Gen|
|00000130| 65 72 61 6c 20 50 75 62 | 6c 69 63 0d 20 2a 20 20 |eral Pub|lic. * |
|00000140| 20 20 4c 69 63 65 6e 73 | 65 20 6f 72 20 74 68 65 | Licens|e or the|
|00000150| 20 41 72 74 69 73 74 69 | 63 20 4c 69 63 65 6e 73 | Artisti|c Licens|
|00000160| 65 2c 20 61 73 20 73 70 | 65 63 69 66 69 65 64 20 |e, as sp|ecified |
|00000170| 69 6e 20 74 68 65 20 52 | 45 41 44 4d 45 20 66 69 |in the R|EADME fi|
|00000180| 6c 65 2e 0d 20 2a 0d 20 | 2a 20 24 4c 6f 67 3a 09 |le.. *. |* $Log:.|
|00000190| 61 72 72 61 79 2e 63 2c | 76 20 24 0d 20 2a 20 52 |array.c,|v $. * R|
|000001a0| 65 76 69 73 69 6f 6e 20 | 34 2e 30 2e 31 2e 33 20 |evision |4.0.1.3 |
|000001b0| 20 39 32 2f 30 36 2f 30 | 38 20 20 31 31 3a 34 35 | 92/06/0|8 11:45|
|000001c0| 3a 30 35 20 20 6c 77 61 | 6c 6c 0d 20 2a 20 70 61 |:05 lwa|ll. * pa|
|000001d0| 74 63 68 32 30 3a 20 50 | 65 72 6c 20 6e 6f 77 20 |tch20: P|erl now |
|000001e0| 64 69 73 74 69 6e 67 75 | 69 73 68 65 73 20 6f 76 |distingu|ishes ov|
|000001f0| 65 72 6c 61 70 70 65 64 | 20 63 6f 70 69 65 73 20 |erlapped| copies |
|00000200| 66 72 6f 6d 20 6e 6f 6e | 2d 6f 76 65 72 6c 61 70 |from non|-overlap|
|00000210| 70 65 64 0d 20 2a 20 0d | 20 2a 20 52 65 76 69 73 |ped. * .| * Revis|
|00000220| 69 6f 6e 20 34 2e 30 2e | 31 2e 32 20 20 39 31 2f |ion 4.0.|1.2 91/|
|00000230| 31 31 2f 30 35 20 20 31 | 36 3a 30 30 3a 31 34 20 |11/05 1|6:00:14 |
|00000240| 20 6c 77 61 6c 6c 0d 20 | 2a 20 70 61 74 63 68 31 | lwall. |* patch1|
|00000250| 31 3a 20 72 61 6e 64 6f | 6d 20 63 6c 65 61 6e 75 |1: rando|m cleanu|
|00000260| 70 0d 20 2a 20 70 61 74 | 63 68 31 31 3a 20 70 61 |p. * pat|ch11: pa|
|00000270| 73 73 69 6e 67 20 6e 6f | 6e 2d 65 78 69 73 74 65 |ssing no|n-existe|
|00000280| 6e 64 20 61 72 72 61 79 | 20 65 6c 65 6d 65 6e 74 |nd array| element|
|00000290| 73 20 74 6f 20 73 75 62 | 72 6f 75 74 69 6e 67 20 |s to sub|routing |
|000002a0| 63 61 75 73 65 64 20 63 | 6f 72 65 20 64 75 6d 70 |caused c|ore dump|
|000002b0| 0d 20 2a 20 0d 20 2a 20 | 52 65 76 69 73 69 6f 6e |. * . * |Revision|
|000002c0| 20 34 2e 30 2e 31 2e 31 | 20 20 39 31 2f 30 36 2f | 4.0.1.1| 91/06/|
|000002d0| 30 37 20 20 31 30 3a 31 | 39 3a 30 38 20 20 6c 77 |07 10:1|9:08 lw|
|000002e0| 61 6c 6c 0d 20 2a 20 70 | 61 74 63 68 34 3a 20 6e |all. * p|atch4: n|
|000002f0| 65 77 20 63 6f 70 79 72 | 69 67 68 74 20 6e 6f 74 |ew copyr|ight not|
|00000300| 69 63 65 0d 20 2a 20 0d | 20 2a 20 52 65 76 69 73 |ice. * .| * Revis|
|00000310| 69 6f 6e 20 34 2e 30 20 | 20 39 31 2f 30 33 2f 32 |ion 4.0 | 91/03/2|
|00000320| 30 20 20 30 31 3a 30 33 | 3a 33 32 20 20 6c 77 61 |0 01:03|:32 lwa|
|00000330| 6c 6c 0d 20 2a 20 34 2e | 30 20 62 61 73 65 6c 69 |ll. * 4.|0 baseli|
|00000340| 6e 65 2e 0d 20 2a 20 0d | 20 2a 2f 0d 0d 23 69 6e |ne.. * .| */..#in|
|00000350| 63 6c 75 64 65 20 22 45 | 58 54 45 52 4e 2e 68 22 |clude "E|XTERN.h"|
|00000360| 0d 23 69 6e 63 6c 75 64 | 65 20 22 70 65 72 6c 2e |.#includ|e "perl.|
|00000370| 68 22 0d 0d 53 54 52 20 | 2a 0d 61 66 65 74 63 68 |h"..STR |*.afetch|
|00000380| 28 61 72 2c 6b 65 79 2c | 6c 76 61 6c 29 0d 72 65 |(ar,key,|lval).re|
|00000390| 67 69 73 74 65 72 20 41 | 52 52 41 59 20 2a 61 72 |gister A|RRAY *ar|
|000003a0| 3b 0d 69 6e 74 20 6b 65 | 79 3b 0d 69 6e 74 20 6c |;.int ke|y;.int l|
|000003b0| 76 61 6c 3b 0d 7b 0d 20 | 20 20 20 53 54 52 20 2a |val;.{. | STR *|
|000003c0| 73 74 72 3b 0d 0d 20 20 | 20 20 69 66 20 28 6b 65 |str;.. | if (ke|
|000003d0| 79 20 3c 20 30 20 7c 7c | 20 6b 65 79 20 3e 20 61 |y < 0 ||| key > a|
|000003e0| 72 2d 3e 61 72 79 5f 66 | 69 6c 6c 29 20 7b 0d 09 |r->ary_f|ill) {..|
|000003f0| 69 66 20 28 6c 76 61 6c | 20 26 26 20 6b 65 79 20 |if (lval| && key |
|00000400| 3e 3d 20 30 29 20 7b 0d | 09 20 20 20 20 69 66 20 |>= 0) {.|. if |
|00000410| 28 61 72 2d 3e 61 72 79 | 5f 66 6c 61 67 73 20 26 |(ar->ary|_flags &|
|00000420| 20 41 52 46 5f 52 45 41 | 4c 29 0d 09 09 73 74 72 | ARF_REA|L)...str|
|00000430| 20 3d 20 53 74 72 5f 6e | 65 77 28 35 2c 30 29 3b | = Str_n|ew(5,0);|
|00000440| 0d 09 20 20 20 20 65 6c | 73 65 0d 09 09 73 74 72 |.. el|se...str|
|00000450| 20 3d 20 73 74 72 5f 6d | 6f 72 74 61 6c 28 26 73 | = str_m|ortal(&s|
|00000460| 74 72 5f 75 6e 64 65 66 | 29 3b 0d 09 20 20 20 20 |tr_undef|);.. |
|00000470| 28 76 6f 69 64 29 61 73 | 74 6f 72 65 28 61 72 2c |(void)as|tore(ar,|
|00000480| 6b 65 79 2c 73 74 72 29 | 3b 0d 09 20 20 20 20 72 |key,str)|;.. r|
|00000490| 65 74 75 72 6e 20 73 74 | 72 3b 0d 09 7d 0d 09 65 |eturn st|r;..}..e|
|000004a0| 6c 73 65 0d 09 20 20 20 | 20 72 65 74 75 72 6e 20 |lse.. | return |
|000004b0| 26 73 74 72 5f 75 6e 64 | 65 66 3b 0d 20 20 20 20 |&str_und|ef;. |
|000004c0| 7d 0d 20 20 20 20 69 66 | 20 28 21 61 72 2d 3e 61 |}. if| (!ar->a|
|000004d0| 72 79 5f 61 72 72 61 79 | 5b 6b 65 79 5d 29 20 7b |ry_array|[key]) {|
|000004e0| 0d 09 69 66 20 28 6c 76 | 61 6c 29 20 7b 0d 09 20 |..if (lv|al) {.. |
|000004f0| 20 20 20 73 74 72 20 3d | 20 53 74 72 5f 6e 65 77 | str =| Str_new|
|00000500| 28 36 2c 30 29 3b 0d 09 | 20 20 20 20 28 76 6f 69 |(6,0);..| (voi|
|00000510| 64 29 61 73 74 6f 72 65 | 28 61 72 2c 6b 65 79 2c |d)astore|(ar,key,|
|00000520| 73 74 72 29 3b 0d 09 20 | 20 20 20 72 65 74 75 72 |str);.. | retur|
|00000530| 6e 20 73 74 72 3b 0d 09 | 7d 0d 09 72 65 74 75 72 |n str;..|}..retur|
|00000540| 6e 20 26 73 74 72 5f 75 | 6e 64 65 66 3b 0d 20 20 |n &str_u|ndef;. |
|00000550| 20 20 7d 0d 20 20 20 20 | 72 65 74 75 72 6e 20 61 | }. |return a|
|00000560| 72 2d 3e 61 72 79 5f 61 | 72 72 61 79 5b 6b 65 79 |r->ary_a|rray[key|
|00000570| 5d 3b 0d 7d 0d 0d 62 6f | 6f 6c 0d 61 73 74 6f 72 |];.}..bo|ol.astor|
|00000580| 65 28 61 72 2c 6b 65 79 | 2c 76 61 6c 29 0d 72 65 |e(ar,key|,val).re|
|00000590| 67 69 73 74 65 72 20 41 | 52 52 41 59 20 2a 61 72 |gister A|RRAY *ar|
|000005a0| 3b 0d 69 6e 74 20 6b 65 | 79 3b 0d 53 54 52 20 2a |;.int ke|y;.STR *|
|000005b0| 76 61 6c 3b 0d 7b 0d 20 | 20 20 20 69 6e 74 20 72 |val;.{. | int r|
|000005c0| 65 74 76 61 6c 3b 0d 0d | 20 20 20 20 69 66 20 28 |etval;..| if (|
|000005d0| 6b 65 79 20 3c 20 30 29 | 0d 09 72 65 74 75 72 6e |key < 0)|..return|
|000005e0| 20 46 41 4c 53 45 3b 0d | 20 20 20 20 69 66 20 28 | FALSE;.| if (|
|000005f0| 6b 65 79 20 3e 20 61 72 | 2d 3e 61 72 79 5f 6d 61 |key > ar|->ary_ma|
|00000600| 78 29 20 7b 0d 09 69 6e | 74 20 6e 65 77 6d 61 78 |x) {..in|t newmax|
|00000610| 3b 0d 0d 09 69 66 20 28 | 61 72 2d 3e 61 72 79 5f |;...if (|ar->ary_|
|00000620| 61 6c 6c 6f 63 20 21 3d | 20 61 72 2d 3e 61 72 79 |alloc !=| ar->ary|
|00000630| 5f 61 72 72 61 79 29 20 | 7b 0d 09 20 20 20 20 72 |_array) |{.. r|
|00000640| 65 74 76 61 6c 20 3d 20 | 61 72 2d 3e 61 72 79 5f |etval = |ar->ary_|
|00000650| 61 72 72 61 79 20 2d 20 | 61 72 2d 3e 61 72 79 5f |array - |ar->ary_|
|00000660| 61 6c 6c 6f 63 3b 0d 09 | 20 20 20 20 4d 6f 76 65 |alloc;..| Move|
|00000670| 28 61 72 2d 3e 61 72 79 | 5f 61 72 72 61 79 2c 20 |(ar->ary|_array, |
|00000680| 61 72 2d 3e 61 72 79 5f | 61 6c 6c 6f 63 2c 20 61 |ar->ary_|alloc, a|
|00000690| 72 2d 3e 61 72 79 5f 6d | 61 78 2b 31 2c 20 53 54 |r->ary_m|ax+1, ST|
|000006a0| 52 2a 29 3b 0d 09 20 20 | 20 20 5a 65 72 6f 28 61 |R*);.. | Zero(a|
|000006b0| 72 2d 3e 61 72 79 5f 61 | 6c 6c 6f 63 2b 61 72 2d |r->ary_a|lloc+ar-|
|000006c0| 3e 61 72 79 5f 6d 61 78 | 2b 31 2c 20 72 65 74 76 |>ary_max|+1, retv|
|000006d0| 61 6c 2c 20 53 54 52 2a | 29 3b 0d 09 20 20 20 20 |al, STR*|);.. |
|000006e0| 61 72 2d 3e 61 72 79 5f | 6d 61 78 20 2b 3d 20 72 |ar->ary_|max += r|
|000006f0| 65 74 76 61 6c 3b 0d 09 | 20 20 20 20 61 72 2d 3e |etval;..| ar->|
|00000700| 61 72 79 5f 61 72 72 61 | 79 20 2d 3d 20 72 65 74 |ary_arra|y -= ret|
|00000710| 76 61 6c 3b 0d 09 20 20 | 20 20 69 66 20 28 6b 65 |val;.. | if (ke|
|00000720| 79 20 3e 20 61 72 2d 3e | 61 72 79 5f 6d 61 78 20 |y > ar->|ary_max |
|00000730| 2d 20 31 30 29 20 7b 0d | 09 09 6e 65 77 6d 61 78 |- 10) {.|..newmax|
|00000740| 20 3d 20 6b 65 79 20 2b | 20 61 72 2d 3e 61 72 79 | = key +| ar->ary|
|00000750| 5f 6d 61 78 3b 0d 09 09 | 67 6f 74 6f 20 72 65 73 |_max;...|goto res|
|00000760| 69 7a 65 3b 0d 09 20 20 | 20 20 7d 0d 09 7d 0d 09 |ize;.. | }..}..|
|00000770| 65 6c 73 65 20 7b 0d 09 | 20 20 20 20 69 66 20 28 |else {..| if (|
|00000780| 61 72 2d 3e 61 72 79 5f | 61 6c 6c 6f 63 29 20 7b |ar->ary_|alloc) {|
|00000790| 0d 09 09 6e 65 77 6d 61 | 78 20 3d 20 6b 65 79 20 |...newma|x = key |
|000007a0| 2b 20 61 72 2d 3e 61 72 | 79 5f 6d 61 78 20 2f 20 |+ ar->ar|y_max / |
|000007b0| 35 3b 0d 09 20 20 20 20 | 20 20 72 65 73 69 7a 65 |5;.. | resize|
|000007c0| 3a 0d 09 09 52 65 6e 65 | 77 28 61 72 2d 3e 61 72 |:...Rene|w(ar->ar|
|000007d0| 79 5f 61 6c 6c 6f 63 2c | 6e 65 77 6d 61 78 2b 31 |y_alloc,|newmax+1|
|000007e0| 2c 20 53 54 52 2a 29 3b | 0d 09 09 5a 65 72 6f 28 |, STR*);|...Zero(|
|000007f0| 26 61 72 2d 3e 61 72 79 | 5f 61 6c 6c 6f 63 5b 61 |&ar->ary|_alloc[a|
|00000800| 72 2d 3e 61 72 79 5f 6d | 61 78 2b 31 5d 2c 20 6e |r->ary_m|ax+1], n|
|00000810| 65 77 6d 61 78 20 2d 20 | 61 72 2d 3e 61 72 79 5f |ewmax - |ar->ary_|
|00000820| 6d 61 78 2c 20 53 54 52 | 2a 29 3b 0d 09 20 20 20 |max, STR|*);.. |
|00000830| 20 7d 0d 09 20 20 20 20 | 65 6c 73 65 20 7b 0d 09 | }.. |else {..|
|00000840| 09 6e 65 77 6d 61 78 20 | 3d 20 6b 65 79 20 3c 20 |.newmax |= key < |
|00000850| 34 20 3f 20 34 20 3a 20 | 6b 65 79 3b 0d 09 09 4e |4 ? 4 : |key;...N|
|00000860| 65 77 7a 28 32 2c 61 72 | 2d 3e 61 72 79 5f 61 6c |ewz(2,ar|->ary_al|
|00000870| 6c 6f 63 2c 20 6e 65 77 | 6d 61 78 2b 31 2c 20 53 |loc, new|max+1, S|
|00000880| 54 52 2a 29 3b 0d 09 20 | 20 20 20 7d 0d 09 20 20 |TR*);.. | }.. |
|00000890| 20 20 61 72 2d 3e 61 72 | 79 5f 61 72 72 61 79 20 | ar->ar|y_array |
|000008a0| 3d 20 61 72 2d 3e 61 72 | 79 5f 61 6c 6c 6f 63 3b |= ar->ar|y_alloc;|
|000008b0| 0d 09 20 20 20 20 61 72 | 2d 3e 61 72 79 5f 6d 61 |.. ar|->ary_ma|
|000008c0| 78 20 3d 20 6e 65 77 6d | 61 78 3b 0d 09 7d 0d 20 |x = newm|ax;..}. |
|000008d0| 20 20 20 7d 0d 20 20 20 | 20 69 66 20 28 61 72 2d | }. | if (ar-|
|000008e0| 3e 61 72 79 5f 66 6c 61 | 67 73 20 26 20 41 52 46 |>ary_fla|gs & ARF|
|000008f0| 5f 52 45 41 4c 29 20 7b | 0d 09 69 66 20 28 61 72 |_REAL) {|..if (ar|
|00000900| 2d 3e 61 72 79 5f 66 69 | 6c 6c 20 3c 20 6b 65 79 |->ary_fi|ll < key|
|00000910| 29 20 7b 0d 09 20 20 20 | 20 77 68 69 6c 65 20 28 |) {.. | while (|
|00000920| 2b 2b 61 72 2d 3e 61 72 | 79 5f 66 69 6c 6c 20 3c |++ar->ar|y_fill <|
|00000930| 20 6b 65 79 29 20 7b 0d | 09 09 69 66 20 28 61 72 | key) {.|..if (ar|
|00000940| 2d 3e 61 72 79 5f 61 72 | 72 61 79 5b 61 72 2d 3e |->ary_ar|ray[ar->|
|00000950| 61 72 79 5f 66 69 6c 6c | 5d 20 21 3d 20 4e 75 6c |ary_fill|] != Nul|
|00000960| 6c 73 74 72 29 20 7b 0d | 09 09 20 20 20 20 73 74 |lstr) {.|.. st|
|00000970| 72 5f 66 72 65 65 28 61 | 72 2d 3e 61 72 79 5f 61 |r_free(a|r->ary_a|
|00000980| 72 72 61 79 5b 61 72 2d | 3e 61 72 79 5f 66 69 6c |rray[ar-|>ary_fil|
|00000990| 6c 5d 29 3b 0d 09 09 20 | 20 20 20 61 72 2d 3e 61 |l]);... | ar->a|
|000009a0| 72 79 5f 61 72 72 61 79 | 5b 61 72 2d 3e 61 72 79 |ry_array|[ar->ary|
|000009b0| 5f 66 69 6c 6c 5d 20 3d | 20 4e 75 6c 6c 73 74 72 |_fill] =| Nullstr|
|000009c0| 3b 0d 09 09 7d 0d 09 20 | 20 20 20 7d 0d 09 7d 0d |;...}.. | }..}.|
|000009d0| 09 72 65 74 76 61 6c 20 | 3d 20 28 61 72 2d 3e 61 |.retval |= (ar->a|
|000009e0| 72 79 5f 61 72 72 61 79 | 5b 6b 65 79 5d 20 21 3d |ry_array|[key] !=|
|000009f0| 20 4e 75 6c 6c 73 74 72 | 29 3b 0d 09 69 66 20 28 | Nullstr|);..if (|
|00000a00| 72 65 74 76 61 6c 29 0d | 09 20 20 20 20 73 74 72 |retval).|. str|
|00000a10| 5f 66 72 65 65 28 61 72 | 2d 3e 61 72 79 5f 61 72 |_free(ar|->ary_ar|
|00000a20| 72 61 79 5b 6b 65 79 5d | 29 3b 0d 20 20 20 20 7d |ray[key]|);. }|
|00000a30| 0d 20 20 20 20 65 6c 73 | 65 0d 09 72 65 74 76 61 |. els|e..retva|
|00000a40| 6c 20 3d 20 30 3b 0d 20 | 20 20 20 61 72 2d 3e 61 |l = 0;. | ar->a|
|00000a50| 72 79 5f 61 72 72 61 79 | 5b 6b 65 79 5d 20 3d 20 |ry_array|[key] = |
|00000a60| 76 61 6c 3b 0d 20 20 20 | 20 72 65 74 75 72 6e 20 |val;. | return |
|00000a70| 72 65 74 76 61 6c 3b 0d | 7d 0d 0d 41 52 52 41 59 |retval;.|}..ARRAY|
|00000a80| 20 2a 0d 61 6e 65 77 28 | 73 74 61 62 29 0d 53 54 | *.anew(|stab).ST|
|00000a90| 41 42 20 2a 73 74 61 62 | 3b 0d 7b 0d 20 20 20 20 |AB *stab|;.{. |
|00000aa0| 72 65 67 69 73 74 65 72 | 20 41 52 52 41 59 20 2a |register| ARRAY *|
|00000ab0| 61 72 3b 0d 0d 20 20 20 | 20 4e 65 77 28 31 2c 61 |ar;.. | New(1,a|
|00000ac0| 72 2c 31 2c 41 52 52 41 | 59 29 3b 0d 20 20 20 20 |r,1,ARRA|Y);. |
|00000ad0| 61 72 2d 3e 61 72 79 5f | 6d 61 67 69 63 20 3d 20 |ar->ary_|magic = |
|00000ae0| 53 74 72 5f 6e 65 77 28 | 37 2c 30 29 3b 0d 20 20 |Str_new(|7,0);. |
|00000af0| 20 20 61 72 2d 3e 61 72 | 79 5f 61 6c 6c 6f 63 20 | ar->ar|y_alloc |
|00000b00| 3d 20 61 72 2d 3e 61 72 | 79 5f 61 72 72 61 79 20 |= ar->ar|y_array |
|00000b10| 3d 20 30 3b 0d 20 20 20 | 20 73 74 72 5f 6d 61 67 |= 0;. | str_mag|
|00000b20| 69 63 28 61 72 2d 3e 61 | 72 79 5f 6d 61 67 69 63 |ic(ar->a|ry_magic|
|00000b30| 2c 20 73 74 61 62 2c 20 | 27 23 27 2c 20 4e 75 6c |, stab, |'#', Nul|
|00000b40| 6c 63 68 2c 20 30 29 3b | 0d 20 20 20 20 61 72 2d |lch, 0);|. ar-|
|00000b50| 3e 61 72 79 5f 6d 61 78 | 20 3d 20 61 72 2d 3e 61 |>ary_max| = ar->a|
|00000b60| 72 79 5f 66 69 6c 6c 20 | 3d 20 2d 31 3b 0d 20 20 |ry_fill |= -1;. |
|00000b70| 20 20 61 72 2d 3e 61 72 | 79 5f 66 6c 61 67 73 20 | ar->ar|y_flags |
|00000b80| 3d 20 41 52 46 5f 52 45 | 41 4c 3b 0d 20 20 20 20 |= ARF_RE|AL;. |
|00000b90| 72 65 74 75 72 6e 20 61 | 72 3b 0d 7d 0d 0d 41 52 |return a|r;.}..AR|
|00000ba0| 52 41 59 20 2a 0d 61 66 | 61 6b 65 28 73 74 61 62 |RAY *.af|ake(stab|
|00000bb0| 2c 73 69 7a 65 2c 73 74 | 72 70 29 0d 53 54 41 42 |,size,st|rp).STAB|
|00000bc0| 20 2a 73 74 61 62 3b 0d | 72 65 67 69 73 74 65 72 | *stab;.|register|
|00000bd0| 20 69 6e 74 20 73 69 7a | 65 3b 0d 72 65 67 69 73 | int siz|e;.regis|
|00000be0| 74 65 72 20 53 54 52 20 | 2a 2a 73 74 72 70 3b 0d |ter STR |**strp;.|
|00000bf0| 7b 0d 20 20 20 20 72 65 | 67 69 73 74 65 72 20 41 |{. re|gister A|
|00000c00| 52 52 41 59 20 2a 61 72 | 3b 0d 0d 20 20 20 20 4e |RRAY *ar|;.. N|
|00000c10| 65 77 28 33 2c 61 72 2c | 31 2c 41 52 52 41 59 29 |ew(3,ar,|1,ARRAY)|
|00000c20| 3b 0d 20 20 20 20 4e 65 | 77 28 34 2c 61 72 2d 3e |;. Ne|w(4,ar->|
|00000c30| 61 72 79 5f 61 6c 6c 6f | 63 2c 73 69 7a 65 2b 31 |ary_allo|c,size+1|
|00000c40| 2c 53 54 52 2a 29 3b 0d | 20 20 20 20 43 6f 70 79 |,STR*);.| Copy|
|00000c50| 28 73 74 72 70 2c 61 72 | 2d 3e 61 72 79 5f 61 6c |(strp,ar|->ary_al|
|00000c60| 6c 6f 63 2c 73 69 7a 65 | 2c 53 54 52 2a 29 3b 0d |loc,size|,STR*);.|
|00000c70| 20 20 20 20 61 72 2d 3e | 61 72 79 5f 61 72 72 61 | ar->|ary_arra|
|00000c80| 79 20 3d 20 61 72 2d 3e | 61 72 79 5f 61 6c 6c 6f |y = ar->|ary_allo|
|00000c90| 63 3b 0d 20 20 20 20 61 | 72 2d 3e 61 72 79 5f 6d |c;. a|r->ary_m|
|00000ca0| 61 67 69 63 20 3d 20 53 | 74 72 5f 6e 65 77 28 38 |agic = S|tr_new(8|
|00000cb0| 2c 30 29 3b 0d 20 20 20 | 20 73 74 72 5f 6d 61 67 |,0);. | str_mag|
|00000cc0| 69 63 28 61 72 2d 3e 61 | 72 79 5f 6d 61 67 69 63 |ic(ar->a|ry_magic|
|00000cd0| 2c 20 73 74 61 62 2c 20 | 27 23 27 2c 20 4e 75 6c |, stab, |'#', Nul|
|00000ce0| 6c 63 68 2c 20 30 29 3b | 0d 20 20 20 20 61 72 2d |lch, 0);|. ar-|
|00000cf0| 3e 61 72 79 5f 66 69 6c | 6c 20 3d 20 73 69 7a 65 |>ary_fil|l = size|
|00000d00| 20 2d 20 31 3b 0d 20 20 | 20 20 61 72 2d 3e 61 72 | - 1;. | ar->ar|
|00000d10| 79 5f 6d 61 78 20 3d 20 | 73 69 7a 65 20 2d 20 31 |y_max = |size - 1|
|00000d20| 3b 0d 20 20 20 20 61 72 | 2d 3e 61 72 79 5f 66 6c |;. ar|->ary_fl|
|00000d30| 61 67 73 20 3d 20 30 3b | 0d 20 20 20 20 77 68 69 |ags = 0;|. whi|
|00000d40| 6c 65 20 28 73 69 7a 65 | 2d 2d 29 20 7b 0d 09 69 |le (size|--) {..i|
|00000d50| 66 20 28 2a 73 74 72 70 | 29 0d 09 20 20 20 20 28 |f (*strp|).. (|
|00000d60| 2a 73 74 72 70 29 2d 3e | 73 74 72 5f 70 6f 6b 20 |*strp)->|str_pok |
|00000d70| 26 3d 20 7e 53 50 5f 54 | 45 4d 50 3b 0d 09 73 74 |&= ~SP_T|EMP;..st|
|00000d80| 72 70 2b 2b 3b 0d 20 20 | 20 20 7d 0d 20 20 20 20 |rp++;. | }. |
|00000d90| 72 65 74 75 72 6e 20 61 | 72 3b 0d 7d 0d 0d 76 6f |return a|r;.}..vo|
|00000da0| 69 64 0d 61 63 6c 65 61 | 72 28 61 72 29 0d 72 65 |id.aclea|r(ar).re|
|00000db0| 67 69 73 74 65 72 20 41 | 52 52 41 59 20 2a 61 72 |gister A|RRAY *ar|
|00000dc0| 3b 0d 7b 0d 20 20 20 20 | 72 65 67 69 73 74 65 72 |;.{. |register|
|00000dd0| 20 69 6e 74 20 6b 65 79 | 3b 0d 0d 20 20 20 20 69 | int key|;.. i|
|00000de0| 66 20 28 21 61 72 20 7c | 7c 20 21 28 61 72 2d 3e |f (!ar ||| !(ar->|
|00000df0| 61 72 79 5f 66 6c 61 67 | 73 20 26 20 41 52 46 5f |ary_flag|s & ARF_|
|00000e00| 52 45 41 4c 29 20 7c 7c | 20 61 72 2d 3e 61 72 79 |REAL) ||| ar->ary|
|00000e10| 5f 6d 61 78 20 3c 20 30 | 29 0d 09 72 65 74 75 72 |_max < 0|)..retur|
|00000e20| 6e 3b 0d 20 20 20 20 2f | 2a 53 55 50 50 52 45 53 |n;. /|*SUPPRES|
|00000e30| 53 20 35 36 30 2a 2f 0d | 20 20 20 20 69 66 20 28 |S 560*/.| if (|
|00000e40| 6b 65 79 20 3d 20 61 72 | 2d 3e 61 72 79 5f 61 72 |key = ar|->ary_ar|
|00000e50| 72 61 79 20 2d 20 61 72 | 2d 3e 61 72 79 5f 61 6c |ray - ar|->ary_al|
|00000e60| 6c 6f 63 29 20 7b 0d 09 | 61 72 2d 3e 61 72 79 5f |loc) {..|ar->ary_|
|00000e70| 6d 61 78 20 2b 3d 20 6b | 65 79 3b 0d 09 61 72 2d |max += k|ey;..ar-|
|00000e80| 3e 61 72 79 5f 61 72 72 | 61 79 20 2d 3d 20 6b 65 |>ary_arr|ay -= ke|
|00000e90| 79 3b 0d 20 20 20 20 7d | 0d 20 20 20 20 66 6f 72 |y;. }|. for|
|00000ea0| 20 28 6b 65 79 20 3d 20 | 30 3b 20 6b 65 79 20 3c | (key = |0; key <|
|00000eb0| 3d 20 61 72 2d 3e 61 72 | 79 5f 6d 61 78 3b 20 6b |= ar->ar|y_max; k|
|00000ec0| 65 79 2b 2b 29 0d 09 73 | 74 72 5f 66 72 65 65 28 |ey++)..s|tr_free(|
|00000ed0| 61 72 2d 3e 61 72 79 5f | 61 72 72 61 79 5b 6b 65 |ar->ary_|array[ke|
|00000ee0| 79 5d 29 3b 0d 20 20 20 | 20 61 72 2d 3e 61 72 79 |y]);. | ar->ary|
|00000ef0| 5f 66 69 6c 6c 20 3d 20 | 2d 31 3b 0d 20 20 20 20 |_fill = |-1;. |
|00000f00| 5a 65 72 6f 28 61 72 2d | 3e 61 72 79 5f 61 72 72 |Zero(ar-|>ary_arr|
|00000f10| 61 79 2c 20 61 72 2d 3e | 61 72 79 5f 6d 61 78 2b |ay, ar->|ary_max+|
|00000f20| 31 2c 20 53 54 52 2a 29 | 3b 0d 7d 0d 0d 76 6f 69 |1, STR*)|;.}..voi|
|00000f30| 64 0d 61 66 72 65 65 28 | 61 72 29 0d 72 65 67 69 |d.afree(|ar).regi|
|00000f40| 73 74 65 72 20 41 52 52 | 41 59 20 2a 61 72 3b 0d |ster ARR|AY *ar;.|
|00000f50| 7b 0d 20 20 20 20 72 65 | 67 69 73 74 65 72 20 69 |{. re|gister i|
|00000f60| 6e 74 20 6b 65 79 3b 0d | 0d 20 20 20 20 69 66 20 |nt key;.|. if |
|00000f70| 28 21 61 72 29 0d 09 72 | 65 74 75 72 6e 3b 0d 20 |(!ar)..r|eturn;. |
|00000f80| 20 20 20 2f 2a 53 55 50 | 50 52 45 53 53 20 35 36 | /*SUP|PRESS 56|
|00000f90| 30 2a 2f 0d 20 20 20 20 | 69 66 20 28 6b 65 79 20 |0*/. |if (key |
|00000fa0| 3d 20 61 72 2d 3e 61 72 | 79 5f 61 72 72 61 79 20 |= ar->ar|y_array |
|00000fb0| 2d 20 61 72 2d 3e 61 72 | 79 5f 61 6c 6c 6f 63 29 |- ar->ar|y_alloc)|
|00000fc0| 20 7b 0d 09 61 72 2d 3e | 61 72 79 5f 6d 61 78 20 | {..ar->|ary_max |
|00000fd0| 2b 3d 20 6b 65 79 3b 0d | 09 61 72 2d 3e 61 72 79 |+= key;.|.ar->ary|
|00000fe0| 5f 61 72 72 61 79 20 2d | 3d 20 6b 65 79 3b 0d 20 |_array -|= key;. |
|00000ff0| 20 20 20 7d 0d 20 20 20 | 20 69 66 20 28 61 72 2d | }. | if (ar-|
|00001000| 3e 61 72 79 5f 66 6c 61 | 67 73 20 26 20 41 52 46 |>ary_fla|gs & ARF|
|00001010| 5f 52 45 41 4c 29 20 7b | 0d 09 66 6f 72 20 28 6b |_REAL) {|..for (k|
|00001020| 65 79 20 3d 20 30 3b 20 | 6b 65 79 20 3c 3d 20 61 |ey = 0; |key <= a|
|00001030| 72 2d 3e 61 72 79 5f 6d | 61 78 3b 20 6b 65 79 2b |r->ary_m|ax; key+|
|00001040| 2b 29 0d 09 20 20 20 20 | 73 74 72 5f 66 72 65 65 |+).. |str_free|
|00001050| 28 61 72 2d 3e 61 72 79 | 5f 61 72 72 61 79 5b 6b |(ar->ary|_array[k|
|00001060| 65 79 5d 29 3b 0d 20 20 | 20 20 7d 0d 20 20 20 20 |ey]);. | }. |
|00001070| 73 74 72 5f 66 72 65 65 | 28 61 72 2d 3e 61 72 79 |str_free|(ar->ary|
|00001080| 5f 6d 61 67 69 63 29 3b | 0d 20 20 20 20 53 61 66 |_magic);|. Saf|
|00001090| 65 66 72 65 65 28 61 72 | 2d 3e 61 72 79 5f 61 6c |efree(ar|->ary_al|
|000010a0| 6c 6f 63 29 3b 0d 20 20 | 20 20 53 61 66 65 66 72 |loc);. | Safefr|
|000010b0| 65 65 28 61 72 29 3b 0d | 7d 0d 0d 62 6f 6f 6c 0d |ee(ar);.|}..bool.|
|000010c0| 61 70 75 73 68 28 61 72 | 2c 76 61 6c 29 0d 72 65 |apush(ar|,val).re|
|000010d0| 67 69 73 74 65 72 20 41 | 52 52 41 59 20 2a 61 72 |gister A|RRAY *ar|
|000010e0| 3b 0d 53 54 52 20 2a 76 | 61 6c 3b 0d 7b 0d 20 20 |;.STR *v|al;.{. |
|000010f0| 20 20 72 65 74 75 72 6e | 20 61 73 74 6f 72 65 28 | return| astore(|
|00001100| 61 72 2c 2b 2b 28 61 72 | 2d 3e 61 72 79 5f 66 69 |ar,++(ar|->ary_fi|
|00001110| 6c 6c 29 2c 76 61 6c 29 | 3b 0d 7d 0d 0d 53 54 52 |ll),val)|;.}..STR|
|00001120| 20 2a 0d 61 70 6f 70 28 | 61 72 29 0d 72 65 67 69 | *.apop(|ar).regi|
|00001130| 73 74 65 72 20 41 52 52 | 41 59 20 2a 61 72 3b 0d |ster ARR|AY *ar;.|
|00001140| 7b 0d 20 20 20 20 53 54 | 52 20 2a 72 65 74 76 61 |{. ST|R *retva|
|00001150| 6c 3b 0d 0d 20 20 20 20 | 69 66 20 28 61 72 2d 3e |l;.. |if (ar->|
|00001160| 61 72 79 5f 66 69 6c 6c | 20 3c 20 30 29 0d 09 72 |ary_fill| < 0)..r|
|00001170| 65 74 75 72 6e 20 4e 75 | 6c 6c 73 74 72 3b 0d 20 |eturn Nu|llstr;. |
|00001180| 20 20 20 72 65 74 76 61 | 6c 20 3d 20 61 72 2d 3e | retva|l = ar->|
|00001190| 61 72 79 5f 61 72 72 61 | 79 5b 61 72 2d 3e 61 72 |ary_arra|y[ar->ar|
|000011a0| 79 5f 66 69 6c 6c 5d 3b | 0d 20 20 20 20 61 72 2d |y_fill];|. ar-|
|000011b0| 3e 61 72 79 5f 61 72 72 | 61 79 5b 61 72 2d 3e 61 |>ary_arr|ay[ar->a|
|000011c0| 72 79 5f 66 69 6c 6c 2d | 2d 5d 20 3d 20 4e 75 6c |ry_fill-|-] = Nul|
|000011d0| 6c 73 74 72 3b 0d 20 20 | 20 20 72 65 74 75 72 6e |lstr;. | return|
|000011e0| 20 72 65 74 76 61 6c 3b | 0d 7d 0d 0d 76 6f 69 64 | retval;|.}..void|
|000011f0| 0d 61 75 6e 73 68 69 66 | 74 28 61 72 2c 6e 75 6d |.aunshif|t(ar,num|
|00001200| 29 0d 72 65 67 69 73 74 | 65 72 20 41 52 52 41 59 |).regist|er ARRAY|
|00001210| 20 2a 61 72 3b 0d 72 65 | 67 69 73 74 65 72 20 69 | *ar;.re|gister i|
|00001220| 6e 74 20 6e 75 6d 3b 0d | 7b 0d 20 20 20 20 72 65 |nt num;.|{. re|
|00001230| 67 69 73 74 65 72 20 69 | 6e 74 20 69 3b 0d 20 20 |gister i|nt i;. |
|00001240| 20 20 72 65 67 69 73 74 | 65 72 20 53 54 52 20 2a | regist|er STR *|
|00001250| 2a 73 73 74 72 2c 2a 2a | 64 73 74 72 3b 0d 0d 20 |*sstr,**|dstr;.. |
|00001260| 20 20 20 69 66 20 28 6e | 75 6d 20 3c 3d 20 30 29 | if (n|um <= 0)|
|00001270| 0d 09 72 65 74 75 72 6e | 3b 0d 20 20 20 20 69 66 |..return|;. if|
|00001280| 20 28 61 72 2d 3e 61 72 | 79 5f 61 72 72 61 79 20 | (ar->ar|y_array |
|00001290| 2d 20 61 72 2d 3e 61 72 | 79 5f 61 6c 6c 6f 63 20 |- ar->ar|y_alloc |
|000012a0| 3e 3d 20 6e 75 6d 29 20 | 7b 0d 09 61 72 2d 3e 61 |>= num) |{..ar->a|
|000012b0| 72 79 5f 6d 61 78 20 2b | 3d 20 6e 75 6d 3b 0d 09 |ry_max +|= num;..|
|000012c0| 61 72 2d 3e 61 72 79 5f | 66 69 6c 6c 20 2b 3d 20 |ar->ary_|fill += |
|000012d0| 6e 75 6d 3b 0d 09 77 68 | 69 6c 65 20 28 6e 75 6d |num;..wh|ile (num|
|000012e0| 2d 2d 29 0d 09 20 20 20 | 20 2a 2d 2d 61 72 2d 3e |--).. | *--ar->|
|000012f0| 61 72 79 5f 61 72 72 61 | 79 20 3d 20 4e 75 6c 6c |ary_arra|y = Null|
|00001300| 73 74 72 3b 0d 20 20 20 | 20 7d 0d 20 20 20 20 65 |str;. | }. e|
|00001310| 6c 73 65 20 7b 0d 09 28 | 76 6f 69 64 29 61 73 74 |lse {..(|void)ast|
|00001320| 6f 72 65 28 61 72 2c 61 | 72 2d 3e 61 72 79 5f 66 |ore(ar,a|r->ary_f|
|00001330| 69 6c 6c 2b 6e 75 6d 2c | 28 53 54 52 2a 29 30 29 |ill+num,|(STR*)0)|
|00001340| 3b 09 2f 2a 20 6d 61 79 | 62 65 20 65 78 74 65 6e |;./* may|be exten|
|00001350| 64 20 61 72 72 61 79 20 | 2a 2f 0d 09 64 73 74 72 |d array |*/..dstr|
|00001360| 20 3d 20 61 72 2d 3e 61 | 72 79 5f 61 72 72 61 79 | = ar->a|ry_array|
|00001370| 20 2b 20 61 72 2d 3e 61 | 72 79 5f 66 69 6c 6c 3b | + ar->a|ry_fill;|
|00001380| 0d 09 73 73 74 72 20 3d | 20 64 73 74 72 20 2d 20 |..sstr =| dstr - |
|00001390| 6e 75 6d 3b 0d 23 69 66 | 64 65 66 20 42 55 47 47 |num;.#if|def BUGG|
|000013a0| 59 5f 4d 53 43 35 0d 20 | 23 20 70 72 61 67 6d 61 |Y_MSC5. |# pragma|
|000013b0| 20 6c 6f 6f 70 5f 6f 70 | 74 28 6f 66 66 29 09 2f | loop_op|t(off)./|
|000013c0| 2a 20 64 6f 6e 27 74 20 | 6c 6f 6f 70 2d 6f 70 74 |* don't |loop-opt|
|000013d0| 69 6d 69 7a 65 20 74 68 | 65 20 66 6f 6c 6c 6f 77 |imize th|e follow|
|000013e0| 69 6e 67 20 63 6f 64 65 | 20 2a 2f 0d 23 65 6e 64 |ing code| */.#end|
|000013f0| 69 66 20 2f 2a 20 42 55 | 47 47 59 5f 4d 53 43 35 |if /* BU|GGY_MSC5|
|00001400| 20 2a 2f 0d 09 66 6f 72 | 20 28 69 20 3d 20 61 72 | */..for| (i = ar|
|00001410| 2d 3e 61 72 79 5f 66 69 | 6c 6c 20 2d 20 6e 75 6d |->ary_fi|ll - num|
|00001420| 3b 20 69 20 3e 3d 20 30 | 3b 20 69 2d 2d 29 20 7b |; i >= 0|; i--) {|
|00001430| 0d 09 20 20 20 20 2a 64 | 73 74 72 2d 2d 20 3d 20 |.. *d|str-- = |
|00001440| 2a 73 73 74 72 2d 2d 3b | 0d 23 69 66 64 65 66 20 |*sstr--;|.#ifdef |
|00001450| 42 55 47 47 59 5f 4d 53 | 43 35 0d 20 23 20 70 72 |BUGGY_MS|C5. # pr|
|00001460| 61 67 6d 61 20 6c 6f 6f | 70 5f 6f 70 74 28 29 09 |agma loo|p_opt().|
|00001470| 2f 2a 20 6c 6f 6f 70 2d | 6f 70 74 69 6d 69 7a 61 |/* loop-|optimiza|
|00001480| 74 69 6f 6e 20 62 61 63 | 6b 20 74 6f 20 63 6f 6d |tion bac|k to com|
|00001490| 6d 61 6e 64 2d 6c 69 6e | 65 20 73 65 74 74 69 6e |mand-lin|e settin|
|000014a0| 67 20 2a 2f 0d 23 65 6e | 64 69 66 20 2f 2a 20 42 |g */.#en|dif /* B|
|000014b0| 55 47 47 59 5f 4d 53 43 | 35 20 2a 2f 0d 09 7d 0d |UGGY_MSC|5 */..}.|
|000014c0| 09 5a 65 72 6f 28 61 72 | 2d 3e 61 72 79 5f 61 72 |.Zero(ar|->ary_ar|
|000014d0| 72 61 79 2c 20 6e 75 6d | 2c 20 53 54 52 2a 29 3b |ray, num|, STR*);|
|000014e0| 0d 20 20 20 20 7d 0d 7d | 0d 0d 53 54 52 20 2a 0d |. }.}|..STR *.|
|000014f0| 61 73 68 69 66 74 28 61 | 72 29 0d 72 65 67 69 73 |ashift(a|r).regis|
|00001500| 74 65 72 20 41 52 52 41 | 59 20 2a 61 72 3b 0d 7b |ter ARRA|Y *ar;.{|
|00001510| 0d 20 20 20 20 53 54 52 | 20 2a 72 65 74 76 61 6c |. STR| *retval|
|00001520| 3b 0d 0d 20 20 20 20 69 | 66 20 28 61 72 2d 3e 61 |;.. i|f (ar->a|
|00001530| 72 79 5f 66 69 6c 6c 20 | 3c 20 30 29 0d 09 72 65 |ry_fill |< 0)..re|
|00001540| 74 75 72 6e 20 4e 75 6c | 6c 73 74 72 3b 0d 20 20 |turn Nul|lstr;. |
|00001550| 20 20 72 65 74 76 61 6c | 20 3d 20 2a 61 72 2d 3e | retval| = *ar->|
|00001560| 61 72 79 5f 61 72 72 61 | 79 3b 0d 20 20 20 20 2a |ary_arra|y;. *|
|00001570| 28 61 72 2d 3e 61 72 79 | 5f 61 72 72 61 79 2b 2b |(ar->ary|_array++|
|00001580| 29 20 3d 20 4e 75 6c 6c | 73 74 72 3b 0d 20 20 20 |) = Null|str;. |
|00001590| 20 61 72 2d 3e 61 72 79 | 5f 6d 61 78 2d 2d 3b 0d | ar->ary|_max--;.|
|000015a0| 20 20 20 20 61 72 2d 3e | 61 72 79 5f 66 69 6c 6c | ar->|ary_fill|
|000015b0| 2d 2d 3b 0d 20 20 20 20 | 72 65 74 75 72 6e 20 72 |--;. |return r|
|000015c0| 65 74 76 61 6c 3b 0d 7d | 0d 0d 69 6e 74 0d 61 6c |etval;.}|..int.al|
|000015d0| 65 6e 28 61 72 29 0d 72 | 65 67 69 73 74 65 72 20 |en(ar).r|egister |
|000015e0| 41 52 52 41 59 20 2a 61 | 72 3b 0d 7b 0d 20 20 20 |ARRAY *a|r;.{. |
|000015f0| 20 72 65 74 75 72 6e 20 | 61 72 2d 3e 61 72 79 5f | return |ar->ary_|
|00001600| 66 69 6c 6c 3b 0d 7d 0d | 0d 76 6f 69 64 0d 61 66 |fill;.}.|.void.af|
|00001610| 69 6c 6c 28 61 72 2c 20 | 66 69 6c 6c 29 0d 72 65 |ill(ar, |fill).re|
|00001620| 67 69 73 74 65 72 20 41 | 52 52 41 59 20 2a 61 72 |gister A|RRAY *ar|
|00001630| 3b 0d 69 6e 74 20 66 69 | 6c 6c 3b 0d 7b 0d 20 20 |;.int fi|ll;.{. |
|00001640| 20 20 69 66 20 28 66 69 | 6c 6c 20 3c 20 30 29 0d | if (fi|ll < 0).|
|00001650| 09 66 69 6c 6c 20 3d 20 | 2d 31 3b 0d 20 20 20 20 |.fill = |-1;. |
|00001660| 69 66 20 28 66 69 6c 6c | 20 3c 3d 20 61 72 2d 3e |if (fill| <= ar->|
|00001670| 61 72 79 5f 6d 61 78 29 | 0d 09 61 72 2d 3e 61 72 |ary_max)|..ar->ar|
|00001680| 79 5f 66 69 6c 6c 20 3d | 20 66 69 6c 6c 3b 0d 20 |y_fill =| fill;. |
|00001690| 20 20 20 65 6c 73 65 0d | 09 28 76 6f 69 64 29 61 | else.|.(void)a|
|000016a0| 73 74 6f 72 65 28 61 72 | 2c 66 69 6c 6c 2c 4e 75 |store(ar|,fill,Nu|
|000016b0| 6c 6c 73 74 72 29 3b 0d | 7d 0d 00 00 00 00 00 00 |llstr);.|}.......|
|000016c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000016d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000016e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000016f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001700| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00001710| 20 23 64 65 66 69 6e 65 | 20 44 4f 53 49 53 48 20 | #define| DOSISH |
|00001720| 31 0d 21 20 23 65 6e 64 | 69 66 0d 21 20 0d 21 20 |1.! #end|if.! .! |
|00001730| 07 61 72 72 61 79 2e 63 | 02 00 00 00 54 45 58 54 |.array.c|....TEXT|
|00001740| 4d 50 53 20 00 00 00 00 | 00 80 00 00 00 00 75 04 |MPS ....|......u.|
|00001750| 00 00 54 45 58 54 4d 50 | 53 20 00 00 00 00 00 80 |..TEXTMP|S ......|
|00001760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001770| 00 00 a6 ea af f2 00 00 | 16 3a 00 00 01 ac 4d 53 |........|.:....MS|
|00001780| 44 4f 53 20 2a 2f 0d 20 | 20 0d 2a 2a 2a 2a 2a 2a |DOS */. | .******|
|00001790| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0d 2a 2a 2a 20 31 33 |********|*.*** 13|
|000017a0| 30 2c 31 36 33 20 2a 2a | 2a 2a 0d 20 20 2f 2a 20 |0,163 **|**. /* |
|000017b0| 55 73 65 20 61 6c 6c 20 | 74 68 65 20 22 73 74 61 |Use all |the "sta|
|000017c0| 6e 64 61 72 64 22 20 64 | 65 66 69 6e 69 74 69 6f |ndard" d|efinitio|
|000017d0| 6e 73 20 2a 2f 0d 20 20 | 23 69 6e 63 6c 75 64 65 |ns */. |#include|
|000017e0| 20 3c 73 74 64 6c 69 62 | 2e 68 3e 0d 20 20 23 69 | <stdlib|.h>. #i|
|000017f0| 6e 63 6c 75 64 65 20 3c | 73 74 72 69 6e 67 2e 68 |nclude <|string.h|
|00001800| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 2f 30 36 |...H..Mo|naco./06|
|00001810| 2f 30 38 20 31 31 3a 34 | 35 3a 30 35 20 24 0d 20 |/08 11:4|5:05 $. |
|00001820| 2a 0d 20 2a 20 20 00 06 | 00 03 00 64 00 1c 01 dd |*. * ..|...d....|
|00001830| 02 3d 00 64 00 1c 01 dd | 02 3d a6 ea bb 8d 00 00 |.=.d....|.=......|
|00001840| 15 8e 00 00 15 8e 00 00 | 14 bd 01 00 00 00 00 1e |........|........|
|00001850| 00 64 00 1c 01 dd 02 3d | 00 64 00 1c 01 dd 02 3d |.d.....=|.d.....=|
|00001860| 00 00 14 bd 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001870| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 00 51 |.....n..|.n...>.Q|
|00001880| 62 20 0e b2 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |b ......|.>..MPSR|
|00001890| 00 01 00 0a 03 ed ff ff | 00 00 00 00 00 00 00 00 |........|........|
|000018a0| 03 f0 ff ff 00 00 00 4c | 00 57 94 a4 00 00 00 00 |.......L|.W......|
|000018b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+