summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/nc-widgets.h
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-12-18 13:05:01 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-12-18 13:43:49 +0800
commit90cc2a11507462e9c40f2494165741561729bdfb (patch)
treec92ad1aaa800a5b7135ded08ca008a97658f8aa4 /ui/ncurses/nc-widgets.h
parentb2ba8efeb3ea00a9b404f403549caa692fe34cc7 (diff)
downloadtalos-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.h5
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);
OpenPOWER on IntegriCloud