home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume1 / 8710 / pc-curses-doc / 2 < prev    next >
SHell self-extracting ARchive  |  1993-09-02  |  38.0 KB

view JSON data     |     view as text     |     open on a Mac     |     open on a PC

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

You can browse this item here: 2

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail, ASCII text default
100% 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 73 74 | 65 76 65 40 63 69 74 35 |From: st|eve@cit5|
|00000010| 2e 63 69 74 2e 6f 7a 2e | 41 55 20 28 53 74 65 76 |.cit.oz.|AU (Stev|
|00000020| 65 20 42 61 6c 6f 67 68 | 29 0a 4e 65 77 73 67 72 |e Balogh|).Newsgr|
|00000030| 6f 75 70 73 3a 20 63 6f | 6d 70 2e 73 6f 75 72 63 |oups: co|mp.sourc|
|00000040| 65 73 2e 6d 69 73 63 0a | 53 75 62 6a 65 63 74 3a |es.misc.|Subject:|
|00000050| 20 50 43 20 63 75 72 73 | 65 73 20 6d 61 6e 75 61 | PC curs|es manua|
|00000060| 6c 20 70 61 67 65 73 20 | 2d 20 50 61 72 74 20 32 |l pages |- Part 2|
|00000070| 2f 34 0a 4d 65 73 73 61 | 67 65 2d 49 44 3a 20 3c |/4.Messa|ge-ID: <|
|00000080| 31 30 35 30 40 62 61 73 | 73 65 72 2e 6f 7a 3e 0a |1050@bas|ser.oz>.|
|00000090| 44 61 74 65 3a 20 39 20 | 4f 63 74 20 38 37 20 31 |Date: 9 |Oct 87 1|
|000000a0| 35 3a 31 36 3a 31 38 20 | 47 4d 54 0a 53 65 6e 64 |5:16:18 |GMT.Send|
|000000b0| 65 72 3a 20 6a 6f 68 6e | 40 62 61 73 73 65 72 2e |er: john|@basser.|
|000000c0| 6f 7a 0a 4c 69 6e 65 73 | 3a 20 31 33 32 34 0a 41 |oz.Lines|: 1324.A|
|000000d0| 70 70 72 6f 76 65 64 3a | 20 6a 6f 68 6e 40 62 61 |pproved:| john@ba|
|000000e0| 73 73 65 72 2e 63 73 2e | 73 75 2e 6f 7a 2e 41 55 |sser.cs.|su.oz.AU|
|000000f0| 0a 58 2d 41 72 63 68 69 | 76 65 3a 20 63 6f 6d 70 |.X-Archi|ve: comp|
|00000100| 2e 73 6f 75 72 63 65 73 | 2e 6d 69 73 63 2f 38 37 |.sources|.misc/87|
|00000110| 31 30 2f 70 63 2d 63 75 | 72 73 65 73 2d 64 6f 63 |10/pc-cu|rses-doc|
|00000120| 2f 32 0a 0a 23 21 20 2f | 62 69 6e 2f 73 68 0a 23 |/2..#! /|bin/sh.#|
|00000130| 20 54 68 69 73 20 69 73 | 20 61 20 73 68 65 6c 6c | This is| a shell|
|00000140| 20 61 72 63 68 69 76 65 | 2c 20 6d 65 61 6e 69 6e | archive|, meanin|
|00000150| 67 3a 0a 23 20 31 2e 20 | 52 65 6d 6f 76 65 20 65 |g:.# 1. |Remove e|
|00000160| 76 65 72 79 74 68 69 6e | 67 20 61 62 6f 76 65 20 |verythin|g above |
|00000170| 74 68 65 20 23 21 20 2f | 62 69 6e 2f 73 68 20 6c |the #! /|bin/sh l|
|00000180| 69 6e 65 2e 0a 23 20 32 | 2e 20 53 61 76 65 20 74 |ine..# 2|. Save t|
|00000190| 68 65 20 72 65 73 75 6c | 74 69 6e 67 20 74 65 78 |he resul|ting tex|
|000001a0| 74 20 69 6e 20 61 20 66 | 69 6c 65 2e 0a 23 20 33 |t in a f|ile..# 3|
|000001b0| 2e 20 45 78 65 63 75 74 | 65 20 74 68 65 20 66 69 |. Execut|e the fi|
|000001c0| 6c 65 20 77 69 74 68 20 | 2f 62 69 6e 2f 73 68 20 |le with |/bin/sh |
|000001d0| 28 6e 6f 74 20 63 73 68 | 29 20 74 6f 20 63 72 65 |(not csh|) to cre|
|000001e0| 61 74 65 20 74 68 65 20 | 66 69 6c 65 73 2e 0a 23 |ate the |files..#|
|000001f0| 20 54 68 69 73 20 61 72 | 63 68 69 76 65 20 63 72 | This ar|chive cr|
|00000200| 65 61 74 65 64 3a 20 57 | 65 64 20 4f 63 74 20 20 |eated: W|ed Oct |
|00000210| 37 20 31 37 3a 35 31 3a | 31 33 20 45 53 54 20 31 |7 17:51:|13 EST 1|
|00000220| 39 38 37 0a 23 20 41 72 | 63 68 69 76 65 64 20 62 |987.# Ar|chived b|
|00000230| 79 3a 20 53 74 65 76 65 | 20 42 61 6c 6f 67 68 20 |y: Steve| Balogh |
|00000240| 2d 20 73 74 65 76 65 25 | 63 69 74 35 2e 63 69 74 |- steve%|cit5.cit|
|00000250| 2e 6f 7a 40 75 75 6e 65 | 74 2e 75 75 2e 6e 65 74 |.oz@uune|t.uu.net|
|00000260| 0a 65 78 70 6f 72 74 20 | 50 41 54 48 3b 20 50 41 |.export |PATH; PA|
|00000270| 54 48 3d 2f 62 69 6e 3a | 24 50 41 54 48 0a 65 63 |TH=/bin:|$PATH.ec|
|00000280| 68 6f 20 73 68 61 72 3a | 20 65 78 74 72 61 63 74 |ho shar:| extract|
|00000290| 69 6e 67 20 22 27 61 64 | 64 63 68 2e 6d 27 22 20 |ing "'ad|dch.m'" |
|000002a0| 27 28 31 31 35 37 20 63 | 68 61 72 61 63 74 65 72 |'(1157 c|haracter|
|000002b0| 73 29 27 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |s)'.if t|est -f '|
|000002c0| 61 64 64 63 68 2e 6d 27 | 0a 74 68 65 6e 0a 09 65 |addch.m'|.then..e|
|000002d0| 63 68 6f 20 73 68 61 72 | 3a 20 77 69 6c 6c 20 6e |cho shar|: will n|
|000002e0| 6f 74 20 6f 76 65 72 2d | 77 72 69 74 65 20 65 78 |ot over-|write ex|
|000002f0| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 22 27 61 64 |isting f|ile "'ad|
|00000300| 64 63 68 2e 6d 27 22 0a | 65 6c 73 65 0a 73 65 64 |dch.m'".|else.sed|
|00000310| 20 27 73 2f 5e 58 2f 2f | 27 20 3c 3c 20 5c 53 48 | 's/^X//|' << \SH|
|00000320| 41 52 5f 45 4f 46 20 3e | 20 27 61 64 64 63 68 2e |AR_EOF >| 'addch.|
|00000330| 6d 27 0a 58 4e 41 4d 45 | 0a 58 09 6e 65 77 6c 69 |m'.XNAME|.X.newli|
|00000340| 6e 65 28 29 20 2d 20 6c | 69 6e 65 20 61 64 76 61 |ne() - l|ine adva|
|00000350| 6e 63 65 0a 58 09 77 61 | 64 64 63 68 28 29 20 61 |nce.X.wa|ddch() a|
|00000360| 64 64 63 68 28 29 20 6d | 76 61 64 64 63 68 28 29 |ddch() m|vaddch()|
|00000370| 20 6d 76 77 61 64 64 63 | 68 28 29 20 2d 20 69 6e | mvwaddc|h() - in|
|00000380| 73 65 72 74 20 61 20 63 | 68 61 72 61 63 74 65 72 |sert a c|haracter|
|00000390| 0a 58 0a 58 53 59 4e 4f | 50 53 49 53 0a 58 09 23 |.X.XSYNO|PSIS.X.#|
|000003a0| 69 6e 63 6c 75 64 65 20 | 3c 63 75 72 73 65 73 2e |include |<curses.|
|000003b0| 68 3e 0a 58 09 23 69 6e | 63 6c 75 64 65 20 3c 63 |h>.X.#in|clude <c|
|000003c0| 75 72 73 70 72 69 76 2e | 68 3e 0a 58 0a 58 09 73 |urspriv.|h>.X.X.s|
|000003d0| 74 61 74 69 63 20 73 68 | 6f 72 74 20 6e 65 77 6c |tatic sh|ort newl|
|000003e0| 69 6e 65 28 77 69 6e 2c | 20 6c 69 6e 29 0a 58 09 |ine(win,| lin).X.|
|000003f0| 57 49 4e 44 4f 57 20 2a | 77 69 6e 3b 0a 58 09 73 |WINDOW *|win;.X.s|
|00000400| 68 6f 72 74 20 6c 69 6e | 3b 0a 58 0a 58 09 69 6e |hort lin|;.X.X.in|
|00000410| 74 20 77 61 64 64 63 68 | 28 77 69 6e 2c 20 63 29 |t waddch|(win, c)|
|00000420| 0a 58 09 72 65 67 69 73 | 74 65 72 20 57 49 4e 44 |.X.regis|ter WIND|
|00000430| 4f 57 20 2a 77 69 6e 3b | 0a 58 09 63 68 61 72 20 |OW *win;|.X.char |
|00000440| 63 3b 0a 58 0a 58 09 69 | 6e 74 20 61 64 64 63 68 |c;.X.X.i|nt addch|
|00000450| 28 63 29 0a 58 09 63 68 | 61 72 20 63 3b 0a 58 0a |(c).X.ch|ar c;.X.|
|00000460| 58 09 69 6e 74 20 6d 76 | 61 64 64 63 68 28 79 2c |X.int mv|addch(y,|
|00000470| 78 2c 63 29 0a 58 09 69 | 6e 74 20 78 3b 0a 58 09 |x,c).X.i|nt x;.X.|
|00000480| 69 6e 74 20 79 3b 0a 58 | 09 63 68 61 72 20 63 3b |int y;.X|.char c;|
|00000490| 0a 58 0a 58 09 69 6e 74 | 20 6d 76 77 61 64 64 63 |.X.X.int| mvwaddc|
|000004a0| 68 28 77 69 6e 2c 79 2c | 78 2c 63 29 0a 58 09 57 |h(win,y,|x,c).X.W|
|000004b0| 49 4e 44 4f 57 20 2a 77 | 69 6e 3b 0a 58 09 69 6e |INDOW *w|in;.X.in|
|000004c0| 74 20 78 3b 0a 58 09 69 | 6e 74 20 79 3b 0a 58 09 |t x;.X.i|nt y;.X.|
|000004d0| 63 68 61 72 20 63 3b 0a | 58 0a 58 44 45 53 43 52 |char c;.|X.XDESCR|
|000004e0| 49 50 54 49 4f 4e 0a 58 | 09 6e 65 77 6c 69 6e 65 |IPTION.X|.newline|
|000004f0| 28 29 20 64 6f 65 73 20 | 6c 69 6e 65 20 61 64 76 |() does |line adv|
|00000500| 61 6e 63 65 20 61 6e 64 | 20 72 65 74 75 72 6e 73 |ance and| returns|
|00000510| 20 74 68 65 20 6e 65 77 | 20 63 75 72 73 6f 72 20 | the new| cursor |
|00000520| 6c 69 6e 65 2e 20 20 0a | 58 09 49 66 20 65 72 72 |line. .|X.If err|
|00000530| 6f 72 2c 20 72 65 74 75 | 72 6e 20 2d 31 2e 20 20 |or, retu|rn -1. |
|00000540| 0a 58 0a 58 09 77 61 64 | 64 63 68 28 29 20 69 6e |.X.X.wad|dch() in|
|00000550| 73 65 72 74 73 20 63 68 | 61 72 61 63 74 65 72 20 |serts ch|aracter |
|00000560| 27 63 27 20 61 74 20 74 | 68 65 20 63 75 72 72 65 |'c' at t|he curre|
|00000570| 6e 74 20 63 75 72 73 6f | 72 20 70 6f 73 69 2d 20 |nt curso|r posi- |
|00000580| 20 0a 58 09 74 69 6f 6e | 20 69 6e 20 77 69 6e 64 | .X.tion| in wind|
|00000590| 6f 77 20 27 77 69 6e 27 | 2c 20 61 6e 64 20 74 61 |ow 'win'|, and ta|
|000005a0| 6b 65 73 20 61 6e 79 20 | 61 63 74 69 6f 6e 73 20 |kes any |actions |
|000005b0| 61 73 20 64 69 63 74 61 | 74 65 64 20 62 79 20 20 |as dicta|ted by |
|000005c0| 0a 58 09 74 68 65 20 63 | 68 61 72 61 63 74 65 72 |.X.the c|haracter|
|000005d0| 2e 20 20 0a 58 0a 58 09 | 61 64 64 63 68 28 29 20 |. .X.X.|addch() |
|000005e0| 69 6e 73 65 72 74 73 20 | 63 68 61 72 61 63 74 65 |inserts |characte|
|000005f0| 72 20 27 63 27 20 61 74 | 20 74 68 65 20 63 75 72 |r 'c' at| the cur|
|00000600| 72 65 6e 74 20 63 75 72 | 73 6f 72 20 70 6f 73 69 |rent cur|sor posi|
|00000610| 2d 20 20 0a 58 09 74 69 | 6f 6e 20 69 6e 20 73 74 |- .X.ti|on in st|
|00000620| 64 73 63 72 2c 20 61 6e | 64 20 74 61 6b 65 73 20 |dscr, an|d takes |
|00000630| 61 6e 79 20 61 63 74 69 | 6f 6e 73 20 61 73 20 64 |any acti|ons as d|
|00000640| 69 63 74 61 74 65 64 20 | 62 79 20 74 68 65 20 20 |ictated |by the |
|00000650| 0a 58 09 63 68 61 72 61 | 63 74 65 72 2e 20 20 0a |.X.chara|cter. .|
|00000660| 58 0a 58 09 6d 76 61 64 | 64 63 68 28 29 20 6d 6f |X.X.mvad|dch() mo|
|00000670| 76 65 73 20 74 6f 20 70 | 6f 73 69 74 69 6f 6e 20 |ves to p|osition |
|00000680| 69 6e 20 73 74 64 73 63 | 72 2c 20 74 68 65 6e 20 |in stdsc|r, then |
|00000690| 69 6e 73 65 72 74 73 20 | 63 68 61 72 61 63 2d 20 |inserts |charac- |
|000006a0| 20 0a 58 09 74 65 72 20 | 27 63 27 20 61 74 20 74 | .X.ter |'c' at t|
|000006b0| 68 61 74 20 70 6f 69 6e | 74 2c 20 61 6e 64 20 74 |hat poin|t, and t|
|000006c0| 61 6b 65 73 20 61 6e 79 | 20 61 63 74 69 6f 6e 73 |akes any| actions|
|000006d0| 20 61 73 20 64 69 63 74 | 61 74 65 64 20 62 79 20 | as dict|ated by |
|000006e0| 20 0a 58 09 74 68 65 20 | 63 68 61 72 61 63 74 65 | .X.the |characte|
|000006f0| 72 2e 20 20 0a 58 0a 58 | 09 6d 76 77 61 64 64 63 |r. .X.X|.mvwaddc|
|00000700| 68 28 29 20 6d 6f 76 65 | 73 20 74 6f 20 70 6f 73 |h() move|s to pos|
|00000710| 69 74 69 6f 6e 20 69 6e | 20 77 69 6e 64 6f 77 20 |ition in| window |
|00000720| 27 77 69 6e 27 2c 20 74 | 68 65 6e 20 69 6e 73 65 |'win', t|hen inse|
|00000730| 72 74 73 20 20 0a 58 09 | 63 68 61 72 61 63 74 65 |rts .X.|characte|
|00000740| 72 20 27 63 27 20 61 74 | 20 74 68 61 74 20 70 6f |r 'c' at| that po|
|00000750| 69 6e 74 20 69 6e 20 74 | 68 65 20 77 69 6e 64 6f |int in t|he windo|
|00000760| 77 2c 20 61 6e 64 20 74 | 61 6b 65 73 20 61 6e 79 |w, and t|akes any|
|00000770| 20 20 0a 58 09 61 63 74 | 69 6f 6e 73 20 61 73 20 | .X.act|ions as |
|00000780| 64 69 63 74 61 74 65 64 | 20 62 79 20 74 68 65 20 |dictated| by the |
|00000790| 63 68 61 72 61 63 74 65 | 72 2e 20 20 0a 58 0a 58 |characte|r. .X.X|
|000007a0| 45 58 41 4d 50 4c 45 53 | 0a 58 0a 58 53 45 45 20 |EXAMPLES|.X.XSEE |
|000007b0| 41 4c 53 4f 0a 58 09 73 | 63 72 6f 6c 6c 28 29 2c |ALSO.X.s|croll(),|
|000007c0| 20 73 77 69 74 63 68 28 | 29 2c 20 77 61 64 64 63 | switch(|), waddc|
|000007d0| 68 28 29 2c 20 6e 65 77 | 6c 69 6e 65 28 29 2c 20 |h(), new|line(), |
|000007e0| 77 6d 6f 76 65 28 29 0a | 58 0a 58 42 55 47 53 0a |wmove().|X.XBUGS.|
|000007f0| 53 48 41 52 5f 45 4f 46 | 0a 69 66 20 74 65 73 74 |SHAR_EOF|.if test|
|00000800| 20 31 31 35 37 20 2d 6e | 65 20 22 60 77 63 20 2d | 1157 -n|e "`wc -|
|00000810| 63 20 3c 20 27 61 64 64 | 63 68 2e 6d 27 60 22 0a |c < 'add|ch.m'`".|
|00000820| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00000830| 20 65 72 72 6f 72 20 74 | 72 61 6e 73 6d 69 74 74 | error t|ransmitt|
|00000840| 69 6e 67 20 22 27 61 64 | 64 63 68 2e 6d 27 22 20 |ing "'ad|dch.m'" |
|00000850| 27 28 73 68 6f 75 6c 64 | 20 68 61 76 65 20 62 65 |'(should| have be|
|00000860| 65 6e 20 31 31 35 37 20 | 63 68 61 72 61 63 74 65 |en 1157 |characte|
|00000870| 72 73 29 27 0a 66 69 0a | 66 69 20 23 20 65 6e 64 |rs)'.fi.|fi # end|
|00000880| 20 6f 66 20 6f 76 65 72 | 77 72 69 74 69 6e 67 20 | of over|writing |
|00000890| 63 68 65 63 6b 0a 65 63 | 68 6f 20 73 68 61 72 3a |check.ec|ho shar:|
|000008a0| 20 65 78 74 72 61 63 74 | 69 6e 67 20 22 27 61 64 | extract|ing "'ad|
|000008b0| 64 73 74 72 2e 6d 27 22 | 20 27 28 39 37 37 20 63 |dstr.m'"| '(977 c|
|000008c0| 68 61 72 61 63 74 65 72 | 73 29 27 0a 69 66 20 74 |haracter|s)'.if t|
|000008d0| 65 73 74 20 2d 66 20 27 | 61 64 64 73 74 72 2e 6d |est -f '|addstr.m|
|000008e0| 27 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |'.then..|echo sha|
|000008f0| 72 3a 20 77 69 6c 6c 20 | 6e 6f 74 20 6f 76 65 72 |r: will |not over|
|00000900| 2d 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 20 |-write e|xisting |
|00000910| 66 69 6c 65 20 22 27 61 | 64 64 73 74 72 2e 6d 27 |file "'a|ddstr.m'|
|00000920| 22 0a 65 6c 73 65 0a 73 | 65 64 20 27 73 2f 5e 58 |".else.s|ed 's/^X|
|00000930| 2f 2f 27 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |//' << \|SHAR_EOF|
|00000940| 20 3e 20 27 61 64 64 73 | 74 72 2e 6d 27 0a 58 4e | > 'adds|tr.m'.XN|
|00000950| 41 4d 45 0a 58 09 77 61 | 64 64 73 74 72 28 29 20 |AME.X.wa|ddstr() |
|00000960| 61 64 64 73 74 72 28 29 | 20 6d 76 61 64 64 73 74 |addstr()| mvaddst|
|00000970| 72 28 29 20 6d 76 77 61 | 64 64 73 74 72 28 29 20 |r() mvwa|ddstr() |
|00000980| 2d 20 69 6e 73 65 72 74 | 20 61 20 73 74 72 69 6e |- insert| a strin|
|00000990| 67 0a 58 0a 58 53 59 4e | 4f 50 53 49 53 0a 58 09 |g.X.XSYN|OPSIS.X.|
|000009a0| 23 69 6e 63 6c 75 64 65 | 20 3c 63 75 72 73 65 73 |#include| <curses|
|000009b0| 2e 68 3e 0a 58 09 23 69 | 6e 63 6c 75 64 65 20 3c |.h>.X.#i|nclude <|
|000009c0| 63 75 72 73 70 72 69 76 | 2e 68 3e 0a 58 0a 58 09 |curspriv|.h>.X.X.|
|000009d0| 69 6e 74 20 77 61 64 64 | 73 74 72 28 77 69 6e 2c |int wadd|str(win,|
|000009e0| 20 73 74 72 29 0a 58 09 | 57 49 4e 44 4f 57 20 2a | str).X.|WINDOW *|
|000009f0| 77 69 6e 3b 20 0a 58 09 | 63 68 61 72 20 2a 73 74 |win; .X.|char *st|
|00000a00| 72 3b 0a 58 0a 58 09 69 | 6e 74 20 61 64 64 73 74 |r;.X.X.i|nt addst|
|00000a10| 72 28 73 74 72 29 0a 58 | 09 63 68 61 72 20 2a 73 |r(str).X|.char *s|
|00000a20| 74 72 3b 0a 58 0a 58 09 | 69 6e 74 20 6d 76 61 64 |tr;.X.X.|int mvad|
|00000a30| 64 73 74 72 28 79 2c 78 | 2c 73 74 72 29 0a 58 09 |dstr(y,x|,str).X.|
|00000a40| 69 6e 74 20 79 3b 0a 58 | 09 69 6e 74 20 78 3b 0a |int y;.X|.int x;.|
|00000a50| 58 09 63 68 61 72 20 2a | 73 74 72 3b 0a 58 0a 58 |X.char *|str;.X.X|
|00000a60| 09 69 6e 74 20 6d 76 77 | 61 64 64 73 74 72 28 77 |.int mvw|addstr(w|
|00000a70| 69 6e 2c 79 2c 78 2c 73 | 74 72 29 0a 58 09 57 49 |in,y,x,s|tr).X.WI|
|00000a80| 4e 44 4f 57 20 2a 77 69 | 6e 3b 0a 58 09 69 6e 74 |NDOW *wi|n;.X.int|
|00000a90| 20 79 3b 0a 58 09 69 6e | 74 20 78 3b 0a 58 09 63 | y;.X.in|t x;.X.c|
|00000aa0| 68 61 72 20 2a 73 74 72 | 3b 0a 58 0a 58 44 45 53 |har *str|;.X.XDES|
|00000ab0| 43 52 49 50 54 49 4f 4e | 0a 58 09 77 61 64 64 73 |CRIPTION|.X.wadds|
|00000ac0| 74 72 28 29 20 69 6e 73 | 65 72 74 73 20 73 74 72 |tr() ins|erts str|
|00000ad0| 69 6e 67 20 27 73 74 72 | 27 20 61 74 20 74 68 65 |ing 'str|' at the|
|00000ae0| 20 63 75 72 72 65 6e 74 | 20 63 75 72 73 6f 72 20 | current| cursor |
|00000af0| 70 6f 73 69 2d 20 20 0a | 58 09 74 69 6f 6e 20 69 |posi- .|X.tion i|
|00000b00| 6e 20 77 69 6e 64 6f 77 | 20 27 77 69 6e 27 2c 20 |n window| 'win', |
|00000b10| 61 6e 64 20 74 61 6b 65 | 73 20 61 6e 79 20 61 63 |and take|s any ac|
|00000b20| 74 69 6f 6e 73 20 61 73 | 20 64 69 63 74 61 74 65 |tions as| dictate|
|00000b30| 64 20 62 79 20 20 0a 58 | 09 74 68 65 20 63 68 61 |d by .X|.the cha|
|00000b40| 72 61 63 74 65 72 73 2e | 20 20 0a 58 0a 58 09 61 |racters.| .X.X.a|
|00000b50| 64 64 73 74 72 28 29 20 | 69 6e 73 65 72 74 73 20 |ddstr() |inserts |
|00000b60| 73 74 72 69 6e 67 20 27 | 73 74 72 27 20 61 74 20 |string '|str' at |
|00000b70| 74 68 65 20 63 75 72 72 | 65 6e 74 20 63 75 72 73 |the curr|ent curs|
|00000b80| 6f 72 20 70 6f 73 69 2d | 20 20 0a 58 09 74 69 6f |or posi-| .X.tio|
|00000b90| 6e 20 69 6e 20 73 74 64 | 73 63 72 2c 20 61 6e 64 |n in std|scr, and|
|00000ba0| 20 74 61 6b 65 73 20 61 | 6e 79 20 61 63 74 69 6f | takes a|ny actio|
|00000bb0| 6e 73 20 61 73 20 64 69 | 63 74 61 74 65 64 20 62 |ns as di|ctated b|
|00000bc0| 79 20 74 68 65 20 20 0a | 58 09 63 68 61 72 61 63 |y the .|X.charac|
|00000bd0| 74 65 72 73 2e 20 20 0a | 58 0a 58 09 6d 76 61 64 |ters. .|X.X.mvad|
|00000be0| 64 73 74 72 28 29 20 6d | 6f 76 65 20 74 6f 20 61 |dstr() m|ove to a|
|00000bf0| 20 6e 65 77 20 70 6f 73 | 69 74 69 6f 6e 20 69 6e | new pos|ition in|
|00000c00| 20 73 74 64 73 63 72 2c | 20 74 68 65 6e 20 69 6e | stdscr,| then in|
|00000c10| 73 65 72 74 73 20 20 0a | 58 09 73 74 72 69 6e 67 |serts .|X.string|
|00000c20| 20 27 73 74 72 27 20 61 | 74 20 74 68 65 20 6e 65 | 'str' a|t the ne|
|00000c30| 77 20 70 6f 73 69 74 69 | 6f 6e 2c 20 74 61 6b 69 |w positi|on, taki|
|00000c40| 6e 67 20 61 6e 79 20 61 | 63 74 69 6f 6e 73 20 61 |ng any a|ctions a|
|00000c50| 73 20 64 69 63 2d 20 20 | 0a 58 09 74 61 74 65 64 |s dic- |.X.tated|
|00000c60| 20 62 79 20 74 68 65 20 | 63 68 61 72 61 63 74 65 | by the |characte|
|00000c70| 72 73 2e 20 20 0a 58 0a | 58 09 6d 76 77 61 64 64 |rs. .X.|X.mvwadd|
|00000c80| 73 74 72 28 29 20 6d 6f | 76 65 20 74 6f 20 61 20 |str() mo|ve to a |
|00000c90| 6e 65 77 20 70 6f 73 69 | 74 69 6f 6e 20 69 6e 20 |new posi|tion in |
|00000ca0| 77 69 6e 64 6f 77 20 27 | 77 69 6e 27 2c 20 74 68 |window '|win', th|
|00000cb0| 65 6e 20 20 0a 58 09 69 | 6e 73 65 72 74 73 20 73 |en .X.i|nserts s|
|00000cc0| 74 72 69 6e 67 20 27 73 | 74 72 27 20 61 74 20 74 |tring 's|tr' at t|
|00000cd0| 68 65 20 6e 65 77 20 70 | 6f 73 69 74 69 6f 6e 2c |he new p|osition,|
|00000ce0| 20 74 61 6b 69 6e 67 20 | 61 6e 79 20 61 63 74 69 | taking |any acti|
|00000cf0| 6f 6e 73 20 20 0a 58 09 | 61 73 20 64 69 63 74 61 |ons .X.|as dicta|
|00000d00| 74 65 64 20 62 79 20 74 | 68 65 20 63 68 61 72 61 |ted by t|he chara|
|00000d10| 63 74 65 72 73 2e 20 20 | 0a 58 0a 58 45 58 41 4d |cters. |.X.XEXAM|
|00000d20| 50 4c 45 53 0a 58 0a 58 | 53 45 45 20 41 4c 53 4f |PLES.X.X|SEE ALSO|
|00000d30| 0a 58 09 77 61 64 64 63 | 68 28 29 3b 20 77 6d 6f |.X.waddc|h(); wmo|
|00000d40| 76 65 28 29 20 20 0a 58 | 0a 58 42 55 47 53 0a 53 |ve() .X|.XBUGS.S|
|00000d50| 48 41 52 5f 45 4f 46 0a | 69 66 20 74 65 73 74 20 |HAR_EOF.|if test |
|00000d60| 39 37 37 20 2d 6e 65 20 | 22 60 77 63 20 2d 63 20 |977 -ne |"`wc -c |
|00000d70| 3c 20 27 61 64 64 73 74 | 72 2e 6d 27 60 22 0a 74 |< 'addst|r.m'`".t|
|00000d80| 68 65 6e 0a 09 65 63 68 | 6f 20 73 68 61 72 3a 20 |hen..ech|o shar: |
|00000d90| 65 72 72 6f 72 20 74 72 | 61 6e 73 6d 69 74 74 69 |error tr|ansmitti|
|00000da0| 6e 67 20 22 27 61 64 64 | 73 74 72 2e 6d 27 22 20 |ng "'add|str.m'" |
|00000db0| 27 28 73 68 6f 75 6c 64 | 20 68 61 76 65 20 62 65 |'(should| have be|
|00000dc0| 65 6e 20 39 37 37 20 63 | 68 61 72 61 63 74 65 72 |en 977 c|haracter|
|00000dd0| 73 29 27 0a 66 69 0a 66 | 69 20 23 20 65 6e 64 20 |s)'.fi.f|i # end |
|00000de0| 6f 66 20 6f 76 65 72 77 | 72 69 74 69 6e 67 20 63 |of overw|riting c|
|00000df0| 68 65 63 6b 0a 65 63 68 | 6f 20 73 68 61 72 3a 20 |heck.ech|o shar: |
|00000e00| 65 78 74 72 61 63 74 69 | 6e 67 20 22 27 62 61 63 |extracti|ng "'bac|
|00000e10| 6b 63 68 61 72 2e 6d 27 | 22 20 27 28 31 36 31 35 |kchar.m'|" '(1615|
|00000e20| 20 63 68 61 72 61 63 74 | 65 72 73 29 27 0a 69 66 | charact|ers)'.if|
|00000e30| 20 74 65 73 74 20 2d 66 | 20 27 62 61 63 6b 63 68 | test -f| 'backch|
|00000e40| 61 72 2e 6d 27 0a 74 68 | 65 6e 0a 09 65 63 68 6f |ar.m'.th|en..echo|
|00000e50| 20 73 68 61 72 3a 20 77 | 69 6c 6c 20 6e 6f 74 20 | shar: w|ill not |
|00000e60| 6f 76 65 72 2d 77 72 69 | 74 65 20 65 78 69 73 74 |over-wri|te exist|
|00000e70| 69 6e 67 20 66 69 6c 65 | 20 22 27 62 61 63 6b 63 |ing file| "'backc|
|00000e80| 68 61 72 2e 6d 27 22 0a | 65 6c 73 65 0a 73 65 64 |har.m'".|else.sed|
|00000e90| 20 27 73 2f 5e 58 2f 2f | 27 20 3c 3c 20 5c 53 48 | 's/^X//|' << \SH|
|00000ea0| 41 52 5f 45 4f 46 20 3e | 20 27 62 61 63 6b 63 68 |AR_EOF >| 'backch|
|00000eb0| 61 72 2e 6d 27 0a 58 4e | 41 4d 45 0a 58 09 77 67 |ar.m'.XN|AME.X.wg|
|00000ec0| 65 74 73 74 72 28 29 20 | 67 65 74 73 74 72 28 29 |etstr() |getstr()|
|00000ed0| 20 6d 76 67 65 74 73 74 | 72 28 29 20 6d 76 77 67 | mvgetst|r() mvwg|
|00000ee0| 65 74 73 74 72 28 29 20 | 2d 20 72 65 61 64 73 20 |etstr() |- reads |
|00000ef0| 69 6e 20 61 20 73 74 72 | 69 6e 67 0a 58 09 09 09 |in a str|ing.X...|
|00000f00| 09 09 09 20 20 20 20 74 | 65 72 6d 69 6e 61 74 65 |... t|erminate|
|00000f10| 64 20 62 79 20 5c 6e 20 | 6f 72 20 5c 72 20 20 0a |d by \n |or \r .|
|00000f20| 58 09 62 61 63 6b 63 68 | 61 72 28 29 20 2d 20 63 |X.backch|ar() - c|
|00000f30| 68 61 72 61 63 74 65 72 | 20 64 65 6c 65 74 65 20 |haracter| delete |
|00000f40| 77 69 74 68 20 73 63 72 | 65 65 6e 20 65 72 61 73 |with scr|een eras|
|00000f50| 65 0a 58 0a 58 53 59 4e | 4f 50 53 49 53 0a 58 09 |e.X.XSYN|OPSIS.X.|
|00000f60| 23 69 6e 63 6c 75 64 65 | 20 3c 63 75 72 73 65 73 |#include| <curses|
|00000f70| 2e 68 3e 0a 58 09 23 69 | 6e 63 6c 75 64 65 20 3c |.h>.X.#i|nclude <|
|00000f80| 63 75 72 73 70 72 69 76 | 2e 68 3e 0a 58 0a 58 09 |curspriv|.h>.X.X.|
|00000f90| 69 6e 74 20 77 67 65 74 | 73 74 72 28 77 69 6e 2c |int wget|str(win,|
|00000fa0| 73 74 72 29 0a 58 09 57 | 49 4e 44 4f 57 20 2a 77 |str).X.W|INDOW *w|
|00000fb0| 69 6e 3b 20 0a 58 09 63 | 68 61 72 20 2a 73 74 72 |in; .X.c|har *str|
|00000fc0| 3b 0a 58 0a 58 09 69 6e | 74 20 67 65 74 73 74 72 |;.X.X.in|t getstr|
|00000fd0| 28 73 74 72 29 0a 58 09 | 63 68 61 72 20 2a 73 74 |(str).X.|char *st|
|00000fe0| 72 3b 0a 58 0a 58 09 69 | 6e 74 20 6d 76 67 65 74 |r;.X.X.i|nt mvget|
|00000ff0| 73 74 72 28 79 2c 78 2c | 73 74 72 29 0a 58 09 69 |str(y,x,|str).X.i|
|00001000| 6e 74 20 79 3b 0a 58 09 | 69 6e 74 20 78 3b 0a 58 |nt y;.X.|int x;.X|
|00001010| 09 63 68 61 72 20 2a 73 | 74 72 3b 0a 58 0a 58 09 |.char *s|tr;.X.X.|
|00001020| 69 6e 74 20 6d 76 77 67 | 65 74 73 74 72 28 77 69 |int mvwg|etstr(wi|
|00001030| 6e 2c 79 2c 78 2c 73 74 | 72 29 0a 58 09 57 49 4e |n,y,x,st|r).X.WIN|
|00001040| 44 4f 57 20 2a 77 69 6e | 3b 0a 58 09 69 6e 74 20 |DOW *win|;.X.int |
|00001050| 79 3b 0a 58 09 69 6e 74 | 20 78 3b 0a 58 09 63 68 |y;.X.int| x;.X.ch|
|00001060| 61 72 20 2a 73 74 72 3b | 0a 58 0a 58 09 73 74 61 |ar *str;|.X.X.sta|
|00001070| 74 69 63 20 63 68 61 72 | 20 2a 62 61 63 6b 63 68 |tic char| *backch|
|00001080| 61 72 28 73 29 0a 58 09 | 63 68 61 72 20 2a 73 3b |ar(s).X.|char *s;|
|00001090| 0a 58 0a 58 44 45 53 43 | 52 49 50 54 49 4f 4e 0a |.X.XDESC|RIPTION.|
|000010a0| 58 09 77 67 65 74 73 74 | 72 28 29 20 72 65 61 64 |X.wgetst|r() read|
|000010b0| 73 20 69 6e 20 61 20 73 | 74 72 69 6e 67 20 28 74 |s in a s|tring (t|
|000010c0| 65 72 6d 69 6e 61 74 65 | 64 20 62 79 20 5c 6e 20 |erminate|d by \n |
|000010d0| 6f 72 20 5c 72 29 20 20 | 0a 58 09 74 6f 20 74 68 |or \r) |.X.to th|
|000010e0| 65 20 62 75 66 66 65 72 | 20 70 6f 69 6e 74 65 64 |e buffer| pointed|
|000010f0| 20 74 6f 20 62 79 20 27 | 73 74 72 27 2c 20 61 6e | to by '|str', an|
|00001100| 64 20 64 69 73 70 6c 61 | 79 73 20 74 68 65 20 69 |d displa|ys the i|
|00001110| 6e 70 75 74 20 20 0a 58 | 09 69 6e 20 77 69 6e 64 |nput .X|.in wind|
|00001120| 6f 77 20 27 77 69 6e 27 | 2e 20 54 68 65 20 75 73 |ow 'win'|. The us|
|00001130| 65 72 27 73 20 65 72 61 | 73 65 20 61 6e 64 20 6b |er's era|se and k|
|00001140| 69 6c 6c 20 63 68 61 72 | 61 63 74 65 72 73 20 61 |ill char|acters a|
|00001150| 72 65 20 20 0a 58 09 61 | 63 74 69 76 65 2e 20 20 |re .X.a|ctive. |
|00001160| 0a 58 0a 58 09 67 65 74 | 73 74 72 28 29 20 72 65 |.X.X.get|str() re|
|00001170| 61 64 73 20 69 6e 20 61 | 20 73 74 72 69 6e 67 20 |ads in a| string |
|00001180| 28 74 65 72 6d 69 6e 61 | 74 65 64 20 62 79 20 5c |(termina|ted by \|
|00001190| 6e 20 6f 72 20 5c 72 29 | 20 74 6f 20 20 0a 58 09 |n or \r)| to .X.|
|000011a0| 74 68 65 20 62 75 66 66 | 65 72 20 70 6f 69 6e 74 |the buff|er point|
|000011b0| 65 64 20 74 6f 20 62 79 | 20 27 73 74 72 27 2c 20 |ed to by| 'str', |
|000011c0| 61 6e 64 20 64 69 73 70 | 6c 61 79 73 20 74 68 65 |and disp|lays the|
|000011d0| 20 69 6e 70 75 74 20 69 | 6e 20 20 0a 58 09 73 74 | input i|n .X.st|
|000011e0| 64 73 63 72 2e 20 54 68 | 65 20 75 73 65 72 27 73 |dscr. Th|e user's|
|000011f0| 20 65 72 61 73 65 20 61 | 6e 64 20 6b 69 6c 6c 20 | erase a|nd kill |
|00001200| 63 68 61 72 61 63 74 65 | 72 73 20 61 72 65 20 61 |characte|rs are a|
|00001210| 63 74 69 76 65 2e 20 20 | 0a 58 0a 58 09 6d 76 67 |ctive. |.X.X.mvg|
|00001220| 65 74 73 74 72 28 29 20 | 6d 6f 76 65 73 20 74 68 |etstr() |moves th|
|00001230| 65 20 73 74 64 73 63 72 | 20 63 75 72 73 6f 72 20 |e stdscr| cursor |
|00001240| 74 6f 20 61 20 6e 65 77 | 20 70 6f 73 69 74 69 6f |to a new| positio|
|00001250| 6e 2c 20 20 0a 58 09 74 | 68 65 6e 20 72 65 61 64 |n, .X.t|hen read|
|00001260| 73 20 69 6e 20 61 20 73 | 74 72 69 6e 67 20 28 74 |s in a s|tring (t|
|00001270| 65 72 6d 69 6e 61 74 65 | 64 20 62 79 20 5c 6e 20 |erminate|d by \n |
|00001280| 6f 72 20 5c 72 29 20 74 | 6f 20 74 68 65 20 62 75 |or \r) t|o the bu|
|00001290| 66 2d 20 20 0a 58 09 66 | 65 72 20 70 6f 69 6e 74 |f- .X.f|er point|
|000012a0| 65 64 20 74 6f 20 62 79 | 20 27 73 74 72 27 2c 20 |ed to by| 'str', |
|000012b0| 61 6e 64 20 64 69 73 70 | 6c 61 79 73 20 74 68 65 |and disp|lays the|
|000012c0| 20 69 6e 70 75 74 20 69 | 6e 20 73 74 64 73 63 72 | input i|n stdscr|
|000012d0| 2e 20 20 0a 58 09 54 68 | 65 20 75 73 65 72 27 73 |. .X.Th|e user's|
|000012e0| 20 65 72 61 73 65 20 61 | 6e 64 20 6b 69 6c 6c 20 | erase a|nd kill |
|000012f0| 63 68 61 72 61 63 74 65 | 72 73 20 61 72 65 20 61 |characte|rs are a|
|00001300| 63 74 69 76 65 2e 20 20 | 0a 58 0a 58 09 6d 76 77 |ctive. |.X.X.mvw|
|00001310| 67 65 74 73 74 72 28 29 | 20 6d 6f 76 65 73 20 74 |getstr()| moves t|
|00001320| 68 65 20 27 77 69 6e 27 | 20 63 75 72 73 6f 72 20 |he 'win'| cursor |
|00001330| 74 6f 20 61 20 6e 65 77 | 20 20 0a 58 09 70 6f 73 |to a new| .X.pos|
|00001340| 69 74 69 6f 6e 2c 20 74 | 68 65 6e 20 72 65 61 64 |ition, t|hen read|
|00001350| 73 20 69 6e 20 61 20 73 | 74 72 69 6e 67 20 28 74 |s in a s|tring (t|
|00001360| 65 72 6d 69 6e 61 74 65 | 64 20 62 79 20 5c 6e 20 |erminate|d by \n |
|00001370| 6f 72 20 5c 72 29 20 20 | 0a 58 09 74 6f 20 74 68 |or \r) |.X.to th|
|00001380| 65 20 62 75 66 66 65 72 | 20 70 6f 69 6e 74 65 64 |e buffer| pointed|
|00001390| 20 74 6f 20 62 79 20 27 | 73 74 72 27 2c 20 61 6e | to by '|str', an|
|000013a0| 64 20 64 69 73 70 6c 61 | 79 73 20 74 68 65 20 69 |d displa|ys the i|
|000013b0| 6e 70 75 74 20 69 6e 20 | 20 0a 58 09 73 74 64 73 |nput in | .X.stds|
|000013c0| 63 72 2e 20 54 68 65 20 | 75 73 65 72 27 73 20 65 |cr. The |user's e|
|000013d0| 72 61 73 65 20 61 6e 64 | 20 6b 69 6c 6c 20 63 68 |rase and| kill ch|
|000013e0| 61 72 61 63 74 65 72 73 | 20 61 72 65 20 61 63 74 |aracters| are act|
|000013f0| 69 76 65 2e 20 20 0a 58 | 0a 58 09 62 61 63 6b 63 |ive. .X|.X.backc|
|00001400| 68 61 72 28 29 20 64 6f | 65 73 20 61 20 63 68 61 |har() do|es a cha|
|00001410| 72 61 63 74 65 72 20 64 | 65 6c 65 74 65 20 77 69 |racter d|elete wi|
|00001420| 74 68 20 73 63 72 65 65 | 6e 20 65 72 61 73 65 2c |th scree|n erase,|
|00001430| 20 65 76 65 6e 20 20 0a | 58 09 75 70 20 74 6f 20 | even .|X.up to |
|00001440| 70 72 65 76 69 6f 75 73 | 20 6c 69 6e 65 73 2e 20 |previous| lines. |
|00001450| 49 74 20 77 69 6c 6c 20 | 6e 6f 74 20 62 61 63 6b |It will |not back|
|00001460| 2d 73 63 72 6f 6c 6c 20 | 69 66 20 74 68 65 20 62 |-scroll |if the b|
|00001470| 65 67 69 2d 20 20 0a 58 | 09 6e 69 6e 67 20 6f 66 |egi- .X|.ning of|
|00001480| 20 74 68 65 20 73 74 72 | 69 6e 67 20 68 61 73 20 | the str|ing has |
|00001490| 73 63 72 6f 6c 6c 65 64 | 20 6f 66 66 20 74 68 65 |scrolled| off the|
|000014a0| 20 77 69 6e 64 6f 77 2e | 20 53 74 65 70 73 20 62 | window.| Steps b|
|000014b0| 61 63 6b 20 20 0a 58 09 | 70 6f 69 6e 74 65 72 20 |ack .X.|pointer |
|000014c0| 27 73 27 2c 20 61 6e 64 | 20 72 65 74 75 72 6e 73 |'s', and| returns|
|000014d0| 20 74 68 65 20 6e 65 77 | 20 76 61 6c 75 65 2e 20 | the new| value. |
|000014e0| 20 0a 58 0a 58 45 58 41 | 4d 50 4c 45 53 0a 58 0a | .X.XEXA|MPLES.X.|
|000014f0| 58 53 45 45 20 41 4c 53 | 4f 0a 58 09 77 72 65 66 |XSEE ALS|O.X.wref|
|00001500| 72 65 73 68 28 29 3b 20 | 67 65 74 63 68 28 29 3b |resh(); |getch();|
|00001510| 20 77 61 64 64 63 68 28 | 29 3b 20 77 6d 6f 76 65 | waddch(|); wmove|
|00001520| 28 29 3b 20 77 61 64 64 | 73 74 72 28 29 3b 20 6d |(); wadd|str(); m|
|00001530| 76 77 61 64 64 63 68 28 | 29 0a 58 0a 58 42 55 47 |vwaddch(|).X.XBUG|
|00001540| 53 0a 53 48 41 52 5f 45 | 4f 46 0a 69 66 20 74 65 |S.SHAR_E|OF.if te|
|00001550| 73 74 20 31 36 31 35 20 | 2d 6e 65 20 22 60 77 63 |st 1615 |-ne "`wc|
|00001560| 20 2d 63 20 3c 20 27 62 | 61 63 6b 63 68 61 72 2e | -c < 'b|ackchar.|
|00001570| 6d 27 60 22 0a 74 68 65 | 6e 0a 09 65 63 68 6f 20 |m'`".the|n..echo |
|00001580| 73 68 61 72 3a 20 65 72 | 72 6f 72 20 74 72 61 6e |shar: er|ror tran|
|00001590| 73 6d 69 74 74 69 6e 67 | 20 22 27 62 61 63 6b 63 |smitting| "'backc|
|000015a0| 68 61 72 2e 6d 27 22 20 | 27 28 73 68 6f 75 6c 64 |har.m'" |'(should|
|000015b0| 20 68 61 76 65 20 62 65 | 65 6e 20 31 36 31 35 20 | have be|en 1615 |
|000015c0| 63 68 61 72 61 63 74 65 | 72 73 29 27 0a 66 69 0a |characte|rs)'.fi.|
|000015d0| 66 69 20 23 20 65 6e 64 | 20 6f 66 20 6f 76 65 72 |fi # end| of over|
|000015e0| 77 72 69 74 69 6e 67 20 | 63 68 65 63 6b 0a 65 63 |writing |check.ec|
|000015f0| 68 6f 20 73 68 61 72 3a | 20 65 78 74 72 61 63 74 |ho shar:| extract|
|00001600| 69 6e 67 20 22 27 62 65 | 65 70 2e 6d 27 22 20 27 |ing "'be|ep.m'" '|
|00001610| 28 32 38 32 20 63 68 61 | 72 61 63 74 65 72 73 29 |(282 cha|racters)|
|00001620| 27 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 62 65 |'.if tes|t -f 'be|
|00001630| 65 70 2e 6d 27 0a 74 68 | 65 6e 0a 09 65 63 68 6f |ep.m'.th|en..echo|
|00001640| 20 73 68 61 72 3a 20 77 | 69 6c 6c 20 6e 6f 74 20 | shar: w|ill not |
|00001650| 6f 76 65 72 2d 77 72 69 | 74 65 20 65 78 69 73 74 |over-wri|te exist|
|00001660| 69 6e 67 20 66 69 6c 65 | 20 22 27 62 65 65 70 2e |ing file| "'beep.|
|00001670| 6d 27 22 0a 65 6c 73 65 | 0a 73 65 64 20 27 73 2f |m'".else|.sed 's/|
|00001680| 5e 58 2f 2f 27 20 3c 3c | 20 5c 53 48 41 52 5f 45 |^X//' <<| \SHAR_E|
|00001690| 4f 46 20 3e 20 27 62 65 | 65 70 2e 6d 27 0a 58 4e |OF > 'be|ep.m'.XN|
|000016a0| 41 4d 45 0a 58 09 62 65 | 65 70 28 29 20 66 6c 61 |AME.X.be|ep() fla|
|000016b0| 73 68 28 29 20 2d 20 61 | 6c 65 72 74 20 74 68 65 |sh() - a|lert the|
|000016c0| 20 6f 70 65 72 61 74 6f | 72 0a 58 0a 58 53 59 4e | operato|r.X.XSYN|
|000016d0| 4f 50 53 49 53 0a 58 09 | 23 69 6e 63 6c 75 64 65 |OPSIS.X.|#include|
|000016e0| 20 3c 63 75 72 73 65 73 | 2e 68 3e 0a 58 09 23 69 | <curses|.h>.X.#i|
|000016f0| 6e 63 6c 75 64 65 20 3c | 63 75 72 73 70 72 69 76 |nclude <|curspriv|
|00001700| 2e 68 3e 0a 58 0a 58 09 | 76 6f 69 64 20 62 65 65 |.h>.X.X.|void bee|
|00001710| 70 28 29 0a 58 0a 58 09 | 76 6f 69 64 20 66 6c 61 |p().X.X.|void fla|
|00001720| 73 68 28 29 0a 58 0a 58 | 44 45 53 43 52 49 50 54 |sh().X.X|DESCRIPT|
|00001730| 49 4f 4e 0a 58 09 62 65 | 65 70 28 29 20 73 6f 75 |ION.X.be|ep() sou|
|00001740| 6e 64 73 20 74 68 65 20 | 74 65 72 6d 69 6e 61 6c |nds the |terminal|
|00001750| 20 62 65 6c 6c 2e 20 20 | 0a 58 09 66 6c 61 73 68 | bell. |.X.flash|
|00001760| 28 29 20 66 6c 61 73 68 | 65 73 20 74 68 65 20 74 |() flash|es the t|
|00001770| 65 72 6d 69 6e 61 6c 20 | 73 63 72 65 65 6e 2e 20 |erminal |screen. |
|00001780| 20 0a 58 0a 58 45 58 41 | 4d 50 4c 45 53 0a 58 0a | .X.XEXA|MPLES.X.|
|00001790| 58 53 45 45 20 41 4c 53 | 4f 0a 58 09 63 75 72 73 |XSEE ALS|O.X.curs|
|000017a0| 65 73 70 75 74 63 28 29 | 2c 20 63 75 72 73 65 73 |esputc()|, curses|
|000017b0| 73 63 72 6f 6c 6c 28 29 | 2c 20 77 72 65 66 72 65 |scroll()|, wrefre|
|000017c0| 73 68 28 29 0a 58 0a 58 | 42 55 47 53 0a 53 48 41 |sh().X.X|BUGS.SHA|
|000017d0| 52 5f 45 4f 46 0a 69 66 | 20 74 65 73 74 20 32 38 |R_EOF.if| test 28|
|000017e0| 32 20 2d 6e 65 20 22 60 | 77 63 20 2d 63 20 3c 20 |2 -ne "`|wc -c < |
|000017f0| 27 62 65 65 70 2e 6d 27 | 60 22 0a 74 68 65 6e 0a |'beep.m'|`".then.|
|00001800| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 65 72 72 6f |.echo sh|ar: erro|
|00001810| 72 20 74 72 61 6e 73 6d | 69 74 74 69 6e 67 20 22 |r transm|itting "|
|00001820| 27 62 65 65 70 2e 6d 27 | 22 20 27 28 73 68 6f 75 |'beep.m'|" '(shou|
|00001830| 6c 64 20 68 61 76 65 20 | 62 65 65 6e 20 32 38 32 |ld have |been 282|
|00001840| 20 63 68 61 72 61 63 74 | 65 72 73 29 27 0a 66 69 | charact|ers)'.fi|
|00001850| 0a 66 69 20 23 20 65 6e | 64 20 6f 66 20 6f 76 65 |.fi # en|d of ove|
|00001860| 72 77 72 69 74 69 6e 67 | 20 63 68 65 63 6b 0a 65 |rwriting| check.e|
|00001870| 63 68 6f 20 73 68 61 72 | 3a 20 65 78 74 72 61 63 |cho shar|: extrac|
|00001880| 74 69 6e 67 20 22 27 62 | 6f 78 2e 6d 27 22 20 27 |ting "'b|ox.m'" '|
|00001890| 28 37 34 35 20 63 68 61 | 72 61 63 74 65 72 73 29 |(745 cha|racters)|
|000018a0| 27 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 62 6f |'.if tes|t -f 'bo|
|000018b0| 78 2e 6d 27 0a 74 68 65 | 6e 0a 09 65 63 68 6f 20 |x.m'.the|n..echo |
|000018c0| 73 68 61 72 3a 20 77 69 | 6c 6c 20 6e 6f 74 20 6f |shar: wi|ll not o|
|000018d0| 76 65 72 2d 77 72 69 74 | 65 20 65 78 69 73 74 69 |ver-writ|e existi|
|000018e0| 6e 67 20 66 69 6c 65 20 | 22 27 62 6f 78 2e 6d 27 |ng file |"'box.m'|
|000018f0| 22 0a 65 6c 73 65 0a 73 | 65 64 20 27 73 2f 5e 58 |".else.s|ed 's/^X|
|00001900| 2f 2f 27 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |//' << \|SHAR_EOF|
|00001910| 20 3e 20 27 62 6f 78 2e | 6d 27 0a 58 4e 41 4d 45 | > 'box.|m'.XNAME|
|00001920| 0a 58 09 77 62 6f 78 28 | 29 20 62 6f 78 28 29 20 |.X.wbox(|) box() |
|00001930| 2d 20 64 72 61 77 20 61 | 20 62 6f 78 0a 58 0a 58 |- draw a| box.X.X|
|00001940| 53 59 4e 4f 50 53 49 53 | 0a 58 09 23 69 6e 63 6c |SYNOPSIS|.X.#incl|
|00001950| 75 64 65 20 3c 63 75 72 | 73 65 73 2e 68 3e 0a 58 |ude <cur|ses.h>.X|
|00001960| 09 23 69 6e 63 6c 75 64 | 65 20 3c 63 75 72 73 70 |.#includ|e <cursp|
|00001970| 72 69 76 2e 68 3e 0a 58 | 0a 58 09 69 6e 74 20 77 |riv.h>.X|.X.int w|
|00001980| 62 6f 78 28 77 69 6e 2c | 79 6d 69 6e 2c 78 6d 69 |box(win,|ymin,xmi|
|00001990| 6e 2c 79 6d 61 78 2c 78 | 6d 61 78 2c 76 2c 68 29 |n,ymax,x|max,v,h)|
|000019a0| 0a 58 09 57 49 4e 44 4f | 57 20 2a 77 69 6e 3b 0a |.X.WINDO|W *win;.|
|000019b0| 58 09 69 6e 74 20 79 6d | 69 6e 3b 0a 58 09 69 6e |X.int ym|in;.X.in|
|000019c0| 74 20 78 6d 69 6e 3b 0a | 58 09 69 6e 74 20 79 6d |t xmin;.|X.int ym|
|000019d0| 61 78 3b 0a 58 09 69 6e | 74 20 78 6d 61 78 3b 0a |ax;.X.in|t xmax;.|
|000019e0| 58 09 63 68 61 72 20 76 | 3b 0a 58 09 63 68 61 72 |X.char v|;.X.char|
|000019f0| 20 68 3b 0a 58 0a 58 09 | 76 6f 69 64 20 62 6f 78 | h;.X.X.|void box|
|00001a00| 28 77 69 6e 2c 76 63 2c | 68 63 29 0a 58 09 57 49 |(win,vc,|hc).X.WI|
|00001a10| 4e 44 4f 57 20 2a 77 69 | 6e 3b 0a 58 09 63 68 61 |NDOW *wi|n;.X.cha|
|00001a20| 72 20 76 63 3b 0a 58 09 | 63 68 61 72 20 68 63 3b |r vc;.X.|char hc;|
|00001a30| 0a 58 0a 58 44 45 53 43 | 52 49 50 54 49 4f 4e 0a |.X.XDESC|RIPTION.|
|00001a40| 58 09 77 62 6f 78 28 77 | 69 6e 2c 79 6d 69 6e 2c |X.wbox(w|in,ymin,|
|00001a50| 78 6d 69 6e 2c 79 6d 61 | 78 2c 78 6d 61 78 2c 76 |xmin,yma|x,xmax,v|
|00001a60| 2c 68 29 20 64 72 61 77 | 73 20 61 20 62 6f 78 20 |,h) draw|s a box |
|00001a70| 69 6e 20 77 69 6e 64 6f | 77 20 20 0a 58 09 27 77 |in windo|w .X.'w|
|00001a80| 69 6e 27 2c 20 65 6e 63 | 6c 6f 73 69 6e 67 20 74 |in', enc|losing t|
|00001a90| 68 65 20 61 72 65 61 20 | 78 6d 69 6e 2d 78 6d 61 |he area |xmin-xma|
|00001aa0| 78 20 61 6e 64 20 79 6d | 69 6e 2d 78 6d 61 78 2e |x and ym|in-xmax.|
|00001ab0| 20 49 66 20 20 0a 58 09 | 78 6d 61 78 20 61 6e 64 | If .X.|xmax and|
|00001ac0| 2f 6f 72 20 79 6d 61 78 | 20 69 73 20 30 2c 20 74 |/or ymax| is 0, t|
|00001ad0| 68 65 20 77 69 6e 64 6f | 77 20 6d 61 78 20 76 61 |he windo|w max va|
|00001ae0| 6c 75 65 20 69 73 20 75 | 73 65 64 2e 20 27 76 27 |lue is u|sed. 'v'|
|00001af0| 20 61 6e 64 20 20 0a 58 | 09 27 68 27 20 61 72 65 | and .X|.'h' are|
|00001b00| 20 74 68 65 20 76 65 72 | 74 69 63 61 6c 20 61 6e | the ver|tical an|
|00001b10| 64 20 68 6f 72 69 7a 6f | 6e 74 61 6c 20 63 68 61 |d horizo|ntal cha|
|00001b20| 72 61 63 74 65 72 73 20 | 74 6f 20 75 73 65 2e 20 |racters |to use. |
|00001b30| 49 66 20 20 0a 58 09 27 | 76 27 20 61 6e 64 20 27 |If .X.'|v' and '|
|00001b40| 68 27 20 61 72 65 20 50 | 43 20 67 72 61 70 69 63 |h' are P|C grapic|
|00001b50| 73 20 6c 69 6e 65 73 2c | 20 77 62 6f 78 20 77 69 |s lines,| wbox wi|
|00001b60| 6c 6c 20 6d 61 6b 65 20 | 74 68 65 20 63 6f 72 6e |ll make |the corn|
|00001b70| 65 72 73 20 20 0a 58 09 | 69 6e 20 61 20 70 72 65 |ers .X.|in a pre|
|00001b80| 74 74 79 20 77 61 79 2e | 20 20 0a 58 0a 58 09 62 |tty way.| .X.X.b|
|00001b90| 6f 78 28 77 69 6e 2c 76 | 2c 68 29 20 64 72 61 77 |ox(win,v|,h) draw|
|00001ba0| 73 20 61 20 62 6f 78 20 | 61 72 6f 75 6e 64 20 77 |s a box |around w|
|00001bb0| 69 6e 64 6f 77 20 77 69 | 6e 64 6f 77 20 27 77 69 |indow wi|ndow 'wi|
|00001bc0| 6e 27 2e 20 27 76 27 20 | 61 6e 64 20 20 0a 58 09 |n'. 'v' |and .X.|
|00001bd0| 27 68 27 20 61 72 65 20 | 74 68 65 20 76 65 72 74 |'h' are |the vert|
|00001be0| 69 63 61 6c 20 61 6e 64 | 20 68 6f 72 69 7a 6f 6e |ical and| horizon|
|00001bf0| 74 61 6c 20 63 68 61 72 | 61 63 74 65 72 73 20 74 |tal char|acters t|
|00001c00| 6f 20 75 73 65 2e 20 20 | 0a 58 0a 58 45 58 41 4d |o use. |.X.XEXAM|
|00001c10| 50 4c 45 53 0a 58 0a 58 | 53 45 45 20 41 4c 53 4f |PLES.X.X|SEE ALSO|
|00001c20| 0a 58 0a 58 42 55 47 53 | 0a 53 48 41 52 5f 45 4f |.X.XBUGS|.SHAR_EO|
|00001c30| 46 0a 69 66 20 74 65 73 | 74 20 37 34 35 20 2d 6e |F.if tes|t 745 -n|
|00001c40| 65 20 22 60 77 63 20 2d | 63 20 3c 20 27 62 6f 78 |e "`wc -|c < 'box|
|00001c50| 2e 6d 27 60 22 0a 74 68 | 65 6e 0a 09 65 63 68 6f |.m'`".th|en..echo|
|00001c60| 20 73 68 61 72 3a 20 65 | 72 72 6f 72 20 74 72 61 | shar: e|rror tra|
|00001c70| 6e 73 6d 69 74 74 69 6e | 67 20 22 27 62 6f 78 2e |nsmittin|g "'box.|
|00001c80| 6d 27 22 20 27 28 73 68 | 6f 75 6c 64 20 68 61 76 |m'" '(sh|ould hav|
|00001c90| 65 20 62 65 65 6e 20 37 | 34 35 20 63 68 61 72 61 |e been 7|45 chara|
|00001ca0| 63 74 65 72 73 29 27 0a | 66 69 0a 66 69 20 23 20 |cters)'.|fi.fi # |
|00001cb0| 65 6e 64 20 6f 66 20 6f | 76 65 72 77 72 69 74 69 |end of o|verwriti|
|00001cc0| 6e 67 20 63 68 65 63 6b | 0a 65 63 68 6f 20 73 68 |ng check|.echo sh|
|00001cd0| 61 72 3a 20 65 78 74 72 | 61 63 74 69 6e 67 20 22 |ar: extr|acting "|
|00001ce0| 27 63 62 72 65 61 6b 2e | 6d 27 22 20 27 28 38 33 |'cbreak.|m'" '(83|
|00001cf0| 30 20 63 68 61 72 61 63 | 74 65 72 73 29 27 0a 69 |0 charac|ters)'.i|
|00001d00| 66 20 74 65 73 74 20 2d | 66 20 27 63 62 72 65 61 |f test -|f 'cbrea|
|00001d10| 6b 2e 6d 27 0a 74 68 65 | 6e 0a 09 65 63 68 6f 20 |k.m'.the|n..echo |
|00001d20| 73 68 61 72 3a 20 77 69 | 6c 6c 20 6e 6f 74 20 6f |shar: wi|ll not o|
|00001d30| 76 65 72 2d 77 72 69 74 | 65 20 65 78 69 73 74 69 |ver-writ|e existi|
|00001d40| 6e 67 20 66 69 6c 65 20 | 22 27 63 62 72 65 61 6b |ng file |"'cbreak|
|00001d50| 2e 6d 27 22 0a 65 6c 73 | 65 0a 73 65 64 20 27 73 |.m'".els|e.sed 's|
|00001d60| 2f 5e 58 2f 2f 27 20 3c | 3c 20 5c 53 48 41 52 5f |/^X//' <|< \SHAR_|
|00001d70| 45 4f 46 20 3e 20 27 63 | 62 72 65 61 6b 2e 6d 27 |EOF > 'c|break.m'|
|00001d80| 0a 58 4e 41 4d 45 0a 58 | 09 72 61 77 28 29 20 6e |.XNAME.X|.raw() n|
|00001d90| 6f 72 61 77 28 29 20 65 | 63 68 6f 28 29 20 6e 6f |oraw() e|cho() no|
|00001da0| 65 63 68 6f 28 29 20 63 | 62 72 65 61 6b 28 29 20 |echo() c|break() |
|00001db0| 6e 6f 63 62 72 65 61 6b | 28 29 20 63 72 6d 6f 64 |nocbreak|() crmod|
|00001dc0| 65 28 29 20 6e 6f 63 72 | 6d 6f 64 65 28 29 0a 58 |e() nocr|mode().X|
|00001dd0| 09 72 65 66 72 62 72 6b | 28 29 20 2d 20 73 65 74 |.refrbrk|() - set|
|00001de0| 20 6f 72 20 75 6e 73 65 | 74 20 73 63 72 65 65 6e | or unse|t screen|
|00001df0| 20 66 6c 61 67 73 0a 58 | 0a 58 53 59 4e 4f 50 53 | flags.X|.XSYNOPS|
|00001e00| 49 53 0a 58 09 23 69 6e | 63 6c 75 64 65 20 3c 63 |IS.X.#in|clude <c|
|00001e10| 75 72 73 65 73 2e 68 3e | 0a 58 09 23 69 6e 63 6c |urses.h>|.X.#incl|
|00001e20| 75 64 65 20 3c 63 75 72 | 73 70 72 69 76 2e 68 3e |ude <cur|spriv.h>|
|00001e30| 0a 58 0a 58 09 76 6f 69 | 64 20 72 61 77 28 29 0a |.X.X.voi|d raw().|
|00001e40| 58 0a 58 09 76 6f 69 64 | 20 6e 6f 72 61 77 28 29 |X.X.void| noraw()|
|00001e50| 0a 58 0a 58 09 76 6f 69 | 64 20 65 63 68 6f 28 29 |.X.X.voi|d echo()|
|00001e60| 0a 58 0a 58 09 76 6f 69 | 64 20 6e 6f 65 63 68 6f |.X.X.voi|d noecho|
|00001e70| 28 29 0a 58 0a 58 09 76 | 6f 69 64 20 6e 6c 28 29 |().X.X.v|oid nl()|
|00001e80| 0a 58 0a 58 09 76 6f 69 | 64 20 6e 6f 6e 6c 28 29 |.X.X.voi|d nonl()|
|00001e90| 0a 58 0a 58 09 76 6f 69 | 64 20 63 62 72 65 61 6b |.X.X.voi|d cbreak|
|00001ea0| 28 29 0a 58 0a 58 09 76 | 6f 69 64 20 6e 6f 63 62 |().X.X.v|oid nocb|
|00001eb0| 72 65 61 6b 28 29 0a 58 | 0a 58 09 76 6f 69 64 20 |reak().X|.X.void |
|00001ec0| 63 72 6d 6f 64 65 28 29 | 0a 58 0a 58 09 76 6f 69 |crmode()|.X.X.voi|
|00001ed0| 64 20 6e 6f 63 72 6d 6f | 64 65 28 29 0a 58 0a 58 |d nocrmo|de().X.X|
|00001ee0| 09 76 6f 69 64 20 72 65 | 66 72 62 72 6b 28 62 66 |.void re|frbrk(bf|
|00001ef0| 29 0a 58 09 62 6f 6f 6c | 20 62 66 3b 0a 58 0a 58 |).X.bool| bf;.X.X|
|00001f00| 44 45 53 43 52 49 50 54 | 49 4f 4e 0a 58 09 72 61 |DESCRIPT|ION.X.ra|
|00001f10| 77 28 29 20 61 6e 64 20 | 6e 6f 72 61 77 28 29 20 |w() and |noraw() |
|00001f20| 73 65 74 73 20 6f 72 20 | 63 6c 65 61 72 73 20 72 |sets or |clears r|
|00001f30| 61 77 20 6d 6f 64 65 2e | 20 20 0a 58 0a 58 09 65 |aw mode.| .X.X.e|
|00001f40| 63 68 6f 28 29 20 61 6e | 64 20 6e 6f 65 63 68 6f |cho() an|d noecho|
|00001f50| 28 29 20 73 65 74 73 20 | 6f 72 20 63 6c 65 61 72 |() sets |or clear|
|00001f60| 73 20 65 63 68 6f 20 6d | 6f 64 65 2e 20 20 0a 58 |s echo m|ode. .X|
|00001f70| 0a 58 09 63 62 72 65 61 | 6b 28 29 2c 20 6e 6f 63 |.X.cbrea|k(), noc|
|00001f80| 62 72 65 61 6b 28 29 2c | 20 63 72 6d 6f 64 65 28 |break(),| crmode(|
|00001f90| 29 20 61 6d 64 20 6e 6f | 63 72 6d 6f 64 65 28 29 |) amd no|crmode()|
|00001fa0| 20 73 65 74 73 20 6f 72 | 20 63 6c 65 61 72 73 0a | sets or| clears.|
|00001fb0| 58 09 63 62 72 65 61 6b | 20 6d 6f 64 65 2e 0a 58 |X.cbreak| mode..X|
|00001fc0| 0a 58 09 72 65 66 72 62 | 72 6b 28 29 20 73 65 74 |.X.refrb|rk() set|
|00001fd0| 73 20 6f 72 20 75 6e 73 | 65 74 73 20 74 68 65 20 |s or uns|ets the |
|00001fe0| 73 63 72 65 65 6e 20 72 | 65 66 72 65 73 68 20 62 |screen r|efresh b|
|00001ff0| 72 65 61 6b 20 66 6c 61 | 67 2e 20 49 66 20 20 0a |reak fla|g. If .|
|00002000| 58 09 74 68 69 73 20 66 | 6c 61 67 20 69 73 20 73 |X.this f|lag is s|
|00002010| 65 74 2c 20 61 6e 64 20 | 74 68 65 72 65 20 69 73 |et, and |there is|
|00002020| 20 61 6e 79 20 69 6e 70 | 75 74 20 61 76 61 69 6c | any inp|ut avail|
|00002030| 61 62 6c 65 2c 20 61 6e | 79 20 20 0a 58 09 73 63 |able, an|y .X.sc|
|00002040| 72 65 65 6e 20 72 65 66 | 72 65 73 68 20 77 69 6c |reen ref|resh wil|
|00002050| 6c 20 62 65 20 70 72 65 | 6d 61 74 75 72 65 6c 79 |l be pre|maturely|
|00002060| 20 74 65 72 6d 69 6e 61 | 74 65 64 2c 20 61 6e 74 | termina|ted, ant|
|00002070| 69 63 69 70 61 74 69 6e | 67 20 20 0a 58 09 6d 6f |icipatin|g .X.mo|
|00002080| 72 65 20 73 63 72 65 65 | 6e 20 75 70 64 61 74 65 |re scree|n update|
|00002090| 73 2e 20 54 68 69 73 20 | 66 6c 61 67 20 69 73 20 |s. This |flag is |
|000020a0| 46 41 4c 53 45 20 62 79 | 20 64 65 66 61 75 6c 74 |FALSE by| default|
|000020b0| 2e 20 20 0a 58 0a 58 45 | 58 41 4d 50 4c 45 53 0a |. .X.XE|XAMPLES.|
|000020c0| 58 0a 58 53 45 45 20 41 | 4c 53 4f 0a 58 09 5f 63 |X.XSEE A|LSO.X._c|
|000020d0| 75 72 73 65 73 73 63 62 | 28 29 3b 20 66 6c 75 73 |ursesscb|(); flus|
|000020e0| 68 69 6e 70 28 29 20 20 | 0a 58 0a 58 42 55 47 53 |hinp() |.X.XBUGS|
|000020f0| 0a 53 48 41 52 5f 45 4f | 46 0a 69 66 20 74 65 73 |.SHAR_EO|F.if tes|
|00002100| 74 20 38 33 30 20 2d 6e | 65 20 22 60 77 63 20 2d |t 830 -n|e "`wc -|
|00002110| 63 20 3c 20 27 63 62 72 | 65 61 6b 2e 6d 27 60 22 |c < 'cbr|eak.m'`"|
|00002120| 0a 74 68 65 6e 0a 09 65 | 63 68 6f 20 73 68 61 72 |.then..e|cho shar|
|00002130| 3a 20 65 72 72 6f 72 20 | 74 72 61 6e 73 6d 69 74 |: error |transmit|
|00002140| 74 69 6e 67 20 22 27 63 | 62 72 65 61 6b 2e 6d 27 |ting "'c|break.m'|
|00002150| 22 20 27 28 73 68 6f 75 | 6c 64 20 68 61 76 65 20 |" '(shou|ld have |
|00002160| 62 65 65 6e 20 38 33 30 | 20 63 68 61 72 61 63 74 |been 830| charact|
|00002170| 65 72 73 29 27 0a 66 69 | 0a 66 69 20 23 20 65 6e |ers)'.fi|.fi # en|
|00002180| 64 20 6f 66 20 6f 76 65 | 72 77 72 69 74 69 6e 67 |d of ove|rwriting|
|00002190| 20 63 68 65 63 6b 0a 65 | 63 68 6f 20 73 68 61 72 | check.e|cho shar|
|000021a0| 3a 20 65 78 74 72 61 63 | 74 69 6e 67 20 22 27 63 |: extrac|ting "'c|
|000021b0| 6c 65 61 72 2e 6d 27 22 | 20 27 28 34 34 33 20 63 |lear.m'"| '(443 c|
|000021c0| 68 61 72 61 63 74 65 72 | 73 29 27 0a 69 66 20 74 |haracter|s)'.if t|
|000021d0| 65 73 74 20 2d 66 20 27 | 63 6c 65 61 72 2e 6d 27 |est -f '|clear.m'|
|000021e0| 0a 74 68 65 6e 0a 09 65 | 63 68 6f 20 73 68 61 72 |.then..e|cho shar|
|000021f0| 3a 20 77 69 6c 6c 20 6e | 6f 74 20 6f 76 65 72 2d |: will n|ot over-|
|00002200| 77 72 69 74 65 20 65 78 | 69 73 74 69 6e 67 20 66 |write ex|isting f|
|00002210| 69 6c 65 20 22 27 63 6c | 65 61 72 2e 6d 27 22 0a |ile "'cl|ear.m'".|
|00002220| 65 6c 73 65 0a 73 65 64 | 20 27 73 2f 5e 58 2f 2f |else.sed| 's/^X//|
|00002230| 27 20 3c 3c 20 5c 53 48 | 41 52 5f 45 4f 46 20 3e |' << \SH|AR_EOF >|
|00002240| 20 27 63 6c 65 61 72 2e | 6d 27 0a 58 4e 41 4d 45 | 'clear.|m'.XNAME|
|00002250| 0a 58 09 77 63 6c 65 61 | 72 28 29 20 63 6c 65 61 |.X.wclea|r() clea|
|00002260| 72 28 29 20 2d 20 66 69 | 6c 6c 20 61 6c 6c 20 6c |r() - fi|ll all l|
|00002270| 69 6e 65 73 20 77 69 74 | 68 20 62 6c 61 6e 6b 73 |ines wit|h blanks|
|00002280| 0a 58 0a 58 53 59 4e 4f | 50 53 49 53 0a 58 09 23 |.X.XSYNO|PSIS.X.#|
|00002290| 69 6e 63 6c 75 64 65 20 | 3c 63 75 72 73 65 73 2e |include |<curses.|
|000022a0| 68 3e 0a 58 09 23 69 6e | 63 6c 75 64 65 20 3c 63 |h>.X.#in|clude <c|
|000022b0| 75 72 73 70 72 69 76 2e | 68 3e 0a 58 0a 58 09 76 |urspriv.|h>.X.X.v|
|000022c0| 6f 69 64 20 77 63 6c 65 | 61 72 28 77 69 6e 29 0a |oid wcle|ar(win).|
|000022d0| 58 09 57 49 4e 44 4f 57 | 20 2a 77 69 6e 3b 0a 58 |X.WINDOW| *win;.X|
|000022e0| 0a 58 09 76 6f 69 64 20 | 63 6c 65 61 72 28 29 0a |.X.void |clear().|
|000022f0| 58 0a 58 44 45 53 43 52 | 49 50 54 49 4f 4e 0a 58 |X.XDESCR|IPTION.X|
|00002300| 09 77 63 6c 65 61 72 28 | 29 20 66 69 6c 6c 73 20 |.wclear(|) fills |
|00002310| 61 6c 6c 20 6c 69 6e 65 | 73 20 6f 66 20 77 69 6e |all line|s of win|
|00002320| 64 6f 77 20 27 77 69 6e | 27 20 77 69 74 68 20 62 |dow 'win|' with b|
|00002330| 6c 61 6e 6b 73 2c 20 61 | 6e 64 20 20 0a 58 09 6d |lanks, a|nd .X.m|
|00002340| 61 72 6b 73 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |arks the| window |
|00002350| 74 6f 20 62 65 20 63 6c | 65 61 72 65 64 20 61 74 |to be cl|eared at|
|00002360| 20 6e 65 78 74 20 72 65 | 66 72 65 73 68 20 6f 70 | next re|fresh op|
|00002370| 65 72 61 74 69 6f 6e 2e | 20 20 0a 58 0a 58 09 63 |eration.| .X.X.c|
|00002380| 6c 65 61 72 28 29 20 66 | 69 6c 6c 73 20 61 6c 6c |lear() f|ills all|
|00002390| 20 6c 69 6e 65 73 20 6f | 66 20 73 74 64 73 63 72 | lines o|f stdscr|
|000023a0| 20 77 69 74 68 20 62 6c | 61 6e 6b 73 2c 20 61 6e | with bl|anks, an|
|000023b0| 64 20 6d 61 72 6b 73 20 | 20 0a 58 09 6d 61 72 6b |d marks | .X.mark|
|000023c0| 73 20 73 64 74 73 63 72 | 20 74 6f 20 62 65 20 63 |s sdtscr| to be c|
|000023d0| 6c 65 61 72 65 64 20 61 | 74 20 6e 65 78 74 20 72 |leared a|t next r|
|000023e0| 65 66 72 65 73 68 20 6f | 70 65 72 61 74 69 6f 6e |efresh o|peration|
|000023f0| 2e 20 20 0a 58 0a 58 45 | 58 41 4d 50 4c 45 53 0a |. .X.XE|XAMPLES.|
|00002400| 58 0a 58 53 45 45 20 41 | 4c 53 4f 0a 58 09 77 65 |X.XSEE A|LSO.X.we|
|00002410| 72 61 73 65 28 29 0a 58 | 0a 58 42 55 47 53 0a 53 |rase().X|.XBUGS.S|
|00002420| 48 41 52 5f 45 4f 46 0a | 69 66 20 74 65 73 74 20 |HAR_EOF.|if test |
|00002430| 34 34 33 20 2d 6e 65 20 | 22 60 77 63 20 2d 63 20 |443 -ne |"`wc -c |
|00002440| 3c 20 27 63 6c 65 61 72 | 2e 6d 27 60 22 0a 74 68 |< 'clear|.m'`".th|
|00002450| 65 6e 0a 09 65 63 68 6f | 20 73 68 61 72 3a 20 65 |en..echo| shar: e|
|00002460| 72 72 6f 72 20 74 72 61 | 6e 73 6d 69 74 74 69 6e |rror tra|nsmittin|
|00002470| 67 20 22 27 63 6c 65 61 | 72 2e 6d 27 22 20 27 28 |g "'clea|r.m'" '(|
|00002480| 73 68 6f 75 6c 64 20 68 | 61 76 65 20 62 65 65 6e |should h|ave been|
|00002490| 20 34 34 33 20 63 68 61 | 72 61 63 74 65 72 73 29 | 443 cha|racters)|
|000024a0| 27 0a 66 69 0a 66 69 20 | 23 20 65 6e 64 20 6f 66 |'.fi.fi |# end of|
|000024b0| 20 6f 76 65 72 77 72 69 | 74 69 6e 67 20 63 68 65 | overwri|ting che|
|000024c0| 63 6b 0a 65 63 68 6f 20 | 73 68 61 72 3a 20 65 78 |ck.echo |shar: ex|
|000024d0| 74 72 61 63 74 69 6e 67 | 20 22 27 63 6c 65 61 72 |tracting| "'clear|
|000024e0| 6f 6b 2e 6d 27 22 20 27 | 28 31 36 33 34 20 63 68 |ok.m'" '|(1634 ch|
|000024f0| 61 72 61 63 74 65 72 73 | 29 27 0a 69 66 20 74 65 |aracters|)'.if te|
|00002500| 73 74 20 2d 66 20 27 63 | 6c 65 61 72 6f 6b 2e 6d |st -f 'c|learok.m|
|00002510| 27 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |'.then..|echo sha|
|00002520| 72 3a 20 77 69 6c 6c 20 | 6e 6f 74 20 6f 76 65 72 |r: will |not over|
|00002530| 2d 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 20 |-write e|xisting |
|00002540| 66 69 6c 65 20 22 27 63 | 6c 65 61 72 6f 6b 2e 6d |file "'c|learok.m|
|00002550| 27 22 0a 65 6c 73 65 0a | 73 65 64 20 27 73 2f 5e |'".else.|sed 's/^|
|00002560| 58 2f 2f 27 20 3c 3c 20 | 5c 53 48 41 52 5f 45 4f |X//' << |\SHAR_EO|
|00002570| 46 20 3e 20 27 63 6c 65 | 61 72 6f 6b 2e 6d 27 0a |F > 'cle|arok.m'.|
|00002580| 58 4e 41 4d 45 0a 58 09 | 69 64 6c 6f 6b 28 29 20 |XNAME.X.|idlok() |
|00002590| 63 6c 65 61 72 6f 6b 28 | 29 20 6c 65 61 76 65 6f |clearok(|) leaveo|
|000025a0| 6b 28 29 20 73 63 72 6f | 6c 6c 6f 6b 28 29 20 6e |k() scro|llok() n|
|000025b0| 6f 64 65 6c 61 79 28 29 | 20 6b 65 79 70 61 64 28 |odelay()| keypad(|
|000025c0| 29 20 0a 58 09 6d 65 74 | 61 28 29 20 63 75 72 73 |) .X.met|a() curs|
|000025d0| 6f 66 66 28 29 20 63 75 | 72 73 6f 6e 28 29 20 2d |off() cu|rson() -|
|000025e0| 20 73 65 74 20 6f 72 20 | 63 6c 65 61 72 20 76 61 | set or |clear va|
|000025f0| 72 69 6f 75 73 20 6f 70 | 74 69 6f 6e 73 20 61 6e |rious op|tions an|
|00002600| 64 20 66 6c 61 67 73 0a | 58 0a 58 53 59 4e 4f 50 |d flags.|X.XSYNOP|
|00002610| 53 49 53 0a 58 09 23 69 | 6e 63 6c 75 64 65 20 3c |SIS.X.#i|nclude <|
|00002620| 63 75 72 73 65 73 2e 68 | 3e 0a 58 09 23 69 6e 63 |curses.h|>.X.#inc|
|00002630| 6c 75 64 65 20 3c 63 75 | 72 73 70 72 69 76 2e 68 |lude <cu|rspriv.h|
|00002640| 3e 0a 58 0a 58 09 76 6f | 69 64 20 69 64 6c 6f 6b |>.X.X.vo|id idlok|
|00002650| 28 77 69 6e 2c 20 66 6c | 61 67 29 0a 58 09 57 49 |(win, fl|ag).X.WI|
|00002660| 4e 44 4f 57 20 2a 77 69 | 6e 3b 0a 58 09 62 6f 6f |NDOW *wi|n;.X.boo|
|00002670| 6c 20 66 6c 61 67 3b 0a | 58 0a 58 09 76 6f 69 64 |l flag;.|X.X.void|
|00002680| 20 63 6c 65 61 72 6f 6b | 28 77 69 6e 2c 20 66 6c | clearok|(win, fl|
|00002690| 61 67 29 0a 58 09 57 49 | 4e 44 4f 57 20 2a 77 69 |ag).X.WI|NDOW *wi|
|000026a0| 6e 3b 0a 58 09 62 6f 6f | 6c 20 66 6c 61 67 3b 0a |n;.X.boo|l flag;.|
|000026b0| 58 0a 58 09 76 6f 69 64 | 20 6c 65 61 76 65 6f 6b |X.X.void| leaveok|
|000026c0| 28 77 69 6e 2c 20 66 6c | 61 67 29 0a 58 09 57 49 |(win, fl|ag).X.WI|
|000026d0| 4e 44 4f 57 20 2a 77 69 | 6e 3b 0a 58 09 62 6f 6f |NDOW *wi|n;.X.boo|
|000026e0| 6c 20 66 6c 61 67 3b 0a | 58 0a 58 09 76 6f 69 64 |l flag;.|X.X.void|
|000026f0| 20 73 63 72 6f 6c 6c 6f | 6b 28 77 69 6e 2c 20 66 | scrollo|k(win, f|
|00002700| 6c 61 67 29 0a 58 09 57 | 49 4e 44 4f 57 20 2a 77 |lag).X.W|INDOW *w|
|00002710| 69 6e 3b 0a 58 09 62 6f | 6f 6c 20 66 6c 61 67 3b |in;.X.bo|ol flag;|
|00002720| 0a 58 0a 58 09 76 6f 69 | 64 20 6e 6f 64 65 6c 61 |.X.X.voi|d nodela|
|00002730| 79 28 77 69 6e 2c 20 66 | 6c 61 67 29 0a 58 09 57 |y(win, f|lag).X.W|
|00002740| 49 4e 44 4f 57 20 2a 77 | 69 6e 3b 0a 58 09 62 6f |INDOW *w|in;.X.bo|
|00002750| 6f 6c 20 66 6c 61 67 3b | 0a 58 0a 58 09 76 6f 69 |ol flag;|.X.X.voi|
|00002760| 64 20 6b 65 79 70 61 64 | 28 77 69 6e 2c 20 66 6c |d keypad|(win, fl|
|00002770| 61 67 29 0a 58 09 57 49 | 4e 44 4f 57 20 2a 77 69 |ag).X.WI|NDOW *wi|
|00002780| 6e 3b 0a 58 09 62 6f 6f | 6c 20 66 6c 61 67 3b 0a |n;.X.boo|l flag;.|
|00002790| 58 0a 58 09 76 6f 69 64 | 20 6d 65 74 61 28 77 69 |X.X.void| meta(wi|
|000027a0| 6e 2c 20 66 6c 61 67 29 | 0a 58 09 57 49 4e 44 4f |n, flag)|.X.WINDO|
|000027b0| 57 20 2a 77 69 6e 3b 0a | 58 09 62 6f 6f 6c 20 66 |W *win;.|X.bool f|
|000027c0| 6c 61 67 3b 0a 58 0a 58 | 09 76 6f 69 64 20 63 75 |lag;.X.X|.void cu|
|000027d0| 72 73 6f 66 66 28 29 0a | 58 0a 58 09 76 6f 69 64 |rsoff().|X.X.void|
|000027e0| 20 63 75 72 73 6f 6e 28 | 29 0a 58 0a 58 44 45 53 | curson(|).X.XDES|
|000027f0| 43 52 49 50 54 49 4f 4e | 0a 58 09 69 64 6c 6f 6b |CRIPTION|.X.idlok|
|00002800| 28 29 20 69 73 20 75 73 | 65 64 20 74 6f 20 73 65 |() is us|ed to se|
|00002810| 74 20 66 6c 61 67 20 66 | 6f 72 20 75 73 69 6e 67 |t flag f|or using|
|00002820| 20 74 68 65 20 74 65 72 | 6d 69 6e 61 6c 20 69 6e | the ter|minal in|
|00002830| 73 65 72 74 2f 20 20 0a | 58 09 64 65 6c 65 74 65 |sert/ .|X.delete|
|00002840| 20 6c 69 6e 65 20 63 61 | 70 61 62 69 6c 69 74 69 | line ca|pabiliti|
|00002850| 65 73 2e 20 54 68 69 73 | 20 69 73 20 6e 6f 74 20 |es. This| is not |
|00002860| 72 65 6c 65 76 61 6e 74 | 20 66 6f 72 20 74 68 65 |relevant| for the|
|00002870| 20 50 43 20 20 0a 58 09 | 76 65 72 73 69 6f 6e 20 | PC .X.|version |
|00002880| 6f 66 20 63 75 72 73 65 | 73 2c 20 61 6e 64 20 74 |of curse|s, and t|
|00002890| 68 75 73 20 6e 6f 74 68 | 69 6e 67 20 69 73 20 64 |hus noth|ing is d|
|000028a0| 6f 6e 65 2e 20 20 0a 58 | 0a 58 09 63 6c 65 61 72 |one. .X|.X.clear|
|000028b0| 6f 6b 28 29 20 6d 61 72 | 6b 73 20 77 69 6e 64 6f |ok() mar|ks windo|
|000028c0| 77 20 27 77 69 6e 27 20 | 74 6f 20 63 61 75 73 65 |w 'win' |to cause|
|000028d0| 20 73 63 72 65 65 6e 20 | 63 6c 65 61 72 69 6e 67 | screen |clearing|
|000028e0| 20 61 6e 64 20 20 0a 58 | 09 72 65 64 72 61 77 20 | and .X|.redraw |
|000028f0| 74 68 65 20 6e 65 78 74 | 20 74 69 6d 65 20 61 20 |the next| time a |
|00002900| 72 65 66 72 65 73 68 20 | 69 73 20 64 6f 6e 65 2e |refresh |is done.|
|00002910| 20 20 0a 58 0a 58 09 6c | 65 61 76 65 6f 6b 28 29 | .X.X.l|eaveok()|
|00002920| 20 6d 61 72 6b 73 20 77 | 69 6e 64 6f 77 20 27 77 | marks w|indow 'w|
|00002930| 69 6e 27 20 74 6f 20 61 | 6c 6c 6f 77 20 74 68 65 |in' to a|llow the|
|00002940| 20 75 70 64 61 74 65 20 | 72 6f 75 74 69 6e 65 73 | update |routines|
|00002950| 20 20 0a 58 09 74 6f 20 | 6c 65 61 76 65 20 74 68 | .X.to |leave th|
|00002960| 65 20 68 61 72 64 77 61 | 72 65 20 63 75 72 73 6f |e hardwa|re curso|
|00002970| 72 20 77 68 65 72 65 20 | 69 74 20 68 61 70 70 65 |r where |it happe|
|00002980| 6e 73 20 74 6f 20 62 65 | 20 61 74 20 74 68 65 20 |ns to be| at the |
|00002990| 20 0a 58 09 65 6e 64 20 | 6f 66 20 75 70 64 61 74 | .X.end |of updat|
|000029a0| 65 2e 20 55 73 75 61 6c | 6c 79 20 75 73 65 64 20 |e. Usual|ly used |
|000029b0| 69 6e 20 63 6f 6d 62 69 | 6e 61 74 69 6f 6e 20 77 |in combi|nation w|
|000029c0| 69 74 68 20 63 75 72 73 | 6f 66 66 28 29 2e 20 20 |ith curs|off(). |
|000029d0| 0a 58 0a 58 09 73 63 72 | 6f 6c 6c 6f 6b 28 29 20 |.X.X.scr|ollok() |
|000029e0| 6d 61 72 6b 73 20 77 69 | 6e 64 6f 77 20 27 77 69 |marks wi|ndow 'wi|
|000029f0| 6e 27 20 74 6f 20 61 6c | 6c 6f 77 20 74 68 65 20 |n' to al|low the |
|00002a00| 73 63 72 6f 6c 6c 69 6e | 67 20 72 65 67 69 6f 6e |scrollin|g region|
|00002a10| 20 20 0a 58 09 6f 66 20 | 69 74 20 74 6f 20 61 63 | .X.of |it to ac|
|00002a20| 74 75 61 6c 6c 79 20 73 | 63 72 6f 6c 6c 2e 20 20 |tually s|croll. |
|00002a30| 0a 58 0a 58 09 6e 6f 64 | 65 6c 61 79 28 29 20 6d |.X.X.nod|elay() m|
|00002a40| 61 72 6b 73 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |arks the| window |
|00002a50| 74 6f 20 6d 61 6b 65 20 | 63 68 61 72 61 63 74 65 |to make |characte|
|00002a60| 72 20 69 6e 70 75 74 20 | 6e 6f 6e 2d 20 20 0a 58 |r input |non- .X|
|00002a70| 09 77 61 69 74 69 6e 67 | 2c 20 69 2e 65 2e 20 69 |.waiting|, i.e. i|
|00002a80| 66 20 74 68 65 72 65 20 | 69 73 20 6e 6f 20 63 68 |f there |is no ch|
|00002a90| 61 72 61 63 74 65 72 20 | 74 6f 20 67 65 74 2c 20 |aracter |to get, |
|00002aa0| 2d 31 20 77 69 6c 6c 20 | 62 65 20 20 0a 58 09 72 |-1 will |be .X.r|
|00002ab0| 65 74 75 72 6e 65 64 2e | 20 20 0a 58 0a 58 09 6b |eturned.| .X.X.k|
|00002ac0| 65 79 70 61 64 28 29 20 | 6d 61 72 6b 73 20 77 69 |eypad() |marks wi|
|00002ad0| 6e 64 6f 77 20 27 77 69 | 6e 27 20 74 6f 20 75 73 |ndow 'wi|n' to us|
|00002ae0| 65 20 74 68 65 20 73 70 | 65 63 69 61 6c 20 6b 65 |e the sp|ecial ke|
|00002af0| 79 70 61 64 20 6d 6f 64 | 65 2e 20 20 0a 58 0a 58 |ypad mod|e. .X.X|
|00002b00| 09 6d 65 74 61 28 29 20 | 61 6c 6c 6f 77 73 20 75 |.meta() |allows u|
|00002b10| 73 65 20 6f 66 20 61 6e | 79 20 61 6c 74 65 72 6e |se of an|y altern|
|00002b20| 61 74 65 20 63 68 61 72 | 61 63 74 65 72 20 73 65 |ate char|acter se|
|00002b30| 74 20 61 6c 6c 6f 77 65 | 64 20 62 79 20 20 0a 58 |t allowe|d by .X|
|00002b40| 09 74 68 65 20 74 65 72 | 6d 69 6e 61 6c 2e 20 57 |.the ter|minal. W|
|00002b50| 65 20 61 6c 77 61 79 73 | 20 61 6c 6c 6f 77 20 74 |e always| allow t|
|00002b60| 68 69 73 20 6f 6e 20 74 | 68 65 20 50 43 2c 20 73 |his on t|he PC, s|
|00002b70| 6f 20 74 68 69 73 20 6f | 6e 65 20 20 0a 58 09 64 |o this o|ne .X.d|
|00002b80| 6f 65 73 20 6e 6f 74 68 | 69 6e 67 2e 20 20 0a 58 |oes noth|ing. .X|
|00002b90| 0a 58 09 63 75 72 73 6f | 66 66 28 29 20 74 75 72 |.X.curso|ff() tur|
|00002ba0| 6e 73 20 6f 66 66 20 74 | 68 65 20 68 61 72 64 77 |ns off t|he hardw|
|00002bb0| 61 72 65 20 63 75 72 73 | 6f 72 2e 20 20 0a 58 0a |are curs|or. .X.|
|00002bc0| 58 09 63 75 72 73 6f 6e | 28 29 20 74 75 72 6e 73 |X.curson|() turns|
|00002bd0| 20 6f 6e 20 74 68 65 20 | 68 61 72 64 77 61 72 65 | on the |hardware|
|00002be0| 20 63 75 72 73 6f 72 2e | 20 20 0a 58 0a 58 45 58 | cursor.| .X.XEX|
|00002bf0| 41 4d 50 4c 45 53 0a 58 | 0a 58 53 45 45 20 41 4c |AMPLES.X|.XSEE AL|
|00002c00| 53 4f 0a 58 09 5f 63 75 | 72 73 65 73 67 63 6d 6f |SO.X._cu|rsesgcmo|
|00002c10| 64 65 28 29 3b 20 5f 63 | 75 72 73 65 73 63 6d 6f |de(); _c|ursescmo|
|00002c20| 64 65 28 29 0a 58 0a 58 | 42 55 47 53 0a 53 48 41 |de().X.X|BUGS.SHA|
|00002c30| 52 5f 45 4f 46 0a 69 66 | 20 74 65 73 74 20 31 36 |R_EOF.if| test 16|
|00002c40| 33 34 20 2d 6e 65 20 22 | 60 77 63 20 2d 63 20 3c |34 -ne "|`wc -c <|
|00002c50| 20 27 63 6c 65 61 72 6f | 6b 2e 6d 27 60 22 0a 74 | 'clearo|k.m'`".t|
|00002c60| 68 65 6e 0a 09 65 63 68 | 6f 20 73 68 61 72 3a 20 |hen..ech|o shar: |
|00002c70| 65 72 72 6f 72 20 74 72 | 61 6e 73 6d 69 74 74 69 |error tr|ansmitti|
|00002c80| 6e 67 20 22 27 63 6c 65 | 61 72 6f 6b 2e 6d 27 22 |ng "'cle|arok.m'"|
|00002c90| 20 27 28 73 68 6f 75 6c | 64 20 68 61 76 65 20 62 | '(shoul|d have b|
|00002ca0| 65 65 6e 20 31 36 33 34 | 20 63 68 61 72 61 63 74 |een 1634| charact|
|00002cb0| 65 72 73 29 27 0a 66 69 | 0a 66 69 20 23 20 65 6e |ers)'.fi|.fi # en|
|00002cc0| 64 20 6f 66 20 6f 76 65 | 72 77 72 69 74 69 6e 67 |d of ove|rwriting|
|00002cd0| 20 63 68 65 63 6b 0a 65 | 63 68 6f 20 73 68 61 72 | check.e|cho shar|
|00002ce0| 3a 20 65 78 74 72 61 63 | 74 69 6e 67 20 22 27 63 |: extrac|ting "'c|
|00002cf0| 6c 65 61 72 73 63 72 65 | 65 6e 2e 6d 27 22 20 27 |learscre|en.m'" '|
|00002d00| 28 31 36 32 39 20 63 68 | 61 72 61 63 74 65 72 73 |(1629 ch|aracters|
|00002d10| 29 27 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 63 |)'.if te|st -f 'c|
|00002d20| 6c 65 61 72 73 63 72 65 | 65 6e 2e 6d 27 0a 74 68 |learscre|en.m'.th|
|00002d30| 65 6e 0a 09 65 63 68 6f | 20 73 68 61 72 3a 20 77 |en..echo| shar: w|
|00002d40| 69 6c 6c 20 6e 6f 74 20 | 6f 76 65 72 2d 77 72 69 |ill not |over-wri|
|00002d50| 74 65 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |te exist|ing file|
|00002d60| 20 22 27 63 6c 65 61 72 | 73 63 72 65 65 6e 2e 6d | "'clear|screen.m|
|00002d70| 27 22 0a 65 6c 73 65 0a | 73 65 64 20 27 73 2f 5e |'".else.|sed 's/^|
|00002d80| 58 2f 2f 27 20 3c 3c 20 | 5c 53 48 41 52 5f 45 4f |X//' << |\SHAR_EO|
|00002d90| 46 20 3e 20 27 63 6c 65 | 61 72 73 63 72 65 65 6e |F > 'cle|arscreen|
|00002da0| 2e 6d 27 0a 58 4e 41 4d | 45 0a 58 09 64 6f 75 70 |.m'.XNAM|E.X.doup|
|00002db0| 64 61 74 65 28 29 20 63 | 6c 72 75 70 64 61 74 65 |date() c|lrupdate|
|00002dc0| 28 29 20 2d 20 75 70 64 | 61 74 65 20 73 63 72 65 |() - upd|ate scre|
|00002dd0| 65 6e 0a 58 09 74 72 61 | 6e 73 66 6f 72 6d 6c 69 |en.X.tra|nsformli|
|00002de0| 6e 65 28 29 20 2d 20 75 | 70 64 61 74 65 20 70 68 |ne() - u|pdate ph|
|00002df0| 79 73 69 63 61 6c 20 6c | 69 6e 65 0a 58 09 63 6c |ysical l|ine.X.cl|
|00002e00| 65 61 72 73 63 72 65 65 | 6e 28 29 20 2d 20 63 6c |earscree|n() - cl|
|00002e10| 65 61 72 20 70 68 79 73 | 69 63 61 6c 20 73 63 72 |ear phys|ical scr|
|00002e20| 65 65 6e 20 20 0a 58 09 | 67 6f 74 6f 78 79 28 29 |een .X.|gotoxy()|
|00002e30| 20 2d 20 6d 6f 76 65 20 | 70 68 79 73 69 63 61 6c | - move |physical|
|00002e40| 20 63 75 72 73 6f 72 20 | 74 6f 20 64 65 73 69 72 | cursor |to desir|
|00002e50| 65 64 20 61 64 64 72 65 | 73 73 20 20 0a 58 09 70 |ed addre|ss .X.p|
|00002e60| 75 74 63 68 61 72 28 29 | 20 2d 20 77 72 69 74 65 |utchar()| - write|
|00002e70| 20 63 68 61 72 61 63 74 | 65 72 20 77 69 74 68 20 | charact|er with |
|00002e80| 61 74 74 72 69 62 75 74 | 65 73 20 74 6f 20 74 68 |attribut|es to th|
|00002e90| 65 20 70 68 79 73 69 63 | 61 6c 20 73 63 72 65 65 |e physic|al scree|
|00002ea0| 6e 0a 58 0a 58 53 59 4e | 4f 50 53 49 53 0a 58 09 |n.X.XSYN|OPSIS.X.|
|00002eb0| 23 69 6e 63 6c 75 64 65 | 20 3c 63 75 72 73 65 73 |#include| <curses|
|00002ec0| 2e 68 3e 0a 58 09 23 69 | 6e 63 6c 75 64 65 20 3c |.h>.X.#i|nclude <|
|00002ed0| 63 75 72 73 70 72 69 76 | 2e 68 3e 0a 58 0a 58 09 |curspriv|.h>.X.X.|
|00002ee0| 76 6f 69 64 20 64 6f 75 | 70 64 61 74 65 28 29 0a |void dou|pdate().|
|00002ef0| 58 0a 58 09 73 74 61 74 | 69 63 20 76 6f 69 64 20 |X.X.stat|ic void |
|00002f00| 63 6c 72 75 70 64 61 74 | 65 28 73 63 72 29 0a 58 |clrupdat|e(scr).X|
|00002f10| 09 57 49 4e 44 4f 57 20 | 2a 73 63 72 3b 0a 58 0a |.WINDOW |*scr;.X.|
|00002f20| 58 09 73 74 61 74 69 63 | 20 62 6f 6f 6c 20 74 72 |X.static| bool tr|
|00002f30| 61 6e 73 66 6f 72 6d 6c | 69 6e 65 28 6c 69 6e 65 |ansforml|ine(line|
|00002f40| 6e 6f 29 0a 58 09 72 65 | 67 69 73 74 65 72 20 69 |no).X.re|gister i|
|00002f50| 6e 74 20 6c 69 6e 65 6e | 6f 3b 0a 58 0a 58 09 73 |nt linen|o;.X.X.s|
|00002f60| 74 61 74 69 63 20 76 6f | 69 64 20 63 6c 65 61 72 |tatic vo|id clear|
|00002f70| 73 63 72 65 65 6e 28 29 | 0a 58 0a 58 09 73 74 61 |screen()|.X.X.sta|
|00002f80| 74 69 63 20 76 6f 69 64 | 20 67 6f 74 6f 78 79 28 |tic void| gotoxy(|
|00002f90| 72 6f 77 2c 63 6f 6c 29 | 0a 58 09 69 6e 74 20 72 |row,col)|.X.int r|
|00002fa0| 6f 77 2c 20 63 6f 6c 3b | 0a 58 0a 58 09 73 74 61 |ow, col;|.X.X.sta|
|00002fb0| 74 69 63 20 76 6f 69 64 | 20 50 75 74 63 68 61 72 |tic void| Putchar|
|00002fc0| 28 63 68 29 0a 58 09 69 | 6e 74 20 63 68 3b 0a 58 |(ch).X.i|nt ch;.X|
|00002fd0| 0a 58 44 45 53 43 52 49 | 50 54 49 4f 4e 0a 58 09 |.XDESCRI|PTION.X.|
|00002fe0| 64 6f 75 70 64 61 74 65 | 28 29 20 75 70 64 61 74 |doupdate|() updat|
|00002ff0| 65 73 20 74 68 65 20 70 | 68 79 73 69 63 61 6c 20 |es the p|hysical |
|00003000| 73 63 72 65 65 6e 20 74 | 6f 20 6c 6f 6f 6b 20 6c |screen t|o look l|
|00003010| 69 6b 65 20 5f 63 75 72 | 73 2d 20 20 0a 58 09 76 |ike _cur|s- .X.v|
|00003020| 61 72 2e 74 6d 70 77 69 | 6e 20 69 66 20 63 75 72 |ar.tmpwi|n if cur|
|00003030| 73 63 72 20 69 73 20 6e | 6f 74 20 27 43 6c 65 61 |scr is n|ot 'Clea|
|00003040| 72 2d 6d 61 72 6b 65 64 | 27 2e 20 4f 74 68 65 72 |r-marked|'. Other|
|00003050| 77 69 73 65 20 69 74 20 | 20 0a 58 09 75 70 64 61 |wise it | .X.upda|
|00003060| 74 65 73 20 74 68 65 20 | 73 63 72 65 65 6e 20 74 |tes the |screen t|
|00003070| 6f 20 6c 6f 6f 6b 20 6c | 69 6b 65 20 63 75 72 73 |o look l|ike curs|
|00003080| 63 72 2e 20 20 0a 58 0a | 58 09 63 6c 72 75 70 64 |cr. .X.|X.clrupd|
|00003090| 61 74 65 28 29 20 75 70 | 64 61 74 65 73 20 74 68 |ate() up|dates th|
|000030a0| 65 20 73 63 72 65 65 6e | 20 62 79 20 63 6c 65 61 |e screen| by clea|
|000030b0| 72 69 6e 67 20 69 74 20 | 61 6e 64 20 74 68 65 6e |ring it |and then|
|000030c0| 20 20 0a 58 09 72 65 64 | 72 61 77 20 69 74 20 69 | .X.red|raw it i|
|000030d0| 6e 20 69 74 27 73 20 65 | 6e 74 69 72 65 74 79 2e |n it's e|ntirety.|
|000030e0| 20 49 66 20 5f 63 75 72 | 73 76 61 72 2e 72 65 66 | If _cur|svar.ref|
|000030f0| 72 62 72 6b 20 69 73 20 | 54 52 55 45 2c 20 61 6e |rbrk is |TRUE, an|
|00003100| 64 20 20 0a 58 09 74 68 | 65 72 65 20 69 73 20 70 |d .X.th|ere is p|
|00003110| 65 6e 64 69 6e 67 20 69 | 6e 70 75 74 20 63 68 61 |ending i|nput cha|
|00003120| 72 61 63 74 65 72 73 2c | 20 74 68 65 20 75 70 64 |racters,| the upd|
|00003130| 61 74 65 20 77 69 6c 6c | 20 62 65 20 70 72 65 2d |ate will| be pre-|
|00003140| 20 20 0a 58 09 6d 61 74 | 75 72 65 6c 79 20 74 65 | .X.mat|urely te|
|00003150| 72 6d 69 6e 61 74 65 64 | 2e 20 20 0a 58 0a 58 09 |rminated|. .X.X.|
|00003160| 74 72 61 6e 73 66 6f 72 | 6d 6c 69 6e 65 28 29 20 |transfor|mline() |
|00003170| 75 70 64 61 74 65 73 20 | 74 68 65 20 67 69 76 65 |updates |the give|
|00003180| 6e 20 70 68 79 73 69 63 | 61 6c 20 6c 69 6e 65 20 |n physic|al line |
|00003190| 74 6f 20 6c 6f 6f 6b 20 | 20 0a 58 09 6c 69 6b 65 |to look | .X.like|
|000031a0| 20 74 68 65 20 63 6f 72 | 72 65 73 70 6f 6e 64 69 | the cor|respondi|
|000031b0| 6e 67 20 6c 69 6e 65 20 | 69 6e 20 5f 63 75 72 73 |ng line |in _curs|
|000031c0| 76 61 72 2e 74 6d 70 77 | 69 6e 2e 20 54 72 61 6e |var.tmpw|in. Tran|
|000031d0| 73 66 6f 72 6d 2d 20 20 | 0a 58 09 72 65 74 75 72 |sform- |.X.retur|
|000031e0| 6e 73 20 31 20 69 66 20 | 70 72 65 6d 61 74 75 72 |ns 1 if |prematur|
|000031f0| 65 20 72 65 66 72 65 73 | 68 20 65 6e 64 20 69 73 |e refres|h end is|
|00003200| 20 61 6c 6c 6f 77 65 64 | 2c 20 61 6e 64 20 74 68 | allowed|, and th|
|00003210| 65 72 65 20 69 73 20 20 | 0a 58 09 61 6e 20 69 6e |ere is |.X.an in|
|00003220| 70 75 74 20 63 68 61 72 | 61 63 74 65 72 20 70 65 |put char|acter pe|
|00003230| 6e 64 69 6e 67 2e 20 20 | 0a 58 0a 58 09 63 6c 65 |nding. |.X.X.cle|
|00003240| 61 72 73 63 72 65 65 6e | 28 29 20 63 6c 65 61 72 |arscreen|() clear|
|00003250| 73 20 74 68 65 20 70 68 | 79 73 69 63 61 6c 20 73 |s the ph|ysical s|
|00003260| 63 72 65 65 6e 20 61 6e | 64 20 70 75 74 73 20 74 |creen an|d puts t|
|00003270| 68 65 20 63 75 72 73 6f | 72 20 20 0a 58 09 69 6e |he curso|r .X.in|
|00003280| 20 74 68 65 20 68 6f 6d | 65 20 70 6f 73 69 74 69 | the hom|e positi|
|00003290| 6f 6e 2e 20 20 0a 58 0a | 58 09 67 6f 74 6f 78 79 |on. .X.|X.gotoxy|
|000032a0| 28 29 20 6d 6f 76 65 73 | 20 74 68 65 20 70 68 79 |() moves| the phy|
|000032b0| 73 69 63 61 6c 20 63 75 | 72 73 6f 72 20 74 6f 20 |sical cu|rsor to |
|000032c0| 74 68 65 20 64 65 73 69 | 72 65 64 20 61 64 64 72 |the desi|red addr|
|000032d0| 65 73 73 20 6f 6e 20 20 | 0a 58 09 74 68 65 20 73 |ess on |.X.the s|
|000032e0| 63 72 65 65 6e 2e 20 57 | 65 20 64 6f 6e 27 74 20 |creen. W|e don't |
|000032f0| 6f 70 74 69 6d 69 7a 65 | 20 68 65 72 65 20 2d 20 |optimize| here - |
|00003300| 6f 6e 20 61 20 50 43 2c | 20 69 74 20 74 61 6b 65 |on a PC,| it take|
|00003310| 73 20 6d 6f 72 65 20 20 | 0a 58 09 74 69 6d 65 20 |s more |.X.time |
|00003320| 74 6f 20 6f 70 74 69 6d | 69 7a 65 20 74 68 61 6e |to optim|ize than|
|00003330| 20 74 6f 20 64 6f 20 74 | 68 69 6e 67 73 20 64 69 | to do t|hings di|
|00003340| 72 65 63 74 6c 79 2e 20 | 20 0a 58 0a 58 09 70 75 |rectly. | .X.X.pu|
|00003350| 74 63 68 61 72 28 29 20 | 77 72 69 74 65 73 20 61 |tchar() |writes a|
|00003360| 20 63 68 61 72 61 63 74 | 65 72 2c 20 77 69 74 68 | charact|er, with|
|00003370| 20 61 74 74 72 69 62 75 | 74 65 73 2c 20 74 6f 20 | attribu|tes, to |
|00003380| 74 68 65 20 70 68 79 73 | 69 2d 20 20 0a 58 09 63 |the phys|i- .X.c|
|00003390| 61 6c 20 73 63 72 65 65 | 6e 2c 20 62 75 74 20 61 |al scree|n, but a|
|000033a0| 76 6f 69 64 73 20 77 72 | 69 74 69 6e 67 20 74 6f |voids wr|iting to|
|000033b0| 20 74 68 65 20 6c 6f 77 | 65 72 20 72 69 67 68 74 | the low|er right|
|000033c0| 20 73 63 72 65 65 6e 20 | 20 0a 58 09 70 6f 73 69 | screen | .X.posi|
|000033d0| 74 69 6f 6e 2e 20 20 0a | 58 0a 58 45 58 41 4d 50 |tion. .|X.XEXAMP|
|000033e0| 4c 45 53 0a 58 0a 58 53 | 45 45 20 41 4c 53 4f 0a |LES.X.XS|EE ALSO.|
|000033f0| 58 09 5f 63 75 72 73 65 | 73 70 65 6e 64 63 68 28 |X._curse|spendch(|
|00003400| 29 3b 20 5f 63 75 72 73 | 65 73 73 63 72 6f 6c 6c |); _curs|esscroll|
|00003410| 28 29 3b 20 5f 63 75 72 | 73 65 73 63 75 72 73 6f |(); _cur|sescurso|
|00003420| 72 28 29 3b 20 5f 63 75 | 72 73 65 73 63 61 74 74 |r(); _cu|rsescatt|
|00003430| 72 28 29 0a 58 0a 58 42 | 55 47 53 0a 53 48 41 52 |r().X.XB|UGS.SHAR|
|00003440| 5f 45 4f 46 0a 69 66 20 | 74 65 73 74 20 31 36 32 |_EOF.if |test 162|
|00003450| 39 20 2d 6e 65 20 22 60 | 77 63 20 2d 63 20 3c 20 |9 -ne "`|wc -c < |
|00003460| 27 63 6c 65 61 72 73 63 | 72 65 65 6e 2e 6d 27 60 |'clearsc|reen.m'`|
|00003470| 22 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |".then..|echo sha|
|00003480| 72 3a 20 65 72 72 6f 72 | 20 74 72 61 6e 73 6d 69 |r: error| transmi|
|00003490| 74 74 69 6e 67 20 22 27 | 63 6c 65 61 72 73 63 72 |tting "'|clearscr|
|000034a0| 65 65 6e 2e 6d 27 22 20 | 27 28 73 68 6f 75 6c 64 |een.m'" |'(should|
|000034b0| 20 68 61 76 65 20 62 65 | 65 6e 20 31 36 32 39 20 | have be|en 1629 |
|000034c0| 63 68 61 72 61 63 74 65 | 72 73 29 27 0a 66 69 0a |characte|rs)'.fi.|
|000034d0| 66 69 20 23 20 65 6e 64 | 20 6f 66 20 6f 76 65 72 |fi # end| of over|
|000034e0| 77 72 69 74 69 6e 67 20 | 63 68 65 63 6b 0a 65 63 |writing |check.ec|
|000034f0| 68 6f 20 73 68 61 72 3a | 20 65 78 74 72 61 63 74 |ho shar:| extract|
|00003500| 69 6e 67 20 22 27 63 6c | 72 62 6f 74 2e 6d 27 22 |ing "'cl|rbot.m'"|
|00003510| 20 27 28 38 34 32 20 63 | 68 61 72 61 63 74 65 72 | '(842 c|haracter|
|00003520| 73 29 27 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |s)'.if t|est -f '|
|00003530| 63 6c 72 62 6f 74 2e 6d | 27 0a 74 68 65 6e 0a 09 |clrbot.m|'.then..|
|00003540| 65 63 68 6f 20 73 68 61 | 72 3a 20 77 69 6c 6c 20 |echo sha|r: will |
|00003550| 6e 6f 74 20 6f 76 65 72 | 2d 77 72 69 74 65 20 65 |not over|-write e|
|00003560| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 22 27 63 |xisting |file "'c|
|00003570| 6c 72 62 6f 74 2e 6d 27 | 22 0a 65 6c 73 65 0a 73 |lrbot.m'|".else.s|
|00003580| 65 64 20 27 73 2f 5e 58 | 2f 2f 27 20 3c 3c 20 5c |ed 's/^X|//' << \|
|00003590| 53 48 41 52 5f 45 4f 46 | 20 3e 20 27 63 6c 72 62 |SHAR_EOF| > 'clrb|
|000035a0| 6f 74 2e 6d 27 0a 58 4e | 41 4d 45 0a 58 09 77 63 |ot.m'.XN|AME.X.wc|
|000035b0| 6c 72 74 6f 62 6f 74 28 | 29 20 63 6c 72 62 6f 74 |lrtobot(|) clrbot|
|000035c0| 28 29 20 6d 76 63 6c 72 | 74 6f 62 6f 74 28 29 20 |() mvclr|tobot() |
|000035d0| 6d 76 77 63 6c 72 74 6f | 62 6f 74 28 29 20 2d 20 |mvwclrto|bot() - |
|000035e0| 63 6c 65 61 72 20 74 6f | 20 62 6f 74 74 6f 6d 20 |clear to| bottom |
|000035f0| 0a 58 0a 58 53 59 4e 4f | 50 53 49 53 0a 58 09 23 |.X.XSYNO|PSIS.X.#|
|00003600| 69 6e 63 6c 75 64 65 20 | 3c 63 75 72 73 65 73 2e |include |<curses.|
|00003610| 68 3e 0a 58 09 23 69 6e | 63 6c 75 64 65 20 3c 63 |h>.X.#in|clude <c|
|00003620| 75 72 73 70 72 69 76 2e | 68 3e 0a 58 0a 58 09 69 |urspriv.|h>.X.X.i|
|00003630| 6e 74 20 77 63 6c 72 74 | 6f 62 6f 74 28 77 69 6e |nt wclrt|obot(win|
|00003640| 29 0a 58 09 57 49 4e 44 | 4f 57 20 2a 77 69 6e 3b |).X.WIND|OW *win;|
|00003650| 0a 58 0a 58 09 69 6e 74 | 20 63 6c 72 62 6f 74 28 |.X.X.int| clrbot(|
|00003660| 29 0a 58 0a 58 09 69 6e | 74 20 6d 76 63 6c 72 74 |).X.X.in|t mvclrt|
|00003670| 6f 62 6f 74 28 79 2c 78 | 29 0a 58 09 69 6e 74 20 |obot(y,x|).X.int |
|00003680| 79 3b 0a 58 09 69 6e 74 | 20 78 3b 0a 58 0a 58 09 |y;.X.int| x;.X.X.|
|00003690| 69 6e 74 20 6d 76 77 63 | 6c 72 74 6f 62 6f 74 28 |int mvwc|lrtobot(|
|000036a0| 77 69 6e 2c 79 2c 78 29 | 0a 58 09 57 49 4e 44 4f |win,y,x)|.X.WINDO|
|000036b0| 57 20 2a 77 69 6e 3b 0a | 58 09 69 6e 74 20 79 3b |W *win;.|X.int y;|
|000036c0| 0a 58 09 69 6e 74 20 78 | 3b 0a 58 0a 58 44 45 53 |.X.int x|;.X.XDES|
|000036d0| 43 52 49 50 54 49 4f 4e | 0a 58 09 77 63 6c 72 74 |CRIPTION|.X.wclrt|
|000036e0| 6f 62 6f 74 28 29 20 66 | 69 6c 6c 73 20 74 68 65 |obot() f|ills the|
|000036f0| 20 72 69 67 68 74 20 68 | 61 6c 66 20 6f 66 20 74 | right h|alf of t|
|00003700| 68 65 20 63 75 72 73 6f | 72 20 6c 69 6e 65 20 6f |he curso|r line o|
|00003710| 66 20 20 0a 58 09 77 69 | 6e 64 6f 77 20 27 77 69 |f .X.wi|ndow 'wi|
|00003720| 6e 27 2c 20 61 6e 64 20 | 61 6c 6c 20 6c 69 6e 65 |n', and |all line|
|00003730| 73 20 62 65 6c 6f 77 20 | 69 74 20 77 69 74 68 20 |s below |it with |
|00003740| 62 6c 61 6e 6b 73 2e 20 | 20 0a 58 0a 58 09 63 6c |blanks. | .X.X.cl|
|00003750| 72 62 6f 74 28 29 20 66 | 69 6c 6c 73 20 74 68 65 |rbot() f|ills the|
|00003760| 20 72 69 67 68 74 20 68 | 61 6c 66 20 6f 66 20 74 | right h|alf of t|
|00003770| 68 65 20 63 75 72 73 6f | 72 20 6c 69 6e 65 20 6f |he curso|r line o|
|00003780| 66 20 20 0a 58 09 73 74 | 64 73 63 72 2c 20 61 6e |f .X.st|dscr, an|
|00003790| 64 20 61 6c 6c 20 6c 69 | 6e 65 73 20 62 65 6c 6f |d all li|nes belo|
|000037a0| 77 20 69 74 20 77 69 74 | 68 20 62 6c 61 6e 6b 73 |w it wit|h blanks|
|000037b0| 2e 20 20 0a 58 0a 58 09 | 6d 76 63 6c 72 74 6f 62 |. .X.X.|mvclrtob|
|000037c0| 6f 74 28 29 20 6d 6f 76 | 65 73 20 74 68 65 20 63 |ot() mov|es the c|
|000037d0| 75 72 73 6f 72 20 74 6f | 20 61 20 6e 65 77 20 70 |ursor to| a new p|
|000037e0| 6f 73 69 74 69 6f 6e 20 | 69 6e 20 73 74 64 73 63 |osition |in stdsc|
|000037f0| 72 20 20 0a 58 09 61 6e | 64 20 66 69 6c 6c 73 20 |r .X.an|d fills |
|00003800| 74 68 65 20 72 69 67 68 | 74 20 68 61 6c 66 20 6f |the righ|t half o|
|00003810| 66 20 74 68 65 20 63 75 | 72 73 6f 72 20 6c 69 6e |f the cu|rsor lin|
|00003820| 65 2c 20 61 6e 64 20 61 | 6c 6c 20 6c 69 6e 65 73 |e, and a|ll lines|
|00003830| 20 20 0a 58 09 62 65 6c | 6f 77 20 69 74 20 77 69 | .X.bel|ow it wi|
|00003840| 74 68 20 62 6c 61 6e 6b | 73 2e 20 20 0a 58 0a 58 |th blank|s. .X.X|
|00003850| 09 6d 76 77 63 6c 72 74 | 6f 62 6f 74 28 29 20 6d |.mvwclrt|obot() m|
|00003860| 6f 76 65 73 20 74 68 65 | 20 63 75 72 73 6f 72 20 |oves the| cursor |
|00003870| 74 6f 20 61 20 6e 65 77 | 20 70 6f 73 69 74 69 6f |to a new| positio|
|00003880| 6e 20 69 6e 20 77 69 6e | 64 6f 77 20 20 0a 58 09 |n in win|dow .X.|
|00003890| 27 77 69 6e 27 2c 20 61 | 6e 64 20 66 69 6c 6c 73 |'win', a|nd fills|
|000038a0| 20 74 68 65 20 72 69 67 | 68 74 20 68 61 6c 66 20 | the rig|ht half |
|000038b0| 6f 66 20 74 68 65 20 63 | 75 72 73 6f 72 20 6c 69 |of the c|ursor li|
|000038c0| 6e 65 2c 20 61 6e 64 20 | 61 6c 6c 20 20 0a 58 09 |ne, and |all .X.|
|000038d0| 6c 69 6e 65 73 20 62 65 | 6c 6f 77 20 69 74 20 77 |lines be|low it w|
|000038e0| 69 74 68 20 62 6c 61 6e | 6b 73 2e 20 20 0a 58 0a |ith blan|ks. .X.|
|000038f0| 58 45 58 41 4d 50 4c 45 | 53 0a 58 0a 58 53 45 45 |XEXAMPLE|S.X.XSEE|
|00003900| 20 41 4c 53 4f 0a 58 09 | 77 6d 6f 76 65 28 29 20 | ALSO.X.|wmove() |
|00003910| 20 0a 58 0a 58 42 55 47 | 53 0a 53 48 41 52 5f 45 | .X.XBUG|S.SHAR_E|
|00003920| 4f 46 0a 69 66 20 74 65 | 73 74 20 38 34 32 20 2d |OF.if te|st 842 -|
|00003930| 6e 65 20 22 60 77 63 20 | 2d 63 20 3c 20 27 63 6c |ne "`wc |-c < 'cl|
|00003940| 72 62 6f 74 2e 6d 27 60 | 22 0a 74 68 65 6e 0a 09 |rbot.m'`|".then..|
|00003950| 65 63 68 6f 20 73 68 61 | 72 3a 20 65 72 72 6f 72 |echo sha|r: error|
|00003960| 20 74 72 61 6e 73 6d 69 | 74 74 69 6e 67 20 22 27 | transmi|tting "'|
|00003970| 63 6c 72 62 6f 74 2e 6d | 27 22 20 27 28 73 68 6f |clrbot.m|'" '(sho|
|00003980| 75 6c 64 20 68 61 76 65 | 20 62 65 65 6e 20 38 34 |uld have| been 84|
|00003990| 32 20 63 68 61 72 61 63 | 74 65 72 73 29 27 0a 66 |2 charac|ters)'.f|
|000039a0| 69 0a 66 69 20 23 20 65 | 6e 64 20 6f 66 20 6f 76 |i.fi # e|nd of ov|
|000039b0| 65 72 77 72 69 74 69 6e | 67 20 63 68 65 63 6b 0a |erwritin|g check.|
|000039c0| 65 63 68 6f 20 73 68 61 | 72 3a 20 65 78 74 72 61 |echo sha|r: extra|
|000039d0| 63 74 69 6e 67 20 22 27 | 63 6c 72 74 6f 65 6f 6c |cting "'|clrtoeol|
|000039e0| 2e 6d 27 22 20 27 28 37 | 39 34 20 63 68 61 72 61 |.m'" '(7|94 chara|
|000039f0| 63 74 65 72 73 29 27 0a | 69 66 20 74 65 73 74 20 |cters)'.|if test |
|00003a00| 2d 66 20 27 63 6c 72 74 | 6f 65 6f 6c 2e 6d 27 0a |-f 'clrt|oeol.m'.|
|00003a10| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00003a20| 20 77 69 6c 6c 20 6e 6f | 74 20 6f 76 65 72 2d 77 | will no|t over-w|
|00003a30| 72 69 74 65 20 65 78 69 | 73 74 69 6e 67 20 66 69 |rite exi|sting fi|
|00003a40| 6c 65 20 22 27 63 6c 72 | 74 6f 65 6f 6c 2e 6d 27 |le "'clr|toeol.m'|
|00003a50| 22 0a 65 6c 73 65 0a 73 | 65 64 20 27 73 2f 5e 58 |".else.s|ed 's/^X|
|00003a60| 2f 2f 27 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |//' << \|SHAR_EOF|
|00003a70| 20 3e 20 27 63 6c 72 74 | 6f 65 6f 6c 2e 6d 27 0a | > 'clrt|oeol.m'.|
|00003a80| 58 4e 41 4d 45 0a 58 09 | 77 63 6c 72 74 6f 65 6f |XNAME.X.|wclrtoeo|
|00003a90| 6c 28 29 20 63 6c 72 74 | 6f 65 6f 6c 28 29 20 6d |l() clrt|oeol() m|
|00003aa0| 76 63 6c 72 74 6f 65 6f | 6c 28 29 20 6d 76 77 63 |vclrtoeo|l() mvwc|
|00003ab0| 6c 72 74 6f 65 6f 6c 28 | 29 20 2d 20 63 6c 65 61 |lrtoeol(|) - clea|
|00003ac0| 72 20 74 6f 20 65 6e 64 | 20 6f 66 20 6c 69 6e 65 |r to end| of line|
|00003ad0| 0a 58 0a 58 53 59 4e 4f | 50 53 49 53 0a 58 09 23 |.X.XSYNO|PSIS.X.#|
|00003ae0| 69 6e 63 6c 75 64 65 20 | 3c 63 75 72 73 65 73 2e |include |<curses.|
|00003af0| 68 3e 0a 58 09 23 69 6e | 63 6c 75 64 65 20 3c 63 |h>.X.#in|clude <c|
|00003b00| 75 72 73 70 72 69 76 2e | 68 3e 0a 58 0a 58 09 69 |urspriv.|h>.X.X.i|
|00003b10| 6e 74 20 77 63 6c 72 74 | 6f 65 6f 6c 28 77 69 6e |nt wclrt|oeol(win|
|00003b20| 29 0a 58 09 57 49 4e 44 | 4f 57 20 2a 77 69 6e 3b |).X.WIND|OW *win;|
|00003b30| 0a 58 0a 58 09 69 6e 74 | 20 63 6c 72 74 6f 65 6f |.X.X.int| clrtoeo|
|00003b40| 6c 28 29 0a 58 0a 58 09 | 69 6e 74 20 6d 76 63 6c |l().X.X.|int mvcl|
|00003b50| 74 6f 72 65 6f 6c 28 79 | 2c 78 29 0a 58 09 69 6e |toreol(y|,x).X.in|
|00003b60| 74 20 79 3b 0a 58 09 69 | 6e 74 20 78 3b 0a 58 0a |t y;.X.i|nt x;.X.|
|00003b70| 58 09 69 6e 74 20 6d 76 | 77 63 6c 72 74 6f 65 6f |X.int mv|wclrtoeo|
|00003b80| 6c 28 77 69 6e 2c 79 2c | 78 29 0a 58 09 57 49 4e |l(win,y,|x).X.WIN|
|00003b90| 44 4f 57 20 2a 77 69 6e | 3b 0a 58 09 69 6e 74 20 |DOW *win|;.X.int |
|00003ba0| 79 3b 0a 58 09 69 6e 74 | 20 78 3b 0a 58 0a 58 44 |y;.X.int| x;.X.XD|
|00003bb0| 45 53 43 52 49 50 54 49 | 4f 4e 0a 58 09 77 63 6c |ESCRIPTI|ON.X.wcl|
|00003bc0| 72 74 6f 65 6f 6c 28 29 | 20 66 69 6c 6c 73 20 74 |rtoeol()| fills t|
|00003bd0| 68 65 20 68 61 6c 66 20 | 6f 66 20 74 68 65 20 63 |he half |of the c|
|00003be0| 75 72 73 6f 72 20 6c 69 | 6e 65 20 74 6f 20 74 68 |ursor li|ne to th|
|00003bf0| 65 20 72 69 67 68 74 20 | 20 0a 58 09 6f 66 20 74 |e right | .X.of t|
|00003c00| 68 65 20 63 75 72 73 6f | 72 20 69 6e 20 77 69 6e |he curso|r in win|
|00003c10| 64 6f 77 20 27 77 69 6e | 27 20 77 69 74 68 20 62 |dow 'win|' with b|
|00003c20| 6c 61 6e 6b 73 2e 20 20 | 0a 58 0a 58 09 63 6c 72 |lanks. |.X.X.clr|
|00003c30| 74 6f 65 6f 6c 28 29 20 | 66 69 6c 6c 73 20 74 68 |toeol() |fills th|
|00003c40| 65 20 68 61 6c 66 20 6f | 66 20 74 68 65 20 63 75 |e half o|f the cu|
|00003c50| 72 73 6f 72 20 6c 69 6e | 65 20 74 6f 20 74 68 65 |rsor lin|e to the|
|00003c60| 20 72 69 67 68 74 20 20 | 0a 58 09 6f 66 20 74 68 | right |.X.of th|
|00003c70| 65 20 63 75 72 73 6f 72 | 20 69 6e 20 73 74 64 73 |e cursor| in stds|
|00003c80| 63 72 20 77 69 74 68 20 | 62 6c 61 6e 6b 73 2e 20 |cr with |blanks. |
|00003c90| 20 0a 58 0a 58 09 6d 76 | 63 6c 72 74 6f 65 6f 6c | .X.X.mv|clrtoeol|
|00003ca0| 28 29 20 6d 6f 76 65 73 | 20 74 68 65 20 63 75 72 |() moves| the cur|
|00003cb0| 73 6f 72 20 74 6f 20 61 | 20 6e 65 77 20 70 6f 73 |sor to a| new pos|
|00003cc0| 69 74 69 6f 6e 20 69 6e | 20 73 74 64 73 63 72 20 |ition in| stdscr |
|00003cd0| 20 0a 58 09 61 6e 64 20 | 66 69 6c 6c 73 20 74 68 | .X.and |fills th|
|00003ce0| 65 20 72 69 67 68 74 20 | 68 61 6c 66 20 6f 66 20 |e right |half of |
|00003cf0| 74 68 65 20 63 75 72 73 | 6f 72 20 6c 69 6e 65 20 |the curs|or line |
|00003d00| 77 69 74 68 20 62 6c 61 | 6e 6b 73 2e 20 20 0a 58 |with bla|nks. .X|
|00003d10| 0a 58 09 6d 76 77 63 6c | 72 74 6f 65 6f 6c 28 29 |.X.mvwcl|rtoeol()|
|00003d20| 20 6d 6f 76 65 73 20 74 | 68 65 20 63 75 72 73 6f | moves t|he curso|
|00003d30| 72 20 74 6f 20 61 20 6e | 65 77 20 70 6f 73 69 74 |r to a n|ew posit|
|00003d40| 69 6f 6e 20 69 6e 20 77 | 69 6e 64 6f 77 20 20 0a |ion in w|indow .|
|00003d50| 58 09 27 77 69 6e 27 2c | 20 61 6e 64 20 66 69 6c |X.'win',| and fil|
|00003d60| 6c 73 20 74 68 65 20 72 | 69 67 68 74 20 68 61 6c |ls the r|ight hal|
|00003d70| 66 20 6f 66 20 74 68 65 | 20 63 75 72 73 6f 72 20 |f of the| cursor |
|00003d80| 6c 69 6e 65 20 77 69 74 | 68 20 20 0a 58 09 62 6c |line wit|h .X.bl|
|00003d90| 61 6e 6b 73 2e 20 20 0a | 58 0a 58 45 58 41 4d 50 |anks. .|X.XEXAMP|
|00003da0| 4c 45 53 0a 58 0a 58 53 | 45 45 20 41 4c 53 4f 0a |LES.X.XS|EE ALSO.|
|00003db0| 58 09 77 6d 6f 76 65 28 | 29 20 0a 58 0a 58 42 55 |X.wmove(|) .X.XBU|
|00003dc0| 47 53 0a 53 48 41 52 5f | 45 4f 46 0a 69 66 20 74 |GS.SHAR_|EOF.if t|
|00003dd0| 65 73 74 20 37 39 34 20 | 2d 6e 65 20 22 60 77 63 |est 794 |-ne "`wc|
|00003de0| 20 2d 63 20 3c 20 27 63 | 6c 72 74 6f 65 6f 6c 2e | -c < 'c|lrtoeol.|
|00003df0| 6d 27 60 22 0a 74 68 65 | 6e 0a 09 65 63 68 6f 20 |m'`".the|n..echo |
|00003e00| 73 68 61 72 3a 20 65 72 | 72 6f 72 20 74 72 61 6e |shar: er|ror tran|
|00003e10| 73 6d 69 74 74 69 6e 67 | 20 22 27 63 6c 72 74 6f |smitting| "'clrto|
|00003e20| 65 6f 6c 2e 6d 27 22 20 | 27 28 73 68 6f 75 6c 64 |eol.m'" |'(should|
|00003e30| 20 68 61 76 65 20 62 65 | 65 6e 20 37 39 34 20 63 | have be|en 794 c|
|00003e40| 68 61 72 61 63 74 65 72 | 73 29 27 0a 66 69 0a 66 |haracter|s)'.fi.f|
|00003e50| 69 20 23 20 65 6e 64 20 | 6f 66 20 6f 76 65 72 77 |i # end |of overw|
|00003e60| 72 69 74 69 6e 67 20 63 | 68 65 63 6b 0a 65 63 68 |riting c|heck.ech|
|00003e70| 6f 20 73 68 61 72 3a 20 | 65 78 74 72 61 63 74 69 |o shar: |extracti|
|00003e80| 6e 67 20 22 27 63 75 72 | 73 65 73 2e 68 27 22 20 |ng "'cur|ses.h'" |
|00003e90| 27 28 31 32 31 35 38 20 | 63 68 61 72 61 63 74 65 |'(12158 |characte|
|00003ea0| 72 73 29 27 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |rs)'.if |test -f |
|00003eb0| 27 63 75 72 73 65 73 2e | 68 27 0a 74 68 65 6e 0a |'curses.|h'.then.|
|00003ec0| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 77 69 6c 6c |.echo sh|ar: will|
|00003ed0| 20 6e 6f 74 20 6f 76 65 | 72 2d 77 72 69 74 65 20 | not ove|r-write |
|00003ee0| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 22 27 |existing| file "'|
|00003ef0| 63 75 72 73 65 73 2e 68 | 27 22 0a 65 6c 73 65 0a |curses.h|'".else.|
|00003f00| 73 65 64 20 27 73 2f 5e | 58 2f 2f 27 20 3c 3c 20 |sed 's/^|X//' << |
|00003f10| 5c 53 48 41 52 5f 45 4f | 46 20 3e 20 27 63 75 72 |\SHAR_EO|F > 'cur|
|00003f20| 73 65 73 2e 68 27 0a 58 | 2f 2a 2a 2a 2a 2a 2a 2a |ses.h'.X|/*******|
|00003f30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003f40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003f50| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003f60| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2f 0a 58 2f 2a 09 09 |********|*/.X/*..|
|00003f70| 09 20 20 20 20 43 55 52 | 53 45 53 2e 48 09 09 09 |. CUR|SES.H...|
|00003f80| 09 2a 2f 0a 58 2f 2a 20 | 48 65 61 64 65 72 20 66 |.*/.X/* |Header f|
|00003f90| 69 6c 65 20 66 6f 72 20 | 64 65 66 69 6e 69 74 69 |ile for |definiti|
|00003fa0| 6f 6e 73 20 61 6e 64 20 | 64 65 63 6c 61 72 61 74 |ons and |declarat|
|00003fb0| 69 6f 6e 73 20 66 6f 72 | 20 74 68 65 09 09 2a 2f |ions for| the..*/|
|00003fc0| 0a 58 2f 2a 20 50 43 63 | 75 72 73 65 73 20 70 61 |.X/* PCc|urses pa|
|00003fd0| 63 6b 61 67 65 2e 20 54 | 68 69 73 20 73 68 6f 75 |ckage. T|his shou|
|00003fe0| 6c 64 20 62 65 20 23 69 | 6e 63 6c 75 64 65 27 64 |ld be #i|nclude'd|
|00003ff0| 20 69 6e 20 61 6c 6c 20 | 75 73 65 72 09 2a 2f 0a | in all |user.*/.|
|00004000| 58 2f 2a 20 70 72 6f 67 | 72 61 6d 73 2e 09 09 09 |X/* prog|rams....|
|00004010| 09 09 09 09 2a 2f 0a 58 | 2f 2a 2a 2a 2a 2a 2a 2a |....*/.X|/*******|
|00004020| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004030| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004040| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004050| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2f 0a 58 2f 2a 20 54 |********|*/.X/* T|
|00004060| 68 69 73 20 76 65 72 73 | 69 6f 6e 20 6f 66 20 63 |his vers|ion of c|
|00004070| 75 72 73 65 73 20 69 73 | 20 62 61 73 65 64 20 6f |urses is| based o|
|00004080| 6e 20 6e 63 75 72 73 65 | 73 2c 20 61 20 63 75 72 |n ncurse|s, a cur|
|00004090| 73 65 73 20 76 65 72 73 | 69 6f 6e 09 2a 2f 0a 58 |ses vers|ion.*/.X|
|000040a0| 2f 2a 20 6f 72 69 67 69 | 6e 61 6c 6c 79 20 77 72 |/* origi|nally wr|
|000040b0| 69 74 74 65 6e 20 62 79 | 20 50 61 76 65 6c 20 43 |itten by| Pavel C|
|000040c0| 75 72 74 69 73 20 61 74 | 20 43 6f 72 6e 65 6c 6c |urtis at| Cornell|
|000040d0| 20 55 6e 69 76 65 72 73 | 69 74 79 2e 09 2a 2f 0a | Univers|ity..*/.|
|000040e0| 58 2f 2a 20 49 20 68 61 | 76 65 20 6d 61 64 65 20 |X/* I ha|ve made |
|000040f0| 73 75 62 73 74 61 6e 74 | 69 61 6c 20 63 68 61 6e |substant|ial chan|
|00004100| 67 65 73 20 74 6f 20 6d | 61 6b 65 20 69 74 20 72 |ges to m|ake it r|
|00004110| 75 6e 20 6f 6e 20 49 42 | 4d 20 50 43 27 73 2c 09 |un on IB|M PC's,.|
|00004120| 2a 2f 0a 58 2f 2a 20 61 | 6e 64 20 74 68 65 72 65 |*/.X/* a|nd there|
|00004130| 66 6f 72 65 20 63 6f 6e | 73 69 64 65 72 20 6d 79 |fore con|sider my|
|00004140| 73 65 6c 66 20 66 72 65 | 65 20 74 6f 20 6d 61 6b |self fre|e to mak|
|00004150| 65 20 69 74 20 70 75 62 | 6c 69 63 20 64 6f 6d 61 |e it pub|lic doma|
|00004160| 69 6e 2e 09 2a 2f 0a 58 | 2f 2a 09 09 42 6a 6f 72 |in..*/.X|/*..Bjor|
|00004170| 6e 20 4c 61 72 73 73 6f | 6e 20 28 2e 2e 2e 6d 63 |n Larsso|n (...mc|
|00004180| 76 61 78 21 65 6e 65 61 | 21 69 6e 66 6f 76 61 78 |vax!enea|!infovax|
|00004190| 21 62 6c 29 09 2a 2f 0a | 58 2f 2a 2a 2a 2a 2a 2a |!bl).*/.|X/******|
|000041a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000041b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000041c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000041d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2f 0a 58 2f 2a 20 |********|**/.X/* |
|000041e0| 31 2e 30 3a 09 52 65 6c | 65 61 73 65 3a 09 09 09 |1.0:.Rel|ease:...|
|000041f0| 09 09 38 37 30 35 31 35 | 09 2a 2f 0a 58 2f 2a 2a |..870515|.*/.X/**|
|00004200| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004210| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004220| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004230| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2f 0a |********|******/.|
|00004240| 58 0a 58 2f 2a 20 67 65 | 6e 65 72 61 6c 20 64 65 |X.X/* ge|neral de|
|00004250| 66 69 6e 69 74 69 6f 6e | 73 20 2a 2f 0a 58 0a 58 |finition|s */.X.X|
|00004260| 23 64 65 66 69 6e 65 09 | 20 54 52 55 45 09 09 31 |#define.| TRUE..1|
|00004270| 09 09 2f 2a 20 62 6f 6f | 6c 65 61 6e 73 20 2a 2f |../* boo|leans */|
|00004280| 0a 58 23 64 65 66 69 6e | 65 09 20 46 41 4c 53 45 |.X#defin|e. FALSE|
|00004290| 09 09 30 0a 58 23 64 65 | 66 69 6e 65 09 20 45 52 |..0.X#de|fine. ER|
|000042a0| 52 09 09 31 09 09 2f 2a | 20 67 65 6e 65 72 61 6c |R..1../*| general|
|000042b0| 20 65 72 72 6f 72 20 66 | 6c 61 67 20 2a 2f 0a 58 | error f|lag */.X|
|000042c0| 23 64 65 66 69 6e 65 09 | 20 4f 4b 09 09 30 09 09 |#define.| OK..0..|
|000042d0| 2f 2a 20 67 65 6e 65 72 | 61 6c 20 4f 4b 20 66 6c |/* gener|al OK fl|
|000042e0| 61 67 20 2a 2f 0a 58 0a | 58 2f 2a 20 66 75 6e 63 |ag */.X.|X/* func|
|000042f0| 74 69 6f 6e 73 20 64 65 | 66 69 6e 65 64 20 61 73 |tions de|fined as|
|00004300| 20 6d 61 63 72 6f 73 20 | 2a 2f 0a 58 0a 58 23 64 | macros |*/.X.X#d|
|00004310| 65 66 69 6e 65 20 67 65 | 74 63 68 28 29 09 20 20 |efine ge|tch(). |
|00004320| 20 77 67 65 74 63 68 28 | 73 74 64 73 63 72 29 09 | wgetch(|stdscr).|
|00004330| 2f 2a 20 75 73 69 6e 67 | 20 6d 61 63 72 6f 65 73 |/* using| macroes|
|00004340| 20 61 6c 6c 6f 77 73 20 | 79 6f 75 20 74 6f 20 75 | allows |you to u|
|00004350| 73 65 20 2a 2f 0a 58 23 | 64 65 66 69 6e 65 09 75 |se */.X#|define.u|
|00004360| 6e 67 65 74 63 68 28 63 | 29 20 77 75 6e 67 65 74 |ngetch(c|) wunget|
|00004370| 63 68 28 63 29 09 09 2f | 2a 20 23 75 6e 64 65 66 |ch(c)../|* #undef|
|00004380| 20 67 65 74 63 68 2f 75 | 6e 67 65 74 63 68 20 69 | getch/u|ngetch i|
|00004390| 6e 20 79 6f 75 72 20 2a | 2f 0a 58 09 09 09 09 09 |n your *|/.X.....|
|000043a0| 2f 2a 20 70 72 6f 67 72 | 61 6d 73 20 74 6f 20 75 |/* progr|ams to u|
|000043b0| 73 65 20 4d 53 43 20 67 | 65 74 63 68 28 29 20 61 |se MSC g|etch() a|
|000043c0| 6e 64 20 2a 2f 0a 58 09 | 09 09 09 09 2f 2a 20 75 |nd */.X.|..../* u|
|000043d0| 6e 67 65 74 63 68 28 29 | 20 72 6f 75 74 69 6e 65 |ngetch()| routine|
|000043e0| 73 20 2a 2f 0a 58 0a 58 | 23 64 65 66 69 6e 65 20 |s */.X.X|#define |
|000043f0| 67 65 74 79 78 28 77 69 | 6e 2c 79 2c 78 29 20 20 |getyx(wi|n,y,x) |
|00004400| 20 09 28 79 20 3d 20 28 | 77 69 6e 29 2d 3e 5f 63 | .(y = (|win)->_c|
|00004410| 75 72 79 2c 20 78 20 3d | 20 28 77 69 6e 29 2d 3e |ury, x =| (win)->|
|00004420| 5f 63 75 72 78 29 0a 58 | 0a 58 23 69 66 6e 64 65 |_curx).X|.X#ifnde|
|00004430| 66 20 6d 61 78 0a 58 23 | 64 65 66 69 6e 65 20 6d |f max.X#|define m|
|00004440| 61 78 28 61 2c 62 29 20 | 28 28 28 61 29 20 3e 20 |ax(a,b) |(((a) > |
|00004450| 28 62 29 29 20 3f 20 28 | 61 29 20 3a 20 28 62 29 |(b)) ? (|a) : (b)|
|00004460| 29 0a 58 23 65 6e 64 69 | 66 0a 58 23 69 66 6e 64 |).X#endi|f.X#ifnd|
|00004470| 65 66 20 6d 69 6e 0a 58 | 23 64 65 66 69 6e 65 20 |ef min.X|#define |
|00004480| 6d 69 6e 28 61 2c 62 29 | 20 28 28 28 61 29 20 3c |min(a,b)| (((a) <|
|00004490| 20 28 62 29 29 20 3f 20 | 28 61 29 20 3a 20 28 62 | (b)) ? |(a) : (b|
|000044a0| 29 29 0a 58 23 65 6e 64 | 69 66 0a 58 0a 58 2f 2a |)).X#end|if.X.X/*|
|000044b0| 20 76 69 64 65 6f 20 61 | 74 74 72 69 62 75 74 65 | video a|ttribute|
|000044c0| 20 64 65 66 69 6e 69 74 | 69 6f 6e 73 20 2a 2f 0a | definit|ions */.|
|000044d0| 58 0a 58 23 64 65 66 69 | 6e 65 09 41 5f 41 4c 54 |X.X#defi|ne.A_ALT|
|000044e0| 43 48 41 52 53 45 54 20 | 20 20 30 0a 58 23 64 65 |CHARSET | 0.X#de|
|000044f0| 66 69 6e 65 09 41 5f 42 | 4c 49 4e 4b 20 20 20 20 |fine.A_B|LINK |
|00004500| 20 20 20 20 30 78 31 30 | 30 0a 58 23 64 65 66 69 | 0x10|0.X#defi|
|00004510| 6e 65 09 41 5f 42 4c 41 | 4e 4b 20 20 20 20 20 20 |ne.A_BLA|NK |
|00004520| 20 20 30 78 32 30 30 0a | 58 23 64 65 66 69 6e 65 | 0x200.|X#define|
|00004530| 09 41 5f 42 4f 4c 44 20 | 20 20 20 20 20 20 20 20 |.A_BOLD | |
|00004540| 30 78 34 30 30 0a 58 23 | 64 65 66 69 6e 65 09 41 |0x400.X#|define.A|
|00004550| 5f 44 49 4d 20 20 20 20 | 20 20 20 20 20 20 30 0a |_DIM | 0.|
|00004560| 58 23 64 65 66 69 6e 65 | 09 41 5f 50 52 4f 54 45 |X#define|.A_PROTE|
|00004570| 43 54 20 20 20 20 20 20 | 30 0a 58 23 64 65 66 69 |CT |0.X#defi|
|00004580| 6e 65 09 41 5f 52 45 56 | 45 52 53 45 20 20 20 20 |ne.A_REV|ERSE |
|00004590| 20 20 30 78 38 30 30 0a | 58 23 64 65 66 69 6e 65 | 0x800.|X#define|
|000045a0| 09 41 5f 53 54 41 4e 44 | 4f 55 54 20 20 20 20 20 |.A_STAND|OUT |
|000045b0| 30 78 31 30 30 30 0a 58 | 23 64 65 66 69 6e 65 09 |0x1000.X|#define.|
|000045c0| 41 5f 55 4e 44 45 52 4c | 49 4e 45 20 20 20 20 30 |A_UNDERL|INE 0|
|000045d0| 78 32 30 30 30 0a 58 0a | 58 2f 2a 20 66 75 6e 63 |x2000.X.|X/* func|
|000045e0| 74 69 6f 6e 20 61 6e 64 | 20 6b 65 79 70 61 64 20 |tion and| keypad |
|000045f0| 6b 65 79 20 64 65 66 69 | 6e 69 74 69 6f 6e 73 20 |key defi|nitions |
|00004600| 2a 2f 0a 58 0a 58 23 64 | 65 66 69 6e 65 20 4b 45 |*/.X.X#d|efine KE|
|00004610| 59 5f 42 52 45 41 4b 20 | 20 20 20 20 20 30 78 31 |Y_BREAK | 0x1|
|00004620| 30 31 20 20 20 20 20 20 | 20 20 2f 2a 20 4e 6f 74 |01 | /* Not|
|00004630| 20 6f 6e 20 50 43 20 2a | 2f 0a 58 23 64 65 66 69 | on PC *|/.X#defi|
|00004640| 6e 65 20 4b 45 59 5f 44 | 4f 57 4e 20 20 20 20 20 |ne KEY_D|OWN |
|00004650| 20 20 30 78 31 30 32 20 | 20 20 20 20 20 20 20 2f | 0x102 | /|
|00004660| 2a 20 54 68 65 20 66 6f | 75 72 20 61 72 72 6f 77 |* The fo|ur arrow|
|00004670| 20 6b 65 79 73 20 2a 2f | 0a 58 23 64 65 66 69 6e | keys */|.X#defin|
|00004680| 65 20 4b 45 59 5f 55 50 | 20 20 20 20 20 20 20 20 |e KEY_UP| |
|00004690| 20 30 78 31 30 33 0a 58 | 23 64 65 66 69 6e 65 20 | 0x103.X|#define |
|000046a0| 4b 45 59 5f 4c 45 46 54 | 20 20 20 20 20 20 20 30 |KEY_LEFT| 0|
|000046b0| 78 31 30 34 0a 58 23 64 | 65 66 69 6e 65 20 4b 45 |x104.X#d|efine KE|
|000046c0| 59 5f 52 49 47 48 54 20 | 20 20 20 20 20 30 78 31 |Y_RIGHT | 0x1|
|000046d0| 30 35 0a 58 23 64 65 66 | 69 6e 65 20 4b 45 59 5f |05.X#def|ine KEY_|
|000046e0| 48 4f 4d 45 20 20 20 20 | 20 20 20 30 78 31 30 36 |HOME | 0x106|
|000046f0| 20 20 20 20 20 20 20 20 | 2f 2a 20 48 6f 6d 65 20 | |/* Home |
|00004700| 6b 65 79 20 28 75 70 77 | 61 72 64 2b 6c 65 66 74 |key (upw|ard+left|
|00004710| 20 61 72 72 6f 77 29 20 | 2a 2f 0a 58 23 64 65 66 | arrow) |*/.X#def|
|00004720| 69 6e 65 20 4b 45 59 5f | 42 41 43 4b 53 50 41 43 |ine KEY_|BACKSPAC|
|00004730| 45 20 20 30 78 31 30 37 | 20 20 20 20 20 20 20 20 |E 0x107| |
|00004740| 2f 2a 20 4e 6f 74 20 6f | 6e 20 50 43 20 2a 2f 0a |/* Not o|n PC */.|
|00004750| 58 23 64 65 66 69 6e 65 | 20 4b 45 59 5f 46 30 20 |X#define| KEY_F0 |
|00004760| 20 20 20 20 20 20 20 20 | 30 78 31 30 38 20 20 20 | |0x108 |
|00004770| 20 20 20 20 20 2f 2a 20 | 46 75 6e 63 74 69 6f 6e | /* |Function|
|00004780| 20 6b 65 79 73 2e 20 53 | 70 61 63 65 20 66 6f 72 | keys. S|pace for|
|00004790| 20 2a 2f 0a 58 23 64 65 | 66 69 6e 65 20 4b 45 59 | */.X#de|fine KEY|
|000047a0| 5f 46 28 6e 29 20 20 20 | 20 20 20 20 28 4b 45 59 |_F(n) | (KEY|
|000047b0| 5f 46 30 2b 28 6e 29 29 | 20 2f 2a 20 20 36 34 20 |_F0+(n))| /* 64 |
|000047c0| 6b 65 79 73 20 69 73 20 | 72 65 73 65 72 76 65 64 |keys is |reserved|
|000047d0| 2e 20 2a 2f 0a 58 23 64 | 65 66 69 6e 65 20 4b 45 |. */.X#d|efine KE|
|000047e0| 59 5f 44 4c 20 20 20 20 | 20 20 20 20 20 30 78 31 |Y_DL | 0x1|
|000047f0| 34 38 20 20 20 20 20 20 | 20 20 2f 2a 20 4e 6f 74 |48 | /* Not|
|00004800| 20 6f 6e 20 50 43 20 2a | 2f 0a 58 23 64 65 66 69 | on PC *|/.X#defi|
|00004810| 6e 65 20 4b 45 59 5f 49 | 4c 20 20 20 20 20 20 20 |ne KEY_I|L |
|00004820| 20 20 30 78 31 34 39 20 | 20 20 20 20 20 20 20 2f | 0x149 | /|
|00004830| 2a 20 49 6e 73 65 72 74 | 20 6c 69 6e 65 20 2a 2f |* Insert| line */|
|00004840| 0a 58 23 64 65 66 69 6e | 65 20 4b 45 59 5f 44 43 |.X#defin|e KEY_DC|
|00004850| 20 20 20 20 20 20 20 20 | 20 30 78 31 34 61 20 20 | | 0x14a |
|00004860| 20 20 20 20 20 20 2f 2a | 20 44 65 6c 65 74 65 20 | /*| Delete |
|00004870| 63 68 61 72 61 63 74 65 | 72 20 2a 2f 0a 58 23 64 |characte|r */.X#d|
|00004880| 65 66 69 6e 65 20 4b 45 | 59 5f 49 43 20 20 20 20 |efine KE|Y_IC |
|00004890| 20 20 20 20 20 30 78 31 | 34 62 20 20 20 20 20 20 | 0x1|4b |
|000048a0| 20 20 2f 2a 20 49 6e 73 | 65 72 74 20 63 68 61 72 | /* Ins|ert char|
|000048b0| 20 6f 72 20 65 6e 74 65 | 72 20 69 6e 73 65 72 74 | or ente|r insert|
|000048c0| 20 6d 6f 64 65 20 2a 2f | 0a 58 23 64 65 66 69 6e | mode */|.X#defin|
|000048d0| 65 20 4b 45 59 5f 45 49 | 43 20 20 20 20 20 20 20 |e KEY_EI|C |
|000048e0| 20 30 78 31 34 63 20 20 | 20 20 20 20 20 20 2f 2a | 0x14c | /*|
|000048f0| 20 45 78 69 74 20 69 6e | 73 65 72 74 20 63 68 61 | Exit in|sert cha|
|00004900| 72 20 6d 6f 64 65 20 2a | 2f 0a 58 23 64 65 66 69 |r mode *|/.X#defi|
|00004910| 6e 65 20 4b 45 59 5f 43 | 4c 45 41 52 20 20 20 20 |ne KEY_C|LEAR |
|00004920| 20 20 30 78 31 34 64 20 | 20 20 20 20 20 20 20 2f | 0x14d | /|
|00004930| 2a 20 43 6c 65 61 72 20 | 73 63 72 65 65 6e 20 2a |* Clear |screen *|
|00004940| 2f 0a 58 23 64 65 66 69 | 6e 65 20 4b 45 59 5f 45 |/.X#defi|ne KEY_E|
|00004950| 4f 53 20 20 20 20 20 20 | 20 20 30 78 31 34 65 20 |OS | 0x14e |
|00004960| 20 20 20 20 20 20 20 2f | 2a 20 43 6c 65 61 72 20 | /|* Clear |
|00004970| 74 6f 20 65 6e 64 20 6f | 66 20 73 63 72 65 65 6e |to end o|f screen|
|00004980| 20 2a 2f 0a 58 23 64 65 | 66 69 6e 65 20 4b 45 59 | */.X#de|fine KEY|
|00004990| 5f 45 4f 4c 20 20 20 20 | 20 20 20 20 30 78 31 34 |_EOL | 0x14|
|000049a0| 66 20 20 20 20 20 20 20 | 20 2f 2a 20 43 6c 65 61 |f | /* Clea|
|000049b0| 72 20 74 6f 20 65 6e 64 | 20 6f 66 20 6c 69 6e 65 |r to end| of line|
|000049c0| 20 2a 2f 0a 58 23 64 65 | 66 69 6e 65 20 4b 45 59 | */.X#de|fine KEY|
|000049d0| 5f 53 46 20 20 20 20 20 | 20 20 20 20 30 78 31 35 |_SF | 0x15|
|000049e0| 30 20 20 20 20 20 20 20 | 20 2f 2a 20 53 63 72 6f |0 | /* Scro|
|000049f0| 6c 6c 20 31 20 6c 69 6e | 65 20 66 6f 72 77 61 72 |ll 1 lin|e forwar|
|00004a00| 64 20 2a 2f 0a 58 23 64 | 65 66 69 6e 65 20 4b 45 |d */.X#d|efine KE|
|00004a10| 59 5f 53 52 20 20 20 20 | 20 20 20 20 20 30 78 31 |Y_SR | 0x1|
|00004a20| 35 31 20 20 20 20 20 20 | 20 20 2f 2a 20 53 63 72 |51 | /* Scr|
|00004a30| 6f 6c 6c 20 31 20 6c 69 | 6e 65 20 62 61 63 6b 77 |oll 1 li|ne backw|
|00004a40| 61 72 64 73 20 28 72 65 | 76 65 72 73 65 29 20 2a |ards (re|verse) *|
|00004a50| 2f 0a 58 23 64 65 66 69 | 6e 65 20 4b 45 59 5f 4e |/.X#defi|ne KEY_N|
|00004a60| 50 41 47 45 20 20 20 20 | 20 20 30 78 31 35 32 20 |PAGE | 0x152 |
|00004a70| 20 20 20 20 20 20 20 2f | 2a 20 4e 65 78 74 20 70 | /|* Next p|
|00004a80| 61 67 65 20 2a 2f 0a 58 | 23 64 65 66 69 6e 65 20 |age */.X|#define |
|00004a90| 4b 45 59 5f 50 50 41 47 | 45 20 20 20 20 20 20 30 |KEY_PPAG|E 0|
|00004aa0| 78 31 35 33 20 20 20 20 | 20 20 20 20 2f 2a 20 50 |x153 | /* P|
|00004ab0| 72 65 76 69 6f 75 73 20 | 70 61 67 65 20 2a 2f 0a |revious |page */.|
|00004ac0| 58 23 64 65 66 69 6e 65 | 20 4b 45 59 5f 53 54 41 |X#define| KEY_STA|
|00004ad0| 42 20 20 20 20 20 20 20 | 30 78 31 35 34 20 20 20 |B |0x154 |
|00004ae0| 20 20 20 20 20 2f 2a 20 | 53 65 74 20 74 61 62 20 | /* |Set tab |
|00004af0| 2a 2f 0a 58 23 64 65 66 | 69 6e 65 20 4b 45 59 5f |*/.X#def|ine KEY_|
|00004b00| 43 54 41 42 20 20 20 20 | 20 20 20 30 78 31 35 35 |CTAB | 0x155|
|00004b10| 20 20 20 20 20 20 20 20 | 2f 2a 20 43 6c 65 61 72 | |/* Clear|
|00004b20| 20 74 61 62 20 2a 2f 0a | 58 23 64 65 66 69 6e 65 | tab */.|X#define|
|00004b30| 20 4b 45 59 5f 43 41 54 | 41 42 20 20 20 20 20 20 | KEY_CAT|AB |
|00004b40| 30 78 31 35 36 20 20 20 | 20 20 20 20 20 2f 2a 20 |0x156 | /* |
|00004b50| 43 6c 65 61 72 20 61 6c | 6c 20 74 61 62 73 20 2a |Clear al|l tabs *|
|00004b60| 2f 0a 58 23 64 65 66 69 | 6e 65 20 4b 45 59 5f 45 |/.X#defi|ne KEY_E|
|00004b70| 4e 54 45 52 20 20 20 20 | 20 20 30 78 31 35 37 20 |NTER | 0x157 |
|00004b80| 20 20 20 20 20 20 20 2f | 2a 20 45 6e 74 65 72 20 | /|* Enter |
|00004b90| 6f 72 20 73 65 6e 64 20 | 28 75 6e 72 65 6c 69 61 |or send |(unrelia|
|00004ba0| 62 6c 65 29 20 2a 2f 0a | 58 23 64 65 66 69 6e 65 |ble) */.|X#define|
|00004bb0| 20 4b 45 59 5f 53 52 45 | 53 45 54 20 20 20 20 20 | KEY_SRE|SET |
|00004bc0| 30 78 31 35 38 20 20 20 | 20 20 20 20 20 2f 2a 20 |0x158 | /* |
|00004bd0| 73 6f 66 74 20 28 70 61 | 72 74 69 61 6c 29 20 72 |soft (pa|rtial) r|
|00004be0| 65 73 65 74 20 28 75 6e | 72 65 6c 69 61 62 6c 65 |eset (un|reliable|
|00004bf0| 29 20 2a 2f 0a 58 23 64 | 65 66 69 6e 65 20 4b 45 |) */.X#d|efine KE|
|00004c00| 59 5f 52 45 53 45 54 20 | 20 20 20 20 20 30 78 31 |Y_RESET | 0x1|
|00004c10| 35 39 20 20 20 20 20 20 | 20 20 2f 2a 20 72 65 73 |59 | /* res|
|00004c20| 65 74 20 6f 72 20 68 61 | 72 64 20 72 65 73 65 74 |et or ha|rd reset|
|00004c30| 20 28 75 6e 72 65 6c 69 | 61 62 6c 65 29 20 2a 2f | (unreli|able) */|
|00004c40| 0a 58 23 64 65 66 69 6e | 65 20 4b 45 59 5f 50 52 |.X#defin|e KEY_PR|
|00004c50| 49 4e 54 20 20 20 20 20 | 20 30 78 31 35 61 20 20 |INT | 0x15a |
|00004c60| 20 20 20 20 20 20 2f 2a | 20 70 72 69 6e 74 20 6f | /*| print o|
|00004c70| 72 20 63 6f 70 79 20 2a | 2f 0a 58 23 64 65 66 69 |r copy *|/.X#defi|
|00004c80| 6e 65 20 4b 45 59 5f 4c | 4c 20 20 20 20 20 20 20 |ne KEY_L|L |
|00004c90| 20 20 30 78 31 35 62 20 | 20 20 20 20 20 20 20 2f | 0x15b | /|
|00004ca0| 2a 20 68 6f 6d 65 20 64 | 6f 77 6e 20 6f 72 20 62 |* home d|own or b|
|00004cb0| 6f 74 74 6f 6d 20 28 6c | 6f 77 65 72 20 6c 65 66 |ottom (l|ower lef|
|00004cc0| 74 29 20 2a 2f 0a 58 23 | 64 65 66 69 6e 65 20 4b |t) */.X#|define K|
|00004cd0| 45 59 5f 41 42 4f 52 54 | 20 20 20 20 20 20 30 78 |EY_ABORT| 0x|
|00004ce0| 31 35 63 20 20 20 20 20 | 20 20 20 2f 2a 20 20 41 |15c | /* A|
|00004cf0| 62 6f 72 74 2f 54 65 72 | 6d 69 6e 61 74 65 20 6b |bort/Ter|minate k|
|00004d00| 65 79 20 28 61 6e 79 29 | 20 2a 2f 0a 58 23 64 65 |ey (any)| */.X#de|
|00004d10| 66 69 6e 65 20 4b 45 59 | 5f 53 48 45 4c 50 20 20 |fine KEY|_SHELP |
|00004d20| 20 20 20 20 30 78 31 35 | 64 20 20 20 20 20 20 20 | 0x15|d |
|00004d30| 20 2f 2a 20 53 68 6f 72 | 74 20 68 65 6c 70 20 2a | /* Shor|t help *|
|00004d40| 2f 0a 58 23 64 65 66 69 | 6e 65 20 4b 45 59 5f 4c |/.X#defi|ne KEY_L|
|00004d50| 48 45 4c 50 20 20 20 20 | 20 20 30 78 31 35 65 20 |HELP | 0x15e |
|00004d60| 20 20 20 20 20 20 20 2f | 2a 20 4c 6f 6e 67 20 68 | /|* Long h|
|00004d70| 65 6c 70 20 2a 2f 0a 58 | 0a 58 2f 2a 20 74 79 70 |elp */.X|.X/* typ|
|00004d80| 65 20 64 65 63 6c 61 72 | 61 74 69 6f 6e 73 20 2a |e declar|ations *|
|00004d90| 2f 0a 58 0a 58 74 79 70 | 65 64 65 66 09 63 68 61 |/.X.Xtyp|edef.cha|
|00004da0| 72 09 62 6f 6f 6c 3b 09 | 09 09 2f 2a 20 62 6f 6f |r.bool;.|../* boo|
|00004db0| 6c 65 61 6e 20 74 79 70 | 65 20 2a 2f 0a 58 0a 58 |lean typ|e */.X.X|
|00004dc0| 74 79 70 65 64 65 66 20 | 73 74 72 75 63 74 0a 58 |typedef |struct.X|
|00004dd0| 20 20 7b 0a 58 20 20 69 | 6e 74 09 20 20 20 5f 63 | {.X i|nt. _c|
|00004de0| 75 72 79 3b 09 09 09 2f | 2a 20 63 75 72 72 65 6e |ury;.../|* curren|
|00004df0| 74 20 70 73 65 75 64 6f | 2d 63 75 72 73 6f 72 20 |t pseudo|-cursor |
|00004e00| 2a 2f 0a 58 20 20 69 6e | 74 09 20 20 20 5f 63 75 |*/.X in|t. _cu|
|00004e10| 72 78 3b 0a 58 20 20 69 | 6e 74 20 20 20 20 20 20 |rx;.X i|nt |
|00004e20| 5f 6d 61 78 79 3b 09 09 | 09 2f 2a 20 6d 61 78 20 |_maxy;..|./* max |
|00004e30| 63 6f 6f 72 64 69 6e 61 | 74 65 73 20 2a 2f 0a 58 |coordina|tes */.X|
|00004e40| 20 20 69 6e 74 20 20 20 | 20 20 20 5f 6d 61 78 78 | int | _maxx|
|00004e50| 3b 0a 58 20 20 69 6e 74 | 20 20 20 20 20 20 5f 62 |;.X int| _b|
|00004e60| 65 67 79 3b 09 09 09 2f | 2a 20 6f 72 69 67 69 6e |egy;.../|* origin|
|00004e70| 20 6f 6e 20 73 63 72 65 | 65 6e 20 2a 2f 0a 58 20 | on scre|en */.X |
|00004e80| 20 69 6e 74 20 20 20 20 | 20 20 5f 62 65 67 78 3b | int | _begx;|
|00004e90| 0a 58 20 20 69 6e 74 09 | 20 20 20 5f 66 6c 61 67 |.X int.| _flag|
|00004ea0| 73 3b 09 09 09 2f 2a 20 | 77 69 6e 64 6f 77 20 70 |s;.../* |window p|
|00004eb0| 72 6f 70 65 72 74 69 65 | 73 20 2a 2f 0a 58 20 20 |ropertie|s */.X |
|00004ec0| 69 6e 74 09 20 20 20 5f | 61 74 74 72 73 3b 09 09 |int. _|attrs;..|
|00004ed0| 09 2f 2a 20 61 74 74 72 | 69 62 75 74 65 73 20 6f |./* attr|ibutes o|
|00004ee0| 66 20 77 72 69 74 74 65 | 6e 20 63 68 61 72 61 63 |f writte|n charac|
|00004ef0| 74 65 72 73 20 2a 2f 0a | 58 20 20 69 6e 74 20 20 |ters */.|X int |
|00004f00| 20 20 20 20 5f 74 61 62 | 73 69 7a 65 3b 09 09 09 | _tab|size;...|
|00004f10| 2f 2a 20 74 61 62 20 63 | 68 61 72 61 63 74 65 72 |/* tab c|haracter|
|00004f20| 20 73 69 7a 65 20 2a 2f | 0a 58 20 20 62 6f 6f 6c | size */|.X bool|
|00004f30| 09 20 20 20 5f 63 6c 65 | 61 72 3b 09 09 09 2f 2a |. _cle|ar;.../*|
|00004f40| 20 63 61 75 73 65 73 20 | 63 6c 65 61 72 20 61 74 | causes |clear at|
|00004f50| 20 6e 65 78 74 20 72 65 | 66 72 65 73 68 20 2a 2f | next re|fresh */|
|00004f60| 0a 58 20 20 62 6f 6f 6c | 09 20 20 20 5f 6c 65 61 |.X bool|. _lea|
|00004f70| 76 65 3b 09 09 09 2f 2a | 20 6c 65 61 76 65 73 20 |ve;.../*| leaves |
|00004f80| 63 75 72 73 6f 72 20 61 | 73 20 69 74 20 68 61 70 |cursor a|s it hap|
|00004f90| 70 65 6e 73 20 2a 2f 0a | 58 20 20 62 6f 6f 6c 09 |pens */.|X bool.|
|00004fa0| 20 20 20 5f 73 63 72 6f | 6c 6c 3b 09 09 09 2f 2a | _scro|ll;.../*|
|00004fb0| 20 61 6c 6c 6f 77 73 20 | 77 69 6e 64 6f 77 20 73 | allows |window s|
|00004fc0| 63 72 6f 6c 6c 69 6e 67 | 20 2a 2f 0a 58 20 20 62 |crolling| */.X b|
|00004fd0| 6f 6f 6c 09 20 20 20 5f | 6e 6f 64 65 6c 61 79 3b |ool. _|nodelay;|
|00004fe0| 09 09 09 2f 2a 20 69 6e | 70 75 74 20 63 68 61 72 |.../* in|put char|
|00004ff0| 61 63 74 65 72 20 77 61 | 69 74 20 66 6c 61 67 20 |acter wa|it flag |
|00005000| 2a 2f 0a 58 20 20 62 6f | 6f 6c 09 20 20 20 5f 6b |*/.X bo|ol. _k|
|00005010| 65 79 70 61 64 3b 09 09 | 09 2f 2a 20 66 6c 61 67 |eypad;..|./* flag|
|00005020| 73 20 6b 65 79 70 61 64 | 20 6b 65 79 20 6d 6f 64 |s keypad| key mod|
|00005030| 65 20 61 63 74 69 76 65 | 20 2a 2f 0a 58 20 20 69 |e active| */.X i|
|00005040| 6e 74 20 20 20 20 2a 2a | 5f 6c 69 6e 65 3b 09 09 |nt **|_line;..|
|00005050| 09 2f 2a 20 70 6f 69 6e | 74 65 72 20 74 6f 20 6c |./* poin|ter to l|
|00005060| 69 6e 65 20 70 6f 69 6e | 74 65 72 20 61 72 72 61 |ine poin|ter arra|
|00005070| 79 20 2a 2f 0a 58 20 20 | 69 6e 74 09 20 20 2a 5f |y */.X |int. *_|
|00005080| 6d 69 6e 63 68 6e 67 3b | 09 09 09 2f 2a 20 46 69 |minchng;|.../* Fi|
|00005090| 72 73 74 20 63 68 61 6e | 67 65 64 20 63 68 61 72 |rst chan|ged char|
|000050a0| 61 63 74 65 72 20 69 6e | 20 6c 69 6e 65 20 2a 2f |acter in| line */|
|000050b0| 0a 58 20 20 69 6e 74 09 | 20 20 2a 5f 6d 61 78 63 |.X int.| *_maxc|
|000050c0| 68 6e 67 3b 09 09 09 2f | 2a 20 4c 61 73 74 20 63 |hng;.../|* Last c|
|000050d0| 68 61 6e 67 65 64 20 63 | 68 61 72 61 63 74 65 72 |hanged c|haracter|
|000050e0| 20 69 6e 20 6c 69 6e 65 | 20 2a 2f 0a 58 20 20 69 | in line| */.X i|
|000050f0| 6e 74 09 20 20 20 5f 72 | 65 67 74 6f 70 3b 09 09 |nt. _r|egtop;..|
|00005100| 09 2f 2a 20 54 6f 70 2f | 62 6f 74 74 6f 6d 20 6f |./* Top/|bottom o|
|00005110| 66 20 73 63 72 6f 6c 6c | 69 6e 67 20 72 65 67 69 |f scroll|ing regi|
|00005120| 6f 6e 20 2a 2f 0a 58 20 | 20 69 6e 74 09 20 20 20 |on */.X | int. |
|00005130| 5f 72 65 67 62 6f 74 74 | 6f 6d 3b 0a 58 20 20 7d |_regbott|om;.X }|
|00005140| 09 57 49 4e 44 4f 57 3b | 0a 58 0a 58 2f 2a 20 45 |.WINDOW;|.X.X/* E|
|00005150| 78 74 65 72 6e 61 6c 20 | 76 61 72 69 61 62 6c 65 |xternal |variable|
|00005160| 73 20 2a 2f 0a 58 0a 58 | 65 78 74 65 72 6e 09 69 |s */.X.X|extern.i|
|00005170| 6e 74 09 4c 49 4e 45 53 | 3b 09 09 09 2f 2a 20 74 |nt.LINES|;.../* t|
|00005180| 65 72 6d 69 6e 61 6c 20 | 68 65 69 67 68 74 20 2a |erminal |height *|
|00005190| 2f 0a 58 65 78 74 65 72 | 6e 09 69 6e 74 09 43 4f |/.Xexter|n.int.CO|
|000051a0| 4c 53 3b 09 09 09 2f 2a | 20 74 65 72 6d 69 6e 61 |LS;.../*| termina|
|000051b0| 6c 20 77 69 64 74 68 20 | 2a 2f 0a 58 65 78 74 65 |l width |*/.Xexte|
|000051c0| 72 6e 09 57 49 4e 44 4f | 57 20 2a 63 75 72 73 63 |rn.WINDO|W *cursc|
|000051d0| 72 3b 09 09 09 2f 2a 20 | 74 68 65 20 63 75 72 72 |r;.../* |the curr|
|000051e0| 65 6e 74 20 73 63 72 65 | 65 6e 20 69 6d 61 67 65 |ent scre|en image|
|000051f0| 20 2a 2f 0a 58 65 78 74 | 65 72 6e 09 57 49 4e 44 | */.Xext|ern.WIND|
|00005200| 4f 57 20 2a 73 74 64 73 | 63 72 3b 09 09 09 2f 2a |OW *stds|cr;.../*|
|00005210| 20 74 68 65 20 64 65 66 | 61 75 6c 74 20 73 63 72 | the def|ault scr|
|00005220| 65 65 6e 20 77 69 6e 64 | 6f 77 20 2a 2f 0a 58 0a |een wind|ow */.X.|
|00005230| 58 2f 2a 20 50 43 63 75 | 72 73 65 73 20 66 75 6e |X/* PCcu|rses fun|
|00005240| 63 74 69 6f 6e 20 64 65 | 63 6c 61 72 61 74 69 6f |ction de|claratio|
|00005250| 6e 73 20 2a 2f 0a 58 0a | 58 65 78 74 65 72 6e 09 |ns */.X.|Xextern.|
|00005260| 69 6e 74 09 20 61 64 64 | 63 68 28 29 3b 09 09 2f |int. add|ch();../|
|00005270| 2a 20 70 75 74 20 63 68 | 61 72 20 69 6e 20 73 74 |* put ch|ar in st|
|00005280| 64 73 63 72 20 2a 2f 0a | 58 65 78 74 65 72 6e 09 |dscr */.|Xextern.|
|00005290| 69 6e 74 09 20 61 64 64 | 73 74 72 28 29 3b 09 09 |int. add|str();..|
|000052a0| 2f 2a 20 70 75 74 20 73 | 74 72 69 6e 67 20 69 6e |/* put s|tring in|
|000052b0| 20 73 74 64 73 63 72 20 | 2a 2f 0a 58 65 78 74 65 | stdscr |*/.Xexte|
|000052c0| 72 6e 09 76 6f 69 64 09 | 20 61 74 74 72 73 65 74 |rn.void.| attrset|
|000052d0| 28 29 3b 09 09 2f 2a 20 | 73 65 74 20 73 74 64 73 |();../* |set stds|
|000052e0| 63 72 20 63 68 61 72 20 | 61 74 74 72 69 62 75 74 |cr char |attribut|
|000052f0| 65 73 20 2a 2f 0a 58 65 | 78 74 65 72 6e 09 76 6f |es */.Xe|xtern.vo|
|00005300| 69 64 09 20 61 74 74 72 | 6f 66 66 28 29 3b 09 09 |id. attr|off();..|
|00005310| 2f 2a 20 63 6c 65 61 72 | 20 61 74 74 72 69 62 75 |/* clear| attribu|
|00005320| 74 65 28 61 29 20 73 74 | 64 73 63 72 20 2a 2f 0a |te(a) st|dscr */.|
|00005330| 58 65 78 74 65 72 6e 09 | 76 6f 69 64 09 20 61 74 |Xextern.|void. at|
|00005340| 74 72 6f 6e 28 29 3b 09 | 09 2f 2a 20 61 64 64 20 |tron();.|./* add |
|00005350| 61 74 74 72 69 62 75 74 | 65 28 73 29 20 73 74 64 |attribut|e(s) std|
|00005360| 73 63 72 20 2a 2f 0a 58 | 65 78 74 65 72 6e 09 69 |scr */.X|extern.i|
|00005370| 6e 74 09 20 62 61 75 64 | 72 61 74 65 28 29 3b 09 |nt. baud|rate();.|
|00005380| 09 2f 2a 20 63 6f 6d 70 | 61 74 69 62 69 6c 69 74 |./* comp|atibilit|
|00005390| 79 20 64 75 6d 6d 79 20 | 2a 2f 0a 58 65 78 74 65 |y dummy |*/.Xexte|
|000053a0| 72 6e 09 76 6f 69 64 09 | 20 62 65 65 70 28 29 3b |rn.void.| beep();|
|000053b0| 09 09 2f 2a 20 73 6f 75 | 6e 64 20 62 65 6c 6c 20 |../* sou|nd bell |
|000053c0| 2a 2f 0a 58 65 78 74 65 | 72 6e 09 76 6f 69 64 09 |*/.Xexte|rn.void.|
|000053d0| 20 62 6f 78 28 29 3b 09 | 09 09 2f 2a 20 64 72 61 | box();.|../* dra|
|000053e0| 77 20 61 20 62 6f 78 20 | 61 72 6f 75 6e 64 20 61 |w a box |around a|
|000053f0| 20 77 69 6e 64 6f 77 20 | 2a 2f 0a 58 65 78 74 65 | window |*/.Xexte|
|00005400| 72 6e 09 76 6f 69 64 09 | 20 63 62 72 65 61 6b 28 |rn.void.| cbreak(|
|00005410| 29 3b 09 09 2f 2a 20 73 | 65 74 20 74 65 72 6d 69 |);../* s|et termi|
|00005420| 6e 61 6c 20 63 62 72 65 | 61 6b 20 6d 6f 64 65 20 |nal cbre|ak mode |
|00005430| 2a 2f 0a 58 65 78 74 65 | 72 6e 09 76 6f 69 64 09 |*/.Xexte|rn.void.|
|00005440| 20 63 6c 65 61 72 28 29 | 3b 09 09 2f 2a 20 63 6c | clear()|;../* cl|
|00005450| 65 61 72 20 73 74 64 73 | 63 72 20 2a 2f 0a 58 65 |ear stds|cr */.Xe|
|00005460| 78 74 65 72 6e 09 76 6f | 69 64 09 20 63 6c 65 61 |xtern.vo|id. clea|
|00005470| 72 6f 6b 28 29 3b 09 09 | 2f 2a 20 6d 61 72 6b 73 |rok();..|/* marks|
|00005480| 20 61 20 77 69 6e 64 6f | 77 20 66 6f 72 20 73 63 | a windo|w for sc|
|00005490| 72 65 65 6e 20 63 6c 65 | 61 72 20 2a 2f 0a 58 65 |reen cle|ar */.Xe|
|000054a0| 78 74 65 72 6e 09 69 6e | 74 09 20 63 6c 72 74 6f |xtern.in|t. clrto|
|000054b0| 62 6f 74 28 29 3b 09 09 | 2f 2a 20 63 6c 65 61 72 |bot();..|/* clear|
|000054c0| 20 65 6e 64 20 6f 66 20 | 73 74 64 73 63 72 20 2a | end of |stdscr *|
|000054d0| 2f 0a 58 65 78 74 65 72 | 6e 09 69 6e 74 09 20 63 |/.Xexter|n.int. c|
|000054e0| 6c 72 74 6f 65 6f 6c 28 | 29 3b 09 09 2f 2a 20 63 |lrtoeol(|);../* c|
|000054f0| 6c 65 61 72 20 65 6e 64 | 20 6f 66 20 6c 69 6e 65 |lear end| of line|
|00005500| 20 69 6e 20 73 74 64 73 | 63 72 20 2a 2f 0a 58 65 | in stds|cr */.Xe|
|00005510| 78 74 65 72 6e 09 76 6f | 69 64 09 20 63 72 6d 6f |xtern.vo|id. crmo|
|00005520| 64 65 28 29 3b 09 09 2f | 2a 20 73 65 74 20 74 65 |de();../|* set te|
|00005530| 72 6d 69 6e 61 6c 20 63 | 62 72 65 61 6b 20 6d 6f |rminal c|break mo|
|00005540| 64 65 20 2a 2f 0a 58 65 | 78 74 65 72 6e 09 76 6f |de */.Xe|xtern.vo|
|00005550| 69 64 09 20 63 75 72 73 | 6f 66 66 28 29 3b 09 09 |id. curs|off();..|
|00005560| 2f 2a 20 74 75 72 6e 73 | 20 6f 66 66 20 68 61 72 |/* turns| off har|
|00005570| 64 77 61 72 65 20 63 75 | 72 73 6f 72 20 2a 2f 0a |dware cu|rsor */.|
|00005580| 58 65 78 74 65 72 6e 09 | 76 6f 69 64 09 20 63 75 |Xextern.|void. cu|
|00005590| 72 73 6f 6e 28 29 3b 09 | 09 2f 2a 20 74 75 72 6e |rson();.|./* turn|
|000055a0| 73 20 6f 6e 20 68 61 72 | 64 77 61 72 65 20 63 75 |s on har|dware cu|
|000055b0| 72 73 6f 72 20 2a 2f 0a | 58 65 78 74 65 72 6e 09 |rsor */.|Xextern.|
|000055c0| 69 6e 74 09 20 64 65 6c | 63 68 28 29 3b 09 09 2f |int. del|ch();../|
|000055d0| 2a 20 64 65 6c 65 74 65 | 20 61 20 63 68 61 72 20 |* delete| a char |
|000055e0| 69 6e 20 73 74 64 73 63 | 72 20 2a 2f 0a 58 65 78 |in stdsc|r */.Xex|
|000055f0| 74 65 72 6e 09 69 6e 74 | 09 20 64 65 6c 65 74 65 |tern.int|. delete|
|00005600| 6c 6e 28 29 3b 09 09 2f | 2a 20 64 65 6c 65 74 65 |ln();../|* delete|
|00005610| 20 61 20 6c 69 6e 65 20 | 69 6e 20 73 74 64 73 63 | a line |in stdsc|
|00005620| 72 20 2a 2f 0a 58 65 78 | 74 65 72 6e 09 76 6f 69 |r */.Xex|tern.voi|
|00005630| 64 09 20 64 65 6c 77 69 | 6e 28 29 3b 09 09 2f 2a |d. delwi|n();../*|
|00005640| 20 64 65 6c 65 74 65 20 | 61 20 77 69 6e 64 6f 77 | delete |a window|
|00005650| 20 6f 72 20 61 20 73 75 | 62 77 69 6e 64 6f 77 20 | or a su|bwindow |
|00005660| 2a 2f 0a 58 65 78 74 65 | 72 6e 20 20 76 6f 69 64 |*/.Xexte|rn void|
|00005670| 09 20 64 6f 75 70 64 61 | 74 65 28 29 3b 09 09 2f |. doupda|te();../|
|00005680| 2a 20 75 70 64 61 74 65 | 20 70 68 79 73 69 63 61 |* update| physica|
|00005690| 6c 20 73 63 72 65 65 6e | 20 2a 2f 0a 58 65 78 74 |l screen| */.Xext|
|000056a0| 65 72 6e 09 76 6f 69 64 | 09 20 65 63 68 6f 28 29 |ern.void|. echo()|
|000056b0| 3b 09 09 2f 2a 20 73 65 | 74 20 74 65 72 6d 69 6e |;../* se|t termin|
|000056c0| 61 6c 20 65 63 68 6f 20 | 6d 6f 64 65 20 2a 2f 0a |al echo |mode */.|
|000056d0| 58 65 78 74 65 72 6e 09 | 69 6e 74 09 20 65 6e 64 |Xextern.|int. end|
|000056e0| 77 69 6e 28 29 3b 09 09 | 2f 2a 20 63 6c 65 61 6e |win();..|/* clean|
|000056f0| 75 70 20 61 6e 64 20 66 | 69 6e 69 74 69 61 6c 69 |up and f|initiali|
|00005700| 7a 61 74 69 6f 6e 20 2a | 2f 0a 58 65 78 74 65 72 |zation *|/.Xexter|
|00005710| 6e 09 76 6f 69 64 09 20 | 65 72 61 73 65 28 29 3b |n.void. |erase();|
|00005720| 09 09 2f 2a 20 65 72 61 | 73 65 20 73 74 64 73 63 |../* era|se stdsc|
|00005730| 72 20 2a 2f 0a 58 65 78 | 74 65 72 6e 09 69 6e 74 |r */.Xex|tern.int|
|00005740| 09 20 65 72 61 73 65 63 | 68 61 72 28 29 3b 09 09 |. erasec|har();..|
|00005750| 2f 2a 20 72 65 74 75 72 | 6e 20 63 68 61 72 20 6b |/* retur|n char k|
|00005760| 69 6c 6c 20 63 68 61 72 | 61 63 74 65 72 20 2a 2f |ill char|acter */|
|00005770| 0a 58 65 78 74 65 72 6e | 09 69 6e 74 09 20 66 69 |.Xextern|.int. fi|
|00005780| 78 74 65 72 6d 28 29 3b | 09 09 2f 2a 20 63 6f 6d |xterm();|../* com|
|00005790| 70 61 74 69 62 69 6c 69 | 74 79 20 64 75 6d 6d 79 |patibili|ty dummy|
|000057a0| 20 2a 2f 0a 58 65 78 74 | 65 72 6e 09 76 6f 69 64 | */.Xext|ern.void|
|000057b0| 09 20 66 6c 61 73 68 28 | 29 3b 09 09 2f 2a 20 66 |. flash(|);../* f|
|000057c0| 6c 61 73 68 20 74 65 72 | 6d 69 6e 61 6c 20 73 63 |lash ter|minal sc|
|000057d0| 72 65 65 6e 20 2a 2f 0a | 58 65 78 74 65 72 6e 09 |reen */.|Xextern.|
|000057e0| 76 6f 69 64 09 20 66 6c | 75 73 68 69 6e 70 28 29 |void. fl|ushinp()|
|000057f0| 3b 09 09 2f 2a 20 6b 69 | 6c 6c 20 70 65 6e 64 69 |;../* ki|ll pendi|
|00005800| 6e 67 20 6b 65 79 62 6f | 61 72 64 20 69 6e 70 75 |ng keybo|ard inpu|
|00005810| 74 20 2a 2f 0a 58 65 78 | 74 65 72 6e 20 20 69 6e |t */.Xex|tern in|
|00005820| 74 09 20 67 65 74 73 74 | 72 28 29 3b 09 09 2f 2a |t. getst|r();../*|
|00005830| 20 67 65 74 20 73 74 72 | 69 6e 67 20 74 6f 20 73 | get str|ing to s|
|00005840| 74 64 73 63 72 20 61 6e | 64 20 62 75 66 66 65 72 |tdscr an|d buffer|
|00005850| 20 2a 2f 0a 58 65 78 74 | 65 72 6e 09 69 6e 74 09 | */.Xext|ern.int.|
|00005860| 20 67 65 74 74 6d 6f 64 | 65 28 29 3b 09 09 2f 2a | gettmod|e();../*|
|00005870| 20 63 6f 6d 70 61 74 69 | 62 69 6c 69 74 79 20 64 | compati|bility d|
|00005880| 75 6d 6d 79 20 2a 2f 0a | 58 65 78 74 65 72 6e 09 |ummy */.|Xextern.|
|00005890| 76 6f 69 64 09 20 69 64 | 6c 6f 6b 28 29 3b 09 09 |void. id|lok();..|
|000058a0| 2f 2a 20 75 73 65 20 69 | 6e 73 2f 64 65 6c 20 6c |/* use i|ns/del l|
|000058b0| 69 6e 65 20 28 64 75 6d | 6d 79 29 20 2a 2f 0a 58 |ine (dum|my) */.X|
|000058c0| 65 78 74 65 72 6e 09 69 | 6e 74 09 20 69 6e 69 74 |extern.i|nt. init|
|000058d0| 73 63 72 28 29 3b 09 09 | 2f 2a 20 63 75 72 73 65 |scr();..|/* curse|
|000058e0| 73 20 69 6e 69 74 69 61 | 6c 69 7a 61 74 69 6f 6e |s initia|lization|
|000058f0| 20 2a 2f 0a 58 65 78 74 | 65 72 6e 20 20 69 6e 74 | */.Xext|ern int|
|00005900| 09 20 69 6e 63 68 28 29 | 3b 09 09 2f 2a 20 67 65 |. inch()|;../* ge|
|00005910| 74 20 63 68 61 72 20 61 | 74 20 73 74 64 73 63 72 |t char a|t stdscr|
|00005920| 20 63 75 72 73 6f 72 20 | 2a 2f 0a 58 65 78 74 65 | cursor |*/.Xexte|
|00005930| 72 6e 09 69 6e 74 09 20 | 69 6e 73 63 68 28 29 3b |rn.int. |insch();|
|00005940| 09 09 2f 2a 20 69 6e 73 | 65 72 74 20 63 68 61 72 |../* ins|ert char|
|00005950| 61 63 74 65 72 20 69 6e | 20 73 74 64 73 63 72 20 |acter in| stdscr |
|00005960| 2a 2f 0a 58 65 78 74 65 | 72 6e 09 69 6e 74 09 20 |*/.Xexte|rn.int. |
|00005970| 69 6e 73 65 72 74 6c 6e | 28 29 3b 09 09 2f 2a 20 |insertln|();../* |
|00005980| 69 6e 73 65 72 74 20 6e | 65 77 20 6c 69 6e 65 20 |insert n|ew line |
|00005990| 69 6e 20 73 74 64 73 63 | 72 20 2a 2f 0a 58 65 78 |in stdsc|r */.Xex|
|000059a0| 74 65 72 6e 09 76 6f 69 | 64 09 20 6b 65 79 70 61 |tern.voi|d. keypa|
|000059b0| 64 28 29 3b 09 09 2f 2a | 20 6d 61 72 6b 73 20 61 |d();../*| marks a|
|000059c0| 20 77 69 6e 64 6f 77 20 | 66 6f 72 20 6b 65 79 70 | window |for keyp|
|000059d0| 61 64 20 75 73 61 67 65 | 20 2a 2f 0a 58 65 78 74 |ad usage| */.Xext|
|000059e0| 65 72 6e 09 69 6e 74 09 | 20 6b 69 6c 6c 63 68 61 |ern.int.| killcha|
|000059f0| 72 28 29 3b 09 09 2f 2a | 20 72 65 74 75 72 6e 20 |r();../*| return |
|00005a00| 6c 69 6e 65 20 6b 69 6c | 6c 20 63 68 61 72 61 63 |line kil|l charac|
|00005a10| 74 65 72 20 2a 2f 0a 58 | 65 78 74 65 72 6e 09 63 |ter */.X|extern.c|
|00005a20| 68 61 72 09 2a 6c 6f 6e | 67 6e 61 6d 65 28 29 3b |har.*lon|gname();|
|00005a30| 09 09 2f 2a 20 74 65 72 | 6d 69 6e 61 6c 20 64 65 |../* ter|minal de|
|00005a40| 73 63 72 69 70 74 69 6f | 6e 20 2a 2f 0a 58 65 78 |scriptio|n */.Xex|
|00005a50| 74 65 72 6e 09 76 6f 69 | 64 09 20 6c 65 61 76 65 |tern.voi|d. leave|
|00005a60| 6f 6b 28 29 3b 09 09 2f | 2a 20 6d 61 72 6b 73 20 |ok();../|* marks |
|00005a70| 77 69 6e 64 6f 77 20 66 | 6f 72 20 63 75 72 73 6f |window f|or curso|
|00005a80| 72 20 27 6c 65 61 76 65 | 27 20 2a 2f 0a 58 65 78 |r 'leave|' */.Xex|
|00005a90| 74 65 72 6e 09 76 6f 69 | 64 09 20 6d 65 74 61 28 |tern.voi|d. meta(|
|00005aa0| 29 3b 09 09 2f 2a 20 6d | 61 72 6b 73 20 77 69 6e |);../* m|arks win|
|00005ab0| 64 6f 77 20 66 6f 72 20 | 6d 65 74 61 20 28 64 75 |dow for |meta (du|
|00005ac0| 6d 6d 79 29 20 2a 2f 0a | 58 65 78 74 65 72 6e 09 |mmy) */.|Xextern.|
|00005ad0| 69 6e 74 09 20 6d 6f 76 | 65 28 29 3b 09 09 2f 2a |int. mov|e();../*|
|00005ae0| 20 6d 6f 76 65 20 63 75 | 72 73 6f 72 20 69 6e 20 | move cu|rsor in |
|00005af0| 73 74 64 73 63 72 20 2a | 2f 0a 58 65 78 74 65 72 |stdscr *|/.Xexter|
|00005b00| 6e 09 69 6e 74 09 20 6d | 76 61 64 64 63 68 28 29 |n.int. m|vaddch()|
|00005b10| 3b 09 09 2f 2a 20 6d 6f | 76 65 20 26 20 70 75 74 |;../* mo|ve & put|
|00005b20| 20 63 68 61 72 20 69 6e | 20 73 74 64 73 63 72 20 | char in| stdscr |
|00005b30| 2a 2f 0a 58 65 78 74 65 | 72 6e 09 69 6e 74 09 20 |*/.Xexte|rn.int. |
|00005b40| 6d 76 61 64 64 73 74 72 | 28 29 3b 09 09 2f 2a 20 |mvaddstr|();../* |
|00005b50| 6d 6f 76 65 20 26 20 70 | 75 74 20 73 74 72 69 6e |move & p|ut strin|
|00005b60| 67 20 69 6e 20 73 74 64 | 73 63 72 20 2a 2f 0a 58 |g in std|scr */.X|
|00005b70| 65 78 74 65 72 6e 09 69 | 6e 74 09 20 6d 76 63 6c |extern.i|nt. mvcl|
|00005b80| 72 74 6f 62 6f 74 28 29 | 3b 09 09 2f 2a 20 6d 6f |rtobot()|;../* mo|
|00005b90| 76 65 20 26 20 63 6c 65 | 61 72 20 65 6e 64 20 6f |ve & cle|ar end o|
|00005ba0| 66 20 73 74 64 73 63 72 | 20 2a 2f 0a 58 65 78 74 |f stdscr| */.Xext|
|00005bb0| 65 72 6e 09 69 6e 74 09 | 20 6d 76 63 6c 72 74 6f |ern.int.| mvclrto|
|00005bc0| 65 6f 6c 28 29 3b 09 09 | 2f 2a 20 6d 6f 76 65 20 |eol();..|/* move |
|00005bd0| 26 20 63 6c 65 61 72 20 | 6c 69 6e 65 65 6e 64 20 |& clear |lineend |
|00005be0| 69 6e 20 73 74 64 73 63 | 72 20 2a 2f 0a 58 65 78 |in stdsc|r */.Xex|
|00005bf0| 74 65 72 6e 09 69 6e 74 | 09 20 6d 76 63 75 72 28 |tern.int|. mvcur(|
|00005c00| 29 3b 09 09 2f 2a 20 6d | 6f 76 65 20 74 65 72 6d |);../* m|ove term|
|00005c10| 69 6e 61 6c 20 63 75 72 | 73 6f 72 20 2a 2f 0a 58 |inal cur|sor */.X|
|00005c20| 65 78 74 65 72 6e 09 69 | 6e 74 09 20 6d 76 64 65 |extern.i|nt. mvde|
|00005c30| 6c 63 68 28 29 3b 09 09 | 2f 2a 20 6d 6f 76 65 20 |lch();..|/* move |
|00005c40| 26 20 64 65 6c 65 74 65 | 20 61 20 63 68 61 72 20 |& delete| a char |
|00005c50| 69 6e 20 73 74 64 73 63 | 72 20 2a 2f 0a 58 65 78 |in stdsc|r */.Xex|
|00005c60| 74 65 72 6e 09 69 6e 74 | 09 20 6d 76 64 65 6c 65 |tern.int|. mvdele|
|00005c70| 74 65 6c 6e 28 29 3b 09 | 09 2f 2a 20 6d 6f 76 65 |teln();.|./* move|
|00005c80| 20 26 20 64 65 6c 65 74 | 65 20 61 20 6c 69 6e 65 | & delet|e a line|
|00005c90| 20 69 6e 20 73 74 64 73 | 63 72 20 2a 2f 0a 58 65 | in stds|cr */.Xe|
|00005ca0| 78 74 65 72 6e 09 69 6e | 74 09 20 6d 76 67 65 74 |xtern.in|t. mvget|
|00005cb0| 63 68 28 29 3b 09 09 2f | 2a 20 6d 6f 76 65 20 26 |ch();../|* move &|
|00005cc0| 20 67 65 74 20 63 68 61 | 72 20 74 6f 20 73 74 64 | get cha|r to std|
|00005cd0| 73 63 72 20 2a 2f 0a 58 | 65 78 74 65 72 6e 09 69 |scr */.X|extern.i|
|00005ce0| 6e 74 09 20 6d 76 67 65 | 74 73 74 72 28 29 3b 09 |nt. mvge|tstr();.|
|00005cf0| 09 2f 2a 20 6d 6f 76 65 | 20 26 20 67 65 74 20 73 |./* move| & get s|
|00005d00| 74 72 69 6e 67 20 74 6f | 20 73 74 64 73 63 72 20 |tring to| stdscr |
|00005d10| 2a 2f 0a 58 65 78 74 65 | 72 6e 09 69 6e 74 09 20 |*/.Xexte|rn.int. |
|00005d20| 6d 76 69 6e 63 68 28 29 | 3b 09 09 2f 2a 20 6d 6f |mvinch()|;../* mo|
|00005d30| 76 65 20 26 20 67 65 74 | 20 63 68 61 72 20 61 74 |ve & get| char at|
|00005d40| 20 73 74 64 73 63 72 20 | 63 75 72 73 6f 72 20 2a | stdscr |cursor *|
|00005d50| 2f 0a 58 65 78 74 65 72 | 6e 09 69 6e 74 09 20 6d |/.Xexter|n.int. m|
|00005d60| 76 69 6e 73 63 68 28 29 | 3b 09 09 2f 2a 20 6d 6f |vinsch()|;../* mo|
|00005d70| 76 65 20 26 20 69 6e 73 | 65 72 74 20 63 68 61 72 |ve & ins|ert char|
|00005d80| 20 69 6e 20 73 74 64 73 | 63 72 20 2a 2f 0a 58 65 | in stds|cr */.Xe|
|00005d90| 78 74 65 72 6e 09 69 6e | 74 09 20 6d 76 69 6e 73 |xtern.in|t. mvins|
|00005da0| 65 72 74 6c 6e 28 29 3b | 09 09 2f 2a 20 6d 6f 76 |ertln();|../* mov|
|00005db0| 65 20 26 20 69 6e 73 65 | 72 74 20 6e 65 77 20 6c |e & inse|rt new l|
|00005dc0| 69 6e 65 20 69 6e 20 73 | 74 64 73 63 72 20 2a 2f |ine in s|tdscr */|
|00005dd0| 0a 58 65 78 74 65 72 6e | 09 69 6e 74 09 20 6d 76 |.Xextern|.int. mv|
|00005de0| 70 72 69 6e 74 77 28 29 | 3b 09 09 2f 2a 20 6d 6f |printw()|;../* mo|
|00005df0| 76 65 20 26 20 70 72 69 | 6e 74 20 73 74 72 69 6e |ve & pri|nt strin|
|00005e00| 67 20 69 6e 20 73 74 64 | 73 63 72 20 2a 2f 0a 58 |g in std|scr */.X|
|00005e10| 65 78 74 65 72 6e 09 69 | 6e 74 09 20 6d 76 73 63 |extern.i|nt. mvsc|
|00005e20| 61 6e 77 28 29 3b 09 09 | 2f 2a 20 6d 6f 76 65 20 |anw();..|/* move |
|00005e30| 26 20 67 65 74 20 76 61 | 6c 75 65 73 20 76 69 61 |& get va|lues via|
|00005e40| 20 73 74 64 73 63 72 20 | 2a 2f 0a 58 65 78 74 65 | stdscr |*/.Xexte|
|00005e50| 72 6e 09 69 6e 74 09 20 | 6d 76 77 61 64 64 63 68 |rn.int. |mvwaddch|
|00005e60| 28 29 3b 09 09 2f 2a 20 | 6d 6f 76 65 20 26 20 70 |();../* |move & p|
|00005e70| 75 74 20 63 68 61 72 20 | 69 6e 20 61 20 77 69 6e |ut char |in a win|
|00005e80| 64 6f 77 20 2a 2f 0a 58 | 65 78 74 65 72 6e 09 69 |dow */.X|extern.i|
|00005e90| 6e 74 09 20 6d 76 77 61 | 64 64 73 74 72 28 29 3b |nt. mvwa|ddstr();|
|00005ea0| 09 09 2f 2a 20 6d 6f 76 | 65 20 26 20 70 75 74 20 |../* mov|e & put |
|00005eb0| 73 74 72 69 6e 67 20 69 | 6e 20 61 20 77 69 6e 64 |string i|n a wind|
|00005ec0| 6f 77 20 2a 2f 0a 58 65 | 78 74 65 72 6e 09 69 6e |ow */.Xe|xtern.in|
|00005ed0| 74 09 20 6d 76 77 63 6c | 72 74 6f 62 6f 74 28 29 |t. mvwcl|rtobot()|
|00005ee0| 3b 09 09 2f 2a 20 6d 6f | 76 65 20 26 20 63 6c 65 |;../* mo|ve & cle|
|00005ef0| 61 72 20 65 6e 64 20 6f | 66 20 61 20 77 69 6e 64 |ar end o|f a wind|
|00005f00| 6f 77 20 2a 2f 0a 58 65 | 78 74 65 72 6e 09 69 6e |ow */.Xe|xtern.in|
|00005f10| 74 09 20 6d 76 77 63 6c | 72 74 6f 65 6f 6c 28 29 |t. mvwcl|rtoeol()|
|00005f20| 3b 09 09 2f 2a 20 6d 6f | 76 65 20 26 20 63 6c 65 |;../* mo|ve & cle|
|00005f30| 61 72 20 6c 69 6e 65 65 | 6e 64 20 69 6e 20 61 20 |ar linee|nd in a |
|00005f40| 77 69 6e 64 6f 77 20 2a | 2f 0a 58 65 78 74 65 72 |window *|/.Xexter|
|00005f50| 6e 09 69 6e 74 09 20 6d | 76 77 64 65 6c 63 68 28 |n.int. m|vwdelch(|
|00005f60| 29 3b 09 09 2f 2a 20 6d | 6f 76 65 20 26 20 64 65 |);../* m|ove & de|
|00005f70| 6c 65 74 65 20 61 20 63 | 68 61 72 20 69 6e 20 61 |lete a c|har in a|
|00005f80| 20 77 69 6e 64 6f 77 20 | 2a 2f 0a 58 65 78 74 65 | window |*/.Xexte|
|00005f90| 72 6e 09 69 6e 74 09 20 | 6d 76 77 64 65 6c 65 74 |rn.int. |mvwdelet|
|00005fa0| 65 6c 6e 28 29 3b 09 09 | 2f 2a 20 6d 6f 76 65 20 |eln();..|/* move |
|00005fb0| 26 20 64 65 6c 65 74 65 | 20 61 20 6c 69 6e 65 20 |& delete| a line |
|00005fc0| 69 6e 20 61 20 77 69 6e | 64 6f 77 20 2a 2f 0a 58 |in a win|dow */.X|
|00005fd0| 65 78 74 65 72 6e 09 69 | 6e 74 09 20 6d 76 77 67 |extern.i|nt. mvwg|
|00005fe0| 65 74 63 68 28 29 3b 09 | 09 2f 2a 20 6d 6f 76 65 |etch();.|./* move|
|00005ff0| 20 26 20 67 65 74 20 63 | 68 61 72 20 74 6f 20 61 | & get c|har to a|
|00006000| 20 77 69 6e 64 6f 77 20 | 2a 2f 0a 58 65 78 74 65 | window |*/.Xexte|
|00006010| 72 6e 09 69 6e 74 09 20 | 6d 76 77 67 65 74 73 74 |rn.int. |mvwgetst|
|00006020| 72 28 29 3b 09 09 2f 2a | 20 6d 6f 76 65 20 26 20 |r();../*| move & |
|00006030| 67 65 74 20 73 74 72 69 | 6e 67 20 74 6f 20 61 20 |get stri|ng to a |
|00006040| 77 69 6e 64 6f 77 20 2a | 2f 0a 58 65 78 74 65 72 |window *|/.Xexter|
|00006050| 6e 09 69 6e 74 09 20 6d | 76 77 69 6e 63 68 28 29 |n.int. m|vwinch()|
|00006060| 3b 09 09 2f 2a 20 6d 6f | 76 65 20 26 20 67 65 74 |;../* mo|ve & get|
|00006070| 20 63 68 61 72 20 61 74 | 20 77 69 6e 64 6f 77 20 | char at| window |
|00006080| 63 75 72 73 6f 72 20 2a | 2f 0a 58 65 78 74 65 72 |cursor *|/.Xexter|
|00006090| 6e 09 69 6e 74 09 20 6d | 76 77 69 6e 73 63 68 28 |n.int. m|vwinsch(|
|000060a0| 29 3b 09 09 2f 2a 20 6d | 6f 76 65 20 26 20 69 6e |);../* m|ove & in|
|000060b0| 73 65 72 74 20 63 68 61 | 72 20 69 6e 20 61 20 77 |sert cha|r in a w|
|000060c0| 69 6e 64 6f 77 20 2a 2f | 0a 58 65 78 74 65 72 6e |indow */|.Xextern|
|000060d0| 09 69 6e 74 09 20 6d 76 | 77 69 6e 73 65 72 74 6c |.int. mv|winsertl|
|000060e0| 6e 28 29 3b 09 09 2f 2a | 20 6d 6f 76 65 20 26 20 |n();../*| move & |
|000060f0| 69 6e 73 65 72 74 20 6e | 65 77 20 6c 69 6e 65 20 |insert n|ew line |
|00006100| 69 6e 20 77 69 6e 64 6f | 77 20 2a 2f 0a 58 65 78 |in windo|w */.Xex|
|00006110| 74 65 72 6e 09 69 6e 74 | 09 20 6d 76 77 69 6e 28 |tern.int|. mvwin(|
|00006120| 29 3b 09 09 2f 2a 20 6d | 6f 76 65 20 77 69 6e 64 |);../* m|ove wind|
|00006130| 6f 77 20 2a 2f 0a 58 65 | 78 74 65 72 6e 09 69 6e |ow */.Xe|xtern.in|
|00006140| 74 09 20 6d 76 77 70 72 | 69 6e 74 77 28 29 3b 09 |t. mvwpr|intw();.|
|00006150| 09 2f 2a 20 6d 6f 76 65 | 20 26 20 70 72 69 6e 74 |./* move| & print|
|00006160| 20 73 74 72 69 6e 67 20 | 69 6e 20 61 20 77 69 6e | string |in a win|
|00006170| 64 6f 77 20 2a 2f 0a 58 | 65 78 74 65 72 6e 09 69 |dow */.X|extern.i|
|00006180| 6e 74 09 20 6d 76 77 73 | 63 61 6e 77 28 29 3b 09 |nt. mvws|canw();.|
|00006190| 09 2f 2a 20 6d 6f 76 65 | 20 26 20 67 65 74 20 76 |./* move| & get v|
|000061a0| 61 6c 75 65 73 20 76 69 | 61 20 61 20 77 69 6e 64 |alues vi|a a wind|
|000061b0| 6f 77 20 2a 2f 0a 58 65 | 78 74 65 72 6e 09 57 49 |ow */.Xe|xtern.WI|
|000061c0| 4e 44 4f 57 09 2a 6e 65 | 77 77 69 6e 28 29 3b 09 |NDOW.*ne|wwin();.|
|000061d0| 09 2f 2a 20 63 72 65 61 | 74 65 20 61 20 77 69 6e |./* crea|te a win|
|000061e0| 64 6f 77 20 2a 2f 0a 58 | 65 78 74 65 72 6e 09 76 |dow */.X|extern.v|
|000061f0| 6f 69 64 09 20 6e 6c 28 | 29 3b 09 09 09 2f 2a 20 |oid. nl(|);.../* |
|00006200| 73 65 74 20 74 65 72 6d | 69 6e 61 6c 20 63 72 2d |set term|inal cr-|
|00006210| 63 72 6c 66 20 6d 61 70 | 20 6d 6f 64 65 20 2a 2f |crlf map| mode */|
|00006220| 0a 58 65 78 74 65 72 6e | 09 76 6f 69 64 09 20 6e |.Xextern|.void. n|
|00006230| 6f 63 62 72 65 61 6b 28 | 29 3b 09 09 2f 2a 20 75 |ocbreak(|);../* u|
|00006240| 6e 73 65 74 20 74 65 72 | 6d 69 6e 61 6c 20 63 62 |nset ter|minal cb|
|00006250| 72 65 61 6b 20 6d 6f 64 | 65 20 2a 2f 0a 58 65 78 |reak mod|e */.Xex|
|00006260| 74 65 72 6e 09 76 6f 69 | 64 09 20 6e 6f 63 72 6d |tern.voi|d. nocrm|
|00006270| 6f 64 65 28 29 3b 09 09 | 2f 2a 20 75 6e 73 65 74 |ode();..|/* unset|
|00006280| 20 74 65 72 6d 69 6e 61 | 6c 20 63 62 72 65 61 6b | termina|l cbreak|
|00006290| 20 6d 6f 64 65 20 2a 2f | 0a 58 65 78 74 65 72 6e | mode */|.Xextern|
|000062a0| 09 76 6f 69 64 09 20 6e | 6f 64 65 6c 61 79 28 29 |.void. n|odelay()|
|000062b0| 3b 09 09 2f 2a 20 6d 61 | 72 6b 73 20 77 69 6e 64 |;../* ma|rks wind|
|000062c0| 6f 77 20 66 6f 72 20 6e | 6f 20 69 6e 70 75 74 20 |ow for n|o input |
|000062d0| 77 61 69 74 20 2a 2f 0a | 58 65 78 74 65 72 6e 09 |wait */.|Xextern.|
|000062e0| 76 6f 69 64 09 20 6e 6f | 65 63 68 6f 28 29 3b 09 |void. no|echo();.|
|000062f0| 09 2f 2a 20 75 6e 73 65 | 74 20 74 65 72 6d 69 6e |./* unse|t termin|
|00006300| 61 6c 20 65 63 68 6f 20 | 6d 6f 64 65 20 2a 2f 0a |al echo |mode */.|
|00006310| 58 65 78 74 65 72 6e 09 | 76 6f 69 64 09 20 6e 6f |Xextern.|void. no|
|00006320| 6e 6c 28 29 3b 09 09 2f | 2a 20 75 6e 73 65 74 20 |nl();../|* unset |
|00006330| 74 65 72 6d 69 6e 61 6c | 20 63 72 2d 63 72 6c 66 |terminal| cr-crlf|
|00006340| 20 6d 61 70 20 6d 6f 64 | 65 20 2a 2f 0a 58 65 78 | map mod|e */.Xex|
|00006350| 74 65 72 6e 09 76 6f 69 | 64 09 20 6e 6f 72 61 77 |tern.voi|d. noraw|
|00006360| 28 29 3b 09 09 2f 2a 20 | 75 6e 73 65 74 20 72 61 |();../* |unset ra|
|00006370| 77 20 74 65 72 6d 69 6e | 61 6c 20 6d 6f 64 65 20 |w termin|al mode |
|00006380| 2a 2f 0a 58 65 78 74 65 | 72 6e 09 76 6f 69 64 09 |*/.Xexte|rn.void.|
|00006390| 20 6f 76 65 72 6c 61 79 | 28 29 3b 09 09 2f 2a 20 | overlay|();../* |
|000063a0| 6f 76 65 72 6c 61 79 20 | 6f 6e 65 20 77 69 6e 64 |overlay |one wind|
|000063b0| 6f 77 20 6f 6e 20 61 6e | 6f 74 68 65 72 20 2a 2f |ow on an|other */|
|000063c0| 0a 58 65 78 74 65 72 6e | 09 76 6f 69 64 09 20 6f |.Xextern|.void. o|
|000063d0| 76 65 72 77 72 69 74 65 | 28 29 3b 09 09 2f 2a 20 |verwrite|();../* |
|000063e0| 6f 76 65 72 77 72 69 74 | 65 20 6f 6e 65 20 77 69 |overwrit|e one wi|
|000063f0| 6e 64 6f 77 20 6f 6e 20 | 61 6e 6f 74 68 65 72 20 |ndow on |another |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.