]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - menu/m_item_val.c
ncurses 6.4 - patch 20240420
[ncurses.git] / menu / m_item_val.c
index c62a4e17484f30ea81c9ba6c9f3365ed65e4ddcb..3163f4b7216e59262285976311d7eb0a73b7f842 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2004,2010 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_val.c,v 1.17 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_item_val.c,v 1.20 2021/06/17 21:11:08 tom Exp $")
 
 /*---------------------------------------------------------------------------
-|   Facility      :  libnmenu  
+|   Facility      :  libnmenu
 |   Function      :  int set_item_value(ITEM *item, int value)
-|   
+|
 |   Description   :  Programmatically set the item's selection value. This is
 |                    only allowed if the item is selectable at all and if
 |                    it is not connected to a single-valued menu.
 |                    If the item is connected to a posted menu, the menu
-|                    will be redisplayed.  
+|                    will be redisplayed.
 |
 |   Return Values :  E_OK              - success
 |                    E_REQUEST_DENIED  - not selectable or single valued menu
 +--------------------------------------------------------------------------*/
 MENU_EXPORT(int)
-set_item_value(ITEM * item, bool value)
+set_item_value(ITEM *item, bool value)
 {
-  MENU *menu;
-
   T((T_CALLED("set_item_value(%p,%d)"), (void *)item, value));
   if (item)
     {
-      menu = item->imenu;
+      MENU *menu = item->imenu;
 
       if ((!(item->opt & O_SELECTABLE)) ||
          (menu && (menu->opt & O_ONEVALUE)))
@@ -87,16 +85,16 @@ set_item_value(ITEM * item, bool value)
 }
 
 /*---------------------------------------------------------------------------
-|   Facility      :  libnmenu  
+|   Facility      :  libnmenu
 |   Function      :  bool item_value(const ITEM *item)
-|   
+|
 |   Description   :  Return the selection value of the item
 |
 |   Return Values :  TRUE   - if item is selected
 |                    FALSE  - if item is not selected
 +--------------------------------------------------------------------------*/
 MENU_EXPORT(bool)
-item_value(const ITEM * item)
+item_value(const ITEM *item)
 {
   T((T_CALLED("item_value(%p)"), (const void *)item));
   returnBool((Normalize_Item(item)->value) ? TRUE : FALSE);