[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New commands (reboot, halt, help)
From: |
Serbinenko Vladimir |
Subject: |
Re: New commands (reboot, halt, help) |
Date: |
Sat, 29 Jan 2005 16:31:39 +0100 |
User-agent: |
Mozilla Thunderbird 1.0 (X11/20041206) |
Right. What the code does is making sure GRUB_COMMAND_FLAG_CMDLINE
and GRUB_COMMAND_FLAG_MENU commands and commands with both set are
shown. I fail to see the redundancy.
In normal.h:
/* Can be run in the command-line. */
#define GRUB_COMMAND_FLAG_CMDLINE 0x1
/* Can be run in the menu. */
#define GRUB_COMMAND_FLAG_MENU 0x2
/* Can be run in both interfaces. */
#define GRUB_COMMAND_FLAG_BOTH 0x3
so GRUB_COMMAND_FLAG_BOTH is 11 in binary, so x&GRUB_COMMAND_FLAG_BOTH
will not be zero if and only if bit 0 *or* bit 1 is set
Example
GRUB_COMMAND_FLAG_CMDLINE &GRUB_COMMAND_FLAG_BOTH=1
GRUB_COMMAND_FLAG_MENU&GRUB_COMMAND_FLAG_BOTH=2
GRUB_COMMAND_FLAG_BOTH&GRUB_COMMAND_FLAG_BOTH=3
*GRUB_COMMAND_FLAG_BOTH&GRUB_COMMAND_FLAG_CMDLINE=1*
The last example shows that for command with attribute
GRUB_COMMAND_FLAG_BOTH already
cmd->flags & GRUB_COMMAND_FLAG_CMDLINE will be true
- New commands (reboot, halt, help), Marco Gerards, 2005/01/28
- Re: New commands (reboot, halt, help), chaac, 2005/01/28
- Re: New commands (reboot, halt, help), Marco Gerards, 2005/01/28
- Re: New commands (reboot, halt, help), Yoshinori K. Okuji, 2005/01/28
- Re: New commands (reboot, halt, help), Marco Gerards, 2005/01/29
- Re: New commands (reboot, halt, help), Yoshinori K. Okuji, 2005/01/29
- Re: New commands (reboot, halt, help), Marco Gerards, 2005/01/29
- Re: New commands (reboot, halt, help),
Serbinenko Vladimir <=
- Re: New commands (reboot, halt, help), Marco Gerards, 2005/01/29
- Re: New commands (reboot, halt, help), Marco Gerards, 2005/01/29
- Re: New commands (reboot, halt, help), Yoshinori K. Okuji, 2005/01/29
- Re: New commands (reboot, halt, help), Yoshinori K. Okuji, 2005/01/29
- Re: New commands (reboot, halt, help), Marco Gerards, 2005/01/29
Re: New commands (reboot, halt, help), Marco Gerards, 2005/01/30