home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / c / curses / src / werase.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-30  |  2.2 KB  |  79 lines

  1. /* -*-C-*-
  2.  *
  3.  *
  4.  * Filename : werase.c
  5.  *
  6.  * Author   : Simon J Raybould.    (sie@fulcrum.bt.co.uk).
  7.  *
  8.  * Date     : Friday 23rd August 1991.
  9.  *
  10.  * Desc     : Empties the screen buffer.
  11.  *
  12.  *
  13.  * THIS CODE IS NOT PUBLIC DOMAIN
  14.  * ==============================
  15.  * 
  16.  * This code is copyright Simon J Raybould 1991, all rights are reserved.
  17.  * All code, ideas, data structures and algorithms remain the property of the
  18.  * author. Neither the whole nor sections of this code may be used as part
  19.  * of other code without the authors consent. If you wish to use some of this
  20.  * code then please email me at (sie@fulcrum.bt.co.uk).
  21.  *
  22.  * This source is not public domain, so you do not have any right to alter it
  23.  * or sell it for personal gain. The source is provided purely for reference
  24.  * purposes. You may re-compile the source with any compiler you choose.
  25.  * You must not distribute altered copies without the authors consent. My
  26.  * intention is that the source will help people isolate any bugs much more
  27.  * effectivly.
  28.  *
  29.  * Disclaimer
  30.  * ==========
  31.  *
  32.  * No implication is made as to this code being fit for any purpose at all.
  33.  * I (the author) shall not be held responsible for any loss of data or damage 
  34.  * to property that may result from its use or misuse.
  35.  *
  36.  *
  37.  * Revision History
  38.  * ================
  39.  *
  40.  * $Log:    werase.c,v $
  41.  * Revision 1.3  91/12/30  10:31:21  sie
  42.  * Removed LRLine and LRATTRS.
  43.  * The speed increase caused by them was too insignificant.
  44.  * 
  45.  * Revision 1.2  91/12/28  14:01:21  sie
  46.  * Removed WinStat.
  47.  * Renamed LineElement as lnel.
  48.  * 
  49.  * Revision 1.1  91/09/07  11:50:02  sie
  50.  * Initial revision
  51.  * 
  52.  *
  53.  */
  54.  
  55. static char *rcsid = "$Header: SRC:lib/curses/src/RCS/werase.c,v 1.3 91/12/30 10:31:21 sie Exp $";
  56.  
  57. #include "acurses.h"
  58.  
  59.  
  60. werase(WINDOW *WinPtr)
  61. {
  62.   int Line;
  63.   
  64.   if(!(CursesFlags & CFLAG_INITSCR))  /* Haven't called initscr() */
  65.     return ERR;
  66.   
  67.   /* Blank screen image */
  68.   for(Line=0; Line<WinPtr->NLines; Line++) {
  69.     memset(WinPtr->LnArry[Line].Line, ' ', WinPtr->_maxx + 1);
  70.     memset(WinPtr->LnArry[Line].ATTRS, WinPtr->_attrs, WinPtr->_maxx+1);
  71.     WinPtr->LnArry[Line].Touched = TRUE;
  72.     WinPtr->LnArry[Line].StartCol = 0;
  73.     WinPtr->LnArry[Line].EndCol = WinPtr->_maxx;
  74.   }
  75.   WinPtr->_curx = 0;
  76.   WinPtr->_cury = 0;
  77.   return OK;
  78. }
  79.