xref: /illumos-gate/usr/src/cmd/format/menu.h (revision b12aaafb)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_MENU_H
27 #define	_MENU_H
28 
29 #ifdef	__cplusplus
30 extern "C" {
31 #endif
32 
33 /*
34  * This file contains declarations pertaining to the menus.
35  */
36 /*
37  * This structure defines a menu entry.  It consists of a command
38  * name, the function to run the command, and a function to determine
39  * if the menu entry is enabled at this particular state in the program.
40  * The descriptive text that appears after the command name in the menus
41  * is actually part of the command name to the program.  Since
42  * abbreviation is allowed for commands, the user never notices the
43  * extra characters.
44  */
45 struct menu_item {
46 	char	*menu_cmd;
47 	int	(*menu_func)();
48 	int	(*menu_state)();
49 };
50 
51 
52 /*
53  *	Prototypes for ANSI C compilers
54  */
55 
56 char	**create_menu_list(struct menu_item *menu);
57 void	display_menu_list(char **list);
58 void	redisplay_menu_list(char **list);
59 void	run_menu(struct menu_item *, char *, char *, int);
60 int	true(void);
61 int	embedded_scsi(void);
62 int	not_embedded_scsi(void);
63 int	not_scsi(void);
64 int	not_efi(void);
65 int	disp_expert_change_expert_efi(void);
66 int	disp_expand_efi(void);
67 int	disp_all_change_expert_efi(void);
68 int	scsi(void);
69 int	scsi_expert(void);
70 int	expert(void);
71 int	developer(void);
72 int	support_fdisk_on_sparc(void);
73 
74 #ifdef	__cplusplus
75 }
76 #endif
77 
78 #endif	/* _MENU_H */
79