]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - panel/p_replace.c
ncurses 5.7 - patch 20100109
[ncurses.git] / panel / p_replace.c
index 3c4aca185d4f5bde0a5b7d2ffd8378f0c3175b04..b4bf6f4a36e66a926e9f4fa31f276f85287a6766 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc.                        *
+ * Copyright (c) 1998-2000,2005 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_replace.c,v 1.3 1999/09/29 15:22:32 juergen Exp $")
+MODULE_ID("$Id: p_replace.c,v 1.10 2009/02/07 23:11:45 tom Exp $")
 
-int
-replace_panel(PANEL *pan, WINDOW *win)
+NCURSES_EXPORT(int)
+replace_panel(PANEL * pan, WINDOW *win)
 {
-  if(!pan)
-    return(ERR);
-  if(_nc_panel_is_linked(pan))
-    PANEL_UPDATE(pan,(PANEL*)0);
-  pan->win = win;
-  return(OK);
+  int rc = ERR;
+
+  T((T_CALLED("replace_panel(%p,%p)"), pan, win));
+
+  if (pan)
+    {
+      GetHook(pan);
+      if (IS_LINKED(pan))
+       {
+         Touchpan(pan);
+         PANEL_UPDATE(pan, (PANEL *) 0);
+       }
+      pan->win = win;
+      rc = OK;
+    }
+  returnCode(rc);
 }