Patchwork [U-Boot,2/3] common, menu: add statusline support

login
register
mail settings
Submitter Heiko Schocher
Date Jan. 15, 2012, 7:53 a.m.
Message ID <1326614022-24014-3-git-send-email-hs@denx.de>
Download mbox | patch
Permalink /patch/136163/
State Superseded
Headers show

Comments

Heiko Schocher - Jan. 15, 2012, 7:53 a.m.
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>
---
 common/menu.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
Mike Frysinger - Jan. 15, 2012, 5:36 p.m.
On Sunday 15 January 2012 02:53:41 Heiko Schocher wrote:
> add the possibility to show a statusline when printing a menu

do you have any examples ?

> +void menu_display_statusline(struct menu *m)

a prototype needs to be in menu.h, and documented
-mike
Heiko Schocher - Jan. 16, 2012, 6:54 a.m.
Hello Mike,

Mike Frysinger wrote:
> On Sunday 15 January 2012 02:53:41 Heiko Schocher wrote:
>> add the possibility to show a statusline when printing a menu
> 
> do you have any examples ?

Used in the cam_enc_4xx update patch, see:

[U-Boot] arm, davinci: cam_enc_4xx board updates
http://patchwork.ozlabs.org/patch/136165/

>> +void menu_display_statusline(struct menu *m)
> 
> a prototype needs to be in menu.h, and documented

Fixed.

bye,
Heiko

Patch

diff --git a/common/menu.c b/common/menu.c
index 3b1e0d0..754a9f9 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -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);
 }