]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
common, menu: add statusline support
authorHeiko Schocher <hs@denx.de>
Mon, 16 Jan 2012 21:13:20 +0000 (21:13 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sun, 12 Feb 2012 09:11:24 +0000 (10:11 +0100)
add the possibility to show a statusline when printing a menu

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Jason Hobbs <jason.hobbs@calxeda.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
common/menu.c
doc/README.menu
include/menu.h

index 3b1e0d0820fb15a4168897c2c7ddf2b4ec262722..754a9f9d06a1ecf7e4847689964dd383e7d457aa 100644 (file)
@@ -113,6 +113,13 @@ static inline void *menu_item_destroy(struct menu *m,
        return NULL;
 }
 
+void __menu_display_statusline(struct menu *m)
+{
+       return;
+}
+void menu_display_statusline(struct menu *m)
+       __attribute__ ((weak, alias("__menu_display_statusline")));
+
 /*
  * Display a menu so the user can make a choice of an item. First display its
  * title, if any, and then each item in the menu.
@@ -123,6 +130,7 @@ static inline void menu_display(struct menu *m)
                puts(m->title);
                putc('\n');
        }
+       menu_display_statusline(m);
 
        menu_items_iter(m, menu_item_print, NULL);
 }
index 0dad6a2cb8968b4035c86ff8dabbe6e45d45f354..4ddf91491dab781908cfaf0db402a762b12880f3 100644 (file)
@@ -69,6 +69,11 @@ int menu_get_choice(struct menu *m, void **choice);
  */
 int menu_destroy(struct menu *m);
 
+/*
+ * menu_display_statusline(struct menu *m);
+ * shows a statusline for every menu_display call.
+ */
+void menu_display_statusline(struct menu *m);
 
 Example Code
 ------------
index cf14a9cca356c4279f40854d4c25a311e562edb2..b806a02b5ddbd156b00d16fa192afed9c73788f2 100644 (file)
@@ -26,5 +26,6 @@ int menu_default_set(struct menu *m, char *item_key);
 int menu_get_choice(struct menu *m, void **choice);
 int menu_item_add(struct menu *m, char *item_key, void *item_data);
 int menu_destroy(struct menu *m);
+void menu_display_statusline(struct menu *m);
 
 #endif /* __MENU_H__ */