/* vs_clr.c *********** Copyright 1988-1993 by Vermont Creative Software *********** vs_clr() Clears the screen Call #include void vs_clr() Returns None Description vs_clr() clears the entire screen with spaces using the screen clear attribute. The clear attribute is assigned an initial value of LSYS. This value can be changed within the program using vs_clratt(). UNIX and VMS Systems: If a clear screen escape sequence has been defined, it will be used to clear the screen; otherwise, the screen will be filled with blanks. The escape sequence approach is much faster and is the preferred method. If the escape sequence is used to clear the screen and the global clear attribute is not NORMAL, the current video attribute for the terminal is set to the global clear attribute. The escape sequence is then sent to the terminal to clear the screen. If the screen can only be cleared to NORMAL, spaces are used to clear the screen instead. */ #include #ifdef OLD_STYLE void FASTCALL vs_clr() #else void FASTCALL vs_clr(void) #endif { WINDOWPTR ttop_child; ULONG flags; #ifndef NO_DEBUG_CODE static UCHAR fn[] = "vs_clr"; #endif INIT_MODULE(fn); sw_att(_vid_scr.clratt, FULL_WNP); /* set to clear attribute */ ttop_child = FULL_WNP->top_child; FULL_WNP->top_child = (WINDOWPTR) NULLP; flags = FULL_WNP->flags; FULL_WNP->flags &= ~BUFFERED; /* Enable fast screen clear */ wn_clr(FULL_WNP); /* clear entire window (screen) */ FULL_WNP->flags = flags; /* Restore flags and clear buffer */ v_chattrow(0, 0, FULL_WNP->fill_char, FULL_WNP->att, ENDWN, CHATT, FULL_WNP); cs_mv(0, 0, FULL_WNP); /* reposition virtual cursor to origin*/ FULL_WNP->top_child = ttop_child; EXIT_NOERRH(fn); return; }