source: trunk/minix/lib/curses/windel.c@ 10

Last change on this file since 10 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.5 KB
Line 
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/****************************************************************/
13/* Modified to run under the MINIX operating system by Don Cope */
14/* These changes are also released into the public domain. */
15/* 900906 */
16/****************************************************************/
17
18#include <stdlib.h>
19#include <curses.h>
20#include "curspriv.h"
21
22/****************************************************************/
23/* Delwin() deallocates all data allocated by 'win'. If 'win' */
24/* Is a subwindow, it uses the original window's lines for sto- */
25/* Rage, and thus the line arrays are not deallocated. */
26/****************************************************************/
27
28void delwin(win)
29WINDOW *win;
30{
31 int i;
32
33 if (!(win->_flags & _SUBWIN)) { /* subwindow uses 'parent's' lines */
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 */
Note: See TracBrowser for help on using the repository browser.