Yoshinori K. Okuji wrote:

On Tuesday 15 February 2005 21:24, Vincent Pelletier wrote:


Isn't it already present ?



No.



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?

Okuji




_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel







_______________________________________________ Grub-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to