home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume1 / 8710 / pc-curses-doc / 3 < prev    next >
SHell self-extracting ARchive  |  1993-09-02  |  17.4 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: 3

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 33 |l pages |- Part 3|
|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 31 40 62 61 73 | 73 65 72 2e 6f 7a 3e 0a |1051@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 34 34 20 | 47 4d 54 0a 53 65 6e 64 |5:16:44 |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 37 30 38 0a 41 70 |oz.Lines|: 708.Ap|
|000000d0| 70 72 6f 76 65 64 3a 20 | 6a 6f 68 6e 40 62 61 73 |proved: |john@bas|
|000000e0| 73 65 72 2e 63 73 2e 73 | 75 2e 6f 7a 2e 41 55 0a |ser.cs.s|u.oz.AU.|
|000000f0| 58 2d 41 72 63 68 69 76 | 65 3a 20 63 6f 6d 70 2e |X-Archiv|e: comp.|
|00000100| 73 6f 75 72 63 65 73 2e | 6d 69 73 63 2f 38 37 31 |sources.|misc/871|
|00000110| 30 2f 70 63 2d 63 75 72 | 73 65 73 2d 64 6f 63 2f |0/pc-cur|ses-doc/|
|00000120| 33 0a 0a 23 21 20 2f 62 | 69 6e 2f 73 68 0a 23 20 |3..#! /b|in/sh.# |
|00000130| 54 68 69 73 20 69 73 20 | 61 20 73 68 65 6c 6c 20 |This is |a shell |
|00000140| 61 72 63 68 69 76 65 2c | 20 6d 65 61 6e 69 6e 67 |archive,| meaning|
|00000150| 3a 0a 23 20 31 2e 20 52 | 65 6d 6f 76 65 20 65 76 |:.# 1. R|emove ev|
|00000160| 65 72 79 74 68 69 6e 67 | 20 61 62 6f 76 65 20 74 |erything| above t|
|00000170| 68 65 20 23 21 20 2f 62 | 69 6e 2f 73 68 20 6c 69 |he #! /b|in/sh li|
|00000180| 6e 65 2e 0a 23 20 32 2e | 20 53 61 76 65 20 74 68 |ne..# 2.| Save th|
|00000190| 65 20 72 65 73 75 6c 74 | 69 6e 67 20 74 65 78 74 |e result|ing text|
|000001a0| 20 69 6e 20 61 20 66 69 | 6c 65 2e 0a 23 20 33 2e | in a fi|le..# 3.|
|000001b0| 20 45 78 65 63 75 74 65 | 20 74 68 65 20 66 69 6c | Execute| the fil|
|000001c0| 65 20 77 69 74 68 20 2f | 62 69 6e 2f 73 68 20 28 |e with /|bin/sh (|
|000001d0| 6e 6f 74 20 63 73 68 29 | 20 74 6f 20 63 72 65 61 |not csh)| to crea|
|000001e0| 74 65 20 74 68 65 20 66 | 69 6c 65 73 2e 0a 23 20 |te the f|iles..# |
|000001f0| 54 68 69 73 20 61 72 63 | 68 69 76 65 20 63 72 65 |This arc|hive cre|
|00000200| 61 74 65 64 3a 20 57 65 | 64 20 4f 63 74 20 20 37 |ated: We|d Oct 7|
|00000210| 20 31 37 3a 35 32 3a 33 | 34 20 45 53 54 20 31 39 | 17:52:3|4 EST 19|
|00000220| 38 37 0a 23 20 41 72 63 | 68 69 76 65 64 20 62 79 |87.# Arc|hived by|
|00000230| 3a 20 53 74 65 76 65 20 | 42 61 6c 6f 67 68 20 2d |: Steve |Balogh -|
|00000240| 20 73 74 65 76 65 25 63 | 69 74 35 2e 63 69 74 2e | steve%c|it5.cit.|
|00000250| 6f 7a 40 75 75 6e 65 74 | 2e 75 75 2e 6e 65 74 0a |oz@uunet|.uu.net.|
|00000260| 65 78 70 6f 72 74 20 50 | 41 54 48 3b 20 50 41 54 |export P|ATH; PAT|
|00000270| 48 3d 2f 62 69 6e 3a 24 | 50 41 54 48 0a 65 63 68 |H=/bin:$|PATH.ech|
|00000280| 6f 20 73 68 61 72 3a 20 | 65 78 74 72 61 63 74 69 |o shar: |extracti|
|00000290| 6e 67 20 22 27 64 65 6c | 63 68 2e 6d 27 22 20 27 |ng "'del|ch.m'" '|
|000002a0| 28 31 31 30 35 20 63 68 | 61 72 61 63 74 65 72 73 |(1105 ch|aracters|
|000002b0| 29 27 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 64 |)'.if te|st -f 'd|
|000002c0| 65 6c 63 68 2e 6d 27 0a | 74 68 65 6e 0a 09 65 63 |elch.m'.|then..ec|
|000002d0| 68 6f 20 73 68 61 72 3a | 20 77 69 6c 6c 20 6e 6f |ho shar:| will no|
|000002e0| 74 20 6f 76 65 72 2d 77 | 72 69 74 65 20 65 78 69 |t over-w|rite exi|
|000002f0| 73 74 69 6e 67 20 66 69 | 6c 65 20 22 27 64 65 6c |sting fi|le "'del|
|00000300| 63 68 2e 6d 27 22 0a 65 | 6c 73 65 0a 73 65 64 20 |ch.m'".e|lse.sed |
|00000310| 27 73 2f 5e 58 2f 2f 27 | 20 3c 3c 20 5c 53 48 41 |'s/^X//'| << \SHA|
|00000320| 52 5f 45 4f 46 20 3e 20 | 27 64 65 6c 63 68 2e 6d |R_EOF > |'delch.m|
|00000330| 27 0a 58 4e 41 4d 45 0a | 58 09 77 64 65 6c 63 68 |'.XNAME.|X.wdelch|
|00000340| 28 29 20 64 65 6c 63 68 | 28 29 20 6d 76 64 65 6c |() delch|() mvdel|
|00000350| 63 68 28 29 20 6d 76 77 | 64 65 6c 63 68 28 29 20 |ch() mvw|delch() |
|00000360| 2d 20 20 64 65 6c 65 74 | 65 20 61 20 63 68 61 72 |- delet|e a char|
|00000370| 61 63 74 65 72 0a 58 0a | 58 53 59 4e 4f 50 53 49 |acter.X.|XSYNOPSI|
|00000380| 53 0a 58 09 23 69 6e 63 | 6c 75 64 65 20 3c 63 75 |S.X.#inc|lude <cu|
|00000390| 72 73 65 73 2e 68 3e 0a | 58 09 23 69 6e 63 6c 75 |rses.h>.|X.#inclu|
|000003a0| 64 65 20 3c 63 75 72 73 | 70 72 69 76 2e 68 3e 0a |de <curs|priv.h>.|
|000003b0| 58 0a 58 09 69 6e 74 20 | 77 64 65 6c 63 68 28 77 |X.X.int |wdelch(w|
|000003c0| 69 6e 29 0a 58 09 57 49 | 4e 44 4f 57 20 2a 77 69 |in).X.WI|NDOW *wi|
|000003d0| 6e 3b 0a 58 0a 58 09 69 | 6e 74 20 64 65 6c 63 68 |n;.X.X.i|nt delch|
|000003e0| 28 29 0a 58 0a 58 09 69 | 6e 74 20 6d 76 64 65 6c |().X.X.i|nt mvdel|
|000003f0| 63 68 28 79 2c 78 29 0a | 58 09 69 6e 74 20 79 3b |ch(y,x).|X.int y;|
|00000400| 0a 58 09 69 6e 74 20 78 | 3b 0a 58 0a 58 09 69 6e |.X.int x|;.X.X.in|
|00000410| 74 20 6d 76 77 64 65 6c | 63 68 28 77 69 6e 2c 79 |t mvwdel|ch(win,y|
|00000420| 2c 78 29 0a 58 09 57 49 | 4e 44 4f 57 20 2a 77 69 |,x).X.WI|NDOW *wi|
|00000430| 6e 3b 0a 58 09 69 6e 74 | 20 79 3b 0a 58 09 69 6e |n;.X.int| y;.X.in|
|00000440| 74 20 78 3b 0a 58 0a 58 | 44 45 53 43 52 49 50 54 |t x;.X.X|DESCRIPT|
|00000450| 49 4f 4e 0a 58 09 77 64 | 65 6c 63 68 28 29 20 64 |ION.X.wd|elch() d|
|00000460| 65 6c 65 74 65 73 20 74 | 68 65 20 63 68 61 72 61 |eletes t|he chara|
|00000470| 63 74 65 72 20 61 74 20 | 74 68 65 20 77 69 6e 64 |cter at |the wind|
|00000480| 6f 77 20 63 75 72 73 6f | 72 2c 20 61 6e 64 20 74 |ow curso|r, and t|
|00000490| 68 65 20 20 0a 58 09 63 | 68 61 72 61 63 74 65 72 |he .X.c|haracter|
|000004a0| 73 20 74 6f 20 74 68 65 | 20 72 69 67 68 74 20 6f |s to the| right o|
|000004b0| 66 20 69 74 20 61 72 65 | 20 73 68 69 66 74 65 64 |f it are| shifted|
|000004c0| 20 6c 65 66 74 2c 20 69 | 6e 73 65 72 74 69 6e 67 | left, i|nserting|
|000004d0| 20 61 20 20 0a 58 09 73 | 70 61 63 65 20 61 74 20 | a .X.s|pace at |
|000004e0| 74 68 65 20 6c 61 73 74 | 20 70 6f 73 69 74 69 6f |the last| positio|
|000004f0| 6e 20 6f 66 20 74 68 65 | 20 6c 69 6e 65 2e 20 20 |n of the| line. |
|00000500| 0a 58 0a 58 09 64 65 6c | 63 68 28 29 20 64 65 6c |.X.X.del|ch() del|
|00000510| 65 74 65 73 20 74 68 65 | 20 63 68 61 72 61 63 74 |etes the| charact|
|00000520| 65 72 20 61 74 20 74 68 | 65 20 73 74 64 73 63 72 |er at th|e stdscr|
|00000530| 20 63 75 72 73 6f 72 2c | 20 61 6e 64 20 74 68 65 | cursor,| and the|
|00000540| 20 20 0a 58 09 63 68 61 | 72 61 63 74 65 72 73 20 | .X.cha|racters |
|00000550| 74 6f 20 74 68 65 20 72 | 69 67 68 74 20 6f 66 20 |to the r|ight of |
|00000560| 69 74 20 61 72 65 20 73 | 68 69 66 74 65 64 20 6c |it are s|hifted l|
|00000570| 65 66 74 2c 20 69 6e 73 | 65 72 74 69 6e 67 20 61 |eft, ins|erting a|
|00000580| 20 20 0a 58 09 73 70 61 | 63 65 20 61 74 20 74 68 | .X.spa|ce at th|
|00000590| 65 20 6c 61 73 74 20 70 | 6f 73 69 74 69 6f 6e 20 |e last p|osition |
|000005a0| 6f 66 20 74 68 65 20 6c | 69 6e 65 2e 20 20 0a 58 |of the l|ine. .X|
|000005b0| 0a 58 09 6d 76 64 65 6c | 63 68 28 29 20 6d 6f 76 |.X.mvdel|ch() mov|
|000005c0| 65 73 20 74 68 65 20 73 | 74 64 73 63 72 20 63 75 |es the s|tdscr cu|
|000005d0| 72 73 6f 72 20 74 6f 20 | 61 20 6e 65 77 20 70 6f |rsor to |a new po|
|000005e0| 73 69 74 69 6f 6e 2c 20 | 74 68 65 6e 20 20 0a 58 |sition, |then .X|
|000005f0| 09 64 65 6c 65 74 65 73 | 20 74 68 65 20 63 68 61 |.deletes| the cha|
|00000600| 72 61 63 74 65 72 20 61 | 74 20 74 68 65 20 73 74 |racter a|t the st|
|00000610| 64 73 63 72 20 63 75 72 | 73 6f 72 2c 20 61 6e 64 |dscr cur|sor, and|
|00000620| 20 74 68 65 20 63 68 61 | 72 61 63 2d 20 20 0a 58 | the cha|rac- .X|
|00000630| 09 74 65 72 73 20 74 6f | 20 74 68 65 20 72 69 67 |.ters to| the rig|
|00000640| 68 74 20 6f 66 20 69 74 | 20 61 72 65 20 73 68 69 |ht of it| are shi|
|00000650| 66 74 65 64 20 6c 65 66 | 74 2c 20 69 6e 73 65 72 |fted lef|t, inser|
|00000660| 74 69 6e 67 20 61 20 73 | 70 61 63 65 20 20 0a 58 |ting a s|pace .X|
|00000670| 09 61 74 20 74 68 65 20 | 6c 61 73 74 20 70 6f 73 |.at the |last pos|
|00000680| 69 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 6c 69 6e |ition of| the lin|
|00000690| 65 2e 20 20 0a 58 0a 58 | 09 6d 76 77 64 65 6c 63 |e. .X.X|.mvwdelc|
|000006a0| 68 28 29 20 6d 6f 76 65 | 73 20 74 68 65 20 63 75 |h() move|s the cu|
|000006b0| 72 73 6f 72 20 6f 66 20 | 77 69 6e 64 6f 77 20 27 |rsor of |window '|
|000006c0| 77 69 6e 27 20 74 6f 20 | 61 20 6e 65 77 20 70 6f |win' to |a new po|
|000006d0| 73 69 2d 20 20 0a 58 09 | 74 69 6f 6e 2c 20 74 68 |si- .X.|tion, th|
|000006e0| 65 6e 20 64 65 6c 65 74 | 65 73 20 74 68 65 20 63 |en delet|es the c|
|000006f0| 68 61 72 61 63 74 65 72 | 20 61 74 20 74 68 65 20 |haracter| at the |
|00000700| 73 74 64 73 63 72 20 63 | 75 72 73 6f 72 2c 20 61 |stdscr c|ursor, a|
|00000710| 6e 64 20 20 0a 58 09 74 | 68 65 20 63 68 61 72 61 |nd .X.t|he chara|
|00000720| 63 74 65 72 73 20 74 6f | 20 74 68 65 20 72 69 67 |cters to| the rig|
|00000730| 68 74 20 6f 66 20 69 74 | 20 61 72 65 20 73 68 69 |ht of it| are shi|
|00000740| 66 74 65 64 20 6c 65 66 | 74 2c 20 69 6e 73 65 72 |fted lef|t, inser|
|00000750| 2d 20 20 0a 58 09 74 69 | 6e 67 20 61 20 73 70 61 |- .X.ti|ng a spa|
|00000760| 63 65 20 61 74 20 74 68 | 65 20 6c 61 73 74 20 70 |ce at th|e last p|
|00000770| 6f 73 69 74 69 6f 6e 20 | 6f 66 20 74 68 65 20 6c |osition |of the l|
|00000780| 69 6e 65 2e 20 20 0a 58 | 0a 58 45 58 41 4d 50 4c |ine. .X|.XEXAMPL|
|00000790| 45 53 0a 58 0a 58 53 45 | 45 20 41 4c 53 4f 0a 58 |ES.X.XSE|E ALSO.X|
|000007a0| 09 77 6d 6f 76 65 28 29 | 0a 58 0a 58 42 55 47 53 |.wmove()|.X.XBUGS|
|000007b0| 0a 53 48 41 52 5f 45 4f | 46 0a 69 66 20 74 65 73 |.SHAR_EO|F.if tes|
|000007c0| 74 20 31 31 30 35 20 2d | 6e 65 20 22 60 77 63 20 |t 1105 -|ne "`wc |
|000007d0| 2d 63 20 3c 20 27 64 65 | 6c 63 68 2e 6d 27 60 22 |-c < 'de|lch.m'`"|
|000007e0| 0a 74 68 65 6e 0a 09 65 | 63 68 6f 20 73 68 61 72 |.then..e|cho shar|
|000007f0| 3a 20 65 72 72 6f 72 20 | 74 72 61 6e 73 6d 69 74 |: error |transmit|
|00000800| 74 69 6e 67 20 22 27 64 | 65 6c 63 68 2e 6d 27 22 |ting "'d|elch.m'"|
|00000810| 20 27 28 73 68 6f 75 6c | 64 20 68 61 76 65 20 62 | '(shoul|d have b|
|00000820| 65 65 6e 20 31 31 30 35 | 20 63 68 61 72 61 63 74 |een 1105| charact|
|00000830| 65 72 73 29 27 0a 66 69 | 0a 66 69 20 23 20 65 6e |ers)'.fi|.fi # en|
|00000840| 64 20 6f 66 20 6f 76 65 | 72 77 72 69 74 69 6e 67 |d of ove|rwriting|
|00000850| 20 63 68 65 63 6b 0a 65 | 63 68 6f 20 73 68 61 72 | check.e|cho shar|
|00000860| 3a 20 65 78 74 72 61 63 | 74 69 6e 67 20 22 27 64 |: extrac|ting "'d|
|00000870| 65 6c 65 74 65 6c 6e 2e | 6d 27 22 20 27 28 31 30 |eleteln.|m'" '(10|
|00000880| 33 38 20 63 68 61 72 61 | 63 74 65 72 73 29 27 0a |38 chara|cters)'.|
|00000890| 69 66 20 74 65 73 74 20 | 2d 66 20 27 64 65 6c 65 |if test |-f 'dele|
|000008a0| 74 65 6c 6e 2e 6d 27 0a | 74 68 65 6e 0a 09 65 63 |teln.m'.|then..ec|
|000008b0| 68 6f 20 73 68 61 72 3a | 20 77 69 6c 6c 20 6e 6f |ho shar:| will no|
|000008c0| 74 20 6f 76 65 72 2d 77 | 72 69 74 65 20 65 78 69 |t over-w|rite exi|
|000008d0| 73 74 69 6e 67 20 66 69 | 6c 65 20 22 27 64 65 6c |sting fi|le "'del|
|000008e0| 65 74 65 6c 6e 2e 6d 27 | 22 0a 65 6c 73 65 0a 73 |eteln.m'|".else.s|
|000008f0| 65 64 20 27 73 2f 5e 58 | 2f 2f 27 20 3c 3c 20 5c |ed 's/^X|//' << \|
|00000900| 53 48 41 52 5f 45 4f 46 | 20 3e 20 27 64 65 6c 65 |SHAR_EOF| > 'dele|
|00000910| 74 65 6c 6e 2e 6d 27 0a | 58 4e 41 4d 45 0a 58 09 |teln.m'.|XNAME.X.|
|00000920| 77 64 65 6c 65 74 65 6c | 6e 28 29 20 64 65 6c 65 |wdeletel|n() dele|
|00000930| 74 65 6c 6e 28 29 20 6d | 76 64 65 6c 65 74 65 6c |teln() m|vdeletel|
|00000940| 6e 28 29 20 6d 76 77 64 | 65 6c 65 74 65 6c 6e 28 |n() mvwd|eleteln(|
|00000950| 29 20 2d 20 64 65 6c 65 | 74 65 20 61 20 6c 69 6e |) - dele|te a lin|
|00000960| 65 0a 58 0a 58 53 59 4e | 4f 50 53 49 53 0a 58 09 |e.X.XSYN|OPSIS.X.|
|00000970| 23 69 6e 63 6c 75 64 65 | 20 3c 63 75 72 73 65 73 |#include| <curses|
|00000980| 2e 68 3e 0a 58 09 23 69 | 6e 63 6c 75 64 65 20 3c |.h>.X.#i|nclude <|
|00000990| 63 75 72 73 70 72 69 76 | 2e 68 3e 0a 58 0a 58 09 |curspriv|.h>.X.X.|
|000009a0| 69 6e 74 20 77 64 65 6c | 65 74 65 6c 6e 28 77 69 |int wdel|eteln(wi|
|000009b0| 6e 29 0a 58 09 57 49 4e | 44 4f 57 20 2a 77 69 6e |n).X.WIN|DOW *win|
|000009c0| 3b 0a 58 0a 58 09 69 6e | 74 20 64 65 6c 65 74 65 |;.X.X.in|t delete|
|000009d0| 6c 6e 28 29 0a 58 0a 58 | 09 69 6e 74 20 6d 76 64 |ln().X.X|.int mvd|
|000009e0| 65 6c 65 74 65 6c 6e 28 | 79 2c 78 29 0a 58 09 69 |eleteln(|y,x).X.i|
|000009f0| 6e 74 20 79 3b 0a 58 09 | 69 6e 74 20 78 3b 0a 58 |nt y;.X.|int x;.X|
|00000a00| 0a 58 09 69 6e 74 20 6d | 76 77 64 65 6c 65 74 65 |.X.int m|vwdelete|
|00000a10| 6c 6e 28 77 69 6e 2c 79 | 2c 78 29 0a 58 09 57 49 |ln(win,y|,x).X.WI|
|00000a20| 4e 44 4f 57 20 2a 77 69 | 6e 3b 0a 58 09 69 6e 74 |NDOW *wi|n;.X.int|
|00000a30| 20 79 3b 0a 58 09 69 6e | 74 20 78 3b 0a 58 0a 58 | y;.X.in|t x;.X.X|
|00000a40| 44 45 53 43 52 49 50 54 | 49 4f 4e 0a 58 09 77 64 |DESCRIPT|ION.X.wd|
|00000a50| 65 6c 65 74 65 6c 6e 28 | 29 20 64 65 6c 65 74 65 |eleteln(|) delete|
|00000a60| 73 20 74 68 65 20 6c 69 | 6e 65 20 61 74 20 74 68 |s the li|ne at th|
|00000a70| 65 20 77 69 6e 64 6f 77 | 20 63 75 72 73 6f 72 2c |e window| cursor,|
|00000a80| 20 61 6e 64 20 74 68 65 | 20 20 0a 58 09 6c 69 6e | and the| .X.lin|
|00000a90| 65 73 20 62 65 6c 6f 77 | 20 69 74 20 61 72 65 20 |es below| it are |
|00000aa0| 73 68 69 66 74 65 64 20 | 75 70 2c 20 69 6e 73 65 |shifted |up, inse|
|00000ab0| 72 74 69 6e 67 20 61 20 | 62 6c 61 6e 6b 20 6c 69 |rting a |blank li|
|00000ac0| 6e 65 20 61 74 20 20 0a | 58 09 74 68 65 20 62 6f |ne at .|X.the bo|
|00000ad0| 74 74 6f 6d 20 6f 66 20 | 74 68 65 20 77 69 6e 64 |ttom of |the wind|
|00000ae0| 6f 77 2e 20 20 0a 58 0a | 58 09 64 65 6c 65 74 65 |ow. .X.|X.delete|
|00000af0| 6c 6e 28 29 20 64 65 6c | 65 74 65 73 20 74 68 65 |ln() del|etes the|
|00000b00| 20 6c 69 6e 65 20 61 74 | 20 74 68 65 20 73 74 64 | line at| the std|
|00000b10| 73 63 72 20 63 75 72 73 | 6f 72 2c 20 61 6e 64 20 |scr curs|or, and |
|00000b20| 74 68 65 20 20 0a 58 09 | 6c 69 6e 65 73 20 62 65 |the .X.|lines be|
|00000b30| 6c 6f 77 20 69 74 20 61 | 72 65 20 73 68 69 66 74 |low it a|re shift|
|00000b40| 65 64 20 75 70 2c 20 69 | 6e 73 65 72 74 69 6e 67 |ed up, i|nserting|
|00000b50| 20 61 20 62 6c 61 6e 6b | 20 6c 69 6e 65 20 61 74 | a blank| line at|
|00000b60| 20 20 0a 58 09 74 68 65 | 20 62 6f 74 74 6f 6d 20 | .X.the| bottom |
|00000b70| 6f 66 20 73 74 64 73 63 | 72 2e 20 20 0a 58 0a 58 |of stdsc|r. .X.X|
|00000b80| 09 6d 76 64 65 6c 65 74 | 65 6c 6e 28 29 20 6d 6f |.mvdelet|eln() mo|
|00000b90| 76 65 73 20 74 68 65 20 | 63 75 72 73 6f 72 20 74 |ves the |cursor t|
|00000ba0| 6f 20 61 20 6e 65 77 20 | 70 6f 73 69 74 69 6f 6e |o a new |position|
|00000bb0| 20 69 6e 20 73 74 64 73 | 63 72 2c 20 20 0a 58 09 | in stds|cr, .X.|
|00000bc0| 74 68 65 6e 20 64 65 6c | 65 74 65 73 20 74 68 65 |then del|etes the|
|00000bd0| 20 6c 69 6e 65 20 61 74 | 20 74 68 65 20 77 69 6e | line at| the win|
|00000be0| 64 6f 77 20 63 75 72 73 | 6f 72 2c 20 61 6e 64 20 |dow curs|or, and |
|00000bf0| 74 68 65 20 6c 69 6e 65 | 73 20 20 0a 58 09 62 65 |the line|s .X.be|
|00000c00| 6c 6f 77 20 69 74 20 61 | 72 65 20 73 68 69 66 74 |low it a|re shift|
|00000c10| 65 64 20 75 70 2c 20 69 | 6e 73 65 72 74 69 6e 67 |ed up, i|nserting|
|00000c20| 20 61 20 62 6c 61 6e 6b | 20 6c 69 6e 65 20 61 74 | a blank| line at|
|00000c30| 20 74 68 65 20 62 6f 74 | 2d 20 20 0a 58 09 74 6f | the bot|- .X.to|
|00000c40| 6d 20 6f 66 20 73 74 64 | 73 63 72 2e 20 20 0a 58 |m of std|scr. .X|
|00000c50| 0a 58 09 6d 76 77 64 65 | 6c 65 74 65 6c 6e 28 29 |.X.mvwde|leteln()|
|00000c60| 20 6d 6f 76 65 73 20 74 | 68 65 20 63 75 72 73 6f | moves t|he curso|
|00000c70| 72 20 74 6f 20 61 20 6e | 65 77 20 70 6f 73 69 74 |r to a n|ew posit|
|00000c80| 69 6f 6e 20 69 6e 20 61 | 20 77 69 6e 2d 20 20 0a |ion in a| win- .|
|00000c90| 58 09 64 6f 77 2c 20 74 | 68 65 6e 20 64 65 6c 65 |X.dow, t|hen dele|
|00000ca0| 74 65 73 20 74 68 65 20 | 6c 69 6e 65 20 61 74 20 |tes the |line at |
|00000cb0| 74 68 65 20 77 69 6e 64 | 6f 77 20 63 75 72 73 6f |the wind|ow curso|
|00000cc0| 72 2c 20 61 6e 64 20 74 | 68 65 20 20 0a 58 09 6c |r, and t|he .X.l|
|00000cd0| 69 6e 65 73 20 62 65 6c | 6f 77 20 69 74 20 61 72 |ines bel|ow it ar|
|00000ce0| 65 20 73 68 69 66 74 65 | 64 20 75 70 2c 20 69 6e |e shifte|d up, in|
|00000cf0| 73 65 72 74 69 6e 67 20 | 61 20 62 6c 61 6e 6b 20 |serting |a blank |
|00000d00| 6c 69 6e 65 20 61 74 20 | 20 0a 58 09 74 68 65 20 |line at | .X.the |
|00000d10| 62 6f 74 74 6f 6d 20 6f | 66 20 74 68 65 20 77 69 |bottom o|f the wi|
|00000d20| 6e 64 6f 77 2e 20 20 0a | 58 0a 58 45 58 41 4d 50 |ndow. .|X.XEXAMP|
|00000d30| 4c 45 53 0a 58 0a 58 53 | 45 45 20 41 4c 53 4f 0a |LES.X.XS|EE ALSO.|
|00000d40| 58 09 77 6d 6f 76 65 28 | 29 20 20 0a 58 0a 58 42 |X.wmove(|) .X.XB|
|00000d50| 55 47 53 0a 53 48 41 52 | 5f 45 4f 46 0a 69 66 20 |UGS.SHAR|_EOF.if |
|00000d60| 74 65 73 74 20 31 30 33 | 38 20 2d 6e 65 20 22 60 |test 103|8 -ne "`|
|00000d70| 77 63 20 2d 63 20 3c 20 | 27 64 65 6c 65 74 65 6c |wc -c < |'deletel|
|00000d80| 6e 2e 6d 27 60 22 0a 74 | 68 65 6e 0a 09 65 63 68 |n.m'`".t|hen..ech|
|00000d90| 6f 20 73 68 61 72 3a 20 | 65 72 72 6f 72 20 74 72 |o shar: |error tr|
|00000da0| 61 6e 73 6d 69 74 74 69 | 6e 67 20 22 27 64 65 6c |ansmitti|ng "'del|
|00000db0| 65 74 65 6c 6e 2e 6d 27 | 22 20 27 28 73 68 6f 75 |eteln.m'|" '(shou|
|00000dc0| 6c 64 20 68 61 76 65 20 | 62 65 65 6e 20 31 30 33 |ld have |been 103|
|00000dd0| 38 20 63 68 61 72 61 63 | 74 65 72 73 29 27 0a 66 |8 charac|ters)'.f|
|00000de0| 69 0a 66 69 20 23 20 65 | 6e 64 20 6f 66 20 6f 76 |i.fi # e|nd of ov|
|00000df0| 65 72 77 72 69 74 69 6e | 67 20 63 68 65 63 6b 0a |erwritin|g check.|
|00000e00| 65 63 68 6f 20 73 68 61 | 72 3a 20 65 78 74 72 61 |echo sha|r: extra|
|00000e10| 63 74 69 6e 67 20 22 27 | 64 65 6c 77 69 6e 2e 6d |cting "'|delwin.m|
|00000e20| 27 22 20 27 28 33 37 32 | 20 63 68 61 72 61 63 74 |'" '(372| charact|
|00000e30| 65 72 73 29 27 0a 69 66 | 20 74 65 73 74 20 2d 66 |ers)'.if| test -f|
|00000e40| 20 27 64 65 6c 77 69 6e | 2e 6d 27 0a 74 68 65 6e | 'delwin|.m'.then|
|00000e50| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 77 69 6c |..echo s|har: wil|
|00000e60| 6c 20 6e 6f 74 20 6f 76 | 65 72 2d 77 72 69 74 65 |l not ov|er-write|
|00000e70| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 22 | existin|g file "|
|00000e80| 27 64 65 6c 77 69 6e 2e | 6d 27 22 0a 65 6c 73 65 |'delwin.|m'".else|
|00000e90| 0a 73 65 64 20 27 73 2f | 5e 58 2f 2f 27 20 3c 3c |.sed 's/|^X//' <<|
|00000ea0| 20 5c 53 48 41 52 5f 45 | 4f 46 20 3e 20 27 64 65 | \SHAR_E|OF > 'de|
|00000eb0| 6c 77 69 6e 2e 6d 27 0a | 58 4e 41 4d 45 0a 58 09 |lwin.m'.|XNAME.X.|
|00000ec0| 64 65 6c 77 69 6e 28 29 | 20 2d 20 64 65 61 6c 6c |delwin()| - deall|
|00000ed0| 6f 63 61 74 65 20 61 6c | 6c 20 64 61 74 61 20 61 |ocate al|l data a|
|00000ee0| 6c 6c 6f 63 61 74 65 64 | 20 62 79 20 27 77 69 6e |llocated| by 'win|
|00000ef0| 27 2e 0a 58 0a 58 53 59 | 4e 4f 50 53 49 53 0a 58 |'..X.XSY|NOPSIS.X|
|00000f00| 09 23 69 6e 63 6c 75 64 | 65 20 3c 63 75 72 73 65 |.#includ|e <curse|
|00000f10| 73 2e 68 3e 0a 58 09 23 | 69 6e 63 6c 75 64 65 20 |s.h>.X.#|include |
|00000f20| 3c 63 75 72 73 70 72 69 | 76 2e 68 3e 0a 58 0a 58 |<curspri|v.h>.X.X|
|00000f30| 09 76 6f 69 64 20 64 65 | 6c 77 69 6e 28 77 69 6e |.void de|lwin(win|
|00000f40| 29 0a 58 09 57 49 4e 44 | 4f 57 20 2a 77 69 6e 3b |).X.WIND|OW *win;|
|00000f50| 0a 58 0a 58 44 45 53 43 | 52 49 50 54 49 4f 4e 0a |.X.XDESC|RIPTION.|
|00000f60| 58 09 64 65 6c 77 69 6e | 28 29 20 64 65 61 6c 6c |X.delwin|() deall|
|00000f70| 6f 63 61 74 65 73 20 61 | 6c 6c 20 64 61 74 61 20 |ocates a|ll data |
|00000f80| 61 6c 6c 6f 63 61 74 65 | 64 20 62 79 20 27 77 69 |allocate|d by 'wi|
|00000f90| 6e 27 2e 20 49 66 20 27 | 77 69 6e 27 20 20 0a 58 |n'. If '|win' .X|
|00000fa0| 09 69 73 20 61 20 73 75 | 62 77 69 6e 64 6f 77 2c |.is a su|bwindow,|
|00000fb0| 20 69 74 20 75 73 65 73 | 20 74 68 65 20 6f 72 69 | it uses| the ori|
|00000fc0| 67 69 6e 61 6c 20 77 69 | 6e 64 6f 77 27 73 20 6c |ginal wi|ndow's l|
|00000fd0| 69 6e 65 73 20 66 6f 72 | 20 73 74 6f 2d 20 20 0a |ines for| sto- .|
|00000fe0| 58 09 72 61 67 65 2c 20 | 61 6e 64 20 74 68 75 73 |X.rage, |and thus|
|00000ff0| 20 74 68 65 20 6c 69 6e | 65 20 61 72 72 61 79 73 | the lin|e arrays|
|00001000| 20 61 72 65 20 6e 6f 74 | 20 64 65 61 6c 6c 6f 63 | are not| dealloc|
|00001010| 61 74 65 64 2e 20 20 0a | 58 0a 58 45 58 41 4d 50 |ated. .|X.XEXAMP|
|00001020| 4c 45 53 0a 58 0a 58 53 | 45 45 20 41 4c 53 4f 0a |LES.X.XS|EE ALSO.|
|00001030| 58 09 66 72 65 65 28 29 | 0a 58 0a 58 42 55 47 53 |X.free()|.X.XBUGS|
|00001040| 0a 53 48 41 52 5f 45 4f | 46 0a 69 66 20 74 65 73 |.SHAR_EO|F.if tes|
|00001050| 74 20 33 37 32 20 2d 6e | 65 20 22 60 77 63 20 2d |t 372 -n|e "`wc -|
|00001060| 63 20 3c 20 27 64 65 6c | 77 69 6e 2e 6d 27 60 22 |c < 'del|win.m'`"|
|00001070| 0a 74 68 65 6e 0a 09 65 | 63 68 6f 20 73 68 61 72 |.then..e|cho shar|
|00001080| 3a 20 65 72 72 6f 72 20 | 74 72 61 6e 73 6d 69 74 |: error |transmit|
|00001090| 74 69 6e 67 20 22 27 64 | 65 6c 77 69 6e 2e 6d 27 |ting "'d|elwin.m'|
|000010a0| 22 20 27 28 73 68 6f 75 | 6c 64 20 68 61 76 65 20 |" '(shou|ld have |
|000010b0| 62 65 65 6e 20 33 37 32 | 20 63 68 61 72 61 63 74 |been 372| charact|
|000010c0| 65 72 73 29 27 0a 66 69 | 0a 66 69 20 23 20 65 6e |ers)'.fi|.fi # en|
|000010d0| 64 20 6f 66 20 6f 76 65 | 72 77 72 69 74 69 6e 67 |d of ove|rwriting|
|000010e0| 20 63 68 65 63 6b 0a 65 | 63 68 6f 20 73 68 61 72 | check.e|cho shar|
|000010f0| 3a 20 65 78 74 72 61 63 | 74 69 6e 67 20 22 27 65 |: extrac|ting "'e|
|00001100| 6e 64 77 69 6e 2e 6d 27 | 22 20 27 28 33 35 32 20 |ndwin.m'|" '(352 |
|00001110| 63 68 61 72 61 63 74 65 | 72 73 29 27 0a 69 66 20 |characte|rs)'.if |
|00001120| 74 65 73 74 20 2d 66 20 | 27 65 6e 64 77 69 6e 2e |test -f |'endwin.|
|00001130| 6d 27 0a 74 68 65 6e 0a | 09 65 63 68 6f 20 73 68 |m'.then.|.echo sh|
|00001140| 61 72 3a 20 77 69 6c 6c | 20 6e 6f 74 20 6f 76 65 |ar: will| not ove|
|00001150| 72 2d 77 72 69 74 65 20 | 65 78 69 73 74 69 6e 67 |r-write |existing|
|00001160| 20 66 69 6c 65 20 22 27 | 65 6e 64 77 69 6e 2e 6d | file "'|endwin.m|
|00001170| 27 22 0a 65 6c 73 65 0a | 73 65 64 20 27 73 2f 5e |'".else.|sed 's/^|
|00001180| 58 2f 2f 27 20 3c 3c 20 | 5c 53 48 41 52 5f 45 4f |X//' << |\SHAR_EO|
|00001190| 46 20 3e 20 27 65 6e 64 | 77 69 6e 2e 6d 27 0a 58 |F > 'end|win.m'.X|
|000011a0| 4e 41 4d 45 0a 58 09 65 | 6e 64 77 69 6e 28 29 20 |NAME.X.e|ndwin() |
|000011b0| 2d 20 63 6c 65 61 6e 2d | 75 70 20 61 66 74 65 72 |- clean-|up after|
|000011c0| 20 75 73 69 6e 67 20 74 | 68 65 20 50 43 63 75 72 | using t|he PCcur|
|000011d0| 73 65 73 20 70 61 63 6b | 61 67 65 0a 58 0a 58 53 |ses pack|age.X.XS|
|000011e0| 59 4e 4f 50 53 49 53 0a | 58 09 23 69 6e 63 6c 75 |YNOPSIS.|X.#inclu|
|000011f0| 64 65 20 3c 63 75 72 73 | 65 73 2e 68 3e 0a 58 09 |de <curs|es.h>.X.|
|00001200| 23 69 6e 63 6c 75 64 65 | 20 3c 63 75 72 73 70 72 |#include| <curspr|
|00001210| 69 76 2e 68 3e 0a 58 0a | 58 09 69 6e 74 20 65 6e |iv.h>.X.|X.int en|
|00001220| 64 77 69 6e 28 29 0a 58 | 0a 58 44 45 53 43 52 49 |dwin().X|.XDESCRI|
|00001230| 50 54 49 4f 4e 0a 58 09 | 65 6e 64 77 69 6e 28 29 |PTION.X.|endwin()|
|00001240| 20 64 6f 65 73 20 6e 65 | 63 63 65 73 73 61 72 79 | does ne|ccessary|
|00001250| 20 63 6c 65 61 6e 2d 75 | 70 20 61 66 74 65 72 20 | clean-u|p after |
|00001260| 75 73 69 6e 67 20 74 68 | 65 20 50 43 63 75 72 73 |using th|e PCcurs|
|00001270| 65 73 20 20 0a 58 09 70 | 61 63 6b 61 67 65 2e 20 |es .X.p|ackage. |
|00001280| 49 74 20 73 68 6f 75 6c | 64 20 62 65 20 63 61 6c |It shoul|d be cal|
|00001290| 6c 65 64 20 62 65 66 6f | 72 65 20 65 78 69 74 69 |led befo|re exiti|
|000012a0| 6e 67 20 74 68 65 20 75 | 73 65 72 27 73 20 70 72 |ng the u|ser's pr|
|000012b0| 6f 2d 20 20 0a 58 09 67 | 72 61 6d 2e 20 20 0a 58 |o- .X.g|ram. .X|
|000012c0| 0a 58 45 58 41 4d 50 4c | 45 53 0a 58 0a 58 53 45 |.XEXAMPL|ES.X.XSE|
|000012d0| 45 20 41 4c 53 4f 0a 58 | 09 64 65 6c 77 69 6e 28 |E ALSO.X|.delwin(|
|000012e0| 29 3b 20 63 75 72 73 6f | 6e 28 29 3b 20 5f 63 75 |); curso|n(); _cu|
|000012f0| 72 73 65 73 63 75 72 73 | 6f 72 28 29 3b 20 5f 63 |rsescurs|or(); _c|
|00001300| 75 72 73 65 73 73 63 62 | 28 29 0a 58 0a 58 42 55 |ursesscb|().X.XBU|
|00001310| 47 53 0a 53 48 41 52 5f | 45 4f 46 0a 69 66 20 74 |GS.SHAR_|EOF.if t|
|00001320| 65 73 74 20 33 35 32 20 | 2d 6e 65 20 22 60 77 63 |est 352 |-ne "`wc|
|00001330| 20 2d 63 20 3c 20 27 65 | 6e 64 77 69 6e 2e 6d 27 | -c < 'e|ndwin.m'|
|00001340| 60 22 0a 74 68 65 6e 0a | 09 65 63 68 6f 20 73 68 |`".then.|.echo sh|
|00001350| 61 72 3a 20 65 72 72 6f | 72 20 74 72 61 6e 73 6d |ar: erro|r transm|
|00001360| 69 74 74 69 6e 67 20 22 | 27 65 6e 64 77 69 6e 2e |itting "|'endwin.|
|00001370| 6d 27 22 20 27 28 73 68 | 6f 75 6c 64 20 68 61 76 |m'" '(sh|ould hav|
|00001380| 65 20 62 65 65 6e 20 33 | 35 32 20 63 68 61 72 61 |e been 3|52 chara|
|00001390| 63 74 65 72 73 29 27 0a | 66 69 0a 66 69 20 23 20 |cters)'.|fi.fi # |
|000013a0| 65 6e 64 20 6f 66 20 6f | 76 65 72 77 72 69 74 69 |end of o|verwriti|
|000013b0| 6e 67 20 63 68 65 63 6b | 0a 65 63 68 6f 20 73 68 |ng check|.echo sh|
|000013c0| 61 72 3a 20 65 78 74 72 | 61 63 74 69 6e 67 20 22 |ar: extr|acting "|
|000013d0| 27 65 72 61 73 65 2e 6d | 27 22 20 27 28 34 31 37 |'erase.m|'" '(417|
|000013e0| 20 63 68 61 72 61 63 74 | 65 72 73 29 27 0a 69 66 | charact|ers)'.if|
|000013f0| 20 74 65 73 74 20 2d 66 | 20 27 65 72 61 73 65 2e | test -f| 'erase.|
|00001400| 6d 27 0a 74 68 65 6e 0a | 09 65 63 68 6f 20 73 68 |m'.then.|.echo sh|
|00001410| 61 72 3a 20 77 69 6c 6c | 20 6e 6f 74 20 6f 76 65 |ar: will| not ove|
|00001420| 72 2d 77 72 69 74 65 20 | 65 78 69 73 74 69 6e 67 |r-write |existing|
|00001430| 20 66 69 6c 65 20 22 27 | 65 72 61 73 65 2e 6d 27 | file "'|erase.m'|
|00001440| 22 0a 65 6c 73 65 0a 73 | 65 64 20 27 73 2f 5e 58 |".else.s|ed 's/^X|
|00001450| 2f 2f 27 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |//' << \|SHAR_EOF|
|00001460| 20 3e 20 27 65 72 61 73 | 65 2e 6d 27 0a 58 4e 41 | > 'eras|e.m'.XNA|
|00001470| 4d 45 0a 58 09 77 65 72 | 61 73 65 28 29 20 65 72 |ME.X.wer|ase() er|
|00001480| 61 73 65 28 29 20 2d 20 | 66 69 6c 6c 20 61 6c 6c |ase() - |fill all|
|00001490| 20 6c 69 6e 65 73 20 77 | 69 74 68 20 62 6c 61 6e | lines w|ith blan|
|000014a0| 6b 73 0a 58 0a 58 53 59 | 4e 4f 50 53 49 53 0a 58 |ks.X.XSY|NOPSIS.X|
|000014b0| 09 23 69 6e 63 6c 75 64 | 65 20 3c 63 75 72 73 65 |.#includ|e <curse|
|000014c0| 73 2e 68 3e 0a 58 09 23 | 69 6e 63 6c 75 64 65 20 |s.h>.X.#|include |
|000014d0| 3c 63 75 72 73 70 72 69 | 76 2e 68 3e 0a 58 0a 58 |<curspri|v.h>.X.X|
|000014e0| 09 76 6f 69 64 20 77 65 | 72 61 73 65 28 77 69 6e |.void we|rase(win|
|000014f0| 29 0a 58 09 57 49 4e 44 | 4f 57 20 2a 77 69 6e 3b |).X.WIND|OW *win;|
|00001500| 0a 58 0a 58 09 76 6f 69 | 64 20 65 72 61 73 65 28 |.X.X.voi|d erase(|
|00001510| 29 0a 58 0a 58 44 45 53 | 43 52 49 50 54 49 4f 4e |).X.XDES|CRIPTION|
|00001520| 0a 58 09 77 65 72 61 73 | 65 28 29 20 66 69 6c 6c |.X.weras|e() fill|
|00001530| 73 20 61 6c 6c 20 6c 69 | 6e 65 73 20 6f 66 20 77 |s all li|nes of w|
|00001540| 69 6e 64 6f 77 20 27 77 | 69 6e 27 20 77 69 74 68 |indow 'w|in' with|
|00001550| 20 62 6c 61 6e 6b 73 20 | 61 6e 64 20 70 6f 2d 20 | blanks |and po- |
|00001560| 20 0a 58 09 73 69 74 69 | 6f 6e 73 20 74 68 65 20 | .X.siti|ons the |
|00001570| 63 75 72 73 6f 72 20 61 | 74 20 68 6f 6d 65 20 69 |cursor a|t home i|
|00001580| 6e 20 74 68 65 20 73 63 | 72 6f 6c 6c 20 72 65 67 |n the sc|roll reg|
|00001590| 69 6f 6e 2e 20 20 0a 58 | 0a 58 09 65 72 61 73 65 |ion. .X|.X.erase|
|000015a0| 28 29 20 66 69 6c 6c 73 | 20 61 6c 6c 20 6c 69 6e |() fills| all lin|
|000015b0| 65 73 20 6f 66 20 73 74 | 64 73 63 72 20 77 69 74 |es of st|dscr wit|
|000015c0| 68 20 62 6c 61 6e 6b 73 | 20 61 6e 64 20 70 6f 73 |h blanks| and pos|
|000015d0| 69 74 69 6f 6e 73 20 20 | 0a 58 09 74 68 65 20 63 |itions |.X.the c|
|000015e0| 75 72 73 6f 72 20 61 74 | 20 68 6f 6d 65 20 69 6e |ursor at| home in|
|000015f0| 20 74 68 65 20 73 63 72 | 6f 6c 6c 20 72 65 67 69 | the scr|oll regi|
|00001600| 6f 6e 2e 20 20 0a 58 0a | 58 45 58 41 4d 50 4c 45 |on. .X.|XEXAMPLE|
|00001610| 53 0a 58 0a 58 53 45 45 | 20 41 4c 53 4f 0a 58 0a |S.X.XSEE| ALSO.X.|
|00001620| 58 42 55 47 53 0a 53 48 | 41 52 5f 45 4f 46 0a 69 |XBUGS.SH|AR_EOF.i|
|00001630| 66 20 74 65 73 74 20 34 | 31 37 20 2d 6e 65 20 22 |f test 4|17 -ne "|
|00001640| 60 77 63 20 2d 63 20 3c | 20 27 65 72 61 73 65 2e |`wc -c <| 'erase.|
|00001650| 6d 27 60 22 0a 74 68 65 | 6e 0a 09 65 63 68 6f 20 |m'`".the|n..echo |
|00001660| 73 68 61 72 3a 20 65 72 | 72 6f 72 20 74 72 61 6e |shar: er|ror tran|
|00001670| 73 6d 69 74 74 69 6e 67 | 20 22 27 65 72 61 73 65 |smitting| "'erase|
|00001680| 2e 6d 27 22 20 27 28 73 | 68 6f 75 6c 64 20 68 61 |.m'" '(s|hould ha|
|00001690| 76 65 20 62 65 65 6e 20 | 34 31 37 20 63 68 61 72 |ve been |417 char|
|000016a0| 61 63 74 65 72 73 29 27 | 0a 66 69 0a 66 69 20 23 |acters)'|.fi.fi #|
|000016b0| 20 65 6e 64 20 6f 66 20 | 6f 76 65 72 77 72 69 74 | end of |overwrit|
|000016c0| 69 6e 67 20 63 68 65 63 | 6b 0a 65 63 68 6f 20 73 |ing chec|k.echo s|
|000016d0| 68 61 72 3a 20 65 78 74 | 72 61 63 74 69 6e 67 20 |har: ext|racting |
|000016e0| 22 27 66 69 78 74 65 72 | 6d 2e 6d 27 22 20 27 28 |"'fixter|m.m'" '(|
|000016f0| 39 36 33 20 63 68 61 72 | 61 63 74 65 72 73 29 27 |963 char|acters)'|
|00001700| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 66 69 78 |.if test| -f 'fix|
|00001710| 74 65 72 6d 2e 6d 27 0a | 74 68 65 6e 0a 09 65 63 |term.m'.|then..ec|
|00001720| 68 6f 20 73 68 61 72 3a | 20 77 69 6c 6c 20 6e 6f |ho shar:| will no|
|00001730| 74 20 6f 76 65 72 2d 77 | 72 69 74 65 20 65 78 69 |t over-w|rite exi|
|00001740| 73 74 69 6e 67 20 66 69 | 6c 65 20 22 27 66 69 78 |sting fi|le "'fix|
|00001750| 74 65 72 6d 2e 6d 27 22 | 0a 65 6c 73 65 0a 73 65 |term.m'"|.else.se|
|00001760| 64 20 27 73 2f 5e 58 2f | 2f 27 20 3c 3c 20 5c 53 |d 's/^X/|/' << \S|
|00001770| 48 41 52 5f 45 4f 46 20 | 3e 20 27 66 69 78 74 65 |HAR_EOF |> 'fixte|
|00001780| 72 6d 2e 6d 27 0a 58 4e | 41 4d 45 0a 58 09 66 69 |rm.m'.XN|AME.X.fi|
|00001790| 78 74 65 72 6d 28 29 20 | 72 65 73 65 74 74 65 72 |xterm() |resetter|
|000017a0| 6d 28 29 20 73 61 76 65 | 6f 6c 64 74 65 72 6d 20 |m() save|oldterm |
|000017b0| 73 61 76 65 74 65 72 6d | 28 29 20 67 65 74 74 6d |saveterm|() gettm|
|000017c0| 6f 64 65 28 29 20 20 0a | 58 09 73 65 74 74 65 72 |ode() .|X.setter|
|000017d0| 6d 28 29 20 62 61 75 64 | 72 61 74 65 28 29 20 2d |m() baud|rate() -|
|000017e0| 20 66 75 6e 63 74 69 6f | 6e 20 64 75 6d 6d 69 65 | functio|n dummie|
|000017f0| 73 20 66 6f 72 20 63 6f | 6d 70 61 74 69 62 69 6c |s for co|mpatibil|
|00001800| 69 74 79 2e 20 20 0a 58 | 09 65 72 61 73 65 63 68 |ity. .X|.erasech|
|00001810| 61 72 28 29 20 6b 69 6c | 6c 63 68 61 72 28 29 20 |ar() kil|lchar() |
|00001820| 2d 20 72 65 74 75 72 6e | 20 73 74 64 20 4d 53 44 |- return| std MSD|
|00001830| 4f 53 20 65 72 61 73 65 | 20 63 68 61 72 73 2e 20 |OS erase| chars. |
|00001840| 20 0a 58 09 73 61 76 65 | 74 74 79 28 29 20 72 65 | .X.save|tty() re|
|00001850| 73 65 74 74 79 28 29 20 | 2d 20 73 61 76 65 20 61 |setty() |- save a|
|00001860| 6e 64 20 72 65 73 74 6f | 72 65 20 74 68 65 20 74 |nd resto|re the t|
|00001870| 65 72 6d 69 6e 61 6c 20 | 49 2f 4f 20 73 65 74 74 |erminal |I/O sett|
|00001880| 69 6e 67 73 2e 20 20 0a | 58 09 73 65 74 75 70 74 |ings. .|X.setupt|
|00001890| 65 72 6d 28 29 20 2d 20 | 73 65 74 73 20 75 70 20 |erm() - |sets up |
|000018a0| 74 68 65 20 74 65 72 6d | 69 6e 61 6c 2e 0a 58 0a |the term|inal..X.|
|000018b0| 58 53 59 4e 4f 50 53 49 | 53 0a 58 09 23 69 6e 63 |XSYNOPSI|S.X.#inc|
|000018c0| 6c 75 64 65 20 3c 63 75 | 72 73 65 73 2e 68 3e 0a |lude <cu|rses.h>.|
|000018d0| 58 09 23 69 6e 63 6c 75 | 64 65 20 3c 63 75 72 73 |X.#inclu|de <curs|
|000018e0| 70 72 69 76 2e 68 3e 0a | 58 0a 58 09 69 6e 74 20 |priv.h>.|X.X.int |
|000018f0| 66 69 78 74 65 72 6d 28 | 29 0a 58 0a 58 09 69 6e |fixterm(|).X.X.in|
|00001900| 74 20 72 65 73 65 74 74 | 65 72 6d 28 29 0a 58 0a |t resett|erm().X.|
|00001910| 58 09 69 6e 74 20 73 61 | 76 65 6f 6c 64 74 65 72 |X.int sa|veoldter|
|00001920| 6d 28 29 0a 58 0a 58 09 | 69 6e 74 20 73 61 76 65 |m().X.X.|int save|
|00001930| 74 65 72 6d 28 29 0a 58 | 0a 58 09 69 6e 74 20 67 |term().X|.X.int g|
|00001940| 65 74 74 6d 6f 64 65 28 | 29 0a 58 0a 58 09 69 6e |ettmode(|).X.X.in|
|00001950| 74 20 73 65 74 74 65 72 | 6d 28 74 79 70 65 29 0a |t setter|m(type).|
|00001960| 58 09 63 68 61 72 20 2a | 74 79 70 65 3b 0a 58 0a |X.char *|type;.X.|
|00001970| 58 09 69 6e 74 20 62 61 | 75 64 72 61 74 65 28 29 |X.int ba|udrate()|
|00001980| 0a 58 0a 58 09 69 6e 74 | 20 65 72 61 73 65 63 68 |.X.X.int| erasech|
|00001990| 61 72 28 29 0a 58 0a 58 | 09 69 6e 74 20 6b 69 6c |ar().X.X|.int kil|
|000019a0| 6c 63 68 61 72 28 29 0a | 58 0a 58 09 69 6e 74 20 |lchar().|X.X.int |
|000019b0| 73 61 76 65 74 74 79 28 | 29 0a 58 0a 58 09 69 6e |savetty(|).X.X.in|
|000019c0| 74 20 72 65 73 65 74 74 | 79 28 29 0a 58 0a 58 09 |t resett|y().X.X.|
|000019d0| 69 6e 74 20 73 65 74 75 | 70 74 65 72 6d 28 29 0a |int setu|pterm().|
|000019e0| 58 0a 58 44 45 53 43 52 | 49 50 54 49 4f 4e 0a 58 |X.XDESCR|IPTION.X|
|000019f0| 09 66 69 78 74 65 72 6d | 28 29 2c 20 72 65 73 65 |.fixterm|(), rese|
|00001a00| 74 74 65 72 6d 28 29 2c | 20 73 61 76 65 6f 6c 64 |tterm(),| saveold|
|00001a10| 74 65 72 6d 2c 20 73 61 | 76 65 74 65 72 6d 28 29 |term, sa|veterm()|
|00001a20| 20 67 65 74 74 6d 6f 64 | 65 28 29 2c 20 20 0a 58 | gettmod|e(), .X|
|00001a30| 09 73 65 74 74 65 72 6d | 28 29 20 61 6e 64 20 62 |.setterm|() and b|
|00001a40| 61 75 64 72 61 74 65 28 | 29 20 66 75 6e 63 74 69 |audrate(|) functi|
|00001a50| 6f 6e 20 64 75 6d 6d 69 | 65 73 20 66 6f 72 20 63 |on dummi|es for c|
|00001a60| 6f 6d 70 61 74 69 62 69 | 6c 69 74 79 2e 20 20 0a |ompatibi|lity. .|
|00001a70| 58 09 65 72 61 73 65 63 | 68 61 72 28 29 2c 20 6b |X.erasec|har(), k|
|00001a80| 69 6c 6c 63 68 61 72 28 | 29 20 72 65 74 75 72 6e |illchar(|) return|
|00001a90| 73 20 73 74 64 20 4d 53 | 44 4f 53 20 65 72 61 73 |s std MS|DOS eras|
|00001aa0| 65 20 63 68 61 72 73 2e | 20 20 0a 58 0a 58 09 73 |e chars.| .X.X.s|
|00001ab0| 61 76 65 74 74 79 28 29 | 20 61 6e 64 20 72 65 73 |avetty()| and res|
|00001ac0| 65 74 74 79 28 29 20 73 | 61 76 65 73 20 61 6e 64 |etty() s|aves and|
|00001ad0| 20 72 65 73 74 6f 72 65 | 73 20 74 68 65 20 74 65 | restore|s the te|
|00001ae0| 72 6d 69 6e 61 6c 20 49 | 2f 4f 20 20 0a 58 09 73 |rminal I|/O .X.s|
|00001af0| 65 74 74 69 6e 67 73 2e | 20 20 0a 58 0a 58 09 73 |ettings.| .X.X.s|
|00001b00| 65 74 75 70 74 65 72 6d | 28 29 20 73 65 74 73 20 |etupterm|() sets |
|00001b10| 75 70 20 74 68 65 20 74 | 65 72 6d 69 6e 61 6c 2e |up the t|erminal.|
|00001b20| 20 4f 6e 20 61 20 50 43 | 2c 20 69 74 20 69 73 20 | On a PC|, it is |
|00001b30| 61 6c 77 61 79 73 20 73 | 75 63 2d 20 20 0a 58 09 |always s|uc- .X.|
|00001b40| 63 65 73 73 66 75 6c 2c | 20 61 6e 64 20 72 65 74 |cessful,| and ret|
|00001b50| 75 72 6e 73 20 31 2e 20 | 20 0a 58 0a 58 45 58 41 |urns 1. | .X.XEXA|
|00001b60| 4d 50 4c 45 53 0a 58 0a | 58 53 45 45 20 41 4c 53 |MPLES.X.|XSEE ALS|
|00001b70| 4f 0a 58 0a 58 42 55 47 | 53 0a 53 48 41 52 5f 45 |O.X.XBUG|S.SHAR_E|
|00001b80| 4f 46 0a 69 66 20 74 65 | 73 74 20 39 36 33 20 2d |OF.if te|st 963 -|
|00001b90| 6e 65 20 22 60 77 63 20 | 2d 63 20 3c 20 27 66 69 |ne "`wc |-c < 'fi|
|00001ba0| 78 74 65 72 6d 2e 6d 27 | 60 22 0a 74 68 65 6e 0a |xterm.m'|`".then.|
|00001bb0| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 65 72 72 6f |.echo sh|ar: erro|
|00001bc0| 72 20 74 72 61 6e 73 6d | 69 74 74 69 6e 67 20 22 |r transm|itting "|
|00001bd0| 27 66 69 78 74 65 72 6d | 2e 6d 27 22 20 27 28 73 |'fixterm|.m'" '(s|
|00001be0| 68 6f 75 6c 64 20 68 61 | 76 65 20 62 65 65 6e 20 |hould ha|ve been |
|00001bf0| 39 36 33 20 63 68 61 72 | 61 63 74 65 72 73 29 27 |963 char|acters)'|
|00001c00| 0a 66 69 0a 66 69 20 23 | 20 65 6e 64 20 6f 66 20 |.fi.fi #| end of |
|00001c10| 6f 76 65 72 77 72 69 74 | 69 6e 67 20 63 68 65 63 |overwrit|ing chec|
|00001c20| 6b 0a 65 63 68 6f 20 73 | 68 61 72 3a 20 65 78 74 |k.echo s|har: ext|
|00001c30| 72 61 63 74 69 6e 67 20 | 22 27 66 6c 75 73 68 69 |racting |"'flushi|
|00001c40| 6e 70 2e 6d 27 22 20 27 | 28 32 32 32 33 20 63 68 |np.m'" '|(2223 ch|
|00001c50| 61 72 61 63 74 65 72 73 | 29 27 0a 69 66 20 74 65 |aracters|)'.if te|
|00001c60| 73 74 20 2d 66 20 27 66 | 6c 75 73 68 69 6e 70 2e |st -f 'f|lushinp.|
|00001c70| 6d 27 0a 74 68 65 6e 0a | 09 65 63 68 6f 20 73 68 |m'.then.|.echo sh|
|00001c80| 61 72 3a 20 77 69 6c 6c | 20 6e 6f 74 20 6f 76 65 |ar: will| not ove|
|00001c90| 72 2d 77 72 69 74 65 20 | 65 78 69 73 74 69 6e 67 |r-write |existing|
|00001ca0| 20 66 69 6c 65 20 22 27 | 66 6c 75 73 68 69 6e 70 | file "'|flushinp|
|00001cb0| 2e 6d 27 22 0a 65 6c 73 | 65 0a 73 65 64 20 27 73 |.m'".els|e.sed 's|
|00001cc0| 2f 5e 58 2f 2f 27 20 3c | 3c 20 5c 53 48 41 52 5f |/^X//' <|< \SHAR_|
|00001cd0| 45 4f 46 20 3e 20 27 66 | 6c 75 73 68 69 6e 70 2e |EOF > 'f|lushinp.|
|00001ce0| 6d 27 0a 58 4e 41 4d 45 | 0a 58 09 67 65 74 63 68 |m'.XNAME|.X.getch|
|00001cf0| 28 29 20 2d 20 2a 2a 2a | 73 61 6d 65 20 61 73 20 |() - ***|same as |
|00001d00| 77 67 65 74 63 68 28 29 | 2a 2a 2a 20 73 65 65 20 |wgetch()|*** see |
|00001d10| 63 75 72 73 65 73 2e 68 | 0a 58 09 77 67 65 74 63 |curses.h|.X.wgetc|
|00001d20| 68 28 29 20 66 6c 75 73 | 68 69 6e 70 28 29 20 77 |h() flus|hinp() w|
|00001d30| 75 6e 67 65 74 63 68 28 | 29 20 6d 76 67 65 74 63 |ungetch(|) mvgetc|
|00001d40| 68 28 29 20 6d 76 77 67 | 65 74 63 68 28 29 20 72 |h() mvwg|etch() r|
|00001d50| 61 77 67 65 74 63 68 28 | 29 20 0a 58 09 73 79 73 |awgetch(|) .X.sys|
|00001d60| 67 65 74 63 68 28 29 20 | 76 61 6c 69 64 63 68 61 |getch() |validcha|
|00001d70| 72 28 29 20 5f 63 75 72 | 73 65 73 70 65 6e 64 63 |r() _cur|sespendc|
|00001d80| 68 28 29 20 2d 20 6d 61 | 6e 69 70 75 6c 61 74 65 |h() - ma|nipulate|
|00001d90| 20 69 6e 70 75 74 20 63 | 68 61 72 61 63 74 65 72 | input c|haracter|
|00001da0| 73 0a 58 0a 58 53 59 4e | 4f 50 53 49 53 0a 58 09 |s.X.XSYN|OPSIS.X.|
|00001db0| 23 69 6e 63 6c 75 64 65 | 20 3c 63 75 72 73 65 73 |#include| <curses|
|00001dc0| 2e 68 3e 0a 58 09 23 69 | 6e 63 6c 75 64 65 20 3c |.h>.X.#i|nclude <|
|00001dd0| 63 75 72 73 70 72 69 76 | 2e 68 3e 0a 58 0a 58 09 |curspriv|.h>.X.X.|
|00001de0| 69 6e 74 20 77 67 65 74 | 63 68 28 77 69 6e 29 0a |int wget|ch(win).|
|00001df0| 58 09 57 49 4e 44 4f 57 | 20 2a 77 69 6e 3b 0a 58 |X.WINDOW| *win;.X|
|00001e00| 0a 58 09 76 6f 69 64 20 | 66 6c 75 73 68 69 6e 70 |.X.void |flushinp|
|00001e10| 28 29 0a 58 0a 58 09 69 | 6e 74 20 77 75 6e 67 65 |().X.X.i|nt wunge|
|00001e20| 74 63 68 28 63 68 29 0a | 58 09 69 6e 74 20 63 68 |tch(ch).|X.int ch|
|00001e30| 3b 0a 58 0a 58 09 69 6e | 74 20 6d 76 67 65 74 63 |;.X.X.in|t mvgetc|
|00001e40| 68 28 79 2c 78 29 0a 58 | 09 69 6e 74 20 79 3b 0a |h(y,x).X|.int y;.|
|00001e50| 58 09 69 6e 74 20 78 3b | 0a 58 0a 58 09 69 6e 74 |X.int x;|.X.X.int|
|00001e60| 20 6d 76 77 67 65 74 63 | 68 28 77 69 6e 2c 79 2c | mvwgetc|h(win,y,|
|00001e70| 78 29 0a 58 09 57 49 4e | 44 4f 57 20 2a 77 69 6e |x).X.WIN|DOW *win|
|00001e80| 3b 0a 58 09 69 6e 74 20 | 79 3b 0a 58 09 69 6e 74 |;.X.int |y;.X.int|
|00001e90| 20 78 3b 0a 58 0a 58 09 | 73 74 61 74 69 63 20 69 | x;.X.X.|static i|
|00001ea0| 6e 74 20 72 61 77 67 65 | 74 63 68 28 29 0a 58 0a |nt rawge|tch().X.|
|00001eb0| 58 09 73 74 61 74 69 63 | 20 69 6e 74 20 73 79 73 |X.static| int sys|
|00001ec0| 67 65 74 63 68 28 29 0a | 58 0a 58 09 73 74 61 74 |getch().|X.X.stat|
|00001ed0| 69 63 20 69 6e 74 20 76 | 61 6c 69 64 63 68 61 72 |ic int v|alidchar|
|00001ee0| 28 63 29 0a 58 09 69 6e | 74 20 63 3b 0a 58 0a 58 |(c).X.in|t c;.X.X|
|00001ef0| 09 62 6f 6f 6c 20 5f 63 | 75 72 73 65 73 70 65 6e |.bool _c|ursespen|
|00001f00| 64 63 68 28 29 0a 58 0a | 58 44 45 53 43 52 49 50 |dch().X.|XDESCRIP|
|00001f10| 54 49 4f 4e 0a 58 09 77 | 67 65 74 63 68 28 77 69 |TION.X.w|getch(wi|
|00001f20| 6e 29 20 67 65 74 73 20 | 61 20 63 68 61 72 61 63 |n) gets |a charac|
|00001f30| 74 65 72 20 66 72 6f 6d | 20 74 68 65 20 74 65 72 |ter from| the ter|
|00001f40| 6d 69 6e 61 6c 2c 20 69 | 6e 20 6e 6f 72 6d 61 6c |minal, i|n normal|
|00001f50| 2c 20 20 0a 58 09 63 62 | 72 65 61 6b 20 6f 72 20 |, .X.cb|reak or |
|00001f60| 72 61 77 20 6d 6f 64 65 | 2c 20 6f 70 74 69 6f 6e |raw mode|, option|
|00001f70| 61 6c 6c 79 20 65 63 68 | 6f 69 6e 67 20 74 6f 20 |ally ech|oing to |
|00001f80| 77 69 6e 64 6f 77 20 27 | 77 69 6e 27 2e 20 20 0a |window '|win'. .|
|00001f90| 58 0a 58 09 66 6c 75 73 | 68 69 6e 70 28 29 20 6b |X.X.flus|hinp() k|
|00001fa0| 69 6c 6c 73 20 61 6e 79 | 20 70 65 6e 64 69 6e 67 |ills any| pending|
|00001fb0| 20 69 6e 70 75 74 20 63 | 68 61 72 61 63 74 65 72 | input c|haracter|
|00001fc0| 73 2e 20 20 0a 58 0a 58 | 09 77 75 6e 67 65 74 63 |s. .X.X|.wungetc|
|00001fd0| 68 28 29 20 70 75 73 68 | 65 73 20 62 61 63 6b 20 |h() push|es back |
|00001fe0| 69 74 27 73 20 61 72 67 | 75 6d 65 6e 74 20 6f 6e |it's arg|ument on|
|00001ff0| 20 74 68 65 20 69 6e 70 | 75 74 20 73 74 72 65 61 | the inp|ut strea|
|00002000| 6d 2e 20 49 66 20 20 0a | 58 09 4f 4b 2c 20 72 65 |m. If .|X.OK, re|
|00002010| 74 75 72 6e 73 20 31 2c | 20 6f 74 68 65 72 77 69 |turns 1,| otherwi|
|00002020| 73 65 20 72 65 74 75 72 | 6e 73 20 30 2e 20 20 0a |se retur|ns 0. .|
|00002030| 58 0a 58 09 6d 76 67 65 | 74 63 68 28 29 20 66 69 |X.X.mvge|tch() fi|
|00002040| 72 73 74 20 6d 6f 76 65 | 73 20 74 68 65 20 73 74 |rst move|s the st|
|00002050| 64 73 63 72 20 63 75 72 | 73 6f 72 20 74 6f 20 61 |dscr cur|sor to a|
|00002060| 20 6e 65 77 20 6c 6f 63 | 61 74 69 6f 6e 2c 20 20 | new loc|ation, |
|00002070| 0a 58 09 74 68 65 6e 20 | 64 6f 65 73 20 61 20 77 |.X.then |does a w|
|00002080| 67 65 74 63 68 28 29 20 | 6f 6e 20 73 74 64 73 63 |getch() |on stdsc|
|00002090| 72 2e 20 20 0a 58 0a 58 | 09 6d 76 77 67 65 74 63 |r. .X.X|.mvwgetc|
|000020a0| 68 28 29 20 66 69 72 73 | 74 20 6d 6f 76 65 73 20 |h() firs|t moves |
|000020b0| 74 68 65 20 63 75 72 73 | 6f 72 20 6f 66 20 77 69 |the curs|or of wi|
|000020c0| 6e 64 6f 77 20 27 77 69 | 6e 27 20 74 6f 20 61 20 |ndow 'wi|n' to a |
|000020d0| 6e 65 77 20 20 0a 58 09 | 6c 6f 63 61 74 69 6f 6e |new .X.|location|
|000020e0| 2c 20 74 68 65 6e 20 64 | 6f 65 73 20 61 20 77 67 |, then d|oes a wg|
|000020f0| 65 74 63 68 28 29 20 69 | 6e 20 27 77 69 6e 27 2e |etch() i|n 'win'.|
|00002100| 20 20 0a 58 0a 58 09 72 | 61 77 67 65 74 63 68 28 | .X.X.r|awgetch(|
|00002110| 29 20 67 65 74 73 20 61 | 20 63 68 61 72 61 63 74 |) gets a| charact|
|00002120| 65 72 20 77 69 74 68 6f | 75 74 20 61 6e 79 20 69 |er witho|ut any i|
|00002130| 6e 74 65 72 70 72 65 74 | 61 74 69 6f 6e 20 61 74 |nterpret|ation at|
|00002140| 20 20 0a 58 09 61 6c 6c | 20 61 6e 64 20 72 65 74 | .X.all| and ret|
|00002150| 75 72 6e 73 20 69 74 2e | 20 49 66 20 6b 65 79 70 |urns it.| If keyp|
|00002160| 61 64 20 6d 6f 64 65 20 | 69 73 20 61 63 74 69 76 |ad mode |is activ|
|00002170| 65 20 66 6f 72 20 74 68 | 65 20 64 65 73 69 67 2d |e for th|e desig-|
|00002180| 20 20 0a 58 09 6e 61 74 | 65 64 20 77 69 6e 64 6f | .X.nat|ed windo|
|00002190| 77 2c 20 66 75 6e 63 74 | 69 6f 6e 20 6b 65 79 20 |w, funct|ion key |
|000021a0| 74 72 61 6e 73 6c 61 74 | 69 6f 6e 20 77 69 6c 6c |translat|ion will|
|000021b0| 20 62 65 20 70 65 72 66 | 6f 72 6d 65 64 2e 20 20 | be perf|ormed. |
|000021c0| 0a 58 09 4f 74 68 65 72 | 77 69 73 65 2c 20 66 75 |.X.Other|wise, fu|
|000021d0| 6e 63 74 69 6f 6e 20 6b | 65 79 73 20 61 72 65 20 |nction k|eys are |
|000021e0| 69 67 6e 6f 72 65 64 2e | 49 66 20 6e 6f 64 65 6c |ignored.|If nodel|
|000021f0| 61 79 20 6d 6f 64 65 20 | 69 73 20 20 0a 58 09 61 |ay mode |is .X.a|
|00002200| 63 74 69 76 65 20 69 6e | 20 74 68 65 20 77 69 6e |ctive in| the win|
|00002210| 64 6f 77 2c 20 74 68 65 | 6e 20 72 61 77 67 65 74 |dow, the|n rawget|
|00002220| 63 68 28 29 20 72 65 74 | 75 72 6e 73 20 2d 31 20 |ch() ret|urns -1 |
|00002230| 69 66 20 6e 6f 20 63 68 | 61 2d 20 20 0a 58 09 72 |if no ch|a- .X.r|
|00002240| 61 63 74 65 72 20 69 73 | 20 61 76 61 69 6c 61 62 |acter is| availab|
|00002250| 6c 65 2e 20 20 0a 58 0a | 58 09 73 79 73 67 65 74 |le. .X.|X.sysget|
|00002260| 63 68 28 29 20 67 65 74 | 73 20 61 20 63 68 61 72 |ch() get|s a char|
|00002270| 61 63 74 65 72 20 77 69 | 74 68 20 6e 6f 72 6d 61 |acter wi|th norma|
|00002280| 6c 20 5e 53 2c 20 5e 51 | 2c 20 5e 50 20 61 6e 64 |l ^S, ^Q|, ^P and|
|00002290| 20 5e 43 20 20 0a 58 09 | 69 6e 74 65 72 70 72 65 | ^C .X.|interpre|
|000022a0| 74 61 74 69 6f 6e 20 61 | 6e 64 20 72 65 74 75 72 |tation a|nd retur|
|000022b0| 6e 73 20 69 74 2e 20 49 | 66 20 6b 65 79 70 61 64 |ns it. I|f keypad|
|000022c0| 20 6d 6f 64 65 20 69 73 | 20 61 63 74 69 76 65 20 | mode is| active |
|000022d0| 66 6f 72 20 20 0a 58 09 | 74 68 65 20 64 65 73 69 |for .X.|the desi|
|000022e0| 67 6e 61 74 65 64 20 77 | 69 6e 64 6f 77 2c 20 66 |gnated w|indow, f|
|000022f0| 75 6e 63 74 69 6f 6e 20 | 6b 65 79 20 74 72 61 6e |unction |key tran|
|00002300| 73 6c 61 74 69 6f 6e 20 | 77 69 6c 6c 20 62 65 20 |slation |will be |
|00002310| 70 65 72 2d 20 20 0a 58 | 09 66 6f 72 6d 65 64 2e |per- .X|.formed.|
|00002320| 20 4f 74 68 65 72 77 69 | 73 65 2c 20 66 75 6e 63 | Otherwi|se, func|
|00002330| 74 69 6f 6e 20 6b 65 79 | 73 20 61 72 65 20 69 67 |tion key|s are ig|
|00002340| 6e 6f 72 65 64 2e 20 49 | 66 20 6e 6f 64 65 6c 61 |nored. I|f nodela|
|00002350| 79 20 20 0a 58 09 6d 6f | 64 65 20 69 73 20 61 63 |y .X.mo|de is ac|
|00002360| 74 69 76 65 20 69 6e 20 | 74 68 65 20 77 69 6e 64 |tive in |the wind|
|00002370| 6f 77 2c 20 74 68 65 6e | 20 73 79 73 67 65 74 63 |ow, then| sysgetc|
|00002380| 68 28 29 20 72 65 74 75 | 72 6e 73 20 2d 31 20 69 |h() retu|rns -1 i|
|00002390| 66 20 20 0a 58 09 6e 6f | 20 63 68 61 72 61 63 74 |f .X.no| charact|
|000023a0| 65 72 20 69 73 20 61 76 | 61 69 6c 61 62 6c 65 2e |er is av|ailable.|
|000023b0| 20 20 0a 58 0a 58 09 76 | 61 6c 69 64 63 68 61 72 | .X.X.v|alidchar|
|000023c0| 28 63 29 20 63 68 65 63 | 6b 73 20 74 68 61 74 20 |(c) chec|ks that |
|000023d0| 27 63 27 20 69 73 20 61 | 20 76 61 6c 69 64 20 63 |'c' is a| valid c|
|000023e0| 68 61 72 61 63 74 65 72 | 2c 20 61 6e 64 20 20 0a |haracter|, and .|
|000023f0| 58 09 69 66 20 73 6f 20 | 72 65 74 75 72 6e 73 20 |X.if so |returns |
|00002400| 69 74 2c 20 77 69 74 68 | 20 66 75 6e 63 74 69 6f |it, with| functio|
|00002410| 6e 20 6b 65 79 20 74 72 | 61 6e 73 6c 61 74 69 6f |n key tr|anslatio|
|00002420| 6e 20 61 70 70 6c 69 65 | 64 20 69 66 20 20 0a 58 |n applie|d if .X|
|00002430| 09 27 77 27 20 68 61 73 | 20 6b 65 79 70 61 64 20 |.'w' has| keypad |
|00002440| 6d 6f 64 65 20 73 65 74 | 2e 20 49 66 20 63 68 61 |mode set|. If cha|
|00002450| 72 20 69 73 20 69 6e 76 | 61 6c 69 64 2c 20 72 65 |r is inv|alid, re|
|00002460| 74 75 72 6e 73 20 2d 31 | 2e 20 20 0a 58 0a 58 09 |turns -1|. .X.X.|
|00002470| 5f 63 75 72 73 65 73 70 | 65 6e 64 63 68 28 29 20 |_cursesp|endch() |
|00002480| 72 65 74 75 72 6e 73 20 | 31 20 69 66 20 74 68 65 |returns |1 if the|
|00002490| 72 65 20 69 73 20 61 6e | 79 20 63 68 61 72 61 63 |re is an|y charac|
|000024a0| 74 65 72 20 61 76 61 69 | 2d 20 20 0a 58 09 6c 61 |ter avai|- .X.la|
|000024b0| 62 6c 65 2c 20 61 6e 64 | 20 30 20 69 66 20 74 68 |ble, and| 0 if th|
|000024c0| 65 72 65 20 69 73 20 6e | 6f 6e 65 2e 20 74 68 69 |ere is n|one. thi|
|000024d0| 73 20 69 73 20 6e 6f 74 | 20 66 6f 72 20 70 72 6f |s is not| for pro|
|000024e0| 67 72 61 6d 6d 65 72 20 | 20 0a 58 09 75 73 61 67 |grammer | .X.usag|
|000024f0| 65 2c 20 62 75 74 20 66 | 6f 72 20 74 68 65 20 75 |e, but f|or the u|
|00002500| 70 64 61 74 65 77 20 72 | 6f 75 74 69 6e 65 73 2e |pdatew r|outines.|
|00002510| 20 20 0a 58 0a 58 45 58 | 41 4d 50 4c 45 53 0a 58 | .X.XEX|AMPLES.X|
|00002520| 0a 58 53 45 45 20 41 4c | 53 4f 0a 58 09 72 61 77 |.XSEE AL|SO.X.raw|
|00002530| 67 65 74 63 68 28 29 3b | 20 5f 63 75 72 73 65 73 |getch();| _curses|
|00002540| 67 63 62 28 29 3b 20 5f | 63 75 72 73 65 73 73 63 |gcb(); _|cursessc|
|00002550| 62 28 29 3b 20 73 79 73 | 67 65 74 63 68 28 29 3b |b(); sys|getch();|
|00002560| 20 5f 63 75 72 73 65 73 | 73 63 62 28 29 3b 0a 58 | _curses|scb();.X|
|00002570| 09 77 61 64 64 63 68 28 | 29 3b 20 77 72 65 66 72 |.waddch(|); wrefr|
|00002580| 65 73 68 28 29 3b 20 5f | 63 75 72 73 65 73 6b 65 |esh(); _|curseske|
|00002590| 79 28 29 3b 20 6b 62 68 | 69 74 28 29 3b 20 67 65 |y(); kbh|it(); ge|
|000025a0| 74 63 68 28 29 3b 20 77 | 6d 6f 76 65 28 29 3b 0a |tch(); w|move();.|
|000025b0| 58 09 77 67 65 74 63 68 | 28 29 3b 20 5f 63 75 72 |X.wgetch|(); _cur|
|000025c0| 73 65 73 6b 65 79 74 73 | 74 28 29 3b 20 76 61 6c |seskeyts|t(); val|
|000025d0| 69 64 63 68 61 72 28 29 | 3b 0a 58 0a 58 42 55 47 |idchar()|;.X.XBUG|
|000025e0| 53 0a 53 48 41 52 5f 45 | 4f 46 0a 69 66 20 74 65 |S.SHAR_E|OF.if te|
|000025f0| 73 74 20 32 32 32 33 20 | 2d 6e 65 20 22 60 77 63 |st 2223 |-ne "`wc|
|00002600| 20 2d 63 20 3c 20 27 66 | 6c 75 73 68 69 6e 70 2e | -c < 'f|lushinp.|
|00002610| 6d 27 60 22 0a 74 68 65 | 6e 0a 09 65 63 68 6f 20 |m'`".the|n..echo |
|00002620| 73 68 61 72 3a 20 65 72 | 72 6f 72 20 74 72 61 6e |shar: er|ror tran|
|00002630| 73 6d 69 74 74 69 6e 67 | 20 22 27 66 6c 75 73 68 |smitting| "'flush|
|00002640| 69 6e 70 2e 6d 27 22 20 | 27 28 73 68 6f 75 6c 64 |inp.m'" |'(should|
|00002650| 20 68 61 76 65 20 62 65 | 65 6e 20 32 32 32 33 20 | have be|en 2223 |
|00002660| 63 68 61 72 61 63 74 65 | 72 73 29 27 0a 66 69 0a |characte|rs)'.fi.|
|00002670| 66 69 20 23 20 65 6e 64 | 20 6f 66 20 6f 76 65 72 |fi # end| of over|
|00002680| 77 72 69 74 69 6e 67 20 | 63 68 65 63 6b 0a 65 63 |writing |check.ec|
|00002690| 68 6f 20 73 68 61 72 3a | 20 65 78 74 72 61 63 74 |ho shar:| extract|
|000026a0| 69 6e 67 20 22 27 67 65 | 74 63 68 2e 6d 27 22 20 |ing "'ge|tch.m'" |
|000026b0| 27 28 32 32 32 33 20 63 | 68 61 72 61 63 74 65 72 |'(2223 c|haracter|
|000026c0| 73 29 27 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |s)'.if t|est -f '|
|000026d0| 67 65 74 63 68 2e 6d 27 | 0a 74 68 65 6e 0a 09 65 |getch.m'|.then..e|
|000026e0| 63 68 6f 20 73 68 61 72 | 3a 20 77 69 6c 6c 20 6e |cho shar|: will n|
|000026f0| 6f 74 20 6f 76 65 72 2d | 77 72 69 74 65 20 65 78 |ot over-|write ex|
|00002700| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 22 27 67 65 |isting f|ile "'ge|
|00002710| 74 63 68 2e 6d 27 22 0a | 65 6c 73 65 0a 73 65 64 |tch.m'".|else.sed|
|00002720| 20 27 73 2f 5e 58 2f 2f | 27 20 3c 3c 20 5c 53 48 | 's/^X//|' << \SH|
|00002730| 41 52 5f 45 4f 46 20 3e | 20 27 67 65 74 63 68 2e |AR_EOF >| 'getch.|
|00002740| 6d 27 0a 58 4e 41 4d 45 | 0a 58 09 67 65 74 63 68 |m'.XNAME|.X.getch|
|00002750| 28 29 20 2d 20 2a 2a 2a | 73 61 6d 65 20 61 73 20 |() - ***|same as |
|00002760| 77 67 65 74 63 68 28 29 | 2a 2a 2a 20 73 65 65 20 |wgetch()|*** see |
|00002770| 63 75 72 73 65 73 2e 68 | 0a 58 09 77 67 65 74 63 |curses.h|.X.wgetc|
|00002780| 68 28 29 20 66 6c 75 73 | 68 69 6e 70 28 29 20 77 |h() flus|hinp() w|
|00002790| 75 6e 67 65 74 63 68 28 | 29 20 6d 76 67 65 74 63 |ungetch(|) mvgetc|
|000027a0| 68 28 29 20 6d 76 77 67 | 65 74 63 68 28 29 20 72 |h() mvwg|etch() r|
|000027b0| 61 77 67 65 74 63 68 28 | 29 20 0a 58 09 73 79 73 |awgetch(|) .X.sys|
|000027c0| 67 65 74 63 68 28 29 20 | 76 61 6c 69 64 63 68 61 |getch() |validcha|
|000027d0| 72 28 29 20 5f 63 75 72 | 73 65 73 70 65 6e 64 63 |r() _cur|sespendc|
|000027e0| 68 28 29 20 2d 20 6d 61 | 6e 69 70 75 6c 61 74 65 |h() - ma|nipulate|
|000027f0| 20 69 6e 70 75 74 20 63 | 68 61 72 61 63 74 65 72 | input c|haracter|
|00002800| 73 0a 58 0a 58 53 59 4e | 4f 50 53 49 53 0a 58 09 |s.X.XSYN|OPSIS.X.|
|00002810| 23 69 6e 63 6c 75 64 65 | 20 3c 63 75 72 73 65 73 |#include| <curses|
|00002820| 2e 68 3e 0a 58 09 23 69 | 6e 63 6c 75 64 65 20 3c |.h>.X.#i|nclude <|
|00002830| 63 75 72 73 70 72 69 76 | 2e 68 3e 0a 58 0a 58 09 |curspriv|.h>.X.X.|
|00002840| 69 6e 74 20 77 67 65 74 | 63 68 28 77 69 6e 29 0a |int wget|ch(win).|
|00002850| 58 09 57 49 4e 44 4f 57 | 20 2a 77 69 6e 3b 0a 58 |X.WINDOW| *win;.X|
|00002860| 0a 58 09 76 6f 69 64 20 | 66 6c 75 73 68 69 6e 70 |.X.void |flushinp|
|00002870| 28 29 0a 58 0a 58 09 69 | 6e 74 20 77 75 6e 67 65 |().X.X.i|nt wunge|
|00002880| 74 63 68 28 63 68 29 0a | 58 09 69 6e 74 20 63 68 |tch(ch).|X.int ch|
|00002890| 3b 0a 58 0a 58 09 69 6e | 74 20 6d 76 67 65 74 63 |;.X.X.in|t mvgetc|
|000028a0| 68 28 79 2c 78 29 0a 58 | 09 69 6e 74 20 79 3b 0a |h(y,x).X|.int y;.|
|000028b0| 58 09 69 6e 74 20 78 3b | 0a 58 0a 58 09 69 6e 74 |X.int x;|.X.X.int|
|000028c0| 20 6d 76 77 67 65 74 63 | 68 28 77 69 6e 2c 79 2c | mvwgetc|h(win,y,|
|000028d0| 78 29 0a 58 09 57 49 4e | 44 4f 57 20 2a 77 69 6e |x).X.WIN|DOW *win|
|000028e0| 3b 0a 58 09 69 6e 74 20 | 79 3b 0a 58 09 69 6e 74 |;.X.int |y;.X.int|
|000028f0| 20 78 3b 0a 58 0a 58 09 | 73 74 61 74 69 63 20 69 | x;.X.X.|static i|
|00002900| 6e 74 20 72 61 77 67 65 | 74 63 68 28 29 0a 58 0a |nt rawge|tch().X.|
|00002910| 58 09 73 74 61 74 69 63 | 20 69 6e 74 20 73 79 73 |X.static| int sys|
|00002920| 67 65 74 63 68 28 29 0a | 58 0a 58 09 73 74 61 74 |getch().|X.X.stat|
|00002930| 69 63 20 69 6e 74 20 76 | 61 6c 69 64 63 68 61 72 |ic int v|alidchar|
|00002940| 28 63 29 0a 58 09 69 6e | 74 20 63 3b 0a 58 0a 58 |(c).X.in|t c;.X.X|
|00002950| 09 62 6f 6f 6c 20 5f 63 | 75 72 73 65 73 70 65 6e |.bool _c|ursespen|
|00002960| 64 63 68 28 29 0a 58 0a | 58 44 45 53 43 52 49 50 |dch().X.|XDESCRIP|
|00002970| 54 49 4f 4e 0a 58 09 77 | 67 65 74 63 68 28 77 69 |TION.X.w|getch(wi|
|00002980| 6e 29 20 67 65 74 73 20 | 61 20 63 68 61 72 61 63 |n) gets |a charac|
|00002990| 74 65 72 20 66 72 6f 6d | 20 74 68 65 20 74 65 72 |ter from| the ter|
|000029a0| 6d 69 6e 61 6c 2c 20 69 | 6e 20 6e 6f 72 6d 61 6c |minal, i|n normal|
|000029b0| 2c 20 20 0a 58 09 63 62 | 72 65 61 6b 20 6f 72 20 |, .X.cb|reak or |
|000029c0| 72 61 77 20 6d 6f 64 65 | 2c 20 6f 70 74 69 6f 6e |raw mode|, option|
|000029d0| 61 6c 6c 79 20 65 63 68 | 6f 69 6e 67 20 74 6f 20 |ally ech|oing to |
|000029e0| 77 69 6e 64 6f 77 20 27 | 77 69 6e 27 2e 20 20 0a |window '|win'. .|
|000029f0| 58 0a 58 09 66 6c 75 73 | 68 69 6e 70 28 29 20 6b |X.X.flus|hinp() k|
|00002a00| 69 6c 6c 73 20 61 6e 79 | 20 70 65 6e 64 69 6e 67 |ills any| pending|
|00002a10| 20 69 6e 70 75 74 20 63 | 68 61 72 61 63 74 65 72 | input c|haracter|
|00002a20| 73 2e 20 20 0a 58 0a 58 | 09 77 75 6e 67 65 74 63 |s. .X.X|.wungetc|
|00002a30| 68 28 29 20 70 75 73 68 | 65 73 20 62 61 63 6b 20 |h() push|es back |
|00002a40| 69 74 27 73 20 61 72 67 | 75 6d 65 6e 74 20 6f 6e |it's arg|ument on|
|00002a50| 20 74 68 65 20 69 6e 70 | 75 74 20 73 74 72 65 61 | the inp|ut strea|
|00002a60| 6d 2e 20 49 66 20 20 0a | 58 09 4f 4b 2c 20 72 65 |m. If .|X.OK, re|
|00002a70| 74 75 72 6e 73 20 31 2c | 20 6f 74 68 65 72 77 69 |turns 1,| otherwi|
|00002a80| 73 65 20 72 65 74 75 72 | 6e 73 20 30 2e 20 20 0a |se retur|ns 0. .|
|00002a90| 58 0a 58 09 6d 76 67 65 | 74 63 68 28 29 20 66 69 |X.X.mvge|tch() fi|
|00002aa0| 72 73 74 20 6d 6f 76 65 | 73 20 74 68 65 20 73 74 |rst move|s the st|
|00002ab0| 64 73 63 72 20 63 75 72 | 73 6f 72 20 74 6f 20 61 |dscr cur|sor to a|
|00002ac0| 20 6e 65 77 20 6c 6f 63 | 61 74 69 6f 6e 2c 20 20 | new loc|ation, |
|00002ad0| 0a 58 09 74 68 65 6e 20 | 64 6f 65 73 20 61 20 77 |.X.then |does a w|
|00002ae0| 67 65 74 63 68 28 29 20 | 6f 6e 20 73 74 64 73 63 |getch() |on stdsc|
|00002af0| 72 2e 20 20 0a 58 0a 58 | 09 6d 76 77 67 65 74 63 |r. .X.X|.mvwgetc|
|00002b00| 68 28 29 20 66 69 72 73 | 74 20 6d 6f 76 65 73 20 |h() firs|t moves |
|00002b10| 74 68 65 20 63 75 72 73 | 6f 72 20 6f 66 20 77 69 |the curs|or of wi|
|00002b20| 6e 64 6f 77 20 27 77 69 | 6e 27 20 74 6f 20 61 20 |ndow 'wi|n' to a |
|00002b30| 6e 65 77 20 20 0a 58 09 | 6c 6f 63 61 74 69 6f 6e |new .X.|location|
|00002b40| 2c 20 74 68 65 6e 20 64 | 6f 65 73 20 61 20 77 67 |, then d|oes a wg|
|00002b50| 65 74 63 68 28 29 20 69 | 6e 20 27 77 69 6e 27 2e |etch() i|n 'win'.|
|00002b60| 20 20 0a 58 0a 58 09 72 | 61 77 67 65 74 63 68 28 | .X.X.r|awgetch(|
|00002b70| 29 20 67 65 74 73 20 61 | 20 63 68 61 72 61 63 74 |) gets a| charact|
|00002b80| 65 72 20 77 69 74 68 6f | 75 74 20 61 6e 79 20 69 |er witho|ut any i|
|00002b90| 6e 74 65 72 70 72 65 74 | 61 74 69 6f 6e 20 61 74 |nterpret|ation at|
|00002ba0| 20 20 0a 58 09 61 6c 6c | 20 61 6e 64 20 72 65 74 | .X.all| and ret|
|00002bb0| 75 72 6e 73 20 69 74 2e | 20 49 66 20 6b 65 79 70 |urns it.| If keyp|
|00002bc0| 61 64 20 6d 6f 64 65 20 | 69 73 20 61 63 74 69 76 |ad mode |is activ|
|00002bd0| 65 20 66 6f 72 20 74 68 | 65 20 64 65 73 69 67 2d |e for th|e desig-|
|00002be0| 20 20 0a 58 09 6e 61 74 | 65 64 20 77 69 6e 64 6f | .X.nat|ed windo|
|00002bf0| 77 2c 20 66 75 6e 63 74 | 69 6f 6e 20 6b 65 79 20 |w, funct|ion key |
|00002c00| 74 72 61 6e 73 6c 61 74 | 69 6f 6e 20 77 69 6c 6c |translat|ion will|
|00002c10| 20 62 65 20 70 65 72 66 | 6f 72 6d 65 64 2e 20 20 | be perf|ormed. |
|00002c20| 0a 58 09 4f 74 68 65 72 | 77 69 73 65 2c 20 66 75 |.X.Other|wise, fu|
|00002c30| 6e 63 74 69 6f 6e 20 6b | 65 79 73 20 61 72 65 20 |nction k|eys are |
|00002c40| 69 67 6e 6f 72 65 64 2e | 49 66 20 6e 6f 64 65 6c |ignored.|If nodel|
|00002c50| 61 79 20 6d 6f 64 65 20 | 69 73 20 20 0a 58 09 61 |ay mode |is .X.a|
|00002c60| 63 74 69 76 65 20 69 6e | 20 74 68 65 20 77 69 6e |ctive in| the win|
|00002c70| 64 6f 77 2c 20 74 68 65 | 6e 20 72 61 77 67 65 74 |dow, the|n rawget|
|00002c80| 63 68 28 29 20 72 65 74 | 75 72 6e 73 20 2d 31 20 |ch() ret|urns -1 |
|00002c90| 69 66 20 6e 6f 20 63 68 | 61 2d 20 20 0a 58 09 72 |if no ch|a- .X.r|
|00002ca0| 61 63 74 65 72 20 69 73 | 20 61 76 61 69 6c 61 62 |acter is| availab|
|00002cb0| 6c 65 2e 20 20 0a 58 0a | 58 09 73 79 73 67 65 74 |le. .X.|X.sysget|
|00002cc0| 63 68 28 29 20 67 65 74 | 73 20 61 20 63 68 61 72 |ch() get|s a char|
|00002cd0| 61 63 74 65 72 20 77 69 | 74 68 20 6e 6f 72 6d 61 |acter wi|th norma|
|00002ce0| 6c 20 5e 53 2c 20 5e 51 | 2c 20 5e 50 20 61 6e 64 |l ^S, ^Q|, ^P and|
|00002cf0| 20 5e 43 20 20 0a 58 09 | 69 6e 74 65 72 70 72 65 | ^C .X.|interpre|
|00002d00| 74 61 74 69 6f 6e 20 61 | 6e 64 20 72 65 74 75 72 |tation a|nd retur|
|00002d10| 6e 73 20 69 74 2e 20 49 | 66 20 6b 65 79 70 61 64 |ns it. I|f keypad|
|00002d20| 20 6d 6f 64 65 20 69 73 | 20 61 63 74 69 76 65 20 | mode is| active |
|00002d30| 66 6f 72 20 20 0a 58 09 | 74 68 65 20 64 65 73 69 |for .X.|the desi|
|00002d40| 67 6e 61 74 65 64 20 77 | 69 6e 64 6f 77 2c 20 66 |gnated w|indow, f|
|00002d50| 75 6e 63 74 69 6f 6e 20 | 6b 65 79 20 74 72 61 6e |unction |key tran|
|00002d60| 73 6c 61 74 69 6f 6e 20 | 77 69 6c 6c 20 62 65 20 |slation |will be |
|00002d70| 70 65 72 2d 20 20 0a 58 | 09 66 6f 72 6d 65 64 2e |per- .X|.formed.|
|00002d80| 20 4f 74 68 65 72 77 69 | 73 65 2c 20 66 75 6e 63 | Otherwi|se, func|
|00002d90| 74 69 6f 6e 20 6b 65 79 | 73 20 61 72 65 20 69 67 |tion key|s are ig|
|00002da0| 6e 6f 72 65 64 2e 20 49 | 66 20 6e 6f 64 65 6c 61 |nored. I|f nodela|
|00002db0| 79 20 20 0a 58 09 6d 6f | 64 65 20 69 73 20 61 63 |y .X.mo|de is ac|
|00002dc0| 74 69 76 65 20 69 6e 20 | 74 68 65 20 77 69 6e 64 |tive in |the wind|
|00002dd0| 6f 77 2c 20 74 68 65 6e | 20 73 79 73 67 65 74 63 |ow, then| sysgetc|
|00002de0| 68 28 29 20 72 65 74 75 | 72 6e 73 20 2d 31 20 69 |h() retu|rns -1 i|
|00002df0| 66 20 20 0a 58 09 6e 6f | 20 63 68 61 72 61 63 74 |f .X.no| charact|
|00002e00| 65 72 20 69 73 20 61 76 | 61 69 6c 61 62 6c 65 2e |er is av|ailable.|
|00002e10| 20 20 0a 58 0a 58 09 76 | 61 6c 69 64 63 68 61 72 | .X.X.v|alidchar|
|00002e20| 28 63 29 20 63 68 65 63 | 6b 73 20 74 68 61 74 20 |(c) chec|ks that |
|00002e30| 27 63 27 20 69 73 20 61 | 20 76 61 6c 69 64 20 63 |'c' is a| valid c|
|00002e40| 68 61 72 61 63 74 65 72 | 2c 20 61 6e 64 20 20 0a |haracter|, and .|
|00002e50| 58 09 69 66 20 73 6f 20 | 72 65 74 75 72 6e 73 20 |X.if so |returns |
|00002e60| 69 74 2c 20 77 69 74 68 | 20 66 75 6e 63 74 69 6f |it, with| functio|
|00002e70| 6e 20 6b 65 79 20 74 72 | 61 6e 73 6c 61 74 69 6f |n key tr|anslatio|
|00002e80| 6e 20 61 70 70 6c 69 65 | 64 20 69 66 20 20 0a 58 |n applie|d if .X|
|00002e90| 09 27 77 27 20 68 61 73 | 20 6b 65 79 70 61 64 20 |.'w' has| keypad |
|00002ea0| 6d 6f 64 65 20 73 65 74 | 2e 20 49 66 20 63 68 61 |mode set|. If cha|
|00002eb0| 72 20 69 73 20 69 6e 76 | 61 6c 69 64 2c 20 72 65 |r is inv|alid, re|
|00002ec0| 74 75 72 6e 73 20 2d 31 | 2e 20 20 0a 58 0a 58 09 |turns -1|. .X.X.|
|00002ed0| 5f 63 75 72 73 65 73 70 | 65 6e 64 63 68 28 29 20 |_cursesp|endch() |
|00002ee0| 72 65 74 75 72 6e 73 20 | 31 20 69 66 20 74 68 65 |returns |1 if the|
|00002ef0| 72 65 20 69 73 20 61 6e | 79 20 63 68 61 72 61 63 |re is an|y charac|
|00002f00| 74 65 72 20 61 76 61 69 | 2d 20 20 0a 58 09 6c 61 |ter avai|- .X.la|
|00002f10| 62 6c 65 2c 20 61 6e 64 | 20 30 20 69 66 20 74 68 |ble, and| 0 if th|
|00002f20| 65 72 65 20 69 73 20 6e | 6f 6e 65 2e 20 74 68 69 |ere is n|one. thi|
|00002f30| 73 20 69 73 20 6e 6f 74 | 20 66 6f 72 20 70 72 6f |s is not| for pro|
|00002f40| 67 72 61 6d 6d 65 72 20 | 20 0a 58 09 75 73 61 67 |grammer | .X.usag|
|00002f50| 65 2c 20 62 75 74 20 66 | 6f 72 20 74 68 65 20 75 |e, but f|or the u|
|00002f60| 70 64 61 74 65 77 20 72 | 6f 75 74 69 6e 65 73 2e |pdatew r|outines.|
|00002f70| 20 20 0a 58 0a 58 45 58 | 41 4d 50 4c 45 53 0a 58 | .X.XEX|AMPLES.X|
|00002f80| 0a 58 53 45 45 20 41 4c | 53 4f 0a 58 09 72 61 77 |.XSEE AL|SO.X.raw|
|00002f90| 67 65 74 63 68 28 29 3b | 20 5f 63 75 72 73 65 73 |getch();| _curses|
|00002fa0| 67 63 62 28 29 3b 20 5f | 63 75 72 73 65 73 73 63 |gcb(); _|cursessc|
|00002fb0| 62 28 29 3b 20 73 79 73 | 67 65 74 63 68 28 29 3b |b(); sys|getch();|
|00002fc0| 20 5f 63 75 72 73 65 73 | 73 63 62 28 29 3b 0a 58 | _curses|scb();.X|
|00002fd0| 09 77 61 64 64 63 68 28 | 29 3b 20 77 72 65 66 72 |.waddch(|); wrefr|
|00002fe0| 65 73 68 28 29 3b 20 5f | 63 75 72 73 65 73 6b 65 |esh(); _|curseske|
|00002ff0| 79 28 29 3b 20 6b 62 68 | 69 74 28 29 3b 20 67 65 |y(); kbh|it(); ge|
|00003000| 74 63 68 28 29 3b 20 77 | 6d 6f 76 65 28 29 3b 0a |tch(); w|move();.|
|00003010| 58 09 77 67 65 74 63 68 | 28 29 3b 20 5f 63 75 72 |X.wgetch|(); _cur|
|00003020| 73 65 73 6b 65 79 74 73 | 74 28 29 3b 20 76 61 6c |seskeyts|t(); val|
|00003030| 69 64 63 68 61 72 28 29 | 3b 0a 58 0a 58 42 55 47 |idchar()|;.X.XBUG|
|00003040| 53 0a 53 48 41 52 5f 45 | 4f 46 0a 69 66 20 74 65 |S.SHAR_E|OF.if te|
|00003050| 73 74 20 32 32 32 33 20 | 2d 6e 65 20 22 60 77 63 |st 2223 |-ne "`wc|
|00003060| 20 2d 63 20 3c 20 27 67 | 65 74 63 68 2e 6d 27 60 | -c < 'g|etch.m'`|
|00003070| 22 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |".then..|echo sha|
|00003080| 72 3a 20 65 72 72 6f 72 | 20 74 72 61 6e 73 6d 69 |r: error| transmi|
|00003090| 74 74 69 6e 67 20 22 27 | 67 65 74 63 68 2e 6d 27 |tting "'|getch.m'|
|000030a0| 22 20 27 28 73 68 6f 75 | 6c 64 20 68 61 76 65 20 |" '(shou|ld have |
|000030b0| 62 65 65 6e 20 32 32 32 | 33 20 63 68 61 72 61 63 |been 222|3 charac|
|000030c0| 74 65 72 73 29 27 0a 66 | 69 0a 66 69 20 23 20 65 |ters)'.f|i.fi # e|
|000030d0| 6e 64 20 6f 66 20 6f 76 | 65 72 77 72 69 74 69 6e |nd of ov|erwritin|
|000030e0| 67 20 63 68 65 63 6b 0a | 65 63 68 6f 20 73 68 61 |g check.|echo sha|
|000030f0| 72 3a 20 65 78 74 72 61 | 63 74 69 6e 67 20 22 27 |r: extra|cting "'|
|00003100| 69 6e 63 68 2e 6d 27 22 | 20 27 28 36 37 33 20 63 |inch.m'"| '(673 c|
|00003110| 68 61 72 61 63 74 65 72 | 73 29 27 0a 69 66 20 74 |haracter|s)'.if t|
|00003120| 65 73 74 20 2d 66 20 27 | 69 6e 63 68 2e 6d 27 0a |est -f '|inch.m'.|
|00003130| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00003140| 20 77 69 6c 6c 20 6e 6f | 74 20 6f 76 65 72 2d 77 | will no|t over-w|
|00003150| 72 69 74 65 20 65 78 69 | 73 74 69 6e 67 20 66 69 |rite exi|sting fi|
|00003160| 6c 65 20 22 27 69 6e 63 | 68 2e 6d 27 22 0a 65 6c |le "'inc|h.m'".el|
|00003170| 73 65 0a 73 65 64 20 27 | 73 2f 5e 58 2f 2f 27 20 |se.sed '|s/^X//' |
|00003180| 3c 3c 20 5c 53 48 41 52 | 5f 45 4f 46 20 3e 20 27 |<< \SHAR|_EOF > '|
|00003190| 69 6e 63 68 2e 6d 27 0a | 58 4e 41 4d 45 0a 58 09 |inch.m'.|XNAME.X.|
|000031a0| 77 69 6e 63 68 28 29 20 | 69 6e 63 68 28 29 20 6d |winch() |inch() m|
|000031b0| 76 69 6e 63 68 28 29 20 | 6d 76 77 69 6e 63 68 28 |vinch() |mvwinch(|
|000031c0| 29 20 2d 20 72 65 74 75 | 72 6e 73 20 61 20 63 68 |) - retu|rns a ch|
|000031d0| 61 72 61 63 74 65 72 20 | 0a 58 0a 58 53 59 4e 4f |aracter |.X.XSYNO|
|000031e0| 50 53 49 53 0a 58 09 23 | 69 6e 63 6c 75 64 65 20 |PSIS.X.#|include |
|000031f0| 3c 63 75 72 73 65 73 2e | 68 3e 0a 58 09 23 69 6e |<curses.|h>.X.#in|
|00003200| 63 6c 75 64 65 20 3c 63 | 75 72 73 70 72 69 76 2e |clude <c|urspriv.|
|00003210| 68 3e 0a 58 0a 58 09 69 | 6e 74 20 77 69 6e 63 68 |h>.X.X.i|nt winch|
|00003220| 28 77 69 6e 29 0a 58 09 | 57 49 4e 44 4f 57 20 2a |(win).X.|WINDOW *|
|00003230| 77 69 6e 3b 0a 58 0a 58 | 09 69 6e 74 20 69 6e 63 |win;.X.X|.int inc|
|00003240| 68 28 29 0a 58 0a 58 09 | 69 6e 74 20 6d 76 69 6e |h().X.X.|int mvin|
|00003250| 63 68 28 79 2c 78 29 0a | 58 09 69 6e 74 20 79 3b |ch(y,x).|X.int y;|
|00003260| 0a 58 09 69 6e 74 20 78 | 3b 0a 58 0a 58 09 69 6e |.X.int x|;.X.X.in|
|00003270| 74 20 6d 76 77 69 6e 63 | 68 28 77 69 6e 2c 79 2c |t mvwinc|h(win,y,|
|00003280| 78 29 0a 58 09 57 49 4e | 44 4f 57 20 2a 77 69 6e |x).X.WIN|DOW *win|
|00003290| 3b 0a 58 09 69 6e 74 20 | 79 3b 0a 58 09 69 6e 74 |;.X.int |y;.X.int|
|000032a0| 20 78 3b 0a 58 0a 58 44 | 45 53 43 52 49 50 54 49 | x;.X.XD|ESCRIPTI|
|000032b0| 4f 4e 0a 58 09 77 69 6e | 63 68 28 29 20 72 65 74 |ON.X.win|ch() ret|
|000032c0| 75 72 6e 73 20 74 68 65 | 20 63 68 61 72 61 63 74 |urns the| charact|
|000032d0| 65 72 20 61 74 20 74 68 | 65 20 63 75 72 72 65 6e |er at th|e curren|
|000032e0| 74 20 70 6f 73 69 74 69 | 6f 6e 20 69 6e 20 20 0a |t positi|on in .|
|000032f0| 58 09 77 69 6e 64 6f 77 | 20 27 77 69 6e 27 2e 20 |X.window| 'win'. |
|00003300| 20 0a 58 0a 58 09 69 6e | 63 68 28 29 20 72 65 74 | .X.X.in|ch() ret|
|00003310| 75 72 6e 73 20 74 68 65 | 20 63 68 61 72 61 63 74 |urns the| charact|
|00003320| 65 72 20 61 74 20 74 68 | 65 20 63 75 72 72 65 6e |er at th|e curren|
|00003330| 74 20 63 75 72 73 6f 72 | 20 70 6f 73 69 74 69 6f |t cursor| positio|
|00003340| 6e 20 20 0a 58 09 69 6e | 20 73 74 64 73 63 72 2e |n .X.in| stdscr.|
|00003350| 20 20 0a 58 0a 58 09 6d | 76 69 6e 63 68 28 29 20 | .X.X.m|vinch() |
|00003360| 6d 6f 76 65 73 20 74 68 | 65 20 73 74 64 73 63 72 |moves th|e stdscr|
|00003370| 20 63 75 72 73 6f 72 20 | 74 6f 20 61 20 6e 65 77 | cursor |to a new|
|00003380| 20 70 6f 73 69 74 69 6f | 6e 2c 20 74 68 65 6e 20 | positio|n, then |
|00003390| 20 0a 58 09 72 65 74 75 | 72 6e 73 20 74 68 65 20 | .X.retu|rns the |
|000033a0| 63 68 61 72 61 63 74 65 | 72 20 61 74 20 74 68 61 |characte|r at tha|
|000033b0| 74 20 70 6f 73 69 74 69 | 6f 6e 2e 20 20 0a 58 0a |t positi|on. .X.|
|000033c0| 58 09 6d 76 77 69 6e 63 | 68 28 29 20 6d 6f 76 65 |X.mvwinc|h() move|
|000033d0| 73 20 74 68 65 20 63 75 | 72 73 6f 72 20 6f 66 20 |s the cu|rsor of |
|000033e0| 77 69 6e 64 6f 77 20 27 | 77 69 6e 27 20 74 6f 20 |window '|win' to |
|000033f0| 61 20 6e 65 77 20 70 6f | 73 69 2d 20 20 0a 58 09 |a new po|si- .X.|
|00003400| 74 69 6f 6e 2c 20 74 68 | 65 6e 20 72 65 74 75 72 |tion, th|en retur|
|00003410| 6e 73 20 74 68 65 20 63 | 68 61 72 61 63 74 65 72 |ns the c|haracter|
|00003420| 20 61 74 20 74 68 61 74 | 20 70 6f 73 69 74 69 6f | at that| positio|
|00003430| 6e 2e 20 20 0a 58 0a 58 | 45 58 41 4d 50 4c 45 53 |n. .X.X|EXAMPLES|
|00003440| 0a 58 0a 58 53 45 45 20 | 41 4c 53 4f 0a 58 09 77 |.X.XSEE |ALSO.X.w|
|00003450| 6d 6f 76 65 28 29 20 20 | 0a 58 0a 58 42 55 47 53 |move() |.X.XBUGS|
|00003460| 0a 53 48 41 52 5f 45 4f | 46 0a 69 66 20 74 65 73 |.SHAR_EO|F.if tes|
|00003470| 74 20 36 37 33 20 2d 6e | 65 20 22 60 77 63 20 2d |t 673 -n|e "`wc -|
|00003480| 63 20 3c 20 27 69 6e 63 | 68 2e 6d 27 60 22 0a 74 |c < 'inc|h.m'`".t|
|00003490| 68 65 6e 0a 09 65 63 68 | 6f 20 73 68 61 72 3a 20 |hen..ech|o shar: |
|000034a0| 65 72 72 6f 72 20 74 72 | 61 6e 73 6d 69 74 74 69 |error tr|ansmitti|
|000034b0| 6e 67 20 22 27 69 6e 63 | 68 2e 6d 27 22 20 27 28 |ng "'inc|h.m'" '(|
|000034c0| 73 68 6f 75 6c 64 20 68 | 61 76 65 20 62 65 65 6e |should h|ave been|
|000034d0| 20 36 37 33 20 63 68 61 | 72 61 63 74 65 72 73 29 | 673 cha|racters)|
|000034e0| 27 0a 66 69 0a 66 69 20 | 23 20 65 6e 64 20 6f 66 |'.fi.fi |# end of|
|000034f0| 20 6f 76 65 72 77 72 69 | 74 69 6e 67 20 63 68 65 | overwri|ting che|
|00003500| 63 6b 0a 65 63 68 6f 20 | 73 68 61 72 3a 20 65 78 |ck.echo |shar: ex|
|00003510| 74 72 61 63 74 69 6e 67 | 20 22 27 69 6e 69 74 73 |tracting| "'inits|
|00003520| 63 72 2e 6d 27 22 20 27 | 28 33 33 34 20 63 68 61 |cr.m'" '|(334 cha|
|00003530| 72 61 63 74 65 72 73 29 | 27 0a 69 66 20 74 65 73 |racters)|'.if tes|
|00003540| 74 20 2d 66 20 27 69 6e | 69 74 73 63 72 2e 6d 27 |t -f 'in|itscr.m'|
|00003550| 0a 74 68 65 6e 0a 09 65 | 63 68 6f 20 73 68 61 72 |.then..e|cho shar|
|00003560| 3a 20 77 69 6c 6c 20 6e | 6f 74 20 6f 76 65 72 2d |: will n|ot over-|
|00003570| 77 72 69 74 65 20 65 78 | 69 73 74 69 6e 67 20 66 |write ex|isting f|
|00003580| 69 6c 65 20 22 27 69 6e | 69 74 73 63 72 2e 6d 27 |ile "'in|itscr.m'|
|00003590| 22 0a 65 6c 73 65 0a 73 | 65 64 20 27 73 2f 5e 58 |".else.s|ed 's/^X|
|000035a0| 2f 2f 27 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |//' << \|SHAR_EOF|
|000035b0| 20 3e 20 27 69 6e 69 74 | 73 63 72 2e 6d 27 0a 58 | > 'init|scr.m'.X|
|000035c0| 4e 41 4d 45 0a 58 09 69 | 6e 69 74 73 63 72 28 29 |NAME.X.i|nitscr()|
|000035d0| 20 2d 20 69 6e 69 74 69 | 61 6c 69 7a 61 74 69 6f | - initi|alizatio|
|000035e0| 6e 20 66 6f 72 20 74 68 | 65 20 50 43 63 75 72 73 |n for th|e PCcurs|
|000035f0| 65 73 20 70 61 63 6b 61 | 67 65 0a 58 0a 58 53 59 |es packa|ge.X.XSY|
|00003600| 4e 4f 50 53 49 53 0a 58 | 09 23 69 6e 63 6c 75 64 |NOPSIS.X|.#includ|
|00003610| 65 20 3c 63 75 72 73 65 | 73 2e 68 3e 0a 58 09 23 |e <curse|s.h>.X.#|
|00003620| 69 6e 63 6c 75 64 65 20 | 3c 63 75 72 73 70 72 69 |include |<curspri|
|00003630| 76 2e 68 3e 0a 58 0a 58 | 09 69 6e 74 20 69 6e 69 |v.h>.X.X|.int ini|
|00003640| 74 73 63 72 28 29 0a 58 | 0a 58 44 45 53 43 52 49 |tscr().X|.XDESCRI|
|00003650| 50 54 49 4f 4e 0a 58 09 | 69 6e 69 74 73 63 72 28 |PTION.X.|initscr(|
|00003660| 29 20 64 6f 65 73 20 6e | 65 63 63 65 73 73 61 72 |) does n|eccessar|
|00003670| 79 20 69 6e 69 74 69 61 | 6c 69 7a 61 74 69 6f 6e |y initia|lization|
|00003680| 73 20 66 6f 72 20 74 68 | 65 20 50 43 63 75 72 73 |s for th|e PCcurs|
|00003690| 65 73 20 20 0a 58 09 70 | 61 63 6b 61 67 65 2e 20 |es .X.p|ackage. |
|000036a0| 49 74 20 4d 55 53 54 20 | 62 65 20 63 61 6c 6c 65 |It MUST |be calle|
|000036b0| 64 20 62 65 66 6f 72 65 | 20 61 6e 79 20 6f 74 68 |d before| any oth|
|000036c0| 65 72 20 63 75 72 73 65 | 73 20 72 6f 75 74 69 6e |er curse|s routin|
|000036d0| 65 73 2e 20 20 0a 58 0a | 58 45 58 41 4d 50 4c 45 |es. .X.|XEXAMPLE|
|000036e0| 53 0a 58 0a 58 53 45 45 | 20 41 4c 53 4f 0a 58 09 |S.X.XSEE| ALSO.X.|
|000036f0| 5f 63 75 72 73 65 73 67 | 63 62 28 29 3b 20 5f 63 |_cursesg|cb(); _c|
|00003700| 75 72 73 65 73 67 63 6f | 6c 73 28 29 3b 20 6e 65 |ursesgco|ls(); ne|
|00003710| 77 77 69 6e 28 29 20 0a | 58 0a 58 42 55 47 53 0a |wwin() .|X.XBUGS.|
|00003720| 53 48 41 52 5f 45 4f 46 | 0a 69 66 20 74 65 73 74 |SHAR_EOF|.if test|
|00003730| 20 33 33 34 20 2d 6e 65 | 20 22 60 77 63 20 2d 63 | 334 -ne| "`wc -c|
|00003740| 20 3c 20 27 69 6e 69 74 | 73 63 72 2e 6d 27 60 22 | < 'init|scr.m'`"|
|00003750| 0a 74 68 65 6e 0a 09 65 | 63 68 6f 20 73 68 61 72 |.then..e|cho shar|
|00003760| 3a 20 65 72 72 6f 72 20 | 74 72 61 6e 73 6d 69 74 |: error |transmit|
|00003770| 74 69 6e 67 20 22 27 69 | 6e 69 74 73 63 72 2e 6d |ting "'i|nitscr.m|
|00003780| 27 22 20 27 28 73 68 6f | 75 6c 64 20 68 61 76 65 |'" '(sho|uld have|
|00003790| 20 62 65 65 6e 20 33 33 | 34 20 63 68 61 72 61 63 | been 33|4 charac|
|000037a0| 74 65 72 73 29 27 0a 66 | 69 0a 66 69 20 23 20 65 |ters)'.f|i.fi # e|
|000037b0| 6e 64 20 6f 66 20 6f 76 | 65 72 77 72 69 74 69 6e |nd of ov|erwritin|
|000037c0| 67 20 63 68 65 63 6b 0a | 65 63 68 6f 20 73 68 61 |g check.|echo sha|
|000037d0| 72 3a 20 65 78 74 72 61 | 63 74 69 6e 67 20 22 27 |r: extra|cting "'|
|000037e0| 69 6e 73 63 68 2e 6d 27 | 22 20 27 28 38 36 36 20 |insch.m'|" '(866 |
|000037f0| 63 68 61 72 61 63 74 65 | 72 73 29 27 0a 69 66 20 |characte|rs)'.if |
|00003800| 74 65 73 74 20 2d 66 20 | 27 69 6e 73 63 68 2e 6d |test -f |'insch.m|
|00003810| 27 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |'.then..|echo sha|
|00003820| 72 3a 20 77 69 6c 6c 20 | 6e 6f 74 20 6f 76 65 72 |r: will |not over|
|00003830| 2d 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 20 |-write e|xisting |
|00003840| 66 69 6c 65 20 22 27 69 | 6e 73 63 68 2e 6d 27 22 |file "'i|nsch.m'"|
|00003850| 0a 65 6c 73 65 0a 73 65 | 64 20 27 73 2f 5e 58 2f |.else.se|d 's/^X/|
|00003860| 2f 27 20 3c 3c 20 5c 53 | 48 41 52 5f 45 4f 46 20 |/' << \S|HAR_EOF |
|00003870| 3e 20 27 69 6e 73 63 68 | 2e 6d 27 0a 58 4e 41 4d |> 'insch|.m'.XNAM|
|00003880| 45 0a 58 09 77 69 6e 73 | 63 68 28 29 20 69 6e 73 |E.X.wins|ch() ins|
|00003890| 63 68 28 29 20 6d 76 69 | 6e 73 63 68 28 29 20 6d |ch() mvi|nsch() m|
|000038a0| 76 77 69 6e 73 63 68 28 | 29 20 2d 20 69 6e 73 65 |vwinsch(|) - inse|
|000038b0| 72 74 20 61 20 63 68 61 | 72 61 63 74 65 72 0a 58 |rt a cha|racter.X|
|000038c0| 0a 58 53 59 4e 4f 50 53 | 49 53 0a 58 09 23 69 6e |.XSYNOPS|IS.X.#in|
|000038d0| 63 6c 75 64 65 20 3c 63 | 75 72 73 65 73 2e 68 3e |clude <c|urses.h>|
|000038e0| 0a 58 09 23 69 6e 63 6c | 75 64 65 20 3c 63 75 72 |.X.#incl|ude <cur|
|000038f0| 73 70 72 69 76 2e 68 3e | 0a 58 0a 58 09 69 6e 74 |spriv.h>|.X.X.int|
|00003900| 20 77 69 6e 73 63 68 28 | 77 69 6e 2c 20 63 29 0a | winsch(|win, c).|
|00003910| 58 09 57 49 4e 44 4f 57 | 20 2a 77 69 6e 3b 0a 58 |X.WINDOW| *win;.X|
|00003920| 09 63 68 61 72 20 63 3b | 0a 58 0a 58 09 69 6e 74 |.char c;|.X.X.int|
|00003930| 20 69 6e 73 63 68 28 63 | 29 0a 58 09 63 68 61 72 | insch(c|).X.char|
|00003940| 20 63 3b 0a 58 0a 58 09 | 69 6e 74 20 6d 76 69 6e | c;.X.X.|int mvin|
|00003950| 73 63 68 28 79 2c 78 2c | 63 29 0a 58 09 69 6e 74 |sch(y,x,|c).X.int|
|00003960| 20 79 3b 0a 58 09 69 6e | 74 20 78 3b 0a 58 09 63 | y;.X.in|t x;.X.c|
|00003970| 68 61 72 20 63 3b 0a 58 | 0a 58 09 69 6e 74 20 6d |har c;.X|.X.int m|
|00003980| 76 77 69 6e 73 63 68 28 | 77 69 6e 2c 79 2c 78 2c |vwinsch(|win,y,x,|
|00003990| 63 29 0a 58 09 57 49 4e | 44 4f 57 20 2a 77 69 6e |c).X.WIN|DOW *win|
|000039a0| 3b 0a 58 09 69 6e 74 20 | 79 3b 0a 58 09 69 6e 74 |;.X.int |y;.X.int|
|000039b0| 20 78 3b 0a 58 09 63 68 | 61 72 20 63 3b 0a 58 0a | x;.X.ch|ar c;.X.|
|000039c0| 58 44 45 53 43 52 49 50 | 54 49 4f 4e 0a 58 09 77 |XDESCRIP|TION.X.w|
|000039d0| 69 6e 73 63 68 28 29 20 | 69 6e 73 65 72 74 73 20 |insch() |inserts |
|000039e0| 63 68 61 72 61 63 74 65 | 72 20 27 63 27 20 61 74 |characte|r 'c' at|
|000039f0| 20 74 68 65 20 63 75 72 | 73 6f 72 20 70 6f 73 69 | the cur|sor posi|
|00003a00| 74 69 6f 6e 20 69 6e 20 | 20 0a 58 09 77 69 6e 64 |tion in | .X.wind|
|00003a10| 6f 77 20 27 77 69 6e 27 | 2e 20 54 68 65 20 63 75 |ow 'win'|. The cu|
|00003a20| 72 73 6f 72 20 69 73 20 | 61 64 76 61 6e 63 65 64 |rsor is |advanced|
|00003a30| 2e 20 20 0a 58 0a 58 09 | 69 6e 73 63 68 28 29 20 |. .X.X.|insch() |
|00003a40| 69 6e 73 65 72 74 73 20 | 63 68 61 72 61 63 74 65 |inserts |characte|
|00003a50| 72 20 27 63 27 20 61 74 | 20 74 68 65 20 63 75 72 |r 'c' at| the cur|
|00003a60| 73 6f 72 20 70 6f 73 69 | 74 69 6f 6e 20 69 6e 20 |sor posi|tion in |
|00003a70| 20 0a 58 09 73 74 64 73 | 63 72 2e 20 54 68 65 20 | .X.stds|cr. The |
|00003a80| 63 75 72 73 6f 72 20 69 | 73 20 61 64 76 61 6e 63 |cursor i|s advanc|
|00003a90| 65 64 2e 20 20 0a 58 0a | 58 09 6d 76 69 6e 73 63 |ed. .X.|X.mvinsc|
|00003aa0| 68 28 29 20 6d 6f 76 65 | 73 20 74 68 65 20 73 74 |h() move|s the st|
|00003ab0| 64 73 63 72 20 63 75 72 | 73 6f 72 20 74 6f 20 61 |dscr cur|sor to a|
|00003ac0| 20 6e 65 77 20 70 6f 73 | 69 74 69 6f 6e 2c 20 74 | new pos|ition, t|
|00003ad0| 68 65 6e 20 20 0a 58 09 | 69 6e 73 65 72 74 73 20 |hen .X.|inserts |
|00003ae0| 63 68 61 72 61 63 74 65 | 72 20 27 63 27 20 61 74 |characte|r 'c' at|
|00003af0| 20 74 68 65 20 63 75 72 | 73 6f 72 20 70 6f 73 69 | the cur|sor posi|
|00003b00| 74 69 6f 6e 20 69 6e 20 | 73 74 64 73 63 72 2e 20 |tion in |stdscr. |
|00003b10| 54 68 65 20 20 0a 58 09 | 63 75 72 73 6f 72 20 69 |The .X.|cursor i|
|00003b20| 73 20 61 64 76 61 6e 63 | 65 64 2e 20 20 0a 58 0a |s advanc|ed. .X.|
|00003b30| 58 09 6d 76 77 69 6e 73 | 63 68 28 29 20 6d 6f 76 |X.mvwins|ch() mov|
|00003b40| 65 73 20 74 68 65 20 63 | 75 72 73 6f 72 20 6f 66 |es the c|ursor of|
|00003b50| 20 77 69 6e 64 6f 77 20 | 27 77 69 6e 27 20 74 6f | window |'win' to|
|00003b60| 20 61 20 6e 65 77 20 70 | 6f 73 69 2d 20 20 0a 58 | a new p|osi- .X|
|00003b70| 09 74 69 6f 6e 2c 20 74 | 68 65 6e 20 69 6e 73 65 |.tion, t|hen inse|
|00003b80| 72 74 73 20 63 68 61 72 | 61 63 74 65 72 20 27 63 |rts char|acter 'c|
|00003b90| 27 20 61 74 20 74 68 65 | 20 63 75 72 73 6f 72 20 |' at the| cursor |
|00003ba0| 70 6f 73 69 74 69 6f 6e | 20 69 6e 20 20 0a 58 09 |position| in .X.|
|00003bb0| 77 69 6e 64 6f 77 20 27 | 77 69 6e 27 2e 20 54 68 |window '|win'. Th|
|00003bc0| 65 20 63 75 72 73 6f 72 | 20 69 73 20 61 64 76 61 |e cursor| is adva|
|00003bd0| 6e 63 65 64 2e 20 20 0a | 58 0a 58 45 58 41 4d 50 |nced. .|X.XEXAMP|
|00003be0| 4c 45 53 0a 58 0a 58 53 | 45 45 20 41 4c 53 4f 0a |LES.X.XS|EE ALSO.|
|00003bf0| 58 09 77 61 64 64 63 68 | 28 29 2c 20 77 6d 6f 76 |X.waddch|(), wmov|
|00003c00| 65 28 29 0a 58 0a 58 42 | 55 47 53 0a 53 48 41 52 |e().X.XB|UGS.SHAR|
|00003c10| 5f 45 4f 46 0a 69 66 20 | 74 65 73 74 20 38 36 36 |_EOF.if |test 866|
|00003c20| 20 2d 6e 65 20 22 60 77 | 63 20 2d 63 20 3c 20 27 | -ne "`w|c -c < '|
|00003c30| 69 6e 73 63 68 2e 6d 27 | 60 22 0a 74 68 65 6e 0a |insch.m'|`".then.|
|00003c40| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 65 72 72 6f |.echo sh|ar: erro|
|00003c50| 72 20 74 72 61 6e 73 6d | 69 74 74 69 6e 67 20 22 |r transm|itting "|
|00003c60| 27 69 6e 73 63 68 2e 6d | 27 22 20 27 28 73 68 6f |'insch.m|'" '(sho|
|00003c70| 75 6c 64 20 68 61 76 65 | 20 62 65 65 6e 20 38 36 |uld have| been 86|
|00003c80| 36 20 63 68 61 72 61 63 | 74 65 72 73 29 27 0a 66 |6 charac|ters)'.f|
|00003c90| 69 0a 66 69 20 23 20 65 | 6e 64 20 6f 66 20 6f 76 |i.fi # e|nd of ov|
|00003ca0| 65 72 77 72 69 74 69 6e | 67 20 63 68 65 63 6b 0a |erwritin|g check.|
|00003cb0| 65 63 68 6f 20 73 68 61 | 72 3a 20 65 78 74 72 61 |echo sha|r: extra|
|00003cc0| 63 74 69 6e 67 20 22 27 | 69 6e 73 65 72 74 6c 6e |cting "'|insertln|
|00003cd0| 2e 6d 27 22 20 27 28 38 | 34 33 20 63 68 61 72 61 |.m'" '(8|43 chara|
|00003ce0| 63 74 65 72 73 29 27 0a | 69 66 20 74 65 73 74 20 |cters)'.|if test |
|00003cf0| 2d 66 20 27 69 6e 73 65 | 72 74 6c 6e 2e 6d 27 0a |-f 'inse|rtln.m'.|
|00003d00| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00003d10| 20 77 69 6c 6c 20 6e 6f | 74 20 6f 76 65 72 2d 77 | will no|t over-w|
|00003d20| 72 69 74 65 20 65 78 69 | 73 74 69 6e 67 20 66 69 |rite exi|sting fi|
|00003d30| 6c 65 20 22 27 69 6e 73 | 65 72 74 6c 6e 2e 6d 27 |le "'ins|ertln.m'|
|00003d40| 22 0a 65 6c 73 65 0a 73 | 65 64 20 27 73 2f 5e 58 |".else.s|ed 's/^X|
|00003d50| 2f 2f 27 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |//' << \|SHAR_EOF|
|00003d60| 20 3e 20 27 69 6e 73 65 | 72 74 6c 6e 2e 6d 27 0a | > 'inse|rtln.m'.|
|00003d70| 58 4e 41 4d 45 0a 58 09 | 77 69 6e 73 65 72 74 6c |XNAME.X.|winsertl|
|00003d80| 6e 28 29 20 69 6e 73 65 | 72 74 6c 6e 28 29 20 6d |n() inse|rtln() m|
|00003d90| 76 69 6e 73 65 72 74 6c | 6e 28 29 20 6d 76 77 69 |vinsertl|n() mvwi|
|00003da0| 6e 73 65 72 74 6c 6e 28 | 29 20 2d 20 69 6e 73 65 |nsertln(|) - inse|
|00003db0| 72 74 20 61 20 62 6c 61 | 6e 6b 20 6c 69 6e 65 0a |rt a bla|nk line.|
|00003dc0| 58 0a 58 53 59 4e 4f 50 | 53 49 53 0a 58 09 23 69 |X.XSYNOP|SIS.X.#i|
|00003dd0| 6e 63 6c 75 64 65 20 3c | 63 75 72 73 65 73 2e 68 |nclude <|curses.h|
|00003de0| 3e 0a 58 09 23 69 6e 63 | 6c 75 64 65 20 3c 63 75 |>.X.#inc|lude <cu|
|00003df0| 72 73 70 72 69 76 2e 68 | 3e 0a 58 0a 58 09 69 6e |rspriv.h|>.X.X.in|
|00003e00| 74 20 77 69 6e 73 65 72 | 74 6c 6e 28 77 69 6e 29 |t winser|tln(win)|
|00003e10| 0a 58 09 57 49 4e 44 4f | 57 20 2a 77 69 6e 3b 0a |.X.WINDO|W *win;.|
|00003e20| 58 0a 58 09 69 6e 74 20 | 69 6e 73 65 72 74 6c 6e |X.X.int |insertln|
|00003e30| 28 29 0a 58 0a 58 09 69 | 6e 74 20 6d 76 69 6e 73 |().X.X.i|nt mvins|
|00003e40| 65 72 74 28 79 2c 78 29 | 0a 58 09 69 6e 74 20 79 |ert(y,x)|.X.int y|
|00003e50| 3b 0a 58 09 69 6e 74 20 | 78 3b 0a 58 0a 58 09 69 |;.X.int |x;.X.X.i|
|00003e60| 6e 74 20 6d 76 77 69 6e | 73 65 72 74 28 77 69 6e |nt mvwin|sert(win|
|00003e70| 2c 79 2c 78 29 0a 58 09 | 57 49 4e 44 4f 57 20 2a |,y,x).X.|WINDOW *|
|00003e80| 77 69 6e 3b 0a 58 09 69 | 6e 74 20 79 3b 0a 58 09 |win;.X.i|nt y;.X.|
|00003e90| 69 6e 74 20 78 3b 0a 58 | 0a 58 44 45 53 43 52 49 |int x;.X|.XDESCRI|
|00003ea0| 50 54 49 4f 4e 0a 58 09 | 77 69 6e 73 65 72 74 6c |PTION.X.|winsertl|
|00003eb0| 6e 28 29 20 69 6e 73 65 | 72 74 73 20 61 20 62 6c |n() inse|rts a bl|
|00003ec0| 61 6e 6b 20 6c 69 6e 65 | 20 69 6e 73 74 65 61 64 |ank line| instead|
|00003ed0| 20 6f 66 20 74 68 65 20 | 63 75 72 73 6f 72 20 6c | of the |cursor l|
|00003ee0| 69 6e 65 20 20 0a 58 09 | 69 6e 20 77 69 6e 64 6f |ine .X.|in windo|
|00003ef0| 77 20 27 77 69 6e 27 20 | 61 6e 64 20 70 75 73 68 |w 'win' |and push|
|00003f00| 65 73 20 6f 74 68 65 72 | 20 6c 69 6e 65 73 20 64 |es other| lines d|
|00003f10| 6f 77 6e 2e 20 20 0a 58 | 0a 58 09 69 6e 73 65 72 |own. .X|.X.inser|
|00003f20| 74 6c 6e 28 29 20 69 6e | 73 65 72 74 73 20 61 20 |tln() in|serts a |
|00003f30| 62 6c 61 6e 6b 20 6c 69 | 6e 65 20 69 6e 73 74 65 |blank li|ne inste|
|00003f40| 61 64 20 6f 66 20 74 68 | 65 20 63 75 72 73 6f 72 |ad of th|e cursor|
|00003f50| 20 6c 69 6e 65 20 20 0a | 58 09 69 6e 20 73 74 64 | line .|X.in std|
|00003f60| 73 63 72 20 61 6e 64 20 | 70 75 73 68 65 73 20 6f |scr and |pushes o|
|00003f70| 74 68 65 72 20 6c 69 6e | 65 73 20 64 6f 77 6e 2e |ther lin|es down.|
|00003f80| 20 20 0a 58 0a 58 09 6d | 76 69 6e 73 65 72 74 6c | .X.X.m|vinsertl|
|00003f90| 6e 28 29 20 6d 6f 76 65 | 73 20 74 68 65 20 73 74 |n() move|s the st|
|00003fa0| 64 73 63 72 20 63 75 72 | 73 6f 72 20 74 6f 20 61 |dscr cur|sor to a|
|00003fb0| 20 6e 65 77 20 70 6f 73 | 69 74 69 6f 6e 73 2c 20 | new pos|itions, |
|00003fc0| 69 6e 2d 20 20 0a 58 09 | 73 65 72 74 73 20 61 20 |in- .X.|serts a |
|00003fd0| 62 6c 61 6e 6b 20 6c 69 | 6e 65 20 69 6e 73 74 65 |blank li|ne inste|
|00003fe0| 61 64 20 6f 66 20 74 68 | 65 20 63 75 72 73 6f 72 |ad of th|e cursor|
|00003ff0| 20 6c 69 6e 65 20 61 6e | 64 20 70 75 73 68 65 73 | line an|d pushes|
|00004000| 20 20 0a 58 09 6f 74 68 | 65 72 20 6c 69 6e 65 73 | .X.oth|er lines|
|00004010| 20 64 6f 77 6e 2e 20 20 | 0a 58 0a 58 09 6d 76 77 | down. |.X.X.mvw|
|00004020| 69 6e 73 65 72 74 6c 6e | 28 29 20 6d 6f 76 65 73 |insertln|() moves|
|00004030| 20 74 68 65 20 63 75 72 | 73 6f 72 20 69 6e 20 77 | the cur|sor in w|
|00004040| 69 6e 64 6f 77 20 27 77 | 69 6e 27 20 74 6f 20 61 |indow 'w|in' to a|
|00004050| 20 6e 65 77 20 70 6f 73 | 69 2d 20 20 0a 58 09 74 | new pos|i- .X.t|
|00004060| 69 6f 6e 73 2c 20 69 6e | 73 65 72 74 73 20 61 20 |ions, in|serts a |
|00004070| 62 6c 61 6e 6b 20 6c 69 | 6e 65 20 69 6e 73 74 65 |blank li|ne inste|
|00004080| 61 64 20 6f 66 20 74 68 | 65 20 63 75 72 73 6f 72 |ad of th|e cursor|
|00004090| 20 6c 69 6e 65 20 61 6e | 64 20 20 0a 58 09 70 75 | line an|d .X.pu|
|000040a0| 73 68 65 73 20 6f 74 68 | 65 72 20 6c 69 6e 65 73 |shes oth|er lines|
|000040b0| 20 64 6f 77 6e 2e 20 20 | 0a 58 0a 58 45 58 41 4d | down. |.X.XEXAM|
|000040c0| 50 4c 45 53 0a 58 0a 58 | 53 45 45 20 41 4c 53 4f |PLES.X.X|SEE ALSO|
|000040d0| 0a 58 09 77 6d 6f 76 65 | 28 29 20 20 0a 58 0a 58 |.X.wmove|() .X.X|
|000040e0| 42 55 47 53 0a 53 48 41 | 52 5f 45 4f 46 0a 69 66 |BUGS.SHA|R_EOF.if|
|000040f0| 20 74 65 73 74 20 38 34 | 33 20 2d 6e 65 20 22 60 | test 84|3 -ne "`|
|00004100| 77 63 20 2d 63 20 3c 20 | 27 69 6e 73 65 72 74 6c |wc -c < |'insertl|
|00004110| 6e 2e 6d 27 60 22 0a 74 | 68 65 6e 0a 09 65 63 68 |n.m'`".t|hen..ech|
|00004120| 6f 20 73 68 61 72 3a 20 | 65 72 72 6f 72 20 74 72 |o shar: |error tr|
|00004130| 61 6e 73 6d 69 74 74 69 | 6e 67 20 22 27 69 6e 73 |ansmitti|ng "'ins|
|00004140| 65 72 74 6c 6e 2e 6d 27 | 22 20 27 28 73 68 6f 75 |ertln.m'|" '(shou|
|00004150| 6c 64 20 68 61 76 65 20 | 62 65 65 6e 20 38 34 33 |ld have |been 843|
|00004160| 20 63 68 61 72 61 63 74 | 65 72 73 29 27 0a 66 69 | charact|ers)'.fi|
|00004170| 0a 66 69 20 23 20 65 6e | 64 20 6f 66 20 6f 76 65 |.fi # en|d of ove|
|00004180| 72 77 72 69 74 69 6e 67 | 20 63 68 65 63 6b 0a 65 |rwriting| check.e|
|00004190| 63 68 6f 20 73 68 61 72 | 3a 20 65 78 74 72 61 63 |cho shar|: extrac|
|000041a0| 74 69 6e 67 20 22 27 6c | 6f 6e 67 6e 61 6d 65 2e |ting "'l|ongname.|
|000041b0| 6d 27 22 20 27 28 32 37 | 31 20 63 68 61 72 61 63 |m'" '(27|1 charac|
|000041c0| 74 65 72 73 29 27 0a 69 | 66 20 74 65 73 74 20 2d |ters)'.i|f test -|
|000041d0| 66 20 27 6c 6f 6e 67 6e | 61 6d 65 2e 6d 27 0a 74 |f 'longn|ame.m'.t|
|000041e0| 68 65 6e 0a 09 65 63 68 | 6f 20 73 68 61 72 3a 20 |hen..ech|o shar: |
|000041f0| 77 69 6c 6c 20 6e 6f 74 | 20 6f 76 65 72 2d 77 72 |will not| over-wr|
|00004200| 69 74 65 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c |ite exis|ting fil|
|00004210| 65 20 22 27 6c 6f 6e 67 | 6e 61 6d 65 2e 6d 27 22 |e "'long|name.m'"|
|00004220| 0a 65 6c 73 65 0a 73 65 | 64 20 27 73 2f 5e 58 2f |.else.se|d 's/^X/|
|00004230| 2f 27 20 3c 3c 20 5c 53 | 48 41 52 5f 45 4f 46 20 |/' << \S|HAR_EOF |
|00004240| 3e 20 27 6c 6f 6e 67 6e | 61 6d 65 2e 6d 27 0a 58 |> 'longn|ame.m'.X|
|00004250| 4e 41 4d 45 0a 58 09 6c | 6f 6e 67 6e 61 6d 65 28 |NAME.X.l|ongname(|
|00004260| 29 20 72 65 74 75 72 6e | 73 20 61 20 70 6f 69 6e |) return|s a poin|
|00004270| 74 65 72 20 74 6f 20 61 | 20 73 74 72 69 6e 67 20 |ter to a| string |
|00004280| 64 65 73 63 72 69 62 69 | 6e 67 20 74 68 65 20 20 |describi|ng the |
|00004290| 0a 58 09 75 73 65 72 20 | 74 65 72 6d 69 6e 61 6c |.X.user |terminal|
|000042a0| 2e 20 20 0a 58 0a 58 53 | 59 4e 4f 50 53 49 53 0a |. .X.XS|YNOPSIS.|
|000042b0| 58 09 23 69 6e 63 6c 75 | 64 65 20 3c 63 75 72 73 |X.#inclu|de <curs|
|000042c0| 65 73 2e 68 3e 0a 58 09 | 23 69 6e 63 6c 75 64 65 |es.h>.X.|#include|
|000042d0| 20 3c 63 75 72 73 70 72 | 69 76 2e 68 3e 0a 58 0a | <curspr|iv.h>.X.|
|000042e0| 58 09 63 68 61 72 20 2a | 6c 6f 6e 67 6e 61 6d 65 |X.char *|longname|
|000042f0| 28 29 0a 58 0a 58 44 45 | 53 43 52 49 50 54 49 4f |().X.XDE|SCRIPTIO|
|00004300| 4e 0a 58 09 6c 6f 6e 67 | 6e 61 6d 65 28 29 20 72 |N.X.long|name() r|
|00004310| 65 74 75 72 6e 73 20 61 | 20 70 6f 69 6e 74 65 72 |eturns a| pointer|
|00004320| 20 74 6f 20 61 20 73 74 | 72 69 6e 67 20 64 65 73 | to a st|ring des|
|00004330| 63 72 69 62 69 6e 67 20 | 74 68 65 20 20 0a 58 09 |cribing |the .X.|
|00004340| 75 73 65 72 20 74 65 72 | 6d 69 6e 61 6c 2e 20 20 |user ter|minal. |
|00004350| 0a 58 0a 58 45 58 41 4d | 50 4c 45 53 0a 58 0a 58 |.X.XEXAM|PLES.X.X|
|00004360| 53 45 45 20 41 4c 53 4f | 0a 58 0a 58 42 55 47 53 |SEE ALSO|.X.XBUGS|
|00004370| 0a 53 48 41 52 5f 45 4f | 46 0a 69 66 20 74 65 73 |.SHAR_EO|F.if tes|
|00004380| 74 20 32 37 31 20 2d 6e | 65 20 22 60 77 63 20 2d |t 271 -n|e "`wc -|
|00004390| 63 20 3c 20 27 6c 6f 6e | 67 6e 61 6d 65 2e 6d 27 |c < 'lon|gname.m'|
|000043a0| 60 22 0a 74 68 65 6e 0a | 09 65 63 68 6f 20 73 68 |`".then.|.echo sh|
|000043b0| 61 72 3a 20 65 72 72 6f | 72 20 74 72 61 6e 73 6d |ar: erro|r transm|
|000043c0| 69 74 74 69 6e 67 20 22 | 27 6c 6f 6e 67 6e 61 6d |itting "|'longnam|
|000043d0| 65 2e 6d 27 22 20 27 28 | 73 68 6f 75 6c 64 20 68 |e.m'" '(|should h|
|000043e0| 61 76 65 20 62 65 65 6e | 20 32 37 31 20 63 68 61 |ave been| 271 cha|
|000043f0| 72 61 63 74 65 72 73 29 | 27 0a 66 69 0a 66 69 20 |racters)|'.fi.fi |
|00004400| 23 20 65 6e 64 20 6f 66 | 20 6f 76 65 72 77 72 69 |# end of| overwri|
|00004410| 74 69 6e 67 20 63 68 65 | 63 6b 0a 23 09 45 6e 64 |ting che|ck.#.End|
|00004420| 20 6f 66 20 73 68 65 6c | 6c 20 61 72 63 68 69 76 | of shel|l archiv|
|00004430| 65 0a 65 78 69 74 20 30 | 0a 2d 09 09 2d 09 09 2d |e.exit 0|.-..-..-|
|00004440| 09 09 2d 09 09 2d 0a 09 | 09 28 49 74 27 73 20 6d |..-..-..|.(It's m|
|00004450| 79 20 6f 70 69 6e 69 6f | 6e 20 61 6e 64 20 6e 6f |y opinio|n and no|
|00004460| 74 20 6d 79 20 65 6d 70 | 6c 6f 79 65 72 73 29 0a |t my emp|loyers).|
|00004470| 53 74 65 76 65 20 42 61 | 6c 6f 67 68 09 56 4b 33 |Steve Ba|logh.VK3|
|00004480| 59 4d 59 09 09 09 7c 20 | 73 74 65 76 65 40 63 69 |YMY...| |steve@ci|
|00004490| 74 35 2e 63 69 74 2e 6f | 7a 20 28 2e 2e 2e 6f 7a |t5.cit.o|z (...oz|
|000044a0| 2e 61 75 29 0a 43 68 69 | 73 68 6f 6c 6d 20 49 6e |.au).Chi|sholm In|
|000044b0| 73 74 69 74 75 74 65 20 | 6f 66 20 54 65 63 68 6e |stitute |of Techn|
|000044c0| 6f 6c 6f 67 79 09 7c 20 | 73 74 65 76 65 25 63 69 |ology.| |steve%ci|
|000044d0| 74 35 2e 63 69 74 2e 6f | 7a 40 75 75 6e 65 74 2e |t5.cit.o|z@uunet.|
|000044e0| 75 75 2e 6e 65 74 0a 50 | 4f 20 42 6f 78 20 31 39 |uu.net.P|O Box 19|
|000044f0| 37 2c 20 43 61 75 6c 66 | 69 65 6c 64 20 45 61 73 |7, Caulf|ield Eas|
|00004500| 74 09 09 7c 20 0a 4d 65 | 6c 62 6f 75 72 6e 65 2c |t..| .Me|lbourne,|
|00004510| 20 41 55 53 54 52 41 4c | 49 41 2e 20 33 31 34 35 | AUSTRAL|IA. 3145|
|00004520| 09 09 7c 20 7b 68 70 6c | 61 62 73 2c 6d 63 76 61 |..| {hpl|abs,mcva|
|00004530| 78 2c 75 75 6e 65 74 2c | 75 6b 63 7d 21 6d 75 6e |x,uunet,|ukc}!mun|
|00004540| 6e 61 72 69 5c 0a 2b 36 | 31 20 33 20 35 37 33 20 |nari\.+6|1 3 573 |
|00004550| 32 32 36 36 20 28 41 6e | 73 20 4d 61 63 68 69 6e |2266 (An|s Machin|
|00004560| 65 29 09 09 7c 20 20 21 | 63 69 74 35 2e 63 69 74 |e)..| !|cit5.cit|
|00004570| 2e 6f 7a 21 73 74 65 76 | 65 0a 0a 0a |.oz!stev|e... |
+--------+-------------------------+-------------------------+--------+--------+