home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / CURSES.LZH / WINDEL.C < prev    next >
C/C++ Source or Header  |  1980-01-01  |  2KB  |  42 lines

  1. /****************************************************************/
  2. /* Delwin() routine of the PCcurses package.            */
  3. /*                                */
  4. /****************************************************************/
  5. /* This version of curses is based on ncurses, a curses version    */
  6. /* originally written by Pavel Curtis at Cornell University.    */
  7. /* I have made substantial changes to make it run on IBM PC's,    */
  8. /* and therefore consider myself free to make it public domain.    */
  9. /*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  10. /****************************************************************/
  11. /* 1.0:    Release:                    870515    */
  12. /* 1.2:    Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  13. /* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  14. /****************************************************************/
  15.  
  16. #include <curses.h>
  17. #include <curspriv.h>
  18.  
  19. char _curses_windel_rcsid[] = "@(#)windel.c v1.3 - 881005";
  20.  
  21. /****************************************************************/
  22. /* Delwin() deallocates all data allocated by 'win'. If 'win'    */
  23. /* is a subwindow, it uses the original window's lines for sto-    */
  24. /* rage, and thus the line arrays are not deallocated.        */
  25. /****************************************************************/
  26.  
  27. void delwin(win)
  28.   WINDOW    *win;
  29.   {
  30.   int         i;
  31.  
  32.   if (! (win->_flags & _SUBWIN))    /* subwindow uses 'parent's' lines */
  33.     {
  34.     for (i = 0; i < win->_maxy && win->_line[i]; i++)
  35.       free(win->_line[i]);
  36.     }
  37.   free(win->_minchng);
  38.   free(win->_maxchng);
  39.   free(win->_line);
  40.   free(win);
  41.   } /* delwin */
  42.