1menu_driver(3CURSES) Curses Library Functions menu_driver(3CURSES)
2
3
4
6 menu_driver - command processor for the menus subsystem
7
9 cc [ flag... ] file... -lmenu -lcurses [ library... ]
10 #include <menu.h>
11
12 int menu_driver(MENU *menu, int c);
13
14
16 menu_driver() is the workhorse of the menus subsystem. It checks to
17 determine whether the character c is a menu request or data. If c is a
18 request, the menu driver executes the request and reports the result.
19 If c is data (a printable ASCII character), it enters the data into the
20 pattern buffer and tries to find a matching item. If no match is found,
21 the menu driver deletes the character from the pattern buffer and
22 returns E_NO_MATCH. If the character is not recognized, the menu driver
23 assumes it is an application-defined command and returns E_UNKNOWN_COM‐
24 MAND.
25
26
27 Menu driver requests:
28
29 REQ_LEFT_ITEM Move left to an item.
30
31
32 REQ_RIGHT_ITEM Move right to an item
33
34
35 REQ_UP_ITEM Move up to an item.
36
37
38 REQ_DOWN_ITEM Move down to an item.
39
40
41 REQ_SCR_ULINE Scroll up a line.
42
43
44 REQ_SCR_DLINE Scroll down a line.
45
46
47 REQ_SCR_DPAGE Scroll up a page.
48
49
50 REQ_SCR_UPAGE Scroll down a page.
51
52
53 REQ_FIRST_ITEM Move to the first item.
54
55
56 REQ_LAST_ITEM Move to the last item.
57
58
59 REQ_NEXT_ITEM Move to the next item.
60
61
62 REQ_PREV_ITEM Move to the previous item.
63
64
65 REQ_TOGGLE_ITEM Select/de-select an item.
66
67
68 REQ_CLEAR_PATTERN Clear the menu pattern buffer.
69
70
71 REQ_BACK_PATTERN Delete the previous character from pattern buffer.
72
73
74 REQ_NEXT_MATCH Move the next matching item.
75
76
77 REQ_PREV_MATCH Move to the previous matching item.
78
79
81 menu_driver() returns one of the following:
82
83 E_OK The routine returned successfully.
84
85
86 E_SYSTEM_ERROR System error.
87
88
89 E_BAD_ARGUMENT An incorrect argument was passed to the routine.
90
91
92 E_BAD_STATE The routine was called from an initialization or
93 termination function.
94
95
96 E_NOT_POSTED The menu has not been posted.
97
98
99 E_UNKNOWN_COMMAND An unknown request was passed to the menu driver.
100
101
102 E_NO_MATCH The character failed to match.
103
104
105 E_NOT_SELECTABLE The item cannot be selected.
106
107
108 E_REQUEST_DENIED The menu driver could not process the request.
109
110
112 See attributes(5) for descriptions of the following attributes:
113
114
115
116
117 ┌─────────────────────────────┬─────────────────────────────┐
118 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
119 ├─────────────────────────────┼─────────────────────────────┤
120 │MT-Level │Unsafe │
121 └─────────────────────────────┴─────────────────────────────┘
122
124 curses(3CURSES), menus(3CURSES), attributes(5)
125
127 Application-defined commands should be defined relative to (greater
128 than) MAX_COMMAND, the maximum value of a request listed above.
129
130
131 The header <menu.h> automatically includes the headers <eti.h> and
132 <curses.h>.
133
134
135
136SunOS 5.11 31 Dec 1996 menu_driver(3CURSES)