Remove nested functions from filesystem directory iterators.

* include/grub/fs.h (grub_fs_dir_hook_t): New type.
(struct grub_fs.dir): Add hook_data argument.

Update all implementations and callers.
This commit is contained in:
Colin Watson 2013-01-21 01:33:46 +00:00
parent 53d3e4e3df
commit fc524edf65
35 changed files with 1723 additions and 1451 deletions

View file

@ -41,6 +41,10 @@ struct grub_dirhook_info
grub_int32_t mtime;
};
typedef int (*grub_fs_dir_hook_t) (const char *filename,
const struct grub_dirhook_info *info,
void *data);
/* Filesystem descriptor. */
struct grub_fs
{
@ -53,8 +57,7 @@ struct grub_fs
/* Call HOOK with each file under DIR. */
grub_err_t (*dir) (grub_device_t device, const char *path,
int (*hook) (const char *filename,
const struct grub_dirhook_info *info));
grub_fs_dir_hook_t hook, void *hook_data);
/* Open a file named NAME and initialize FILE. */
grub_err_t (*open) (struct grub_file *file, const char *name);