m_item_nam.c revision 1.3
1/*	$OpenBSD: m_item_nam.c,v 1.3 1997/12/03 05:31:20 millert Exp $	*/
2
3/*-----------------------------------------------------------------------------+
4|           The ncurses menu library is  Copyright (C) 1995-1997               |
5|             by Juergen Pfeifer <Juergen.Pfeifer@T-Online.de>                 |
6|                          All Rights Reserved.                                |
7|                                                                              |
8| Permission to use, copy, modify, and distribute this software and its        |
9| documentation for any purpose and without fee is hereby granted, provided    |
10| that the above copyright notice appear in all copies and that both that      |
11| copyright notice and this permission notice appear in supporting             |
12| documentation, and that the name of the above listed copyright holder(s) not |
13| be used in advertising or publicity pertaining to distribution of the        |
14| software without specific, written prior permission.                         |
15|                                                                              |
16| THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO  |
17| THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-  |
18| NESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR   |
19| ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RE- |
20| SULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, |
21| NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH    |
22| THE USE OR PERFORMANCE OF THIS SOFTWARE.                                     |
23+-----------------------------------------------------------------------------*/
24
25/***************************************************************************
26* Module m_item_nam                                                        *
27* Get menus item name and description                                      *
28***************************************************************************/
29
30#include "menu.priv.h"
31
32MODULE_ID("Id: m_item_nam.c,v 1.6 1997/10/21 08:44:31 juergen Exp $")
33
34/*---------------------------------------------------------------------------
35|   Facility      :  libnmenu
36|   Function      :  char *item_name(const ITEM *item)
37|
38|   Description   :  Return name of menu item
39|
40|   Return Values :  See above; returns NULL if item is invalid
41+--------------------------------------------------------------------------*/
42const char *item_name(const ITEM * item)
43{
44  return ((item) ? item->name.str : (char *)0);
45}
46
47/*---------------------------------------------------------------------------
48|   Facility      :  libnmenu
49|   Function      :  char *item_description(const ITEM *item)
50|
51|   Description   :  Returns description of item
52|
53|   Return Values :  See above; Returns NULL if item is invalid
54+--------------------------------------------------------------------------*/
55const char *item_description(const ITEM * item)
56{
57  return ((item) ? item->description.str : (char *)0);
58}
59
60/* m_item_nam.c ends here */
61