523 |
int found = -1; |
int found = -1; |
524 |
int isleaf = 0; |
int isleaf = 0; |
525 |
|
|
526 |
|
auto int node_found (struct grub_hfs_node *, struct grub_hfs_record *); |
527 |
|
|
528 |
int node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec) |
int node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec) |
529 |
{ |
{ |
530 |
int cmp = 1; |
int cmp = 1; |
578 |
/* Iterate over the directory with the id DIR. The tree is searched |
/* Iterate over the directory with the id DIR. The tree is searched |
579 |
starting with the node ROOT_IDX. For every entry in this directory |
starting with the node ROOT_IDX. For every entry in this directory |
580 |
call HOOK. */ |
call HOOK. */ |
581 |
grub_err_t |
static grub_err_t |
582 |
grub_hfs_iterate_dir (struct grub_hfs_data *data, grub_uint32_t root_idx, |
grub_hfs_iterate_dir (struct grub_hfs_data *data, grub_uint32_t root_idx, |
583 |
unsigned int dir, int (*hook) (struct grub_hfs_record *)) |
unsigned int dir, int (*hook) (struct grub_hfs_record *)) |
584 |
{ |
{ |
588 |
|
|
589 |
/* The lowest key possible with DIR as root directory. */ |
/* The lowest key possible with DIR as root directory. */ |
590 |
struct grub_hfs_catalog_key key = {0, grub_cpu_to_be32 (dir), 0, ""}; |
struct grub_hfs_catalog_key key = {0, grub_cpu_to_be32 (dir), 0, ""}; |
591 |
|
|
592 |
|
auto int node_found (struct grub_hfs_node *, struct grub_hfs_record *); |
593 |
|
auto int it_dir (struct grub_hfs_node * __attribute ((unused)), |
594 |
|
struct grub_hfs_record *); |
595 |
|
|
596 |
|
|
597 |
int node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec) |
int node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec) |
|
|
|
598 |
{ |
{ |
599 |
struct grub_hfs_catalog_key *ckey = rec->key; |
struct grub_hfs_catalog_key *ckey = rec->key; |
600 |
|
|
729 |
{ |
{ |
730 |
int inode; |
int inode; |
731 |
|
|
732 |
|
auto int dir_hook (struct grub_hfs_record *rec); |
733 |
|
|
734 |
int dir_hook (struct grub_hfs_record *rec) |
int dir_hook (struct grub_hfs_record *rec) |
735 |
{ |
{ |
736 |
char fname[32] = { 0 }; |
char fname[32] = { 0 }; |