home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / unix / gawk.sit / source / gnufuncts.c < prev    next >
MacBinary  |  1990-09-29  |  2.5 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

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

You can browse this item here: gnufuncts.c

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, inited, Sat Sep 29 16:04:35 1990, modified Sat Sep 29 16:04:35 1990, creator 'MPS ', type ASCII, 1974 bytes "gnufuncts.c" , at 0x836 374 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 0b 67 6e 75 66 75 6e | 63 74 73 2e 63 00 00 00 |..gnufun|cts.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 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 07 b6 00 | 00 01 76 a3 2a ae d3 a3 |........|..v.*...|
|00000060| 2a ae d3 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 fa fe 00 00 |........|........|
|00000080| 2f 2a 20 0d 20 2a 20 43 | 6f 70 79 72 69 67 68 74 |/* . * C|opyright|
|00000090| 20 28 43 29 20 31 39 38 | 36 2c 20 31 39 38 38 2c | (C) 198|6, 1988,|
|000000a0| 20 31 39 38 39 20 74 68 | 65 20 46 72 65 65 20 53 | 1989 th|e Free S|
|000000b0| 6f 66 74 77 61 72 65 20 | 46 6f 75 6e 64 61 74 69 |oftware |Foundati|
|000000c0| 6f 6e 2c 20 49 6e 63 2e | 0d 20 2a 20 0d 20 2a 20 |on, Inc.|. * . * |
|000000d0| 54 68 69 73 20 66 69 6c | 65 20 69 73 20 70 61 72 |This fil|e is par|
|000000e0| 74 20 6f 66 20 47 41 57 | 4b 2c 20 74 68 65 20 47 |t of GAW|K, the G|
|000000f0| 4e 55 20 69 6d 70 6c 65 | 6d 65 6e 74 61 74 69 6f |NU imple|mentatio|
|00000100| 6e 20 6f 66 20 74 68 65 | 0d 20 2a 20 41 57 4b 20 |n of the|. * AWK |
|00000110| 50 72 6f 67 61 6d 6d 69 | 6e 67 20 4c 61 6e 67 75 |Progammi|ng Langu|
|00000120| 61 67 65 2e 0d 20 2a 20 | 0d 20 2a 20 47 41 57 4b |age.. * |. * GAWK|
|00000130| 20 69 73 20 66 72 65 65 | 20 73 6f 66 74 77 61 72 | is free| softwar|
|00000140| 65 3b 20 79 6f 75 20 63 | 61 6e 20 72 65 64 69 73 |e; you c|an redis|
|00000150| 74 72 69 62 75 74 65 20 | 69 74 20 61 6e 64 2f 6f |tribute |it and/o|
|00000160| 72 20 6d 6f 64 69 66 79 | 0d 20 2a 20 69 74 20 75 |r modify|. * it u|
|00000170| 6e 64 65 72 20 74 68 65 | 20 74 65 72 6d 73 20 6f |nder the| terms o|
|00000180| 66 20 74 68 65 20 47 4e | 55 20 47 65 6e 65 72 61 |f the GN|U Genera|
|00000190| 6c 20 50 75 62 6c 69 63 | 20 4c 69 63 65 6e 73 65 |l Public| License|
|000001a0| 20 61 73 20 70 75 62 6c | 69 73 68 65 64 20 62 79 | as publ|ished by|
|000001b0| 0d 20 2a 20 74 68 65 20 | 46 72 65 65 20 53 6f 66 |. * the |Free Sof|
|000001c0| 74 77 61 72 65 20 46 6f | 75 6e 64 61 74 69 6f 6e |tware Fo|undation|
|000001d0| 3b 20 65 69 74 68 65 72 | 20 76 65 72 73 69 6f 6e |; either| version|
|000001e0| 20 31 2c 20 6f 72 20 28 | 61 74 20 79 6f 75 72 20 | 1, or (|at your |
|000001f0| 6f 70 74 69 6f 6e 29 0d | 20 2a 20 61 6e 79 20 6c |option).| * any l|
|00000200| 61 74 65 72 20 76 65 72 | 73 69 6f 6e 2e 0d 20 2a |ater ver|sion.. *|
|00000210| 20 0d 20 2a 20 47 41 57 | 4b 20 69 73 20 64 69 73 | . * GAW|K is dis|
|00000220| 74 72 69 62 75 74 65 64 | 20 69 6e 20 74 68 65 20 |tributed| in the |
|00000230| 68 6f 70 65 20 74 68 61 | 74 20 69 74 20 77 69 6c |hope tha|t it wil|
|00000240| 6c 20 62 65 20 75 73 65 | 66 75 6c 2c 0d 20 2a 20 |l be use|ful,. * |
|00000250| 62 75 74 20 57 49 54 48 | 4f 55 54 20 41 4e 59 20 |but WITH|OUT ANY |
|00000260| 57 41 52 52 41 4e 54 59 | 3b 20 77 69 74 68 6f 75 |WARRANTY|; withou|
|00000270| 74 20 65 76 65 6e 20 74 | 68 65 20 69 6d 70 6c 69 |t even t|he impli|
|00000280| 65 64 20 77 61 72 72 61 | 6e 74 79 20 6f 66 0d 20 |ed warra|nty of. |
|00000290| 2a 20 4d 45 52 43 48 41 | 4e 54 41 42 49 4c 49 54 |* MERCHA|NTABILIT|
|000002a0| 59 20 6f 72 20 46 49 54 | 4e 45 53 53 20 46 4f 52 |Y or FIT|NESS FOR|
|000002b0| 20 41 20 50 41 52 54 49 | 43 55 4c 41 52 20 50 55 | A PARTI|CULAR PU|
|000002c0| 52 50 4f 53 45 2e 20 20 | 53 65 65 20 74 68 65 0d |RPOSE. |See the.|
|000002d0| 20 2a 20 47 4e 55 20 47 | 65 6e 65 72 61 6c 20 50 | * GNU G|eneral P|
|000002e0| 75 62 6c 69 63 20 4c 69 | 63 65 6e 73 65 20 66 6f |ublic Li|cense fo|
|000002f0| 72 20 6d 6f 72 65 20 64 | 65 74 61 69 6c 73 2e 0d |r more d|etails..|
|00000300| 20 2a 20 0d 20 2a 20 59 | 6f 75 20 73 68 6f 75 6c | * . * Y|ou shoul|
|00000310| 64 20 68 61 76 65 20 72 | 65 63 65 69 76 65 64 20 |d have r|eceived |
|00000320| 61 20 63 6f 70 79 20 6f | 66 20 74 68 65 20 47 4e |a copy o|f the GN|
|00000330| 55 20 47 65 6e 65 72 61 | 6c 20 50 75 62 6c 69 63 |U Genera|l Public|
|00000340| 20 4c 69 63 65 6e 73 65 | 0d 20 2a 20 61 6c 6f 6e | License|. * alon|
|00000350| 67 20 77 69 74 68 20 47 | 41 57 4b 3b 20 73 65 65 |g with G|AWK; see|
|00000360| 20 74 68 65 20 66 69 6c | 65 20 43 4f 50 59 49 4e | the fil|e COPYIN|
|00000370| 47 2e 20 20 49 66 20 6e | 6f 74 2c 20 77 72 69 74 |G. If n|ot, writ|
|00000380| 65 20 74 6f 0d 20 2a 20 | 74 68 65 20 46 72 65 65 |e to. * |the Free|
|00000390| 20 53 6f 66 74 77 61 72 | 65 20 46 6f 75 6e 64 61 | Softwar|e Founda|
|000003a0| 74 69 6f 6e 2c 20 36 37 | 35 20 4d 61 73 73 20 41 |tion, 67|5 Mass A|
|000003b0| 76 65 2c 20 43 61 6d 62 | 72 69 64 67 65 2c 20 4d |ve, Camb|ridge, M|
|000003c0| 41 20 30 32 31 33 39 2c | 20 55 53 41 2e 0d 20 2a |A 02139,| USA.. *|
|000003d0| 2f 0d 20 0d 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |/. .#inc|lude <st|
|000003e0| 64 69 6f 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |dio.h>.#|include |
|000003f0| 3c 73 74 64 6c 69 62 2e | 68 3e 0d 23 69 6e 63 6c |<stdlib.|h>.#incl|
|00000400| 75 64 65 20 3c 73 74 72 | 69 6e 67 2e 68 3e 0d 23 |ude <str|ing.h>.#|
|00000410| 69 6e 63 6c 75 64 65 20 | 3c 6d 61 74 68 2e 68 3e |include |<math.h>|
|00000420| 0d 23 69 6e 63 6c 75 64 | 65 20 22 61 77 6b 2e 68 |.#includ|e "awk.h|
|00000430| 22 0d 0d 76 6f 69 64 20 | 2a 6d 65 6d 63 70 79 28 |"..void |*memcpy(|
|00000440| 29 3b 0d 0d 0d 0d 76 6f | 69 64 20 62 7a 65 72 6f |);....vo|id bzero|
|00000450| 28 70 2c 6e 29 0d 76 6f | 69 64 20 2a 70 3b 0d 69 |(p,n).vo|id *p;.i|
|00000460| 6e 74 20 6e 3b 0d 7b 0d | 09 6d 65 6d 73 65 74 28 |nt n;.{.|.memset(|
|00000470| 70 2c 27 5c 30 27 2c 6e | 29 3b 0d 7d 0d 0d 0d 46 |p,'\0',n|);.}...F|
|00000480| 49 4c 45 20 2a 70 6f 70 | 65 6e 28 73 2c 6d 6f 64 |ILE *pop|en(s,mod|
|00000490| 65 29 0d 63 68 61 72 20 | 2a 73 2c 2a 6d 6f 64 65 |e).char |*s,*mode|
|000004a0| 3b 0d 7b 0d 09 66 70 72 | 69 6e 74 66 28 73 74 64 |;.{..fpr|intf(std|
|000004b0| 65 72 72 2c 22 53 6f 72 | 72 79 2c 20 70 69 70 65 |err,"Sor|ry, pipe|
|000004c0| 73 20 61 72 65 20 6e 6f | 74 20 69 6d 70 6c 65 6d |s are no|t implem|
|000004d0| 65 6e 74 65 64 2e 5c 6e | 22 29 3b 0d 09 65 78 69 |ented.\n|");..exi|
|000004e0| 74 28 32 30 29 3b 0d 7d | 0d 0d 70 63 6c 6f 73 65 |t(20);.}|..pclose|
|000004f0| 28 66 70 29 0d 46 49 4c | 45 20 2a 66 70 3b 0d 7b |(fp).FIL|E *fp;.{|
|00000500| 0d 09 66 70 72 69 6e 74 | 66 28 73 74 64 65 72 72 |..fprint|f(stderr|
|00000510| 2c 20 22 53 6f 72 72 79 | 2c 20 70 69 70 65 73 20 |, "Sorry|, pipes |
|00000520| 61 72 65 20 6e 6f 74 20 | 69 6d 70 6c 65 6d 65 6e |are not |implemen|
|00000530| 74 65 64 2e 5c 6e 22 29 | 3b 0d 09 65 78 69 74 28 |ted.\n")|;..exit(|
|00000540| 32 31 29 3b 0d 7d 0d 0d | 69 6e 74 20 62 63 6d 70 |21);.}..|int bcmp|
|00000550| 28 64 2c 64 32 2c 6d 63 | 6e 74 29 0d 63 68 61 72 |(d,d2,mc|nt).char|
|00000560| 20 2a 64 2c 2a 64 32 3b | 0d 69 6e 74 20 20 6d 63 | *d,*d2;|.int mc|
|00000570| 6e 74 3b 0d 7b 0d 09 69 | 66 20 28 73 74 72 6e 63 |nt;.{..i|f (strnc|
|00000580| 6d 70 28 64 2c 64 32 2c | 6d 63 6e 74 29 29 0d 09 |mp(d,d2,|mcnt))..|
|00000590| 20 09 72 65 74 75 72 6e | 28 31 29 3b 0d 09 20 65 | .return|(1);.. e|
|000005a0| 6c 73 65 20 72 65 74 75 | 72 6e 28 30 29 3b 0d 7d |lse retu|rn(0);.}|
|000005b0| 0d 09 20 0d 63 68 61 72 | 20 2a 69 6e 64 65 78 28 |.. .char| *index(|
|000005c0| 73 2c 20 63 29 0d 63 68 | 61 72 20 2a 73 2c 63 3b |s, c).ch|ar *s,c;|
|000005d0| 0d 7b 0d 0d 09 72 65 74 | 75 72 6e 20 28 73 74 72 |.{...ret|urn (str|
|000005e0| 63 68 72 28 73 2c 63 29 | 29 3b 0d 7d 0d 0d 69 6e |chr(s,c)|);.}..in|
|000005f0| 74 20 70 69 70 65 28 66 | 69 6c 64 65 73 29 0d 69 |t pipe(f|ildes).i|
|00000600| 6e 74 20 66 69 6c 64 65 | 73 5b 32 5d 3b 0d 7b 0d |nt filde|s[2];.{.|
|00000610| 0d 09 66 70 72 69 6e 74 | 66 28 73 74 64 65 72 72 |..fprint|f(stderr|
|00000620| 2c 22 53 6f 72 72 79 2c | 20 70 69 70 65 73 20 61 |,"Sorry,| pipes a|
|00000630| 72 65 20 6e 6f 74 20 69 | 6d 70 6c 65 6d 65 6e 74 |re not i|mplement|
|00000640| 65 64 2e 5c 6e 22 29 3b | 0d 09 65 78 69 74 28 32 |ed.\n");|..exit(2|
|00000650| 32 29 3b 0d 0d 7d 0d 0d | 69 6e 74 20 66 6f 72 6b |2);..}..|int fork|
|00000660| 28 29 0d 7b 0d 0d 09 66 | 70 72 69 6e 74 66 28 73 |().{...f|printf(s|
|00000670| 74 64 65 72 72 2c 22 53 | 6f 72 72 79 2c 20 63 61 |tderr,"S|orry, ca|
|00000680| 6e 27 74 20 66 6f 72 6b | 2e 5c 6e 22 29 3b 0d 09 |n't fork|.\n");..|
|00000690| 65 78 69 74 28 32 33 29 | 3b 0d 09 0d 7d 0d 0d 69 |exit(23)|;...}..i|
|000006a0| 6e 74 20 77 61 69 74 28 | 6a 75 6e 6b 29 0d 76 6f |nt wait(|junk).vo|
|000006b0| 69 64 20 2a 20 6a 75 6e | 6b 3b 0d 7b 0d 0d 09 66 |id * jun|k;.{...f|
|000006c0| 70 72 69 6e 74 66 28 73 | 74 64 65 72 72 2c 22 53 |printf(s|tderr,"S|
|000006d0| 6f 72 72 79 2c 20 63 61 | 6e 27 74 20 77 61 69 74 |orry, ca|n't wait|
|000006e0| 2e 5c 6e 22 29 3b 0d 09 | 65 78 69 74 28 32 34 29 |.\n");..|exit(24)|
|000006f0| 3b 0d 7d 0d 0d 69 6e 74 | 0d 64 75 70 32 20 28 6f |;.}..int|.dup2 (o|
|00000700| 6c 64 2c 20 6e 65 77 29 | 0d 69 6e 74 20 6f 6c 64 |ld, new)|.int old|
|00000710| 2c 20 6e 65 77 3b 0d 7b | 0d 0d 09 66 70 72 69 6e |, new;.{|...fprin|
|00000720| 74 66 28 73 74 64 65 72 | 72 2c 22 53 6f 72 72 79 |tf(stder|r,"Sorry|
|00000730| 2c 20 6e 6f 20 64 75 70 | 32 2e 5c 6e 22 29 3b 0d |, no dup|2.\n");.|
|00000740| 09 65 78 69 74 28 32 35 | 29 3b 0d 0d 7d 0d 0d 70 |.exit(25|);..}..p|
|00000750| 6f 69 6e 74 65 72 20 78 | 6d 61 6c 6c 6f 63 28 6e |ointer x|malloc(n|
|00000760| 29 0d 75 6e 73 69 67 6e | 65 64 20 69 6e 74 20 6e |).unsign|ed int n|
|00000770| 3b 0d 7b 0d 20 20 65 78 | 74 65 72 6e 20 70 6f 69 |;.{. ex|tern poi|
|00000780| 6e 74 65 72 20 6d 61 6c | 6c 6f 63 28 29 3b 0d 20 |nter mal|loc();. |
|00000790| 20 70 6f 69 6e 74 65 72 | 20 63 70 3b 0d 20 20 73 | pointer| cp;. s|
|000007a0| 74 61 74 69 63 20 63 68 | 61 72 20 6d 65 73 67 5b |tatic ch|ar mesg[|
|000007b0| 5d 20 3d 20 22 78 6d 61 | 6c 6c 6f 63 3a 20 6e 6f |] = "xma|lloc: no|
|000007c0| 20 6d 65 6d 6f 72 79 21 | 5c 6e 22 3b 0d 0d 20 20 | memory!|\n";.. |
|000007d0| 63 70 20 3d 20 6d 61 6c | 6c 6f 63 28 6e 29 3b 0d |cp = mal|loc(n);.|
|000007e0| 20 20 69 66 20 28 21 20 | 63 70 29 20 7b 0d 20 20 | if (! |cp) {. |
|000007f0| 20 20 77 72 69 74 65 20 | 28 32 2c 20 6d 65 73 67 | write |(2, mesg|
|00000800| 2c 20 73 69 7a 65 6f 66 | 28 6d 65 73 67 29 20 2d |, sizeof|(mesg) -|
|00000810| 20 31 29 3b 0d 20 20 20 | 20 65 78 69 74 28 31 29 | 1);. | exit(1)|
|00000820| 3b 0d 20 20 7d 0d 20 20 | 72 65 74 75 72 6e 20 63 |;. }. |return c|
|00000830| 70 3b 0d 7d 0d 0d 00 00 | 00 00 00 00 00 00 00 00 |p;.}....|........|
|00000840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000880| 00 00 01 00 00 00 01 1c | 00 00 00 1c 00 00 00 5a |........|.......Z|
|00000890| 20 7c 7c 20 28 73 74 72 | 63 68 72 28 62 75 66 2c | || (str|chr(buf,|
|000008a0| 27 65 27 29 20 21 3d 30 | 20 29 20 29 20 72 65 74 |'e') !=0| ) ) ret|
|000008b0| 0b 67 6e 75 66 75 6e 63 | 74 73 2e 63 02 00 00 00 |.gnufunc|ts.c....|
|000008c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008f0| 00 00 a3 8b cf 01 00 00 | 00 00 00 00 01 76 3e 30 |........|.....v>0|
|00000900| 20 3b 69 2d 2d 29 0d 09 | 20 7b 63 20 3d 20 62 75 | ;i--)..| {c = bu|
|00000910| 66 5b 69 5d 3b 0d 09 20 | 20 69 66 20 28 63 20 3d |f[i];.. | if (c =|
|00000920| 3d 20 27 2e 27 29 20 7b | 62 75 66 5b 69 5d 20 3d |= '.') {|buf[i] =|
|00000930| 20 27 5c 30 27 3b 0d 09 | 20 20 09 09 09 09 20 72 | '\0';..| .... r|
|00000940| 65 74 75 72 6e 3b 7d 0d | 09 20 20 69 66 20 28 63 |eturn;}.|. if (c|
|00000950| 20 3d 3d 20 27 30 27 20 | 29 20 62 75 66 5b 69 5d | == '0' |) buf[i]|
|00000960| 20 3d 20 27 5c 30 27 3b | 0d 09 20 20 65 6c 73 65 | = '\0';|.. else|
|00000970| 20 62 72 65 61 6b 3b 7d | 0d 09 20 7d 0d 0d 46 49 | break;}|.. }..FI|
|00000980| 00 00 00 02 00 00 00 00 | 00 04 00 06 00 08 00 00 |........|........|
|00000990| 00 0a 00 09 06 4d 6f 6e | 61 63 6f eb 00 00 01 00 |.....Mon|aco.....|
|000009a0| 00 00 01 1c 00 00 00 1c | 00 00 00 5a 00 2b 65 ee |........|...Z.+e.|
|000009b0| 03 ae 00 00 00 1c 00 5a | 00 02 45 51 45 44 00 00 |.......Z|..EQED..|
|000009c0| 00 1a 45 54 41 42 00 00 | 00 26 45 46 4e 54 00 00 |..ETAB..|.&EFNT..|
|000009d0| 00 32 03 eb ff ff 00 00 | 00 00 00 00 00 00 03 ec |.2......|........|
|000009e0| ff ff 00 00 00 06 00 2b | 65 16 03 eb ff ff 00 00 |.......+|e.......|
|000009f0| 00 0e 00 2b 65 76 00 00 | 00 00 00 00 00 00 00 00 |...+ev..|........|
+--------+-------------------------+-------------------------+--------+--------+