attach Berkeley specific copyright
[unix-history] / usr / src / usr.bin / window / wwclose.c
CommitLineData
21296b85 1#ifndef lint
60de5df9 2static char sccsid[] = "@(#)wwclose.c 3.13 %G%";
21296b85
EW
3#endif
4
60de5df9
EW
5/*
6 * Copyright (c) 1983 Regents of the University of California,
7 * All rights reserved. Redistribution permitted subject to
8 * the terms of the Berkeley Software License Agreement.
9 */
10
21296b85
EW
11#include "ww.h"
12#include <signal.h>
13
14wwclose(w)
15register struct ww *w;
16{
85af59e4 17 wwindex[w->ww_index] = 0;
7ecf4dca
EW
18 if (w->ww_pty >= 0)
19 (void) close(w->ww_pty);
20 if (w->ww_socket >= 0)
21 (void) close(w->ww_socket);
f2a77fe1 22 wwfree((char **)w->ww_win, w->ww_w.t);
e5a83b51 23 wwfree((char **)w->ww_buf, w->ww_b.t);
9481e8c2 24 if (w->ww_fmap != 0)
f2a77fe1
EW
25 wwfree((char **)w->ww_fmap, w->ww_w.t);
26 free((char *)(w->ww_nvis + w->ww_w.t));
e3eda680
EW
27 if (w->ww_ob != 0)
28 free(w->ww_ob);
85af59e4 29 free((char *)w);
21296b85 30}