11573Srgrimes/* $OpenBSD: m_item_nam.c,v 1.8 2023/10/17 09:52:10 nicm Exp $ */ 21573Srgrimes 31573Srgrimes/**************************************************************************** 41573Srgrimes * Copyright 2020,2021 Thomas E. Dickey * 51573Srgrimes * Copyright 1998-2004,2010 Free Software Foundation, Inc. * 61573Srgrimes * * 71573Srgrimes * Permission is hereby granted, free of charge, to any person obtaining a * 81573Srgrimes * copy of this software and associated documentation files (the * 91573Srgrimes * "Software"), to deal in the Software without restriction, including * 101573Srgrimes * without limitation the rights to use, copy, modify, merge, publish, * 111573Srgrimes * distribute, distribute with modifications, sublicense, and/or sell * 121573Srgrimes * copies of the Software, and to permit persons to whom the Software is * 131573Srgrimes * furnished to do so, subject to the following conditions: * 141573Srgrimes * * 151573Srgrimes * The above copyright notice and this permission notice shall be included * 161573Srgrimes * in all copies or substantial portions of the Software. * 171573Srgrimes * * 181573Srgrimes * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 191573Srgrimes * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 201573Srgrimes * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 211573Srgrimes * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 221573Srgrimes * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 231573Srgrimes * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 241573Srgrimes * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 251573Srgrimes * * 261573Srgrimes * Except as contained in this notice, the name(s) of the above copyright * 271573Srgrimes * holders shall not be used in advertising or otherwise to promote the * 281573Srgrimes * sale, use or other dealings in this Software without prior written * 291573Srgrimes * authorization. * 301573Srgrimes ****************************************************************************/ 311573Srgrimes 321573Srgrimes/**************************************************************************** 331573Srgrimes * Author: Juergen Pfeifer, 1995,1997 * 341573Srgrimes ****************************************************************************/ 351573Srgrimes 361573Srgrimes/*************************************************************************** 3792986Sobrien* Module m_item_nam * 3892986Sobrien* Get menus item name and description * 391573Srgrimes***************************************************************************/ 401573Srgrimes 411573Srgrimes#include "menu.priv.h" 421573Srgrimes 431573SrgrimesMODULE_ID("$Id: m_item_nam.c,v 1.8 2023/10/17 09:52:10 nicm Exp $") 441573Srgrimes 451573Srgrimes/*--------------------------------------------------------------------------- 461573Srgrimes| Facility : libnmenu 471573Srgrimes| Function : char *item_name(const ITEM *item) 481573Srgrimes| 491573Srgrimes| Description : Return name of menu item 501573Srgrimes| 511573Srgrimes| Return Values : See above; returns NULL if item is invalid 521573Srgrimes+--------------------------------------------------------------------------*/ 531573SrgrimesMENU_EXPORT(const char *) 541573Srgrimesitem_name(const ITEM *item) 551573Srgrimes{ 561573Srgrimes T((T_CALLED("item_name(%p)"), (const void *)item)); 571573Srgrimes returnCPtr((item) ? item->name.str : (char *)0); 581573Srgrimes} 591573Srgrimes 601573Srgrimes/*--------------------------------------------------------------------------- 611573Srgrimes| Facility : libnmenu 621573Srgrimes| Function : char *item_description(const ITEM *item) 631573Srgrimes| 64| Description : Returns description of item 65| 66| Return Values : See above; Returns NULL if item is invalid 67+--------------------------------------------------------------------------*/ 68MENU_EXPORT(const char *) 69item_description(const ITEM *item) 70{ 71 T((T_CALLED("item_description(%p)"), (const void *)item)); 72 returnCPtr((item) ? item->description.str : (char *)0); 73} 74 75/* m_item_nam.c ends here */ 76