home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume9 / teco / part04 < prev    next >
SHell self-extracting ARchive  |  1987-03-11  |  34.4 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


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

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert 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% 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| 53 75 62 6a 65 63 74 3a | 20 20 76 30 39 69 30 33 |Subject:| v09i03|
|00000010| 31 3a 20 20 41 20 54 45 | 43 4f 20 74 65 78 74 20 |1: A TE|CO text |
|00000020| 65 64 69 74 6f 72 2c 20 | 50 61 72 74 30 34 2f 30 |editor, |Part04/0|
|00000030| 34 0a 4e 65 77 73 67 72 | 6f 75 70 73 3a 20 6d 6f |4.Newsgr|oups: mo|
|00000040| 64 2e 73 6f 75 72 63 65 | 73 0a 41 70 70 72 6f 76 |d.source|s.Approv|
|00000050| 65 64 3a 20 72 73 40 6d | 69 72 72 6f 72 2e 54 4d |ed: rs@m|irror.TM|
|00000060| 43 2e 43 4f 4d 0a 0a 53 | 75 62 6d 69 74 74 65 64 |C.COM..S|ubmitted|
|00000070| 20 62 79 3a 20 67 65 6e | 72 61 64 21 6d 6c 66 0a | by: gen|rad!mlf.|
|00000080| 4d 6f 64 2e 73 6f 75 72 | 63 65 73 3a 20 56 6f 6c |Mod.sour|ces: Vol|
|00000090| 75 6d 65 20 39 2c 20 49 | 73 73 75 65 20 33 31 0a |ume 9, I|ssue 31.|
|000000a0| 41 72 63 68 69 76 65 2d | 6e 61 6d 65 3a 20 74 65 |Archive-|name: te|
|000000b0| 63 6f 2f 50 61 72 74 30 | 34 0a 0a 23 21 20 2f 62 |co/Part0|4..#! /b|
|000000c0| 69 6e 2f 73 68 0a 23 20 | 54 68 69 73 20 69 73 20 |in/sh.# |This is |
|000000d0| 61 20 73 68 65 6c 6c 20 | 61 72 63 68 69 76 65 2e |a shell |archive.|
|000000e0| 20 20 52 65 6d 6f 76 65 | 20 61 6e 79 74 68 69 6e | Remove| anythin|
|000000f0| 67 20 62 65 66 6f 72 65 | 20 74 68 69 73 20 6c 69 |g before| this li|
|00000100| 6e 65 2c 0a 23 20 74 68 | 65 6e 20 75 6e 70 61 63 |ne,.# th|en unpac|
|00000110| 6b 20 69 74 20 62 79 20 | 73 61 76 69 6e 67 20 69 |k it by |saving i|
|00000120| 74 20 69 6e 20 61 20 66 | 69 6c 65 20 61 6e 64 20 |t in a f|ile and |
|00000130| 74 79 70 69 6e 67 20 22 | 73 68 20 66 69 6c 65 22 |typing "|sh file"|
|00000140| 2e 0a 23 20 49 66 20 74 | 68 69 73 20 61 72 63 68 |..# If t|his arch|
|00000150| 69 76 65 20 69 73 20 63 | 6f 6d 70 6c 65 74 65 2c |ive is c|omplete,|
|00000160| 20 79 6f 75 20 77 69 6c | 6c 20 73 65 65 20 74 68 | you wil|l see th|
|00000170| 65 20 6d 65 73 73 61 67 | 65 3a 0a 23 09 09 22 45 |e messag|e:.#.."E|
|00000180| 6e 64 20 6f 66 20 61 72 | 63 68 69 76 65 20 34 20 |nd of ar|chive 4 |
|00000190| 28 6f 66 20 34 29 2e 22 | 0a 23 20 43 6f 6e 74 65 |(of 4)."|.# Conte|
|000001a0| 6e 74 73 3a 20 20 74 65 | 5f 77 69 6e 64 6f 77 2e |nts: te|_window.|
|000001b0| 63 0a 23 20 57 72 61 70 | 70 65 64 20 62 79 20 72 |c.# Wrap|ped by r|
|000001c0| 73 40 6d 69 72 72 6f 72 | 20 6f 6e 20 54 68 75 20 |s@mirror| on Thu |
|000001d0| 4d 61 72 20 31 32 20 31 | 39 3a 35 34 3a 33 35 20 |Mar 12 1|9:54:35 |
|000001e0| 31 39 38 37 0a 50 41 54 | 48 3d 2f 62 69 6e 3a 2f |1987.PAT|H=/bin:/|
|000001f0| 75 73 72 2f 62 69 6e 3a | 2f 75 73 72 2f 75 63 62 |usr/bin:|/usr/ucb|
|00000200| 20 3b 20 65 78 70 6f 72 | 74 20 50 41 54 48 0a 65 | ; expor|t PATH.e|
|00000210| 63 68 6f 20 73 68 61 72 | 3a 20 45 78 74 72 61 63 |cho shar|: Extrac|
|00000220| 74 69 6e 67 20 5c 22 74 | 65 5f 77 69 6e 64 6f 77 |ting \"t|e_window|
|00000230| 2e 63 5c 22 20 5c 28 33 | 33 30 31 38 20 63 68 61 |.c\" \(3|3018 cha|
|00000240| 72 61 63 74 65 72 73 5c | 29 0a 69 66 20 74 65 73 |racters\|).if tes|
|00000250| 74 20 2d 66 20 74 65 5f | 77 69 6e 64 6f 77 2e 63 |t -f te_|window.c|
|00000260| 20 3b 20 74 68 65 6e 20 | 0a 20 20 65 63 68 6f 20 | ; then |. echo |
|00000270| 73 68 61 72 3a 20 57 69 | 6c 6c 20 6e 6f 74 20 6f |shar: Wi|ll not o|
|00000280| 76 65 72 2d 77 72 69 74 | 65 20 65 78 69 73 74 69 |ver-writ|e existi|
|00000290| 6e 67 20 66 69 6c 65 20 | 5c 22 74 65 5f 77 69 6e |ng file |\"te_win|
|000002a0| 64 6f 77 2e 63 5c 22 0a | 65 6c 73 65 0a 73 65 64 |dow.c\".|else.sed|
|000002b0| 20 22 73 2f 5e 58 2f 2f | 22 20 3e 74 65 5f 77 69 | "s/^X//|" >te_wi|
|000002c0| 6e 64 6f 77 2e 63 20 3c | 3c 27 45 4e 44 5f 4f 46 |ndow.c <|<'END_OF|
|000002d0| 5f 74 65 5f 77 69 6e 64 | 6f 77 2e 63 27 0a 58 2f |_te_wind|ow.c'.X/|
|000002e0| 2a 20 54 45 43 4f 20 66 | 6f 72 20 55 6c 74 72 69 |* TECO f|or Ultri|
|000002f0| 78 20 20 20 43 6f 70 79 | 72 69 67 68 74 20 31 39 |x Copy|right 19|
|00000300| 38 36 20 4d 61 74 74 20 | 46 69 63 68 74 65 6e 62 |86 Matt |Fichtenb|
|00000310| 61 75 6d 09 09 09 09 09 | 09 2a 2f 0a 58 2f 2a 20 |aum.....|.*/.X/* |
|00000320| 54 68 69 73 20 70 72 6f | 67 72 61 6d 20 61 6e 64 |This pro|gram and|
|00000330| 20 69 74 73 20 63 6f 6d | 70 6f 6e 65 6e 74 73 20 | its com|ponents |
|00000340| 62 65 6c 6f 6e 67 20 74 | 6f 20 47 65 6e 52 61 64 |belong t|o GenRad|
|00000350| 20 49 6e 63 2c 20 43 6f | 6e 63 6f 72 64 20 4d 41 | Inc, Co|ncord MA|
|00000360| 20 30 31 37 34 32 09 2a | 2f 0a 58 2f 2a 20 54 68 | 01742.*|/.X/* Th|
|00000370| 65 79 20 6d 61 79 20 62 | 65 20 63 6f 70 69 65 64 |ey may b|e copied|
|00000380| 20 69 66 20 74 68 69 73 | 20 63 6f 70 79 72 69 67 | if this| copyrig|
|00000390| 68 74 20 6e 6f 74 69 63 | 65 20 69 73 20 69 6e 63 |ht notic|e is inc|
|000003a0| 6c 75 64 65 64 09 09 09 | 09 09 2a 2f 0a 58 0a 58 |luded...|..*/.X.X|
|000003b0| 2f 2a 20 74 65 5f 77 69 | 6e 64 6f 77 2e 63 20 20 |/* te_wi|ndow.c |
|000003c0| 20 77 69 6e 64 6f 77 20 | 66 6f 72 20 74 65 63 6f | window |for teco|
|000003d0| 20 20 20 31 30 2f 31 30 | 2f 38 36 20 2a 2f 0a 58 | 10/10|/86 */.X|
|000003e0| 2f 2a 20 54 68 69 73 20 | 61 74 74 65 6d 70 74 73 |/* This |attempts|
|000003f0| 20 74 6f 20 62 65 20 61 | 20 72 65 61 6c 20 77 69 | to be a| real wi|
|00000400| 6e 64 6f 77 2c 20 77 69 | 74 68 6f 75 74 20 75 6e |ndow, wi|thout un|
|00000410| 65 63 65 73 73 61 72 79 | 20 72 65 64 72 61 77 20 |ecessary| redraw |
|00000420| 2a 2f 0a 58 2f 2a 20 69 | 74 20 69 73 20 76 65 72 |*/.X/* i|t is ver|
|00000430| 79 20 56 54 2d 31 30 30 | 20 73 70 65 63 69 66 69 |y VT-100| specifi|
|00000440| 63 2c 20 61 6e 64 20 6f | 75 67 68 74 20 74 6f 20 |c, and o|ught to |
|00000450| 62 65 20 72 65 77 72 69 | 74 74 65 6e 20 74 6f 20 |be rewri|tten to |
|00000460| 62 65 20 67 65 6e 65 72 | 61 6c 20 2a 2f 0a 58 0a |be gener|al */.X.|
|00000470| 58 23 69 6e 63 6c 75 64 | 65 20 22 74 65 5f 64 65 |X#includ|e "te_de|
|00000480| 66 73 2e 68 22 0a 58 0a | 58 2f 2a 20 6d 61 78 69 |fs.h".X.|X/* maxi|
|00000490| 6d 75 6d 20 73 63 72 65 | 65 6e 20 68 65 69 67 68 |mum scre|en heigh|
|000004a0| 74 20 61 6e 64 20 77 69 | 64 74 68 20 28 68 6f 72 |t and wi|dth (hor|
|000004b0| 69 7a 20 61 6e 64 20 76 | 65 72 74 2c 20 6e 6f 74 |iz and v|ert, not|
|000004c0| 20 68 65 69 67 68 74 20 | 61 6e 64 20 76 69 64 74 | height |and vidt|
|000004d0| 68 29 20 2a 2f 0a 58 23 | 64 65 66 69 6e 65 20 57 |h) */.X#|define W|
|000004e0| 5f 4d 41 58 5f 56 20 37 | 30 0a 58 23 64 65 66 69 |_MAX_V 7|0.X#defi|
|000004f0| 6e 65 20 57 5f 4d 41 58 | 5f 48 20 31 35 30 0a 58 |ne W_MAX|_H 150.X|
|00000500| 23 64 65 66 69 6e 65 20 | 4d 41 58 20 30 78 37 66 |#define |MAX 0x7f|
|00000510| 66 66 66 66 66 66 09 09 | 09 2f 2a 20 6d 61 78 69 |ffffff..|./* maxi|
|00000520| 6d 75 6d 20 70 6f 73 69 | 74 69 76 65 20 69 6e 74 |mum posi|tive int|
|00000530| 65 67 65 72 2c 20 66 6f | 72 20 22 6c 61 73 74 20 |eger, fo|r "last |
|00000540| 6d 6f 64 69 66 69 65 64 | 22 20 6c 6f 63 61 74 69 |modified|" locati|
|00000550| 6f 6e 20 2a 2f 0a 58 23 | 64 65 66 69 6e 65 20 57 |on */.X#|define W|
|00000560| 5f 4d 41 52 4b 20 30 32 | 30 30 09 09 09 09 2f 2a |_MARK 02|00..../*|
|00000570| 20 22 74 68 69 73 20 6c | 6f 63 20 69 73 20 73 70 | "this l|oc is sp|
|00000580| 65 63 69 61 6c 22 20 69 | 6e 20 73 63 72 65 65 6e |ecial" i|n screen|
|00000590| 20 69 6d 61 67 65 20 2a | 2f 0a 58 0a 58 0a 58 2f | image *|/.X.X.X/|
|000005a0| 2a 20 69 6d 61 67 65 20 | 6f 66 20 63 75 72 72 65 |* image |of curre|
|000005b0| 6e 74 20 77 69 6e 64 6f | 77 20 2a 2f 0a 58 0a 58 |nt windo|w */.X.X|
|000005c0| 73 74 72 75 63 74 20 77 | 5f 6c 69 6e 65 09 09 09 |struct w|_line...|
|000005d0| 2f 2a 20 64 61 74 61 20 | 61 73 73 6f 63 69 61 74 |/* data |associat|
|000005e0| 65 64 20 77 69 74 68 20 | 6f 6e 65 20 73 63 72 65 |ed with |one scre|
|000005f0| 65 6e 20 6c 69 6e 65 20 | 2a 2f 0a 58 09 7b 0a 58 |en line |*/.X.{.X|
|00000600| 09 69 6e 74 20 73 74 61 | 72 74 2c 20 65 6e 64 3b |.int sta|rt, end;|
|00000610| 09 09 09 09 2f 2a 20 64 | 6f 74 20 61 74 20 62 65 |..../* d|ot at be|
|00000620| 67 69 6e 6e 69 6e 67 2c | 20 61 74 20 65 6e 64 20 |ginning,| at end |
|00000630| 2a 2f 0a 58 09 73 68 6f | 72 74 20 6e 2c 20 63 66 |*/.X.sho|rt n, cf|
|00000640| 6c 61 67 2c 20 63 6f 6c | 3b 09 09 2f 2a 20 6e 75 |lag, col|;../* nu|
|00000650| 6d 62 65 72 20 6f 66 20 | 63 68 61 72 20 70 6f 73 |mber of |char pos|
|00000660| 69 74 69 6f 6e 73 20 75 | 73 65 64 2c 20 6c 69 6e |itions u|sed, lin|
|00000670| 65 20 63 6f 6e 74 69 6e | 75 61 74 69 6f 6e 20 66 |e contin|uation f|
|00000680| 6c 61 67 2c 20 73 74 61 | 72 74 69 6e 67 20 63 6f |lag, sta|rting co|
|00000690| 6c 20 2a 2f 0a 58 09 63 | 68 61 72 20 63 68 5b 57 |l */.X.c|har ch[W|
|000006a0| 5f 4d 41 58 5f 48 5d 3b | 09 09 09 2f 2a 20 69 6d |_MAX_H];|.../* im|
|000006b0| 61 67 65 20 6f 66 20 6c | 69 6e 65 20 2a 2f 0a 58 |age of l|ine */.X|
|000006c0| 09 7d 0a 58 09 20 77 5f | 69 6d 61 67 65 5b 57 5f |.}.X. w_|image[W_|
|000006d0| 4d 41 58 5f 56 5d 3b 0a | 58 0a 58 0a 58 2f 2a 20 |MAX_V];.|X.X.X/* |
|000006e0| 64 65 66 69 6e 65 20 22 | 74 68 69 73 20 6c 69 6e |define "|this lin|
|000006f0| 65 20 69 73 20 63 6f 6e | 74 69 6e 75 65 64 22 20 |e is con|tinued" |
|00000700| 2f 20 22 74 68 69 73 20 | 6c 69 6e 65 20 69 73 20 |/ "this |line is |
|00000710| 61 20 63 6f 6e 74 69 6e | 75 61 74 69 6f 6e 22 20 |a contin|uation" |
|00000720| 66 6c 61 67 73 20 2a 2f | 0a 58 23 64 65 66 69 6e |flags */|.X#defin|
|00000730| 65 20 57 46 5f 42 45 47 | 20 31 0a 58 23 64 65 66 |e WF_BEG| 1.X#def|
|00000740| 69 6e 65 20 57 46 5f 43 | 4f 4e 54 20 32 0a 58 0a |ine WF_C|ONT 2.X.|
|00000750| 58 73 74 72 75 63 74 20 | 77 5f 6c 69 6e 65 20 2a |Xstruct |w_line *|
|00000760| 77 6c 70 5b 57 5f 4d 41 | 58 5f 56 5d 3b 09 2f 2a |wlp[W_MA|X_V];./*|
|00000770| 20 65 61 63 68 20 77 6f | 72 64 20 70 6f 69 6e 74 | each wo|rd point|
|00000780| 73 20 74 6f 20 74 68 65 | 20 63 6f 72 72 65 73 70 |s to the| corresp|
|00000790| 6f 6e 64 69 6e 67 20 6c | 69 6e 65 27 73 20 64 61 |onding l|ine's da|
|000007a0| 74 61 20 73 74 72 75 63 | 74 75 72 65 20 2a 2f 0a |ta struc|ture */.|
|000007b0| 58 0a 58 73 74 72 75 63 | 74 20 71 70 20 77 5f 70 |X.Xstruc|t qp w_p|
|000007c0| 31 3b 09 09 09 09 09 2f | 2a 20 70 6f 69 6e 74 65 |1;...../|* pointe|
|000007d0| 72 20 66 6f 72 20 77 69 | 6e 64 6f 77 20 61 63 63 |r for wi|ndow acc|
|000007e0| 65 73 73 20 74 6f 20 62 | 75 66 66 65 72 20 2a 2f |ess to b|uffer */|
|000007f0| 0a 58 0a 58 73 68 6f 72 | 74 20 63 75 72 72 5f 78 |.X.Xshor|t curr_x|
|00000800| 2c 20 63 75 72 72 5f 79 | 3b 09 09 09 2f 2a 20 61 |, curr_y|;.../* a|
|00000810| 63 74 69 76 65 20 63 68 | 61 72 61 63 74 65 72 20 |ctive ch|aracter |
|00000820| 70 6f 73 69 74 69 6f 6e | 20 2a 2f 0a 58 73 68 6f |position| */.Xsho|
|00000830| 72 74 20 74 65 72 6d 5f | 78 2c 20 74 65 72 6d 5f |rt term_|x, term_|
|00000840| 79 3b 09 09 09 2f 2a 20 | 63 75 72 72 65 6e 74 20 |y;.../* |current |
|00000850| 74 65 72 6d 69 6e 61 6c | 20 63 75 72 73 6f 72 20 |terminal| cursor |
|00000860| 70 6f 73 69 74 69 6f 6e | 20 2a 2f 0a 58 73 68 6f |position| */.Xsho|
|00000870| 72 74 20 63 75 72 73 5f | 78 2c 20 63 75 72 73 5f |rt curs_|x, curs_|
|00000880| 79 3b 09 09 09 2f 2a 20 | 63 75 72 72 65 6e 74 20 |y;.../* |current |
|00000890| 74 65 63 6f 20 64 6f 74 | 20 73 63 72 65 65 6e 20 |teco dot| screen |
|000008a0| 63 6f 6f 72 64 69 6e 61 | 74 65 73 20 2a 2f 0a 58 |coordina|tes */.X|
|000008b0| 73 68 6f 72 74 20 6c 61 | 73 74 5f 79 3b 09 09 09 |short la|st_y;...|
|000008c0| 09 09 2f 2a 20 6c 61 73 | 74 20 75 73 65 64 20 6c |../* las|t used l|
|000008d0| 69 6e 65 20 69 6e 20 77 | 69 6e 64 6f 77 20 2a 2f |ine in w|indow */|
|000008e0| 0a 58 63 68 61 72 20 63 | 75 72 73 5f 63 3b 09 09 |.Xchar c|urs_c;..|
|000008f0| 09 09 09 2f 2a 20 63 6f | 64 65 20 66 6f 72 20 63 |.../* co|de for c|
|00000900| 68 61 72 20 61 74 20 63 | 75 72 73 6f 72 20 2a 2f |har at c|ursor */|
|00000910| 0a 58 63 68 61 72 20 2a | 63 75 72 73 5f 70 3b 09 |.Xchar *|curs_p;.|
|00000920| 09 09 09 09 2f 2a 20 70 | 6f 69 6e 74 65 72 20 74 |..../* p|ointer t|
|00000930| 6f 20 63 75 72 73 6f 72 | 20 6c 6f 63 20 69 6e 20 |o cursor| loc in |
|00000940| 77 69 6e 64 6f 77 20 69 | 6d 61 67 65 20 2a 2f 0a |window i|mage */.|
|00000950| 58 73 68 6f 72 74 20 63 | 75 72 73 5f 63 72 66 6c |Xshort c|urs_crfl|
|00000960| 61 67 3b 09 09 09 09 2f | 2a 20 66 6c 61 67 20 74 |ag;..../|* flag t|
|00000970| 68 61 74 20 63 75 72 73 | 6f 72 20 69 73 20 6f 6e |hat curs|or is on|
|00000980| 20 61 20 43 52 20 2a 2f | 0a 58 73 68 6f 72 74 20 | a CR */|.Xshort |
|00000990| 72 65 64 72 61 77 5f 73 | 77 3b 09 09 09 09 2f 2a |redraw_s|w;..../*|
|000009a0| 20 66 6f 72 63 65 73 20 | 61 62 73 6f 6c 75 74 65 | forces |absolute|
|000009b0| 20 72 65 64 72 61 77 20 | 2a 2f 0a 58 0a 58 0a 58 | redraw |*/.X.X.X|
|000009c0| 2f 2a 20 66 69 6c 6c 20 | 63 68 61 72 61 63 74 65 |/* fill |characte|
|000009d0| 72 73 20 61 6e 64 20 74 | 65 72 6d 69 6e 61 6c 20 |rs and t|erminal |
|000009e0| 73 70 65 65 64 73 3a 20 | 30 74 68 20 65 6e 74 72 |speeds: |0th entr|
|000009f0| 79 20 75 73 65 64 20 77 | 68 65 6e 20 73 74 64 20 |y used w|hen std |
|00000a00| 6f 75 74 20 69 73 20 6e | 6f 74 20 61 20 74 65 72 |out is n|ot a ter|
|00000a10| 6d 69 6e 61 6c 20 2a 2f | 0a 58 63 68 61 72 20 77 |minal */|.Xchar w|
|00000a20| 69 6e 5f 73 70 65 65 64 | 73 5b 5d 20 3d 20 7b 20 |in_speed|s[] = { |
|00000a30| 30 2c 20 30 2c 20 42 39 | 36 30 30 2c 20 42 34 38 |0, 0, B9|600, B48|
|00000a40| 30 30 2c 20 42 32 34 30 | 30 2c 20 42 31 38 30 30 |00, B240|0, B1800|
|00000a50| 2c 20 42 31 32 30 30 2c | 20 42 36 30 30 2c 20 42 |, B1200,| B600, B|
|00000a60| 33 30 30 2c 20 42 32 30 | 30 2c 20 42 31 35 30 2c |300, B20|0, B150,|
|00000a70| 20 42 31 33 34 2c 20 42 | 31 31 30 20 7d 3b 0a 58 | B134, B|110 };.X|
|00000a80| 63 68 61 72 20 77 69 6e | 5f 64 6c 79 65 5b 5d 20 |char win|_dlye[] |
|00000a90| 3d 20 20 20 7b 20 30 2c | 20 39 30 2c 20 34 35 2c |= { 0,| 90, 45,|
|00000aa0| 20 32 33 2c 20 31 31 2c | 20 39 2c 20 36 2c 20 33 | 23, 11,| 9, 6, 3|
|00000ab0| 2c 20 31 2c 20 31 2c 20 | 31 2c 20 31 2c 20 31 20 |, 1, 1, |1, 1, 1 |
|00000ac0| 7d 3b 09 2f 2a 20 64 65 | 6c 61 79 20 66 6f 72 20 |};./* de|lay for |
|00000ad0| 65 72 61 73 65 2d 73 63 | 72 65 65 6e 20 2a 2f 0a |erase-sc|reen */.|
|00000ae0| 58 63 68 61 72 20 77 69 | 6e 5f 64 6c 79 73 5b 5d |Xchar wi|n_dlys[]|
|00000af0| 20 3d 20 20 20 7b 20 30 | 2c 20 36 30 2c 20 33 30 | = { 0|, 60, 30|
|00000b00| 2c 20 31 35 2c 20 37 2c | 20 36 2c 20 34 2c 20 32 |, 15, 7,| 6, 4, 2|
|00000b10| 2c 20 31 2c 20 31 2c 20 | 30 2c 20 30 2c 20 30 20 |, 1, 1, |0, 0, 0 |
|00000b20| 7d 3b 09 2f 2a 20 64 65 | 6c 61 79 20 66 6f 72 20 |};./* de|lay for |
|00000b30| 73 63 72 6f 6c 6c 20 6f | 70 73 20 2a 2f 0a 58 63 |scroll o|ps */.Xc|
|00000b40| 68 61 72 20 77 69 6e 5f | 64 6c 79 6c 5b 5d 20 3d |har win_|dlyl[] =|
|00000b50| 20 20 20 7b 20 30 2c 20 | 34 2c 20 32 2c 20 31 2c | { 0, |4, 2, 1,|
|00000b60| 20 30 2c 20 30 2c 20 30 | 2c 20 30 2c 20 30 2c 20 | 0, 0, 0|, 0, 0, |
|00000b70| 30 2c 20 30 2c 20 30 2c | 20 30 20 7d 3b 09 09 2f |0, 0, 0,| 0 };../|
|00000b80| 2a 20 64 65 6c 61 79 20 | 66 6f 72 20 65 72 61 73 |* delay |for eras|
|00000b90| 65 20 6c 69 6e 65 20 2a | 2f 0a 58 63 68 61 72 20 |e line *|/.Xchar |
|00000ba0| 77 69 6e 5f 64 6c 79 63 | 5b 5d 20 3d 20 20 20 7b |win_dlyc|[] = {|
|00000bb0| 20 30 2c 20 32 2c 20 31 | 2c 20 30 2c 20 30 2c 20 | 0, 2, 1|, 0, 0, |
|00000bc0| 30 2c 20 30 2c 20 30 2c | 20 30 2c 20 30 2c 20 30 |0, 0, 0,| 0, 0, 0|
|00000bd0| 2c 20 30 2c 20 30 20 7d | 3b 09 09 2f 2a 20 64 65 |, 0, 0 }|;../* de|
|00000be0| 6c 61 79 20 66 6f 72 20 | 6f 74 68 65 72 20 63 6f |lay for |other co|
|00000bf0| 6e 74 72 6f 6c 20 66 75 | 6e 63 74 69 6f 6e 73 20 |ntrol fu|nctions |
|00000c00| 2a 2f 0a 58 73 68 6f 72 | 74 20 77 69 6e 5f 73 70 |*/.Xshor|t win_sp|
|00000c10| 65 65 64 3b 0a 58 0c 2f | 2a 20 72 6f 75 74 69 6e |eed;.X./|* routin|
|00000c20| 65 20 74 6f 20 70 65 72 | 66 6f 72 6d 20 73 69 6d |e to per|form sim|
|00000c30| 70 6c 65 20 73 63 6f 70 | 65 20 6f 70 65 72 61 74 |ple scop|e operat|
|00000c40| 69 6f 6e 73 20 2a 2f 0a | 58 2f 2a 20 28 61 6e 20 |ions */.|X/* (an |
|00000c50| 61 74 74 65 6d 70 74 20 | 74 6f 20 63 6f 6e 63 65 |attempt |to conce|
|00000c60| 6e 74 72 61 74 65 20 56 | 54 2d 31 30 30 20 73 70 |ntrate V|T-100 sp|
|00000c70| 65 63 69 66 69 63 20 74 | 68 69 6e 67 73 20 69 6e |ecific t|hings in|
|00000c80| 20 6f 6e 65 20 70 6c 61 | 63 65 29 20 2a 2f 0a 58 | one pla|ce) */.X|
|00000c90| 0a 58 76 74 28 66 75 6e | 63 29 0a 58 09 69 6e 74 |.Xvt(fun|c).X.int|
|00000ca0| 20 66 75 6e 63 3b 0a 58 | 09 7b 0a 58 09 73 68 6f | func;.X|.{.X.sho|
|00000cb0| 72 74 20 74 3b 0a 58 09 | 73 77 69 74 63 68 20 28 |rt t;.X.|switch (|
|00000cc0| 66 75 6e 63 29 0a 58 09 | 09 7b 0a 58 09 09 63 61 |func).X.|.{.X..ca|
|00000cd0| 73 65 20 56 54 5f 43 4c | 45 41 52 3a 09 09 09 2f |se VT_CL|EAR:.../|
|00000ce0| 2a 20 63 6c 65 61 72 20 | 73 63 72 65 65 6e 20 2a |* clear |screen *|
|00000cf0| 2f 0a 58 09 09 09 66 70 | 75 74 73 28 22 5c 30 33 |/.X...fp|uts("\03|
|00000d00| 33 5b 48 5c 30 33 33 5b | 4a 22 2c 20 73 74 64 6f |3[H\033[|J", stdo|
|00000d10| 75 74 29 3b 0a 58 09 09 | 09 66 6f 72 20 28 74 20 |ut);.X..|.for (t |
|00000d20| 3d 20 30 3b 20 74 20 3c | 20 77 69 6e 5f 64 6c 79 |= 0; t <| win_dly|
|00000d30| 65 5b 77 69 6e 5f 73 70 | 65 65 64 5d 3b 20 74 2b |e[win_sp|eed]; t+|
|00000d40| 2b 29 20 70 75 74 63 68 | 61 72 28 27 5c 30 27 29 |+) putch|ar('\0')|
|00000d50| 3b 09 2f 2a 20 66 69 6c | 6c 20 63 68 61 72 73 20 |;./* fil|l chars |
|00000d60| 2a 2f 0a 58 09 09 09 62 | 72 65 61 6b 3b 0a 58 0a |*/.X...b|reak;.X.|
|00000d70| 58 09 09 63 61 73 65 20 | 56 54 5f 45 45 4f 4c 3a |X..case |VT_EEOL:|
|00000d80| 09 09 09 2f 2a 20 65 72 | 61 73 65 20 74 6f 20 65 |.../* er|ase to e|
|00000d90| 6e 64 20 6f 66 20 6c 69 | 6e 65 20 2a 2f 0a 58 09 |nd of li|ne */.X.|
|00000da0| 09 09 66 70 75 74 73 28 | 22 5c 30 33 33 5b 4b 22 |..fputs(|"\033[K"|
|00000db0| 2c 20 73 74 64 6f 75 74 | 29 3b 0a 58 09 09 09 66 |, stdout|);.X...f|
|00000dc0| 6f 72 20 28 74 20 3d 20 | 30 3b 20 74 20 3c 20 77 |or (t = |0; t < w|
|00000dd0| 69 6e 5f 64 6c 79 6c 5b | 77 69 6e 5f 73 70 65 65 |in_dlyl[|win_spee|
|00000de0| 64 5d 3b 20 74 2b 2b 29 | 20 70 75 74 63 68 61 72 |d]; t++)| putchar|
|00000df0| 28 27 5c 30 27 29 3b 09 | 2f 2a 20 66 69 6c 6c 20 |('\0');.|/* fill |
|00000e00| 63 68 61 72 73 20 2a 2f | 0a 58 09 09 09 62 72 65 |chars */|.X...bre|
|00000e10| 61 6b 3b 0a 58 0a 58 09 | 09 63 61 73 65 20 56 54 |ak;.X.X.|.case VT|
|00000e20| 5f 45 42 4f 4c 3a 09 09 | 09 2f 2a 20 65 72 61 73 |_EBOL:..|./* eras|
|00000e30| 65 20 66 72 6f 6d 20 62 | 65 67 69 6e 6e 69 6e 67 |e from b|eginning|
|00000e40| 20 6f 66 20 6c 69 6e 65 | 20 2a 2f 0a 58 09 09 09 | of line| */.X...|
|00000e50| 66 70 75 74 73 28 22 5c | 30 33 33 5b 31 4b 22 2c |fputs("\|033[1K",|
|00000e60| 20 73 74 64 6f 75 74 29 | 3b 0a 58 09 09 09 66 6f | stdout)|;.X...fo|
|00000e70| 72 20 28 74 20 3d 20 30 | 3b 20 74 20 3c 20 77 69 |r (t = 0|; t < wi|
|00000e80| 6e 5f 64 6c 79 6c 5b 77 | 69 6e 5f 73 70 65 65 64 |n_dlyl[w|in_speed|
|00000e90| 5d 3b 20 74 2b 2b 29 20 | 70 75 74 63 68 61 72 28 |]; t++) |putchar(|
|00000ea0| 27 5c 30 27 29 3b 09 2f | 2a 20 66 69 6c 6c 20 63 |'\0');./|* fill c|
|00000eb0| 68 61 72 73 20 2a 2f 0a | 58 09 09 09 62 72 65 61 |hars */.|X...brea|
|00000ec0| 6b 3b 0a 58 0a 58 09 09 | 63 61 73 65 20 56 54 5f |k;.X.X..|case VT_|
|00000ed0| 53 45 54 53 50 45 43 31 | 3a 09 09 2f 2a 20 72 65 |SETSPEC1|:../* re|
|00000ee0| 76 65 72 73 65 20 76 69 | 64 65 6f 20 2a 2f 0a 58 |verse vi|deo */.X|
|00000ef0| 09 09 09 66 70 75 74 73 | 28 22 5c 30 33 33 5b 37 |...fputs|("\033[7|
|00000f00| 6d 22 2c 20 73 74 64 6f | 75 74 29 3b 0a 58 09 09 |m", stdo|ut);.X..|
|00000f10| 09 62 72 65 61 6b 3b 0a | 58 0a 58 09 09 63 61 73 |.break;.|X.X..cas|
|00000f20| 65 20 56 54 5f 53 45 54 | 53 50 45 43 32 3a 09 09 |e VT_SET|SPEC2:..|
|00000f30| 2f 2a 20 62 72 69 67 68 | 74 20 72 65 76 65 72 73 |/* brigh|t revers|
|00000f40| 65 20 76 69 64 65 6f 20 | 2a 2f 0a 58 09 09 09 66 |e video |*/.X...f|
|00000f50| 70 75 74 73 28 22 5c 30 | 33 33 5b 31 3b 37 6d 22 |puts("\0|33[1;7m"|
|00000f60| 2c 20 73 74 64 6f 75 74 | 29 3b 0a 58 09 09 09 62 |, stdout|);.X...b|
|00000f70| 72 65 61 6b 3b 0a 58 0a | 58 09 09 63 61 73 65 20 |reak;.X.|X..case |
|00000f80| 56 54 5f 43 4c 52 53 50 | 45 43 3a 09 09 2f 2a 20 |VT_CLRSP|EC:../* |
|00000f90| 6e 6f 72 6d 61 6c 20 76 | 69 64 65 6f 20 2a 2f 0a |normal v|ideo */.|
|00000fa0| 58 09 09 09 66 70 75 74 | 73 28 22 5c 30 33 33 5b |X...fput|s("\033[|
|00000fb0| 30 6d 22 2c 20 73 74 64 | 6f 75 74 29 3b 0a 58 09 |0m", std|out);.X.|
|00000fc0| 09 09 62 72 65 61 6b 3b | 0a 58 0a 58 09 09 63 61 |..break;|.X.X..ca|
|00000fd0| 73 65 20 56 54 5f 42 53 | 31 3a 09 09 09 2f 2a 20 |se VT_BS|1:.../* |
|00000fe0| 62 61 63 6b 73 70 61 63 | 65 20 31 20 73 70 6f 74 |backspac|e 1 spot|
|00000ff0| 20 2a 2f 0a 58 09 09 09 | 66 70 75 74 73 28 22 5c | */.X...|fputs("\|
|00001000| 62 20 5c 62 22 2c 20 73 | 74 64 6f 75 74 29 3b 0a |b \b", s|tdout);.|
|00001010| 58 09 09 09 62 72 65 61 | 6b 3b 0a 58 0a 58 09 09 |X...brea|k;.X.X..|
|00001020| 63 61 73 65 20 56 54 5f | 42 53 32 3a 09 09 09 2f |case VT_|BS2:.../|
|00001030| 2a 20 62 61 63 6b 73 70 | 61 63 65 20 32 20 73 70 |* backsp|ace 2 sp|
|00001040| 6f 74 73 20 2a 2f 0a 58 | 09 09 09 66 70 75 74 73 |ots */.X|...fputs|
|00001050| 28 22 5c 62 20 5c 62 5c | 62 20 5c 62 22 2c 20 73 |("\b \b\|b \b", s|
|00001060| 74 64 6f 75 74 29 3b 0a | 58 09 09 09 62 72 65 61 |tdout);.|X...brea|
|00001070| 6b 3b 0a 58 0a 58 09 09 | 63 61 73 65 20 56 54 5f |k;.X.X..|case VT_|
|00001080| 4c 49 4e 45 55 50 3a 09 | 09 09 2f 2a 20 75 70 20 |LINEUP:.|../* up |
|00001090| 6f 6e 65 20 6c 69 6e 65 | 20 2a 2f 0a 58 09 09 09 |one line| */.X...|
|000010a0| 66 70 75 74 73 28 22 5c | 30 33 33 5b 31 41 22 2c |fputs("\|033[1A",|
|000010b0| 20 73 74 64 6f 75 74 29 | 3b 0a 58 09 09 09 62 72 | stdout)|;.X...br|
|000010c0| 65 61 6b 3b 0a 58 09 09 | 7d 0a 58 09 7d 0a 58 0c |eak;.X..|}.X.}.X.|
|000010d0| 2f 2a 20 72 6f 75 74 69 | 6e 65 20 74 6f 20 73 65 |/* routi|ne to se|
|000010e0| 74 20 77 69 6e 64 6f 77 | 20 70 61 72 61 6d 65 74 |t window| paramet|
|000010f0| 65 72 73 20 2a 2f 0a 58 | 0a 58 2f 2a 20 30 3a 20 |ers */.X|.X/* 0: |
|00001100| 73 63 6f 70 65 20 74 79 | 70 65 2c 20 31 3a 20 77 |scope ty|pe, 1: w|
|00001110| 69 64 74 68 2c 20 32 3a | 20 68 65 69 67 68 74 2c |idth, 2:| height,|
|00001120| 20 33 3a 20 73 65 65 61 | 6c 6c 2c 20 34 3a 20 6d | 3: seea|ll, 4: m|
|00001130| 61 72 6b 20 70 6f 73 69 | 74 69 6f 6e 2c 09 09 2a |ark posi|tion,..*|
|00001140| 2f 0a 58 2f 2a 20 35 3a | 20 68 6f 6c 64 20 6d 6f |/.X/* 5:| hold mo|
|00001150| 64 65 2c 20 36 3a 20 75 | 70 70 65 72 20 6c 65 66 |de, 6: u|pper lef|
|00001160| 74 20 63 6f 72 6e 65 72 | 20 70 6f 73 69 74 69 6f |t corner| positio|
|00001170| 6e 2c 20 37 3a 20 73 63 | 72 6f 6c 6c 20 72 65 67 |n, 7: sc|roll reg|
|00001180| 69 6f 6e 20 73 69 7a 65 | 09 2a 2f 0a 58 0a 58 2f |ion size|.*/.X.X/|
|00001190| 2a 09 09 09 09 20 20 20 | 30 20 20 20 31 09 09 32 |*.... |0 1..2|
|000011a0| 09 09 20 33 20 20 34 09 | 20 20 35 20 20 20 36 09 |.. 3 4.| 5 6.|
|000011b0| 20 20 20 37 09 2a 2f 0a | 58 69 6e 74 20 77 69 6e | 7.*/.|Xint win|
|000011c0| 5f 6d 69 6e 5b 5d 20 20 | 3d 20 7b 20 34 2c 20 20 |_min[] |= { 4, |
|000011d0| 32 30 2c 09 09 34 2c 09 | 09 20 30 2c 20 30 2c 09 |20,..4,.|. 0, 0,.|
|000011e0| 20 2d 31 2c 20 20 31 2c | 20 20 20 30 20 7d 20 3b | -1, 1,| 0 } ;|
|000011f0| 09 2f 2a 20 6d 69 6e 20 | 76 61 6c 75 65 73 20 66 |./* min |values f|
|00001200| 6f 72 20 77 69 6e 64 6f | 77 20 70 61 72 61 6d 65 |or windo|w parame|
|00001210| 74 65 72 73 20 2a 2f 0a | 58 69 6e 74 20 77 69 6e |ters */.|Xint win|
|00001220| 5f 6d 61 78 5b 5d 20 20 | 3d 20 7b 20 34 2c 20 20 |_max[] |= { 4, |
|00001230| 57 5f 4d 41 58 5f 48 2c | 09 57 5f 4d 41 58 5f 56 |W_MAX_H,|.W_MAX_V|
|00001240| 2c 20 31 2c 20 4d 41 58 | 2c 20 31 32 2c 20 2d 31 |, 1, MAX|, 12, -1|
|00001250| 2c 20 20 32 30 20 7d 20 | 3b 09 2f 2a 20 6d 61 78 |, 20 } |;./* max|
|00001260| 20 76 61 6c 75 65 73 20 | 2a 2f 0a 58 69 6e 74 20 | values |*/.Xint |
|00001270| 77 69 6e 5f 64 61 74 61 | 5b 5d 20 3d 20 7b 20 34 |win_data|[] = { 4|
|00001280| 2c 20 20 31 33 32 2c 09 | 09 32 34 2c 09 09 20 30 |, 132,.|.24,.. 0|
|00001290| 2c 20 30 2c 09 20 20 30 | 2c 20 20 30 2c 20 20 20 |, 0,. 0|, 0, |
|000012a0| 30 20 7d 20 3b 09 2f 2a | 20 77 69 6e 64 6f 77 20 |0 } ;./*| window |
|000012b0| 70 61 72 61 6d 65 74 65 | 72 73 09 2a 2f 0a 58 0a |paramete|rs.*/.X.|
|000012c0| 58 69 6e 74 20 77 69 6e | 64 6f 77 5f 73 69 7a 65 |Xint win|dow_size|
|000012d0| 3b 09 09 09 09 09 09 09 | 09 2f 2a 20 23 20 6f 66 |;.......|./* # of|
|000012e0| 20 6c 69 6e 65 73 20 69 | 6e 20 61 20 77 69 6e 64 | lines i|n a wind|
|000012f0| 6f 77 20 2a 2f 0a 58 0a | 58 64 6f 5f 77 69 6e 64 |ow */.X.|Xdo_wind|
|00001300| 6f 77 28 72 65 66 5f 66 | 6c 61 67 29 0a 58 09 69 |ow(ref_f|lag).X.i|
|00001310| 6e 74 20 72 65 66 5f 66 | 6c 61 67 3b 09 09 09 09 |nt ref_f|lag;....|
|00001320| 09 2f 2a 20 6e 6f 6e 7a | 65 72 6f 20 66 6f 72 63 |./* nonz|ero forc|
|00001330| 65 73 20 22 72 65 66 72 | 65 73 68 22 20 6f 70 65 |es "refr|esh" ope|
|00001340| 72 61 74 69 6f 6e 20 2a | 2f 0a 58 09 7b 0a 58 09 |ration *|/.X.{.X.|
|00001350| 69 6e 74 20 69 3b 0a 58 | 0a 58 09 69 66 20 28 63 |int i;.X|.X.if (c|
|00001360| 6f 6c 6f 6e 66 6c 61 67 | 20 26 26 20 21 72 65 66 |olonflag| && !ref|
|00001370| 5f 66 6c 61 67 29 0a 58 | 09 09 7b 0a 58 09 09 69 |_flag).X|..{.X..i|
|00001380| 20 3d 20 67 65 74 5f 76 | 61 6c 75 65 28 30 29 3b | = get_v|alue(0);|
|00001390| 09 2f 2a 20 67 65 74 20 | 73 75 62 2d 66 75 6e 63 |./* get |sub-func|
|000013a0| 74 69 6f 6e 20 2a 2f 0a | 58 09 09 69 66 20 28 28 |tion */.|X..if ((|
|000013b0| 69 20 3c 20 30 29 20 7c | 7c 20 28 69 20 3e 20 37 |i < 0) ||| (i > 7|
|000013c0| 29 29 20 45 52 52 4f 52 | 28 45 5f 49 57 41 29 3b |)) ERROR|(E_IWA);|
|000013d0| 0a 58 09 09 69 66 20 28 | 21 65 73 70 2d 3e 66 6c |.X..if (|!esp->fl|
|000013e0| 61 67 32 29 09 2f 2a 20 | 69 74 27 73 20 61 20 22 |ag2)./* |it's a "|
|000013f0| 67 65 74 22 20 2a 2f 0a | 58 09 09 09 7b 0a 58 09 |get" */.|X...{.X.|
|00001400| 09 09 65 73 70 2d 3e 76 | 61 6c 31 20 3d 20 77 69 |..esp->v|al1 = wi|
|00001410| 6e 5f 64 61 74 61 5b 69 | 5d 3b 0a 58 09 09 09 65 |n_data[i|];.X...e|
|00001420| 73 70 2d 3e 66 6c 61 67 | 31 20 3d 20 31 3b 0a 58 |sp->flag|1 = 1;.X|
|00001430| 09 09 09 7d 0a 58 09 09 | 65 6c 73 65 0a 58 09 09 |...}.X..|else.X..|
|00001440| 09 7b 0a 58 09 09 09 69 | 66 20 28 28 65 73 70 2d |.{.X...i|f ((esp-|
|00001450| 3e 76 61 6c 32 20 3c 20 | 77 69 6e 5f 6d 69 6e 5b |>val2 < |win_min[|
|00001460| 69 5d 29 20 7c 7c 20 28 | 65 73 70 2d 3e 76 61 6c |i]) || (|esp->val|
|00001470| 32 20 3e 20 77 69 6e 5f | 6d 61 78 5b 69 5d 29 29 |2 > win_|max[i]))|
|00001480| 09 2f 2a 20 63 68 65 63 | 6b 20 72 61 6e 67 65 20 |./* chec|k range |
|00001490| 2a 2f 0a 58 09 09 09 09 | 45 52 52 4f 52 28 45 5f |*/.X....|ERROR(E_|
|000014a0| 49 57 41 29 3b 0a 58 09 | 09 09 69 66 20 28 69 20 |IWA);.X.|..if (i |
|000014b0| 3d 3d 20 37 29 0a 58 09 | 09 09 09 7b 0a 58 09 09 |== 7).X.|...{.X..|
|000014c0| 09 09 69 66 20 28 65 73 | 70 2d 3e 76 61 6c 32 29 |..if (es|p->val2)|
|000014d0| 0a 58 09 09 09 09 09 7b | 0a 58 09 09 09 09 09 57 |.X.....{|.X.....W|
|000014e0| 4e 5f 73 63 72 6f 6c 6c | 20 3d 20 65 73 70 2d 3e |N_scroll| = esp->|
|000014f0| 76 61 6c 32 3b 0a 58 09 | 09 09 09 09 77 69 6e 64 |val2;.X.|....wind|
|00001500| 6f 77 5f 73 69 7a 65 20 | 3d 20 57 4e 5f 68 65 69 |ow_size |= WN_hei|
|00001510| 67 68 74 20 2d 20 57 4e | 5f 73 63 72 6f 6c 6c 3b |ght - WN|_scroll;|
|00001520| 09 2f 2a 20 64 65 66 69 | 6e 65 20 73 69 7a 65 20 |./* defi|ne size |
|00001530| 6f 66 20 77 69 6e 64 6f | 77 20 61 72 65 61 20 2a |of windo|w area *|
|00001540| 2f 0a 58 09 09 09 09 09 | 77 69 6e 64 6f 77 28 57 |/.X.....|window(W|
|00001550| 49 4e 5f 49 4e 49 54 29 | 3b 09 09 09 2f 2a 20 74 |IN_INIT)|;.../* t|
|00001560| 75 72 6e 20 6f 6e 20 77 | 69 6e 64 6f 77 20 2a 2f |urn on w|indow */|
|00001570| 0a 58 09 09 09 09 09 7d | 0a 58 09 09 09 09 65 6c |.X.....}|.X....el|
|00001580| 73 65 20 77 69 6e 64 6f | 77 28 57 49 4e 5f 4f 46 |se windo|w(WIN_OF|
|00001590| 46 29 3b 09 09 09 2f 2a | 20 74 75 72 6e 20 6f 66 |F);.../*| turn of|
|000015a0| 66 20 77 69 6e 64 6f 77 | 20 2a 2f 0a 58 09 09 09 |f window| */.X...|
|000015b0| 09 7d 0a 58 09 09 09 77 | 69 6e 5f 64 61 74 61 5b |.}.X...w|in_data[|
|000015c0| 69 5d 20 3d 20 65 73 70 | 2d 3e 76 61 6c 32 3b 09 |i] = esp|->val2;.|
|000015d0| 09 09 2f 2a 20 72 65 64 | 75 6e 64 61 6e 74 20 66 |../* red|undant f|
|000015e0| 6f 72 20 7e 30 2c 37 3a | 77 2c 20 62 75 74 20 6e |or ~0,7:|w, but n|
|000015f0| 6f 20 68 61 72 6d 20 2a | 2f 0a 58 09 09 09 65 73 |o harm *|/.X...es|
|00001600| 70 2d 3e 66 6c 61 67 32 | 20 3d 20 30 3b 0a 58 09 |p->flag2| = 0;.X.|
|00001610| 09 09 77 69 6e 64 6f 77 | 28 57 49 4e 5f 52 45 44 |..window|(WIN_RED|
|00001620| 52 41 57 29 3b 09 09 09 | 09 09 2f 2a 20 72 65 64 |RAW);...|../* red|
|00001630| 72 61 77 20 77 69 6e 64 | 6f 77 20 2a 2f 0a 58 09 |raw wind|ow */.X.|
|00001640| 09 09 7d 0a 58 09 09 7d | 0a 58 0a 58 09 65 6c 73 |..}.X..}|.X.X.els|
|00001650| 65 09 09 09 09 09 09 09 | 09 2f 2a 20 6e 6f 20 63 |e.......|./* no c|
|00001660| 6f 6c 6f 6e 2c 20 6f 72 | 20 5e 57 20 63 6f 6d 6d |olon, or| ^W comm|
|00001670| 61 6e 64 20 2a 2f 0a 58 | 09 09 7b 0a 58 09 09 69 |and */.X|..{.X..i|
|00001680| 66 20 28 65 73 70 2d 3e | 66 6c 61 67 31 20 7c 7c |f (esp->|flag1 |||
|00001690| 20 72 65 66 5f 66 6c 61 | 67 29 0a 58 09 09 09 7b | ref_fla|g).X...{|
|000016a0| 0a 58 09 09 09 69 66 20 | 28 21 72 65 66 5f 66 6c |.X...if |(!ref_fl|
|000016b0| 61 67 20 26 26 20 28 65 | 73 70 2d 3e 76 61 6c 31 |ag && (e|sp->val1|
|000016c0| 20 3d 3d 20 2d 31 30 30 | 30 29 29 20 72 65 64 72 | == -100|0)) redr|
|000016d0| 61 77 5f 73 77 20 3d 20 | 30 3b 09 2f 2a 20 2d 31 |aw_sw = |0;./* -1|
|000016e0| 30 30 30 57 3a 20 22 66 | 6f 72 67 65 74 20 74 68 |000W: "f|orget th|
|000016f0| 61 74 20 6f 75 74 70 75 | 74 20 77 61 73 20 64 6f |at outpu|t was do|
|00001700| 6e 65 22 20 2a 2f 0a 58 | 09 09 09 65 6c 73 65 20 |ne" */.X|...else |
|00001710| 77 69 6e 64 6f 77 28 57 | 49 4e 5f 44 49 53 50 29 |window(W|IN_DISP)|
|00001720| 3b 09 09 2f 2a 20 6e 57 | 20 6f 72 20 5e 57 20 72 |;../* nW| or ^W r|
|00001730| 65 66 72 65 73 68 65 73 | 20 77 69 6e 64 6f 77 20 |efreshes| window |
|00001740| 2a 2f 0a 58 09 09 09 7d | 0a 58 09 09 20 65 73 70 |*/.X...}|.X.. esp|
|00001750| 2d 3e 66 6c 61 67 32 20 | 3d 20 65 73 70 2d 3e 66 |->flag2 |= esp->f|
|00001760| 6c 61 67 31 20 3d 20 30 | 3b 09 09 2f 2a 20 6e 6f |lag1 = 0|;../* no|
|00001770| 20 63 6f 6c 6f 6e 2c 20 | 63 6f 6e 73 75 6d 65 20 | colon, |consume |
|00001780| 61 72 67 73 20 2a 2f 0a | 58 09 09 7d 0a 58 09 63 |args */.|X..}.X.c|
|00001790| 6f 6c 6f 6e 66 6c 61 67 | 20 3d 20 30 3b 0a 58 09 |olonflag| = 0;.X.|
|000017a0| 65 73 70 2d 3e 6f 70 20 | 3d 20 4f 50 5f 53 54 41 |esp->op |= OP_STA|
|000017b0| 52 54 3b 0a 58 09 7d 0a | 58 0c 2f 2a 20 72 6f 75 |RT;.X.}.|X./* rou|
|000017c0| 74 69 6e 65 20 74 6f 20 | 75 70 64 61 74 65 20 73 |tine to |update s|
|000017d0| 63 72 65 65 6e 20 73 69 | 7a 65 20 77 69 74 68 20 |creen si|ze with |
|000017e0| 6e 75 6d 62 65 72 73 20 | 6f 62 74 61 69 6e 65 64 |numbers |obtained|
|000017f0| 20 66 72 6f 6d 20 65 6e | 76 69 72 6f 6e 6d 65 6e | from en|vironmen|
|00001800| 74 09 2a 2f 0a 58 2f 2a | 20 28 63 61 6c 6c 65 64 |t.*/.X/*| (called|
|00001810| 20 62 79 20 6d 61 69 6e | 20 70 72 6f 67 72 61 6d | by main| program|
|00001820| 27 73 20 69 6e 69 74 69 | 61 6c 69 7a 61 74 69 6f |'s initi|alizatio|
|00001830| 6e 29 09 09 09 09 09 09 | 09 2a 2f 0a 58 0a 58 73 |n)......|.*/.X.Xs|
|00001840| 65 74 5f 74 65 72 6d 5f | 70 61 72 28 6c 69 6e 65 |et_term_|par(line|
|00001850| 73 2c 20 63 6f 6c 73 29 | 0a 58 09 69 6e 74 20 6c |s, cols)|.X.int l|
|00001860| 69 6e 65 73 2c 20 63 6f | 6c 73 3b 0a 58 09 7b 0a |ines, co|ls;.X.{.|
|00001870| 58 09 69 66 20 28 28 6c | 69 6e 65 73 20 3e 3d 20 |X.if ((l|ines >= |
|00001880| 77 69 6e 5f 6d 69 6e 5b | 32 5d 29 20 26 26 20 28 |win_min[|2]) && (|
|00001890| 6c 69 6e 65 73 20 3c 3d | 20 77 69 6e 5f 6d 61 78 |lines <=| win_max|
|000018a0| 5b 32 5d 29 29 20 77 69 | 6e 64 6f 77 5f 73 69 7a |[2])) wi|ndow_siz|
|000018b0| 65 20 3d 20 77 69 6e 5f | 64 61 74 61 5b 32 5d 20 |e = win_|data[2] |
|000018c0| 3d 20 6c 69 6e 65 73 3b | 0a 58 09 69 66 20 28 28 |= lines;|.X.if ((|
|000018d0| 63 6f 6c 73 20 3e 3d 20 | 77 69 6e 5f 6d 69 6e 5b |cols >= |win_min[|
|000018e0| 31 5d 29 20 26 26 20 28 | 63 6f 6c 73 20 3c 3d 20 |1]) && (|cols <= |
|000018f0| 77 69 6e 5f 6d 61 78 5b | 31 5d 29 29 20 77 69 6e |win_max[|1])) win|
|00001900| 5f 64 61 74 61 5b 31 5d | 20 3d 20 63 6f 6c 73 3b |_data[1]| = cols;|
|00001910| 0a 58 09 7d 0a 58 0a 58 | 0a 58 2f 2a 20 77 69 6e |.X.}.X.X|.X/* win|
|00001920| 64 6f 77 20 72 6f 75 74 | 69 6e 65 2e 20 20 70 65 |dow rout|ine. pe|
|00001930| 72 66 6f 72 6d 73 20 66 | 75 6e 63 74 69 6f 6e 20 |rforms f|unction |
|00001940| 61 73 20 69 6e 64 69 63 | 61 74 65 64 20 62 79 20 |as indic|ated by |
|00001950| 61 72 67 75 6d 65 6e 74 | 09 09 09 09 09 09 2a 2f |argument|......*/|
|00001960| 0a 58 2f 2a 20 57 49 4e | 5f 4f 46 46 3a 09 09 64 |.X/* WIN|_OFF:..d|
|00001970| 69 73 61 62 6c 65 73 20 | 73 70 6c 69 74 2d 73 63 |isables |split-sc|
|00001980| 72 65 65 6e 20 73 63 72 | 6f 6c 6c 69 6e 67 09 09 |reen scr|olling..|
|00001990| 09 09 09 09 09 09 09 09 | 2a 2f 0a 58 2f 2a 20 57 |........|*/.X/* W|
|000019a0| 49 4e 5f 53 55 53 50 3a | 09 64 69 73 61 62 6c 65 |IN_SUSP:|.disable|
|000019b0| 73 20 73 70 6c 69 74 2d | 73 63 72 65 65 6e 20 73 |s split-|screen s|
|000019c0| 63 72 6f 6c 6c 69 6e 67 | 20 74 65 6d 70 6f 72 61 |crolling| tempora|
|000019d0| 72 69 6c 79 09 09 09 09 | 09 09 09 2a 2f 0a 58 2f |rily....|...*/.X/|
|000019e0| 2a 20 57 49 4e 5f 49 4e | 49 54 3a 09 73 65 74 73 |* WIN_IN|IT:.sets|
|000019f0| 20 75 70 20 64 69 73 70 | 6c 61 79 20 73 75 70 70 | up disp|lay supp|
|00001a00| 6f 72 74 20 69 66 20 73 | 70 6c 69 74 2d 73 63 72 |ort if s|plit-scr|
|00001a10| 65 65 6e 20 73 63 72 6f | 6c 6c 69 6e 67 20 65 6e |een scro|lling en|
|00001a20| 61 62 6c 65 64 2c 20 65 | 6c 73 65 20 6e 6f 70 09 |abled, e|lse nop.|
|00001a30| 2a 2f 0a 58 2f 2a 20 57 | 49 4e 5f 52 45 53 55 4d |*/.X/* W|IN_RESUM|
|00001a40| 45 3a 09 72 65 2d 65 6e | 61 62 6c 65 73 20 64 69 |E:.re-en|ables di|
|00001a50| 73 70 6c 61 79 20 73 75 | 70 70 6f 72 74 09 09 09 |splay su|pport...|
|00001a60| 09 09 09 09 09 09 09 09 | 2a 2f 0a 58 2f 2a 20 57 |........|*/.X/* W|
|00001a70| 49 4e 5f 52 45 44 52 41 | 57 3a 09 63 61 75 73 65 |IN_REDRA|W:.cause|
|00001a80| 73 20 77 69 6e 64 6f 77 | 20 74 6f 20 62 65 20 72 |s window| to be r|
|00001a90| 65 64 72 61 77 6e 20 6f | 6e 20 6e 65 78 74 20 72 |edrawn o|n next r|
|00001aa0| 65 66 72 65 73 68 20 63 | 61 6c 6c 09 09 09 09 09 |efresh c|all.....|
|00001ab0| 2a 2f 0a 58 2f 2a 20 57 | 49 4e 5f 52 45 46 52 3a |*/.X/* W|IN_REFR:|
|00001ac0| 09 69 66 20 73 63 72 6f | 6c 6c 69 6e 67 20 65 6e |.if scro|lling en|
|00001ad0| 61 62 6c 65 64 2c 20 72 | 65 64 6f 65 73 20 77 69 |abled, r|edoes wi|
|00001ae0| 6e 64 6f 77 2c 20 65 6c | 73 65 20 69 66 20 65 76 |ndow, el|se if ev|
|00001af0| 20 6f 72 20 65 73 20 65 | 6e 61 62 6c 65 64 2c 20 | or es e|nabled, |
|00001b00| 64 6f 65 73 09 2a 2f 0a | 58 2f 2a 09 09 09 09 74 |does.*/.|X/*....t|
|00001b10| 68 61 74 2c 20 65 6c 73 | 65 20 6e 6f 70 09 09 09 |hat, els|e nop...|
|00001b20| 09 09 09 09 09 09 09 09 | 09 09 09 2a 2f 0a 58 2f |........|...*/.X/|
|00001b30| 2a 20 57 49 4e 5f 4c 49 | 4e 45 3a 09 64 6f 65 73 |* WIN_LI|NE:.does|
|00001b40| 20 57 49 4e 5f 52 45 46 | 52 20 75 6e 6c 65 73 73 | WIN_REF|R unless|
|00001b50| 20 74 68 61 74 20 77 6f | 75 6c 64 6e 27 74 20 64 | that wo|uldn't d|
|00001b60| 6f 20 61 6e 79 74 68 69 | 6e 67 2c 20 69 6e 20 77 |o anythi|ng, in w|
|00001b70| 68 69 63 68 20 63 61 73 | 65 09 09 2a 2f 0a 58 2f |hich cas|e..*/.X/|
|00001b80| 2a 09 09 09 09 69 74 20 | 64 6f 65 73 20 65 66 66 |*....it |does eff|
|00001b90| 65 63 74 69 76 65 20 31 | 45 56 20 6f 75 74 70 75 |ective 1|EV outpu|
|00001ba0| 74 09 09 09 09 09 09 09 | 09 09 09 2a 2f 0a 58 0a |t.......|...*/.X.|
|00001bb0| 58 69 6e 74 20 6c 61 73 | 74 5f 64 6f 74 20 3d 20 |Xint las|t_dot = |
|00001bc0| 2d 31 3b 09 09 09 09 2f | 2a 20 6c 61 73 74 20 64 |-1;..../|* last d|
|00001bd0| 6f 74 20 6c 6f 63 61 74 | 69 6f 6e 20 2a 2f 0a 58 |ot locat|ion */.X|
|00001be0| 0a 58 77 69 6e 64 6f 77 | 28 61 72 67 29 0a 58 09 |.Xwindow|(arg).X.|
|00001bf0| 69 6e 74 20 61 72 67 3b | 0a 58 09 7b 0a 58 09 69 |int arg;|.X.{.X.i|
|00001c00| 6e 74 20 69 3b 0a 58 0a | 58 09 73 77 69 74 63 68 |nt i;.X.|X.switch|
|00001c10| 20 28 61 72 67 29 0a 58 | 09 09 7b 0a 58 09 09 63 | (arg).X|..{.X..c|
|00001c20| 61 73 65 20 57 49 4e 5f | 4f 46 46 3a 09 09 09 09 |ase WIN_|OFF:....|
|00001c30| 2f 2a 20 66 69 6e 61 6c | 20 77 69 6e 64 6f 77 20 |/* final| window |
|00001c40| 6f 66 66 20 2a 2f 0a 58 | 09 09 63 61 73 65 20 57 |off */.X|..case W|
|00001c50| 49 4e 5f 53 55 53 50 3a | 09 09 09 09 2f 2a 20 74 |IN_SUSP:|..../* t|
|00001c60| 65 6d 70 20 77 69 6e 64 | 6f 77 20 6f 66 66 20 2a |emp wind|ow off *|
|00001c70| 2f 0a 58 09 09 09 69 66 | 20 28 57 4e 5f 73 63 72 |/.X...if| (WN_scr|
|00001c80| 6f 6c 6c 29 09 09 09 2f | 2a 20 69 66 20 72 65 73 |oll).../|* if res|
|00001c90| 65 74 2f 63 6c 65 61 6e | 20 75 70 20 2a 2f 0a 58 |et/clean| up */.X|
|00001ca0| 09 09 09 09 7b 0a 58 09 | 09 09 09 2f 2a 20 66 75 |....{.X.|.../* fu|
|00001cb0| 6c 6c 20 6d 61 72 67 69 | 6e 73 2c 20 63 75 72 73 |ll margi|ns, curs|
|00001cc0| 6f 72 20 74 6f 20 6c 61 | 73 74 20 6c 69 6e 65 2c |or to la|st line,|
|00001cd0| 20 65 72 61 73 65 20 6c | 69 6e 65 20 2a 2f 0a 58 | erase l|ine */.X|
|00001ce0| 09 09 09 09 70 72 69 6e | 74 66 28 22 5c 30 33 33 |....prin|tf("\033|
|00001cf0| 5b 72 5c 30 33 33 5b 25 | 64 3b 30 48 5c 30 33 33 |[r\033[%|d;0H\033|
|00001d00| 5b 4b 22 2c 20 57 4e 5f | 68 65 69 67 68 74 29 3b |[K", WN_|height);|
|00001d10| 0a 58 09 09 09 09 7d 0a | 58 09 09 09 62 72 65 61 |.X....}.|X...brea|
|00001d20| 6b 3b 0a 58 0a 58 09 09 | 63 61 73 65 20 57 49 4e |k;.X.X..|case WIN|
|00001d30| 5f 49 4e 49 54 3a 09 09 | 09 09 2f 2a 20 69 6e 69 |_INIT:..|../* ini|
|00001d40| 74 69 61 6c 69 7a 65 20 | 77 69 6e 64 6f 77 20 2d |tialize |window -|
|00001d50| 20 66 69 6e 64 20 6f 75 | 74 70 75 74 20 73 70 65 | find ou|tput spe|
|00001d60| 65 64 20 2a 2f 0a 58 09 | 09 09 69 66 20 28 6f 75 |ed */.X.|..if (ou|
|00001d70| 74 5f 6e 6f 74 65 72 6d | 29 20 77 69 6e 5f 73 70 |t_noterm|) win_sp|
|00001d80| 65 65 64 20 3d 20 30 3b | 09 09 2f 2a 20 73 74 64 |eed = 0;|../* std|
|00001d90| 20 6f 75 74 20 69 73 20 | 6e 6f 74 20 61 20 74 65 | out is |not a te|
|00001da0| 72 6d 69 6e 61 6c 20 2a | 2f 0a 58 09 09 09 65 6c |rminal *|/.X...el|
|00001db0| 73 65 0a 58 09 09 09 09 | 7b 0a 58 09 09 09 09 66 |se.X....|{.X....f|
|00001dc0| 6f 72 20 28 77 69 6e 5f | 73 70 65 65 64 20 3d 20 |or (win_|speed = |
|00001dd0| 31 3b 20 28 77 69 6e 5f | 73 70 65 65 64 73 5b 77 |1; (win_|speeds[w|
|00001de0| 69 6e 5f 73 70 65 65 64 | 5d 20 21 3d 20 74 74 79 |in_speed|] != tty|
|00001df0| 62 75 66 2e 73 67 5f 6f | 73 70 65 65 64 29 20 26 |buf.sg_o|speed) &|
|00001e00| 26 20 28 77 69 6e 5f 73 | 70 65 65 64 20 3c 20 31 |& (win_s|peed < 1|
|00001e10| 33 29 3b 20 77 69 6e 5f | 73 70 65 65 64 2b 2b 29 |3); win_|speed++)|
|00001e20| 3b 0a 58 09 09 09 09 69 | 66 20 28 77 69 6e 5f 73 |;.X....i|f (win_s|
|00001e30| 70 65 65 64 20 3d 3d 20 | 31 33 29 20 77 69 6e 5f |peed == |13) win_|
|00001e40| 73 70 65 65 64 20 3d 20 | 31 3b 0a 58 09 09 09 09 |speed = |1;.X....|
|00001e50| 7d 0a 58 09 09 09 77 5f | 69 6e 69 74 28 29 3b 09 |}.X...w_|init();.|
|00001e60| 09 09 09 2f 2a 20 73 65 | 74 20 75 70 20 73 63 72 |.../* se|t up scr|
|00001e70| 65 65 6e 20 69 6d 61 67 | 65 20 62 75 66 66 65 72 |een imag|e buffer|
|00001e80| 20 2a 2f 0a 58 09 09 09 | 69 66 20 28 57 4e 5f 73 | */.X...|if (WN_s|
|00001e90| 63 72 6f 6c 6c 29 20 76 | 74 28 56 54 5f 43 4c 45 |croll) v|t(VT_CLE|
|00001ea0| 41 52 29 3b 09 09 2f 2a | 20 69 66 20 73 70 6c 69 |AR);../*| if spli|
|00001eb0| 74 2d 73 63 72 65 65 6e | 20 69 73 20 65 6e 61 62 |t-screen| is enab|
|00001ec0| 6c 65 64 2c 20 63 6c 65 | 61 72 20 73 63 72 65 65 |led, cle|ar scree|
|00001ed0| 6e 20 2a 2f 0a 58 09 09 | 09 09 09 09 09 09 09 2f |n */.X..|......./|
|00001ee0| 2a 20 28 66 61 6c 6c 20 | 74 68 72 6f 75 67 68 20 |* (fall |through |
|00001ef0| 74 6f 20 22 72 65 73 75 | 6d 65 22 29 20 2a 2f 0a |to "resu|me") */.|
|00001f00| 58 0a 58 09 09 63 61 73 | 65 20 57 49 4e 5f 52 45 |X.X..cas|e WIN_RE|
|00001f10| 53 55 4d 45 3a 09 09 09 | 2f 2a 20 72 65 2d 65 6e |SUME:...|/* re-en|
|00001f20| 61 62 6c 65 20 77 69 6e | 64 6f 77 20 2a 2f 0a 58 |able win|dow */.X|
|00001f30| 09 09 09 69 66 20 28 57 | 4e 5f 73 63 72 6f 6c 6c |...if (W|N_scroll|
|00001f40| 29 09 09 09 2f 2a 20 73 | 65 74 20 73 63 72 6f 6c |).../* s|et scrol|
|00001f50| 6c 20 72 65 67 69 6f 6e | 2c 20 63 75 72 73 6f 72 |l region|, cursor|
|00001f60| 20 74 6f 20 62 6f 74 74 | 6f 6d 20 2a 2f 0a 58 09 | to bott|om */.X.|
|00001f70| 09 09 09 70 72 69 6e 74 | 66 28 22 5c 30 33 33 5b |...print|f("\033[|
|00001f80| 25 64 3b 25 64 72 5c 30 | 33 33 5b 25 64 3b 30 48 |%d;%dr\0|33[%d;0H|
|00001f90| 22 2c 20 57 4e 5f 68 65 | 69 67 68 74 20 2d 20 57 |", WN_he|ight - W|
|00001fa0| 4e 5f 73 63 72 6f 6c 6c | 20 2b 20 31 2c 20 57 4e |N_scroll| + 1, WN|
|00001fb0| 5f 68 65 69 67 68 74 2c | 20 57 4e 5f 68 65 69 67 |_height,| WN_heig|
|00001fc0| 68 74 29 3b 0a 58 09 09 | 09 62 72 65 61 6b 3b 0a |ht);.X..|.break;.|
|00001fd0| 58 0c 09 09 63 61 73 65 | 20 57 49 4e 5f 52 45 44 |X...case| WIN_RED|
|00001fe0| 52 41 57 3a 09 09 2f 2a | 20 66 6f 72 63 65 20 72 |RAW:../*| force r|
|00001ff0| 65 64 72 61 77 20 6f 66 | 20 77 69 6e 64 6f 77 20 |edraw of| window |
|00002000| 2a 2f 0a 58 09 09 09 72 | 65 64 72 61 77 5f 73 77 |*/.X...r|edraw_sw|
|00002010| 20 3d 20 31 3b 0a 58 09 | 09 09 62 72 65 61 6b 3b | = 1;.X.|..break;|
|00002020| 0a 58 0a 58 09 09 63 61 | 73 65 20 57 49 4e 5f 4c |.X.X..ca|se WIN_L|
|00002030| 49 4e 45 3a 09 09 09 2f | 2a 20 64 69 73 70 6c 61 |INE:.../|* displa|
|00002040| 79 20 6f 6e 65 20 6c 69 | 6e 65 20 75 6e 6c 65 73 |y one li|ne unles|
|00002050| 73 20 77 69 6e 64 6f 77 | 20 65 6e 61 62 6c 65 64 |s window| enabled|
|00002060| 20 6f 72 20 65 76 20 2a | 2f 0a 58 09 09 09 69 66 | or ev *|/.X...if|
|00002070| 20 28 57 4e 5f 73 63 72 | 6f 6c 6c 20 7c 7c 20 65 | (WN_scr|oll || e|
|00002080| 76 5f 76 61 6c 29 20 77 | 69 6e 64 6f 77 28 57 49 |v_val) w|indow(WI|
|00002090| 4e 5f 52 45 46 52 29 3b | 09 09 2f 2a 20 69 66 20 |N_REFR);|../* if |
|000020a0| 61 20 72 65 61 6c 20 77 | 69 6e 64 6f 77 20 69 73 |a real w|indow is|
|000020b0| 20 73 65 74 2c 20 64 6f | 20 69 74 20 2a 2f 0a 58 | set, do| it */.X|
|000020c0| 09 09 09 65 6c 73 65 20 | 69 66 20 28 77 5f 73 65 |...else |if (w_se|
|000020d0| 74 70 74 72 28 64 6f 74 | 2c 20 26 77 5f 70 31 29 |tptr(dot|, &w_p1)|
|000020e0| 29 09 09 2f 2a 20 73 65 | 74 20 70 6f 69 6e 74 65 |)../* se|t pointe|
|000020f0| 72 20 74 6f 20 64 6f 74 | 2e 2e 2e 20 61 6e 64 20 |r to dot|... and |
|00002100| 69 66 20 74 68 65 72 65 | 27 73 20 61 20 62 75 66 |if there|'s a buf|
|00002110| 66 65 72 20 2a 2f 0a 58 | 09 09 09 09 7b 0a 58 09 |fer */.X|....{.X.|
|00002120| 09 09 09 77 5f 6c 69 6e | 65 73 28 30 2c 20 26 77 |...w_lin|es(0, &w|
|00002130| 5f 70 31 2c 20 26 77 5f | 70 31 29 3b 09 09 2f 2a |_p1, &w_|p1);../*|
|00002140| 20 67 65 74 20 74 6f 20 | 62 65 67 69 6e 6e 69 6e | get to |beginnin|
|00002150| 67 20 6f 66 20 6c 69 6e | 65 20 2a 2f 0a 58 09 09 |g of lin|e */.X..|
|00002160| 09 09 77 69 6e 64 6f 77 | 30 28 31 29 3b 09 09 09 |..window|0(1);...|
|00002170| 09 09 09 2f 2a 20 61 6e | 64 20 74 79 70 65 20 31 |.../* an|d type 1|
|00002180| 20 6c 69 6e 65 20 2a 2f | 0a 58 09 09 09 09 7d 0a | line */|.X....}.|
|00002190| 58 09 09 09 62 72 65 61 | 6b 3b 0a 58 0a 58 09 09 |X...brea|k;.X.X..|
|000021a0| 63 61 73 65 20 57 49 4e | 5f 52 45 46 52 3a 09 09 |case WIN|_REFR:..|
|000021b0| 09 2f 2a 20 69 66 20 65 | 6e 61 62 6c 65 64 2c 20 |./* if e|nabled, |
|000021c0| 72 65 66 72 65 73 68 20 | 77 69 6e 64 6f 77 3b 20 |refresh |window; |
|000021d0| 65 6c 73 65 20 64 6f 20 | 65 76 20 6f 72 20 65 73 |else do |ev or es|
|000021e0| 20 2a 2f 0a 58 09 09 09 | 69 66 20 28 57 4e 5f 73 | */.X...|if (WN_s|
|000021f0| 63 72 6f 6c 6c 29 20 77 | 69 6e 64 6f 77 31 28 29 |croll) w|indow1()|
|00002200| 3b 09 09 2f 2a 20 69 66 | 20 73 63 72 6f 6c 6c 69 |;../* if| scrolli|
|00002210| 6e 67 20 65 6e 61 62 6c | 65 64 2c 20 72 65 66 72 |ng enabl|ed, refr|
|00002220| 65 73 68 20 74 68 65 20 | 77 69 6e 64 6f 77 20 2a |esh the |window *|
|00002230| 2f 0a 58 09 09 09 65 6c | 73 65 20 69 66 20 28 28 |/.X...el|se if ((|
|00002240| 65 76 5f 76 61 6c 29 20 | 7c 7c 20 28 65 73 5f 76 |ev_val) ||| (es_v|
|00002250| 61 6c 20 26 26 20 73 65 | 61 72 63 68 5f 66 6c 61 |al && se|arch_fla|
|00002260| 67 29 29 09 2f 2a 20 65 | 6c 73 65 20 69 66 20 65 |g))./* e|lse if e|
|00002270| 76 20 6f 72 20 65 73 2c | 20 64 6f 20 74 68 61 74 |v or es,| do that|
|00002280| 20 2a 2f 0a 58 09 09 09 | 09 7b 0a 58 09 09 09 09 | */.X...|.{.X....|
|00002290| 69 20 3d 20 28 65 76 5f | 76 61 6c 29 20 3f 20 65 |i = (ev_|val) ? e|
|000022a0| 76 5f 76 61 6c 20 3a 20 | 65 73 5f 76 61 6c 3b 0a |v_val : |es_val;.|
|000022b0| 58 09 09 09 09 69 66 20 | 28 77 5f 73 65 74 70 74 |X....if |(w_setpt|
|000022c0| 72 28 64 6f 74 2c 20 26 | 77 5f 70 31 29 29 09 09 |r(dot, &|w_p1))..|
|000022d0| 2f 2a 20 73 65 74 20 61 | 20 70 6f 69 6e 74 65 72 |/* set a| pointer|
|000022e0| 20 61 74 20 64 6f 74 2e | 2e 2e 20 61 6e 64 20 69 | at dot.|.. and i|
|000022f0| 66 20 74 68 65 72 65 27 | 73 20 61 20 62 75 66 66 |f there'|s a buff|
|00002300| 65 72 20 2a 2f 0a 58 09 | 09 09 09 09 77 69 6e 64 |er */.X.|....wind|
|00002310| 6f 77 30 28 69 20 2d 20 | 77 5f 6c 69 6e 65 73 28 |ow0(i - |w_lines(|
|00002320| 31 20 2d 20 69 2c 20 26 | 77 5f 70 31 2c 20 26 77 |1 - i, &|w_p1, &w|
|00002330| 5f 70 31 29 29 3b 09 2f | 2a 20 67 6f 20 62 61 63 |_p1));./|* go bac|
|00002340| 6b 20 28 69 2d 31 29 20 | 6c 69 6e 65 73 20 61 6e |k (i-1) |lines an|
|00002350| 64 20 61 68 65 61 64 20 | 28 69 29 20 6c 69 6e 65 |d ahead |(i) line|
|00002360| 73 20 2a 2f 0a 58 09 09 | 09 09 7d 0a 58 09 09 09 |s */.X..|..}.X...|
|00002370| 62 72 65 61 6b 3b 0a 58 | 0a 58 09 09 63 61 73 65 |break;.X|.X..case|
|00002380| 20 57 49 4e 5f 44 49 53 | 50 3a 09 09 09 09 09 2f | WIN_DIS|P:...../|
|00002390| 2a 20 64 69 73 70 6c 61 | 79 20 62 75 66 66 65 72 |* displa|y buffer|
|000023a0| 20 69 6e 64 65 70 65 6e | 64 65 6e 74 20 6f 66 20 | indepen|dent of |
|000023b0| 77 68 65 74 68 65 72 20 | 73 63 72 6f 6c 6c 20 6d |whether |scroll m|
|000023c0| 6f 64 65 20 69 73 20 65 | 6e 61 62 6c 65 64 20 2a |ode is e|nabled *|
|000023d0| 2f 0a 58 09 09 09 77 69 | 6e 64 6f 77 31 28 29 3b |/.X...wi|ndow1();|
|000023e0| 0a 58 09 09 09 62 72 65 | 61 6b 3b 0a 58 0a 58 09 |.X...bre|ak;.X.X.|
|000023f0| 09 7d 09 09 2f 2a 20 65 | 6e 64 20 6f 66 20 73 77 |.}../* e|nd of sw|
|00002400| 69 74 63 68 20 2a 2f 0a | 58 0a 58 09 66 66 6c 75 |itch */.|X.X.fflu|
|00002410| 73 68 28 73 74 64 6f 75 | 74 29 3b 09 09 09 2f 2a |sh(stdou|t);.../*|
|00002420| 20 73 65 6e 64 20 6f 75 | 74 70 75 74 20 6f 75 74 | send ou|tput out|
|00002430| 20 2a 2f 0a 58 09 7d 09 | 09 09 09 09 2f 2a 20 65 | */.X.}.|..../* e|
|00002440| 6e 64 20 6f 66 20 77 69 | 6e 64 6f 77 28 29 20 2a |nd of wi|ndow() *|
|00002450| 2f 0a 58 0c 2f 2a 20 72 | 6f 75 74 69 6e 65 20 74 |/.X./* r|outine t|
|00002460| 6f 20 74 79 70 65 20 6e | 20 6c 69 6e 65 73 20 77 |o type n| lines w|
|00002470| 69 74 68 20 63 68 61 72 | 61 63 74 65 72 20 61 74 |ith char|acter at|
|00002480| 20 22 64 6f 74 22 20 69 | 6e 20 72 65 76 65 72 73 | "dot" i|n revers|
|00002490| 65 20 76 69 64 65 6f 09 | 09 09 2a 2f 0a 58 2f 2a |e video.|..*/.X/*|
|000024a0| 20 75 73 65 64 20 66 6f | 72 20 65 76 2c 20 65 73 | used fo|r ev, es|
|000024b0| 2c 20 61 6e 64 20 3c 42 | 53 3e 20 6f 72 20 3c 4c |, and <B|S> or <L|
|000024c0| 46 3e 20 61 73 20 69 6d | 6d 65 64 69 61 74 65 20 |F> as im|mediate |
|000024d0| 63 6f 6d 6d 61 6e 64 73 | 09 09 09 09 09 2a 2f 0a |commands|.....*/.|
|000024e0| 58 2f 2a 20 73 74 61 72 | 74 69 6e 67 20 63 68 61 |X/* star|ting cha|
|000024f0| 72 20 70 6f 73 69 74 69 | 6f 6e 20 69 73 20 69 6e |r positi|on is in|
|00002500| 20 77 5f 70 31 3b 20 61 | 72 67 75 6d 65 6e 74 20 | w_p1; a|rgument |
|00002510| 69 73 20 6e 75 6d 62 65 | 72 20 6f 66 20 6c 69 6e |is numbe|r of lin|
|00002520| 65 73 09 09 09 2a 2f 0a | 58 0a 58 77 69 6e 64 6f |es...*/.|X.Xwindo|
|00002530| 77 30 28 6e 75 6d 29 0a | 58 09 69 6e 74 20 6e 75 |w0(num).|X.int nu|
|00002540| 6d 3b 0a 58 09 7b 0a 58 | 09 69 6e 74 20 77 69 3b |m;.X.{.X|.int wi;|
|00002550| 0a 58 09 63 68 61 72 20 | 77 63 3b 09 09 09 2f 2a |.X.char |wc;.../*|
|00002560| 20 74 65 6d 70 20 63 68 | 61 72 20 2a 2f 0a 58 0a | temp ch|ar */.X.|
|00002570| 58 09 66 6f 72 20 28 77 | 69 20 3d 20 77 5f 70 31 |X.for (w|i = w_p1|
|00002580| 2e 64 6f 74 3b 20 28 6e | 75 6d 20 3e 20 30 29 20 |.dot; (n|um > 0) |
|00002590| 26 26 20 28 77 69 20 3c | 20 7a 29 3b 20 77 69 2b |&& (wi <| z); wi+|
|000025a0| 2b 29 09 09 2f 2a 20 66 | 6f 72 20 65 61 63 68 20 |+)../* f|or each |
|000025b0| 63 68 61 72 61 63 74 65 | 72 20 2a 2f 0a 58 09 09 |characte|r */.X..|
|000025c0| 7b 0a 58 09 09 77 63 20 | 3d 20 77 5f 70 31 2e 70 |{.X..wc |= w_p1.p|
|000025d0| 2d 3e 63 68 5b 77 5f 70 | 31 2e 63 5d 3b 09 09 2f |->ch[w_p|1.c];../|
|000025e0| 2a 20 67 65 74 20 63 68 | 61 72 61 63 74 65 72 20 |* get ch|aracter |
|000025f0| 2a 2f 0a 58 0a 58 09 09 | 69 66 20 28 28 63 68 61 |*/.X.X..|if ((cha|
|00002600| 72 5f 63 6f 75 6e 74 20 | 3e 3d 20 57 4e 5f 77 69 |r_count |>= WN_wi|
|00002610| 64 74 68 29 20 26 26 20 | 28 77 63 20 21 3d 20 43 |dth) && |(wc != C|
|00002620| 52 29 20 26 26 20 21 28 | 73 70 65 63 5f 63 68 61 |R) && !(|spec_cha|
|00002630| 72 73 5b 77 63 5d 20 26 | 20 41 5f 4c 29 29 09 2f |rs[wc] &| A_L))./|
|00002640| 2a 20 69 66 20 61 62 6f | 75 74 20 74 6f 20 65 78 |* if abo|ut to ex|
|00002650| 63 65 65 64 20 77 69 64 | 74 68 20 2a 2f 0a 58 09 |ceed wid|th */.X.|
|00002660| 09 09 7b 0a 58 09 09 09 | 69 66 20 28 65 74 5f 76 |..{.X...|if (et_v|
|00002670| 61 6c 20 26 20 45 54 5f | 54 52 55 4e 43 29 20 67 |al & ET_|TRUNC) g|
|00002680| 6f 74 6f 20 77 30 5f 6e | 6f 70 72 69 6e 74 3b 09 |oto w0_n|oprint;.|
|00002690| 09 09 2f 2a 20 74 72 75 | 6e 63 61 74 65 3a 20 64 |../* tru|ncate: d|
|000026a0| 6f 6e 27 74 20 70 72 69 | 6e 74 20 74 68 69 73 20 |on't pri|nt this |
|000026b0| 2a 2f 0a 58 09 09 09 65 | 6c 73 65 0a 58 09 09 09 |*/.X...e|lse.X...|
|000026c0| 09 7b 0a 58 09 09 09 09 | 66 70 75 74 73 28 22 5c |.{.X....|fputs("\|
|000026d0| 30 33 33 5b 4b 5c 30 31 | 35 5c 30 31 32 5c 30 33 |033[K\01|5\012\03|
|000026e0| 33 28 30 68 5c 30 33 33 | 28 42 20 22 2c 20 73 74 |3(0h\033|(B ", st|
|000026f0| 64 6f 75 74 29 3b 09 2f | 2a 20 3c 65 65 6f 6c 3e |dout);./|* <eeol>|
|00002700| 20 22 4e 4c 20 73 70 61 | 63 65 22 20 2a 2f 0a 58 | "NL spa|ce" */.X|
|00002710| 09 09 09 09 63 68 61 72 | 5f 63 6f 75 6e 74 20 3d |....char|_count =|
|00002720| 20 32 3b 0a 58 09 09 09 | 09 2d 2d 6e 75 6d 3b 09 | 2;.X...|.--num;.|
|00002730| 09 09 09 09 2f 2a 20 6f | 6e 65 20 66 65 77 65 72 |..../* o|ne fewer|
|00002740| 20 6c 69 6e 65 20 72 65 | 6d 61 69 6e 69 6e 67 20 | line re|maining |
|00002750| 2a 2f 0a 58 09 09 09 09 | 7d 0a 58 09 09 09 7d 0a |*/.X....|}.X...}.|
|00002760| 58 0a 58 09 09 69 66 20 | 28 77 69 20 3d 3d 20 64 |X.X..if |(wi == d|
|00002770| 6f 74 29 09 09 09 09 09 | 2f 2a 20 69 66 20 74 68 |ot).....|/* if th|
|00002780| 69 73 20 63 68 61 72 20 | 69 73 20 61 74 20 74 68 |is char |is at th|
|00002790| 65 20 70 6f 69 6e 74 65 | 72 20 2a 2f 0a 58 09 09 |e pointe|r */.X..|
|000027a0| 09 7b 0a 58 09 09 09 76 | 74 28 56 54 5f 53 45 54 |.{.X...v|t(VT_SET|
|000027b0| 53 50 45 43 32 29 3b 09 | 09 09 2f 2a 20 73 65 74 |SPEC2);.|../* set|
|000027c0| 20 72 65 76 65 72 73 65 | 20 76 69 64 65 6f 20 2a | reverse| video *|
|000027d0| 2f 0a 58 09 09 09 69 66 | 20 28 77 63 20 3d 3d 20 |/.X...if| (wc == |
|000027e0| 54 41 42 29 0a 58 09 09 | 09 09 7b 0a 58 09 09 09 |TAB).X..|..{.X...|
|000027f0| 09 74 79 70 65 5f 63 68 | 61 72 28 27 20 27 29 3b |.type_ch|ar(' ');|
|00002800| 09 09 2f 2a 20 69 6c 6c | 75 6d 69 6e 61 74 65 20 |../* ill|uminate |
|00002810| 74 68 65 20 66 69 72 73 | 74 20 73 70 20 6f 66 20 |the firs|t sp of |
|00002820| 61 20 74 61 62 20 2a 2f | 0a 58 09 09 09 09 76 74 |a tab */|.X....vt|
|00002830| 28 56 54 5f 43 4c 52 53 | 50 45 43 29 3b 09 09 2f |(VT_CLRS|PEC);../|
|00002840| 2a 20 63 6c 65 61 72 20 | 72 65 76 65 72 73 65 20 |* clear |reverse |
|00002850| 76 69 64 65 6f 20 2a 2f | 0a 58 09 09 09 09 69 66 |video */|.X....if|
|00002860| 20 28 63 68 61 72 5f 63 | 6f 75 6e 74 20 26 20 74 | (char_c|ount & t|
|00002870| 61 62 6d 61 73 6b 29 20 | 74 79 70 65 5f 63 68 61 |abmask) |type_cha|
|00002880| 72 28 54 41 42 29 3b 0a | 58 09 09 09 09 7d 0a 58 |r(TAB);.|X....}.X|
|00002890| 09 09 09 65 6c 73 65 09 | 09 09 09 09 09 2f 2a 20 |...else.|...../* |
|000028a0| 6e 6f 74 20 61 20 74 61 | 62 20 2a 2f 0a 58 09 09 |not a ta|b */.X..|
|000028b0| 09 09 7b 0a 58 09 09 09 | 09 69 66 20 28 28 77 63 |..{.X...|.if ((wc|
|000028c0| 20 3d 3d 20 43 52 29 20 | 26 26 20 28 63 68 61 72 | == CR) |&& (char|
|000028d0| 5f 63 6f 75 6e 74 20 3c | 20 57 4e 5f 77 69 64 74 |_count <| WN_widt|
|000028e0| 68 29 29 09 2f 2a 20 43 | 52 20 61 74 20 72 68 20 |h))./* C|R at rh |
|000028f0| 6d 61 72 67 69 6e 3a 20 | 64 6f 6e 27 74 20 64 69 |margin: |don't di|
|00002900| 73 70 6c 61 79 20 63 75 | 72 73 6f 72 20 2a 2f 0a |splay cu|rsor */.|
|00002910| 58 09 09 09 09 09 7b 0a | 58 09 09 09 09 09 74 79 |X.....{.|X.....ty|
|00002920| 70 65 5f 63 68 61 72 28 | 27 20 27 29 3b 09 09 2f |pe_char(|' ');../|
|00002930| 2a 20 63 72 3a 20 70 75 | 74 20 61 20 73 70 61 63 |* cr: pu|t a spac|
|00002940| 65 20 61 66 74 65 72 20 | 6c 69 6e 65 20 2a 2f 0a |e after |line */.|
|00002950| 58 09 09 09 09 09 76 74 | 28 56 54 5f 45 45 4f 4c |X.....vt|(VT_EEOL|
|00002960| 29 3b 09 09 2f 2a 20 65 | 72 61 73 65 20 74 6f 20 |);../* e|rase to |
|00002970| 65 6f 6c 20 2a 2f 0a 58 | 09 09 09 09 09 7d 0a 58 |eol */.X|.....}.X|
|00002980| 09 09 09 09 74 79 70 65 | 5f 63 68 61 72 28 77 63 |....type|_char(wc|
|00002990| 29 3b 09 09 09 2f 2a 20 | 74 79 70 65 20 74 68 65 |);.../* |type the|
|000029a0| 20 63 68 61 72 2c 20 6f | 72 20 65 78 65 63 20 43 | char, o|r exec C|
|000029b0| 52 20 2a 2f 0a 58 09 09 | 09 09 69 66 20 28 77 63 |R */.X..|..if (wc|
|000029c0| 20 3d 3d 20 4c 46 29 0a | 58 09 09 09 09 09 7b 0a | == LF).|X.....{.|
|000029d0| 58 09 09 09 09 09 66 70 | 75 74 73 28 22 5c 30 33 |X.....fp|uts("\03|
|000029e0| 33 28 30 22 2c 20 73 74 | 64 6f 75 74 29 3b 0a 58 |3(0", st|dout);.X|
|000029f0| 09 09 09 09 09 74 79 70 | 65 5f 63 68 61 72 28 27 |.....typ|e_char('|
|00002a00| 65 27 29 3b 0a 58 09 09 | 09 09 09 66 70 75 74 73 |e');.X..|...fputs|
|00002a10| 28 22 5c 30 33 33 28 42 | 22 2c 20 73 74 64 6f 75 |("\033(B|", stdou|
|00002a20| 74 29 3b 0a 58 09 09 09 | 09 09 7d 0a 58 09 09 09 |t);.X...|..}.X...|
|00002a30| 09 76 74 28 56 54 5f 43 | 4c 52 53 50 45 43 29 3b |.vt(VT_C|LRSPEC);|
|00002a40| 09 09 2f 2a 20 63 6c 65 | 61 72 20 72 65 76 65 72 |../* cle|ar rever|
|00002a50| 73 65 20 76 69 64 65 6f | 20 2a 2f 0a 58 09 09 09 |se video| */.X...|
|00002a60| 09 7d 0a 58 09 09 09 7d | 0a 58 0c 09 09 65 6c 73 |.}.X...}|.X...els|
|00002a70| 65 09 09 09 09 09 2f 2a | 20 74 68 69 73 20 69 73 |e...../*| this is|
|00002a80| 20 6e 6f 74 20 63 68 61 | 72 20 61 74 20 70 6f 69 | not cha|r at poi|
|00002a90| 6e 74 65 72 20 2a 2f 0a | 58 09 09 09 7b 0a 58 09 |nter */.|X...{.X.|
|00002aa0| 09 09 69 66 20 28 77 63 | 20 3d 3d 20 43 52 20 26 |..if (wc| == CR &|
|00002ab0| 26 20 63 75 72 72 5f 78 | 20 3c 20 57 4e 5f 77 69 |& curr_x| < WN_wi|
|00002ac0| 64 74 68 29 20 76 74 28 | 56 54 5f 45 45 4f 4c 29 |dth) vt(|VT_EEOL)|
|00002ad0| 3b 09 09 2f 2a 20 65 72 | 61 73 65 20 74 6f 20 45 |;../* er|ase to E|
|00002ae0| 4f 4c 20 2a 2f 0a 58 09 | 09 09 74 79 70 65 5f 63 |OL */.X.|..type_c|
|00002af0| 68 61 72 28 77 63 29 3b | 0a 58 09 09 09 7d 0a 58 |har(wc);|.X...}.X|
|00002b00| 09 09 69 66 20 28 28 77 | 63 20 3d 3d 20 46 46 29 |..if ((w|c == FF)|
|00002b10| 20 7c 7c 20 28 77 63 20 | 3d 3d 20 56 54 29 29 09 | || (wc |== VT)).|
|00002b20| 09 2f 2a 20 46 46 20 26 | 20 56 54 20 65 6e 64 20 |./* FF &| VT end |
|00002b30| 61 20 6c 69 6e 65 20 2a | 2f 0a 58 09 09 09 7b 0a |a line *|/.X...{.|
|00002b40| 58 09 09 09 76 74 28 56 | 54 5f 45 45 4f 4c 29 3b |X...vt(V|T_EEOL);|
|00002b50| 09 09 09 2f 2a 20 65 72 | 61 73 65 20 72 65 73 74 |.../* er|ase rest|
|00002b60| 20 6f 66 20 74 68 69 73 | 20 6c 69 6e 65 20 2a 2f | of this| line */|
|00002b70| 0a 58 09 09 09 63 72 6c | 66 28 29 3b 09 09 09 09 |.X...crl|f();....|
|00002b80| 09 2f 2a 20 61 6e 64 20 | 6c 65 61 76 65 20 61 20 |./* and |leave a |
|00002b90| 62 6c 61 6e 6b 20 6f 6e | 65 20 2a 2f 0a 58 09 09 |blank on|e */.X..|
|00002ba0| 09 69 66 20 28 21 28 65 | 7a 5f 76 61 6c 20 26 20 |.if (!(e|z_val & |
|00002bb0| 45 5a 5f 4e 4f 56 54 46 | 46 29 29 20 2d 2d 6e 75 |EZ_NOVTF|F)) --nu|
|00002bc0| 6d 3b 09 09 2f 2a 20 69 | 66 20 46 46 20 61 6e 64 |m;../* i|f FF and|
|00002bd0| 20 56 54 20 63 6f 75 6e | 74 20 61 73 20 6c 69 6e | VT coun|t as lin|
|00002be0| 65 20 73 65 70 27 73 2c | 20 63 6f 75 6e 74 20 74 |e sep's,| count t|
|00002bf0| 68 65 6d 20 2a 2f 0a 58 | 09 09 09 7d 0a 58 0a 58 |hem */.X|...}.X.X|
|00002c00| 09 20 20 77 30 5f 6e 6f | 70 72 69 6e 74 3a 0a 58 |. w0_no|print:.X|
|00002c10| 09 09 69 66 20 28 2b 2b | 77 5f 70 31 2e 63 20 3e |..if (++|w_p1.c >|
|00002c20| 20 43 45 4c 4c 53 49 5a | 45 2d 31 29 20 77 5f 70 | CELLSIZ|E-1) w_p|
|00002c30| 31 2e 70 20 3d 20 77 5f | 70 31 2e 70 2d 3e 66 2c |1.p = w_|p1.p->f,|
|00002c40| 20 77 5f 70 31 2e 63 20 | 3d 20 30 3b 09 2f 2a 20 | w_p1.c |= 0;./* |
|00002c50| 6e 65 78 74 20 63 68 61 | 72 20 2a 2f 0a 58 09 09 |next cha|r */.X..|
|00002c60| 69 66 20 28 77 63 20 3d | 3d 20 4c 46 29 20 2d 2d |if (wc =|= LF) --|
|00002c70| 6e 75 6d 3b 09 2f 2a 20 | 69 66 20 74 68 69 73 20 |num;./* |if this |
|00002c80| 69 73 20 61 20 6c 69 6e | 65 20 66 65 65 64 2c 20 |is a lin|e feed, |
|00002c90| 63 6f 75 6e 74 20 6c 69 | 6e 65 73 20 2a 2f 0a 58 |count li|nes */.X|
|00002ca0| 09 09 7d 0a 58 0a 58 09 | 69 66 20 28 64 6f 74 20 |..}.X.X.|if (dot |
|00002cb0| 3d 3d 20 7a 29 20 66 70 | 75 74 73 28 22 5c 30 33 |== z) fp|uts("\03|
|00002cc0| 33 5b 31 3b 37 6d 20 5c | 30 33 33 5b 30 6d 5c 30 |3[1;7m \|033[0m\0|
|00002cd0| 33 33 5b 30 4b 22 2c 20 | 73 74 64 6f 75 74 29 3b |33[0K", |stdout);|
|00002ce0| 09 2f 2a 20 74 79 70 65 | 20 6f 6e 65 20 73 70 61 |./* type| one spa|
|00002cf0| 63 65 20 61 6e 64 20 65 | 72 61 73 65 20 72 65 73 |ce and e|rase res|
|00002d00| 74 20 6f 66 20 6c 69 6e | 65 20 2a 2f 0a 58 09 65 |t of lin|e */.X.e|
|00002d10| 6c 73 65 20 66 70 75 74 | 73 28 22 5c 30 33 33 5b |lse fput|s("\033[|
|00002d20| 30 4b 22 2c 20 73 74 64 | 6f 75 74 29 3b 09 09 09 |0K", std|out);...|
|00002d30| 2f 2a 20 65 6c 73 65 20 | 6a 75 73 74 20 65 72 61 |/* else |just era|
|00002d40| 73 65 20 74 6f 20 45 4f | 4c 20 2a 2f 0a 58 09 7d |se to EO|L */.X.}|
|00002d50| 0a 58 0c 2f 2a 20 72 6f | 75 74 69 6e 65 20 74 6f |.X./* ro|utine to|
|00002d60| 20 6d 61 69 6e 74 61 69 | 6e 20 74 68 65 20 73 63 | maintai|n the sc|
|00002d70| 72 65 65 6e 20 77 69 6e | 64 6f 77 09 09 09 09 09 |reen win|dow.....|
|00002d80| 09 09 09 09 09 2a 2f 0a | 58 2f 2a 20 69 66 20 73 |.....*/.|X/* if s|
|00002d90| 63 72 6f 6c 6c 20 6d 6f | 64 65 20 69 73 20 65 6e |croll mo|de is en|
|00002da0| 61 62 6c 65 64 2c 20 74 | 68 65 20 56 54 31 30 30 |abled, t|he VT100|
|00002db0| 20 73 63 72 65 65 6e 20 | 69 73 20 73 70 6c 69 74 | screen |is split|
|00002dc0| 20 61 6e 64 20 6f 6e 6c | 79 20 74 68 65 20 75 70 | and onl|y the up|
|00002dd0| 70 65 72 20 70 61 72 74 | 20 2a 2f 0a 58 2f 2a 20 |per part| */.X/* |
|00002de0| 69 73 20 75 73 65 64 20 | 62 79 20 74 68 69 73 20 |is used |by this |
|00002df0| 72 6f 75 74 69 6e 65 3b | 20 65 6c 73 65 20 74 68 |routine;| else th|
|00002e00| 65 20 77 68 6f 6c 65 20 | 73 63 72 65 65 6e 20 69 |e whole |screen i|
|00002e10| 73 20 75 73 65 64 2e 09 | 09 09 09 09 09 2a 2f 0a |s used..|.....*/.|
|00002e20| 58 0a 58 77 69 6e 64 6f | 77 31 28 29 0a 58 09 7b |X.Xwindo|w1().X.{|
|00002e30| 0a 58 09 69 6e 74 20 69 | 2c 20 6a 2c 20 6d 2c 20 |.X.int i|, j, m, |
|00002e40| 6c 66 6c 61 67 3b 0a 58 | 0a 58 09 69 66 20 28 21 |lflag;.X|.X.if (!|
|00002e50| 72 65 64 72 61 77 5f 73 | 77 20 26 26 20 28 64 6f |redraw_s|w && (do|
|00002e60| 74 20 3d 3d 20 6c 61 73 | 74 5f 64 6f 74 29 20 26 |t == las|t_dot) &|
|00002e70| 26 20 28 62 75 66 66 5f | 6d 6f 64 20 3d 3d 20 4d |& (buff_|mod == M|
|00002e80| 41 58 29 29 20 72 65 74 | 75 72 6e 3b 09 09 2f 2a |AX)) ret|urn;../*|
|00002e90| 20 72 65 74 75 72 6e 20 | 69 66 20 6e 6f 74 68 69 | return |if nothi|
|00002ea0| 6e 67 20 68 61 73 20 63 | 68 61 6e 67 65 64 20 2a |ng has c|hanged *|
|00002eb0| 2f 0a 58 0a 58 09 62 6c | 6f 63 6b 5f 69 6e 74 65 |/.X.X.bl|ock_inte|
|00002ec0| 72 28 31 29 3b 09 09 09 | 09 09 09 09 2f 2a 20 64 |r(1);...|..../* d|
|00002ed0| 69 73 61 62 6c 65 20 5e | 43 20 69 6e 74 65 72 72 |isable ^|C interr|
|00002ee0| 75 70 74 73 20 2a 2f 0a | 58 09 69 66 20 28 57 4e |upts */.|X.if (WN|
|00002ef0| 5f 73 63 72 6f 6c 6c 29 | 20 70 72 69 6e 74 66 28 |_scroll)| printf(|
|00002f00| 22 5c 30 33 33 5b 31 3b | 25 64 72 22 2c 20 77 69 |"\033[1;|%dr", wi|
|00002f10| 6e 64 6f 77 5f 73 69 7a | 65 29 3b 09 09 2f 2a 20 |ndow_siz|e);../* |
|00002f20| 73 63 72 6f 6c 6c 20 6d | 6f 64 65 3a 20 72 65 64 |scroll m|ode: red|
|00002f30| 65 66 69 6e 65 20 73 63 | 72 6f 6c 6c 20 72 65 67 |efine sc|roll reg|
|00002f40| 69 6f 6e 20 2a 2f 0a 58 | 09 70 72 69 6e 74 66 28 |ion */.X|.printf(|
|00002f50| 22 5c 30 33 33 5b 48 22 | 29 3b 09 09 09 09 09 09 |"\033[H"|);......|
|00002f60| 2f 2a 20 68 6f 6d 65 20 | 2a 2f 0a 58 09 74 65 72 |/* home |*/.X.ter|
|00002f70| 6d 5f 79 20 3d 20 74 65 | 72 6d 5f 78 20 3d 20 30 |m_y = te|rm_x = 0|
|00002f80| 3b 09 09 09 09 09 2f 2a | 20 69 6e 64 69 63 61 74 |;...../*| indicat|
|00002f90| 65 20 63 75 72 73 6f 72 | 20 69 73 20 61 74 20 68 |e cursor| is at h|
|00002fa0| 6f 6d 65 20 2a 2f 0a 58 | 0a 58 09 69 66 20 28 28 |ome */.X|.X.if ((|
|00002fb0| 72 65 64 72 61 77 5f 73 | 77 29 20 7c 7c 20 28 7a |redraw_s|w) || (z|
|00002fc0| 20 3c 3d 20 77 6c 70 5b | 30 5d 2d 3e 73 74 61 72 | <= wlp[|0]->star|
|00002fd0| 74 29 29 20 77 69 6e 64 | 6f 77 31 5f 61 62 73 28 |t)) wind|ow1_abs(|
|00002fe0| 29 3b 09 09 2f 2a 20 66 | 6f 72 63 65 64 20 72 65 |);../* f|orced re|
|00002ff0| 64 72 61 77 2c 20 6f 72 | 20 7a 20 62 65 66 6f 72 |draw, or| z befor|
|00003000| 65 20 73 74 61 72 74 20 | 6f 66 20 73 63 72 65 65 |e start |of scree|
|00003010| 6e 20 2a 2f 0a 58 0a 58 | 0a 58 2f 2a 20 63 68 65 |n */.X.X|.X/* che|
|00003020| 63 6b 20 77 68 65 74 68 | 65 72 20 70 6f 69 6e 74 |ck wheth|er point|
|00003030| 65 72 20 69 73 20 62 65 | 66 6f 72 65 20 6d 6f 64 |er is be|fore mod|
|00003040| 69 66 69 65 64 20 62 75 | 66 66 65 72 20 6c 6f 63 |ified bu|ffer loc|
|00003050| 61 74 69 6f 6e 20 2a 2f | 0a 58 0a 58 09 65 6c 73 |ation */|.X.X.els|
|00003060| 65 20 69 66 20 28 62 75 | 66 66 5f 6d 6f 64 20 3e |e if (bu|ff_mod >|
|00003070| 3d 20 64 6f 74 29 09 2f | 2a 20 79 65 73 20 2a 2f |= dot)./|* yes */|
|00003080| 0a 58 09 09 7b 0a 58 0a | 58 09 09 69 66 20 28 64 |.X..{.X.|X..if (d|
|00003090| 6f 74 20 3c 20 77 6c 70 | 5b 30 5d 2d 3e 73 74 61 |ot < wlp|[0]->sta|
|000030a0| 72 74 29 09 09 09 2f 2a | 20 69 66 20 64 6f 74 20 |rt).../*| if dot |
|000030b0| 69 73 20 62 65 66 6f 72 | 65 20 73 63 72 65 65 6e |is befor|e screen|
|000030c0| 20 2a 2f 0a 58 09 09 09 | 7b 0a 58 09 09 09 77 5f | */.X...|{.X...w_|
|000030d0| 73 65 74 70 74 72 28 77 | 6c 70 5b 30 5d 2d 3e 73 |setptr(w|lp[0]->s|
|000030e0| 74 61 72 74 2c 20 26 77 | 5f 70 31 29 3b 09 2f 2a |tart, &w|_p1);./*|
|000030f0| 20 67 65 74 20 74 6f 20 | 62 65 67 69 6e 6e 69 6e | get to |beginnin|
|00003100| 67 20 6f 66 20 73 63 72 | 65 65 6e 20 2a 2f 0a 58 |g of scr|een */.X|
|00003110| 0a 58 09 09 2f 2a 20 63 | 68 65 63 6b 20 77 68 65 |.X../* c|heck whe|
|00003120| 74 68 65 72 20 73 63 72 | 65 65 6e 20 62 65 67 69 |ther scr|een begi|
|00003130| 6e 73 20 77 69 74 68 20 | 74 68 65 20 6c 61 73 74 |ns with |the last|
|00003140| 20 70 61 72 74 20 6f 66 | 20 61 20 63 6f 6e 74 69 | part of| a conti|
|00003150| 6e 75 65 64 20 6c 69 6e | 65 20 2a 2f 0a 58 09 09 |nued lin|e */.X..|
|00003160| 09 66 6f 72 20 28 6a 20 | 3d 20 30 3b 20 28 77 6c |.for (j |= 0; (wl|
|00003170| 70 5b 6a 5d 2d 3e 63 66 | 6c 61 67 20 26 20 57 46 |p[j]->cf|lag & WF|
|00003180| 5f 43 4f 4e 54 29 20 26 | 26 20 28 6a 20 3c 20 77 |_CONT) &|& (j < w|
|00003190| 69 6e 64 6f 77 5f 73 69 | 7a 65 2f 32 29 3b 20 6a |indow_si|ze/2); j|
|000031a0| 2b 2b 29 3b 0a 58 09 09 | 09 69 66 20 28 6a 20 3c |++);.X..|.if (j <|
|000031b0| 20 77 69 6e 64 6f 77 5f | 73 69 7a 65 2f 32 29 09 | window_|size/2).|
|000031c0| 09 09 2f 2a 20 69 66 20 | 73 6f 2c 20 64 6f 65 73 |../* if |so, does|
|000031d0| 20 69 74 20 63 6f 6e 74 | 69 6e 75 65 20 6c 65 73 | it cont|inue les|
|000031e0| 73 20 74 68 61 6e 20 68 | 61 6c 66 77 61 79 20 64 |s than h|alfway d|
|000031f0| 6f 77 6e 20 74 68 65 20 | 73 63 72 65 65 6e 3f 20 |own the |screen? |
|00003200| 2a 2f 0a 58 09 09 09 09 | 7b 0a 58 0a 58 09 09 09 |*/.X....|{.X.X...|
|00003210| 09 69 66 20 28 6a 29 09 | 09 09 09 09 09 2f 2a 20 |.if (j).|...../* |
|00003220| 69 73 20 74 68 65 72 65 | 20 61 20 70 61 72 74 69 |is there| a parti|
|00003230| 61 6c 20 6c 69 6e 65 3f | 20 2a 2f 0a 58 09 09 09 |al line?| */.X...|
|00003240| 09 09 7b 0a 58 09 09 09 | 09 09 77 5f 6c 69 6e 65 |..{.X...|..w_line|
|00003250| 73 28 30 2c 20 26 77 5f | 70 31 2c 20 26 77 5f 70 |s(0, &w_|p1, &w_p|
|00003260| 31 29 3b 09 09 2f 2a 20 | 30 4c 20 2a 2f 0a 58 09 |1);../* |0L */.X.|
|00003270| 09 09 09 09 6a 20 2d 3d | 20 77 5f 6c 69 6e 65 73 |....j -=| w_lines|
|00003280| 28 31 2c 20 26 77 5f 70 | 31 2c 20 4e 55 4c 4c 29 |(1, &w_p|1, NULL)|
|00003290| 3b 09 09 2f 2a 20 6e 6f | 77 20 6a 20 69 73 20 6e |;../* no|w j is n|
|000032a0| 75 6d 62 65 72 20 6f 66 | 20 64 69 73 70 6c 61 79 |umber of| display|
|000032b0| 20 6c 69 6e 65 73 20 62 | 65 66 6f 72 65 20 73 63 | lines b|efore sc|
|000032c0| 72 65 65 6e 20 2a 2f 0a | 58 09 09 09 09 09 7d 0a |reen */.|X.....}.|
|000032d0| 58 0c 09 09 2f 2a 20 6e | 6f 77 20 6c 6f 6f 6b 20 |X.../* n|ow look |
|000032e0| 66 6f 72 20 68 6f 77 20 | 6d 61 6e 79 20 6c 69 6e |for how |many lin|
|000032f0| 65 73 20 62 61 63 6b 20 | 22 64 6f 74 22 20 69 73 |es back |"dot" is|
|00003300| 3a 20 69 66 20 73 63 72 | 65 65 6e 20 73 74 61 72 |: if scr|een star|
|00003310| 74 73 20 77 69 74 68 20 | 70 61 72 74 69 61 6c 20 |ts with |partial |
|00003320| 6c 69 6e 65 2c 20 77 5f | 70 31 20 68 61 73 20 61 |line, w_|p1 has a|
|00003330| 6c 72 65 61 64 79 20 62 | 65 65 6e 20 6d 6f 76 65 |lready b|een move|
|00003340| 64 20 2a 2f 0a 58 09 09 | 2f 2a 20 74 6f 20 62 65 |d */.X..|/* to be|
|00003350| 67 69 6e 6e 69 6e 67 20 | 6f 66 20 74 68 65 20 6c |ginning |of the l|
|00003360| 69 6e 65 20 61 6e 64 20 | 6a 20 65 71 75 61 6c 73 |ine and |j equals|
|00003370| 20 74 68 65 20 63 6f 75 | 6e 74 20 6f 66 20 65 78 | the cou|nt of ex|
|00003380| 74 72 61 20 6c 69 6e 65 | 73 20 74 6f 20 73 63 72 |tra line|s to scr|
|00003390| 6f 6c 6c 20 2a 2f 0a 58 | 0a 58 09 09 09 09 66 6f |oll */.X|.X....fo|
|000033a0| 72 20 28 69 20 3d 20 30 | 3b 20 28 64 6f 74 20 3c |r (i = 0|; (dot <|
|000033b0| 20 77 5f 70 31 2e 64 6f | 74 29 20 26 26 20 28 69 | w_p1.do|t) && (i|
|000033c0| 20 3c 20 77 69 6e 64 6f | 77 5f 73 69 7a 65 2f 32 | < windo|w_size/2|
|000033d0| 29 3b 20 29 20 69 20 2d | 3d 20 77 5f 6c 69 6e 65 |); ) i -|= w_line|
|000033e0| 73 28 2d 31 2c 20 26 77 | 5f 70 31 2c 20 26 77 5f |s(-1, &w|_p1, &w_|
|000033f0| 70 31 29 3b 0a 58 09 09 | 09 09 69 66 20 28 28 64 |p1);.X..|..if ((d|
|00003400| 6f 74 20 3e 3d 20 77 5f | 70 31 2e 64 6f 74 29 20 |ot >= w_|p1.dot) |
|00003410| 26 26 20 28 69 20 3c 20 | 77 69 6e 64 6f 77 5f 73 |&& (i < |window_s|
|00003420| 69 7a 65 29 29 09 09 09 | 2f 2a 20 66 6f 75 6e 64 |ize))...|/* found|
|00003430| 20 70 6f 69 6e 74 20 77 | 69 74 68 69 6e 20 72 65 | point w|ithin re|
|00003440| 61 73 6f 6e 20 2a 2f 0a | 58 09 09 09 09 09 7b 0a |ason */.|X.....{.|
|00003450| 58 09 09 09 09 09 77 5f | 73 63 72 6f 6c 6c 28 6a |X.....w_|scroll(j|
|00003460| 20 2d 20 69 29 3b 09 09 | 09 2f 2a 20 73 63 72 6f | - i);..|./* scro|
|00003470| 6c 6c 20 73 63 72 65 65 | 6e 20 64 6f 77 6e 20 74 |ll scree|n down t|
|00003480| 68 61 74 20 6d 61 6e 79 | 20 6c 69 6e 65 73 20 2a |hat many| lines *|
|00003490| 2f 0a 58 09 09 09 09 09 | 63 75 72 72 5f 79 20 3d |/.X.....|curr_y =|
|000034a0| 20 77 6c 70 5b 30 5d 2d | 3e 63 66 6c 61 67 20 3d | wlp[0]-|>cflag =|
|000034b0| 20 77 6c 70 5b 30 5d 2d | 3e 63 6f 6c 20 3d 20 63 | wlp[0]-|>col = c|
|000034c0| 75 72 72 5f 78 20 3d 20 | 30 3b 09 09 2f 2a 20 73 |urr_x = |0;../* s|
|000034d0| 74 61 72 74 20 66 72 6f | 6d 20 74 6f 70 20 6f 66 |tart fro|m top of|
|000034e0| 20 73 63 72 65 65 6e 20 | 2a 2f 0a 58 09 09 09 09 | screen |*/.X....|
|000034f0| 09 77 6c 70 5b 30 5d 2d | 3e 73 74 61 72 74 20 3d |.wlp[0]-|>start =|
|00003500| 20 77 5f 70 31 2e 64 6f | 74 3b 09 2f 2a 20 73 61 | w_p1.do|t;./* sa|
|00003510| 76 65 20 73 74 61 72 74 | 69 6e 67 20 63 68 61 72 |ve start|ing char|
|00003520| 20 70 6f 73 69 74 69 6f | 6e 20 2a 2f 0a 58 09 09 | positio|n */.X..|
|00003530| 09 09 09 77 69 6e 64 6f | 77 32 28 30 29 3b 09 09 |...windo|w2(0);..|
|00003540| 09 09 09 2f 2a 20 61 6e | 64 20 72 65 77 72 69 74 |.../* an|d rewrit|
|00003550| 65 20 73 63 72 65 65 6e | 20 2a 2f 0a 58 09 09 09 |e screen| */.X...|
|00003560| 09 09 7d 0a 58 0a 58 09 | 09 09 09 65 6c 73 65 20 |..}.X.X.|...else |
|00003570| 77 69 6e 64 6f 77 31 5f | 61 62 73 28 29 3b 09 09 |window1_|abs();..|
|00003580| 09 09 2f 2a 20 66 61 72 | 74 68 65 72 20 62 61 63 |../* far|ther bac|
|00003590| 6b 20 74 68 61 6e 20 74 | 68 61 74 20 2d 20 72 65 |k than t|hat - re|
|000035a0| 64 72 61 77 20 2a 2f 0a | 58 09 09 09 09 7d 0a 58 |draw */.|X....}.X|
|000035b0| 0a 58 09 09 09 65 6c 73 | 65 20 77 69 6e 64 6f 77 |.X...els|e window|
|000035c0| 31 5f 61 62 73 28 29 3b | 09 09 09 09 09 2f 2a 20 |1_abs();|...../* |
|000035d0| 63 6f 6e 74 69 6e 75 61 | 74 69 6f 6e 20 77 61 73 |continua|tion was|
|000035e0| 20 74 6f 6f 20 6c 6f 6e | 67 3a 20 67 69 76 65 20 | too lon|g: give |
|000035f0| 75 70 20 61 6e 64 20 72 | 65 64 72 61 77 20 2a 2f |up and r|edraw */|
|00003600| 0a 58 09 09 09 7d 09 09 | 09 09 2f 2a 20 65 6e 64 |.X...}..|../* end|
|00003610| 20 6f 66 20 22 64 6f 74 | 20 69 73 20 62 65 66 6f | of "dot| is befo|
|00003620| 72 65 20 73 63 72 65 65 | 6e 22 20 2a 2f 0a 58 0a |re scree|n" */.X.|
|00003630| 58 09 09 65 6c 73 65 20 | 69 66 20 28 64 6f 74 20 |X..else |if (dot |
|00003640| 3c 3d 20 77 6c 70 5b 6c | 61 73 74 5f 79 5d 2d 3e |<= wlp[l|ast_y]->|
|00003650| 65 6e 64 29 20 77 69 6e | 64 6f 77 31 5f 69 6e 63 |end) win|dow1_inc|
|00003660| 28 64 6f 74 29 3b 09 09 | 2f 2a 20 6f 6e 20 73 63 |(dot);..|/* on sc|
|00003670| 72 65 65 6e 20 2d 20 72 | 65 64 72 61 77 20 69 6e |reen - r|edraw in|
|00003680| 63 72 65 6d 65 6e 74 61 | 6c 6c 79 20 2a 2f 0a 58 |crementa|lly */.X|
|00003690| 0a 58 09 09 65 6c 73 65 | 20 77 69 6e 64 6f 77 31 |.X..else| window1|
|000036a0| 5f 61 66 74 65 72 28 29 | 3b 09 09 09 09 2f 2a 20 |_after()|;..../* |
|000036b0| 64 6f 74 20 69 73 20 61 | 66 74 65 72 20 73 63 72 |dot is a|fter scr|
|000036c0| 65 65 6e 3a 20 73 63 72 | 6f 6c 6c 20 6f 72 20 72 |een: scr|oll or r|
|000036d0| 65 64 72 61 77 20 2a 2f | 0a 58 09 09 7d 09 09 09 |edraw */|.X..}...|
|000036e0| 09 2f 2a 20 65 6e 64 20 | 6f 66 20 22 64 6f 74 20 |./* end |of "dot |
|000036f0| 69 73 20 62 65 66 6f 72 | 65 20 6d 6f 64 69 66 69 |is befor|e modifi|
|00003700| 65 64 20 70 6f 69 6e 74 | 22 20 2a 2f 0a 58 0a 58 |ed point|" */.X.X|
|00003710| 0a 58 2f 2a 20 74 68 65 | 20 6d 6f 64 69 66 69 65 |.X/* the| modifie|
|00003720| 64 20 70 6f 69 6e 74 20 | 69 6e 20 74 68 65 20 62 |d point |in the b|
|00003730| 75 66 66 65 72 20 69 73 | 20 62 65 66 6f 72 65 20 |uffer is| before |
|00003740| 64 6f 74 20 2a 2f 0a 58 | 0a 58 09 65 6c 73 65 0a |dot */.X|.X.else.|
|00003750| 58 09 09 7b 0a 58 09 09 | 69 66 20 28 62 75 66 66 |X..{.X..|if (buff|
|00003760| 5f 6d 6f 64 20 3c 20 77 | 6c 70 5b 30 5d 2d 3e 73 |_mod < w|lp[0]->s|
|00003770| 74 61 72 74 29 20 77 69 | 6e 64 6f 77 31 5f 61 62 |tart) wi|ndow1_ab|
|00003780| 73 28 29 3b 09 2f 2a 20 | 6d 6f 64 69 66 69 65 64 |s();./* |modified|
|00003790| 20 70 6f 69 6e 74 20 62 | 65 66 6f 72 65 20 73 63 | point b|efore sc|
|000037a0| 72 65 65 6e 20 2d 20 72 | 65 64 72 61 77 20 66 75 |reen - r|edraw fu|
|000037b0| 6c 6c 79 20 2a 2f 0a 58 | 0a 58 09 09 65 6c 73 65 |lly */.X|.X..else|
|000037c0| 20 69 66 20 28 62 75 66 | 66 5f 6d 6f 64 20 3c 3d | if (buf|f_mod <=|
|000037d0| 20 77 6c 70 5b 6c 61 73 | 74 5f 79 5d 2d 3e 65 6e | wlp[las|t_y]->en|
|000037e0| 64 29 09 09 09 2f 2a 20 | 6d 6f 64 69 66 69 65 64 |d).../* |modified|
|000037f0| 20 70 6f 69 6e 74 20 6f | 6e 20 73 63 72 65 65 6e | point o|n screen|
|00003800| 20 2a 2f 0a 58 09 09 09 | 7b 0a 58 09 09 09 66 6f | */.X...|{.X...fo|
|00003810| 72 20 28 6d 20 3d 20 30 | 3b 20 62 75 66 66 5f 6d |r (m = 0|; buff_m|
|00003820| 6f 64 20 3e 20 77 6c 70 | 5b 6d 5d 2d 3e 65 6e 64 |od > wlp|[m]->end|
|00003830| 3b 20 6d 2b 2b 29 3b 09 | 2f 2a 20 66 69 6e 64 20 |; m++);.|/* find |
|00003840| 6c 69 6e 65 20 77 69 74 | 68 20 62 75 66 66 5f 6d |line wit|h buff_m|
|00003850| 6f 64 20 2a 2f 0a 58 09 | 09 09 77 5f 73 65 74 70 |od */.X.|..w_setp|
|00003860| 74 72 28 77 6c 70 5b 6d | 5d 2d 3e 73 74 61 72 74 |tr(wlp[m|]->start|
|00003870| 2c 20 26 77 5f 70 31 29 | 3b 09 09 09 09 2f 2a 20 |, &w_p1)|;..../* |
|00003880| 73 65 74 20 61 20 70 6f | 69 6e 74 65 72 20 74 6f |set a po|inter to|
|00003890| 20 73 74 61 72 74 20 6f | 66 20 6c 69 6e 65 20 77 | start o|f line w|
|000038a0| 69 74 68 20 62 75 66 66 | 5f 6d 6f 64 20 2a 2f 0a |ith buff|_mod */.|
|000038b0| 58 09 09 09 6a 20 3d 20 | 28 6d 20 3c 20 77 69 6e |X...j = |(m < win|
|000038c0| 64 6f 77 5f 73 69 7a 65 | 2f 32 29 20 3f 20 77 69 |dow_size|/2) ? wi|
|000038d0| 6e 64 6f 77 5f 73 69 7a | 65 20 2d 20 31 20 2d 20 |ndow_siz|e - 1 - |
|000038e0| 6d 20 3a 20 77 69 6e 64 | 6f 77 5f 73 69 7a 65 2f |m : wind|ow_size/|
|000038f0| 32 3b 09 2f 2a 20 6d 61 | 78 69 6d 75 6d 20 23 20 |2;./* ma|ximum # |
|00003900| 6f 66 20 6c 69 6e 65 73 | 20 62 65 74 77 65 65 6e |of lines| between|
|00003910| 20 62 75 66 66 5f 6d 6f | 64 20 26 20 64 6f 74 20 | buff_mo|d & dot |
|00003920| 2a 2f 0a 58 09 09 09 66 | 6f 72 20 28 69 20 3d 20 |*/.X...f|or (i = |
|00003930| 30 3b 20 28 64 6f 74 20 | 3e 3d 20 77 5f 70 31 2e |0; (dot |>= w_p1.|
|00003940| 64 6f 74 29 20 26 26 20 | 28 77 5f 70 31 2e 64 6f |dot) && |(w_p1.do|
|00003950| 74 20 3c 20 7a 29 20 26 | 26 20 28 69 20 3c 3d 20 |t < z) &|& (i <= |
|00003960| 6a 29 3b 20 29 0a 58 09 | 09 09 09 69 20 2b 3d 20 |j); ).X.|...i += |
|00003970| 28 6c 66 6c 61 67 20 3d | 20 77 5f 6c 69 6e 65 73 |(lflag =| w_lines|
|00003980| 28 31 2c 20 26 77 5f 70 | 31 2c 20 26 77 5f 70 31 |(1, &w_p|1, &w_p1|
|00003990| 29 20 29 20 3f 20 6c 66 | 6c 61 67 20 3a 20 31 3b |) ) ? lf|lag : 1;|
|000039a0| 09 2f 2a 20 63 6f 75 6e | 74 20 6c 69 6e 65 73 20 |./* coun|t lines |
|000039b0| 66 72 6f 6d 20 62 75 66 | 66 5f 6d 6f 64 20 74 6f |from buf|f_mod to|
|000039c0| 20 66 69 72 73 74 20 6c | 69 6e 65 20 61 66 74 65 | first l|ine afte|
|000039d0| 72 20 64 6f 74 20 2a 2f | 0a 58 09 09 09 69 66 20 |r dot */|.X...if |
|000039e0| 28 69 20 3e 20 6a 29 20 | 77 69 6e 64 6f 77 31 5f |(i > j) |window1_|
|000039f0| 61 62 73 28 29 3b 09 09 | 09 09 09 2f 2a 20 74 6f |abs();..|.../* to|
|00003a00| 6f 20 66 61 72 20 2d 20 | 72 65 64 72 61 77 20 2a |o far - |redraw *|
|00003a10| 2f 0a 58 09 09 09 65 6c | 73 65 0a 58 09 09 09 09 |/.X...el|se.X....|
|00003a20| 7b 0a 58 09 09 09 09 69 | 66 20 28 6c 66 6c 61 67 |{.X....i|f (lflag|
|00003a30| 20 26 26 20 28 64 6f 74 | 20 3d 3d 20 7a 29 29 20 | && (dot| == z)) |
|00003a40| 69 2b 2b 3b 09 09 09 2f | 2a 20 69 66 20 61 74 20 |i++;.../|* if at |
|00003a50| 65 6e 64 2c 20 66 6f 6c | 6c 6f 77 69 6e 67 20 61 |end, fol|lowing a|
|00003a60| 20 4c 46 20 2a 2f 0a 58 | 09 09 09 09 77 5f 73 65 | LF */.X|....w_se|
|00003a70| 74 70 74 72 28 77 6c 70 | 5b 6d 5d 2d 3e 73 74 61 |tptr(wlp|[m]->sta|
|00003a80| 72 74 2c 20 26 77 5f 70 | 31 29 3b 09 09 09 2f 2a |rt, &w_p|1);.../*|
|00003a90| 20 70 6f 69 6e 74 65 72 | 20 74 6f 20 73 74 61 72 | pointer| to star|
|00003aa0| 74 20 6f 66 20 61 72 65 | 61 20 74 6f 20 72 65 64 |t of are|a to red|
|00003ab0| 72 61 77 20 2a 2f 0a 58 | 09 09 09 09 69 66 20 28 |raw */.X|....if (|
|00003ac0| 69 20 3e 3d 20 77 69 6e | 64 6f 77 5f 73 69 7a 65 |i >= win|dow_size|
|00003ad0| 20 2d 20 6d 29 09 09 09 | 09 2f 2a 20 69 66 20 74 | - m)...|./* if t|
|00003ae0| 68 65 72 65 20 61 72 65 | 20 6e 6f 74 20 65 6e 6f |here are| not eno|
|00003af0| 75 67 68 20 62 6c 61 6e | 6b 20 6c 69 6e 65 73 20 |ugh blan|k lines |
|00003b00| 6f 6e 20 73 63 72 65 65 | 6e 20 2a 2f 0a 58 09 09 |on scree|n */.X..|
|00003b10| 09 09 09 77 5f 73 63 72 | 6f 6c 6c 28 69 20 3d 20 |...w_scr|oll(i = |
|00003b20| 69 20 2d 20 77 69 6e 64 | 6f 77 5f 73 69 7a 65 20 |i - wind|ow_size |
|00003b30| 2b 20 6d 29 2c 20 63 75 | 72 72 5f 79 20 3d 20 6d |+ m), cu|rr_y = m|
|00003b40| 20 2d 20 69 2c 20 63 75 | 72 73 5f 79 20 2d 3d 20 | - i, cu|rs_y -= |
|00003b50| 69 3b 09 2f 2a 20 73 63 | 72 6f 6c 6c 20 75 70 20 |i;./* sc|roll up |
|00003b60| 74 68 65 20 64 69 66 66 | 65 72 65 6e 63 65 20 2a |the diff|erence *|
|00003b70| 2f 0a 58 09 09 09 09 65 | 6c 73 65 20 63 75 72 72 |/.X....e|lse curr|
|00003b80| 5f 79 20 3d 20 6d 3b 0a | 58 09 09 09 09 63 75 72 |_y = m;.|X....cur|
|00003b90| 72 5f 78 20 3d 20 28 77 | 6c 70 5b 63 75 72 72 5f |r_x = (w|lp[curr_|
|00003ba0| 79 5d 2d 3e 63 66 6c 61 | 67 20 26 20 57 46 5f 43 |y]->cfla|g & WF_C|
|00003bb0| 4f 4e 54 29 20 3f 20 32 | 20 3a 20 77 6c 70 5b 63 |ONT) ? 2| : wlp[c|
|00003bc0| 75 72 72 5f 79 5d 2d 3e | 63 6f 6c 3b 09 09 2f 2a |urr_y]->|col;../*|
|00003bd0| 20 6c 69 6e 65 20 73 74 | 61 72 74 73 20 61 74 20 | line st|arts at |
|00003be0| 6c 65 66 74 20 75 6e 6c | 65 73 73 20 63 6f 6e 74 |left unl|ess cont|
|00003bf0| 69 6e 75 61 74 69 6f 6e | 20 2a 2f 0a 58 09 09 09 |inuation| */.X...|
|00003c00| 09 69 66 20 28 28 63 75 | 72 72 5f 79 20 3e 20 63 |.if ((cu|rr_y > c|
|00003c10| 75 72 73 5f 79 29 20 26 | 26 20 28 63 75 72 73 5f |urs_y) &|& (curs_|
|00003c20| 79 20 3e 3d 20 30 29 29 | 20 77 5f 72 6d 63 75 72 |y >= 0))| w_rmcur|
|00003c30| 73 28 29 3b 09 09 2f 2a | 20 72 65 6d 6f 76 65 20 |s();../*| remove |
|00003c40| 6f 6c 64 20 63 75 72 73 | 6f 72 20 69 66 20 69 74 |old curs|or if it|
|00003c50| 20 77 6f 6e 27 74 20 62 | 65 20 77 72 69 74 74 65 | won't b|e writte|
|00003c60| 6e 20 6f 76 65 72 20 2a | 2f 0a 58 09 09 09 09 77 |n over *|/.X....w|
|00003c70| 69 6e 64 6f 77 32 28 30 | 29 3b 09 09 09 09 09 09 |indow2(0|);......|
|00003c80| 09 2f 2a 20 72 65 77 72 | 69 74 65 20 6e 65 77 6c |./* rewr|ite newl|
|00003c90| 79 20 63 6c 65 61 72 65 | 64 20 72 65 67 69 6f 6e |y cleare|d region|
|00003ca0| 20 2a 2f 0a 58 09 09 09 | 09 66 6f 72 20 28 63 75 | */.X...|.for (cu|
|00003cb0| 72 72 5f 78 20 3d 20 30 | 3b 20 2b 2b 63 75 72 72 |rr_x = 0|; ++curr|
|00003cc0| 5f 79 20 3c 20 77 69 6e | 64 6f 77 5f 73 69 7a 65 |_y < win|dow_size|
|00003cd0| 3b 20 29 09 09 2f 2a 20 | 63 6c 65 61 72 20 72 65 |; )../* |clear re|
|00003ce0| 73 74 20 6f 66 20 73 63 | 72 65 65 6e 20 69 66 20 |st of sc|reen if |
|00003cf0| 6e 65 65 64 65 64 20 2a | 2f 0a 58 09 09 09 09 09 |needed *|/.X.....|
|00003d00| 7b 0a 58 09 09 09 09 09 | 77 6c 70 5b 63 75 72 72 |{.X.....|wlp[curr|
|00003d10| 5f 79 5d 2d 3e 63 66 6c | 61 67 20 3d 20 30 3b 0a |_y]->cfl|ag = 0;.|
|00003d20| 58 09 09 09 09 09 69 66 | 20 28 77 6c 70 5b 63 75 |X.....if| (wlp[cu|
|00003d30| 72 72 5f 79 5d 2d 3e 6e | 29 20 77 6c 70 5b 63 75 |rr_y]->n|) wlp[cu|
|00003d40| 72 72 5f 79 5d 2d 3e 6e | 20 3d 20 30 2c 20 76 74 |rr_y]->n| = 0, vt|
|00003d50| 6d 28 56 54 5f 45 45 4f | 4c 29 3b 0a 58 09 09 09 |m(VT_EEO|L);.X...|
|00003d60| 09 09 7d 0a 58 09 09 09 | 09 7d 0a 58 09 09 09 7d |..}.X...|.}.X...}|
|00003d70| 09 09 09 2f 2a 20 65 6e | 64 20 22 6d 6f 64 69 66 |.../* en|d "modif|
|00003d80| 69 65 64 20 70 6f 69 6e | 74 20 6f 6e 20 73 63 72 |ied poin|t on scr|
|00003d90| 65 65 6e 20 2a 2f 0a 58 | 0a 58 09 09 65 6c 73 65 |een */.X|.X..else|
|00003da0| 20 77 69 6e 64 6f 77 31 | 5f 61 66 74 65 72 28 29 | window1|_after()|
|00003db0| 3b 09 09 2f 2a 20 6d 6f | 64 69 66 69 65 64 20 70 |;../* mo|dified p|
|00003dc0| 6f 69 6e 74 20 61 66 74 | 65 72 20 73 63 72 65 65 |oint aft|er scree|
|00003dd0| 6e 3a 20 73 63 72 6f 6c | 6c 20 6f 72 20 72 65 64 |n: scrol|l or red|
|00003de0| 72 61 77 20 61 73 20 61 | 70 70 72 6f 70 72 69 61 |raw as a|ppropria|
|00003df0| 74 65 20 2a 2f 0a 58 09 | 09 7d 0a 58 0c 2f 2a 20 |te */.X.|.}.X./* |
|00003e00| 64 6f 6e 65 20 72 65 64 | 72 61 77 69 6e 67 3a 20 |done red|rawing: |
|00003e10| 64 6f 20 63 6c 65 61 6e | 75 70 20 77 6f 72 6b 20 |do clean|up work |
|00003e20| 2a 2f 0a 58 0a 58 09 69 | 66 20 28 57 4e 5f 73 63 |*/.X.X.i|f (WN_sc|
|00003e30| 72 6f 6c 6c 29 0a 58 09 | 09 7b 0a 58 09 09 70 72 |roll).X.|.{.X..pr|
|00003e40| 69 6e 74 66 28 22 5c 30 | 33 33 5b 25 64 3b 25 64 |intf("\0|33[%d;%d|
|00003e50| 72 22 2c 20 77 69 6e 64 | 6f 77 5f 73 69 7a 65 2b |r", wind|ow_size+|
|00003e60| 31 2c 20 57 4e 5f 68 65 | 69 67 68 74 29 3b 09 2f |1, WN_he|ight);./|
|00003e70| 2a 20 72 65 73 65 74 20 | 6d 61 72 67 69 6e 73 20 |* reset |margins |
|00003e80| 2a 2f 0a 58 09 09 70 72 | 69 6e 74 66 28 22 5c 30 |*/.X..pr|intf("\0|
|00003e90| 33 33 5b 25 64 3b 30 48 | 22 2c 20 57 4e 5f 68 65 |33[%d;0H|", WN_he|
|00003ea0| 69 67 68 74 29 3b 09 09 | 2f 2a 20 63 75 72 73 6f |ight);..|/* curso|
|00003eb0| 72 20 74 6f 20 62 6f 74 | 74 6f 6d 20 2a 2f 0a 58 |r to bot|tom */.X|
|00003ec0| 09 09 7d 0a 58 09 65 6c | 73 65 20 70 72 69 6e 74 |..}.X.el|se print|
|00003ed0| 66 28 22 5c 30 33 33 5b | 48 22 29 3b 09 09 2f 2a |f("\033[|H");../*|
|00003ee0| 20 6e 6f 20 73 70 6c 69 | 74 20 73 63 72 65 65 6e | no spli|t screen|
|00003ef0| 3a 20 73 65 74 20 68 6f | 6d 65 20 2a 2f 0a 58 0a |: set ho|me */.X.|
|00003f00| 58 09 66 66 6c 75 73 68 | 28 73 74 64 6f 75 74 29 |X.fflush|(stdout)|
|00003f10| 3b 09 09 09 09 2f 2a 20 | 66 6c 75 73 68 20 6f 75 |;..../* |flush ou|
|00003f20| 74 70 75 74 20 2a 2f 0a | 58 09 57 4e 5f 6f 72 69 |tput */.|X.WN_ori|
|00003f30| 67 69 6e 20 3d 20 77 6c | 70 5b 30 5d 2d 3e 73 74 |gin = wl|p[0]->st|
|00003f40| 61 72 74 3b 09 2f 2a 20 | 73 61 76 65 20 66 69 72 |art;./* |save fir|
|00003f50| 73 74 20 63 68 61 72 20 | 70 6f 73 20 6f 6e 20 73 |st char |pos on s|
|00003f60| 63 72 65 65 6e 20 2a 2f | 0a 58 09 72 65 64 72 61 |creen */|.X.redra|
|00003f70| 77 5f 73 77 20 3d 20 30 | 3b 09 09 09 09 2f 2a 20 |w_sw = 0|;..../* |
|00003f80| 6d 61 72 6b 20 73 63 72 | 65 65 6e 20 61 73 20 75 |mark scr|een as u|
|00003f90| 70 64 61 74 65 64 20 2a | 2f 0a 58 09 62 75 66 66 |pdated *|/.X.buff|
|00003fa0| 5f 6d 6f 64 20 3d 20 4d | 41 58 3b 0a 58 09 6c 61 |_mod = M|AX;.X.la|
|00003fb0| 73 74 5f 64 6f 74 20 3d | 20 64 6f 74 3b 0a 58 09 |st_dot =| dot;.X.|
|00003fc0| 62 6c 6f 63 6b 5f 69 6e | 74 65 72 28 30 29 3b 09 |block_in|ter(0);.|
|00003fd0| 09 09 09 2f 2a 20 72 65 | 65 6e 61 62 6c 65 20 69 |.../* re|enable i|
|00003fe0| 6e 74 65 72 72 75 70 74 | 73 20 2a 2f 0a 58 09 7d |nterrupt|s */.X.}|
|00003ff0| 0a 58 0c 2f 2a 20 72 6f | 75 74 69 6e 65 20 74 6f |.X./* ro|utine to|
|00004000| 20 72 65 64 72 61 77 20 | 73 63 72 65 65 6e 20 61 | redraw |screen a|
|00004010| 62 73 6f 6c 75 74 65 6c | 79 20 2a 2f 0a 58 0a 58 |bsolutel|y */.X.X|
|00004020| 77 69 6e 64 6f 77 31 5f | 61 62 73 28 29 0a 58 09 |window1_|abs().X.|
|00004030| 7b 0a 58 09 69 6e 74 20 | 69 2c 20 6a 3b 0a 58 0a |{.X.int |i, j;.X.|
|00004040| 58 09 63 75 72 72 5f 79 | 20 3d 20 77 6c 70 5b 30 |X.curr_y| = wlp[0|
|00004050| 5d 2d 3e 63 6f 6c 20 3d | 20 63 75 72 72 5f 78 20 |]->col =| curr_x |
|00004060| 3d 20 30 3b 09 09 09 09 | 2f 2a 20 69 6e 64 69 63 |= 0;....|/* indic|
|00004070| 61 74 65 20 77 68 65 72 | 65 20 72 65 66 72 65 73 |ate wher|e refres|
|00004080| 68 20 73 74 61 72 74 73 | 20 2a 2f 0a 58 09 73 65 |h starts| */.X.se|
|00004090| 74 5f 70 6f 69 6e 74 65 | 72 28 64 6f 74 2c 20 26 |t_pointe|r(dot, &|
|000040a0| 77 5f 70 31 29 3b 09 09 | 09 09 09 09 2f 2a 20 6d |w_p1);..|..../* m|
|000040b0| 61 6b 65 20 61 20 74 65 | 78 74 20 62 75 66 66 65 |ake a te|xt buffe|
|000040c0| 72 2c 20 69 66 20 6e 6f | 6e 65 2c 20 61 6e 64 20 |r, if no|ne, and |
|000040d0| 72 65 66 72 65 73 68 20 | 74 68 65 20 64 69 73 70 |refresh |the disp|
|000040e0| 6c 61 79 20 2a 2f 0a 58 | 09 77 5f 6c 69 6e 65 73 |lay */.X|.w_lines|
|000040f0| 28 30 2c 20 26 77 5f 70 | 31 2c 20 26 77 5f 70 31 |(0, &w_p|1, &w_p1|
|00004100| 29 3b 09 09 09 09 09 09 | 2f 2a 20 64 6f 20 30 4c |);......|/* do 0L|
|00004110| 20 2a 2f 0a 58 09 69 66 | 20 28 28 69 20 3d 20 77 | */.X.if| ((i = w|
|00004120| 5f 6c 69 6e 65 73 28 77 | 69 6e 64 6f 77 5f 73 69 |_lines(w|indow_si|
|00004130| 7a 65 2f 32 2c 20 26 77 | 5f 70 31 2c 20 4e 55 4c |ze/2, &w|_p1, NUL|
|00004140| 4c 29 29 20 3d 3d 20 30 | 29 20 69 20 3d 20 31 3b |L)) == 0|) i = 1;|
|00004150| 09 09 2f 2a 20 63 68 65 | 63 6b 20 68 6f 77 20 6d |../* che|ck how m|
|00004160| 61 6e 79 20 6c 69 6e 65 | 73 20 61 66 74 65 72 20 |any line|s after |
|00004170| 64 6f 74 20 2a 2f 0a 58 | 09 69 66 20 28 69 20 3e |dot */.X|.if (i >|
|00004180| 20 77 69 6e 64 6f 77 5f | 73 69 7a 65 2f 32 29 20 | window_|size/2) |
|00004190| 69 20 3d 20 77 69 6e 64 | 6f 77 5f 73 69 7a 65 2f |i = wind|ow_size/|
|000041a0| 32 3b 09 09 2f 2a 20 6c | 69 6d 69 74 20 61 6d 6f |2;../* l|imit amo|
|000041b0| 75 6e 74 20 61 66 74 65 | 72 20 64 6f 74 20 2a 2f |unt afte|r dot */|
|000041c0| 0a 58 09 66 6f 72 20 28 | 6a 20 3d 20 30 3b 20 28 |.X.for (|j = 0; (|
|000041d0| 6a 20 3c 20 77 69 6e 64 | 6f 77 5f 73 69 7a 65 20 |j < wind|ow_size |
|000041e0| 2d 20 69 29 20 26 26 20 | 28 77 5f 70 31 2e 64 6f |- i) && |(w_p1.do|
|000041f0| 74 20 3e 20 30 29 3b 20 | 29 09 09 2f 2a 20 66 69 |t > 0); |)../* fi|
|00004200| 6e 64 20 73 74 61 72 74 | 20 6f 66 20 64 69 73 70 |nd start| of disp|
|00004210| 6c 61 79 20 61 72 65 61 | 20 2a 2f 0a 58 09 09 6a |lay area| */.X..j|
|00004220| 20 2d 3d 20 77 5f 6c 69 | 6e 65 73 28 2d 31 2c 20 | -= w_li|nes(-1, |
|00004230| 26 77 5f 70 31 2c 20 26 | 77 5f 70 31 29 3b 0a 58 |&w_p1, &|w_p1);.X|
|00004240| 09 69 66 20 28 6a 20 3e | 20 77 69 6e 64 6f 77 5f |.if (j >| window_|
|00004250| 73 69 7a 65 20 2d 20 69 | 29 20 77 5f 6c 69 6e 65 |size - i|) w_line|
|00004260| 73 28 31 2c 20 26 77 5f | 70 31 2c 20 26 77 5f 70 |s(1, &w_|p1, &w_p|
|00004270| 31 29 3b 09 09 09 2f 2a | 20 69 66 20 74 6f 6f 20 |1);.../*| if too |
|00004280| 66 61 72 20 62 61 63 6b | 2c 20 6d 6f 76 65 20 75 |far back|, move u|
|00004290| 70 20 6f 6e 65 20 6c 69 | 6e 65 20 2a 2f 0a 58 0a |p one li|ne */.X.|
|000042a0| 58 09 77 6c 70 5b 30 5d | 2d 3e 73 74 61 72 74 20 |X.wlp[0]|->start |
|000042b0| 3d 20 77 5f 70 31 2e 64 | 6f 74 3b 09 09 2f 2a 20 |= w_p1.d|ot;../* |
|000042c0| 69 6e 64 69 63 61 74 65 | 20 77 68 65 72 65 20 66 |indicate| where f|
|000042d0| 69 72 73 74 20 77 69 6e | 64 6f 77 20 6c 69 6e 65 |irst win|dow line|
|000042e0| 20 73 74 61 72 74 73 20 | 2a 2f 0a 58 09 77 69 6e | starts |*/.X.win|
|000042f0| 64 6f 77 32 28 30 29 3b | 09 09 09 09 09 09 2f 2a |dow2(0);|....../*|
|00004300| 20 72 65 66 72 65 73 68 | 20 74 68 65 20 77 68 6f | refresh| the who|
|00004310| 6c 65 20 64 69 73 70 6c | 61 79 20 2a 2f 0a 58 0a |le displ|ay */.X.|
|00004320| 58 09 66 6f 72 20 28 63 | 75 72 72 5f 78 20 3d 20 |X.for (c|urr_x = |
|00004330| 30 3b 20 2b 2b 63 75 72 | 72 5f 79 20 3c 20 77 69 |0; ++cur|r_y < wi|
|00004340| 6e 64 6f 77 5f 73 69 7a | 65 3b 20 29 09 09 2f 2a |ndow_siz|e; )../*|
|00004350| 20 62 6c 61 6e 6b 20 6f | 75 74 20 6c 69 6e 65 73 | blank o|ut lines|
|00004360| 20 6e 6f 74 20 77 72 69 | 74 74 65 6e 20 62 79 20 | not wri|tten by |
|00004370| 77 69 6e 64 6f 77 32 20 | 2a 2f 0a 58 09 09 69 66 |window2 |*/.X..if|
|00004380| 20 28 77 6c 70 5b 63 75 | 72 72 5f 79 5d 2d 3e 6e | (wlp[cu|rr_y]->n|
|00004390| 20 7c 7c 20 72 65 64 72 | 61 77 5f 73 77 29 20 77 | || redr|aw_sw) w|
|000043a0| 6c 70 5b 63 75 72 72 5f | 79 5d 2d 3e 6e 20 3d 20 |lp[curr_|y]->n = |
|000043b0| 30 2c 20 76 74 6d 28 56 | 54 5f 45 45 4f 4c 29 3b |0, vtm(V|T_EEOL);|
|000043c0| 0a 58 09 7d 0a 58 0a 58 | 0a 58 0a 58 0a 58 2f 2a |.X.}.X.X|.X.X.X/*|
|000043d0| 20 72 65 64 72 61 77 20 | 73 63 72 65 65 6e 20 69 | redraw |screen i|
|000043e0| 6e 63 72 65 6d 65 6e 74 | 61 6c 6c 79 20 2a 2f 0a |ncrement|ally */.|
|000043f0| 58 0a 58 77 69 6e 64 6f | 77 31 5f 69 6e 63 28 77 |X.Xwindo|w1_inc(w|
|00004400| 64 29 0a 58 09 69 6e 74 | 20 77 64 3b 09 09 09 09 |d).X.int| wd;....|
|00004410| 09 09 2f 2a 20 61 72 67 | 75 6d 65 6e 74 20 69 73 |../* arg|ument is|
|00004420| 20 65 61 72 6c 69 65 73 | 74 20 63 68 61 6e 67 65 | earlies|t change|
|00004430| 20 2a 2f 0a 58 09 7b 0a | 58 09 73 68 6f 72 74 20 | */.X.{.|X.short |
|00004440| 74 65 6d 70 5f 79 3b 0a | 58 0a 58 2f 2a 20 66 69 |temp_y;.|X.X/* fi|
|00004450| 6e 64 20 74 68 65 20 6c | 69 6e 65 20 63 6f 6e 74 |nd the l|ine cont|
|00004460| 61 69 6e 69 6e 67 20 74 | 68 65 20 63 68 61 72 61 |aining t|he chara|
|00004470| 63 74 65 72 20 61 74 20 | 77 64 20 2a 2f 0a 58 0a |cter at |wd */.X.|
|00004480| 58 09 66 6f 72 20 28 74 | 65 6d 70 5f 79 20 3d 20 |X.for (t|emp_y = |
|00004490| 30 3b 20 77 64 20 3e 20 | 77 6c 70 5b 74 65 6d 70 |0; wd > |wlp[temp|
|000044a0| 5f 79 5d 2d 3e 65 6e 64 | 3b 20 74 65 6d 70 5f 79 |_y]->end|; temp_y|
|000044b0| 2b 2b 29 3b 0a 58 0a 58 | 09 69 66 20 28 28 63 75 |++);.X.X|.if ((cu|
|000044c0| 72 73 5f 79 20 21 3d 20 | 74 65 6d 70 5f 79 29 20 |rs_y != |temp_y) |
|000044d0| 7c 7c 20 28 62 75 66 66 | 5f 6d 6f 64 20 3d 3d 20 ||| (buff|_mod == |
|000044e0| 4d 41 58 29 20 7c 7c 20 | 63 75 72 73 5f 63 72 66 |MAX) || |curs_crf|
|000044f0| 6c 61 67 29 09 09 2f 2a | 20 69 66 20 74 68 65 20 |lag)../*| if the |
|00004500| 63 75 72 73 6f 72 20 6c | 69 6e 65 20 77 6f 6e 27 |cursor l|ine won'|
|00004510| 74 20 62 65 20 72 65 77 | 72 69 74 74 65 6e 20 2a |t be rew|ritten *|
|00004520| 2f 0a 58 09 09 77 5f 72 | 6d 63 75 72 73 28 29 3b |/.X..w_r|mcurs();|
|00004530| 09 09 09 09 09 2f 2a 20 | 72 65 6d 6f 76 65 20 74 |...../* |remove t|
|00004540| 68 65 20 6f 6c 64 20 63 | 75 72 73 6f 72 20 2a 2f |he old c|ursor */|
|00004550| 0a 58 09 63 75 72 72 5f | 79 20 3d 20 74 65 6d 70 |.X.curr_|y = temp|
|00004560| 5f 79 3b 09 09 09 09 2f | 2a 20 61 6e 64 20 67 6f |_y;..../|* and go|
|00004570| 20 74 6f 20 77 6f 72 6b | 20 6f 6e 20 74 68 65 20 | to work| on the |
|00004580| 62 65 67 69 6e 6e 69 6e | 67 20 6f 66 20 74 68 65 |beginnin|g of the|
|00004590| 20 6c 69 6e 65 20 77 69 | 74 68 20 64 6f 74 20 2a | line wi|th dot *|
|000045a0| 2f 0a 58 09 63 75 72 72 | 5f 78 20 3d 20 28 77 6c |/.X.curr|_x = (wl|
|000045b0| 70 5b 63 75 72 72 5f 79 | 5d 2d 3e 63 66 6c 61 67 |p[curr_y|]->cflag|
|000045c0| 20 26 20 57 46 5f 43 4f | 4e 54 29 20 3f 20 32 20 | & WF_CO|NT) ? 2 |
|000045d0| 3a 20 77 6c 70 5b 63 75 | 72 72 5f 79 5d 2d 3e 63 |: wlp[cu|rr_y]->c|
|000045e0| 6f 6c 3b 09 09 2f 2a 20 | 6c 69 6e 65 20 73 74 61 |ol;../* |line sta|
|000045f0| 72 74 73 20 61 74 20 6c | 65 66 74 20 75 6e 6c 65 |rts at l|eft unle|
|00004600| 73 73 20 63 6f 6e 74 69 | 6e 75 61 74 69 6f 6e 20 |ss conti|nuation |
|00004610| 2a 2f 0a 58 0a 58 09 77 | 5f 73 65 74 70 74 72 28 |*/.X.X.w|_setptr(|
|00004620| 77 6c 70 5b 63 75 72 72 | 5f 79 5d 2d 3e 73 74 61 |wlp[curr|_y]->sta|
|00004630| 72 74 2c 20 26 77 5f 70 | 31 29 3b 09 09 2f 2a 20 |rt, &w_p|1);../* |
|00004640| 6d 61 6b 65 20 61 20 70 | 6f 69 6e 74 65 72 20 74 |make a p|ointer t|
|00004650| 68 65 72 65 20 2a 2f 0a | 58 09 77 69 6e 64 6f 77 |here */.|X.window|
|00004660| 32 28 62 75 66 66 5f 6d | 6f 64 20 3d 3d 20 4d 41 |2(buff_m|od == MA|
|00004670| 58 29 3b 09 09 2f 2a 20 | 69 66 20 62 75 66 66 65 |X);../* |if buffe|
|00004680| 72 20 6e 6f 74 20 6d 6f | 64 69 66 69 65 64 2c 20 |r not mo|dified, |
|00004690| 72 65 64 72 61 77 20 6f | 6e 6c 79 20 74 68 65 20 |redraw o|nly the |
|000046a0| 6c 69 6e 65 20 77 69 74 | 68 20 64 6f 74 20 2a 2f |line wit|h dot */|
|000046b0| 0a 58 0a 58 09 69 66 20 | 28 62 75 66 66 5f 6d 6f |.X.X.if |(buff_mo|
|000046c0| 64 20 3c 20 4d 41 58 29 | 09 09 09 2f 2a 20 69 66 |d < MAX)|.../* if|
|000046d0| 20 62 75 66 66 65 72 20 | 68 61 73 20 63 68 61 6e | buffer |has chan|
|000046e0| 67 65 64 2c 20 65 72 61 | 73 65 20 64 69 73 70 6c |ged, era|se displ|
|000046f0| 61 79 20 6c 69 6e 65 73 | 20 62 65 79 6f 6e 64 20 |ay lines| beyond |
|00004700| 65 6e 64 20 6f 66 20 62 | 75 66 66 65 72 20 2a 2f |end of b|uffer */|
|00004710| 0a 58 09 09 66 6f 72 20 | 28 63 75 72 72 5f 78 20 |.X..for |(curr_x |
|00004720| 3d 20 30 3b 20 2b 2b 63 | 75 72 72 5f 79 20 3c 20 |= 0; ++c|urr_y < |
|00004730| 77 69 6e 64 6f 77 5f 73 | 69 7a 65 3b 20 29 0a 58 |window_s|ize; ).X|
|00004740| 09 09 09 69 66 20 28 20 | 28 28 77 6c 70 5b 63 75 |...if ( |((wlp[cu|
|00004750| 72 72 5f 79 5d 2d 3e 73 | 74 61 72 74 20 3e 3d 20 |rr_y]->s|tart >= |
|00004760| 7a 29 20 7c 7c 20 28 77 | 6c 70 5b 63 75 72 72 5f |z) || (w|lp[curr_|
|00004770| 79 5d 2d 3e 73 74 61 72 | 74 20 3c 3d 20 77 6c 70 |y]->star|t <= wlp|
|00004780| 5b 63 75 72 72 5f 79 2d | 31 5d 2d 3e 65 6e 64 29 |[curr_y-|1]->end)|
|00004790| 29 20 26 26 20 28 77 6c | 70 5b 63 75 72 72 5f 79 |) && (wl|p[curr_y|
|000047a0| 5d 2d 3e 6e 20 7c 7c 20 | 72 65 64 72 61 77 5f 73 |]->n || |redraw_s|
|000047b0| 77 29 20 29 0a 58 09 09 | 09 09 77 6c 70 5b 63 75 |w) ).X..|..wlp[cu|
|000047c0| 72 72 5f 79 5d 2d 3e 6e | 20 3d 20 30 2c 20 76 74 |rr_y]->n| = 0, vt|
|000047d0| 6d 28 56 54 5f 45 45 4f | 4c 29 2c 20 77 6c 70 5b |m(VT_EEO|L), wlp[|
|000047e0| 63 75 72 72 5f 79 5d 2d | 3e 63 66 6c 61 67 20 3d |curr_y]-|>cflag =|
|000047f0| 20 30 3b 0a 58 09 7d 0a | 58 0c 2f 2a 20 72 6f 75 | 0;.X.}.|X./* rou|
|00004800| 74 69 6e 65 20 74 6f 20 | 6d 6f 76 65 20 77 69 6e |tine to |move win|
|00004810| 64 6f 77 20 64 6f 77 6e | 77 61 72 64 73 3a 20 73 |dow down|wards: s|
|00004820| 63 72 6f 6c 6c 20 75 70 | 20 6f 72 20 72 65 64 72 |croll up| or redr|
|00004830| 61 77 20 61 73 20 61 70 | 70 72 6f 70 72 69 61 74 |aw as ap|propriat|
|00004840| 65 20 2a 2f 0a 58 0a 58 | 77 69 6e 64 6f 77 31 5f |e */.X.X|window1_|
|00004850| 61 66 74 65 72 28 29 0a | 58 09 7b 0a 58 09 69 6e |after().|X.{.X.in|
|00004860| 74 20 69 2c 20 6c 66 6c | 61 67 3b 0a 58 0a 58 09 |t i, lfl|ag;.X.X.|
|00004870| 77 5f 72 6d 63 75 72 73 | 28 29 3b 09 09 09 09 09 |w_rmcurs|();.....|
|00004880| 09 2f 2a 20 72 65 6d 6f | 76 65 20 6f 6c 64 20 63 |./* remo|ve old c|
|00004890| 75 72 73 6f 72 20 2a 2f | 0a 58 09 77 5f 73 65 74 |ursor */|.X.w_set|
|000048a0| 70 74 72 28 77 6c 70 5b | 77 69 6e 64 6f 77 5f 73 |ptr(wlp[|window_s|
|000048b0| 69 7a 65 2d 31 5d 2d 3e | 73 74 61 72 74 2c 20 26 |ize-1]->|start, &|
|000048c0| 77 5f 70 31 29 3b 09 09 | 2f 2a 20 73 65 74 20 70 |w_p1);..|/* set p|
|000048d0| 6f 69 6e 74 65 72 20 74 | 6f 20 73 74 61 72 74 20 |ointer t|o start |
|000048e0| 6f 66 20 6c 61 73 74 20 | 6c 69 6e 65 20 6f 6e 20 |of last |line on |
|000048f0| 73 63 72 65 65 6e 20 2a | 2f 0a 58 0a 58 09 66 6f |screen *|/.X.X.fo|
|00004900| 72 20 28 69 20 3d 20 30 | 3b 20 28 64 6f 74 20 3e |r (i = 0|; (dot >|
|00004910| 3d 20 77 5f 70 31 2e 64 | 6f 74 29 20 26 26 20 28 |= w_p1.d|ot) && (|
|00004920| 77 5f 70 31 2e 64 6f 74 | 20 3c 20 7a 29 20 26 26 |w_p1.dot| < z) &&|
|00004930| 20 28 69 20 3c 3d 20 77 | 69 6e 64 6f 77 5f 73 69 | (i <= w|indow_si|
|00004940| 7a 65 2f 32 29 3b 20 29 | 0a 58 09 09 69 20 2b 3d |ze/2); )|.X..i +=|
|00004950| 20 28 6c 66 6c 61 67 20 | 3d 20 77 5f 6c 69 6e 65 | (lflag |= w_line|
|00004960| 73 28 31 2c 20 26 77 5f | 70 31 2c 20 26 77 5f 70 |s(1, &w_|p1, &w_p|
|00004970| 31 29 29 20 3f 20 6c 66 | 6c 61 67 20 3a 20 31 3b |1)) ? lf|lag : 1;|
|00004980| 09 2f 2a 20 66 77 64 20 | 6f 6e 65 20 6c 69 6e 65 |./* fwd |one line|
|00004990| 20 61 74 20 61 20 74 69 | 6d 65 20 75 6e 74 69 6c | at a ti|me until|
|000049a0| 20 3e 20 64 6f 74 20 6f | 72 20 65 6e 64 20 6f 66 | > dot o|r end of|
|000049b0| 20 62 75 66 66 65 72 20 | 2a 2f 0a 58 0a 58 09 69 | buffer |*/.X.X.i|
|000049c0| 66 20 28 69 20 3c 3d 20 | 77 69 6e 64 6f 77 5f 73 |f (i <= |window_s|
|000049d0| 69 7a 65 2f 32 29 09 09 | 09 2f 2a 20 66 6f 75 6e |ize/2)..|./* foun|
|000049e0| 64 20 77 69 74 68 69 6e | 20 6e 20 6c 69 6e 65 73 |d within| n lines|
|000049f0| 20 2a 2f 0a 58 09 09 7b | 0a 58 09 09 69 66 20 28 | */.X..{|.X..if (|
|00004a00| 6c 66 6c 61 67 20 26 26 | 20 28 64 6f 74 20 3d 3d |lflag &&| (dot ==|
|00004a10| 20 7a 29 29 20 2b 2b 69 | 3b 09 09 09 09 2f 2a 20 | z)) ++i|;..../* |
|00004a20| 69 66 20 64 6f 74 20 69 | 73 20 61 74 20 65 6e 64 |if dot i|s at end|
|00004a30| 20 6f 66 20 62 75 66 66 | 65 72 20 61 66 74 65 72 | of buff|er after|
|00004a40| 20 61 20 4c 46 20 2a 2f | 0a 58 09 09 69 66 20 28 | a LF */|.X..if (|
|00004a50| 69 20 3e 3d 20 77 69 6e | 64 6f 77 5f 73 69 7a 65 |i >= win|dow_size|
|00004a60| 20 2d 20 6c 61 73 74 5f | 79 29 09 09 09 09 2f 2a | - last_|y)..../*|
|00004a70| 20 69 66 20 74 68 65 72 | 65 20 61 72 65 20 6e 6f | if ther|e are no|
|00004a80| 74 20 65 6e 6f 75 67 68 | 20 62 6c 61 6e 6b 20 6c |t enough| blank l|
|00004a90| 69 6e 65 73 20 6f 6e 20 | 73 63 72 65 65 6e 20 2a |ines on |screen *|
|00004aa0| 2f 0a 58 09 09 09 77 5f | 73 63 72 6f 6c 6c 28 69 |/.X...w_|scroll(i|
|00004ab0| 20 2d 20 77 69 6e 64 6f | 77 5f 73 69 7a 65 20 2b | - windo|w_size +|
|00004ac0| 20 6c 61 73 74 5f 79 29 | 2c 20 63 75 72 72 5f 79 | last_y)|, curr_y|
|00004ad0| 20 3d 20 77 69 6e 64 6f | 77 5f 73 69 7a 65 20 2d | = windo|w_size -|
|00004ae0| 20 69 3b 09 2f 2a 20 73 | 63 72 6f 6c 6c 20 75 70 | i;./* s|croll up|
|00004af0| 20 74 68 65 20 64 69 66 | 66 65 72 65 6e 63 65 20 | the dif|ference |
|00004b00| 2a 2f 0a 58 09 09 65 6c | 73 65 20 63 75 72 72 5f |*/.X..el|se curr_|
|00004b10| 79 20 3d 20 6c 61 73 74 | 5f 79 3b 0a 58 0a 58 09 |y = last|_y;.X.X.|
|00004b20| 09 77 68 69 6c 65 20 28 | 63 75 72 72 5f 79 20 26 |.while (|curr_y &|
|00004b30| 26 20 28 77 6c 70 5b 63 | 75 72 72 5f 79 5d 2d 3e |& (wlp[c|urr_y]->|
|00004b40| 63 66 6c 61 67 20 26 20 | 57 46 5f 43 4f 4e 54 29 |cflag & |WF_CONT)|
|00004b50| 29 20 2d 2d 63 75 72 72 | 5f 79 3b 09 09 2f 2a 20 |) --curr|_y;../* |
|00004b60| 67 65 74 20 74 6f 20 73 | 74 61 72 74 20 6f 66 20 |get to s|tart of |
|00004b70| 63 6f 6e 74 27 64 20 6c | 69 6e 65 73 20 2a 2f 0a |cont'd l|ines */.|
|00004b80| 58 09 09 77 5f 73 65 74 | 70 74 72 28 77 6c 70 5b |X..w_set|ptr(wlp[|
|00004b90| 63 75 72 72 5f 79 5d 2d | 3e 73 74 61 72 74 2c 20 |curr_y]-|>start, |
|00004ba0| 26 77 5f 70 31 29 3b 09 | 09 2f 2a 20 70 6f 69 6e |&w_p1);.|./* poin|
|00004bb0| 74 65 72 20 74 6f 20 73 | 74 61 72 74 20 6f 66 20 |ter to s|tart of |
|00004bc0| 61 72 65 61 20 74 6f 20 | 72 65 64 72 61 77 20 2a |area to |redraw *|
|00004bd0| 2f 0a 58 09 09 63 75 72 | 72 5f 78 20 3d 20 77 6c |/.X..cur|r_x = wl|
|00004be0| 70 5b 63 75 72 72 5f 79 | 5d 2d 3e 63 6f 6c 3b 09 |p[curr_y|]->col;.|
|00004bf0| 09 09 09 09 2f 2a 20 72 | 65 64 72 61 77 20 73 74 |..../* r|edraw st|
|00004c00| 61 72 74 73 20 61 74 20 | 6c 69 6e 65 27 73 20 66 |arts at |line's f|
|00004c10| 69 72 73 74 20 63 6f 6c | 75 6d 6e 20 2a 2f 0a 58 |irst col|umn */.X|
|00004c20| 09 09 77 69 6e 64 6f 77 | 32 28 30 29 3b 09 09 09 |..window|2(0);...|
|00004c30| 09 09 09 09 09 09 2f 2a | 20 72 65 77 72 69 74 65 |....../*| rewrite|
|00004c40| 20 6e 65 77 6c 79 20 63 | 6c 65 61 72 65 64 20 72 | newly c|leared r|
|00004c50| 65 67 69 6f 6e 20 2a 2f | 0a 58 09 09 7d 0a 58 0a |egion */|.X..}.X.|
|00004c60| 58 09 65 6c 73 65 20 77 | 69 6e 64 6f 77 31 5f 61 |X.else w|indow1_a|
|00004c70| 62 73 28 29 3b 09 09 09 | 09 09 09 2f 2a 20 6d 6f |bs();...|.../* mo|
|00004c80| 76 65 20 64 6f 77 6e 20 | 69 73 20 74 6f 6f 20 66 |ve down |is too f|
|00004c90| 61 72 3a 20 72 65 64 72 | 61 77 20 66 75 6c 6c 79 |ar: redr|aw fully|
|00004ca0| 20 2a 2f 0a 58 09 7d 0a | 58 0a 58 0a 58 0a 58 2f | */.X.}.|X.X.X.X/|
|00004cb0| 2a 20 72 6f 75 74 69 6e | 65 20 74 6f 20 72 65 6d |* routin|e to rem|
|00004cc0| 6f 76 65 20 74 68 65 20 | 65 78 69 73 74 69 6e 67 |ove the |existing|
|00004cd0| 20 63 75 72 73 6f 72 20 | 2a 2f 0a 58 0a 58 77 5f | cursor |*/.X.Xw_|
|00004ce0| 72 6d 63 75 72 73 28 29 | 0a 58 09 7b 0a 58 09 69 |rmcurs()|.X.{.X.i|
|00004cf0| 66 20 28 63 75 72 73 5f | 63 29 09 09 09 2f 2a 20 |f (curs_|c).../* |
|00004d00| 69 66 20 74 68 65 72 65 | 20 77 61 73 20 61 20 63 |if there| was a c|
|00004d10| 75 72 73 6f 72 20 2a 2f | 0a 58 09 09 7b 0a 58 09 |ursor */|.X..{.X.|
|00004d20| 09 77 5f 6d 6f 76 65 28 | 63 75 72 73 5f 79 2c 20 |.w_move(|curs_y, |
|00004d30| 63 75 72 73 5f 78 29 3b | 09 09 2f 2a 20 67 6f 20 |curs_x);|../* go |
|00004d40| 72 65 6d 6f 76 65 20 74 | 68 65 20 6f 6c 64 20 63 |remove t|he old c|
|00004d50| 75 72 73 6f 72 20 2a 2f | 0a 58 09 09 69 66 20 28 |ursor */|.X..if (|
|00004d60| 63 75 72 73 5f 63 20 26 | 20 57 5f 4d 41 52 4b 29 |curs_c &| W_MARK)|
|00004d70| 20 66 70 75 74 73 28 22 | 5c 30 33 33 28 30 22 2c | fputs("|\033(0",|
|00004d80| 20 73 74 64 6f 75 74 29 | 3b 09 09 2f 2a 20 69 66 | stdout)|;../* if|
|00004d90| 20 70 72 65 76 20 63 68 | 61 72 20 77 61 73 20 61 | prev ch|ar was a|
|00004da0| 20 73 70 65 63 20 63 68 | 61 72 20 2a 2f 0a 58 09 | spec ch|ar */.X.|
|00004db0| 09 70 75 74 63 68 61 72 | 28 2a 63 75 72 73 5f 70 |.putchar|(*curs_p|
|00004dc0| 20 3d 20 63 75 72 73 5f | 63 29 3b 09 2f 2a 20 70 | = curs_|c);./* p|
|00004dd0| 75 74 20 62 61 63 6b 20 | 74 68 65 20 63 68 61 72 |ut back |the char|
|00004de0| 20 74 68 61 74 20 77 61 | 73 20 74 68 65 72 65 20 | that wa|s there |
|00004df0| 2a 2f 0a 58 09 09 69 66 | 20 28 63 75 72 73 5f 63 |*/.X..if| (curs_c|
|00004e00| 20 26 20 57 5f 4d 41 52 | 4b 29 20 66 70 75 74 73 | & W_MAR|K) fputs|
|00004e10| 28 22 5c 30 33 33 28 42 | 22 2c 20 73 74 64 6f 75 |("\033(B|", stdou|
|00004e20| 74 29 3b 0a 58 09 09 2b | 2b 74 65 72 6d 5f 78 3b |t);.X..+|+term_x;|
|00004e30| 09 09 09 09 09 2f 2a 20 | 61 6e 64 20 6b 65 65 70 |...../* |and keep|
|00004e40| 20 74 68 65 20 74 65 72 | 6d 69 6e 61 6c 20 63 75 | the ter|minal cu|
|00004e50| 72 73 6f 72 20 6c 6f 63 | 2e 20 68 61 70 70 79 20 |rsor loc|. happy |
|00004e60| 2a 2f 0a 58 09 09 7d 0a | 58 09 7d 0a 58 0c 2f 2a |*/.X..}.|X.}.X./*|
|00004e70| 20 72 6f 75 74 69 6e 65 | 20 74 6f 20 64 6f 20 61 | routine| to do a|
|00004e80| 63 74 75 61 6c 20 64 69 | 73 70 6c 61 79 20 72 65 |ctual di|splay re|
|00004e90| 66 72 65 73 68 09 09 09 | 09 09 09 09 09 09 09 09 |fresh...|........|
|00004ea0| 09 2a 2f 0a 58 2f 2a 20 | 63 61 6c 6c 65 64 20 77 |.*/.X/* |called w|
|00004eb0| 69 74 68 20 77 5f 70 31 | 20 61 74 20 73 74 61 72 |ith w_p1| at star|
|00004ec0| 74 69 6e 67 20 63 68 61 | 72 2c 20 63 75 72 72 5f |ting cha|r, curr_|
|00004ed0| 79 2c 20 63 75 72 72 5f | 78 20 61 74 20 73 74 61 |y, curr_|x at sta|
|00004ee0| 72 74 69 6e 67 20 63 6f | 6f 72 64 69 6e 61 74 65 |rting co|ordinate|
|00004ef0| 09 09 09 2a 2f 0a 58 2f | 2a 20 72 65 77 72 69 74 |...*/.X/|* rewrit|
|00004f00| 65 73 20 74 6f 20 65 6e | 64 20 6f 66 20 73 63 72 |es to en|d of scr|
|00004f10| 65 65 6e 20 69 66 20 61 | 72 67 20 3d 20 30 2c 20 |een if a|rg = 0, |
|00004f20| 6f 72 20 6f 6e 6c 79 20 | 75 6e 74 69 6c 20 6c 69 |or only |until li|
|00004f30| 6e 65 20 77 69 74 68 20 | 63 75 72 73 6f 72 20 69 |ne with |cursor i|
|00004f40| 66 20 61 72 67 20 3d 20 | 31 09 2a 2f 0a 58 0a 58 |f arg = |1.*/.X.X|
|00004f50| 77 69 6e 64 6f 77 32 28 | 61 72 67 29 0a 58 09 69 |window2(|arg).X.i|
|00004f60| 6e 74 20 61 72 67 3b 0a | 58 09 7b 0a 58 09 72 65 |nt arg;.|X.{.X.re|
|00004f70| 67 69 73 74 65 72 20 69 | 6e 74 20 77 64 6f 74 3b |gister i|nt wdot;|
|00004f80| 0a 58 09 72 65 67 69 73 | 74 65 72 20 63 68 61 72 |.X.regis|ter char|
|00004f90| 20 77 63 3b 09 09 09 2f | 2a 20 74 65 6d 70 20 63 | wc;.../|* temp c|
|00004fa0| 68 61 72 20 2a 2f 0a 58 | 09 72 65 67 69 73 74 65 |har */.X|.registe|
|00004fb0| 72 20 73 68 6f 72 74 20 | 64 66 6c 61 67 3b 09 09 |r short |dflag;..|
|00004fc0| 2f 2a 20 6e 6f 6e 7a 65 | 72 6f 20 69 66 20 74 68 |/* nonze|ro if th|
|00004fd0| 69 73 20 69 73 20 63 68 | 61 72 20 61 74 20 64 6f |is is ch|ar at do|
|00004fe0| 74 20 2a 2f 0a 58 09 73 | 68 6f 72 74 20 63 72 5f |t */.X.s|hort cr_|
|00004ff0| 66 6f 75 6e 64 3b 09 09 | 09 09 2f 2a 20 69 6e 64 |found;..|../* ind|
|00005000| 69 63 61 74 65 73 20 61 | 20 63 72 20 66 6f 75 6e |icates a| cr foun|
|00005010| 64 20 6f 6e 20 74 68 69 | 73 20 6c 69 6e 65 20 2a |d on thi|s line *|
|00005020| 2f 0a 58 0a 58 09 63 72 | 5f 66 6f 75 6e 64 20 3d |/.X.X.cr|_found =|
|00005030| 20 30 3b 09 09 09 09 2f | 2a 20 63 6c 65 61 72 20 | 0;..../|* clear |
|00005040| 22 63 72 22 20 66 6c 61 | 67 20 69 6e 20 66 69 72 |"cr" fla|g in fir|
|00005050| 73 74 20 6c 69 6e 65 20 | 77 72 69 74 74 65 6e 20 |st line |written |
|00005060| 2a 2f 0a 58 09 66 6f 72 | 20 28 77 64 6f 74 20 3d |*/.X.for| (wdot =|
|00005070| 20 77 5f 70 31 2e 64 6f | 74 3b 20 28 63 75 72 72 | w_p1.do|t; (curr|
|00005080| 5f 79 20 3c 20 77 69 6e | 64 6f 77 5f 73 69 7a 65 |_y < win|dow_size|
|00005090| 29 20 26 26 20 28 77 64 | 6f 74 20 3c 20 7a 29 3b |) && (wd|ot < z);|
|000050a0| 20 77 64 6f 74 2b 2b 29 | 09 09 2f 2a 20 66 6f 72 | wdot++)|../* for|
|000050b0| 20 65 61 63 68 20 63 68 | 61 72 61 63 74 65 72 20 | each ch|aracter |
|000050c0| 2a 2f 0a 58 09 09 7b 0a | 58 09 09 77 63 20 3d 20 |*/.X..{.|X..wc = |
|000050d0| 77 5f 70 31 2e 70 2d 3e | 63 68 5b 77 5f 70 31 2e |w_p1.p->|ch[w_p1.|
|000050e0| 63 5d 20 26 20 30 31 37 | 37 3b 09 09 2f 2a 20 67 |c] & 017|7;../* g|
|000050f0| 65 74 20 63 68 61 72 61 | 63 74 65 72 20 2a 2f 0a |et chara|cter */.|
|00005100| 58 09 09 69 66 20 28 64 | 66 6c 61 67 20 3d 20 28 |X..if (d|flag = (|
|00005110| 77 64 6f 74 20 3d 3d 20 | 64 6f 74 29 29 20 69 66 |wdot == |dot)) if|
|00005120| 20 28 61 72 67 29 20 61 | 72 67 20 3d 20 2d 31 3b | (arg) a|rg = -1;|
|00005130| 09 09 2f 2a 20 73 61 76 | 65 20 22 74 68 69 73 20 |../* sav|e "this |
|00005140| 69 73 20 63 68 61 72 20 | 61 74 20 64 6f 74 22 2c |is char |at dot",|
|00005150| 20 22 6f 6e 20 6c 69 6e | 65 20 77 69 74 68 20 64 | "on lin|e with d|
|00005160| 6f 74 22 20 2a 2f 0a 58 | 0a 58 09 09 69 66 20 28 |ot" */.X|.X..if (|
|00005170| 77 63 20 3c 20 27 20 27 | 29 20 73 77 69 74 63 68 |wc < ' '|) switch|
|00005180| 20 28 77 63 29 09 09 09 | 09 2f 2a 20 64 69 73 70 | (wc)...|./* disp|
|00005190| 61 74 63 68 20 63 6f 6e | 74 72 6f 6c 20 63 68 61 |atch con|trol cha|
|000051a0| 72 61 63 74 65 72 73 20 | 2a 2f 0a 58 09 09 09 7b |racters |*/.X...{|
|000051b0| 0a 58 09 09 09 63 61 73 | 65 20 43 52 3a 0a 58 09 |.X...cas|e CR:.X.|
|000051c0| 09 09 09 69 66 20 28 64 | 66 6c 61 67 29 09 09 09 |...if (d|flag)...|
|000051d0| 2f 2a 20 69 66 20 63 75 | 72 73 6f 72 20 6f 6e 20 |/* if cu|rsor on |
|000051e0| 74 68 69 73 20 43 52 20 | 2a 2f 0a 58 09 09 09 09 |this CR |*/.X....|
|000051f0| 09 7b 0a 58 09 09 09 09 | 09 69 66 20 28 63 75 72 |.{.X....|.if (cur|
|00005200| 72 5f 78 20 3c 20 57 4e | 5f 77 69 64 74 68 29 20 |r_x < WN|_width) |
|00005210| 77 5f 6d 61 6b 65 63 75 | 72 73 28 27 20 27 2c 20 |w_makecu|rs(' ', |
|00005220| 31 29 2c 20 77 5f 74 79 | 70 65 28 27 20 27 2c 20 |1), w_ty|pe(' ', |
|00005230| 31 29 3b 09 2f 2a 20 64 | 69 73 70 6c 61 79 20 61 |1);./* d|isplay a|
|00005240| 20 73 70 61 63 65 2c 20 | 75 6e 6c 65 73 73 20 61 | space, |unless a|
|00005250| 74 20 65 6e 64 20 2a 2f | 0a 58 09 09 09 09 09 65 |t end */|.X.....e|
|00005260| 6c 73 65 20 63 75 72 73 | 5f 63 72 66 6c 61 67 20 |lse curs|_crflag |
|00005270| 3d 20 63 75 72 73 5f 63 | 20 3d 20 30 3b 09 09 09 |= curs_c| = 0;...|
|00005280| 09 2f 2a 20 65 6c 73 65 | 20 73 65 74 20 22 6e 6f |./* else| set "no|
|00005290| 20 63 75 72 73 6f 72 20 | 64 69 73 70 6c 61 79 65 | cursor |displaye|
|000052a0| 64 22 20 2a 2f 0a 58 09 | 09 09 09 09 7d 0a 58 09 |d" */.X.|....}.X.|
|000052b0| 09 09 09 2f 2a 20 74 72 | 69 6d 20 72 65 6d 61 69 |.../* tr|im remai|
|000052c0| 6e 64 65 72 20 6f 66 20 | 6c 69 6e 65 20 69 66 20 |nder of |line if |
|000052d0| 74 68 69 73 20 69 73 20 | 66 69 72 73 74 20 63 72 |this is |first cr|
|000052e0| 20 61 6e 64 20 6f 6c 64 | 20 6c 69 6e 65 20 77 61 | and old| line wa|
|000052f0| 73 20 6c 6f 6e 67 65 72 | 20 2a 2f 0a 58 09 09 09 |s longer| */.X...|
|00005300| 09 69 66 20 28 21 63 72 | 5f 66 6f 75 6e 64 20 26 |.if (!cr|_found &|
|00005310| 26 20 28 28 63 75 72 72 | 5f 78 20 3c 20 77 6c 70 |& ((curr|_x < wlp|
|00005320| 5b 63 75 72 72 5f 79 5d | 2d 3e 6e 29 20 7c 7c 20 |[curr_y]|->n) || |
|00005330| 72 65 64 72 61 77 5f 73 | 77 29 29 0a 58 09 09 09 |redraw_s|w)).X...|
|00005340| 09 09 7b 0a 58 09 09 09 | 09 09 77 6c 70 5b 63 75 |..{.X...|..wlp[cu|
|00005350| 72 72 5f 79 5d 2d 3e 6e | 20 3d 20 63 75 72 72 5f |rr_y]->n| = curr_|
|00005360| 78 3b 0a 58 09 09 09 09 | 09 69 66 20 28 63 75 72 |x;.X....|.if (cur|
|00005370| 72 5f 78 20 3c 20 57 4e | 5f 77 69 64 74 68 29 20 |r_x < WN|_width) |
|00005380| 76 74 6d 28 56 54 5f 45 | 45 4f 4c 29 3b 0a 58 09 |vtm(VT_E|EOL);.X.|
|00005390| 09 09 09 09 7d 0a 58 09 | 09 09 09 63 72 5f 66 6f |....}.X.|...cr_fo|
|000053a0| 75 6e 64 20 3d 20 31 3b | 09 09 09 2f 2a 20 73 65 |und = 1;|.../* se|
|000053b0| 74 20 63 72 20 66 6c 61 | 67 20 2a 2f 0a 58 09 09 |t cr fla|g */.X..|
|000053c0| 09 09 77 6c 70 5b 63 75 | 72 72 5f 79 5d 2d 3e 63 |..wlp[cu|rr_y]->c|
|000053d0| 66 6c 61 67 20 26 3d 20 | 7e 57 46 5f 42 45 47 3b |flag &= |~WF_BEG;|
|000053e0| 09 09 2f 2a 20 74 68 69 | 73 20 6c 69 6e 65 20 69 |../* thi|s line i|
|000053f0| 73 20 6e 6f 74 20 63 6f | 6e 74 69 6e 75 65 64 20 |s not co|ntinued |
|00005400| 2a 2f 0a 58 09 09 09 09 | 77 68 69 6c 65 20 28 63 |*/.X....|while (c|
|00005410| 75 72 72 5f 79 20 26 26 | 20 28 77 6c 70 5b 63 75 |urr_y &&| (wlp[cu|
|00005420| 72 72 5f 79 5d 2d 3e 63 | 66 6c 61 67 20 26 20 57 |rr_y]->c|flag & W|
|00005430| 46 5f 43 4f 4e 54 29 29 | 20 2d 2d 63 75 72 72 5f |F_CONT))| --curr_|
|00005440| 79 3b 09 09 2f 2a 20 69 | 66 20 6c 69 6e 65 20 69 |y;../* i|f line i|
|00005450| 73 20 61 20 63 6f 6e 74 | 69 6e 75 61 74 69 6f 6e |s a cont|inuation|
|00005460| 2c 20 73 63 61 6e 20 75 | 70 20 2a 2f 0a 58 09 09 |, scan u|p */.X..|
|00005470| 09 09 63 75 72 72 5f 78 | 20 3d 20 30 3b 0a 58 09 |..curr_x| = 0;.X.|
|00005480| 09 09 09 62 72 65 61 6b | 3b 0a 58 0a 58 09 09 09 |...break|;.X.X...|
|00005490| 63 61 73 65 20 54 41 42 | 3a 0a 58 09 09 09 09 69 |case TAB|:.X....i|
|000054a0| 66 20 28 63 75 72 72 5f | 78 20 3e 3d 20 57 4e 5f |f (curr_|x >= WN_|
|000054b0| 77 69 64 74 68 29 0a 58 | 09 09 09 09 09 7b 0a 58 |width).X|.....{.X|
|000054c0| 09 09 09 09 09 69 66 20 | 28 65 74 5f 76 61 6c 20 |.....if |(et_val |
|000054d0| 26 20 45 54 5f 54 52 55 | 4e 43 29 20 67 6f 74 6f |& ET_TRU|NC) goto|
|000054e0| 20 6e 6f 70 72 69 6e 74 | 3b 0a 58 09 09 09 09 09 | noprint|;.X.....|
|000054f0| 69 66 20 28 77 5f 6f 76 | 65 72 66 6c 6f 77 28 77 |if (w_ov|erflow(w|
|00005500| 64 6f 74 29 29 20 67 6f | 74 6f 20 77 32 5f 65 78 |dot)) go|to w2_ex|
|00005510| 69 74 3b 09 09 09 09 2f | 2a 20 65 78 74 65 6e 64 |it;..../|* extend|
|00005520| 20 6c 69 6e 65 20 2a 2f | 0a 58 09 09 09 09 09 7d | line */|.X.....}|
|00005530| 0a 58 09 09 09 09 69 66 | 20 28 64 66 6c 61 67 29 |.X....if| (dflag)|
|00005540| 20 77 5f 6d 61 6b 65 63 | 75 72 73 28 27 20 27 2c | w_makec|urs(' ',|
|00005550| 20 30 29 3b 0a 58 09 09 | 09 09 77 5f 74 79 70 65 | 0);.X..|..w_type|
|00005560| 28 27 20 27 2c 20 64 66 | 6c 61 67 29 3b 09 09 09 |(' ', df|lag);...|
|00005570| 09 09 09 2f 2a 20 74 79 | 70 65 20 6f 6e 65 20 73 |.../* ty|pe one s|
|00005580| 70 61 63 65 20 2a 2f 0a | 58 09 09 09 09 69 66 20 |pace */.|X....if |
|00005590| 28 64 66 6c 61 67 29 0a | 58 09 09 09 09 09 7b 0a |(dflag).|X.....{.|
|000055a0| 58 09 09 09 09 09 76 74 | 28 56 54 5f 43 4c 52 53 |X.....vt|(VT_CLRS|
|000055b0| 50 45 43 29 3b 09 09 2f | 2a 20 65 6e 64 20 72 65 |PEC);../|* end re|
|000055c0| 76 65 72 73 65 20 76 69 | 64 65 6f 20 2a 2f 0a 58 |verse vi|deo */.X|
|000055d0| 09 09 09 09 09 64 66 6c | 61 67 20 3d 20 30 3b 0a |.....dfl|ag = 0;.|
|000055e0| 58 09 09 09 09 09 7d 0a | 58 09 09 09 09 77 68 69 |X.....}.|X....whi|
|000055f0| 6c 65 20 28 28 63 75 72 | 72 5f 78 20 26 20 74 61 |le ((cur|r_x & ta|
|00005600| 62 6d 61 73 6b 29 20 26 | 26 20 28 63 75 72 72 5f |bmask) &|& (curr_|
|00005610| 78 20 3c 20 57 4e 5f 77 | 69 64 74 68 29 29 20 77 |x < WN_w|idth)) w|
|00005620| 5f 74 79 70 65 28 27 20 | 27 2c 20 30 29 3b 09 09 |_type(' |', 0);..|
|00005630| 2f 2a 20 66 69 6e 69 73 | 68 20 74 61 62 20 2a 2f |/* finis|h tab */|
|00005640| 0a 58 09 09 09 09 62 72 | 65 61 6b 3b 0a 58 0c 09 |.X....br|eak;.X..|
|00005650| 09 09 63 61 73 65 20 4c | 46 3a 0a 58 09 09 09 09 |..case L|F:.X....|
|00005660| 77 68 69 6c 65 20 28 28 | 63 75 72 72 5f 79 20 3c |while ((|curr_y <|
|00005670| 20 77 69 6e 64 6f 77 5f | 73 69 7a 65 29 20 26 26 | window_|size) &&|
|00005680| 20 28 77 6c 70 5b 63 75 | 72 72 5f 79 5d 2d 3e 63 | (wlp[cu|rr_y]->c|
|00005690| 66 6c 61 67 20 26 20 57 | 46 5f 42 45 47 29 29 20 |flag & W|F_BEG)) |
|000056a0| 2b 2b 63 75 72 72 5f 79 | 3b 09 2f 2a 20 6c 61 73 |++curr_y|;./* las|
|000056b0| 74 20 73 63 72 65 65 6e | 20 72 6f 77 20 6f 66 20 |t screen| row of |
|000056c0| 74 68 69 73 20 6c 69 6e | 65 20 2a 2f 0a 58 09 09 |this lin|e */.X..|
|000056d0| 09 09 77 6c 70 5b 63 75 | 72 72 5f 79 5d 2d 3e 65 |..wlp[cu|rr_y]->e|
|000056e0| 6e 64 20 3d 20 77 64 6f | 74 3b 09 09 2f 2a 20 73 |nd = wdo|t;../* s|
|000056f0| 61 76 65 20 63 68 61 72 | 20 70 6f 73 69 74 69 6f |ave char| positio|
|00005700| 6e 20 74 68 61 74 20 65 | 6e 64 65 64 20 74 68 69 |n that e|nded thi|
|00005710| 73 20 6c 69 6e 65 20 2a | 2f 0a 58 09 09 09 09 69 |s line *|/.X....i|
|00005720| 66 20 28 64 66 6c 61 67 | 29 09 09 2f 2a 20 69 66 |f (dflag|)../* if|
|00005730| 20 74 68 69 73 20 4c 46 | 20 69 73 20 61 74 20 64 | this LF| is at d|
|00005740| 6f 74 20 2a 2f 0a 58 09 | 09 09 09 09 7b 09 09 09 |ot */.X.|....{...|
|00005750| 2f 2a 20 70 75 74 20 63 | 75 72 73 6f 72 20 74 68 |/* put c|ursor th|
|00005760| 65 72 65 2c 20 73 61 76 | 65 20 63 68 61 72 20 74 |ere, sav|e char t|
|00005770| 68 61 74 20 77 61 73 20 | 74 68 65 72 65 20 2a 2f |hat was |there */|
|00005780| 0a 58 09 09 09 09 09 77 | 5f 6d 61 6b 65 63 75 72 |.X.....w|_makecur|
|00005790| 73 28 20 28 63 75 72 72 | 5f 78 20 3c 20 77 6c 70 |s( (curr|_x < wlp|
|000057a0| 5b 63 75 72 72 5f 79 5d | 2d 3e 6e 29 20 3f 20 77 |[curr_y]|->n) ? w|
|000057b0| 6c 70 5b 63 75 72 72 5f | 79 5d 2d 3e 63 68 5b 63 |lp[curr_|y]->ch[c|
|000057c0| 75 72 72 5f 78 5d 20 3a | 20 27 20 27 2c 20 30 29 |urr_x] :| ' ', 0)|
|000057d0| 3b 0a 58 09 09 09 09 09 | 66 70 75 74 73 28 22 5c |;.X.....|fputs("\|
|000057e0| 30 33 33 28 30 22 2c 20 | 73 74 64 6f 75 74 29 3b |033(0", |stdout);|
|000057f0| 09 09 09 2f 2a 20 70 75 | 74 20 69 6e 20 61 20 22 |.../* pu|t in a "|
|00005800| 4c 46 22 20 63 68 61 72 | 20 2a 2f 0a 58 09 09 09 |LF" char| */.X...|
|00005810| 09 09 77 5f 74 79 70 65 | 28 27 65 27 2c 20 31 29 |..w_type|('e', 1)|
|00005820| 3b 0a 58 09 09 09 09 09 | 66 70 75 74 73 28 22 5c |;.X.....|fputs("\|
|00005830| 30 33 33 28 42 22 2c 20 | 73 74 64 6f 75 74 29 3b |033(B", |stdout);|
|00005840| 0a 58 09 09 09 09 09 7d | 09 09 09 2f 2a 20 69 66 |.X.....}|.../* if|
|00005850| 20 6e 6f 20 63 72 20 66 | 6f 75 6e 64 20 61 6e 64 | no cr f|ound and|
|00005860| 20 6e 6f 74 20 69 6e 20 | 6c 61 73 74 20 63 6f 6c | not in |last col|
|00005870| 75 6d 6e 2c 20 65 72 61 | 73 65 20 72 65 73 74 20 |umn, era|se rest |
|00005880| 6f 66 20 6c 69 6e 65 20 | 2a 2f 0a 58 09 09 09 09 |of line |*/.X....|
|00005890| 69 66 20 28 21 63 72 5f | 66 6f 75 6e 64 20 26 26 |if (!cr_|found &&|
|000058a0| 20 28 63 75 72 72 5f 78 | 20 3c 20 77 6c 70 5b 63 | (curr_x| < wlp[c|
|000058b0| 75 72 72 5f 79 5d 2d 3e | 6e 29 29 0a 58 09 09 09 |urr_y]->|n)).X...|
|000058c0| 09 09 7b 0a 58 09 09 09 | 09 09 77 6c 70 5b 63 75 |..{.X...|..wlp[cu|
|000058d0| 72 72 5f 79 5d 2d 3e 6e | 20 3d 20 63 75 72 72 5f |rr_y]->n| = curr_|
|000058e0| 78 3b 0a 58 09 09 09 09 | 09 69 66 20 28 63 75 72 |x;.X....|.if (cur|
|000058f0| 72 5f 78 20 3c 20 57 4e | 5f 77 69 64 74 68 29 20 |r_x < WN|_width) |
|00005900| 76 74 6d 28 56 54 5f 45 | 45 4f 4c 29 3b 0a 58 09 |vtm(VT_E|EOL);.X.|
|00005910| 09 09 09 09 7d 0a 58 09 | 09 09 09 69 66 20 28 64 |....}.X.|...if (d|
|00005920| 66 6c 61 67 29 20 2d 2d | 63 75 72 72 5f 78 3b 09 |flag) --|curr_x;.|
|00005930| 09 09 2f 2a 20 70 75 74 | 20 74 68 65 20 63 75 72 |../* put| the cur|
|00005940| 73 6f 72 20 62 61 63 6b | 20 62 65 66 6f 72 65 20 |sor back| before |
|00005950| 74 68 65 20 61 72 74 69 | 66 69 63 69 61 6c 20 4c |the arti|ficial L|
|00005960| 46 20 63 68 61 72 2c 20 | 69 66 20 61 6e 79 20 2a |F char, |if any *|
|00005970| 2f 0a 58 09 09 09 09 69 | 66 20 28 63 75 72 72 5f |/.X....i|f (curr_|
|00005980| 79 20 3e 3d 20 77 69 6e | 64 6f 77 5f 73 69 7a 65 |y >= win|dow_size|
|00005990| 2d 31 29 09 2f 2a 20 69 | 66 20 61 74 20 65 6e 64 |-1)./* i|f at end|
|000059a0| 20 6f 66 20 73 63 72 65 | 65 6e 2c 20 65 78 69 74 | of scre|en, exit|
|000059b0| 2c 20 62 75 74 2e 2e 2e | 20 2a 2f 0a 58 09 09 09 |, but...| */.X...|
|000059c0| 09 09 7b 0a 58 09 09 09 | 09 09 69 66 20 28 64 66 |..{.X...|..if (df|
|000059d0| 6c 61 67 29 20 76 74 28 | 56 54 5f 43 4c 52 53 50 |lag) vt(|VT_CLRSP|
|000059e0| 45 43 29 3b 09 2f 2a 20 | 69 66 20 63 75 72 73 6f |EC);./* |if curso|
|000059f0| 72 20 69 73 20 68 65 72 | 65 2c 20 63 6c 65 61 72 |r is her|e, clear|
|00005a00| 20 72 65 76 65 72 73 65 | 20 76 69 64 65 6f 20 66 | reverse| video f|
|00005a10| 69 72 73 74 20 2a 2f 0a | 58 09 09 09 09 09 67 6f |irst */.|X.....go|
|00005a20| 74 6f 20 77 32 5f 65 78 | 69 74 3b 0a 58 09 09 09 |to w2_ex|it;.X...|
|00005a30| 09 09 7d 0a 58 0a 58 09 | 09 09 09 69 66 20 28 28 |..}.X.X.|...if ((|
|00005a40| 77 6c 70 5b 63 75 72 72 | 5f 79 5d 2d 3e 63 66 6c |wlp[curr|_y]->cfl|
|00005a50| 61 67 20 26 20 57 46 5f | 43 4f 4e 54 29 20 26 26 |ag & WF_|CONT) &&|
|00005a60| 20 28 77 6c 70 5b 63 75 | 72 72 5f 79 5d 2d 3e 65 | (wlp[cu|rr_y]->e|
|00005a70| 6e 64 20 2d 20 77 6c 70 | 5b 63 75 72 72 5f 79 5d |nd - wlp|[curr_y]|
|00005a80| 2d 3e 73 74 61 72 74 20 | 3d 3d 20 31 29 29 09 2f |->start |== 1))./|
|00005a90| 2a 20 69 66 20 61 20 6e | 6f 77 2d 65 6d 70 74 79 |* if a n|ow-empty|
|00005aa0| 20 63 6f 6e 74 2e 20 6c | 69 6e 65 2c 20 2a 2f 0a | cont. l|ine, */.|
|00005ab0| 58 09 09 09 09 09 7b 09 | 09 09 09 09 09 09 09 09 |X.....{.|........|
|00005ac0| 09 09 09 09 09 09 2f 2a | 20 66 6c 75 73 68 20 69 |....../*| flush i|
|00005ad0| 74 20 2a 2f 0a 58 09 09 | 09 09 09 69 66 20 28 63 |t */.X..|...if (c|
|00005ae0| 75 72 72 5f 79 20 3e 20 | 30 29 20 77 6c 70 5b 63 |urr_y > |0) wlp[c|
|00005af0| 75 72 72 5f 79 2d 31 5d | 2d 3e 63 66 6c 61 67 20 |urr_y-1]|->cflag |
|00005b00| 26 3d 20 7e 57 46 5f 42 | 45 47 3b 09 09 09 2f 2a |&= ~WF_B|EG;.../*|
|00005b10| 20 72 65 6d 6f 76 65 20 | 22 63 6f 6e 74 27 64 22 | remove |"cont'd"|
|00005b20| 20 66 6c 61 67 20 66 72 | 6f 6d 20 70 72 65 76 20 | flag fr|om prev |
|00005b30| 6c 69 6e 65 20 2a 2f 0a | 58 09 09 09 09 09 61 72 |line */.|X.....ar|
|00005b40| 67 20 3d 20 30 3b 09 09 | 09 09 09 09 09 09 09 09 |g = 0;..|........|
|00005b50| 09 09 09 2f 2a 20 61 6e | 64 20 66 6f 72 63 65 20 |.../* an|d force |
|00005b60| 72 65 64 72 61 77 20 6f | 66 20 72 65 73 74 20 6f |redraw o|f rest o|
|00005b70| 66 20 73 63 72 65 65 6e | 20 2a 2f 0a 58 09 09 09 |f screen| */.X...|
|00005b80| 09 09 69 66 20 28 63 75 | 72 73 5f 79 20 3d 3d 20 |..if (cu|rs_y == |
|00005b90| 63 75 72 72 5f 79 29 20 | 63 75 72 73 5f 63 20 3d |curr_y) |curs_c =|
|00005ba0| 20 30 3b 09 09 09 09 09 | 09 09 2f 2a 20 69 66 20 | 0;.....|../* if |
|00005bb0| 63 75 72 73 6f 72 20 77 | 61 73 20 6f 6e 20 74 68 |cursor w|as on th|
|00005bc0| 69 73 20 6c 69 6e 65 2c | 20 69 74 20 77 69 6c 6c |is line,| it will|
|00005bd0| 20 64 69 73 61 70 70 65 | 61 72 20 2a 2f 0a 58 09 | disappe|ar */.X.|
|00005be0| 09 09 09 09 7d 0a 58 09 | 09 09 09 65 6c 73 65 20 |....}.X.|...else |
|00005bf0| 2b 2b 63 75 72 72 5f 79 | 3b 09 09 09 09 2f 2a 20 |++curr_y|;..../* |
|00005c00| 64 6f 77 6e 20 6f 6e 65 | 20 6c 69 6e 65 20 69 66 |down one| line if|
|00005c10| 20 6e 6f 74 20 61 62 73 | 6f 72 62 69 6e 67 20 62 | not abs|orbing b|
|00005c20| 6c 61 6e 6b 20 63 6f 6e | 74 69 6e 2e 20 6c 69 6e |lank con|tin. lin|
|00005c30| 65 20 2a 2f 0a 58 0a 58 | 09 09 09 09 77 6c 70 5b |e */.X.X|....wlp[|
|00005c40| 63 75 72 72 5f 79 5d 2d | 3e 73 74 61 72 74 20 3d |curr_y]-|>start =|
|00005c50| 20 77 64 6f 74 20 2b 20 | 31 3b 09 09 09 09 2f 2a | wdot + |1;..../*|
|00005c60| 20 61 73 73 75 6d 65 20 | 6c 69 6e 65 20 73 74 61 | assume |line sta|
|00005c70| 72 74 73 20 77 69 74 68 | 20 6e 65 78 74 20 63 68 |rts with| next ch|
|00005c80| 61 72 20 2a 2f 0a 58 09 | 09 09 09 77 6c 70 5b 63 |ar */.X.|...wlp[c|
|00005c90| 75 72 72 5f 79 5d 2d 3e | 63 6f 6c 20 3d 20 63 75 |urr_y]->|col = cu|
|00005ca0| 72 72 5f 78 3b 09 09 09 | 09 09 2f 2a 20 73 61 76 |rr_x;...|../* sav|
|00005cb0| 65 20 73 74 61 72 74 69 | 6e 67 20 63 6f 6c 75 6d |e starti|ng colum|
|00005cc0| 6e 20 2a 2f 0a 58 09 09 | 09 09 63 72 5f 66 6f 75 |n */.X..|..cr_fou|
|00005cd0| 6e 64 20 3d 20 77 6c 70 | 5b 63 75 72 72 5f 79 5d |nd = wlp|[curr_y]|
|00005ce0| 2d 3e 63 66 6c 61 67 20 | 3d 20 30 3b 09 09 09 2f |->cflag |= 0;.../|
|00005cf0| 2a 20 63 6c 65 61 72 20 | 6c 69 6e 65 20 63 6f 6e |* clear |line con|
|00005d00| 74 69 6e 75 61 74 69 6f | 6e 20 66 6c 61 67 73 20 |tinuatio|n flags |
|00005d10| 2a 2f 0a 58 09 09 09 09 | 69 66 20 28 63 75 72 72 |*/.X....|if (curr|
|00005d20| 5f 78 29 20 77 5f 65 62 | 6f 6c 28 29 3b 09 09 09 |_x) w_eb|ol();...|
|00005d30| 09 09 09 2f 2a 20 69 66 | 20 6e 6f 74 20 61 74 20 |.../* if| not at |
|00005d40| 6c 65 66 74 20 6d 61 72 | 67 69 6e 2c 20 65 72 61 |left mar|gin, era|
|00005d50| 73 65 20 62 65 67 69 6e | 6e 69 6e 67 20 6f 66 20 |se begin|ning of |
|00005d60| 6c 69 6e 65 20 2a 2f 0a | 58 09 09 09 09 69 66 20 |line */.|X....if |
|00005d70| 28 61 72 67 20 3d 3d 20 | 2d 31 29 09 09 09 09 09 |(arg == |-1).....|
|00005d80| 09 09 09 2f 2a 20 66 69 | 6e 69 73 68 65 64 20 6c |.../* fi|nished l|
|00005d90| 69 6e 65 20 77 69 74 68 | 20 64 6f 74 2e 2e 2e 20 |ine with| dot... |
|00005da0| 71 75 69 74 20 69 66 20 | 73 70 65 63 27 64 20 2a |quit if |spec'd *|
|00005db0| 2f 0a 58 09 09 09 09 09 | 7b 0a 58 09 09 09 09 09 |/.X.....|{.X.....|
|00005dc0| 69 66 20 28 64 66 6c 61 | 67 29 09 09 09 09 09 09 |if (dfla|g)......|
|00005dd0| 2f 2a 20 62 75 74 20 66 | 69 72 73 74 2c 20 69 66 |/* but f|irst, if|
|00005de0| 20 61 74 20 63 75 72 73 | 6f 72 2c 20 63 6c 65 61 | at curs|or, clea|
|00005df0| 72 20 72 65 76 65 72 73 | 65 20 76 69 64 65 6f 20 |r revers|e video |
|00005e00| 2a 2f 0a 58 09 09 09 09 | 09 09 7b 0a 58 09 09 09 |*/.X....|..{.X...|
|00005e10| 09 09 09 76 74 28 56 54 | 5f 43 4c 52 53 50 45 43 |...vt(VT|_CLRSPEC|
|00005e20| 29 3b 0a 58 09 09 09 09 | 09 09 64 66 6c 61 67 20 |);.X....|..dflag |
|00005e30| 3d 20 30 3b 0a 58 09 09 | 09 09 09 09 7d 0a 58 09 |= 0;.X..|....}.X.|
|00005e40| 09 09 09 09 72 65 74 75 | 72 6e 3b 0a 58 09 09 09 |....retu|rn;.X...|
|00005e50| 09 09 7d 0a 58 09 09 09 | 09 62 72 65 61 6b 3b 0a |..}.X...|.break;.|
|00005e60| 58 0a 58 09 09 09 63 61 | 73 65 20 45 53 43 3a 0a |X.X...ca|se ESC:.|
|00005e70| 58 09 09 09 09 69 66 20 | 28 63 75 72 72 5f 78 20 |X....if |(curr_x |
|00005e80| 3e 3d 20 57 4e 5f 77 69 | 64 74 68 29 0a 58 09 09 |>= WN_wi|dth).X..|
|00005e90| 09 09 09 7b 0a 58 09 09 | 09 09 09 69 66 20 28 65 |...{.X..|...if (e|
|00005ea0| 74 5f 76 61 6c 20 26 20 | 45 54 5f 54 52 55 4e 43 |t_val & |ET_TRUNC|
|00005eb0| 29 20 67 6f 74 6f 20 6e | 6f 70 72 69 6e 74 3b 0a |) goto n|oprint;.|
|00005ec0| 58 09 09 09 09 09 69 66 | 20 28 77 5f 6f 76 65 72 |X.....if| (w_over|
|00005ed0| 66 6c 6f 77 28 77 64 6f | 74 29 29 20 67 6f 74 6f |flow(wdo|t)) goto|
|00005ee0| 20 77 32 5f 65 78 69 74 | 3b 09 09 09 09 2f 2a 20 | w2_exit|;..../* |
|00005ef0| 65 78 74 65 6e 64 20 6c | 69 6e 65 20 2a 2f 0a 58 |extend l|ine */.X|
|00005f00| 09 09 09 09 09 7d 0a 58 | 09 09 09 09 69 66 20 28 |.....}.X|....if (|
|00005f10| 64 66 6c 61 67 29 20 77 | 5f 6d 61 6b 65 63 75 72 |dflag) w|_makecur|
|00005f20| 73 28 27 24 27 2c 20 30 | 29 3b 0a 58 09 09 09 09 |s('$', 0|);.X....|
|00005f30| 77 5f 74 79 70 65 28 27 | 24 27 2c 20 64 66 6c 61 |w_type('|$', dfla|
|00005f40| 67 29 3b 0a 58 09 09 09 | 09 62 72 65 61 6b 3b 0a |g);.X...|.break;.|
|00005f50| 58 0c 09 09 09 64 65 66 | 61 75 6c 74 3a 09 09 09 |X....def|ault:...|
|00005f60| 09 09 2f 2a 20 61 6c 6c | 20 6f 74 68 65 72 20 63 |../* all| other c|
|00005f70| 6f 6e 74 72 6f 6c 20 63 | 68 61 72 73 20 70 72 69 |ontrol c|hars pri|
|00005f80| 6e 74 20 61 73 20 5e 58 | 20 2a 2f 0a 58 09 09 09 |nt as ^X| */.X...|
|00005f90| 09 69 66 20 28 63 75 72 | 72 5f 78 20 3e 3d 20 57 |.if (cur|r_x >= W|
|00005fa0| 4e 5f 77 69 64 74 68 20 | 2d 20 31 29 0a 58 09 09 |N_width |- 1).X..|
|00005fb0| 09 09 09 7b 0a 58 09 09 | 09 09 09 69 66 20 28 65 |...{.X..|...if (e|
|00005fc0| 74 5f 76 61 6c 20 26 20 | 45 54 5f 54 52 55 4e 43 |t_val & |ET_TRUNC|
|00005fd0| 29 20 67 6f 74 6f 20 6e | 6f 70 72 69 6e 74 3b 0a |) goto n|oprint;.|
|00005fe0| 58 09 09 09 09 09 69 66 | 20 28 77 5f 6f 76 65 72 |X.....if| (w_over|
|00005ff0| 66 6c 6f 77 28 77 64 6f | 74 29 29 20 67 6f 74 6f |flow(wdo|t)) goto|
|00006000| 20 77 32 5f 65 78 69 74 | 3b 0a 58 09 09 09 09 09 | w2_exit|;.X.....|
|00006010| 7d 0a 58 09 09 09 09 69 | 66 20 28 64 66 6c 61 67 |}.X....i|f (dflag|
|00006020| 29 20 77 5f 6d 61 6b 65 | 63 75 72 73 28 27 5e 27 |) w_make|curs('^'|
|00006030| 2c 20 30 29 3b 0a 58 09 | 09 09 09 77 5f 74 79 70 |, 0);.X.|...w_typ|
|00006040| 65 28 27 5e 27 2c 20 64 | 66 6c 61 67 29 3b 09 09 |e('^', d|flag);..|
|00006050| 09 09 2f 2a 20 5e 20 2a | 2f 0a 58 09 09 09 09 69 |../* ^ *|/.X....i|
|00006060| 66 20 28 64 66 6c 61 67 | 29 0a 58 09 09 09 09 09 |f (dflag|).X.....|
|00006070| 7b 0a 58 09 09 09 09 09 | 76 74 28 56 54 5f 43 4c |{.X.....|vt(VT_CL|
|00006080| 52 53 50 45 43 29 3b 09 | 09 2f 2a 20 69 66 20 61 |RSPEC);.|./* if a|
|00006090| 74 20 63 75 72 73 6f 72 | 2c 20 63 6c 65 61 72 20 |t cursor|, clear |
|000060a0| 72 65 76 65 72 73 65 20 | 76 69 64 65 6f 20 2a 2f |reverse |video */|
|000060b0| 0a 58 09 09 09 09 09 64 | 66 6c 61 67 20 3d 20 30 |.X.....d|flag = 0|
|000060c0| 3b 0a 58 09 09 09 09 09 | 7d 0a 58 09 09 09 09 77 |;.X.....|}.X....w|
|000060d0| 5f 74 79 70 65 28 77 63 | 20 7c 20 30 31 30 30 2c |_type(wc| | 0100,|
|000060e0| 20 30 29 3b 0a 58 09 09 | 09 09 62 72 65 61 6b 3b | 0);.X..|..break;|
|000060f0| 0a 58 09 09 09 7d 09 09 | 09 09 09 2f 2a 20 65 6e |.X...}..|.../* en|
|00006100| 64 20 22 73 77 69 74 63 | 68 22 20 2a 2f 0a 58 09 |d "switc|h" */.X.|
|00006110| 09 65 6c 73 65 09 09 09 | 09 09 2f 2a 20 61 20 70 |.else...|../* a p|
|00006120| 72 69 6e 74 69 6e 67 20 | 63 68 61 72 61 63 74 65 |rinting |characte|
|00006130| 72 20 2a 2f 0a 58 09 09 | 09 7b 0a 58 09 09 09 69 |r */.X..|.{.X...i|
|00006140| 66 20 28 63 75 72 72 5f | 78 20 3e 3d 20 57 4e 5f |f (curr_|x >= WN_|
|00006150| 77 69 64 74 68 29 0a 58 | 09 09 09 09 7b 0a 58 09 |width).X|....{.X.|
|00006160| 09 09 09 69 66 20 28 65 | 74 5f 76 61 6c 20 26 20 |...if (e|t_val & |
|00006170| 45 54 5f 54 52 55 4e 43 | 29 20 67 6f 74 6f 20 6e |ET_TRUNC|) goto n|
|00006180| 6f 70 72 69 6e 74 3b 0a | 58 09 09 09 09 69 66 20 |oprint;.|X....if |
|00006190| 28 77 5f 6f 76 65 72 66 | 6c 6f 77 28 77 64 6f 74 |(w_overf|low(wdot|
|000061a0| 29 29 20 67 6f 74 6f 20 | 77 32 5f 65 78 69 74 3b |)) goto |w2_exit;|
|000061b0| 09 09 09 09 2f 2a 20 65 | 78 74 65 6e 64 20 6c 69 |..../* e|xtend li|
|000061c0| 6e 65 20 2a 2f 0a 58 09 | 09 09 09 7d 0a 58 09 09 |ne */.X.|...}.X..|
|000061d0| 09 69 66 20 28 64 66 6c | 61 67 29 20 77 5f 6d 61 |.if (dfl|ag) w_ma|
|000061e0| 6b 65 63 75 72 73 28 77 | 63 2c 20 30 29 3b 0a 58 |kecurs(w|c, 0);.X|
|000061f0| 09 09 09 77 5f 74 79 70 | 65 28 77 63 2c 20 64 66 |...w_typ|e(wc, df|
|00006200| 6c 61 67 29 3b 0a 58 09 | 09 09 7d 0a 58 0a 58 09 |lag);.X.|..}.X.X.|
|00006210| 09 69 66 20 28 64 66 6c | 61 67 29 0a 58 09 09 09 |.if (dfl|ag).X...|
|00006220| 7b 0a 58 09 09 09 76 74 | 28 56 54 5f 43 4c 52 53 |{.X...vt|(VT_CLRS|
|00006230| 50 45 43 29 3b 09 09 09 | 09 2f 2a 20 69 66 20 61 |PEC);...|./* if a|
|00006240| 74 20 63 75 72 73 6f 72 | 2c 20 63 6c 65 61 72 20 |t cursor|, clear |
|00006250| 72 65 76 65 72 73 65 20 | 76 69 64 65 6f 20 2a 2f |reverse |video */|
|00006260| 0a 58 09 09 09 7d 0a 58 | 0a 58 09 09 69 66 20 28 |.X...}.X|.X..if (|
|00006270| 28 77 63 20 3d 3d 20 46 | 46 29 20 7c 7c 20 28 77 |(wc == F|F) || (w|
|00006280| 63 20 3d 3d 20 56 54 29 | 29 09 09 09 2f 2a 20 74 |c == VT)|).../* t|
|00006290| 68 65 73 65 20 63 68 61 | 72 73 20 6c 65 61 76 65 |hese cha|rs leave|
|000062a0| 20 61 20 64 69 73 70 6c | 61 79 20 6c 69 6e 65 20 | a displ|ay line |
|000062b0| 62 6c 61 6e 6b 20 2a 2f | 0a 58 09 09 09 7b 0a 58 |blank */|.X...{.X|
|000062c0| 09 09 09 69 66 20 28 72 | 65 64 72 61 77 5f 73 77 |...if (r|edraw_sw|
|000062d0| 20 7c 7c 20 28 63 75 72 | 72 5f 78 20 3c 20 77 6c | || (cur|r_x < wl|
|000062e0| 70 5b 63 75 72 72 5f 79 | 5d 2d 3e 6e 29 29 0a 58 |p[curr_y|]->n)).X|
|000062f0| 09 09 09 09 7b 0a 58 09 | 09 09 09 77 6c 70 5b 63 |....{.X.|...wlp[c|
|00006300| 75 72 72 5f 79 5d 2d 3e | 6e 20 3d 20 63 75 72 72 |urr_y]->|n = curr|
|00006310| 5f 78 3b 0a 58 09 09 09 | 09 69 66 20 28 63 75 72 |_x;.X...|.if (cur|
|00006320| 72 5f 78 20 3c 20 57 4e | 5f 77 69 64 74 68 29 20 |r_x < WN|_width) |
|00006330| 76 74 6d 28 56 54 5f 45 | 45 4f 4c 29 3b 09 2f 2a |vtm(VT_E|EOL);./*|
|00006340| 20 65 72 61 73 65 20 72 | 65 73 74 20 6f 66 20 6c | erase r|est of l|
|00006350| 69 6e 65 20 2a 2f 0a 58 | 09 09 09 09 7d 0a 58 09 |ine */.X|....}.X.|
|00006360| 09 09 77 6c 70 5b 63 75 | 72 72 5f 79 5d 2d 3e 65 |..wlp[cu|rr_y]->e|
|00006370| 6e 64 20 3d 20 77 64 6f | 74 3b 0a 58 09 09 09 69 |nd = wdo|t;.X...i|
|00006380| 66 20 28 63 75 72 72 5f | 79 20 3e 3d 20 77 69 6e |f (curr_|y >= win|
|00006390| 64 6f 77 5f 73 69 7a 65 | 2d 31 29 20 67 6f 74 6f |dow_size|-1) goto|
|000063a0| 20 77 32 5f 65 78 69 74 | 3b 09 2f 2a 20 71 75 69 | w2_exit|;./* qui|
|000063b0| 74 20 69 66 20 6f 76 65 | 72 66 6c 6f 77 20 73 63 |t if ove|rflow sc|
|000063c0| 72 65 65 6e 20 2a 2f 0a | 58 09 09 09 77 6c 70 5b |reen */.|X...wlp[|
|000063d0| 2b 2b 63 75 72 72 5f 79 | 5d 2d 3e 73 74 61 72 74 |++curr_y|]->start|
|000063e0| 20 3d 20 77 64 6f 74 20 | 2b 20 31 3b 0a 58 09 09 | = wdot |+ 1;.X..|
|000063f0| 09 63 72 5f 66 6f 75 6e | 64 20 3d 20 77 6c 70 5b |.cr_foun|d = wlp[|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.