summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/nc-widgets.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-11-17 14:04:08 +1100
committerJeremy Kerr <jk@ozlabs.org>2013-11-22 10:45:54 +0800
commit37c9aee3ffc02a299d94867df9df8132b09fc611 (patch)
treeff87ad3b758f7da2bad7c69b9b8d7113657b9dcb /ui/ncurses/nc-widgets.c
parent504b84c7a37ba8656bceb80fa37138751b7a6702 (diff)
downloadtalos-petitboot-37c9aee3ffc02a299d94867df9df8132b09fc611.tar.gz
talos-petitboot-37c9aee3ffc02a299d94867df9df8132b09fc611.zip
ui/ncurses: Make boot editor API consistent with config & sysinfo screens
The boot-editor API is a little more exposed than it needs to be: the boot_editor struct does not need to be available to other files, and the init function and on_exit functions differ from those provided for the config and sysinfo screens. This change unifies the boot_editor API with those for the other screens. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses/nc-widgets.c')
-rw-r--r--ui/ncurses/nc-widgets.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/ui/ncurses/nc-widgets.c b/ui/ncurses/nc-widgets.c
index d17034d..98ea6be 100644
--- a/ui/ncurses/nc-widgets.c
+++ b/ui/ncurses/nc-widgets.c
@@ -17,6 +17,33 @@
#define _GNU_SOURCE
+#include "config.h"
+
+#include <linux/input.h> /* This must be included before ncurses.h */
+#if defined HAVE_NCURSESW_CURSES_H
+# include <ncursesw/curses.h>
+#elif defined HAVE_NCURSESW_H
+# include <ncursesw.h>
+#elif defined HAVE_NCURSES_CURSES_H
+# include <ncurses/curses.h>
+#elif defined HAVE_NCURSES_H
+# include <ncurses.h>
+#elif defined HAVE_CURSES_H
+# include <curses.h>
+#else
+# error "Curses header file not found."
+#endif
+
+#if defined HAVE_NCURSESW_FORM_H
+# include <ncursesw/form.h>
+#elif defined HAVE_NCURSES_FORM_H
+# include <ncurses/form.h>
+#elif defined HAVE_FORM_H
+# include <form.h>
+#else
+# error "Curses form.h not found."
+#endif
+
#include <string.h>
#include <ctype.h>
OpenPOWER on IntegriCloud