grub/include/grub/hfs.h
marco_g 0090587997 2006-01-03 Hollis Blanchard <hollis@penguinppc.org>
* fs/hfs.c: Include <grub/hfs.h>.  Added reference to the official
	documentation.
	(GRUB_HFS_EMBED_HFSPLUS_SIG): New macro.
	(grub_hfs_mount): Grammar fix in error. Make sure this is not an
	embedded HFS+ filesystem.
	(GRUB_HFS_MAGIC, grub_hfs_extent, grub_hfs_datarecord_t)
	(grub_hfs_sblock): Move from here...
	* include/grub/hfs.h: To here...  New file.
	* fs/hfsplus.c: Include <grub/hfs.h>.  Added reference to the official
	documentation.
	(GRUB_HFSPLUS_MAGIC, GRUB_HFSPLUSX_MAGIC, GRUB_HFSPLUS_SBLOCK):
	New macros.
	(grub_hfsplus_volheader): Change type of member `magic' to
	`grub_uint16_t'.
	(grub_hfsplus_data): Add new member `embedded_offset'.
	(grub_hfsplus_read_block): Add the HFS+ wrapper offset to the
	returned block.
	(grub_hfsplus_mount): Read the HFS+ wrapper if it exists.
	Calculate the offset.
2006-01-03 14:30:57 +00:00

61 lines
1.8 KiB
C

/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef GRUB_HFS_HEADER
#define GRUB_HFS_HEADER 1
#include <grub/types.h>
#define GRUB_HFS_MAGIC 0x4244
/* A single extent. A file consists of one or more extents. */
struct grub_hfs_extent
{
/* The first physical block. */
grub_uint16_t first_block;
grub_uint16_t count;
};
/* HFS stores extents in groups of 3. */
typedef struct grub_hfs_extent grub_hfs_datarecord_t[3];
/* The HFS superblock (The official name is `Master Directory
Block'). */
struct grub_hfs_sblock
{
grub_uint16_t magic;
grub_uint8_t unused[18];
grub_uint32_t blksz;
grub_uint8_t unused2[4];
grub_uint16_t first_block;
grub_uint8_t unused4[6];
/* A pascal style string that holds the volumename. */
grub_uint8_t volname[28];
grub_uint8_t unused5[60];
grub_uint16_t embed_sig;
struct grub_hfs_extent embed_extent;
grub_uint8_t unused6[4];
grub_hfs_datarecord_t extent_recs;
grub_uint32_t catalog_size;
grub_hfs_datarecord_t catalog_recs;
} __attribute__ ((packed));
#endif /* ! GRUB_HFS_HEADER */