mitemnew(3X) mitemnew(3X)
NAME
mitemnew - create and destroy menu items
SYNOPSIS
##include <>
ITEM *newitem(const char *name, const char *description);
int freeitem(ITEM *item);
DESCRIPTION
The function newitem allocates a new item and initializes it from the
name and description pointers. Please notice that the item stores only
the pointers to the name and description. Those pointers must be valid
during the lifetime of the item. So you should be very careful with
names or descriptions allocated on the stack of some routines.
The function freeitem de-allocates an item. Please notice that it is
the responsibility of the application to release the memory for the
name or the description of the item.
RETURN VALUE
The function newitem returns NUL on error.
The function freeitem returns one of the following:
EOK The routine succeeded.
ESYSTEMEROR
System error occurred (see errno).
EBADARGUMENT
Routine detected an incorrect or out-of-range argument.
ECONECTED
Item is connected to a menu.
SEE ALSO
curses(3X), menu(3X).
NOTES
The header file <> automatically includes the header file
<>.
PORTABILITY
These routines emulate the System V menu library. They were not sup-
ported on Version 7 or BSD versions.
AUTHORS
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S.
Raymond.
mitemnew(3X)
|