menu.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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
* 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]
*
* CDDL HEADER END
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1997, by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _MENU_H
#define _MENU_H
#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.15 */
#include <curses.h>
#include <eti.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Menu options: */
#define O_ONEVALUE 0x01
#define O_SHOWDESC 0x02
#define O_ROWMAJOR 0x04
#define O_IGNORECASE 0x08
#define O_SHOWMATCH 0x10
#define O_NONCYCLIC 0x20
/* Item options: */
#define O_SELECTABLE 0x01
typedef struct {
char *str;
int length;
} TEXT;
typedef struct ITEM {
int index; /* Item number */
int value;
char *userptr;
int status;
short y; /* y and x location of item in menu */
short x;
} ITEM;
#define _POSTED 0x1
#define _IN_DRIVER 0x2
#define _LINK_NEEDED 0x4
typedef struct MENU {
int height; /* Number of chars high */
int width; /* Number of chars wide */
int rows; /* Number of items high */
int cols; /* Number of items wide */
int frows; /* Number of formated items high */
int fcols; /* Number of formated items wide */
int namelen; /* Length of widest name */
int desclen; /* Length of widest description */
int marklen; /* Length of mark */
int itemlen; /* Length of an one item */
char *pattern; /* Buffer used to store match chars */
int pindex; /* Index into pattern buffer */
int nitems; /* Total number of items in menu */
int toprow; /* Top row of menu */
int pad; /* Pad character */
char *userptr;
char *mark;
int status;
} MENU;
/* Define keys */
#ifdef __STDC__
*current_item(MENU *),
*new_item(char *, char *);
extern char *item_description(ITEM *),
*item_userptr(ITEM *),
*menu_pattern(MENU *),
*menu_userptr(MENU *);
item_count(MENU *),
item_index(ITEM *),
item_value(ITEM *),
item_visible(ITEM *),
menu_driver(MENU *, int),
pos_menu_cursor(MENU *),
scale_menu(MENU *, int *, int *),
set_item_userptr(ITEM *, char *),
set_item_value(ITEM *, int),
set_menu_format(MENU *, int, int),
set_menu_mark(MENU *, char *),
set_menu_pad(MENU *, int),
set_menu_pattern(MENU *, char *),
set_menu_userptr(MENU *, char *),
set_top_row(MENU *, int),
unpost_menu(MENU *);
void menu_format(MENU *, int *, int *);
#else /* old style extern's */
extern ITEM **menu_items(),
*current_item(),
*new_item();
menu_opts();
item_term(),
menu_init(),
menu_term();
*menu_win();
extern char *item_description(),
*item_name(),
*item_userptr(),
*menu_mark(),
*menu_pattern(),
*menu_userptr();
menu_fore(),
menu_grey();
extern int free_item(),
free_menu(),
item_count(),
item_index(),
item_opts_on(),
item_value(),
item_visible(),
menu_driver(),
menu_opts_on(),
menu_pad(),
post_menu(),
scale_menu(),
set_menu_pad(),
set_menu_sub(),
set_menu_win(),
set_top_row(),
top_row(),
unpost_menu();
void menu_format();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* _MENU_H */