X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=panel%2Fp_hide.c;h=c3bcc8a74f5cb3c02df65f13a2b32ad854184c8a;hp=d61429538440a22bca87dcff058aa1ed1881947d;hb=f67a188e71a0e6f80c1c45e50e7a7449c2d7bfb3;hpb=0eb88fc5281804773e2a0c7a488a4452463535ce;ds=sidebyside diff --git a/panel/p_hide.c b/panel/p_hide.c index d6142953..c3bcc8a7 100644 --- a/panel/p_hide.c +++ b/panel/p_hide.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright 2020 Thomas E. Dickey * + * Copyright 1998-2009,2010 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 * @@ -36,61 +37,27 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_hide.c,v 1.3 1999/09/29 15:22:32 juergen Exp $") +MODULE_ID("$Id: p_hide.c,v 1.13 2020/05/24 01:40:20 anonymous.maarten Exp $") -/*+------------------------------------------------------------------------- - __panel_unlink(pan) - unlink panel from stack ---------------------------------------------------------------------------*/ -static void -__panel_unlink(PANEL *pan) +PANEL_EXPORT(int) +hide_panel(register PANEL * pan) { - PANEL *prev; - PANEL *next; + int err = ERR; -#ifdef TRACE - dStack("",1,pan); - if(!_nc_panel_is_linked(pan)) - return; -#endif + T((T_CALLED("hide_panel(%p)"), (void *)pan)); - PANEL_UPDATE(pan,(PANEL*)0); - - prev = pan->below; - next = pan->above; - - if(prev) - { /* if non-zero, we will not update the list head */ - prev->above = next; - if(next) - next->below = prev; - } - else if(next) - next->below = prev; - if(pan == _nc_bottom_panel) - _nc_bottom_panel = next; - if(pan == _nc_top_panel) - _nc_top_panel = prev; + if (pan) + { + GetHook(pan); - pan->above = (PANEL *)0; - pan->below = (PANEL *)0; - dStack("",9,pan); -} + dBug(("--> hide_panel %s", USER_PTR(pan->user))); + dStack("", 1, pan); -int -hide_panel(register PANEL *pan) -{ - if(!pan) - return(ERR); + HIDE_PANEL(pan, err, ERR); - dBug(("--> hide_panel %s", USER_PTR(pan->user))); + err = OK; - if(!_nc_panel_is_linked(pan)) - { - pan->above = (PANEL *)0; - pan->below = (PANEL *)0; - return(ERR); + dStack("", 9, pan); } - - __panel_unlink(pan); - return(OK); + returnCode(err); }