]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - panel/p_show.c
ncurses 6.1 - patch 20190323
[ncurses.git] / panel / p_show.c
index 0e1968fdea5847c37b6e6bd98113ea9a118f1bf1..d5b09bd942602d47fdd70a6c03e1105dc09c2138 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2005,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            *
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_show.c,v 1.9 2001/02/24 23:46:50 tom Exp $")
+MODULE_ID("$Id: p_show.c,v 1.13 2010/01/23 21:22:16 tom Exp $")
 
 NCURSES_EXPORT(int)
-show_panel (PANEL *pan)
-{ 
-  int err = OK;
+show_panel(PANEL * pan)
+{
+  int err = ERR;
 
-  if(!pan)
-    return(ERR);
+  T((T_CALLED("show_panel(%p)"), (void *)pan));
 
-  if (Is_Top(pan))
-    return(OK);
+  if (pan)
+    {
+      GetHook(pan);
 
-  dBug(("--> show_panel %s", USER_PTR(pan->user)));
+      if (Is_Top(pan))
+       returnCode(OK);
 
-  HIDE_PANEL(pan,err,OK);
+      dBug(("--> show_panel %s", USER_PTR(pan->user)));
 
-  dStack("<lt%d>",1,pan);
-  assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
+      HIDE_PANEL(pan, err, OK);
 
-  _nc_top_panel->above = pan;
-  pan->below = _nc_top_panel;  
-  pan->above = (PANEL *)0;
-  _nc_top_panel = pan;
-  
-  dStack("<lt%d>",9,pan);
+      dStack("<lt%d>", 1, pan);
+      assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
 
-  return(OK);
+      _nc_top_panel->above = pan;
+      pan->below = _nc_top_panel;
+      pan->above = (PANEL *) 0;
+      _nc_top_panel = pan;
+
+      err = OK;
+
+      dStack("<lt%d>", 9, pan);
+    }
+  returnCode(err);
 }