X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=menu%2Fm_userptr.c;h=dc87da12527d9ab034d71947e034ffdba5ab3f96;hp=9ac73b9fc988cc6a5cace2919a8829c18d957707;hb=3b3a6d094f484e799b1430782f1130a9af71a94e;hpb=3a9b6a3bf0269231bef7de74757a910dedd04e0c diff --git a/menu/m_userptr.c b/menu/m_userptr.c index 9ac73b9f..dc87da12 100644 --- a/menu/m_userptr.c +++ b/menu/m_userptr.c @@ -1,62 +1,77 @@ -/*-----------------------------------------------------------------------------+ -| The ncurses menu library is Copyright (C) 1995-1997 | -| by Juergen Pfeifer | -| All Rights Reserved. | -| | -| Permission to use, copy, modify, and distribute this software and its | -| documentation for any purpose and without fee is hereby granted, provided | -| that the above copyright notice appear in all copies and that both that | -| copyright notice and this permission notice appear in supporting | -| documentation, and that the name of the above listed copyright holder(s) not | -| be used in advertising or publicity pertaining to distribution of the | -| software without specific, written prior permission. | -| | -| THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO | -| THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT- | -| NESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR | -| ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RE- | -| SULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | -| NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH | -| THE USE OR PERFORMANCE OF THIS SOFTWARE. | -+-----------------------------------------------------------------------------*/ +/**************************************************************************** + * Copyright 2020 Thomas E. Dickey * + * Copyright 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 * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Juergen Pfeifer, 1995,1997 * + ****************************************************************************/ /*************************************************************************** -* Module menu_userptr * +* Module m_userptr * * Associate application data with menus * ***************************************************************************/ #include "menu.priv.h" -MODULE_ID("$Id: m_userptr.c,v 1.5 1997/05/01 16:47:26 juergen Exp $") +MODULE_ID("$Id: m_userptr.c,v 1.20 2020/05/24 01:40:20 anonymous.maarten Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu -| Function : int set_menu_userptr(MENU *menu, const void *userptr) -| +| Facility : libnmenu +| Function : int set_menu_userptr(MENU *menu, void *userptr) +| | Description : Set the pointer that is reserved in any menu to store -| application relevant informations. +| application relevant information. | | Return Values : E_OK - success +--------------------------------------------------------------------------*/ -int set_menu_userptr(MENU * menu, const void * userptr) +MENU_EXPORT(int) +set_menu_userptr(MENU * menu, void *userptr) { + T((T_CALLED("set_menu_userptr(%p,%p)"), (void *)menu, (void *)userptr)); Normalize_Menu(menu)->userptr = userptr; - RETURN( E_OK ); + RETURN(E_OK); } /*--------------------------------------------------------------------------- -| Facility : libnmenu -| Function : char *menu_userptr(const MENU *menu) -| +| Facility : libnmenu +| Function : void *menu_userptr(const MENU *menu) +| | Description : Return the pointer that is reserved in any menu to -| store application relevant informations. +| store application relevant information. | | Return Values : Value of the pointer. If no such pointer has been set, | NULL is returned +--------------------------------------------------------------------------*/ -const void *menu_userptr(const MENU * menu) +MENU_EXPORT(void *) +menu_userptr(const MENU * menu) { - return( Normalize_Menu(menu)->userptr); + T((T_CALLED("menu_userptr(%p)"), (const void *)menu)); + returnVoidPtr(Normalize_Menu(menu)->userptr); } /* m_userptr.c ends here */