]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/mitem_new.3x
ncurses 4.2
[ncurses.git] / man / mitem_new.3x
1 '\" t
2 .TH mitem_new 3X ""
3 .SH NAME
4 \fBmitem_new\fR - create and destroy menu items
5 .SH SYNOPSIS
6 \fB#include <menu.h>\fR
7 .br
8 ITEM *new_item(const char *name, const char *description);
9 .br
10 int free_item(ITEM *item);
11 .br
12 .SH DESCRIPTION
13 The function \fBnew_item\fR allocates a new item and initializes it from the
14 \fBname\fR and \fBdescription\fR pointers. Please notice that the item stores
15 only the pointers to the name and description. Those pointers must be valid
16 during the lifetime of the item. So you should be very carefull with names
17 or descriptions allocated on the stack of some routines.
18 .br
19 The function \fBfree_item\fR de-allocates an item. Please notice that it
20 is the responsibility of the application to release the memory for the
21 name or the description of the item.
22 .SH RETURN VALUE
23 The function \fBnew_item\fR returns \fBNULL\fR on error.
24
25 The function \fBfree_item\fR returns one of the following:
26 .TP 5
27 \fBE_OK\fR
28 The routine succeeded.
29 .TP 5
30 \fBE_SYSTEM_ERROR\fR
31 System error occurred (see \fBerrno\fR).
32 .TP 5
33 \fBE_BAD_ARGUMENT\fR
34 Routine detected an incorrect or out-of-range argument.
35 .TP 5
36 \fBE_CONNECTED\fR
37 Item is connected to a menu.
38 .SH SEE ALSO
39 \fBcurses\fR(3X), \fBmenu\fR(3X).
40 .SH NOTES
41 The header file \fB<menu.h>\fR automatically includes the header file
42 \fB<curses.h>\fR.
43 .SH PORTABILITY
44 These routines emulate the System V menu library.  They were not supported on
45 Version 7 or BSD versions.
46 .SH AUTHORS
47 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
48 S. Raymond.
49 .\"#
50 .\"# The following sets edit modes for GNU EMACS
51 .\"# Local Variables:
52 .\"# mode:nroff
53 .\"# fill-column:79
54 .\"# End: