X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=panel%2Fp_show.c;h=3503bec1909e102cf7182bb02b3a49a16d4e01cf;hp=35eee237b958007d378339d8b4801e3d31881911;hb=f259fb41d8f08b7e042eb928b839b59c8e39098c;hpb=55ccd2b959766810cf7db8d1c4462f338ce0afc8 diff --git a/panel/p_show.c b/panel/p_show.c index 35eee237..3503bec1 100644 --- a/panel/p_show.c +++ b/panel/p_show.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright 2020,2021 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 * @@ -32,38 +33,41 @@ ****************************************************************************/ /* p_show.c - * Place a panel on top of the stack; may already be in the stack + * Place a panel on top of the stack; may already be in the stack */ #include "panel.priv.h" -MODULE_ID("$Id: p_show.c,v 1.11 2005/02/19 16:42:02 tom Exp $") +MODULE_ID("$Id: p_show.c,v 1.17 2021/06/17 21:20:30 tom Exp $") -NCURSES_EXPORT(int) +PANEL_EXPORT(int) show_panel(PANEL * pan) { - int err = OK; + int err = ERR; - T((T_CALLED("show_panel(%p)"), pan)); + T((T_CALLED("show_panel(%p)"), (void *)pan)); - if (!pan) - returnCode(ERR); + if (pan) + { + GetHook(pan); - if (Is_Top(pan)) - returnCode(OK); + if (Is_Top(pan)) + returnCode(OK); - dBug(("--> show_panel %s", USER_PTR(pan->user))); + dBug(("--> show_panel %s", USER_PTR(pan->user, 1))); - HIDE_PANEL(pan, err, OK); + HIDE_PANEL(pan, err, OK); - dStack("", 1, pan); - assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); + dStack("", 1, pan); + assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); - _nc_top_panel->above = pan; - pan->below = _nc_top_panel; - pan->above = (PANEL *) 0; - _nc_top_panel = pan; + _nc_top_panel->above = pan; + pan->below = _nc_top_panel; + pan->above = (PANEL *) 0; + _nc_top_panel = pan; - dStack("", 9, pan); + err = OK; - returnCode(OK); + dStack("", 9, pan); + } + returnCode(err); }