aboutsummaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-10-01 19:13:31 -0600
committerTom Rini <trini@konsulko.com>2023-10-11 15:43:55 -0400
commit93f99b35ec7d32b86a00cd066d2f8107cc9c23ed (patch)
treeecf58c43e0c23256b0ad1849fb9fbb2c2540b681 /boot
parent94598d5b0ab1739279a1f864dc88a8ed3140d7c9 (diff)
downloadu-boot-93f99b35ec7d32b86a00cd066d2f8107cc9c23ed.zip
u-boot-93f99b35ec7d32b86a00cd066d2f8107cc9c23ed.tar.gz
u-boot-93f99b35ec7d32b86a00cd066d2f8107cc9c23ed.tar.bz2
expo: Add some scene fields needed for text entry
Add the CLI state, a buffer to hold the old value of the text being edited and a place to save vidconsole entry context. These will be use by the textline object. Set an upper limit on the maximum number of characters in a textline object supported by expo, at least for now. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot')
-rw-r--r--boot/scene.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/boot/scene.c b/boot/scene.c
index 314dd7c..0b44a13 100644
--- a/boot/scene.c
+++ b/boot/scene.c
@@ -32,6 +32,14 @@ int scene_new(struct expo *exp, const char *name, uint id, struct scene **scnp)
return log_msg_ret("name", -ENOMEM);
}
+ abuf_init(&scn->buf);
+ if (!abuf_realloc(&scn->buf, EXPO_MAX_CHARS + 1)) {
+ free(scn->name);
+ free(scn);
+ return log_msg_ret("buf", -ENOMEM);
+ }
+ abuf_init(&scn->entry_save);
+
INIT_LIST_HEAD(&scn->obj_head);
scn->id = resolve_id(exp, id);
scn->expo = exp;
@@ -57,6 +65,8 @@ void scene_destroy(struct scene *scn)
list_for_each_entry_safe(obj, next, &scn->obj_head, sibling)
scene_obj_destroy(obj);
+ abuf_uninit(&scn->entry_save);
+ abuf_uninit(&scn->buf);
free(scn->name);
free(scn);
}