|
|
1.1 root 1: /*
2: * Close one window, free memory and update remaining windows
3: *
4: * Copyright (c) 1990-93 by Udo Munk
5: */
6:
7: #ifdef AIX
8: #define NLS
9: #endif
10:
11: #include <curses.h>
12: #include "winfun.h"
13:
14: extern W_LIST *wl;
15: extern void free();
16:
17: close_window(w)
18: WINDOW *w;
19: {
20: register W_LIST *wlp = wl->w_next;
21: register W_LIST *lwlp = wl;
22:
23: if ((lwlp->w_next == (W_LIST *) 0) || (lwlp->w_w == w)) /* don't close */
24: return(WIN_ERR); /* stdscr !! */
25: do {
26: if (wlp->w_w == w) {
27: lwlp->w_next = wlp->w_next;
28: delwin(wlp->w_w);
29: free((char *) wlp);
30: wlp = lwlp->w_next;
31: touchwin(lwlp->w_w);
32: wnoutrefresh(lwlp->w_w);
33: } else {
34: touchwin(lwlp->w_w);
35: wnoutrefresh(lwlp->w_w);
36: lwlp = wlp;
37: wlp = wlp->w_next;
38: }
39: } while (wlp != (W_LIST *) 0);
40: touchwin(lwlp->w_w);
41: wnoutrefresh(lwlp->w_w);
42: doupdate();
43: return(WIN_OK);
44: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.