]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/menu_pattern.3x
ncurses 6.2 - patch 20210403
[ncurses.git] / man / menu_pattern.3x
1 .\"***************************************************************************
2 .\" Copyright 2018-2019,2020 Thomas E. Dickey                                *
3 .\" Copyright 1998-2010,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_pattern.3x,v 1.21 2020/10/18 00:41:14 tom Exp $
31 .TH menu_pattern 3X ""
32 .SH NAME
33 \fBset_menu_pattern\fP,
34 \fBmenu_pattern\fR \- set and get a menu's pattern buffer
35 .SH SYNOPSIS
36 \fB#include <menu.h>\fR
37 .sp
38 \fBint set_menu_pattern(MENU *\fP\fImenu\fP\fB, const char *\fP\fIpattern\fP\fB);\fP
39 .br
40 \fBchar *menu_pattern(const MENU *\fP\fImenu\fP\fB);\fP
41 .br
42 .SH DESCRIPTION
43 Every menu has an associated pattern match buffer.
44 As input events that are
45 printable characters come in, they are appended to this match buffer
46 and tested for a match, as described in \fBmenu_driver\fR(3X).
47 .PP
48 The function \fBset_menu_pattern\fR sets the pattern buffer for the given menu
49 and tries to find the first matching item.
50 If it succeeds, that item becomes
51 current; if not, the current item does not change.
52 .PP
53 The function \fBmenu_pattern\fR returns the pattern buffer of the given
54 \fImenu\fR.
55 .SH RETURN VALUE
56 The function \fBmenu_pattern\fR returns a pointer,
57 which is \fBNULL\fR if the \fImenu\fP parameter is \fBNULL\fP.
58 Otherwise, it is a pointer to a string which is empty
59 if no pattern has been set.
60 It does not set \fBerrno\fP.
61 .PP
62 The function \fBset_menu_pattern\fR may return the following error codes:
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_BAD_STATE
71 Routine was called from an initialization or termination function.
72 .TP 5
73 .B E_NOT_CONNECTED
74 No items are connected to menu.
75 .TP 5
76 .B E_NO_MATCH
77 Character failed to match.
78 .TP 5
79 .B E_SYSTEM_ERROR
80 System error occurred (see \fBerrno\fR(3)).
81 .SH SEE ALSO
82 \fBcurses\fR(3X), \fBmenu\fR(3X).
83 .SH NOTES
84 The header file \fB<menu.h>\fR automatically includes the header file
85 \fB<curses.h>\fR.
86 .SH PORTABILITY
87 These routines emulate the System V menu library.
88 They were not supported on
89 Version 7 or BSD versions.
90 .SH AUTHORS
91 Juergen Pfeifer.
92 Manual pages and adaptation for new curses by Eric S. Raymond.