4 <STRONG>mitem_new</STRONG> - create and destroy menu items
9 <STRONG>#include</STRONG> <STRONG><menu.h></STRONG>
10 ITEM *new_item(const char *name, const char *description);
11 int free_item(ITEM *item);
15 <H2>DESCRIPTION</H2><PRE>
16 The function <STRONG>new_item</STRONG> allocates a new item and initializes
17 it from the <STRONG>name</STRONG> and <STRONG>description</STRONG> pointers. Please notice
18 that the item stores only the pointers to the name and
19 description. Those pointers must be valid during the life-
20 time of the item. So you should be very carefull with
21 names or descriptions allocated on the stack of some rou-
23 The function <STRONG>free_item</STRONG> de-allocates an item. Please notice
24 that it is the responsibility of the application to
25 release the memory for the name or the description of the
30 <H2>RETURN VALUE</H2><PRE>
31 The function <STRONG>new_item</STRONG> returns <STRONG>NULL</STRONG> on error.
33 The function <STRONG>free_item</STRONG> returns one of the following:
35 <STRONG>E_OK</STRONG> The routine succeeded.
37 <STRONG>E_SYSTEM_ERROR</STRONG>
38 System error occurred (see <STRONG>errno</STRONG>).
40 <STRONG>E_BAD_ARGUMENT</STRONG>
41 Routine detected an incorrect or out-of-range argu-
44 <STRONG>E_CONNECTED</STRONG>
45 Item is connected to a menu.
49 <H2>SEE ALSO</H2><PRE>
50 <STRONG><A HREF="ncurses.3x.html">curses(3X)</A></STRONG>, <STRONG><A HREF="menu.3x.html">menu(3X)</A></STRONG>.
55 The header file <STRONG><menu.h></STRONG> automatically includes the header
56 file <STRONG><curses.h></STRONG>.
60 <H2>PORTABILITY</H2><PRE>
61 These routines emulate the System V menu library. They
62 were not supported on Version 7 or BSD versions.
67 Juergen Pfeifer. Manual pages and adaptation for new
68 curses by Eric S. Raymond.