]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/mitem_new.3x.html
ncurses 5.1
[ncurses.git] / doc / html / man / mitem_new.3x.html
1 <HTML>
2 <BODY>
3 <PRE>
4 <!-- Manpage converted by man2html 3.0.1 -->
5
6 </PRE>
7 <H2>NAME</H2><PRE>
8        <B>mitem_new</B> - create and destroy menu items
9
10
11 </PRE>
12 <H2>SYNOPSIS</H2><PRE>
13        <B>#include</B> <B>&lt;menu.h&gt;</B>
14        ITEM *new_item(const char *name, const char *description);
15        int free_item(ITEM *item);
16
17
18 </PRE>
19 <H2>DESCRIPTION</H2><PRE>
20        The function <B>new_item</B> allocates a new item and initializes
21        it  from  the <B>name</B> and <B>description</B> pointers. Please notice
22        that the item stores only the pointers  to  the  name  and
23        description. Those pointers must be valid during the life-
24        time of the item. So you  should  be  very  carefull  with
25        names  or descriptions allocated on the stack of some rou-
26        tines.
27        The function <B>free_item</B> de-allocates an item. Please notice
28        that  it  is  the  responsibility  of  the  application to
29        release the memory for the name or the description of  the
30        item.
31
32
33 </PRE>
34 <H2>RETURN VALUE</H2><PRE>
35        The function <B>new_item</B> returns <B>NULL</B> on error.
36
37        The function <B>free_item</B> returns one of the following:
38
39        <B>E_OK</B> The routine succeeded.
40
41        <B>E_SYSTEM_ERROR</B>
42             System error occurred (see <B>errno</B>).
43
44        <B>E_BAD_ARGUMENT</B>
45             Routine  detected  an incorrect or out-of-range argu-
46             ment.
47
48        <B>E_CONNECTED</B>
49             Item is connected to a menu.
50
51
52 </PRE>
53 <H2>SEE ALSO</H2><PRE>
54        <B><A HREF="ncurses.3x.html">curses(3x)</A></B>, <B><A HREF="menu.3x.html">menu(3x)</A></B>.
55
56
57 </PRE>
58 <H2>NOTES</H2><PRE>
59        The header file <B>&lt;menu.h&gt;</B> automatically includes the header
60        file <B>&lt;curses.h&gt;</B>.
61
62
63 </PRE>
64 <H2>PORTABILITY</H2><PRE>
65        These  routines  emulate  the System V menu library.  They
66        were not supported on Version 7 or BSD versions.
67
68
69 </PRE>
70 <H2>AUTHORS</H2><PRE>
71        Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
72        curses by Eric S. Raymond.
73
74
75 </PRE>
76 <HR>
77 <ADDRESS>
78 Man(1) output converted with
79 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
80 </ADDRESS>
81 </BODY>
82 </HTML>