home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume24 / mkid2 / part04 < prev    next >
SHell self-extracting ARchive  |  1991-10-09  |  38.4 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: SHell self-extracting ARchive (archive/shar).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/rfc822 default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 53 75 62 6a 65 63 74 3a | 20 20 76 32 34 69 30 39 |Subject:| v24i09|
|00000010| 32 3a 20 20 50 72 6f 67 | 72 61 6d 20 69 64 65 6e |2: Prog|ram iden|
|00000020| 74 69 66 69 65 72 20 64 | 61 74 61 62 61 73 65 20 |tifier d|atabase |
|00000030| 74 6f 6f 6c 73 2c 20 50 | 61 72 74 30 34 2f 30 37 |tools, P|art04/07|
|00000040| 0a 4e 65 77 73 67 72 6f | 75 70 73 3a 20 63 6f 6d |.Newsgro|ups: com|
|00000050| 70 2e 73 6f 75 72 63 65 | 73 2e 75 6e 69 78 0a 41 |p.source|s.unix.A|
|00000060| 70 70 72 6f 76 65 64 3a | 20 72 73 61 6c 7a 40 75 |pproved:| rsalz@u|
|00000070| 75 6e 65 74 2e 55 55 2e | 4e 45 54 0a 58 2d 43 68 |unet.UU.|NET.X-Ch|
|00000080| 65 63 6b 73 75 6d 2d 53 | 6e 65 66 72 75 3a 20 62 |ecksum-S|nefru: b|
|00000090| 38 61 30 63 30 32 37 20 | 33 66 30 61 39 66 39 32 |8a0c027 |3f0a9f92|
|000000a0| 20 64 65 32 31 66 34 37 | 34 20 35 64 65 62 32 38 | de21f47|4 5deb28|
|000000b0| 37 33 0a 0a 53 75 62 6d | 69 74 74 65 64 2d 62 79 |73..Subm|itted-by|
|000000c0| 3a 20 54 6f 6d 20 48 6f | 72 73 6c 65 79 20 3c 74 |: Tom Ho|rsley <t|
|000000d0| 6f 6d 40 68 63 78 32 2e | 73 73 64 2e 63 73 64 2e |om@hcx2.|ssd.csd.|
|000000e0| 68 61 72 72 69 73 2e 63 | 6f 6d 3e 0a 50 6f 73 74 |harris.c|om>.Post|
|000000f0| 69 6e 67 2d 6e 75 6d 62 | 65 72 3a 20 56 6f 6c 75 |ing-numb|er: Volu|
|00000100| 6d 65 20 32 34 2c 20 49 | 73 73 75 65 20 39 32 0a |me 24, I|ssue 92.|
|00000110| 41 72 63 68 69 76 65 2d | 6e 61 6d 65 3a 20 6d 6b |Archive-|name: mk|
|00000120| 69 64 32 2f 70 61 72 74 | 30 34 0a 0a 23 21 20 2f |id2/part|04..#! /|
|00000130| 62 69 6e 2f 73 68 0a 23 | 20 54 68 69 73 20 69 73 |bin/sh.#| This is|
|00000140| 20 61 20 73 68 65 6c 6c | 20 61 72 63 68 69 76 65 | a shell| archive|
|00000150| 2e 20 20 52 65 6d 6f 76 | 65 20 61 6e 79 74 68 69 |. Remov|e anythi|
|00000160| 6e 67 20 62 65 66 6f 72 | 65 20 74 68 69 73 20 6c |ng befor|e this l|
|00000170| 69 6e 65 2c 20 74 68 65 | 6e 20 75 6e 70 61 63 6b |ine, the|n unpack|
|00000180| 0a 23 20 69 74 20 62 79 | 20 73 61 76 69 6e 67 20 |.# it by| saving |
|00000190| 69 74 20 69 6e 74 6f 20 | 61 20 66 69 6c 65 20 61 |it into |a file a|
|000001a0| 6e 64 20 74 79 70 69 6e | 67 20 22 73 68 20 66 69 |nd typin|g "sh fi|
|000001b0| 6c 65 22 2e 20 20 54 6f | 20 6f 76 65 72 77 72 69 |le". To| overwri|
|000001c0| 74 65 20 65 78 69 73 74 | 69 6e 67 0a 23 20 66 69 |te exist|ing.# fi|
|000001d0| 6c 65 73 2c 20 74 79 70 | 65 20 22 73 68 20 66 69 |les, typ|e "sh fi|
|000001e0| 6c 65 20 2d 63 22 2e 20 | 20 59 6f 75 20 63 61 6e |le -c". | You can|
|000001f0| 20 61 6c 73 6f 20 66 65 | 65 64 20 74 68 69 73 20 | also fe|ed this |
|00000200| 61 73 20 73 74 61 6e 64 | 61 72 64 20 69 6e 70 75 |as stand|ard inpu|
|00000210| 74 20 76 69 61 0a 23 20 | 75 6e 73 68 61 72 2c 20 |t via.# |unshar, |
|00000220| 6f 72 20 62 79 20 74 79 | 70 69 6e 67 20 22 73 68 |or by ty|ping "sh|
|00000230| 20 3c 66 69 6c 65 22 2c | 20 65 2e 67 2e 2e 20 20 | <file",| e.g.. |
|00000240| 49 66 20 74 68 69 73 20 | 61 72 63 68 69 76 65 20 |If this |archive |
|00000250| 69 73 20 63 6f 6d 70 6c | 65 74 65 2c 20 79 6f 75 |is compl|ete, you|
|00000260| 0a 23 20 77 69 6c 6c 20 | 73 65 65 20 74 68 65 20 |.# will |see the |
|00000270| 66 6f 6c 6c 6f 77 69 6e | 67 20 6d 65 73 73 61 67 |followin|g messag|
|00000280| 65 20 61 74 20 74 68 65 | 20 65 6e 64 3a 0a 23 09 |e at the| end:.#.|
|00000290| 09 22 45 6e 64 20 6f 66 | 20 61 72 63 68 69 76 65 |."End of| archive|
|000002a0| 20 34 20 28 6f 66 20 37 | 29 2e 22 0a 23 20 43 6f | 4 (of 7|).".# Co|
|000002b0| 6e 74 65 6e 74 73 3a 20 | 20 54 55 54 4f 52 49 41 |ntents: | TUTORIA|
|000002c0| 4c 20 69 69 64 2e 79 20 | 73 63 61 6e 2d 63 2e 63 |L iid.y |scan-c.c|
|000002d0| 0a 23 20 57 72 61 70 70 | 65 64 20 62 79 20 74 6f |.# Wrapp|ed by to|
|000002e0| 6d 40 68 63 78 32 20 6f | 6e 20 54 75 65 20 46 65 |m@hcx2 o|n Tue Fe|
|000002f0| 62 20 32 36 20 31 30 3a | 30 33 3a 30 34 20 31 39 |b 26 10:|03:04 19|
|00000300| 39 31 0a 50 41 54 48 3d | 2f 62 69 6e 3a 2f 75 73 |91.PATH=|/bin:/us|
|00000310| 72 2f 62 69 6e 3a 2f 75 | 73 72 2f 75 63 62 20 3b |r/bin:/u|sr/ucb ;|
|00000320| 20 65 78 70 6f 72 74 20 | 50 41 54 48 0a 69 66 20 | export |PATH.if |
|00000330| 74 65 73 74 20 2d 66 20 | 27 54 55 54 4f 52 49 41 |test -f |'TUTORIA|
|00000340| 4c 27 20 2d 61 20 22 24 | 7b 31 7d 22 20 21 3d 20 |L' -a "$|{1}" != |
|00000350| 22 2d 63 22 20 3b 20 74 | 68 65 6e 20 0a 20 20 65 |"-c" ; t|hen . e|
|00000360| 63 68 6f 20 73 68 61 72 | 3a 20 57 69 6c 6c 20 6e |cho shar|: Will n|
|00000370| 6f 74 20 63 6c 6f 62 62 | 65 72 20 65 78 69 73 74 |ot clobb|er exist|
|00000380| 69 6e 67 20 66 69 6c 65 | 20 5c 22 27 54 55 54 4f |ing file| \"'TUTO|
|00000390| 52 49 41 4c 27 5c 22 0a | 65 6c 73 65 0a 65 63 68 |RIAL'\".|else.ech|
|000003a0| 6f 20 73 68 61 72 3a 20 | 45 78 74 72 61 63 74 69 |o shar: |Extracti|
|000003b0| 6e 67 20 5c 22 27 54 55 | 54 4f 52 49 41 4c 27 5c |ng \"'TU|TORIAL'\|
|000003c0| 22 20 5c 28 31 36 30 33 | 37 20 63 68 61 72 61 63 |" \(1603|7 charac|
|000003d0| 74 65 72 73 5c 29 0a 73 | 65 64 20 22 73 2f 5e 58 |ters\).s|ed "s/^X|
|000003e0| 2f 2f 22 20 3e 27 54 55 | 54 4f 52 49 41 4c 27 20 |//" >'TU|TORIAL' |
|000003f0| 3c 3c 27 45 4e 44 5f 4f | 46 5f 46 49 4c 45 27 0a |<<'END_O|F_FILE'.|
|00000400| 58 0a 58 54 68 69 73 20 | 69 73 20 61 20 70 72 6f |X.XThis |is a pro|
|00000410| 67 72 61 6d 20 69 64 65 | 6e 74 69 66 69 65 72 20 |gram ide|ntifier |
|00000420| 64 61 74 61 62 61 73 65 | 20 70 61 63 6b 61 67 65 |database| package|
|00000430| 2e 20 20 54 68 65 73 65 | 20 74 6f 6f 6c 73 20 70 |. These| tools p|
|00000440| 72 6f 76 69 64 65 20 61 | 0a 58 6c 6f 67 69 63 61 |rovide a|.Xlogica|
|00000450| 6c 20 65 78 74 65 6e 73 | 69 6f 6e 20 74 6f 20 63 |l extens|ion to c|
|00000460| 74 61 67 73 2e 20 28 77 | 68 69 63 68 20 69 73 20 |tags. (w|hich is |
|00000470| 6c 69 6d 69 74 65 64 20 | 69 6e 20 74 68 61 74 20 |limited |in that |
|00000480| 69 74 20 6f 6e 6c 79 20 | 73 74 6f 72 65 73 20 74 |it only |stores t|
|00000490| 68 65 0a 58 6c 6f 63 61 | 74 69 6f 6e 20 6f 66 20 |he.Xloca|tion of |
|000004a0| 66 75 6e 63 74 69 6f 6e | 20 61 6e 64 20 74 79 70 |function| and typ|
|000004b0| 65 20 2a 64 65 66 69 6e | 69 74 69 6f 6e 73 2a 61 |e *defin|itions*a|
|000004c0| 29 20 20 54 68 65 20 49 | 44 20 66 61 63 69 6c 69 |) The I|D facili|
|000004d0| 74 79 0a 58 73 74 6f 72 | 65 73 20 74 68 65 20 6c |ty.Xstor|es the l|
|000004e0| 6f 63 61 74 69 6f 6e 73 | 20 66 6f 72 20 61 6c 6c |ocations| for all|
|000004f0| 20 75 73 65 73 20 6f 66 | 20 69 64 65 6e 74 69 66 | uses of| identif|
|00000500| 69 65 72 73 2c 20 70 72 | 65 2d 70 72 6f 63 65 73 |iers, pr|e-proces|
|00000510| 73 6f 72 0a 58 6e 61 6d | 65 73 2c 20 61 6e 64 20 |sor.Xnam|es, and |
|00000520| 6e 75 6d 62 65 72 73 2e | 20 28 69 6e 20 64 65 63 |numbers.| (in dec|
|00000530| 69 6d 61 6c 2c 20 6f 63 | 74 61 6c 20 6f 72 20 68 |imal, oc|tal or h|
|00000540| 65 78 29 0a 58 0a 58 57 | 68 65 6e 20 66 69 78 69 |ex).X.XW|hen fixi|
|00000550| 6e 67 20 6f 72 20 65 6e | 68 61 6e 63 69 6e 67 20 |ng or en|hancing |
|00000560| 61 20 6c 61 72 67 65 20 | 70 72 6f 67 72 61 6d 20 |a large |program |
|00000570| 28 70 61 72 74 69 63 75 | 6c 61 72 6c 79 20 6f 6e |(particu|larly on|
|00000580| 65 20 74 68 61 74 20 69 | 73 0a 58 75 6e 66 61 6d |e that i|s.Xunfam|
|00000590| 69 6c 69 61 72 29 20 69 | 74 20 69 73 20 6f 66 74 |iliar) i|t is oft|
|000005a0| 65 6e 20 6e 65 63 65 73 | 73 61 72 79 20 74 6f 20 |en neces|sary to |
|000005b0| 61 75 64 69 74 20 74 68 | 65 20 75 73 65 20 6f 66 |audit th|e use of|
|000005c0| 20 67 6c 6f 62 61 6c 0a | 58 64 61 74 61 2d 73 74 | global.|Xdata-st|
|000005d0| 72 75 63 74 75 72 65 73 | 20 69 6e 20 6f 72 64 65 |ructures| in orde|
|000005e0| 72 20 74 6f 20 76 65 72 | 69 66 79 20 74 68 61 74 |r to ver|ify that|
|000005f0| 20 74 68 65 20 70 72 6f | 70 6f 73 65 64 20 6d 6f | the pro|posed mo|
|00000600| 64 69 66 69 63 61 74 69 | 6f 6e 20 77 69 6c 6c 0a |dificati|on will.|
|00000610| 58 6e 6f 74 20 74 72 69 | 67 67 65 72 20 61 6e 79 |Xnot tri|gger any|
|00000620| 20 68 69 64 64 65 6e 20 | 60 67 6f 74 63 68 61 73 | hidden |`gotchas|
|00000630| 27 2e 20 20 4f 66 74 65 | 6e 20 74 68 69 73 20 65 |'. Ofte|n this e|
|00000640| 6e 74 61 69 6c 73 20 67 | 72 65 70 70 69 6e 67 20 |ntails g|repping |
|00000650| 74 68 72 6f 75 67 68 0a | 58 6d 61 6e 79 20 74 68 |through.|Xmany th|
|00000660| 6f 75 73 61 6e 64 73 20 | 6f 66 20 6c 69 6e 65 73 |ousands |of lines|
|00000670| 20 6f 66 20 73 6f 75 72 | 63 65 20 63 6f 64 65 20 | of sour|ce code |
|00000680| 73 70 72 65 61 64 20 6f | 76 65 72 20 64 6f 7a 65 |spread o|ver doze|
|00000690| 6e 73 20 61 6e 64 20 73 | 6f 6d 65 74 69 6d 65 73 |ns and s|ometimes|
|000006a0| 0a 58 68 75 6e 64 72 65 | 64 73 20 6f 66 20 73 6f |.Xhundre|ds of so|
|000006b0| 75 72 63 65 20 66 69 6c | 65 73 20 69 6e 20 6d 75 |urce fil|es in mu|
|000006c0| 6c 74 69 70 6c 65 20 73 | 75 62 2d 64 69 72 65 63 |ltiple s|ub-direc|
|000006d0| 74 6f 72 69 65 73 2e 20 | 20 54 68 69 73 20 70 72 |tories. | This pr|
|000006e0| 6f 63 65 73 73 0a 58 70 | 6c 61 63 65 73 20 61 20 |ocess.Xp|laces a |
|000006f0| 73 69 67 6e 69 66 69 63 | 61 6e 74 20 6c 6f 61 64 |signific|ant load|
|00000700| 20 6f 6e 20 63 6f 6d 70 | 75 74 69 6e 67 20 72 65 | on comp|uting re|
|00000710| 73 6f 75 72 63 65 73 2c | 20 61 6e 64 20 74 61 6b |sources,| and tak|
|00000720| 65 73 20 61 20 6c 6f 6e | 67 0a 58 74 69 6d 65 2e |es a lon|g.Xtime.|
|00000730| 20 20 54 68 65 72 65 20 | 69 73 20 65 76 65 6e 20 | There |is even |
|00000740| 74 68 65 20 64 61 6e 67 | 65 72 20 74 68 61 74 20 |the dang|er that |
|00000750| 61 20 70 72 6f 67 72 61 | 6d 6d 65 72 20 77 69 6c |a progra|mmer wil|
|00000760| 6c 20 61 76 6f 69 64 20 | 64 6f 69 6e 67 20 61 0a |l avoid |doing a.|
|00000770| 58 63 6f 6d 70 6c 65 74 | 65 20 61 75 64 69 74 20 |Xcomplet|e audit |
|00000780| 64 75 65 20 74 6f 20 74 | 68 65 20 70 65 72 63 65 |due to t|he perce|
|00000790| 69 76 65 64 20 63 6f 73 | 74 2d 2d 68 65 20 6f 72 |ived cos|t--he or|
|000007a0| 20 73 68 65 20 77 69 6c | 6c 20 72 65 6c 79 20 6f | she wil|l rely o|
|000007b0| 6e 20 6d 65 6d 6f 72 79 | 0a 58 61 6e 64 20 68 6f |n memory|.Xand ho|
|000007c0| 70 65 20 74 68 61 74 20 | 74 68 65 72 65 20 61 72 |pe that |there ar|
|000007d0| 65 20 6e 6f 20 62 6f 6f | 62 79 20 74 72 61 70 73 |e no boo|by traps|
|000007e0| 2e 0a 58 0a 58 54 68 65 | 20 69 64 2d 64 61 74 61 |..X.XThe| id-data|
|000007f0| 62 61 73 65 20 69 73 20 | 6d 6f 73 74 20 75 73 65 |base is |most use|
|00000800| 66 75 6c 20 66 6f 72 20 | 6d 61 69 6e 74 61 69 6e |ful for |maintain|
|00000810| 69 6e 67 20 6c 61 72 67 | 65 20 70 72 6f 67 72 61 |ing larg|e progra|
|00000820| 6d 73 20 74 68 61 74 0a | 58 63 6f 6e 73 69 73 74 |ms that.|Xconsist|
|00000830| 20 6f 66 20 6d 61 6e 79 | 20 73 6f 75 72 63 65 20 | of many| source |
|00000840| 66 69 6c 65 73 2e 20 20 | 54 68 65 20 64 61 74 61 |files. |The data|
|00000850| 62 61 73 65 20 69 73 20 | 73 69 6d 70 6c 79 20 61 |base is |simply a|
|00000860| 20 74 77 6f 20 64 69 6d | 65 6e 73 69 6f 6e 61 6c | two dim|ensional|
|00000870| 0a 58 62 6f 6f 6c 65 61 | 6e 20 61 72 72 61 79 20 |.Xboolea|n array |
|00000880| 69 6e 64 65 78 65 64 20 | 62 79 20 69 64 65 6e 74 |indexed |by ident|
|00000890| 69 66 69 65 72 2d 6e 61 | 6d 65 20 61 6e 64 20 73 |ifier-na|me and s|
|000008a0| 6f 75 72 63 65 2d 66 69 | 6c 65 2d 6e 61 6d 65 2e |ource-fi|le-name.|
|000008b0| 20 20 46 6f 72 20 61 0a | 58 67 69 76 65 6e 20 69 | For a.|Xgiven i|
|000008c0| 64 65 6e 74 69 66 69 65 | 72 20 61 6e 64 20 73 6f |dentifie|r and so|
|000008d0| 75 72 63 65 2d 66 69 6c | 65 2c 20 69 66 20 74 68 |urce-fil|e, if th|
|000008e0| 65 20 69 64 65 6e 74 69 | 66 69 65 72 20 6f 63 63 |e identi|fier occ|
|000008f0| 75 72 73 20 69 6e 20 74 | 68 65 20 66 69 6c 65 2c |urs in t|he file,|
|00000900| 0a 58 74 68 65 20 62 6f | 6f 6c 65 61 6e 20 76 61 |.Xthe bo|olean va|
|00000910| 6c 75 65 20 69 73 20 54 | 52 55 45 2e 20 20 54 68 |lue is T|RUE. Th|
|00000920| 65 20 64 61 74 61 62 61 | 73 65 20 6d 61 79 20 62 |e databa|se may b|
|00000930| 65 20 71 75 65 72 69 65 | 64 20 65 69 74 68 65 72 |e querie|d either|
|00000940| 20 62 79 0a 58 69 64 65 | 6e 74 69 66 69 65 72 2d | by.Xide|ntifier-|
|00000950| 6e 61 6d 65 20 6f 72 20 | 66 69 6c 65 2d 6e 61 6d |name or |file-nam|
|00000960| 65 2e 0a 58 0a 58 54 68 | 65 20 66 6f 6c 6c 6f 77 |e..X.XTh|e follow|
|00000970| 69 6e 67 20 74 79 70 65 | 73 20 6f 66 20 71 75 65 |ing type|s of que|
|00000980| 72 69 65 73 20 73 75 70 | 70 6f 72 74 65 64 3a 0a |ries sup|ported:.|
|00000990| 58 0a 58 2a 20 6e 61 6d | 65 20 6c 6f 6f 6b 75 70 |X.X* nam|e lookup|
|000009a0| 0a 58 09 6c 69 73 74 20 | 61 6c 6c 20 74 68 65 20 |.X.list |all the |
|000009b0| 66 69 6c 65 73 20 77 68 | 65 72 65 20 61 6e 20 69 |files wh|ere an i|
|000009c0| 64 65 6e 74 69 66 69 65 | 72 20 6f 63 63 75 72 73 |dentifie|r occurs|
|000009d0| 2e 20 20 54 68 65 20 6e | 61 6d 65 0a 58 09 6d 61 |. The n|ame.X.ma|
|000009e0| 79 20 62 65 20 61 20 72 | 65 67 75 6c 61 72 20 65 |y be a r|egular e|
|000009f0| 78 70 72 65 73 73 69 6f | 6e 2e 0a 58 0a 58 2a 20 |xpressio|n..X.X* |
|00000a00| 6e 61 6d 65 20 61 70 72 | 6f 70 6f 73 0a 58 09 6c |name apr|opos.X.l|
|00000a10| 69 73 74 20 61 6c 6c 20 | 74 68 65 20 66 69 6c 65 |ist all |the file|
|00000a20| 73 20 66 6f 72 20 61 6c | 6c 20 69 64 65 6e 74 69 |s for al|l identi|
|00000a30| 66 69 65 72 73 20 74 68 | 61 74 20 68 61 76 65 20 |fiers th|at have |
|00000a40| 74 68 65 20 73 75 62 2d | 73 74 72 69 6e 67 0a 58 |the sub-|string.X|
|00000a50| 09 6e 61 6d 65 20 69 6e | 20 74 68 65 6d 2e 20 20 |.name in| them. |
|00000a60| 4d 61 74 63 68 65 73 20 | 61 72 65 20 64 6f 6e 65 |Matches |are done|
|00000a70| 20 69 6e 20 61 20 63 61 | 73 65 2d 69 6e 73 65 6e | in a ca|se-insen|
|00000a80| 73 69 74 69 76 65 20 6d | 61 6d 6d 65 72 2e 0a 58 |sitive m|ammer..X|
|00000a90| 0a 58 2a 20 6e 61 6d 65 | 20 60 67 72 65 70 27 0a |.X* name| `grep'.|
|00000aa0| 58 09 73 65 61 72 63 68 | 20 66 6f 72 20 61 6e 20 |X.search| for an |
|00000ab0| 69 64 65 6e 74 69 66 69 | 65 72 20 69 6e 20 61 6c |identifi|er in al|
|00000ac0| 6c 20 74 68 65 20 66 69 | 6c 65 73 20 77 68 65 72 |l the fi|les wher|
|00000ad0| 65 20 69 74 20 6f 63 63 | 75 72 73 2e 0a 58 09 54 |e it occ|urs..X.T|
|00000ae0| 68 69 73 20 69 73 20 61 | 6e 20 6f 70 74 69 6d 69 |his is a|n optimi|
|00000af0| 7a 65 64 20 60 67 72 65 | 70 27 20 6f 76 65 72 20 |zed `gre|p' over |
|00000b00| 61 6c 6c 20 74 68 65 20 | 73 6f 75 72 63 65 73 2d |all the |sources-|
|00000b10| 2d 77 65 20 6f 6e 6c 79 | 0a 58 09 73 65 61 72 63 |-we only|.X.searc|
|00000b20| 68 20 6f 6e 20 66 69 6c | 65 73 20 74 68 61 74 20 |h on fil|es that |
|00000b30| 63 6f 6e 74 61 69 6e 20 | 74 68 65 20 69 64 65 6e |contain |the iden|
|00000b40| 74 69 66 69 65 72 2e 0a | 58 0a 58 2a 20 6e 61 6d |tifier..|X.X* nam|
|00000b50| 65 20 65 64 69 74 0a 58 | 09 69 6e 76 6f 6b 65 20 |e edit.X|.invoke |
|00000b60| 61 6e 20 65 64 69 74 6f | 72 20 6f 6e 20 74 68 65 |an edito|r on the|
|00000b70| 20 66 69 6c 65 73 20 77 | 68 65 72 65 20 61 6e 20 | files w|here an |
|00000b80| 69 64 65 6e 74 69 66 69 | 65 72 20 6f 63 63 75 72 |identifi|er occur|
|00000b90| 73 2c 0a 58 09 61 6e 64 | 20 75 73 65 20 74 68 65 |s,.X.and| use the|
|00000ba0| 20 69 64 65 6e 74 69 66 | 69 65 72 20 61 73 20 61 | identif|ier as a|
|00000bb0| 6e 20 69 6e 69 74 69 61 | 6c 20 73 65 61 72 63 68 |n initia|l search|
|00000bc0| 20 73 74 72 69 6e 67 2e | 0a 58 0a 58 2a 20 66 69 | string.|.X.X* fi|
|00000bd0| 6c 65 20 6c 6f 6f 6b 75 | 70 0a 58 09 6c 69 73 74 |le looku|p.X.list|
|00000be0| 20 61 6c 6c 20 69 64 65 | 6e 74 69 66 69 65 72 73 | all ide|ntifiers|
|00000bf0| 20 74 68 61 74 20 6f 63 | 63 75 72 20 69 6e 20 61 | that oc|cur in a|
|00000c00| 20 66 69 6c 65 2c 20 6f | 72 20 6c 69 73 74 0a 58 | file, o|r list.X|
|00000c10| 09 74 68 65 20 69 64 65 | 6e 74 69 66 69 65 72 73 |.the ide|ntifiers|
|00000c20| 20 74 68 61 74 20 61 72 | 65 20 63 6f 6d 6d 6f 6e | that ar|e common|
|00000c30| 20 62 65 74 77 65 65 6e | 20 74 77 6f 20 66 69 6c | between| two fil|
|00000c40| 65 73 2e 0a 58 0a 58 2a | 20 6e 6f 6e 2d 75 6e 69 |es..X.X*| non-uni|
|00000c50| 71 75 65 20 6e 61 6d 65 | 73 0a 58 09 6c 69 73 74 |que name|s.X.list|
|00000c60| 20 74 68 65 20 6e 61 6d | 65 73 20 6f 66 20 61 6c | the nam|es of al|
|00000c70| 6c 20 69 6e 64 65 6e 74 | 69 66 69 65 72 73 20 77 |l indent|ifiers w|
|00000c80| 68 6f 73 65 20 6e 61 6d | 65 73 20 61 72 65 20 6e |hose nam|es are n|
|00000c90| 6f 6e 2d 75 6e 69 71 75 | 65 0a 58 09 77 69 74 68 |on-uniqu|e.X.with|
|00000ca0| 69 6e 20 73 6f 6d 65 20 | 6e 75 6d 62 65 72 20 6f |in some |number o|
|00000cb0| 66 20 63 68 61 72 61 63 | 74 65 72 73 2e 20 20 54 |f charac|ters. T|
|00000cc0| 68 69 73 20 69 73 20 75 | 73 65 66 75 6c 20 77 68 |his is u|seful wh|
|00000cd0| 65 6e 20 70 6f 72 74 69 | 6e 67 0a 58 09 61 20 70 |en porti|ng.X.a p|
|00000ce0| 72 6f 67 72 61 6d 20 66 | 72 6f 6d 20 61 20 60 66 |rogram f|rom a `f|
|00000cf0| 6c 65 78 6e 61 6d 65 73 | 27 20 73 79 73 74 65 6d |lexnames|' system|
|00000d00| 20 74 6f 20 6f 6e 65 20 | 6d 6f 72 65 20 6c 69 6d | to one |more lim|
|00000d10| 69 74 65 64 20 6e 61 6d | 65 73 2e 0a 58 0a 58 2a |ited nam|es..X.X*|
|00000d20| 20 73 6f 6c 6f 0a 58 09 | 6c 69 73 74 20 61 6c 6c | solo.X.|list all|
|00000d30| 20 69 64 65 6e 74 69 66 | 69 65 72 73 20 74 68 61 | identif|iers tha|
|00000d40| 74 20 6f 63 63 75 72 20 | 65 78 61 63 74 6c 79 20 |t occur |exactly |
|00000d50| 6f 6e 63 65 20 69 6e 20 | 61 20 73 6f 66 74 77 61 |once in |a softwa|
|00000d60| 72 65 0a 58 09 73 79 73 | 74 65 6d 2e 20 20 54 68 |re.X.sys|tem. Th|
|00000d70| 69 73 20 6d 61 79 20 62 | 65 20 75 73 65 66 75 6c |is may b|e useful|
|00000d80| 20 66 6f 72 20 6c 6f 63 | 61 74 69 6e 67 20 69 64 | for loc|ating id|
|00000d90| 65 6e 74 69 66 69 65 72 | 73 20 74 68 61 74 20 61 |entifier|s that a|
|00000da0| 72 65 0a 58 09 64 65 63 | 6c 61 72 65 64 20 62 75 |re.X.dec|lared bu|
|00000db0| 74 20 6e 65 76 65 72 20 | 75 73 65 64 2c 20 6f 72 |t never |used, or|
|00000dc0| 20 6c 69 62 72 61 72 79 | 20 66 75 6e 63 74 69 6f | library| functio|
|00000dd0| 6e 73 20 74 68 61 74 20 | 61 72 65 20 75 73 65 64 |ns that |are used|
|00000de0| 0a 58 09 62 75 74 20 6e | 65 76 65 72 20 64 65 63 |.X.but n|ever dec|
|00000df0| 6c 61 72 65 64 2e 0a 58 | 09 0a 58 0a 58 54 68 65 |lared..X|..X.XThe|
|00000e00| 20 66 69 72 73 74 20 66 | 6f 75 72 20 71 75 65 72 | first f|our quer|
|00000e10| 69 65 73 20 61 72 65 20 | 68 61 6e 64 6c 65 64 20 |ies are |handled |
|00000e20| 62 79 20 6f 6e 65 20 70 | 72 6f 67 72 61 6d 2e 20 |by one p|rogram. |
|00000e30| 20 54 68 65 20 74 79 70 | 65 20 6f 66 20 71 75 65 | The typ|e of que|
|00000e40| 72 79 0a 58 69 73 20 64 | 65 74 65 72 6d 69 6e 65 |ry.Xis d|etermine|
|00000e50| 64 20 62 79 20 74 68 65 | 20 6e 61 6d 65 20 74 68 |d by the| name th|
|00000e60| 65 20 70 72 6f 67 72 61 | 6d 20 77 61 73 20 69 6e |e progra|m was in|
|00000e70| 76 6f 6b 65 64 20 77 69 | 74 68 2e 20 20 54 68 65 |voked wi|th. The|
|00000e80| 20 66 6f 75 72 20 6c 69 | 6e 6b 73 0a 58 61 72 65 | four li|nks.Xare|
|00000e90| 20 6c 69 64 28 31 29 20 | 66 6f 72 20 60 6c 6f 6f | lid(1) |for `loo|
|00000ea0| 6b 75 70 20 69 64 27 2c | 20 61 69 64 28 31 29 20 |kup id',| aid(1) |
|00000eb0| 66 6f 72 20 60 61 70 72 | 6f 70 6f 73 20 69 64 27 |for `apr|opos id'|
|00000ec0| 2c 20 67 69 64 28 31 29 | 20 66 6f 72 20 60 67 72 |, gid(1)| for `gr|
|00000ed0| 65 70 0a 58 69 64 27 20 | 61 6e 64 20 65 69 64 28 |ep.Xid' |and eid(|
|00000ee0| 31 29 20 66 6f 72 20 60 | 65 64 69 74 20 69 64 27 |1) for `|edit id'|
|00000ef0| 2e 20 20 4f 6e 65 20 6f | 72 20 6d 6f 72 65 20 69 |. One o|r more i|
|00000f00| 64 65 6e 74 69 66 69 65 | 72 73 20 6d 61 79 20 62 |dentifie|rs may b|
|00000f10| 65 20 70 61 73 73 65 64 | 20 6f 6e 0a 58 74 68 65 |e passed| on.Xthe|
|00000f20| 20 63 6f 6d 6d 61 6e 64 | 20 6c 69 6e 65 2e 20 20 | command| line. |
|00000f30| 54 68 65 20 69 64 65 6e | 74 69 66 69 65 72 73 20 |The iden|tifiers |
|00000f40| 6d 61 79 20 62 65 20 6c | 69 74 65 72 61 6c 20 73 |may be l|iteral s|
|00000f50| 74 72 69 6e 67 73 20 6f | 72 20 72 65 67 75 6c 61 |trings o|r regula|
|00000f60| 72 0a 58 65 78 70 72 65 | 73 73 69 6f 6e 73 2e 20 |r.Xexpre|ssions. |
|00000f70| 20 48 65 72 65 20 61 72 | 65 20 73 6f 6d 65 20 65 | Here ar|e some e|
|00000f80| 78 61 6d 70 6c 65 73 3a | 0a 58 0a 58 24 20 6c 69 |xamples:|.X.X$ li|
|00000f90| 64 20 46 49 4c 45 0a 58 | 46 49 4c 45 20 20 20 20 |d FILE.X|FILE |
|00000fa0| 20 20 20 20 20 20 20 65 | 78 74 65 72 6e 2e 68 20 | e|xtern.h |
|00000fb0| 7b 66 69 64 2c 67 65 74 | 73 30 2c 67 65 74 73 46 |{fid,get|s0,getsF|
|00000fc0| 46 2c 69 64 78 2c 69 6e | 69 74 2c 6c 69 64 2c 6d |F,idx,in|it,lid,m|
|00000fd0| 6b 69 64 2c 6f 70 65 6e | 73 72 63 2c 73 63 61 6e |kid,open|src,scan|
|00000fe0| 2d 61 73 6d 2c 73 63 61 | 6e 2d 63 7d 2e 63 0a 58 |-asm,sca|n-c}.c.X|
|00000ff0| 0a 58 24 20 6c 69 64 20 | 46 49 4c 45 24 0a 58 41 |.X$ lid |FILE$.XA|
|00001000| 46 5f 46 49 4c 45 20 20 | 20 20 20 20 20 20 6d 6b |F_FILE | mk|
|00001010| 69 64 2e 63 0a 58 41 46 | 5f 49 44 46 49 4c 45 20 |id.c.XAF|_IDFILE |
|00001020| 20 20 20 20 20 6d 6b 69 | 64 2e 63 0a 58 46 49 4c | mki|d.c.XFIL|
|00001030| 45 20 20 20 20 20 20 20 | 20 20 20 20 65 78 74 65 |E | exte|
|00001040| 72 6e 2e 68 20 7b 66 69 | 64 2c 67 65 74 73 30 2c |rn.h {fi|d,gets0,|
|00001050| 67 65 74 73 46 46 2c 69 | 64 78 2c 69 6e 69 74 2c |getsFF,i|dx,init,|
|00001060| 6c 69 64 2c 6d 6b 69 64 | 2c 6f 70 65 6e 73 72 63 |lid,mkid|,opensrc|
|00001070| 2c 73 63 61 6e 2d 61 73 | 6d 2c 73 63 61 6e 2d 63 |,scan-as|m,scan-c|
|00001080| 7d 2e 63 0a 58 49 44 46 | 49 4c 45 20 20 20 20 20 |}.c.XIDF|ILE |
|00001090| 20 20 20 20 69 64 2e 68 | 20 7b 66 69 64 2c 6c 69 | id.h| {fid,li|
|000010a0| 64 2c 6d 6b 69 64 7d 2e | 63 0a 58 49 64 46 49 4c |d,mkid}.|c.XIdFIL|
|000010b0| 45 20 20 20 20 20 20 20 | 20 20 7b 66 69 64 2c 6c |E | {fid,l|
|000010c0| 69 64 7d 2e 63 0a 58 61 | 72 67 46 49 4c 45 20 20 |id}.c.Xa|rgFILE |
|000010d0| 20 20 20 20 20 20 6d 6b | 69 64 2e 63 0a 58 67 69 | mk|id.c.Xgi|
|000010e0| 64 46 49 4c 45 20 20 20 | 20 20 20 20 20 6c 69 64 |dFILE | lid|
|000010f0| 2e 63 0a 58 69 64 46 49 | 4c 45 20 20 20 20 20 20 |.c.XidFI|LE |
|00001100| 20 20 20 7b 69 6e 69 74 | 2c 6d 6b 69 64 7d 2e 63 | {init|,mkid}.c|
|00001110| 0a 58 69 6e 46 49 4c 45 | 20 20 20 20 20 20 20 20 |.XinFILE| |
|00001120| 20 7b 67 65 74 73 30 2c | 67 65 74 73 46 46 2c 73 | {gets0,|getsFF,s|
|00001130| 63 61 6e 2d 61 73 6d 2c | 73 63 61 6e 2d 63 7d 2e |can-asm,|scan-c}.|
|00001140| 63 0a 58 6f 70 65 6e 53 | 72 63 46 49 4c 45 20 20 |c.XopenS|rcFILE |
|00001150| 20 20 65 78 74 65 72 6e | 2e 68 20 7b 69 64 78 2c | extern|.h {idx,|
|00001160| 6d 6b 69 64 2c 6f 70 65 | 6e 73 72 63 7d 2e 63 0a |mkid,ope|nsrc}.c.|
|00001170| 58 73 72 63 46 49 4c 45 | 20 20 20 20 20 20 20 20 |XsrcFILE| |
|00001180| 7b 69 64 78 2c 6d 6b 69 | 64 2c 6f 70 65 6e 73 72 |{idx,mki|d,opensr|
|00001190| 63 7d 2e 63 0a 58 0a 58 | 24 20 6c 69 64 20 5e 67 |c}.c.X.X|$ lid ^g|
|000011a0| 65 74 0a 58 67 65 74 20 | 20 20 20 20 20 20 20 20 |et.Xget | |
|000011b0| 20 20 20 6f 70 65 6e 73 | 72 63 2e 63 0a 58 67 65 | opens|rc.c.Xge|
|000011c0| 74 41 64 61 49 64 20 20 | 20 20 20 20 20 67 65 74 |tAdaId | get|
|000011d0| 73 63 61 6e 2e 63 0a 58 | 67 65 74 41 73 6d 49 64 |scan.c.X|getAsmId|
|000011e0| 20 20 20 20 20 20 20 65 | 78 74 65 72 6e 2e 68 20 | e|xtern.h |
|000011f0| 7b 67 65 74 73 63 61 6e | 2c 73 63 61 6e 2d 61 73 |{getscan|,scan-as|
|00001200| 6d 7d 2e 63 0a 58 67 65 | 74 43 49 64 20 20 20 20 |m}.c.Xge|tCId |
|00001210| 20 20 20 20 20 65 78 74 | 65 72 6e 2e 68 20 7b 67 | ext|ern.h {g|
|00001220| 65 74 73 63 61 6e 2c 73 | 63 61 6e 2d 63 7d 2e 63 |etscan,s|can-c}.c|
|00001230| 0a 58 67 65 74 44 69 72 | 54 6f 4e 61 6d 65 20 20 |.XgetDir|ToName |
|00001240| 20 65 78 74 65 72 6e 2e | 68 20 7b 66 69 64 2c 6c | extern.|h {fid,l|
|00001250| 69 64 2c 70 61 74 68 73 | 7d 2e 63 0a 58 67 65 74 |id,paths|}.c.Xget|
|00001260| 49 64 20 20 20 20 20 20 | 20 20 20 20 7b 69 64 78 |Id | {idx|
|00001270| 2c 6d 6b 69 64 7d 2e 63 | 0a 58 67 65 74 4c 61 6e |,mkid}.c|.XgetLan|
|00001280| 67 75 61 67 65 20 20 20 | 20 65 78 74 65 72 6e 2e |guage | extern.|
|00001290| 68 20 7b 67 65 74 73 63 | 61 6e 2c 69 64 78 2c 6d |h {getsc|an,idx,m|
|000012a0| 6b 69 64 7d 2e 63 0a 58 | 67 65 74 4c 69 73 70 49 |kid}.c.X|getLispI|
|000012b0| 64 20 20 20 20 20 20 67 | 65 74 73 63 61 6e 2e 63 |d g|etscan.c|
|000012c0| 0a 58 67 65 74 50 61 73 | 63 61 6c 49 64 20 20 20 |.XgetPas|calId |
|000012d0| 20 67 65 74 73 63 61 6e | 2e 63 0a 58 67 65 74 52 | getscan|.c.XgetR|
|000012e0| 6f 66 66 49 64 20 20 20 | 20 20 20 67 65 74 73 63 |offId | getsc|
|000012f0| 61 6e 2e 63 0a 58 67 65 | 74 53 43 43 53 20 20 20 |an.c.Xge|tSCCS |
|00001300| 20 20 20 20 20 65 78 74 | 65 72 6e 2e 68 20 6f 70 | ext|ern.h op|
|00001310| 65 6e 73 72 63 2e 63 0a | 58 67 65 74 53 63 61 6e |ensrc.c.|XgetScan|
|00001320| 6e 65 72 20 20 20 20 20 | 65 78 74 65 72 6e 2e 68 |ner |extern.h|
|00001330| 20 7b 67 65 74 73 63 61 | 6e 2c 69 64 78 2c 6d 6b | {getsca|n,idx,mk|
|00001340| 69 64 7d 2e 63 0a 58 67 | 65 74 54 65 58 49 64 20 |id}.c.Xg|etTeXId |
|00001350| 20 20 20 20 20 20 67 65 | 74 73 63 61 6e 2e 63 0a | ge|tscan.c.|
|00001360| 58 67 65 74 54 65 78 74 | 49 64 20 20 20 20 20 20 |XgetText|Id |
|00001370| 67 65 74 73 63 61 6e 2e | 63 0a 58 67 65 74 63 20 |getscan.|c.Xgetc |
|00001380| 20 20 20 20 20 20 20 20 | 20 20 7b 67 65 74 73 30 | | {gets0|
|00001390| 2c 67 65 74 73 46 46 2c | 6c 69 64 2c 73 63 61 6e |,getsFF,|lid,scan|
|000013a0| 2d 61 73 6d 2c 73 63 61 | 6e 2d 63 7d 2e 63 0a 58 |-asm,sca|n-c}.c.X|
|000013b0| 67 65 74 63 68 61 72 20 | 20 20 20 20 20 20 20 6c |getchar | l|
|000013c0| 69 64 2e 63 0a 58 67 65 | 74 65 6e 76 20 20 20 20 |id.c.Xge|tenv |
|000013d0| 20 20 20 20 20 65 78 74 | 65 72 6e 2e 68 20 6c 69 | ext|ern.h li|
|000013e0| 64 2e 63 0a 58 67 65 74 | 73 20 20 20 20 20 20 20 |d.c.Xget|s |
|000013f0| 20 20 20 20 6c 69 64 2e | 63 0a 58 67 65 74 73 46 | lid.|c.XgetsF|
|00001400| 46 20 20 20 20 20 20 20 | 20 20 65 78 74 65 72 6e |F | extern|
|00001410| 2e 68 20 7b 62 69 74 73 | 76 65 63 2c 66 69 64 2c |.h {bits|vec,fid,|
|00001420| 67 65 74 73 46 46 2c 6c | 69 64 2c 6d 6b 69 64 7d |getsFF,l|id,mkid}|
|00001430| 2e 63 0a 58 0a 58 41 73 | 20 79 6f 75 20 63 61 6e |.c.X.XAs| you can|
|00001440| 20 73 65 65 2c 20 77 68 | 65 6e 20 61 20 72 65 67 | see, wh|en a reg|
|00001450| 75 6c 61 72 20 65 78 70 | 72 65 73 73 69 6f 6e 20 |ular exp|ression |
|00001460| 69 73 20 75 73 65 64 2c | 20 69 74 20 69 73 20 70 |is used,| it is p|
|00001470| 6f 73 73 69 62 6c 65 20 | 74 6f 0a 58 67 65 74 20 |ossible |to.Xget |
|00001480| 6d 6f 72 65 20 74 68 61 | 6e 20 6f 6e 65 20 6c 69 |more tha|n one li|
|00001490| 6e 65 20 6f 66 20 6f 75 | 74 70 75 74 2e 20 20 49 |ne of ou|tput. I|
|000014a0| 66 20 79 6f 75 20 77 69 | 73 68 20 6d 75 6c 74 69 |f you wi|sh multi|
|000014b0| 70 6c 65 20 6c 69 6e 65 | 73 20 74 6f 20 62 65 0a |ple line|s to be.|
|000014c0| 58 6d 65 72 67 65 64 20 | 69 6e 74 6f 20 6f 6e 65 |Xmerged |into one|
|000014d0| 2c 20 73 75 70 70 6c 79 | 20 74 68 65 20 60 2d 6d |, supply| the `-m|
|000014e0| 27 20 6f 70 74 69 6f 6e | 3a 0a 58 0a 58 24 20 6c |' option|:.X.X$ l|
|000014f0| 69 64 20 2d 6d 20 5e 67 | 65 74 0a 58 5e 67 65 74 |id -m ^g|et.X^get|
|00001500| 20 20 20 20 20 20 20 20 | 20 20 20 65 78 74 65 72 | | exter|
|00001510| 6e 2e 68 20 7b 62 69 74 | 73 76 65 63 2c 66 69 64 |n.h {bit|svec,fid|
|00001520| 2c 67 65 74 73 30 2c 67 | 65 74 73 46 46 2c 67 65 |,gets0,g|etsFF,ge|
|00001530| 74 73 63 61 6e 2c 69 64 | 78 2c 6c 69 64 2c 6d 6b |tscan,id|x,lid,mk|
|00001540| 69 64 2c 6f 70 65 6e 73 | 72 63 2c 70 61 74 68 73 |id,opens|rc,paths|
|00001550| 2c 73 63 61 6e 2d 61 73 | 6d 2c 73 63 61 6e 2d 63 |,scan-as|m,scan-c|
|00001560| 7d 2e 63 0a 58 0a 58 54 | 68 65 20 71 75 65 72 79 |}.c.X.XT|he query|
|00001570| 20 70 72 6f 67 72 61 6d | 20 73 65 61 72 63 68 65 | program| searche|
|00001580| 73 20 66 6f 72 20 6e 75 | 6d 62 65 72 73 20 6e 75 |s for nu|mbers nu|
|00001590| 6d 65 72 69 63 61 6c 6c | 79 20 72 61 74 68 65 72 |mericall|y rather|
|000015a0| 20 74 68 61 6e 0a 58 74 | 65 78 74 75 61 6c 6c 79 | than.Xt|extually|
|000015b0| 2e 20 20 54 68 65 72 65 | 66 6f 72 65 20 79 6f 75 |. There|fore you|
|000015c0| 20 6d 61 79 20 73 65 61 | 72 63 68 20 66 6f 72 20 | may sea|rch for |
|000015d0| 6d 75 6c 74 69 70 6c 65 | 20 72 65 70 72 65 73 65 |multiple| represe|
|000015e0| 6e 74 61 74 69 6f 6e 73 | 20 6f 66 20 61 0a 58 6e |ntations| of a.Xn|
|000015f0| 75 6d 62 65 72 2e 20 20 | 49 74 20 69 73 20 62 65 |umber. |It is be|
|00001600| 73 74 20 74 6f 20 69 6c | 6c 75 73 74 72 61 74 65 |st to il|lustrate|
|00001610| 20 74 68 69 73 20 77 69 | 74 68 20 65 78 61 6d 70 | this wi|th examp|
|00001620| 6c 65 73 3a 0a 58 0a 58 | 24 20 6c 69 64 20 2d 61 |les:.X.X|$ lid -a|
|00001630| 20 30 78 31 30 0a 58 30 | 32 30 20 20 20 20 20 20 | 0x10.X0|20 |
|00001640| 20 20 20 20 20 20 6e 75 | 6d 74 73 74 2e 63 0a 58 | nu|mtst.c.X|
|00001650| 30 78 30 30 30 31 30 20 | 20 20 20 20 20 20 20 6e |0x00010 | n|
|00001660| 75 6d 74 73 74 2e 63 0a | 58 30 78 30 30 31 30 20 |umtst.c.|X0x0010 |
|00001670| 20 20 20 20 20 20 20 20 | 73 63 61 6e 2d 63 2e 63 | |scan-c.c|
|00001680| 0a 58 30 78 31 30 20 20 | 20 20 20 20 20 20 20 20 |.X0x10 | |
|00001690| 20 7b 69 64 2c 72 61 64 | 69 78 7d 2e 68 20 7b 73 | {id,rad|ix}.h {s|
|000016a0| 63 61 6e 2d 61 73 6d 2c | 73 74 6f 69 7d 2e 63 0a |can-asm,|stoi}.c.|
|000016b0| 58 31 36 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |X16 | |
|000016c0| 6e 75 6d 74 73 74 2e 63 | 0a 58 0a 58 54 68 65 20 |numtst.c|.X.XThe |
|000016d0| 60 2d 61 27 20 61 72 67 | 75 6d 65 6e 74 20 74 65 |`-a' arg|ument te|
|000016e0| 6c 6c 73 20 6c 69 64 28 | 31 29 20 74 6f 20 6c 6f |lls lid(|1) to lo|
|000016f0| 6f 6b 20 66 6f 72 20 30 | 78 31 30 20 69 6e 20 61 |ok for 0|x10 in a|
|00001700| 6c 6c 20 72 61 64 69 78 | 65 73 2e 20 20 28 46 6f |ll radix|es. (Fo|
|00001710| 72 0a 58 6e 75 6d 62 65 | 72 73 20 30 20 74 68 72 |r.Xnumbe|rs 0 thr|
|00001720| 6f 75 67 68 20 37 2c 20 | 6c 69 64 28 31 29 20 6c |ough 7, |lid(1) l|
|00001730| 6f 6f 6b 73 20 66 6f 72 | 20 61 6c 6c 20 72 61 64 |ooks for| all rad|
|00001740| 69 78 65 73 20 62 79 20 | 64 65 66 61 75 6c 74 2e |ixes by |default.|
|00001750| 20 20 46 6f 72 20 6e 75 | 6d 62 65 72 73 0a 58 67 | For nu|mbers.Xg|
|00001760| 72 65 61 74 65 72 20 74 | 68 61 6e 20 37 2c 20 6c |reater t|han 7, l|
|00001770| 69 64 28 31 29 20 6f 6e | 6c 79 20 6c 6f 6f 6b 73 |id(1) on|ly looks|
|00001780| 20 66 6f 72 20 74 68 65 | 20 72 61 64 69 78 20 74 | for the| radix t|
|00001790| 68 61 74 20 74 68 65 20 | 61 72 67 75 6d 65 6e 74 |hat the |argument|
|000017a0| 20 69 73 0a 58 73 75 70 | 70 6c 69 65 64 20 69 6e | is.Xsup|plied in|
|000017b0| 2e 29 20 49 74 20 69 73 | 20 61 6c 73 6f 20 70 6f |.) It is| also po|
|000017c0| 73 73 69 62 6c 65 20 74 | 6f 20 72 65 73 74 72 69 |ssible t|o restri|
|000017d0| 63 74 20 74 68 65 20 73 | 65 61 72 63 68 20 74 6f |ct the s|earch to|
|000017e0| 20 73 65 6c 65 63 74 65 | 64 0a 58 72 61 64 69 78 | selecte|d.Xradix|
|000017f0| 65 73 20 62 79 20 73 75 | 70 70 6c 79 69 6e 67 20 |es by su|pplying |
|00001800| 61 6e 20 61 72 67 75 6d | 65 6e 74 20 63 6f 6e 73 |an argum|ent cons|
|00001810| 69 73 74 69 6e 67 20 6f | 66 20 6f 6e 65 20 6f 72 |isting o|f one or|
|00001820| 20 6d 6f 72 65 20 6f 66 | 20 74 68 65 0a 58 6b 65 | more of| the.Xke|
|00001830| 79 2d 6c 65 74 74 65 72 | 73 20 60 6f 27 2c 20 60 |y-letter|s `o', `|
|00001840| 64 27 2c 20 61 6e 64 20 | 60 78 27 20 66 6f 72 20 |d', and |`x' for |
|00001850| 6f 63 74 61 6c 20 64 65 | 63 69 6d 61 6c 20 61 6e |octal de|cimal an|
|00001860| 64 20 68 65 78 61 64 65 | 63 69 6d 61 6c 0a 58 72 |d hexade|cimal.Xr|
|00001870| 65 73 70 65 63 74 69 76 | 65 6c 79 3a 0a 58 0a 58 |espectiv|ely:.X.X|
|00001880| 24 20 6c 69 64 20 2d 6f | 20 30 78 31 30 0a 58 30 |$ lid -o| 0x10.X0|
|00001890| 32 30 20 20 20 20 20 20 | 20 20 20 20 20 20 6e 75 |20 | nu|
|000018a0| 6d 74 73 74 2e 63 0a 58 | 0a 58 24 20 6c 69 64 20 |mtst.c.X|.X$ lid |
|000018b0| 2d 78 20 31 36 0a 58 30 | 78 30 30 30 31 30 20 20 |-x 16.X0|x00010 |
|000018c0| 20 20 20 20 20 20 6e 75 | 6d 74 73 74 2e 63 0a 58 | nu|mtst.c.X|
|000018d0| 30 78 30 30 31 30 20 20 | 20 20 20 20 20 20 20 73 |0x0010 | s|
|000018e0| 63 61 6e 2d 63 2e 63 0a | 58 30 78 31 30 20 20 20 |can-c.c.|X0x10 |
|000018f0| 20 20 20 20 20 20 20 20 | 7b 69 64 2c 72 61 64 69 | |{id,radi|
|00001900| 78 7d 2e 68 20 20 7b 73 | 63 61 6e 2d 61 73 6d 2c |x}.h {s|can-asm,|
|00001910| 73 74 6f 69 7d 2e 63 0a | 58 0a 58 24 20 6c 69 64 |stoi}.c.|X.X$ lid|
|00001920| 20 2d 64 20 30 32 30 0a | 58 31 36 20 20 20 20 20 | -d 020.|X16 |
|00001930| 20 20 20 20 20 20 20 20 | 6e 75 6d 74 73 74 2e 63 | |numtst.c|
|00001940| 0a 58 0a 58 0a 58 54 68 | 65 20 67 72 65 70 20 69 |.X.X.XTh|e grep i|
|00001950| 6e 74 65 72 66 61 63 65 | 20 62 65 68 61 76 65 73 |nterface| behaves|
|00001960| 20 73 6f 6d 65 77 68 61 | 74 20 6c 69 6b 65 20 74 | somewha|t like t|
|00001970| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 63 6f 6d |he follo|wing com|
|00001980| 6d 61 6e 64 3a 0a 58 0a | 58 24 20 67 72 65 70 20 |mand:.X.|X$ grep |
|00001990| 2d 77 20 2d 6e 20 60 6c | 69 64 20 54 52 55 45 60 |-w -n `l|id TRUE`|
|000019a0| 0a 58 0a 58 48 65 72 65 | 73 20 73 6f 6d 65 20 73 |.X.XHere|s some s|
|000019b0| 61 6d 70 6c 65 20 6f 75 | 74 70 75 74 20 66 6f 72 |ample ou|tput for|
|000019c0| 20 74 68 65 20 65 71 75 | 69 76 61 6c 65 6e 74 20 | the equ|ivalent |
|000019d0| 67 69 64 20 63 6f 6d 6d | 61 6e 64 3a 0a 58 0a 58 |gid comm|and:.X.X|
|000019e0| 24 20 67 69 64 20 54 52 | 55 45 0a 58 62 6f 6f 6c |$ gid TR|UE.Xbool|
|000019f0| 2e 68 3a 35 3a 20 23 64 | 65 66 69 6e 65 09 54 52 |.h:5: #d|efine.TR|
|00001a00| 55 45 09 28 30 3d 3d 30 | 29 0a 58 6c 69 64 2e 63 |UE.(0==0|).Xlid.c|
|00001a10| 3a 31 30 32 3a 20 09 09 | 63 61 73 65 20 27 6d 27 |:102: ..|case 'm'|
|00001a20| 3a 20 66 6f 72 63 65 4d | 65 72 67 65 20 3d 20 54 |: forceM|erge = T|
|00001a30| 52 55 45 3b 20 62 72 65 | 61 6b 3b 0a 58 6c 69 64 |RUE; bre|ak;.Xlid|
|00001a40| 2e 63 3a 31 37 30 3a 20 | 09 09 09 4d 65 72 67 69 |.c:170: |...Mergi|
|00001a50| 6e 67 20 3d 20 54 52 55 | 45 3b 0a 58 6c 69 64 2e |ng = TRU|E;.Xlid.|
|00001a60| 63 3a 32 30 34 3a 20 09 | 09 09 63 72 75 6e 63 68 |c:204: .|..crunch|
|00001a70| 69 6e 67 20 3d 20 54 52 | 55 45 3b 0a 58 6c 69 64 |ing = TR|UE;.Xlid|
|00001a80| 2e 63 3a 35 35 33 3a 20 | 09 09 09 68 69 74 44 69 |.c:553: |...hitDi|
|00001a90| 67 69 74 73 20 3d 20 54 | 52 55 45 3b 0a 58 6c 69 |gits = T|RUE;.Xli|
|00001aa0| 64 2e 63 3a 37 38 37 3a | 20 09 09 09 72 65 74 75 |d.c:787:| ...retu|
|00001ab0| 72 6e 20 54 52 55 45 3b | 0a 58 6d 6b 69 64 2e 63 |rn TRUE;|.Xmkid.c|
|00001ac0| 3a 31 31 37 3a 20 09 09 | 09 56 65 72 62 6f 73 65 |:117: ..|.Verbose|
|00001ad0| 20 3d 20 54 52 55 45 3b | 0a 58 6d 6b 69 64 2e 63 | = TRUE;|.Xmkid.c|
|00001ae0| 3a 31 39 31 3a 20 09 09 | 09 09 09 6b 65 65 70 4c |:191: ..|...keepL|
|00001af0| 61 6e 67 20 3d 20 54 52 | 55 45 3b 0a 58 73 63 61 |ang = TR|UE;.Xsca|
|00001b00| 6e 2d 61 73 6d 2e 63 3a | 37 39 3a 20 73 74 61 74 |n-asm.c:|79: stat|
|00001b10| 69 63 20 62 6f 6f 6c 20 | 65 61 74 55 6e 64 65 72 |ic bool |eatUnder|
|00001b20| 20 3d 20 54 52 55 45 3b | 0a 58 73 63 61 6e 2d 61 | = TRUE;|.Xscan-a|
|00001b30| 73 6d 2e 63 3a 38 30 3a | 20 73 74 61 74 69 63 20 |sm.c:80:| static |
|00001b40| 62 6f 6f 6c 20 70 72 65 | 50 72 6f 63 65 73 73 20 |bool pre|Process |
|00001b50| 3d 20 54 52 55 45 3b 0a | 58 73 63 61 6e 2d 61 73 |= TRUE;.|Xscan-as|
|00001b60| 6d 2e 63 3a 39 36 3a 20 | 09 73 74 61 74 69 63 20 |m.c:96: |.static |
|00001b70| 62 6f 6f 6c 09 6e 65 77 | 4c 69 6e 65 20 3d 20 54 |bool.new|Line = T|
|00001b80| 52 55 45 3b 0a 58 73 63 | 61 6e 2d 61 73 6d 2e 63 |RUE;.Xsc|an-asm.c|
|00001b90| 3a 31 33 30 3a 20 09 09 | 6e 65 77 4c 69 6e 65 20 |:130: ..|newLine |
|00001ba0| 3d 20 54 52 55 45 3b 0a | 58 73 63 61 6e 2d 61 73 |= TRUE;.|Xscan-as|
|00001bb0| 6d 2e 63 3a 31 34 31 3a | 20 09 09 6e 65 77 4c 69 |m.c:141:| ..newLi|
|00001bc0| 6e 65 20 3d 20 54 52 55 | 45 3b 0a 58 73 63 61 6e |ne = TRU|E;.Xscan|
|00001bd0| 2d 61 73 6d 2e 63 3a 31 | 34 35 3a 20 09 09 6e 65 |-asm.c:1|45: ..ne|
|00001be0| 77 4c 69 6e 65 20 3d 20 | 54 52 55 45 3b 0a 58 73 |wLine = |TRUE;.Xs|
|00001bf0| 63 61 6e 2d 61 73 6d 2e | 63 3a 31 35 30 3a 20 09 |can-asm.|c:150: .|
|00001c00| 09 6e 65 77 4c 69 6e 65 | 20 3d 20 54 52 55 45 3b |.newLine| = TRUE;|
|00001c10| 0a 58 73 63 61 6e 2d 61 | 73 6d 2e 63 3a 31 36 35 |.Xscan-a|sm.c:165|
|00001c20| 3a 20 09 09 09 09 6e 65 | 77 4c 69 6e 65 20 3d 20 |: ....ne|wLine = |
|00001c30| 54 52 55 45 3b 0a 58 73 | 63 61 6e 2d 63 2e 63 3a |TRUE;.Xs|can-c.c:|
|00001c40| 38 38 3a 20 73 74 61 74 | 69 63 20 62 6f 6f 6c 20 |88: stat|ic bool |
|00001c50| 65 61 74 55 6e 64 65 72 | 20 3d 20 54 52 55 45 3b |eatUnder| = TRUE;|
|00001c60| 0a 58 73 63 61 6e 2d 63 | 2e 63 3a 31 30 31 3a 20 |.Xscan-c|.c:101: |
|00001c70| 09 73 74 61 74 69 63 20 | 62 6f 6f 6c 09 6e 65 77 |.static |bool.new|
|00001c80| 4c 69 6e 65 20 3d 20 54 | 52 55 45 3b 0a 58 73 63 |Line = T|RUE;.Xsc|
|00001c90| 61 6e 2d 63 2e 63 3a 31 | 33 38 3a 20 09 09 6e 65 |an-c.c:1|38: ..ne|
|00001ca0| 77 4c 69 6e 65 20 3d 20 | 54 52 55 45 3b 0a 58 73 |wLine = |TRUE;.Xs|
|00001cb0| 63 61 6e 2d 63 2e 63 3a | 31 39 39 3a 20 09 09 09 |can-c.c:|199: ...|
|00001cc0| 09 6e 65 77 4c 69 6e 65 | 20 3d 20 54 52 55 45 3b |.newLine| = TRUE;|
|00001cd0| 0a 58 73 63 61 6e 2d 63 | 2e 63 3a 32 30 35 3a 20 |.Xscan-c|.c:205: |
|00001ce0| 09 09 6e 65 77 4c 69 6e | 65 20 3d 20 54 52 55 45 |..newLin|e = TRUE|
|00001cf0| 3b 0a 58 73 63 61 6e 2d | 63 2e 63 3a 32 31 30 3a |;.Xscan-|c.c:210:|
|00001d00| 20 09 09 09 6e 65 77 4c | 69 6e 65 20 3d 20 54 52 | ...newL|ine = TR|
|00001d10| 55 45 3b 0a 58 77 6d 61 | 74 63 68 2e 63 3a 33 37 |UE;.Xwma|tch.c:37|
|00001d20| 3a 20 09 09 09 72 65 74 | 75 72 6e 20 54 52 55 45 |: ...ret|urn TRUE|
|00001d30| 3b 0a 58 0a 58 4e 6f 74 | 69 63 65 20 74 68 61 74 |;.X.XNot|ice that|
|00001d40| 20 65 61 63 68 20 6c 69 | 6e 65 20 69 73 20 72 65 | each li|ne is re|
|00001d50| 70 6f 72 74 65 64 20 69 | 6e 20 74 68 65 20 73 61 |ported i|n the sa|
|00001d60| 6d 65 20 66 6f 72 6d 61 | 74 20 61 73 20 61 0a 58 |me forma|t as a.X|
|00001d70| 43 2d 70 72 65 70 72 6f | 63 65 73 73 6f 72 20 65 |C-prepro|cessor e|
|00001d80| 72 72 6f 72 20 6d 65 73 | 73 61 67 65 2e 20 20 54 |rror mes|sage. T|
|00001d90| 68 69 73 20 66 65 61 74 | 75 72 65 20 61 6c 6c 6f |his feat|ure allo|
|00001da0| 77 73 20 67 69 64 28 31 | 29 20 6c 69 6e 65 73 20 |ws gid(1|) lines |
|00001db0| 74 6f 20 62 65 0a 58 64 | 69 67 65 73 74 65 64 20 |to be.Xd|igested |
|00001dc0| 62 79 20 61 6e 79 20 70 | 72 6f 67 72 61 6d 20 74 |by any p|rogram t|
|00001dd0| 68 61 74 20 70 61 72 73 | 65 73 20 65 72 72 6f 72 |hat pars|es error|
|00001de0| 20 6d 65 73 73 61 67 65 | 73 2c 20 73 75 63 68 20 | message|s, such |
|00001df0| 61 73 20 65 72 72 6f 72 | 28 31 29 0a 58 61 6e 64 |as error|(1).Xand|
|00001e00| 20 67 6e 75 2d 65 6d 61 | 63 73 2e 0a 58 0a 58 49 | gnu-ema|cs..X.XI|
|00001e10| 66 20 79 6f 75 20 77 61 | 6e 74 20 74 6f 20 65 64 |f you wa|nt to ed|
|00001e20| 69 74 20 61 6c 6c 20 66 | 69 6c 65 73 20 74 68 61 |it all f|iles tha|
|00001e30| 74 20 68 61 76 65 20 61 | 6e 20 69 64 65 6e 74 69 |t have a|n identi|
|00001e40| 66 69 65 72 2c 20 79 6f | 75 20 6d 61 79 0a 58 63 |fier, yo|u may.Xc|
|00001e50| 6f 6e 76 65 6e 69 65 6e | 74 6c 79 20 64 6f 20 73 |onvenien|tly do s|
|00001e60| 6f 20 77 69 74 68 20 65 | 69 64 28 31 29 3a 0a 58 |o with e|id(1):.X|
|00001e70| 0a 58 24 20 65 69 64 20 | 54 52 55 45 0a 58 54 52 |.X$ eid |TRUE.XTR|
|00001e80| 55 45 20 20 20 20 20 20 | 20 20 20 20 20 62 6f 6f |UE | boo|
|00001e90| 6c 2e 68 20 7b 6c 69 64 | 2c 6d 6b 69 64 2c 73 63 |l.h {lid|,mkid,sc|
|00001ea0| 61 6e 2d 61 73 6d 2c 73 | 63 61 6e 2d 63 2c 77 6d |an-asm,s|can-c,wm|
|00001eb0| 61 74 63 68 7d 2e 63 0a | 58 45 64 69 74 3f 20 5b |atch}.c.|XEdit? [|
|00001ec0| 79 31 2d 39 5e 53 2f 6e | 71 5d 20 0a 58 0a 58 42 |y1-9^S/n|q] .X.XB|
|00001ed0| 65 66 6f 72 65 20 74 68 | 65 20 65 64 69 74 6f 72 |efore th|e editor|
|00001ee0| 20 69 73 20 69 6e 76 6f | 6b 65 64 2c 20 79 6f 75 | is invo|ked, you|
|00001ef0| 20 61 72 65 20 67 69 76 | 65 6e 20 74 68 65 20 6c | are giv|en the l|
|00001f00| 69 64 28 31 29 20 6f 75 | 74 70 75 74 20 74 6f 20 |id(1) ou|tput to |
|00001f10| 72 65 76 69 65 77 0a 58 | 61 6e 64 20 63 6f 6d 66 |review.X|and comf|
|00001f20| 69 72 6d 2e 20 20 49 66 | 20 79 6f 75 20 77 61 6e |irm. If| you wan|
|00001f30| 74 20 74 6f 20 65 64 69 | 74 20 61 6c 6c 20 66 69 |t to edi|t all fi|
|00001f40| 6c 65 73 20 6c 69 73 74 | 65 64 2c 20 72 65 73 70 |les list|ed, resp|
|00001f50| 6f 6e 64 20 77 69 74 68 | 20 61 0a 58 6e 65 77 6c |ond with| a.Xnewl|
|00001f60| 69 6e 65 20 6f 72 20 77 | 69 74 68 20 60 79 27 2e |ine or w|ith `y'.|
|00001f70| 20 20 49 66 20 79 6f 75 | 20 77 61 6e 74 20 74 6f | If you| want to|
|00001f80| 20 73 6b 69 70 20 73 6f | 6d 65 20 6e 75 6d 62 65 | skip so|me numbe|
|00001f90| 72 20 6f 66 20 66 69 6c | 65 73 20 69 6e 74 6f 20 |r of fil|es into |
|00001fa0| 74 68 65 0a 58 61 72 67 | 75 6d 65 6e 74 20 6c 69 |the.Xarg|ument li|
|00001fb0| 73 74 2c 20 72 65 73 70 | 6f 6e 64 20 77 69 74 68 |st, resp|ond with|
|00001fc0| 20 61 20 73 69 6e 67 6c | 65 20 64 69 67 69 74 20 | a singl|e digit |
|00001fd0| 60 31 27 20 74 68 72 6f | 75 67 68 20 60 39 27 20 |`1' thro|ugh `9' |
|00001fe0| 74 6f 20 73 6b 69 70 20 | 74 68 61 74 0a 58 6d 61 |to skip |that.Xma|
|00001ff0| 6e 79 20 66 69 6c 65 73 | 2c 20 6f 72 20 64 6f 20 |ny files|, or do |
|00002000| 61 20 73 74 72 69 6e 67 | 2d 73 65 61 72 63 68 20 |a string|-search |
|00002010| 74 6f 20 74 68 65 20 66 | 69 72 73 74 20 66 69 6c |to the f|irst fil|
|00002020| 65 20 79 6f 75 20 77 61 | 6e 74 20 77 69 74 68 0a |e you wa|nt with.|
|00002030| 58 60 5e 53 3c 73 74 72 | 69 6e 67 3e 27 20 6f 72 |X`^S<str|ing>' or|
|00002040| 20 60 2f 3c 73 74 72 69 | 6e 67 3e 27 2e 20 20 49 | `/<stri|ng>'. I|
|00002050| 66 20 79 6f 75 20 64 6f | 6e 27 74 20 77 61 6e 74 |f you do|n't want|
|00002060| 20 74 6f 20 65 64 69 74 | 20 61 6e 79 74 68 69 6e | to edit| anythin|
|00002070| 67 2c 20 74 79 70 65 0a | 58 60 6e 27 20 74 6f 20 |g, type.|X`n' to |
|00002080| 67 6f 20 6f 6e 20 74 6f | 20 74 68 65 20 6e 65 78 |go on to| the nex|
|00002090| 74 20 61 72 67 75 6d 65 | 6e 74 20 79 6f 75 20 67 |t argume|nt you g|
|000020a0| 61 76 65 20 74 6f 20 65 | 69 64 28 31 29 20 6f 72 |ave to e|id(1) or|
|000020b0| 20 74 79 70 65 20 60 71 | 27 20 74 6f 0a 58 71 75 | type `q|' to.Xqu|
|000020c0| 69 74 20 61 6c 74 6f 67 | 65 74 68 65 72 2e 0a 58 |it altog|ether..X|
|000020d0| 0a 58 54 68 65 20 62 65 | 68 61 76 69 6f 72 20 6f |.XThe be|havior o|
|000020e0| 66 20 74 68 65 20 65 64 | 69 74 69 6e 67 20 69 6e |f the ed|iting in|
|000020f0| 74 65 72 66 61 63 65 20 | 69 73 20 63 6f 6e 74 72 |terface |is contr|
|00002100| 6f 6c 6c 65 64 20 62 79 | 20 74 68 72 65 65 0a 58 |olled by| three.X|
|00002110| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 20 76 61 72 69 |environm|ent vari|
|00002120| 61 62 6c 65 73 20 63 61 | 6c 6c 65 64 20 45 49 44 |ables ca|lled EID|
|00002130| 41 52 47 2c 20 45 49 44 | 4c 44 45 4c 2c 20 61 6e |ARG, EID|LDEL, an|
|00002140| 64 20 45 49 44 52 44 45 | 4c 2e 20 20 54 68 65 20 |d EIDRDE|L. The |
|00002150| 62 65 73 74 0a 58 77 61 | 79 20 74 6f 20 69 6c 6c |best.Xwa|y to ill|
|00002160| 75 73 74 72 61 74 65 20 | 74 68 65 69 72 20 75 73 |ustrate |their us|
|00002170| 65 20 62 79 20 61 6e 20 | 65 78 61 6d 70 6c 65 2e |e by an |example.|
|00002180| 20 20 48 65 72 65 20 69 | 73 20 68 6f 77 20 74 6f | Here i|s how to|
|00002190| 20 64 65 66 69 6e 65 20 | 74 68 65 6d 0a 58 66 6f | define |them.Xfo|
|000021a0| 72 20 76 69 28 31 29 20 | 28 75 73 69 6e 67 20 2f |r vi(1) |(using /|
|000021b0| 62 69 6e 2f 73 68 20 73 | 79 6e 74 61 78 29 0a 58 |bin/sh s|yntax).X|
|000021c0| 0a 58 45 49 44 41 52 47 | 3d 27 2b 2f 25 73 2f 27 |.XEIDARG|='+/%s/'|
|000021d0| 09 23 20 70 72 69 6e 74 | 66 28 33 29 20 73 74 72 |.# print|f(3) str|
|000021e0| 69 6e 67 20 66 6f 72 20 | 69 6e 69 74 69 61 6c 20 |ing for |initial |
|000021f0| 73 65 61 72 63 68 2d 73 | 74 72 69 6e 67 20 61 72 |search-s|tring ar|
|00002200| 67 75 6d 65 6e 74 0a 58 | 45 49 44 4c 44 45 4c 3d |gument.X|EIDLDEL=|
|00002210| 27 5c 3c 27 09 23 20 6c | 65 66 74 20 77 6f 72 64 |'\<'.# l|eft word|
|00002220| 2d 64 65 6c 69 6d 69 74 | 65 72 0a 58 45 49 44 52 |-delimit|er.XEIDR|
|00002230| 44 45 4c 3d 27 5c 3e 27 | 09 23 20 72 69 67 68 74 |DEL='\>'|.# right|
|00002240| 20 77 6f 72 64 2d 64 65 | 6c 69 6d 69 74 65 72 0a | word-de|limiter.|
|00002250| 58 0a 58 60 45 49 44 5b | 4c 52 5d 44 45 4c 27 20 |X.X`EID[|LR]DEL' |
|00002260| 61 72 65 20 70 6f 73 69 | 74 69 6f 6e 65 64 20 61 |are posi|tioned a|
|00002270| 72 6f 75 6e 64 20 74 68 | 65 20 69 64 65 6e 74 69 |round th|e identi|
|00002280| 66 69 65 72 20 61 73 20 | 6c 65 66 74 20 61 6e 64 |fier as |left and|
|00002290| 20 72 69 67 68 74 0a 58 | 77 6f 72 64 2d 64 65 6c | right.X|word-del|
|000022a0| 69 6d 69 74 65 72 73 20 | 69 66 20 79 6f 75 72 20 |imiters |if your |
|000022b0| 65 64 69 74 6f 72 20 73 | 75 70 70 6f 72 74 73 20 |editor s|upports |
|000022c0| 74 68 61 74 20 6e 6f 74 | 69 6f 6e 2e 20 20 54 68 |that not|ion. Th|
|000022d0| 65 6e 20 74 68 65 20 77 | 68 6f 6c 65 0a 58 6e 61 |en the w|hole.Xna|
|000022e0| 6d 65 2d 73 74 72 69 6e | 67 20 69 73 20 73 70 72 |me-strin|g is spr|
|000022f0| 69 6e 74 66 28 33 29 27 | 65 64 20 69 6e 74 6f 20 |intf(3)'|ed into |
|00002300| 60 45 49 44 41 52 47 27 | 20 74 6f 20 63 6f 6e 73 |`EIDARG'| to cons|
|00002310| 74 72 75 63 74 20 74 68 | 65 20 69 6e 69 74 69 61 |truct th|e initia|
|00002320| 6c 0a 58 73 65 61 72 63 | 68 2d 73 74 72 69 6e 67 |l.Xsearc|h-string|
|00002330| 20 61 72 67 75 6d 65 6e | 74 20 74 6f 20 74 68 65 | argumen|t to the|
|00002340| 20 65 64 69 74 6f 72 2e | 20 20 49 66 20 79 6f 75 | editor.| If you|
|00002350| 72 20 65 64 69 74 6f 72 | 20 63 61 6e 27 74 20 64 |r editor| can't d|
|00002360| 69 67 65 73 74 20 73 75 | 63 68 0a 58 61 6e 20 61 |igest su|ch.Xan a|
|00002370| 72 67 75 6d 65 6e 74 2c | 20 73 69 6d 70 6c 79 20 |rgument,| simply |
|00002380| 6c 65 61 76 65 20 74 68 | 65 73 65 20 76 61 72 69 |leave th|ese vari|
|00002390| 61 62 6c 65 73 20 75 6e | 64 65 66 69 6e 65 64 20 |ables un|defined |
|000023a0| 69 6e 20 74 68 65 0a 58 | 65 6e 76 69 72 6f 6e 6d |in the.X|environm|
|000023b0| 65 6e 74 2e 0a 58 0a 58 | 53 6f 6d 65 20 65 6d 61 |ent..X.X|Some ema|
|000023c0| 63 73 20 75 73 65 72 73 | 20 61 72 65 20 61 70 70 |cs users| are app|
|000023d0| 61 6c 6c 65 64 20 61 74 | 20 74 68 65 20 6e 6f 74 |alled at| the not|
|000023e0| 69 6f 6e 20 6f 66 20 73 | 74 61 72 74 69 6e 67 20 |ion of s|tarting |
|000023f0| 75 70 20 61 20 66 72 65 | 73 68 20 65 64 69 74 6f |up a fre|sh edito|
|00002400| 72 0a 58 73 69 6d 70 6c | 79 20 74 6f 20 66 6f 6c |r.Xsimpl|y to fol|
|00002410| 6c 6f 77 20 61 6e 20 69 | 64 65 6e 74 69 66 69 65 |low an i|dentifie|
|00002420| 72 2e 20 20 46 6f 72 20 | 74 68 6f 73 65 20 77 68 |r. For |those wh|
|00002430| 6f 20 61 72 65 20 66 6f | 72 74 75 6e 61 74 65 20 |o are fo|rtunate |
|00002440| 65 6e 6f 75 67 68 20 74 | 6f 20 68 61 76 65 0a 58 |enough t|o have.X|
|00002450| 61 20 70 72 6f 67 72 61 | 6d 6d 61 62 6c 65 20 65 |a progra|mmable e|
|00002460| 6d 61 63 73 20 73 75 63 | 68 20 61 73 20 67 6e 75 |macs suc|h as gnu|
|00002470| 2d 65 6d 61 63 73 2c 20 | 69 74 20 69 73 20 66 61 |-emacs, |it is fa|
|00002480| 69 72 6c 79 20 73 69 6d | 70 6c 65 20 74 6f 20 64 |irly sim|ple to d|
|00002490| 65 76 69 73 65 0a 58 61 | 20 63 6f 6d 6d 61 6e 64 |evise.Xa| command|
|000024a0| 20 74 68 61 74 20 69 6e | 76 6f 6b 65 73 20 67 69 | that in|vokes gi|
|000024b0| 64 28 31 29 20 61 6e 64 | 20 64 69 67 65 73 74 73 |d(1) and| digests|
|000024c0| 20 69 74 73 20 6f 75 74 | 70 75 74 20 61 73 20 74 | its out|put as t|
|000024d0| 68 6f 75 67 68 20 69 74 | 20 77 65 72 65 0a 58 2f |hough it| were.X/|
|000024e0| 6c 69 62 2f 63 70 70 20 | 65 72 72 6f 72 20 73 74 |lib/cpp |error st|
|000024f0| 72 69 6e 67 73 20 74 6f | 20 62 65 20 65 78 61 6d |rings to| be exam|
|00002500| 69 6e 65 64 2e 20 20 28 | 53 6f 72 72 79 2c 20 6e |ined. (|Sorry, n|
|00002510| 6f 20 73 75 63 68 20 63 | 6f 64 65 20 69 73 20 70 |o such c|ode is p|
|00002520| 72 6f 76 69 64 65 64 0a | 58 61 74 20 74 68 69 73 |rovided.|Xat this|
|00002530| 20 70 6f 73 74 69 6e 67 | 2e 2e 2e 29 0a 58 0a 58 | posting|...).X.X|
|00002540| 41 6e 6f 74 68 65 72 20 | 74 79 70 65 20 6f 66 20 |Another |type of |
|00002550| 71 75 65 72 79 20 69 73 | 20 74 6f 20 66 69 6e 64 |query is| to find|
|00002560| 20 61 6c 6c 20 69 64 65 | 6e 74 69 66 69 65 72 73 | all ide|ntifiers|
|00002570| 20 74 68 61 74 20 61 72 | 65 20 6e 6f 6e 2d 75 6e | that ar|e non-un|
|00002580| 69 71 75 65 0a 58 77 69 | 74 68 69 6e 20 73 6f 6d |ique.Xwi|thin som|
|00002590| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 63 68 61 72 |e number| of char|
|000025a0| 61 63 74 65 72 73 2e 20 | 20 54 68 69 73 20 69 73 |acters. | This is|
|000025b0| 20 75 73 65 66 75 6c 20 | 66 6f 72 20 66 69 6e 64 | useful |for find|
|000025c0| 69 6e 67 20 70 6f 74 65 | 6e 74 69 61 6c 0a 58 70 |ing pote|ntial.Xp|
|000025d0| 6f 72 74 61 62 69 6c 69 | 74 79 20 70 72 6f 62 6c |ortabili|ty probl|
|000025e0| 65 6d 73 20 77 68 65 6e | 20 6d 6f 76 69 6e 67 20 |ems when| moving |
|000025f0| 74 6f 20 61 20 73 79 73 | 74 65 6d 20 77 68 6f 73 |to a sys|tem whos|
|00002600| 65 20 63 6f 6d 70 69 6c | 65 72 20 6f 72 20 6c 69 |e compil|er or li|
|00002610| 6e 6b 65 72 0a 58 6c 69 | 6d 69 74 73 20 74 68 65 |nker.Xli|mits the|
|00002620| 20 6e 75 6d 62 65 72 20 | 6f 66 20 73 69 67 6e 69 | number |of signi|
|00002630| 66 69 63 61 6e 74 20 63 | 68 61 72 61 63 74 65 72 |ficant c|haracter|
|00002640| 73 20 69 6e 20 61 20 6e | 61 6d 65 2e 20 20 54 68 |s in a n|ame. Th|
|00002650| 65 20 60 2d 75 3c 6e 3e | 27 0a 58 61 72 67 75 6d |e `-u<n>|'.Xargum|
|00002660| 65 6e 74 20 64 6f 65 73 | 20 74 68 65 20 74 72 69 |ent does| the tri|
|00002670| 63 6b 2e 20 20 48 65 72 | 65 27 73 20 61 20 6c 69 |ck. Her|e's a li|
|00002680| 73 74 20 6f 66 20 69 64 | 65 6e 74 69 66 69 65 72 |st of id|entifier|
|00002690| 73 20 74 68 61 74 20 6d | 61 79 20 79 69 65 6c 64 |s that m|ay yield|
|000026a0| 0a 58 6d 75 6c 74 69 70 | 6c 79 2d 64 65 66 69 6e |.Xmultip|ly-defin|
|000026b0| 65 64 20 65 72 72 6f 72 | 73 20 69 6e 20 61 20 73 |ed error|s in a s|
|000026c0| 79 6d 62 6f 6c 20 74 61 | 62 6c 65 20 74 68 61 74 |ymbol ta|ble that|
|000026d0| 20 6f 6e 6c 79 20 6b 6e | 6f 77 73 20 61 62 6f 75 | only kn|ows abou|
|000026e0| 74 20 74 68 65 0a 58 66 | 69 72 73 74 20 37 20 63 |t the.Xf|irst 7 c|
|000026f0| 68 61 72 61 63 74 65 72 | 73 3a 0a 58 0a 58 24 20 |haracter|s:.X.X$ |
|00002700| 6c 69 64 20 2d 75 37 0a | 58 53 43 41 4e 5f 54 45 |lid -u7.|XSCAN_TE|
|00002710| 58 20 20 20 20 20 20 20 | 67 65 74 73 63 61 6e 2e |X |getscan.|
|00002720| 63 0a 58 53 43 41 4e 5f | 54 45 58 54 20 20 20 20 |c.XSCAN_|TEXT |
|00002730| 20 20 67 65 74 73 63 61 | 6e 2e 63 0a 58 69 64 68 | getsca|n.c.Xidh|
|00002740| 5f 61 72 67 63 20 20 20 | 20 20 20 20 69 64 2e 68 |_argc | id.h|
|00002750| 20 7b 69 6e 69 74 2c 6d | 6b 69 64 7d 2e 63 0a 58 | {init,m|kid}.c.X|
|00002760| 69 64 68 5f 61 72 67 6f | 20 20 20 20 20 20 20 69 |idh_argo| i|
|00002770| 64 2e 68 20 7b 69 6e 69 | 74 2c 6d 6b 69 64 7d 2e |d.h {ini|t,mkid}.|
|00002780| 63 0a 58 69 64 68 5f 6e | 61 6d 63 20 20 20 20 20 |c.Xidh_n|amc |
|00002790| 20 20 69 64 2e 68 20 7b | 66 69 64 2c 6d 6b 69 64 | id.h {|fid,mkid|
|000027a0| 7d 2e 63 0a 58 69 64 68 | 5f 6e 61 6d 6f 20 20 20 |}.c.Xidh|_namo |
|000027b0| 20 20 20 20 69 64 2e 68 | 20 7b 66 69 64 2c 69 6e | id.h| {fid,in|
|000027c0| 69 74 2c 6c 69 64 2c 6d | 6b 69 64 7d 2e 63 0a 58 |it,lid,m|kid}.c.X|
|000027d0| 6f 6c 64 48 61 73 68 53 | 69 7a 65 20 20 20 20 6d |oldHashS|ize m|
|000027e0| 6b 69 64 2e 63 0a 58 6f | 6c 64 48 61 73 68 54 61 |kid.c.Xo|ldHashTa|
|000027f0| 62 6c 65 20 20 20 6d 6b | 69 64 2e 63 0a 58 0a 58 |ble mk|id.c.X.X|
|00002800| 42 65 74 74 65 72 20 79 | 65 74 2c 20 69 66 20 79 |Better y|et, if y|
|00002810| 6f 75 20 77 61 6e 74 20 | 74 6f 20 65 64 69 74 20 |ou want |to edit |
|00002820| 74 68 65 73 65 2c 20 74 | 72 79 0a 58 0a 58 24 20 |these, t|ry.X.X$ |
|00002830| 65 69 64 20 2d 75 37 0a | 58 5e 53 43 41 4e 5f 54 |eid -u7.|X^SCAN_T|
|00002840| 45 20 20 20 20 20 20 20 | 67 65 74 73 63 61 6e 2e |E |getscan.|
|00002850| 63 0a 58 45 64 69 74 3f | 20 5b 79 31 2d 39 5e 53 |c.XEdit?| [y1-9^S|
|00002860| 2f 6e 71 5d 20 6e 0a 58 | 5e 69 64 68 5f 61 72 67 |/nq] n.X|^idh_arg|
|00002870| 20 20 20 20 20 20 20 67 | 65 74 73 63 61 6e 2e 63 | g|etscan.c|
|00002880| 20 69 64 2e 68 20 7b 69 | 6e 69 74 2c 6d 6b 69 64 | id.h {i|nit,mkid|
|00002890| 7d 2e 63 0a 58 45 64 69 | 74 3f 20 5b 79 31 2d 39 |}.c.XEdi|t? [y1-9|
|000028a0| 5e 53 2f 6e 71 5d 20 6e | 0a 58 5e 69 64 68 5f 6e |^S/nq] n|.X^idh_n|
|000028b0| 61 6d 20 20 20 20 20 20 | 20 7b 66 69 64 2c 67 65 |am | {fid,ge|
|000028c0| 74 73 63 61 6e 7d 2e 63 | 20 69 64 2e 68 20 7b 69 |tscan}.c| id.h {i|
|000028d0| 6e 69 74 2c 6c 69 64 2c | 6d 6b 69 64 7d 2e 63 0a |nit,lid,|mkid}.c.|
|000028e0| 58 45 64 69 74 3f 20 5b | 79 31 2d 39 5e 53 2f 6e |XEdit? [|y1-9^S/n|
|000028f0| 71 5d 20 6e 0a 58 5e 6f | 6c 64 48 61 73 68 20 20 |q] n.X^o|ldHash |
|00002900| 20 20 20 20 20 7b 66 69 | 64 2c 67 65 74 73 63 61 | {fi|d,getsca|
|00002910| 6e 7d 2e 63 20 69 64 2e | 68 20 7b 69 6e 69 74 2c |n}.c id.|h {init,|
|00002920| 6c 69 64 2c 6d 6b 69 64 | 7d 2e 63 0a 58 45 64 69 |lid,mkid|}.c.XEdi|
|00002930| 74 3f 20 5b 79 31 2d 39 | 5e 53 2f 6e 71 5d 20 6e |t? [y1-9|^S/nq] n|
|00002940| 0a 58 0a 58 0a 58 41 6e | 20 61 64 64 69 74 69 6f |.X.X.XAn| additio|
|00002950| 6e 61 6c 20 66 65 61 74 | 75 72 65 20 6f 66 20 6c |nal feat|ure of l|
|00002960| 69 64 28 31 29 20 69 73 | 20 74 68 61 74 20 70 61 |id(1) is| that pa|
|00002970| 74 68 6e 61 6d 65 73 20 | 61 72 65 20 61 75 74 6f |thnames |are auto|
|00002980| 6d 61 74 69 63 61 6c 6c | 79 0a 58 61 64 6a 75 73 |maticall|y.Xadjus|
|00002990| 74 65 64 20 66 6f 72 20 | 74 68 65 20 63 75 72 72 |ted for |the curr|
|000029a0| 65 6e 74 20 77 6f 72 6b | 69 6e 67 20 64 69 72 65 |ent work|ing dire|
|000029b0| 63 74 6f 72 79 2e 20 20 | 4c 61 72 67 65 20 70 72 |ctory. |Large pr|
|000029c0| 6f 67 72 61 6d 73 20 73 | 75 63 68 20 61 73 20 74 |ograms s|uch as t|
|000029d0| 68 65 0a 58 55 4e 49 58 | 20 6b 65 72 6e 65 6c 20 |he.XUNIX| kernel |
|000029e0| 61 72 65 20 6f 66 74 65 | 6e 20 70 61 72 74 69 74 |are ofte|n partit|
|000029f0| 69 6f 6e 65 64 20 69 6e | 74 6f 20 73 75 62 73 79 |ioned in|to subsy|
|00002a00| 73 74 65 6d 73 20 77 68 | 6f 73 65 20 73 6f 75 72 |stems wh|ose sour|
|00002a10| 63 65 73 20 6c 69 76 65 | 20 69 6e 0a 58 64 69 66 |ces live| in.Xdif|
|00002a20| 66 65 72 65 6e 74 20 64 | 69 72 65 63 74 6f 72 69 |ferent d|irectori|
|00002a30| 65 73 2e 20 20 57 68 61 | 74 20 66 6f 6c 6c 6f 77 |es. Wha|t follow|
|00002a40| 73 20 61 72 65 20 73 65 | 76 65 72 61 6c 20 65 78 |s are se|veral ex|
|00002a50| 61 6d 70 6c 65 73 20 6f | 66 20 74 68 65 20 73 61 |amples o|f the sa|
|00002a60| 6d 65 0a 58 73 65 61 72 | 63 68 20 63 6f 6e 64 75 |me.Xsear|ch condu|
|00002a70| 63 74 65 64 20 66 72 6f | 6d 20 64 69 66 66 65 72 |cted fro|m differ|
|00002a80| 65 6e 74 20 70 6f 69 6e | 74 73 20 69 6e 20 74 68 |ent poin|ts in th|
|00002a90| 65 20 55 4e 49 58 20 6b | 65 72 6e 65 6c 20 73 6f |e UNIX k|ernel so|
|00002aa0| 75 72 63 65 0a 58 68 69 | 65 72 61 72 63 68 79 3a |urce.Xhi|erarchy:|
|00002ab0| 0a 58 0a 58 24 20 63 64 | 20 2f 73 72 63 2f 75 74 |.X.X$ cd| /src/ut|
|00002ac0| 73 2f 6d 36 38 6b 0a 58 | 24 20 6c 69 64 20 62 64 |s/m68k.X|$ lid bd|
|00002ad0| 65 76 73 77 0a 58 62 64 | 65 76 73 77 20 20 20 20 |evsw.Xbd|evsw |
|00002ae0| 20 20 20 20 20 73 79 73 | 2f 63 6f 6e 66 2e 68 20 | sys|/conf.h |
|00002af0| 20 63 66 2f 63 6f 6e 66 | 2e 63 20 20 69 6f 2f 62 | cf/conf|.c io/b|
|00002b00| 69 6f 2e 63 20 20 6f 73 | 2f 7b 66 69 6f 2c 6d 61 |io.c os|/{fio,ma|
|00002b10| 69 6e 2c 70 72 66 2c 73 | 79 73 33 7d 2e 63 0a 58 |in,prf,s|ys3}.c.X|
|00002b20| 0a 58 24 20 63 64 20 69 | 6f 0a 58 24 20 6c 69 64 |.X$ cd i|o.X$ lid|
|00002b30| 20 62 64 65 76 73 77 0a | 58 62 64 65 76 73 77 20 | bdevsw.|Xbdevsw |
|00002b40| 20 20 20 20 20 20 20 20 | 2e 2e 2f 73 79 73 2f 63 | |../sys/c|
|00002b50| 6f 6e 66 2e 68 20 20 2e | 2e 2f 63 66 2f 63 6f 6e |onf.h .|./cf/con|
|00002b60| 66 2e 63 20 20 62 69 6f | 2e 63 20 20 2e 2e 2f 6f |f.c bio|.c ../o|
|00002b70| 73 2f 7b 66 69 6f 2c 6d | 61 69 6e 2c 70 72 66 2c |s/{fio,m|ain,prf,|
|00002b80| 73 79 73 33 7d 2e 63 0a | 58 0a 58 24 20 63 64 20 |sys3}.c.|X.X$ cd |
|00002b90| 2e 2e 2f 6f 73 0a 58 62 | 64 65 76 73 77 20 20 20 |../os.Xb|devsw |
|00002ba0| 20 20 20 20 20 20 2e 2e | 2f 73 79 73 2f 63 6f 6e | ..|/sys/con|
|00002bb0| 66 2e 68 20 20 2e 2e 2f | 63 66 2f 63 6f 6e 66 2e |f.h ../|cf/conf.|
|00002bc0| 63 20 20 2e 2e 2f 69 6f | 2f 62 69 6f 2e 63 20 20 |c ../io|/bio.c |
|00002bd0| 7b 66 69 6f 2c 6d 61 69 | 6e 2c 70 72 66 2c 73 79 |{fio,mai|n,prf,sy|
|00002be0| 73 33 7d 2e 63 0a 58 0a | 58 54 68 65 20 64 61 74 |s3}.c.X.|XThe dat|
|00002bf0| 61 62 61 73 65 20 69 73 | 20 62 75 69 6c 74 20 77 |abase is| built w|
|00002c00| 69 74 68 20 6d 6b 69 64 | 28 31 29 2e 20 20 54 68 |ith mkid|(1). Th|
|00002c10| 65 20 75 73 65 72 20 73 | 75 70 70 6c 69 65 73 20 |e user s|upplies |
|00002c20| 70 61 74 68 6e 61 6d 65 | 73 0a 58 65 69 74 68 65 |pathname|s.Xeithe|
|00002c30| 72 20 6f 6e 20 74 68 65 | 20 63 6f 6d 6d 61 6e 64 |r on the| command|
|00002c40| 20 6c 69 6e 65 20 6f 72 | 20 6f 6e 20 73 74 64 69 | line or| on stdi|
|00002c50| 6e 2e 20 20 48 65 72 65 | 27 73 20 74 68 65 20 6f |n. Here|'s the o|
|00002c60| 75 74 70 75 74 20 6f 66 | 20 74 68 65 0a 58 60 76 |utput of| the.X`v|
|00002c70| 65 72 62 6f 73 65 27 20 | 6f 70 74 69 6f 6e 20 74 |erbose' |option t|
|00002c80| 6f 20 6d 6b 69 64 28 31 | 29 3a 0a 58 0a 58 24 20 |o mkid(1|):.X.X$ |
|00002c90| 6d 6b 69 64 20 2d 76 20 | 2a 2e 68 20 2a 2e 63 0a |mkid -v |*.h *.c.|
|00002ca0| 58 63 3a 20 62 69 74 6f | 70 73 2e 68 0a 58 63 3a |Xc: bito|ps.h.Xc:|
|00002cb0| 20 62 6f 6f 6c 2e 68 0a | 58 63 3a 20 65 78 74 65 | bool.h.|Xc: exte|
|00002cc0| 72 6e 2e 68 0a 58 63 3a | 20 69 64 2e 68 0a 58 63 |rn.h.Xc:| id.h.Xc|
|00002cd0| 3a 20 70 61 74 63 68 6c | 65 76 65 6c 2e 68 0a 58 |: patchl|evel.h.X|
|00002ce0| 63 3a 20 72 61 64 69 78 | 2e 68 0a 58 63 3a 20 73 |c: radix|.h.Xc: s|
|00002cf0| 74 72 69 6e 67 2e 68 0a | 58 63 3a 20 62 61 73 65 |tring.h.|Xc: base|
|00002d00| 6e 61 6d 65 2e 63 0a 58 | 63 3a 20 62 69 74 63 6f |name.c.X|c: bitco|
|00002d10| 75 6e 74 2e 63 0a 58 63 | 3a 20 62 69 74 6f 70 73 |unt.c.Xc|: bitops|
|00002d20| 2e 63 0a 58 63 3a 20 62 | 69 74 73 76 65 63 2e 63 |.c.Xc: b|itsvec.c|
|00002d30| 0a 58 63 3a 20 62 73 65 | 61 72 63 68 2e 63 0a 58 |.Xc: bse|arch.c.X|
|00002d40| 63 3a 20 62 7a 65 72 6f | 2e 63 0a 58 63 3a 20 64 |c: bzero|.c.Xc: d|
|00002d50| 6f 63 75 6d 65 6e 74 2e | 63 0a 58 63 3a 20 66 69 |ocument.|c.Xc: fi|
|00002d60| 64 2e 63 0a 58 63 3a 20 | 67 65 74 73 30 2e 63 0a |d.c.Xc: |gets0.c.|
|00002d70| 58 63 3a 20 67 65 74 73 | 46 46 2e 63 0a 58 63 3a |Xc: gets|FF.c.Xc:|
|00002d80| 20 67 65 74 73 63 61 6e | 2e 63 0a 58 63 3a 20 68 | getscan|.c.Xc: h|
|00002d90| 61 73 68 2e 63 0a 58 63 | 3a 20 69 64 78 2e 63 0a |ash.c.Xc|: idx.c.|
|00002da0| 58 63 3a 20 69 6e 69 74 | 2e 63 0a 58 63 3a 20 6c |Xc: init|.c.Xc: l|
|00002db0| 69 64 2e 63 0a 58 63 3a | 20 6d 6b 69 64 2e 63 0a |id.c.Xc:| mkid.c.|
|00002dc0| 58 63 3a 20 6e 75 6d 74 | 73 74 2e 63 0a 58 63 3a |Xc: numt|st.c.Xc:|
|00002dd0| 20 6f 70 65 6e 73 72 63 | 2e 63 0a 58 63 3a 20 70 | opensrc|.c.Xc: p|
|00002de0| 61 74 68 73 2e 63 0a 58 | 63 3a 20 73 63 61 6e 2d |aths.c.X|c: scan-|
|00002df0| 61 73 6d 2e 63 0a 58 63 | 3a 20 73 63 61 6e 2d 63 |asm.c.Xc|: scan-c|
|00002e00| 2e 63 0a 58 63 3a 20 73 | 74 6f 69 2e 63 0a 58 63 |.c.Xc: s|toi.c.Xc|
|00002e10| 3a 20 74 74 79 2e 63 0a | 58 63 3a 20 75 65 72 72 |: tty.c.|Xc: uerr|
|00002e20| 6f 72 2e 63 0a 58 63 3a | 20 77 6d 61 74 63 68 2e |or.c.Xc:| wmatch.|
|00002e30| 63 0a 58 43 6f 6d 70 72 | 65 73 73 69 6e 67 20 48 |c.XCompr|essing H|
|00002e40| 61 73 68 20 54 61 62 6c | 65 2e 2e 2e 0a 58 53 6f |ash Tabl|e....XSo|
|00002e50| 72 74 69 6e 67 20 48 61 | 73 68 20 54 61 62 6c 65 |rting Ha|sh Table|
|00002e60| 2e 2e 2e 0a 58 57 72 69 | 74 69 6e 67 20 60 49 44 |....XWri|ting `ID|
|00002e70| 27 2e 2e 2e 0a 58 4e 61 | 6d 65 73 3a 20 35 39 33 |'....XNa|mes: 593|
|00002e80| 2c 20 4e 75 6d 62 65 72 | 73 3a 20 36 34 2c 20 53 |, Number|s: 64, S|
|00002e90| 74 72 69 6e 67 73 3a 20 | 34 33 2c 20 53 6f 6c 6f |trings: |43, Solo|
|00002ea0| 3a 20 31 31 39 2c 20 54 | 6f 74 61 6c 3a 20 36 39 |: 119, T|otal: 69|
|00002eb0| 37 0a 58 4f 63 63 75 72 | 72 61 6e 63 65 73 3a 20 |7.XOccur|rances: |
|00002ec0| 31 31 2e 36 37 2c 20 4c | 6f 61 64 3a 20 30 2e 31 |11.67, L|oad: 0.1|
|00002ed0| 37 2c 20 50 72 6f 62 65 | 73 3a 20 31 2e 30 37 0a |7, Probe|s: 1.07.|
|00002ee0| 58 0a 58 4d 6b 69 64 28 | 31 29 20 65 63 68 6f 65 |X.XMkid(|1) echoe|
|00002ef0| 73 20 74 68 65 20 6e 61 | 6d 65 20 6f 66 20 65 61 |s the na|me of ea|
|00002f00| 63 68 20 66 69 6c 65 20 | 61 73 20 69 74 20 69 73 |ch file |as it is|
|00002f10| 20 73 63 61 6e 6e 65 64 | 2c 20 70 72 65 66 69 78 | scanned|, prefix|
|00002f20| 65 64 20 62 79 20 74 68 | 65 0a 58 6e 61 6d 65 20 |ed by th|e.Xname |
|00002f30| 6f 66 20 74 68 65 20 6c | 61 6e 67 75 61 67 65 20 |of the l|anguage |
|00002f40| 69 74 20 74 68 69 6e 6b | 73 20 74 68 65 20 66 69 |it think|s the fi|
|00002f50| 6c 65 20 69 73 20 77 72 | 69 74 74 65 6e 20 69 6e |le is wr|itten in|
|00002f60| 2e 20 20 4d 6b 69 64 28 | 31 29 20 72 65 70 6f 72 |. Mkid(|1) repor|
|00002f70| 74 73 0a 58 68 6f 77 20 | 6d 61 6e 79 20 75 6e 69 |ts.Xhow |many uni|
|00002f80| 71 75 65 20 6e 61 6d 65 | 73 20 61 6e 64 20 6e 75 |que name|s and nu|
|00002f90| 6d 62 65 72 73 20 77 65 | 72 65 20 66 6f 75 6e 64 |mbers we|re found|
|00002fa0| 2c 20 68 6f 77 20 6d 61 | 6e 79 20 6e 61 6d 65 73 |, how ma|ny names|
|00002fb0| 20 6f 63 63 75 72 72 65 | 64 0a 58 6f 6e 6c 79 20 | occurre|d.Xonly |
|00002fc0| 6f 6e 63 65 2c 20 61 6e | 64 20 74 68 65 20 74 6f |once, an|d the to|
|00002fd0| 74 61 6c 20 66 6f 72 20 | 6e 61 6d 65 73 20 61 6e |tal for |names an|
|00002fe0| 64 20 6e 75 6d 62 65 72 | 73 2e 20 20 49 74 20 61 |d number|s. It a|
|00002ff0| 6c 73 6f 20 72 65 70 6f | 72 74 73 20 74 68 65 0a |lso repo|rts the.|
|00003000| 58 61 76 65 72 61 67 65 | 20 6e 75 6d 62 65 72 20 |Xaverage| number |
|00003010| 6f 66 20 6f 63 63 75 72 | 72 61 6e 63 65 73 20 66 |of occur|rances f|
|00003020| 6f 72 20 61 6c 6c 20 6e | 61 6d 65 73 20 61 6e 64 |or all n|ames and|
|00003030| 20 6e 75 6d 62 65 72 73 | 2e 20 20 4e 65 78 74 2c | numbers|. Next,|
|00003040| 20 74 68 65 72 65 0a 58 | 61 72 65 20 73 6f 6d 65 | there.X|are some|
|00003050| 20 68 61 73 68 2d 74 61 | 62 6c 65 20 73 74 61 74 | hash-ta|ble stat|
|00003060| 69 73 74 69 63 73 20 6f | 6e 20 74 68 65 20 6c 6f |istics o|n the lo|
|00003070| 61 64 2d 66 61 63 74 6f | 72 20 61 6e 64 20 74 68 |ad-facto|r and th|
|00003080| 65 20 61 76 65 72 61 67 | 65 0a 58 6e 75 6d 62 65 |e averag|e.Xnumbe|
|00003090| 72 20 6f 66 20 6f 70 65 | 6e 2d 61 64 64 72 65 73 |r of ope|n-addres|
|000030a0| 73 65 64 20 70 72 6f 62 | 65 73 2e 0a 58 0a 58 4d |sed prob|es..X.XM|
|000030b0| 6b 69 64 28 31 29 20 63 | 61 6e 20 74 61 6b 65 20 |kid(1) c|an take |
|000030c0| 61 72 67 75 6d 65 6e 74 | 73 20 66 72 6f 6d 20 74 |argument|s from t|
|000030d0| 68 65 20 63 6f 6d 6d 61 | 6e 64 20 6c 69 6e 65 2c |he comma|nd line,|
|000030e0| 20 66 72 6f 6d 20 73 74 | 64 69 6e 2c 20 6f 72 20 | from st|din, or |
|000030f0| 66 72 6f 6d 0a 58 61 20 | 66 69 6c 65 2e 20 20 41 |from.Xa |file. A|
|00003100| 20 66 69 6c 65 20 66 75 | 6c 6c 20 6f 66 20 66 69 | file fu|ll of fi|
|00003110| 6c 65 6e 61 6d 65 73 20 | 6d 61 79 20 61 6c 73 6f |lenames |may also|
|00003120| 20 63 6f 6e 74 61 69 6e | 20 6d 6b 69 64 20 6f 70 | contain| mkid op|
|00003130| 74 69 6f 6e 73 20 6f 66 | 20 74 68 65 20 66 6f 72 |tions of| the for|
|00003140| 6d 0a 58 2d 3c 6f 70 74 | 69 6f 6e 3e 2e 20 20 46 |m.X-<opt|ion>. F|
|00003150| 69 6c 65 6e 61 6d 65 73 | 20 61 6e 64 20 6f 70 74 |ilenames| and opt|
|00003160| 69 6f 6e 73 20 61 70 70 | 65 61 72 20 69 6e 20 74 |ions app|ear in t|
|00003170| 68 65 20 66 69 6c 65 20 | 6f 6e 65 2d 70 65 72 2d |he file |one-per-|
|00003180| 6c 69 6e 65 2e 20 20 54 | 79 70 69 63 61 6c 0a 58 |line. T|ypical.X|
|00003190| 75 73 61 67 65 20 66 6f | 72 20 74 68 69 73 20 66 |usage fo|r this f|
|000031a0| 65 61 74 75 72 65 20 69 | 73 20 61 73 20 66 6f 6c |eature i|s as fol|
|000031b0| 6c 6f 77 73 3a 0a 58 0a | 58 24 20 66 69 6e 64 20 |lows:.X.|X$ find |
|000031c0| 2e 20 2d 6e 61 6d 65 20 | 27 2a 2e 5b 63 68 79 73 |. -name |'*.[chys|
|000031d0| 5d 27 20 2d 70 72 69 6e | 74 20 3e 49 44 46 49 4c |]' -prin|t >IDFIL|
|000031e0| 45 53 0a 58 24 20 6d 6b | 69 64 20 2d 61 49 44 46 |ES.X$ mk|id -aIDF|
|000031f0| 49 4c 45 53 0a 58 0a 58 | 2d 2d 20 6f 72 20 2d 2d |ILES.X.X|-- or --|
|00003200| 0a 58 0a 58 24 20 66 69 | 6e 64 20 2e 20 2d 6e 61 |.X.X$ fi|nd . -na|
|00003210| 6d 65 20 27 2a 2e 5b 63 | 68 79 73 5d 27 20 2d 70 |me '*.[c|hys]' -p|
|00003220| 72 69 6e 74 20 7c 6d 6b | 69 64 20 2d 0a 58 0a 58 |rint |mk|id -.X.X|
|00003230| 4d 6b 69 64 28 31 29 20 | 73 74 61 73 68 65 73 20 |Mkid(1) |stashes |
|00003240| 74 68 65 20 66 69 6c 65 | 6e 61 6d 65 73 20 61 6e |the file|names an|
|00003250| 64 20 72 65 6c 65 76 61 | 6e 74 20 61 72 67 75 6d |d releva|nt argum|
|00003260| 65 6e 74 73 20 69 6e 20 | 74 68 65 20 64 61 74 61 |ents in |the data|
|00003270| 62 61 73 65 0a 58 69 74 | 73 65 6c 66 2e 20 20 49 |base.Xit|self. I|
|00003280| 74 20 75 73 65 73 20 74 | 68 65 73 65 20 74 6f 20 |t uses t|hese to |
|00003290| 73 75 70 70 6f 72 74 20 | 74 68 65 20 60 60 69 6e |support |the ``in|
|000032a0| 63 72 65 6d 65 6e 74 61 | 6c 2d 75 70 64 61 74 65 |crementa|l-update|
|000032b0| 27 20 6f 70 74 69 6f 6e | 2e 0a 58 49 66 20 69 6e |' option|..XIf in|
|000032c0| 76 6f 6b 65 64 20 77 69 | 74 68 20 60 2d 75 27 2c |voked wi|th `-u',|
|000032d0| 20 6d 6b 69 64 28 31 29 | 20 63 68 65 63 6b 73 20 | mkid(1)| checks |
|000032e0| 74 68 65 20 6d 6f 64 69 | 66 69 63 61 74 69 6f 6e |the modi|fication|
|000032f0| 20 74 69 6d 65 73 20 6f | 66 20 61 6c 6c 0a 58 63 | times o|f all.Xc|
|00003300| 6f 6e 73 74 69 74 75 65 | 6e 74 20 66 69 6c 65 73 |onstitue|nt files|
|00003310| 2c 20 61 6e 64 20 6f 6e | 6c 79 20 72 65 2d 73 63 |, and on|ly re-sc|
|00003320| 61 6e 73 20 74 68 6f 73 | 65 20 74 68 61 74 20 61 |ans thos|e that a|
|00003330| 72 65 20 6e 65 77 65 72 | 20 74 68 61 6e 20 74 68 |re newer| than th|
|00003340| 65 0a 58 64 61 74 61 62 | 61 73 65 20 69 74 73 65 |e.Xdatab|ase itse|
|00003350| 6c 66 2e 20 20 49 74 20 | 69 73 20 69 6e 76 6f 6b |lf. It |is invok|
|00003360| 65 64 20 6c 69 6b 65 20 | 73 6f 3a 0a 58 0a 58 24 |ed like |so:.X.X$|
|00003370| 20 6d 6b 69 64 20 2d 75 | 0a 58 0a 58 49 6e 20 73 | mkid -u|.X.XIn s|
|00003380| 75 6d 6d 61 74 69 6f 6e | 2c 20 6d 6b 69 64 28 31 |ummation|, mkid(1|
|00003390| 29 20 63 61 6e 20 67 65 | 74 20 61 72 67 75 6d 65 |) can ge|t argume|
|000033a0| 6e 74 73 20 66 72 6f 6d | 20 6f 6e 65 20 6f 66 20 |nts from| one of |
|000033b0| 66 6f 75 72 20 70 6c 61 | 63 65 73 3a 0a 58 31 29 |four pla|ces:.X1)|
|000033c0| 20 74 68 65 20 63 6f 6d | 6d 61 6e 64 20 6c 69 6e | the com|mand lin|
|000033d0| 65 2c 20 32 29 20 61 20 | 66 69 6c 65 2c 20 33 29 |e, 2) a |file, 3)|
|000033e0| 20 73 74 64 69 6e 2c 20 | 34 29 20 74 68 65 20 64 | stdin, |4) the d|
|000033f0| 61 74 61 62 61 73 65 20 | 69 74 73 65 6c 66 2e 0a |atabase |itself..|
|00003400| 58 0a 58 4d 6b 69 64 28 | 31 29 20 61 63 63 65 70 |X.XMkid(|1) accep|
|00003410| 74 73 20 61 20 6e 75 6d | 62 65 72 20 6f 66 20 73 |ts a num|ber of s|
|00003420| 63 61 6e 6e 65 72 2d 73 | 70 65 63 69 66 69 63 20 |canner-s|pecific |
|00003430| 61 72 67 75 6d 65 6e 74 | 73 2e 20 20 47 65 6e 65 |argument|s. Gene|
|00003440| 72 61 6c 6c 79 2c 0a 58 | 74 68 65 73 65 20 61 72 |rally,.X|these ar|
|00003450| 65 20 69 6e 74 72 6f 64 | 75 63 65 64 20 77 69 74 |e introd|uced wit|
|00003460| 68 20 60 2d 53 3c 6c 61 | 6e 67 3e 27 20 77 68 65 |h `-S<la|ng>' whe|
|00003470| 72 65 20 3c 6c 61 6e 67 | 3e 20 69 73 20 74 68 65 |re <lang|> is the|
|00003480| 20 6e 61 6d 65 20 6f 66 | 0a 58 61 20 6c 61 6e 67 | name of|.Xa lang|
|00003490| 75 61 67 65 2c 20 73 75 | 63 68 20 61 73 20 60 63 |uage, su|ch as `c|
|000034a0| 27 20 6f 72 20 60 61 73 | 6d 27 2e 20 20 59 6f 75 |' or `as|m'. You|
|000034b0| 20 63 61 6e 20 67 65 74 | 20 61 20 73 63 61 6e 6e | can get| a scann|
|000034c0| 65 72 2d 73 70 65 63 69 | 66 69 63 0a 58 75 73 61 |er-speci|fic.Xusa|
|000034d0| 67 65 2d 72 65 70 6f 72 | 74 20 77 69 74 68 20 60 |ge-repor|t with `|
|000034e0| 2d 53 3c 6c 61 6e 67 3e | 3f 27 20 20 28 4f 66 20 |-S<lang>|?' (Of |
|000034f0| 63 6f 75 72 73 65 2c 20 | 74 68 65 20 60 3f 27 20 |course, |the `?' |
|00003500| 6d 75 73 74 20 62 65 20 | 65 73 63 61 70 65 64 0a |must be |escaped.|
|00003510| 58 74 6f 20 67 65 74 20 | 69 74 20 70 61 73 74 20 |Xto get |it past |
|00003520| 74 68 65 20 73 68 65 6c | 6c 29 0a 58 0a 58 48 65 |the shel|l).X.XHe|
|00003530| 72 65 27 73 20 73 63 61 | 6e 6e 65 72 2d 75 73 61 |re's sca|nner-usa|
|00003540| 67 65 20 66 6f 72 20 74 | 68 65 20 61 73 73 65 6d |ge for t|he assem|
|00003550| 62 6c 79 20 6c 61 6e 67 | 75 61 67 65 20 73 63 61 |bly lang|uage sca|
|00003560| 6e 6e 65 72 3a 0a 58 0a | 58 24 20 6d 6b 69 64 20 |nner:.X.|X$ mkid |
|00003570| 2d 53 61 73 6d 5c 3f 0a | 58 54 68 65 20 41 73 73 |-Sasm\?.|XThe Ass|
|00003580| 65 6d 62 6c 65 72 20 73 | 63 61 6e 6e 65 72 20 61 |embler s|canner a|
|00003590| 72 67 75 6d 65 6e 74 73 | 20 74 61 6b 65 20 74 68 |rguments| take th|
|000035a0| 65 20 66 6f 72 6d 20 2d | 53 61 73 6d 3c 61 72 67 |e form -|Sasm<arg|
|000035b0| 3e 2c 20 77 68 65 72 65 | 0a 58 3c 61 72 67 3e 20 |>, where|.X<arg> |
|000035c0| 69 73 20 6f 6e 65 20 6f | 66 20 74 68 65 20 66 6f |is one o|f the fo|
|000035d0| 6c 6c 6f 77 69 6e 67 3a | 20 28 3c 63 63 3e 20 64 |llowing:| (<cc> d|
|000035e0| 65 6e 6f 74 65 73 20 6f | 6e 65 20 6f 72 20 6d 6f |enotes o|ne or mo|
|000035f0| 72 65 20 63 68 61 72 61 | 63 74 65 72 73 29 0a 58 |re chara|cters).X|
|00003600| 20 20 2d 63 3c 63 63 3e | 20 2e 20 2e 20 2e 20 2e | -c<cc>| . . . .|
|00003610| 20 3c 63 63 3e 20 69 6e | 74 72 6f 64 75 63 65 28 | <cc> in|troduce(|
|00003620| 73 29 20 61 20 63 6f 6d | 6d 65 6e 74 20 75 6e 74 |s) a com|ment unt|
|00003630| 69 6c 20 65 6e 64 2d 6f | 66 2d 6c 69 6e 65 2e 0a |il end-o|f-line..|
|00003640| 58 20 20 28 2b 7c 2d 29 | 75 20 2e 20 2e 20 2e 20 |X (+|-)|u . . . |
|00003650| 2e 20 28 44 6f 7c 44 6f | 6e 27 74 29 20 73 74 72 |. (Do|Do|n't) str|
|00003660| 69 70 20 61 20 6c 65 61 | 64 69 6e 67 20 60 5f 27 |ip a lea|ding `_'|
|00003670| 20 66 72 6f 6d 20 69 64 | 73 2e 0a 58 20 20 28 2b | from id|s..X (+|
|00003680| 7c 2d 29 61 3c 63 63 3e | 20 2e 20 2e 20 41 6c 6c ||-)a<cc>| . . All|
|00003690| 6f 77 20 3c 63 63 3e 20 | 69 6e 20 69 64 73 2c 20 |ow <cc> |in ids, |
|000036a0| 61 6e 64 20 28 6b 65 65 | 70 7c 69 67 6e 6f 72 65 |and (kee|p|ignore|
|000036b0| 29 20 74 68 6f 73 65 20 | 69 64 73 2e 0a 58 20 20 |) those |ids..X |
|000036c0| 28 2b 7c 2d 29 70 20 2e | 20 2e 20 2e 20 2e 20 28 |(+|-)p .| . . . (|
|000036d0| 44 6f 7c 44 6f 6e 27 74 | 29 20 68 61 6e 64 6c 65 |Do|Don't|) handle|
|000036e0| 20 43 2d 70 72 65 70 72 | 6f 63 65 73 73 6f 72 20 | C-prepr|ocessor |
|000036f0| 64 69 72 65 63 74 69 76 | 65 73 2e 0a 58 20 20 28 |directiv|es..X (|
|00003700| 2b 7c 2d 29 43 20 2e 20 | 2e 20 2e 20 2e 20 28 44 |+|-)C . |. . . (D|
|00003710| 6f 7c 44 6f 6e 27 74 29 | 20 68 61 6e 64 6c 65 20 |o|Don't)| handle |
|00003720| 43 2d 73 74 79 6c 65 20 | 63 6f 6d 6d 65 6e 74 73 |C-style |comments|
|00003730| 2e 20 28 2f 2a 20 2a 2f | 29 0a 58 0a 58 60 2d 53 |. (/* */|).X.X`-S|
|00003740| 61 73 6d 2d 63 3c 63 63 | 3e 27 20 74 65 6c 6c 73 |asm-c<cc|>' tells|
|00003750| 20 74 68 65 20 73 63 61 | 6e 6e 65 72 20 77 68 61 | the sca|nner wha|
|00003760| 74 20 63 68 61 72 61 63 | 74 65 72 73 20 61 72 65 |t charac|ters are|
|00003770| 20 75 73 65 64 20 74 6f | 20 69 6e 74 72 6f 64 75 | used to| introdu|
|00003780| 63 65 20 63 6f 6d 6d 65 | 6e 74 73 0a 58 74 68 61 |ce comme|nts.Xtha|
|00003790| 74 20 65 78 74 65 6e 64 | 20 74 6f 20 65 6e 64 2d |t extend| to end-|
|000037a0| 6f 66 2d 6c 69 6e 65 2e | 0a 58 0a 58 55 73 65 20 |of-line.|.X.XUse |
|000037b0| 60 2d 53 61 73 6d 2b 75 | 27 20 69 66 20 79 6f 75 |`-Sasm+u|' if you|
|000037c0| 72 20 43 20 63 6f 6d 70 | 69 6c 65 72 20 70 72 65 |r C comp|iler pre|
|000037d0| 70 65 6e 64 73 20 6c 65 | 61 64 69 6e 67 20 75 6e |pends le|ading un|
|000037e0| 64 65 72 73 63 6f 72 65 | 73 20 74 6f 20 65 78 74 |derscore|s to ext|
|000037f0| 65 72 6e 61 6c 0a 58 6e | 61 6d 65 73 2e 20 20 54 |ernal.Xn|ames. T|
|00003800| 68 69 73 20 77 61 79 2c | 20 6d 6b 69 64 28 31 29 |his way,| mkid(1)|
|00003810| 20 77 69 6c 6c 20 73 74 | 72 69 70 20 6c 65 61 64 | will st|rip lead|
|00003820| 69 6e 67 20 75 6e 64 65 | 72 73 63 6f 72 65 73 2c |ing unde|rscores,|
|00003830| 20 61 6e 64 20 74 68 65 | 20 6e 61 6d 65 0a 58 60 | and the| name.X`|
|00003840| 66 6f 6f 27 20 69 6e 20 | 61 20 43 20 73 6f 75 72 |foo' in |a C sour|
|00003850| 63 65 20 77 69 6c 6c 20 | 62 65 20 63 6f 72 72 65 |ce will |be corre|
|00003860| 63 74 6c 79 20 61 73 73 | 6f 63 69 61 74 65 64 20 |ctly ass|ociated |
|00003870| 77 69 74 68 20 74 68 65 | 20 6e 61 6d 65 20 60 5f |with the| name `_|
|00003880| 66 6f 6f 27 0a 58 69 6e | 20 61 6e 20 61 73 73 65 |foo'.Xin| an asse|
|00003890| 6d 62 6c 65 72 20 73 6f | 75 72 63 65 2e 20 20 49 |mbler so|urce. I|
|000038a0| 66 20 79 6f 75 72 20 63 | 6f 6d 70 69 6c 65 72 20 |f your c|ompiler |
|000038b0| 64 6f 65 73 6e 27 74 20 | 70 72 65 70 65 6e 64 20 |doesn't |prepend |
|000038c0| 6c 65 61 64 69 6e 67 0a | 58 75 6e 64 65 72 73 63 |leading.|Xundersc|
|000038d0| 6f 72 65 73 2c 20 75 73 | 65 20 60 2d 53 61 73 6d |ores, us|e `-Sasm|
|000038e0| 2d 75 27 2e 0a 58 0a 58 | 4d 61 6e 79 20 61 73 73 |-u'..X.X|Many ass|
|000038f0| 65 6d 62 6c 65 72 73 20 | 61 6c 6c 6f 77 20 73 70 |emblers |allow sp|
|00003900| 65 63 69 61 6c 20 63 68 | 61 72 61 63 74 65 72 73 |ecial ch|aracters|
|00003910| 20 74 6f 20 62 65 20 6d | 69 78 65 64 20 77 69 74 | to be m|ixed wit|
|00003920| 68 0a 58 61 6c 70 68 61 | 2d 6e 75 6d 65 72 69 63 |h.Xalpha|-numeric|
|00003930| 73 20 69 6e 20 6c 61 62 | 65 6c 2c 20 63 6f 6e 73 |s in lab|el, cons|
|00003940| 74 61 6e 74 20 61 6e 64 | 20 72 65 67 69 73 74 65 |tant and| registe|
|00003950| 72 20 6e 61 6d 65 73 2e | 20 20 43 6f 6d 6d 6f 6e |r names.| Common|
|00003960| 20 63 68 6f 69 63 65 73 | 0a 58 61 72 65 20 60 2e | choices|.Xare `.|
|00003970| 27 2c 20 60 25 27 2c 20 | 61 6e 64 20 60 24 27 2e |', `%', |and `$'.|
|00003980| 20 20 54 68 75 73 2c 20 | 61 20 6c 61 62 65 6c 20 | Thus, |a label |
|00003990| 73 75 63 68 20 61 73 20 | 60 4c 25 31 32 33 27 20 |such as |`L%123' |
|000039a0| 73 68 6f 75 6c 64 20 62 | 65 20 73 63 61 6e 6e 65 |should b|e scanne|
|000039b0| 64 0a 58 61 73 20 6f 6e | 65 20 74 6f 6b 65 6e 2c |d.Xas on|e token,|
|000039c0| 20 6e 6f 74 20 62 72 6f | 6b 65 6e 20 75 70 20 69 | not bro|ken up i|
|000039d0| 6e 74 6f 20 74 68 65 20 | 6e 61 6d 65 20 60 4c 27 |nto the |name `L'|
|000039e0| 20 61 6e 64 20 74 68 65 | 20 6e 75 6d 62 65 72 20 | and the| number |
|000039f0| 31 32 33 2e 0a 58 60 2d | 53 61 73 6d 2d 61 25 2e |123..X`-|Sasm-a%.|
|00003a00| 27 20 74 65 6c 6c 73 20 | 74 68 65 20 73 63 61 6e |' tells |the scan|
|00003a10| 6e 65 72 20 74 6f 20 61 | 6c 6c 6f 77 20 60 25 27 |ner to a|llow `%'|
|00003a20| 20 61 6e 64 20 60 2e 27 | 20 69 6e 20 74 6f 6b 65 | and `.'| in toke|
|00003a30| 6e 73 2c 20 62 75 74 20 | 74 6f 20 74 68 72 6f 77 |ns, but |to throw|
|00003a40| 0a 58 61 77 61 79 20 74 | 6f 6b 65 6e 73 20 63 6f |.Xaway t|okens co|
|00003a50| 6e 74 61 69 6e 69 6e 67 | 20 60 25 27 20 6f 72 20 |ntaining| `%' or |
|00003a60| 60 2e 27 20 60 2d 53 61 | 73 6d 2b 61 25 2e 27 20 |`.' `-Sa|sm+a%.' |
|00003a70| 74 65 6c 6c 73 20 74 68 | 65 20 73 63 61 6e 6e 65 |tells th|e scanne|
|00003a80| 72 20 74 6f 20 6b 65 65 | 70 20 73 75 63 68 0a 58 |r to kee|p such.X|
|00003a90| 74 6f 6b 65 6e 73 20 61 | 6e 64 20 70 75 74 20 74 |tokens a|nd put t|
|00003aa0| 68 65 6d 20 69 6e 74 6f | 20 74 68 65 20 64 61 74 |hem into| the dat|
|00003ab0| 61 62 61 73 65 2e 0a 58 | 0a 58 0a 58 60 2d 53 61 |abase..X|.X.X`-Sa|
|00003ac0| 73 6d 2b 70 27 20 74 65 | 6c 6c 73 20 74 68 65 20 |sm+p' te|lls the |
|00003ad0| 73 63 61 6e 6e 65 72 20 | 74 6f 20 68 61 6e 64 6c |scanner |to handl|
|00003ae0| 65 20 60 23 69 6e 63 6c | 75 64 65 27 20 61 6e 64 |e `#incl|ude' and|
|00003af0| 20 60 23 64 65 66 69 6e | 65 27 20 6c 69 6e 65 73 | `#defin|e' lines|
|00003b00| 20 61 73 0a 58 69 6e 20 | 43 20 73 6f 75 72 63 65 | as.Xin |C source|
|00003b10| 2c 20 61 6e 64 20 60 2d | 53 61 73 6d 2b 43 27 20 |, and `-|Sasm+C' |
|00003b20| 74 65 6c 6c 73 20 69 74 | 20 74 6f 20 69 67 6e 6f |tells it| to igno|
|00003b30| 72 65 20 43 2d 73 74 79 | 6c 65 20 63 6f 6d 6d 65 |re C-sty|le comme|
|00003b40| 6e 74 73 2e 0a 58 0a 58 | 48 65 72 65 27 73 20 74 |nts..X.X|Here's t|
|00003b50| 68 65 20 73 63 61 6e 6e | 65 72 2d 75 73 61 67 65 |he scann|er-usage|
|00003b60| 20 66 6f 72 20 43 3a 0a | 58 0a 58 24 20 6d 6b 69 | for C:.|X.X$ mki|
|00003b70| 64 20 2d 53 63 5c 3f 0a | 58 54 68 65 20 43 20 73 |d -Sc\?.|XThe C s|
|00003b80| 63 61 6e 6e 65 72 20 61 | 72 67 75 6d 65 6e 74 73 |canner a|rguments|
|00003b90| 20 74 61 6b 65 20 74 68 | 65 20 66 6f 72 6d 20 2d | take th|e form -|
|00003ba0| 53 63 3c 61 72 67 3e 2c | 20 77 68 65 72 65 20 3c |Sc<arg>,| where <|
|00003bb0| 61 72 67 3e 0a 58 69 73 | 20 6f 6e 65 20 6f 66 20 |arg>.Xis| one of |
|00003bc0| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 3a 20 28 |the foll|owing: (|
|00003bd0| 3c 63 63 3e 20 64 65 6e | 6f 74 65 73 20 6f 6e 65 |<cc> den|otes one|
|00003be0| 20 6f 72 20 6d 6f 72 65 | 20 63 68 61 72 61 63 74 | or more| charact|
|00003bf0| 65 72 73 29 0a 58 20 20 | 28 2b 7c 2d 29 75 20 2e |ers).X |(+|-)u .|
|00003c00| 20 2e 20 2e 20 2e 20 28 | 44 6f 7c 44 6f 6e 27 74 | . . . (|Do|Don't|
|00003c10| 29 20 73 74 72 69 70 20 | 61 20 6c 65 61 64 69 6e |) strip |a leadin|
|00003c20| 67 20 60 5f 27 20 66 72 | 6f 6d 20 69 64 73 20 69 |g `_' fr|om ids i|
|00003c30| 6e 20 73 74 72 69 6e 67 | 73 2e 0a 58 20 20 2d 73 |n string|s..X -s|
|00003c40| 3c 63 63 3e 20 2e 20 2e | 20 2e 20 2e 20 41 6c 6c |<cc> . .| . . All|
|00003c50| 6f 77 20 3c 63 63 3e 20 | 69 6e 20 73 74 72 69 6e |ow <cc> |in strin|
|00003c60| 67 20 69 64 73 2e 0a 58 | 0a 58 54 68 65 20 60 2b |g ids..X|.XThe `+|
|00003c70| 75 27 20 61 72 67 75 6d | 65 6e 74 20 69 73 20 61 |u' argum|ent is a|
|00003c80| 6b 69 6e 20 74 6f 20 74 | 68 65 20 61 72 67 75 6d |kin to t|he argum|
|00003c90| 65 6e 74 20 66 6f 72 20 | 74 68 65 20 61 73 73 65 |ent for |the asse|
|00003ca0| 6d 62 6c 79 2d 6c 61 6e | 67 75 61 67 65 0a 58 73 |mbly-lan|guage.Xs|
|00003cb0| 63 61 6e 6e 65 72 2e 20 | 20 4d 6b 69 64 28 31 29 |canner. | Mkid(1)|
|00003cc0| 20 6b 65 65 70 73 20 74 | 68 65 20 63 6f 6e 74 65 | keeps t|he conte|
|00003cd0| 6e 74 73 20 6f 66 20 71 | 75 6f 74 65 64 2d 73 74 |nts of q|uoted-st|
|00003ce0| 72 69 6e 67 73 20 69 66 | 20 74 68 65 20 73 74 72 |rings if| the str|
|00003cf0| 69 6e 67 0a 58 63 6f 6e | 74 61 69 6e 73 20 61 20 |ing.Xcon|tains a |
|00003d00| 73 69 6e 67 6c 65 20 76 | 61 6c 69 64 20 43 20 6e |single v|alid C n|
|00003d10| 61 6d 65 20 61 6e 64 20 | 6e 6f 74 68 69 6e 67 20 |ame and |nothing |
|00003d20| 65 6c 73 65 2e 20 20 45 | 2e 67 2e 20 20 6d 6b 69 |else. E|.g. mki|
|00003d30| 64 28 31 29 20 77 6f 75 | 6c 64 0a 58 6b 65 65 70 |d(1) wou|ld.Xkeep|
|00003d40| 20 74 68 65 20 63 6f 6e | 74 65 6e 74 73 20 6f 66 | the con|tents of|
|00003d50| 20 22 5f 70 72 6f 63 22 | 2e 20 20 53 75 63 68 20 | "_proc"|. Such |
|00003d60| 73 74 72 69 6e 67 73 20 | 61 72 65 20 69 6e 74 65 |strings |are inte|
|00003d70| 72 65 73 74 69 6e 67 20 | 62 65 63 61 75 73 65 0a |resting |because.|
|00003d80| 58 74 68 65 79 20 6d 61 | 79 20 63 6f 6e 74 61 69 |Xthey ma|y contai|
|00003d90| 6e 20 73 79 6d 62 6f 6c | 20 6e 61 6d 65 73 20 74 |n symbol| names t|
|00003da0| 68 61 74 20 61 20 70 72 | 6f 67 72 61 6d 20 75 73 |hat a pr|ogram us|
|00003db0| 65 73 20 66 6f 72 20 6e | 6c 69 73 74 20 6c 6f 6f |es for n|list loo|
|00003dc0| 6b 75 70 73 2e 0a 58 53 | 6f 2c 20 69 66 20 79 6f |kups..XS|o, if yo|
|00003dd0| 75 72 20 63 6f 6d 70 69 | 6c 65 72 20 70 72 65 70 |ur compi|ler prep|
|00003de0| 65 6e 64 73 20 75 6e 64 | 65 72 73 63 6f 72 65 73 |ends und|erscores|
|00003df0| 20 74 6f 20 65 78 74 65 | 72 6e 61 6c 20 73 79 6d | to exte|rnal sym|
|00003e00| 62 6f 6c 73 2c 20 75 73 | 65 0a 58 60 2d 53 63 2b |bols, us|e.X`-Sc+|
|00003e10| 75 27 20 73 6f 20 74 68 | 61 74 20 6d 6b 69 64 28 |u' so th|at mkid(|
|00003e20| 31 29 20 77 69 6c 6c 20 | 73 74 72 69 70 20 74 68 |1) will |strip th|
|00003e30| 65 6d 20 62 61 63 6b 20 | 6f 66 66 2e 0a 58 0a 58 |em back |off..X.X|
|00003e40| 4d 6b 69 64 28 31 29 20 | 6e 6f 72 6d 61 6c 6c 79 |Mkid(1) |normally|
|00003e50| 20 74 68 72 6f 77 73 20 | 61 77 61 79 20 74 68 65 | throws |away the|
|00003e60| 20 63 6f 6e 74 65 6e 74 | 73 20 6f 66 20 71 75 6f | content|s of quo|
|00003e70| 74 65 64 20 73 74 72 69 | 6e 67 73 20 74 68 61 74 |ted stri|ngs that|
|00003e80| 20 68 61 76 65 0a 58 61 | 6e 79 74 68 69 6e 67 20 | have.Xa|nything |
|00003e90| 6f 74 68 65 72 20 74 68 | 61 6e 20 61 20 73 69 6e |other th|an a sin|
|00003ea0| 67 6c 65 20 6e 61 6d 65 | 20 69 6e 20 74 68 65 6d |gle name| in them|
|00003eb0| 2e 20 20 59 6f 75 20 63 | 61 6e 20 74 65 6c 6c 20 |. You c|an tell |
|00003ec0| 6d 6b 69 64 28 31 29 20 | 74 6f 0a 58 61 63 63 65 |mkid(1) |to.Xacce|
|00003ed0| 70 74 20 61 64 64 69 74 | 69 6f 6e 61 6c 20 63 68 |pt addit|ional ch|
|00003ee0| 61 72 61 63 74 65 72 73 | 20 69 6e 20 73 74 72 69 |aracters| in stri|
|00003ef0| 6e 67 73 20 77 69 74 68 | 20 60 2d 53 63 2d 73 3c |ngs with| `-Sc-s<|
|00003f00| 63 63 3e 27 20 77 68 65 | 72 65 20 3c 63 63 3e 20 |cc>' whe|re <cc> |
|00003f10| 69 73 0a 58 6f 6e 65 20 | 6f 72 20 6d 6f 72 65 20 |is.Xone |or more |
|00003f20| 73 70 65 63 69 61 6c 20 | 63 68 61 72 61 63 74 65 |special |characte|
|00003f30| 72 73 2e 20 20 45 2e 67 | 2e 20 60 2d 53 63 2d 73 |rs. E.g|. `-Sc-s|
|00003f40| 2f 2e 2d 3a 2c 27 20 77 | 69 6c 6c 20 69 6e 63 6c |/.-:,' w|ill incl|
|00003f50| 75 64 65 20 6d 6f 73 74 | 20 6f 66 0a 58 74 68 65 |ude most| of.Xthe|
|00003f60| 20 73 74 72 69 6e 67 73 | 20 63 6f 6e 74 61 69 6e | strings| contain|
|00003f70| 69 6e 67 20 70 61 74 68 | 6e 61 6d 65 73 20 74 68 |ing path|names th|
|00003f80| 61 74 20 79 6f 75 20 61 | 72 65 20 6c 69 6b 65 6c |at you a|re likel|
|00003f90| 79 20 74 6f 20 65 6e 63 | 6f 75 6e 74 65 72 2e 0a |y to enc|ounter..|
|00003fa0| 58 0a 58 41 6e 6f 74 68 | 65 72 20 63 6c 61 73 73 |X.XAnoth|er class|
|00003fb0| 20 6f 66 20 73 63 61 6e | 6e 65 72 20 61 72 67 75 | of scan|ner argu|
|00003fc0| 6d 65 6e 74 20 61 6c 6c | 6f 77 73 20 79 6f 75 20 |ment all|ows you |
|00003fd0| 74 6f 20 61 73 73 6f 63 | 69 61 74 65 20 61 20 73 |to assoc|iate a s|
|00003fe0| 75 66 66 69 78 0a 58 77 | 69 74 68 20 61 20 6c 61 |uffix.Xw|ith a la|
|00003ff0| 6e 67 75 61 67 65 2e 20 | 20 45 2e 67 2e 20 60 2d |nguage. | E.g. `-|
|00004000| 53 2e 79 3d 63 27 20 74 | 65 6c 6c 73 20 6d 6b 69 |S.y=c' t|ells mki|
|00004010| 64 28 31 29 20 74 6f 20 | 75 73 65 20 74 68 65 20 |d(1) to |use the |
|00004020| 43 20 6c 61 6e 67 75 61 | 67 65 0a 58 73 63 61 6e |C langua|ge.Xscan|
|00004030| 6e 65 72 20 6f 6e 20 61 | 6c 6c 20 66 69 6c 65 73 |ner on a|ll files|
|00004040| 20 65 6e 64 69 6e 67 20 | 77 69 74 68 20 2e 79 2e | ending |with .y.|
|00004050| 20 20 59 6f 75 20 63 61 | 6e 20 61 73 6b 20 6d 6b | You ca|n ask mk|
|00004060| 69 64 28 31 29 20 66 6f | 72 20 74 68 65 0a 58 61 |id(1) fo|r the.Xa|
|00004070| 76 61 69 6c 61 62 6c 65 | 20 73 63 61 6e 6e 65 72 |vailable| scanner|
|00004080| 73 20 61 6e 64 20 61 73 | 73 6f 63 69 61 74 65 64 |s and as|sociated|
|00004090| 20 73 75 66 66 69 78 65 | 73 20 6c 69 6b 65 20 73 | suffixe|s like s|
|000040a0| 6f 3a 0a 58 0a 58 24 20 | 6d 6b 69 64 20 2d 53 5c |o:.X.X$ |mkid -S\|
|000040b0| 3f 3d 5c 3f 0a 58 2e 63 | 3d 63 2c 20 2e 68 3d 63 |?=\?.X.c|=c, .h=c|
|000040c0| 2c 20 2e 79 3d 63 2c 20 | 2e 73 3d 61 73 6d 2c 20 |, .y=c, |.s=asm, |
|000040d0| 2e 70 3d 70 61 73 63 61 | 6c 2c 20 2e 70 61 73 3d |.p=pasca|l, .pas=|
|000040e0| 70 61 73 63 61 6c 0a 58 | 0a 58 50 6c 65 61 73 65 |pascal.X|.XPlease|
|000040f0| 20 6e 6f 74 65 2c 20 6d | 6b 69 64 28 31 29 20 69 | note, m|kid(1) i|
|00004100| 73 20 6c 79 69 6e 67 20 | 74 6f 20 79 6f 75 20 61 |s lying |to you a|
|00004110| 62 6f 75 74 20 69 74 73 | 20 50 61 73 63 61 6c 20 |bout its| Pascal |
|00004120| 70 72 6f 77 65 73 73 21 | 0a 58 41 74 20 74 68 65 |prowess!|.XAt the|
|00004130| 20 74 69 6d 65 20 6f 66 | 20 74 68 69 73 20 70 6f | time of| this po|
|00004140| 73 74 69 6e 67 2c 20 74 | 68 65 72 65 20 61 72 65 |sting, t|here are|
|00004150| 20 73 63 61 6e 6e 65 72 | 73 20 66 6f 72 20 43 20 | scanner|s for C |
|00004160| 61 6e 64 20 61 73 73 65 | 6d 62 6c 79 0a 58 6c 61 |and asse|mbly.Xla|
|00004170| 6e 67 75 61 67 65 20 73 | 6f 75 72 63 65 73 2e 20 |nguage s|ources. |
|00004180| 20 54 68 65 72 65 20 61 | 72 65 20 61 6c 73 6f 20 | There a|re also |
|00004190| 73 74 75 62 73 20 66 6f | 72 20 50 61 73 63 61 6c |stubs fo|r Pascal|
|000041a0| 2c 20 41 64 61 20 61 6e | 64 20 4c 49 53 50 2e 20 |, Ada an|d LISP. |
|000041b0| 20 54 68 65 0a 58 73 63 | 61 6e 6e 65 72 73 20 61 | The.Xsc|anners a|
|000041c0| 72 65 20 76 65 72 79 20 | 66 61 73 74 2e 20 20 54 |re very |fast. T|
|000041d0| 68 65 20 61 73 73 65 6d | 62 6c 79 20 6c 61 6e 67 |he assem|bly lang|
|000041e0| 75 61 67 65 20 73 63 61 | 6e 6e 65 72 20 6b 6e 6f |uage sca|nner kno|
|000041f0| 77 73 20 68 6f 77 0a 58 | 74 6f 20 74 68 72 6f 77 |ws how.X|to throw|
|00004200| 20 61 77 61 79 20 43 2d | 73 74 79 6c 65 20 63 6f | away C-|style co|
|00004210| 6d 6d 65 6e 74 73 20 61 | 73 20 77 65 6c 6c 20 61 |mments a|s well a|
|00004220| 73 20 74 68 65 20 74 72 | 61 64 69 74 69 6f 6e 61 |s the tr|aditiona|
|00004230| 6c 20 60 63 6f 6d 6d 65 | 6e 74 2d 0a 58 63 68 61 |l `comme|nt-.Xcha|
|00004240| 72 61 63 74 65 72 2d 75 | 6e 74 69 6c 2d 65 6e 64 |racter-u|ntil-end|
|00004250| 2d 6f 66 2d 6c 69 6e 65 | 27 20 73 74 79 6c 65 2e |-of-line|' style.|
|00004260| 20 20 49 6e 20 6f 72 64 | 65 72 20 74 6f 20 74 65 | In ord|er to te|
|00004270| 73 74 20 6e 65 77 20 73 | 63 61 6e 6e 65 72 73 2c |st new s|canners,|
|00004280| 0a 58 74 68 65 72 65 20 | 69 73 20 61 20 73 63 61 |.Xthere |is a sca|
|00004290| 6e 6e 65 72 20 64 72 69 | 76 65 72 20 63 61 6c 6c |nner dri|ver call|
|000042a0| 65 64 20 69 64 78 28 31 | 29 2e 20 20 49 64 78 28 |ed idx(1|). Idx(|
|000042b0| 31 29 20 73 69 6d 70 6c | 79 20 63 61 6c 6c 73 20 |1) simpl|y calls |
|000042c0| 74 68 65 0a 58 73 63 61 | 6e 6e 65 72 20 74 6f 20 |the.Xsca|nner to |
|000042d0| 67 65 74 20 69 64 65 6e | 74 69 66 69 65 72 73 20 |get iden|tifiers |
|000042e0| 6f 6e 65 2d 61 74 2d 61 | 2d 74 69 6d 65 20 70 72 |one-at-a|-time pr|
|000042f0| 69 6e 74 73 20 74 68 65 | 6d 20 6f 6e 20 73 74 64 |ints the|m on std|
|00004300| 6f 75 74 20 6f 6e 65 2d | 70 65 72 2d 6c 69 6e 65 |out one-|per-line|
|00004310| 2e 0a 58 0a 58 46 6f 72 | 20 6d 6f 72 65 20 69 6e |..X.XFor| more in|
|00004320| 66 6f 72 6d 61 74 69 6f | 6e 2c 20 72 65 61 64 20 |formatio|n, read |
|00004330| 74 68 65 20 6d 61 6e 75 | 61 6c 20 70 61 67 65 73 |the manu|al pages|
|00004340| 21 0a 58 0a 58 48 61 70 | 70 79 20 48 61 63 6b 69 |!.X.XHap|py Hacki|
|00004350| 6e 67 2c 0a 58 2d 2d 0a | 58 2d 2d 20 47 72 65 67 |ng,.X--.|X-- Greg|
|00004360| 20 4d 63 47 61 72 79 0a | 58 2d 2d 20 50 2e 4f 2e | McGary.|X-- P.O.|
|00004370| 20 42 6f 78 20 32 38 36 | 0a 58 2d 2d 20 4c 69 6e | Box 286|.X-- Lin|
|00004380| 63 6f 6c 6e 2c 20 4d 41 | 20 20 30 31 37 37 33 0a |coln, MA| 01773.|
|00004390| 58 2d 2d 0a 58 2d 2d 20 | 39 2f 31 35 2f 38 37 0a |X--.X-- |9/15/87.|
|000043a0| 58 2d 2d 0a 58 2d 2d 09 | 55 6e 74 69 6c 20 74 68 |X--.X--.|Until th|
|000043b0| 65 20 65 6e 64 20 6f 66 | 20 31 39 38 37 2c 0a 58 |e end of| 1987,.X|
|000043c0| 2d 2d 09 43 6f 6e 73 75 | 6c 74 69 6e 67 20 74 6f |--.Consu|lting to|
|000043d0| 20 53 75 6e 27 73 20 45 | 61 73 74 20 43 6f 61 73 | Sun's E|ast Coas|
|000043e0| 74 20 44 69 76 69 73 69 | 6f 6e 3a 0a 58 2d 2d 09 |t Divisi|on:.X--.|
|000043f0| 09 67 6d 63 67 61 72 79 | 40 65 63 64 2e 73 75 6e |.gmcgary|@ecd.sun|
|00004400| 2e 63 6f 6d 0a 58 2d 2d | 09 09 67 6d 63 67 61 72 |.com.X--|..gmcgar|
|00004410| 79 40 73 75 6e 65 61 73 | 74 2e 75 75 2e 6e 65 74 |y@suneas|t.uu.net|
|00004420| 0a 58 2d 2d 0a 58 2d 2d | 09 41 66 74 65 72 20 74 |.X--.X--|.After t|
|00004430| 68 61 74 2c 20 70 72 6f | 62 61 62 6c 79 20 63 6f |hat, pro|bably co|
|00004440| 6e 73 75 6c 74 69 6e 67 | 20 69 6e 20 45 75 72 6f |nsulting| in Euro|
|00004450| 70 65 2e 2e 2e 0a 45 4e | 44 5f 4f 46 5f 46 49 4c |pe....EN|D_OF_FIL|
|00004460| 45 0a 69 66 20 74 65 73 | 74 20 31 36 30 33 37 20 |E.if tes|t 16037 |
|00004470| 2d 6e 65 20 60 77 63 20 | 2d 63 20 3c 27 54 55 54 |-ne `wc |-c <'TUT|
|00004480| 4f 52 49 41 4c 27 60 3b | 20 74 68 65 6e 0a 20 20 |ORIAL'`;| then. |
|00004490| 20 20 65 63 68 6f 20 73 | 68 61 72 3a 20 5c 22 27 | echo s|har: \"'|
|000044a0| 54 55 54 4f 52 49 41 4c | 27 5c 22 20 75 6e 70 61 |TUTORIAL|'\" unpa|
|000044b0| 63 6b 65 64 20 77 69 74 | 68 20 77 72 6f 6e 67 20 |cked wit|h wrong |
|000044c0| 73 69 7a 65 21 0a 66 69 | 0a 23 20 65 6e 64 20 6f |size!.fi|.# end o|
|000044d0| 66 20 27 54 55 54 4f 52 | 49 41 4c 27 0a 66 69 0a |f 'TUTOR|IAL'.fi.|
|000044e0| 69 66 20 74 65 73 74 20 | 2d 66 20 27 69 69 64 2e |if test |-f 'iid.|
|000044f0| 79 27 20 2d 61 20 22 24 | 7b 31 7d 22 20 21 3d 20 |y' -a "$|{1}" != |
|00004500| 22 2d 63 22 20 3b 20 74 | 68 65 6e 20 0a 20 20 65 |"-c" ; t|hen . e|
|00004510| 63 68 6f 20 73 68 61 72 | 3a 20 57 69 6c 6c 20 6e |cho shar|: Will n|
|00004520| 6f 74 20 63 6c 6f 62 62 | 65 72 20 65 78 69 73 74 |ot clobb|er exist|
|00004530| 69 6e 67 20 66 69 6c 65 | 20 5c 22 27 69 69 64 2e |ing file| \"'iid.|
|00004540| 79 27 5c 22 0a 65 6c 73 | 65 0a 65 63 68 6f 20 73 |y'\".els|e.echo s|
|00004550| 68 61 72 3a 20 45 78 74 | 72 61 63 74 69 6e 67 20 |har: Ext|racting |
|00004560| 5c 22 27 69 69 64 2e 79 | 27 5c 22 20 5c 28 31 31 |\"'iid.y|'\" \(11|
|00004570| 32 37 38 20 63 68 61 72 | 61 63 74 65 72 73 5c 29 |278 char|acters\)|
|00004580| 0a 73 65 64 20 22 73 2f | 5e 58 2f 2f 22 20 3e 27 |.sed "s/|^X//" >'|
|00004590| 69 69 64 2e 79 27 20 3c | 3c 27 45 4e 44 5f 4f 46 |iid.y' <|<'END_OF|
|000045a0| 5f 46 49 4c 45 27 0a 58 | 25 7b 0a 58 2f 2a 20 54 |_FILE'.X|%{.X/* T|
|000045b0| 68 69 73 20 69 73 20 74 | 68 65 20 79 61 63 63 20 |his is t|he yacc |
|000045c0| 64 65 66 69 6e 69 74 69 | 6f 6e 20 66 6f 72 20 74 |definiti|on for t|
|000045d0| 68 65 20 69 69 64 20 63 | 6f 6d 6d 61 6e 64 20 6c |he iid c|ommand l|
|000045e0| 61 6e 67 75 61 67 65 2e | 0a 58 20 2a 20 54 68 65 |anguage.|.X * The|
|000045f0| 20 6d 61 69 6e 20 70 72 | 6f 67 72 61 6d 2c 20 73 | main pr|ogram, s|
|00004600| 63 61 6e 6e 65 72 2c 20 | 61 6e 64 20 70 61 72 73 |canner, |and pars|
|00004610| 65 72 20 61 72 65 20 64 | 65 66 69 6e 65 64 20 68 |er are d|efined h|
|00004620| 65 72 65 2e 0a 58 20 2a | 20 54 68 65 20 75 74 69 |ere..X *| The uti|
|00004630| 6c 69 74 79 20 66 75 6e | 63 74 69 6f 6e 73 20 69 |lity fun|ctions i|
|00004640| 6e 76 6f 6b 65 64 20 66 | 72 6f 6d 20 68 65 72 65 |nvoked f|rom here|
|00004650| 20 61 72 65 20 69 6e 20 | 69 69 64 66 75 6e 2e 63 | are in |iidfun.c|
|00004660| 0a 58 20 2a 2f 0a 58 0a | 58 23 69 6e 63 6c 75 64 |.X */.X.|X#includ|
|00004670| 65 20 22 69 69 64 64 65 | 66 2e 68 22 0a 58 0a 58 |e "iidde|f.h".X.X|
|00004680| 25 7d 0a 58 0a 58 25 75 | 6e 69 6f 6e 20 7b 0a 58 |%}.X.X%u|nion {.X|
|00004690| 20 20 20 73 65 74 5f 74 | 79 70 65 20 2a 20 20 20 | set_t|ype * |
|000046a0| 20 20 73 65 74 64 65 66 | 20 3b 20 20 20 0a 58 20 | setdef| ; .X |
|000046b0| 20 20 69 64 5f 74 79 70 | 65 20 2a 20 20 20 20 20 | id_typ|e * |
|000046c0| 20 73 74 72 64 65 66 20 | 3b 0a 58 20 20 20 69 64 | strdef |;.X id|
|000046d0| 5f 6c 69 73 74 5f 74 79 | 70 65 20 2a 20 6c 69 73 |_list_ty|pe * lis|
|000046e0| 74 64 65 66 20 3b 0a 58 | 7d 0a 58 0a 58 25 74 6f |tdef ;.X|}.X.X%to|
|000046f0| 6b 65 6e 20 3c 20 73 65 | 74 64 65 66 20 3e 20 53 |ken < se|tdef > S|
|00004700| 45 54 0a 58 0a 58 25 74 | 6f 6b 65 6e 20 3c 20 73 |ET.X.X%t|oken < s|
|00004710| 74 72 64 65 66 20 3e 20 | 49 44 20 53 48 45 4c 4c |trdef > |ID SHELL|
|00004720| 5f 51 55 45 52 59 20 53 | 48 45 4c 4c 5f 43 4f 4d |_QUERY S|HELL_COM|
|00004730| 4d 41 4e 44 0a 58 0a 58 | 25 74 79 70 65 20 3c 20 |MAND.X.X|%type < |
|00004740| 73 65 74 64 65 66 20 3e | 20 51 75 65 72 79 20 50 |setdef >| Query P|
|00004750| 72 69 6d 69 74 69 76 65 | 0a 58 0a 58 25 74 79 70 |rimitive|.X.X%typ|
|00004760| 65 20 3c 20 6c 69 73 74 | 64 65 66 20 3e 20 4c 69 |e < list|def > Li|
|00004770| 64 5f 67 72 6f 75 70 20 | 41 69 64 5f 67 72 6f 75 |d_group |Aid_grou|
|00004780| 70 20 49 64 5f 6c 69 73 | 74 20 43 6f 6d 6d 61 6e |p Id_lis|t Comman|
|00004790| 64 5f 6c 69 73 74 0a 58 | 0a 58 25 74 6f 6b 65 6e |d_list.X|.X%token|
|000047a0| 20 4c 49 44 20 41 49 44 | 20 42 45 47 49 4e 20 53 | LID AID| BEGIN S|
|000047b0| 45 54 53 20 53 53 20 46 | 49 4c 45 53 20 53 48 4f |ETS SS F|ILES SHO|
|000047c0| 57 20 48 45 4c 50 20 4f | 46 46 20 4d 41 54 43 48 |W HELP O|FF MATCH|
|000047d0| 0a 58 0a 58 25 6c 65 66 | 74 20 4f 52 0a 58 0a 58 |.X.X%lef|t OR.X.X|
|000047e0| 25 6c 65 66 74 20 41 4e | 44 0a 58 0a 58 25 6c 65 |%left AN|D.X.X%le|
|000047f0| 66 74 20 4e 4f 54 0a 58 | 0a 58 25 73 74 61 72 74 |ft NOT.X|.X%start|
|00004800| 20 43 6f 6d 6d 61 6e 64 | 0a 58 0a 58 25 25 0a 58 | Command|.X.X%%.X|
|00004810| 0a 58 43 6f 6d 6d 61 6e | 64 20 3a 0a 58 20 20 20 |.XComman|d :.X |
|00004820| 42 45 47 49 4e 20 49 44 | 0a 58 20 20 20 20 20 20 |BEGIN ID|.X |
|00004830| 7b 0a 58 20 20 20 20 20 | 20 20 20 20 2f 2a 20 63 |{.X | /* c|
|00004840| 64 20 74 6f 20 74 68 65 | 20 64 69 72 65 63 74 6f |d to the| directo|
|00004850| 72 79 20 73 70 65 63 69 | 66 69 65 64 20 61 73 20 |ry speci|fied as |
|00004860| 61 72 67 75 6d 65 6e 74 | 2c 20 66 6c 75 73 68 20 |argument|, flush |
|00004870| 73 65 74 73 20 2a 2f 0a | 58 0a 58 20 20 20 20 20 |sets */.|X.X |
|00004880| 20 20 20 20 53 65 74 44 | 69 72 65 63 74 6f 72 79 | SetD|irectory|
|00004890| 28 24 32 29 20 3b 0a 58 | 20 20 20 20 20 20 20 20 |($2) ;.X| |
|000048a0| 20 46 6c 75 73 68 53 65 | 74 73 28 29 20 3b 0a 58 | FlushSe|ts() ;.X|
|000048b0| 20 20 20 20 20 20 7d 0a | 58 7c 20 20 53 65 74 5f | }.|X| Set_|
|000048c0| 71 75 65 72 79 20 51 75 | 65 72 79 0a 58 7c 20 20 |query Qu|ery.X| |
|000048d0| 46 69 6c 65 5f 71 75 65 | 72 79 20 51 75 65 72 79 |File_que|ry Query|
|000048e0| 0a 58 20 20 20 20 20 20 | 7b 0a 58 20 20 20 20 20 |.X |{.X |
|000048f0| 20 20 20 20 2f 2a 20 70 | 72 69 6e 74 20 74 68 65 | /* p|rint the|
|00004900| 20 6c 69 73 74 20 6f 66 | 20 66 69 6c 65 73 20 72 | list of| files r|
|00004910| 65 73 75 6c 74 69 6e 67 | 20 66 72 6f 6d 20 51 75 |esulting| from Qu|
|00004920| 65 72 79 20 2a 2f 0a 58 | 0a 58 20 20 20 20 20 20 |ery */.X|.X |
|00004930| 20 20 20 50 72 69 6e 74 | 53 65 74 28 24 32 29 20 | Print|Set($2) |
|00004940| 3b 0a 58 20 20 20 20 20 | 20 7d 0a 58 7c 20 20 53 |;.X | }.X| S|
|00004950| 48 4f 57 20 53 45 54 0a | 58 20 20 20 20 20 20 7b |HOW SET.|X {|
|00004960| 0a 58 20 20 20 20 20 20 | 20 20 20 2f 2a 20 72 75 |.X | /* ru|
|00004970| 6e 20 50 41 47 45 52 20 | 6f 6e 20 74 68 65 20 6c |n PAGER |on the l|
|00004980| 69 73 74 20 6f 66 20 66 | 69 6c 65 73 20 69 6e 20 |ist of f|iles in |
|00004990| 53 45 54 20 2a 2f 0a 58 | 0a 58 20 20 20 20 20 20 |SET */.X|.X |
|000049a0| 20 20 20 52 75 6e 50 61 | 67 65 72 28 50 61 67 65 | RunPa|ger(Page|
|000049b0| 72 2c 20 24 32 29 20 3b | 0a 58 20 20 20 20 20 20 |r, $2) ;|.X |
|000049c0| 7d 0a 58 7c 20 20 53 45 | 54 53 0a 58 20 20 20 20 |}.X| SE|TS.X |
|000049d0| 20 20 7b 0a 58 20 20 20 | 20 20 20 20 20 20 2f 2a | {.X | /*|
|000049e0| 20 64 65 73 63 72 69 62 | 65 20 73 65 74 73 20 63 | describ|e sets c|
|000049f0| 72 65 61 74 65 64 20 73 | 6f 20 66 61 72 20 2a 2f |reated s|o far */|
|00004a00| 0a 58 0a 58 20 20 20 20 | 20 20 20 20 20 44 65 73 |.X.X | Des|
|00004a10| 63 72 69 62 65 53 65 74 | 73 28 29 20 3b 0a 58 20 |cribeSet|s() ;.X |
|00004a20| 20 20 20 20 20 7d 0a 58 | 7c 20 20 48 45 4c 50 0a | }.X|| HELP.|
|00004a30| 58 20 20 20 20 20 20 7b | 0a 58 20 20 20 20 20 20 |X {|.X |
|00004a40| 20 20 20 2f 2a 20 72 75 | 6e 20 50 41 47 45 52 20 | /* ru|n PAGER |
|00004a50| 6f 6e 20 74 68 65 20 68 | 65 6c 70 20 66 69 6c 65 |on the h|elp file|
|00004a60| 20 2a 2f 0a 58 0a 58 20 | 20 20 20 20 20 20 20 20 | */.X.X | |
|00004a70| 52 75 6e 50 61 67 65 72 | 28 50 61 67 65 72 2c 20 |RunPager|(Pager, |
|00004a80| 48 65 6c 70 53 65 74 29 | 20 3b 0a 58 20 20 20 20 |HelpSet)| ;.X |
|00004a90| 20 20 7d 0a 58 7c 20 20 | 4f 46 46 0a 58 20 20 20 | }.X| |OFF.X |
|00004aa0| 20 20 20 7b 0a 58 20 20 | 20 20 20 20 20 20 20 65 | {.X | e|
|00004ab0| 78 69 74 28 30 29 20 3b | 0a 58 20 20 20 20 20 20 |xit(0) ;|.X |
|00004ac0| 7d 0a 58 7c 20 53 48 45 | 4c 4c 5f 51 55 45 52 59 |}.X| SHE|LL_QUERY|
|00004ad0| 20 43 6f 6d 6d 61 6e 64 | 5f 6c 69 73 74 0a 58 20 | Command|_list.X |
|00004ae0| 20 20 20 20 20 7b 0a 58 | 20 20 20 20 20 20 20 20 | {.X| |
|00004af0| 20 2f 2a 20 72 75 6e 20 | 74 68 65 20 73 68 65 6c | /* run |the shel|
|00004b00| 6c 20 63 6f 6d 6d 61 6e | 64 20 61 6e 64 20 65 61 |l comman|d and ea|
|00004b10| 74 20 74 68 65 20 72 65 | 73 75 6c 74 73 20 61 73 |t the re|sults as|
|00004b20| 20 61 20 66 69 6c 65 20 | 73 65 74 20 2a 2f 0a 58 | a file |set */.X|
|00004b30| 0a 58 20 20 20 20 20 20 | 20 20 20 4f 6e 65 44 65 |.X | OneDe|
|00004b40| 73 63 72 69 70 74 69 6f | 6e 28 52 75 6e 50 72 6f |scriptio|n(RunPro|
|00004b50| 67 28 24 31 2d 3e 69 64 | 2c 20 24 32 29 29 20 3b |g($1->id|, $2)) ;|
|00004b60| 0a 58 20 20 20 20 20 20 | 20 20 20 66 72 65 65 28 |.X | free(|
|00004b70| 24 31 29 20 3b 0a 58 20 | 20 20 20 20 20 7d 0a 58 |$1) ;.X | }.X|
|00004b80| 7c 20 53 48 45 4c 4c 5f | 43 4f 4d 4d 41 4e 44 20 || SHELL_|COMMAND |
|00004b90| 43 6f 6d 6d 61 6e 64 5f | 6c 69 73 74 0a 58 20 20 |Command_|list.X |
|00004ba0| 20 20 20 20 7b 0a 58 20 | 20 20 20 20 20 20 20 20 | {.X | |
|00004bb0| 2f 2a 20 72 75 6e 20 74 | 68 65 20 73 68 65 6c 6c |/* run t|he shell|
|00004bc0| 20 63 6f 6d 6d 61 6e 64 | 20 2a 2f 0a 58 0a 58 20 | command| */.X.X |
|00004bd0| 20 20 20 20 20 20 20 20 | 52 75 6e 53 68 65 6c 6c | |RunShell|
|00004be0| 28 24 31 2d 3e 69 64 2c | 20 24 32 29 20 3b 0a 58 |($1->id,| $2) ;.X|
|00004bf0| 20 20 20 20 20 20 20 20 | 20 66 72 65 65 28 24 31 | | free($1|
|00004c00| 29 20 3b 0a 58 20 20 20 | 20 20 20 7d 0a 58 3b 0a |) ;.X | }.X;.|
|00004c10| 58 0a 58 53 65 74 5f 71 | 75 65 72 79 20 3a 0a 58 |X.XSet_q|uery :.X|
|00004c20| 20 20 20 53 53 0a 58 20 | 20 20 20 20 20 7b 0a 58 | SS.X | {.X|
|00004c30| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 54 75 72 6e | | /* Turn|
|00004c40| 20 6f 6e 20 76 65 72 62 | 6f 73 65 20 71 75 65 72 | on verb|ose quer|
|00004c50| 79 20 66 6c 61 67 20 2a | 2f 0a 58 0a 58 20 20 20 |y flag *|/.X.X |
|00004c60| 20 20 20 20 20 20 56 65 | 72 62 6f 73 65 51 75 65 | Ve|rboseQue|
|00004c70| 72 79 20 3d 20 54 52 55 | 45 20 3b 0a 58 20 20 20 |ry = TRU|E ;.X |
|00004c80| 20 20 20 7d 0a 58 3b 0a | 58 0a 58 46 69 6c 65 5f | }.X;.|X.XFile_|
|00004c90| 71 75 65 72 79 20 3a 0a | 58 20 20 20 46 49 4c 45 |query :.|X FILE|
|00004ca0| 53 0a 58 20 20 20 20 20 | 20 7b 0a 58 20 20 20 20 |S.X | {.X |
|00004cb0| 20 20 20 20 20 2f 2a 20 | 54 75 72 6e 20 6f 66 66 | /* |Turn off|
|00004cc0| 20 76 65 72 62 6f 73 65 | 20 71 75 65 72 79 20 66 | verbose| query f|
|00004cd0| 6c 61 67 20 2a 2f 0a 58 | 0a 58 20 20 20 20 20 20 |lag */.X|.X |
|00004ce0| 20 20 20 56 65 72 62 6f | 73 65 51 75 65 72 79 20 | Verbo|seQuery |
|00004cf0| 3d 20 46 41 4c 53 45 20 | 3b 0a 58 20 20 20 20 20 |= FALSE |;.X |
|00004d00| 20 7d 0a 58 3b 0a 58 0a | 58 51 75 65 72 79 20 3a | }.X;.X.|XQuery :|
|00004d10| 0a 58 20 20 20 50 72 69 | 6d 69 74 69 76 65 0a 58 |.X Pri|mitive.X|
|00004d20| 20 20 20 20 20 20 7b 0a | 58 20 20 20 20 20 20 20 | {.|X |
|00004d30| 20 20 2f 2a 20 76 61 6c | 75 65 20 6f 66 20 71 75 | /* val|ue of qu|
|00004d40| 65 72 79 20 69 73 20 73 | 65 74 20 61 73 73 6f 63 |ery is s|et assoc|
|00004d50| 69 61 74 65 64 20 77 69 | 74 68 20 70 72 69 6d 69 |iated wi|th primi|
|00004d60| 74 69 76 65 20 2a 2f 0a | 58 0a 58 20 20 20 20 20 |tive */.|X.X |
|00004d70| 20 20 20 20 24 24 20 3d | 20 24 31 20 3b 0a 58 20 | $$ =| $1 ;.X |
|00004d80| 20 20 20 20 20 7d 0a 58 | 7c 20 20 51 75 65 72 79 | }.X|| Query|
|00004d90| 20 41 4e 44 20 51 75 65 | 72 79 0a 58 20 20 20 20 | AND Que|ry.X |
|00004da0| 20 20 7b 0a 58 20 20 20 | 20 20 20 20 20 20 2f 2a | {.X | /*|
|00004db0| 20 76 61 6c 75 65 20 6f | 66 20 71 75 65 72 79 20 | value o|f query |
|00004dc0| 69 73 20 69 6e 74 65 72 | 73 65 63 74 69 6f 6e 20 |is inter|section |
|00004dd0| 6f 66 20 74 68 65 20 74 | 77 6f 20 71 75 65 72 79 |of the t|wo query|
|00004de0| 20 73 65 74 73 20 2a 2f | 0a 58 0a 58 20 20 20 20 | sets */|.X.X |
|00004df0| 20 20 20 20 20 24 24 20 | 3d 20 53 65 74 49 6e 74 | $$ |= SetInt|
|00004e00| 65 72 73 65 63 74 28 24 | 31 2c 20 24 33 29 20 3b |ersect($|1, $3) ;|
|00004e10| 0a 58 20 20 20 20 20 20 | 20 20 20 69 66 20 28 56 |.X | if (V|
|00004e20| 65 72 62 6f 73 65 51 75 | 65 72 79 29 20 7b 0a 58 |erboseQu|ery) {.X|
|00004e30| 20 20 20 20 20 20 20 20 | 20 20 20 20 4f 6e 65 44 | | OneD|
|00004e40| 65 73 63 72 69 70 74 69 | 6f 6e 28 24 24 29 20 3b |escripti|on($$) ;|
|00004e50| 0a 58 20 20 20 20 20 20 | 20 20 20 7d 0a 58 20 20 |.X | }.X |
|00004e60| 20 20 20 20 7d 0a 58 7c | 20 20 51 75 65 72 79 20 | }.X|| Query |
|00004e70| 4f 52 20 51 75 65 72 79 | 0a 58 20 20 20 20 20 20 |OR Query|.X |
|00004e80| 7b 0a 58 20 20 20 20 20 | 20 20 20 20 2f 2a 20 76 |{.X | /* v|
|00004e90| 61 6c 75 65 20 6f 66 20 | 71 75 65 72 79 20 69 73 |alue of |query is|
|00004ea0| 20 75 6e 69 6f 6e 20 6f | 66 20 74 68 65 20 74 77 | union o|f the tw|
|00004eb0| 6f 20 71 75 65 72 79 20 | 73 65 74 73 20 2a 2f 0a |o query |sets */.|
|00004ec0| 58 0a 58 20 20 20 20 20 | 20 20 20 20 24 24 20 3d |X.X | $$ =|
|00004ed0| 20 53 65 74 55 6e 69 6f | 6e 28 24 31 2c 20 24 33 | SetUnio|n($1, $3|
|00004ee0| 29 20 3b 0a 58 20 20 20 | 20 20 20 20 20 20 69 66 |) ;.X | if|
|00004ef0| 20 28 56 65 72 62 6f 73 | 65 51 75 65 72 79 29 20 | (Verbos|eQuery) |
|00004f00| 7b 0a 58 20 20 20 20 20 | 20 20 20 20 20 20 20 4f |{.X | O|
|00004f10| 6e 65 44 65 73 63 72 69 | 70 74 69 6f 6e 28 24 24 |neDescri|ption($$|
|00004f20| 29 20 3b 0a 58 20 20 20 | 20 20 20 20 20 20 7d 0a |) ;.X | }.|
|00004f30| 58 20 20 20 20 20 20 7d | 0a 58 7c 20 20 4e 4f 54 |X }|.X| NOT|
|00004f40| 20 51 75 65 72 79 0a 58 | 20 20 20 20 20 20 7b 0a | Query.X| {.|
|00004f50| 58 20 20 20 20 20 20 20 | 20 20 2f 2a 20 76 61 6c |X | /* val|
|00004f60| 75 65 20 6f 66 20 71 75 | 65 72 79 20 69 73 20 69 |ue of qu|ery is i|
|00004f70| 6e 76 65 72 73 65 20 6f | 66 20 6f 74 68 65 72 20 |nverse o|f other |
|00004f80| 71 75 65 72 79 20 2a 2f | 0a 58 20 20 20 20 20 20 |query */|.X |
|00004f90| 20 20 20 0a 58 20 20 20 | 20 20 20 20 20 20 24 24 | .X | $$|
|00004fa0| 20 3d 20 53 65 74 49 6e | 76 65 72 73 65 28 24 32 | = SetIn|verse($2|
|00004fb0| 29 20 3b 0a 58 20 20 20 | 20 20 20 20 20 20 69 66 |) ;.X | if|
|00004fc0| 20 28 56 65 72 62 6f 73 | 65 51 75 65 72 79 29 20 | (Verbos|eQuery) |
|00004fd0| 7b 0a 58 20 20 20 20 20 | 20 20 20 20 20 20 20 4f |{.X | O|
|00004fe0| 6e 65 44 65 73 63 72 69 | 70 74 69 6f 6e 28 24 24 |neDescri|ption($$|
|00004ff0| 29 20 3b 0a 58 20 20 20 | 20 20 20 20 20 20 7d 0a |) ;.X | }.|
|00005000| 58 20 20 20 20 20 20 7d | 0a 58 3b 0a 58 0a 58 50 |X }|.X;.X.XP|
|00005010| 72 69 6d 69 74 69 76 65 | 20 3a 0a 58 20 20 20 53 |rimitive| :.X S|
|00005020| 45 54 0a 58 20 20 20 20 | 20 20 7b 0a 58 20 20 20 |ET.X | {.X |
|00005030| 20 20 20 20 20 20 2f 2a | 20 56 61 6c 75 65 20 6f | /*| Value o|
|00005040| 66 20 70 72 69 6d 69 74 | 69 76 65 20 69 73 20 76 |f primit|ive is v|
|00005050| 61 6c 75 65 20 6f 66 20 | 72 65 63 6f 72 64 65 64 |alue of |recorded|
|00005060| 20 73 65 74 20 2a 2f 0a | 58 0a 58 20 20 20 20 20 | set */.|X.X |
|00005070| 20 20 20 20 24 24 20 3d | 20 24 31 20 3b 0a 58 20 | $$ =| $1 ;.X |
|00005080| 20 20 20 20 20 7d 0a 58 | 7c 20 20 4c 69 64 5f 67 | }.X|| Lid_g|
|00005090| 72 6f 75 70 0a 58 20 20 | 20 20 20 20 7b 0a 58 20 |roup.X | {.X |
|000050a0| 20 20 20 20 20 20 20 20 | 2f 2a 20 56 61 6c 75 65 | |/* Value|
|000050b0| 20 6f 66 20 70 72 69 6d | 69 74 69 76 65 20 69 73 | of prim|itive is|
|000050c0| 20 6f 62 74 61 69 6e 65 | 64 20 62 79 20 72 75 6e | obtaine|d by run|
|000050d0| 6e 69 6e 67 20 61 6e 20 | 6c 69 64 20 71 75 65 72 |ning an |lid quer|
|000050e0| 79 20 2a 2f 0a 58 0a 58 | 20 20 20 20 20 20 20 20 |y */.X.X| |
|000050f0| 20 24 24 20 3d 20 52 75 | 6e 50 72 6f 67 28 4c 69 | $$ = Ru|nProg(Li|
|00005100| 64 43 6f 6d 6d 61 6e 64 | 2c 20 24 31 29 20 3b 0a |dCommand|, $1) ;.|
|00005110| 58 20 20 20 20 20 20 20 | 20 20 69 66 20 28 56 65 |X | if (Ve|
|00005120| 72 62 6f 73 65 51 75 65 | 72 79 29 20 7b 0a 58 20 |rboseQue|ry) {.X |
|00005130| 20 20 20 20 20 20 20 20 | 20 20 20 4f 6e 65 44 65 | | OneDe|
|00005140| 73 63 72 69 70 74 69 6f | 6e 28 24 24 29 20 3b 0a |scriptio|n($$) ;.|
|00005150| 58 20 20 20 20 20 20 20 | 20 20 7d 0a 58 20 20 20 |X | }.X |
|00005160| 20 20 20 7d 0a 58 7c 20 | 20 41 69 64 5f 67 72 6f | }.X| | Aid_gro|
|00005170| 75 70 0a 58 20 20 20 20 | 20 20 7b 0a 58 20 20 20 |up.X | {.X |
|00005180| 20 20 20 20 20 20 2f 2a | 20 56 61 6c 75 65 20 6f | /*| Value o|
|00005190| 66 20 70 72 69 6d 69 74 | 69 76 65 20 69 73 20 6f |f primit|ive is o|
|000051a0| 62 74 61 69 6e 65 64 20 | 62 79 20 72 75 6e 6e 69 |btained |by runni|
|000051b0| 6e 67 20 61 6e 20 61 69 | 64 20 71 75 65 72 79 20 |ng an ai|d query |
|000051c0| 2a 2f 0a 58 0a 58 20 20 | 20 20 20 20 20 20 20 24 |*/.X.X | $|
|000051d0| 24 20 3d 20 52 75 6e 50 | 72 6f 67 28 22 61 69 64 |$ = RunP|rog("aid|
|000051e0| 20 2d 6b 6d 6e 22 2c 20 | 24 31 29 20 3b 0a 58 20 | -kmn", |$1) ;.X |
|000051f0| 20 20 20 20 20 20 20 20 | 69 66 20 28 56 65 72 62 | |if (Verb|
|00005200| 6f 73 65 51 75 65 72 79 | 29 20 7b 0a 58 20 20 20 |oseQuery|) {.X |
|00005210| 20 20 20 20 20 20 20 20 | 20 4f 6e 65 44 65 73 63 | | OneDesc|
|00005220| 72 69 70 74 69 6f 6e 28 | 24 24 29 20 3b 0a 58 20 |ription(|$$) ;.X |
|00005230| 20 20 20 20 20 20 20 20 | 7d 0a 58 20 20 20 20 20 | |}.X |
|00005240| 20 7d 0a 58 7c 20 20 4d | 41 54 43 48 20 49 64 5f | }.X| M|ATCH Id_|
|00005250| 6c 69 73 74 0a 58 20 20 | 20 20 20 20 7b 0a 58 20 |list.X | {.X |
|00005260| 20 20 20 20 20 20 20 20 | 2f 2a 20 4d 61 74 63 68 | |/* Match|
|00005270| 20 6e 61 6d 65 73 20 66 | 72 6f 6d 20 64 61 74 61 | names f|rom data|
|00005280| 62 61 73 65 20 61 67 61 | 69 6e 73 74 20 70 61 74 |base aga|inst pat|
|00005290| 74 65 72 6e 20 2a 2f 0a | 58 20 20 20 20 20 20 20 |tern */.|X |
|000052a0| 20 20 24 24 20 3d 20 52 | 75 6e 50 72 6f 67 28 22 | $$ = R|unProg("|
|000052b0| 70 69 64 20 2d 6b 6d 6e | 22 2c 20 24 32 29 20 3b |pid -kmn|", $2) ;|
|000052c0| 0a 58 20 20 20 20 20 20 | 20 20 20 69 66 20 28 56 |.X | if (V|
|000052d0| 65 72 62 6f 73 65 51 75 | 65 72 79 29 20 7b 0a 58 |erboseQu|ery) {.X|
|000052e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 4f 6e 65 44 | | OneD|
|000052f0| 65 73 63 72 69 70 74 69 | 6f 6e 28 24 24 29 20 3b |escripti|on($$) ;|
|00005300| 0a 58 20 20 20 20 20 20 | 20 20 20 7d 0a 58 20 20 |.X | }.X |
|00005310| 20 20 20 20 7d 0a 58 7c | 20 20 27 28 27 20 51 75 | }.X|| '(' Qu|
|00005320| 65 72 79 20 27 29 27 0a | 58 20 20 20 20 20 20 7b |ery ')'.|X {|
|00005330| 0a 58 20 20 20 20 20 20 | 20 20 20 2f 2a 20 76 61 |.X | /* va|
|00005340| 6c 75 65 20 6f 66 20 70 | 72 69 6d 69 74 69 76 65 |lue of p|rimitive|
|00005350| 20 69 73 20 76 61 6c 75 | 65 20 6f 66 20 71 75 65 | is valu|e of que|
|00005360| 72 79 20 2a 2f 0a 58 0a | 58 20 20 20 20 20 20 20 |ry */.X.|X |
|00005370| 20 20 24 24 20 3d 20 24 | 32 20 3b 0a 58 20 20 20 | $$ = $|2 ;.X |
|00005380| 20 20 20 7d 0a 58 3b 0a | 58 0a 58 4c 69 64 5f 67 | }.X;.|X.XLid_g|
|00005390| 72 6f 75 70 20 3a 0a 58 | 20 20 20 49 44 0a 58 20 |roup :.X| ID.X |
|000053a0| 20 20 20 20 20 7b 0a 58 | 20 20 20 20 20 20 20 20 | {.X| |
|000053b0| 20 2f 2a 20 6d 61 6b 65 | 20 61 72 67 20 6c 69 73 | /* make| arg lis|
|000053c0| 74 20 68 6f 6c 64 69 6e | 67 20 73 69 6e 67 6c 65 |t holdin|g single|
|000053d0| 20 49 44 20 2a 2f 0a 58 | 0a 58 20 20 20 20 20 20 | ID */.X|.X |
|000053e0| 20 20 20 24 24 20 3d 20 | 49 6e 69 74 4c 69 73 74 | $$ = |InitList|
|000053f0| 28 29 20 3b 0a 58 20 20 | 20 20 20 20 20 20 20 24 |() ;.X | $|
|00005400| 24 20 3d 20 45 78 74 65 | 6e 64 4c 69 73 74 28 24 |$ = Exte|ndList($|
|00005410| 24 2c 20 24 31 29 20 3b | 0a 58 20 20 20 20 20 20 |$, $1) ;|.X |
|00005420| 20 20 20 4c 69 64 43 6f | 6d 6d 61 6e 64 20 3d 20 | LidCo|mmand = |
|00005430| 44 65 66 61 75 6c 74 43 | 6f 6d 6d 61 6e 64 20 3b |DefaultC|ommand ;|
|00005440| 0a 58 20 20 20 20 20 20 | 7d 0a 58 7c 20 20 4c 49 |.X |}.X| LI|
|00005450| 44 20 49 64 5f 6c 69 73 | 74 0a 58 20 20 20 20 20 |D Id_lis|t.X |
|00005460| 20 7b 0a 58 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | {.X | /* |
|00005470| 61 72 67 20 6c 69 73 74 | 20 69 73 20 49 64 5f 6c |arg list| is Id_l|
|00005480| 69 73 74 20 2a 2f 0a 58 | 0a 58 20 20 20 20 20 20 |ist */.X|.X |
|00005490| 20 20 20 24 24 20 3d 20 | 24 32 20 3b 0a 58 20 20 | $$ = |$2 ;.X |
|000054a0| 20 20 20 20 20 20 20 4c | 69 64 43 6f 6d 6d 61 6e | L|idComman|
|000054b0| 64 20 3d 20 22 6c 69 64 | 20 2d 6b 6d 6e 22 20 3b |d = "lid| -kmn" ;|
|000054c0| 0a 58 20 20 20 20 20 20 | 7d 0a 58 3b 0a 58 0a 58 |.X |}.X;.X.X|
|000054d0| 41 69 64 5f 67 72 6f 75 | 70 20 3a 0a 58 20 20 20 |Aid_grou|p :.X |
|000054e0| 41 49 44 20 49 64 5f 6c | 69 73 74 0a 58 20 20 20 |AID Id_l|ist.X |
|000054f0| 20 20 20 7b 0a 58 20 20 | 20 20 20 20 20 20 20 2f | {.X | /|
|00005500| 2a 20 61 72 67 20 6c 69 | 73 74 20 69 73 20 49 64 |* arg li|st is Id|
|00005510| 5f 6c 69 73 74 20 2a 2f | 0a 58 0a 58 20 20 20 20 |_list */|.X.X |
|00005520| 20 20 20 20 20 24 24 20 | 3d 20 24 32 20 3b 0a 58 | $$ |= $2 ;.X|
|00005530| 20 20 20 20 20 20 7d 0a | 58 3b 0a 58 0a 58 43 6f | }.|X;.X.XCo|
|00005540| 6d 6d 61 6e 64 5f 6c 69 | 73 74 20 3a 0a 58 20 20 |mmand_li|st :.X |
|00005550| 20 49 44 0a 58 20 20 20 | 20 20 20 7b 0a 58 20 20 | ID.X | {.X |
|00005560| 20 20 20 20 20 20 20 2f | 2a 20 6d 61 6b 65 20 61 | /|* make a|
|00005570| 72 67 20 6c 69 73 74 20 | 68 6f 6c 64 69 6e 67 20 |rg list |holding |
|00005580| 73 69 6e 67 6c 65 20 49 | 44 20 2a 2f 0a 58 0a 58 |single I|D */.X.X|
|00005590| 20 20 20 20 20 20 20 20 | 20 24 24 20 3d 20 49 6e | | $$ = In|
|000055a0| 69 74 4c 69 73 74 28 29 | 20 3b 0a 58 20 20 20 20 |itList()| ;.X |
|000055b0| 20 20 20 20 20 24 24 20 | 3d 20 45 78 74 65 6e 64 | $$ |= Extend|
|000055c0| 4c 69 73 74 28 24 24 2c | 20 24 31 29 20 3b 0a 58 |List($$,| $1) ;.X|
|000055d0| 20 20 20 20 20 20 7d 0a | 58 7c 20 20 53 45 54 0a | }.|X| SET.|
|000055e0| 58 20 20 20 20 20 20 7b | 0a 58 20 20 20 20 20 20 |X {|.X |
|000055f0| 20 20 20 2f 2a 20 6d 61 | 6b 65 20 61 72 67 20 6c | /* ma|ke arg l|
|00005600| 69 73 74 20 68 6f 6c 64 | 69 6e 67 20 6e 61 6d 65 |ist hold|ing name|
|00005610| 73 20 66 72 6f 6d 20 73 | 65 74 20 2a 2f 0a 58 0a |s from s|et */.X.|
|00005620| 58 20 20 20 20 20 20 20 | 20 20 24 24 20 3d 20 49 |X | $$ = I|
|00005630| 6e 69 74 4c 69 73 74 28 | 29 20 3b 0a 58 20 20 20 |nitList(|) ;.X |
|00005640| 20 20 20 20 20 20 24 24 | 20 3d 20 53 65 74 4c 69 | $$| = SetLi|
|00005650| 73 74 28 24 24 2c 20 24 | 31 29 20 3b 0a 58 20 20 |st($$, $|1) ;.X |
|00005660| 20 20 20 20 7d 0a 58 7c | 20 20 43 6f 6d 6d 61 6e | }.X|| Comman|
|00005670| 64 5f 6c 69 73 74 20 49 | 44 0a 58 20 20 20 20 20 |d_list I|D.X |
|00005680| 20 7b 0a 58 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | {.X | /* |
|00005690| 65 78 74 65 6e 64 20 61 | 72 67 20 6c 69 73 74 20 |extend a|rg list |
|000056a0| 77 69 74 68 20 61 64 64 | 69 74 69 6f 6e 61 6c 20 |with add|itional |
|000056b0| 49 44 20 2a 2f 0a 58 0a | 58 20 20 20 20 20 20 20 |ID */.X.|X |
|000056c0| 20 20 24 24 20 3d 20 45 | 78 74 65 6e 64 4c 69 73 | $$ = E|xtendLis|
|000056d0| 74 28 24 31 2c 20 24 32 | 29 20 3b 0a 58 20 20 20 |t($1, $2|) ;.X |
|000056e0| 20 20 20 7d 0a 58 7c 20 | 20 43 6f 6d 6d 61 6e 64 | }.X| | Command|
|000056f0| 5f 6c 69 73 74 20 53 45 | 54 0a 58 20 20 20 20 20 |_list SE|T.X |
|00005700| 20 7b 0a 58 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | {.X | /* |
|00005710| 65 78 74 65 6e 64 20 61 | 72 67 20 6c 69 73 74 20 |extend a|rg list |
|00005720| 77 69 74 68 20 61 64 64 | 69 74 69 6f 6e 61 6c 20 |with add|itional |
|00005730| 66 69 6c 65 20 6e 61 6d | 65 73 20 2a 2f 0a 58 0a |file nam|es */.X.|
|00005740| 58 20 20 20 20 20 20 20 | 20 20 24 24 20 3d 20 53 |X | $$ = S|
|00005750| 65 74 4c 69 73 74 28 24 | 31 2c 20 24 32 29 20 3b |etList($|1, $2) ;|
|00005760| 0a 58 20 20 20 20 20 20 | 7d 0a 58 3b 0a 58 0a 58 |.X |}.X;.X.X|
|00005770| 49 64 5f 6c 69 73 74 20 | 3a 0a 58 20 20 20 49 44 |Id_list |:.X ID|
|00005780| 0a 58 20 20 20 20 20 20 | 7b 0a 58 20 20 20 20 20 |.X |{.X |
|00005790| 20 20 20 20 2f 2a 20 6d | 61 6b 65 20 61 72 67 20 | /* m|ake arg |
|000057a0| 6c 69 73 74 20 68 6f 6c | 64 69 6e 67 20 73 69 6e |list hol|ding sin|
|000057b0| 67 6c 65 20 49 44 20 2a | 2f 0a 58 0a 58 20 20 20 |gle ID *|/.X.X |
|000057c0| 20 20 20 20 20 20 24 24 | 20 3d 20 49 6e 69 74 4c | $$| = InitL|
|000057d0| 69 73 74 28 29 20 3b 0a | 58 20 20 20 20 20 20 20 |ist() ;.|X |
|000057e0| 20 20 24 24 20 3d 20 45 | 78 74 65 6e 64 4c 69 73 | $$ = E|xtendLis|
|000057f0| 74 28 24 24 2c 20 24 31 | 29 20 3b 0a 58 20 20 20 |t($$, $1|) ;.X |
|00005800| 20 20 20 7d 0a 58 7c 20 | 20 49 64 5f 6c 69 73 74 | }.X| | Id_list|
|00005810| 20 49 44 0a 58 20 20 20 | 20 20 20 7b 0a 58 20 20 | ID.X | {.X |
|00005820| 20 20 20 20 20 20 20 2f | 2a 20 65 78 74 65 6e 64 | /|* extend|
|00005830| 20 61 72 67 20 6c 69 73 | 74 20 77 69 74 68 20 61 | arg lis|t with a|
|00005840| 64 64 69 74 69 6f 6e 61 | 6c 20 49 44 20 2a 2f 0a |dditiona|l ID */.|
|00005850| 58 0a 58 20 20 20 20 20 | 20 20 20 20 24 24 20 3d |X.X | $$ =|
|00005860| 20 45 78 74 65 6e 64 4c | 69 73 74 28 24 31 2c 20 | ExtendL|ist($1, |
|00005870| 24 32 29 20 3b 0a 58 20 | 20 20 20 20 20 7d 0a 58 |$2) ;.X | }.X|
|00005880| 3b 0a 58 0a 58 25 25 0a | 58 0a 58 2f 2a 20 53 63 |;.X.X%%.|X.X/* Sc|
|00005890| 61 6e 4c 69 6e 65 20 2d | 20 61 20 67 6c 6f 62 61 |anLine -| a globa|
|000058a0| 6c 20 76 61 72 69 61 62 | 6c 65 20 68 6f 6c 64 69 |l variab|le holdi|
|000058b0| 6e 67 20 61 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 |ng a poi|nter to |
|000058c0| 74 68 65 20 63 75 72 72 | 65 6e 74 0a 58 20 2a 20 |the curr|ent.X * |
|000058d0| 63 6f 6d 6d 61 6e 64 20 | 62 65 69 6e 67 20 73 63 |command |being sc|
|000058e0| 61 6e 6e 65 64 2e 0a 58 | 20 2a 2f 0a 58 63 68 61 |anned..X| */.Xcha|
|000058f0| 72 20 2a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |r * | |
|00005900| 53 63 61 6e 4c 69 6e 65 | 20 3b 0a 58 0a 58 2f 2a |ScanLine| ;.X.X/*|
|00005910| 20 53 63 61 6e 50 74 72 | 20 2d 20 61 20 67 6c 6f | ScanPtr| - a glo|
|00005920| 62 61 6c 20 70 6f 69 6e | 74 65 72 20 74 6f 20 74 |bal poin|ter to t|
|00005930| 68 65 20 63 75 72 72 65 | 6e 74 20 73 63 61 6e 20 |he curre|nt scan |
|00005940| 70 6f 73 69 74 69 6f 6e | 20 69 6e 20 53 63 61 6e |position| in Scan|
|00005950| 4c 69 6e 65 2e 0a 58 20 | 2a 2f 0a 58 63 68 61 72 |Line..X |*/.Xchar|
|00005960| 20 2a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 53 | * | S|
|00005970| 63 61 6e 50 74 72 20 3b | 0a 58 0a 58 2f 2a 20 79 |canPtr ;|.X.X/* y|
|00005980| 79 74 65 78 74 20 2d 20 | 62 75 66 66 65 72 20 68 |ytext - |buffer h|
|00005990| 6f 6c 64 69 6e 67 20 74 | 68 65 20 74 6f 6b 65 6e |olding t|he token|
|000059a0| 2e 0a 58 20 2a 2f 0a 58 | 63 68 61 72 20 20 20 20 |..X */.X|char |
|000059b0| 20 20 20 20 20 20 20 20 | 20 20 20 79 79 74 65 78 | | yytex|
|000059c0| 74 20 5b 20 4d 41 58 43 | 4d 44 20 5d 20 3b 0a 58 |t [ MAXC|MD ] ;.X|
|000059d0| 0a 58 2f 2a 20 79 79 65 | 72 72 6f 72 20 2d 20 70 |.X/* yye|rror - p|
|000059e0| 72 6f 63 65 73 73 20 73 | 79 6e 74 61 78 20 65 72 |rocess s|yntax er|
|000059f0| 72 6f 72 73 2e 0a 58 20 | 2a 2f 0a 58 69 6e 74 0a |rors..X |*/.Xint.|
|00005a00| 58 79 79 65 72 72 6f 72 | 28 73 29 0a 58 20 20 20 |Xyyerror|(s).X |
|00005a10| 63 68 61 72 20 2a 20 20 | 20 20 20 73 20 3b 0a 58 |char * | s ;.X|
|00005a20| 7b 0a 58 20 20 20 69 66 | 20 28 2a 53 63 61 6e 50 |{.X if| (*ScanP|
|00005a30| 74 72 20 3d 3d 20 27 5c | 30 27 29 20 7b 0a 58 20 |tr == '\|0') {.X |
|00005a40| 20 20 20 20 20 66 70 72 | 69 6e 74 66 28 73 74 64 | fpr|intf(std|
|00005a50| 65 72 72 2c 22 53 79 6e | 74 61 78 20 65 72 72 6f |err,"Syn|tax erro|
|00005a60| 72 20 6e 65 61 72 20 65 | 6e 64 20 6f 66 20 63 6f |r near e|nd of co|
|00005a70| 6d 6d 61 6e 64 2e 5c 6e | 22 29 20 3b 0a 58 20 20 |mmand.\n|") ;.X |
|00005a80| 20 7d 20 65 6c 73 65 20 | 7b 0a 58 20 20 20 20 20 | } else |{.X |
|00005a90| 20 66 70 72 69 6e 74 66 | 28 73 74 64 65 72 72 2c | fprintf|(stderr,|
|00005aa0| 22 53 79 6e 74 61 78 20 | 65 72 72 6f 72 20 6f 6e |"Syntax |error on|
|00005ab0| 20 6f 72 20 62 65 66 6f | 72 65 20 25 73 5c 6e 22 | or befo|re %s\n"|
|00005ac0| 2c 53 63 61 6e 50 74 72 | 29 20 3b 0a 58 20 20 20 |,ScanPtr|) ;.X |
|00005ad0| 7d 0a 58 20 20 20 72 65 | 74 75 72 6e 28 30 29 20 |}.X re|turn(0) |
|00005ae0| 3b 0a 58 7d 0a 58 0a 58 | 2f 2a 20 53 63 61 6e 49 |;.X}.X.X|/* ScanI|
|00005af0| 6e 69 74 20 2d 20 69 6e | 69 74 69 61 6c 69 7a 65 |nit - in|itialize|
|00005b00| 20 74 68 65 20 79 79 6c | 65 78 20 72 6f 75 74 69 | the yyl|ex routi|
|00005b10| 6e 65 20 66 6f 72 20 74 | 68 65 20 6e 65 77 20 6c |ne for t|he new l|
|00005b20| 69 6e 65 20 6f 66 20 69 | 6e 70 75 74 2e 0a 58 20 |ine of i|nput..X |
|00005b30| 2a 20 42 61 73 69 63 61 | 6c 6c 79 20 6a 75 73 74 |* Basica|lly just|
|00005b40| 20 69 6e 69 74 69 61 6c | 69 7a 65 73 20 74 68 65 | initial|izes the|
|00005b50| 20 67 6c 6f 62 61 6c 20 | 76 61 72 69 61 62 6c 65 | global |variable|
|00005b60| 73 20 74 68 61 74 20 68 | 6f 6c 64 20 74 68 65 20 |s that h|old the |
|00005b70| 63 68 61 72 0a 58 20 2a | 20 70 74 72 73 20 74 68 |char.X *| ptrs th|
|00005b80| 65 20 73 63 61 6e 6e 65 | 72 20 75 73 65 73 2e 0a |e scanne|r uses..|
|00005b90| 58 20 2a 2f 0a 58 76 6f | 69 64 0a 58 53 63 61 6e |X */.Xvo|id.XScan|
|00005ba0| 49 6e 69 74 28 6c 69 6e | 65 29 0a 58 20 20 20 63 |Init(lin|e).X c|
|00005bb0| 68 61 72 20 2a 20 20 20 | 20 6c 69 6e 65 20 3b 0a |har * | line ;.|
|00005bc0| 58 7b 0a 58 20 20 20 2f | 2a 20 73 6b 69 70 20 74 |X{.X /|* skip t|
|00005bd0| 68 65 20 6c 65 61 64 69 | 6e 67 20 77 68 69 74 65 |he leadi|ng white|
|00005be0| 20 73 70 61 63 65 20 2d | 20 74 68 65 20 79 79 6c | space -| the yyl|
|00005bf0| 65 78 20 72 6f 75 74 69 | 6e 65 20 69 73 20 73 65 |ex routi|ne is se|
|00005c00| 6e 73 69 74 69 76 65 0a | 58 20 20 20 20 2a 20 74 |nsitive.|X * t|
|00005c10| 6f 20 6b 65 79 77 6f 72 | 64 73 20 69 6e 20 74 68 |o keywor|ds in th|
|00005c20| 65 20 66 69 72 73 74 20 | 70 6f 73 69 74 69 6f 6e |e first |position|
|00005c30| 20 6f 6e 20 74 68 65 20 | 63 6f 6d 6d 61 6e 64 20 | on the |command |
|00005c40| 6c 69 6e 65 2e 0a 58 20 | 20 20 20 2a 2f 0a 58 20 |line..X | */.X |
|00005c50| 20 20 0a 58 20 20 20 77 | 68 69 6c 65 20 28 69 73 | .X w|hile (is|
|00005c60| 73 70 61 63 65 28 2a 6c | 69 6e 65 29 29 20 2b 2b |space(*l|ine)) ++|
|00005c70| 6c 69 6e 65 20 3b 0a 58 | 20 20 20 53 63 61 6e 4c |line ;.X| ScanL|
|00005c80| 69 6e 65 20 3d 20 6c 69 | 6e 65 20 3b 0a 58 20 20 |ine = li|ne ;.X |
|00005c90| 20 53 63 61 6e 50 74 72 | 20 3d 20 6c 69 6e 65 20 | ScanPtr| = line |
|00005ca0| 3b 0a 58 7d 0a 58 0a 58 | 2f 2a 20 4e 61 6d 65 45 |;.X}.X.X|/* NameE|
|00005cb0| 71 20 2d 20 63 6f 6d 70 | 61 72 65 20 74 77 6f 20 |q - comp|are two |
|00005cc0| 6e 61 6d 65 73 20 66 6f | 72 20 65 71 75 61 6c 69 |names fo|r equali|
|00005cd0| 74 79 20 69 6e 20 61 20 | 63 61 73 65 20 69 6e 73 |ty in a |case ins|
|00005ce0| 65 6e 73 69 74 69 76 65 | 20 6d 61 6e 6e 65 72 2e |ensitive| manner.|
|00005cf0| 0a 58 20 2a 20 72 65 74 | 75 72 6e 20 54 52 55 45 |.X * ret|urn TRUE|
|00005d00| 20 66 6f 72 20 65 71 75 | 61 6c 2c 20 46 41 4c 53 | for equ|al, FALS|
|00005d10| 45 20 6f 74 68 65 72 77 | 69 73 65 2e 0a 58 20 2a |E otherw|ise..X *|
|00005d20| 2f 0a 58 69 6e 74 0a 58 | 4e 61 6d 65 45 71 28 6e |/.Xint.X|NameEq(n|
|00005d30| 31 2c 6e 32 29 0a 58 20 | 20 20 63 68 61 72 20 2a |1,n2).X | char *|
|00005d40| 20 20 20 20 20 20 6e 31 | 20 3b 0a 58 20 20 20 63 | n1| ;.X c|
|00005d50| 68 61 72 20 2a 20 20 20 | 20 20 20 6e 32 20 3b 0a |har * | n2 ;.|
|00005d60| 58 7b 0a 58 20 20 20 63 | 68 61 72 20 20 20 20 20 |X{.X c|har |
|00005d70| 20 20 20 63 31 20 3b 0a | 58 20 20 20 63 68 61 72 | c1 ;.|X char|
|00005d80| 20 20 20 20 20 20 20 20 | 63 32 20 3b 0a 58 20 20 | |c2 ;.X |
|00005d90| 20 0a 58 20 20 20 66 6f | 72 20 28 20 3b 20 3b 20 | .X fo|r ( ; ; |
|00005da0| 29 20 7b 0a 58 20 20 20 | 20 20 20 63 31 20 3d 20 |) {.X | c1 = |
|00005db0| 2a 6e 31 2b 2b 20 3b 0a | 58 20 20 20 20 20 20 63 |*n1++ ;.|X c|
|00005dc0| 32 20 3d 20 2a 6e 32 2b | 2b 20 3b 0a 58 20 20 20 |2 = *n2+|+ ;.X |
|00005dd0| 20 20 20 69 66 20 28 69 | 73 61 6c 70 68 61 28 63 | if (i|salpha(c|
|00005de0| 31 29 29 20 63 31 20 3d | 20 74 6f 6c 6f 77 65 72 |1)) c1 =| tolower|
|00005df0| 28 63 31 29 20 3b 0a 58 | 20 20 20 20 20 20 69 66 |(c1) ;.X| if|
|00005e00| 20 28 69 73 61 6c 70 68 | 61 28 63 32 29 29 20 63 | (isalph|a(c2)) c|
|00005e10| 32 20 3d 20 74 6f 6c 6f | 77 65 72 28 63 32 29 20 |2 = tolo|wer(c2) |
|00005e20| 3b 0a 58 20 20 20 20 20 | 20 69 66 20 28 63 31 20 |;.X | if (c1 |
|00005e30| 21 3d 20 63 32 29 20 72 | 65 74 75 72 6e 20 46 41 |!= c2) r|eturn FA|
|00005e40| 4c 53 45 20 3b 0a 58 20 | 20 20 20 20 20 69 66 20 |LSE ;.X | if |
|00005e50| 28 63 31 20 3d 3d 20 27 | 5c 30 27 29 20 72 65 74 |(c1 == '|\0') ret|
|00005e60| 75 72 6e 20 54 52 55 45 | 20 3b 0a 58 20 20 20 7d |urn TRUE| ;.X }|
|00005e70| 0a 58 7d 0a 58 0a 58 2f | 2a 20 79 79 6c 65 78 20 |.X}.X.X/|* yylex |
|00005e80| 2d 20 74 68 65 20 73 63 | 61 6e 6e 65 72 20 66 6f |- the sc|anner fo|
|00005e90| 72 20 69 69 64 2e 20 42 | 61 73 69 63 61 6c 6c 79 |r iid. B|asically|
|00005ea0| 20 61 20 6b 6c 75 64 67 | 65 20 61 64 2d 68 6f 63 | a kludg|e ad-hoc|
|00005eb0| 20 70 69 65 63 65 20 6f | 66 20 6a 75 6e 6b 2c 0a | piece o|f junk,.|
|00005ec0| 58 20 2a 20 62 75 74 20 | 77 68 61 74 20 74 68 65 |X * but |what the|
|00005ed0| 20 68 65 63 6b 2c 20 69 | 66 20 69 74 20 77 6f 72 | heck, i|f it wor|
|00005ee0| 6b 73 2e 2e 2e 0a 58 20 | 2a 0a 58 20 2a 20 4d 6f |ks....X |*.X * Mo|
|00005ef0| 73 74 6c 79 20 6a 75 73 | 74 20 73 63 61 6e 73 20 |stly jus|t scans |
|00005f00| 66 6f 72 20 6e 6f 6e 20 | 77 68 69 74 65 20 73 70 |for non |white sp|
|00005f10| 61 63 65 20 73 74 72 69 | 6e 67 73 20 61 6e 64 20 |ace stri|ngs and |
|00005f20| 72 65 74 75 72 6e 73 20 | 49 44 20 66 6f 72 20 74 |returns |ID for t|
|00005f30| 68 65 6d 2e 0a 58 20 2a | 20 44 6f 65 73 20 63 68 |hem..X *| Does ch|
|00005f40| 65 63 6b 20 65 73 70 65 | 63 69 61 6c 6c 79 20 66 |eck espe|cially f|
|00005f50| 6f 72 20 27 28 27 20 61 | 6e 64 20 27 29 27 2e 20 |or '(' a|nd ')'. |
|00005f60| 4a 75 73 74 20 62 65 66 | 6f 72 65 20 72 65 74 75 |Just bef|ore retu|
|00005f70| 72 6e 69 6e 67 20 49 44 | 20 69 74 0a 58 20 2a 20 |rning ID| it.X * |
|00005f80| 63 68 65 63 6b 73 20 66 | 6f 72 20 63 6f 6d 6d 61 |checks f|or comma|
|00005f90| 6e 64 20 6e 61 6d 65 73 | 20 69 66 20 69 74 20 69 |nd names| if it i|
|00005fa0| 73 20 74 68 65 20 66 69 | 72 73 74 20 74 6f 6b 65 |s the fi|rst toke|
|00005fb0| 6e 20 6f 6e 20 6c 69 6e | 65 20 6f 72 0a 58 20 2a |n on lin|e or.X *|
|00005fc0| 20 41 4e 44 2c 20 4f 52 | 2c 20 4c 49 44 2c 20 41 | AND, OR|, LID, A|
|00005fd0| 49 44 20 69 66 20 69 74 | 20 69 73 20 69 6e 20 74 |ID if it| is in t|
|00005fe0| 68 65 20 6d 69 64 64 6c | 65 20 6f 66 20 61 20 6c |he middl|e of a l|
|00005ff0| 69 6e 65 2e 0a 58 20 2a | 2f 0a 58 69 6e 74 0a 58 |ine..X *|/.Xint.X|
|00006000| 79 79 6c 65 78 28 29 0a | 58 7b 0a 58 20 20 20 63 |yylex().|X{.X c|
|00006010| 68 61 72 20 2a 20 20 20 | 20 20 20 62 70 20 3b 0a |har * | bp ;.|
|00006020| 58 20 20 20 63 68 61 72 | 20 20 20 20 20 20 20 20 |X char| |
|00006030| 63 20 3b 0a 58 20 20 20 | 69 6e 74 20 20 20 20 20 |c ;.X |int |
|00006040| 20 20 20 20 63 6f 64 65 | 20 3d 20 49 44 20 3b 0a | code| = ID ;.|
|00006050| 58 20 20 20 63 68 61 72 | 20 2a 20 20 20 20 20 20 |X char| * |
|00006060| 64 70 20 3b 0a 58 20 20 | 20 63 68 61 72 20 2a 20 |dp ;.X | char * |
|00006070| 20 20 20 20 20 73 70 20 | 3b 0a 58 20 20 20 69 6e | sp |;.X in|
|00006080| 74 20 20 20 20 20 20 20 | 20 20 76 61 6c 20 3b 0a |t | val ;.|
|00006090| 58 20 20 20 0a 58 20 20 | 20 62 70 20 3d 20 53 63 |X .X | bp = Sc|
|000060a0| 61 6e 50 74 72 20 3b 0a | 58 20 20 20 77 68 69 6c |anPtr ;.|X whil|
|000060b0| 65 20 28 69 73 73 70 61 | 63 65 28 2a 62 70 29 29 |e (isspa|ce(*bp))|
|000060c0| 20 2b 2b 62 70 20 3b 0a | 58 20 20 20 73 70 20 3d | ++bp ;.|X sp =|
|000060d0| 20 62 70 20 3b 0a 58 20 | 20 20 63 20 3d 20 2a 73 | bp ;.X | c = *s|
|000060e0| 70 2b 2b 20 3b 0a 58 20 | 20 20 69 66 20 28 28 63 |p++ ;.X | if ((c|
|000060f0| 20 3d 3d 20 27 28 27 29 | 20 7c 7c 20 28 63 20 3d | == '(')| || (c =|
|00006100| 3d 20 27 29 27 29 20 7c | 7c 20 28 63 20 3d 3d 20 |= ')') ||| (c == |
|00006110| 27 5c 30 27 29 29 20 7b | 0a 58 20 20 20 20 20 20 |'\0')) {|.X |
|00006120| 53 63 61 6e 50 74 72 20 | 3d 20 73 70 20 3b 0a 58 |ScanPtr |= sp ;.X|
|00006130| 20 20 20 20 20 20 69 66 | 20 28 63 20 3d 3d 20 27 | if| (c == '|
|00006140| 5c 30 27 29 20 7b 0a 58 | 20 20 20 20 20 20 20 20 |\0') {.X| |
|00006150| 20 2d 2d 53 63 61 6e 50 | 74 72 20 3b 0a 58 20 20 | --ScanP|tr ;.X |
|00006160| 20 20 20 20 7d 0a 58 20 | 20 20 20 20 20 72 65 74 | }.X | ret|
|00006170| 75 72 6e 28 63 29 20 3b | 0a 58 20 20 20 7d 20 65 |urn(c) ;|.X } e|
|00006180| 6c 73 65 20 7b 0a 58 20 | 20 20 20 20 20 64 70 20 |lse {.X | dp |
|00006190| 3d 20 79 79 74 65 78 74 | 20 3b 0a 58 20 20 20 20 |= yytext| ;.X |
|000061a0| 20 20 77 68 69 6c 65 20 | 28 21 20 28 28 63 20 3d | while |(! ((c =|
|000061b0| 3d 20 27 28 27 29 20 7c | 7c 20 28 63 20 3d 3d 20 |= '(') ||| (c == |
|000061c0| 27 29 27 29 20 7c 7c 20 | 28 63 20 3d 3d 20 27 5c |')') || |(c == '\|
|000061d0| 30 27 29 20 7c 7c 20 69 | 73 73 70 61 63 65 28 63 |0') || i|sspace(c|
|000061e0| 29 29 29 20 7b 0a 58 20 | 20 20 20 20 20 20 20 20 |))) {.X | |
|000061f0| 2a 64 70 2b 2b 20 3d 20 | 63 20 3b 0a 58 20 20 20 |*dp++ = |c ;.X |
|00006200| 20 20 20 20 20 20 63 20 | 3d 20 2a 73 70 2b 2b 20 | c |= *sp++ |
|00006210| 3b 0a 58 20 20 20 20 20 | 20 7d 0a 58 20 20 20 20 |;.X | }.X |
|00006220| 20 20 2a 64 70 2b 2b 20 | 3d 20 27 5c 30 27 20 3b | *dp++ |= '\0' ;|
|00006230| 0a 58 20 20 20 20 20 20 | 53 63 61 6e 50 74 72 20 |.X |ScanPtr |
|00006240| 3d 20 73 70 20 2d 20 31 | 20 3b 0a 58 20 20 20 20 |= sp - 1| ;.X |
|00006250| 20 20 69 66 20 28 62 70 | 20 3d 3d 20 53 63 61 6e | if (bp| == Scan|
|00006260| 4c 69 6e 65 29 20 7b 0a | 58 0a 58 20 20 20 20 20 |Line) {.|X.X |
|00006270| 20 20 20 20 2f 2a 20 66 | 69 72 73 74 20 74 6f 6b | /* f|irst tok|
|00006280| 65 6e 20 6f 6e 20 6c 69 | 6e 65 2c 20 63 68 65 63 |en on li|ne, chec|
|00006290| 6b 20 66 6f 72 20 63 6f | 6d 6d 61 6e 64 20 6e 61 |k for co|mmand na|
|000062a0| 6d 65 73 20 2a 2f 0a 58 | 0a 58 20 20 20 20 20 20 |mes */.X|.X |
|000062b0| 20 20 20 69 66 20 28 4e | 61 6d 65 45 71 28 79 79 | if (N|ameEq(yy|
|000062c0| 74 65 78 74 2c 20 22 53 | 53 22 29 29 20 72 65 74 |text, "S|S")) ret|
|000062d0| 75 72 6e 28 53 53 29 20 | 3b 0a 58 20 20 20 20 20 |urn(SS) |;.X |
|000062e0| 20 20 20 20 69 66 20 28 | 4e 61 6d 65 45 71 28 79 | if (|NameEq(y|
|000062f0| 79 74 65 78 74 2c 20 22 | 46 49 4c 45 53 22 29 29 |ytext, "|FILES"))|
|00006300| 20 72 65 74 75 72 6e 28 | 46 49 4c 45 53 29 20 3b | return(|FILES) ;|
|00006310| 0a 58 20 20 20 20 20 20 | 20 20 20 69 66 20 28 4e |.X | if (N|
|00006320| 61 6d 65 45 71 28 79 79 | 74 65 78 74 2c 20 22 46 |ameEq(yy|text, "F|
|00006330| 22 29 29 20 72 65 74 75 | 72 6e 28 46 49 4c 45 53 |")) retu|rn(FILES|
|00006340| 29 20 3b 0a 58 20 20 20 | 20 20 20 20 20 20 69 66 |) ;.X | if|
|00006350| 20 28 4e 61 6d 65 45 71 | 28 79 79 74 65 78 74 2c | (NameEq|(yytext,|
|00006360| 20 22 48 45 4c 50 22 29 | 29 20 72 65 74 75 72 6e | "HELP")|) return|
|00006370| 28 48 45 4c 50 29 20 3b | 0a 58 20 20 20 20 20 20 |(HELP) ;|.X |
|00006380| 20 20 20 69 66 20 28 4e | 61 6d 65 45 71 28 79 79 | if (N|ameEq(yy|
|00006390| 74 65 78 74 2c 20 22 48 | 22 29 29 20 72 65 74 75 |text, "H|")) retu|
|000063a0| 72 6e 28 48 45 4c 50 29 | 20 3b 0a 58 20 20 20 20 |rn(HELP)| ;.X |
|000063b0| 20 20 20 20 20 69 66 20 | 28 4e 61 6d 65 45 71 28 | if |(NameEq(|
|000063c0| 79 79 74 65 78 74 2c 20 | 22 3f 22 29 29 20 72 65 |yytext, |"?")) re|
|000063d0| 74 75 72 6e 28 48 45 4c | 50 29 20 3b 0a 58 20 20 |turn(HEL|P) ;.X |
|000063e0| 20 20 20 20 20 20 20 69 | 66 20 28 4e 61 6d 65 45 | i|f (NameE|
|000063f0| 71 28 79 79 74 65 78 74 | 2c 20 22 42 45 47 49 4e |q(yytext|, "BEGIN|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.