summaryrefslogtreecommitdiffstats
path: root/include/console_countdown.h
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2015-04-22 10:20:10 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-04-23 08:12:28 +0200
commit1aa3dbfc1a6048fe7f6af4f1af4fba7b83194f1f (patch)
tree093235e097fed31da77a856f91fee739b816dfd5 /include/console_countdown.h
parent78caf2d171c97f7d385654af1778ef3e726173ae (diff)
downloadbarebox-1aa3dbfc1a6048fe7f6af4f1af4fba7b83194f1f.tar.gz
barebox-1aa3dbfc1a6048fe7f6af4f1af4fba7b83194f1f.tar.xz
timeout: factor out wait-for-key-press loop into separate file
This patch factors out the wait-for-key-press loop from the shell command "timeout" into a sparate file, so that it can be used from C, too. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/console_countdown.h')
-rw-r--r--include/console_countdown.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/console_countdown.h b/include/console_countdown.h
new file mode 100644
index 0000000000..cb46964bc4
--- /dev/null
+++ b/include/console_countdown.h
@@ -0,0 +1,11 @@
+#ifndef __CONSOLE_COUNTDOWN_H
+#define __CONSOLE_COUNTDOWN_H
+
+#define CONSOLE_COUNTDOWN_SILENT (1 << 0)
+#define CONSOLE_COUNTDOWN_ANYKEY (1 << 1)
+#define CONSOLE_COUNTDOWN_RETURN (1 << 3)
+#define CONSOLE_COUNTDOWN_CTRLC (1 << 4)
+
+int console_countdown(int timeout_s, unsigned flags, char *out_key);
+
+#endif /* __CONSOLE_COUNTDOWN_H */