diff options
author | Xin LI <delphij@FreeBSD.org> | 2014-02-28 19:12:44 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2014-02-28 19:12:44 +0000 |
commit | 4b819fa20a8d007a10f2d3e8d6a5dedf7f18fc9a (patch) | |
tree | b8f6e12b479a78216f3bffb8e1258d54087268de /ncurses/base/lib_freeall.c | |
parent | e07762606a5bf651a501cb095c98cba90e4a8fe2 (diff) | |
download | src-4b819fa20a8d007a10f2d3e8d6a5dedf7f18fc9a.tar.gz src-4b819fa20a8d007a10f2d3e8d6a5dedf7f18fc9a.zip |
Undo two previous imports which was never done in preparation of doing a
new import.
Notes
Notes:
svn path=/vendor/ncurses/dist/; revision=262616
Diffstat (limited to 'ncurses/base/lib_freeall.c')
-rw-r--r-- | ncurses/base/lib_freeall.c | 62 |
1 files changed, 24 insertions, 38 deletions
diff --git a/ncurses/base/lib_freeall.c b/ncurses/base/lib_freeall.c index 5bcc974bc257..564026582911 100644 --- a/ncurses/base/lib_freeall.c +++ b/ncurses/base/lib_freeall.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,6 +31,7 @@ ****************************************************************************/ #include <curses.priv.h> +#include <term_entry.h> #include <tic.h> #if HAVE_NC_FREEALL @@ -39,40 +40,40 @@ extern int malloc_errfd; /* FIXME */ #endif -MODULE_ID("$Id: lib_freeall.c,v 1.59 2010/01/23 17:57:43 tom Exp $") +MODULE_ID("$Id: lib_freeall.c,v 1.54 2008/09/27 13:09:57 tom Exp $") /* * Free all ncurses data. This is used for testing only (there's no practical * use for it as an extension). */ NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_freeall) (NCURSES_SP_DCL0) +_nc_freeall(void) { WINDOWLIST *p, *q; static va_list empty_va; T((T_CALLED("_nc_freeall()"))); #if NO_LEAKS - if (SP_PARM != 0) { - if (SP_PARM->_oldnum_list != 0) { - FreeAndNull(SP_PARM->_oldnum_list); + if (SP != 0) { + if (SP->_oldnum_list != 0) { + FreeAndNull(SP->_oldnum_list); } - if (SP_PARM->_panelHook.destroy != 0) { - SP_PARM->_panelHook.destroy(SP_PARM->_panelHook.stdscr_pseudo_panel); + if (SP->_panelHook.destroy != 0) { + SP->_panelHook.destroy(SP->_panelHook.stdscr_pseudo_panel); } } #endif - if (SP_PARM != 0) { + if (SP != 0) { _nc_lock_global(curses); - while (WindowList(SP_PARM) != 0) { + while (_nc_windows != 0) { bool deleted = FALSE; /* Delete only windows that're not a parent */ - for (each_window(SP_PARM, p)) { + for (each_window(p)) { bool found = FALSE; - for (each_window(SP_PARM, q)) { + for (each_window(q)) { if ((p != q) && (q->win._flags & _SUBWIN) && (&(p->win) == q->win._parent)) { @@ -94,9 +95,11 @@ NCURSES_SP_NAME(_nc_freeall) (NCURSES_SP_DCL0) if (!deleted) break; } - delscreen(SP_PARM); + delscreen(SP); _nc_unlock_global(curses); } + if (cur_term != 0) + del_curterm(cur_term); (void) _nc_printf_string(0, empty_va); #ifdef TRACE @@ -118,20 +121,12 @@ NCURSES_SP_NAME(_nc_freeall) (NCURSES_SP_DCL0) returnVoid; } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) -_nc_freeall(void) -{ - NCURSES_SP_NAME(_nc_freeall) (CURRENT_SCREEN); -} -#endif - NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_free_and_exit) (NCURSES_SP_DCLx int code) +_nc_free_and_exit(int code) { - char *last_setbuf = (SP_PARM != 0) ? SP_PARM->_setbuf : 0; + char *last_setbuf = (SP != 0) ? SP->_setbuf : 0; - NCURSES_SP_NAME(_nc_freeall) (NCURSES_SP_ARG); + _nc_freeall(); #ifdef TRACE trace(0); /* close trace file, freeing its setbuf */ { @@ -151,21 +146,12 @@ _nc_freeall(void) } NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_free_and_exit) (NCURSES_SP_DCLx int code) -{ - if (SP_PARM) { - delscreen(SP_PARM); - if (SP_PARM->_term) - NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx SP_PARM->_term); - } - exit(code); -} -#endif - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) _nc_free_and_exit(int code) { - NCURSES_SP_NAME(_nc_free_and_exit) (CURRENT_SCREEN, code); + if (SP) + delscreen(SP); + if (cur_term != 0) + del_curterm(cur_term); + exit(code); } #endif |