]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/menu_new.3x
ncurses 6.2 - patch 20200725
[ncurses.git] / man / menu_new.3x
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright 2018-2019,2020 Thomas E. Dickey                                *
4 .\" Copyright 1998-2010,2015 Free Software Foundation, Inc.                  *
5 .\"                                                                          *
6 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
7 .\" copy of this software and associated documentation files (the            *
8 .\" "Software"), to deal in the Software without restriction, including      *
9 .\" without limitation the rights to use, copy, modify, merge, publish,      *
10 .\" distribute, distribute with modifications, sublicense, and/or sell       *
11 .\" copies of the Software, and to permit persons to whom the Software is    *
12 .\" furnished to do so, subject to the following conditions:                 *
13 .\"                                                                          *
14 .\" The above copyright notice and this permission notice shall be included  *
15 .\" in all copies or substantial portions of the Software.                   *
16 .\"                                                                          *
17 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
18 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
19 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
20 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
21 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
22 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
23 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
24 .\"                                                                          *
25 .\" Except as contained in this notice, the name(s) of the above copyright   *
26 .\" holders shall not be used in advertising or otherwise to promote the     *
27 .\" sale, use or other dealings in this Software without prior written       *
28 .\" authorization.                                                           *
29 .\"***************************************************************************
30 .\"
31 .\" $Id: menu_new.3x,v 1.16 2020/03/28 19:06:28 tom Exp $
32 .TH menu_new 3X ""
33 .SH NAME
34 \fBnew_menu\fP,
35 \fBfree_menu\fR \- create and destroy menus
36 .SH SYNOPSIS
37 \fB#include <menu.h>\fR
38 .br
39 MENU *new_menu(ITEM **items);
40 .br
41 int free_menu(MENU *menu);
42 .br
43 .SH DESCRIPTION
44 The function \fBnew_menu\fR creates a new menu connected to a specified item
45 pointer array (which must be \fBNULL\fR-terminated).
46 .PP
47 The function \fBfree_menu\fR disconnects \fImenu\fR from its item array
48 and frees the storage allocated for the menu.
49 .SH RETURN VALUE
50 The function \fBnew_menu\fR returns \fBNULL\fR on error.
51 It sets \fBerrno\fP according to the function's failure:
52 .TP 5
53 .B E_NOT_CONNECTED
54 No items are connected to the menu.
55 .TP 5
56 .B E_SYSTEM_ERROR
57 System error occurred, e.g., malloc failure.
58 .PP
59 The function \fBfree_menu\fR returns one of the following:
60 .TP 5
61 .B E_OK
62 The routine succeeded.
63 .TP 5
64 .B E_SYSTEM_ERROR
65 System error occurred (see \fBerrno\fR(3)).
66 .TP 5
67 .B E_BAD_ARGUMENT
68 Routine detected an incorrect or out-of-range argument.
69 .TP 5
70 .B E_POSTED
71 The menu has already been posted.
72 .SH SEE ALSO
73 \fBcurses\fR(3X), \fBmenu\fR(3X).
74 .SH NOTES
75 The header file \fB<menu.h>\fR automatically includes the header file
76 \fB<curses.h>\fR.
77 .SH PORTABILITY
78 These routines emulate the System V menu library.
79 They were not supported on
80 Version 7 or BSD versions.
81 .SH AUTHORS
82 Juergen Pfeifer.
83 Manual pages and adaptation for new curses by Eric S. Raymond.