[Top][All Lists]

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

What is hook()

From: Jimmy Pan
Subject: What is hook()
Date: Fri, 16 Sep 2011 13:30:04 +0800

newbie here.
Can any body explain what is the hook() here?
A function? well, why there is an auto ahead int?
why can it be invoked by grub_module_iterate (hook);
Thanks in advance.

grub_load_modules (void)
  auto int hook (struct grub_module_header *);
  int hook (struct grub_module_header *header)
      /* Not an ELF module, skip.  */
      if (header->type != OBJ_TYPE_ELF)
        return 0;

      if (! grub_dl_load_core ((char *) header + sizeof (struct grub_module_header),
                               (header->size - sizeof (struct grub_module_header))))
        grub_fatal ("%s", grub_errmsg);

      if (grub_errno)
        grub_print_error ();

      return 0;

  grub_module_iterate (hook);

reply via email to

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