jcs's openbsd hax
openbsd
1.\" $OpenBSD: menu_pattern.3,v 1.8 2023/10/17 09:52:10 nicm Exp $
2.\"
3.\"***************************************************************************
4.\" Copyright 2018-2022,2023 Thomas E. Dickey *
5.\" Copyright 1998-2010,2015 Free Software Foundation, Inc. *
6.\" *
7.\" Permission is hereby granted, free of charge, to any person obtaining a *
8.\" copy of this software and associated documentation files (the *
9.\" "Software"), to deal in the Software without restriction, including *
10.\" without limitation the rights to use, copy, modify, merge, publish, *
11.\" distribute, distribute with modifications, sublicense, and/or sell *
12.\" copies of the Software, and to permit persons to whom the Software is *
13.\" furnished to do so, subject to the following conditions: *
14.\" *
15.\" The above copyright notice and this permission notice shall be included *
16.\" in all copies or substantial portions of the Software. *
17.\" *
18.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
19.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
20.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
21.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
22.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
23.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
24.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
25.\" *
26.\" Except as contained in this notice, the name(s) of the above copyright *
27.\" holders shall not be used in advertising or otherwise to promote the *
28.\" sale, use or other dealings in this Software without prior written *
29.\" authorization. *
30.\"***************************************************************************
31.\"
32.\" $Id: menu_pattern.3,v 1.8 2023/10/17 09:52:10 nicm Exp $
33.TH menu_pattern 3 2023-07-01 "ncurses 6.4" "Library calls"
34.SH NAME
35\fBset_menu_pattern\fP,
36\fBmenu_pattern\fP \- set and get a menu's pattern buffer
37.SH SYNOPSIS
38\fB#include <menu.h>\fP
39.sp
40\fBint set_menu_pattern(MENU *\fImenu\fB, const char *\fIpattern\fB);\fR
41.br
42\fBchar *menu_pattern(const MENU *\fImenu\fB);\fR
43.SH DESCRIPTION
44Every menu has an associated pattern match buffer.
45As input events that are
46printable characters come in, they are appended to this match buffer
47and tested for a match, as described in \fBmenu_driver\fP(3).
48.PP
49The function \fBset_menu_pattern\fP sets the pattern buffer for the given menu
50and tries to find the first matching item.
51If it succeeds, that item becomes
52current; if not, the current item does not change.
53.PP
54The function \fBmenu_pattern\fP returns the pattern buffer of the given
55\fImenu\fP.
56.SH RETURN VALUE
57The function \fBmenu_pattern\fP returns a pointer,
58which is \fBNULL\fP if the \fImenu\fP parameter is \fBNULL\fP.
59Otherwise, it is a pointer to a string which is empty
60if no pattern has been set.
61It does not set \fBerrno\fP.
62.PP
63The function \fBset_menu_pattern\fP may return the following error codes:
64.TP 5
65.B E_OK
66The routine succeeded.
67.TP 5
68.B E_BAD_ARGUMENT
69Routine detected an incorrect or out-of-range argument.
70.TP 5
71.B E_BAD_STATE
72Routine was called from an initialization or termination function.
73.TP 5
74.B E_NOT_CONNECTED
75No items are connected to menu.
76.TP 5
77.B E_NO_MATCH
78Character failed to match.
79.TP 5
80.B E_SYSTEM_ERROR
81System error occurred (see \fBerrno\fP(3)).
82.SH SEE ALSO
83\fBcurses\fP(3), \fBmenu\fP(3).
84.SH NOTES
85The header file \fB<menu.h>\fP automatically includes the header file
86\fB<curses.h>\fP.
87.SH PORTABILITY
88These routines emulate the System V menu library.
89They were not supported on
90Version 7 or BSD versions.
91.SH AUTHORS
92Juergen Pfeifer.
93Manual pages and adaptation for new curses by Eric S. Raymond.