Imported Upstream version 1.1.11
[platform/upstream/cdrkit.git] / libhfs_iso / low.h
1 /*
2  * This file has been modified for the cdrkit suite.
3  *
4  * The behaviour and appearence of the program code below can differ to a major
5  * extent from the version distributed by the original author(s).
6  *
7  * For details, see Changelog file distributed with the cdrkit package. If you
8  * received this file from another source then ask the distributing person for
9  * a log of modifications.
10  *
11  */
12
13 /* @(#)low.h    1.1 00/03/05 joerg */
14 /*
15  * hfsutils - tools for reading and writing Macintosh HFS volumes
16  * Copyright (C) 1996, 1997 Robert Leslie
17  *
18  * This program is free software; you can redistribute it and/or modify
19  * it under the terms of the GNU General Public License as published by
20  * the Free Software Foundation; either version 2 of the License, or
21  * (at your option) any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program; if not, write to the Free Software
30  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31  */
32
33 typedef struct {
34   Integer       sbSig;          /* device signature (should be 0x4552) */
35   Integer       sbBlkSize;      /* block size of the device (in bytes) */
36   LongInt       sbBlkCount;     /* number of blocks on the device */
37   Integer       sbDevType;      /* reserved */
38   Integer       sbDevId;        /* reserved */
39   LongInt       sbData;         /* reserved */
40   Integer       sbDrvrCount;    /* number of driver descriptor entries */
41   LongInt       ddBlock;        /* first driver's starting block */
42   Integer       ddSize;         /* size of the driver, in 512-byte blocks */
43   Integer       ddType;         /* driver operating system type (MacOS = 1) */
44   Integer       ddPad[243];     /* additional drivers, if any */
45 } Block0;
46
47 typedef struct {
48   Integer       bbID;           /* boot blocks signature */
49   LongInt       bbEntry;        /* entry point to boot code */
50   Integer       bbVersion;      /* boot blocks version number */
51   Integer       bbPageFlags;    /* used internally */
52   Str15         bbSysName;      /* System filename */
53   Str15         bbShellName;    /* Finder filename */
54   Str15         bbDbg1Name;     /* debugger filename */
55   Str15         bbDbg2Name;     /* debugger filename */
56   Str15         bbScreenName;   /* name of startup screen */
57   Str15         bbHelloName;    /* name of startup program */
58   Str15         bbScrapName;    /* name of system scrap file */
59   Integer       bbCntFCBs;      /* number of FCBs to allocate */
60   Integer       bbCntEvts;      /* number of event queue elements */
61   LongInt       bb128KSHeap;    /* system heap size on 128K Mac */
62   LongInt       bb256KSHeap;    /* used internally */
63   LongInt       bbSysHeapSize;  /* system heap size on all machines */
64   Integer       filler;         /* reserved */
65   LongInt       bbSysHeapExtra; /* additional system heap space */
66   LongInt       bbSysHeapFract; /* fraction of RAM for system heap */
67 } BootBlkHdr;
68
69 typedef struct {
70   Integer       pmSig;          /* partition signature (0x504d or 0x5453) */
71   Integer       pmSigPad;       /* reserved */
72   LongInt       pmMapBlkCnt;    /* number of blocks in partition map */
73   LongInt       pmPyPartStart;  /* first physical block of partition */
74   LongInt       pmPartBlkCnt;   /* number of blocks in partition */
75   Char          pmPartName[33]; /* partition name */
76   Char          pmParType[33];  /* partition type */
77   /*
78    * Apple_partition_map        partition map
79    * Apple_Driver               device driver
80    * Apple_Driver43             SCSI Manager 4.3 device driver
81    * Apple_MFS                  Macintosh 64K ROM filesystem
82    * Apple_HFS                  Macintosh hierarchical filesystem
83    * Apple_Unix_SVR2            Unix filesystem
84    * Apple_PRODOS               ProDOS filesystem
85    * Apple_Free                 unused
86    * Apple_Scratch              empty
87    */
88   LongInt       pmLgDataStart;  /* first logical block of data area */
89   LongInt       pmDataCnt;      /* number of blocks in data area */
90   LongInt       pmPartStatus;   /* partition status information */
91   LongInt       pmLgBootStart;  /* first logical block of boot code */
92   LongInt       pmBootSize;     /* size of boot code, in bytes */
93   LongInt       pmBootAddr;     /* boot code load address */
94   LongInt       pmBootAddr2;    /* reserved */
95   LongInt       pmBootEntry;    /* boot code entry point */
96   LongInt       pmBootEntry2;   /* reserved */
97   LongInt       pmBootCksum;    /* boot code checksum */
98   Char          pmProcessor[17];/* processor type */
99   Integer       pmPad[188];     /* reserved */
100 } Partition;
101
102 int l_lockvol(hfsvol *);
103
104 int l_readblock0(hfsvol *);
105 int l_readpm(hfsvol *);
106
107 int l_readmdb(hfsvol *);
108 int l_writemdb(hfsvol *);
109
110 int l_readvbm(hfsvol *);
111 int l_writevbm(hfsvol *);