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

  1. /* -*-C-*-
  2.  *
  3.  *
  4.  * Filename : wclrtobot.c
  5.  *
  6.  * Author   : Simon J Raybould.    (sie@fulcrum.bt.co.uk).
  7.  *
  8.  * Date     : Friday 23rd August 1991.
  9.  *
  10.  * Desc     : Clear to bottom of screen.
  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:    wclrtobot.c,v $
  41.  * Revision 1.2  92/06/23  22:14:38  sie
  42.  * Changed to alter the window structure directly rather than
  43.  * using calls to other curses functions.
  44.  * 
  45.  * Revision 1.1  91/09/07  11:49:38  sie
  46.  * Initial revision
  47.  * 
  48.  *
  49.  */
  50.  
  51. static char *rcsid = "$Header: SRC:lib/curses/src/RCS/wclrtobot.c,v 1.2 92/06/23 22:14:38 sie Exp $";
  52.  
  53. #include "acurses.h"
  54.  
  55.  
  56. wclrtobot(WINDOW *WinPtr)
  57. {
  58.   int line;
  59.   
  60.   if(!(CursesFlags & CFLAG_INITSCR))  /* Haven't called initscr() */
  61.     return ERR;
  62.   /* do the first line */
  63.   memset(&(WinPtr->LnArry[WinPtr->_cury].Line[WinPtr->_curx]),
  64.      ' ', WinPtr->_maxx-WinPtr->_curx+1);
  65.   memset(&(WinPtr->LnArry[WinPtr->_cury].ATTRS[WinPtr->_curx]),
  66.      WinPtr->_attrs, WinPtr->_maxx-WinPtr->_curx+1);
  67.  
  68.   WinPtr->LnArry[WinPtr->_cury].StartCol =
  69.     min(WinPtr->_curx, WinPtr->LnArry[WinPtr->_cury].StartCol);
  70.   WinPtr->LnArry[WinPtr->_cury].EndCol = WinPtr->_maxx;
  71.   WinPtr->LnArry[WinPtr->_cury].Touched = TRUE;
  72.  
  73.   /* do the rest of the lines */
  74.   for(line=WinPtr->_cury+1; line<=WinPtr->_maxy; line++) {
  75.     memset(WinPtr->LnArry[line].Line, ' ', WinPtr->_maxx+1);
  76.     memset(WinPtr->LnArry[line].ATTRS, WinPtr->_attrs, WinPtr->_maxx+1);
  77.     WinPtr->LnArry[line].StartCol = 0;
  78.     WinPtr->LnArry[line].EndCol = WinPtr->_maxx;
  79.     WinPtr->LnArry[line].Touched = TRUE;
  80.   }    
  81.   return OK;
  82. }
  83.