home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3598 < prev    next >
SHell self-extracting ARchive  |  1991-07-11  |  41.9 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 SHell self-extracting ARchive (archive/shar) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file 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)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 61 6c 74 2e |Newsgrou|ps: alt.|
|00000010| 73 6f 75 72 63 65 73 0a | 46 72 6f 6d 3a 20 6a 70 |sources.|From: jp|
|00000020| 72 40 6a 70 72 61 64 6c | 65 79 2e 6a 70 72 2e 63 |r@jpradl|ey.jpr.c|
|00000030| 6f 6d 20 28 4a 65 61 6e | 2d 50 69 65 72 72 65 20 |om (Jean|-Pierre |
|00000040| 52 61 64 6c 65 79 29 0a | 53 75 62 6a 65 63 74 3a |Radley).|Subject:|
|00000050| 20 58 43 20 33 2e 30 62 | 20 35 2f 35 20 43 6f 6d | XC 3.0b| 5/5 Com|
|00000060| 6d 75 6e 69 63 61 74 69 | 6f 6e 73 20 50 72 6f 67 |municati|ons Prog|
|00000070| 72 61 6d 0a 44 61 74 65 | 3a 20 54 75 65 2c 20 30 |ram.Date|: Tue, 0|
|00000080| 39 20 4a 75 6c 20 31 39 | 39 31 20 30 31 3a 30 34 |9 Jul 19|91 01:04|
|00000090| 3a 33 33 20 47 4d 54 0a | 4d 65 73 73 61 67 65 2d |:33 GMT.|Message-|
|000000a0| 49 44 3a 20 3c 31 39 39 | 31 4a 75 6c 30 39 2e 30 |ID: <199|1Jul09.0|
|000000b0| 31 30 34 33 33 2e 38 30 | 38 39 40 6a 70 72 61 64 |10433.80|89@jprad|
|000000c0| 6c 65 79 2e 6a 70 72 2e | 63 6f 6d 3e 0a 0a 0a 2d |ley.jpr.|com>...-|
|000000d0| 2d 2d 63 75 74 2d 2d 2d | 0a 23 21 2f 62 69 6e 2f |--cut---|.#!/bin/|
|000000e0| 73 68 0a 23 20 54 68 69 | 73 20 69 73 20 61 20 73 |sh.# Thi|s is a s|
|000000f0| 68 65 6c 6c 20 61 72 63 | 68 69 76 65 2c 20 6d 65 |hell arc|hive, me|
|00000100| 61 6e 69 6e 67 3a 0a 23 | 20 31 2e 20 52 65 6d 6f |aning:.#| 1. Remo|
|00000110| 76 65 20 65 76 65 72 79 | 74 68 69 6e 67 20 61 62 |ve every|thing ab|
|00000120| 6f 76 65 20 74 68 65 20 | 23 21 2f 62 69 6e 2f 73 |ove the |#!/bin/s|
|00000130| 68 20 6c 69 6e 65 2e 0a | 23 20 32 2e 20 53 61 76 |h line..|# 2. Sav|
|00000140| 65 20 74 68 65 20 72 65 | 73 75 6c 74 69 6e 67 20 |e the re|sulting |
|00000150| 74 65 78 74 20 69 6e 20 | 61 20 66 69 6c 65 2e 0a |text in |a file..|
|00000160| 23 20 33 2e 20 45 78 65 | 63 75 74 65 20 74 68 65 |# 3. Exe|cute the|
|00000170| 20 66 69 6c 65 20 77 69 | 74 68 20 2f 62 69 6e 2f | file wi|th /bin/|
|00000180| 73 68 20 28 6e 6f 74 20 | 63 73 68 29 20 74 6f 20 |sh (not |csh) to |
|00000190| 63 72 65 61 74 65 20 74 | 68 65 20 66 69 6c 65 73 |create t|he files|
|000001a0| 3a 0a 23 09 78 63 64 69 | 61 6c 2e 63 0a 23 09 78 |:.#.xcdi|al.c.#.x|
|000001b0| 63 6d 61 69 6e 2e 63 0a | 23 09 78 63 74 65 72 6d |cmain.c.|#.xcterm|
|000001c0| 2e 63 0a 23 09 78 63 78 | 6d 64 6d 2e 63 0a 23 20 |.c.#.xcx|mdm.c.# |
|000001d0| 54 68 69 73 20 61 72 63 | 68 69 76 65 20 63 72 65 |This arc|hive cre|
|000001e0| 61 74 65 64 3a 20 4d 6f | 6e 20 4a 75 6c 20 20 38 |ated: Mo|n Jul 8|
|000001f0| 20 32 30 3a 33 37 3a 33 | 37 20 31 39 39 31 0a 65 | 20:37:3|7 1991.e|
|00000200| 78 70 6f 72 74 20 50 41 | 54 48 3b 20 50 41 54 48 |xport PA|TH; PATH|
|00000210| 3d 2f 62 69 6e 3a 24 50 | 41 54 48 0a 65 63 68 6f |=/bin:$P|ATH.echo|
|00000220| 20 73 68 61 72 3a 20 65 | 78 74 72 61 63 74 69 6e | shar: e|xtractin|
|00000230| 67 20 22 27 78 63 64 69 | 61 6c 2e 63 27 22 20 27 |g "'xcdi|al.c'" '|
|00000240| 28 36 34 32 38 20 63 68 | 61 72 61 63 74 65 72 73 |(6428 ch|aracters|
|00000250| 29 27 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 78 |)'.if te|st -f 'x|
|00000260| 63 64 69 61 6c 2e 63 27 | 0a 74 68 65 6e 0a 09 65 |cdial.c'|.then..e|
|00000270| 63 68 6f 20 73 68 61 72 | 3a 20 77 69 6c 6c 20 6e |cho shar|: will n|
|00000280| 6f 74 20 6f 76 65 72 2d | 77 72 69 74 65 20 65 78 |ot over-|write ex|
|00000290| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 22 27 78 63 |isting f|ile "'xc|
|000002a0| 64 69 61 6c 2e 63 27 22 | 0a 65 6c 73 65 0a 73 65 |dial.c'"|.else.se|
|000002b0| 64 20 27 73 2f 5e 7c 2f | 2f 27 20 3c 3c 20 5c 53 |d 's/^|/|/' << \S|
|000002c0| 48 41 52 5f 45 4f 46 20 | 3e 20 27 78 63 64 69 61 |HAR_EOF |> 'xcdia|
|000002d0| 6c 2e 63 27 0a 7c 2f 2a | 09 78 63 64 69 61 6c 2e |l.c'.|/*|.xcdial.|
|000002e0| 63 20 2d 2d 20 64 69 61 | 6c 69 6e 67 20 64 69 72 |c -- dia|ling dir|
|000002f0| 65 63 74 6f 72 79 20 6d | 6f 64 75 6c 65 20 66 6f |ectory m|odule fo|
|00000300| 72 20 58 43 0a 7c 09 54 | 68 69 73 20 66 69 6c 65 |r XC.|.T|his file|
|00000310| 20 75 73 65 73 20 34 2d | 63 68 61 72 61 63 74 65 | uses 4-|characte|
|00000320| 72 20 74 61 62 73 74 6f | 70 73 0a 7c 09 41 75 74 |r tabsto|ps.|.Aut|
|00000330| 68 6f 72 3a 20 53 74 65 | 76 65 20 4d 61 6e 65 73 |hor: Ste|ve Manes|
|00000340| 20 38 2f 32 36 2f 38 38 | 0a 7c 20 2a 2f 0a 7c 0a | 8/26/88|.| */.|.|
|00000350| 7c 23 69 6e 63 6c 75 64 | 65 20 3c 73 74 64 69 6f ||#includ|e <stdio|
|00000360| 2e 68 3e 0a 7c 23 69 6e | 63 6c 75 64 65 20 3c 63 |.h>.|#in|clude <c|
|00000370| 74 79 70 65 2e 68 3e 0a | 7c 23 69 6e 63 6c 75 64 |type.h>.||#includ|
|00000380| 65 20 3c 73 79 73 2f 74 | 79 70 65 73 2e 68 3e 0a |e <sys/t|ypes.h>.|
|00000390| 7c 23 69 6e 63 6c 75 64 | 65 20 3c 66 63 6e 74 6c ||#includ|e <fcntl|
|000003a0| 2e 68 3e 0a 7c 23 69 6e | 63 6c 75 64 65 20 22 78 |.h>.|#in|clude "x|
|000003b0| 63 2e 68 22 0a 7c 0a 7c | 23 64 65 66 69 6e 65 20 |c.h".|.||#define |
|000003c0| 4d 41 58 4e 41 4d 45 09 | 09 32 37 09 2f 2a 20 6d |MAXNAME.|.27./* m|
|000003d0| 61 78 69 6d 75 6d 20 64 | 69 73 70 6c 61 79 20 66 |aximum d|isplay f|
|000003e0| 6f 72 20 73 79 73 74 65 | 6d 20 6e 61 6d 65 20 2a |or syste|m name *|
|000003f0| 2f 0a 7c 23 64 65 66 69 | 6e 65 20 4d 41 58 4e 55 |/.|#defi|ne MAXNU|
|00000400| 4d 42 45 52 09 32 30 09 | 2f 2a 09 20 20 22 09 09 |MBER.20.|/*. "..|
|00000410| 20 20 22 09 09 22 20 20 | 70 68 6f 6e 65 20 6e 75 | ".." |phone nu|
|00000420| 6d 62 65 72 20 2a 2f 0a | 7c 23 64 65 66 69 6e 65 |mber */.||#define|
|00000430| 20 4d 41 58 50 52 4f 54 | 4f 43 4f 4c 09 20 39 09 | MAXPROT|OCOL. 9.|
|00000440| 2f 2a 09 20 20 22 09 09 | 20 20 22 09 09 22 20 20 |/*. "..| ".." |
|00000450| 70 72 6f 74 6f 63 6f 6c | 20 73 74 72 69 6e 67 20 |protocol| string |
|00000460| 2a 2f 0a 7c 23 64 65 66 | 69 6e 65 20 4d 41 58 53 |*/.|#def|ine MAXS|
|00000470| 43 52 49 50 54 09 31 34 | 09 2f 2a 09 20 20 22 09 |CRIPT.14|./*. ".|
|00000480| 09 20 20 22 09 09 22 20 | 20 73 63 72 69 70 74 20 |. ".." | script |
|00000490| 6e 61 6d 65 20 2a 2f 0a | 7c 0a 7c 73 74 61 74 69 |name */.||.|stati|
|000004a0| 63 20 46 49 4c 45 20 2a | 64 69 72 66 3b 0a 7c 73 |c FILE *|dirf;.|s|
|000004b0| 74 61 74 69 63 20 6c 6f | 6e 67 20 70 61 67 65 73 |tatic lo|ng pages|
|000004c0| 5b 35 37 5d 3b 09 2f 2a | 20 6f 66 66 73 65 74 73 |[57];./*| offsets|
|000004d0| 20 69 6e 74 6f 20 70 68 | 6f 6e 65 66 69 6c 65 20 | into ph|onefile |
|000004e0| 2a 2f 0a 7c 73 74 61 74 | 69 63 20 73 68 6f 72 74 |*/.|stat|ic short|
|000004f0| 20 64 69 72 6e 75 6d 2c | 20 74 68 69 73 70 61 67 | dirnum,| thispag|
|00000500| 65 2c 20 6c 61 73 74 70 | 61 67 65 3b 0a 7c 73 74 |e, lastp|age;.|st|
|00000510| 61 74 69 63 20 63 68 61 | 72 20 2a 6c 61 73 74 5f |atic cha|r *last_|
|00000520| 6e 62 72 20 3d 20 4e 55 | 4c 4c 53 3b 0a 7c 65 78 |nbr = NU|LLS;.|ex|
|00000530| 74 65 72 6e 20 73 68 6f | 72 74 20 73 5f 66 6c 61 |tern sho|rt s_fla|
|00000540| 67 3b 0a 7c 65 78 74 65 | 72 6e 20 76 6f 69 64 20 |g;.|exte|rn void |
|00000550| 63 6c 5f 65 6e 64 28 29 | 2c 20 6e 65 77 62 6d 61 |cl_end()|, newbma|
|00000560| 73 6b 28 29 3b 0a 7c 0a | 7c 2f 2a 09 73 68 6f 77 |sk();.|.||/*.show|
|00000570| 65 6e 74 72 79 28 64 69 | 72 6e 75 6d 2c 20 65 6e |entry(di|rnum, en|
|00000580| 74 72 79 29 0a 7c 09 73 | 68 6f 77 20 61 20 73 69 |try).|.s|how a si|
|00000590| 6e 67 6c 65 2c 20 66 6f | 72 6d 61 74 74 65 64 20 |ngle, fo|rmatted |
|000005a0| 64 69 61 6c 64 69 72 20 | 65 6e 74 72 79 2e 0a 7c |dialdir |entry..||
|000005b0| 09 63 68 65 63 6b 20 69 | 74 73 20 66 6f 72 6d 61 |.check i|ts forma|
|000005c0| 74 20 69 6e 74 65 67 72 | 69 74 79 20 61 73 20 77 |t integr|ity as w|
|000005d0| 65 20 67 6f 0a 7c 2a 2f | 0a 7c 73 74 61 74 69 63 |e go.|*/|.|static|
|000005e0| 20 76 6f 69 64 20 73 68 | 6f 77 65 6e 74 72 79 28 | void sh|owentry(|
|000005f0| 63 68 6f 69 63 65 2c 20 | 65 6e 74 72 79 29 0a 7c |choice, |entry).||
|00000600| 73 68 6f 72 74 20 63 68 | 6f 69 63 65 3b 0a 7c 63 |short ch|oice;.|c|
|00000610| 68 61 72 20 2a 65 6e 74 | 72 79 3b 0a 7c 7b 0a 7c |har *ent|ry;.|{.||
|00000620| 09 63 68 61 72 20 6e 61 | 6d 65 5b 4d 41 58 4e 41 |.char na|me[MAXNA|
|00000630| 4d 45 20 2b 31 5d 2c 20 | 6e 75 6d 5b 4d 41 58 4e |ME +1], |num[MAXN|
|00000640| 55 4d 42 45 52 20 2b 31 | 5d 2c 20 66 5b 33 30 5d |UMBER +1|], f[30]|
|00000650| 2c 0a 7c 09 09 70 72 6f | 74 6f 63 6f 6c 5b 4d 41 |,.|..pro|tocol[MA|
|00000660| 58 50 52 4f 54 4f 43 4f | 4c 20 2b 31 5d 2c 20 73 |XPROTOCO|L +1], s|
|00000670| 63 72 69 70 74 5b 4d 41 | 58 53 43 52 49 50 54 20 |cript[MA|XSCRIPT |
|00000680| 2b 31 5d 3b 0a 7c 09 63 | 68 61 72 20 2a 73 3b 0a |+1];.|.c|har *s;.|
|00000690| 7c 09 73 68 6f 72 74 20 | 69 2c 20 6a 20 3d 20 30 ||.short |i, j = 0|
|000006a0| 3b 0a 7c 0a 7c 09 73 20 | 3d 20 65 6e 74 72 79 3b |;.|.|.s |= entry;|
|000006b0| 0a 7c 0a 7c 09 2f 2a 20 | 67 65 74 20 70 68 6f 6e |.|.|./* |get phon|
|000006c0| 65 20 6e 75 6d 62 65 72 | 20 2a 2f 0a 7c 09 77 68 |e number| */.|.wh|
|000006d0| 69 6c 65 20 28 69 73 73 | 70 61 63 65 28 2a 73 29 |ile (iss|pace(*s)|
|000006e0| 29 0a 7c 09 09 73 2b 2b | 3b 0a 7c 0a 7c 09 66 6f |).|..s++|;.|.|.fo|
|000006f0| 72 20 28 69 3d 30 3b 20 | 69 20 3c 20 4d 41 58 4e |r (i=0; |i < MAXN|
|00000700| 55 4d 42 45 52 20 26 26 | 20 21 69 73 73 70 61 63 |UMBER &&| !isspac|
|00000710| 65 28 2a 73 29 3b 20 69 | 2b 2b 29 0a 7c 09 09 6e |e(*s); i|++).|..n|
|00000720| 75 6d 5b 6a 2b 2b 5d 20 | 3d 20 2a 73 2b 2b 3b 0a |um[j++] |= *s++;.|
|00000730| 7c 09 6e 75 6d 5b 6a 5d | 20 3d 20 27 5c 30 27 3b ||.num[j]| = '\0';|
|00000740| 0a 7c 0a 7c 09 2f 2a 20 | 67 65 74 20 6e 61 6d 65 |.|.|./* |get name|
|00000750| 20 2a 2f 0a 7c 09 77 68 | 69 6c 65 20 28 21 69 73 | */.|.wh|ile (!is|
|00000760| 73 70 61 63 65 28 2a 73 | 29 29 0a 7c 09 09 73 2b |space(*s|)).|..s+|
|00000770| 2b 3b 0a 7c 09 77 68 69 | 6c 65 20 28 69 73 73 70 |+;.|.whi|le (issp|
|00000780| 61 63 65 28 2a 73 29 29 | 0a 7c 09 09 73 2b 2b 3b |ace(*s))|.|..s++;|
|00000790| 0a 7c 09 6a 3d 30 3b 0a | 7c 09 66 6f 72 20 28 69 |.|.j=0;.||.for (i|
|000007a0| 3d 30 3b 20 69 20 3c 20 | 4d 41 58 4e 41 4d 45 20 |=0; i < |MAXNAME |
|000007b0| 26 26 20 2a 73 20 21 3d | 20 27 5c 74 27 3b 20 69 |&& *s !=| '\t'; i|
|000007c0| 2b 2b 29 0a 7c 09 09 6e | 61 6d 65 5b 6a 2b 2b 5d |++).|..n|ame[j++]|
|000007d0| 20 3d 20 2a 73 2b 2b 3b | 0a 7c 09 6e 61 6d 65 5b | = *s++;|.|.name[|
|000007e0| 6a 5d 20 3d 20 27 5c 30 | 27 3b 0a 7c 09 73 20 3d |j] = '\0|';.|.s =|
|000007f0| 20 73 74 72 63 68 72 28 | 6e 61 6d 65 2c 27 5c 6e | strchr(|name,'\n|
|00000800| 27 29 3b 0a 7c 09 69 66 | 20 28 73 29 0a 7c 09 09 |');.|.if| (s).|..|
|00000810| 2a 73 20 3d 20 27 5c 30 | 27 3b 0a 7c 0a 7c 09 2f |*s = '\0|';.|.|./|
|00000820| 2a 20 67 65 74 20 70 72 | 6f 74 6f 63 6f 6c 20 2a |* get pr|otocol *|
|00000830| 2f 0a 7c 09 69 66 20 28 | 73 20 3d 20 73 74 72 73 |/.|.if (|s = strs|
|00000840| 74 72 28 65 6e 74 72 79 | 2c 20 22 42 50 53 3d 22 |tr(entry|, "BPS="|
|00000850| 29 29 20 7b 0a 7c 09 09 | 73 20 2b 3d 20 34 3b 0a |)) {.|..|s += 4;.|
|00000860| 7c 09 09 6a 3d 30 3b 0a | 7c 09 09 66 6f 72 20 28 ||..j=0;.||..for (|
|00000870| 69 3d 30 3b 20 69 20 3c | 20 36 20 26 26 20 69 73 |i=0; i <| 6 && is|
|00000880| 64 69 67 69 74 28 2a 73 | 29 3b 20 69 2b 2b 29 0a |digit(*s|); i++).|
|00000890| 7c 09 09 09 70 72 6f 74 | 6f 63 6f 6c 5b 6a 2b 2b ||...prot|ocol[j++|
|000008a0| 5d 20 3d 20 2a 73 2b 2b | 3b 0a 7c 09 09 70 72 6f |] = *s++|;.|..pro|
|000008b0| 74 6f 63 6f 6c 5b 6a 5d | 20 3d 20 27 5c 30 27 3b |tocol[j]| = '\0';|
|000008c0| 0a 7c 09 09 73 74 72 63 | 61 74 28 70 72 6f 74 6f |.|..strc|at(proto|
|000008d0| 63 6f 6c 2c 20 22 2f 22 | 29 3b 0a 7c 09 7d 0a 7c |col, "/"|);.|.}.||
|000008e0| 09 65 6c 73 65 0a 7c 09 | 09 73 70 72 69 6e 74 66 |.else.|.|.sprintf|
|000008f0| 28 70 72 6f 74 6f 63 6f | 6c 2c 22 3f 3f 3f 3f 25 |(protoco|l,"????%|
|00000900| 63 22 2c 27 2f 27 29 3b | 0a 7c 0a 7c 09 69 66 20 |c",'/');|.|.|.if |
|00000910| 28 73 20 3d 20 73 74 72 | 73 74 72 28 65 6e 74 72 |(s = str|str(entr|
|00000920| 79 2c 20 22 42 49 54 53 | 3d 22 29 29 20 7b 0a 7c |y, "BITS|=")) {.||
|00000930| 09 09 73 20 2b 3d 20 35 | 3b 0a 7c 09 09 73 77 69 |..s += 5|;.|..swi|
|00000940| 74 63 68 20 28 2a 73 29 | 20 7b 0a 7c 09 09 09 63 |tch (*s)| {.|...c|
|00000950| 61 73 65 20 27 37 27 3a | 0a 7c 09 09 09 09 73 74 |ase '7':|.|....st|
|00000960| 72 63 61 74 28 70 72 6f | 74 6f 63 6f 6c 2c 20 22 |rcat(pro|tocol, "|
|00000970| 37 2f 22 29 3b 0a 7c 09 | 09 09 09 62 72 65 61 6b |7/");.|.|...break|
|00000980| 3b 0a 7c 09 09 09 63 61 | 73 65 20 27 38 27 3a 0a |;.|...ca|se '8':.|
|00000990| 7c 09 09 09 09 73 74 72 | 63 61 74 28 70 72 6f 74 ||....str|cat(prot|
|000009a0| 6f 63 6f 6c 2c 20 22 38 | 2f 22 29 3b 0a 7c 09 09 |ocol, "8|/");.|..|
|000009b0| 09 09 62 72 65 61 6b 3b | 0a 7c 09 09 09 64 65 66 |..break;|.|...def|
|000009c0| 61 75 6c 74 3a 0a 7c 09 | 09 09 09 62 65 65 70 28 |ault:.|.|...beep(|
|000009d0| 29 3b 0a 7c 09 09 09 09 | 73 70 72 69 6e 74 66 28 |);.|....|sprintf(|
|000009e0| 4d 73 67 2c 22 49 6e 76 | 61 6c 69 64 20 42 49 54 |Msg,"Inv|alid BIT|
|000009f0| 53 3d 20 66 6f 72 20 27 | 25 73 27 22 2c 6e 61 6d |S= for '|%s'",nam|
|00000a00| 65 29 3b 0a 7c 09 09 09 | 09 53 3b 0a 7c 09 09 09 |e);.|...|.S;.|...|
|00000a10| 09 73 74 72 63 61 74 28 | 70 72 6f 74 6f 63 6f 6c |.strcat(|protocol|
|00000a20| 2c 22 38 2f 4e 22 29 3b | 0a 7c 09 09 09 09 72 65 |,"8/N");|.|....re|
|00000a30| 74 75 72 6e 3b 0a 7c 09 | 09 7d 0a 7c 09 7d 0a 7c |turn;.|.|.}.|.}.||
|00000a40| 09 65 6c 73 65 0a 7c 09 | 09 73 74 72 63 61 74 28 |.else.|.|.strcat(|
|00000a50| 70 72 6f 74 6f 63 6f 6c | 2c 22 3f 2f 22 29 3b 0a |protocol|,"?/");.|
|00000a60| 7c 0a 7c 09 69 66 20 28 | 2a 73 20 3d 3d 20 27 37 ||.|.if (|*s == '7|
|00000a70| 27 29 0a 7c 09 09 73 74 | 72 63 61 74 28 70 72 6f |').|..st|rcat(pro|
|00000a80| 74 6f 63 6f 6c 2c 20 22 | 45 22 29 3b 0a 7c 09 65 |tocol, "|E");.|.e|
|00000a90| 6c 73 65 0a 7c 09 09 73 | 74 72 63 61 74 28 70 72 |lse.|..s|trcat(pr|
|00000aa0| 6f 74 6f 63 6f 6c 2c 20 | 22 4e 22 29 3b 0a 7c 0a |otocol, |"N");.|.|
|00000ab0| 7c 09 69 66 20 28 73 20 | 3d 20 73 74 72 73 74 72 ||.if (s |= strstr|
|00000ac0| 28 65 6e 74 72 79 2c 20 | 22 53 43 52 49 50 54 3d |(entry, |"SCRIPT=|
|00000ad0| 22 29 29 20 7b 0a 7c 09 | 09 73 20 2b 3d 20 37 3b |")) {.|.|.s += 7;|
|00000ae0| 0a 7c 09 09 6a 3d 30 3b | 0a 7c 09 09 66 6f 72 20 |.|..j=0;|.|..for |
|00000af0| 28 69 3d 30 3b 20 69 20 | 3c 20 4d 41 58 53 43 52 |(i=0; i |< MAXSCR|
|00000b00| 49 50 54 20 26 26 20 21 | 69 73 73 70 61 63 65 28 |IPT && !|isspace(|
|00000b10| 2a 73 29 3b 20 69 2b 2b | 29 0a 7c 09 09 09 73 63 |*s); i++|).|...sc|
|00000b20| 72 69 70 74 5b 6a 2b 2b | 5d 20 3d 20 2a 73 2b 2b |ript[j++|] = *s++|
|00000b30| 3b 0a 7c 09 09 73 63 72 | 69 70 74 5b 6a 5d 20 3d |;.|..scr|ipt[j] =|
|00000b40| 20 27 5c 30 27 3b 0a 7c | 0a 7c 09 7d 0a 7c 09 65 | '\0';.||.|.}.|.e|
|00000b50| 6c 73 65 0a 7c 09 09 73 | 63 72 69 70 74 5b 30 5d |lse.|..s|cript[0]|
|00000b60| 20 3d 20 27 5c 30 27 3b | 0a 7c 0a 7c 09 73 70 72 | = '\0';|.|.|.spr|
|00000b70| 69 6e 74 66 28 66 2c 22 | 25 25 33 64 20 2d 20 25 |intf(f,"|%%3d - %|
|00000b80| 25 2d 25 64 73 20 25 25 | 25 64 73 20 25 25 25 64 |%-%ds %%|%ds %%%d|
|00000b90| 73 20 25 25 2d 25 64 73 | 5c 6e 22 2c 0a 7c 09 09 |s %%-%ds|\n",.|..|
|00000ba0| 4d 41 58 4e 41 4d 45 2c | 20 4d 41 58 4e 55 4d 42 |MAXNAME,| MAXNUMB|
|00000bb0| 45 52 2c 20 4d 41 58 50 | 52 4f 54 4f 43 4f 4c 2c |ER, MAXP|ROTOCOL,|
|00000bc0| 20 4d 41 58 53 43 52 49 | 50 54 29 3b 0a 7c 09 66 | MAXSCRI|PT);.|.f|
|00000bd0| 70 72 69 6e 74 66 28 74 | 66 70 2c 20 66 2c 20 63 |printf(t|fp, f, c|
|00000be0| 68 6f 69 63 65 2c 20 6e | 61 6d 65 2c 20 6e 75 6d |hoice, n|ame, num|
|00000bf0| 2c 20 70 72 6f 74 6f 63 | 6f 6c 2c 20 73 63 72 69 |, protoc|ol, scri|
|00000c00| 70 74 29 3b 0a 7c 7d 0a | 7c 0a 7c 2f 2a 09 73 63 |pt);.|}.||.|/*.sc|
|00000c10| 72 6f 6c 6c 5f 64 69 72 | 28 29 0a 7c 09 73 63 72 |roll_dir|().|.scr|
|00000c20| 6f 6c 6c 20 64 69 72 65 | 63 74 6f 72 79 20 61 74 |oll dire|ctory at|
|00000c30| 20 63 75 72 72 65 6e 74 | 20 66 69 6c 65 70 6f 73 | current| filepos|
|00000c40| 0a 7c 2a 2f 0a 7c 73 74 | 61 74 69 63 20 76 6f 69 |.|*/.|st|atic voi|
|00000c50| 64 20 73 63 72 6f 6c 6c | 5f 64 69 72 28 29 0a 7c |d scroll|_dir().||
|00000c60| 7b 0a 7c 09 73 68 6f 72 | 74 20 69 3b 0a 7c 09 63 |{.|.shor|t i;.|.c|
|00000c70| 68 61 72 20 62 75 66 66 | 5b 31 32 31 5d 3b 0a 7c |har buff|[121];.||
|00000c80| 0a 7c 09 74 74 67 6f 74 | 6f 28 34 2c 20 30 29 3b |.|.ttgot|o(4, 0);|
|00000c90| 0a 7c 09 63 75 72 5f 6f | 66 66 28 29 3b 0a 7c 09 |.|.cur_o|ff();.|.|
|00000ca0| 63 6c 5f 65 6e 64 28 29 | 3b 0a 7c 0a 7c 09 66 73 |cl_end()|;.|.|.fs|
|00000cb0| 65 65 6b 28 64 69 72 66 | 2c 20 70 61 67 65 73 5b |eek(dirf|, pages[|
|00000cc0| 74 68 69 73 70 61 67 65 | 5d 2c 20 30 29 2c 0a 7c |thispage|], 0),.||
|00000cd0| 09 64 69 72 6e 75 6d 20 | 3d 20 74 68 69 73 70 61 |.dirnum |= thispa|
|00000ce0| 67 65 20 2a 20 28 4c 49 | 20 2d 20 36 29 3b 0a 7c |ge * (LI| - 6);.||
|00000cf0| 09 66 6f 72 20 28 69 3d | 30 3b 20 69 20 3c 20 4c |.for (i=|0; i < L|
|00000d00| 49 20 2d 20 36 3b 20 69 | 2b 2b 29 20 7b 0a 7c 09 |I - 6; i|++) {.|.|
|00000d10| 09 69 66 20 28 66 67 65 | 74 73 28 62 75 66 66 2c |.if (fge|ts(buff,|
|00000d20| 20 31 32 30 2c 20 64 69 | 72 66 29 20 3d 3d 20 4e | 120, di|rf) == N|
|00000d30| 55 4c 4c 53 29 20 7b 0a | 7c 09 09 09 6c 61 73 74 |ULLS) {.||...last|
|00000d40| 70 61 67 65 20 3d 20 74 | 68 69 73 70 61 67 65 3b |page = t|hispage;|
|00000d50| 0a 7c 09 09 09 62 72 65 | 61 6b 3b 0a 7c 09 09 7d |.|...bre|ak;.|..}|
|00000d60| 0a 7c 09 09 73 68 6f 77 | 65 6e 74 72 79 28 2b 2b |.|..show|entry(++|
|00000d70| 64 69 72 6e 75 6d 2c 20 | 62 75 66 66 29 3b 0a 7c |dirnum, |buff);.||
|00000d80| 09 7d 0a 7c 0a 7c 09 70 | 61 67 65 73 5b 74 68 69 |.}.|.|.p|ages[thi|
|00000d90| 73 70 61 67 65 20 2b 20 | 31 5d 20 3d 20 66 74 65 |spage + |1] = fte|
|00000da0| 6c 6c 28 64 69 72 66 29 | 3b 0a 7c 09 69 66 20 28 |ll(dirf)|;.|.if (|
|00000db0| 66 67 65 74 73 28 62 75 | 66 66 2c 20 31 32 30 2c |fgets(bu|ff, 120,|
|00000dc0| 20 64 69 72 66 29 20 3d | 3d 20 4e 55 4c 4c 53 29 | dirf) =|= NULLS)|
|00000dd0| 0a 7c 09 09 6c 61 73 74 | 70 61 67 65 20 3d 20 74 |.|..last|page = t|
|00000de0| 68 69 73 70 61 67 65 3b | 0a 7c 09 63 75 72 5f 6f |hispage;|.|.cur_o|
|00000df0| 6e 28 29 3b 0a 7c 7d 0a | 7c 0a 7c 2f 2a 20 44 69 |n();.|}.||.|/* Di|
|00000e00| 61 6c 20 61 20 70 68 6f | 6e 65 20 6e 75 6d 62 65 |al a pho|ne numbe|
|00000e10| 72 2c 20 75 73 69 6e 67 | 20 70 72 6f 70 65 72 20 |r, using| proper |
|00000e20| 66 6f 72 6d 61 74 20 61 | 6e 64 20 64 65 6c 61 79 |format a|nd delay|
|00000e30| 2e 20 2a 2f 0a 7c 76 6f | 69 64 20 78 63 64 69 61 |. */.|vo|id xcdia|
|00000e40| 6c 28 73 29 0a 7c 63 68 | 61 72 20 2a 73 3b 0a 7c |l(s).|ch|ar *s;.||
|00000e50| 7b 0a 7c 09 63 68 61 72 | 20 62 75 66 66 65 72 5b |{.|.char| buffer[|
|00000e60| 53 4d 5f 42 55 46 46 5d | 3b 0a 7c 0a 7c 09 69 66 |SM_BUFF]|;.|.|.if|
|00000e70| 20 28 6c 61 73 74 5f 6e | 62 72 29 0a 7c 09 09 66 | (last_n|br).|..f|
|00000e80| 72 65 65 28 6c 61 73 74 | 5f 6e 62 72 29 3b 0a 7c |ree(last|_nbr);.||
|00000e90| 0a 7c 09 6c 61 73 74 5f | 6e 62 72 20 3d 20 73 74 |.|.last_|nbr = st|
|00000ea0| 72 64 75 70 28 73 29 3b | 0a 7c 0a 7c 09 73 70 72 |rdup(s);|.|.|.spr|
|00000eb0| 69 6e 74 66 28 62 75 66 | 66 65 72 2c 20 44 49 41 |intf(buf|fer, DIA|
|00000ec0| 4c 53 54 52 2c 20 73 29 | 3b 0a 7c 09 73 65 6e 64 |LSTR, s)|;.|.send|
|00000ed0| 5f 73 6c 6f 77 6c 79 28 | 62 75 66 66 65 72 29 3b |_slowly(|buffer);|
|00000ee0| 0a 7c 7d 0a 7c 0a 7c 73 | 74 61 74 69 63 20 76 6f |.|}.|.|s|tatic vo|
|00000ef0| 69 64 20 70 61 72 73 65 | 5f 65 6e 74 72 79 28 62 |id parse|_entry(b|
|00000f00| 75 66 29 0a 7c 63 68 61 | 72 20 2a 62 75 66 3b 0a |uf).|cha|r *buf;.|
|00000f10| 7c 7b 0a 7c 09 63 68 61 | 72 20 2a 73 2c 20 2a 74 ||{.|.cha|r *s, *t|
|00000f20| 2c 20 2a 6e 62 72 3b 0a | 7c 0a 7c 09 69 66 20 28 |, *nbr;.||.|.if (|
|00000f30| 73 20 3d 20 73 74 72 73 | 74 72 28 62 75 66 2c 20 |s = strs|tr(buf, |
|00000f40| 22 42 50 53 3d 22 29 29 | 20 7b 0a 7c 09 09 73 20 |"BPS="))| {.|..s |
|00000f50| 2b 3d 20 34 3b 0a 7c 09 | 09 69 66 20 28 6d 72 61 |+= 4;.|.|.if (mra|
|00000f60| 74 65 28 73 29 20 3c 20 | 30 29 20 7b 0a 7c 09 09 |te(s) < |0) {.|..|
|00000f70| 09 73 68 6f 77 28 30 2c | 22 49 6e 76 61 6c 69 64 |.show(0,|"Invalid|
|00000f80| 20 42 50 53 3d 22 29 3b | 0a 7c 09 09 09 72 65 74 | BPS=");|.|...ret|
|00000f90| 75 72 6e 3b 0a 7c 09 09 | 7d 0a 7c 09 7d 0a 7c 09 |urn;.|..|}.|.}.|.|
|00000fa0| 69 66 20 28 73 20 3d 20 | 73 74 72 73 74 72 28 62 |if (s = |strstr(b|
|00000fb0| 75 66 2c 20 22 42 49 54 | 53 3d 22 29 29 20 7b 0a |uf, "BIT|S=")) {.|
|00000fc0| 7c 09 09 73 20 2b 3d 20 | 35 3b 0a 7c 09 09 73 77 ||..s += |5;.|..sw|
|00000fd0| 69 74 63 68 20 28 2a 73 | 29 20 7b 0a 7c 09 09 09 |itch (*s|) {.|...|
|00000fe0| 63 61 73 65 20 27 37 27 | 3a 0a 7c 09 09 09 09 69 |case '7'|:.|....i|
|00000ff0| 66 20 28 62 69 74 6d 61 | 73 6b 20 3d 3d 20 30 78 |f (bitma|sk == 0x|
|00001000| 66 66 29 0a 7c 09 09 09 | 09 09 6e 65 77 62 6d 61 |ff).|...|..newbma|
|00001010| 73 6b 28 29 3b 0a 7c 09 | 09 09 09 62 72 65 61 6b |sk();.|.|...break|
|00001020| 3b 0a 7c 09 09 09 63 61 | 73 65 20 27 38 27 3a 0a |;.|...ca|se '8':.|
|00001030| 7c 09 09 09 09 69 66 20 | 28 62 69 74 6d 61 73 6b ||....if |(bitmask|
|00001040| 20 3d 3d 20 30 78 37 66 | 29 0a 7c 09 09 09 09 09 | == 0x7f|).|.....|
|00001050| 20 6e 65 77 62 6d 61 73 | 6b 28 29 3b 0a 7c 09 09 | newbmas|k();.|..|
|00001060| 09 09 62 72 65 61 6b 3b | 0a 7c 09 09 09 64 65 66 |..break;|.|...def|
|00001070| 61 75 6c 74 3a 0a 7c 09 | 09 09 09 73 68 6f 77 28 |ault:.|.|...show(|
|00001080| 30 2c 22 49 6e 76 61 6c | 69 64 20 42 49 54 53 3d |0,"Inval|id BITS=|
|00001090| 22 29 3b 0a 7c 09 09 09 | 09 72 65 74 75 72 6e 3b |");.|...|.return;|
|000010a0| 0a 7c 09 09 7d 0a 7c 09 | 7d 0a 7c 0a 7c 09 63 6c |.|..}.|.|}.|.|.cl|
|000010b0| 73 28 29 3b 0a 7c 09 69 | 66 20 28 28 73 20 3d 20 |s();.|.i|f ((s = |
|000010c0| 73 74 72 73 74 72 28 62 | 75 66 2c 20 22 50 52 45 |strstr(b|uf, "PRE|
|000010d0| 46 49 58 3d 22 29 29 20 | 21 3d 20 4e 55 4c 4c 53 |FIX=")) |!= NULLS|
|000010e0| 29 20 7b 0a 7c 09 09 73 | 20 2b 3d 20 37 3b 0a 7c |) {.|..s| += 7;.||
|000010f0| 09 09 73 65 6e 64 5f 73 | 6c 6f 77 6c 79 28 22 5c |..send_s|lowly("\|
|00001100| 72 22 29 3b 0a 7c 09 09 | 73 65 6e 64 5f 73 6c 6f |r");.|..|send_slo|
|00001110| 77 6c 79 28 73 29 3b 0a | 7c 09 09 73 65 6e 64 5f |wly(s);.||..send_|
|00001120| 73 6c 6f 77 6c 79 28 22 | 5c 72 22 29 3b 0a 7c 09 |slowly("|\r");.|.|
|00001130| 09 73 20 2d 3d 20 37 3b | 0a 7c 09 09 2a 73 20 3d |.s -= 7;|.|..*s =|
|00001140| 20 27 5c 30 27 3b 0a 7c | 09 09 73 6c 65 65 70 28 | '\0';.||..sleep(|
|00001150| 32 29 3b 0a 7c 09 7d 0a | 7c 09 73 70 72 69 6e 74 |2);.|.}.||.sprint|
|00001160| 66 28 4d 73 67 2c 22 43 | 61 6c 6c 69 6e 67 20 25 |f(Msg,"C|alling %|
|00001170| 73 22 2c 62 75 66 29 3b | 0a 7c 09 53 3b 0a 7c 0a |s",buf);|.|.S;.|.|
|00001180| 7c 09 77 68 69 6c 65 20 | 28 69 73 73 70 61 63 65 ||.while |(isspace|
|00001190| 28 2a 62 75 66 29 20 26 | 26 20 2a 62 75 66 29 0a |(*buf) &|& *buf).|
|000011a0| 7c 09 09 62 75 66 2b 2b | 3b 0a 7c 0a 7c 09 69 66 ||..buf++|;.|.|.if|
|000011b0| 20 28 21 28 2a 62 75 66 | 29 29 0a 7c 09 09 72 65 | (!(*buf|)).|..re|
|000011c0| 74 75 72 6e 3b 0a 7c 0a | 7c 09 66 6f 72 20 28 6e |turn;.|.||.for (n|
|000011d0| 62 72 20 3d 20 62 75 66 | 3b 20 21 69 73 73 70 61 |br = buf|; !isspa|
|000011e0| 63 65 28 2a 62 75 66 29 | 20 26 26 20 2a 62 75 66 |ce(*buf)| && *buf|
|000011f0| 3b 20 62 75 66 2b 2b 29 | 0a 7c 09 09 3b 0a 7c 0a |; buf++)|.|..;.|.|
|00001200| 7c 09 2a 62 75 66 20 3d | 20 27 5c 30 27 3b 0a 7c ||.*buf =| '\0';.||
|00001210| 09 69 6e 74 64 65 6c 28 | 54 52 55 45 29 3b 0a 7c |.intdel(|TRUE);.||
|00001220| 09 78 63 64 69 61 6c 28 | 6e 62 72 29 3b 0a 7c 0a |.xcdial(|nbr);.|.|
|00001230| 7c 09 69 66 20 28 73 20 | 3d 20 73 74 72 73 74 72 ||.if (s |= strstr|
|00001240| 28 2b 2b 62 75 66 2c 20 | 22 53 43 52 49 50 54 3d |(++buf, |"SCRIPT=|
|00001250| 22 29 29 20 7b 0a 7c 09 | 09 73 20 2b 3d 20 37 3b |")) {.|.|.s += 7;|
|00001260| 0a 7c 09 09 74 20 3d 20 | 73 3b 0a 7c 09 09 77 68 |.|..t = |s;.|..wh|
|00001270| 69 6c 65 20 28 21 69 73 | 73 70 61 63 65 28 2a 74 |ile (!is|space(*t|
|00001280| 29 20 26 26 20 2a 74 20 | 21 3d 20 27 5c 30 27 29 |) && *t |!= '\0')|
|00001290| 0a 7c 09 09 09 74 2b 2b | 3b 0a 7c 09 09 2a 74 20 |.|...t++|;.|..*t |
|000012a0| 3d 20 27 5c 30 27 3b 0a | 7c 09 09 73 70 72 69 6e |= '\0';.||..sprin|
|000012b0| 74 66 28 64 64 73 6e 61 | 6d 65 2c 22 25 73 22 2c |tf(ddsna|me,"%s",|
|000012c0| 73 29 3b 0a 7c 09 09 73 | 5f 66 6c 61 67 20 3d 20 |s);.|..s|_flag = |
|000012d0| 6c 69 6e 6b 66 6c 61 67 | 20 3d 20 54 52 55 45 3b |linkflag| = TRUE;|
|000012e0| 0a 7c 09 7d 0a 7c 09 69 | 6e 74 64 65 6c 28 46 41 |.|.}.|.i|ntdel(FA|
|000012f0| 4c 53 45 29 3b 0a 7c 7d | 0a 7c 0a 7c 64 69 61 6c |LSE);.|}|.|.|dial|
|00001300| 5f 64 69 72 28 29 0a 7c | 7b 0a 7c 09 69 6e 74 20 |_dir().||{.|.int |
|00001310| 69 2c 20 63 3b 0a 7c 09 | 63 68 61 72 20 62 75 66 |i, c;.|.|char buf|
|00001320| 66 5b 35 5d 2c 20 66 5b | 53 4d 5f 42 55 46 46 5d |f[5], f[|SM_BUFF]|
|00001330| 3b 0a 7c 0a 7c 09 69 66 | 20 28 28 64 69 72 66 20 |;.|.|.if| ((dirf |
|00001340| 3d 20 6f 70 65 6e 66 69 | 6c 65 28 70 68 6f 6e 65 |= openfi|le(phone|
|00001350| 66 69 6c 65 29 29 20 3d | 3d 20 4e 55 4c 4c 46 29 |file)) =|= NULLF)|
|00001360| 20 7b 0a 7c 09 09 73 70 | 72 69 6e 74 66 28 4d 73 | {.|..sp|rintf(Ms|
|00001370| 67 2c 22 50 68 6f 6e 65 | 6c 69 73 74 20 27 25 73 |g,"Phone|list '%s|
|00001380| 27 20 6e 6f 74 20 66 6f | 75 6e 64 22 2c 70 68 6f |' not fo|und",pho|
|00001390| 6e 65 66 69 6c 65 29 3b | 0a 7c 09 09 53 3b 0a 7c |nefile);|.|..S;.||
|000013a0| 09 09 72 65 74 75 72 6e | 20 46 41 49 4c 55 52 45 |..return| FAILURE|
|000013b0| 3b 0a 7c 09 7d 0a 7c 0a | 7c 09 64 69 72 6e 75 6d |;.|.}.|.||.dirnum|
|000013c0| 20 3d 20 74 68 69 73 70 | 61 67 65 20 3d 20 30 3b | = thisp|age = 0;|
|000013d0| 0a 7c 09 6c 61 73 74 70 | 61 67 65 20 3d 20 2d 31 |.|.lastp|age = -1|
|000013e0| 3b 0a 7c 09 63 6c 73 28 | 29 3b 0a 7c 09 64 72 61 |;.|.cls(|);.|.dra|
|000013f0| 77 6c 69 6e 65 28 30 2c | 20 30 2c 20 43 4f 29 3b |wline(0,| 0, CO);|
|00001400| 0a 7c 09 74 74 67 6f 74 | 6f 28 31 2c 20 32 33 29 |.|.ttgot|o(1, 23)|
|00001410| 3b 0a 7c 09 73 68 6f 77 | 28 2d 31 2c 22 20 44 20 |;.|.show|(-1," D |
|00001420| 49 20 41 20 4c 20 49 20 | 4e 20 47 20 20 20 44 20 |I A L I |N G D |
|00001430| 49 20 52 20 45 20 43 20 | 54 20 4f 20 52 20 59 20 |I R E C |T O R Y |
|00001440| 22 29 3b 0a 7c 09 64 72 | 61 77 6c 69 6e 65 28 32 |");.|.dr|awline(2|
|00001450| 2c 20 30 2c 20 43 4f 29 | 3b 0a 7c 09 74 74 67 6f |, 0, CO)|;.|.ttgo|
|00001460| 74 6f 28 33 2c 20 30 29 | 3b 0a 7c 09 73 70 72 69 |to(3, 0)|;.|.spri|
|00001470| 6e 74 66 28 66 2c 22 20 | 20 20 20 20 25 25 2d 25 |ntf(f," | %%-%|
|00001480| 64 73 20 25 25 25 64 73 | 20 25 25 25 64 73 20 25 |ds %%%ds| %%%ds %|
|00001490| 25 2d 25 64 73 25 2a 73 | 5c 6e 22 2c 0a 7c 09 09 |%-%ds%*s|\n",.|..|
|000014a0| 4d 41 58 4e 41 4d 45 2c | 20 4d 41 58 4e 55 4d 42 |MAXNAME,| MAXNUMB|
|000014b0| 45 52 2c 20 4d 41 58 50 | 52 4f 54 4f 43 4f 4c 2c |ER, MAXP|ROTOCOL,|
|000014c0| 20 4d 41 58 53 43 52 49 | 50 54 2c 0a 7c 09 09 43 | MAXSCRI|PT,.|..C|
|000014d0| 4f 2d 4d 41 58 4e 41 4d | 45 2d 4d 41 58 4e 55 4d |O-MAXNAM|E-MAXNUM|
|000014e0| 42 45 52 2d 4d 41 58 50 | 52 4f 54 4f 43 4f 4c 2d |BER-MAXP|ROTOCOL-|
|000014f0| 4d 41 58 53 43 52 49 50 | 54 2d 38 2c 20 22 22 29 |MAXSCRIP|T-8, "")|
|00001500| 3b 0a 7c 09 73 70 72 69 | 6e 74 66 28 4d 73 67 2c |;.|.spri|ntf(Msg,|
|00001510| 20 66 2c 20 22 4e 41 4d | 45 22 2c 20 22 4e 55 4d | f, "NAM|E", "NUM|
|00001520| 42 45 52 22 2c 20 22 50 | 52 4f 54 4f 43 4f 4c 22 |BER", "P|ROTOCOL"|
|00001530| 2c 20 22 53 43 52 49 50 | 54 22 29 3b 0a 7c 09 73 |, "SCRIP|T");.|.s|
|00001540| 68 6f 77 28 2d 31 2c 4d | 73 67 29 3b 0a 7c 09 73 |how(-1,M|sg);.|.s|
|00001550| 63 72 6f 6c 6c 5f 64 69 | 72 28 29 3b 0a 7c 09 77 |croll_di|r();.|.w|
|00001560| 68 69 6c 65 20 28 31 29 | 20 7b 0a 7c 09 09 74 74 |hile (1)| {.|..tt|
|00001570| 67 6f 74 6f 28 4c 49 2d | 31 2c 20 30 29 3b 0a 7c |goto(LI-|1, 0);.||
|00001580| 09 09 66 70 72 69 6e 74 | 66 28 74 66 70 2c 0a 7c |..fprint|f(tfp,.||
|00001590| 09 09 22 3d 3d 3e 20 20 | 20 20 20 5b 23 5d 20 44 |.."==> | [#] D|
|000015a0| 69 61 6c 20 45 6e 74 72 | 79 20 20 20 5b 4d 5d 61 |ial Entr|y [M]a|
|000015b0| 6e 75 61 6c 20 44 69 61 | 6c 20 20 20 5b 58 5d 69 |nual Dia|l [X]i|
|000015c0| 74 20 20 20 5b 4e 5d 65 | 78 74 20 20 20 5b 50 5d |t [N]e|xt [P]|
|000015d0| 72 65 76 69 6f 75 73 22 | 29 3b 0a 7c 09 09 74 74 |revious"|);.|..tt|
|000015e0| 67 6f 74 6f 28 4c 49 2d | 31 2c 20 34 29 3b 0a 7c |goto(LI-|1, 4);.||
|000015f0| 09 09 77 68 69 6c 65 20 | 28 31 29 20 7b 0a 7c 09 |..while |(1) {.|.|
|00001600| 09 09 63 20 3d 20 74 6f | 75 70 70 65 72 28 64 67 |..c = to|upper(dg|
|00001610| 65 74 63 68 28 29 29 3b | 0a 7c 09 09 09 69 66 20 |etch());|.|...if |
|00001620| 28 63 20 3d 3d 20 27 5c | 62 27 29 0a 7c 09 09 09 |(c == '\|b').|...|
|00001630| 09 63 6f 6e 74 69 6e 75 | 65 3b 0a 7c 09 09 09 69 |.continu|e;.|...i|
|00001640| 66 20 28 63 20 3d 3d 20 | 27 4e 27 20 7c 7c 20 63 |f (c == |'N' || c|
|00001650| 20 3d 3d 20 27 5c 6e 27 | 20 7c 7c 20 63 20 3d 3d | == '\n'| || c ==|
|00001660| 20 27 20 27 29 20 7b 0a | 7c 09 09 09 09 69 66 20 | ' ') {.||....if |
|00001670| 28 74 68 69 73 70 61 67 | 65 20 3e 20 28 69 6e 74 |(thispag|e > (int|
|00001680| 29 28 28 31 30 30 30 2f | 28 4c 49 2d 36 29 29 2d |)((1000/|(LI-6))-|
|00001690| 31 29 20 7c 7c 20 74 68 | 69 73 70 61 67 65 20 3d |1) || th|ispage =|
|000016a0| 3d 20 6c 61 73 74 70 61 | 67 65 29 0a 7c 09 09 09 |= lastpa|ge).|...|
|000016b0| 09 09 73 68 6f 77 28 30 | 2c 22 4c 61 73 74 20 70 |..show(0|,"Last p|
|000016c0| 61 67 65 22 29 3b 0a 7c | 09 09 09 09 65 6c 73 65 |age");.||....else|
|000016d0| 0a 7c 09 09 09 09 09 74 | 68 69 73 70 61 67 65 2b |.|.....t|hispage+|
|000016e0| 2b 2c 0a 7c 09 09 09 09 | 09 73 63 72 6f 6c 6c 5f |+,.|....|.scroll_|
|000016f0| 64 69 72 28 29 3b 0a 7c | 09 09 09 09 62 72 65 61 |dir();.||....brea|
|00001700| 6b 3b 0a 7c 09 09 09 7d | 0a 7c 09 09 09 65 6c 73 |k;.|...}|.|...els|
|00001710| 65 20 69 66 20 28 63 20 | 3d 3d 20 27 50 27 20 26 |e if (c |== 'P' &|
|00001720| 26 20 64 69 72 6e 75 6d | 20 3e 20 31 29 20 7b 0a |& dirnum| > 1) {.|
|00001730| 7c 09 09 09 09 69 66 20 | 28 74 68 69 73 70 61 67 ||....if |(thispag|
|00001740| 65 20 3d 3d 20 30 29 0a | 7c 09 09 09 09 09 73 68 |e == 0).||.....sh|
|00001750| 6f 77 28 30 2c 22 46 69 | 72 73 74 20 70 61 67 65 |ow(0,"Fi|rst page|
|00001760| 22 29 3b 0a 7c 09 09 09 | 09 65 6c 73 65 0a 7c 09 |");.|...|.else.|.|
|00001770| 09 09 09 09 74 68 69 73 | 70 61 67 65 2d 2d 2c 0a |....this|page--,.|
|00001780| 7c 09 09 09 09 09 73 63 | 72 6f 6c 6c 5f 64 69 72 ||.....sc|roll_dir|
|00001790| 28 29 3b 0a 7c 09 09 09 | 09 62 72 65 61 6b 3b 0a |();.|...|.break;.|
|000017a0| 7c 09 09 09 7d 0a 7c 09 | 09 09 65 6c 73 65 20 69 ||...}.|.|..else i|
|000017b0| 66 20 28 63 20 3d 3d 20 | 27 58 27 29 20 7b 0a 7c |f (c == |'X') {.||
|000017c0| 09 09 09 09 63 6c 73 28 | 29 3b 0a 7c 09 09 09 09 |....cls(|);.|....|
|000017d0| 66 63 6c 6f 73 65 28 64 | 69 72 66 29 3b 0a 7c 09 |fclose(d|irf);.|.|
|000017e0| 09 09 09 72 65 74 75 72 | 6e 20 46 41 49 4c 55 52 |...retur|n FAILUR|
|000017f0| 45 3b 0a 7c 09 09 09 7d | 0a 7c 09 09 09 65 6c 73 |E;.|...}|.|...els|
|00001800| 65 20 69 66 20 28 63 20 | 3d 3d 20 27 4d 27 29 20 |e if (c |== 'M') |
|00001810| 7b 0a 7c 09 09 09 09 69 | 66 20 28 6d 61 6e 5f 64 |{.|....i|f (man_d|
|00001820| 69 61 6c 28 29 29 20 7b | 0a 7c 09 09 09 09 09 66 |ial()) {|.|.....f|
|00001830| 63 6c 6f 73 65 28 64 69 | 72 66 29 3b 0a 7c 09 09 |close(di|rf);.|..|
|00001840| 09 09 09 72 65 74 65 72 | 6d 20 3d 20 54 52 55 45 |...reter|m = TRUE|
|00001850| 3b 0a 7c 09 09 09 09 09 | 72 65 74 75 72 6e 20 53 |;.|.....|return S|
|00001860| 55 43 43 45 53 53 3b 0a | 7c 09 09 09 09 7d 0a 7c |UCCESS;.||....}.||
|00001870| 09 09 09 09 72 65 74 65 | 72 6d 20 3d 20 46 41 4c |....rete|rm = FAL|
|00001880| 53 45 3b 0a 7c 09 09 09 | 09 62 72 65 61 6b 3b 0a |SE;.|...|.break;.|
|00001890| 7c 09 09 09 7d 0a 7c 09 | 09 09 65 6c 73 65 20 69 ||...}.|.|..else i|
|000018a0| 66 20 28 69 73 64 69 67 | 69 74 28 63 29 29 20 7b |f (isdig|it(c)) {|
|000018b0| 0a 7c 09 09 09 09 62 75 | 66 66 5b 30 5d 20 3d 20 |.|....bu|ff[0] = |
|000018c0| 63 3b 0a 7c 09 09 09 09 | 66 70 75 74 63 28 63 2c |c;.|....|fputc(c,|
|000018d0| 74 66 70 29 3b 0a 7c 09 | 09 09 09 66 6f 72 20 28 |tfp);.|.|...for (|
|000018e0| 69 3d 31 3b 20 69 3c 34 | 3b 20 2b 2b 69 29 20 7b |i=1; i<4|; ++i) {|
|000018f0| 0a 7c 09 09 09 09 09 62 | 75 66 66 5b 69 5d 20 3d |.|.....b|uff[i] =|
|00001900| 20 67 65 74 63 68 61 72 | 28 29 3b 0a 7c 09 09 09 | getchar|();.|...|
|00001910| 09 09 69 66 20 28 62 75 | 66 66 5b 69 5d 3d 3d 27 |..if (bu|ff[i]=='|
|00001920| 5c 62 27 29 20 7b 0a 7c | 09 09 09 09 09 09 69 66 |\b') {.||......if|
|00001930| 20 28 69 3e 30 29 0a 7c | 09 09 09 09 09 09 09 66 | (i>0).||.......f|
|00001940| 70 72 69 6e 74 66 28 74 | 66 70 2c 22 5c 62 20 5c |printf(t|fp,"\b \|
|00001950| 62 22 29 2c 0a 7c 09 09 | 09 09 09 09 09 69 20 2d |b"),.|..|.....i -|
|00001960| 3d 20 32 3b 0a 7c 09 09 | 09 09 09 09 65 6c 73 65 |= 2;.|..|....else|
|00001970| 0a 7c 09 09 09 09 09 09 | 09 69 20 3d 20 2d 31 3b |.|......|.i = -1;|
|00001980| 0a 7c 09 09 09 09 09 09 | 63 6f 6e 74 69 6e 75 65 |.|......|continue|
|00001990| 3b 0a 7c 09 09 09 09 09 | 7d 0a 7c 09 09 09 09 09 |;.|.....|}.|.....|
|000019a0| 66 70 75 74 63 28 62 75 | 66 66 5b 69 5d 2c 74 66 |fputc(bu|ff[i],tf|
|000019b0| 70 29 3b 0a 7c 09 09 09 | 09 09 69 66 20 28 62 75 |p);.|...|..if (bu|
|000019c0| 66 66 5b 69 5d 3d 3d 27 | 5c 6e 27 20 7c 7c 20 62 |ff[i]=='|\n' || b|
|000019d0| 75 66 66 5b 69 5d 3d 3d | 27 5c 72 27 29 0a 7c 09 |uff[i]==|'\r').|.|
|000019e0| 09 09 09 09 09 62 72 65 | 61 6b 3b 0a 7c 09 09 09 |.....bre|ak;.|...|
|000019f0| 09 7d 0a 7c 09 09 09 09 | 69 66 20 28 69 20 3d 3d |.}.|....|if (i ==|
|00001a00| 20 30 29 20 7b 0a 7c 09 | 09 09 09 09 72 65 74 65 | 0) {.|.|....rete|
|00001a10| 72 6d 20 3d 20 46 41 4c | 53 45 3b 0a 7c 09 09 09 |rm = FAL|SE;.|...|
|00001a20| 09 09 62 72 65 61 6b 3b | 0a 7c 09 09 09 09 7d 0a |..break;|.|....}.|
|00001a30| 7c 09 09 09 09 62 75 66 | 66 5b 2b 2b 69 5d 20 3d ||....buf|f[++i] =|
|00001a40| 20 27 5c 30 27 3b 0a 7c | 09 09 09 09 69 66 20 28 | '\0';.||....if (|
|00001a50| 64 69 61 6c 5f 65 6e 74 | 72 79 28 61 74 6f 69 28 |dial_ent|ry(atoi(|
|00001a60| 62 75 66 66 29 29 29 20 | 7b 0a 7c 09 09 09 09 09 |buff))) |{.|.....|
|00001a70| 66 63 6c 6f 73 65 28 64 | 69 72 66 29 3b 0a 7c 09 |fclose(d|irf);.|.|
|00001a80| 09 09 09 09 72 65 74 65 | 72 6d 20 3d 20 54 52 55 |....rete|rm = TRU|
|00001a90| 45 3b 0a 7c 09 09 09 09 | 09 72 65 74 75 72 6e 20 |E;.|....|.return |
|00001aa0| 53 55 43 43 45 53 53 3b | 0a 7c 09 09 09 09 7d 0a |SUCCESS;|.|....}.|
|00001ab0| 7c 09 09 09 09 72 65 74 | 65 72 6d 20 3d 20 46 41 ||....ret|erm = FA|
|00001ac0| 4c 53 45 3b 0a 7c 09 09 | 09 09 62 72 65 61 6b 3b |LSE;.|..|..break;|
|00001ad0| 0a 7c 09 09 09 7d 0a 7c | 09 09 7d 0a 7c 09 7d 0a |.|...}.||..}.|.}.|
|00001ae0| 7c 7d 0a 7c 73 74 61 74 | 69 63 20 64 69 61 6c 5f ||}.|stat|ic dial_|
|00001af0| 65 6e 74 72 79 28 63 68 | 6f 69 63 65 29 0a 7c 73 |entry(ch|oice).|s|
|00001b00| 68 6f 72 74 20 63 68 6f | 69 63 65 3b 0a 7c 7b 0a |hort cho|ice;.|{.|
|00001b10| 7c 09 63 68 61 72 20 62 | 75 66 66 5b 31 32 31 5d ||.char b|uff[121]|
|00001b20| 3b 0a 7c 0a 7c 09 69 66 | 20 28 63 68 6f 69 63 65 |;.|.|.if| (choice|
|00001b30| 20 3d 3d 20 30 29 0a 7c | 09 09 72 65 74 75 72 6e | == 0).||..return|
|00001b40| 20 46 41 49 4c 55 52 45 | 3b 0a 7c 09 72 65 77 69 | FAILURE|;.|.rewi|
|00001b50| 6e 64 28 64 69 72 66 29 | 3b 0a 7c 09 77 68 69 6c |nd(dirf)|;.|.whil|
|00001b60| 65 20 28 63 68 6f 69 63 | 65 2d 2d 29 20 7b 0a 7c |e (choic|e--) {.||
|00001b70| 09 09 69 66 20 28 66 67 | 65 74 73 28 62 75 66 66 |..if (fg|ets(buff|
|00001b80| 2c 20 31 32 30 2c 20 64 | 69 72 66 29 20 3d 3d 20 |, 120, d|irf) == |
|00001b90| 4e 55 4c 4c 53 29 20 7b | 0a 7c 09 09 09 73 68 6f |NULLS) {|.|...sho|
|00001ba0| 77 28 30 2c 22 4e 6f 6e | 65 78 69 73 74 65 6e 74 |w(0,"Non|existent|
|00001bb0| 20 65 6e 74 72 79 22 29 | 3b 0a 7c 09 09 09 72 65 | entry")|;.|...re|
|00001bc0| 74 75 72 6e 20 46 41 49 | 4c 55 52 45 3b 0a 7c 09 |turn FAI|LURE;.|.|
|00001bd0| 09 7d 0a 7c 09 7d 0a 7c | 09 70 61 72 73 65 5f 65 |.}.|.}.||.parse_e|
|00001be0| 6e 74 72 79 28 62 75 66 | 66 29 3b 0a 7c 09 72 65 |ntry(buf|f);.|.re|
|00001bf0| 74 75 72 6e 20 53 55 43 | 43 45 53 53 3b 0a 7c 7d |turn SUC|CESS;.|}|
|00001c00| 0a 7c 0a 7c 73 74 61 74 | 69 63 20 6d 61 6e 5f 64 |.|.|stat|ic man_d|
|00001c10| 69 61 6c 28 29 0a 7c 7b | 0a 7c 09 74 74 67 6f 74 |ial().|{|.|.ttgot|
|00001c20| 6f 28 4c 49 2d 31 2c 20 | 30 29 3b 0a 7c 09 63 6c |o(LI-1, |0);.|.cl|
|00001c30| 5f 65 6e 64 28 29 3b 0a | 7c 09 66 70 72 69 6e 74 |_end();.||.fprint|
|00001c40| 66 28 74 66 70 2c 22 4e | 75 6d 62 65 72 20 74 6f |f(tfp,"N|umber to|
|00001c50| 20 64 69 61 6c 3a 20 22 | 29 3b 0a 7c 09 67 65 74 | dial: "|);.|.get|
|00001c60| 6c 69 6e 65 28 29 3b 0a | 7c 09 69 66 20 28 21 6c |line();.||.if (!l|
|00001c70| 69 6e 65 5b 30 5d 29 0a | 7c 09 09 72 65 74 75 72 |ine[0]).||..retur|
|00001c80| 6e 20 46 41 49 4c 55 52 | 45 3b 0a 7c 09 70 61 72 |n FAILUR|E;.|.par|
|00001c90| 73 65 5f 65 6e 74 72 79 | 28 6c 69 6e 65 29 3b 0a |se_entry|(line);.|
|00001ca0| 7c 09 72 65 74 75 72 6e | 20 53 55 43 43 45 53 53 ||.return| SUCCESS|
|00001cb0| 3b 0a 7c 7d 0a 7c 0a 7c | 72 65 64 69 61 6c 28 29 |;.|}.|.||redial()|
|00001cc0| 0a 7c 7b 0a 7c 09 63 68 | 61 72 20 2a 73 3b 0a 7c |.|{.|.ch|ar *s;.||
|00001cd0| 0a 7c 09 69 66 20 28 6c | 61 73 74 5f 6e 62 72 20 |.|.if (l|ast_nbr |
|00001ce0| 3d 3d 20 4e 55 4c 4c 53 | 29 20 7b 0a 7c 09 09 73 |== NULLS|) {.|..s|
|00001cf0| 68 6f 77 28 31 2c 22 52 | 45 44 49 41 4c 20 46 41 |how(1,"R|EDIAL FA|
|00001d00| 49 4c 55 52 45 22 29 3b | 0a 7c 09 09 72 65 74 75 |ILURE");|.|..retu|
|00001d10| 72 6e 20 2d 31 3b 0a 7c | 09 7d 0a 7c 0a 7c 09 73 |rn -1;.||.}.|.|.s|
|00001d20| 20 3d 20 73 74 72 64 75 | 70 28 6c 61 73 74 5f 6e | = strdu|p(last_n|
|00001d30| 62 72 29 3b 0a 7c 09 78 | 63 64 69 61 6c 28 73 29 |br);.|.x|cdial(s)|
|00001d40| 3b 0a 7c 09 66 72 65 65 | 28 73 29 3b 0a 7c 09 72 |;.|.free|(s);.|.r|
|00001d50| 65 74 75 72 6e 20 30 3b | 0a 7c 7d 0a 53 48 41 52 |eturn 0;|.|}.SHAR|
|00001d60| 5f 45 4f 46 0a 69 66 20 | 74 65 73 74 20 36 34 32 |_EOF.if |test 642|
|00001d70| 38 20 2d 6e 65 20 22 60 | 77 63 20 2d 63 20 3c 20 |8 -ne "`|wc -c < |
|00001d80| 27 78 63 64 69 61 6c 2e | 63 27 60 22 0a 74 68 65 |'xcdial.|c'`".the|
|00001d90| 6e 0a 09 65 63 68 6f 20 | 73 68 61 72 3a 20 65 72 |n..echo |shar: er|
|00001da0| 72 6f 72 20 74 72 61 6e | 73 6d 69 74 74 69 6e 67 |ror tran|smitting|
|00001db0| 20 22 27 78 63 64 69 61 | 6c 2e 63 27 22 20 27 28 | "'xcdia|l.c'" '(|
|00001dc0| 73 68 6f 75 6c 64 20 68 | 61 76 65 20 62 65 65 6e |should h|ave been|
|00001dd0| 20 36 34 32 38 20 63 68 | 61 72 61 63 74 65 72 73 | 6428 ch|aracters|
|00001de0| 29 27 0a 66 69 0a 66 69 | 20 23 20 65 6e 64 20 6f |)'.fi.fi| # end o|
|00001df0| 66 20 6f 76 65 72 77 72 | 69 74 69 6e 67 20 63 68 |f overwr|iting ch|
|00001e00| 65 63 6b 0a 65 63 68 6f | 20 73 68 61 72 3a 20 65 |eck.echo| shar: e|
|00001e10| 78 74 72 61 63 74 69 6e | 67 20 22 27 78 63 6d 61 |xtractin|g "'xcma|
|00001e20| 69 6e 2e 63 27 22 20 27 | 28 31 35 37 30 37 20 63 |in.c'" '|(15707 c|
|00001e30| 68 61 72 61 63 74 65 72 | 73 29 27 0a 69 66 20 74 |haracter|s)'.if t|
|00001e40| 65 73 74 20 2d 66 20 27 | 78 63 6d 61 69 6e 2e 63 |est -f '|xcmain.c|
|00001e50| 27 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |'.then..|echo sha|
|00001e60| 72 3a 20 77 69 6c 6c 20 | 6e 6f 74 20 6f 76 65 72 |r: will |not over|
|00001e70| 2d 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 20 |-write e|xisting |
|00001e80| 66 69 6c 65 20 22 27 78 | 63 6d 61 69 6e 2e 63 27 |file "'x|cmain.c'|
|00001e90| 22 0a 65 6c 73 65 0a 73 | 65 64 20 27 73 2f 5e 7c |".else.s|ed 's/^||
|00001ea0| 2f 2f 27 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |//' << \|SHAR_EOF|
|00001eb0| 20 3e 20 27 78 63 6d 61 | 69 6e 2e 63 27 0a 7c 2f | > 'xcma|in.c'.|/|
|00001ec0| 2a 09 78 63 6d 61 69 6e | 2e 63 20 2d 2d 20 6d 61 |*.xcmain|.c -- ma|
|00001ed0| 69 6e 20 6d 6f 64 75 6c | 65 20 66 6f 72 20 58 43 |in modul|e for XC|
|00001ee0| 0a 7c 09 54 68 69 73 20 | 66 69 6c 65 20 75 73 65 |.|.This |file use|
|00001ef0| 73 20 34 2d 63 68 61 72 | 61 63 74 65 72 20 74 61 |s 4-char|acter ta|
|00001f00| 62 73 74 6f 70 73 0a 7c | 2a 2f 0a 7c 0a 7c 23 69 |bstops.||*/.|.|#i|
|00001f10| 6e 63 6c 75 64 65 20 3c | 73 79 73 2f 74 79 70 65 |nclude <|sys/type|
|00001f20| 73 2e 68 3e 0a 7c 23 69 | 6e 63 6c 75 64 65 20 3c |s.h>.|#i|nclude <|
|00001f30| 73 74 64 69 6f 2e 68 3e | 0a 7c 23 69 6e 63 6c 75 |stdio.h>|.|#inclu|
|00001f40| 64 65 20 3c 73 69 67 6e | 61 6c 2e 68 3e 0a 7c 23 |de <sign|al.h>.|#|
|00001f50| 69 6e 63 6c 75 64 65 20 | 3c 63 74 79 70 65 2e 68 |include |<ctype.h|
|00001f60| 3e 0a 7c 23 69 6e 63 6c | 75 64 65 20 3c 74 65 72 |>.|#incl|ude <ter|
|00001f70| 6d 69 6f 2e 68 3e 0a 7c | 23 69 66 64 65 66 20 54 |mio.h>.||#ifdef T|
|00001f80| 36 30 30 30 0a 7c 23 69 | 6e 63 6c 75 64 65 20 3c |6000.|#i|nclude <|
|00001f90| 73 79 73 2f 69 6f 63 74 | 6c 2e 68 3e 0a 7c 23 65 |sys/ioct|l.h>.|#e|
|00001fa0| 6e 64 69 66 0a 7c 23 69 | 6e 63 6c 75 64 65 20 3c |ndif.|#i|nclude <|
|00001fb0| 73 65 74 6a 6d 70 2e 68 | 3e 0a 7c 23 69 6e 63 6c |setjmp.h|>.|#incl|
|00001fc0| 75 64 65 20 22 78 63 2e | 68 22 0a 7c 0a 7c 73 74 |ude "xc.|h".|.|st|
|00001fd0| 61 74 69 63 20 63 68 61 | 72 20 76 65 72 73 69 6f |atic cha|r versio|
|00001fe0| 6e 5b 5d 3d 22 40 28 23 | 29 58 43 20 33 2e 30 62 |n[]="@(#|)XC 3.0b|
|00001ff0| 20 4a 50 52 61 64 6c 65 | 79 20 30 38 20 4a 75 6c | JPRadle|y 08 Jul|
|00002000| 79 20 39 31 22 3b 0a 7c | 0a 7c 23 64 65 66 69 6e |y 91";.||.|#defin|
|00002010| 65 20 52 65 73 75 6d 65 | 5f 4e 6f 74 5f 41 6c 6c |e Resume|_Not_All|
|00002020| 6f 77 65 64 09 31 0a 7c | 0a 7c 6a 6d 70 5f 62 75 |owed.1.||.|jmp_bu|
|00002030| 66 20 65 72 72 65 74 3b | 09 09 09 2f 2a 20 6e 6f |f erret;|.../* no|
|00002040| 6e 2d 6c 6f 63 61 6c 20 | 65 72 72 6f 72 20 72 65 |n-local |error re|
|00002050| 74 75 72 6e 20 2a 2f 0a | 7c 0a 7c 73 68 6f 72 74 |turn */.||.|short|
|00002060| 0a 7c 09 61 75 74 6f 66 | 6c 61 67 20 3d 20 46 41 |.|.autof|lag = FA|
|00002070| 4c 53 45 2c 09 2f 2a 20 | 46 6c 61 67 20 66 6f 72 |LSE,./* |Flag for|
|00002080| 20 61 75 74 6f 6d 61 74 | 69 63 20 63 61 70 74 75 | automat|ic captu|
|00002090| 72 69 6e 67 20 2a 2f 0a | 7c 09 62 61 64 6c 69 6e |ring */.||.badlin|
|000020a0| 65 20 3d 20 46 41 4c 53 | 45 2c 09 2f 2a 20 42 61 |e = FALS|E,./* Ba|
|000020b0| 64 20 74 65 6c 65 70 68 | 6f 6e 65 20 6c 69 6e 65 |d teleph|one line|
|000020c0| 3f 20 2a 2f 0a 7c 09 63 | 69 73 6d 6f 64 65 20 3d |? */.|.c|ismode =|
|000020d0| 20 54 52 55 45 2c 09 09 | 2f 2a 20 52 65 73 70 6f | TRUE,..|/* Respo|
|000020e0| 6e 64 20 74 6f 20 43 49 | 53 20 22 45 4e 51 22 20 |nd to CI|S "ENQ" |
|000020f0| 2a 2f 0a 7c 09 63 72 5f | 61 64 64 20 3d 20 54 52 |*/.|.cr_|add = TR|
|00002100| 55 45 2c 09 09 2f 2a 20 | 41 64 64 20 63 61 72 72 |UE,../* |Add carr|
|00002110| 69 61 67 65 20 72 65 74 | 75 72 6e 73 20 66 6f 72 |iage ret|urns for|
|00002120| 20 42 2b 20 75 70 6c 6f | 61 64 73 20 2a 2f 0a 7c | B+ uplo|ads */.||
|00002130| 09 68 64 70 6c 78 66 6c | 61 67 20 3d 20 46 41 4c |.hdplxfl|ag = FAL|
|00002140| 53 45 2c 09 2f 2a 20 46 | 6c 61 67 20 66 6f 72 20 |SE,./* F|lag for |
|00002150| 68 61 6c 66 2d 64 75 70 | 6c 65 78 20 6d 6f 64 65 |half-dup|lex mode|
|00002160| 20 2a 2f 0a 7c 09 6e 6c | 6d 6f 64 65 20 3d 20 54 | */.|.nl|mode = T|
|00002170| 52 55 45 2c 09 09 2f 2a | 20 4d 61 70 20 6e 65 77 |RUE,../*| Map new|
|00002180| 6c 69 6e 65 73 20 74 6f | 20 63 61 72 72 69 61 67 |lines to| carriag|
|00002190| 65 20 72 65 74 75 72 6e | 73 20 2a 2f 0a 7c 09 72 |e return|s */.|.r|
|000021a0| 65 74 65 72 6d 20 3d 20 | 46 41 4c 53 45 2c 09 09 |eterm = |FALSE,..|
|000021b0| 2f 2a 20 4e 6f 20 6a 75 | 6d 70 69 6e 67 20 69 6e |/* No ju|mping in|
|000021c0| 74 6f 20 74 65 72 6d 69 | 6e 61 6c 20 6d 6f 64 65 |to termi|nal mode|
|000021d0| 20 2a 2f 0a 7c 09 73 74 | 61 74 5f 66 6c 61 67 20 | */.|.st|at_flag |
|000021e0| 3d 20 46 41 4c 53 45 2c | 09 2f 2a 20 46 6c 61 67 |= FALSE,|./* Flag|
|000021f0| 20 66 6f 72 20 73 74 61 | 74 75 73 20 64 69 73 70 | for sta|tus disp|
|00002200| 6c 61 79 20 2a 2f 0a 7c | 09 65 6f 66 5f 66 6c 61 |lay */.||.eof_fla|
|00002210| 67 20 3d 20 46 41 4c 53 | 45 3b 09 2f 2a 20 46 6c |g = FALS|E;./* Fl|
|00002220| 61 67 20 74 6f 20 71 75 | 69 74 20 61 20 73 63 72 |ag to qu|it a scr|
|00002230| 69 70 74 20 2a 2f 0a 7c | 0a 7c 69 6e 74 20 73 5f |ipt */.||.|int s_|
|00002240| 63 69 73 28 29 2c 20 73 | 5f 73 65 74 28 29 2c 20 |cis(), s|_set(), |
|00002250| 73 5f 65 78 69 74 28 29 | 2c 20 73 5f 73 68 65 6c |s_exit()|, s_shel|
|00002260| 6c 28 29 3b 0a 7c 0a 7c | 63 68 61 72 20 4d 73 67 |l();.|.||char Msg|
|00002270| 5b 53 4d 5f 42 55 46 46 | 5d 3b 0a 7c 0a 7c 46 49 |[SM_BUFF|];.|.|FI|
|00002280| 4c 45 20 2a 74 66 70 3b | 0a 7c 0a 7c 73 74 72 75 |LE *tfp;|.|.|stru|
|00002290| 63 74 20 74 65 72 6d 69 | 6f 20 6e 65 77 6d 6f 64 |ct termi|o newmod|
|000022a0| 65 2c 20 6f 6c 64 6d 6f | 64 65 2c 20 73 69 67 6d |e, oldmo|de, sigm|
|000022b0| 6f 64 65 3b 0a 7c 0a 7c | 73 74 61 74 69 63 20 63 |ode;.|.||static c|
|000022c0| 68 61 72 09 2a 73 74 61 | 74 66 6d 74 20 3d 20 22 |har.*sta|tfmt = "|
|000022d0| 5c 74 5c 74 25 2d 38 73 | 20 25 32 35 73 20 25 73 |\t\t%-8s| %25s %s|
|000022e0| 5c 6e 22 2c 0a 7c 09 09 | 09 6f 6c 64 73 68 65 6c |\n",.|..|.oldshel|
|000022f0| 6c 5b 53 4d 5f 42 55 46 | 46 5d 3b 0a 7c 0a 7c 73 |l[SM_BUF|F];.|.|s|
|00002300| 74 61 74 69 63 20 73 5f | 73 63 72 69 70 74 28 29 |tatic s_|script()|
|00002310| 2c 20 73 5f 78 6d 6f 64 | 65 6d 28 29 2c 20 73 5f |, s_xmod|em(), s_|
|00002320| 74 65 72 6d 28 29 2c 20 | 73 5f 68 65 6c 70 28 29 |term(), |s_help()|
|00002330| 2c 20 73 5f 64 69 61 6c | 28 29 2c 20 70 75 74 74 |, s_dial|(), putt|
|00002340| 61 6b 65 28 29 2c 0a 7c | 09 09 53 45 54 5f 37 62 |ake(),.||..SET_7b|
|00002350| 69 74 28 29 2c 20 53 45 | 54 5f 63 72 28 29 2c 20 |it(), SE|T_cr(), |
|00002360| 53 45 54 5f 63 69 73 28 | 29 2c 20 53 45 54 5f 6e |SET_cis(|), SET_n|
|00002370| 6c 28 29 2c 20 53 45 54 | 5f 70 75 72 67 65 28 29 |l(), SET|_purge()|
|00002380| 2c 20 53 45 54 5f 78 6f | 66 66 28 29 2c 0a 7c 09 |, SET_xo|ff(),.|.|
|00002390| 09 53 45 54 5f 68 61 6c | 66 64 70 6c 78 28 29 2c |.SET_hal|fdplx(),|
|000023a0| 20 53 45 54 5f 62 70 73 | 28 29 2c 20 53 45 54 5f | SET_bps|(), SET_|
|000023b0| 61 75 74 6f 63 61 70 74 | 28 29 2c 20 53 45 54 5f |autocapt|(), SET_|
|000023c0| 63 66 69 6c 65 28 29 2c | 20 53 45 54 5f 70 66 69 |cfile(),| SET_pfi|
|000023d0| 6c 65 28 29 3b 0a 7c 0a | 7c 65 78 74 65 72 6e 20 |le();.|.||extern |
|000023e0| 73 68 6f 72 74 20 73 63 | 72 69 70 74 66 6c 61 67 |short sc|riptflag|
|000023f0| 3b 0a 7c 65 78 74 65 72 | 6e 20 76 6f 69 64 20 42 |;.|exter|n void B|
|00002400| 5f 54 72 61 6e 73 66 65 | 72 28 29 2c 20 64 62 67 |_Transfe|r(), dbg|
|00002410| 6c 6f 67 28 29 2c 20 6d | 61 74 74 61 63 68 28 29 |log(), m|attach()|
|00002420| 2c 20 74 65 72 6d 69 6e | 61 6c 28 29 2c 20 78 72 |, termin|al(), xr|
|00002430| 65 63 65 69 76 65 28 29 | 2c 20 78 73 65 6e 64 28 |eceive()|, xsend(|
|00002440| 29 2c 0a 7c 09 09 09 67 | 65 74 5f 74 74 79 70 65 |),.|...g|et_ttype|
|00002450| 28 29 3b 0a 7c 0a 7c 73 | 74 61 74 69 63 20 63 68 |();.|.|s|tatic ch|
|00002460| 61 72 09 2a 62 61 62 62 | 6c 65 5b 5d 20 3d 20 7b |ar.*babb|le[] = {|
|00002470| 0a 7c 09 22 55 73 61 67 | 65 3a 20 78 63 20 5b 2d |.|."Usag|e: xc [-|
|00002480| 6c 20 64 65 76 69 63 65 | 5d 20 5b 2d 74 5d 20 5b |l device|] [-t] [|
|00002490| 2d 67 20 66 69 6c 65 5d | 22 2c 0a 7c 09 22 22 2c |-g file]|",.|."",|
|000024a0| 0a 7c 09 22 2d 6c 20 64 | 65 76 69 63 65 20 20 55 |.|."-l d|evice U|
|000024b0| 73 65 20 27 64 65 76 69 | 63 65 27 20 61 73 20 74 |se 'devi|ce' as t|
|000024c0| 68 65 20 6d 6f 64 65 6d | 20 70 6f 72 74 20 28 65 |he modem| port (e|
|000024d0| 67 2c 20 2d 6c 20 2f 64 | 65 76 2f 74 74 79 30 30 |g, -l /d|ev/tty00|
|000024e0| 29 22 2c 0a 7c 09 22 2d | 74 20 20 20 20 20 20 20 |)",.|."-|t |
|000024f0| 20 20 45 6e 74 65 72 20 | 74 65 72 6d 69 6e 61 6c | Enter |terminal|
|00002500| 20 6d 6f 64 65 20 69 6d | 6d 65 64 69 61 74 65 6c | mode im|mediatel|
|00002510| 79 22 2c 0a 7c 09 22 2d | 73 20 66 69 6c 65 20 20 |y",.|."-|s file |
|00002520| 20 20 45 78 65 63 75 74 | 65 20 73 63 72 69 70 74 | Execut|e script|
|00002530| 20 66 69 6c 65 20 27 66 | 69 6c 65 27 20 69 6d 6d | file 'f|ile' imm|
|00002540| 65 64 69 61 74 65 6c 79 | 22 2c 0a 7c 09 22 22 2c |ediately|",.|."",|
|00002550| 0a 7c 09 4e 55 4c 4c 53 | 20 7d 3b 0a 7c 0a 7c 73 |.|.NULLS| };.|.|s|
|00002560| 74 61 74 69 63 20 76 6f | 69 64 20 75 73 61 67 65 |tatic vo|id usage|
|00002570| 28 29 0a 7c 7b 0a 7c 09 | 63 68 61 72 20 2a 2a 70 |().|{.|.|char **p|
|00002580| 74 72 3b 0a 7c 0a 7c 09 | 66 6f 72 20 28 70 74 72 |tr;.|.|.|for (ptr|
|00002590| 20 3d 20 62 61 62 62 6c | 65 3b 20 2a 70 74 72 20 | = babbl|e; *ptr |
|000025a0| 21 3d 20 4e 55 4c 4c 53 | 3b 20 70 74 72 2b 2b 29 |!= NULLS|; ptr++)|
|000025b0| 0a 7c 09 09 66 70 72 69 | 6e 74 66 28 74 66 70 2c |.|..fpri|ntf(tfp,|
|000025c0| 20 22 25 73 5c 6e 22 2c | 20 2a 70 74 72 29 3b 0a | "%s\n",| *ptr);.|
|000025d0| 7c 7d 0a 7c 0a 7c 73 74 | 72 75 63 74 20 6b 77 20 ||}.|.|st|ruct kw |
|000025e0| 7b 09 09 09 09 09 2f 2a | 20 55 73 65 64 20 62 79 |{...../*| Used by|
|000025f0| 20 63 6f 6d 6d 61 6e 64 | 20 70 61 72 73 69 6e 67 | command| parsing|
|00002600| 20 72 6f 75 74 69 6e 65 | 73 20 2a 2f 0a 7c 09 63 | routine|s */.|.c|
|00002610| 68 61 72 20 2a 6b 65 79 | 77 6f 72 64 3b 0a 7c 09 |har *key|word;.|.|
|00002620| 69 6e 74 20 28 2a 72 74 | 6e 29 28 29 3b 0a 7c 7d |int (*rt|n)();.|}|
|00002630| 3b 0a 7c 0a 7c 73 74 61 | 74 69 63 20 73 74 72 75 |;.|.|sta|tic stru|
|00002640| 63 74 20 6b 77 20 63 6d | 64 73 5b 5d 20 3d 20 7b |ct kw cm|ds[] = {|
|00002650| 20 2f 2a 20 43 6f 6d 6d | 61 6e 64 20 74 61 62 6c | /* Comm|and tabl|
|00002660| 65 20 2a 2f 0a 7c 09 7b | 22 63 22 2c 09 09 73 5f |e */.|.{|"c",..s_|
|00002670| 63 69 73 7d 2c 0a 7c 09 | 7b 22 73 22 2c 09 09 73 |cis},.|.|{"s",..s|
|00002680| 5f 73 63 72 69 70 74 7d | 2c 0a 7c 09 7b 22 68 22 |_script}|,.|.{"h"|
|00002690| 2c 09 09 68 61 6e 67 75 | 70 7d 2c 0a 7c 09 7b 22 |,..hangu|p},.|.{"|
|000026a0| 72 62 22 2c 09 09 73 5f | 78 6d 6f 64 65 6d 7d 2c |rb",..s_|xmodem},|
|000026b0| 0a 7c 09 7b 22 72 74 22 | 2c 09 09 73 5f 78 6d 6f |.|.{"rt"|,..s_xmo|
|000026c0| 64 65 6d 7d 2c 0a 7c 09 | 7b 22 73 62 22 2c 09 09 |dem},.|.|{"sb",..|
|000026d0| 73 5f 78 6d 6f 64 65 6d | 7d 2c 0a 7c 09 7b 22 73 |s_xmodem|},.|.{"s|
|000026e0| 74 22 2c 09 09 73 5f 78 | 6d 6f 64 65 6d 7d 2c 0a |t",..s_x|modem},.|
|000026f0| 7c 09 7b 22 73 65 74 22 | 2c 09 09 73 5f 73 65 74 ||.{"set"|,..s_set|
|00002700| 7d 2c 0a 7c 09 7b 22 74 | 22 2c 09 09 73 5f 74 65 |},.|.{"t|",..s_te|
|00002710| 72 6d 7d 2c 0a 7c 09 7b | 22 64 22 2c 09 09 73 5f |rm},.|.{|"d",..s_|
|00002720| 64 69 61 6c 7d 2c 0a 7c | 09 7b 22 71 22 2c 09 09 |dial},.||.{"q",..|
|00002730| 73 5f 65 78 69 74 7d 2c | 0a 7c 09 7b 22 78 22 2c |s_exit},|.|.{"x",|
|00002740| 09 09 73 5f 65 78 69 74 | 7d 2c 0a 7c 09 7b 22 65 |..s_exit|},.|.{"e|
|00002750| 78 69 74 22 2c 09 73 5f | 65 78 69 74 7d 2c 0a 7c |xit",.s_|exit},.||
|00002760| 09 7b 22 21 22 2c 09 09 | 73 5f 73 68 65 6c 6c 7d |.{"!",..|s_shell}|
|00002770| 2c 0a 7c 09 7b 22 21 21 | 22 2c 09 09 73 5f 73 68 |,.|.{"!!|",..s_sh|
|00002780| 65 6c 6c 7d 2c 0a 7c 09 | 7b 22 24 22 2c 09 09 73 |ell},.|.|{"$",..s|
|00002790| 5f 73 68 65 6c 6c 7d 2c | 0a 7c 09 7b 22 25 70 22 |_shell},|.|.{"%p"|
|000027a0| 2c 09 09 70 75 74 74 61 | 6b 65 7d 2c 0a 7c 09 7b |,..putta|ke},.|.{|
|000027b0| 22 25 74 22 2c 09 09 70 | 75 74 74 61 6b 65 7d 2c |"%t",..p|uttake},|
|000027c0| 0a 7c 09 7b 22 68 65 6c | 70 22 2c 09 73 5f 68 65 |.|.{"hel|p",.s_he|
|000027d0| 6c 70 7d 2c 0a 7c 09 7b | 22 3f 22 2c 09 09 73 5f |lp},.|.{|"?",..s_|
|000027e0| 68 65 6c 70 7d 2c 0a 7c | 09 7b 4e 55 4c 4c 53 2c |help},.||.{NULLS,|
|000027f0| 09 09 30 7d 0a 7c 7d 3b | 0a 7c 0a 7c 2f 2a 20 43 |..0}.|};|.|.|/* C|
|00002800| 61 74 63 68 20 61 20 73 | 69 67 6e 61 6c 20 61 6e |atch a s|ignal an|
|00002810| 64 20 6a 75 6d 70 20 74 | 6f 20 6d 61 69 6e 2e 20 |d jump t|o main. |
|00002820| 52 65 73 65 74 20 73 69 | 67 6e 61 6c 20 61 6e 64 |Reset si|gnal and|
|00002830| 20 64 6f 20 61 20 6c 6f | 6e 67 6a 6d 70 20 2a 2f | do a lo|ngjmp */|
|00002840| 0a 7c 73 74 61 74 69 63 | 20 76 6f 69 64 20 63 61 |.|static| void ca|
|00002850| 74 63 68 28 29 0a 7c 7b | 0a 7c 09 73 68 6f 77 28 |tch().|{|.|.show(|
|00002860| 32 2c 22 58 43 3a 20 49 | 6e 74 65 72 72 75 70 74 |2,"XC: I|nterrupt|
|00002870| 22 29 3b 0a 7c 0a 7c 09 | 73 69 67 6e 61 6c 28 53 |");.|.|.|signal(S|
|00002880| 49 47 49 4e 54 2c 63 61 | 74 63 68 29 3b 0a 7c 09 |IGINT,ca|tch);.|.|
|00002890| 73 69 67 6e 61 6c 28 53 | 49 47 51 55 49 54 2c 63 |signal(S|IGQUIT,c|
|000028a0| 61 74 63 68 29 3b 0a 7c | 09 6c 6f 6e 67 6a 6d 70 |atch);.||.longjmp|
|000028b0| 28 65 72 72 65 74 2c 31 | 29 3b 0a 7c 7d 0a 7c 0a |(erret,1|);.|}.|.|
|000028c0| 7c 73 74 61 74 69 63 20 | 73 74 72 75 63 74 20 6b ||static |struct k|
|000028d0| 77 20 73 65 74 6c 69 73 | 74 5b 5d 20 3d 20 7b 0a |w setlis|t[] = {.|
|000028e0| 7c 09 7b 22 37 62 69 74 | 22 2c 09 53 45 54 5f 37 ||.{"7bit|",.SET_7|
|000028f0| 62 69 74 7d 2c 0a 7c 09 | 7b 22 61 75 74 6f 22 2c |bit},.|.|{"auto",|
|00002900| 09 53 45 54 5f 61 75 74 | 6f 63 61 70 74 7d 2c 0a |.SET_aut|ocapt},.|
|00002910| 7c 09 7b 22 62 70 73 22 | 2c 09 09 53 45 54 5f 62 ||.{"bps"|,..SET_b|
|00002920| 70 73 7d 2c 0a 7c 09 7b | 22 63 66 69 6c 65 22 2c |ps},.|.{|"cfile",|
|00002930| 09 53 45 54 5f 63 66 69 | 6c 65 7d 2c 0a 7c 09 7b |.SET_cfi|le},.|.{|
|00002940| 22 63 69 73 22 2c 09 09 | 53 45 54 5f 63 69 73 7d |"cis",..|SET_cis}|
|00002950| 2c 0a 7c 09 7b 22 63 72 | 22 2c 09 09 53 45 54 5f |,.|.{"cr|",..SET_|
|00002960| 63 72 7d 2c 0a 7c 09 7b | 22 68 61 6c 66 64 70 6c |cr},.|.{|"halfdpl|
|00002970| 78 22 2c 53 45 54 5f 68 | 61 6c 66 64 70 6c 78 7d |x",SET_h|alfdplx}|
|00002980| 2c 0a 7c 09 7b 22 6e 6c | 22 2c 09 09 53 45 54 5f |,.|.{"nl|",..SET_|
|00002990| 6e 6c 7d 2c 0a 7c 09 7b | 22 70 66 69 6c 65 22 2c |nl},.|.{|"pfile",|
|000029a0| 09 53 45 54 5f 70 66 69 | 6c 65 7d 2c 0a 7c 09 7b |.SET_pfi|le},.|.{|
|000029b0| 22 70 75 72 67 65 22 2c | 09 53 45 54 5f 70 75 72 |"purge",|.SET_pur|
|000029c0| 67 65 7d 2c 0a 7c 09 7b | 22 78 6f 66 66 22 2c 09 |ge},.|.{|"xoff",.|
|000029d0| 53 45 54 5f 78 6f 66 66 | 7d 2c 0a 7c 09 7b 4e 55 |SET_xoff|},.|.{NU|
|000029e0| 4c 4c 53 2c 09 09 30 7d | 0a 7c 7d 3b 0a 7c 0a 7c |LLS,..0}|.|};.|.||
|000029f0| 2f 2a 20 50 72 69 6e 74 | 20 74 68 65 20 73 74 61 |/* Print| the sta|
|00002a00| 74 75 73 20 6f 66 20 74 | 68 65 20 70 72 6f 67 72 |tus of t|he progr|
|00002a10| 61 6d 20 2a 2f 0a 7c 73 | 74 61 74 69 63 20 76 6f |am */.|s|tatic vo|
|00002a20| 69 64 20 73 74 61 74 75 | 73 28 29 0a 7c 7b 0a 7c |id statu|s().|{.||
|00002a30| 09 73 74 72 75 63 74 20 | 6b 77 20 2a 70 74 72 3b |.struct |kw *ptr;|
|00002a40| 0a 7c 09 63 68 61 72 20 | 70 5b 33 30 5d 3b 0a 7c |.|.char |p[30];.||
|00002a50| 09 69 6e 74 20 28 2a 66 | 63 74 29 28 29 20 3d 20 |.int (*f|ct)() = |
|00002a60| 30 3b 0a 7c 0a 7c 09 73 | 74 61 74 5f 66 6c 61 67 |0;.|.|.s|tat_flag|
|00002a70| 20 3d 20 54 52 55 45 3b | 0a 7c 0a 7c 09 63 6c 73 | = TRUE;|.|.|.cls|
|00002a80| 28 29 3b 0a 7c 09 63 75 | 72 5f 6f 66 66 28 29 3b |();.|.cu|r_off();|
|00002a90| 0a 7c 09 73 70 72 69 6e | 74 66 28 70 2c 22 4d 6f |.|.sprin|tf(p,"Mo|
|00002aa0| 64 65 6d 20 50 6f 72 74 | 3a 20 25 73 22 2c 6d 70 |dem Port|: %s",mp|
|00002ab0| 6f 72 74 28 4e 55 4c 4c | 53 29 29 3b 0a 7c 09 64 |ort(NULL|S));.|.d|
|00002ac0| 72 61 77 6c 69 6e 65 28 | 30 2c 20 30 2c 20 43 4f |rawline(|0, 0, CO|
|00002ad0| 29 3b 0a 7c 09 74 74 67 | 6f 74 6f 28 31 2c 20 39 |);.|.ttg|oto(1, 9|
|00002ae0| 29 3b 0a 7c 09 73 70 72 | 69 6e 74 66 28 4d 73 67 |);.|.spr|intf(Msg|
|00002af0| 2c 22 25 2d 32 39 73 25 | 32 39 73 22 2c 26 76 65 |,"%-29s%|29s",&ve|
|00002b00| 72 73 69 6f 6e 5b 34 5d | 2c 20 70 29 3b 0a 7c 09 |rsion[4]|, p);.|.|
|00002b10| 53 3b 0a 7c 09 64 72 61 | 77 6c 69 6e 65 28 32 2c |S;.|.dra|wline(2,|
|00002b20| 20 30 2c 20 43 4f 29 3b | 0a 7c 09 74 74 67 6f 74 | 0, CO);|.|.ttgot|
|00002b30| 6f 28 33 2c 20 30 29 3b | 0a 7c 09 66 70 72 69 6e |o(3, 0);|.|.fprin|
|00002b40| 74 66 28 74 66 70 2c 20 | 73 74 61 74 66 6d 74 2c |tf(tfp, |statfmt,|
|00002b50| 20 22 4b 65 79 77 6f 72 | 64 22 2c 20 22 44 65 73 | "Keywor|d", "Des|
|00002b60| 63 72 69 70 74 69 6f 6e | 22 2c 20 22 53 74 61 74 |cription|", "Stat|
|00002b70| 75 73 22 29 3b 0a 7c 09 | 66 70 72 69 6e 74 66 28 |us");.|.|fprintf(|
|00002b80| 74 66 70 2c 20 73 74 61 | 74 66 6d 74 2c 20 22 2d |tfp, sta|tfmt, "-|
|00002b90| 2d 2d 2d 2d 2d 2d 2d 22 | 2c 20 22 2d 2d 2d 2d 2d |-------"|, "-----|
|00002ba0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002bb0| 2d 2d 2d 2d 22 2c 20 22 | 2d 2d 2d 2d 2d 2d 2d 2d |----", "|--------|
|00002bc0| 2d 2d 2d 22 29 3b 0a 7c | 0a 7c 09 66 6f 72 20 28 |---");.||.|.for (|
|00002bd0| 70 74 72 20 3d 20 73 65 | 74 6c 69 73 74 3b 20 70 |ptr = se|tlist; p|
|00002be0| 74 72 2d 3e 6b 65 79 77 | 6f 72 64 20 21 3d 20 4e |tr->keyw|ord != N|
|00002bf0| 55 4c 4c 53 3b 20 70 74 | 72 2b 2b 29 0a 7c 09 09 |ULLS; pt|r++).|..|
|00002c00| 69 66 20 28 70 74 72 2d | 3e 72 74 6e 20 21 3d 20 |if (ptr-|>rtn != |
|00002c10| 66 63 74 29 20 7b 0a 7c | 09 09 09 66 63 74 20 3d |fct) {.||...fct =|
|00002c20| 20 70 74 72 2d 3e 72 74 | 6e 3b 0a 7c 09 09 09 28 | ptr->rt|n;.|...(|
|00002c30| 2a 66 63 74 29 28 29 3b | 0a 7c 09 09 7d 0a 7c 0a |*fct)();|.|..}.|.|
|00002c40| 7c 09 74 74 67 6f 74 6f | 28 31 38 2c 20 32 35 29 ||.ttgoto|(18, 25)|
|00002c50| 3b 0a 7c 09 73 68 6f 77 | 28 31 2c 22 54 79 70 65 |;.|.show|(1,"Type|
|00002c60| 20 5c 22 68 65 6c 70 5c | 22 20 6f 72 20 3f 20 66 | \"help\|" or ? f|
|00002c70| 6f 72 20 68 65 6c 70 22 | 29 3b 0a 7c 09 73 74 61 |or help"|);.|.sta|
|00002c80| 74 5f 66 6c 61 67 20 3d | 20 46 41 4c 53 45 3b 0a |t_flag =| FALSE;.|
|00002c90| 7c 09 63 75 72 5f 6f 6e | 28 29 3b 0a 7c 7d 0a 7c ||.cur_on|();.|}.||
|00002ca0| 0a 7c 6d 61 69 6e 28 61 | 72 67 63 2c 20 61 72 67 |.|main(a|rgc, arg|
|00002cb0| 76 29 0a 7c 69 6e 74 20 | 61 72 67 63 3b 0a 7c 63 |v).|int |argc;.|c|
|00002cc0| 68 61 72 20 2a 61 72 67 | 76 5b 5d 3b 0a 7c 7b 0a |har *arg|v[];.|{.|
|00002cd0| 7c 09 63 68 61 72 20 2a | 73 63 72 69 70 74 20 3d ||.char *|script =|
|00002ce0| 20 4e 55 4c 4c 53 3b 0a | 7c 09 65 78 74 65 72 6e | NULLS;.||.extern|
|00002cf0| 20 63 68 61 72 20 2a 6f | 70 74 61 72 67 3b 0a 7c | char *o|ptarg;.||
|00002d00| 09 69 6e 74 20 63 3b 0a | 7c 09 65 78 74 65 72 6e |.int c;.||.extern|
|00002d10| 20 69 6e 74 20 6f 70 74 | 69 6e 64 3b 0a 7c 0a 7c | int opt|ind;.|.||
|00002d20| 09 73 74 72 75 63 74 20 | 6b 77 20 2a 70 74 72 3b |.struct |kw *ptr;|
|00002d30| 0a 7c 09 74 66 70 20 3d | 20 73 74 64 65 72 72 3b |.|.tfp =| stderr;|
|00002d40| 0a 7c 09 69 66 20 28 69 | 73 61 74 74 79 28 30 29 |.|.if (i|satty(0)|
|00002d50| 29 0a 7c 09 09 67 65 74 | 5f 74 74 79 70 65 28 29 |).|..get|_ttype()|
|00002d60| 3b 0a 7c 0a 7c 09 69 6f | 63 74 6c 28 30 2c 20 54 |;.|.|.io|ctl(0, T|
|00002d70| 43 47 45 54 41 2c 20 26 | 6f 6c 64 6d 6f 64 65 29 |CGETA, &|oldmode)|
|00002d80| 3b 09 2f 2a 20 67 65 74 | 20 63 75 72 72 65 6e 74 |;./* get| current|
|00002d90| 20 74 74 79 20 6d 6f 64 | 65 09 2a 2f 0a 7c 0a 7c | tty mod|e.*/.|.||
|00002da0| 09 2f 2a 20 74 72 61 70 | 20 66 6f 72 20 53 49 47 |./* trap| for SIG|
|00002db0| 48 55 50 20 61 6e 64 20 | 53 49 47 54 45 52 4d 2c |HUP and |SIGTERM,|
|00002dc0| 20 6d 61 6b 65 20 73 75 | 72 65 20 4c 43 4b 66 69 | make su|re LCKfi|
|00002dd0| 6c 65 20 67 65 74 73 20 | 6b 69 6c 6c 65 64 20 2a |le gets |killed *|
|00002de0| 2f 0a 7c 09 73 69 67 6e | 61 6c 28 53 49 47 48 55 |/.|.sign|al(SIGHU|
|00002df0| 50 2c 73 5f 65 78 69 74 | 29 3b 0a 7c 09 73 69 67 |P,s_exit|);.|.sig|
|00002e00| 6e 61 6c 28 53 49 47 54 | 45 52 4d 2c 73 5f 65 78 |nal(SIGT|ERM,s_ex|
|00002e10| 69 74 29 3b 0a 7c 0a 7c | 09 6e 65 77 6d 6f 64 65 |it);.|.||.newmode|
|00002e20| 20 3d 20 6f 6c 64 6d 6f | 64 65 3b 0a 7c 0a 7c 09 | = oldmo|de;.|.|.|
|00002e30| 6e 65 77 6d 6f 64 65 2e | 63 5f 6f 66 6c 61 67 20 |newmode.|c_oflag |
|00002e40| 26 3d 20 28 4f 50 4f 53 | 54 20 7c 20 4f 4e 4c 43 |&= (OPOS|T | ONLC|
|00002e50| 52 29 3b 0a 7c 09 6e 65 | 77 6d 6f 64 65 2e 63 5f |R);.|.ne|wmode.c_|
|00002e60| 69 66 6c 61 67 20 26 3d | 20 7e 28 49 58 4f 4e 20 |iflag &=| ~(IXON |
|00002e70| 7c 20 49 58 4f 46 46 29 | 3b 0a 7c 09 6e 65 77 6d || IXOFF)|;.|.newm|
|00002e80| 6f 64 65 2e 63 5f 6c 66 | 6c 61 67 20 26 3d 20 7e |ode.c_lf|lag &= ~|
|00002e90| 28 49 43 41 4e 4f 4e 20 | 7c 20 49 53 49 47 20 7c |(ICANON || ISIG ||
|00002ea0| 20 45 43 48 4f 29 3b 0a | 7c 09 6e 65 77 6d 6f 64 | ECHO);.||.newmod|
|00002eb0| 65 2e 63 5f 63 63 5b 56 | 4d 49 4e 5d 20 3d 20 31 |e.c_cc[V|MIN] = 1|
|00002ec0| 3b 0a 7c 09 6e 65 77 6d | 6f 64 65 2e 63 5f 63 63 |;.|.newm|ode.c_cc|
|00002ed0| 5b 56 54 49 4d 45 5d 20 | 3d 20 31 3b 0a 7c 0a 7c |[VTIME] |= 1;.|.||
|00002ee0| 09 73 69 67 6d 6f 64 65 | 20 3d 20 6e 65 77 6d 6f |.sigmode| = newmo|
|00002ef0| 64 65 3b 0a 7c 09 73 69 | 67 6d 6f 64 65 2e 63 5f |de;.|.si|gmode.c_|
|00002f00| 6c 66 6c 61 67 20 7c 3d | 20 49 53 49 47 3b 0a 7c |lflag |=| ISIG;.||
|00002f10| 0a 7c 09 6f 6c 64 73 68 | 65 6c 6c 5b 30 5d 20 3d |.|.oldsh|ell[0] =|
|00002f20| 20 27 5c 30 27 3b 09 2f | 2a 20 73 65 74 20 6c 61 | '\0';./|* set la|
|00002f30| 73 74 20 63 6f 6d 6d 61 | 6e 64 20 74 6f 20 62 6c |st comma|nd to bl|
|00002f40| 61 6e 6b 20 2a 2f 0a 7c | 09 69 66 20 28 73 65 74 |ank */.||.if (set|
|00002f50| 6a 6d 70 28 65 72 72 65 | 74 29 29 09 2f 2a 20 73 |jmp(erre|t))./* s|
|00002f60| 65 74 20 65 72 72 6f 72 | 20 68 61 6e 64 6c 65 72 |et error| handler|
|00002f70| 20 74 6f 20 65 78 69 74 | 20 2a 2f 0a 7c 09 09 65 | to exit| */.|..e|
|00002f80| 78 69 74 28 30 29 3b 09 | 09 2f 2a 20 77 68 69 6c |xit(0);.|./* whil|
|00002f90| 65 20 70 61 72 73 69 6e | 67 20 63 6f 6d 6d 61 6e |e parsin|g comman|
|00002fa0| 64 20 6c 69 6e 65 20 2a | 2f 0a 7c 09 73 69 67 6e |d line *|/.|.sign|
|00002fb0| 61 6c 28 53 49 47 49 4e | 54 2c 63 61 74 63 68 29 |al(SIGIN|T,catch)|
|00002fc0| 3b 09 2f 2a 20 63 61 74 | 63 68 20 62 72 65 61 6b |;./* cat|ch break|
|00002fd0| 20 26 20 71 75 69 74 20 | 73 69 67 6e 61 6c 73 2f | & quit |signals/|
|00002fe0| 6b 65 79 73 20 2a 2f 0a | 7c 09 73 69 67 6e 61 6c |keys */.||.signal|
|00002ff0| 28 53 49 47 51 55 49 54 | 2c 63 61 74 63 68 29 3b |(SIGQUIT|,catch);|
|00003000| 0a 7c 0a 7c 09 77 68 69 | 6c 65 20 28 28 63 20 3d |.|.|.whi|le ((c =|
|00003010| 20 67 65 74 6f 70 74 28 | 61 72 67 63 2c 20 61 72 | getopt(|argc, ar|
|00003020| 67 76 2c 20 22 73 3a 6c | 3a 74 22 29 29 20 21 3d |gv, "s:l|:t")) !=|
|00003030| 20 2d 31 29 0a 7c 09 09 | 73 77 69 74 63 68 20 28 | -1).|..|switch (|
|00003040| 63 29 20 7b 0a 7c 09 09 | 63 61 73 65 20 27 6c 27 |c) {.|..|case 'l'|
|00003050| 3a 09 2f 2a 20 73 65 74 | 20 6d 6f 64 65 6d 20 70 |:./* set| modem p|
|00003060| 6f 72 74 20 6e 61 6d 65 | 20 2a 2f 0a 7c 09 09 09 |ort name| */.|...|
|00003070| 6d 70 6f 72 74 28 6f 70 | 74 61 72 67 29 3b 0a 7c |mport(op|targ);.||
|00003080| 09 09 09 62 72 65 61 6b | 3b 0a 7c 09 09 63 61 73 |...break|;.|..cas|
|00003090| 65 20 27 73 27 3a 09 2f | 2a 20 45 78 65 63 75 74 |e 's':./|* Execut|
|000030a0| 65 20 53 43 52 49 50 54 | 20 66 69 6c 65 20 2a 2f |e SCRIPT| file */|
|000030b0| 0a 7c 09 09 09 73 63 72 | 69 70 74 20 3d 20 6f 70 |.|...scr|ipt = op|
|000030c0| 74 61 72 67 3b 0a 7c 09 | 09 09 62 72 65 61 6b 3b |targ;.|.|..break;|
|000030d0| 0a 7c 09 09 63 61 73 65 | 20 27 74 27 3a 09 2f 2a |.|..case| 't':./*|
|000030e0| 20 6a 75 6d 70 20 69 6e | 74 6f 20 74 65 72 6d 69 | jump in|to termi|
|000030f0| 6e 61 6c 20 6d 6f 64 65 | 20 2a 2f 0a 7c 09 09 09 |nal mode| */.|...|
|00003100| 72 65 74 65 72 6d 20 3d | 20 54 52 55 45 3b 0a 7c |reterm =| TRUE;.||
|00003110| 09 09 09 62 72 65 61 6b | 3b 0a 7c 09 09 64 65 66 |...break|;.|..def|
|00003120| 61 75 6c 74 3a 09 2f 2a | 20 42 61 64 20 63 6f 6d |ault:./*| Bad com|
|00003130| 6d 61 6e 64 20 2e 2e 20 | 70 72 69 6e 74 20 68 65 |mand .. |print he|
|00003140| 6c 70 20 2a 2f 0a 7c 09 | 09 09 75 73 61 67 65 28 |lp */.|.|..usage(|
|00003150| 29 3b 0a 7c 09 09 09 65 | 78 69 74 28 31 29 3b 0a |);.|...e|xit(1);.|
|00003160| 7c 09 09 7d 0a 7c 0a 7c | 09 73 65 74 75 69 64 28 ||..}.|.||.setuid(|
|00003170| 28 69 6e 74 29 67 65 74 | 65 75 69 64 28 29 29 3b |(int)get|euid());|
|00003180| 0a 7c 09 73 65 74 67 69 | 64 28 28 69 6e 74 29 67 |.|.setgi|d((int)g|
|00003190| 65 74 65 67 69 64 28 29 | 29 3b 0a 7c 0a 7c 09 6d |etegid()|);.|.|.m|
|000031a0| 6f 70 65 6e 28 29 3b 09 | 2f 2a 20 6f 70 65 6e 73 |open();.|/* opens|
|000031b0| 20 61 6e 64 20 63 6f 6e | 66 69 67 75 72 65 73 20 | and con|figures |
|000031c0| 6d 6f 64 65 6d 20 70 6f | 72 74 2c 20 6f 72 20 65 |modem po|rt, or e|
|000031d0| 78 69 74 73 20 2a 2f 0a | 7c 0a 7c 09 73 65 74 75 |xits */.||.|.setu|
|000031e0| 69 64 28 28 69 6e 74 29 | 67 65 74 75 69 64 28 29 |id((int)|getuid()|
|000031f0| 29 3b 0a 7c 09 73 65 74 | 67 69 64 28 28 69 6e 74 |);.|.set|gid((int|
|00003200| 29 67 65 74 67 69 64 28 | 29 29 3b 0a 7c 0a 7c 09 |)getgid(|));.|.|.|
|00003210| 69 6e 74 64 65 6c 28 46 | 41 4c 53 45 29 3b 0a 7c |intdel(F|ALSE);.||
|00003220| 09 6c 69 6e 6b 66 6c 61 | 67 3d 32 3b 0a 7c 09 64 |.linkfla|g=2;.|.d|
|00003230| 6f 5f 73 63 72 69 70 74 | 28 53 54 41 52 54 55 50 |o_script|(STARTUP|
|00003240| 29 3b 0a 7c 0a 7c 23 69 | 66 64 65 66 20 44 45 42 |);.|.|#i|fdef DEB|
|00003250| 55 47 0a 7c 09 64 62 67 | 6c 6f 67 28 29 3b 0a 7c |UG.|.dbg|log();.||
|00003260| 23 65 6e 64 69 66 0a 7c | 0a 7c 09 69 66 20 28 21 |#endif.||.|.if (!|
|00003270| 73 63 72 69 70 74 29 0a | 7c 09 09 73 74 61 74 75 |script).||..statu|
|00003280| 73 28 29 3b 0a 7c 0a 7c | 09 66 6f 72 20 28 20 3b |s();.|.||.for ( ;|
|00003290| 20 3b 20 29 20 7b 0a 7c | 09 09 73 65 74 6a 6d 70 | ; ) {.||..setjmp|
|000032a0| 28 65 72 72 65 74 29 3b | 0a 7c 09 09 73 69 67 6e |(erret);|.|..sign|
|000032b0| 61 6c 28 53 49 47 51 55 | 49 54 2c 73 5f 65 78 69 |al(SIGQU|IT,s_exi|
|000032c0| 74 29 3b 0a 7c 09 09 69 | 6e 74 64 65 6c 28 46 41 |t);.|..i|ntdel(FA|
|000032d0| 4c 53 45 29 3b 0a 7c 0a | 7c 09 09 69 66 20 28 73 |LSE);.|.||..if (s|
|000032e0| 63 72 69 70 74 29 0a 7c | 09 09 09 64 6f 5f 73 63 |cript).||...do_sc|
|000032f0| 72 69 70 74 28 73 63 72 | 69 70 74 29 2c 0a 7c 09 |ript(scr|ipt),.|.|
|00003300| 09 09 73 63 72 69 70 74 | 20 3d 20 4e 55 4c 4c 53 |..script| = NULLS|
|00003310| 2c 0a 7c 09 09 09 72 65 | 74 65 72 6d 20 3d 20 54 |,.|...re|term = T|
|00003320| 52 55 45 3b 0a 7c 0a 7c | 09 09 69 66 20 28 72 65 |RUE;.|.||..if (re|
|00003330| 74 65 72 6d 29 20 7b 0a | 7c 09 09 09 73 5f 74 65 |term) {.||...s_te|
|00003340| 72 6d 28 29 3b 0a 7c 09 | 09 09 63 6f 6e 74 69 6e |rm();.|.|..contin|
|00003350| 75 65 3b 0a 7c 09 09 7d | 0a 7c 0a 7c 09 09 69 6e |ue;.|..}|.|.|..in|
|00003360| 74 64 65 6c 28 54 52 55 | 45 29 3b 0a 7c 09 09 66 |tdel(TRU|E);.|..f|
|00003370| 70 75 74 63 28 27 5c 6e | 27 2c 74 66 70 29 3b 0a |putc('\n|',tfp);.|
|00003380| 7c 09 09 73 68 6f 77 28 | 2d 31 2c 22 3c 58 43 3e ||..show(|-1,"<XC>|
|00003390| 22 29 3b 0a 7c 09 09 66 | 70 75 74 63 28 27 20 27 |");.|..f|putc(' '|
|000033a0| 2c 74 66 70 29 3b 0a 7c | 0a 7c 09 09 6c 70 74 72 |,tfp);.||.|..lptr|
|000033b0| 20 3d 20 6c 69 6e 65 3b | 0a 7c 09 09 67 65 74 6c | = line;|.|..getl|
|000033c0| 69 6e 65 28 29 3b 0a 7c | 09 09 69 6e 74 64 65 6c |ine();.||..intdel|
|000033d0| 28 46 41 4c 53 45 29 3b | 0a 7c 09 09 66 70 75 74 |(FALSE);|.|..fput|
|000033e0| 63 28 27 5c 6e 27 2c 74 | 66 70 29 3b 0a 7c 0a 7c |c('\n',t|fp);.|.||
|000033f0| 09 09 67 65 74 77 6f 72 | 64 28 29 3b 0a 7c 09 09 |..getwor|d();.|..|
|00003400| 6c 63 5f 77 6f 72 64 28 | 77 6f 72 64 29 3b 0a 7c |lc_word(|word);.||
|00003410| 09 09 69 66 20 28 77 6f | 72 64 5b 30 5d 20 3d 3d |..if (wo|rd[0] ==|
|00003420| 20 27 5c 30 27 29 09 09 | 2f 2a 20 49 66 20 62 6c | '\0')..|/* If bl|
|00003430| 61 6e 6b 20 6c 69 6e 65 | 2e 2e 2e 20 72 65 70 72 |ank line|... repr|
|00003440| 6f 6d 70 74 20 2a 2f 0a | 7c 09 09 09 63 6f 6e 74 |ompt */.||...cont|
|00003450| 69 6e 75 65 3b 0a 7c 0a | 7c 09 09 66 6f 72 20 28 |inue;.|.||..for (|
|00003460| 70 74 72 20 3d 20 63 6d | 64 73 3b 20 70 74 72 2d |ptr = cm|ds; ptr-|
|00003470| 3e 6b 65 79 77 6f 72 64 | 20 21 3d 20 4e 55 4c 4c |>keyword| != NULL|
|00003480| 53 3b 20 70 74 72 2b 2b | 29 0a 7c 09 09 09 69 66 |S; ptr++|).|...if|
|00003490| 20 28 73 74 72 63 6d 70 | 28 77 6f 72 64 2c 20 70 | (strcmp|(word, p|
|000034a0| 74 72 2d 3e 6b 65 79 77 | 6f 72 64 29 20 3d 3d 20 |tr->keyw|ord) == |
|000034b0| 30 29 0a 7c 09 09 09 09 | 62 72 65 61 6b 3b 0a 7c |0).|....|break;.||
|000034c0| 0a 7c 09 09 69 66 20 28 | 70 74 72 2d 3e 6b 65 79 |.|..if (|ptr->key|
|000034d0| 77 6f 72 64 29 0a 7c 09 | 09 09 28 2a 70 74 72 2d |word).|.|..(*ptr-|
|000034e0| 3e 72 74 6e 29 28 29 3b | 0a 7c 09 09 65 6c 73 65 |>rtn)();|.|..else|
|000034f0| 0a 7c 09 09 09 73 70 72 | 69 6e 74 66 28 4d 73 67 |.|...spr|intf(Msg|
|00003500| 2c 22 55 6e 72 65 63 6f | 67 6e 69 7a 65 64 20 63 |,"Unreco|gnized c|
|00003510| 6f 6d 6d 61 6e 64 3a 20 | 25 73 22 2c 77 6f 72 64 |ommand: |%s",word|
|00003520| 29 2c 0a 7c 09 09 09 53 | 3b 0a 7c 09 7d 0a 7c 7d |),.|...S|;.|.}.|}|
|00003530| 0a 7c 0a 7c 73 74 61 74 | 69 63 20 73 5f 73 63 72 |.|.|stat|ic s_scr|
|00003540| 69 70 74 28 29 0a 7c 7b | 0a 7c 09 67 65 74 77 6f |ipt().|{|.|.getwo|
|00003550| 72 64 28 29 3b 0a 7c 0a | 7c 09 69 66 20 28 77 6f |rd();.|.||.if (wo|
|00003560| 72 64 5b 30 5d 20 3d 3d | 20 27 5c 30 27 29 20 7b |rd[0] ==| '\0') {|
|00003570| 0a 7c 09 09 73 68 6f 77 | 28 31 2c 22 53 63 72 69 |.|..show|(1,"Scri|
|00003580| 70 74 20 66 69 6c 65 20 | 6e 6f 74 20 73 70 65 63 |pt file |not spec|
|00003590| 69 66 69 65 64 22 29 3b | 0a 7c 09 09 72 65 74 75 |ified");|.|..retu|
|000035a0| 72 6e 3b 0a 7c 09 7d 0a | 7c 0a 7c 09 73 70 72 69 |rn;.|.}.||.|.spri|
|000035b0| 6e 74 66 28 64 64 73 6e | 61 6d 65 2c 22 25 73 22 |ntf(ddsn|ame,"%s"|
|000035c0| 2c 77 6f 72 64 29 3b 0a | 7c 09 64 6f 5f 73 63 72 |,word);.||.do_scr|
|000035d0| 69 70 74 28 64 64 73 6e | 61 6d 65 29 3b 0a 7c 09 |ipt(ddsn|ame);.|.|
|000035e0| 72 65 74 65 72 6d 20 3d | 20 54 52 55 45 3b 0a 7c |reterm =| TRUE;.||
|000035f0| 7d 0a 7c 0a 7c 73 74 61 | 74 69 63 20 73 5f 78 6d |}.|.|sta|tic s_xm|
|00003600| 6f 64 65 6d 28 29 0a 7c | 7b 0a 7c 09 63 68 61 72 |odem().||{.|.char|
|00003610| 20 64 20 3d 20 77 6f 72 | 64 5b 30 5d 3b 0a 7c 09 | d = wor|d[0];.|.|
|00003620| 63 68 61 72 20 63 20 3d | 20 77 6f 72 64 5b 31 5d |char c =| word[1]|
|00003630| 3b 0a 7c 0a 7c 09 67 65 | 74 77 6f 72 64 28 29 3b |;.|.|.ge|tword();|
|00003640| 0a 7c 09 69 66 20 28 77 | 6f 72 64 5b 30 5d 20 3d |.|.if (w|ord[0] =|
|00003650| 3d 20 27 5c 30 27 29 0a | 7c 09 09 73 68 6f 77 28 |= '\0').||..show(|
|00003660| 31 2c 22 54 72 61 6e 73 | 66 65 72 20 66 69 6c 65 |1,"Trans|fer file|
|00003670| 20 6e 6f 74 20 73 70 65 | 63 69 66 69 65 64 22 29 | not spe|cified")|
|00003680| 3b 0a 7c 09 65 6c 73 65 | 20 69 66 20 28 64 20 3d |;.|.else| if (d =|
|00003690| 3d 20 27 73 27 29 0a 7c | 09 09 78 73 65 6e 64 28 |= 's').||..xsend(|
|000036a0| 63 29 3b 0a 7c 09 65 6c | 73 65 0a 7c 09 09 78 72 |c);.|.el|se.|..xr|
|000036b0| 65 63 65 69 76 65 28 63 | 29 3b 0a 7c 0a 7c 09 72 |eceive(c|);.|.|.r|
|000036c0| 65 74 65 72 6d 20 3d 20 | 54 52 55 45 3b 0a 7c 7d |eterm = |TRUE;.|}|
|000036d0| 0a 7c 0a 7c 73 74 61 74 | 69 63 20 73 5f 74 65 72 |.|.|stat|ic s_ter|
|000036e0| 6d 28 29 0a 7c 7b 0a 7c | 09 66 6f 72 20 28 20 3b |m().|{.||.for ( ;|
|000036f0| 20 3b 20 29 20 7b 0a 7c | 09 09 74 65 72 6d 69 6e | ; ) {.||..termin|
|00003700| 61 6c 28 46 41 4c 53 45 | 29 3b 0a 7c 09 09 69 66 |al(FALSE|);.|..if|
|00003710| 20 28 63 69 73 6d 6f 64 | 65 20 21 3d 20 32 29 0a | (cismod|e != 2).|
|00003720| 7c 09 09 09 72 65 74 75 | 72 6e 3b 0a 7c 09 09 63 ||...retu|rn;.|..c|
|00003730| 69 73 6d 6f 64 65 20 3d | 20 31 3b 0a 7c 09 09 73 |ismode =| 1;.|..s|
|00003740| 5f 63 69 73 28 29 3b 0a | 7c 09 7d 0a 7c 7d 0a 7c |_cis();.||.}.|}.||
|00003750| 0a 7c 73 74 61 74 69 63 | 20 73 5f 64 69 61 6c 28 |.|static| s_dial(|
|00003760| 29 0a 7c 7b 0a 7c 09 66 | 6f 72 20 28 20 3b 20 3b |).|{.|.f|or ( ; ;|
|00003770| 20 29 20 7b 0a 7c 09 09 | 74 65 72 6d 69 6e 61 6c | ) {.|..|terminal|
|00003780| 28 54 52 55 45 29 3b 0a | 7c 09 09 69 66 20 28 63 |(TRUE);.||..if (c|
|00003790| 69 73 6d 6f 64 65 20 21 | 3d 20 32 29 0a 7c 09 09 |ismode !|= 2).|..|
|000037a0| 09 72 65 74 75 72 6e 3b | 0a 7c 09 09 63 69 73 6d |.return;|.|..cism|
|000037b0| 6f 64 65 20 3d 20 31 3b | 0a 7c 09 09 73 5f 63 69 |ode = 1;|.|..s_ci|
|000037c0| 73 28 29 3b 0a 7c 09 7d | 0a 7c 7d 0a 7c 0a 7c 73 |s();.|.}|.|}.|.|s|
|000037d0| 5f 63 69 73 28 29 0a 7c | 7b 0a 7c 09 42 5f 54 72 |_cis().||{.|.B_Tr|
|000037e0| 61 6e 73 66 65 72 28 29 | 3b 0a 7c 09 72 65 74 65 |ansfer()|;.|.rete|
|000037f0| 72 6d 20 3d 20 54 52 55 | 45 3b 0a 7c 7d 0a 7c 0a |rm = TRU|E;.|}.|.|
|00003800| 7c 73 5f 73 68 65 6c 6c | 28 29 0a 7c 7b 0a 7c 09 ||s_shell|().|{.|.|
|00003810| 76 6f 69 64 20 28 2a 6f | 6c 64 76 65 63 29 28 29 |void (*o|ldvec)()|
|00003820| 3b 0a 7c 09 69 6e 74 20 | 73 74 61 74 5f 6c 6f 63 |;.|.int |stat_loc|
|00003830| 20 3d 20 30 3b 0a 7c 09 | 63 68 61 72 20 63 20 3d | = 0;.|.|char c =|
|00003840| 20 77 6f 72 64 5b 30 5d | 3b 0a 7c 09 73 74 61 74 | word[0]|;.|.stat|
|00003850| 69 63 20 63 68 61 72 20 | 2a 73 68 65 6c 6c 20 3d |ic char |*shell =|
|00003860| 20 4e 55 4c 4c 53 3b 0a | 7c 0a 7c 23 69 66 64 65 | NULLS;.||.|#ifde|
|00003870| 66 20 4e 4f 53 48 45 4c | 4c 0a 7c 09 72 65 74 75 |f NOSHEL|L.|.retu|
|00003880| 72 6e 28 30 29 3b 0a 7c | 23 65 6e 64 69 66 0a 7c |rn(0);.||#endif.||
|00003890| 09 69 66 20 28 77 6f 72 | 64 5b 30 5d 20 3d 3d 20 |.if (wor|d[0] == |
|000038a0| 77 6f 72 64 5b 31 5d 29 | 0a 7c 09 09 73 74 72 63 |word[1])|.|..strc|
|000038b0| 70 79 28 77 70 74 72 20 | 3d 20 77 6f 72 64 2c 20 |py(wptr |= word, |
|000038c0| 6f 6c 64 73 68 65 6c 6c | 29 3b 0a 7c 09 65 6c 73 |oldshell|);.|.els|
|000038d0| 65 20 7b 0a 7c 09 09 67 | 65 74 77 6f 72 64 28 29 |e {.|..g|etword()|
|000038e0| 3b 0a 7c 09 09 69 66 20 | 28 2a 77 70 74 72 29 0a |;.|..if |(*wptr).|
|000038f0| 7c 09 09 09 73 74 72 63 | 70 79 28 6f 6c 64 73 68 ||...strc|py(oldsh|
|00003900| 65 6c 6c 2c 20 77 70 74 | 72 29 3b 0a 7c 09 7d 0a |ell, wpt|r);.|.}.|
|00003910| 7c 0a 7c 09 69 66 20 28 | 21 73 68 65 6c 6c 29 20 ||.|.if (|!shell) |
|00003920| 7b 0a 7c 09 09 73 68 65 | 6c 6c 20 3d 20 67 65 74 |{.|..she|ll = get|
|00003930| 65 6e 76 28 22 53 48 45 | 4c 4c 22 29 3b 0a 7c 09 |env("SHE|LL");.|.|
|00003940| 09 69 66 20 28 21 73 68 | 65 6c 6c 29 0a 7c 09 09 |.if (!sh|ell).|..|
|00003950| 09 73 68 65 6c 6c 20 3d | 20 22 2f 62 69 6e 2f 73 |.shell =| "/bin/s|
|00003960| 68 22 3b 0a 7c 09 7d 0a | 7c 0a 7c 09 66 70 75 74 |h";.|.}.||.|.fput|
|00003970| 63 28 27 5c 6e 27 2c 74 | 66 70 29 3b 0a 7c 09 69 |c('\n',t|fp);.|.i|
|00003980| 6f 63 74 6c 28 30 2c 20 | 54 43 53 45 54 41 57 2c |octl(0, |TCSETAW,|
|00003990| 20 26 6f 6c 64 6d 6f 64 | 65 29 3b 0a 7c 0a 7c 09 | &oldmod|e);.|.|.|
|000039a0| 69 66 20 28 28 66 6f 72 | 6b 65 6d 28 29 29 20 3d |if ((for|kem()) =|
|000039b0| 3d 20 30 29 20 7b 0a 7c | 09 09 69 66 20 28 63 20 |= 0) {.||..if (c |
|000039c0| 3d 3d 20 27 24 27 29 09 | 2f 2a 20 41 74 74 61 63 |== '$').|/* Attac|
|000039d0| 68 20 6d 6f 64 65 6d 20 | 74 6f 20 73 74 64 69 6e |h modem |to stdin|
|000039e0| 2c 20 73 74 64 6f 75 74 | 20 2a 2f 0a 7c 09 09 09 |, stdout| */.|...|
|000039f0| 6d 61 74 74 61 63 68 28 | 29 3b 0a 7c 09 09 73 69 |mattach(|);.|..si|
|00003a00| 67 6e 61 6c 28 53 49 47 | 43 4c 44 2c 53 49 47 5f |gnal(SIG|CLD,SIG_|
|00003a10| 44 46 4c 29 3b 0a 7c 09 | 09 73 69 67 6e 61 6c 28 |DFL);.|.|.signal(|
|00003a20| 53 49 47 49 4e 54 2c 53 | 49 47 5f 44 46 4c 29 3b |SIGINT,S|IG_DFL);|
|00003a30| 0a 7c 09 09 73 69 67 6e | 61 6c 28 53 49 47 51 55 |.|..sign|al(SIGQU|
|00003a40| 49 54 2c 53 49 47 5f 44 | 46 4c 29 3b 0a 7c 09 09 |IT,SIG_D|FL);.|..|
|00003a50| 69 66 20 28 77 6f 72 64 | 5b 30 5d 20 3d 3d 20 27 |if (word|[0] == '|
|00003a60| 5c 30 27 29 0a 7c 09 09 | 09 65 78 65 63 6c 28 73 |\0').|..|.execl(s|
|00003a70| 68 65 6c 6c 2c 20 73 68 | 65 6c 6c 2c 20 22 2d 69 |hell, sh|ell, "-i|
|00003a80| 22 2c 20 4e 55 4c 4c 53 | 29 3b 0a 7c 09 09 65 6c |", NULLS|);.|..el|
|00003a90| 73 65 0a 7c 09 09 09 65 | 78 65 63 6c 28 73 68 65 |se.|...e|xecl(she|
|00003aa0| 6c 6c 2c 20 73 68 65 6c | 6c 2c 20 22 2d 63 22 2c |ll, shel|l, "-c",|
|00003ab0| 20 77 70 74 72 2c 20 4e | 55 4c 4c 53 29 3b 0a 7c | wptr, N|ULLS);.||
|00003ac0| 09 09 73 68 6f 77 28 31 | 2c 22 45 78 65 63 20 66 |..show(1|,"Exec f|
|00003ad0| 61 69 6c 65 64 21 22 29 | 3b 0a 7c 09 09 65 78 69 |ailed!")|;.|..exi|
|00003ae0| 74 28 32 29 3b 0a 7c 09 | 7d 0a 7c 0a 7c 09 6f 6c |t(2);.|.|}.|.|.ol|
|00003af0| 64 76 65 63 20 3d 20 73 | 69 67 6e 61 6c 28 53 49 |dvec = s|ignal(SI|
|00003b00| 47 49 4e 54 2c 53 49 47 | 5f 49 47 4e 29 3b 0a 7c |GINT,SIG|_IGN);.||
|00003b10| 09 77 61 69 74 28 26 73 | 74 61 74 5f 6c 6f 63 29 |.wait(&s|tat_loc)|
|00003b20| 3b 0a 7c 09 73 69 67 6e | 61 6c 28 53 49 47 49 4e |;.|.sign|al(SIGIN|
|00003b30| 54 2c 6f 6c 64 76 65 63 | 29 3b 0a 7c 0a 7c 09 69 |T,oldvec|);.|.|.i|
|00003b40| 6e 74 64 65 6c 28 46 41 | 4c 53 45 29 3b 0a 7c 09 |ntdel(FA|LSE);.|.|
|00003b50| 73 74 72 63 70 79 28 6f | 6c 64 73 68 65 6c 6c 2c |strcpy(o|ldshell,|
|00003b60| 20 77 70 74 72 29 3b 0a | 7c 09 72 65 74 75 72 6e | wptr);.||.return|
|00003b70| 28 21 21 73 74 61 74 5f | 6c 6f 63 29 3b 0a 7c 7d |(!!stat_|loc);.|}|
|00003b80| 0a 7c 0a 7c 73 74 61 74 | 69 63 20 63 68 61 72 09 |.|.|stat|ic char.|
|00003b90| 2a 63 6d 64 6c 69 73 74 | 5b 5d 20 3d 20 7b 0a 7c |*cmdlist|[] = {.||
|00003ba0| 09 22 5c 74 58 43 20 43 | 6f 6d 6d 61 6e 64 20 53 |."\tXC C|ommand S|
|00003bb0| 75 6d 6d 61 72 79 5c 6e | 5c 6e 22 2c 0a 7c 09 22 |ummary\n|\n",.|."|
|00003bc0| 5c 74 63 5c 74 5c 74 49 | 6e 69 74 69 61 74 65 20 |\tc\t\tI|nitiate |
|00003bd0| 43 49 53 20 42 2b 20 46 | 69 6c 65 20 54 72 61 6e |CIS B+ F|ile Tran|
|00003be0| 73 66 65 72 20 28 55 70 | 6c 6f 61 64 20 61 6e 64 |sfer (Up|load and|
|00003bf0| 20 44 6f 77 6e 6c 6f 61 | 64 29 5c 6e 22 2c 0a 7c | Downloa|d)\n",.||
|00003c00| 09 22 5c 74 72 62 20 66 | 69 6c 65 5c 74 5c 74 58 |."\trb f|ile\t\tX|
|00003c10| 4d 4f 44 45 4d 20 72 65 | 63 65 69 76 65 20 28 62 |MODEM re|ceive (b|
|00003c20| 69 6e 61 72 79 20 6d 6f | 64 65 29 5c 6e 22 2c 0a |inary mo|de)\n",.|
|00003c30| 7c 09 22 5c 74 72 74 20 | 66 69 6c 65 5c 74 5c 74 ||."\trt |file\t\t|
|00003c40| 58 4d 4f 44 45 4d 20 72 | 65 63 65 69 76 65 20 28 |XMODEM r|eceive (|
|00003c50| 41 73 63 69 69 20 6d 6f | 64 65 29 5c 6e 22 2c 0a |Ascii mo|de)\n",.|
|00003c60| 7c 09 22 5c 74 73 62 20 | 66 69 6c 65 20 2e 2e 2e ||."\tsb |file ...|
|00003c70| 5c 74 58 4d 4f 44 45 4d | 20 73 65 6e 64 20 28 62 |\tXMODEM| send (b|
|00003c80| 69 6e 61 72 79 20 6d 6f | 64 65 29 5c 6e 22 2c 0a |inary mo|de)\n",.|
|00003c90| 7c 09 22 5c 74 73 74 20 | 66 69 6c 65 20 2e 2e 2e ||."\tst |file ...|
|00003ca0| 5c 74 58 4d 4f 44 45 4d | 20 73 65 6e 64 20 28 41 |\tXMODEM| send (A|
|00003cb0| 73 63 69 69 20 6d 6f 64 | 65 29 5c 6e 22 2c 0a 7c |scii mod|e)\n",.||
|00003cc0| 09 22 5c 74 73 65 74 20 | 2e 2e 2e 5c 74 5c 74 58 |."\tset |...\t\tX|
|00003cd0| 43 20 50 61 72 61 6d 65 | 74 65 72 20 73 65 74 5c |C Parame|ter set\|
|00003ce0| 6e 5c 6e 22 2c 0a 7c 09 | 22 5c 74 73 20 66 69 6c |n\n",.|.|"\ts fil|
|00003cf0| 65 5c 74 5c 74 45 78 65 | 63 75 74 65 20 58 43 20 |e\t\tExe|cute XC |
|00003d00| 73 63 72 69 70 74 20 66 | 69 6c 65 5c 6e 22 2c 0a |script f|ile\n",.|
|00003d10| 7c 09 22 5c 74 74 5c 74 | 5c 74 45 6e 74 65 72 20 ||."\tt\t|\tEnter |
|00003d20| 74 65 72 6d 69 6e 61 6c | 20 6d 6f 64 65 5c 6e 22 |terminal| mode\n"|
|00003d30| 2c 0a 7c 09 22 5c 74 64 | 5c 74 5c 74 44 69 61 6c |,.|."\td|\t\tDial|
|00003d40| 69 6e 67 20 64 69 72 65 | 63 74 6f 72 79 5c 6e 22 |ing dire|ctory\n"|
|00003d50| 2c 0a 7c 09 22 5c 74 68 | 5c 74 5c 74 48 61 6e 67 |,.|."\th|\t\tHang|
|00003d60| 20 75 70 20 74 68 65 20 | 6d 6f 64 65 6d 5c 6e 22 | up the |modem\n"|
|00003d70| 2c 0a 7c 09 22 5c 74 71 | 2c 20 78 20 6f 72 20 65 |,.|."\tq|, x or e|
|00003d80| 78 69 74 5c 74 45 78 69 | 74 20 58 43 5c 6e 5c 6e |xit\tExi|t XC\n\n|
|00003d90| 22 2c 0a 7c 23 69 66 6e | 64 65 66 20 4e 4f 53 48 |",.|#ifn|def NOSH|
|00003da0| 45 4c 4c 0a 7c 09 22 5c | 74 21 5c 74 5c 74 45 78 |ELL.|."\|t!\t\tEx|
|00003db0| 65 63 75 74 65 20 61 20 | 6c 6f 63 61 6c 20 69 6e |ecute a |local in|
|00003dc0| 74 65 72 61 63 74 69 76 | 65 20 73 68 65 6c 6c 5c |teractiv|e shell\|
|00003dd0| 6e 22 2c 0a 7c 09 22 5c | 74 21 20 63 6d 64 5c 74 |n",.|."\|t! cmd\t|
|00003de0| 5c 74 45 78 65 63 75 74 | 65 20 73 68 65 6c 6c 20 |\tExecut|e shell |
|00003df0| 63 6f 6d 6d 61 6e 64 20 | 73 74 72 69 6e 67 20 6f |command |string o|
|00003e00| 6e 20 74 68 65 20 6c 6f | 63 61 6c 20 73 79 73 74 |n the lo|cal syst|
|00003e10| 65 6d 5c 6e 22 2c 0a 7c | 09 22 5c 74 21 21 5c 74 |em\n",.||."\t!!\t|
|00003e20| 5c 74 52 65 2d 65 78 65 | 63 75 74 65 20 74 68 65 |\tRe-exe|cute the|
|00003e30| 20 6c 61 73 74 20 73 68 | 65 6c 6c 20 63 6f 6d 6d | last sh|ell comm|
|00003e40| 61 6e 64 20 73 74 72 69 | 6e 67 5c 6e 22 2c 0a 7c |and stri|ng\n",.||
|00003e50| 09 22 5c 74 24 20 63 6d | 64 5c 74 5c 74 53 68 65 |."\t$ cm|d\t\tShe|
|00003e60| 6c 6c 20 63 6f 6d 6d 61 | 6e 64 20 77 69 74 68 20 |ll comma|nd with |
|00003e70| 73 74 64 69 6e 20 61 6e | 64 20 73 74 64 6f 75 74 |stdin an|d stdout|
|00003e80| 20 72 65 64 69 72 65 63 | 74 65 64 20 74 6f 20 6d | redirec|ted to m|
|00003e90| 6f 64 65 6d 5c 6e 22 2c | 0a 7c 23 65 6e 64 69 66 |odem\n",|.|#endif|
|00003ea0| 09 0a 7c 09 22 5c 74 25 | 70 20 6c 6f 63 20 5b 72 |..|."\t%|p loc [r|
|00003eb0| 65 6d 5d 5c 74 50 75 74 | 20 6c 6f 63 61 6c 20 66 |em]\tPut| local f|
|00003ec0| 69 6c 65 20 74 6f 20 61 | 20 55 4e 49 58 20 73 79 |ile to a| UNIX sy|
|00003ed0| 73 74 65 6d 5c 6e 22 2c | 0a 7c 09 22 5c 74 25 74 |stem\n",|.|."\t%t|
|00003ee0| 20 72 65 6d 20 5b 6c 6f | 63 5d 5c 74 54 61 6b 65 | rem [lo|c]\tTake|
|00003ef0| 20 72 65 6d 6f 74 65 20 | 66 69 6c 65 20 66 72 6f | remote |file fro|
|00003f00| 6d 20 61 20 55 4e 49 58 | 20 73 79 73 74 65 6d 5c |m a UNIX| system\|
|00003f10| 6e 22 2c 0a 7c 09 22 5c | 74 3f 20 6f 72 20 68 65 |n",.|."\|t? or he|
|00003f20| 6c 70 5c 74 50 72 69 6e | 74 20 74 68 69 73 20 68 |lp\tPrin|t this h|
|00003f30| 65 6c 70 20 73 63 72 65 | 65 6e 5c 6e 22 2c 0a 7c |elp scre|en\n",.||
|00003f40| 09 22 22 2c 0a 7c 09 22 | 5c 74 53 45 54 20 4b 65 |."",.|."|\tSET Ke|
|00003f50| 79 77 6f 72 64 73 3a 5c | 6e 5c 6e 22 2c 0a 7c 09 |ywords:\|n\n",.|.|
|00003f60| 22 5c 74 73 65 74 5c 74 | 5c 74 5c 74 44 69 73 70 |"\tset\t|\t\tDisp|
|00003f70| 6c 61 79 20 63 75 72 72 | 65 6e 74 20 58 43 20 73 |lay curr|ent XC s|
|00003f80| 74 61 74 75 73 5c 6e 22 | 2c 0a 7c 09 22 5c 74 73 |tatus\n"|,.|."\ts|
|00003f90| 65 74 20 37 62 69 74 20 | 6f 6e 7c 6f 66 66 5c 74 |et 7bit |on|off\t|
|00003fa0| 5c 74 53 65 74 2f 52 65 | 73 65 74 20 37 2d 62 69 |\tSet/Re|set 7-bi|
|00003fb0| 74 20 64 61 74 61 20 6d | 61 73 6b 20 28 69 67 6e |t data m|ask (ign|
|00003fc0| 6f 72 65 20 68 69 67 68 | 20 62 69 74 73 29 5c 6e |ore high| bits)\n|
|00003fd0| 22 2c 0a 7c 09 22 5c 74 | 73 65 74 20 61 75 74 6f |",.|."\t|set auto|
|00003fe0| 20 6f 6e 7c 6f 66 66 5c | 74 5c 74 53 65 74 2f 52 | on|off\|t\tSet/R|
|00003ff0| 65 73 65 74 20 61 75 74 | 6f 6d 61 74 69 63 20 63 |eset aut|omatic c|
|00004000| 61 70 74 75 72 69 6e 67 | 5c 6e 22 2c 0a 7c 09 22 |apturing|\n",.|."|
|00004010| 5c 74 73 65 74 20 62 70 | 73 20 3c 76 61 6c 75 65 |\tset bp|s <value|
|00004020| 3e 5c 74 5c 74 53 65 74 | 20 42 69 74 73 2f 53 65 |>\t\tSet| Bits/Se|
|00004030| 63 6f 6e 64 20 74 6f 20 | 3c 76 61 6c 75 65 3e 5c |cond to |<value>\|
|00004040| 6e 22 2c 0a 7c 09 22 5c | 74 73 65 74 20 63 66 69 |n",.|."\|tset cfi|
|00004050| 6c 65 20 6e 61 6d 65 5c | 74 5c 74 43 68 61 6e 67 |le name\|t\tChang|
|00004060| 65 20 6e 61 6d 65 20 6f | 66 20 63 61 70 74 75 72 |e name o|f captur|
|00004070| 65 20 66 69 6c 65 5c 6e | 22 2c 0a 7c 09 22 5c 74 |e file\n|",.|."\t|
|00004080| 73 65 74 20 63 69 73 20 | 6f 6e 7c 6f 66 66 5c 74 |set cis |on|off\t|
|00004090| 5c 74 53 65 74 2f 52 65 | 73 65 74 20 43 49 53 20 |\tSet/Re|set CIS |
|000040a0| 3c 45 4e 51 3e 20 6d 6f | 64 65 20 28 41 75 74 6f |<ENQ> mo|de (Auto|
|000040b0| 20 75 70 2f 64 6f 77 6e | 6c 6f 61 64 29 5c 6e 22 | up/down|load)\n"|
|000040c0| 2c 0a 7c 09 22 5c 74 73 | 65 74 20 63 72 20 6f 6e |,.|."\ts|et cr on|
|000040d0| 7c 6f 66 66 5c 74 5c 74 | 53 65 74 2f 52 65 73 65 ||off\t\t|Set/Rese|
|000040e0| 74 20 43 61 72 72 69 61 | 67 65 20 52 65 74 75 72 |t Carria|ge Retur|
|000040f0| 6e 20 49 6e 6a 65 63 74 | 69 6f 6e 20 6d 6f 64 65 |n Inject|ion mode|
|00004100| 5c 6e 22 2c 0a 7c 09 22 | 5c 74 73 65 74 20 68 61 |\n",.|."|\tset ha|
|00004110| 6c 66 64 70 6c 78 20 6f | 6e 7c 6f 66 66 5c 74 53 |lfdplx o|n|off\tS|
|00004120| 65 74 2f 72 65 73 65 74 | 20 68 61 6c 66 2d 64 75 |et/reset| half-du|
|00004130| 70 6c 65 78 20 74 65 72 | 6d 69 6e 61 6c 20 6d 6f |plex ter|minal mo|
|00004140| 64 65 5c 6e 22 2c 0a 7c | 09 22 5c 74 73 65 74 20 |de\n",.||."\tset |
|00004150| 6e 6c 20 6f 6e 7c 6f 66 | 66 5c 74 5c 74 53 65 74 |nl on|of|f\t\tSet|
|00004160| 2f 52 65 73 65 74 20 6e | 65 77 6c 69 6e 65 20 74 |/Reset n|ewline t|
|00004170| 72 61 6e 73 6c 61 74 69 | 6f 6e 5c 6e 22 2c 0a 7c |ranslati|on\n",.||
|00004180| 09 22 5c 74 73 65 74 20 | 70 66 69 6c 65 20 6e 61 |."\tset |pfile na|
|00004190| 6d 65 5c 74 5c 74 43 68 | 61 6e 67 65 20 6e 61 6d |me\t\tCh|ange nam|
|000041a0| 65 20 6f 66 20 70 68 6f | 6e 65 6c 69 73 74 20 66 |e of pho|nelist f|
|000041b0| 69 6c 65 5c 6e 22 2c 0a | 7c 09 22 5c 74 73 65 74 |ile\n",.||."\tset|
|000041c0| 20 70 75 72 67 65 20 6f | 6e 7c 6f 66 66 5c 74 53 | purge o|n|off\tS|
|000041d0| 65 74 2f 52 65 73 65 74 | 20 62 61 64 20 70 68 6f |et/Reset| bad pho|
|000041e0| 6e 65 20 6c 69 6e 65 20 | 6d 6f 64 65 5c 6e 22 2c |ne line |mode\n",|
|000041f0| 0a 7c 09 22 5c 74 73 65 | 74 20 78 6f 66 66 20 6f |.|."\tse|t xoff o|
|00004200| 6e 7c 6f 66 66 5c 74 5c | 74 53 65 74 2f 52 65 73 |n|off\t\|tSet/Res|
|00004210| 65 74 20 58 4f 4e 2f 58 | 4f 46 46 20 66 6c 6f 77 |et XON/X|OFF flow|
|00004220| 20 63 6f 6e 74 72 6f 6c | 5c 6e 22 2c 0a 7c 09 22 | control|\n",.|."|
|00004230| 22 2c 0a 7c 09 22 5c 74 | 45 53 43 41 50 45 20 73 |",.|."\t|ESCAPE s|
|00004240| 65 71 75 65 6e 63 65 73 | 20 69 6e 20 54 45 52 4d |equences| in TERM|
|00004250| 49 4e 41 4c 20 6d 6f 64 | 65 3a 5c 6e 5c 6e 22 2c |INAL mod|e:\n\n",|
|00004260| 0a 7c 09 22 5c 74 22 2c | 45 53 43 5f 53 54 52 2c |.|."\t",|ESC_STR,|
|00004270| 22 20 62 5c 74 53 65 6e | 64 20 6d 6f 64 65 6d 20 |" b\tSen|d modem |
|00004280| 62 72 65 61 6b 5c 6e 22 | 2c 0a 7c 09 22 5c 74 22 |break\n"|,.|."\t"|
|00004290| 2c 45 53 43 5f 53 54 52 | 2c 22 20 64 5c 74 44 69 |,ESC_STR|," d\tDi|
|000042a0| 61 6c 69 6e 67 20 64 69 | 72 65 63 74 6f 72 79 5c |aling di|rectory\|
|000042b0| 6e 22 2c 0a 7c 09 22 5c | 74 22 2c 45 53 43 5f 53 |n",.|."\|t",ESC_S|
|000042c0| 54 52 2c 22 20 66 5c 74 | 53 65 6e 64 20 61 20 66 |TR," f\t|Send a f|
|000042d0| 69 6c 65 20 74 68 72 6f | 75 67 68 20 74 68 65 20 |ile thro|ugh the |
|000042e0| 6d 6f 64 65 6d 20 28 41 | 53 43 49 49 20 74 72 61 |modem (A|SCII tra|
|000042f0| 6e 73 66 65 72 29 5c 6e | 22 2c 0a 7c 09 22 5c 74 |nsfer)\n|",.|."\t|
|00004300| 22 2c 45 53 43 5f 53 54 | 52 2c 22 20 73 5c 74 45 |",ESC_ST|R," s\tE|
|00004310| 78 65 63 75 74 65 20 58 | 43 20 73 63 72 69 70 74 |xecute X|C script|
|00004320| 20 66 69 6c 65 5c 6e 22 | 2c 0a 7c 09 22 5c 74 22 | file\n"|,.|."\t"|
|00004330| 2c 45 53 43 5f 53 54 52 | 2c 22 20 68 5c 74 48 61 |,ESC_STR|," h\tHa|
|00004340| 6e 67 20 75 70 20 74 68 | 65 20 6d 6f 64 65 6d 5c |ng up th|e modem\|
|00004350| 6e 22 2c 0a 7c 09 22 5c | 74 22 2c 45 53 43 5f 53 |n",.|."\|t",ESC_S|
|00004360| 54 52 2c 22 20 74 5c 74 | 54 6f 67 67 6c 65 20 63 |TR," t\t|Toggle c|
|00004370| 61 70 74 75 72 65 20 66 | 69 6c 65 20 6f 6e 20 61 |apture f|ile on a|
|00004380| 6e 64 20 6f 66 66 5c 6e | 22 2c 0a 7c 09 22 5c 74 |nd off\n|",.|."\t|
|00004390| 22 2c 45 53 43 5f 53 54 | 52 2c 22 20 78 5c 74 45 |",ESC_ST|R," x\tE|
|000043a0| 78 69 74 20 74 65 72 6d | 69 6e 61 6c 20 6d 6f 64 |xit term|inal mod|
|000043b0| 65 20 62 61 63 6b 20 74 | 6f 20 58 43 20 63 6f 6d |e back t|o XC com|
|000043c0| 6d 61 6e 64 20 6d 6f 64 | 65 5c 6e 22 2c 0a 7c 09 |mand mod|e\n",.|.|
|000043d0| 22 5c 74 22 2c 45 53 43 | 5f 53 54 52 2c 22 20 71 |"\t",ESC|_STR," q|
|000043e0| 5c 74 51 75 69 74 20 58 | 43 20 65 6e 74 69 72 65 |\tQuit X|C entire|
|000043f0| 6c 79 5c 6e 22 2c 0a 7c | 09 22 22 2c 0a 7c 09 4e |ly\n",.||."",.|.N|
|00004400| 55 4c 4c 53 20 7d 3b 0a | 7c 0a 7c 73 74 61 74 69 |ULLS };.||.|stati|
|00004410| 63 20 73 5f 68 65 6c 70 | 28 29 0a 7c 7b 0a 7c 09 |c s_help|().|{.|.|
|00004420| 63 68 61 72 20 2a 2a 70 | 74 72 20 3d 20 63 6d 64 |char **p|tr = cmd|
|00004430| 6c 69 73 74 3b 0a 7c 0a | 7c 09 69 6f 63 74 6c 28 |list;.|.||.ioctl(|
|00004440| 30 2c 20 54 43 53 45 54 | 41 57 2c 20 26 6f 6c 64 |0, TCSET|AW, &old|
|00004450| 6d 6f 64 65 29 3b 0a 7c | 09 63 6c 73 28 29 3b 0a |mode);.||.cls();.|
|00004460| 7c 09 63 75 72 5f 6f 66 | 66 28 29 3b 0a 7c 09 66 ||.cur_of|f();.|.f|
|00004470| 6f 72 20 28 20 3b 20 2a | 70 74 72 20 21 3d 20 4e |or ( ; *|ptr != N|
|00004480| 55 4c 4c 53 3b 20 70 74 | 72 2b 2b 29 0a 7c 09 09 |ULLS; pt|r++).|..|
|00004490| 69 66 20 28 2a 2a 70 74 | 72 29 0a 7c 09 09 09 66 |if (**pt|r).|...f|
|000044a0| 70 72 69 6e 74 66 28 74 | 66 70 2c 20 22 25 73 22 |printf(t|fp, "%s"|
|000044b0| 2c 20 2a 70 74 72 29 3b | 0a 7c 09 09 65 6c 73 65 |, *ptr);|.|..else|
|000044c0| 0a 7c 09 09 09 73 68 6f | 77 28 30 2c 22 50 52 45 |.|...sho|w(0,"PRE|
|000044d0| 53 53 20 45 4e 54 45 52 | 22 29 2c 0a 7c 09 09 09 |SS ENTER|"),.|...|
|000044e0| 67 65 74 6c 69 6e 65 28 | 29 2c 0a 7c 09 09 09 63 |getline(|),.|...c|
|000044f0| 6c 73 28 29 3b 0a 7c 09 | 73 74 61 74 75 73 28 29 |ls();.|.|status()|
|00004500| 3b 0a 7c 7d 0a 7c 0a 7c | 73 5f 73 65 74 28 29 0a |;.|}.|.||s_set().|
|00004510| 7c 7b 0a 7c 09 73 74 72 | 75 63 74 20 6b 77 20 2a ||{.|.str|uct kw *|
|00004520| 70 74 72 3b 0a 7c 0a 7c | 09 67 65 74 77 6f 72 64 |ptr;.|.||.getword|
|00004530| 28 29 3b 0a 7c 0a 7c 09 | 69 66 20 28 77 6f 72 64 |();.|.|.|if (word|
|00004540| 5b 30 5d 20 3d 3d 20 27 | 5c 30 27 20 26 26 20 21 |[0] == '|\0' && !|
|00004550| 73 63 72 69 70 74 66 6c | 61 67 29 20 7b 0a 7c 09 |scriptfl|ag) {.|.|
|00004560| 09 73 74 61 74 75 73 28 | 29 3b 0a 7c 09 09 72 65 |.status(|);.|..re|
|00004570| 74 75 72 6e 3b 0a 7c 09 | 7d 20 65 6c 73 65 20 69 |turn;.|.|} else i|
|00004580| 66 20 28 77 6f 72 64 5b | 30 5d 20 3d 3d 20 27 5c |f (word[|0] == '\|
|00004590| 30 27 29 20 7b 0a 7c 09 | 09 73 68 6f 77 28 31 2c |0') {.|.|.show(1,|
|000045a0| 22 53 45 54 20 6b 65 79 | 77 6f 72 64 20 72 65 71 |"SET key|word req|
|000045b0| 75 69 72 65 73 20 61 6e | 20 61 72 67 75 6d 65 6e |uires an| argumen|
|000045c0| 74 22 29 3b 0a 7c 09 09 | 65 6f 66 5f 66 6c 61 67 |t");.|..|eof_flag|
|000045d0| 2b 2b 3b 0a 7c 09 09 72 | 65 74 75 72 6e 3b 0a 7c |++;.|..r|eturn;.||
|000045e0| 09 7d 0a 7c 0a 7c 09 6c | 63 5f 77 6f 72 64 28 77 |.}.|.|.l|c_word(w|
|000045f0| 6f 72 64 29 3b 0a 7c 0a | 7c 09 66 6f 72 20 28 70 |ord);.|.||.for (p|
|00004600| 74 72 20 3d 20 73 65 74 | 6c 69 73 74 3b 20 70 74 |tr = set|list; pt|
|00004610| 72 2d 3e 6b 65 79 77 6f | 72 64 20 21 3d 20 4e 55 |r->keywo|rd != NU|
|00004620| 4c 4c 53 3b 20 70 74 72 | 2b 2b 29 0a 7c 09 09 69 |LLS; ptr|++).|..i|
|00004630| 66 20 28 73 74 72 63 6d | 70 28 70 74 72 2d 3e 6b |f (strcm|p(ptr->k|
|00004640| 65 79 77 6f 72 64 2c 20 | 77 6f 72 64 29 20 3d 3d |eyword, |word) ==|
|00004650| 20 30 29 20 7b 0a 7c 09 | 09 09 28 2a 70 74 72 2d | 0) {.|.|..(*ptr-|
|00004660| 3e 72 74 6e 29 28 29 3b | 0a 7c 09 09 09 72 65 74 |>rtn)();|.|...ret|
|00004670| 75 72 6e 3b 0a 7c 09 09 | 7d 0a 7c 0a 7c 09 73 70 |urn;.|..|}.|.|.sp|
|00004680| 72 69 6e 74 66 28 4d 73 | 67 2c 22 49 6e 76 61 6c |rintf(Ms|g,"Inval|
|00004690| 69 64 20 53 45 54 20 6b | 65 79 77 6f 72 64 3a 20 |id SET k|eyword: |
|000046a0| 25 73 22 2c 20 77 6f 72 | 64 29 3b 0a 7c 09 53 3b |%s", wor|d);.|.S;|
|000046b0| 0a 7c 09 65 6f 66 5f 66 | 6c 61 67 2b 2b 3b 0a 7c |.|.eof_f|lag++;.||
|000046c0| 7d 0a 7c 0a 7c 73 65 74 | 5f 6f 6e 6f 66 66 28 66 |}.|.|set|_onoff(f|
|000046d0| 6c 61 67 29 0a 7c 73 68 | 6f 72 74 20 2a 66 6c 61 |lag).|sh|ort *fla|
|000046e0| 67 3b 0a 7c 7b 0a 7c 09 | 63 68 61 72 20 2a 70 74 |g;.|{.|.|char *pt|
|000046f0| 72 20 3d 20 73 74 72 64 | 75 70 28 77 6f 72 64 29 |r = strd|up(word)|
|00004700| 3b 0a 7c 0a 7c 09 67 65 | 74 77 6f 72 64 28 29 3b |;.|.|.ge|tword();|
|00004710| 0a 7c 09 6c 63 5f 77 6f | 72 64 28 77 6f 72 64 29 |.|.lc_wo|rd(word)|
|00004720| 3b 0a 7c 0a 7c 09 69 66 | 20 28 73 74 72 63 6d 70 |;.|.|.if| (strcmp|
|00004730| 28 77 6f 72 64 2c 20 22 | 6f 6e 22 29 20 3d 3d 20 |(word, "|on") == |
|00004740| 30 29 0a 7c 09 09 2a 66 | 6c 61 67 20 3d 20 54 52 |0).|..*f|lag = TR|
|00004750| 55 45 3b 0a 7c 09 65 6c | 73 65 20 69 66 20 28 73 |UE;.|.el|se if (s|
|00004760| 74 72 63 6d 70 28 77 6f | 72 64 2c 20 22 6f 66 66 |trcmp(wo|rd, "off|
|00004770| 22 29 20 3d 3d 20 30 29 | 0a 7c 09 09 2a 66 6c 61 |") == 0)|.|..*fla|
|00004780| 67 20 3d 20 46 41 4c 53 | 45 3b 0a 7c 09 65 6c 73 |g = FALS|E;.|.els|
|00004790| 65 0a 7c 09 09 73 70 72 | 69 6e 74 66 28 4d 73 67 |e.|..spr|intf(Msg|
|000047a0| 2c 22 53 65 74 20 27 25 | 73 27 20 76 61 6c 75 65 |,"Set '%|s' value|
|000047b0| 20 6d 75 73 74 20 62 65 | 20 27 6f 6e 27 20 6f 72 | must be| 'on' or|
|000047c0| 20 27 6f 66 66 27 22 2c | 70 74 72 29 2c 0a 7c 09 | 'off'",|ptr),.|.|
|000047d0| 09 53 2c 0a 7c 09 09 65 | 6f 66 5f 66 6c 61 67 2b |.S,.|..e|of_flag+|
|000047e0| 2b 3b 0a 7c 0a 7c 09 66 | 72 65 65 28 70 74 72 29 |+;.|.|.f|ree(ptr)|
|000047f0| 3b 0a 7c 7d 0a 7c 0a 7c | 73 74 61 74 69 63 20 53 |;.|}.|.||static S|
|00004800| 45 54 5f 37 62 69 74 28 | 29 0a 7c 7b 0a 7c 09 73 |ET_7bit(|).|{.|.s|
|00004810| 68 6f 72 74 20 76 61 6c | 3b 0a 7c 0a 7c 09 69 66 |hort val|;.|.|.if|
|00004820| 20 28 73 74 61 74 5f 66 | 6c 61 67 29 20 7b 0a 7c | (stat_f|lag) {.||
|00004830| 09 09 66 70 72 69 6e 74 | 66 28 74 66 70 2c 20 73 |..fprint|f(tfp, s|
|00004840| 74 61 74 66 6d 74 2c 20 | 22 37 62 69 74 22 2c 20 |tatfmt, |"7bit", |
|00004850| 22 53 65 76 65 6e 2d 62 | 69 74 20 4d 61 73 6b 22 |"Seven-b|it Mask"|
|00004860| 2c 0a 7c 09 09 09 62 69 | 74 6d 61 73 6b 20 3d 3d |,.|...bi|tmask ==|
|00004870| 20 30 78 37 66 20 3f 20 | 22 4f 4e 22 20 3a 20 22 | 0x7f ? |"ON" : "|
|00004880| 4f 46 46 22 29 3b 0a 7c | 09 09 72 65 74 75 72 6e |OFF");.||..return|
|00004890| 3b 0a 7c 09 7d 0a 7c 0a | 7c 09 73 65 74 5f 6f 6e |;.|.}.|.||.set_on|
|000048a0| 6f 66 66 28 26 76 61 6c | 29 3b 0a 7c 09 62 69 74 |off(&val|);.|.bit|
|000048b0| 6d 61 73 6b 20 3d 20 76 | 61 6c 20 3f 20 30 78 37 |mask = v|al ? 0x7|
|000048c0| 66 20 3a 20 30 78 66 66 | 3b 0a 7c 0a 7c 09 69 66 |f : 0xff|;.|.|.if|
|000048d0| 20 28 21 73 63 72 69 70 | 74 66 6c 61 67 29 0a 7c | (!scrip|tflag).||
|000048e0| 09 09 73 70 72 69 6e 74 | 66 28 4d 73 67 2c 22 25 |..sprint|f(Msg,"%|
|000048f0| 73 2d 62 69 74 20 6d 61 | 73 6b 20 65 6e 61 62 6c |s-bit ma|sk enabl|
|00004900| 65 64 22 2c 20 76 61 6c | 20 3f 20 22 53 65 76 65 |ed", val| ? "Seve|
|00004910| 6e 22 20 3a 20 22 45 69 | 67 68 74 22 29 2c 0a 7c |n" : "Ei|ght"),.||
|00004920| 09 09 53 3b 0a 7c 7d 0a | 7c 0a 7c 73 74 61 74 69 |..S;.|}.||.|stati|
|00004930| 63 20 53 45 54 5f 63 72 | 28 29 0a 7c 7b 0a 7c 09 |c SET_cr|().|{.|.|
|00004940| 69 66 20 28 73 74 61 74 | 5f 66 6c 61 67 29 20 7b |if (stat|_flag) {|
|00004950| 0a 7c 09 09 66 70 72 69 | 6e 74 66 28 74 66 70 2c |.|..fpri|ntf(tfp,|
|00004960| 20 73 74 61 74 66 6d 74 | 2c 20 22 63 72 22 2c 20 | statfmt|, "cr", |
|00004970| 22 43 61 72 72 69 61 67 | 65 20 52 65 74 75 72 6e |"Carriag|e Return|
|00004980| 20 49 6e 6a 65 63 74 69 | 6f 6e 22 2c 0a 7c 09 09 | Injecti|on",.|..|
|00004990| 09 63 72 5f 61 64 64 20 | 3f 20 22 4f 4e 22 20 3a |.cr_add |? "ON" :|
|000049a0| 20 22 4f 46 46 22 29 3b | 0a 7c 09 09 72 65 74 75 | "OFF");|.|..retu|
|000049b0| 72 6e 3b 0a 7c 09 7d 0a | 7c 0a 7c 09 73 65 74 5f |rn;.|.}.||.|.set_|
|000049c0| 6f 6e 6f 66 66 28 26 63 | 72 5f 61 64 64 29 3b 0a |onoff(&c|r_add);.|
|000049d0| 7c 0a 7c 09 69 66 20 28 | 21 73 63 72 69 70 74 66 ||.|.if (|!scriptf|
|000049e0| 6c 61 67 29 0a 7c 09 09 | 73 70 72 69 6e 74 66 28 |lag).|..|sprintf(|
|000049f0| 4d 73 67 2c 22 43 61 72 | 72 69 61 67 65 20 52 65 |Msg,"Car|riage Re|
|00004a00| 74 75 72 6e 73 20 25 73 | 20 69 6e 6a 65 63 74 65 |turns %s| injecte|
|00004a10| 64 20 69 6e 20 42 2b 20 | 41 53 43 49 49 20 75 70 |d in B+ |ASCII up|
|00004a20| 6c 6f 61 64 73 22 2c 0a | 7c 09 09 09 63 72 5f 61 |loads",.||...cr_a|
|00004a30| 64 64 20 3f 20 22 41 52 | 45 22 20 3a 20 22 61 72 |dd ? "AR|E" : "ar|
|00004a40| 65 20 4e 4f 54 22 29 2c | 0a 7c 09 09 53 3b 0a 7c |e NOT"),|.|..S;.||
|00004a50| 7d 0a 7c 0a 7c 73 74 61 | 74 69 63 20 53 45 54 5f |}.|.|sta|tic SET_|
|00004a60| 6e 6c 28 29 0a 7c 7b 0a | 7c 09 69 66 20 28 73 74 |nl().|{.||.if (st|
|00004a70| 61 74 5f 66 6c 61 67 29 | 20 7b 0a 7c 09 09 66 70 |at_flag)| {.|..fp|
|00004a80| 72 69 6e 74 66 28 74 66 | 70 2c 20 73 74 61 74 66 |rintf(tf|p, statf|
|00004a90| 6d 74 2c 20 22 6e 6c 22 | 2c 20 22 4e 65 77 6c 69 |mt, "nl"|, "Newli|
|00004aa0| 6e 65 20 54 72 61 6e 73 | 6c 61 74 69 6f 6e 22 2c |ne Trans|lation",|
|00004ab0| 0a 7c 09 09 09 6e 6c 6d | 6f 64 65 20 3f 20 22 4f |.|...nlm|ode ? "O|
|00004ac0| 4e 22 20 3a 20 22 4f 46 | 46 22 29 3b 0a 7c 09 09 |N" : "OF|F");.|..|
|00004ad0| 72 65 74 75 72 6e 3b 0a | 7c 09 7d 0a 7c 0a 7c 09 |return;.||.}.|.|.|
|00004ae0| 73 65 74 5f 6f 6e 6f 66 | 66 28 26 6e 6c 6d 6f 64 |set_onof|f(&nlmod|
|00004af0| 65 29 3b 0a 7c 0a 7c 09 | 69 66 20 28 21 73 63 72 |e);.|.|.|if (!scr|
|00004b00| 69 70 74 66 6c 61 67 29 | 0a 7c 09 09 73 70 72 69 |iptflag)|.|..spri|
|00004b10| 6e 74 66 28 4d 73 67 2c | 22 4e 65 77 6c 69 6e 65 |ntf(Msg,|"Newline|
|00004b20| 73 20 25 73 20 63 68 61 | 6e 67 65 64 20 74 6f 20 |s %s cha|nged to |
|00004b30| 43 61 72 72 69 61 67 65 | 20 52 65 74 75 72 6e 73 |Carriage| Returns|
|00004b40| 22 2c 0a 7c 09 09 09 6e | 6c 6d 6f 64 65 20 3f 20 |",.|...n|lmode ? |
|00004b50| 22 41 52 45 22 20 3a 20 | 22 61 72 65 20 4e 4f 54 |"ARE" : |"are NOT|
|00004b60| 22 29 2c 0a 7c 09 09 53 | 3b 0a 7c 7d 0a 7c 0a 7c |"),.|..S|;.|}.|.||
|00004b70| 73 74 61 74 69 63 20 53 | 45 54 5f 63 69 73 28 29 |static S|ET_cis()|
|00004b80| 0a 7c 7b 0a 7c 09 69 66 | 20 28 73 74 61 74 5f 66 |.|{.|.if| (stat_f|
|00004b90| 6c 61 67 29 20 7b 0a 7c | 09 09 66 70 72 69 6e 74 |lag) {.||..fprint|
|00004ba0| 66 28 74 66 70 2c 20 73 | 74 61 74 66 6d 74 2c 20 |f(tfp, s|tatfmt, |
|00004bb0| 22 63 69 73 22 2c 20 22 | 43 49 53 20 3c 45 4e 51 |"cis", "|CIS <ENQ|
|00004bc0| 3e 20 41 75 74 6f 20 44 | 6f 77 6e 6c 6f 61 64 22 |> Auto D|ownload"|
|00004bd0| 2c 0a 7c 09 09 09 63 69 | 73 6d 6f 64 65 20 3f 20 |,.|...ci|smode ? |
|00004be0| 22 4f 4e 22 20 3a 20 22 | 4f 46 46 22 29 3b 0a 7c |"ON" : "|OFF");.||
|00004bf0| 09 09 72 65 74 75 72 6e | 3b 0a 7c 09 7d 0a 7c 0a |..return|;.|.}.|.|
|00004c00| 7c 09 73 65 74 5f 6f 6e | 6f 66 66 28 26 63 69 73 ||.set_on|off(&cis|
|00004c10| 6d 6f 64 65 29 3b 0a 7c | 0a 7c 09 69 66 20 28 21 |mode);.||.|.if (!|
|00004c20| 73 63 72 69 70 74 66 6c | 61 67 29 0a 7c 09 09 73 |scriptfl|ag).|..s|
|00004c30| 70 72 69 6e 74 66 28 4d | 73 67 2c 22 43 49 53 20 |printf(M|sg,"CIS |
|00004c40| 3c 45 4e 51 3e 20 41 75 | 74 6f 20 44 6f 77 6e 6c |<ENQ> Au|to Downl|
|00004c50| 6f 61 64 20 69 73 20 25 | 73 22 2c 20 63 69 73 6d |oad is %|s", cism|
|00004c60| 6f 64 65 20 3f 20 22 4f | 4e 22 20 3a 20 22 4f 46 |ode ? "O|N" : "OF|
|00004c70| 46 22 29 2c 0a 7c 09 09 | 53 3b 0a 7c 7d 0a 7c 0a |F"),.|..|S;.|}.|.|
|00004c80| 7c 73 74 61 74 69 63 20 | 53 45 54 5f 70 75 72 67 ||static |SET_purg|
|00004c90| 65 28 29 0a 7c 7b 0a 7c | 09 69 66 20 28 73 74 61 |e().|{.||.if (sta|
|00004ca0| 74 5f 66 6c 61 67 29 20 | 7b 0a 7c 09 09 66 70 72 |t_flag) |{.|..fpr|
|00004cb0| 69 6e 74 66 28 74 66 70 | 2c 20 73 74 61 74 66 6d |intf(tfp|, statfm|
|00004cc0| 74 2c 20 22 70 75 72 67 | 65 22 2c 20 22 42 61 64 |t, "purg|e", "Bad|
|00004cd0| 20 54 65 6c 65 70 68 6f | 6e 65 20 6c 69 6e 65 22 | Telepho|ne line"|
|00004ce0| 2c 0a 7c 09 09 09 62 61 | 64 6c 69 6e 65 20 3f 20 |,.|...ba|dline ? |
|00004cf0| 22 4f 4e 22 20 3a 20 22 | 4f 46 46 22 29 3b 0a 7c |"ON" : "|OFF");.||
|00004d00| 09 09 72 65 74 75 72 6e | 3b 0a 7c 09 7d 0a 7c 0a |..return|;.|.}.|.|
|00004d10| 7c 09 73 65 74 5f 6f 6e | 6f 66 66 28 26 62 61 64 ||.set_on|off(&bad|
|00004d20| 6c 69 6e 65 29 3b 0a 7c | 0a 7c 09 69 66 20 28 21 |line);.||.|.if (!|
|00004d30| 73 63 72 69 70 74 66 6c | 61 67 29 0a 7c 09 09 73 |scriptfl|ag).|..s|
|00004d40| 70 72 69 6e 74 66 28 4d | 73 67 2c 22 42 61 64 20 |printf(M|sg,"Bad |
|00004d50| 74 65 6c 65 70 68 6f 6e | 65 20 6c 69 6e 65 20 70 |telephon|e line p|
|00004d60| 75 72 67 69 6e 67 20 69 | 73 20 25 73 22 2c 20 62 |urging i|s %s", b|
|00004d70| 61 64 6c 69 6e 65 20 3f | 20 22 4f 4e 22 20 3a 20 |adline ?| "ON" : |
|00004d80| 22 4f 46 46 22 29 2c 0a | 7c 09 09 53 3b 0a 7c 7d |"OFF"),.||..S;.|}|
|00004d90| 0a 7c 0a 7c 73 74 61 74 | 69 63 20 53 45 54 5f 78 |.|.|stat|ic SET_x|
|00004da0| 6f 66 66 28 29 0a 7c 7b | 0a 7c 09 69 66 20 28 73 |off().|{|.|.if (s|
|00004db0| 74 61 74 5f 66 6c 61 67 | 29 20 7b 0a 7c 09 09 66 |tat_flag|) {.|..f|
|00004dc0| 70 72 69 6e 74 66 28 74 | 66 70 2c 20 73 74 61 74 |printf(t|fp, stat|
|00004dd0| 66 6d 74 2c 20 22 78 6f | 66 66 22 2c 20 22 54 65 |fmt, "xo|ff", "Te|
|00004de0| 72 6d 69 6e 61 6c 20 6d | 6f 64 65 20 58 4f 4e 2f |rminal m|ode XON/|
|00004df0| 58 4f 46 46 22 2c 0a 7c | 09 09 09 66 6c 6f 77 66 |XOFF",.||...flowf|
|00004e00| 6c 61 67 20 3f 20 22 4f | 4e 22 20 3a 20 22 4f 46 |lag ? "O|N" : "OF|
|00004e10| 46 22 29 3b 0a 7c 09 09 | 72 65 74 75 72 6e 3b 0a |F");.|..|return;.|
|00004e20| 7c 09 7d 0a 7c 0a 7c 09 | 73 65 74 5f 6f 6e 6f 66 ||.}.|.|.|set_onof|
|00004e30| 66 28 26 66 6c 6f 77 66 | 6c 61 67 29 3b 0a 7c 09 |f(&flowf|lag);.|.|
|00004e40| 78 63 5f 73 65 74 66 6c | 6f 77 28 66 6c 6f 77 66 |xc_setfl|ow(flowf|
|00004e50| 6c 61 67 29 3b 0a 7c 0a | 7c 09 69 66 20 28 21 73 |lag);.|.||.if (!s|
|00004e60| 63 72 69 70 74 66 6c 61 | 67 29 0a 7c 09 09 73 70 |criptfla|g).|..sp|
|00004e70| 72 69 6e 74 66 28 4d 73 | 67 2c 22 58 4f 46 46 2f |rintf(Ms|g,"XOFF/|
|00004e80| 58 4f 4e 20 46 6c 6f 77 | 20 63 6f 6e 74 72 6f 6c |XON Flow| control|
|00004e90| 20 69 73 20 25 73 22 2c | 20 66 6c 6f 77 66 6c 61 | is %s",| flowfla|
|00004ea0| 67 20 3f 20 22 4f 4e 22 | 20 3a 20 22 4f 46 46 22 |g ? "ON"| : "OFF"|
|00004eb0| 29 2c 0a 7c 09 09 53 3b | 0a 7c 7d 0a 7c 0a 7c 73 |),.|..S;|.|}.|.|s|
|00004ec0| 74 61 74 69 63 20 53 45 | 54 5f 62 70 73 28 29 0a |tatic SE|T_bps().|
|00004ed0| 7c 7b 0a 7c 09 69 66 20 | 28 73 74 61 74 5f 66 6c ||{.|.if |(stat_fl|
|00004ee0| 61 67 29 20 7b 0a 7c 09 | 09 63 68 61 72 20 62 72 |ag) {.|.|.char br|
|00004ef0| 5b 31 30 5d 3b 0a 7c 09 | 09 73 70 72 69 6e 74 66 |[10];.|.|.sprintf|
|00004f00| 28 62 72 2c 20 22 25 64 | 22 2c 20 31 30 2a 6d 72 |(br, "%d|", 10*mr|
|00004f10| 61 74 65 28 4e 55 4c 4c | 53 29 29 3b 0a 7c 09 09 |ate(NULL|S));.|..|
|00004f20| 66 70 72 69 6e 74 66 28 | 74 66 70 2c 20 73 74 61 |fprintf(|tfp, sta|
|00004f30| 74 66 6d 74 2c 20 22 62 | 70 73 22 2c 20 22 42 69 |tfmt, "b|ps", "Bi|
|00004f40| 74 73 20 70 65 72 20 53 | 65 63 6f 6e 64 22 2c 20 |ts per S|econd", |
|00004f50| 62 72 29 3b 0a 7c 09 09 | 72 65 74 75 72 6e 3b 0a |br);.|..|return;.|
|00004f60| 7c 09 7d 0a 7c 0a 7c 09 | 67 65 74 77 6f 72 64 28 ||.}.|.|.|getword(|
|00004f70| 29 3b 0a 7c 09 69 66 20 | 28 77 6f 72 64 5b 30 5d |);.|.if |(word[0]|
|00004f80| 20 3d 3d 20 27 5c 30 27 | 29 0a 7c 09 09 73 68 6f | == '\0'|).|..sho|
|00004f90| 77 28 31 2c 22 53 65 74 | 20 42 70 73 20 6d 75 73 |w(1,"Set| Bps mus|
|00004fa0| 74 20 68 61 76 65 20 61 | 20 72 61 74 65 22 29 3b |t have a| rate");|
|00004fb0| 0a 7c 09 65 6c 73 65 20 | 69 66 20 28 6d 72 61 74 |.|.else |if (mrat|
|00004fc0| 65 28 77 6f 72 64 29 20 | 3c 20 30 29 0a 7c 09 09 |e(word) |< 0).|..|
|00004fd0| 73 70 72 69 6e 74 66 28 | 4d 73 67 2c 22 55 6e 73 |sprintf(|Msg,"Uns|
|00004fe0| 75 70 70 6f 72 74 65 64 | 20 62 70 73 20 72 61 74 |upported| bps rat|
|00004ff0| 65 20 25 73 22 2c 77 6f | 72 64 29 2c 0a 7c 09 09 |e %s",wo|rd),.|..|
|00005000| 53 3b 0a 7c 09 65 6f 66 | 5f 66 6c 61 67 2b 2b 3b |S;.|.eof|_flag++;|
|00005010| 0a 7c 09 69 66 20 28 21 | 73 63 72 69 70 74 66 6c |.|.if (!|scriptfl|
|00005020| 61 67 29 0a 7c 09 09 73 | 70 72 69 6e 74 66 28 4d |ag).|..s|printf(M|
|00005030| 73 67 2c 22 42 69 74 73 | 2f 53 65 63 6f 6e 64 20 |sg,"Bits|/Second |
|00005040| 73 65 74 20 74 6f 20 25 | 64 22 2c 31 30 2a 6d 72 |set to %|d",10*mr|
|00005050| 61 74 65 28 4e 55 4c 4c | 53 29 29 2c 0a 7c 09 09 |ate(NULL|S)),.|..|
|00005060| 53 3b 0a 7c 7d 0a 7c 0a | 7c 73 74 61 74 69 63 20 |S;.|}.|.||static |
|00005070| 53 45 54 5f 68 61 6c 66 | 64 70 6c 78 28 29 0a 7c |SET_half|dplx().||
|00005080| 7b 0a 7c 09 69 66 20 28 | 73 74 61 74 5f 66 6c 61 |{.|.if (|stat_fla|
|00005090| 67 29 20 7b 0a 7c 09 09 | 66 70 72 69 6e 74 66 28 |g) {.|..|fprintf(|
|000050a0| 74 66 70 2c 20 73 74 61 | 74 66 6d 74 2c 20 22 68 |tfp, sta|tfmt, "h|
|000050b0| 61 6c 66 64 70 6c 78 22 | 2c 20 22 48 61 6c 66 2d |alfdplx"|, "Half-|
|000050c0| 64 75 70 6c 65 78 20 6d | 6f 64 65 22 2c 0a 7c 09 |duplex m|ode",.|.|
|000050d0| 09 09 68 64 70 6c 78 66 | 6c 61 67 20 3f 20 22 4f |..hdplxf|lag ? "O|
|000050e0| 4e 22 20 3a 20 22 4f 46 | 46 22 29 3b 0a 7c 09 09 |N" : "OF|F");.|..|
|000050f0| 72 65 74 75 72 6e 3b 0a | 7c 09 7d 0a 7c 0a 7c 09 |return;.||.}.|.|.|
|00005100| 73 65 74 5f 6f 6e 6f 66 | 66 28 26 68 64 70 6c 78 |set_onof|f(&hdplx|
|00005110| 66 6c 61 67 29 3b 0a 7c | 0a 7c 09 69 66 20 28 21 |flag);.||.|.if (!|
|00005120| 73 63 72 69 70 74 66 6c | 61 67 29 0a 7c 09 09 73 |scriptfl|ag).|..s|
|00005130| 70 72 69 6e 74 66 28 4d | 73 67 2c 22 48 61 6c 66 |printf(M|sg,"Half|
|00005140| 2d 64 75 70 6c 65 78 20 | 4d 6f 64 65 20 69 73 20 |-duplex |Mode is |
|00005150| 25 73 22 2c 20 68 64 70 | 6c 78 66 6c 61 67 20 3f |%s", hdp|lxflag ?|
|00005160| 20 22 4f 4e 22 20 3a 20 | 22 4f 46 46 22 29 2c 0a | "ON" : |"OFF"),.|
|00005170| 7c 09 09 53 3b 0a 7c 7d | 0a 7c 0a 7c 73 74 61 74 ||..S;.|}|.|.|stat|
|00005180| 69 63 20 53 45 54 5f 61 | 75 74 6f 63 61 70 74 28 |ic SET_a|utocapt(|
|00005190| 29 0a 7c 7b 0a 7c 09 69 | 66 20 28 73 74 61 74 5f |).|{.|.i|f (stat_|
|000051a0| 66 6c 61 67 29 20 7b 0a | 7c 09 09 66 70 72 69 6e |flag) {.||..fprin|
|000051b0| 74 66 28 74 66 70 2c 20 | 73 74 61 74 66 6d 74 2c |tf(tfp, |statfmt,|
|000051c0| 20 22 61 75 74 6f 22 2c | 20 22 41 75 74 6f 20 63 | "auto",| "Auto c|
|000051d0| 61 70 74 75 72 65 20 74 | 6f 67 67 6c 65 22 2c 0a |apture t|oggle",.|
|000051e0| 7c 09 09 09 61 75 74 6f | 66 6c 61 67 20 3f 20 22 ||...auto|flag ? "|
|000051f0| 4f 4e 22 20 3a 20 22 4f | 46 46 22 29 3b 0a 7c 09 |ON" : "O|FF");.|.|
|00005200| 09 72 65 74 75 72 6e 3b | 0a 7c 09 7d 0a 7c 0a 7c |.return;|.|.}.|.||
|00005210| 09 73 65 74 5f 6f 6e 6f | 66 66 28 26 61 75 74 6f |.set_ono|ff(&auto|
|00005220| 66 6c 61 67 29 3b 0a 7c | 0a 7c 09 69 66 20 28 21 |flag);.||.|.if (!|
|00005230| 73 63 72 69 70 74 66 6c | 61 67 29 0a 7c 09 09 73 |scriptfl|ag).|..s|
|00005240| 70 72 69 6e 74 66 28 4d | 73 67 2c 22 41 75 74 6f |printf(M|sg,"Auto|
|00005250| 20 43 61 70 74 75 72 65 | 20 54 6f 67 67 6c 69 6e | Capture| Togglin|
|00005260| 67 20 69 73 20 25 73 22 | 2c 20 61 75 74 6f 66 6c |g is %s"|, autofl|
|00005270| 61 67 20 3f 20 22 4f 4e | 22 20 3a 20 22 4f 46 46 |ag ? "ON|" : "OFF|
|00005280| 22 29 2c 0a 7c 09 09 53 | 3b 0a 7c 7d 0a 7c 0a 7c |"),.|..S|;.|}.|.||
|00005290| 73 74 61 74 69 63 20 53 | 45 54 5f 63 66 69 6c 65 |static S|ET_cfile|
|000052a0| 28 29 0a 7c 7b 0a 7c 09 | 69 66 20 28 73 74 61 74 |().|{.|.|if (stat|
|000052b0| 5f 66 6c 61 67 29 20 7b | 0a 7c 09 09 66 70 72 69 |_flag) {|.|..fpri|
|000052c0| 6e 74 66 28 74 66 70 2c | 20 73 74 61 74 66 6d 74 |ntf(tfp,| statfmt|
|000052d0| 2c 20 22 63 66 69 6c 65 | 22 2c 20 22 43 61 70 74 |, "cfile|", "Capt|
|000052e0| 75 72 65 20 66 69 6c 65 | 22 2c 20 63 61 70 74 66 |ure file|", captf|
|000052f0| 69 6c 65 29 3b 0a 7c 09 | 09 72 65 74 75 72 6e 3b |ile);.|.|.return;|
|00005300| 0a 7c 09 7d 0a 7c 0a 7c | 09 67 65 74 77 6f 72 64 |.|.}.|.||.getword|
|00005310| 28 29 3b 0a 7c 09 69 66 | 20 28 77 6f 72 64 5b 30 |();.|.if| (word[0|
|00005320| 5d 20 3d 3d 20 27 5c 30 | 27 29 20 7b 0a 7c 09 09 |] == '\0|') {.|..|
|00005330| 73 68 6f 77 28 31 2c 22 | 53 65 74 20 43 46 49 4c |show(1,"|Set CFIL|
|00005340| 45 20 6d 75 73 74 20 68 | 61 76 65 20 66 69 6c 65 |E must h|ave file|
|00005350| 20 6e 61 6d 65 22 29 3b | 0a 7c 09 09 65 6f 66 5f | name");|.|..eof_|
|00005360| 66 6c 61 67 2b 2b 3b 0a | 7c 09 09 72 65 74 75 72 |flag++;.||..retur|
|00005370| 6e 3b 0a 7c 09 7d 0a 7c | 0a 7c 09 73 74 72 63 70 |n;.|.}.||.|.strcp|
|00005380| 79 28 63 61 70 74 66 69 | 6c 65 2c 20 77 6f 72 64 |y(captfi|le, word|
|00005390| 29 3b 0a 7c 0a 7c 09 69 | 66 20 28 21 73 63 72 69 |);.|.|.i|f (!scri|
|000053a0| 70 74 66 6c 61 67 29 0a | 7c 09 09 73 70 72 69 6e |ptflag).||..sprin|
|000053b0| 74 66 28 4d 73 67 2c 22 | 43 61 70 74 75 72 65 20 |tf(Msg,"|Capture |
|000053c0| 66 69 6c 65 20 73 65 74 | 20 74 6f 20 27 25 73 27 |file set| to '%s'|
|000053d0| 22 2c 63 61 70 74 66 69 | 6c 65 29 2c 0a 7c 09 09 |",captfi|le),.|..|
|000053e0| 53 3b 0a 7c 7d 0a 7c 0a | 7c 73 74 61 74 69 63 20 |S;.|}.|.||static |
|000053f0| 53 45 54 5f 70 66 69 6c | 65 28 29 0a 7c 7b 0a 7c |SET_pfil|e().|{.||
|00005400| 09 69 66 20 28 73 74 61 | 74 5f 66 6c 61 67 29 20 |.if (sta|t_flag) |
|00005410| 7b 0a 7c 09 09 66 70 72 | 69 6e 74 66 28 74 66 70 |{.|..fpr|intf(tfp|
|00005420| 2c 20 73 74 61 74 66 6d | 74 2c 20 22 70 66 69 6c |, statfm|t, "pfil|
|00005430| 65 22 2c 20 22 50 68 6f | 6e 65 20 6e 75 6d 62 65 |e", "Pho|ne numbe|
|00005440| 72 20 66 69 6c 65 22 2c | 20 70 68 6f 6e 65 66 69 |r file",| phonefi|
|00005450| 6c 65 29 3b 0a 7c 09 09 | 72 65 74 75 72 6e 3b 0a |le);.|..|return;.|
|00005460| 7c 09 7d 0a 7c 0a 7c 09 | 67 65 74 77 6f 72 64 28 ||.}.|.|.|getword(|
|00005470| 29 3b 0a 7c 09 69 66 20 | 28 77 6f 72 64 5b 30 5d |);.|.if |(word[0]|
|00005480| 20 3d 3d 20 27 5c 30 27 | 29 20 7b 0a 7c 09 09 73 | == '\0'|) {.|..s|
|00005490| 68 6f 77 28 31 2c 22 53 | 65 74 20 50 46 49 4c 45 |how(1,"S|et PFILE|
|000054a0| 20 6d 75 73 74 20 68 61 | 76 65 20 66 69 6c 65 20 | must ha|ve file |
|000054b0| 6e 61 6d 65 22 29 3b 0a | 7c 09 09 65 6f 66 5f 66 |name");.||..eof_f|
|000054c0| 6c 61 67 2b 2b 3b 0a 7c | 09 09 72 65 74 75 72 6e |lag++;.||..return|
|000054d0| 3b 0a 7c 09 7d 0a 7c 0a | 7c 09 73 74 72 63 70 79 |;.|.}.|.||.strcpy|
|000054e0| 28 70 68 6f 6e 65 66 69 | 6c 65 2c 20 77 6f 72 64 |(phonefi|le, word|
|000054f0| 29 3b 0a 7c 0a 7c 09 69 | 66 20 28 21 73 63 72 69 |);.|.|.i|f (!scri|
|00005500| 70 74 66 6c 61 67 29 0a | 7c 09 09 73 70 72 69 6e |ptflag).||..sprin|
|00005510| 74 66 28 4d 73 67 2c 22 | 50 68 6f 6e 65 20 6e 75 |tf(Msg,"|Phone nu|
|00005520| 6d 62 65 72 20 66 69 6c | 65 20 73 65 74 20 74 6f |mber fil|e set to|
|00005530| 20 27 25 73 27 22 2c 70 | 68 6f 6e 65 66 69 6c 65 | '%s'",p|honefile|
|00005540| 29 2c 0a 7c 09 09 53 3b | 0a 7c 7d 0a 7c 0a 7c 2f |),.|..S;|.|}.|.|/|
|00005550| 2a 09 50 75 74 20 61 6e | 64 20 54 61 6b 65 20 61 |*.Put an|d Take a|
|00005560| 20 66 69 6c 65 20 74 6f | 2f 66 72 6f 6d 20 61 20 | file to|/from a |
|00005570| 55 4e 49 58 2d 74 79 70 | 65 20 22 63 75 22 20 73 |UNIX-typ|e "cu" s|
|00005580| 79 73 74 65 6d 2e 20 55 | 6e 66 6f 72 74 75 6e 61 |ystem. U|nfortuna|
|00005590| 74 65 6c 79 2c 0a 7c 09 | 74 68 65 20 73 74 74 79 |tely,.|.|the stty|
|000055a0| 20 63 6f 6d 6d 61 6e 64 | 20 69 73 20 6f 6e 65 20 | command| is one |
|000055b0| 6f 66 20 74 68 6f 73 65 | 20 63 6f 6d 6d 61 6e 64 |of those| command|
|000055c0| 73 20 74 68 61 74 20 61 | 6c 77 61 79 73 20 67 65 |s that a|lways ge|
|000055d0| 74 73 20 63 68 61 6e 67 | 65 64 0a 7c 09 77 69 74 |ts chang|ed.|.wit|
|000055e0| 68 20 64 69 66 66 65 72 | 65 6e 74 20 55 4e 49 58 |h differ|ent UNIX|
|000055f0| 20 73 79 73 74 65 6d 73 | 2c 20 73 6f 20 79 6f 75 | systems|, so you|
|00005600| 20 77 69 6c 6c 20 67 65 | 74 20 28 61 74 20 6c 65 | will ge|t (at le|
|00005610| 61 73 74 29 20 61 20 66 | 69 6c 65 20 66 75 6c 6c |ast) a f|ile full|
|00005620| 20 6f 66 0a 7c 09 5e 4d | 20 6f 6e 20 74 68 65 20 | of.|.^M| on the |
|00005630| 74 61 6b 65 20 63 6f 6d | 6d 61 6e 64 20 66 6f 72 |take com|mand for|
|00005640| 20 73 79 73 74 65 6d 73 | 20 6c 61 74 65 72 20 74 | systems| later t|
|00005650| 68 61 6e 20 56 37 20 6f | 72 20 77 6f 72 6b 2d 61 |han V7 o|r work-a|
|00005660| 6c 69 6b 65 73 2e 0a 7c | 0a 7c 09 41 64 64 69 74 |likes..||.|.Addit|
|00005670| 69 6f 6e 61 6c 6c 79 2c | 20 74 68 65 20 54 61 6b |ionally,| the Tak|
|00005680| 65 20 63 6f 6d 6d 61 6e | 64 20 74 61 6b 65 73 20 |e comman|d takes |
|00005690| 61 20 62 69 74 20 74 6f | 6f 20 6d 75 63 68 21 0a |a bit to|o much!.|
|000056a0| 7c 0a 7c 09 46 69 78 65 | 64 20 61 20 6c 6f 74 20 ||.|.Fixe|d a lot |
|000056b0| 6f 66 20 74 68 69 73 3a | 20 4a 50 52 61 64 6c 65 |of this:| JPRadle|
|000056c0| 79 20 38 39 2f 30 37 2f | 32 37 0a 7c 2a 2f 0a 7c |y 89/07/|27.|*/.||
|000056d0| 0a 7c 73 74 61 74 69 63 | 20 70 75 74 74 61 6b 65 |.|static| puttake|
|000056e0| 28 29 0a 7c 7b 0a 7c 09 | 46 49 4c 45 20 2a 20 66 |().|{.|.|FILE * f|
|000056f0| 70 3b 0a 7c 09 69 6e 74 | 20 69 2c 20 43 68 3b 0a |p;.|.int| i, Ch;.|
|00005700| 7c 09 63 68 61 72 20 63 | 20 3d 20 77 6f 72 64 5b ||.char c| = word[|
|00005710| 31 5d 2c 20 66 6e 61 6d | 65 5b 53 4d 5f 42 55 46 |1], fnam|e[SM_BUF|
|00005720| 46 5d 2c 20 74 6e 61 6d | 65 5b 53 4d 5f 42 55 46 |F], tnam|e[SM_BUF|
|00005730| 46 5d 2c 20 77 72 6b 62 | 75 66 66 5b 53 4d 5f 42 |F], wrkb|uff[SM_B|
|00005740| 55 46 46 5d 3b 0a 7c 0a | 7c 09 67 65 74 77 6f 72 |UFF];.|.||.getwor|
|00005750| 64 28 29 3b 0a 7c 0a 7c | 09 69 6e 74 64 65 6c 28 |d();.|.||.intdel(|
|00005760| 54 52 55 45 29 3b 0a 7c | 09 73 69 67 6e 61 6c 28 |TRUE);.||.signal(|
|00005770| 53 49 47 49 4e 54 2c 63 | 61 74 63 68 29 3b 0a 7c |SIGINT,c|atch);.||
|00005780| 09 73 69 67 6e 61 6c 28 | 53 49 47 51 55 49 54 2c |.signal(|SIGQUIT,|
|00005790| 63 61 74 63 68 29 3b 0a | 7c 09 78 63 5f 73 65 74 |catch);.||.xc_set|
|000057a0| 66 6c 6f 77 28 54 52 55 | 45 29 3b 0a 7c 09 69 66 |flow(TRU|E);.|.if|
|000057b0| 20 28 77 6f 72 64 5b 30 | 5d 20 3d 3d 20 27 5c 30 | (word[0|] == '\0|
|000057c0| 27 29 20 7b 0a 7c 09 09 | 73 70 72 69 6e 74 66 28 |') {.|..|sprintf(|
|000057d0| 4d 73 67 2c 22 4d 75 73 | 74 20 67 69 76 65 20 61 |Msg,"Mus|t give a|
|000057e0| 20 66 69 6c 65 6e 61 6d | 65 20 77 69 74 68 20 74 | filenam|e with t|
|000057f0| 68 65 20 27 25 25 25 63 | 27 20 6f 70 74 69 6f 6e |he '%%%c|' option|
|00005800| 22 2c 63 29 3b 0a 7c 09 | 09 53 3b 0a 7c 09 09 72 |",c);.|.|.S;.|..r|
|00005810| 65 74 75 72 6e 3b 0a 7c | 09 7d 0a 7c 0a 7c 09 73 |eturn;.||.}.|.|.s|
|00005820| 74 72 63 70 79 28 66 6e | 61 6d 65 2c 20 77 6f 72 |trcpy(fn|ame, wor|
|00005830| 64 29 3b 0a 7c 09 67 65 | 74 77 6f 72 64 28 29 3b |d);.|.ge|tword();|
|00005840| 0a 7c 09 69 66 20 28 77 | 6f 72 64 5b 30 5d 20 3d |.|.if (w|ord[0] =|
|00005850| 3d 20 27 5c 30 27 29 0a | 7c 09 09 73 74 72 63 70 |= '\0').||..strcp|
|00005860| 79 28 74 6e 61 6d 65 2c | 20 66 6e 61 6d 65 29 3b |y(tname,| fname);|
|00005870| 0a 7c 09 65 6c 73 65 0a | 7c 09 09 73 74 72 63 70 |.|.else.||..strcp|
|00005880| 79 28 74 6e 61 6d 65 2c | 20 77 6f 72 64 29 3b 0a |y(tname,| word);.|
|00005890| 7c 09 73 77 69 74 63 68 | 20 28 63 29 20 7b 0a 7c ||.switch| (c) {.||
|000058a0| 09 63 61 73 65 20 27 70 | 27 3a 0a 7c 09 09 69 66 |.case 'p|':.|..if|
|000058b0| 20 28 28 66 70 20 3d 20 | 66 6f 70 65 6e 28 66 6e | ((fp = |fopen(fn|
|000058c0| 61 6d 65 2c 20 22 72 22 | 29 29 20 3d 3d 20 4e 55 |ame, "r"|)) == NU|
|000058d0| 4c 4c 46 29 20 7b 0a 7c | 09 09 09 73 70 72 69 6e |LLF) {.||...sprin|
|000058e0| 74 66 28 4d 73 67 2c 22 | 43 61 6e 27 74 20 61 63 |tf(Msg,"|Can't ac|
|000058f0| 63 65 73 73 20 27 25 73 | 27 22 2c 66 6e 61 6d 65 |cess '%s|'",fname|
|00005900| 29 3b 0a 7c 09 09 09 53 | 3b 0a 7c 09 09 09 62 72 |);.|...S|;.|...br|
|00005910| 65 61 6b 3b 0a 7c 09 09 | 7d 0a 7c 0a 7c 09 09 66 |eak;.|..|}.|.|..f|
|00005920| 70 72 69 6e 74 66 28 74 | 66 70 2c 20 22 5c 6e 50 |printf(t|fp, "\nP|
|00005930| 75 74 74 69 6e 67 20 66 | 69 6c 65 20 27 25 73 27 |utting f|ile '%s'|
|00005940| 20 74 6f 20 27 25 73 27 | 20 6f 6e 20 72 65 6d 6f | to '%s'| on remo|
|00005950| 74 65 20 55 4e 49 58 5c | 6e 22 2c 0a 7c 09 09 09 |te UNIX\|n",.|...|
|00005960| 66 6e 61 6d 65 2c 20 74 | 6e 61 6d 65 29 3b 0a 7c |fname, t|name);.||
|00005970| 09 09 73 70 72 69 6e 74 | 66 28 77 72 6b 62 75 66 |..sprint|f(wrkbuf|
|00005980| 66 2c 20 22 73 74 74 79 | 20 2d 65 63 68 6f 3b 63 |f, "stty| -echo;c|
|00005990| 61 74 20 3e 25 73 3b 73 | 6c 65 65 70 20 31 3b 73 |at >%s;s|leep 1;s|
|000059a0| 74 74 79 20 65 63 68 6f | 5c 6e 22 2c 20 74 6e 61 |tty echo|\n", tna|
|000059b0| 6d 65 29 3b 0a 7c 09 09 | 73 65 6e 64 5f 73 6c 6f |me);.|..|send_slo|
|000059c0| 77 6c 79 28 77 72 6b 62 | 75 66 66 29 3b 09 09 2f |wly(wrkb|uff);../|
|000059d0| 2a 20 73 65 6e 64 20 63 | 6f 6d 6d 61 6e 64 20 73 |* send c|ommand s|
|000059e0| 74 72 69 6e 67 20 74 6f | 20 72 65 6d 6f 74 65 20 |tring to| remote |
|000059f0| 73 68 65 6c 6c 20 2a 2f | 0a 7c 09 09 69 20 3d 20 |shell */|.|..i = |
|00005a00| 36 34 3b 0a 7c 09 09 77 | 68 69 6c 65 20 28 28 43 |64;.|..w|hile ((C|
|00005a10| 68 20 3d 20 67 65 74 63 | 28 66 70 29 29 20 21 3d |h = getc|(fp)) !=|
|00005a20| 20 45 4f 46 29 20 7b 0a | 7c 09 09 09 69 66 20 28 | EOF) {.||...if (|
|00005a30| 2b 2b 69 20 3e 20 36 34 | 29 20 7b 20 2f 2a 20 74 |++i > 64|) { /* t|
|00005a40| 68 69 73 20 70 72 65 76 | 65 6e 74 73 20 61 6e 20 |his prev|ents an |
|00005a50| 6f 76 65 72 6c 6f 61 64 | 20 6f 6e 20 74 68 65 20 |overload| on the |
|00005a60| 2a 2f 0a 7c 09 09 09 09 | 69 20 3d 20 30 3b 09 20 |*/.|....|i = 0;. |
|00005a70| 2f 2a 20 72 65 63 65 69 | 76 65 72 27 73 20 69 6e |/* recei|ver's in|
|00005a80| 70 75 74 20 62 75 66 66 | 65 72 20 28 36 34 3d 6b |put buff|er (64=k|
|00005a90| 6c 75 64 67 65 29 20 2a | 2f 0a 7c 09 09 09 09 6d |ludge) *|/.|....m|
|00005aa0| 73 65 63 73 28 28 43 42 | 41 55 44 2d 63 62 61 75 |secs((CB|AUD-cbau|
|00005ab0| 64 29 20 2a 20 31 30 30 | 29 3b 0a 7c 09 09 09 7d |d) * 100|);.|...}|
|00005ac0| 0a 7c 09 09 09 73 65 6e | 64 5f 6d 62 79 74 65 28 |.|...sen|d_mbyte(|
|00005ad0| 43 68 29 3b 09 09 2f 2a | 20 73 65 6e 64 20 63 68 |Ch);../*| send ch|
|00005ae0| 61 72 61 63 74 65 72 73 | 20 74 6f 20 63 61 74 20 |aracters| to cat |
|00005af0| 63 6f 6d 6d 61 6e 64 20 | 2a 2f 0a 7c 09 09 7d 0a |command |*/.|..}.|
|00005b00| 7c 09 09 66 63 6c 6f 73 | 65 28 66 70 29 3b 0a 7c ||..fclos|e(fp);.||
|00005b10| 09 09 73 65 6e 64 5f 6d | 62 79 74 65 28 27 44 27 |..send_m|byte('D'|
|00005b20| 2d 27 40 27 29 3b 09 2f | 2a 20 73 65 6e 64 20 61 |-'@');./|* send a|
|00005b30| 20 5e 44 20 74 6f 20 63 | 61 74 20 2a 2f 0a 7c 09 | ^D to c|at */.|.|
|00005b40| 09 70 75 72 67 65 28 29 | 3b 09 09 09 09 2f 2a 20 |.purge()|;..../* |
|00005b50| 67 65 74 20 72 69 64 20 | 6f 66 20 77 68 61 74 65 |get rid |of whate|
|00005b60| 76 65 72 20 77 61 73 20 | 73 65 6e 74 20 62 61 63 |ver was |sent bac|
|00005b70| 6b 20 2a 2f 0a 7c 09 09 | 73 65 6e 64 5f 6d 62 79 |k */.|..|send_mby|
|00005b80| 74 65 28 27 5c 6e 27 29 | 3b 0a 7c 09 09 62 72 65 |te('\n')|;.|..bre|
|00005b90| 61 6b 3b 0a 7c 0a 7c 09 | 63 61 73 65 20 27 74 27 |ak;.|.|.|case 't'|
|00005ba0| 3a 0a 7c 09 09 73 74 72 | 63 70 79 28 4e 61 6d 65 |:.|..str|cpy(Name|
|00005bb0| 2c 20 74 6e 61 6d 65 29 | 3b 0a 7c 09 09 69 66 20 |, tname)|;.|..if |
|00005bc0| 28 28 66 70 3d 51 75 65 | 72 79 43 72 65 61 74 65 |((fp=Que|ryCreate|
|00005bd0| 28 52 65 73 75 6d 65 5f | 4e 6f 74 5f 41 6c 6c 6f |(Resume_|Not_Allo|
|00005be0| 77 65 64 29 29 20 3d 3d | 20 4e 55 4c 4c 46 29 0a |wed)) ==| NULLF).|
|00005bf0| 7c 09 09 09 62 72 65 61 | 6b 3b 0a 7c 0a 7c 09 09 ||...brea|k;.|.|..|
|00005c00| 66 70 72 69 6e 74 66 28 | 74 66 70 2c 20 22 5c 6e |fprintf(|tfp, "\n|
|00005c10| 54 61 6b 69 6e 67 20 66 | 69 6c 65 20 27 25 73 27 |Taking f|ile '%s'|
|00005c20| 20 66 72 6f 6d 20 72 65 | 6d 6f 74 65 20 55 4e 49 | from re|mote UNI|
|00005c30| 58 20 74 6f 20 27 25 73 | 27 5c 6e 22 2c 0a 7c 09 |X to '%s|'\n",.|.|
|00005c40| 09 09 66 6e 61 6d 65 2c | 20 74 6e 61 6d 65 29 3b |..fname,| tname);|
|00005c50| 0a 7c 09 09 09 09 09 09 | 09 09 09 2f 2a 20 69 66 |.|......|.../* if|
|00005c60| 20 27 66 6e 61 6d 65 27 | 20 68 61 73 20 61 20 5e | 'fname'| has a ^|
|00005c70| 45 2c 20 77 65 27 6c 6c | 20 64 69 65 20 2a 2f 0a |E, we'll| die */.|
|00005c80| 7c 09 09 73 70 72 69 6e | 74 66 28 77 72 6b 62 75 ||..sprin|tf(wrkbu|
|00005c90| 66 66 2c 20 22 73 74 74 | 79 20 6e 6c 3b 63 61 74 |ff, "stt|y nl;cat|
|00005ca0| 20 25 73 3b 65 63 68 6f | 20 25 63 3b 73 74 74 79 | %s;echo| %c;stty|
|00005cb0| 20 2d 6e 6c 3b 73 6c 65 | 65 70 20 31 5c 6e 22 2c | -nl;sle|ep 1\n",|
|00005cc0| 0a 7c 09 09 09 66 6e 61 | 6d 65 2c 20 45 4e 51 29 |.|...fna|me, ENQ)|
|00005cd0| 3b 0a 7c 09 09 73 65 6e | 64 5f 73 6c 6f 77 6c 79 |;.|..sen|d_slowly|
|00005ce0| 28 77 72 6b 62 75 66 66 | 29 3b 09 09 2f 2a 20 73 |(wrkbuff|);../* s|
|00005cf0| 65 6e 64 20 63 6f 6d 6d | 61 6e 64 20 73 74 72 69 |end comm|and stri|
|00005d00| 6e 67 20 74 6f 20 72 65 | 6d 6f 74 65 20 73 68 65 |ng to re|mote she|
|00005d10| 6c 6c 20 2a 2f 0a 7c 09 | 09 77 68 69 6c 65 20 28 |ll */.|.|.while (|
|00005d20| 72 65 61 64 5f 6d 62 79 | 74 65 28 33 29 20 21 3d |read_mby|te(3) !=|
|00005d30| 20 27 5c 6e 27 29 3b 20 | 2f 2a 20 64 69 73 63 61 | '\n'); |/* disca|
|00005d40| 72 64 20 75 70 20 74 6f | 20 74 68 65 20 5c 6e 20 |rd up to| the \n |
|00005d50| 69 6e 20 77 72 6b 62 75 | 66 66 20 2a 2f 0a 7c 09 |in wrkbu|ff */.|.|
|00005d60| 09 09 3b 0a 7c 09 09 77 | 68 69 6c 65 20 28 28 43 |..;.|..w|hile ((C|
|00005d70| 68 3d 72 65 61 64 5f 6d | 62 79 74 65 28 33 29 29 |h=read_m|byte(3))|
|00005d80| 20 21 3d 20 2d 31 20 26 | 26 20 2f 2a 20 77 68 69 | != -1 &|& /* whi|
|00005d90| 6c 65 20 6d 6f 72 65 20 | 63 68 61 72 73 20 61 72 |le more |chars ar|
|00005da0| 65 20 62 65 69 6e 67 20 | 73 65 6e 74 20 2a 2f 0a |e being |sent */.|
|00005db0| 7c 09 09 09 09 09 43 68 | 20 21 3d 20 45 4e 51 29 ||.....Ch| != ENQ)|
|00005dc0| 09 09 09 20 20 20 2f 2a | 20 61 6e 64 20 77 65 20 |... /*| and we |
|00005dd0| 68 61 76 65 6e 27 74 20 | 73 65 65 6e 20 6f 75 72 |haven't |seen our|
|00005de0| 20 45 4e 51 20 2a 2f 0a | 7c 09 09 09 66 70 75 74 | ENQ */.||...fput|
|00005df0| 63 28 43 68 2c 66 70 29 | 3b 0a 7c 09 09 66 63 6c |c(Ch,fp)|;.|..fcl|
|00005e00| 6f 73 65 28 66 70 29 3b | 0a 7c 09 09 62 72 65 61 |ose(fp);|.|..brea|
|00005e10| 6b 3b 0a 7c 09 7d 0a 7c | 09 69 6e 74 64 65 6c 28 |k;.|.}.||.intdel(|
|00005e20| 46 41 4c 53 45 29 3b 0a | 7c 09 78 63 5f 73 65 74 |FALSE);.||.xc_set|
|00005e30| 66 6c 6f 77 28 66 6c 6f | 77 66 6c 61 67 29 3b 0a |flow(flo|wflag);.|
|00005e40| 7c 09 72 65 74 65 72 6d | 20 3d 20 54 52 55 45 3b ||.reterm| = TRUE;|
|00005e50| 0a 7c 7d 0a 7c 0a 7c 73 | 5f 65 78 69 74 28 29 0a |.|}.|.|s|_exit().|
|00005e60| 7c 7b 0a 7c 09 73 69 67 | 6e 61 6c 28 53 49 47 48 ||{.|.sig|nal(SIGH|
|00005e70| 55 50 2c 53 49 47 5f 49 | 47 4e 29 3b 0a 7c 09 73 |UP,SIG_I|GN);.|.s|
|00005e80| 69 67 6e 61 6c 28 53 49 | 47 49 4e 54 2c 53 49 47 |ignal(SI|GINT,SIG|
|00005e90| 5f 49 47 4e 29 3b 0a 7c | 09 73 69 67 6e 61 6c 28 |_IGN);.||.signal(|
|00005ea0| 53 49 47 51 55 49 54 2c | 53 49 47 5f 49 47 4e 29 |SIGQUIT,|SIG_IGN)|
|00005eb0| 3b 0a 7c 09 73 69 67 6e | 61 6c 28 53 49 47 54 45 |;.|.sign|al(SIGTE|
|00005ec0| 52 4d 2c 53 49 47 5f 49 | 47 4e 29 3b 0a 7c 0a 7c |RM,SIG_I|GN);.|.||
|00005ed0| 09 70 75 74 63 28 27 5c | 6e 27 2c 74 66 70 29 3b |.putc('\|n',tfp);|
|00005ee0| 0a 7c 0a 7c 09 75 6e 6c | 6f 63 6b 5f 74 74 79 28 |.|.|.unl|ock_tty(|
|00005ef0| 29 3b 0a 7c 0a 7c 09 69 | 6f 63 74 6c 28 30 2c 20 |);.|.|.i|octl(0, |
|00005f00| 54 43 53 45 54 41 46 2c | 20 26 6f 6c 64 6d 6f 64 |TCSETAF,| &oldmod|
|00005f10| 65 29 3b 0a 7c 0a 7c 09 | 65 78 69 74 28 30 29 3b |e);.|.|.|exit(0);|
|00005f20| 0a 7c 7d 0a 53 48 41 52 | 5f 45 4f 46 0a 69 66 20 |.|}.SHAR|_EOF.if |
|00005f30| 74 65 73 74 20 31 35 37 | 30 37 20 2d 6e 65 20 22 |test 157|07 -ne "|
|00005f40| 60 77 63 20 2d 63 20 3c | 20 27 78 63 6d 61 69 6e |`wc -c <| 'xcmain|
|00005f50| 2e 63 27 60 22 0a 74 68 | 65 6e 0a 09 65 63 68 6f |.c'`".th|en..echo|
|00005f60| 20 73 68 61 72 3a 20 65 | 72 72 6f 72 20 74 72 61 | shar: e|rror tra|
|00005f70| 6e 73 6d 69 74 74 69 6e | 67 20 22 27 78 63 6d 61 |nsmittin|g "'xcma|
|00005f80| 69 6e 2e 63 27 22 20 27 | 28 73 68 6f 75 6c 64 20 |in.c'" '|(should |
|00005f90| 68 61 76 65 20 62 65 65 | 6e 20 31 35 37 30 37 20 |have bee|n 15707 |
|00005fa0| 63 68 61 72 61 63 74 65 | 72 73 29 27 0a 66 69 0a |characte|rs)'.fi.|
|00005fb0| 66 69 20 23 20 65 6e 64 | 20 6f 66 20 6f 76 65 72 |fi # end| of over|
|00005fc0| 77 72 69 74 69 6e 67 20 | 63 68 65 63 6b 0a 65 63 |writing |check.ec|
|00005fd0| 68 6f 20 73 68 61 72 3a | 20 65 78 74 72 61 63 74 |ho shar:| extract|
|00005fe0| 69 6e 67 20 22 27 78 63 | 74 65 72 6d 2e 63 27 22 |ing "'xc|term.c'"|
|00005ff0| 20 27 28 35 38 32 31 20 | 63 68 61 72 61 63 74 65 | '(5821 |characte|
|00006000| 72 73 29 27 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |rs)'.if |test -f |
|00006010| 27 78 63 74 65 72 6d 2e | 63 27 0a 74 68 65 6e 0a |'xcterm.|c'.then.|
|00006020| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 77 69 6c 6c |.echo sh|ar: will|
|00006030| 20 6e 6f 74 20 6f 76 65 | 72 2d 77 72 69 74 65 20 | not ove|r-write |
|00006040| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 22 27 |existing| file "'|
|00006050| 78 63 74 65 72 6d 2e 63 | 27 22 0a 65 6c 73 65 0a |xcterm.c|'".else.|
|00006060| 73 65 64 20 27 73 2f 5e | 7c 2f 2f 27 20 3c 3c 20 |sed 's/^||//' << |
|00006070| 5c 53 48 41 52 5f 45 4f | 46 20 3e 20 27 78 63 74 |\SHAR_EO|F > 'xct|
|00006080| 65 72 6d 2e 63 27 0a 7c | 2f 2a 09 78 63 74 65 72 |erm.c'.||/*.xcter|
|00006090| 6d 2e 63 20 2d 2d 20 74 | 65 72 6d 69 6e 61 6c 20 |m.c -- t|erminal |
|000060a0| 6d 6f 64 65 6d 6f 64 75 | 6c 65 20 66 6f 72 20 58 |modemodu|le for X|
|000060b0| 43 0a 7c 09 54 68 69 73 | 20 66 69 6c 65 20 75 73 |C.|.This| file us|
|000060c0| 65 73 20 34 2d 63 68 61 | 72 61 63 74 65 72 20 74 |es 4-cha|racter t|
|000060d0| 61 62 73 74 6f 70 73 0a | 7c 2a 2f 0a 7c 0a 7c 23 |abstops.||*/.|.|#|
|000060e0| 69 6e 63 6c 75 64 65 20 | 3c 73 74 64 69 6f 2e 68 |include |<stdio.h|
|000060f0| 3e 0a 7c 23 69 6e 63 6c | 75 64 65 20 3c 73 79 73 |>.|#incl|ude <sys|
|00006100| 2f 74 79 70 65 73 2e 68 | 3e 0a 7c 23 69 6e 63 6c |/types.h|>.|#incl|
|00006110| 75 64 65 20 3c 73 79 73 | 2f 73 74 61 74 2e 68 3e |ude <sys|/stat.h>|
|00006120| 0a 7c 23 69 6e 63 6c 75 | 64 65 20 3c 63 74 79 70 |.|#inclu|de <ctyp|
|00006130| 65 2e 68 3e 0a 7c 23 69 | 6e 63 6c 75 64 65 20 3c |e.h>.|#i|nclude <|
|00006140| 73 69 67 6e 61 6c 2e 68 | 3e 0a 7c 23 69 6e 63 6c |signal.h|>.|#incl|
|00006150| 75 64 65 20 3c 73 65 74 | 6a 6d 70 2e 68 3e 0a 7c |ude <set|jmp.h>.||
|00006160| 23 69 6e 63 6c 75 64 65 | 20 3c 74 65 72 6d 69 6f |#include| <termio|
|00006170| 2e 68 3e 0a 7c 23 69 6e | 63 6c 75 64 65 20 22 78 |.h>.|#in|clude "x|
|00006180| 63 2e 68 22 0a 7c 0a 7c | 23 64 65 66 69 6e 65 20 |c.h".|.||#define |
|00006190| 45 4e 44 43 48 41 52 09 | 09 28 28 27 58 27 20 26 |ENDCHAR.|.(('X' &|
|000061a0| 20 30 78 31 66 29 20 2b | 20 31 32 38 29 09 2f 2a | 0x1f) +| 128)./*|
|000061b0| 20 45 78 69 74 20 74 65 | 72 6d 69 6e 61 6c 20 6d | Exit te|rminal m|
|000061c0| 6f 64 65 20 2a 2f 0a 7c | 23 64 65 66 69 6e 65 20 |ode */.||#define |
|000061d0| 54 4f 47 43 48 41 52 09 | 09 28 28 27 54 27 20 26 |TOGCHAR.|.(('T' &|
|000061e0| 20 30 78 31 66 29 20 2b | 20 31 32 38 29 09 2f 2a | 0x1f) +| 128)./*|
|000061f0| 20 54 6f 67 67 6c 65 20 | 63 61 70 74 75 72 65 20 | Toggle |capture |
|00006200| 62 75 66 66 65 72 20 2a | 2f 0a 7c 23 64 65 66 69 |buffer *|/.|#defi|
|00006210| 6e 65 20 44 49 56 43 48 | 41 52 09 09 28 28 27 46 |ne DIVCH|AR..(('F|
|00006220| 27 20 26 20 30 78 31 66 | 29 20 2b 20 31 32 38 29 |' & 0x1f|) + 128)|
|00006230| 09 2f 2a 20 53 65 6e 64 | 20 66 69 6c 65 20 74 68 |./* Send| file th|
|00006240| 72 6f 75 67 68 20 6d 6f | 64 65 6d 20 2a 2f 0a 7c |rough mo|dem */.||
|00006250| 23 64 65 66 69 6e 65 20 | 44 49 41 4c 43 48 52 09 |#define |DIALCHR.|
|00006260| 09 28 28 27 44 27 20 26 | 20 30 78 31 66 29 20 2b |.(('D' &| 0x1f) +|
|00006270| 20 31 32 38 29 09 2f 2a | 20 44 69 61 6c 20 66 72 | 128)./*| Dial fr|
|00006280| 6f 6d 20 70 68 6f 6e 65 | 6c 69 73 74 20 2a 2f 0a |om phone|list */.|
|00006290| 7c 23 64 65 66 69 6e 65 | 20 48 55 50 43 48 41 52 ||#define| HUPCHAR|
|000062a0| 09 09 28 28 27 48 27 20 | 26 20 30 78 31 66 29 20 |..(('H' |& 0x1f) |
|000062b0| 2b 20 31 32 38 29 09 2f | 2a 20 48 61 6e 67 20 75 |+ 128)./|* Hang u|
|000062c0| 70 20 6d 6f 64 65 6d 20 | 2a 2f 0a 7c 23 64 65 66 |p modem |*/.|#def|
|000062d0| 69 6e 65 20 53 43 52 50 | 43 48 52 09 09 28 28 27 |ine SCRP|CHR..(('|
|000062e0| 53 27 20 26 20 30 78 31 | 66 29 20 2b 20 31 32 38 |S' & 0x1|f) + 128|
|000062f0| 29 09 2f 2a 20 45 78 65 | 63 75 74 65 20 73 63 72 |)./* Exe|cute scr|
|00006300| 69 70 74 20 66 69 6c 65 | 20 2a 2f 0a 7c 23 64 65 |ipt file| */.|#de|
|00006310| 66 69 6e 65 20 42 52 4b | 43 48 41 52 09 09 28 28 |fine BRK|CHAR..((|
|00006320| 27 42 27 20 26 20 30 78 | 31 66 29 20 2b 20 31 32 |'B' & 0x|1f) + 12|
|00006330| 38 29 09 2f 2a 20 6d 6f | 64 65 6d 20 42 52 45 41 |8)./* mo|dem BREA|
|00006340| 4b 20 63 68 61 72 61 63 | 74 65 72 20 2a 2f 0a 7c |K charac|ter */.||
|00006350| 23 64 65 66 69 6e 65 20 | 51 55 49 54 43 48 52 09 |#define |QUITCHR.|
|00006360| 09 28 28 27 51 27 20 26 | 20 30 78 31 66 29 20 2b |.(('Q' &| 0x1f) +|
|00006370| 20 31 32 38 29 09 2f 2a | 20 63 6c 6f 73 65 20 61 | 128)./*| close a|
|00006380| 6e 64 20 6c 65 61 76 65 | 20 58 43 20 2a 2f 0a 7c |nd leave| XC */.||
|00006390| 0a 7c 63 68 61 72 20 63 | 61 70 74 66 69 6c 65 5b |.|char c|aptfile[|
|000063a0| 53 4d 5f 42 55 46 46 5d | 20 3d 20 43 41 50 54 46 |SM_BUFF]| = CAPTF|
|000063b0| 49 4c 45 2c 09 2f 2a 20 | 63 61 70 74 75 72 65 20 |ILE,./* |capture |
|000063c0| 66 69 6c 65 27 73 20 6e | 61 6d 65 20 2a 2f 0a 7c |file's n|ame */.||
|000063d0| 09 20 70 68 6f 6e 65 66 | 69 6c 65 5b 53 4d 5f 42 |. phonef|ile[SM_B|
|000063e0| 55 46 46 5d 20 3d 20 50 | 48 46 49 4c 45 3b 09 2f |UFF] = P|HFILE;./|
|000063f0| 2a 20 70 68 6f 6e 65 20 | 6e 75 6d 62 65 72 20 66 |* phone |number f|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.