grub-devel
[Top][All Lists]
Advanced

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

advise on the make the hook function's name more readable..


From: liu Aleaxander
Subject: advise on the make the hook function's name more readable..
Date: Mon, 2 Mar 2009 23:35:44 +0800

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.

reply via email to

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