mirror of
https://github.com/ipxe/ipxe
synced 2025-12-25 00:17:57 +03:00
[parseopt] Add parse_timeout()
Parsing a timeout value (specified in milliseconds) into an internal timeout value measured in timer ticks is a common operation. Provide a parse_timeout() value to carry out this conversion automatically. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -43,7 +43,7 @@ extern struct menu_item * add_menu_item ( struct menu *menu, const char *label,
|
||||
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 int timeout_ms,
|
||||
extern int show_menu ( struct menu *menu, unsigned long timeout,
|
||||
const char *select, struct menu_item **selected );
|
||||
|
||||
#endif /* _IPXE_MENU_H */
|
||||
|
||||
@@ -126,6 +126,7 @@ struct named_setting {
|
||||
|
||||
extern int parse_string ( char *text, char **value );
|
||||
extern int parse_integer ( char *text, unsigned int *value );
|
||||
extern int parse_timeout ( char *text, unsigned long *value );
|
||||
extern int parse_netdev ( char *text, struct net_device **netdev );
|
||||
extern int parse_menu ( char *text, struct menu **menu );
|
||||
extern int parse_flag ( char *text __unused, int *flag );
|
||||
|
||||
@@ -11,6 +11,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern int ping ( const char *hostname, unsigned long timeout_ms, size_t len );
|
||||
extern int ping ( const char *hostname, unsigned long timeout, size_t len );
|
||||
|
||||
#endif /* _USR_PINGMGMT_H */
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
extern int prompt ( const char *text, unsigned int wait_ms, int key );
|
||||
extern int prompt ( const char *text, unsigned long timeout, int key );
|
||||
|
||||
#endif /* _USR_PROMPT_H */
|
||||
|
||||
Reference in New Issue
Block a user