From: Serbinenko Vladimir <serbinenko.vova@list.ru>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: New commands (reboot, halt, help)
Date: Sat, 29 Jan 2005 16:31:39 +0100 [thread overview]
Message-ID: <41FBAC5B.3030003@list.ru> (raw)
In-Reply-To: <87acqss22c.fsf@marco.marco-g.com>
>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
next prev parent reply other threads:[~2005-01-29 16:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-28 12:36 New commands (reboot, halt, help) Marco Gerards
2005-01-28 12:52 ` chaac
2005-01-28 14:33 ` Marco Gerards
2005-01-28 18:54 ` Marco Gerards
2005-01-29 1:23 ` Yoshinori K. Okuji
2005-01-29 13:01 ` Marco Gerards
2005-01-29 14:30 ` Yoshinori K. Okuji
2005-01-29 15:11 ` Marco Gerards
2005-01-29 15:31 ` Serbinenko Vladimir [this message]
2005-01-29 16:17 ` Marco Gerards
2005-01-29 15:43 ` Marco Gerards
2005-01-29 17:47 ` Yoshinori K. Okuji
2005-01-29 17:45 ` Yoshinori K. Okuji
2005-01-29 18:36 ` Marco Gerards
2005-01-30 17:15 ` Marco Gerards
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41FBAC5B.3030003@list.ru \
--to=serbinenko.vova@list.ru \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.