menu_driver(3X)
NAME
menu_driver − command processor for the menus subsystem
SYNOPSIS
#include <menu.h>
int menu_driver(MENU ∗menu, int c);
DESCRIPTION
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_ITEMMove left to an item.
REQ_RIGHT_ITEMMove right to an item.
REQ_UP_ITEMMove up to an item.
REQ_DOWN_ITEMMove down to an item.
REQ_SCR_ULINEScroll up a line.
REQ_SCR_DLINEScroll down a line.
REQ_SCR_DPAGEScroll up a page.
REQ_SCR_UPAGEScroll down a page.
REQ_FIRST_ITEMMove to the first item.
REQ_LAST_ITEMMove to the last item.
REQ_NEXT_ITEMMove to the next item.
REQ_PREV_ITEMMove to the previous item.
REQ_TOGGLE_ITEMSelect/de-select an item.
REQ_CLEAR_PATTERNClear the menu pattern buffer.
REQ_BACK_PATTERNDelete the previous character from
pattern buffer.
REQ_NEXT_MATCHMove the next matching item.
REQ_PREV_MATCHMove to the previous matching item.
RETURN VALUES
menu_driver() returns one of the following:
E_OKThe routine returned successfully.
E_SYSTEM_ERRORSystem error.
E_BAD_ARGUMENTAn incorrect argument was passed to
the routine.
E_BAD_STATEThe routine was called from an
initialization or termination
function.
E_NOT_POSTEDThe menu has not been posted.
E_UNKNOWN_COMMANDAn unknown request was passed to
the menu driver.
E_NO_MATCHThe character failed to match.
E_NOT_SELECTABLEThe item cannot be selected.
E_REQUEST_DENIEDThe menu driver could not process
the request.
NOTES
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>.
SEE ALSO
SunOS 5.1/SPARC — Last change: 3 Jul 1990