Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LeABM-0001UU-GW for mharc-grub-devel@gnu.org; Mon, 02 Mar 2009 10:35:52 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LeABK-0001Sy-0M for grub-devel@gnu.org; Mon, 02 Mar 2009 10:35:50 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LeABJ-0001Rs-1V for grub-devel@gnu.org; Mon, 02 Mar 2009 10:35:49 -0500 Received: from [199.232.76.173] (port=57735 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LeABI-0001Rp-Up for grub-devel@gnu.org; Mon, 02 Mar 2009 10:35:48 -0500 Received: from yx-out-1718.google.com ([74.125.44.153]:47567) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LeABI-0002gL-FA for grub-devel@gnu.org; Mon, 02 Mar 2009 10:35:48 -0500 Received: by yx-out-1718.google.com with SMTP id 34so1410166yxf.66 for ; Mon, 02 Mar 2009 07:35:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=Ls7uybccneLUj3UcOaDlXpeYAmsRd0y0SyQkGspcu8g=; b=p5hQYOCeaQjj474Qcyp/nmTiSdmuCGEDqDFrVl0LYLEoLgl+RJAJ0sS+pr/FsVzInv k7HEtuK4YO0zK2Gzk1xPRcsN8VyzjffzUBQOj7AOScHybdAmnbAGouzIDV53prvb8Xjg KDWAcZ1q8QwouS3JUxCbgeiuUQcQyCd4OVCRk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=W0pb7J8L2jnFFxzrjIrPjCY3M6w8+uJDWlEmPsROcAZj6SQ4nifETTVOZ3D7mjxd/8 IiheHIogLrUR6ZHcQXc5hj2L+Lv80vzFBhhxzSkrgk4yHjT6+oxhMY1UdvYk02H8A4Mu cOr8P/m4/2V3Gm9GdIIM+X573/Z/YWsH3c+kM= MIME-Version: 1.0 Received: by 10.151.102.16 with SMTP id e16mr866828ybm.15.1236008144674; Mon, 02 Mar 2009 07:35:44 -0800 (PST) Date: Mon, 2 Mar 2009 23:35:44 +0800 Message-ID: From: liu Aleaxander To: The development of GRUB 2 Content-Type: multipart/alternative; boundary=00151750ec70671fdc0464249210 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: advise on the make the hook function's name more readable.. 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: Mon, 02 Mar 2009 15:35:50 -0000 --00151750ec70671fdc0464249210 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi,all. There all lots of hook functions , and in almost, these function are defined and passed as an argument in the following way or something like that: static grub_err_t grub_ls_list_devices (int longlist) { /* hook function defined here */ int grub_ls_print_devices (const char *name) { ... ... return 0; } ..... grub_device_iterate (grub_ls_print_devices); ..... } then grub_device_iterate function defines like this: int grub_device_iterate( int (*hook)(const char *name)); why not changed the function grub_device_iterate's define like this: int grub_device_iterate(int (*hook_ls_print_devices)(const char *name)) i think that's would make the code much easier to read. 'cause in some case, the hook will be passed as an argument across two or more function. Thanks. --00151750ec70671fdc0464249210 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,all.

There all lots of hook functions , and in almost, these func= tion are defined and passed as an argument in the following way or somethin= g like that:

static grub_err_t
grub_ls_list_devices (int longlist= )
{
=A0 /* hook function defined here */
=A0 int grub_ls_print_devices = (const char *name)
=A0=A0=A0 {
=A0=A0=A0=A0=A0 ...
=A0=A0=A0=A0=A0= ...
=A0=A0=A0=A0=A0 return 0;
=A0=A0=A0 }
=A0
=A0 .....
= =A0 grub_device_iterate (grub_ls_print_devices);
=A0 .....
}

then grub_device_iterate function defines like this:<= br>int grub_device_iterate( int (*hook)(const char *name));



=
why not changed the function grub_device_iterate's define like this= :
int grub_device_iterate(int (*hook_l= s_print_devices)(const char *name))


i think that's wo= uld make the code much easier to read. 'cause in some case, the hook wi= ll be passed as an argument across two or more function.

Thanks.
--00151750ec70671fdc0464249210--