1menu_pattern(3X) menu_pattern(3X)
2
3
4
6 set_menu_pattern, menu_pattern - set and get a menu's pattern buffer
7
9 #include <menu.h>
10 int set_menu_pattern(MENU *menu, const char *pattern);
11 char *menu_pattern(const MENU *menu);
12
14 Every menu has an associated pattern match buffer. As input events
15 that are printable characters come in, they are appended to this match
16 buffer and tested for a match, as described in menu_driver(3X).
17
18 The function set_menu_pattern sets the pattern buffer for the given
19 menu and tries to find the first matching item. If it succeeds, that
20 item becomes current; if not, the current item does not change.
21
22 The function menu_pattern returns the pattern buffer of the given menu.
23
25 The function menu_pattern returns a pointer, which is NULL if the menu
26 parameter is NULL. Otherwise, it is a pointer to a string which is
27 empty if no pattern has been set. It does not set errno.
28
29 The function set_menu_pattern may return the following error codes:
30
31 E_OK The routine succeeded.
32
33 E_BAD_ARGUMENT
34 Routine detected an incorrect or out-of-range argument.
35
36 E_BAD_STATE
37 Routine was called from an initialization or termination function.
38
39 E_NOT_CONNECTED
40 No items are connected to menu.
41
42 E_NO_MATCH
43 Character failed to match.
44
45 E_SYSTEM_ERROR
46 System error occurred (see errno).
47
49 curses(3X), menu(3X).
50
52 The header file <menu.h> automatically includes the header file
53 <curses.h>.
54
56 These routines emulate the System V menu library. They were not sup‐
57 ported on Version 7 or BSD versions.
58
60 Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S.
61 Raymond.
62
63
64
65 menu_pattern(3X)