date and time created 83/08/19 15:05:34 by edward
authorEdward Wang <edward@ucbvax.Berkeley.EDU>
Sat, 20 Aug 1983 06:05:34 +0000 (22:05 -0800)
committerEdward Wang <edward@ucbvax.Berkeley.EDU>
Sat, 20 Aug 1983 06:05:34 +0000 (22:05 -0800)
SCCS-vsn: usr.bin/window/wwcursor.c 3.1

usr/src/usr.bin/window/wwcursor.c [new file with mode: 0644]

diff --git a/usr/src/usr.bin/window/wwcursor.c b/usr/src/usr.bin/window/wwcursor.c
new file mode 100644 (file)
index 0000000..fdb331d
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef lint
+static char *sccsid = "@(#)wwcursor.c  3.1 83/08/19";
+#endif
+
+#include "ww.h"
+
+wwcursor(w, on)
+register struct ww *w;
+{
+       register char *win;
+       register r, c;
+
+       if (on) {
+               if (w->ww_hascursor)
+                       return;
+               w->ww_hascursor = 1;
+       } else {
+               if (!w->ww_hascursor)
+                       return;
+               w->ww_hascursor = 0;
+       }
+       if (wwcursormodes != 0) {
+               win = &w->ww_win[w->ww_cur.r][w->ww_cur.c];
+               if (*win == 0)
+                       w->ww_nvis[w->ww_cur.r]--;
+               else if (*win == wwcursormodes)
+                       w->ww_nvis[w->ww_cur.r]++;
+               *win ^= wwcursormodes;
+       }
+       r = wwcurrow(w);
+       c = wwcurcol(w);
+       if (wwsmap[r][c] == w->ww_index) {
+               wwns[r][c].c_m ^= wwcursormodes;
+               wwtouched[r] = 1;
+       }
+}