blob: e63a9f73d84c5f948aec8a939ec563d6bd63d705 [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
Steve Kondikae271bc2015-11-15 02:50:53 +01002.\" Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05303.\" *
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.\"
Steve Kondikae271bc2015-11-15 02:50:53 +010029.\" $Id: menu_pattern.3x,v 1.13 2010/12/04 18:40:45 tom Exp $
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053030.TH menu_pattern 3X ""
31.SH NAME
Steve Kondikae271bc2015-11-15 02:50:53 +010032\fBmenu_pattern\fR \- get and set a menu's pattern buffer
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053033.SH SYNOPSIS
34\fB#include <menu.h>\fR
35.br
36int set_menu_pattern(MENU *menu, const char *pattern);
37.br
38char *menu_pattern(const MENU *menu);
39.br
40.SH DESCRIPTION
41Every menu has an associated pattern match buffer. As input events that are
42printable characters come in, they are appended to this match buffer
43and tested for a match, as described in \fBmenu_driver\fR(3X).
44.PP
45The function \fBset_menu_pattern\fR sets the pattern buffer for the given menu
46and tries to find the first matching item. If it succeeds, that item becomes
47current; if not, the current item does not change.
48.PP
49The function \fBmenu_pattern\fR returns the pattern buffer of the given
50\fImenu\fR.
51.SH RETURN VALUE
52The function \fBmenu_pattern\fR returns a pointer, which is \fBNULL\fR if the \fImenu\fP parameter is \fBNULL\fP.
53Otherwise, it is a pointer to a string which is empty if no pattern has been set.
54It does not set errno.
55.PP
56The function \fBset_menu_pattern\fR may return the following error codes:
57.TP 5
58.B E_OK
59The routine succeeded.
60.TP 5
61.B E_BAD_ARGUMENT
62Routine detected an incorrect or out-of-range argument.
63.TP 5
64.B E_BAD_STATE
65Routine was called from an initialization or termination function.
66.TP 5
67.B E_NOT_CONNECTED
68No items are connected to menu.
69.TP 5
70.B E_NO_MATCH
71Character failed to match.
72.TP 5
73.B E_SYSTEM_ERROR
74System error occurred (see \fBerrno\fR).
75.SH SEE ALSO
76\fBcurses\fR(3X), \fBmenu\fR(3X).
77.SH NOTES
78The header file \fB<menu.h>\fR automatically includes the header file
79\fB<curses.h>\fR.
80.SH PORTABILITY
81These routines emulate the System V menu library. They were not supported on
82Version 7 or BSD versions.
83.SH AUTHORS
84Juergen Pfeifer. Manual pages and adaptation for new curses by Eric
85S. Raymond.