2004-08-24 Marco Gerards <metgerards@student.han.nl>

* commands/boot.c (grub_boot_init) [GRUB_UTIL]: Make conditional.
	(grub_boot_fini) [GRUB_UTIL]: Likewise.
	(GRUB_MOD_INIT) [!GRUB_UTIL]: Likewise.
	(GRUB_MOD_FINI) [!GRUB_UTIL]: Likewise.

	* fs/hfs.c (grub_hfs_find_node): Add a prototype for `node_found'.
	(grub_hfs_iterate_dir): Make the function static.  Add prototypes
	for `node_found' and `it_dir'.
	(grub_hfs_dir): Add prototype for `dir_hook'.

	* fs/minix.c (grub_minix_get_file_block): Add prototype for
	`grub_get_indir'.  Rename `indir' in two blocks to `indir16'
	and `indir32' to silence a gcc warning.

	* include/grub/fs.h (grub_hfs_init): New prototype.
	(grub_hfs_fini): Likewise.
This commit is contained in:
marco_g 2004-08-24 20:32:47 +00:00
parent 97543f08fc
commit 94bc45af05
5 changed files with 43 additions and 10 deletions

View file

@ -1,3 +1,23 @@
2004-08-24 Marco Gerards <metgerards@student.han.nl>
* commands/boot.c (grub_boot_init) [GRUB_UTIL]: Make conditional.
(grub_boot_fini) [GRUB_UTIL]: Likewise.
(GRUB_MOD_INIT) [!GRUB_UTIL]: Likewise.
(GRUB_MOD_FINI) [!GRUB_UTIL]: Likewise.
* fs/hfs.c (grub_hfs_find_node): Add a prototype for `node_found'.
(grub_hfs_iterate_dir): Make the function static. Add prototypes
for `node_found' and `it_dir'.
(grub_hfs_dir): Add prototype for `dir_hook'.
* fs/minix.c (grub_minix_get_file_block): Add prototype for
`grub_get_indir'. Rename `indir' in two blocks to `indir16'
and `indir32' to silence a gcc warning.
* include/grub/fs.h (grub_hfs_init): New prototype.
(grub_hfs_fini): Likewise.
2004-08-21 Yoshinori K. Okuji <okuji@enbug.org>
Each disk device has its own id now. This is useful to make use

View file

@ -38,6 +38,7 @@ grub_cmd_boot (struct grub_arg_list *state __attribute__ ((unused)),
#ifdef GRUB_UTIL
void
grub_boot_init (void)
{
@ -50,7 +51,7 @@ grub_boot_fini (void)
{
grub_unregister_command ("boot");
}
#else /* ! GRUB_UTIL */
GRUB_MOD_INIT
{
(void)mod; /* To stop warning. */
@ -62,4 +63,4 @@ GRUB_MOD_FINI
{
grub_unregister_command ("boot");
}
#endif /* ! GRUB_UTIL */

View file

@ -523,6 +523,8 @@ grub_hfs_find_node (struct grub_hfs_data *data, char *key,
int found = -1;
int isleaf = 0;
auto int node_found (struct grub_hfs_node *, struct grub_hfs_record *);
int node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec)
{
int cmp = 1;
@ -576,7 +578,7 @@ grub_hfs_find_node (struct grub_hfs_data *data, char *key,
/* Iterate over the directory with the id DIR. The tree is searched
starting with the node ROOT_IDX. For every entry in this directory
call HOOK. */
grub_err_t
static grub_err_t
grub_hfs_iterate_dir (struct grub_hfs_data *data, grub_uint32_t root_idx,
unsigned int dir, int (*hook) (struct grub_hfs_record *))
{
@ -587,8 +589,12 @@ grub_hfs_iterate_dir (struct grub_hfs_data *data, grub_uint32_t root_idx,
/* The lowest key possible with DIR as root directory. */
struct grub_hfs_catalog_key key = {0, grub_cpu_to_be32 (dir), 0, ""};
int node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec)
auto int node_found (struct grub_hfs_node *, struct grub_hfs_record *);
auto int it_dir (struct grub_hfs_node * __attribute ((unused)),
struct grub_hfs_record *);
int node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec)
{
struct grub_hfs_catalog_key *ckey = rec->key;
@ -723,6 +729,8 @@ grub_hfs_dir (grub_device_t device, const char *path,
{
int inode;
auto int dir_hook (struct grub_hfs_record *rec);
int dir_hook (struct grub_hfs_record *rec)
{
char fname[32] = { 0 };

View file

@ -126,26 +126,28 @@ grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk)
struct grub_minix_sblock *sblock = &data->sblock;
int indir;
auto int grub_get_indir (int, int);
/* Read the block pointer in ZONE, on the offset NUM. */
int grub_get_indir (int zone, int num)
{
if (data->version == 1)
{
grub_uint16_t indir;
grub_uint16_t indir16;
grub_disk_read (data->disk,
zone << GRUB_MINIX_LOG2_ZONESZ,
sizeof (grub_uint16_t) * num,
sizeof (grub_uint16_t), (char *) &indir);
return grub_le_to_cpu16 (indir);
sizeof (grub_uint16_t), (char *) &indir16);
return grub_le_to_cpu16 (indir16);
}
else
{
grub_uint32_t indir;
grub_uint32_t indir32;
grub_disk_read (data->disk,
zone << GRUB_MINIX_LOG2_ZONESZ,
sizeof (grub_uint32_t) * num,
sizeof (grub_uint32_t), (char *) &indir);
return grub_le_to_cpu32 (indir);
sizeof (grub_uint32_t), (char *) &indir32);
return grub_le_to_cpu32 (indir32);
}
}

View file

@ -74,6 +74,8 @@ void grub_ufs_init (void);
void grub_ufs_fini (void);
void grub_minix_init (void);
void grub_minix_fini (void);
void grub_hfs_init (void);
void grub_hfs_fini (void);
#endif /* GRUB_UTIL */
#endif /* ! GRUB_FS_HEADER */