grub-devel
[Top][All Lists]
Advanced

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

Re: some design issues


From: Yoshinori K. Okuji
Subject: Re: some design issues
Date: Tue, 15 Feb 2005 23:23:09 +0100
User-agent: KMail/1.7.1

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, ...);
  ...
}

Okuji




reply via email to

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