[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: some design issues

From: Serbinenko Vladimir
Subject: Re: some design issues
Date: Wed, 16 Feb 2005 17:01:17 +0100
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)

Yoshinori K. Okuji wrote:

On Tuesday 15 February 2005 21:24, Vincent Pelletier wrote:
Isn't it already present ?


There is a "nested" variable passed to menu main function, that
should do the trick (leaving a menu which is nested would give back the control to the calling menu, which would redraw itself).

It is a different thing. The question is, for example, how to add a new menu entry into current menu. Suppose this command:

entry "foo" {

The command "entry" should be an ordinary command. I don't want to make it special like "title" in GRUB Legacy. Then, this command must be able to access a menu variable. So, one way is to define the function like this:

grub_err_t grub_cmd_entry (struct grub_arg_list *state, int argc, char **args, grub_context_t context)
 grub_menu_add_entry (context->menu, ...);

Another way is:

grub_err_t grub_cmd_entry (struct grub_arg_list *state, int argc, char **args)
 grub_context_t context = grub_get_context ();

 grub_menu_add_entry (context->menu, ...);

In my scripting engine entry is parsed the same way that function. Only difference is where contents stored but it's not written as a normal function because it changes a bit the way the input parsed (no expanding, ...) What do you think about it?


Grub-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]