Copyright 1989 AT&T
Portions Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
cc [ flag... ] file... -lmenu -lcurses [ library... ] #include <menu.h> int menu_driver(MENU *menu, int c);
menu_driver() is the workhorse of the menus subsystem. It checks to determine whether the character c is a menu request or data. If c is a request, the menu driver executes the request and reports the result. If c is data (a printable ASCII character), it enters the data into the pattern buffer and tries to find a matching item. If no match is found, the menu driver deletes the character from the pattern buffer and returns E_NO_MATCH. If the character is not recognized, the menu driver assumes it is an application-defined command and returns E_UNKNOWN_COMMAND.
Menu driver requests: REQ_LEFT_ITEM
Move left to an item.
Move right to an item
Move up to an item.
Move down to an item.
Scroll up a line.
Scroll down a line.
Scroll up a page.
Scroll down a page.
Move to the first item.
Move to the last item.
Move to the next item.
Move to the previous item.
Clear the menu pattern buffer.
Delete the previous character from pattern buffer.
Move the next matching item.
Move to the previous matching item.
menu_driver() returns one of the following: E_OK
The routine returned successfully.
System error.
An incorrect argument was passed to the routine.
The routine was called from an initialization or termination function.
The menu has not been posted.
An unknown request was passed to the menu driver.
The character failed to match.
The item cannot be selected.
The menu driver could not process the request.
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE |
MT-Level Unsafe |
curses (3CURSES), menus (3CURSES), attributes (7)
Application-defined commands should be defined relative to (greater than) MAX_COMMAND, the maximum value of a request listed above.
The header <menu.h> automatically includes the headers <eti.h> and <curses.h>.