ncurses 5.7 - patch 20100123
[ncurses.git] / panel / p_bottom.c
index 0928e77eb828ddb2a1c37b3b155c97a499dcba47..db814415375c0f4f226b6d9ac1d8bf30e9ca035f 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 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            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,6 +29,7 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1997-1999,2008          *
  ****************************************************************************/
 
 /* p_bottom.c
  ****************************************************************************/
 
 /* p_bottom.c
  */
 #include "panel.priv.h"
 
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_bottom.c,v 1.9 2001/02/24 23:46:33 tom Exp $")
+MODULE_ID("$Id: p_bottom.c,v 1.13 2010/01/23 21:22:16 tom Exp $")
 
 NCURSES_EXPORT(int)
 
 NCURSES_EXPORT(int)
-bottom_panel (PANEL *pan)
+bottom_panel(PANEL * pan)
 {
   int err = OK;
 
 {
   int err = OK;
 
-  if (pan) {
+  T((T_CALLED("bottom_panel(%p)"), (void *)pan));
+  if (pan)
+    {
+      GetHook(pan);
+      if (!Is_Bottom(pan))
+       {
 
 
-    if(!Is_Bottom(pan)) {
-      
-      dBug(("--> bottom_panel %s", USER_PTR(pan->user)));
-     
-      HIDE_PANEL(pan,err,OK);
-      assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
-      
-      dStack("<lb%d>",1,pan);      
-      
-      pan->below = _nc_bottom_panel;
-      pan->above = _nc_bottom_panel->above;
-      if (pan->above)
-       pan->above->below = pan;
-      _nc_bottom_panel->above = pan;
-      
-      dStack("<lb%d>",9,pan);
+         dBug(("--> bottom_panel %s", USER_PTR(pan->user)));
+
+         HIDE_PANEL(pan, err, OK);
+         assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
+
+         dStack("<lb%d>", 1, pan);
+
+         pan->below = _nc_bottom_panel;
+         pan->above = _nc_bottom_panel->above;
+         if (pan->above)
+           pan->above->below = pan;
+         _nc_bottom_panel->above = pan;
+
+         dStack("<lb%d>", 9, pan);
+       }
     }
     }
-  }
   else
     err = ERR;
   else
     err = ERR;
-  
-  return(err);
+
+  returnCode(err);
 }
 }