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
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news or mail text
| default
| |
99%
| file
| C source text
| default
| |
98%
| file
| C source, ASCII text
| default
| |
100%
| TrID
| E-Mail message (Var. 2)
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/rfc822
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 54 6f | 6d 20 54 72 75 73 63 6f |From: To|m Trusco|
|00000010| 74 74 20 3c 64 65 63 76 | 61 78 21 6d 63 6e 63 21 |tt <decv|ax!mcnc!|
|00000020| 72 74 69 2d 73 65 6c 21 | 74 72 74 3e 0a 53 75 62 |rti-sel!|trt>.Sub|
|00000030| 6a 65 63 74 3a 20 77 6d | 20 28 70 61 72 74 20 34 |ject: wm| (part 4|
|00000040| 20 6f 66 20 34 29 20 2d | 20 50 61 74 63 68 65 73 | of 4) -| Patches|
|00000050| 20 74 6f 20 43 75 72 73 | 65 73 0a 4e 65 77 73 67 | to Curs|es.Newsg|
|00000060| 72 6f 75 70 73 3a 20 6d | 6f 64 2e 73 6f 75 72 63 |roups: m|od.sourc|
|00000070| 65 73 0a 41 70 70 72 6f | 76 65 64 3a 20 6a 6f 68 |es.Appro|ved: joh|
|00000080| 6e 40 67 65 6e 72 61 64 | 2e 55 55 43 50 0a 0a 4d |n@genrad|.UUCP..M|
|00000090| 6f 64 2e 73 6f 75 72 63 | 65 73 3a 20 20 56 6f 6c |od.sourc|es: Vol|
|000000a0| 75 6d 65 20 32 2c 20 49 | 73 73 75 65 20 33 34 0a |ume 2, I|ssue 34.|
|000000b0| 53 75 62 6d 69 74 74 65 | 64 20 62 79 3a 20 54 6f |Submitte|d by: To|
|000000c0| 6d 20 54 72 75 73 63 6f | 74 74 20 3c 64 65 63 76 |m Trusco|tt <decv|
|000000d0| 61 78 21 6d 63 6e 63 21 | 72 74 69 2d 73 65 6c 21 |ax!mcnc!|rti-sel!|
|000000e0| 74 72 74 3e 0a 0a 0a 23 | 21 20 2f 62 69 6e 2f 73 |trt>...#|! /bin/s|
|000000f0| 68 0a 23 20 54 68 69 73 | 20 69 73 20 61 20 73 68 |h.# This| is a sh|
|00000100| 65 6c 6c 20 61 72 63 68 | 69 76 65 2c 20 6d 65 61 |ell arch|ive, mea|
|00000110| 6e 69 6e 67 3a 0a 23 20 | 31 2e 20 52 65 6d 6f 76 |ning:.# |1. Remov|
|00000120| 65 20 65 76 65 72 79 74 | 68 69 6e 67 20 61 62 6f |e everyt|hing abo|
|00000130| 76 65 20 74 68 65 20 23 | 21 20 2f 62 69 6e 2f 73 |ve the #|! /bin/s|
|00000140| 68 20 6c 69 6e 65 2e 0a | 23 20 32 2e 20 53 61 76 |h line..|# 2. Sav|
|00000150| 65 20 74 68 65 20 72 65 | 73 75 6c 74 69 6e 67 20 |e the re|sulting |
|00000160| 74 65 78 74 20 69 6e 20 | 61 20 66 69 6c 65 2e 0a |text in |a file..|
|00000170| 23 20 33 2e 20 45 78 65 | 63 75 74 65 20 74 68 65 |# 3. Exe|cute the|
|00000180| 20 66 69 6c 65 20 77 69 | 74 68 20 2f 62 69 6e 2f | file wi|th /bin/|
|00000190| 73 68 20 28 6e 6f 74 20 | 63 73 68 29 20 74 6f 20 |sh (not |csh) to |
|000001a0| 63 72 65 61 74 65 20 74 | 68 65 20 66 69 6c 65 73 |create t|he files|
|000001b0| 3a 0a 23 09 52 45 41 44 | 4d 45 2e 63 75 72 73 65 |:.#.READ|ME.curse|
|000001c0| 73 0a 23 09 55 50 47 52 | 41 44 45 0a 23 09 61 64 |s.#.UPGR|ADE.#.ad|
|000001d0| 64 63 68 2e 63 2e 70 61 | 74 0a 23 09 63 6c 72 74 |dch.c.pa|t.#.clrt|
|000001e0| 6f 62 6f 74 2e 63 2e 70 | 61 74 0a 23 09 63 72 5f |obot.c.p|at.#.cr_|
|000001f0| 74 74 79 2e 63 2e 70 61 | 74 0a 23 09 63 75 72 73 |tty.c.pa|t.#.curs|
|00000200| 65 73 2e 68 2e 6e 65 77 | 0a 23 09 64 65 6c 65 74 |es.h.new|.#.delet|
|00000210| 65 6c 6e 2e 63 2e 70 61 | 74 0a 23 09 69 6e 69 74 |eln.c.pa|t.#.init|
|00000220| 73 63 72 2e 63 2e 70 61 | 74 0a 23 09 69 6e 73 65 |scr.c.pa|t.#.inse|
|00000230| 72 74 6c 6e 2e 63 2e 70 | 61 74 0a 23 09 6c 6f 6e |rtln.c.p|at.#.lon|
|00000240| 67 6e 61 6d 65 2e 63 2e | 6e 65 77 0a 23 09 6d 6f |gname.c.|new.#.mo|
|00000250| 76 65 2e 63 2e 70 61 74 | 0a 23 09 6d 76 77 69 6e |ve.c.pat|.#.mvwin|
|00000260| 2e 63 2e 70 61 74 0a 23 | 09 6e 65 77 77 69 6e 2e |.c.pat.#|.newwin.|
|00000270| 63 2e 70 61 74 0a 23 09 | 6f 76 65 72 6c 61 79 2e |c.pat.#.|overlay.|
|00000280| 63 2e 70 61 74 0a 23 09 | 70 72 69 6e 74 77 2e 63 |c.pat.#.|printw.c|
|00000290| 2e 6e 65 77 0a 23 09 72 | 65 66 72 65 73 68 2e 63 |.new.#.r|efresh.c|
|000002a0| 2e 70 61 74 0a 23 09 74 | 73 74 70 2e 63 2e 6e 65 |.pat.#.t|stp.c.ne|
|000002b0| 77 0a 23 20 54 68 69 73 | 20 61 72 63 68 69 76 65 |w.# This| archive|
|000002c0| 20 63 72 65 61 74 65 64 | 3a 20 46 72 69 20 41 75 | created|: Fri Au|
|000002d0| 67 20 20 32 20 31 33 3a | 33 33 3a 31 30 20 31 39 |g 2 13:|33:10 19|
|000002e0| 38 35 0a 65 78 70 6f 72 | 74 20 50 41 54 48 3b 20 |85.expor|t PATH; |
|000002f0| 50 41 54 48 3d 2f 62 69 | 6e 3a 24 50 41 54 48 0a |PATH=/bi|n:$PATH.|
|00000300| 65 63 68 6f 20 73 68 61 | 72 3a 20 65 78 74 72 61 |echo sha|r: extra|
|00000310| 63 74 69 6e 67 20 22 27 | 52 45 41 44 4d 45 2e 63 |cting "'|README.c|
|00000320| 75 72 73 65 73 27 22 20 | 27 28 31 30 30 35 20 63 |urses'" |'(1005 c|
|00000330| 68 61 72 61 63 74 65 72 | 73 29 27 0a 69 66 20 74 |haracter|s)'.if t|
|00000340| 65 73 74 20 2d 66 20 27 | 52 45 41 44 4d 45 2e 63 |est -f '|README.c|
|00000350| 75 72 73 65 73 27 0a 74 | 68 65 6e 0a 09 65 63 68 |urses'.t|hen..ech|
|00000360| 6f 20 73 68 61 72 3a 20 | 77 69 6c 6c 20 6e 6f 74 |o shar: |will not|
|00000370| 20 6f 76 65 72 2d 77 72 | 69 74 65 20 65 78 69 73 | over-wr|ite exis|
|00000380| 74 69 6e 67 20 66 69 6c | 65 20 22 27 52 45 41 44 |ting fil|e "'READ|
|00000390| 4d 45 2e 63 75 72 73 65 | 73 27 22 0a 65 6c 73 65 |ME.curse|s'".else|
|000003a0| 0a 73 65 64 20 27 73 2f | 5e 58 2f 2f 27 20 3c 3c |.sed 's/|^X//' <<|
|000003b0| 20 5c 53 48 41 52 5f 45 | 4f 46 20 3e 20 27 52 45 | \SHAR_E|OF > 'RE|
|000003c0| 41 44 4d 45 2e 63 75 72 | 73 65 73 27 0a 58 53 41 |ADME.cur|ses'.XSA|
|000003d0| 56 45 20 54 48 49 53 20 | 4b 49 54 20 49 46 20 59 |VE THIS |KIT IF Y|
|000003e0| 4f 55 20 57 41 4e 54 20 | 54 4f 20 52 55 4e 20 54 |OU WANT |TO RUN T|
|000003f0| 48 45 20 27 57 4d 27 20 | 57 49 4e 44 4f 57 20 4d |HE 'WM' |WINDOW M|
|00000400| 41 4e 41 47 45 52 0a 0a | 09 34 2e 32 20 42 53 44 |ANAGER..|.4.2 BSD|
|00000410| 20 6c 69 62 63 75 72 73 | 65 73 20 70 61 74 63 68 | libcurs|es patch|
|00000420| 20 6b 69 74 0a 09 54 6f | 6d 20 54 72 75 73 63 6f | kit..To|m Trusco|
|00000430| 74 74 2c 20 6d 63 6e 63 | 21 72 74 69 2d 73 65 6c |tt, mcnc|!rti-sel|
|00000440| 21 74 72 74 0a 09 52 65 | 73 65 61 72 63 68 20 54 |!trt..Re|search T|
|00000450| 72 69 61 6e 67 6c 65 20 | 49 6e 73 74 69 74 75 74 |riangle |Institut|
|00000460| 65 2c 20 4e 43 0a 09 09 | 28 39 31 39 29 20 35 34 |e, NC...|(919) 54|
|00000470| 31 2d 37 30 30 35 0a 0a | 54 68 69 73 20 69 73 20 |1-7005..|This is |
|00000480| 61 20 63 6f 6c 6c 65 63 | 74 69 6f 6e 20 6f 66 20 |a collec|tion of |
|00000490| 70 61 74 63 68 65 73 0a | 66 6f 72 20 74 68 65 20 |patches.|for the |
|000004a0| 76 61 6e 69 6c 6c 61 20 | 34 2e 32 20 42 53 44 20 |vanilla |4.2 BSD |
|000004b0| 6c 69 62 63 75 72 73 65 | 73 20 64 69 73 74 72 69 |libcurse|s distri|
|000004c0| 62 75 74 69 6f 6e 2e 0a | 49 74 20 69 6e 63 6c 75 |bution..|It inclu|
|000004d0| 64 65 73 20 73 6f 6d 65 | 20 62 75 67 20 66 69 78 |des some| bug fix|
|000004e0| 65 73 20 72 65 70 6f 72 | 74 65 64 20 6f 6e 20 55 |es repor|ted on U|
|000004f0| 73 65 6e 65 74 2c 0a 73 | 6f 6d 65 20 64 69 73 63 |senet,.s|ome disc|
|00000500| 6f 76 65 72 65 64 20 6c | 6f 63 61 6c 6c 79 2c 20 |overed l|ocally, |
|00000510| 61 6e 64 20 73 6f 6d 65 | 20 28 62 75 74 20 6e 6f |and some| (but no|
|00000520| 74 20 61 6c 6c 29 20 6f | 66 0a 74 68 65 20 66 69 |t all) o|f.the fi|
|00000530| 78 65 73 20 69 6e 20 74 | 68 65 20 55 43 53 46 20 |xes in t|he UCSF |
|00000540| 55 73 65 72 20 53 6f 66 | 74 77 61 72 65 20 45 6e |User Sof|tware En|
|00000550| 67 69 6e 65 65 72 69 6e | 67 20 64 69 73 74 72 69 |gineerin|g distri|
|00000560| 62 75 74 69 6f 6e 20 28 | 22 54 72 6f 6c 6c 22 29 |bution (|"Troll")|
|00000570| 2e 0a 54 6f 6e 79 20 57 | 61 73 73 65 72 6d 61 6e |..Tony W|asserman|
|00000580| 6e 20 67 72 61 63 69 6f | 75 73 6c 79 20 70 65 72 |n gracio|usly per|
|00000590| 6d 69 74 74 65 64 20 74 | 68 6f 73 65 20 74 6f 20 |mitted t|hose to |
|000005a0| 62 65 20 69 6e 63 6c 75 | 64 65 64 20 68 65 72 65 |be inclu|ded here|
|000005b0| 2e 0a 0a 49 74 20 61 6c | 73 6f 20 69 6e 63 6c 75 |...It al|so inclu|
|000005c0| 64 65 73 20 73 6f 6d 65 | 20 64 69 73 67 75 73 74 |des some| disgust|
|000005d0| 69 6e 67 20 65 66 66 69 | 63 69 65 6e 63 79 20 68 |ing effi|ciency h|
|000005e0| 61 63 6b 73 2e 0a 0a 54 | 6f 20 49 6e 73 74 61 6c |acks...T|o Instal|
|000005f0| 6c 3a 0a 2a 29 20 55 6e | 70 61 63 6b 20 74 68 69 |l:.*) Un|pack thi|
|00000600| 73 20 73 68 61 72 20 66 | 69 6c 65 20 69 6e 20 61 |s shar f|ile in a|
|00000610| 6e 20 65 6d 70 74 79 20 | 64 69 72 65 63 74 6f 72 |n empty |director|
|00000620| 79 2e 0a 2a 29 20 49 6e | 20 27 55 50 47 52 41 44 |y..*) In| 'UPGRAD|
|00000630| 45 27 2c 20 73 65 74 20 | 74 68 65 20 43 55 52 53 |E', set |the CURS|
|00000640| 52 43 20 76 61 72 69 61 | 62 6c 65 20 74 6f 0a 20 |RC varia|ble to. |
|00000650| 20 20 74 68 65 20 6e 61 | 6d 65 20 6f 66 20 74 68 | the na|me of th|
|00000660| 65 20 2a 76 61 6e 69 6c | 6c 61 2a 20 34 2e 32 20 |e *vanil|la* 4.2 |
|00000670| 42 53 44 20 6c 69 62 63 | 75 72 73 65 73 20 73 6f |BSD libc|urses so|
|00000680| 75 72 63 65 73 2e 0a 2a | 29 20 4d 61 6b 65 20 73 |urces..*|) Make s|
|00000690| 75 72 65 20 79 6f 75 20 | 68 61 76 65 20 74 68 65 |ure you |have the|
|000006a0| 20 77 6f 6e 64 65 72 66 | 75 6c 20 27 70 61 74 63 | wonderf|ul 'patc|
|000006b0| 68 27 20 70 72 6f 67 72 | 61 6d 2e 0a 09 28 49 66 |h' progr|am...(If|
|000006c0| 20 79 6f 75 20 64 6f 20 | 6e 6f 74 2c 20 64 6f 20 | you do |not, do |
|000006d0| 74 68 65 20 70 61 74 63 | 68 65 73 20 79 6f 75 72 |the patc|hes your|
|000006e0| 73 65 6c 66 21 29 0a 2a | 29 20 52 75 6e 20 55 50 |self!).*|) Run UP|
|000006f0| 47 52 41 44 45 0a 2a 29 | 20 27 6d 61 6b 65 27 20 |GRADE.*)| 'make' |
|00000700| 74 6f 20 63 6f 6d 70 69 | 6c 65 20 6c 69 62 63 75 |to compi|le libcu|
|00000710| 72 73 65 73 20 61 6e 64 | 20 6c 69 62 63 75 72 73 |rses and| libcurs|
|00000720| 65 73 5f 70 0a 2a 29 20 | 49 66 20 79 6f 75 20 77 |es_p.*) |If you w|
|00000730| 61 6e 74 20 74 6f 20 69 | 6e 73 74 61 6c 6c 20 74 |ant to i|nstall t|
|00000740| 68 69 73 20 61 73 20 74 | 68 65 20 73 74 61 6e 64 |his as t|he stand|
|00000750| 61 72 64 20 63 75 72 73 | 65 73 2c 0a 09 61 29 20 |ard curs|es,..a) |
|00000760| 73 61 76 65 20 74 68 65 | 20 6f 6c 64 20 63 75 72 |save the| old cur|
|00000770| 73 65 73 2e 68 20 61 6e | 64 20 2f 75 73 72 2f 6c |ses.h an|d /usr/l|
|00000780| 69 62 2f 6c 69 62 63 75 | 72 2a 0a 09 62 29 20 27 |ib/libcu|r*..b) '|
|00000790| 6d 61 6b 65 20 69 6e 73 | 74 61 6c 6c 27 0a 09 63 |make ins|tall'..c|
|000007a0| 29 20 63 70 20 63 75 72 | 73 65 73 2e 68 20 2f 75 |) cp cur|ses.h /u|
|000007b0| 73 72 2f 69 6e 63 6c 75 | 64 65 0a 53 48 41 52 5f |sr/inclu|de.SHAR_|
|000007c0| 45 4f 46 0a 69 66 20 74 | 65 73 74 20 31 30 30 35 |EOF.if t|est 1005|
|000007d0| 20 2d 6e 65 20 22 60 77 | 63 20 2d 63 20 3c 20 27 | -ne "`w|c -c < '|
|000007e0| 52 45 41 44 4d 45 2e 63 | 75 72 73 65 73 27 60 22 |README.c|urses'`"|
|000007f0| 0a 74 68 65 6e 0a 09 65 | 63 68 6f 20 73 68 61 72 |.then..e|cho shar|
|00000800| 3a 20 65 72 72 6f 72 20 | 74 72 61 6e 73 6d 69 74 |: error |transmit|
|00000810| 74 69 6e 67 20 22 27 52 | 45 41 44 4d 45 2e 63 75 |ting "'R|EADME.cu|
|00000820| 72 73 65 73 27 22 20 27 | 28 73 68 6f 75 6c 64 20 |rses'" '|(should |
|00000830| 68 61 76 65 20 62 65 65 | 6e 20 31 30 30 35 20 63 |have bee|n 1005 c|
|00000840| 68 61 72 61 63 74 65 72 | 73 29 27 0a 66 69 0a 66 |haracter|s)'.fi.f|
|00000850| 69 20 23 20 65 6e 64 20 | 6f 66 20 6f 76 65 72 77 |i # end |of overw|
|00000860| 72 69 74 69 6e 67 20 63 | 68 65 63 6b 0a 65 63 68 |riting c|heck.ech|
|00000870| 6f 20 73 68 61 72 3a 20 | 65 78 74 72 61 63 74 69 |o shar: |extracti|
|00000880| 6e 67 20 22 27 55 50 47 | 52 41 44 45 27 22 20 27 |ng "'UPG|RADE'" '|
|00000890| 28 35 37 33 20 63 68 61 | 72 61 63 74 65 72 73 29 |(573 cha|racters)|
|000008a0| 27 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 55 50 |'.if tes|t -f 'UP|
|000008b0| 47 52 41 44 45 27 0a 74 | 68 65 6e 0a 09 65 63 68 |GRADE'.t|hen..ech|
|000008c0| 6f 20 73 68 61 72 3a 20 | 77 69 6c 6c 20 6e 6f 74 |o shar: |will not|
|000008d0| 20 6f 76 65 72 2d 77 72 | 69 74 65 20 65 78 69 73 | over-wr|ite exis|
|000008e0| 74 69 6e 67 20 66 69 6c | 65 20 22 27 55 50 47 52 |ting fil|e "'UPGR|
|000008f0| 41 44 45 27 22 0a 65 6c | 73 65 0a 73 65 64 20 27 |ADE'".el|se.sed '|
|00000900| 73 2f 5e 58 2f 2f 27 20 | 3c 3c 20 5c 53 48 41 52 |s/^X//' |<< \SHAR|
|00000910| 5f 45 4f 46 20 3e 20 27 | 55 50 47 52 41 44 45 27 |_EOF > '|UPGRADE'|
|00000920| 0a 23 21 20 2f 62 69 6e | 2f 73 68 0a 43 55 52 53 |.#! /bin|/sh.CURS|
|00000930| 52 43 3d 2f 75 73 72 2f | 73 72 63 2f 75 73 72 2e |RC=/usr/|src/usr.|
|00000940| 6c 69 62 2f 6c 69 62 63 | 75 72 73 65 73 0a 0a 65 |lib/libc|urses..e|
|00000950| 63 68 6f 20 27 43 6f 70 | 79 69 6e 67 20 69 6e 20 |cho 'Cop|ying in |
|00000960| 74 68 65 20 34 2e 32 20 | 42 53 44 20 6c 69 62 63 |the 4.2 |BSD libc|
|00000970| 75 72 73 65 73 27 0a 28 | 63 64 20 24 43 55 52 53 |urses'.(|cd $CURS|
|00000980| 52 43 3b 20 74 61 72 20 | 63 66 20 2d 20 2e 29 20 |RC; tar |cf - .) |
|00000990| 7c 20 74 61 72 20 78 76 | 70 66 20 2d 0a 0a 65 63 || tar xv|pf -..ec|
|000009a0| 68 6f 20 27 52 65 70 6c | 61 63 69 6e 67 20 6d 6f |ho 'Repl|acing mo|
|000009b0| 64 75 6c 65 73 3a 27 0a | 66 6f 72 20 69 20 69 6e |dules:'.|for i in|
|000009c0| 20 2a 2e 6e 65 77 0a 64 | 6f 0a 09 65 63 68 6f 20 | *.new.d|o..echo |
|000009d0| 22 20 24 69 22 0a 09 6d | 76 20 60 62 61 73 65 6e |" $i"..m|v `basen|
|000009e0| 61 6d 65 20 24 69 20 2e | 6e 65 77 60 20 60 62 61 |ame $i .|new` `ba|
|000009f0| 73 65 6e 61 6d 65 20 24 | 69 20 2e 6e 65 77 60 2e |sename $|i .new`.|
|00000a00| 6f 72 69 67 0a 09 63 70 | 20 24 69 20 60 62 61 73 |orig..cp| $i `bas|
|00000a10| 65 6e 61 6d 65 20 24 69 | 20 2e 6e 65 77 60 0a 64 |ename $i| .new`.d|
|00000a20| 6f 6e 65 0a 65 63 68 6f | 20 27 20 27 0a 0a 65 63 |one.echo| ' '..ec|
|00000a30| 68 6f 20 27 50 61 74 63 | 68 69 6e 67 20 6d 6f 64 |ho 'Patc|hing mod|
|00000a40| 75 6c 65 73 3a 27 0a 66 | 6f 72 20 69 20 69 6e 20 |ules:'.f|or i in |
|00000a50| 2a 2e 70 61 74 0a 64 6f | 0a 09 65 63 68 6f 20 22 |*.pat.do|..echo "|
|00000a60| 20 24 69 22 0a 09 70 61 | 74 63 68 20 60 62 61 73 | $i"..pa|tch `bas|
|00000a70| 65 6e 61 6d 65 20 24 69 | 20 2e 70 61 74 60 20 24 |ename $i| .pat` $|
|00000a80| 69 0a 64 6f 6e 65 0a 65 | 63 68 6f 20 27 20 27 0a |i.done.e|cho ' '.|
|00000a90| 0a 65 63 68 6f 20 27 44 | 6f 6e 65 27 0a 0a 65 63 |.echo 'D|one'..ec|
|00000aa0| 68 6f 20 27 54 6f 20 63 | 6f 6d 70 69 6c 65 2c 20 |ho 'To c|ompile, |
|00000ab0| 22 6d 61 6b 65 22 27 0a | 65 63 68 6f 20 27 54 6f |"make"'.|echo 'To|
|00000ac0| 20 69 6e 73 74 61 6c 6c | 2c 20 22 6d 61 6b 65 20 | install|, "make |
|00000ad0| 69 6e 73 74 61 6c 6c 22 | 27 0a 65 63 68 6f 20 27 |install"|'.echo '|
|00000ae0| 28 42 75 74 20 66 69 72 | 73 74 20 73 61 76 65 20 |(But fir|st save |
|00000af0| 74 68 65 20 6f 6c 64 20 | 2f 75 73 72 2f 69 6e 63 |the old |/usr/inc|
|00000b00| 6c 75 64 65 2f 63 75 72 | 73 65 73 2e 68 20 61 6e |lude/cur|ses.h an|
|00000b10| 64 20 2f 75 73 72 2f 6c | 69 62 2f 6c 69 62 63 75 |d /usr/l|ib/libcu|
|00000b20| 72 73 2a 29 27 0a 65 63 | 68 6f 20 27 54 6f 20 63 |rs*)'.ec|ho 'To c|
|00000b30| 6c 65 61 6e 20 75 70 2c | 20 22 6d 61 6b 65 20 63 |lean up,| "make c|
|00000b40| 6c 65 61 6e 3b 20 72 6d | 20 2a 2e 6f 72 69 67 20 |lean; rm| *.orig |
|00000b50| 2a 2e 6e 65 77 20 2a 2e | 70 61 74 22 27 0a 53 48 |*.new *.|pat"'.SH|
|00000b60| 41 52 5f 45 4f 46 0a 69 | 66 20 74 65 73 74 20 35 |AR_EOF.i|f test 5|
|00000b70| 37 33 20 2d 6e 65 20 22 | 60 77 63 20 2d 63 20 3c |73 -ne "|`wc -c <|
|00000b80| 20 27 55 50 47 52 41 44 | 45 27 60 22 0a 74 68 65 | 'UPGRAD|E'`".the|
|00000b90| 6e 0a 09 65 63 68 6f 20 | 73 68 61 72 3a 20 65 72 |n..echo |shar: er|
|00000ba0| 72 6f 72 20 74 72 61 6e | 73 6d 69 74 74 69 6e 67 |ror tran|smitting|
|00000bb0| 20 22 27 55 50 47 52 41 | 44 45 27 22 20 27 28 73 | "'UPGRA|DE'" '(s|
|00000bc0| 68 6f 75 6c 64 20 68 61 | 76 65 20 62 65 65 6e 20 |hould ha|ve been |
|00000bd0| 35 37 33 20 63 68 61 72 | 61 63 74 65 72 73 29 27 |573 char|acters)'|
|00000be0| 0a 66 69 0a 66 69 20 23 | 20 65 6e 64 20 6f 66 20 |.fi.fi #| end of |
|00000bf0| 6f 76 65 72 77 72 69 74 | 69 6e 67 20 63 68 65 63 |overwrit|ing chec|
|00000c00| 6b 0a 65 63 68 6f 20 73 | 68 61 72 3a 20 65 78 74 |k.echo s|har: ext|
|00000c10| 72 61 63 74 69 6e 67 20 | 22 27 61 64 64 63 68 2e |racting |"'addch.|
|00000c20| 63 2e 70 61 74 27 22 20 | 27 28 31 30 32 35 20 63 |c.pat'" |'(1025 c|
|00000c30| 68 61 72 61 63 74 65 72 | 73 29 27 0a 69 66 20 74 |haracter|s)'.if t|
|00000c40| 65 73 74 20 2d 66 20 27 | 61 64 64 63 68 2e 63 2e |est -f '|addch.c.|
|00000c50| 70 61 74 27 0a 74 68 65 | 6e 0a 09 65 63 68 6f 20 |pat'.the|n..echo |
|00000c60| 73 68 61 72 3a 20 77 69 | 6c 6c 20 6e 6f 74 20 6f |shar: wi|ll not o|
|00000c70| 76 65 72 2d 77 72 69 74 | 65 20 65 78 69 73 74 69 |ver-writ|e existi|
|00000c80| 6e 67 20 66 69 6c 65 20 | 22 27 61 64 64 63 68 2e |ng file |"'addch.|
|00000c90| 63 2e 70 61 74 27 22 0a | 65 6c 73 65 0a 73 65 64 |c.pat'".|else.sed|
|00000ca0| 20 27 73 2f 5e 58 2f 2f | 27 20 3c 3c 20 5c 53 48 | 's/^X//|' << \SH|
|00000cb0| 41 52 5f 45 4f 46 20 3e | 20 27 61 64 64 63 68 2e |AR_EOF >| 'addch.|
|00000cc0| 63 2e 70 61 74 27 0a 2a | 2a 2a 20 6c 69 62 63 75 |c.pat'.*|** libcu|
|00000cd0| 72 73 65 73 34 32 2f 61 | 64 64 63 68 2e 63 09 54 |rses42/a|ddch.c.T|
|00000ce0| 68 75 20 4e 6f 76 20 31 | 37 20 31 31 3a 30 33 3a |hu Nov 1|7 11:03:|
|00000cf0| 31 30 20 31 39 38 33 0a | 2d 2d 2d 20 6c 69 62 63 |10 1983.|--- libc|
|00000d00| 75 72 73 65 73 2f 61 64 | 64 63 68 2e 63 09 57 65 |urses/ad|dch.c.We|
|00000d10| 64 20 4a 75 6c 20 32 34 | 20 31 33 3a 33 30 3a 35 |d Jul 24| 13:30:5|
|00000d20| 38 20 31 39 38 35 0a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |8 1985.*|********|
|00000d30| 2a 2a 2a 2a 2a 2a 0a 2a | 2a 2a 20 31 39 2c 32 32 |******.*|** 19,22|
|00000d40| 0a 20 20 23 20 65 6e 64 | 69 66 0a 21 20 09 69 66 |. # end|if.! .if|
|00000d50| 20 28 79 20 3e 3d 20 77 | 69 6e 2d 3e 5f 6d 61 78 | (y >= w|in->_max|
|00000d60| 79 20 7c 7c 20 78 20 3e | 3d 20 77 69 6e 2d 3e 5f |y || x >|= win->_|
|00000d70| 6d 61 78 78 20 7c 7c 20 | 79 20 3c 20 30 20 7c 7c |maxx || |y < 0 |||
|00000d80| 20 78 20 3c 20 30 29 0a | 21 20 09 09 72 65 74 75 | x < 0).|! ..retu|
|00000d90| 72 6e 20 45 52 52 3b 0a | 20 20 09 73 77 69 74 63 |rn ERR;.| .switc|
|00000da0| 68 20 28 63 29 20 7b 0a | 0a 2d 2d 2d 20 31 39 2c |h (c) {.|.--- 19,|
|00000db0| 32 35 20 2d 2d 2d 2d 2d | 0a 20 20 23 20 65 6e 64 |25 -----|. # end|
|00000dc0| 69 66 0a 21 20 23 69 66 | 64 65 66 20 73 6c 6f 77 |if.! #if|def slow|
|00000dd0| 77 61 79 0a 21 20 09 2f | 2a 20 54 68 65 73 65 20 |way.! ./|* These |
|00000de0| 74 65 73 74 73 20 27 63 | 61 6e 6e 6f 74 20 68 61 |tests 'c|annot ha|
|00000df0| 70 70 65 6e 27 2e 20 20 | 57 68 61 74 20 61 62 6f |ppen'. |What abo|
|00000e00| 75 74 20 77 69 6e 3d 3d | 4e 55 4c 4c 3f 21 20 2a |ut win==|NULL?! *|
|00000e10| 2f 0a 21 20 09 69 66 20 | 28 79 20 3c 20 30 20 7c |/.! .if |(y < 0 ||
|00000e20| 7c 20 79 20 3e 3d 20 77 | 69 6e 2d 3e 5f 6d 61 78 || y >= w|in->_max|
|00000e30| 79 20 7c 7c 20 78 20 3c | 20 30 20 7c 7c 20 78 20 |y || x <| 0 || x |
|00000e40| 3e 3d 20 77 69 6e 2d 3e | 5f 6d 61 78 78 29 0a 21 |>= win->|_maxx).!|
|00000e50| 20 09 09 72 65 74 75 72 | 6e 20 28 45 52 52 29 3b | ..retur|n (ERR);|
|00000e60| 0a 21 20 23 65 6e 64 69 | 66 0a 20 20 09 73 77 69 |.! #endi|f. .swi|
|00000e70| 74 63 68 20 28 63 29 20 | 7b 0a 2a 2a 2a 2a 2a 2a |tch (c) |{.******|
|00000e80| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0a 2a 2a 2a 20 33 38 |********|*.*** 38|
|00000e90| 2c 34 30 0a 20 20 09 09 | 09 63 20 7c 3d 20 5f 53 |,40. ..|.c |= _S|
|00000ea0| 54 41 4e 44 4f 55 54 3b | 0a 21 20 09 09 73 65 74 |TANDOUT;|.! ..set|
|00000eb0| 5f 63 68 28 77 69 6e 2c | 20 79 2c 20 78 2c 20 63 |_ch(win,| y, x, c|
|00000ec0| 2c 20 4e 55 4c 4c 29 3b | 0a 20 20 09 09 66 6f 72 |, NULL);|. ..for|
|00000ed0| 20 28 77 70 20 3d 20 77 | 69 6e 2d 3e 5f 6e 65 78 | (wp = w|in->_nex|
|00000ee0| 74 70 3b 20 77 70 20 21 | 3d 20 77 69 6e 3b 20 77 |tp; wp !|= win; w|
|00000ef0| 70 20 3d 20 77 70 2d 3e | 5f 6e 65 78 74 70 29 0a |p = wp->|_nextp).|
|00000f00| 0a 2d 2d 2d 20 34 31 2c | 35 35 20 2d 2d 2d 2d 2d |.--- 41,|55 -----|
|00000f10| 0a 20 20 09 09 09 63 20 | 7c 3d 20 5f 53 54 41 4e |. ...c ||= _STAN|
|00000f20| 44 4f 55 54 3b 0a 21 20 | 23 69 66 64 65 66 09 73 |DOUT;.! |#ifdef.s|
|00000f30| 6c 6f 77 77 61 79 0a 21 | 20 09 09 73 65 74 5f 63 |lowway.!| ..set_c|
|00000f40| 68 28 77 69 6e 2c 20 79 | 2c 20 78 2c 20 63 2c 20 |h(win, y|, x, c, |
|00000f50| 28 57 49 4e 44 4f 57 20 | 2a 29 4e 55 4c 4c 29 3b |(WINDOW |*)NULL);|
|00000f60| 0a 21 20 23 65 6c 73 65 | 0a 21 20 09 09 2f 2a 20 |.! #else|.! ../* |
|00000f70| 72 74 69 2d 73 65 6c 21 | 74 72 74 3a 20 65 66 66 |rti-sel!|trt: eff|
|00000f80| 69 63 69 65 6e 63 79 20 | 68 61 63 6b 20 2a 2f 0a |iciency |hack */.|
|00000f90| 21 20 09 09 69 66 20 28 | 77 69 6e 2d 3e 5f 79 5b |! ..if (|win->_y[|
|00000fa0| 79 5d 5b 78 5d 20 21 3d | 20 63 29 20 7b 0a 21 20 |y][x] !=| c) {.! |
|00000fb0| 09 09 09 69 66 20 28 77 | 69 6e 2d 3e 5f 66 69 72 |...if (w|in->_fir|
|00000fc0| 73 74 63 68 5b 79 5d 20 | 3d 3d 20 5f 4e 4f 43 48 |stch[y] |== _NOCH|
|00000fd0| 41 4e 47 45 29 0a 21 20 | 09 09 09 09 77 69 6e 2d |ANGE).! |....win-|
|00000fe0| 3e 5f 66 69 72 73 74 63 | 68 5b 79 5d 20 3d 20 77 |>_firstc|h[y] = w|
|00000ff0| 69 6e 2d 3e 5f 6c 61 73 | 74 63 68 5b 79 5d 20 3d |in->_las|tch[y] =|
|00001000| 20 78 3b 0a 21 20 09 09 | 09 65 6c 73 65 20 69 66 | x;.! ..|.else if|
|00001010| 20 28 78 20 3e 20 77 69 | 6e 2d 3e 5f 6c 61 73 74 | (x > wi|n->_last|
|00001020| 63 68 5b 79 5d 29 0a 21 | 20 09 09 09 09 77 69 6e |ch[y]).!| ....win|
|00001030| 2d 3e 5f 6c 61 73 74 63 | 68 5b 79 5d 20 3d 20 78 |->_lastc|h[y] = x|
|00001040| 3b 0a 21 20 09 09 09 65 | 6c 73 65 20 69 66 20 28 |;.! ...e|lse if (|
|00001050| 78 20 3c 20 77 69 6e 2d | 3e 5f 66 69 72 73 74 63 |x < win-|>_firstc|
|00001060| 68 5b 79 5d 29 0a 21 20 | 09 09 09 09 77 69 6e 2d |h[y]).! |....win-|
|00001070| 3e 5f 66 69 72 73 74 63 | 68 5b 79 5d 20 3d 20 78 |>_firstc|h[y] = x|
|00001080| 3b 0a 21 20 09 09 7d 0a | 21 20 23 65 6e 64 69 66 |;.! ..}.|! #endif|
|00001090| 0a 20 20 09 09 66 6f 72 | 20 28 77 70 20 3d 20 77 |. ..for| (wp = w|
|000010a0| 69 6e 2d 3e 5f 6e 65 78 | 74 70 3b 20 77 70 20 21 |in->_nex|tp; wp !|
|000010b0| 3d 20 77 69 6e 3b 20 77 | 70 20 3d 20 77 70 2d 3e |= win; w|p = wp->|
|000010c0| 5f 6e 65 78 74 70 29 0a | 53 48 41 52 5f 45 4f 46 |_nextp).|SHAR_EOF|
|000010d0| 0a 69 66 20 74 65 73 74 | 20 31 30 32 35 20 2d 6e |.if test| 1025 -n|
|000010e0| 65 20 22 60 77 63 20 2d | 63 20 3c 20 27 61 64 64 |e "`wc -|c < 'add|
|000010f0| 63 68 2e 63 2e 70 61 74 | 27 60 22 0a 74 68 65 6e |ch.c.pat|'`".then|
|00001100| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 65 72 72 |..echo s|har: err|
|00001110| 6f 72 20 74 72 61 6e 73 | 6d 69 74 74 69 6e 67 20 |or trans|mitting |
|00001120| 22 27 61 64 64 63 68 2e | 63 2e 70 61 74 27 22 20 |"'addch.|c.pat'" |
|00001130| 27 28 73 68 6f 75 6c 64 | 20 68 61 76 65 20 62 65 |'(should| have be|
|00001140| 65 6e 20 31 30 32 35 20 | 63 68 61 72 61 63 74 65 |en 1025 |characte|
|00001150| 72 73 29 27 0a 66 69 0a | 66 69 20 23 20 65 6e 64 |rs)'.fi.|fi # end|
|00001160| 20 6f 66 20 6f 76 65 72 | 77 72 69 74 69 6e 67 20 | of over|writing |
|00001170| 63 68 65 63 6b 0a 65 63 | 68 6f 20 73 68 61 72 3a |check.ec|ho shar:|
|00001180| 20 65 78 74 72 61 63 74 | 69 6e 67 20 22 27 63 6c | extract|ing "'cl|
|00001190| 72 74 6f 62 6f 74 2e 63 | 2e 70 61 74 27 22 20 27 |rtobot.c|.pat'" '|
|000011a0| 28 35 30 30 20 63 68 61 | 72 61 63 74 65 72 73 29 |(500 cha|racters)|
|000011b0| 27 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 63 6c |'.if tes|t -f 'cl|
|000011c0| 72 74 6f 62 6f 74 2e 63 | 2e 70 61 74 27 0a 74 68 |rtobot.c|.pat'.th|
|000011d0| 65 6e 0a 09 65 63 68 6f | 20 73 68 61 72 3a 20 77 |en..echo| shar: w|
|000011e0| 69 6c 6c 20 6e 6f 74 20 | 6f 76 65 72 2d 77 72 69 |ill not |over-wri|
|000011f0| 74 65 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |te exist|ing file|
|00001200| 20 22 27 63 6c 72 74 6f | 62 6f 74 2e 63 2e 70 61 | "'clrto|bot.c.pa|
|00001210| 74 27 22 0a 65 6c 73 65 | 0a 73 65 64 20 27 73 2f |t'".else|.sed 's/|
|00001220| 5e 58 2f 2f 27 20 3c 3c | 20 5c 53 48 41 52 5f 45 |^X//' <<| \SHAR_E|
|00001230| 4f 46 20 3e 20 27 63 6c | 72 74 6f 62 6f 74 2e 63 |OF > 'cl|rtobot.c|
|00001240| 2e 70 61 74 27 0a 2a 2a | 2a 20 6c 69 62 63 75 72 |.pat'.**|* libcur|
|00001250| 73 65 73 34 32 2f 63 6c | 72 74 6f 62 6f 74 2e 63 |ses42/cl|rtobot.c|
|00001260| 09 54 68 75 20 4e 6f 76 | 20 31 37 20 31 31 3a 30 |.Thu Nov| 17 11:0|
|00001270| 33 3a 31 32 20 31 39 38 | 33 0a 2d 2d 2d 20 6c 69 |3:12 198|3.--- li|
|00001280| 62 63 75 72 73 65 73 2f | 63 6c 72 74 6f 62 6f 74 |bcurses/|clrtobot|
|00001290| 2e 63 09 57 65 64 20 4a | 75 6c 20 32 34 20 31 33 |.c.Wed J|ul 24 13|
|000012a0| 3a 32 39 3a 34 34 20 31 | 39 38 35 0a 2a 2a 2a 2a |:29:44 1|985.****|
|000012b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 0a 2a 2a 2a 20 |********|***.*** |
|000012c0| 33 2c 35 0a 20 20 2f 2a | 0a 21 20 20 2a 09 54 68 |3,5. /*|.! *.Th|
|000012d0| 69 73 20 72 6f 75 74 69 | 6e 65 20 65 72 61 73 65 |is routi|ne erase|
|000012e0| 73 20 65 76 65 72 79 74 | 68 69 6e 67 20 6f 6e 20 |s everyt|hing on |
|000012f0| 74 68 65 20 77 69 6e 64 | 6f 77 2e 0a 20 20 20 2a |the wind|ow.. *|
|00001300| 0a 0a 2d 2d 2d 20 33 2c | 37 20 2d 2d 2d 2d 2d 0a |..--- 3,|7 -----.|
|00001310| 20 20 2f 2a 0a 21 20 20 | 2a 09 54 68 69 73 20 72 | /*.! |*.This r|
|00001320| 6f 75 74 69 6e 65 20 65 | 72 61 73 65 73 20 66 72 |outine e|rases fr|
|00001330| 6f 6d 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 70 |om the c|urrent p|
|00001340| 6f 73 69 74 69 6f 6e 0a | 21 20 20 2a 09 74 6f 20 |osition.|! *.to |
|00001350| 74 68 65 20 65 6e 64 20 | 6f 66 20 74 68 65 20 77 |the end |of the w|
|00001360| 69 6e 64 6f 77 20 28 69 | 6e 63 6c 75 73 69 76 65 |indow (i|nclusive|
|00001370| 29 2e 0a 21 20 20 2a 09 | 54 68 65 20 63 75 72 72 |)..! *.|The curr|
|00001380| 65 6e 74 20 70 6f 73 69 | 74 69 6f 6e 20 72 65 6d |ent posi|tion rem|
|00001390| 61 69 6e 73 20 75 6e 63 | 68 61 6e 67 65 64 2e 0a |ains unc|hanged..|
|000013a0| 20 20 20 2a 0a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a | *.***|********|
|000013b0| 2a 2a 2a 2a 0a 2a 2a 2a | 20 33 34 2c 33 36 0a 20 |****.***| 34,36. |
|000013c0| 20 09 7d 0a 21 20 09 77 | 69 6e 2d 3e 5f 63 75 72 | .}.! .w|in->_cur|
|000013d0| 78 20 3d 20 77 69 6e 2d | 3e 5f 63 75 72 79 20 3d |x = win-|>_cury =|
|000013e0| 20 30 3b 0a 20 20 7d 0a | 0a 2d 2d 2d 20 33 36 2c | 0;. }.|.--- 36,|
|000013f0| 34 30 20 2d 2d 2d 2d 2d | 0a 20 20 09 7d 0a 21 20 |40 -----|. .}.! |
|00001400| 23 69 66 64 65 66 09 77 | 61 6e 74 61 6d 65 73 73 |#ifdef.w|antamess|
|00001410| 0a 21 20 09 77 69 6e 2d | 3e 5f 63 75 72 78 3d 77 |.! .win-|>_curx=w|
|00001420| 69 6e 2d 3e 5f 63 75 72 | 79 3d 30 3b 0a 21 20 23 |in->_cur|y=0;.! #|
|00001430| 65 6e 64 69 66 0a 20 20 | 7d 0a 53 48 41 52 5f 45 |endif. |}.SHAR_E|
|00001440| 4f 46 0a 69 66 20 74 65 | 73 74 20 35 30 30 20 2d |OF.if te|st 500 -|
|00001450| 6e 65 20 22 60 77 63 20 | 2d 63 20 3c 20 27 63 6c |ne "`wc |-c < 'cl|
|00001460| 72 74 6f 62 6f 74 2e 63 | 2e 70 61 74 27 60 22 0a |rtobot.c|.pat'`".|
|00001470| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00001480| 20 65 72 72 6f 72 20 74 | 72 61 6e 73 6d 69 74 74 | error t|ransmitt|
|00001490| 69 6e 67 20 22 27 63 6c | 72 74 6f 62 6f 74 2e 63 |ing "'cl|rtobot.c|
|000014a0| 2e 70 61 74 27 22 20 27 | 28 73 68 6f 75 6c 64 20 |.pat'" '|(should |
|000014b0| 68 61 76 65 20 62 65 65 | 6e 20 35 30 30 20 63 68 |have bee|n 500 ch|
|000014c0| 61 72 61 63 74 65 72 73 | 29 27 0a 66 69 0a 66 69 |aracters|)'.fi.fi|
|000014d0| 20 23 20 65 6e 64 20 6f | 66 20 6f 76 65 72 77 72 | # end o|f overwr|
|000014e0| 69 74 69 6e 67 20 63 68 | 65 63 6b 0a 65 63 68 6f |iting ch|eck.echo|
|000014f0| 20 73 68 61 72 3a 20 65 | 78 74 72 61 63 74 69 6e | shar: e|xtractin|
|00001500| 67 20 22 27 63 72 5f 74 | 74 79 2e 63 2e 70 61 74 |g "'cr_t|ty.c.pat|
|00001510| 27 22 20 27 28 33 33 39 | 20 63 68 61 72 61 63 74 |'" '(339| charact|
|00001520| 65 72 73 29 27 0a 69 66 | 20 74 65 73 74 20 2d 66 |ers)'.if| test -f|
|00001530| 20 27 63 72 5f 74 74 79 | 2e 63 2e 70 61 74 27 0a | 'cr_tty|.c.pat'.|
|00001540| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00001550| 20 77 69 6c 6c 20 6e 6f | 74 20 6f 76 65 72 2d 77 | will no|t over-w|
|00001560| 72 69 74 65 20 65 78 69 | 73 74 69 6e 67 20 66 69 |rite exi|sting fi|
|00001570| 6c 65 20 22 27 63 72 5f | 74 74 79 2e 63 2e 70 61 |le "'cr_|tty.c.pa|
|00001580| 74 27 22 0a 65 6c 73 65 | 0a 73 65 64 20 27 73 2f |t'".else|.sed 's/|
|00001590| 5e 58 2f 2f 27 20 3c 3c | 20 5c 53 48 41 52 5f 45 |^X//' <<| \SHAR_E|
|000015a0| 4f 46 20 3e 20 27 63 72 | 5f 74 74 79 2e 63 2e 70 |OF > 'cr|_tty.c.p|
|000015b0| 61 74 27 0a 2a 2a 2a 20 | 6c 69 62 63 75 72 73 65 |at'.*** |libcurse|
|000015c0| 73 34 32 2f 63 72 5f 74 | 74 79 2e 63 09 54 68 75 |s42/cr_t|ty.c.Thu|
|000015d0| 20 4e 6f 76 20 31 37 20 | 31 31 3a 30 32 3a 35 34 | Nov 17 |11:02:54|
|000015e0| 20 31 39 38 33 0a 2d 2d | 2d 20 6c 69 62 63 75 72 | 1983.--|- libcur|
|000015f0| 73 65 73 2f 63 72 5f 74 | 74 79 2e 63 09 54 68 75 |ses/cr_t|ty.c.Thu|
|00001600| 20 4d 61 72 20 31 34 20 | 31 33 3a 33 31 3a 34 35 | Mar 14 |13:31:45|
|00001610| 20 31 39 38 35 0a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a | 1985.**|********|
|00001620| 2a 2a 2a 2a 2a 0a 2a 2a | 2a 20 39 36 2c 39 38 0a |*****.**|* 96,98.|
|00001630| 20 20 09 50 43 20 3d 20 | 78 50 43 20 3f 20 78 50 | .PC = |xPC ? xP|
|00001640| 43 5b 30 5d 20 3a 20 46 | 41 4c 53 45 3b 0a 21 20 |C[0] : F|ALSE;.! |
|00001650| 09 61 6f 66 74 73 70 61 | 63 65 20 3d 20 74 73 70 |.aoftspa|ce = tsp|
|00001660| 61 63 65 3b 0a 20 20 09 | 73 74 72 63 70 79 28 74 |ace;. .|strcpy(t|
|00001670| 74 79 74 79 70 65 2c 20 | 6c 6f 6e 67 6e 61 6d 65 |tytype, |longname|
|00001680| 28 67 65 6e 62 75 66 2c | 20 74 79 70 65 29 29 3b |(genbuf,| type));|
|00001690| 0a 0a 2d 2d 2d 20 39 36 | 2c 39 38 20 2d 2d 2d 2d |..--- 96|,98 ----|
|000016a0| 2d 0a 20 20 09 50 43 20 | 3d 20 78 50 43 20 3f 20 |-. .PC |= xPC ? |
|000016b0| 78 50 43 5b 30 5d 20 3a | 20 46 41 4c 53 45 3b 0a |xPC[0] :| FALSE;.|
|000016c0| 21 20 2f 2a 09 61 6f 66 | 74 73 70 61 63 65 20 3d |! /*.aof|tspace =|
|000016d0| 20 74 73 70 61 63 65 3b | 2a 2f 0a 20 20 09 73 74 | tspace;|*/. .st|
|000016e0| 72 63 70 79 28 74 74 79 | 74 79 70 65 2c 20 6c 6f |rcpy(tty|type, lo|
|000016f0| 6e 67 6e 61 6d 65 28 67 | 65 6e 62 75 66 2c 20 74 |ngname(g|enbuf, t|
|00001700| 79 70 65 29 29 3b 0a 53 | 48 41 52 5f 45 4f 46 0a |ype));.S|HAR_EOF.|
|00001710| 69 66 20 74 65 73 74 20 | 33 33 39 20 2d 6e 65 20 |if test |339 -ne |
|00001720| 22 60 77 63 20 2d 63 20 | 3c 20 27 63 72 5f 74 74 |"`wc -c |< 'cr_tt|
|00001730| 79 2e 63 2e 70 61 74 27 | 60 22 0a 74 68 65 6e 0a |y.c.pat'|`".then.|
|00001740| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 65 72 72 6f |.echo sh|ar: erro|
|00001750| 72 20 74 72 61 6e 73 6d | 69 74 74 69 6e 67 20 22 |r transm|itting "|
|00001760| 27 63 72 5f 74 74 79 2e | 63 2e 70 61 74 27 22 20 |'cr_tty.|c.pat'" |
|00001770| 27 28 73 68 6f 75 6c 64 | 20 68 61 76 65 20 62 65 |'(should| have be|
|00001780| 65 6e 20 33 33 39 20 63 | 68 61 72 61 63 74 65 72 |en 339 c|haracter|
|00001790| 73 29 27 0a 66 69 0a 66 | 69 20 23 20 65 6e 64 20 |s)'.fi.f|i # end |
|000017a0| 6f 66 20 6f 76 65 72 77 | 72 69 74 69 6e 67 20 63 |of overw|riting c|
|000017b0| 68 65 63 6b 0a 65 63 68 | 6f 20 73 68 61 72 3a 20 |heck.ech|o shar: |
|000017c0| 65 78 74 72 61 63 74 69 | 6e 67 20 22 27 63 75 72 |extracti|ng "'cur|
|000017d0| 73 65 73 2e 68 2e 6e 65 | 77 27 22 20 27 28 34 37 |ses.h.ne|w'" '(47|
|000017e0| 37 38 20 63 68 61 72 61 | 63 74 65 72 73 29 27 0a |78 chara|cters)'.|
|000017f0| 69 66 20 74 65 73 74 20 | 2d 66 20 27 63 75 72 73 |if test |-f 'curs|
|00001800| 65 73 2e 68 2e 6e 65 77 | 27 0a 74 68 65 6e 0a 09 |es.h.new|'.then..|
|00001810| 65 63 68 6f 20 73 68 61 | 72 3a 20 77 69 6c 6c 20 |echo sha|r: will |
|00001820| 6e 6f 74 20 6f 76 65 72 | 2d 77 72 69 74 65 20 65 |not over|-write e|
|00001830| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 22 27 63 |xisting |file "'c|
|00001840| 75 72 73 65 73 2e 68 2e | 6e 65 77 27 22 0a 65 6c |urses.h.|new'".el|
|00001850| 73 65 0a 73 65 64 20 27 | 73 2f 5e 58 2f 2f 27 20 |se.sed '|s/^X//' |
|00001860| 3c 3c 20 5c 53 48 41 52 | 5f 45 4f 46 20 3e 20 27 |<< \SHAR|_EOF > '|
|00001870| 63 75 72 73 65 73 2e 68 | 2e 6e 65 77 27 0a 2f 2a |curses.h|.new'./*|
|00001880| 20 40 28 23 29 63 75 72 | 73 65 73 2e 68 09 31 2e | @(#)cur|ses.h.1.|
|00001890| 31 34 20 28 42 65 72 6b | 65 6c 65 79 29 20 37 2f |14 (Berk|eley) 7/|
|000018a0| 34 2f 38 33 20 2a 2f 0a | 2f 2a 20 44 65 63 20 38 |4/83 */.|/* Dec 8|
|000018b0| 33 20 43 6f 72 72 65 63 | 74 69 6f 6e 73 20 6d 61 |3 Correc|tions ma|
|000018c0| 64 65 20 61 74 20 55 6e | 69 76 65 72 73 69 74 79 |de at Un|iversity|
|000018d0| 20 6f 66 20 43 61 6c 69 | 66 6f 72 6e 69 61 2c 20 | of Cali|fornia, |
|000018e0| 53 61 6e 20 46 72 61 6e | 63 69 73 63 6f 20 2a 2f |San Fran|cisco */|
|000018f0| 0a 23 20 69 66 6e 64 65 | 66 20 57 49 4e 44 4f 57 |.# ifnde|f WINDOW|
|00001900| 0a 0a 23 20 69 6e 63 6c | 75 64 65 09 3c 73 74 64 |..# incl|ude.<std|
|00001910| 69 6f 2e 68 3e 0a 20 0a | 23 20 69 6e 63 6c 75 64 |io.h>. .|# includ|
|00001920| 65 09 3c 73 67 74 74 79 | 2e 68 3e 0a 23 20 69 6e |e.<sgtty|.h>.# in|
|00001930| 63 6c 75 64 65 09 3c 73 | 79 73 2f 69 6f 63 74 6c |clude.<s|ys/ioctl|
|00001940| 2e 68 3e 0a 0a 23 20 64 | 65 66 69 6e 65 09 62 6f |.h>..# d|efine.bo|
|00001950| 6f 6c 09 63 68 61 72 0a | 23 20 64 65 66 69 6e 65 |ol.char.|# define|
|00001960| 09 72 65 67 09 72 65 67 | 69 73 74 65 72 0a 0a 23 |.reg.reg|ister..#|
|00001970| 20 64 65 66 69 6e 65 09 | 54 52 55 45 09 28 31 29 | define.|TRUE.(1)|
|00001980| 0a 23 20 64 65 66 69 6e | 65 09 46 41 4c 53 45 09 |.# defin|e.FALSE.|
|00001990| 28 30 29 0a 23 20 64 65 | 66 69 6e 65 09 45 52 52 |(0).# de|fine.ERR|
|000019a0| 09 28 30 29 0a 23 20 64 | 65 66 69 6e 65 09 4f 4b |.(0).# d|efine.OK|
|000019b0| 09 28 31 29 0a 0a 23 20 | 64 65 66 69 6e 65 09 5f |.(1)..# |define._|
|000019c0| 45 4e 44 4c 49 4e 45 09 | 30 30 31 0a 23 20 64 65 |ENDLINE.|001.# de|
|000019d0| 66 69 6e 65 09 5f 46 55 | 4c 4c 57 49 4e 09 30 30 |fine._FU|LLWIN.00|
|000019e0| 32 0a 23 20 64 65 66 69 | 6e 65 09 5f 53 43 52 4f |2.# defi|ne._SCRO|
|000019f0| 4c 4c 57 49 4e 09 30 30 | 34 0a 23 20 64 65 66 69 |LLWIN.00|4.# defi|
|00001a00| 6e 65 09 5f 46 4c 55 53 | 48 09 09 30 31 30 0a 23 |ne._FLUS|H..010.#|
|00001a10| 20 64 65 66 69 6e 65 09 | 5f 53 54 41 4e 44 4f 55 | define.|_STANDOU|
|00001a20| 54 09 30 32 30 30 0a 23 | 20 64 65 66 69 6e 65 09 |T.0200.#| define.|
|00001a30| 5f 4e 4f 43 48 41 4e 47 | 45 09 2d 31 0a 0a 23 20 |_NOCHANG|E.-1..# |
|00001a40| 64 65 66 69 6e 65 09 5f | 70 75 74 73 28 73 29 09 |define._|puts(s).|
|00001a50| 74 70 75 74 73 28 73 2c | 20 30 2c 20 5f 70 75 74 |tputs(s,| 0, _put|
|00001a60| 63 68 61 72 29 0a 0a 74 | 79 70 65 64 65 66 09 73 |char)..t|ypedef.s|
|00001a70| 74 72 75 63 74 20 73 67 | 74 74 79 62 09 53 47 54 |truct sg|ttyb.SGT|
|00001a80| 54 59 3b 0a 0a 2f 2a 0a | 20 2a 20 43 61 70 61 62 |TY;../*.| * Capab|
|00001a90| 69 6c 69 74 69 65 73 20 | 66 72 6f 6d 20 74 65 72 |ilities |from ter|
|00001aa0| 6d 63 61 70 0a 20 2a 2f | 0a 0a 65 78 74 65 72 6e |mcap. */|..extern|
|00001ab0| 20 62 6f 6f 6c 20 20 20 | 20 20 41 4d 2c 20 42 53 | bool | AM, BS|
|00001ac0| 2c 20 43 41 2c 20 44 41 | 2c 20 44 42 2c 20 45 4f |, CA, DA|, DB, EO|
|00001ad0| 2c 20 47 54 2c 20 48 5a | 2c 20 49 4e 2c 20 4d 49 |, GT, HZ|, IN, MI|
|00001ae0| 2c 20 4d 53 2c 20 4e 43 | 2c 20 4f 53 2c 20 55 4c |, MS, NC|, OS, UL|
|00001af0| 2c 0a 09 09 58 4e 3b 0a | 65 78 74 65 72 6e 20 63 |,...XN;.|extern c|
|00001b00| 68 61 72 20 20 20 20 20 | 2a 41 4c 2c 20 2a 42 43 |har |*AL, *BC|
|00001b10| 2c 20 2a 42 54 2c 20 2a | 43 44 2c 20 2a 43 45 2c |, *BT, *|CD, *CE,|
|00001b20| 20 2a 43 4c 2c 20 2a 43 | 4d 2c 20 2a 43 52 2c 20 | *CL, *C|M, *CR, |
|00001b30| 2a 44 43 2c 20 2a 44 4c | 2c 20 2a 44 4d 2c 0a 09 |*DC, *DL|, *DM,..|
|00001b40| 09 2a 44 4f 2c 20 2a 45 | 44 2c 20 2a 45 49 2c 20 |.*DO, *E|D, *EI, |
|00001b50| 2a 48 4f 2c 20 2a 49 43 | 2c 20 2a 49 4d 2c 20 2a |*HO, *IC|, *IM, *|
|00001b60| 49 50 2c 20 2a 4c 4c 2c | 20 2a 4d 41 2c 20 2a 4e |IP, *LL,| *MA, *N|
|00001b70| 44 2c 20 2a 4e 4c 2c 0a | 09 09 2a 53 45 2c 20 2a |D, *NL,.|..*SE, *|
|00001b80| 53 46 2c 20 2a 53 4f 2c | 20 2a 53 52 2c 20 2a 54 |SF, *SO,| *SR, *T|
|00001b90| 41 2c 20 2a 54 45 2c 20 | 2a 54 49 2c 20 2a 55 43 |A, *TE, |*TI, *UC|
|00001ba0| 2c 20 2a 55 45 2c 20 2a | 55 50 2c 20 2a 55 53 2c |, *UE, *|UP, *US,|
|00001bb0| 0a 09 09 2a 56 42 2c 20 | 2a 56 45 2c 20 2a 56 53 |...*VB, |*VE, *VS|
|00001bc0| 2c 20 50 43 3b 0a 0a 2f | 2a 0a 20 2a 20 46 72 6f |, PC;../|*. * Fro|
|00001bd0| 6d 20 74 68 65 20 74 74 | 79 20 6d 6f 64 65 73 2e |m the tt|y modes.|
|00001be0| 2e 2e 0a 20 2a 2f 0a 0a | 65 78 74 65 72 6e 20 62 |... */..|extern b|
|00001bf0| 6f 6f 6c 09 4e 4f 4e 4c | 2c 20 55 50 50 45 52 43 |ool.NONL|, UPPERC|
|00001c00| 41 53 45 2c 20 6e 6f 72 | 6d 74 74 79 2c 20 5f 70 |ASE, nor|mtty, _p|
|00001c10| 66 61 73 74 3b 0a 0a 73 | 74 72 75 63 74 20 5f 77 |fast;..s|truct _w|
|00001c20| 69 6e 5f 73 74 20 7b 0a | 09 73 68 6f 72 74 09 09 |in_st {.|.short..|
|00001c30| 5f 63 75 72 79 2c 20 5f | 63 75 72 78 3b 0a 09 73 |_cury, _|curx;..s|
|00001c40| 68 6f 72 74 09 09 5f 6d | 61 78 79 2c 20 5f 6d 61 |hort.._m|axy, _ma|
|00001c50| 78 78 3b 0a 09 73 68 6f | 72 74 09 09 5f 62 65 67 |xx;..sho|rt.._beg|
|00001c60| 79 2c 20 5f 62 65 67 78 | 3b 0a 09 73 68 6f 72 74 |y, _begx|;..short|
|00001c70| 09 09 5f 66 6c 61 67 73 | 3b 0a 09 62 6f 6f 6c 09 |.._flags|;..bool.|
|00001c80| 09 5f 63 6c 65 61 72 3b | 0a 09 62 6f 6f 6c 09 09 |._clear;|..bool..|
|00001c90| 5f 6c 65 61 76 65 3b 0a | 09 62 6f 6f 6c 09 09 5f |_leave;.|.bool.._|
|00001ca0| 73 63 72 6f 6c 6c 3b 0a | 09 63 68 61 72 09 09 2a |scroll;.|.char..*|
|00001cb0| 2a 5f 79 3b 0a 09 73 68 | 6f 72 74 09 09 2a 5f 66 |*_y;..sh|ort..*_f|
|00001cc0| 69 72 73 74 63 68 3b 0a | 09 73 68 6f 72 74 09 09 |irstch;.|.short..|
|00001cd0| 2a 5f 6c 61 73 74 63 68 | 3b 0a 09 73 74 72 75 63 |*_lastch|;..struc|
|00001ce0| 74 20 5f 77 69 6e 5f 73 | 74 09 2a 5f 6e 65 78 74 |t _win_s|t.*_next|
|00001cf0| 70 2c 20 2a 5f 6f 72 69 | 67 3b 0a 7d 3b 0a 0a 23 |p, *_ori|g;.};..#|
|00001d00| 20 64 65 66 69 6e 65 09 | 57 49 4e 44 4f 57 09 73 | define.|WINDOW.s|
|00001d10| 74 72 75 63 74 20 5f 77 | 69 6e 5f 73 74 0a 0a 65 |truct _w|in_st..e|
|00001d20| 78 74 65 72 6e 20 62 6f | 6f 6c 09 4d 79 5f 74 65 |xtern bo|ol.My_te|
|00001d30| 72 6d 2c 20 5f 65 63 68 | 6f 69 74 2c 20 5f 72 61 |rm, _ech|oit, _ra|
|00001d40| 77 6d 6f 64 65 2c 20 5f | 65 6e 64 77 69 6e 3b 0a |wmode, _|endwin;.|
|00001d50| 0a 65 78 74 65 72 6e 20 | 63 68 61 72 09 2a 44 65 |.extern |char.*De|
|00001d60| 66 5f 74 65 72 6d 2c 20 | 74 74 79 74 79 70 65 5b |f_term, |ttytype[|
|00001d70| 5d 3b 0a 0a 65 78 74 65 | 72 6e 20 69 6e 74 09 4c |];..exte|rn int.L|
|00001d80| 49 4e 45 53 2c 20 43 4f | 4c 53 2c 20 5f 74 74 79 |INES, CO|LS, _tty|
|00001d90| 5f 63 68 2c 20 5f 72 65 | 73 5f 66 6c 67 3b 0a 0a |_ch, _re|s_flg;..|
|00001da0| 65 78 74 65 72 6e 20 53 | 47 54 54 59 09 5f 74 74 |extern S|GTTY._tt|
|00001db0| 79 3b 0a 0a 65 78 74 65 | 72 6e 20 57 49 4e 44 4f |y;..exte|rn WINDO|
|00001dc0| 57 09 2a 73 74 64 73 63 | 72 2c 20 2a 63 75 72 73 |W.*stdsc|r, *curs|
|00001dd0| 63 72 3b 0a 0a 2f 2a 0a | 20 2a 09 44 65 66 69 6e |cr;../*.| *.Defin|
|00001de0| 65 20 56 4f 49 44 20 74 | 6f 20 73 74 6f 70 20 6c |e VOID t|o stop l|
|00001df0| 69 6e 74 20 66 72 6f 6d | 20 67 65 6e 65 72 61 74 |int from| generat|
|00001e00| 69 6e 67 20 22 6e 75 6c | 6c 20 65 66 66 65 63 74 |ing "nul|l effect|
|00001e10| 22 0a 20 2a 20 63 6f 6d | 6d 65 6e 74 73 2e 0a 20 |". * com|ments.. |
|00001e20| 2a 2f 0a 23 20 69 66 64 | 65 66 20 6c 69 6e 74 0a |*/.# ifd|ef lint.|
|00001e30| 69 6e 74 09 5f 5f 76 6f | 69 64 5f 5f 3b 0a 23 20 |int.__vo|id__;.# |
|00001e40| 64 65 66 69 6e 65 09 56 | 4f 49 44 28 78 29 09 28 |define.V|OID(x).(|
|00001e50| 5f 5f 76 6f 69 64 5f 5f | 20 3d 20 28 69 6e 74 29 |__void__| = (int)|
|00001e60| 20 28 78 29 29 0a 23 20 | 65 6c 73 65 0a 23 20 64 | (x)).# |else.# d|
|00001e70| 65 66 69 6e 65 09 56 4f | 49 44 28 78 29 09 28 78 |efine.VO|ID(x).(x|
|00001e80| 29 0a 23 20 65 6e 64 69 | 66 0a 0a 2f 2a 0a 20 2a |).# endi|f../*. *|
|00001e90| 20 70 73 75 65 64 6f 20 | 66 75 6e 63 74 69 6f 6e | psuedo |function|
|00001ea0| 73 20 66 6f 72 20 73 74 | 61 6e 64 61 72 64 20 73 |s for st|andard s|
|00001eb0| 63 72 65 65 6e 0a 20 2a | 2f 0a 23 20 64 65 66 69 |creen. *|/.# defi|
|00001ec0| 6e 65 09 61 64 64 63 68 | 28 63 68 29 09 56 4f 49 |ne.addch|(ch).VOI|
|00001ed0| 44 28 77 61 64 64 63 68 | 28 73 74 64 73 63 72 2c |D(waddch|(stdscr,|
|00001ee0| 20 63 68 29 29 0a 23 20 | 64 65 66 69 6e 65 09 67 | ch)).# |define.g|
|00001ef0| 65 74 63 68 28 29 09 09 | 56 4f 49 44 28 77 67 65 |etch()..|VOID(wge|
|00001f00| 74 63 68 28 73 74 64 73 | 63 72 29 29 0a 23 20 64 |tch(stds|cr)).# d|
|00001f10| 65 66 69 6e 65 09 61 64 | 64 73 74 72 28 73 74 72 |efine.ad|dstr(str|
|00001f20| 29 09 56 4f 49 44 28 77 | 61 64 64 73 74 72 28 73 |).VOID(w|addstr(s|
|00001f30| 74 64 73 63 72 2c 20 73 | 74 72 29 29 0a 23 20 64 |tdscr, s|tr)).# d|
|00001f40| 65 66 69 6e 65 09 67 65 | 74 73 74 72 28 73 74 72 |efine.ge|tstr(str|
|00001f50| 29 09 56 4f 49 44 28 77 | 67 65 74 73 74 72 28 73 |).VOID(w|getstr(s|
|00001f60| 74 64 73 63 72 2c 20 73 | 74 72 29 29 0a 23 20 64 |tdscr, s|tr)).# d|
|00001f70| 65 66 69 6e 65 09 6d 6f | 76 65 28 79 2c 20 78 29 |efine.mo|ve(y, x)|
|00001f80| 09 56 4f 49 44 28 77 6d | 6f 76 65 28 73 74 64 73 |.VOID(wm|ove(stds|
|00001f90| 63 72 2c 20 79 2c 20 78 | 29 29 0a 23 20 64 65 66 |cr, y, x|)).# def|
|00001fa0| 69 6e 65 09 63 6c 65 61 | 72 28 29 09 09 56 4f 49 |ine.clea|r()..VOI|
|00001fb0| 44 28 77 63 6c 65 61 72 | 28 73 74 64 73 63 72 29 |D(wclear|(stdscr)|
|00001fc0| 29 0a 23 20 64 65 66 69 | 6e 65 09 65 72 61 73 65 |).# defi|ne.erase|
|00001fd0| 28 29 09 09 56 4f 49 44 | 28 77 65 72 61 73 65 28 |()..VOID|(werase(|
|00001fe0| 73 74 64 73 63 72 29 29 | 0a 23 20 64 65 66 69 6e |stdscr))|.# defin|
|00001ff0| 65 09 63 6c 72 74 6f 62 | 6f 74 28 29 09 56 4f 49 |e.clrtob|ot().VOI|
|00002000| 44 28 77 63 6c 72 74 6f | 62 6f 74 28 73 74 64 73 |D(wclrto|bot(stds|
|00002010| 63 72 29 29 0a 23 20 64 | 65 66 69 6e 65 09 63 6c |cr)).# d|efine.cl|
|00002020| 72 74 6f 65 6f 6c 28 29 | 09 56 4f 49 44 28 77 63 |rtoeol()|.VOID(wc|
|00002030| 6c 72 74 6f 65 6f 6c 28 | 73 74 64 73 63 72 29 29 |lrtoeol(|stdscr))|
|00002040| 0a 23 20 64 65 66 69 6e | 65 09 69 6e 73 65 72 74 |.# defin|e.insert|
|00002050| 6c 6e 28 29 09 56 4f 49 | 44 28 77 69 6e 73 65 72 |ln().VOI|D(winser|
|00002060| 74 6c 6e 28 73 74 64 73 | 63 72 29 29 0a 23 20 64 |tln(stds|cr)).# d|
|00002070| 65 66 69 6e 65 09 64 65 | 6c 65 74 65 6c 6e 28 29 |efine.de|leteln()|
|00002080| 09 56 4f 49 44 28 77 64 | 65 6c 65 74 65 6c 6e 28 |.VOID(wd|eleteln(|
|00002090| 73 74 64 73 63 72 29 29 | 0a 23 20 64 65 66 69 6e |stdscr))|.# defin|
|000020a0| 65 09 72 65 66 72 65 73 | 68 28 29 09 56 4f 49 44 |e.refres|h().VOID|
|000020b0| 28 77 72 65 66 72 65 73 | 68 28 73 74 64 73 63 72 |(wrefres|h(stdscr|
|000020c0| 29 29 0a 23 20 64 65 66 | 69 6e 65 09 69 6e 63 68 |)).# def|ine.inch|
|000020d0| 28 29 09 09 56 4f 49 44 | 28 77 69 6e 63 68 28 73 |()..VOID|(winch(s|
|000020e0| 74 64 73 63 72 29 29 0a | 23 20 64 65 66 69 6e 65 |tdscr)).|# define|
|000020f0| 09 69 6e 73 63 68 28 63 | 29 09 56 4f 49 44 28 77 |.insch(c|).VOID(w|
|00002100| 69 6e 73 63 68 28 73 74 | 64 73 63 72 2c 63 29 29 |insch(st|dscr,c))|
|00002110| 0a 23 20 64 65 66 69 6e | 65 09 64 65 6c 63 68 28 |.# defin|e.delch(|
|00002120| 29 09 09 56 4f 49 44 28 | 77 64 65 6c 63 68 28 73 |)..VOID(|wdelch(s|
|00002130| 74 64 73 63 72 29 29 0a | 23 20 64 65 66 69 6e 65 |tdscr)).|# define|
|00002140| 09 73 74 61 6e 64 6f 75 | 74 28 29 09 56 4f 49 44 |.standou|t().VOID|
|00002150| 28 77 73 74 61 6e 64 6f | 75 74 28 73 74 64 73 63 |(wstando|ut(stdsc|
|00002160| 72 29 29 0a 23 20 64 65 | 66 69 6e 65 09 73 74 61 |r)).# de|fine.sta|
|00002170| 6e 64 65 6e 64 28 29 09 | 56 4f 49 44 28 77 73 74 |ndend().|VOID(wst|
|00002180| 61 6e 64 65 6e 64 28 73 | 74 64 73 63 72 29 29 0a |andend(s|tdscr)).|
|00002190| 0a 2f 2a 0a 20 2a 20 6d | 76 20 66 75 6e 63 74 69 |./*. * m|v functi|
|000021a0| 6f 6e 73 0a 20 2a 2f 0a | 23 64 65 66 69 6e 65 09 |ons. */.|#define.|
|000021b0| 6d 76 77 61 64 64 63 68 | 28 77 69 6e 2c 79 2c 78 |mvwaddch|(win,y,x|
|000021c0| 2c 63 68 29 09 56 4f 49 | 44 28 77 6d 6f 76 65 28 |,ch).VOI|D(wmove(|
|000021d0| 77 69 6e 2c 79 2c 78 29 | 3d 3d 45 52 52 3f 45 52 |win,y,x)|==ERR?ER|
|000021e0| 52 3a 77 61 64 64 63 68 | 28 77 69 6e 2c 63 68 29 |R:waddch|(win,ch)|
|000021f0| 29 0a 23 64 65 66 69 6e | 65 09 6d 76 77 67 65 74 |).#defin|e.mvwget|
|00002200| 63 68 28 77 69 6e 2c 79 | 2c 78 29 09 56 4f 49 44 |ch(win,y|,x).VOID|
|00002210| 28 77 6d 6f 76 65 28 77 | 69 6e 2c 79 2c 78 29 3d |(wmove(w|in,y,x)=|
|00002220| 3d 45 52 52 3f 45 52 52 | 3a 77 67 65 74 63 68 28 |=ERR?ERR|:wgetch(|
|00002230| 77 69 6e 29 29 0a 23 64 | 65 66 69 6e 65 09 6d 76 |win)).#d|efine.mv|
|00002240| 77 61 64 64 73 74 72 28 | 77 69 6e 2c 79 2c 78 2c |waddstr(|win,y,x,|
|00002250| 73 74 72 29 09 56 4f 49 | 44 28 77 6d 6f 76 65 28 |str).VOI|D(wmove(|
|00002260| 77 69 6e 2c 79 2c 78 29 | 3d 3d 45 52 52 3f 45 52 |win,y,x)|==ERR?ER|
|00002270| 52 3a 77 61 64 64 73 74 | 72 28 77 69 6e 2c 73 74 |R:waddst|r(win,st|
|00002280| 72 29 29 0a 23 64 65 66 | 69 6e 65 20 6d 76 77 67 |r)).#def|ine mvwg|
|00002290| 65 74 73 74 72 28 77 69 | 6e 2c 79 2c 78 2c 73 74 |etstr(wi|n,y,x,st|
|000022a0| 72 29 20 20 56 4f 49 44 | 28 77 6d 6f 76 65 28 77 |r) VOID|(wmove(w|
|000022b0| 69 6e 2c 79 2c 78 29 3d | 3d 45 52 52 3f 45 52 52 |in,y,x)=|=ERR?ERR|
|000022c0| 3a 77 67 65 74 73 74 72 | 28 77 69 6e 2c 73 74 72 |:wgetstr|(win,str|
|000022d0| 29 29 0a 23 64 65 66 69 | 6e 65 09 6d 76 77 69 6e |)).#defi|ne.mvwin|
|000022e0| 63 68 28 77 69 6e 2c 79 | 2c 78 29 09 56 4f 49 44 |ch(win,y|,x).VOID|
|000022f0| 28 77 6d 6f 76 65 28 77 | 69 6e 2c 79 2c 78 29 20 |(wmove(w|in,y,x) |
|00002300| 3d 3d 20 45 52 52 20 3f | 20 45 52 52 20 3a 20 77 |== ERR ?| ERR : w|
|00002310| 69 6e 63 68 28 77 69 6e | 29 29 0a 23 64 65 66 69 |inch(win|)).#defi|
|00002320| 6e 65 09 6d 76 77 64 65 | 6c 63 68 28 77 69 6e 2c |ne.mvwde|lch(win,|
|00002330| 79 2c 78 29 09 56 4f 49 | 44 28 77 6d 6f 76 65 28 |y,x).VOI|D(wmove(|
|00002340| 77 69 6e 2c 79 2c 78 29 | 20 3d 3d 20 45 52 52 20 |win,y,x)| == ERR |
|00002350| 3f 20 45 52 52 20 3a 20 | 77 64 65 6c 63 68 28 77 |? ERR : |wdelch(w|
|00002360| 69 6e 29 29 0a 23 64 65 | 66 69 6e 65 09 6d 76 77 |in)).#de|fine.mvw|
|00002370| 69 6e 73 63 68 28 77 69 | 6e 2c 79 2c 78 2c 63 29 |insch(wi|n,y,x,c)|
|00002380| 09 56 4f 49 44 28 77 6d | 6f 76 65 28 77 69 6e 2c |.VOID(wm|ove(win,|
|00002390| 79 2c 78 29 20 3d 3d 20 | 45 52 52 20 3f 20 45 52 |y,x) == |ERR ? ER|
|000023a0| 52 3a 77 69 6e 73 63 68 | 28 77 69 6e 2c 63 29 29 |R:winsch|(win,c))|
|000023b0| 0a 23 64 65 66 69 6e 65 | 09 6d 76 61 64 64 63 68 |.#define|.mvaddch|
|000023c0| 28 79 2c 78 2c 63 68 29 | 09 09 6d 76 77 61 64 64 |(y,x,ch)|..mvwadd|
|000023d0| 63 68 28 73 74 64 73 63 | 72 2c 79 2c 78 2c 63 68 |ch(stdsc|r,y,x,ch|
|000023e0| 29 0a 23 64 65 66 69 6e | 65 09 6d 76 67 65 74 63 |).#defin|e.mvgetc|
|000023f0| 68 28 79 2c 78 29 09 09 | 6d 76 77 67 65 74 63 68 |h(y,x)..|mvwgetch|
|00002400| 28 73 74 64 73 63 72 2c | 79 2c 78 29 0a 23 64 65 |(stdscr,|y,x).#de|
|00002410| 66 69 6e 65 09 6d 76 61 | 64 64 73 74 72 28 79 2c |fine.mva|ddstr(y,|
|00002420| 78 2c 73 74 72 29 09 6d | 76 77 61 64 64 73 74 72 |x,str).m|vwaddstr|
|00002430| 28 73 74 64 73 63 72 2c | 79 2c 78 2c 73 74 72 29 |(stdscr,|y,x,str)|
|00002440| 0a 23 64 65 66 69 6e 65 | 20 6d 76 67 65 74 73 74 |.#define| mvgetst|
|00002450| 72 28 79 2c 78 2c 73 74 | 72 29 20 20 20 20 20 20 |r(y,x,st|r) |
|00002460| 20 6d 76 77 67 65 74 73 | 74 72 28 73 74 64 73 63 | mvwgets|tr(stdsc|
|00002470| 72 2c 79 2c 78 2c 73 74 | 72 29 0a 23 64 65 66 69 |r,y,x,st|r).#defi|
|00002480| 6e 65 09 6d 76 69 6e 63 | 68 28 79 2c 78 29 09 09 |ne.mvinc|h(y,x)..|
|00002490| 6d 76 77 69 6e 63 68 28 | 73 74 64 73 63 72 2c 79 |mvwinch(|stdscr,y|
|000024a0| 2c 78 29 0a 23 64 65 66 | 69 6e 65 09 6d 76 64 65 |,x).#def|ine.mvde|
|000024b0| 6c 63 68 28 79 2c 78 29 | 09 09 6d 76 77 64 65 6c |lch(y,x)|..mvwdel|
|000024c0| 63 68 28 73 74 64 73 63 | 72 2c 79 2c 78 29 0a 23 |ch(stdsc|r,y,x).#|
|000024d0| 64 65 66 69 6e 65 09 6d | 76 69 6e 73 63 68 28 79 |define.m|vinsch(y|
|000024e0| 2c 78 2c 63 29 09 09 6d | 76 77 69 6e 73 63 68 28 |,x,c)..m|vwinsch(|
|000024f0| 73 74 64 73 63 72 2c 79 | 2c 78 2c 63 29 0a 0a 2f |stdscr,y|,x,c)../|
|00002500| 2a 0a 20 2a 20 70 73 75 | 65 64 6f 20 66 75 6e 63 |*. * psu|edo func|
|00002510| 74 69 6f 6e 73 0a 20 2a | 2f 0a 0a 23 64 65 66 69 |tions. *|/..#defi|
|00002520| 6e 65 09 63 6c 65 61 72 | 6f 6b 28 77 69 6e 2c 62 |ne.clear|ok(win,b|
|00002530| 66 29 09 20 28 77 69 6e | 2d 3e 5f 63 6c 65 61 72 |f). (win|->_clear|
|00002540| 20 3d 20 62 66 29 0a 23 | 64 65 66 69 6e 65 09 6c | = bf).#|define.l|
|00002550| 65 61 76 65 6f 6b 28 77 | 69 6e 2c 62 66 29 09 20 |eaveok(w|in,bf). |
|00002560| 28 77 69 6e 2d 3e 5f 6c | 65 61 76 65 20 3d 20 62 |(win->_l|eave = b|
|00002570| 66 29 0a 23 64 65 66 69 | 6e 65 09 73 63 72 6f 6c |f).#defi|ne.scrol|
|00002580| 6c 6f 6b 28 77 69 6e 2c | 62 66 29 20 28 77 69 6e |lok(win,|bf) (win|
|00002590| 2d 3e 5f 73 63 72 6f 6c | 6c 20 3d 20 62 66 29 0a |->_scrol|l = bf).|
|000025a0| 23 64 65 66 69 6e 65 20 | 66 6c 75 73 68 6f 6b 28 |#define |flushok(|
|000025b0| 77 69 6e 2c 62 66 29 09 | 20 28 62 66 20 3f 20 28 |win,bf).| (bf ? (|
|000025c0| 77 69 6e 2d 3e 5f 66 6c | 61 67 73 20 7c 3d 20 5f |win->_fl|ags |= _|
|000025d0| 46 4c 55 53 48 29 3a 28 | 77 69 6e 2d 3e 5f 66 6c |FLUSH):(|win->_fl|
|000025e0| 61 67 73 20 26 3d 20 7e | 5f 46 4c 55 53 48 29 29 |ags &= ~|_FLUSH))|
|000025f0| 0a 23 64 65 66 69 6e 65 | 09 67 65 74 79 78 28 77 |.#define|.getyx(w|
|00002600| 69 6e 2c 79 2c 78 29 09 | 20 79 20 3d 20 77 69 6e |in,y,x).| y = win|
|00002610| 2d 3e 5f 63 75 72 79 2c | 20 78 20 3d 20 77 69 6e |->_cury,| x = win|
|00002620| 2d 3e 5f 63 75 72 78 0a | 23 64 65 66 69 6e 65 09 |->_curx.|#define.|
|00002630| 77 69 6e 63 68 28 77 69 | 6e 29 09 20 28 77 69 6e |winch(wi|n). (win|
|00002640| 2d 3e 5f 79 5b 77 69 6e | 2d 3e 5f 63 75 72 79 5d |->_y[win|->_cury]|
|00002650| 5b 77 69 6e 2d 3e 5f 63 | 75 72 78 5d 20 26 20 30 |[win->_c|urx] & 0|
|00002660| 31 37 37 29 0a 0a 23 64 | 65 66 69 6e 65 20 72 61 |177)..#d|efine ra|
|00002670| 77 28 29 09 20 28 5f 74 | 74 79 2e 73 67 5f 66 6c |w(). (_t|ty.sg_fl|
|00002680| 61 67 73 7c 3d 52 41 57 | 2c 20 5f 70 66 61 73 74 |ags|=RAW|, _pfast|
|00002690| 3d 5f 72 61 77 6d 6f 64 | 65 3d 54 52 55 45 2c 20 |=_rawmod|e=TRUE, |
|000026a0| 69 6f 63 74 6c 28 5f 74 | 74 79 5f 63 68 2c 54 49 |ioctl(_t|ty_ch,TI|
|000026b0| 4f 43 53 45 54 4e 2c 28 | 63 68 61 72 20 2a 29 26 |OCSETN,(|char *)&|
|000026c0| 5f 74 74 79 29 29 0a 23 | 64 65 66 69 6e 65 20 6e |_tty)).#|define n|
|000026d0| 6f 72 61 77 28 29 09 20 | 28 5f 74 74 79 2e 73 67 |oraw(). |(_tty.sg|
|000026e0| 5f 66 6c 61 67 73 26 3d | 7e 52 41 57 2c 5f 72 61 |_flags&=|~RAW,_ra|
|000026f0| 77 6d 6f 64 65 3d 46 41 | 4c 53 45 2c 5f 70 66 61 |wmode=FA|LSE,_pfa|
|00002700| 73 74 3d 21 28 5f 74 74 | 79 2e 73 67 5f 66 6c 61 |st=!(_tt|y.sg_fla|
|00002710| 67 73 26 43 52 4d 4f 44 | 29 2c 69 6f 63 74 6c 28 |gs&CRMOD|),ioctl(|
|00002720| 5f 74 74 79 5f 63 68 2c | 54 49 4f 43 53 45 54 4e |_tty_ch,|TIOCSETN|
|00002730| 2c 28 63 68 61 72 20 2a | 29 26 5f 74 74 79 29 29 |,(char *|)&_tty))|
|00002740| 0a 23 64 65 66 69 6e 65 | 20 63 72 6d 6f 64 65 28 |.#define| crmode(|
|00002750| 29 20 28 5f 74 74 79 2e | 73 67 5f 66 6c 61 67 73 |) (_tty.|sg_flags|
|00002760| 20 7c 3d 20 43 42 52 45 | 41 4b 2c 20 5f 72 61 77 | |= CBRE|AK, _raw|
|00002770| 6d 6f 64 65 20 3d 20 54 | 52 55 45 2c 20 69 6f 63 |mode = T|RUE, ioc|
|00002780| 74 6c 28 5f 74 74 79 5f | 63 68 2c 54 49 4f 43 53 |tl(_tty_|ch,TIOCS|
|00002790| 45 54 4e 2c 28 63 68 61 | 72 20 2a 29 26 5f 74 74 |ETN,(cha|r *)&_tt|
|000027a0| 79 29 29 0a 23 64 65 66 | 69 6e 65 20 6e 6f 63 72 |y)).#def|ine nocr|
|000027b0| 6d 6f 64 65 28 29 20 28 | 5f 74 74 79 2e 73 67 5f |mode() (|_tty.sg_|
|000027c0| 66 6c 61 67 73 20 26 3d | 20 7e 43 42 52 45 41 4b |flags &=| ~CBREAK|
|000027d0| 2c 5f 72 61 77 6d 6f 64 | 65 3d 46 41 4c 53 45 2c |,_rawmod|e=FALSE,|
|000027e0| 69 6f 63 74 6c 28 5f 74 | 74 79 5f 63 68 2c 54 49 |ioctl(_t|ty_ch,TI|
|000027f0| 4f 43 53 45 54 4e 2c 28 | 63 68 61 72 20 2a 29 26 |OCSETN,(|char *)&|
|00002800| 5f 74 74 79 29 29 0a 23 | 64 65 66 69 6e 65 20 65 |_tty)).#|define e|
|00002810| 63 68 6f 28 29 09 20 28 | 5f 74 74 79 2e 73 67 5f |cho(). (|_tty.sg_|
|00002820| 66 6c 61 67 73 20 7c 3d | 20 45 43 48 4f 2c 20 5f |flags |=| ECHO, _|
|00002830| 65 63 68 6f 69 74 20 3d | 20 54 52 55 45 2c 20 69 |echoit =| TRUE, i|
|00002840| 6f 63 74 6c 28 5f 74 74 | 79 5f 63 68 2c 54 49 4f |octl(_tt|y_ch,TIO|
|00002850| 43 53 45 54 4e 2c 28 63 | 68 61 72 20 2a 29 26 5f |CSETN,(c|har *)&_|
|00002860| 74 74 79 29 29 0a 23 64 | 65 66 69 6e 65 20 6e 6f |tty)).#d|efine no|
|00002870| 65 63 68 6f 28 29 20 28 | 5f 74 74 79 2e 73 67 5f |echo() (|_tty.sg_|
|00002880| 66 6c 61 67 73 20 26 3d | 20 7e 45 43 48 4f 2c 20 |flags &=| ~ECHO, |
|00002890| 5f 65 63 68 6f 69 74 20 | 3d 20 46 41 4c 53 45 2c |_echoit |= FALSE,|
|000028a0| 20 69 6f 63 74 6c 28 5f | 74 74 79 5f 63 68 2c 54 | ioctl(_|tty_ch,T|
|000028b0| 49 4f 43 53 45 54 4e 2c | 28 63 68 61 72 20 2a 29 |IOCSETN,|(char *)|
|000028c0| 26 5f 74 74 79 29 29 0a | 2f 2a 20 6e 6c 28 29 2c |&_tty)).|/* nl(),|
|000028d0| 20 6e 6f 6e 6c 28 29 20 | 66 69 78 65 64 20 62 79 | nonl() |fixed by|
|000028e0| 20 4d 69 6b 65 20 4c 69 | 6c 6c 65 79 20 61 6e 64 | Mike Li|lley and|
|000028f0| 20 4d 69 6b 65 20 4c 61 | 6d 61 6e 20 2a 2f 0a 23 | Mike La|man */.#|
|00002900| 64 65 66 69 6e 65 20 6e | 6c 28 29 09 20 28 5f 74 |define n|l(). (_t|
|00002910| 74 79 2e 73 67 5f 66 6c | 61 67 73 20 7c 3d 20 43 |ty.sg_fl|ags |= C|
|00002920| 52 4d 4f 44 2c 5f 70 66 | 61 73 74 20 3d 20 5f 74 |RMOD,_pf|ast = _t|
|00002930| 74 79 2e 73 67 5f 66 6c | 61 67 73 26 52 41 57 2c |ty.sg_fl|ags&RAW,|
|00002940| 4e 4f 4e 4c 3d 46 41 4c | 53 45 2c 69 6f 63 74 6c |NONL=FAL|SE,ioctl|
|00002950| 28 5f 74 74 79 5f 63 68 | 2c 54 49 4f 43 53 45 54 |(_tty_ch|,TIOCSET|
|00002960| 4e 2c 28 63 68 61 72 20 | 2a 29 26 5f 74 74 79 29 |N,(char |*)&_tty)|
|00002970| 29 0a 23 64 65 66 69 6e | 65 20 6e 6f 6e 6c 28 29 |).#defin|e nonl()|
|00002980| 09 20 28 5f 74 74 79 2e | 73 67 5f 66 6c 61 67 73 |. (_tty.|sg_flags|
|00002990| 20 26 3d 20 7e 43 52 4d | 4f 44 2c 20 5f 70 66 61 | &= ~CRM|OD, _pfa|
|000029a0| 73 74 20 3d 20 54 52 55 | 45 2c 4e 4f 4e 4c 3d 54 |st = TRU|E,NONL=T|
|000029b0| 52 55 45 2c 20 69 6f 63 | 74 6c 28 5f 74 74 79 5f |RUE, ioc|tl(_tty_|
|000029c0| 63 68 2c 54 49 4f 43 53 | 45 54 4e 2c 28 63 68 61 |ch,TIOCS|ETN,(cha|
|000029d0| 72 20 2a 29 26 5f 74 74 | 79 29 29 0a 23 64 65 66 |r *)&_tt|y)).#def|
|000029e0| 69 6e 65 09 73 61 76 65 | 74 74 79 28 29 20 28 28 |ine.save|tty() ((|
|000029f0| 76 6f 69 64 29 67 74 74 | 79 28 5f 74 74 79 5f 63 |void)gtt|y(_tty_c|
|00002a00| 68 2c 26 5f 74 74 79 29 | 2c 20 5f 72 65 73 5f 66 |h,&_tty)|, _res_f|
|00002a10| 6c 67 20 3d 20 5f 74 74 | 79 2e 73 67 5f 66 6c 61 |lg = _tt|y.sg_fla|
|00002a20| 67 73 29 0a 23 64 65 66 | 69 6e 65 09 72 65 73 65 |gs).#def|ine.rese|
|00002a30| 74 74 79 28 29 20 28 5f | 74 74 79 2e 73 67 5f 66 |tty() (_|tty.sg_f|
|00002a40| 6c 61 67 73 20 3d 20 5f | 72 65 73 5f 66 6c 67 2c |lags = _|res_flg,|
|00002a50| 20 69 6f 63 74 6c 28 5f | 74 74 79 5f 63 68 2c 54 | ioctl(_|tty_ch,T|
|00002a60| 49 4f 43 53 45 54 4e 2c | 28 63 68 61 72 20 2a 29 |IOCSETN,|(char *)|
|00002a70| 26 5f 74 74 79 29 29 0a | 0a 57 49 4e 44 4f 57 09 |&_tty)).|.WINDOW.|
|00002a80| 2a 69 6e 69 74 73 63 72 | 28 29 2c 20 2a 6e 65 77 |*initscr|(), *new|
|00002a90| 77 69 6e 28 29 2c 20 2a | 73 75 62 77 69 6e 28 29 |win(), *|subwin()|
|00002aa0| 3b 0a 63 68 61 72 09 2a | 6c 6f 6e 67 6e 61 6d 65 |;.char.*|longname|
|00002ab0| 28 29 2c 20 2a 67 65 74 | 63 61 70 28 29 3b 0a 0a |(), *get|cap();..|
|00002ac0| 2f 2a 0a 20 2a 20 55 73 | 65 64 20 74 6f 20 62 65 |/*. * Us|ed to be|
|00002ad0| 20 69 6e 20 75 6e 63 74 | 72 6c 2e 68 2e 0a 20 2a | in unct|rl.h.. *|
|00002ae0| 2f 0a 23 64 65 66 69 6e | 65 09 75 6e 63 74 72 6c |/.#defin|e.unctrl|
|00002af0| 28 63 29 09 5f 75 6e 63 | 74 72 6c 5b 28 63 29 20 |(c)._unc|trl[(c) |
|00002b00| 26 20 30 31 37 37 5d 0a | 65 78 74 65 72 6e 20 63 |& 0177].|extern c|
|00002b10| 68 61 72 20 2a 5f 75 6e | 63 74 72 6c 5b 5d 3b 0a |har *_un|ctrl[];.|
|00002b20| 23 20 65 6e 64 69 66 0a | 53 48 41 52 5f 45 4f 46 |# endif.|SHAR_EOF|
|00002b30| 0a 69 66 20 74 65 73 74 | 20 34 37 37 38 20 2d 6e |.if test| 4778 -n|
|00002b40| 65 20 22 60 77 63 20 2d | 63 20 3c 20 27 63 75 72 |e "`wc -|c < 'cur|
|00002b50| 73 65 73 2e 68 2e 6e 65 | 77 27 60 22 0a 74 68 65 |ses.h.ne|w'`".the|
|00002b60| 6e 0a 09 65 63 68 6f 20 | 73 68 61 72 3a 20 65 72 |n..echo |shar: er|
|00002b70| 72 6f 72 20 74 72 61 6e | 73 6d 69 74 74 69 6e 67 |ror tran|smitting|
|00002b80| 20 22 27 63 75 72 73 65 | 73 2e 68 2e 6e 65 77 27 | "'curse|s.h.new'|
|00002b90| 22 20 27 28 73 68 6f 75 | 6c 64 20 68 61 76 65 20 |" '(shou|ld have |
|00002ba0| 62 65 65 6e 20 34 37 37 | 38 20 63 68 61 72 61 63 |been 477|8 charac|
|00002bb0| 74 65 72 73 29 27 0a 66 | 69 0a 66 69 20 23 20 65 |ters)'.f|i.fi # e|
|00002bc0| 6e 64 20 6f 66 20 6f 76 | 65 72 77 72 69 74 69 6e |nd of ov|erwritin|
|00002bd0| 67 20 63 68 65 63 6b 0a | 65 63 68 6f 20 73 68 61 |g check.|echo sha|
|00002be0| 72 3a 20 65 78 74 72 61 | 63 74 69 6e 67 20 22 27 |r: extra|cting "'|
|00002bf0| 64 65 6c 65 74 65 6c 6e | 2e 63 2e 70 61 74 27 22 |deleteln|.c.pat'"|
|00002c00| 20 27 28 33 36 31 20 63 | 68 61 72 61 63 74 65 72 | '(361 c|haracter|
|00002c10| 73 29 27 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |s)'.if t|est -f '|
|00002c20| 64 65 6c 65 74 65 6c 6e | 2e 63 2e 70 61 74 27 0a |deleteln|.c.pat'.|
|00002c30| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00002c40| 20 77 69 6c 6c 20 6e 6f | 74 20 6f 76 65 72 2d 77 | will no|t over-w|
|00002c50| 72 69 74 65 20 65 78 69 | 73 74 69 6e 67 20 66 69 |rite exi|sting fi|
|00002c60| 6c 65 20 22 27 64 65 6c | 65 74 65 6c 6e 2e 63 2e |le "'del|eteln.c.|
|00002c70| 70 61 74 27 22 0a 65 6c | 73 65 0a 73 65 64 20 27 |pat'".el|se.sed '|
|00002c80| 73 2f 5e 58 2f 2f 27 20 | 3c 3c 20 5c 53 48 41 52 |s/^X//' |<< \SHAR|
|00002c90| 5f 45 4f 46 20 3e 20 27 | 64 65 6c 65 74 65 6c 6e |_EOF > '|deleteln|
|00002ca0| 2e 63 2e 70 61 74 27 0a | 2a 2a 2a 20 6c 69 62 63 |.c.pat'.|*** libc|
|00002cb0| 75 72 73 65 73 34 32 2f | 64 65 6c 65 74 65 6c 6e |urses42/|deleteln|
|00002cc0| 2e 63 09 54 68 75 20 4e | 6f 76 20 31 37 20 31 31 |.c.Thu N|ov 17 11|
|00002cd0| 3a 30 32 3a 35 36 20 31 | 39 38 33 0a 2d 2d 2d 20 |:02:56 1|983.--- |
|00002ce0| 6c 69 62 63 75 72 73 65 | 73 2f 64 65 6c 65 74 65 |libcurse|s/delete|
|00002cf0| 6c 6e 2e 63 09 53 61 74 | 20 4a 75 6c 20 20 36 20 |ln.c.Sat| Jul 6 |
|00002d00| 31 34 3a 31 34 3a 32 30 | 20 31 39 38 35 0a 2a 2a |14:14:20| 1985.**|
|00002d10| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 0a 2a 2a |********|*****.**|
|00002d20| 2a 20 32 34 2c 32 35 0a | 20 20 09 77 69 6e 2d 3e |* 24,25.| .win->|
|00002d30| 5f 79 5b 77 69 6e 2d 3e | 5f 6d 61 78 79 2d 31 5d |_y[win->|_maxy-1]|
|00002d40| 20 3d 20 74 65 6d 70 20 | 2d 20 77 69 6e 2d 3e 5f | = temp |- win->_|
|00002d50| 6d 61 78 78 3b 0a 20 20 | 7d 0a 0a 2d 2d 2d 20 32 |maxx;. |}..--- 2|
|00002d60| 34 2c 32 37 20 2d 2d 2d | 2d 2d 0a 20 20 09 77 69 |4,27 ---|--. .wi|
|00002d70| 6e 2d 3e 5f 79 5b 77 69 | 6e 2d 3e 5f 6d 61 78 79 |n->_y[wi|n->_maxy|
|00002d80| 2d 31 5d 20 3d 20 74 65 | 6d 70 20 2d 20 77 69 6e |-1] = te|mp - win|
|00002d90| 2d 3e 5f 6d 61 78 78 3b | 0a 2b 20 09 77 69 6e 2d |->_maxx;|.+ .win-|
|00002da0| 3e 5f 66 69 72 73 74 63 | 68 5b 77 69 6e 2d 3e 5f |>_firstc|h[win->_|
|00002db0| 6d 61 78 79 2d 31 5d 20 | 3d 20 30 3b 09 2f 2a 20 |maxy-1] |= 0;./* |
|00002dc0| 4d 69 6b 65 20 4c 61 6d | 61 6e 20 28 3f 29 20 2a |Mike Lam|an (?) *|
|00002dd0| 2f 0a 2b 20 09 77 69 6e | 2d 3e 5f 6c 61 73 74 63 |/.+ .win|->_lastc|
|00002de0| 68 5b 77 69 6e 2d 3e 5f | 6d 61 78 79 2d 31 5d 20 |h[win->_|maxy-1] |
|00002df0| 3d 20 77 69 6e 2d 3e 5f | 6d 61 78 78 20 2d 31 3b |= win->_|maxx -1;|
|00002e00| 09 2f 2a 20 64 69 74 74 | 6f 20 2a 2f 0a 20 20 7d |./* ditt|o */. }|
|00002e10| 0a 53 48 41 52 5f 45 4f | 46 0a 69 66 20 74 65 73 |.SHAR_EO|F.if tes|
|00002e20| 74 20 33 36 31 20 2d 6e | 65 20 22 60 77 63 20 2d |t 361 -n|e "`wc -|
|00002e30| 63 20 3c 20 27 64 65 6c | 65 74 65 6c 6e 2e 63 2e |c < 'del|eteln.c.|
|00002e40| 70 61 74 27 60 22 0a 74 | 68 65 6e 0a 09 65 63 68 |pat'`".t|hen..ech|
|00002e50| 6f 20 73 68 61 72 3a 20 | 65 72 72 6f 72 20 74 72 |o shar: |error tr|
|00002e60| 61 6e 73 6d 69 74 74 69 | 6e 67 20 22 27 64 65 6c |ansmitti|ng "'del|
|00002e70| 65 74 65 6c 6e 2e 63 2e | 70 61 74 27 22 20 27 28 |eteln.c.|pat'" '(|
|00002e80| 73 68 6f 75 6c 64 20 68 | 61 76 65 20 62 65 65 6e |should h|ave been|
|00002e90| 20 33 36 31 20 63 68 61 | 72 61 63 74 65 72 73 29 | 361 cha|racters)|
|00002ea0| 27 0a 66 69 0a 66 69 20 | 23 20 65 6e 64 20 6f 66 |'.fi.fi |# end of|
|00002eb0| 20 6f 76 65 72 77 72 69 | 74 69 6e 67 20 63 68 65 | overwri|ting che|
|00002ec0| 63 6b 0a 65 63 68 6f 20 | 73 68 61 72 3a 20 65 78 |ck.echo |shar: ex|
|00002ed0| 74 72 61 63 74 69 6e 67 | 20 22 27 69 6e 69 74 73 |tracting| "'inits|
|00002ee0| 63 72 2e 63 2e 70 61 74 | 27 22 20 27 28 34 38 35 |cr.c.pat|'" '(485|
|00002ef0| 20 63 68 61 72 61 63 74 | 65 72 73 29 27 0a 69 66 | charact|ers)'.if|
|00002f00| 20 74 65 73 74 20 2d 66 | 20 27 69 6e 69 74 73 63 | test -f| 'initsc|
|00002f10| 72 2e 63 2e 70 61 74 27 | 0a 74 68 65 6e 0a 09 65 |r.c.pat'|.then..e|
|00002f20| 63 68 6f 20 73 68 61 72 | 3a 20 77 69 6c 6c 20 6e |cho shar|: will n|
|00002f30| 6f 74 20 6f 76 65 72 2d | 77 72 69 74 65 20 65 78 |ot over-|write ex|
|00002f40| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 22 27 69 6e |isting f|ile "'in|
|00002f50| 69 74 73 63 72 2e 63 2e | 70 61 74 27 22 0a 65 6c |itscr.c.|pat'".el|
|00002f60| 73 65 0a 73 65 64 20 27 | 73 2f 5e 58 2f 2f 27 20 |se.sed '|s/^X//' |
|00002f70| 3c 3c 20 5c 53 48 41 52 | 5f 45 4f 46 20 3e 20 27 |<< \SHAR|_EOF > '|
|00002f80| 69 6e 69 74 73 63 72 2e | 63 2e 70 61 74 27 0a 2a |initscr.|c.pat'.*|
|00002f90| 2a 2a 20 6c 69 62 63 75 | 72 73 65 73 34 32 2f 69 |** libcu|rses42/i|
|00002fa0| 6e 69 74 73 63 72 2e 63 | 09 54 68 75 20 4e 6f 76 |nitscr.c|.Thu Nov|
|00002fb0| 20 31 37 20 31 31 3a 30 | 33 3a 30 30 20 31 39 38 | 17 11:0|3:00 198|
|00002fc0| 33 0a 2d 2d 2d 20 6c 69 | 62 63 75 72 73 65 73 2f |3.--- li|bcurses/|
|00002fd0| 69 6e 69 74 73 63 72 2e | 63 09 53 75 6e 20 4a 75 |initscr.|c.Sun Ju|
|00002fe0| 6c 20 32 31 20 31 37 3a | 35 39 3a 30 32 20 31 39 |l 21 17:|59:02 19|
|00002ff0| 38 35 0a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |85.*****|********|
|00003000| 2a 2a 0a 2a 2a 2a 20 31 | 35 2c 31 36 0a 20 20 09 |**.*** 1|5,16. .|
|00003010| 72 65 67 20 63 68 61 72 | 09 2a 73 70 3b 0a 20 20 |reg char|.*sp;. |
|00003020| 09 69 6e 74 09 09 74 73 | 74 70 28 29 3b 0a 0a 2d |.int..ts|tp();..-|
|00003030| 2d 2d 20 31 35 2c 31 37 | 20 2d 2d 2d 2d 2d 0a 20 |-- 15,17| -----. |
|00003040| 20 09 72 65 67 20 63 68 | 61 72 09 2a 73 70 3b 0a | .reg ch|ar.*sp;.|
|00003050| 2b 20 09 69 6e 74 09 09 | 28 2a 6f 6c 64 74 73 74 |+ .int..|(*oldtst|
|00003060| 70 29 28 29 3b 09 2f 2a | 20 52 6f 6e 20 57 65 73 |p)();./*| Ron Wes|
|00003070| 73 65 6c 73 2c 20 75 74 | 68 75 62 2e 31 34 39 2c |sels, ut|hub.149,|
|00003080| 20 4d 61 79 20 31 39 38 | 34 20 2a 2f 0a 20 20 09 | May 198|4 */. .|
|00003090| 69 6e 74 09 09 74 73 74 | 70 28 29 3b 0a 2a 2a 2a |int..tst|p();.***|
|000030a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 0a 2a 2a 2a |********|****.***|
|000030b0| 20 34 31 2c 34 33 0a 20 | 20 23 20 69 66 64 65 66 | 41,43. | # ifdef|
|000030c0| 20 53 49 47 54 53 54 50 | 0a 21 20 09 73 69 67 6e | SIGTSTP|.! .sign|
|000030d0| 61 6c 28 53 49 47 54 53 | 54 50 2c 20 74 73 74 70 |al(SIGTS|TP, tstp|
|000030e0| 29 3b 0a 20 20 23 20 65 | 6e 64 69 66 0a 0a 2d 2d |);. # e|ndif..--|
|000030f0| 2d 20 34 32 2c 34 35 20 | 2d 2d 2d 2d 2d 0a 20 20 |- 42,45 |-----. |
|00003100| 23 20 69 66 64 65 66 20 | 53 49 47 54 53 54 50 0a |# ifdef |SIGTSTP.|
|00003110| 21 20 09 69 66 20 28 28 | 6f 6c 64 74 73 74 70 20 |! .if ((|oldtstp |
|00003120| 3d 20 73 69 67 6e 61 6c | 28 53 49 47 54 53 54 50 |= signal|(SIGTSTP|
|00003130| 2c 20 74 73 74 70 29 29 | 20 21 3d 20 53 49 47 5f |, tstp))| != SIG_|
|00003140| 44 46 4c 29 0a 21 20 09 | 09 28 76 6f 69 64 29 20 |DFL).! .|.(void) |
|00003150| 73 69 67 6e 61 6c 28 53 | 49 47 54 53 54 50 2c 20 |signal(S|IGTSTP, |
|00003160| 6f 6c 64 74 73 74 70 29 | 3b 0a 20 20 23 20 65 6e |oldtstp)|;. # en|
|00003170| 64 69 66 0a 53 48 41 52 | 5f 45 4f 46 0a 69 66 20 |dif.SHAR|_EOF.if |
|00003180| 74 65 73 74 20 34 38 35 | 20 2d 6e 65 20 22 60 77 |test 485| -ne "`w|
|00003190| 63 20 2d 63 20 3c 20 27 | 69 6e 69 74 73 63 72 2e |c -c < '|initscr.|
|000031a0| 63 2e 70 61 74 27 60 22 | 0a 74 68 65 6e 0a 09 65 |c.pat'`"|.then..e|
|000031b0| 63 68 6f 20 73 68 61 72 | 3a 20 65 72 72 6f 72 20 |cho shar|: error |
|000031c0| 74 72 61 6e 73 6d 69 74 | 74 69 6e 67 20 22 27 69 |transmit|ting "'i|
|000031d0| 6e 69 74 73 63 72 2e 63 | 2e 70 61 74 27 22 20 27 |nitscr.c|.pat'" '|
|000031e0| 28 73 68 6f 75 6c 64 20 | 68 61 76 65 20 62 65 65 |(should |have bee|
|000031f0| 6e 20 34 38 35 20 63 68 | 61 72 61 63 74 65 72 73 |n 485 ch|aracters|
|00003200| 29 27 0a 66 69 0a 66 69 | 20 23 20 65 6e 64 20 6f |)'.fi.fi| # end o|
|00003210| 66 20 6f 76 65 72 77 72 | 69 74 69 6e 67 20 63 68 |f overwr|iting ch|
|00003220| 65 63 6b 0a 65 63 68 6f | 20 73 68 61 72 3a 20 65 |eck.echo| shar: e|
|00003230| 78 74 72 61 63 74 69 6e | 67 20 22 27 69 6e 73 65 |xtractin|g "'inse|
|00003240| 72 74 6c 6e 2e 63 2e 70 | 61 74 27 22 20 27 28 32 |rtln.c.p|at'" '(2|
|00003250| 34 32 20 63 68 61 72 61 | 63 74 65 72 73 29 27 0a |42 chara|cters)'.|
|00003260| 69 66 20 74 65 73 74 20 | 2d 66 20 27 69 6e 73 65 |if test |-f 'inse|
|00003270| 72 74 6c 6e 2e 63 2e 70 | 61 74 27 0a 74 68 65 6e |rtln.c.p|at'.then|
|00003280| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 77 69 6c |..echo s|har: wil|
|00003290| 6c 20 6e 6f 74 20 6f 76 | 65 72 2d 77 72 69 74 65 |l not ov|er-write|
|000032a0| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 22 | existin|g file "|
|000032b0| 27 69 6e 73 65 72 74 6c | 6e 2e 63 2e 70 61 74 27 |'insertl|n.c.pat'|
|000032c0| 22 0a 65 6c 73 65 0a 73 | 65 64 20 27 73 2f 5e 58 |".else.s|ed 's/^X|
|000032d0| 2f 2f 27 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |//' << \|SHAR_EOF|
|000032e0| 20 3e 20 27 69 6e 73 65 | 72 74 6c 6e 2e 63 2e 70 | > 'inse|rtln.c.p|
|000032f0| 61 74 27 0a 2a 2a 2a 20 | 6c 69 62 63 75 72 73 65 |at'.*** |libcurse|
|00003300| 73 34 32 2f 69 6e 73 65 | 72 74 6c 6e 2e 63 09 54 |s42/inse|rtln.c.T|
|00003310| 68 75 20 4e 6f 76 20 31 | 37 20 31 31 3a 30 33 3a |hu Nov 1|7 11:03:|
|00003320| 30 31 20 31 39 38 33 0a | 2d 2d 2d 20 6c 69 62 63 |01 1983.|--- libc|
|00003330| 75 72 73 65 73 2f 69 6e | 73 65 72 74 6c 6e 2e 63 |urses/in|sertln.c|
|00003340| 09 53 61 74 20 4a 75 6c | 20 20 36 20 31 34 3a 31 |.Sat Jul| 6 14:1|
|00003350| 32 3a 35 34 20 31 39 38 | 35 0a 2a 2a 2a 2a 2a 2a |2:54 198|5.******|
|00003360| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0a 2a 2a 2a 20 33 34 |********|*.*** 34|
|00003370| 2c 33 35 0a 20 20 09 09 | 09 72 65 74 75 72 6e 20 |,35. ..|.return |
|00003380| 45 52 52 3b 0a 20 20 09 | 72 65 74 75 72 6e 20 4f |ERR;. .|return O|
|00003390| 4b 3b 0a 0a 2d 2d 2d 20 | 33 34 2c 33 36 20 2d 2d |K;..--- |34,36 --|
|000033a0| 2d 2d 2d 0a 20 20 09 09 | 09 72 65 74 75 72 6e 20 |---. ..|.return |
|000033b0| 45 52 52 3b 0a 2b 20 09 | 74 6f 75 63 68 77 69 6e |ERR;.+ .|touchwin|
|000033c0| 28 77 69 6e 29 3b 09 2f | 2a 20 4d 69 6b 65 20 4c |(win);./|* Mike L|
|000033d0| 61 6d 61 6e 20 2a 2f 0a | 20 20 09 72 65 74 75 72 |aman */.| .retur|
|000033e0| 6e 20 4f 4b 3b 0a 53 48 | 41 52 5f 45 4f 46 0a 69 |n OK;.SH|AR_EOF.i|
|000033f0| 66 20 74 65 73 74 20 32 | 34 32 20 2d 6e 65 20 22 |f test 2|42 -ne "|
|00003400| 60 77 63 20 2d 63 20 3c | 20 27 69 6e 73 65 72 74 |`wc -c <| 'insert|
|00003410| 6c 6e 2e 63 2e 70 61 74 | 27 60 22 0a 74 68 65 6e |ln.c.pat|'`".then|
|00003420| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 65 72 72 |..echo s|har: err|
|00003430| 6f 72 20 74 72 61 6e 73 | 6d 69 74 74 69 6e 67 20 |or trans|mitting |
|00003440| 22 27 69 6e 73 65 72 74 | 6c 6e 2e 63 2e 70 61 74 |"'insert|ln.c.pat|
|00003450| 27 22 20 27 28 73 68 6f | 75 6c 64 20 68 61 76 65 |'" '(sho|uld have|
|00003460| 20 62 65 65 6e 20 32 34 | 32 20 63 68 61 72 61 63 | been 24|2 charac|
|00003470| 74 65 72 73 29 27 0a 66 | 69 0a 66 69 20 23 20 65 |ters)'.f|i.fi # e|
|00003480| 6e 64 20 6f 66 20 6f 76 | 65 72 77 72 69 74 69 6e |nd of ov|erwritin|
|00003490| 67 20 63 68 65 63 6b 0a | 65 63 68 6f 20 73 68 61 |g check.|echo sha|
|000034a0| 72 3a 20 65 78 74 72 61 | 63 74 69 6e 67 20 22 27 |r: extra|cting "'|
|000034b0| 6c 6f 6e 67 6e 61 6d 65 | 2e 63 2e 6e 65 77 27 22 |longname|.c.new'"|
|000034c0| 20 27 28 38 35 35 20 63 | 68 61 72 61 63 74 65 72 | '(855 c|haracter|
|000034d0| 73 29 27 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |s)'.if t|est -f '|
|000034e0| 6c 6f 6e 67 6e 61 6d 65 | 2e 63 2e 6e 65 77 27 0a |longname|.c.new'.|
|000034f0| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00003500| 20 77 69 6c 6c 20 6e 6f | 74 20 6f 76 65 72 2d 77 | will no|t over-w|
|00003510| 72 69 74 65 20 65 78 69 | 73 74 69 6e 67 20 66 69 |rite exi|sting fi|
|00003520| 6c 65 20 22 27 6c 6f 6e | 67 6e 61 6d 65 2e 63 2e |le "'lon|gname.c.|
|00003530| 6e 65 77 27 22 0a 65 6c | 73 65 0a 73 65 64 20 27 |new'".el|se.sed '|
|00003540| 73 2f 5e 58 2f 2f 27 20 | 3c 3c 20 5c 53 48 41 52 |s/^X//' |<< \SHAR|
|00003550| 5f 45 4f 46 20 3e 20 27 | 6c 6f 6e 67 6e 61 6d 65 |_EOF > '|longname|
|00003560| 2e 63 2e 6e 65 77 27 0a | 23 20 64 65 66 69 6e 65 |.c.new'.|# define|
|00003570| 09 72 65 67 09 72 65 67 | 69 73 74 65 72 0a 0a 2f |.reg.reg|ister../|
|00003580| 2a 0a 20 2a 09 54 68 69 | 73 20 72 6f 75 74 69 6e |*. *.Thi|s routin|
|00003590| 65 20 66 69 6c 6c 73 20 | 69 6e 20 22 64 65 66 22 |e fills |in "def"|
|000035a0| 20 77 69 74 68 20 74 68 | 65 20 6c 6f 6e 67 20 6e | with th|e long n|
|000035b0| 61 6d 65 20 6f 66 20 74 | 68 65 20 74 65 72 6d 69 |ame of t|he termi|
|000035c0| 6e 61 6c 2e 0a 20 2a 0a | 20 2a 20 31 2f 32 36 2f |nal.. *.| * 1/26/|
|000035d0| 38 31 20 28 42 65 72 6b | 65 6c 65 79 29 20 40 28 |81 (Berk|eley) @(|
|000035e0| 23 29 6c 6f 6e 67 6e 61 | 6d 65 2e 63 09 31 2e 31 |#)longna|me.c.1.1|
|000035f0| 0a 20 2a 0a 20 2a 20 32 | 2f 32 32 2f 38 34 20 43 |. *. * 2|/22/84 C|
|00003600| 6f 72 72 65 63 74 69 6f | 6e 73 20 6d 61 64 65 20 |orrectio|ns made |
|00003610| 61 74 20 55 6e 69 76 65 | 72 73 69 74 79 20 6f 66 |at Unive|rsity of|
|00003620| 20 43 61 6c 69 66 6f 72 | 6e 69 61 2c 20 53 61 6e | Califor|nia, San|
|00003630| 20 46 72 61 6e 63 69 73 | 63 6f 2e 0a 20 2a 20 54 | Francis|co.. * T|
|00003640| 68 69 73 20 63 6f 72 72 | 65 63 74 69 6f 6e 20 6d |his corr|ection m|
|00003650| 61 6b 65 73 20 61 20 70 | 72 69 76 61 74 65 20 63 |akes a p|rivate c|
|00003660| 6f 70 79 20 6f 66 20 74 | 68 65 20 6c 6f 6e 67 6e |opy of t|he longn|
|00003670| 61 6d 65 2e 20 54 68 65 | 20 6f 72 69 67 69 6e 61 |ame. The| origina|
|00003680| 6c 20 76 65 72 73 69 6f | 6e 0a 20 2a 20 73 69 6d |l versio|n. * sim|
|00003690| 70 6c 79 20 70 61 74 63 | 68 65 64 20 61 20 27 5c |ply patc|hed a '\|
|000036a0| 30 27 20 69 6e 20 74 68 | 65 20 74 65 72 6d 63 61 |0' in th|e termca|
|000036b0| 70 20 62 75 66 66 65 72 | 2c 20 70 72 65 76 65 6e |p buffer|, preven|
|000036c0| 74 69 6e 67 20 61 63 63 | 65 73 73 20 74 6f 0a 20 |ting acc|ess to. |
|000036d0| 2a 20 74 65 72 6d 69 6e | 61 6c 20 63 61 70 61 62 |* termin|al capab|
|000036e0| 69 6c 69 74 69 65 73 20 | 61 74 20 61 20 6c 61 74 |ilities |at a lat|
|000036f0| 65 72 20 70 6f 69 6e 74 | 2e 0a 20 2a 20 72 74 69 |er point|.. * rti|
|00003700| 2d 73 65 6c 21 74 72 74 | 3a 20 6e 6f 74 65 3a 20 |-sel!trt|: note: |
|00003710| 74 68 69 73 20 63 6f 64 | 65 20 69 73 20 73 74 69 |this cod|e is sti|
|00003720| 6c 6c 20 62 72 6f 6b 65 | 6e 20 77 72 74 20 74 68 |ll broke|n wrt th|
|00003730| 65 20 64 6f 63 75 6d 65 | 6e 74 61 74 69 6f 6e 2e |e docume|ntation.|
|00003740| 0a 20 2a 20 49 74 20 6f | 70 65 72 61 74 65 73 20 |. * It o|perates |
|00003750| 63 6f 6e 66 75 73 69 6e | 67 6c 79 20 61 6e 64 20 |confusin|gly and |
|00003760| 75 73 75 61 6c 6c 79 20 | 67 65 74 73 20 74 68 65 |usually |gets the|
|00003770| 20 77 72 6f 6e 67 20 61 | 6e 73 77 65 72 2e 0a 20 | wrong a|nswer.. |
|00003780| 2a 2f 0a 0a 63 68 61 72 | 20 2a 0a 6c 6f 6e 67 6e |*/..char| *.longn|
|00003790| 61 6d 65 28 62 70 2c 20 | 64 65 66 29 0a 72 65 67 |ame(bp, |def).reg|
|000037a0| 20 63 68 61 72 09 2a 62 | 70 2c 20 2a 64 65 66 3b | char.*b|p, *def;|
|000037b0| 20 7b 0a 0a 09 72 65 67 | 20 63 68 61 72 09 2a 63 | {...reg| char.*c|
|000037c0| 70 3b 0a 09 73 74 61 74 | 69 63 20 63 68 61 72 20 |p;..stat|ic char |
|000037d0| 6c 6f 6e 67 63 6f 70 79 | 5b 33 30 5d 20 3b 0a 0a |longcopy|[30] ;..|
|000037e0| 09 77 68 69 6c 65 20 28 | 2a 62 70 20 26 26 20 2a |.while (|*bp && *|
|000037f0| 62 70 20 21 3d 20 27 3a | 27 20 26 26 20 2a 62 70 |bp != ':|' && *bp|
|00003800| 20 21 3d 20 27 7c 27 29 | 0a 09 09 62 70 2b 2b 3b | != '|')|...bp++;|
|00003810| 0a 09 69 66 20 28 2a 62 | 70 20 3d 3d 20 27 7c 27 |..if (*b|p == '|'|
|00003820| 29 20 7b 0a 09 09 62 70 | 2b 2b 3b 0a 09 09 63 70 |) {...bp|++;...cp|
|00003830| 20 3d 20 6c 6f 6e 67 63 | 6f 70 79 20 3b 0a 09 09 | = longc|opy ;...|
|00003840| 77 68 69 6c 65 20 28 28 | 63 70 2d 6c 6f 6e 67 63 |while ((|cp-longc|
|00003850| 6f 70 79 29 3c 32 39 20 | 26 26 20 2a 62 70 20 26 |opy)<29 |&& *bp &|
|00003860| 26 20 2a 62 70 20 21 3d | 20 27 3a 27 20 26 26 20 |& *bp !=| ':' && |
|00003870| 2a 62 70 20 21 3d 20 27 | 7c 27 29 0a 09 09 09 2a |*bp != '||')....*|
|00003880| 63 70 2b 2b 20 3d 20 2a | 62 70 2b 2b 20 3b 0a 09 |cp++ = *|bp++ ;..|
|00003890| 09 2a 63 70 20 3d 20 30 | 3b 0a 09 09 72 65 74 75 |.*cp = 0|;...retu|
|000038a0| 72 6e 20 6c 6f 6e 67 63 | 6f 70 79 3b 0a 09 7d 0a |rn longc|opy;..}.|
|000038b0| 09 72 65 74 75 72 6e 20 | 64 65 66 3b 0a 7d 0a 53 |.return |def;.}.S|
|000038c0| 48 41 52 5f 45 4f 46 0a | 69 66 20 74 65 73 74 20 |HAR_EOF.|if test |
|000038d0| 38 35 35 20 2d 6e 65 20 | 22 60 77 63 20 2d 63 20 |855 -ne |"`wc -c |
|000038e0| 3c 20 27 6c 6f 6e 67 6e | 61 6d 65 2e 63 2e 6e 65 |< 'longn|ame.c.ne|
|000038f0| 77 27 60 22 0a 74 68 65 | 6e 0a 09 65 63 68 6f 20 |w'`".the|n..echo |
|00003900| 73 68 61 72 3a 20 65 72 | 72 6f 72 20 74 72 61 6e |shar: er|ror tran|
|00003910| 73 6d 69 74 74 69 6e 67 | 20 22 27 6c 6f 6e 67 6e |smitting| "'longn|
|00003920| 61 6d 65 2e 63 2e 6e 65 | 77 27 22 20 27 28 73 68 |ame.c.ne|w'" '(sh|
|00003930| 6f 75 6c 64 20 68 61 76 | 65 20 62 65 65 6e 20 38 |ould hav|e been 8|
|00003940| 35 35 20 63 68 61 72 61 | 63 74 65 72 73 29 27 0a |55 chara|cters)'.|
|00003950| 66 69 0a 66 69 20 23 20 | 65 6e 64 20 6f 66 20 6f |fi.fi # |end of o|
|00003960| 76 65 72 77 72 69 74 69 | 6e 67 20 63 68 65 63 6b |verwriti|ng check|
|00003970| 0a 65 63 68 6f 20 73 68 | 61 72 3a 20 65 78 74 72 |.echo sh|ar: extr|
|00003980| 61 63 74 69 6e 67 20 22 | 27 6d 6f 76 65 2e 63 2e |acting "|'move.c.|
|00003990| 70 61 74 27 22 20 27 28 | 33 31 32 20 63 68 61 72 |pat'" '(|312 char|
|000039a0| 61 63 74 65 72 73 29 27 | 0a 69 66 20 74 65 73 74 |acters)'|.if test|
|000039b0| 20 2d 66 20 27 6d 6f 76 | 65 2e 63 2e 70 61 74 27 | -f 'mov|e.c.pat'|
|000039c0| 0a 74 68 65 6e 0a 09 65 | 63 68 6f 20 73 68 61 72 |.then..e|cho shar|
|000039d0| 3a 20 77 69 6c 6c 20 6e | 6f 74 20 6f 76 65 72 2d |: will n|ot over-|
|000039e0| 77 72 69 74 65 20 65 78 | 69 73 74 69 6e 67 20 66 |write ex|isting f|
|000039f0| 69 6c 65 20 22 27 6d 6f | 76 65 2e 63 2e 70 61 74 |ile "'mo|ve.c.pat|
|00003a00| 27 22 0a 65 6c 73 65 0a | 73 65 64 20 27 73 2f 5e |'".else.|sed 's/^|
|00003a10| 58 2f 2f 27 20 3c 3c 20 | 5c 53 48 41 52 5f 45 4f |X//' << |\SHAR_EO|
|00003a20| 46 20 3e 20 27 6d 6f 76 | 65 2e 63 2e 70 61 74 27 |F > 'mov|e.c.pat'|
|00003a30| 0a 2a 2a 2a 20 6c 69 62 | 63 75 72 73 65 73 34 32 |.*** lib|curses42|
|00003a40| 2f 6d 6f 76 65 2e 63 09 | 54 68 75 20 4e 6f 76 20 |/move.c.|Thu Nov |
|00003a50| 31 37 20 31 31 3a 30 33 | 3a 31 34 20 31 39 38 33 |17 11:03|:14 1983|
|00003a60| 0a 2d 2d 2d 20 6c 69 62 | 63 75 72 73 65 73 2f 6d |.--- lib|curses/m|
|00003a70| 6f 76 65 2e 63 09 57 65 | 64 20 4a 75 6c 20 32 34 |ove.c.We|d Jul 24|
|00003a80| 20 31 33 3a 32 35 3a 34 | 37 20 31 39 38 35 0a 2a | 13:25:4|7 1985.*|
|00003a90| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 0a 2a |********|******.*|
|00003aa0| 2a 2a 20 31 34 2c 31 35 | 0a 20 20 23 20 65 6e 64 |** 14,15|. # end|
|00003ab0| 69 66 0a 20 20 09 69 66 | 20 28 78 20 3e 3d 20 77 |if. .if| (x >= w|
|00003ac0| 69 6e 2d 3e 5f 6d 61 78 | 78 20 7c 7c 20 79 20 3e |in->_max|x || y >|
|00003ad0| 3d 20 77 69 6e 2d 3e 5f | 6d 61 78 79 29 0a 0a 2d |= win->_|maxy)..-|
|00003ae0| 2d 2d 20 31 34 2c 31 39 | 20 2d 2d 2d 2d 2d 0a 20 |-- 14,19| -----. |
|00003af0| 20 23 20 65 6e 64 69 66 | 0a 2b 20 23 69 66 6e 64 | # endif|.+ #ifnd|
|00003b00| 65 66 20 77 61 6e 74 61 | 6d 65 73 73 0a 2b 20 09 |ef wanta|mess.+ .|
|00003b10| 69 66 20 28 78 20 3c 20 | 30 20 7c 7c 20 79 20 3c |if (x < |0 || y <|
|00003b20| 20 30 29 0a 2b 20 09 09 | 72 65 74 75 72 6e 28 45 | 0).+ ..|return(E|
|00003b30| 52 52 29 3b 0a 2b 20 23 | 65 6e 64 69 66 0a 20 20 |RR);.+ #|endif. |
|00003b40| 09 69 66 20 28 78 20 3e | 3d 20 77 69 6e 2d 3e 5f |.if (x >|= win->_|
|00003b50| 6d 61 78 78 20 7c 7c 20 | 79 20 3e 3d 20 77 69 6e |maxx || |y >= win|
|00003b60| 2d 3e 5f 6d 61 78 79 29 | 0a 53 48 41 52 5f 45 4f |->_maxy)|.SHAR_EO|
|00003b70| 46 0a 69 66 20 74 65 73 | 74 20 33 31 32 20 2d 6e |F.if tes|t 312 -n|
|00003b80| 65 20 22 60 77 63 20 2d | 63 20 3c 20 27 6d 6f 76 |e "`wc -|c < 'mov|
|00003b90| 65 2e 63 2e 70 61 74 27 | 60 22 0a 74 68 65 6e 0a |e.c.pat'|`".then.|
|00003ba0| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 65 72 72 6f |.echo sh|ar: erro|
|00003bb0| 72 20 74 72 61 6e 73 6d | 69 74 74 69 6e 67 20 22 |r transm|itting "|
|00003bc0| 27 6d 6f 76 65 2e 63 2e | 70 61 74 27 22 20 27 28 |'move.c.|pat'" '(|
|00003bd0| 73 68 6f 75 6c 64 20 68 | 61 76 65 20 62 65 65 6e |should h|ave been|
|00003be0| 20 33 31 32 20 63 68 61 | 72 61 63 74 65 72 73 29 | 312 cha|racters)|
|00003bf0| 27 0a 66 69 0a 66 69 20 | 23 20 65 6e 64 20 6f 66 |'.fi.fi |# end of|
|00003c00| 20 6f 76 65 72 77 72 69 | 74 69 6e 67 20 63 68 65 | overwri|ting che|
|00003c10| 63 6b 0a 65 63 68 6f 20 | 73 68 61 72 3a 20 65 78 |ck.echo |shar: ex|
|00003c20| 74 72 61 63 74 69 6e 67 | 20 22 27 6d 76 77 69 6e |tracting| "'mvwin|
|00003c30| 2e 63 2e 70 61 74 27 22 | 20 27 28 33 30 39 20 63 |.c.pat'"| '(309 c|
|00003c40| 68 61 72 61 63 74 65 72 | 73 29 27 0a 69 66 20 74 |haracter|s)'.if t|
|00003c50| 65 73 74 20 2d 66 20 27 | 6d 76 77 69 6e 2e 63 2e |est -f '|mvwin.c.|
|00003c60| 70 61 74 27 0a 74 68 65 | 6e 0a 09 65 63 68 6f 20 |pat'.the|n..echo |
|00003c70| 73 68 61 72 3a 20 77 69 | 6c 6c 20 6e 6f 74 20 6f |shar: wi|ll not o|
|00003c80| 76 65 72 2d 77 72 69 74 | 65 20 65 78 69 73 74 69 |ver-writ|e existi|
|00003c90| 6e 67 20 66 69 6c 65 20 | 22 27 6d 76 77 69 6e 2e |ng file |"'mvwin.|
|00003ca0| 63 2e 70 61 74 27 22 0a | 65 6c 73 65 0a 73 65 64 |c.pat'".|else.sed|
|00003cb0| 20 27 73 2f 5e 58 2f 2f | 27 20 3c 3c 20 5c 53 48 | 's/^X//|' << \SH|
|00003cc0| 41 52 5f 45 4f 46 20 3e | 20 27 6d 76 77 69 6e 2e |AR_EOF >| 'mvwin.|
|00003cd0| 63 2e 70 61 74 27 0a 2a | 2a 2a 20 6c 69 62 63 75 |c.pat'.*|** libcu|
|00003ce0| 72 73 65 73 34 32 2f 6d | 76 77 69 6e 2e 63 09 54 |rses42/m|vwin.c.T|
|00003cf0| 68 75 20 4e 6f 76 20 31 | 37 20 31 31 3a 30 33 3a |hu Nov 1|7 11:03:|
|00003d00| 30 33 20 31 39 38 33 0a | 2d 2d 2d 20 6c 69 62 63 |03 1983.|--- libc|
|00003d10| 75 72 73 65 73 2f 6d 76 | 77 69 6e 2e 63 09 57 65 |urses/mv|win.c.We|
|00003d20| 64 20 4d 61 79 20 33 30 | 20 32 32 3a 32 33 3a 31 |d May 30| 22:23:1|
|00003d30| 32 20 31 39 38 34 0a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |2 1984.*|********|
|00003d40| 2a 2a 2a 2a 2a 2a 0a 2a | 2a 2a 20 31 32 2c 31 34 |******.*|** 12,14|
|00003d50| 0a 20 20 0a 21 20 09 69 | 66 20 28 62 79 20 2b 20 |. .! .i|f (by + |
|00003d60| 77 69 6e 2d 3e 5f 6d 61 | 78 79 20 3e 20 4c 49 4e |win->_ma|xy > LIN|
|00003d70| 45 53 20 7c 7c 20 62 78 | 20 2b 20 77 69 6e 2d 3e |ES || bx| + win->|
|00003d80| 5f 6d 61 78 78 20 3e 20 | 43 4f 4c 53 29 0a 20 20 |_maxx > |COLS). |
|00003d90| 09 09 72 65 74 75 72 6e | 20 45 52 52 3b 0a 0a 2d |..return| ERR;..-|
|00003da0| 2d 2d 20 31 32 2c 31 34 | 20 2d 2d 2d 2d 2d 0a 20 |-- 12,14| -----. |
|00003db0| 20 0a 21 20 09 69 66 20 | 28 62 79 20 2b 20 77 69 | .! .if |(by + wi|
|00003dc0| 6e 2d 3e 5f 6d 61 78 79 | 20 3e 20 4c 49 4e 45 53 |n->_maxy| > LINES|
|00003dd0| 20 7c 7c 20 62 78 20 2b | 20 77 69 6e 2d 3e 5f 6d | || bx +| win->_m|
|00003de0| 61 78 78 20 3e 20 43 4f | 4c 53 20 7c 7c 20 62 79 |axx > CO|LS || by|
|00003df0| 3c 30 20 7c 7c 20 62 78 | 3c 30 29 0a 20 20 09 09 |<0 || bx|<0). ..|
|00003e00| 72 65 74 75 72 6e 20 45 | 52 52 3b 0a 53 48 41 52 |return E|RR;.SHAR|
|00003e10| 5f 45 4f 46 0a 69 66 20 | 74 65 73 74 20 33 30 39 |_EOF.if |test 309|
|00003e20| 20 2d 6e 65 20 22 60 77 | 63 20 2d 63 20 3c 20 27 | -ne "`w|c -c < '|
|00003e30| 6d 76 77 69 6e 2e 63 2e | 70 61 74 27 60 22 0a 74 |mvwin.c.|pat'`".t|
|00003e40| 68 65 6e 0a 09 65 63 68 | 6f 20 73 68 61 72 3a 20 |hen..ech|o shar: |
|00003e50| 65 72 72 6f 72 20 74 72 | 61 6e 73 6d 69 74 74 69 |error tr|ansmitti|
|00003e60| 6e 67 20 22 27 6d 76 77 | 69 6e 2e 63 2e 70 61 74 |ng "'mvw|in.c.pat|
|00003e70| 27 22 20 27 28 73 68 6f | 75 6c 64 20 68 61 76 65 |'" '(sho|uld have|
|00003e80| 20 62 65 65 6e 20 33 30 | 39 20 63 68 61 72 61 63 | been 30|9 charac|
|00003e90| 74 65 72 73 29 27 0a 66 | 69 0a 66 69 20 23 20 65 |ters)'.f|i.fi # e|
|00003ea0| 6e 64 20 6f 66 20 6f 76 | 65 72 77 72 69 74 69 6e |nd of ov|erwritin|
|00003eb0| 67 20 63 68 65 63 6b 0a | 65 63 68 6f 20 73 68 61 |g check.|echo sha|
|00003ec0| 72 3a 20 65 78 74 72 61 | 63 74 69 6e 67 20 22 27 |r: extra|cting "'|
|00003ed0| 6e 65 77 77 69 6e 2e 63 | 2e 70 61 74 27 22 20 27 |newwin.c|.pat'" '|
|00003ee0| 28 33 33 36 20 63 68 61 | 72 61 63 74 65 72 73 29 |(336 cha|racters)|
|00003ef0| 27 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 6e 65 |'.if tes|t -f 'ne|
|00003f00| 77 77 69 6e 2e 63 2e 70 | 61 74 27 0a 74 68 65 6e |wwin.c.p|at'.then|
|00003f10| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 77 69 6c |..echo s|har: wil|
|00003f20| 6c 20 6e 6f 74 20 6f 76 | 65 72 2d 77 72 69 74 65 |l not ov|er-write|
|00003f30| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 22 | existin|g file "|
|00003f40| 27 6e 65 77 77 69 6e 2e | 63 2e 70 61 74 27 22 0a |'newwin.|c.pat'".|
|00003f50| 65 6c 73 65 0a 73 65 64 | 20 27 73 2f 5e 58 2f 2f |else.sed| 's/^X//|
|00003f60| 27 20 3c 3c 20 5c 53 48 | 41 52 5f 45 4f 46 20 3e |' << \SH|AR_EOF >|
|00003f70| 20 27 6e 65 77 77 69 6e | 2e 63 2e 70 61 74 27 0a | 'newwin|.c.pat'.|
|00003f80| 2a 2a 2a 20 6c 69 62 63 | 75 72 73 65 73 34 32 2f |*** libc|urses42/|
|00003f90| 6e 65 77 77 69 6e 2e 63 | 09 54 68 75 20 4e 6f 76 |newwin.c|.Thu Nov|
|00003fa0| 20 31 37 20 31 31 3a 30 | 33 3a 30 32 20 31 39 38 | 17 11:0|3:02 198|
|00003fb0| 33 0a 2d 2d 2d 20 6c 69 | 62 63 75 72 73 65 73 2f |3.--- li|bcurses/|
|00003fc0| 6e 65 77 77 69 6e 2e 63 | 09 57 65 64 20 4a 75 6c |newwin.c|.Wed Jul|
|00003fd0| 20 32 34 20 31 33 3a 32 | 37 3a 32 33 20 31 39 38 | 24 13:2|7:23 198|
|00003fe0| 35 0a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |5.******|********|
|00003ff0| 2a 0a 2a 2a 2a 20 31 31 | 37 2c 31 31 38 0a 20 20 |*.*** 11|7,118. |
|00004000| 0a 20 20 23 20 69 66 64 | 65 66 09 44 45 42 55 47 |. # ifd|ef.DEBUG|
|00004010| 0a 0a 2d 2d 2d 20 31 31 | 37 2c 31 32 35 20 2d 2d |..--- 11|7,125 --|
|00004020| 2d 2d 2d 0a 20 20 0a 2b | 20 23 69 66 6e 64 65 66 |---. .+| #ifndef|
|00004030| 20 77 61 6e 74 61 6d 65 | 73 73 0a 2b 20 09 69 66 | wantame|ss.+ .if|
|00004040| 20 28 62 79 20 3c 20 30 | 20 7c 7c 20 62 78 20 3c | (by < 0| || bx <|
|00004050| 20 30 20 7c 7c 20 6e 6c | 20 3c 3d 20 30 20 7c 7c | 0 || nl| <= 0 |||
|00004060| 20 6e 63 20 3c 3d 20 30 | 29 0a 2b 20 09 09 72 65 | nc <= 0|).+ ..re|
|00004070| 74 75 72 6e 28 4e 55 4c | 4c 29 3b 0a 2b 20 09 69 |turn(NUL|L);.+ .i|
|00004080| 66 20 28 62 79 2b 6e 6c | 20 3e 20 4c 49 4e 45 53 |f (by+nl| > LINES|
|00004090| 20 7c 7c 20 62 78 2b 6e | 63 20 3e 20 43 4f 4c 53 | || bx+n|c > COLS|
|000040a0| 29 0a 2b 20 09 09 72 65 | 74 75 72 6e 28 4e 55 4c |).+ ..re|turn(NUL|
|000040b0| 4c 29 3b 0a 2b 20 23 65 | 6e 64 69 66 0a 2b 20 0a |L);.+ #e|ndif.+ .|
|000040c0| 20 20 23 20 69 66 64 65 | 66 09 44 45 42 55 47 0a | # ifde|f.DEBUG.|
|000040d0| 53 48 41 52 5f 45 4f 46 | 0a 69 66 20 74 65 73 74 |SHAR_EOF|.if test|
|000040e0| 20 33 33 36 20 2d 6e 65 | 20 22 60 77 63 20 2d 63 | 336 -ne| "`wc -c|
|000040f0| 20 3c 20 27 6e 65 77 77 | 69 6e 2e 63 2e 70 61 74 | < 'neww|in.c.pat|
|00004100| 27 60 22 0a 74 68 65 6e | 0a 09 65 63 68 6f 20 73 |'`".then|..echo s|
|00004110| 68 61 72 3a 20 65 72 72 | 6f 72 20 74 72 61 6e 73 |har: err|or trans|
|00004120| 6d 69 74 74 69 6e 67 20 | 22 27 6e 65 77 77 69 6e |mitting |"'newwin|
|00004130| 2e 63 2e 70 61 74 27 22 | 20 27 28 73 68 6f 75 6c |.c.pat'"| '(shoul|
|00004140| 64 20 68 61 76 65 20 62 | 65 65 6e 20 33 33 36 20 |d have b|een 336 |
|00004150| 63 68 61 72 61 63 74 65 | 72 73 29 27 0a 66 69 0a |characte|rs)'.fi.|
|00004160| 66 69 20 23 20 65 6e 64 | 20 6f 66 20 6f 76 65 72 |fi # end| of over|
|00004170| 77 72 69 74 69 6e 67 20 | 63 68 65 63 6b 0a 65 63 |writing |check.ec|
|00004180| 68 6f 20 73 68 61 72 3a | 20 65 78 74 72 61 63 74 |ho shar:| extract|
|00004190| 69 6e 67 20 22 27 6f 76 | 65 72 6c 61 79 2e 63 2e |ing "'ov|erlay.c.|
|000041a0| 70 61 74 27 22 20 27 28 | 34 31 33 20 63 68 61 72 |pat'" '(|413 char|
|000041b0| 61 63 74 65 72 73 29 27 | 0a 69 66 20 74 65 73 74 |acters)'|.if test|
|000041c0| 20 2d 66 20 27 6f 76 65 | 72 6c 61 79 2e 63 2e 70 | -f 'ove|rlay.c.p|
|000041d0| 61 74 27 0a 74 68 65 6e | 0a 09 65 63 68 6f 20 73 |at'.then|..echo s|
|000041e0| 68 61 72 3a 20 77 69 6c | 6c 20 6e 6f 74 20 6f 76 |har: wil|l not ov|
|000041f0| 65 72 2d 77 72 69 74 65 | 20 65 78 69 73 74 69 6e |er-write| existin|
|00004200| 67 20 66 69 6c 65 20 22 | 27 6f 76 65 72 6c 61 79 |g file "|'overlay|
|00004210| 2e 63 2e 70 61 74 27 22 | 0a 65 6c 73 65 0a 73 65 |.c.pat'"|.else.se|
|00004220| 64 20 27 73 2f 5e 58 2f | 2f 27 20 3c 3c 20 5c 53 |d 's/^X/|/' << \S|
|00004230| 48 41 52 5f 45 4f 46 20 | 3e 20 27 6f 76 65 72 6c |HAR_EOF |> 'overl|
|00004240| 61 79 2e 63 2e 70 61 74 | 27 0a 2a 2a 2a 20 6c 69 |ay.c.pat|'.*** li|
|00004250| 62 63 75 72 73 65 73 34 | 32 2f 6f 76 65 72 6c 61 |bcurses4|2/overla|
|00004260| 79 2e 63 09 54 68 75 20 | 4e 6f 76 20 31 37 20 31 |y.c.Thu |Nov 17 1|
|00004270| 31 3a 30 33 3a 30 34 20 | 31 39 38 33 0a 2d 2d 2d |1:03:04 |1983.---|
|00004280| 20 6c 69 62 63 75 72 73 | 65 73 2f 6f 76 65 72 6c | libcurs|es/overl|
|00004290| 61 79 2e 63 09 53 61 74 | 20 4a 75 6c 20 20 36 20 |ay.c.Sat| Jul 6 |
|000042a0| 31 34 3a 31 33 3a 30 34 | 20 31 39 38 35 0a 2a 2a |14:13:04| 1985.**|
|000042b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 0a 2a 2a |********|*****.**|
|000042c0| 2a 20 32 34 2c 32 36 0a | 20 20 09 65 6e 64 78 20 |* 24,26.| .endx |
|000042d0| 3d 20 6d 69 6e 28 77 69 | 6e 31 2d 3e 5f 6d 61 78 |= min(wi|n1->_max|
|000042e0| 78 2c 20 77 69 6e 32 2d | 3e 5f 6d 61 78 78 29 20 |x, win2-|>_maxx) |
|000042f0| 2d 20 77 69 6e 31 2d 3e | 5f 62 65 67 78 20 2d 20 |- win1->|_begx - |
|00004300| 31 3b 0a 21 20 09 66 6f | 72 20 28 79 20 3d 20 73 |1;.! .fo|r (y = s|
|00004310| 74 61 72 74 79 3b 20 79 | 20 3c 20 65 6e 64 79 3b |tarty; y| < endy;|
|00004320| 20 79 2b 2b 29 20 7b 0a | 20 20 09 09 65 6e 64 20 | y++) {.| ..end |
|00004330| 3d 20 26 77 69 6e 31 2d | 3e 5f 79 5b 79 5d 5b 65 |= &win1-|>_y[y][e|
|00004340| 6e 64 78 5d 3b 0a 0a 2d | 2d 2d 20 32 34 2c 32 36 |ndx];..-|-- 24,26|
|00004350| 20 2d 2d 2d 2d 2d 0a 20 | 20 09 65 6e 64 78 20 3d | -----. | .endx =|
|00004360| 20 6d 69 6e 28 77 69 6e | 31 2d 3e 5f 6d 61 78 78 | min(win|1->_maxx|
|00004370| 2c 20 77 69 6e 32 2d 3e | 5f 6d 61 78 78 29 20 2d |, win2->|_maxx) -|
|00004380| 20 77 69 6e 31 2d 3e 5f | 62 65 67 78 20 2d 20 31 | win1->_|begx - 1|
|00004390| 3b 0a 21 20 09 66 6f 72 | 20 28 79 20 3d 20 73 74 |;.! .for| (y = st|
|000043a0| 61 72 74 79 3b 20 79 20 | 3c 3d 20 65 6e 64 79 3b |arty; y |<= endy;|
|000043b0| 20 79 2b 2b 29 20 7b 09 | 2f 2a 20 4d 69 6b 65 20 | y++) {.|/* Mike |
|000043c0| 4c 61 6d 61 6e 20 2a 2f | 0a 20 20 09 09 65 6e 64 |Laman */|. ..end|
|000043d0| 20 3d 20 26 77 69 6e 31 | 2d 3e 5f 79 5b 79 5d 5b | = &win1|->_y[y][|
|000043e0| 65 6e 64 78 5d 3b 0a 53 | 48 41 52 5f 45 4f 46 0a |endx];.S|HAR_EOF.|
|000043f0| 69 66 20 74 65 73 74 20 | 34 31 33 20 2d 6e 65 20 |if test |413 -ne |
|00004400| 22 60 77 63 20 2d 63 20 | 3c 20 27 6f 76 65 72 6c |"`wc -c |< 'overl|
|00004410| 61 79 2e 63 2e 70 61 74 | 27 60 22 0a 74 68 65 6e |ay.c.pat|'`".then|
|00004420| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 65 72 72 |..echo s|har: err|
|00004430| 6f 72 20 74 72 61 6e 73 | 6d 69 74 74 69 6e 67 20 |or trans|mitting |
|00004440| 22 27 6f 76 65 72 6c 61 | 79 2e 63 2e 70 61 74 27 |"'overla|y.c.pat'|
|00004450| 22 20 27 28 73 68 6f 75 | 6c 64 20 68 61 76 65 20 |" '(shou|ld have |
|00004460| 62 65 65 6e 20 34 31 33 | 20 63 68 61 72 61 63 74 |been 413| charact|
|00004470| 65 72 73 29 27 0a 66 69 | 0a 66 69 20 23 20 65 6e |ers)'.fi|.fi # en|
|00004480| 64 20 6f 66 20 6f 76 65 | 72 77 72 69 74 69 6e 67 |d of ove|rwriting|
|00004490| 20 63 68 65 63 6b 0a 65 | 63 68 6f 20 73 68 61 72 | check.e|cho shar|
|000044a0| 3a 20 65 78 74 72 61 63 | 74 69 6e 67 20 22 27 70 |: extrac|ting "'p|
|000044b0| 72 69 6e 74 77 2e 63 2e | 6e 65 77 27 22 20 27 28 |rintw.c.|new'" '(|
|000044c0| 31 38 34 39 20 63 68 61 | 72 61 63 74 65 72 73 29 |1849 cha|racters)|
|000044d0| 27 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 70 72 |'.if tes|t -f 'pr|
|000044e0| 69 6e 74 77 2e 63 2e 6e | 65 77 27 0a 74 68 65 6e |intw.c.n|ew'.then|
|000044f0| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 77 69 6c |..echo s|har: wil|
|00004500| 6c 20 6e 6f 74 20 6f 76 | 65 72 2d 77 72 69 74 65 |l not ov|er-write|
|00004510| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 22 | existin|g file "|
|00004520| 27 70 72 69 6e 74 77 2e | 63 2e 6e 65 77 27 22 0a |'printw.|c.new'".|
|00004530| 65 6c 73 65 0a 73 65 64 | 20 27 73 2f 5e 58 2f 2f |else.sed| 's/^X//|
|00004540| 27 20 3c 3c 20 5c 53 48 | 41 52 5f 45 4f 46 20 3e |' << \SH|AR_EOF >|
|00004550| 20 27 70 72 69 6e 74 77 | 2e 63 2e 6e 65 77 27 0a | 'printw|.c.new'.|
|00004560| 2f 2a 0a 20 2a 20 70 72 | 69 6e 74 77 20 61 6e 64 |/*. * pr|intw and|
|00004570| 20 66 72 69 65 6e 64 73 | 0a 20 2a 0a 20 2a 20 31 | friends|. *. * 1|
|00004580| 2f 32 36 2f 38 31 20 28 | 42 65 72 6b 65 6c 65 79 |/26/81 (|Berkeley|
|00004590| 29 20 40 28 23 29 70 72 | 69 6e 74 77 2e 63 09 31 |) @(#)pr|intw.c.1|
|000045a0| 2e 31 0a 20 2a 2f 0a 0a | 23 20 69 6e 63 6c 75 64 |.1. */..|# includ|
|000045b0| 65 09 22 63 75 72 73 65 | 73 2e 65 78 74 22 0a 0a |e."curse|s.ext"..|
|000045c0| 2f 2a 0a 20 2a 09 54 68 | 69 73 20 72 6f 75 74 69 |/*. *.Th|is routi|
|000045d0| 6e 65 20 69 6d 70 6c 65 | 6d 65 6e 74 73 20 61 20 |ne imple|ments a |
|000045e0| 70 72 69 6e 74 66 20 6f | 6e 20 74 68 65 20 73 74 |printf o|n the st|
|000045f0| 61 6e 64 61 72 64 20 73 | 63 72 65 65 6e 2e 0a 20 |andard s|creen.. |
|00004600| 2a 09 0a 20 2a 09 4d 6f | 64 69 66 69 65 64 20 62 |*.. *.Mo|dified b|
|00004610| 79 20 44 61 76 69 64 20 | 4f 77 65 6e 2c 20 55 2e |y David |Owen, U.|
|00004620| 43 2e 53 2e 44 2e 20 31 | 30 2e 35 2e 38 33 20 74 |C.S.D. 1|0.5.83 t|
|00004630| 6f 20 61 6c 6c 6f 77 20 | 61 72 62 69 74 72 61 72 |o allow |arbitrar|
|00004640| 79 0a 20 2a 09 6c 65 6e | 67 74 68 20 73 74 72 69 |y. *.len|gth stri|
|00004650| 6e 67 73 20 74 6f 20 22 | 70 72 69 6e 74 77 22 2e |ngs to "|printw".|
|00004660| 20 49 6e 20 22 73 70 72 | 69 6e 74 77 22 20 74 68 | In "spr|intw" th|
|00004670| 65 20 65 72 72 6f 72 20 | 73 74 61 74 75 73 20 69 |e error |status i|
|00004680| 73 20 0a 20 2a 09 63 68 | 65 63 6b 65 64 20 6f 6e |s . *.ch|ecked on|
|00004690| 20 72 65 74 75 72 6e 20 | 66 72 6f 6d 20 74 68 65 | return |from the|
|000046a0| 20 22 64 6f 70 72 6e 74 | 22 20 61 6e 64 20 69 66 | "doprnt|" and if|
|000046b0| 20 73 65 74 2c 20 74 68 | 65 0a 20 2a 09 63 61 6c | set, th|e. *.cal|
|000046c0| 6c 20 69 73 20 72 65 70 | 65 61 74 65 64 20 77 69 |l is rep|eated wi|
|000046d0| 74 68 20 61 20 62 69 67 | 67 65 72 20 62 75 66 66 |th a big|ger buff|
|000046e0| 65 72 2e 0a 20 2a 2f 0a | 70 72 69 6e 74 77 28 66 |er.. */.|printw(f|
|000046f0| 6d 74 2c 20 61 72 67 73 | 29 0a 63 68 61 72 09 2a |mt, args|).char.*|
|00004700| 66 6d 74 3b 0a 69 6e 74 | 09 61 72 67 73 3b 20 7b |fmt;.int|.args; {|
|00004710| 0a 0a 09 72 65 74 75 72 | 6e 20 5f 73 70 72 69 6e |...retur|n _sprin|
|00004720| 74 77 28 73 74 64 73 63 | 72 2c 20 66 6d 74 2c 20 |tw(stdsc|r, fmt, |
|00004730| 26 61 72 67 73 29 3b 0a | 7d 0a 0a 2f 2a 0a 20 2a |&args);.|}../*. *|
|00004740| 09 54 68 69 73 20 72 6f | 75 74 69 6e 65 20 69 6d |.This ro|utine im|
|00004750| 70 6c 65 6d 65 6e 74 73 | 20 61 20 70 72 69 6e 74 |plements| a print|
|00004760| 66 20 6f 6e 20 74 68 65 | 20 67 69 76 65 6e 20 77 |f on the| given w|
|00004770| 69 6e 64 6f 77 2e 0a 20 | 2a 2f 0a 77 70 72 69 6e |indow.. |*/.wprin|
|00004780| 74 77 28 77 69 6e 2c 20 | 66 6d 74 2c 20 61 72 67 |tw(win, |fmt, arg|
|00004790| 73 29 0a 57 49 4e 44 4f | 57 09 2a 77 69 6e 3b 0a |s).WINDO|W.*win;.|
|000047a0| 63 68 61 72 09 2a 66 6d | 74 3b 0a 69 6e 74 09 61 |char.*fm|t;.int.a|
|000047b0| 72 67 73 3b 20 7b 0a 0a | 09 72 65 74 75 72 6e 20 |rgs; {..|.return |
|000047c0| 5f 73 70 72 69 6e 74 77 | 28 77 69 6e 2c 20 66 6d |_sprintw|(win, fm|
|000047d0| 74 2c 20 26 61 72 67 73 | 29 3b 0a 7d 0a 2f 2a 0a |t, &args|);.}./*.|
|000047e0| 20 2a 09 54 68 69 73 20 | 72 6f 75 74 69 6e 65 20 | *.This |routine |
|000047f0| 61 63 74 75 61 6c 6c 79 | 20 65 78 65 63 75 74 65 |actually| execute|
|00004800| 73 20 74 68 65 20 70 72 | 69 6e 74 66 20 61 6e 64 |s the pr|intf and|
|00004810| 20 61 64 64 73 20 69 74 | 20 74 6f 20 74 68 65 20 | adds it| to the |
|00004820| 77 69 6e 64 6f 77 0a 20 | 2a 0a 20 2a 09 54 68 69 |window. |*. *.Thi|
|00004830| 73 20 69 73 20 72 65 61 | 6c 6c 79 20 61 20 6d 6f |s is rea|lly a mo|
|00004840| 64 69 66 69 65 64 20 76 | 65 72 73 69 6f 6e 20 6f |dified v|ersion o|
|00004850| 66 20 22 73 70 72 69 6e | 74 66 22 2e 20 20 41 73 |f "sprin|tf". As|
|00004860| 20 73 75 63 68 2c 0a 20 | 2a 20 69 74 20 61 73 73 | such,. |* it ass|
|00004870| 75 6d 65 73 20 74 68 61 | 74 20 73 70 72 69 6e 74 |umes tha|t sprint|
|00004880| 66 20 69 6e 74 65 72 66 | 61 63 65 73 20 77 69 74 |f interf|aces wit|
|00004890| 68 20 74 68 65 20 6f 74 | 68 65 72 20 70 72 69 6e |h the ot|her prin|
|000048a0| 74 66 20 66 75 6e 63 74 | 69 6f 6e 73 0a 20 2a 20 |tf funct|ions. * |
|000048b0| 69 6e 20 61 20 63 65 72 | 74 61 69 6e 20 77 61 79 |in a cer|tain way|
|000048c0| 2e 20 20 49 66 20 74 68 | 69 73 20 69 73 20 6e 6f |. If th|is is no|
|000048d0| 74 20 68 6f 77 20 79 6f | 75 72 20 73 79 73 74 65 |t how yo|ur syste|
|000048e0| 6d 20 77 6f 72 6b 73 2c | 20 79 6f 75 0a 20 2a 20 |m works,| you. * |
|000048f0| 77 69 6c 6c 20 68 61 76 | 65 20 74 6f 20 6d 6f 64 |will hav|e to mod|
|00004900| 69 66 79 20 74 68 69 73 | 20 72 6f 75 74 69 6e 65 |ify this| routine|
|00004910| 20 74 6f 20 75 73 65 20 | 74 68 65 20 69 6e 74 65 | to use |the inte|
|00004920| 72 66 61 63 65 20 74 68 | 61 74 20 79 6f 75 72 0a |rface th|at your.|
|00004930| 20 2a 20 22 73 70 72 69 | 6e 74 66 22 20 75 73 65 | * "spri|ntf" use|
|00004940| 73 2e 0a 20 2a 2f 0a 5f | 73 70 72 69 6e 74 77 28 |s.. */._|sprintw(|
|00004950| 77 69 6e 2c 20 66 6d 74 | 2c 20 61 72 67 73 29 0a |win, fmt|, args).|
|00004960| 57 49 4e 44 4f 57 09 2a | 77 69 6e 3b 0a 63 68 61 |WINDOW.*|win;.cha|
|00004970| 72 09 2a 66 6d 74 3b 0a | 69 6e 74 09 2a 61 72 67 |r.*fmt;.|int.*arg|
|00004980| 73 3b 20 7b 0a 0a 09 46 | 49 4c 45 09 6a 75 6e 6b |s; {...F|ILE.junk|
|00004990| 3b 0a 09 63 68 61 72 09 | 62 75 66 5b 42 55 46 53 |;..char.|buf[BUFS|
|000049a0| 49 5a 5d 2c 2a 62 70 74 | 72 3b 0a 09 69 6e 74 20 |IZ],*bpt|r;..int |
|000049b0| 63 6f 75 6e 74 2c 72 65 | 73 3b 0a 09 63 6f 75 6e |count,re|s;..coun|
|000049c0| 74 20 3d 20 30 3b 0a 0a | 09 6a 75 6e 6b 2e 5f 66 |t = 0;..|.junk._f|
|000049d0| 6c 61 67 20 3d 20 5f 49 | 4f 57 52 54 20 2b 20 5f |lag = _I|OWRT + _|
|000049e0| 49 4f 53 54 52 47 3b 0a | 09 6a 75 6e 6b 2e 5f 70 |IOSTRG;.|.junk._p|
|000049f0| 74 72 20 3d 20 62 75 66 | 3b 0a 09 6a 75 6e 6b 2e |tr = buf|;..junk.|
|00004a00| 5f 62 61 73 65 20 3d 20 | 62 75 66 3b 0a 09 6a 75 |_base = |buf;..ju|
|00004a10| 6e 6b 2e 5f 63 6e 74 20 | 3d 20 42 55 46 53 49 5a |nk._cnt |= BUFSIZ|
|00004a20| 3b 0a 2f 2a 4d 61 6b 65 | 20 73 75 72 65 20 65 72 |;./*Make| sure er|
|00004a30| 72 6f 72 20 66 6c 61 67 | 20 73 65 74 20 69 66 20 |ror flag| set if |
|00004a40| 65 76 65 72 20 22 66 6c | 73 62 75 66 22 20 69 73 |ever "fl|sbuf" is|
|00004a50| 20 63 61 6c 6c 65 64 2a | 2f 0a 09 6a 75 6e 6b 2e | called*|/..junk.|
|00004a60| 5f 66 69 6c 65 20 3d 20 | 2d 31 3b 0a 09 66 6f 72 |_file = |-1;..for|
|00004a70| 28 3b 3b 29 7b 0a 09 09 | 5f 64 6f 70 72 6e 74 28 |(;;){...|_doprnt(|
|00004a80| 66 6d 74 2c 20 61 72 67 | 73 2c 20 26 6a 75 6e 6b |fmt, arg|s, &junk|
|00004a90| 29 3b 0a 09 09 70 75 74 | 63 28 27 5c 30 27 2c 20 |);...put|c('\0', |
|00004aa0| 26 6a 75 6e 6b 29 3b 0a | 2f 2a 49 66 20 74 68 65 |&junk);.|/*If the|
|00004ab0| 72 65 20 77 61 73 20 61 | 20 77 72 69 74 65 20 65 |re was a| write e|
|00004ac0| 72 72 6f 72 20 69 6e 63 | 72 65 61 73 65 20 62 75 |rror inc|rease bu|
|00004ad0| 66 66 65 72 20 61 6e 64 | 20 74 72 79 20 61 67 61 |ffer and| try aga|
|00004ae0| 69 6e 2a 2f 0a 09 09 69 | 66 28 6a 75 6e 6b 2e 5f |in*/...i|f(junk._|
|00004af0| 66 6c 61 67 20 26 20 5f | 49 4f 45 52 52 29 7b 0a |flag & _|IOERR){.|
|00004b00| 09 09 09 69 66 28 63 6f | 75 6e 74 29 20 0a 09 09 |...if(co|unt) ...|
|00004b10| 09 09 66 72 65 65 28 62 | 70 74 72 29 3b 0a 09 09 |..free(b|ptr);...|
|00004b20| 09 65 6c 73 65 0a 09 09 | 09 09 63 6f 75 6e 74 20 |.else...|..count |
|00004b30| 3d 20 42 55 46 53 49 5a | 3b 0a 09 09 09 63 6f 75 |= BUFSIZ|;....cou|
|00004b40| 6e 74 20 2b 3d 20 42 55 | 46 53 49 5a 3b 0a 09 09 |nt += BU|FSIZ;...|
|00004b50| 09 69 66 28 28 62 70 74 | 72 20 3d 20 28 63 68 61 |.if((bpt|r = (cha|
|00004b60| 72 20 2a 29 6d 61 6c 6c | 6f 63 28 63 6f 75 6e 74 |r *)mall|oc(count|
|00004b70| 29 29 20 3d 3d 20 4e 55 | 4c 4c 29 7b 0a 09 09 09 |)) == NU|LL){....|
|00004b80| 09 66 70 72 69 6e 74 66 | 28 73 74 64 65 72 72 2c |.fprintf|(stderr,|
|00004b90| 22 73 70 72 69 6e 74 77 | 3a 6e 6f 20 6d 61 6c 6c |"sprintw|:no mall|
|00004ba0| 6f 63 20 73 70 61 63 65 | 5c 6e 22 29 3b 0a 09 09 |oc space|\n");...|
|00004bb0| 09 09 72 65 74 75 72 6e | 28 2d 31 29 3b 0a 09 09 |..return|(-1);...|
|00004bc0| 09 7d 0a 09 09 09 6a 75 | 6e 6b 2e 5f 66 6c 61 67 |.}....ju|nk._flag|
|00004bd0| 20 3d 20 5f 49 4f 57 52 | 54 20 2b 20 5f 49 4f 53 | = _IOWR|T + _IOS|
|00004be0| 54 52 47 3b 0a 09 09 09 | 6a 75 6e 6b 2e 5f 70 74 |TRG;....|junk._pt|
|00004bf0| 72 20 3d 20 62 70 74 72 | 3b 0a 09 09 09 6a 75 6e |r = bptr|;....jun|
|00004c00| 6b 2e 5f 62 61 73 65 20 | 3d 20 62 70 74 72 3b 0a |k._base |= bptr;.|
|00004c10| 09 09 09 6a 75 6e 6b 2e | 5f 63 6e 74 20 3d 20 63 |...junk.|_cnt = c|
|00004c20| 6f 75 6e 74 3b 0a 09 09 | 09 6a 75 6e 6b 2e 5f 66 |ount;...|.junk._f|
|00004c30| 69 6c 65 20 3d 20 2d 31 | 3b 0a 09 09 09 63 6f 6e |ile = -1|;....con|
|00004c40| 74 69 6e 75 65 3b 0a 09 | 09 7d 0a 09 09 72 65 73 |tinue;..|.}...res|
|00004c50| 20 3d 20 77 61 64 64 73 | 74 72 28 77 69 6e 2c 6a | = wadds|tr(win,j|
|00004c60| 75 6e 6b 2e 5f 62 61 73 | 65 29 3b 0a 09 09 69 66 |unk._bas|e);...if|
|00004c70| 28 63 6f 75 6e 74 29 20 | 66 72 65 65 28 62 70 74 |(count) |free(bpt|
|00004c80| 72 29 3b 0a 09 09 72 65 | 74 75 72 6e 28 72 65 73 |r);...re|turn(res|
|00004c90| 29 3b 0a 09 7d 0a 7d 0a | 0a 53 48 41 52 5f 45 4f |);..}.}.|.SHAR_EO|
|00004ca0| 46 0a 69 66 20 74 65 73 | 74 20 31 38 34 39 20 2d |F.if tes|t 1849 -|
|00004cb0| 6e 65 20 22 60 77 63 20 | 2d 63 20 3c 20 27 70 72 |ne "`wc |-c < 'pr|
|00004cc0| 69 6e 74 77 2e 63 2e 6e | 65 77 27 60 22 0a 74 68 |intw.c.n|ew'`".th|
|00004cd0| 65 6e 0a 09 65 63 68 6f | 20 73 68 61 72 3a 20 65 |en..echo| shar: e|
|00004ce0| 72 72 6f 72 20 74 72 61 | 6e 73 6d 69 74 74 69 6e |rror tra|nsmittin|
|00004cf0| 67 20 22 27 70 72 69 6e | 74 77 2e 63 2e 6e 65 77 |g "'prin|tw.c.new|
|00004d00| 27 22 20 27 28 73 68 6f | 75 6c 64 20 68 61 76 65 |'" '(sho|uld have|
|00004d10| 20 62 65 65 6e 20 31 38 | 34 39 20 63 68 61 72 61 | been 18|49 chara|
|00004d20| 63 74 65 72 73 29 27 0a | 66 69 0a 66 69 20 23 20 |cters)'.|fi.fi # |
|00004d30| 65 6e 64 20 6f 66 20 6f | 76 65 72 77 72 69 74 69 |end of o|verwriti|
|00004d40| 6e 67 20 63 68 65 63 6b | 0a 65 63 68 6f 20 73 68 |ng check|.echo sh|
|00004d50| 61 72 3a 20 65 78 74 72 | 61 63 74 69 6e 67 20 22 |ar: extr|acting "|
|00004d60| 27 72 65 66 72 65 73 68 | 2e 63 2e 70 61 74 27 22 |'refresh|.c.pat'"|
|00004d70| 20 27 28 34 38 38 34 20 | 63 68 61 72 61 63 74 65 | '(4884 |characte|
|00004d80| 72 73 29 27 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |rs)'.if |test -f |
|00004d90| 27 72 65 66 72 65 73 68 | 2e 63 2e 70 61 74 27 0a |'refresh|.c.pat'.|
|00004da0| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00004db0| 20 77 69 6c 6c 20 6e 6f | 74 20 6f 76 65 72 2d 77 | will no|t over-w|
|00004dc0| 72 69 74 65 20 65 78 69 | 73 74 69 6e 67 20 66 69 |rite exi|sting fi|
|00004dd0| 6c 65 20 22 27 72 65 66 | 72 65 73 68 2e 63 2e 70 |le "'ref|resh.c.p|
|00004de0| 61 74 27 22 0a 65 6c 73 | 65 0a 73 65 64 20 27 73 |at'".els|e.sed 's|
|00004df0| 2f 5e 58 2f 2f 27 20 3c | 3c 20 5c 53 48 41 52 5f |/^X//' <|< \SHAR_|
|00004e00| 45 4f 46 20 3e 20 27 72 | 65 66 72 65 73 68 2e 63 |EOF > 'r|efresh.c|
|00004e10| 2e 70 61 74 27 0a 2a 2a | 2a 20 6c 69 62 63 75 72 |.pat'.**|* libcur|
|00004e20| 73 65 73 34 32 2f 72 65 | 66 72 65 73 68 2e 63 09 |ses42/re|fresh.c.|
|00004e30| 54 68 75 20 4e 6f 76 20 | 31 37 20 31 31 3a 30 33 |Thu Nov |17 11:03|
|00004e40| 3a 30 36 20 31 39 38 33 | 0a 2d 2d 2d 20 6c 69 62 |:06 1983|.--- lib|
|00004e50| 63 75 72 73 65 73 2f 72 | 65 66 72 65 73 68 2e 63 |curses/r|efresh.c|
|00004e60| 09 54 75 65 20 4a 75 6c | 20 33 30 20 32 33 3a 31 |.Tue Jul| 30 23:1|
|00004e70| 36 3a 30 31 20 31 39 38 | 35 0a 2a 2a 2a 2a 2a 2a |6:01 198|5.******|
|00004e80| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0a 2a 2a 2a 20 35 2c |********|*.*** 5,|
|00004e90| 36 0a 20 20 20 2a 20 35 | 2f 31 32 2f 38 33 20 28 |6. * 5|/12/83 (|
|00004ea0| 42 65 72 6b 65 6c 65 79 | 29 20 40 28 23 29 72 65 |Berkeley|) @(#)re|
|00004eb0| 66 72 65 73 68 2e 63 09 | 31 2e 38 0a 20 20 20 2a |fresh.c.|1.8. *|
|00004ec0| 2f 0a 0a 2d 2d 2d 20 35 | 2c 31 34 20 2d 2d 2d 2d |/..--- 5|,14 ----|
|00004ed0| 2d 0a 20 20 20 2a 20 35 | 2f 31 32 2f 38 33 20 28 |-. * 5|/12/83 (|
|00004ee0| 42 65 72 6b 65 6c 65 79 | 29 20 40 28 23 29 72 65 |Berkeley|) @(#)re|
|00004ef0| 66 72 65 73 68 2e 63 09 | 31 2e 38 0a 2b 20 20 2a |fresh.c.|1.8.+ *|
|00004f00| 0a 2b 20 20 2a 20 32 2f | 32 38 2f 38 34 20 43 6f |.+ * 2/|28/84 Co|
|00004f10| 72 72 65 63 74 69 6f 6e | 20 61 74 20 55 43 53 46 |rrection| at UCSF|
|00004f20| 3a 0a 2b 20 20 2a 20 54 | 61 6b 65 20 74 68 65 20 |:.+ * T|ake the |
|00004f30| 74 65 72 6d 69 6e 61 6c | 20 6f 75 74 20 6f 66 20 |terminal| out of |
|00004f40| 73 74 61 6e 64 6f 75 74 | 20 6d 6f 64 65 2c 20 62 |standout| mode, b|
|00004f50| 65 66 6f 72 65 20 63 6c | 65 61 72 20 74 6f 20 65 |efore cl|ear to e|
|00004f60| 6e 64 20 6f 66 20 6c 69 | 6e 65 0a 2b 20 20 2a 20 |nd of li|ne.+ * |
|00004f70| 69 66 20 69 74 20 69 73 | 6e 27 74 20 73 61 66 65 |if it is|n't safe|
|00004f80| 20 74 6f 20 6d 6f 76 65 | 20 69 6e 20 73 74 61 6e | to move| in stan|
|00004f90| 64 6f 75 74 20 6d 6f 64 | 65 20 28 74 65 72 6d 63 |dout mod|e (termc|
|00004fa0| 61 70 20 65 6e 74 72 79 | 20 6d 73 29 0a 2b 20 20 |ap entry| ms).+ |
|00004fb0| 2a 0a 2b 20 20 2a 20 33 | 2f 31 34 2f 38 35 20 43 |*.+ * 3|/14/85 C|
|00004fc0| 6f 72 72 65 63 74 69 6f | 6e 73 20 61 74 20 52 54 |orrectio|ns at RT|
|00004fd0| 49 0a 2b 20 20 2a 20 20 | 46 69 78 20 70 72 6f 62 |I.+ * |Fix prob|
|00004fe0| 6c 65 6d 73 20 72 65 70 | 6f 72 74 65 64 20 6f 6e |lems rep|orted on|
|00004ff0| 20 55 73 65 6e 65 74 2e | 20 20 41 6c 73 6f 2c 20 | Usenet.| Also, |
|00005000| 64 65 6c 65 74 65 20 61 | 70 70 61 72 65 6e 74 6c |delete a|pparentl|
|00005010| 79 0a 2b 20 20 2a 20 20 | 75 73 65 6c 65 73 73 20 |y.+ * |useless |
|00005020| 28 61 6e 64 20 68 61 72 | 6d 66 75 6c 29 20 63 6f |(and har|mful) co|
|00005030| 64 65 20 69 66 20 5f 6c | 65 61 76 65 20 68 61 73 |de if _l|eave has|
|00005040| 20 62 65 65 6e 20 73 65 | 74 2e 0a 20 20 20 2a 2f | been se|t.. */|
|00005050| 0a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.*******|********|
|00005060| 0a 2a 2a 2a 20 38 36 2c | 38 37 0a 20 20 09 09 63 |.*** 86,|87. ..c|
|00005070| 75 72 73 63 72 2d 3e 5f | 63 75 72 78 20 3d 20 6c |urscr->_|curx = l|
|00005080| 78 3b 0a 20 20 09 09 6c | 79 20 2d 3d 20 77 69 6e |x;. ..l|y -= win|
|00005090| 2d 3e 5f 62 65 67 79 3b | 0a 0a 2d 2d 2d 20 39 34 |->_begy;|..--- 94|
|000050a0| 2c 39 37 20 2d 2d 2d 2d | 2d 0a 20 20 09 09 63 75 |,97 ----|-. ..cu|
|000050b0| 72 73 63 72 2d 3e 5f 63 | 75 72 78 20 3d 20 6c 78 |rscr->_c|urx = lx|
|000050c0| 3b 0a 2b 20 23 69 66 64 | 65 66 09 77 61 6e 74 61 |;.+ #ifd|ef.wanta|
|000050d0| 6d 65 73 73 0a 2b 20 09 | 09 2f 2a 20 72 74 69 2d |mess.+ .|./* rti-|
|000050e0| 73 65 6c 21 74 72 74 3a | 20 74 68 69 73 20 63 6f |sel!trt:| this co|
|000050f0| 64 65 20 69 73 20 63 6f | 6d 70 6c 65 74 65 6c 79 |de is co|mpletely|
|00005100| 20 62 6f 67 75 73 2c 20 | 79 65 73 3f 20 2a 2f 0a | bogus, |yes? */.|
|00005110| 20 20 09 09 6c 79 20 2d | 3d 20 77 69 6e 2d 3e 5f | ..ly -|= win->_|
|00005120| 62 65 67 79 3b 0a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |begy;.**|********|
|00005130| 2a 2a 2a 2a 2a 0a 2a 2a | 2a 20 39 34 2c 39 35 0a |*****.**|* 94,95.|
|00005140| 20 20 09 09 09 77 69 6e | 2d 3e 5f 63 75 72 79 20 | ...win|->_cury |
|00005150| 3d 20 77 69 6e 2d 3e 5f | 63 75 72 78 20 3d 20 30 |= win->_|curx = 0|
|00005160| 3b 0a 20 20 09 7d 0a 0a | 2d 2d 2d 20 31 30 34 2c |;. .}..|--- 104,|
|00005170| 31 30 36 20 2d 2d 2d 2d | 2d 0a 20 20 09 09 09 77 |106 ----|-. ...w|
|00005180| 69 6e 2d 3e 5f 63 75 72 | 79 20 3d 20 77 69 6e 2d |in->_cur|y = win-|
|00005190| 3e 5f 63 75 72 78 20 3d | 20 30 3b 0a 2b 20 23 65 |>_curx =| 0;.+ #e|
|000051a0| 6e 64 69 66 0a 20 20 09 | 7d 0a 2a 2a 2a 2a 2a 2a |ndif. .|}.******|
|000051b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0a 2a 2a 2a 20 31 31 |********|*.*** 11|
|000051c0| 38 2c 31 31 39 0a 20 20 | 09 72 65 67 20 69 6e 74 |8,119. |.reg int|
|000051d0| 09 09 6e 6c 73 70 2c 20 | 63 6c 73 70 3b 09 2f 2a |..nlsp, |clsp;./*|
|000051e0| 20 6c 61 73 74 20 73 70 | 61 63 65 20 69 6e 20 6c | last sp|ace in l|
|000051f0| 69 6e 65 73 09 09 2a 2f | 0a 20 20 0a 0a 2d 2d 2d |ines..*/|. ..---|
|00005200| 20 31 32 39 2c 31 33 31 | 20 2d 2d 2d 2d 2d 0a 20 | 129,131| -----. |
|00005210| 20 09 72 65 67 20 69 6e | 74 09 09 6e 6c 73 70 2c | .reg in|t..nlsp,|
|00005220| 20 63 6c 73 70 3b 09 2f | 2a 20 6c 61 73 74 20 73 | clsp;./|* last s|
|00005230| 70 61 63 65 20 69 6e 20 | 6c 69 6e 65 73 09 09 2a |pace in |lines..*|
|00005240| 2f 0a 2b 20 09 73 74 61 | 74 69 63 20 69 6e 74 20 |/.+ .sta|tic int |
|00005250| 67 6c 69 74 63 68 58 4e | 3b 0a 20 20 0a 2a 2a 2a |glitchXN|;. .***|
|00005260| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 0a 2a 2a 2a |********|****.***|
|00005270| 20 31 32 38 2c 31 32 39 | 0a 20 20 09 69 66 20 28 | 128,129|. .if (|
|00005280| 43 45 20 26 26 20 21 63 | 75 72 77 69 6e 29 20 7b |CE && !c|urwin) {|
|00005290| 0a 20 20 09 09 66 6f 72 | 20 28 63 65 20 3d 20 26 |. ..for| (ce = &|
|000052a0| 77 69 6e 2d 3e 5f 79 5b | 77 79 5d 5b 77 69 6e 2d |win->_y[|wy][win-|
|000052b0| 3e 5f 6d 61 78 78 20 2d | 20 31 5d 3b 20 2a 63 65 |>_maxx -| 1]; *ce|
|000052c0| 20 3d 3d 20 27 20 27 3b | 20 63 65 2d 2d 29 0a 0a | == ' ';| ce--)..|
|000052d0| 2d 2d 2d 20 31 34 30 2c | 31 34 32 20 2d 2d 2d 2d |--- 140,|142 ----|
|000052e0| 2d 0a 20 20 09 69 66 20 | 28 43 45 20 26 26 20 21 |-. .if |(CE && !|
|000052f0| 63 75 72 77 69 6e 29 20 | 7b 0a 2b 20 23 69 66 64 |curwin) |{.+ #ifd|
|00005300| 65 66 20 73 6c 6f 77 77 | 61 79 0a 20 20 09 09 66 |ef sloww|ay. ..f|
|00005310| 6f 72 20 28 63 65 20 3d | 20 26 77 69 6e 2d 3e 5f |or (ce =| &win->_|
|00005320| 79 5b 77 79 5d 5b 77 69 | 6e 2d 3e 5f 6d 61 78 78 |y[wy][wi|n->_maxx|
|00005330| 20 2d 20 31 5d 3b 20 2a | 63 65 20 3d 3d 20 27 20 | - 1]; *|ce == ' |
|00005340| 27 3b 20 63 65 2d 2d 29 | 0a 2a 2a 2a 2a 2a 2a 2a |'; ce--)|.*******|
|00005350| 2a 2a 2a 2a 2a 2a 2a 2a | 0a 2a 2a 2a 20 31 33 32 |********|.*** 132|
|00005360| 2c 31 33 33 0a 20 20 09 | 09 6e 6c 73 70 20 3d 20 |,133. .|.nlsp = |
|00005370| 63 65 20 2d 20 77 69 6e | 2d 3e 5f 79 5b 77 79 5d |ce - win|->_y[wy]|
|00005380| 3b 0a 20 20 09 7d 0a 0a | 2d 2d 2d 20 31 34 35 2c |;. .}..|--- 145,|
|00005390| 31 34 39 20 2d 2d 2d 2d | 2d 0a 20 20 09 09 6e 6c |149 ----|-. ..nl|
|000053a0| 73 70 20 3d 20 63 65 20 | 2d 20 77 69 6e 2d 3e 5f |sp = ce |- win->_|
|000053b0| 79 5b 77 79 5d 3b 0a 2b | 20 23 65 6c 73 65 0a 2b |y[wy];.+| #else.+|
|000053c0| 20 09 09 6e 6c 73 70 20 | 3d 20 2d 31 3b 0a 2b 20 | ..nlsp |= -1;.+ |
|000053d0| 23 65 6e 64 69 66 0a 20 | 20 09 7d 0a 2a 2a 2a 2a |#endif. | .}.****|
|000053e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 0a 2a 2a 2a 20 |********|***.*** |
|000053f0| 31 33 39 2c 31 34 30 0a | 20 20 09 09 69 66 20 28 |139,140.| ..if (|
|00005400| 2a 6e 73 70 20 21 3d 20 | 2a 63 73 70 29 20 7b 0a |*nsp != |*csp) {.|
|00005410| 20 20 09 09 09 64 6f 6d | 76 63 75 72 28 6c 79 2c | ...dom|vcur(ly,|
|00005420| 20 6c 78 2c 20 79 2c 20 | 77 78 20 2b 20 77 69 6e | lx, y, |wx + win|
|00005430| 2d 3e 5f 62 65 67 78 29 | 3b 0a 0a 2d 2d 2d 20 31 |->_begx)|;..--- 1|
|00005440| 35 35 2c 31 36 38 20 2d | 2d 2d 2d 2d 0a 20 20 09 |55,168 -|----. .|
|00005450| 09 69 66 20 28 2a 6e 73 | 70 20 21 3d 20 2a 63 73 |.if (*ns|p != *cs|
|00005460| 70 29 20 7b 0a 2b 20 23 | 69 66 6e 64 65 66 20 77 |p) {.+ #|ifndef w|
|00005470| 61 6e 74 61 6d 65 73 73 | 0a 2b 20 09 09 09 2f 2a |antamess|.+ .../*|
|00005480| 20 74 68 69 73 20 69 73 | 20 6e 6f 20 67 75 61 72 | this is| no guar|
|00005490| 61 6e 74 65 65 2c 20 62 | 75 74 20 73 65 65 6d 73 |antee, b|ut seems|
|000054a0| 20 74 6f 20 77 6f 72 6b | 20 2a 2f 0a 2b 20 09 09 | to work| */.+ ..|
|000054b0| 09 69 66 20 28 67 6c 69 | 74 63 68 58 4e 20 26 26 |.if (gli|tchXN &&|
|000054c0| 20 77 78 20 26 26 20 77 | 78 2b 77 69 6e 2d 3e 5f | wx && w|x+win->_|
|000054d0| 62 65 67 78 3d 3d 43 4f | 4c 53 2d 31 29 20 7b 0a |begx==CO|LS-1) {.|
|000054e0| 2b 20 09 09 09 09 64 6f | 6d 76 63 75 72 28 6c 79 |+ ....do|mvcur(ly|
|000054f0| 2c 20 6c 78 2c 20 79 2c | 20 77 78 2b 77 69 6e 2d |, lx, y,| wx+win-|
|00005500| 3e 5f 62 65 67 78 2d 31 | 29 3b 0a 2b 20 09 09 09 |>_begx-1|);.+ ...|
|00005510| 09 6c 79 20 3d 20 79 3b | 0a 2b 20 09 09 09 09 6c |.ly = y;|.+ ....l|
|00005520| 78 20 3d 20 77 78 2b 77 | 69 6e 2d 3e 5f 62 65 67 |x = wx+w|in->_beg|
|00005530| 78 2d 31 3b 0a 2b 20 09 | 09 09 09 67 6c 69 74 63 |x-1;.+ .|...glitc|
|00005540| 68 58 4e 20 3d 20 30 3b | 0a 2b 20 09 09 09 09 63 |hXN = 0;|.+ ....c|
|00005550| 6f 6e 74 69 6e 75 65 3b | 0a 2b 20 09 09 09 7d 0a |ontinue;|.+ ...}.|
|00005560| 2b 20 09 09 09 67 6c 69 | 74 63 68 58 4e 20 3d 20 |+ ...gli|tchXN = |
|00005570| 30 3b 0a 2b 20 23 65 6e | 64 69 66 0a 2b 20 23 69 |0;.+ #en|dif.+ #i|
|00005580| 66 64 65 66 20 73 6c 6f | 77 77 61 79 0a 20 20 09 |fdef slo|wway. .|
|00005590| 09 09 64 6f 6d 76 63 75 | 72 28 6c 79 2c 20 6c 78 |..domvcu|r(ly, lx|
|000055a0| 2c 20 79 2c 20 77 78 20 | 2b 20 77 69 6e 2d 3e 5f |, y, wx |+ win->_|
|000055b0| 62 65 67 78 29 3b 0a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |begx);.*|********|
|000055c0| 2a 2a 2a 2a 2a 2a 0a 2a | 2a 2a 20 31 34 35 2c 31 |******.*|** 145,1|
|000055d0| 34 37 0a 20 20 09 09 09 | 6c 78 20 3d 20 77 78 20 |47. ...|lx = wx |
|000055e0| 2b 20 77 69 6e 2d 3e 5f | 62 65 67 78 3b 0a 21 20 |+ win->_|begx;.! |
|000055f0| 09 09 09 77 68 69 6c 65 | 20 28 2a 6e 73 70 20 21 |...while| (*nsp !|
|00005600| 3d 20 2a 63 73 70 20 26 | 26 20 77 78 20 3c 3d 20 |= *csp &|& wx <= |
|00005610| 6c 63 68 29 20 7b 0a 20 | 20 09 09 09 09 69 66 20 |lch) {. | ....if |
|00005620| 28 63 65 20 21 3d 20 4e | 55 4c 4c 20 26 26 20 77 |(ce != N|ULL && w|
|00005630| 78 20 3e 3d 20 6e 6c 73 | 70 20 26 26 20 2a 6e 73 |x >= nls|p && *ns|
|00005640| 70 20 3d 3d 20 27 20 27 | 29 20 7b 0a 0a 2d 2d 2d |p == ' '|) {..---|
|00005650| 20 31 37 33 2c 32 31 32 | 20 2d 2d 2d 2d 2d 0a 20 | 173,212| -----. |
|00005660| 20 09 09 09 6c 78 20 3d | 20 77 78 20 2b 20 77 69 | ...lx =| wx + wi|
|00005670| 6e 2d 3e 5f 62 65 67 78 | 3b 0a 21 20 23 65 6c 73 |n->_begx|;.! #els|
|00005680| 65 0a 21 20 09 09 09 2f | 2a 20 73 70 65 65 64 20 |e.! .../|* speed |
|00005690| 68 61 63 6b 73 20 74 6f | 20 61 76 6f 69 64 20 64 |hacks to| avoid d|
|000056a0| 6f 6d 76 63 75 72 20 69 | 6e 20 73 69 6d 70 6c 65 |omvcur i|n simple|
|000056b0| 20 63 61 73 65 73 20 2a | 2f 0a 21 20 09 09 09 63 | cases *|/.! ...c|
|000056c0| 6c 73 70 20 3d 20 77 78 | 20 2b 20 77 69 6e 2d 3e |lsp = wx| + win->|
|000056d0| 5f 62 65 67 78 3b 20 2f | 2a 20 64 69 72 74 79 20 |_begx; /|* dirty |
|000056e0| 75 73 65 20 6f 66 20 63 | 6c 73 70 20 2a 2f 0a 21 |use of c|lsp */.!|
|000056f0| 20 09 09 09 69 66 20 28 | 6c 79 20 3d 3d 20 79 29 | ...if (|ly == y)|
|00005700| 20 7b 0a 21 20 09 09 09 | 20 20 20 20 69 66 20 28 | {.! ...| if (|
|00005710| 6c 78 20 3d 3d 20 63 6c | 73 70 29 0a 21 20 09 09 |lx == cl|sp).! ..|
|00005720| 09 09 67 6f 74 6f 20 61 | 74 5f 74 61 72 67 65 74 |..goto a|t_target|
|00005730| 3b 0a 21 20 09 09 09 20 | 20 20 20 69 66 20 28 6c |;.! ... | if (l|
|00005740| 78 2b 31 20 3d 3d 20 63 | 6c 73 70 20 26 26 20 21 |x+1 == c|lsp && !|
|00005750| 63 75 72 77 69 6e 29 20 | 7b 0a 21 20 09 09 09 09 |curwin) |{.! ....|
|00005760| 2f 2a 20 65 6e 74 65 72 | 2f 65 78 69 74 20 73 74 |/* enter|/exit st|
|00005770| 61 6e 64 6f 75 74 20 6d | 6f 64 65 20 61 73 20 61 |andout m|ode as a|
|00005780| 70 70 72 6f 70 72 69 61 | 74 65 20 2a 2f 0a 21 20 |ppropria|te */.! |
|00005790| 09 09 09 09 69 66 20 28 | 53 4f 20 26 26 20 28 63 |....if (|SO && (c|
|000057a0| 73 70 5b 2d 31 5d 26 5f | 53 54 41 4e 44 4f 55 54 |sp[-1]&_|STANDOUT|
|000057b0| 29 20 21 3d 20 28 63 75 | 72 73 63 72 2d 3e 5f 66 |) != (cu|rscr->_f|
|000057c0| 6c 61 67 73 26 5f 53 54 | 41 4e 44 4f 55 54 29 29 |lags&_ST|ANDOUT))|
|000057d0| 20 7b 0a 21 20 09 09 09 | 09 09 69 66 20 28 63 73 | {.! ...|..if (cs|
|000057e0| 70 5b 2d 31 5d 20 26 20 | 5f 53 54 41 4e 44 4f 55 |p[-1] & |_STANDOU|
|000057f0| 54 29 20 7b 0a 21 20 09 | 09 09 09 09 09 5f 70 75 |T) {.! .|....._pu|
|00005800| 74 73 28 53 4f 29 3b 0a | 21 20 09 09 09 09 09 09 |ts(SO);.|! ......|
|00005810| 63 75 72 73 63 72 2d 3e | 5f 66 6c 61 67 73 20 7c |curscr->|_flags ||
|00005820| 3d 20 5f 53 54 41 4e 44 | 4f 55 54 3b 0a 21 20 09 |= _STAND|OUT;.! .|
|00005830| 09 09 09 09 7d 0a 21 20 | 09 09 09 09 09 65 6c 73 |....}.! |.....els|
|00005840| 65 20 7b 0a 21 20 09 09 | 09 09 09 09 5f 70 75 74 |e {.! ..|...._put|
|00005850| 73 28 53 45 29 3b 0a 21 | 20 09 09 09 09 09 09 63 |s(SE);.!| ......c|
|00005860| 75 72 73 63 72 2d 3e 5f | 66 6c 61 67 73 20 26 3d |urscr->_|flags &=|
|00005870| 20 7e 5f 53 54 41 4e 44 | 4f 55 54 3b 0a 21 20 09 | ~_STAND|OUT;.! .|
|00005880| 09 09 09 09 7d 0a 21 20 | 09 09 09 09 7d 0a 21 20 |....}.! |....}.! |
|00005890| 09 09 09 09 70 75 74 63 | 68 61 72 28 63 73 70 5b |....putc|har(csp[|
|000058a0| 2d 31 5d 26 30 31 37 37 | 29 3b 0a 21 20 09 09 09 |-1]&0177|);.! ...|
|000058b0| 09 6c 78 2b 2b 3b 0a 21 | 20 09 09 09 09 67 6f 74 |.lx++;.!| ....got|
|000058c0| 6f 20 61 74 5f 74 61 72 | 67 65 74 3b 0a 21 20 09 |o at_tar|get;.! .|
|000058d0| 09 09 20 20 20 20 7d 0a | 21 20 09 09 09 20 20 20 |.. }.|! ... |
|000058e0| 20 69 66 20 28 63 6c 73 | 70 20 3d 3d 20 30 20 26 | if (cls|p == 0 &|
|000058f0| 26 20 21 28 63 75 72 73 | 63 72 2d 3e 5f 66 6c 61 |& !(curs|cr->_fla|
|00005900| 67 73 26 5f 53 54 41 4e | 44 4f 55 54 29 0a 21 20 |gs&_STAN|DOUT).! |
|00005910| 09 09 09 20 20 20 20 20 | 26 26 20 21 4e 43 20 26 |... |&& !NC &|
|00005920| 26 20 28 21 43 52 20 7c | 7c 20 43 52 5b 31 5d 20 |& (!CR ||| CR[1] |
|00005930| 3d 3d 20 27 5c 30 27 29 | 29 20 7b 0a 21 20 09 09 |== '\0')|) {.! ..|
|00005940| 09 09 69 66 20 28 43 52 | 29 0a 21 20 09 09 09 09 |..if (CR|).! ....|
|00005950| 20 20 20 20 70 75 74 63 | 68 61 72 28 2a 43 52 29 | putc|har(*CR)|
|00005960| 3b 0a 21 20 09 09 09 09 | 65 6c 73 65 0a 21 20 09 |;.! ....|else.! .|
|00005970| 09 09 09 20 20 20 20 70 | 75 74 63 68 61 72 28 27 |... p|utchar('|
|00005980| 5c 72 27 29 3b 0a 21 20 | 09 09 09 09 6c 78 20 3d |\r');.! |....lx =|
|00005990| 20 30 3b 0a 21 20 09 09 | 09 09 67 6f 74 6f 20 61 | 0;.! ..|..goto a|
|000059a0| 74 5f 74 61 72 67 65 74 | 3b 0a 21 20 09 09 09 20 |t_target|;.! ... |
|000059b0| 20 20 20 7d 0a 21 20 09 | 09 09 7d 0a 21 20 09 09 | }.! .|..}.! ..|
|000059c0| 09 64 6f 6d 76 63 75 72 | 28 6c 79 2c 20 6c 78 2c |.domvcur|(ly, lx,|
|000059d0| 20 79 2c 20 63 6c 73 70 | 29 3b 0a 21 20 09 09 09 | y, clsp|);.! ...|
|000059e0| 6c 79 20 3d 20 79 3b 0a | 21 20 09 09 09 6c 78 20 |ly = y;.|! ...lx |
|000059f0| 3d 20 63 6c 73 70 3b 0a | 21 20 09 09 61 74 5f 74 |= clsp;.|! ..at_t|
|00005a00| 61 72 67 65 74 3a 3b 0a | 21 20 23 65 6e 64 69 66 |arget:;.|! #endif|
|00005a10| 0a 21 20 09 09 09 77 68 | 69 6c 65 20 28 77 78 20 |.! ...wh|ile (wx |
|00005a20| 3c 3d 20 6c 63 68 20 26 | 26 20 2a 6e 73 70 20 21 |<= lch &|& *nsp !|
|00005a30| 3d 20 2a 63 73 70 29 20 | 7b 0a 20 20 09 09 09 09 |= *csp) |{. ....|
|00005a40| 69 66 20 28 63 65 20 21 | 3d 20 4e 55 4c 4c 20 26 |if (ce !|= NULL &|
|00005a50| 26 20 77 78 20 3e 3d 20 | 6e 6c 73 70 20 26 26 20 |& wx >= |nlsp && |
|00005a60| 2a 6e 73 70 20 3d 3d 20 | 27 20 27 29 20 7b 0a 2a |*nsp == |' ') {.*|
|00005a70| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 0a 2a |********|******.*|
|00005a80| 2a 2a 20 31 34 37 2c 31 | 34 38 0a 20 20 09 09 09 |** 147,1|48. ...|
|00005a90| 09 69 66 20 28 63 65 20 | 21 3d 20 4e 55 4c 4c 20 |.if (ce |!= NULL |
|00005aa0| 26 26 20 77 78 20 3e 3d | 20 6e 6c 73 70 20 26 26 |&& wx >=| nlsp &&|
|00005ab0| 20 2a 6e 73 70 20 3d 3d | 20 27 20 27 29 20 7b 0a | *nsp ==| ' ') {.|
|00005ac0| 20 20 09 09 09 09 09 2f | 2a 0a 0a 2d 2d 2d 20 32 | ...../|*..--- 2|
|00005ad0| 31 32 2c 32 32 32 20 2d | 2d 2d 2d 2d 0a 20 20 09 |12,222 -|----. .|
|00005ae0| 09 09 09 69 66 20 28 63 | 65 20 21 3d 20 4e 55 4c |...if (c|e != NUL|
|00005af0| 4c 20 26 26 20 77 78 20 | 3e 3d 20 6e 6c 73 70 20 |L && wx |>= nlsp |
|00005b00| 26 26 20 2a 6e 73 70 20 | 3d 3d 20 27 20 27 29 20 |&& *nsp |== ' ') |
|00005b10| 7b 0a 2b 20 23 69 66 6e | 64 65 66 20 73 6c 6f 77 |{.+ #ifn|def slow|
|00005b20| 77 61 79 0a 2b 20 09 09 | 09 09 20 20 20 20 69 66 |way.+ ..|.. if|
|00005b30| 20 28 6e 6c 73 70 20 3c | 20 30 29 20 7b 0a 2b 20 | (nlsp <| 0) {.+ |
|00005b40| 09 09 09 09 09 66 6f 72 | 20 28 6e 6c 73 70 20 3d |.....for| (nlsp =|
|00005b50| 20 77 69 6e 2d 3e 5f 6d | 61 78 78 2d 31 3b 0a 2b | win->_m|axx-1;.+|
|00005b60| 20 09 09 09 09 09 20 20 | 20 20 6e 6c 73 70 20 3e | ..... | nlsp >|
|00005b70| 20 30 20 26 26 20 77 69 | 6e 2d 3e 5f 79 5b 77 79 | 0 && wi|n->_y[wy|
|00005b80| 5d 5b 6e 6c 73 70 5d 3d | 3d 27 20 27 3b 0a 2b 20 |][nlsp]=|=' ';.+ |
|00005b90| 09 09 09 09 09 20 20 20 | 20 6e 6c 73 70 2d 2d 29 |..... | nlsp--)|
|00005ba0| 0a 2b 20 09 09 09 09 09 | 09 3b 0a 2b 20 09 09 09 |.+ .....|.;.+ ...|
|00005bb0| 09 09 63 6f 6e 74 69 6e | 75 65 3b 20 2f 2a 20 67 |..contin|ue; /* g|
|00005bc0| 6f 74 74 61 20 72 65 63 | 68 65 63 6b 20 6e 6c 73 |otta rec|heck nls|
|00005bd0| 70 20 2a 2f 0a 2b 20 09 | 09 09 09 20 20 20 20 7d |p */.+ .|... }|
|00005be0| 0a 2b 20 23 65 6e 64 69 | 66 0a 20 20 09 09 09 09 |.+ #endi|f. ....|
|00005bf0| 09 2f 2a 0a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |./*.****|********|
|00005c00| 2a 2a 2a 0a 2a 2a 2a 20 | 31 36 33 2c 31 36 34 0a |***.*** |163,164.|
|00005c10| 20 20 23 20 65 6e 64 69 | 66 0a 20 20 09 09 09 09 | # endi|f. ....|
|00005c20| 09 09 5f 70 75 74 73 28 | 43 45 29 3b 0a 0a 2d 2d |.._puts(|CE);..--|
|00005c30| 2d 20 32 33 37 2c 32 34 | 35 20 2d 2d 2d 2d 2d 0a |- 237,24|5 -----.|
|00005c40| 20 20 23 20 65 6e 64 69 | 66 0a 2b 20 09 09 09 09 | # endi|f.+ ....|
|00005c50| 09 09 2f 2a 20 69 66 20 | 77 65 20 73 68 6f 75 6c |../* if |we shoul|
|00005c60| 64 6e 27 74 20 6d 6f 76 | 65 20 69 6e 20 73 74 61 |dn't mov|e in sta|
|00005c70| 6e 64 6f 75 74 20 6d 6f | 64 65 2c 20 43 45 20 6d |ndout mo|de, CE m|
|00005c80| 61 79 20 63 61 75 73 65 | 0a 2b 20 09 09 09 09 09 |ay cause|.+ .....|
|00005c90| 09 20 20 20 70 72 6f 62 | 6c 65 6d 73 20 74 6f 6f |. prob|lems too|
|00005ca0| 0a 2b 20 09 09 09 09 09 | 09 2a 2f 0a 2b 20 09 09 |.+ .....|.*/.+ ..|
|00005cb0| 09 09 09 09 69 66 20 28 | 63 75 72 73 63 72 2d 3e |....if (|curscr->|
|00005cc0| 5f 66 6c 61 67 73 20 26 | 20 5f 53 54 41 4e 44 4f |_flags &| _STANDO|
|00005cd0| 55 54 20 26 26 20 21 4d | 53 29 20 7b 0a 2b 20 09 |UT && !M|S) {.+ .|
|00005ce0| 09 09 09 09 09 09 5f 70 | 75 74 73 28 53 45 29 3b |......_p|uts(SE);|
|00005cf0| 0a 2b 20 09 09 09 09 09 | 09 09 63 75 72 73 63 72 |.+ .....|..curscr|
|00005d00| 2d 3e 5f 66 6c 61 67 73 | 20 26 3d 20 7e 5f 53 54 |->_flags| &= ~_ST|
|00005d10| 41 4e 44 4f 55 54 3b 0a | 2b 20 09 09 09 09 09 09 |ANDOUT;.|+ ......|
|00005d20| 7d 0a 20 20 09 09 09 09 | 09 09 5f 70 75 74 73 28 |}. ....|.._puts(|
|00005d30| 43 45 29 3b 0a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |CE);.***|********|
|00005d40| 2a 2a 2a 2a 0a 2a 2a 2a | 20 32 32 36 2c 32 32 38 |****.***| 226,228|
|00005d50| 0a 20 20 09 09 65 6c 73 | 65 20 69 66 20 28 77 78 |. ..els|e if (wx|
|00005d60| 20 3c 20 6c 63 68 29 0a | 21 20 09 09 09 77 68 69 | < lch).|! ...whi|
|00005d70| 6c 65 20 28 2a 6e 73 70 | 20 3d 3d 20 2a 63 73 70 |le (*nsp| == *csp|
|00005d80| 29 20 7b 0a 20 20 09 09 | 09 09 6e 73 70 2b 2b 3b |) {. ..|..nsp++;|
|00005d90| 0a 0a 2d 2d 2d 20 33 30 | 37 2c 33 30 39 20 2d 2d |..--- 30|7,309 --|
|00005da0| 2d 2d 2d 0a 20 20 09 09 | 65 6c 73 65 20 69 66 20 |---. ..|else if |
|00005db0| 28 77 78 20 3c 20 6c 63 | 68 29 0a 21 20 09 09 09 |(wx < lc|h).! ...|
|00005dc0| 77 68 69 6c 65 20 28 77 | 78 20 3c 3d 20 6c 63 68 |while (w|x <= lch|
|00005dd0| 20 26 26 20 2a 6e 73 70 | 20 3d 3d 20 2a 63 73 70 | && *nsp| == *csp|
|00005de0| 29 20 7b 0a 20 20 09 09 | 09 09 6e 73 70 2b 2b 3b |) {. ..|..nsp++;|
|00005df0| 0a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.*******|********|
|00005e00| 0a 2a 2a 2a 20 32 33 39 | 2c 32 34 30 0a 20 20 72 |.*** 239|,240. r|
|00005e10| 65 74 3a 0a 20 20 09 72 | 65 74 75 72 6e 20 4f 4b |et:. .r|eturn OK|
|00005e20| 3b 0a 0a 2d 2d 2d 20 33 | 32 30 2c 33 34 36 20 2d |;..--- 3|20,346 -|
|00005e30| 2d 2d 2d 2d 0a 20 20 72 | 65 74 3a 0a 2b 20 23 69 |----. r|et:.+ #i|
|00005e40| 66 6e 64 65 66 09 77 61 | 6e 74 61 6d 65 73 73 0a |fndef.wa|ntamess.|
|00005e50| 2b 20 09 2f 2a 20 72 74 | 69 2d 73 65 6c 21 74 72 |+ ./* rt|i-sel!tr|
|00005e60| 74 3a 20 75 70 64 61 74 | 65 20 63 75 72 73 6f 72 |t: updat|e cursor|
|00005e70| 20 6c 6f 63 61 74 69 6f | 6e 20 6f 6e 20 61 75 74 | locatio|n on aut|
|00005e80| 6f 2d 77 72 61 70 20 2a | 2f 0a 2b 20 09 69 66 20 |o-wrap *|/.+ .if |
|00005e90| 28 6c 78 20 3e 3d 20 43 | 4f 4c 53 29 20 7b 0a 2b |(lx >= C|OLS) {.+|
|00005ea0| 20 09 09 69 66 20 28 58 | 4e 29 20 7b 09 2f 2a 20 | ..if (X|N) {./* |
|00005eb0| 6d 61 6b 65 20 74 68 69 | 73 20 63 61 73 65 20 6c |make thi|s case l|
|00005ec0| 69 6b 65 20 74 68 65 20 | 75 73 75 61 6c 20 6f 6e |ike the |usual on|
|00005ed0| 65 20 2a 2f 0a 2b 20 09 | 09 09 69 66 20 28 63 75 |e */.+ .|..if (cu|
|00005ee0| 72 73 63 72 2d 3e 5f 66 | 6c 61 67 73 20 26 20 5f |rscr->_f|lags & _|
|00005ef0| 53 54 41 4e 44 4f 55 54 | 20 26 26 20 21 4d 53 29 |STANDOUT| && !MS)|
|00005f00| 20 7b 0a 2b 20 09 09 09 | 09 5f 70 75 74 73 28 53 | {.+ ...|._puts(S|
|00005f10| 45 29 3b 0a 2b 20 09 09 | 09 09 63 75 72 73 63 72 |E);.+ ..|..curscr|
|00005f20| 2d 3e 5f 66 6c 61 67 73 | 20 26 3d 20 7e 5f 53 54 |->_flags| &= ~_ST|
|00005f30| 41 4e 44 4f 55 54 3b 0a | 2b 20 09 09 09 7d 0a 2b |ANDOUT;.|+ ...}.+|
|00005f40| 20 09 09 09 70 75 74 63 | 68 61 72 28 27 5c 72 27 | ...putc|har('\r'|
|00005f50| 29 3b 0a 2b 20 09 09 09 | 70 75 74 63 68 61 72 28 |);.+ ...|putchar(|
|00005f60| 27 5c 6e 27 29 3b 0a 2b | 20 09 09 09 67 6c 69 74 |'\n');.+| ...glit|
|00005f70| 63 68 58 4e 2b 2b 3b 09 | 2f 2a 20 6e 65 78 74 20 |chXN++;.|/* next |
|00005f80| 63 68 61 72 20 6d 75 73 | 74 20 6e 6f 74 20 62 65 |char mus|t not be|
|00005f90| 20 69 6e 20 63 6f 6c 20 | 38 30 20 2a 2f 0a 2b 20 | in col |80 */.+ |
|00005fa0| 09 09 7d 0a 2b 20 09 09 | 6c 78 20 3d 20 30 3b 0a |..}.+ ..|lx = 0;.|
|00005fb0| 2b 20 09 09 69 66 20 28 | 6c 79 20 3c 20 4c 49 4e |+ ..if (|ly < LIN|
|00005fc0| 45 53 2d 31 29 0a 2b 20 | 09 09 09 6c 79 2b 2b 3b |ES-1).+ |...ly++;|
|00005fd0| 0a 2b 20 09 09 65 6c 73 | 65 20 7b 0a 2b 20 09 09 |.+ ..els|e {.+ ..|
|00005fe0| 09 2f 2a 20 61 74 20 74 | 68 69 73 20 70 6f 69 6e |./* at t|his poin|
|00005ff0| 74 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 73 63 |t the cu|rrent sc|
|00006000| 72 65 65 6e 20 73 63 72 | 6f 6c 6c 65 64 20 75 70 |reen scr|olled up|
|00006010| 2e 0a 2b 20 09 09 09 20 | 2a 20 73 63 72 6f 6c 6c |..+ ... |* scroll|
|00006020| 28 29 20 69 73 20 73 74 | 72 61 6e 67 65 2c 20 73 |() is st|range, s|
|00006030| 6f 20 77 65 20 73 69 6d | 75 6c 61 74 65 20 69 74 |o we sim|ulate it|
|00006040| 20 62 79 20 68 61 6e 64 | 2e 0a 2b 20 09 09 09 20 | by hand|..+ ... |
|00006050| 2a 20 43 75 72 73 65 73 | 20 73 68 6f 75 6c 64 20 |* Curses| should |
|00006060| 70 72 6f 62 61 62 6c 79 | 20 6e 6f 74 20 70 75 74 |probably| not put|
|00006070| 20 61 6e 79 74 68 69 6e | 67 20 69 6e 20 6c 6f 77 | anythin|g in low|
|00006080| 65 72 0a 2b 20 09 09 09 | 20 2a 20 72 69 67 68 74 |er.+ ...| * right|
|00006090| 20 63 6f 72 6e 65 72 20 | 6f 66 20 73 63 72 65 65 | corner |of scree|
|000060a0| 6e 2c 20 61 6e 64 20 74 | 68 75 73 20 61 76 6f 69 |n, and t|hus avoi|
|000060b0| 64 20 74 68 69 73 20 6d | 65 73 73 20 2a 2f 0a 2b |d this m|ess */.+|
|000060c0| 20 09 09 09 77 6d 6f 76 | 65 28 63 75 72 73 63 72 | ...wmov|e(curscr|
|000060d0| 2c 20 30 2c 20 30 29 3b | 20 77 64 65 6c 65 74 65 |, 0, 0);| wdelete|
|000060e0| 6c 6e 28 63 75 72 73 63 | 72 29 3b 0a 2b 20 09 09 |ln(cursc|r);.+ ..|
|000060f0| 09 77 6d 6f 76 65 28 63 | 75 72 73 63 72 2c 20 6c |.wmove(c|urscr, l|
|00006100| 79 2c 20 6c 78 29 3b 0a | 2b 20 09 09 7d 0a 2b 20 |y, lx);.|+ ..}.+ |
|00006110| 09 7d 0a 2b 20 23 65 6e | 64 69 66 0a 20 20 09 72 |.}.+ #en|dif. .r|
|00006120| 65 74 75 72 6e 20 4f 4b | 3b 0a 53 48 41 52 5f 45 |eturn OK|;.SHAR_E|
|00006130| 4f 46 0a 69 66 20 74 65 | 73 74 20 34 38 38 34 20 |OF.if te|st 4884 |
|00006140| 2d 6e 65 20 22 60 77 63 | 20 2d 63 20 3c 20 27 72 |-ne "`wc| -c < 'r|
|00006150| 65 66 72 65 73 68 2e 63 | 2e 70 61 74 27 60 22 0a |efresh.c|.pat'`".|
|00006160| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00006170| 20 65 72 72 6f 72 20 74 | 72 61 6e 73 6d 69 74 74 | error t|ransmitt|
|00006180| 69 6e 67 20 22 27 72 65 | 66 72 65 73 68 2e 63 2e |ing "'re|fresh.c.|
|00006190| 70 61 74 27 22 20 27 28 | 73 68 6f 75 6c 64 20 68 |pat'" '(|should h|
|000061a0| 61 76 65 20 62 65 65 6e | 20 34 38 38 34 20 63 68 |ave been| 4884 ch|
|000061b0| 61 72 61 63 74 65 72 73 | 29 27 0a 66 69 0a 66 69 |aracters|)'.fi.fi|
|000061c0| 20 23 20 65 6e 64 20 6f | 66 20 6f 76 65 72 77 72 | # end o|f overwr|
|000061d0| 69 74 69 6e 67 20 63 68 | 65 63 6b 0a 65 63 68 6f |iting ch|eck.echo|
|000061e0| 20 73 68 61 72 3a 20 65 | 78 74 72 61 63 74 69 6e | shar: e|xtractin|
|000061f0| 67 20 22 27 74 73 74 70 | 2e 63 2e 6e 65 77 27 22 |g "'tstp|.c.new'"|
|00006200| 20 27 28 38 34 31 20 63 | 68 61 72 61 63 74 65 72 | '(841 c|haracter|
|00006210| 73 29 27 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |s)'.if t|est -f '|
|00006220| 74 73 74 70 2e 63 2e 6e | 65 77 27 0a 74 68 65 6e |tstp.c.n|ew'.then|
|00006230| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 77 69 6c |..echo s|har: wil|
|00006240| 6c 20 6e 6f 74 20 6f 76 | 65 72 2d 77 72 69 74 65 |l not ov|er-write|
|00006250| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 22 | existin|g file "|
|00006260| 27 74 73 74 70 2e 63 2e | 6e 65 77 27 22 0a 65 6c |'tstp.c.|new'".el|
|00006270| 73 65 0a 73 65 64 20 27 | 73 2f 5e 58 2f 2f 27 20 |se.sed '|s/^X//' |
|00006280| 3c 3c 20 5c 53 48 41 52 | 5f 45 4f 46 20 3e 20 27 |<< \SHAR|_EOF > '|
|00006290| 74 73 74 70 2e 63 2e 6e | 65 77 27 0a 23 20 69 6e |tstp.c.n|ew'.# in|
|000062a0| 63 6c 75 64 65 09 3c 73 | 69 67 6e 61 6c 2e 68 3e |clude.<s|ignal.h>|
|000062b0| 0a 0a 23 20 69 6e 63 6c | 75 64 65 09 22 63 75 72 |..# incl|ude."cur|
|000062c0| 73 65 73 2e 65 78 74 22 | 0a 0a 2f 2a 0a 20 2a 20 |ses.ext"|../*. * |
|000062d0| 68 61 6e 64 6c 65 20 73 | 74 6f 70 20 61 6e 64 20 |handle s|top and |
|000062e0| 73 74 61 72 74 20 73 69 | 67 6e 61 6c 73 0a 20 2a |start si|gnals. *|
|000062f0| 0a 20 2a 20 36 2f 32 35 | 2f 38 33 20 28 42 65 72 |. * 6/25|/83 (Ber|
|00006300| 6b 65 6c 65 79 29 20 40 | 28 23 29 74 73 74 70 2e |keley) @|(#)tstp.|
|00006310| 63 09 31 2e 33 0a 20 2a | 2f 0a 74 73 74 70 28 29 |c.1.3. *|/.tstp()|
|00006320| 20 7b 0a 0a 23 20 69 66 | 64 65 66 20 53 49 47 54 | {..# if|def SIGT|
|00006330| 53 54 50 0a 0a 09 69 6e | 74 20 74 74 79 66 6c 61 |STP...in|t ttyfla|
|00006340| 67 73 3b 0a 09 69 6e 74 | 09 6f 6d 61 73 6b 3b 0a |gs;..int|.omask;.|
|00006350| 23 20 69 66 64 65 66 20 | 44 45 42 55 47 0a 09 69 |# ifdef |DEBUG..i|
|00006360| 66 20 28 6f 75 74 66 29 | 0a 09 09 66 66 6c 75 73 |f (outf)|...fflus|
|00006370| 68 28 6f 75 74 66 29 3b | 0a 23 20 65 6e 64 69 66 |h(outf);|.# endif|
|00006380| 0a 09 74 74 79 66 6c 61 | 67 73 20 3d 20 5f 74 74 |..ttyfla|gs = _tt|
|00006390| 79 2e 73 67 5f 66 6c 61 | 67 73 3b 09 2f 2a 20 73 |y.sg_fla|gs;./* s|
|000063a0| 74 6f 72 65 20 63 75 72 | 73 65 73 20 73 74 61 74 |tore cur|ses stat|
|000063b0| 65 20 2a 2f 0a 09 6d 76 | 63 75 72 28 30 2c 20 43 |e */..mv|cur(0, C|
|000063c0| 4f 4c 53 20 2d 20 31 2c | 20 4c 49 4e 45 53 20 2d |OLS - 1,| LINES -|
|000063d0| 20 31 2c 20 30 29 3b 0a | 09 65 6e 64 77 69 6e 28 | 1, 0);.|.endwin(|
|000063e0| 29 3b 0a 09 66 66 6c 75 | 73 68 28 73 74 64 6f 75 |);..fflu|sh(stdou|
|000063f0| 74 29 3b 0a 09 2f 2a 20 | 72 65 73 65 74 20 73 69 |t);../* |reset si|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.