date and time created 83/08/19 15:05:34 by edward
[unix-history] / usr / src / usr.bin / window / wwcursor.c
CommitLineData
120c3815
EW
1#ifndef lint
2static char *sccsid = "@(#)wwcursor.c 3.1 83/08/19";
3#endif
4
5#include "ww.h"
6
7wwcursor(w, on)
8register struct ww *w;
9{
10 register char *win;
11 register r, c;
12
13 if (on) {
14 if (w->ww_hascursor)
15 return;
16 w->ww_hascursor = 1;
17 } else {
18 if (!w->ww_hascursor)
19 return;
20 w->ww_hascursor = 0;
21 }
22 if (wwcursormodes != 0) {
23 win = &w->ww_win[w->ww_cur.r][w->ww_cur.c];
24 if (*win == 0)
25 w->ww_nvis[w->ww_cur.r]--;
26 else if (*win == wwcursormodes)
27 w->ww_nvis[w->ww_cur.r]++;
28 *win ^= wwcursormodes;
29 }
30 r = wwcurrow(w);
31 c = wwcurcol(w);
32 if (wwsmap[r][c] == w->ww_index) {
33 wwns[r][c].c_m ^= wwcursormodes;
34 wwtouched[r] = 1;
35 }
36}