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