diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-12-18 13:05:01 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-12-18 13:43:49 +0800 |
commit | 90cc2a11507462e9c40f2494165741561729bdfb (patch) | |
tree | c92ad1aaa800a5b7135ded08ca008a97658f8aa4 /ui/ncurses/nc-widgets.h | |
parent | b2ba8efeb3ea00a9b404f403549caa692fe34cc7 (diff) | |
download | talos-petitboot-90cc2a11507462e9c40f2494165741561729bdfb.tar.gz talos-petitboot-90cc2a11507462e9c40f2494165741561729bdfb.zip |
ui/ncurses/nc-widgets: Add initial textbox validation functions
We'd like to do some validation of the system configuration parameters,
so add a few validation types to the widget code. We currently need
integer, ipv4 address and multiple ipv4 address types. These are
implemented as small wrappers around the ncurses form validator code.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses/nc-widgets.h')
-rw-r--r-- | ui/ncurses/nc-widgets.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/ncurses/nc-widgets.h b/ui/ncurses/nc-widgets.h index 47a57d9..32b6bae 100644 --- a/ui/ncurses/nc-widgets.h +++ b/ui/ncurses/nc-widgets.h @@ -35,6 +35,11 @@ struct nc_widget_button *widget_new_button(struct nc_widgetset *set, int y, int x, int size, const char *str, void (*click)(void *), void *arg); +void widget_textbox_set_validator_integer(struct nc_widget_textbox *textbox, + long min, long max); +void widget_textbox_set_validator_ipv4(struct nc_widget_textbox *textbox); +void widget_textbox_set_validator_ipv4_multi(struct nc_widget_textbox *textbox); + void widget_select_add_option(struct nc_widget_select *select, int value, const char *text, bool selected); |