Skip to contentSkip to conversation

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

DISCUSSION liu Aleaxander 1 participant 1 message Mar 2, 2009

lore
Share & tools
lore
#0 lore raw

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.