summaryrefslogtreecommitdiff
path: root/include/expo.h
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2025-05-02 08:46:16 -0600
committerSimon Glass <[email protected]>2025-05-30 09:49:31 +0100
commitbf9860459516d1837e92270340ca307211cd961a (patch)
tree07a30de0e77474896d5a0f942fda3150ef14b44a /include/expo.h
parent5c365ecabcac6d3218cf7e560bda01629a46d88e (diff)
expo: Add a function to poll for input
Both bootflow_menu and cedit use similar logic to poll an expo. Move this into the expo library so the code can be shared. Update bootflow_menu_run() to return -EPIPE when the user quits without choosing anything, since -EAGAIN is ambiguous and elsewhere means that there is no input yet. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include/expo.h')
-rw-r--r--include/expo.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/expo.h b/include/expo.h
index b3b9c0b8872..63452bbdd6a 100644
--- a/include/expo.h
+++ b/include/expo.h
@@ -772,4 +772,17 @@ int expo_build(ofnode root, struct expo **expp);
*/
int cb_expo_build(struct expo **expp);
+/**
+ * expo_poll() - render an expo and see if the user takes an action
+ *
+ * Thsi calls expo_render() and then checks for a keypress. If there is one, it
+ * is processed and the resulting action returned, if any
+ *
+ * @exp: Expo to poll
+ * @act: Returns action on success
+ * Return: 0 if an action was obtained, -EAGAIN if not, other error if something
+ * went wrong
+ */
+int expo_poll(struct expo *exp, struct expo_action *act);
+
#endif /*__EXPO_H */