iPXE
include
ipxe
menu.h
Go to the documentation of this file.
1
#ifndef _IPXE_MENU_H
2
#define _IPXE_MENU_H
3
4
/** @file
5
*
6
* Menu selection
7
*
8
*/
9
10
FILE_LICENCE
( GPL2_OR_LATER_OR_UBDL );
11
12
#include <
ipxe/list.h
>
13
14
/** A menu */
15
struct
menu
{
16
/** List of menus */
17
struct
list_head
list
;
18
/** Name */
19
const
char
*
name
;
20
/** Title */
21
const
char
*
title
;
22
/** Menu items */
23
struct
list_head
items
;
24
};
25
26
/** A menu item */
27
struct
menu_item
{
28
/** List of menu items */
29
struct
list_head
list
;
30
/** Label */
31
const
char
*
label
;
32
/** Text */
33
const
char
*
text
;
34
/** Shortcut key */
35
int
shortcut
;
36
/** Is default item */
37
int
is_default
;
38
};
39
40
extern
struct
menu
*
create_menu
(
const
char
*
name
,
const
char
*
title
);
41
extern
struct
menu_item
*
add_menu_item
(
struct
menu
*
menu
,
const
char
*
label
,
42
const
char
*
text
,
int
shortcut
,
43
int
is_default
);
44
extern
void
destroy_menu
(
struct
menu
*
menu
);
45
extern
struct
menu
*
find_menu
(
const
char
*
name
);
46
extern
int
show_menu
(
struct
menu
*
menu
,
unsigned
long
timeout
,
47
const
char
*
select
,
struct
menu_item
**selected );
48
49
#endif
/* _IPXE_MENU_H */
menu_item
A menu item.
Definition:
menu.h:27
name
const char * name
Definition:
ath9k_hw.c:1984
menu::list
struct list_head list
List of menus.
Definition:
menu.h:17
create_menu
struct menu * create_menu(const char *name, const char *title)
Create menu.
Definition:
menu.c:48
menu_item::label
const char * label
Label.
Definition:
menu.h:31
menu::items
struct list_head items
Menu items.
Definition:
menu.h:23
list_head
A doubly-linked list entry (or list head)
Definition:
list.h:18
menu_item::list
struct list_head list
List of menu items.
Definition:
menu.h:29
menu::name
const char * name
Name.
Definition:
menu.h:19
list.h
Linked lists.
menu::title
const char * title
Title.
Definition:
menu.h:21
find_menu
struct menu * find_menu(const char *name)
Find menu.
Definition:
menu.c:171
select
int select(fd_set *readfds, int wait)
Check file descriptors for readiness.
Definition:
posix_io.c:229
menu_item::text
const char * text
Text.
Definition:
menu.h:33
add_menu_item
struct menu_item * add_menu_item(struct menu *menu, const char *label, const char *text, int shortcut, int is_default)
Add menu item.
Definition:
menu.c:103
show_menu
int show_menu(struct menu *menu, unsigned long timeout, const char *select, struct menu_item **selected)
Show menu.
Definition:
menu_ui.c:273
menu_item::is_default
int is_default
Is default item.
Definition:
menu.h:37
timeout
void timeout(int)
FILE_LICENCE
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
menu
A menu.
Definition:
menu.h:15
destroy_menu
void destroy_menu(struct menu *menu)
Destroy menu.
Definition:
menu.c:148
menu_item::shortcut
int shortcut
Shortcut key.
Definition:
menu.h:35
Generated by
1.8.15