summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/nc-scr.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-10-16 11:30:29 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-11-13 17:31:04 +0800
commitd57d1c9c4cd7365063da7aa1f018736166bb3a50 (patch)
tree71581953001d5bc44203fe3d4d03eac4c7a42b9c /ui/ncurses/nc-scr.c
parent31ae49c6bfaa3cd65969bff7448be0f6385a6255 (diff)
downloadtalos-petitboot-d57d1c9c4cd7365063da7aa1f018736166bb3a50.tar.gz
talos-petitboot-d57d1c9c4cd7365063da7aa1f018736166bb3a50.zip
ui/ncurses: Add nc_scr_{un,}post()
We may have nc_scrs that aren't interested in post/unpost information, so create helper functions that allow a NULL callback. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses/nc-scr.c')
-rw-r--r--ui/ncurses/nc-scr.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ui/ncurses/nc-scr.c b/ui/ncurses/nc-scr.c
index c6172e1..e8c5fca 100644
--- a/ui/ncurses/nc-scr.c
+++ b/ui/ncurses/nc-scr.c
@@ -40,6 +40,20 @@ static void nc_scr_status_draw(struct nc_scr *scr)
scr->frame.status);
}
+int nc_scr_post(struct nc_scr *scr)
+{
+ if (scr->post)
+ return scr->post(scr);
+ return 0;
+}
+
+int nc_scr_unpost(struct nc_scr *scr)
+{
+ if (scr->unpost)
+ return scr->unpost(scr);
+ return 0;
+}
+
void nc_scr_frame_draw(struct nc_scr *scr)
{
int ltitle_len, rtitle_len;
OpenPOWER on IntegriCloud