8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / ucblib / libcurses / touchwin.c
blobdd4e04944e593b76d8beeffb9a12a30b372eb0da
1 /*
2 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
6 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
9 /*
10 * Copyright (c) 1980 Regents of the University of California.
11 * All rights reserved. The Berkeley software License Agreement
12 * specifies the terms and conditions for redistribution.
15 #pragma ident "%Z%%M% %I% %E% SMI"
17 /*LINTLIBRARY*/
19 #ifndef lint
20 static char
21 sccsid[] = "@(#)touchwin.c 1.6 88/02/08 SMI"; /* from UCB 5.1 85/06/07 */
22 #endif /* not lint */
24 #include "curses.ext"
27 * make it look like the whole window has been changed.
31 int
32 touchwin(WINDOW *win)
34 int y, maxy;
36 #ifdef DEBUG
37 fprintf(outf, "TOUCHWIN(%0.2o)\n", win);
38 #endif
39 maxy = win->_maxy;
40 for (y = 0; y < maxy; y++)
41 (void) touchline(win, y, 0, win->_maxx - 1);
42 return (OK);
46 * touch a given line
49 int
50 touchline(WINDOW *win, int y, int sx, int ex)
52 #ifdef DEBUG
53 fprintf(outf, "TOUCHLINE(%0.2o, %d, %d, %d)\n", win, y, sx, ex);
54 fprintf(outf, "TOUCHLINE:first = %d, last = %d\n",
55 win->_firstch[y], win->_lastch[y]);
56 #endif
57 sx += win->_ch_off;
58 ex += win->_ch_off;
59 if (win->_firstch[y] == _NOCHANGE) {
60 win->_firstch[y] = (short)sx;
61 win->_lastch[y] = (short)ex;
62 } else {
63 if (win->_firstch[y] > sx)
64 win->_firstch[y] = (short)sx;
65 if (win->_lastch[y] < ex)
66 win->_lastch[y] = (short)ex;
68 #ifdef DEBUG
69 fprintf(outf, "TOUCHLINE:first = %d, last = %d\n",
70 win->_firstch[y], win->_lastch[y]);
71 #endif
72 return (OK);