diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/ipxe/dynui.h | 50 | ||||
-rw-r--r-- | src/include/ipxe/errfile.h | 2 | ||||
-rw-r--r-- | src/include/ipxe/menu.h | 49 | ||||
-rw-r--r-- | src/include/ipxe/parseopt.h | 4 |
4 files changed, 53 insertions, 52 deletions
diff --git a/src/include/ipxe/dynui.h b/src/include/ipxe/dynui.h new file mode 100644 index 000000000..25124a3af --- /dev/null +++ b/src/include/ipxe/dynui.h @@ -0,0 +1,50 @@ +#ifndef _IPXE_DYNUI_H +#define _IPXE_DYNUI_H + +/** @file + * + * Dynamic user interfaces + * + */ + +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); + +#include <ipxe/list.h> + +/** A dynamic user interface */ +struct dynamic_ui { + /** List of dynamic user interfaces */ + struct list_head list; + /** Name */ + const char *name; + /** Title */ + const char *title; + /** Dynamic user interface items */ + struct list_head items; +}; + +/** A dynamic user interface item */ +struct dynamic_item { + /** List of dynamic user interface items */ + struct list_head list; + /** Name */ + const char *name; + /** Text */ + const char *text; + /** Shortcut key */ + int shortcut; + /** Is default item */ + int is_default; +}; + +extern struct dynamic_ui * create_dynui ( const char *name, const char *title ); +extern struct dynamic_item * add_dynui_item ( struct dynamic_ui *dynui, + const char *name, + const char *text, int shortcut, + int is_default ); +extern void destroy_dynui ( struct dynamic_ui *dynui ); +extern struct dynamic_ui * find_dynui ( const char *name ); +extern int show_menu ( struct dynamic_ui *dynui, unsigned long timeout, + const char *select, struct dynamic_item **selected ); + +#endif /* _IPXE_DYNUI_H */ diff --git a/src/include/ipxe/errfile.h b/src/include/ipxe/errfile.h index a9ce6569b..d75661ba7 100644 --- a/src/include/ipxe/errfile.h +++ b/src/include/ipxe/errfile.h @@ -364,7 +364,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #define ERRFILE_cms ( ERRFILE_OTHER | 0x002a0000 ) #define ERRFILE_imgtrust ( ERRFILE_OTHER | 0x002b0000 ) #define ERRFILE_menu_ui ( ERRFILE_OTHER | 0x002c0000 ) -#define ERRFILE_menu_cmd ( ERRFILE_OTHER | 0x002d0000 ) +#define ERRFILE_dynui_cmd ( ERRFILE_OTHER | 0x002d0000 ) #define ERRFILE_validator ( ERRFILE_OTHER | 0x002e0000 ) #define ERRFILE_ocsp ( ERRFILE_OTHER | 0x002f0000 ) #define ERRFILE_nslookup ( ERRFILE_OTHER | 0x00300000 ) diff --git a/src/include/ipxe/menu.h b/src/include/ipxe/menu.h deleted file mode 100644 index d11a92559..000000000 --- a/src/include/ipxe/menu.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef _IPXE_MENU_H -#define _IPXE_MENU_H - -/** @file - * - * Menu selection - * - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#include <ipxe/list.h> - -/** A menu */ -struct menu { - /** List of menus */ - struct list_head list; - /** Name */ - const char *name; - /** Title */ - const char *title; - /** Menu items */ - struct list_head items; -}; - -/** A menu item */ -struct menu_item { - /** List of menu items */ - struct list_head list; - /** Name */ - const char *name; - /** Text */ - const char *text; - /** Shortcut key */ - int shortcut; - /** Is default item */ - int is_default; -}; - -extern struct menu * create_menu ( const char *name, const char *title ); -extern struct menu_item * add_menu_item ( struct menu *menu, const char *name, - const char *text, int shortcut, - int is_default ); -extern void destroy_menu ( struct menu *menu ); -extern struct menu * find_menu ( const char *name ); -extern int show_menu ( struct menu *menu, unsigned long timeout, - const char *select, struct menu_item **selected ); - -#endif /* _IPXE_MENU_H */ diff --git a/src/include/ipxe/parseopt.h b/src/include/ipxe/parseopt.h index 61010f22a..5c449cd42 100644 --- a/src/include/ipxe/parseopt.h +++ b/src/include/ipxe/parseopt.h @@ -16,7 +16,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); struct net_device; struct net_device_configurator; -struct menu; +struct dynamic_ui; struct parameters; /** A command-line option descriptor */ @@ -142,7 +142,7 @@ extern int parse_netdev ( char *text, struct net_device **netdev ); extern int parse_netdev_configurator ( char *text, struct net_device_configurator **configurator ); -extern int parse_menu ( char *text, struct menu **menu ); +extern int parse_dynui ( char *text, struct dynamic_ui **dynui ); extern int parse_flag ( char *text __unused, int *flag ); extern int parse_key ( char *text, unsigned int *key ); extern int parse_settings ( char *text, struct settings **settings ); |