From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Cuv1W-0004vq-WD for mharc-grub-devel@gnu.org; Sat, 29 Jan 2005 11:00:35 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Cuv1N-0004sM-4f for grub-devel@gnu.org; Sat, 29 Jan 2005 11:00:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Cuv1B-0004oA-Rf for grub-devel@gnu.org; Sat, 29 Jan 2005 11:00:18 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cuv19-0004lB-Jx for grub-devel@gnu.org; Sat, 29 Jan 2005 11:00:11 -0500 Received: from [194.67.23.121] (helo=mx1.mail.ru) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CuuZ6-0002jc-CO for grub-devel@gnu.org; Sat, 29 Jan 2005 10:31:12 -0500 Received: from [83.76.233.184] (port=3361 helo=[192.168.1.100]) by mx1.mail.ru with esmtp id 1CuuZ5-000DlS-00 for grub-devel@gnu.org; Sat, 29 Jan 2005 18:31:11 +0300 Message-ID: <41FBAC5B.3030003@list.ru> Date: Sat, 29 Jan 2005 16:31:39 +0100 From: Serbinenko Vladimir User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: The development of GRUB 2 References: <87mzut3f3c.fsf@marco.marco-g.com> <200501290223.09666.okuji@enbug.org> <87ekg4s823.fsf@marco.marco-g.com> <200501291530.37761.okuji@enbug.org> <87acqss22c.fsf@marco.marco-g.com> In-Reply-To: <87acqss22c.fsf@marco.marco-g.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: Not detected Subject: Re: New commands (reboot, halt, help) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2005 16:00:28 -0000 >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