fix ctrl macro for ANSI C
[unix-history] / usr / src / usr.bin / window / wwmisc.c
CommitLineData
8584be19 1#ifndef lint
95bc282c 2static char sccsid[] = "@(#)wwmisc.c 3.10 %G%";
8584be19
EW
3#endif
4
60de5df9
EW
5/*
6 * Copyright (c) 1983 Regents of the University of California,
7 * All rights reserved. Redistribution permitted subject to
8 * the terms of the Berkeley Software License Agreement.
9 */
10
8584be19 11#include "ww.h"
e85b5833
EW
12#include "tt.h"
13#include "char.h"
8584be19 14
27b31336 15/*
f2a77fe1 16 * Sufficient but not necessary test for total visibility.
27b31336
EW
17 */
18wwvisible(w)
19register struct ww *w;
20{
21 register i;
22 register nvis = 0;
23
f2a77fe1 24 for (i = w->ww_i.t; i < w->ww_i.b; i++)
27b31336 25 nvis += w->ww_nvis[i];
f2a77fe1 26 if (w->ww_hascursor
e011d63a 27 && w->ww_cur.r >= w->ww_i.t && w->ww_cur.r < w->ww_i.b
f2a77fe1
EW
28 && w->ww_cur.c >= w->ww_i.l && w->ww_cur.c < w->ww_i.r
29 && wwsmap[w->ww_cur.r][w->ww_cur.c] == w->ww_index)
27b31336 30 nvis++;
f2a77fe1 31 return nvis == w->ww_i.nr * w->ww_i.nc;
27b31336 32}
e85b5833
EW
33
34wwbell()
35{
95bc282c 36 ttputc(ctrl('g'));
e85b5833 37}