]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - menu/m_pad.c
ncurses 5.9 - patch 20110521
[ncurses.git] / menu / m_pad.c
index 560036e2ccd69ac163de658f2f7753938a439dc6..caa2f9e207b1eeaa6f8d1368f6d3a0f7af3df238 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2004,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 "menu.priv.h"
 
-MODULE_ID("$Id: m_pad.c,v 1.7 2003/10/25 14:54:48 tom Exp $")
+MODULE_ID("$Id: m_pad.c,v 1.12 2010/01/23 21:20:10 tom Exp $")
 
 /* Macro to redraw menu if it is posted and changed */
 #define Refresh_Menu(menu) \
    if ( (menu) && ((menu)->status & _POSTED) )\
    {\
       _nc_Draw_Menu( menu );\
-      _nc_Show_Menu( menu );\
+      _nc_Show_Menu( menu ); \
    }
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
-|   Function      :  int set_menu_pad(MENU *menu, int pad)
+|   Function      :  int set_menu_pad(MENUmenu, int pad)
 |   
 |   Description   :  Set the character to be used to separate the item name
 |                    from its description. This must be a printable 
@@ -59,18 +59,20 @@ MODULE_ID("$Id: m_pad.c,v 1.7 2003/10/25 14:54:48 tom Exp $")
 |                    E_BAD_ARGUMENT    - an invalid value has been passed
 +--------------------------------------------------------------------------*/
 NCURSES_EXPORT(int)
-set_menu_pad (MENU *menu, int pad)
+set_menu_pad(MENU * menu, int pad)
 {
-  bool do_refresh = (menu != (MENU*)0);
+  bool do_refresh = (menu != (MENU *) 0);
 
-  if (!isprint((unsigned char)pad))
+  T((T_CALLED("set_menu_pad(%p,%d)"), (void *)menu, pad));
+
+  if (!isprint(UChar(pad)))
     RETURN(E_BAD_ARGUMENT);
-  
-  Normalize_Menu( menu );
+
+  Normalize_Menu(menu);
   menu->pad = pad;
-  
+
   if (do_refresh)
-      Refresh_Menu( menu );
+    Refresh_Menu(menu);
 
   RETURN(E_OK);
 }
@@ -84,9 +86,10 @@ set_menu_pad (MENU *menu, int pad)
 |   Return Values :  The pad character
 +--------------------------------------------------------------------------*/
 NCURSES_EXPORT(int)
-menu_pad (const MENU * menu)
+menu_pad(const MENU * menu)
 {
-  return (Normalize_Menu( menu ) -> pad);
+  T((T_CALLED("menu_pad(%p)"), (const void *)menu));
+  returnCode(Normalize_Menu(menu)->pad);
 }
 
 /* m_pad.c ends here */