mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-27 01:29:27 +00:00
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:
1 parent
53d3e4e3df
commit
fc524edf65
35 files changed
+1723
-1451
No files matched your search
@@ -1491,8 +1491,7 @@ find_path (struct grub_btrfs_data *data,
|
||||
|
||||
static grub_err_t
|
||||
grub_btrfs_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)
|
||||
{
|
||||
struct grub_btrfs_data *data = grub_btrfs_mount (device);
|
||||
struct grub_btrfs_key key_in, key_out;
|
||||
@@ -1586,7 +1585,7 @@ grub_btrfs_dir (grub_device_t device, const char *path,
|
||||
c = cdirel->name[grub_le_to_cpu16 (cdirel->n)];
|
||||
cdirel->name[grub_le_to_cpu16 (cdirel->n)] = 0;
|
||||
info.dir = (cdirel->type == GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY);
|
||||
if (hook (cdirel->name, &info))
|
||||
if (hook (cdirel->name, &info, hook_data))
|
||||
goto out;
|
||||
cdirel->name[grub_le_to_cpu16 (cdirel->n)] = c;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user