home *** CD-ROM | disk | FTP | other *** search
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).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| C source text
| default
| |
99%
| file
| C source, 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 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 73 6f 75 72 63 65 73 | 2e 6d 69 73 63 0a 46 72 |.sources|.misc.Fr|
|00000020| 6f 6d 3a 20 61 6c 6c 62 | 65 72 79 40 75 75 6e 65 |om: allb|ery@uune|
|00000030| 74 2e 55 55 2e 4e 45 54 | 20 28 42 72 61 6e 64 6f |t.UU.NET| (Brando|
|00000040| 6e 20 53 2e 20 41 6c 6c | 62 65 72 79 20 2d 20 63 |n S. All|bery - c|
|00000050| 6f 6d 70 2e 73 6f 75 72 | 63 65 73 2e 6d 69 73 63 |omp.sour|ces.misc|
|00000060| 29 0a 53 75 62 6a 65 63 | 74 3a 20 76 30 37 69 30 |).Subjec|t: v07i0|
|00000070| 35 34 3a 20 73 69 6d 70 | 6c 65 20 76 74 31 30 30 |54: simp|le vt100|
|00000080| 20 65 6d 75 6c 61 74 6f | 72 20 66 6f 72 20 41 70 | emulato|r for Ap|
|00000090| 6f 6c 6c 6f 73 0a 52 65 | 70 6c 79 2d 54 6f 3a 20 |ollos.Re|ply-To: |
|000000a0| 73 38 37 33 30 36 37 39 | 40 73 70 65 63 74 72 75 |s8730679|@spectru|
|000000b0| 6d 2e 65 65 63 73 2e 75 | 6e 73 77 2e 6f 7a 2e 61 |m.eecs.u|nsw.oz.a|
|000000c0| 75 20 28 20 54 68 65 20 | 49 6e 71 75 69 73 69 74 |u ( The |Inquisit|
|000000d0| 6f 72 20 29 0a 0a 50 6f | 73 74 69 6e 67 2d 6e 75 |or )..Po|sting-nu|
|000000e0| 6d 62 65 72 3a 20 56 6f | 6c 75 6d 65 20 37 2c 20 |mber: Vo|lume 7, |
|000000f0| 49 73 73 75 65 20 35 34 | 0a 53 75 62 6d 69 74 74 |Issue 54|.Submitt|
|00000100| 65 64 2d 62 79 3a 20 73 | 38 37 33 30 36 37 39 40 |ed-by: s|8730679@|
|00000110| 73 70 65 63 74 72 75 6d | 2e 65 65 63 73 2e 75 6e |spectrum|.eecs.un|
|00000120| 73 77 2e 6f 7a 2e 61 75 | 20 28 20 54 68 65 20 49 |sw.oz.au| ( The I|
|00000130| 6e 71 75 69 73 69 74 6f | 72 20 29 0a 41 72 63 68 |nquisito|r ).Arch|
|00000140| 69 76 65 2d 6e 61 6d 65 | 3a 20 74 6d 0a 0a 09 49 |ive-name|: tm...I|
|00000150| 20 77 72 6f 74 65 20 74 | 68 69 73 20 70 72 6f 67 | wrote t|his prog|
|00000160| 72 61 6d 20 61 66 74 65 | 72 20 62 65 63 6f 6d 69 |ram afte|r becomi|
|00000170| 6e 67 20 66 72 75 73 74 | 72 61 74 65 64 20 61 74 |ng frust|rated at|
|00000180| 20 74 68 65 0a 72 65 67 | 75 6c 61 72 20 66 61 69 | the.reg|ular fai|
|00000190| 6c 75 72 65 20 6f 6e 20 | 74 68 65 20 70 61 72 74 |lure on |the part|
|000001a0| 20 6f 66 20 74 68 65 20 | 61 70 6f 6c 6c 6f 20 76 | of the |apollo v|
|000001b0| 74 31 30 30 20 65 6d 75 | 6c 61 74 6f 72 20 74 6f |t100 emu|lator to|
|000001c0| 0a 63 6f 6d 65 20 75 70 | 2e 20 49 74 20 69 73 20 |.come up|. It is |
|000001d0| 61 20 73 69 6d 70 6c 65 | 20 74 65 72 6d 69 6e 61 |a simple| termina|
|000001e0| 6c 20 65 6d 75 6c 61 74 | 6f 72 20 77 68 69 63 68 |l emulat|or which|
|000001f0| 20 69 73 20 73 75 66 66 | 69 63 69 65 6e 74 0a 74 | is suff|icient.t|
|00000200| 6f 20 72 75 6e 20 76 6e | 2e 20 48 61 63 6b 20 63 |o run vn|. Hack c|
|00000210| 72 61 73 68 65 73 20 75 | 6e 64 65 72 20 69 74 20 |rashes u|nder it |
|00000220| 61 6e 64 20 74 68 65 72 | 65 20 61 72 65 20 62 75 |and ther|e are bu|
|00000230| 67 73 2c 20 62 75 74 20 | 69 74 20 69 73 0a 74 68 |gs, but |it is.th|
|00000240| 65 20 73 68 65 6c 6c 20 | 6f 66 20 61 20 64 65 63 |e shell |of a dec|
|00000250| 65 6e 74 20 65 6d 75 6c | 61 74 6f 72 2e 0a 0a 09 |ent emul|ator....|
|00000260| 09 54 72 6f 79 20 52 6f | 6c 6c 6f 0a 09 61 76 65 |.Troy Ro|llo..ave|
|00000270| 6e 67 65 72 40 72 75 6e | 78 2e 69 70 73 2e 6f 7a |nger@run|x.ips.oz|
|00000280| 2e 61 75 0a 09 73 38 37 | 33 30 36 37 39 40 73 70 |.au..s87|30679@sp|
|00000290| 65 63 74 72 75 6d 2e 65 | 65 63 73 2e 75 6e 73 77 |ectrum.e|ecs.unsw|
|000002a0| 2e 6f 7a 2e 61 75 0a 09 | 38 37 33 30 36 37 39 40 |.oz.au..|8730679@|
|000002b0| 65 6c 65 63 37 30 61 2e | 65 65 63 73 2e 75 6e 73 |elec70a.|eecs.uns|
|000002c0| 77 2e 6f 7a 2e 61 75 0a | 09 74 72 6f 79 5f 72 6f |w.oz.au.|.troy_ro|
|000002d0| 6c 6c 6f 40 37 31 32 2e | 35 30 32 40 66 69 64 6f |llo@712.|502@fido|
|000002e0| 67 61 74 65 2e 66 69 64 | 6f 2e 6f 7a 2e 61 75 0a |gate.fid|o.oz.au.|
|000002f0| 0a 23 21 20 2f 62 69 6e | 2f 73 68 0a 23 20 54 68 |.#! /bin|/sh.# Th|
|00000300| 69 73 20 69 73 20 61 20 | 73 68 65 6c 6c 20 61 72 |is is a |shell ar|
|00000310| 63 68 69 76 65 2e 20 20 | 52 65 6d 6f 76 65 20 61 |chive. |Remove a|
|00000320| 6e 79 74 68 69 6e 67 20 | 62 65 66 6f 72 65 20 74 |nything |before t|
|00000330| 68 69 73 20 6c 69 6e 65 | 2c 20 74 68 65 6e 0a 23 |his line|, then.#|
|00000340| 20 75 6e 70 61 63 6b 20 | 69 74 20 62 79 20 73 61 | unpack |it by sa|
|00000350| 76 69 6e 67 20 69 74 20 | 69 6e 20 61 20 66 69 6c |ving it |in a fil|
|00000360| 65 20 61 6e 64 20 74 79 | 70 69 6e 67 20 22 73 68 |e and ty|ping "sh|
|00000370| 20 66 69 6c 65 22 2e 20 | 20 28 46 69 6c 65 73 0a | file". | (Files.|
|00000380| 23 20 75 6e 70 61 63 6b | 65 64 20 77 69 6c 6c 20 |# unpack|ed will |
|00000390| 62 65 20 6f 77 6e 65 64 | 20 62 79 20 79 6f 75 20 |be owned| by you |
|000003a0| 61 6e 64 20 68 61 76 65 | 20 64 65 66 61 75 6c 74 |and have| default|
|000003b0| 20 70 65 72 6d 69 73 73 | 69 6f 6e 73 2e 29 0a 23 | permiss|ions.).#|
|000003c0| 0a 23 20 54 68 69 73 20 | 61 72 63 68 69 76 65 20 |.# This |archive |
|000003d0| 63 6f 6e 74 61 69 6e 73 | 3a 0a 23 20 52 45 41 44 |contains|:.# READ|
|000003e0| 4d 45 20 4d 61 6b 65 66 | 69 6c 65 20 74 65 72 6d |ME Makef|ile term|
|000003f0| 63 61 70 20 74 6d 2e 63 | 0a 0a 65 63 68 6f 20 78 |cap tm.c|..echo x|
|00000400| 20 2d 20 52 45 41 44 4d | 45 0a 63 61 74 20 3e 20 | - READM|E.cat > |
|00000410| 22 52 45 41 44 4d 45 22 | 20 3c 3c 20 27 2f 2f 45 |"README"| << '//E|
|00000420| 2a 4f 2a 46 20 52 45 41 | 44 4d 45 2f 2f 27 0a 09 |*O*F REA|DME//'..|
|00000430| 09 20 54 68 69 73 74 65 | 72 6d 20 74 65 72 6d 69 |. Thiste|rm termi|
|00000440| 6e 61 6c 20 65 6d 75 6c | 61 74 6f 72 0a 0a 09 42 |nal emul|ator...B|
|00000450| 79 20 54 72 6f 79 20 52 | 6f 6c 6c 6f 20 31 39 38 |y Troy R|ollo 198|
|00000460| 39 0a 0a 09 54 68 65 20 | 74 68 69 73 74 65 72 6d |9...The |thisterm|
|00000470| 20 74 65 72 6d 69 6e 61 | 6c 20 65 6d 75 6c 61 74 | termina|l emulat|
|00000480| 6f 72 20 69 73 20 61 20 | 6d 69 6e 69 6d 75 6d 20 |or is a |minimum |
|00000490| 74 65 72 6d 69 6e 61 6c | 0a 09 65 6d 75 6c 61 74 |terminal|..emulat|
|000004a0| 6f 72 20 66 6f 72 20 74 | 68 65 20 61 70 6f 6c 6c |or for t|he apoll|
|000004b0| 6f 20 64 6f 6d 61 69 6e | 73 2e 20 54 68 69 73 20 |o domain|s. This |
|000004c0| 76 65 72 73 69 6f 6e 20 | 68 61 73 20 6f 6e 6c 79 |version |has only|
|000004d0| 0a 09 74 77 6f 20 63 6f | 6e 74 72 6f 6c 20 73 65 |..two co|ntrol se|
|000004e0| 71 75 65 6e 63 65 73 3a | 0a 09 09 43 74 72 6c 2d |quences:|...Ctrl-|
|000004f0| 4c 20 28 61 73 63 69 69 | 20 30 78 63 29 20 63 6c |L (ascii| 0xc) cl|
|00000500| 65 61 72 73 20 74 68 65 | 20 73 63 72 65 65 6e 20 |ears the| screen |
|00000510| 28 70 61 64 29 0a 09 09 | 41 6e 20 65 73 63 61 70 |(pad)...|An escap|
|00000520| 65 20 63 68 61 72 61 63 | 74 65 72 20 66 6f 6c 6c |e charac|ter foll|
|00000530| 6f 77 65 64 20 62 79 20 | 78 2b 27 20 27 2c 20 79 |owed by |x+' ', y|
|00000540| 2b 27 20 27 20 6d 6f 76 | 65 73 0a 09 74 6f 20 74 |+' ' mov|es..to t|
|00000550| 68 65 20 67 69 76 65 6e | 20 6c 6f 63 61 74 69 6f |he given| locatio|
|00000560| 6e 20 69 6e 20 74 68 65 | 20 70 61 64 2e 0a 0a 09 |n in the| pad....|
|00000570| 41 64 64 69 74 69 6f 6e | 61 6c 20 63 6f 6e 74 72 |Addition|al contr|
|00000580| 6f 6c 20 73 65 71 75 65 | 6e 63 65 73 20 63 61 6e |ol seque|nces can|
|00000590| 20 62 65 20 63 72 65 61 | 74 65 64 20 62 79 20 6d | be crea|ted by m|
|000005a0| 6f 64 69 66 79 69 6e 67 | 0a 09 74 68 65 20 78 66 |odifying|..the xf|
|000005b0| 72 65 61 64 20 72 6f 75 | 74 69 6e 65 2e 20 54 68 |read rou|tine. Th|
|000005c0| 65 20 6f 6e 65 73 20 61 | 6c 72 65 61 64 79 20 69 |e ones a|lready i|
|000005d0| 6e 73 74 61 6c 6c 65 64 | 20 63 61 6e 2c 20 6f 66 |nstalled| can, of|
|000005e0| 20 63 6f 75 72 73 65 0a | 09 62 65 20 6d 6f 64 69 | course.|.be modi|
|000005f0| 66 69 65 64 2e 0a 0a 09 | 54 68 69 73 74 65 72 6d |fied....|Thisterm|
|00000600| 20 75 73 65 73 20 74 68 | 65 20 70 73 65 75 64 6f | uses th|e pseudo|
|00000610| 20 74 74 79 20 64 65 76 | 69 63 65 20 65 6e 74 72 | tty dev|ice entr|
|00000620| 69 65 73 20 2f 64 65 76 | 2f 70 74 79 70 62 20 61 |ies /dev|/ptypb a|
|00000630| 6e 64 0a 09 2f 64 65 76 | 2f 74 74 79 70 62 2e 20 |nd../dev|/ttypb. |
|00000640| 41 6e 20 69 6d 70 72 6f | 76 65 64 20 76 65 72 73 |An impro|ved vers|
|00000650| 69 6f 6e 20 77 6f 75 6c | 64 20 73 74 61 72 74 20 |ion woul|d start |
|00000660| 61 74 20 5b 70 74 5d 74 | 79 70 30 20 61 6e 64 20 |at [pt]t|yp0 and |
|00000670| 77 6f 72 6b 0a 09 75 70 | 20 74 6f 77 61 72 64 73 |work..up| towards|
|00000680| 20 5b 70 74 5d 74 79 70 | 66 2c 20 61 6c 6c 6f 77 | [pt]typ|f, allow|
|00000690| 69 6e 67 20 6d 6f 72 65 | 20 74 68 61 6e 20 6f 6e |ing more| than on|
|000006a0| 65 20 74 68 69 73 74 65 | 72 6d 0a 09 74 65 72 6d |e thiste|rm..term|
|000006b0| 69 6e 61 6c 20 65 6d 75 | 6c 61 74 6f 72 20 74 6f |inal emu|lator to|
|000006c0| 20 72 75 6e 20 61 74 20 | 6f 6e 63 65 2e 20 49 74 | run at |once. It|
|000006d0| 20 6d 69 67 68 74 20 61 | 6c 73 6f 20 72 65 6d 6f | might a|lso remo|
|000006e0| 76 65 20 62 6f 72 64 65 | 72 73 2c 0a 09 61 6e 64 |ve borde|rs,..and|
|000006f0| 20 75 73 65 20 70 61 64 | 5f 24 73 65 74 5f 66 75 | use pad|_$set_fu|
|00000700| 6c 6c 5f 77 69 6e 64 6f | 77 20 61 6e 64 20 74 68 |ll_windo|w and th|
|00000710| 65 20 63 75 72 72 65 6e | 74 20 73 63 61 6c 65 20 |e curren|t scale |
|00000720| 66 61 63 74 6f 72 20 74 | 6f 0a 09 73 65 74 20 74 |factor t|o..set t|
|00000730| 68 65 20 73 69 7a 65 20 | 6f 66 20 74 68 65 20 77 |he size |of the w|
|00000740| 69 6e 64 6f 77 20 74 6f | 20 6d 61 74 63 68 20 74 |indow to| match t|
|00000750| 68 65 20 73 69 7a 65 20 | 6f 66 20 74 68 65 20 70 |he size |of the p|
|00000760| 73 65 75 64 6f 0a 09 73 | 63 72 65 65 6e 2e 0a 0a |seudo..s|creen...|
|00000770| 09 54 6f 20 75 73 65 20 | 74 68 69 73 2c 20 66 69 |.To use |this, fi|
|00000780| 72 73 74 20 72 75 6e 20 | 74 68 69 73 74 65 72 6d |rst run |thisterm|
|00000790| 2c 20 74 68 65 6e 20 73 | 65 74 20 74 68 65 20 65 |, then s|et the e|
|000007a0| 6e 76 69 72 6f 6e 6d 65 | 6e 74 20 76 61 72 69 61 |nvironme|nt varia|
|000007b0| 62 6c 65 73 3a 0a 0a 09 | 4d 4f 52 45 3d 2d 63 0a |bles:...|MORE=-c.|
|000007c0| 09 54 45 52 4d 3d 74 68 | 69 73 0a 09 54 45 52 4d |.TERM=th|is..TERM|
|000007d0| 43 41 50 3d 79 6f 75 72 | 5f 74 65 72 6d 63 61 70 |CAP=your|_termcap|
|000007e0| 5f 70 61 74 68 0a 0a 09 | 61 76 65 6e 67 65 72 40 |_path...|avenger@|
|000007f0| 72 75 6e 78 2e 69 70 73 | 2e 6f 7a 2e 61 75 0a 09 |runx.ips|.oz.au..|
|00000800| 73 38 37 33 30 36 37 39 | 40 73 70 65 63 74 72 75 |s8730679|@spectru|
|00000810| 6d 2e 65 65 63 73 2e 75 | 6e 73 77 2e 6f 7a 2e 61 |m.eecs.u|nsw.oz.a|
|00000820| 75 20 28 73 6f 6d 65 74 | 69 6d 65 73 29 0a 09 38 |u (somet|imes)..8|
|00000830| 37 33 30 36 37 39 40 65 | 6c 65 63 37 30 61 2e 65 |730679@e|lec70a.e|
|00000840| 65 63 73 2e 75 6e 73 77 | 2e 6f 7a 2e 61 75 20 28 |ecs.unsw|.oz.au (|
|00000850| 73 6f 6d 65 74 69 6d 65 | 73 29 0a 09 74 72 6f 79 |sometime|s)..troy|
|00000860| 5f 72 6f 6c 6c 6f 40 37 | 31 32 2e 35 30 32 40 66 |_rollo@7|12.502@f|
|00000870| 69 64 6f 67 61 74 65 2e | 66 69 64 6f 2e 6f 7a 2e |idogate.|fido.oz.|
|00000880| 61 75 20 28 63 61 6e 27 | 74 20 72 65 70 6c 79 29 |au (can'|t reply)|
|00000890| 0a 2f 2f 45 2a 4f 2a 46 | 20 52 45 41 44 4d 45 2f |.//E*O*F| README/|
|000008a0| 2f 0a 0a 65 63 68 6f 20 | 78 20 2d 20 4d 61 6b 65 |/..echo |x - Make|
|000008b0| 66 69 6c 65 0a 63 61 74 | 20 3e 20 22 4d 61 6b 65 |file.cat| > "Make|
|000008c0| 66 69 6c 65 22 20 3c 3c | 20 27 2f 2f 45 2a 4f 2a |file" <<| '//E*O*|
|000008d0| 46 20 4d 61 6b 65 66 69 | 6c 65 2f 2f 27 0a 23 20 |F Makefi|le//'.# |
|000008e0| 4d 61 6b 65 66 69 6c 65 | 20 66 6f 72 20 74 68 69 |Makefile| for thi|
|000008f0| 73 74 65 72 6d 0a 23 20 | 56 65 72 79 20 65 61 73 |sterm.# |Very eas|
|00000900| 79 3a 0a 0a 74 68 69 73 | 74 65 72 6d 3a 20 74 6d |y:..this|term: tm|
|00000910| 2e 63 0a 09 63 63 20 2d | 6f 20 74 68 69 73 74 65 |.c..cc -|o thiste|
|00000920| 72 6d 20 74 6d 2e 63 0a | 2f 2f 45 2a 4f 2a 46 20 |rm tm.c.|//E*O*F |
|00000930| 4d 61 6b 65 66 69 6c 65 | 2f 2f 0a 0a 65 63 68 6f |Makefile|//..echo|
|00000940| 20 78 20 2d 20 74 65 72 | 6d 63 61 70 0a 63 61 74 | x - ter|mcap.cat|
|00000950| 20 3e 20 22 74 65 72 6d | 63 61 70 22 20 3c 3c 20 | > "term|cap" << |
|00000960| 27 2f 2f 45 2a 4f 2a 46 | 20 74 65 72 6d 63 61 70 |'//E*O*F| termcap|
|00000970| 2f 2f 27 0a 23 0a 23 20 | 54 65 72 6d 63 61 70 20 |//'.#.# |Termcap |
|00000980| 66 69 6c 65 20 66 6f 72 | 20 6d 79 20 6e 65 77 73 |file for| my news|
|00000990| 20 72 65 61 64 69 6e 67 | 20 65 6d 75 6c 61 74 6f | reading| emulato|
|000009a0| 72 0a 23 0a 23 20 72 75 | 6e 20 74 6d 2c 20 74 68 |r.#.# ru|n tm, th|
|000009b0| 65 6e 20 73 65 74 3a 0a | 23 0a 23 09 4d 4f 52 45 |en set:.|#.#.MORE|
|000009c0| 3d 2d 63 0a 23 09 54 45 | 52 4d 3d 74 68 69 73 0a |=-c.#.TE|RM=this.|
|000009d0| 23 09 54 45 52 4d 43 41 | 50 3d 24 48 4f 4d 45 2f |#.TERMCA|P=$HOME/|
|000009e0| 74 65 72 6d 63 61 70 0a | 23 0a 74 68 7c 74 68 69 |termcap.|#.th|thi|
|000009f0| 73 7c 74 68 69 73 20 65 | 6d 75 6c 61 74 6f 72 3a |s|this e|mulator:|
|00000a00| 5c 0a 09 3a 63 6d 3d 5c | 45 25 72 25 2b 20 25 2b |\..:cm=\|E%r%+ %+|
|00000a10| 20 3a 63 6c 3d 5c 31 34 | 3a 6c 69 23 32 35 3a 63 | :cl=\14|:li#25:c|
|00000a20| 6f 23 38 30 3a 62 73 3a | 0a 2f 2f 45 2a 4f 2a 46 |o#80:bs:|.//E*O*F|
|00000a30| 20 74 65 72 6d 63 61 70 | 2f 2f 0a 0a 65 63 68 6f | termcap|//..echo|
|00000a40| 20 78 20 2d 20 74 6d 2e | 63 0a 63 61 74 20 3e 20 | x - tm.|c.cat > |
|00000a50| 22 74 6d 2e 63 22 20 3c | 3c 20 27 2f 2f 45 2a 4f |"tm.c" <|< '//E*O|
|00000a60| 2a 46 20 74 6d 2e 63 2f | 2f 27 0a 2f 2a 20 74 68 |*F tm.c/|/'./* th|
|00000a70| 69 73 74 65 72 6d 20 74 | 65 72 6d 69 6e 61 6c 20 |isterm t|erminal |
|00000a80| 65 6d 75 6c 61 74 6f 72 | 0a 09 42 79 20 54 72 6f |emulator|..By Tro|
|00000a90| 79 20 52 6f 6c 6c 6f 20 | 31 39 38 39 0a 0a 09 54 |y Rollo |1989...T|
|00000aa0| 68 65 20 74 68 69 73 74 | 65 72 6d 20 74 65 72 6d |he thist|erm term|
|00000ab0| 69 6e 61 6c 20 65 6d 75 | 6c 61 74 6f 72 20 69 73 |inal emu|lator is|
|00000ac0| 20 61 20 6d 69 6e 69 6d | 75 6d 20 74 65 72 6d 69 | a minim|um termi|
|00000ad0| 6e 61 6c 0a 09 65 6d 75 | 6c 61 74 6f 72 20 66 6f |nal..emu|lator fo|
|00000ae0| 72 20 74 68 65 20 61 70 | 6f 6c 6c 6f 20 64 6f 6d |r the ap|ollo dom|
|00000af0| 61 69 6e 73 2e 20 54 68 | 69 73 20 76 65 72 73 69 |ains. Th|is versi|
|00000b00| 6f 6e 20 68 61 73 20 6f | 6e 6c 79 0a 09 74 77 6f |on has o|nly..two|
|00000b10| 20 63 6f 6e 74 72 6f 6c | 20 73 65 71 75 65 6e 63 | control| sequenc|
|00000b20| 65 73 3a 0a 09 09 43 74 | 72 6c 2d 4c 20 28 61 73 |es:...Ct|rl-L (as|
|00000b30| 63 69 69 20 30 78 63 29 | 20 63 6c 65 61 72 73 20 |cii 0xc)| clears |
|00000b40| 74 68 65 20 73 63 72 65 | 65 6e 20 28 70 61 64 29 |the scre|en (pad)|
|00000b50| 0a 09 09 41 6e 20 65 73 | 63 61 70 65 20 63 68 61 |...An es|cape cha|
|00000b60| 72 61 63 74 65 72 20 66 | 6f 6c 6c 6f 77 65 64 20 |racter f|ollowed |
|00000b70| 62 79 20 78 2b 27 20 27 | 2c 20 79 2b 27 20 27 20 |by x+' '|, y+' ' |
|00000b80| 6d 6f 76 65 73 0a 09 74 | 6f 20 74 68 65 20 67 69 |moves..t|o the gi|
|00000b90| 76 65 6e 20 6c 6f 63 61 | 74 69 6f 6e 20 69 6e 20 |ven loca|tion in |
|00000ba0| 74 68 65 20 70 61 64 2e | 0a 0a 09 41 64 64 69 74 |the pad.|...Addit|
|00000bb0| 69 6f 6e 61 6c 20 63 6f | 6e 74 72 6f 6c 20 73 65 |ional co|ntrol se|
|00000bc0| 71 75 65 6e 63 65 73 20 | 63 61 6e 20 62 65 20 63 |quences |can be c|
|00000bd0| 72 65 61 74 65 64 20 62 | 79 20 6d 6f 64 69 66 79 |reated b|y modify|
|00000be0| 69 6e 67 0a 09 74 68 65 | 20 78 66 72 65 61 64 20 |ing..the| xfread |
|00000bf0| 72 6f 75 74 69 6e 65 2e | 20 54 68 65 20 6f 6e 65 |routine.| The one|
|00000c00| 73 20 61 6c 72 65 61 64 | 79 20 69 6e 73 74 61 6c |s alread|y instal|
|00000c10| 6c 65 64 20 63 61 6e 2c | 20 6f 66 20 63 6f 75 72 |led can,| of cour|
|00000c20| 73 65 0a 09 62 65 20 6d | 6f 64 69 66 69 65 64 2e |se..be m|odified.|
|00000c30| 0a 0a 09 54 68 69 73 74 | 65 72 6d 20 75 73 65 73 |...Thist|erm uses|
|00000c40| 20 74 68 65 20 70 73 65 | 75 64 6f 20 74 74 79 20 | the pse|udo tty |
|00000c50| 64 65 76 69 63 65 20 65 | 6e 74 72 69 65 73 20 2f |device e|ntries /|
|00000c60| 64 65 76 2f 70 74 79 70 | 62 20 61 6e 64 0a 09 2f |dev/ptyp|b and../|
|00000c70| 64 65 76 2f 74 74 79 70 | 62 2e 20 41 6e 20 69 6d |dev/ttyp|b. An im|
|00000c80| 70 72 6f 76 65 64 20 76 | 65 72 73 69 6f 6e 20 77 |proved v|ersion w|
|00000c90| 6f 75 6c 64 20 73 74 61 | 72 74 20 61 74 20 5b 70 |ould sta|rt at [p|
|00000ca0| 74 5d 74 79 70 30 20 61 | 6e 64 20 77 6f 72 6b 0a |t]typ0 a|nd work.|
|00000cb0| 09 75 70 20 74 6f 77 61 | 72 64 73 20 5b 70 74 5d |.up towa|rds [pt]|
|00000cc0| 74 79 70 66 2c 20 61 6c | 6c 6f 77 69 6e 67 20 6d |typf, al|lowing m|
|00000cd0| 6f 72 65 20 74 68 61 6e | 20 6f 6e 65 20 74 68 69 |ore than| one thi|
|00000ce0| 73 74 65 72 6d 0a 09 74 | 65 72 6d 69 6e 61 6c 20 |sterm..t|erminal |
|00000cf0| 65 6d 75 6c 61 74 6f 72 | 20 74 6f 20 72 75 6e 20 |emulator| to run |
|00000d00| 61 74 20 6f 6e 63 65 2e | 20 49 74 20 6d 69 67 68 |at once.| It migh|
|00000d10| 74 20 61 6c 73 6f 20 72 | 65 6d 6f 76 65 20 62 6f |t also r|emove bo|
|00000d20| 72 64 65 72 73 2c 0a 09 | 61 6e 64 20 75 73 65 20 |rders,..|and use |
|00000d30| 70 61 64 5f 24 73 65 74 | 5f 66 75 6c 6c 5f 77 69 |pad_$set|_full_wi|
|00000d40| 6e 64 6f 77 20 61 6e 64 | 20 74 68 65 20 63 75 72 |ndow and| the cur|
|00000d50| 72 65 6e 74 20 73 63 61 | 6c 65 20 66 61 63 74 6f |rent sca|le facto|
|00000d60| 72 20 74 6f 0a 09 73 65 | 74 20 74 68 65 20 73 69 |r to..se|t the si|
|00000d70| 7a 65 20 6f 66 20 74 68 | 65 20 77 69 6e 64 6f 77 |ze of th|e window|
|00000d80| 20 74 6f 20 6d 61 74 63 | 68 20 74 68 65 20 73 69 | to matc|h the si|
|00000d90| 7a 65 20 6f 66 20 74 68 | 65 20 70 73 65 75 64 6f |ze of th|e pseudo|
|00000da0| 0a 09 73 63 72 65 65 6e | 2e 0a 0a 09 61 76 65 6e |..screen|....aven|
|00000db0| 67 65 72 40 72 75 6e 78 | 2e 69 70 73 2e 6f 7a 2e |ger@runx|.ips.oz.|
|00000dc0| 61 75 0a 09 73 38 37 33 | 30 36 37 39 40 73 70 65 |au..s873|0679@spe|
|00000dd0| 63 74 72 75 6d 2e 65 65 | 63 73 2e 75 6e 73 77 2e |ctrum.ee|cs.unsw.|
|00000de0| 6f 7a 2e 61 75 20 28 73 | 6f 6d 65 74 69 6d 65 73 |oz.au (s|ometimes|
|00000df0| 29 0a 09 38 37 33 30 36 | 37 39 40 65 6c 65 63 37 |)..87306|79@elec7|
|00000e00| 30 61 2e 65 65 63 73 2e | 75 6e 73 77 2e 6f 7a 2e |0a.eecs.|unsw.oz.|
|00000e10| 61 75 20 28 73 6f 6d 65 | 74 69 6d 65 73 29 0a 09 |au (some|times)..|
|00000e20| 74 72 6f 79 5f 72 6f 6c | 6c 6f 40 37 31 32 2e 35 |troy_rol|lo@712.5|
|00000e30| 30 32 40 66 69 64 6f 67 | 61 74 65 2e 66 69 64 6f |02@fidog|ate.fido|
|00000e40| 2e 6f 7a 2e 61 75 20 28 | 63 61 6e 27 74 20 72 65 |.oz.au (|can't re|
|00000e50| 70 6c 79 29 0a 2a 2f 0a | 0a 23 69 6e 63 6c 75 64 |ply).*/.|.#includ|
|00000e60| 65 20 3c 6e 65 74 64 62 | 2e 68 3e 0a 23 69 6e 63 |e <netdb|.h>.#inc|
|00000e70| 6c 75 64 65 20 3c 73 74 | 64 69 6f 2e 68 3e 0a 23 |lude <st|dio.h>.#|
|00000e80| 69 6e 63 6c 75 64 65 20 | 3c 73 69 67 6e 61 6c 2e |include |<signal.|
|00000e90| 68 3e 20 0a 23 69 6e 63 | 6c 75 64 65 20 3c 66 63 |h> .#inc|lude <fc|
|00000ea0| 6e 74 6c 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |ntl.h>.#|include |
|00000eb0| 3c 61 70 6f 6c 6c 6f 2f | 62 61 73 65 2e 68 3e 0a |<apollo/|base.h>.|
|00000ec0| 23 69 6e 63 6c 75 64 65 | 20 3c 61 70 6f 6c 6c 6f |#include| <apollo|
|00000ed0| 2f 70 61 64 2e 68 3e 0a | 23 69 6e 63 6c 75 64 65 |/pad.h>.|#include|
|00000ee0| 20 3c 61 70 6f 6c 6c 6f | 2f 65 72 72 6f 72 2e 68 | <apollo|/error.h|
|00000ef0| 3e 0a 0a 23 64 65 66 69 | 6e 65 20 43 4f 4c 55 4d |>..#defi|ne COLUM|
|00000f00| 4e 53 20 38 30 0a 23 64 | 65 66 69 6e 65 20 52 4f |NS 80.#d|efine RO|
|00000f10| 57 53 20 32 35 0a 0a 2f | 2a 20 49 20 74 68 69 6e |WS 25../|* I thin|
|00000f20| 6b 20 66 64 32 70 20 69 | 73 20 61 20 72 65 6c 69 |k fd2p i|s a reli|
|00000f30| 63 20 66 72 6f 6d 20 61 | 20 70 72 65 76 69 6f 75 |c from a| previou|
|00000f40| 73 20 6c 69 66 65 2e 20 | 54 68 69 73 20 70 72 6f |s life. |This pro|
|00000f50| 67 72 61 6d 20 65 76 6f | 6c 76 65 64 0a 09 66 72 |gram evo|lved..fr|
|00000f60| 6f 6d 20 61 6e 20 72 65 | 78 65 63 20 70 61 74 72 |om an re|xec patr|
|00000f70| 6f 6e 20 2a 2f 0a 69 6e | 74 20 66 64 32 70 20 3d |on */.in|t fd2p =|
|00000f80| 20 31 3b 0a 73 74 61 74 | 75 73 5f 24 74 20 73 74 | 1;.stat|us_$t st|
|00000f90| 61 74 75 73 3b 0a 73 74 | 72 65 61 6d 5f 24 73 6b |atus;.st|ream_$sk|
|00000fa0| 5f 74 20 73 6b 20 3d 20 | 7b 0a 09 09 30 6c 2c 0a |_t sk = |{...0l,.|
|00000fb0| 09 09 30 6c 2c 0a 09 09 | 30 6c 0a 09 7d 3b 0a 0a |..0l,...|0l..};..|
|00000fc0| 2f 2a 20 48 6d 6d 2e 2e | 2e 20 69 6e 74 65 72 65 |/* Hmm..|. intere|
|00000fd0| 73 74 69 6e 67 2e 2e 2e | 20 49 20 64 6f 6e 27 74 |sting...| I don't|
|00000fe0| 20 61 63 74 75 61 6c 6c | 79 20 75 73 65 20 61 72 | actuall|y use ar|
|00000ff0| 67 63 20 6f 72 20 61 72 | 67 76 20 2a 2f 0a 6d 61 |gc or ar|gv */.ma|
|00001000| 69 6e 28 69 6e 74 20 61 | 72 67 63 2c 20 63 68 61 |in(int a|rgc, cha|
|00001010| 72 20 2a 2a 61 72 67 76 | 29 0a 7b 0a 20 20 20 20 |r **argv|).{. |
|00001020| 20 20 20 20 63 68 61 72 | 20 63 5b 32 35 36 5d 3b | char| c[256];|
|00001030| 09 0a 20 20 20 20 20 20 | 20 20 69 6e 74 20 63 63 |.. | int cc|
|00001040| 3b 0a 20 20 20 20 20 20 | 20 20 69 6e 74 20 6e 3b |;. | int n;|
|00001050| 0a 20 20 20 20 20 20 20 | 20 69 6e 74 20 70 6e 2c |. | int pn,|
|00001060| 20 70 69 64 3b 0a 09 69 | 6e 74 20 72 65 6d 2c 20 | pid;..i|nt rem, |
|00001070| 70 72 6f 63 3b 0a 20 20 | 20 20 20 20 20 20 0a 0a |proc;. | ..|
|00001080| 09 2f 2a 20 70 75 74 20 | 74 68 65 20 70 61 64 20 |./* put |the pad |
|00001090| 69 6e 20 72 61 77 20 6d | 6f 64 65 2e 20 54 68 69 |in raw m|ode. Thi|
|000010a0| 73 20 69 73 20 61 20 72 | 65 71 75 69 72 65 6d 65 |s is a r|equireme|
|000010b0| 6e 74 20 66 6f 72 20 61 | 6e 79 20 74 65 72 6d 69 |nt for a|ny termi|
|000010c0| 6e 61 6c 0a 09 20 20 20 | 65 6d 75 6c 61 74 6f 72 |nal.. |emulator|
|000010d0| 20 2a 2f 0a 09 70 61 64 | 5f 24 72 61 77 28 31 2c | */..pad|_$raw(1,|
|000010e0| 20 26 73 74 61 74 75 73 | 29 3b 0a 09 2f 2a 20 4e | &status|);../* N|
|000010f0| 6f 77 20 6f 70 65 6e 20 | 74 68 65 20 6d 61 73 74 |ow open |the mast|
|00001100| 65 72 20 73 69 64 65 20 | 6f 66 20 74 68 65 20 70 |er side |of the p|
|00001110| 73 65 75 64 6f 20 74 74 | 79 20 2a 2f 0a 09 72 65 |seudo tt|y */..re|
|00001120| 6d 3d 6f 70 65 6e 28 22 | 2f 64 65 76 2f 70 74 79 |m=open("|/dev/pty|
|00001130| 70 62 22 2c 20 4f 5f 52 | 44 57 52 29 3b 0a 09 2f |pb", O_R|DWR);../|
|00001140| 2a 20 41 6e 64 20 74 68 | 65 20 73 6c 61 76 65 20 |* And th|e slave |
|00001150| 73 69 64 65 20 2a 2f 0a | 09 70 72 6f 63 3d 6f 70 |side */.|.proc=op|
|00001160| 65 6e 28 22 2f 64 65 76 | 2f 74 74 79 70 62 22 2c |en("/dev|/ttypb",|
|00001170| 20 4f 5f 52 44 57 52 29 | 3b 0a 20 20 20 20 20 20 | O_RDWR)|;. |
|00001180| 20 20 69 66 20 28 72 65 | 6d 3d 3d 2d 31 20 7c 7c | if (re|m==-1 |||
|00001190| 20 70 72 6f 63 3d 3d 2d | 31 29 0a 09 09 2f 2a 20 | proc==-|1).../* |
|000011a0| 43 6f 6d 70 6c 61 69 6e | 20 69 66 20 75 6e 61 62 |Complain| if unab|
|000011b0| 6c 65 20 74 6f 20 6f 70 | 65 6e 20 65 69 74 68 65 |le to op|en eithe|
|000011c0| 72 20 2d 20 70 72 6f 62 | 61 62 6c 79 20 73 68 6f |r - prob|ably sho|
|000011d0| 75 6c 64 0a 09 09 20 20 | 20 74 72 79 20 74 6f 20 |uld... | try to |
|000011e0| 66 69 6e 64 20 61 6e 6f | 74 68 65 72 20 6f 6e 65 |find ano|ther one|
|000011f0| 20 2a 2f 0a 09 09 65 78 | 69 74 28 31 29 3b 0a 09 | */...ex|it(1);..|
|00001200| 69 66 28 28 70 69 64 3d | 66 6f 72 6b 28 29 29 3d |if((pid=|fork())=|
|00001210| 3d 2d 31 29 20 7b 0a 09 | 09 66 70 72 69 6e 74 66 |=-1) {..|.fprintf|
|00001220| 28 73 74 64 65 72 72 2c | 20 22 25 73 3a 20 63 61 |(stderr,| "%s: ca|
|00001230| 6e 27 74 20 66 6f 72 6b | 5c 6e 22 2c 20 61 72 67 |n't fork|\n", arg|
|00001240| 76 5b 30 5d 29 3b 0a 09 | 09 65 78 69 74 28 31 29 |v[0]);..|.exit(1)|
|00001250| 3b 0a 09 7d 0a 09 69 66 | 20 28 70 69 64 3d 3d 30 |;..}..if| (pid==0|
|00001260| 29 20 7b 0a 09 09 2f 2a | 20 54 68 69 73 20 70 72 |) {.../*| This pr|
|00001270| 6f 63 65 73 73 20 6c 69 | 76 65 73 20 6f 6e 20 74 |ocess li|ves on t|
|00001280| 68 65 20 73 6c 61 76 65 | 20 73 69 64 65 20 6f 66 |he slave| side of|
|00001290| 20 74 68 65 20 70 73 65 | 75 64 6f 20 74 74 79 0a | the pse|udo tty.|
|000012a0| 09 09 20 20 20 4d 61 6b | 65 20 74 68 65 20 70 73 |.. Mak|e the ps|
|000012b0| 65 75 64 6f 20 74 74 79 | 20 73 74 64 69 6e 2c 20 |eudo tty| stdin, |
|000012c0| 73 74 64 6f 75 74 20 61 | 6e 64 20 73 74 64 65 72 |stdout a|nd stder|
|000012d0| 72 20 2a 2f 0a 09 09 63 | 6c 6f 73 65 28 30 29 3b |r */...c|lose(0);|
|000012e0| 0a 09 09 63 6c 6f 73 65 | 28 31 29 3b 0a 09 09 63 |...close|(1);...c|
|000012f0| 6c 6f 73 65 28 32 29 3b | 0a 09 09 64 75 70 28 70 |lose(2);|...dup(p|
|00001300| 72 6f 63 29 3b 0a 09 09 | 64 75 70 28 70 72 6f 63 |roc);...|dup(proc|
|00001310| 29 3b 0a 09 09 64 75 70 | 28 70 72 6f 63 29 3b 0a |);...dup|(proc);.|
|00001320| 09 09 63 6c 6f 73 65 28 | 70 72 6f 63 29 3b 0a 09 |..close(|proc);..|
|00001330| 09 63 6c 6f 73 65 28 72 | 65 6d 29 3b 0a 09 09 2f |.close(r|em);.../|
|00001340| 2a 20 49 20 75 73 65 20 | 6b 73 68 20 2d 20 79 6f |* I use |ksh - yo|
|00001350| 75 20 6d 69 67 68 74 20 | 70 72 65 66 65 72 20 61 |u might |prefer a|
|00001360| 6e 6f 74 68 65 72 20 73 | 68 65 6c 6c 20 2a 2f 0a |nother s|hell */.|
|00001370| 09 09 65 78 65 63 6c 28 | 22 2f 62 69 6e 2f 6b 73 |..execl(|"/bin/ks|
|00001380| 68 22 2c 20 22 6b 73 68 | 22 2c 20 22 2d 69 22 2c |h", "ksh|", "-i",|
|00001390| 20 30 29 3b 0a 09 7d 0a | 09 63 6c 6f 73 65 28 70 | 0);..}.|.close(p|
|000013a0| 72 6f 63 29 3b 0a 09 2f | 2a 20 43 6c 6f 73 65 20 |roc);../|* Close |
|000013b0| 74 68 65 20 73 6c 61 76 | 65 20 73 69 64 65 20 73 |the slav|e side s|
|000013c0| 6f 20 74 68 61 74 20 77 | 68 65 6e 20 74 68 65 20 |o that w|hen the |
|000013d0| 6c 61 73 74 20 73 6c 61 | 76 65 20 73 69 64 65 20 |last sla|ve side |
|000013e0| 70 72 6f 63 65 73 73 20 | 64 69 65 73 0a 09 20 20 |process |dies.. |
|000013f0| 20 6f 72 20 63 6c 6f 73 | 65 73 20 69 74 73 20 6c | or clos|es its l|
|00001400| 61 73 74 20 66 69 6c 65 | 20 64 65 73 63 72 69 70 |ast file| descrip|
|00001410| 74 6f 72 20 77 65 20 68 | 65 61 72 20 61 62 6f 75 |tor we h|ear abou|
|00001420| 74 20 69 74 20 6f 6e 20 | 74 68 65 20 6d 61 73 74 |t it on |the mast|
|00001430| 65 72 20 73 69 64 65 20 | 2a 2f 0a 20 20 20 20 20 |er side |*/. |
|00001440| 20 20 20 69 66 20 28 28 | 70 6e 3d 66 6f 72 6b 28 | if ((|pn=fork(|
|00001450| 29 29 3d 3d 2d 31 29 20 | 7b 0a 09 09 66 70 72 69 |))==-1) |{...fpri|
|00001460| 6e 74 66 28 73 74 64 65 | 72 72 2c 20 22 25 73 3a |ntf(stde|rr, "%s:|
|00001470| 20 43 61 6e 27 74 20 66 | 6f 72 6b 5c 6e 22 2c 20 | Can't f|ork\n", |
|00001480| 61 72 67 76 5b 30 5d 29 | 3b 0a 09 09 6b 69 6c 6c |argv[0])|;...kill|
|00001490| 28 70 69 64 2c 39 29 3b | 0a 09 09 65 78 69 74 28 |(pid,9);|...exit(|
|000014a0| 31 29 3b 0a 20 20 20 20 | 20 20 20 20 7d 0a 09 2f |1);. | }../|
|000014b0| 2a 20 43 72 65 61 74 65 | 20 61 20 66 72 61 6d 65 |* Create| a frame|
|000014c0| 20 74 6f 20 61 6c 6c 6f | 77 20 74 68 65 20 63 75 | to allo|w the cu|
|000014d0| 72 73 6f 72 20 74 6f 20 | 72 6f 61 6d 20 61 72 6f |rsor to |roam aro|
|000014e0| 75 6e 64 20 74 68 65 20 | 70 73 65 75 64 6f 20 73 |und the |pseudo s|
|000014f0| 63 72 65 65 6e 20 2a 2f | 0a 09 70 61 64 5f 24 63 |creen */|..pad_$c|
|00001500| 72 65 61 74 65 5f 66 72 | 61 6d 65 28 31 2c 20 43 |reate_fr|ame(1, C|
|00001510| 4f 4c 55 4d 4e 53 2c 20 | 52 4f 57 53 2c 20 26 73 |OLUMNS, |ROWS, &s|
|00001520| 74 61 74 75 73 29 3b 0a | 09 2f 2a 20 54 68 65 20 |tatus);.|./* The |
|00001530| 70 61 72 65 6e 74 20 72 | 65 61 64 73 20 6f 6e 20 |parent r|eads on |
|00001540| 74 68 65 20 6d 61 73 74 | 65 72 20 73 69 64 65 20 |the mast|er side |
|00001550| 28 6f 75 74 70 75 74 20 | 6f 66 20 74 68 65 20 73 |(output |of the s|
|00001560| 6c 61 63 65 20 73 69 64 | 65 29 20 75 6e 74 69 6c |lace sid|e) until|
|00001570| 0a 09 20 20 20 74 68 65 | 72 65 20 61 72 65 20 6e |.. the|re are n|
|00001580| 6f 20 6d 6f 72 65 20 70 | 72 6f 63 65 73 73 65 73 |o more p|rocesses|
|00001590| 20 77 72 69 74 69 6e 67 | 20 6f 6e 20 74 68 65 20 | writing| on the |
|000015a0| 70 73 65 75 64 6f 20 74 | 74 79 2e 20 41 74 20 74 |pseudo t|ty. At t|
|000015b0| 68 69 73 20 70 6f 69 6e | 74 0a 09 20 20 20 69 74 |his poin|t.. it|
|000015c0| 20 65 6e 74 65 72 73 20 | 61 20 73 75 69 63 69 64 | enters |a suicid|
|000015d0| 65 20 70 61 63 74 20 2d | 20 6b 69 6c 6c 69 6e 67 |e pact -| killing|
|000015e0| 20 74 68 65 20 63 68 69 | 6c 64 20 77 69 74 68 20 | the chi|ld with |
|000015f0| 61 20 6d 61 63 68 69 6e | 65 20 67 75 6e 20 28 73 |a machin|e gun (s|
|00001600| 69 67 6e 61 6c 0a 09 20 | 20 20 39 29 20 61 6e 64 |ignal.. | 9) and|
|00001610| 20 64 69 65 69 6e 67 20 | 69 74 73 65 6c 66 2e 0a | dieing |itself..|
|00001620| 09 20 20 20 49 6e 74 69 | 6c 20 69 74 20 64 69 65 |. Inti|l it die|
|00001630| 73 2c 20 74 68 65 20 73 | 6c 61 76 65 20 73 69 64 |s, the s|lave sid|
|00001640| 65 20 74 72 61 6e 73 66 | 65 72 73 20 61 6c 6c 20 |e transf|ers all |
|00001650| 73 74 64 69 6e 20 74 6f | 20 74 68 65 20 70 73 65 |stdin to| the pse|
|00001660| 75 64 6f 20 74 74 79 09 | 2a 2f 0a 20 20 20 20 20 |udo tty.|*/. |
|00001670| 20 20 20 69 66 20 28 70 | 6e 21 3d 30 29 20 7b 0a | if (p|n!=0) {.|
|00001680| 09 09 77 68 69 6c 65 20 | 28 78 66 72 65 61 64 28 |..while |(xfread(|
|00001690| 72 65 6d 29 20 21 3d 2d | 31 29 3b 0a 09 09 70 61 |rem) !=-|1);...pa|
|000016a0| 64 5f 24 63 6f 6f 6b 65 | 64 28 31 2c 20 26 73 74 |d_$cooke|d(1, &st|
|000016b0| 61 74 75 73 29 3b 0a 09 | 09 70 61 64 5f 24 64 65 |atus);..|.pad_$de|
|000016c0| 6c 65 74 65 5f 66 72 61 | 6d 65 28 31 2c 20 26 73 |lete_fra|me(1, &s|
|000016d0| 74 61 74 75 73 29 3b 0a | 09 09 6b 69 6c 6c 28 70 |tatus);.|..kill(p|
|000016e0| 6e 2c 20 39 29 3b 0a 09 | 09 65 78 69 74 28 30 29 |n, 9);..|.exit(0)|
|000016f0| 3b 0a 20 20 20 20 20 20 | 20 20 7d 0a 20 20 20 20 |;. | }. |
|00001700| 20 20 20 20 65 6c 73 65 | 20 7b 0a 20 20 20 20 20 | else| {. |
|00001710| 20 20 20 09 77 68 69 6c | 65 20 28 28 6e 3d 72 65 | .whil|e ((n=re|
|00001720| 61 64 28 30 2c 20 63 2c | 20 32 35 35 29 29 20 21 |ad(0, c,| 255)) !|
|00001730| 3d 20 30 29 0a 09 09 09 | 77 72 69 74 65 28 72 65 |= 0)....|write(re|
|00001740| 6d 2c 20 63 2c 20 6e 29 | 3b 0a 20 20 20 20 20 20 |m, c, n)|;. |
|00001750| 20 20 7d 0a 7d 0a 0a 0a | 2f 2a 20 78 66 72 65 61 | }.}...|/* xfrea|
|00001760| 64 20 72 65 61 64 73 20 | 66 72 6f 6d 20 74 68 65 |d reads |from the|
|00001770| 20 70 73 65 75 64 6f 20 | 74 74 79 2c 20 61 6e 64 | pseudo |tty, and|
|00001780| 20 64 65 63 69 64 65 73 | 20 77 68 61 74 20 74 6f | decides| what to|
|00001790| 20 64 6f 20 61 62 6f 75 | 74 20 74 68 65 20 6f 75 | do abou|t the ou|
|000017a0| 74 70 75 74 2e 0a 20 20 | 20 49 74 27 73 20 66 61 |tput.. | It's fa|
|000017b0| 69 72 6c 79 20 73 74 72 | 61 69 67 68 74 20 66 6f |irly str|aight fo|
|000017c0| 72 77 61 72 64 20 2d 20 | 63 68 65 63 6b 73 20 66 |rward - |checks f|
|000017d0| 6f 72 20 61 6e 79 20 73 | 70 65 63 69 66 69 65 64 |or any s|pecified|
|000017e0| 20 63 6f 6e 74 72 6f 6c | 20 63 68 61 72 61 63 74 | control| charact|
|000017f0| 65 72 2e 0a 20 20 20 54 | 68 65 72 65 20 69 73 20 |er.. T|here is |
|00001800| 61 20 62 75 67 20 69 6e | 20 74 68 65 20 6e 65 77 |a bug in| the new|
|00001810| 6c 69 6e 65 20 73 65 71 | 75 65 6e 63 65 20 2d 20 |line seq|uence - |
|00001820| 69 66 20 74 68 65 20 75 | 73 65 72 20 70 72 65 73 |if the u|ser pres|
|00001830| 73 65 73 20 74 68 65 20 | 70 61 67 65 20 75 70 20 |ses the |page up |
|00001840| 6f 72 0a 20 20 20 73 68 | 69 66 74 2d 75 70 61 72 |or. sh|ift-upar|
|00001850| 72 6f 77 20 6b 65 79 73 | 2c 20 79 6f 75 20 63 61 |row keys|, you ca|
|00001860| 6e 27 74 20 67 65 74 20 | 62 61 63 6b 20 6f 6e 20 |n't get |back on |
|00001870| 74 68 65 20 63 75 72 72 | 65 6e 74 20 66 72 61 6d |the curr|ent fram|
|00001880| 65 2e 2e 2e 2e 20 70 65 | 72 68 61 70 73 20 74 68 |e.... pe|rhaps th|
|00001890| 65 73 65 0a 20 20 20 6b | 65 79 73 20 73 68 6f 75 |ese. k|eys shou|
|000018a0| 6c 64 20 62 65 20 72 65 | 64 65 66 69 6e 65 64 20 |ld be re|defined |
|000018b0| 77 69 74 68 69 6e 20 74 | 68 65 20 72 65 67 69 6f |within t|he regio|
|000018c0| 6e 20 6f 66 20 74 68 65 | 20 70 61 64 2e 0a 09 53 |n of the| pad...S|
|000018d0| 6f 6d 65 20 65 6e 68 61 | 6e 63 65 6d 65 6e 74 73 |ome enha|ncements|
|000018e0| 20 6d 69 67 68 74 20 62 | 65 3a 0a 20 20 20 41 20 | might b|e:. A |
|000018f0| 70 61 72 74 69 61 6c 20 | 73 63 72 65 65 6e 20 63 |partial |screen c|
|00001900| 6c 65 61 72 69 6e 67 20 | 6f 70 74 69 6f 6e 2e 0a |learing |option..|
|00001910| 20 20 20 53 63 72 6f 6c | 6c 20 66 6f 72 77 61 72 | Scrol|l forwar|
|00001920| 64 20 61 6e 64 20 62 61 | 63 6b 20 6f 6e 20 64 65 |d and ba|ck on de|
|00001930| 6d 61 6e 64 2e 0a 20 20 | 20 43 68 61 6e 67 69 6e |mand.. | Changin|
|00001940| 67 20 66 6f 6e 74 20 28 | 70 65 72 68 61 70 73 20 |g font (|perhaps |
|00001950| 6c 6f 61 64 69 6e 67 20 | 61 6e 20 69 6e 76 65 72 |loading |an inver|
|00001960| 73 65 20 66 6f 6e 74 20 | 61 6e 64 20 75 73 69 6e |se font |and usin|
|00001970| 67 20 69 74 20 66 6f 72 | 20 68 69 67 68 6c 69 67 |g it for| highlig|
|00001980| 68 74 2e 0a 09 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |ht...the| followi|
|00001990| 6e 67 20 66 6f 6e 74 73 | 20 63 6f 75 6c 64 20 61 |ng fonts| could a|
|000019a0| 6c 73 6f 20 70 72 6f 76 | 65 20 75 73 65 66 75 6c |lso prov|e useful|
|000019b0| 20 61 73 20 62 75 69 6c | 74 2d 69 6e 73 3a 0a 09 | as buil|t-ins:..|
|000019c0| 20 20 69 74 61 6c 69 63 | 73 0a 09 20 20 62 6f 6c | italic|s.. bol|
|000019d0| 64 0a 09 20 20 74 69 6d | 65 73 5f 72 6f 6d 61 6e |d.. tim|es_roman|
|000019e0| 0a 09 61 73 20 77 65 6c | 6c 20 61 73 20 61 20 70 |..as wel|l as a p|
|000019f0| 75 72 65 20 67 72 61 70 | 68 69 63 73 20 66 6f 6e |ure grap|hics fon|
|00001a00| 74 20 28 73 61 79 2c 20 | 61 20 37 78 31 20 66 6f |t (say, |a 7x1 fo|
|00001a10| 6e 74 20 77 69 74 68 20 | 65 61 63 68 20 63 68 61 |nt with |each cha|
|00001a20| 72 61 63 74 65 72 0a 09 | 72 65 70 72 65 73 65 6e |racter..|represen|
|00001a30| 74 69 6e 67 20 61 20 73 | 65 71 75 65 6e 63 65 20 |ting a s|equence |
|00001a40| 6f 66 20 70 69 78 65 6c | 73 20 69 6e 20 61 20 76 |of pixel|s in a v|
|00001a50| 65 72 74 69 63 61 6c 20 | 6c 69 6e 65 29 0a 20 20 |ertical |line). |
|00001a60| 20 54 68 69 73 20 72 6f | 75 74 69 6e 65 20 64 6f | This ro|utine do|
|00001a70| 65 73 6e 27 74 20 72 65 | 74 75 72 6e 20 75 6e 74 |esn't re|turn unt|
|00001a80| 69 6c 20 74 68 65 72 65 | 20 61 72 65 20 6e 6f 20 |il there| are no |
|00001a90| 6d 6f 72 65 20 73 6c 61 | 76 65 73 20 75 73 69 6e |more sla|ves usin|
|00001aa0| 67 20 74 68 65 20 70 73 | 65 75 64 6f 0a 20 20 20 |g the ps|eudo. |
|00001ab0| 74 74 79 0a 2a 2f 0a 69 | 6e 74 20 78 66 72 65 61 |tty.*/.i|nt xfrea|
|00001ac0| 64 28 66 29 0a 69 6e 74 | 20 66 3b 0a 7b 0a 09 63 |d(f).int| f;.{..c|
|00001ad0| 68 61 72 20 62 3b 0a 09 | 73 68 6f 72 74 20 78 2c |har b;..|short x,|
|00001ae0| 20 79 3b 0a 09 6c 6f 6e | 67 20 6c 69 6e 65 2c 20 | y;..lon|g line, |
|00001af0| 65 6f 66 3b 0a 09 73 68 | 6f 72 74 20 78 6f 2c 20 |eof;..sh|ort xo, |
|00001b00| 79 6f 3b 0a 0a 09 77 68 | 69 6c 65 20 28 6b 72 65 |yo;...wh|ile (kre|
|00001b10| 61 64 28 66 2c 26 62 29 | 21 3d 2d 31 29 0a 09 09 |ad(f,&b)|!=-1)...|
|00001b20| 69 66 20 28 62 3d 3d 27 | 5c 30 33 33 27 29 20 7b |if (b=='|\033') {|
|00001b30| 0a 09 09 09 6b 72 65 61 | 64 28 66 2c 26 62 29 3b |....krea|d(f,&b);|
|00001b40| 0a 09 09 09 78 3d 28 73 | 68 6f 72 74 29 20 28 62 |....x=(s|hort) (b|
|00001b50| 2d 27 20 27 2b 31 29 3b | 0a 09 09 09 6b 72 65 61 |-' '+1);|....krea|
|00001b60| 64 28 66 2c 26 62 29 3b | 0a 09 09 09 79 3d 28 73 |d(f,&b);|....y=(s|
|00001b70| 68 6f 72 74 29 20 28 62 | 2d 27 20 27 2b 31 29 3b |hort) (b|-' '+1);|
|00001b80| 0a 09 09 09 70 61 64 5f | 24 69 6e 71 5f 76 69 65 |....pad_|$inq_vie|
|00001b90| 77 28 31 2c 20 31 2c 20 | 26 6c 69 6e 65 2c 20 26 |w(1, 1, |&line, &|
|00001ba0| 65 6f 66 2c 20 26 78 6f | 2c 20 26 79 6f 2c 20 26 |eof, &xo|, &yo, &|
|00001bb0| 73 74 61 74 75 73 29 3b | 0a 09 09 09 70 61 64 5f |status);|....pad_|
|00001bc0| 24 6d 6f 76 65 28 31 2c | 70 61 64 5f 24 61 62 73 |$move(1,|pad_$abs|
|00001bd0| 6f 6c 75 74 65 2c 78 2c | 79 2b 79 6f 2d 31 2c 26 |olute,x,|y+yo-1,&|
|00001be0| 73 74 61 74 75 73 29 3b | 0a 09 09 09 77 72 69 74 |status);|....writ|
|00001bf0| 65 28 31 2c 22 5c 30 22 | 2c 32 29 3b 0a 09 09 7d |e(1,"\0"|,2);...}|
|00001c00| 0a 09 09 65 6c 73 65 20 | 69 66 20 28 62 3d 3d 27 |...else |if (b=='|
|00001c10| 5c 30 31 34 27 29 20 7b | 0a 09 09 09 70 61 64 5f |\014') {|....pad_|
|00001c20| 24 63 6c 65 61 72 5f 66 | 72 61 6d 65 28 31 2c 20 |$clear_f|rame(1, |
|00001c30| 73 6b 2c 20 26 73 74 61 | 74 75 73 29 3b 0a 09 09 |sk, &sta|tus);...|
|00001c40| 09 77 72 69 74 65 28 31 | 2c 22 5c 30 22 2c 32 29 |.write(1|,"\0",2)|
|00001c50| 3b 0a 09 09 7d 0a 09 09 | 65 6c 73 65 20 7b 0a 09 |;...}...|else {..|
|00001c60| 09 09 77 72 69 74 65 28 | 31 2c 26 62 2c 31 29 3b |..write(|1,&b,1);|
|00001c70| 0a 09 09 09 69 66 20 28 | 62 3d 3d 27 5c 6e 27 29 |....if (|b=='\n')|
|00001c80| 20 7b 0a 09 09 09 09 70 | 61 64 5f 24 69 6e 71 5f | {.....p|ad_$inq_|
|00001c90| 76 69 65 77 28 31 2c 20 | 31 2c 20 26 6c 69 6e 65 |view(1, |1, &line|
|00001ca0| 2c 20 26 65 6f 66 2c 20 | 26 78 6f 2c 20 26 79 6f |, &eof, |&xo, &yo|
|00001cb0| 2c 20 26 73 74 61 74 75 | 73 29 3b 0a 09 09 09 09 |, &statu|s);.....|
|00001cc0| 70 61 64 5f 24 69 6e 71 | 5f 70 6f 73 69 74 69 6f |pad_$inq|_positio|
|00001cd0| 6e 28 31 2c 20 26 78 2c | 20 26 79 2c 20 26 73 74 |n(1, &x,| &y, &st|
|00001ce0| 61 74 75 73 29 3b 0a 09 | 09 09 09 69 66 20 28 79 |atus);..|...if (y|
|00001cf0| 2d 79 6f 2b 31 3d 3d 32 | 35 29 20 7b 0a 09 09 09 |-yo+1==2|5) {....|
|00001d00| 09 09 70 61 64 5f 24 73 | 65 74 5f 76 69 65 77 28 |..pad_$s|et_view(|
|00001d10| 31 2c 20 31 2c 20 6c 69 | 6e 65 2c 20 31 2c 20 79 |1, 1, li|ne, 1, y|
|00001d20| 6f 2b 32 2c 20 26 73 74 | 61 74 75 73 29 3b 0a 09 |o+2, &st|atus);..|
|00001d30| 09 09 09 09 70 61 64 5f | 24 63 72 65 61 74 65 5f |....pad_|$create_|
|00001d40| 66 72 61 6d 65 28 31 2c | 20 43 4f 4c 55 4d 4e 53 |frame(1,| COLUMNS|
|00001d50| 2c 20 52 4f 57 53 2c 20 | 26 73 74 61 74 75 73 29 |, ROWS, |&status)|
|00001d60| 3b 0a 09 09 09 09 7d 0a | 09 09 09 7d 0a 09 09 7d |;.....}.|...}...}|
|00001d70| 0a 09 72 65 74 75 72 6e | 20 28 2d 31 29 3b 0a 7d |..return| (-1);.}|
|00001d80| 0a 0a 2f 2a 20 41 20 62 | 75 66 66 65 72 65 64 20 |../* A b|uffered |
|00001d90| 72 65 61 64 20 2d 20 72 | 65 74 75 72 6e 73 20 31 |read - r|eturns 1|
|00001da0| 20 6f 6e 20 73 75 63 63 | 65 73 73 2c 20 2d 31 20 | on succ|ess, -1 |
|00001db0| 6f 6e 20 66 61 69 6c 75 | 72 65 20 28 6a 75 73 74 |on failu|re (just|
|00001dc0| 20 74 6f 20 62 65 20 64 | 69 66 66 69 63 75 6c 74 | to be d|ifficult|
|00001dd0| 20 66 6f 72 0a 20 20 20 | 61 6e 79 62 6f 64 79 20 | for. |anybody |
|00001de0| 75 73 69 6e 67 20 69 74 | 20 61 73 20 74 68 65 20 |using it| as the |
|00001df0| 61 72 67 75 6d 65 6e 74 | 20 74 6f 20 69 66 21 20 |argument| to if! |
|00001e00| 41 6e 64 20 61 6c 73 6f | 20 66 6f 72 20 63 6f 6d |And also| for com|
|00001e10| 70 61 74 69 62 69 6c 69 | 74 79 20 77 69 74 68 20 |patibili|ty with |
|00001e20| 74 68 65 0a 20 20 20 76 | 61 6c 75 65 73 20 72 65 |the. v|alues re|
|00001e30| 74 75 72 6e 65 64 20 62 | 79 20 44 6f 6d 61 69 6e |turned b|y Domain|
|00001e40| 2f 49 58 0a 20 20 20 72 | 65 74 75 72 6e 73 20 6f |/IX. r|eturns o|
|00001e50| 6e 65 20 63 68 61 72 61 | 63 74 65 72 20 61 74 20 |ne chara|cter at |
|00001e60| 61 20 74 69 6d 65 2c 20 | 62 75 66 66 65 72 69 6e |a time, |bufferin|
|00001e70| 67 20 74 68 65 6d 20 69 | 6e 20 61 20 73 74 61 74 |g them i|n a stat|
|00001e80| 69 63 20 32 30 34 38 20 | 62 79 74 65 20 62 75 66 |ic 2048 |byte buf|
|00001e90| 66 65 72 2e 0a 20 20 20 | 69 6e 74 65 72 65 73 74 |fer.. |interest|
|00001ea0| 69 6e 67 20 74 68 69 6e | 67 73 20 77 6f 75 6c 64 |ing thin|gs would|
|00001eb0| 20 68 61 70 70 65 6e 20 | 69 66 20 74 77 6f 20 64 | happen |if two d|
|00001ec0| 69 66 66 65 72 65 6e 74 | 20 66 69 6c 65 73 20 77 |ifferent| files w|
|00001ed0| 65 72 65 20 75 73 65 64 | 20 61 73 20 61 72 67 75 |ere used| as argu|
|00001ee0| 6d 65 6e 74 73 0a 20 20 | 20 69 6e 74 20 64 69 66 |ments. | int dif|
|00001ef0| 66 65 72 65 6e 74 20 70 | 61 72 74 73 20 6f 66 20 |ferent p|arts of |
|00001f00| 74 68 65 20 70 72 6f 67 | 72 61 6d 2c 20 62 75 74 |the prog|ram, but|
|00001f10| 20 69 74 27 73 20 70 72 | 6f 62 61 62 6c 79 20 6e | it's pr|obably n|
|00001f20| 6f 74 20 77 6f 72 74 68 | 20 66 69 78 69 6e 67 20 |ot worth| fixing |
|00001f30| 2a 2f 0a 69 6e 74 20 6b | 72 65 61 64 28 66 69 6c |*/.int k|read(fil|
|00001f40| 65 2c 20 62 75 66 66 65 | 72 29 0a 69 6e 74 20 66 |e, buffe|r).int f|
|00001f50| 69 6c 65 3b 0a 63 68 61 | 72 20 2a 62 75 66 66 65 |ile;.cha|r *buffe|
|00001f60| 72 3b 0a 7b 0a 09 73 74 | 61 74 69 63 20 63 68 61 |r;.{..st|atic cha|
|00001f70| 72 20 42 49 47 42 55 46 | 5b 32 30 34 38 5d 3b 0a |r BIGBUF|[2048];.|
|00001f80| 09 73 74 61 74 69 63 20 | 69 6e 74 20 62 62 63 6e |.static |int bbcn|
|00001f90| 74 20 3d 20 30 3b 0a 09 | 73 74 61 74 69 63 20 69 |t = 0;..|static i|
|00001fa0| 6e 74 20 62 62 70 74 72 | 20 3d 20 30 3b 0a 0a 09 |nt bbptr| = 0;...|
|00001fb0| 69 66 20 28 62 62 70 74 | 72 3e 3d 62 62 63 6e 74 |if (bbpt|r>=bbcnt|
|00001fc0| 29 20 7b 0a 09 09 62 62 | 63 6e 74 3d 72 65 61 64 |) {...bb|cnt=read|
|00001fd0| 28 66 69 6c 65 2c 20 42 | 49 47 42 55 46 2c 20 32 |(file, B|IGBUF, 2|
|00001fe0| 30 34 38 29 3b 0a 09 09 | 69 66 20 28 62 62 63 6e |048);...|if (bbcn|
|00001ff0| 74 3d 3d 2d 31 29 0a 09 | 09 09 72 65 74 75 72 6e |t==-1)..|..return|
|00002000| 28 2d 31 29 3b 0a 09 09 | 62 62 70 74 72 3d 30 3b |(-1);...|bbptr=0;|
|00002010| 0a 09 7d 0a 09 2a 62 75 | 66 66 65 72 3d 42 49 47 |..}..*bu|ffer=BIG|
|00002020| 42 55 46 5b 62 62 70 74 | 72 5d 3b 0a 09 2b 2b 62 |BUF[bbpt|r];..++b|
|00002030| 62 70 74 72 3b 0a 09 72 | 65 74 75 72 6e 28 31 29 |bptr;..r|eturn(1)|
|00002040| 3b 0a 7d 0a 2f 2f 45 2a | 4f 2a 46 20 74 6d 2e 63 |;.}.//E*|O*F tm.c|
|00002050| 2f 2f 0a 0a 65 78 69 74 | 20 30 0a 0a 0a |//..exit| 0... |
+--------+-------------------------+-------------------------+--------+--------+