xref: /original-bsd/usr.bin/window/wwbox.c (revision a0a7d8f4)
1 #ifndef lint
2 static char sccsid[] = "@(#)wwbox.c	3.4 04/24/85";
3 #endif
4 
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 
11 #include "ww.h"
12 #include "tt.h"
13 
14 wwbox(w, r, c, nr, nc)
15 register struct ww *w;
16 register r, c;
17 int nr, nc;
18 {
19 	register r1, c1;
20 	register i;
21 
22 	r1 = r + nr - 1;
23 	c1 = c + nc - 1;
24 	wwframec(w, r, c, WWF_D|WWF_R);
25 	for (i = c + 1; i < c1; i++)
26 		wwframec(w, r, i, WWF_L|WWF_R);
27 	wwframec(w, r, i, WWF_L|WWF_D);
28 	for (i = r + 1; i < r1; i++)
29 		wwframec(w, i, c1, WWF_U|WWF_D);
30 	wwframec(w, i, c1, WWF_U|WWF_L);
31 	for (i = c1 - 1; i > c; i--)
32 		wwframec(w, r1, i, WWF_R|WWF_L);
33 	wwframec(w, r1, i, WWF_R|WWF_U);
34 	for (i = r1 - 1; i > r; i--)
35 		wwframec(w, i, c, WWF_D|WWF_U);
36 }
37