vaseboot/include/VasEBoot/hfs.h

73 lines
2.2 KiB
C

/*
* VAS_EBOOT -- GRand Unified Bootloader
* Copyright (C) 2005,2006,2007 Free Software Foundation, Inc.
*
* VAS_EBOOT 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 3 of the License, or
* (at your option) any later version.
*
* VAS_EBOOT 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 VAS_EBOOT. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VAS_EBOOT_HFS_HEADER
#define VAS_EBOOT_HFS_HEADER 1
#include <VasEBoot/types.h>
#define VAS_EBOOT_HFS_MAGIC 0x4244
/* A single extent. A file consists of one or more extents. */
struct VasEBoot_hfs_extent
{
/* The first physical block. */
VasEBoot_uint16_t first_block;
VasEBoot_uint16_t count;
} VAS_EBOOT_PACKED;
/* HFS stores extents in groups of 3. */
typedef struct VasEBoot_hfs_extent VasEBoot_hfs_datarecord_t[3];
/* The HFS superblock (The official name is `Master Directory
Block'). */
struct VasEBoot_hfs_sblock
{
VasEBoot_uint16_t magic;
VasEBoot_uint32_t ctime;
VasEBoot_uint32_t mtime;
VasEBoot_uint8_t unused[10];
VasEBoot_uint32_t blksz;
VasEBoot_uint8_t unused2[4];
VasEBoot_uint16_t first_block;
VasEBoot_uint8_t unused4[6];
/* A pascal style string that holds the volumename. */
VasEBoot_uint8_t volname[28];
VasEBoot_uint8_t unused5[28];
VasEBoot_uint32_t ppc_bootdir;
VasEBoot_uint32_t intel_bootfile;
/* Folder opened when disk is mounted. Unused by VAS_EBOOT. */
VasEBoot_uint32_t showfolder;
VasEBoot_uint32_t os9folder;
VasEBoot_uint8_t unused6[4];
VasEBoot_uint32_t osxfolder;
VasEBoot_uint64_t num_serial;
VasEBoot_uint16_t embed_sig;
struct VasEBoot_hfs_extent embed_extent;
VasEBoot_uint8_t unused7[4];
VasEBoot_hfs_datarecord_t extent_recs;
VasEBoot_uint32_t catalog_size;
VasEBoot_hfs_datarecord_t catalog_recs;
} VAS_EBOOT_PACKED;
#endif /* ! VAS_EBOOT_HFS_HEADER */