122662Sdist /* 234677Sbostic * Copyright (c) 1981 Regents of the University of California. 334677Sbostic * All rights reserved. 434677Sbostic * 542653Sbostic * %sccs.include.redist.c% 622662Sdist */ 722662Sdist 822662Sdist #ifndef lint 9*60058Sbostic static char sccsid[] = "@(#)erase.c 5.12 (Berkeley) 05/16/93"; 1055957Sbostic #endif /* not lint */ 1122662Sdist 1255957Sbostic #include <curses.h> 132248Sarnold 142248Sarnold /* 1555957Sbostic * werase -- 1655957Sbostic * Erases everything on the window. 172248Sarnold */ 1855957Sbostic int 192248Sarnold werase(win) 2055957Sbostic register WINDOW *win; 2155957Sbostic { 222248Sarnold 2355957Sbostic register int minx, y; 2456647Selan register __LDATA *sp, *end, *start, *maxx; 252248Sarnold 2655957Sbostic #ifdef DEBUG 27*60058Sbostic __CTRACE("werase: (%0.2o)\n", win); 2855957Sbostic #endif 2956238Selan for (y = 0; y < win->maxy; y++) { 3056238Selan minx = -1; 3156238Selan start = win->lines[y]->line; 3256238Selan end = &start[win->maxx]; 332248Sarnold for (sp = start; sp < end; sp++) 3456647Selan if (sp->ch != ' ' || sp->attr != 0) { 3556647Selan maxx = sp; 3656238Selan if (minx == -1) 372248Sarnold minx = sp - start; 3856647Selan sp->ch = ' '; 3956647Selan sp->attr = 0; 402248Sarnold } 4156238Selan if (minx != -1) 4256650Selan __touchline(win, y, minx, maxx - win->lines[y]->line, 4356650Selan 0); 442248Sarnold } 4557472Sbostic return (OK); 462248Sarnold } 47