blob: 43409fef812b2faa7f49c5a3a71402b0ef7145fa [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04002.\" Copyright 2018-2023,2024 Thomas E. Dickey *
3.\" Copyright 1998-2012,2015 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05304.\" *
5.\" Permission is hereby granted, free of charge, to any person obtaining a *
6.\" copy of this software and associated documentation files (the *
7.\" "Software"), to deal in the Software without restriction, including *
8.\" without limitation the rights to use, copy, modify, merge, publish, *
9.\" distribute, distribute with modifications, sublicense, and/or sell *
10.\" copies of the Software, and to permit persons to whom the Software is *
11.\" furnished to do so, subject to the following conditions: *
12.\" *
13.\" The above copyright notice and this permission notice shall be included *
14.\" in all copies or substantial portions of the Software. *
15.\" *
16.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
17.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
18.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
19.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
20.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
21.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
22.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23.\" *
24.\" Except as contained in this notice, the name(s) of the above copyright *
25.\" holders shall not be used in advertising or otherwise to promote the *
26.\" sale, use or other dealings in this Software without prior written *
27.\" authorization. *
28.\"***************************************************************************
29.\"
micky3879b9f5e72025-07-08 18:04:53 -040030.\" $Id: menu_items.3x,v 1.34 2024/03/16 15:35:01 tom Exp $
31.TH menu_items 3X 2024-03-16 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053032.SH NAME
micky3879b9f5e72025-07-08 18:04:53 -040033\fBset_menu_items\fP,
34\fBmenu_items\fP,
35\fBitem_count\fP \-
36make and break connections between items and menus
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053037.SH SYNOPSIS
micky3879b9f5e72025-07-08 18:04:53 -040038.nf
39\fB#include <menu.h>
40.PP
41\fBint set_menu_items(MENU *\fImenu\fP, ITEM **\fIitems\fP);
42\fBITEM **menu_items(const MENU *\fImenu\fP);
43\fBint item_count(const MENU *\fImenu\fP);
44.fi
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053045.SH DESCRIPTION
micky3879b9f5e72025-07-08 18:04:53 -040046The function \fBset_menu_items\fP changes the item pointer array of the given
47\fImenu\fP. The array must be terminated by a \fBNULL\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053048.PP
micky3879b9f5e72025-07-08 18:04:53 -040049The function \fBmenu_items\fP returns the item array of the given menu.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053050.PP
micky3879b9f5e72025-07-08 18:04:53 -040051The function \fBitem_count\fP returns the count of items in \fImenu\fP.
Steve Kondikae271bc2015-11-15 02:50:53 +010052.SH RETURN VALUE
micky3879b9f5e72025-07-08 18:04:53 -040053The function \fBmenu_items\fP returns a pointer (which may be \fBNULL\fP).
54It does not set \fBerrno\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053055.PP
micky3879b9f5e72025-07-08 18:04:53 -040056The function \fBitem_count\fP returns \fBERR\fP (the general \fBcurses\fP error
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053057return value) if its \fImenu\fP parameter is \fBNULL\fP.
58.PP
micky3879b9f5e72025-07-08 18:04:53 -040059The function \fBset_menu_items\fP returns one of the following codes on error:
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053060.TP 5
61.B E_OK
62The routine succeeded.
63.TP 5
64.B E_BAD_ARGUMENT
65Routine detected an incorrect or out-of-range argument.
66.TP 5
67.B E_NOT_CONNECTED
68No items are connected to the menu.
69.TP 5
70.B E_POSTED
71The menu is already posted.
72.TP 5
73.B E_SYSTEM_ERROR
micky3879b9f5e72025-07-08 18:04:53 -040074System error occurred (see \fBerrno\fP(3)).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053075.SH PORTABILITY
micky3879b9f5e72025-07-08 18:04:53 -040076These routines emulate the System V menu library.
77They were not supported on
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053078Version 7 or BSD versions.
79.PP
micky3879b9f5e72025-07-08 18:04:53 -040080The SVr4 menu library documentation specifies the \fBitem_count\fP error value
81as \-1 (which is the value of \fBERR\fP).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053082.SH AUTHORS
micky3879b9f5e72025-07-08 18:04:53 -040083Juergen Pfeifer.
84Manual pages and adaptation for new curses by Eric S. Raymond.
85.SH SEE ALSO
86\fB\%curses\fP(3X),
87\fB\%menu\fP(3X)