home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / ncurses-1.9.9e-src.tgz / tar.out / fsf / ncurses / menu / m_item_use.c < prev    next >
C/C++ Source or Header  |  1996-09-28  |  3KB  |  60 lines

  1.  
  2. /***************************************************************************
  3. *                            COPYRIGHT NOTICE                              *
  4. ****************************************************************************
  5. *                ncurses is copyright (C) 1992-1995                        *
  6. *                          Zeyd M. Ben-Halim                               *
  7. *                          zmbenhal@netcom.com                             *
  8. *                          Eric S. Raymond                                 *
  9. *                          esr@snark.thyrsus.com                           *
  10. *                                                                          *
  11. *        Permission is hereby granted to reproduce and distribute ncurses  *
  12. *        by any means and for any fee, whether alone or as part of a       *
  13. *        larger distribution, in source or in binary form, PROVIDED        *
  14. *        this notice is included with any such distribution, and is not    *
  15. *        removed from any of its header files. Mention of ncurses in any   *
  16. *        applications linked with it is highly appreciated.                *
  17. *                                                                          *
  18. *        ncurses comes AS IS with no warranty, implied or expressed.       *
  19. *                                                                          *
  20. ***************************************************************************/
  21.  
  22. /***************************************************************************
  23. * Module menu_item_use                                                     *
  24. * Associate application data with menu items                               *
  25. ***************************************************************************/
  26.  
  27. #include "menu.priv.h"
  28.  
  29. /*---------------------------------------------------------------------------
  30. |   Facility      :  libnmenu  
  31. |   Function      :  int set_item_userptr(ITEM *item, char *userptr)
  32. |   
  33. |   Description   :  Set the pointer that is reserved in any item to store
  34. |                    application relevant informations.  
  35. |
  36. |   Return Values :  E_OK               - success
  37. +--------------------------------------------------------------------------*/
  38. int set_item_userptr(ITEM * item, char * userptr)
  39. {
  40.   Normalize_Item(item)->userptr = userptr;
  41.   RETURN( E_OK );
  42. }
  43.  
  44. /*---------------------------------------------------------------------------
  45. |   Facility      :  libnmenu  
  46. |   Function      :  char *item_userptr(const ITEM *item)
  47. |   
  48. |   Description   :  Return the pointer that is reserved in any item to store
  49. |                    application relevant informations.
  50. |
  51. |   Return Values :  Value of the pointer. If no such pointer has been set,
  52. |                    NULL is returned.
  53. +--------------------------------------------------------------------------*/
  54. char *item_userptr(const ITEM * item)
  55. {
  56.   return Normalize_Item(item)->userptr;
  57. }
  58.  
  59. /* m_item_use.c */
  60.