122654Sdist /* 234677Sbostic * Copyright (c) 1981 Regents of the University of California. 334677Sbostic * All rights reserved. 434677Sbostic * 542653Sbostic * %sccs.include.redist.c% 622654Sdist */ 722654Sdist 822654Sdist #ifndef lint 9*57472Sbostic static char sccsid[] = "@(#)clrtobot.c 5.12 (Berkeley) 01/11/93"; 1055950Sbostic #endif /* not lint */ 1122654Sdist 1255950Sbostic #include <curses.h> 132240Sarnold 142240Sarnold /* 1555950Sbostic * wclrtobot -- 1655950Sbostic * Erase everything on the window. 172240Sarnold */ 1855950Sbostic int 192240Sarnold wclrtobot(win) 2055950Sbostic register WINDOW *win; 2155950Sbostic { 2255950Sbostic register int minx, startx, y; 2356647Selan register __LDATA *sp, *end, *maxx; 242240Sarnold 2556238Selan startx = win->curx; 2656238Selan for (y = win->cury; y < win->maxy; y++) { 2756238Selan minx = -1; 2856238Selan end = &win->lines[y]->line[win->maxx]; 2956238Selan for (sp = &win->lines[y]->line[startx]; sp < end; sp++) 3056647Selan if (sp->ch != ' ' || sp->attr != 0) { 312240Sarnold maxx = sp; 3256238Selan if (minx == -1) 3356238Selan minx = sp - win->lines[y]->line; 3456647Selan sp->ch = ' '; 3556647Selan sp->attr = 0; 362240Sarnold } 3756238Selan if (minx != -1) 3856650Selan __touchline(win, y, minx, maxx - win->lines[y]->line, 3956650Selan 0); 402240Sarnold startx = 0; 412240Sarnold } 42*57472Sbostic return (OK); 432240Sarnold } 44