]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/html/man/mitem_new.3x.html
ncurses 4.2
[ncurses.git] / Ada95 / html / man / mitem_new.3x.html
1 <HTML>
2 <BODY>
3 <PRE>
4        <STRONG>mitem_new</STRONG> - create and destroy menu items
5
6
7 </PRE>
8 <H2>SYNOPSIS</H2><PRE>
9        <STRONG>#include</STRONG> <STRONG><menu.h></STRONG>
10        ITEM *new_item(const char *name, const char *description);
11        int free_item(ITEM *item);
12
13
14 </PRE>
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-
22        tines.
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
26        item.
27
28
29 </PRE>
30 <H2>RETURN VALUE</H2><PRE>
31        The function <STRONG>new_item</STRONG> returns <STRONG>NULL</STRONG> on error.
32
33        The function <STRONG>free_item</STRONG> returns one of the following:
34
35        <STRONG>E_OK</STRONG> The routine succeeded.
36
37        <STRONG>E_SYSTEM_ERROR</STRONG>
38             System error occurred (see <STRONG>errno</STRONG>).
39
40        <STRONG>E_BAD_ARGUMENT</STRONG>
41             Routine  detected  an incorrect or out-of-range argu-
42             ment.
43
44        <STRONG>E_CONNECTED</STRONG>
45             Item is connected to a menu.
46
47
48 </PRE>
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>.
51
52
53 </PRE>
54 <H2>NOTES</H2><PRE>
55        The header file <STRONG><menu.h></STRONG> automatically includes the header
56        file <STRONG><curses.h></STRONG>.
57
58
59 </PRE>
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.
63
64
65 </PRE>
66 <H2>AUTHORS</H2><PRE>
67        Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
68        curses by Eric S. Raymond.
69
70 </PRE>
71 </BODY>
72 </HTML>