1 /*-----------------------------------------------------------------------------+
2 | The ncurses menu library is Copyright (C) 1995-1997 |
3 | by Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> |
4 | All Rights Reserved. |
6 | Permission to use, copy, modify, and distribute this software and its |
7 | documentation for any purpose and without fee is hereby granted, provided |
8 | that the above copyright notice appear in all copies and that both that |
9 | copyright notice and this permission notice appear in supporting |
10 | documentation, and that the name of the above listed copyright holder(s) not |
11 | be used in advertising or publicity pertaining to distribution of the |
12 | software without specific, written prior permission. |
14 | THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO |
15 | THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT- |
16 | NESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR |
17 | ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RE- |
18 | SULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, |
19 | NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH |
20 | THE USE OR PERFORMANCE OF THIS SOFTWARE. |
21 +-----------------------------------------------------------------------------*/
23 /***************************************************************************
24 * Module menu_userptr *
25 * Associate application data with menus *
26 ***************************************************************************/
28 #include "menu.priv.h"
30 MODULE_ID("$Id: m_userptr.c,v 1.5 1997/05/01 16:47:26 juergen Exp $")
32 /*---------------------------------------------------------------------------
34 | Function : int set_menu_userptr(MENU *menu, const void *userptr)
36 | Description : Set the pointer that is reserved in any menu to store
37 | application relevant informations.
39 | Return Values : E_OK - success
40 +--------------------------------------------------------------------------*/
41 int set_menu_userptr(MENU * menu, const void * userptr)
43 Normalize_Menu(menu)->userptr = userptr;
47 /*---------------------------------------------------------------------------
49 | Function : char *menu_userptr(const MENU *menu)
51 | Description : Return the pointer that is reserved in any menu to
52 | store application relevant informations.
54 | Return Values : Value of the pointer. If no such pointer has been set,
56 +--------------------------------------------------------------------------*/
57 const void *menu_userptr(const MENU * menu)
59 return( Normalize_Menu(menu)->userptr);
62 /* m_userptr.c ends here */