Debian Codegraph @

upstream/debian-unstable/man3/items.3menu

raw
1 .\"***************************************************************************
2 .\" Copyright 2018-2023,2024 Thomas E. Dickey *
3 .\" Copyright 1998-2012,2015 Free Software Foundation, Inc. *
4 .\" *
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 .\"
30 .\" $Id: menu_items.3x,v 1.36 2024/12/28 21:26:21 tom Exp $
31 .TH items 3MENU 2024-12-28 "ncurses 6.6" "Library calls"
32 .SH NAME
33 \fBset_menu_items\fP,
34 \fBmenu_items\fP,
35 \fBitem_count\fP \-
36 make and break connections between items and menus
37 .SH SYNOPSIS
38 .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
45 .SH DESCRIPTION
46 The function \fBset_menu_items\fP changes the item pointer array of the given
47 \fImenu\fP. The array must be terminated by a
48 .IR NULL "."
49 .PP
50 The function \fBmenu_items\fP returns the item array of the given menu.
51 .PP
52 The function \fBitem_count\fP returns the count of items in \fImenu\fP.
53 .SH RETURN VALUE
54 The function \fBmenu_items\fP returns a pointer (which may be
55 .IR NULL ")."
56 It does not set \fBerrno\fP.
57 .PP
58 The function \fBitem_count\fP returns \fBERR\fP (the general \fBcurses\fP error
59 return value) if its \fImenu\fP parameter is
60 .I NULL "."
61 .PP
62 The function \fBset_menu_items\fP returns one of the following codes on error:
63 .TP 5
64 .B E_OK
65 The routine succeeded.
66 .TP 5
67 .B E_BAD_ARGUMENT
68 Routine detected an incorrect or out-of-range argument.
69 .TP 5
70 .B E_NOT_CONNECTED
71 No items are connected to the menu.
72 .TP 5
73 .B E_POSTED
74 The menu is already posted.
75 .TP 5
76 .B E_SYSTEM_ERROR
77 System error occurred (see \fBerrno\fP(3)).
78 .SH PORTABILITY
79 These routines emulate the System V menu library.
80 They were not supported on
81 Version 7 or BSD versions.
82 .PP
83 The SVr4 menu library documentation specifies the \fBitem_count\fP error value
84 as \-1 (which is the value of \fBERR\fP).
85 .SH AUTHORS
86 Juergen Pfeifer.
87 Manual pages and adaptation for new curses by Eric S. Raymond.
88 .SH SEE ALSO
89 \fB\%ncurses\fP(3NCURSES),
90 \fB\%menu\fP(3MENU)