~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/packages/univint/src/AppleDiskPartitions.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{
 
2
     File:       AppleDiskPartitions.p
 
3
 
 
4
     Contains:   The Apple disk partition scheme as defined in Inside Macintosh: Volume V.
 
5
 
 
6
     Version:    Technology: Mac OS 9
 
7
                 Release:    Universal Interfaces 3.4.2
 
8
 
 
9
     Copyright:  � 2000-2002 by Apple Computer, Inc., all rights reserved
 
10
 
 
11
     Bugs?:      For bug reports, consult the following page on
 
12
                 the World Wide Web:
 
13
 
 
14
                     http://www.freepascal.org/bugs.html
 
15
 
 
16
}
 
17
 
 
18
 
 
19
{
 
20
    Modified for use with Free Pascal
 
21
    Version 210
 
22
    Please report any bugs to <gpc@microbizz.nl>
 
23
}
 
24
 
 
25
{$mode macpas}
 
26
{$packenum 1}
 
27
{$macro on}
 
28
{$inline on}
 
29
{$calling mwpascal}
 
30
 
 
31
unit AppleDiskPartitions;
 
32
interface
 
33
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
 
34
{$setc GAP_INTERFACES_VERSION := $0210}
 
35
 
 
36
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
 
37
    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
 
38
{$endc}
 
39
 
 
40
{$ifc defined CPUPOWERPC and defined CPUI386}
 
41
        {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
 
42
{$endc}
 
43
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
 
44
        {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 
45
{$endc}
 
46
 
 
47
{$ifc not defined __ppc__ and defined CPUPOWERPC}
 
48
        {$setc __ppc__ := 1}
 
49
{$elsec}
 
50
        {$setc __ppc__ := 0}
 
51
{$endc}
 
52
{$ifc not defined __i386__ and defined CPUI386}
 
53
        {$setc __i386__ := 1}
 
54
{$elsec}
 
55
        {$setc __i386__ := 0}
 
56
{$endc}
 
57
 
 
58
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 
59
        {$error Conflicting definitions for __ppc__ and __i386__}
 
60
{$endc}
 
61
 
 
62
{$ifc defined __ppc__ and __ppc__}
 
63
        {$setc TARGET_CPU_PPC := TRUE}
 
64
        {$setc TARGET_CPU_X86 := FALSE}
 
65
{$elifc defined __i386__ and __i386__}
 
66
        {$setc TARGET_CPU_PPC := FALSE}
 
67
        {$setc TARGET_CPU_X86 := TRUE}
 
68
{$elsec}
 
69
        {$error Neither __ppc__ nor __i386__ is defined.}
 
70
{$endc}
 
71
{$setc TARGET_CPU_PPC_64 := FALSE}
 
72
 
 
73
{$ifc defined FPC_BIG_ENDIAN}
 
74
        {$setc TARGET_RT_BIG_ENDIAN := TRUE}
 
75
        {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
 
76
{$elifc defined FPC_LITTLE_ENDIAN}
 
77
        {$setc TARGET_RT_BIG_ENDIAN := FALSE}
 
78
        {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
 
79
{$elsec}
 
80
        {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
 
81
{$endc}
 
82
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
 
83
{$setc CALL_NOT_IN_CARBON := FALSE}
 
84
{$setc OLDROUTINENAMES := FALSE}
 
85
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
 
86
{$setc OPAQUE_UPP_TYPES := TRUE}
 
87
{$setc OTCARBONAPPLICATION := TRUE}
 
88
{$setc OTKERNEL := FALSE}
 
89
{$setc PM_USE_SESSION_APIS := TRUE}
 
90
{$setc TARGET_API_MAC_CARBON := TRUE}
 
91
{$setc TARGET_API_MAC_OS8 := FALSE}
 
92
{$setc TARGET_API_MAC_OSX := TRUE}
 
93
{$setc TARGET_CARBON := TRUE}
 
94
{$setc TARGET_CPU_68K := FALSE}
 
95
{$setc TARGET_CPU_MIPS := FALSE}
 
96
{$setc TARGET_CPU_SPARC := FALSE}
 
97
{$setc TARGET_OS_MAC := TRUE}
 
98
{$setc TARGET_OS_UNIX := FALSE}
 
99
{$setc TARGET_OS_WIN32 := FALSE}
 
100
{$setc TARGET_RT_MAC_68881 := FALSE}
 
101
{$setc TARGET_RT_MAC_CFM := FALSE}
 
102
{$setc TARGET_RT_MAC_MACHO := TRUE}
 
103
{$setc TYPED_FUNCTION_POINTERS := TRUE}
 
104
{$setc TYPE_BOOL := FALSE}
 
105
{$setc TYPE_EXTENDED := FALSE}
 
106
{$setc TYPE_LONGLONG := TRUE}
 
107
uses MacTypes;
 
108
 
 
109
 
 
110
{$ALIGN MAC68K}
 
111
 
 
112
{ Block 0 Definitions }
 
113
 
 
114
const
 
115
        sbSIGWord                                       = $4552;                                                {  signature word for Block 0 ('ER')  }
 
116
        sbMac                                           = 1;                                                    {  system type for Mac  }
 
117
 
 
118
        {        Partition Map Signatures       }
 
119
        pMapSIG                                         = $504D;                                                {  partition map signature ('PM')  }
 
120
        pdSigWord                                       = $5453;                                                {  partition map signature ('TS')  }
 
121
        oldPMSigWord                            = $5453;
 
122
        newPMSigWord                            = $504D;
 
123
 
 
124
 
 
125
        {        Driver Descriptor Map  }
 
126
 
 
127
type
 
128
        Block0Ptr = ^Block0;
 
129
        Block0 = packed record
 
130
                sbSig:                                  UInt16;                                                                 {  unique value for SCSI block 0  }
 
131
                sbBlkSize:                              UInt16;                                                                 {  block size of device  }
 
132
                sbBlkCount:                             UInt32;                                                                 {  number of blocks on device  }
 
133
                sbDevType:                              UInt16;                                                                 {  device type  }
 
134
                sbDevId:                                UInt16;                                                                 {  device id  }
 
135
                sbData:                                 UInt32;                                                                 {  not used  }
 
136
                sbDrvrCount:                    UInt16;                                                                 {  driver descriptor count  }
 
137
                ddBlock:                                UInt32;                                                                 {  1st driver's starting block  }
 
138
                ddSize:                                 UInt16;                                                                 {  size of 1st driver (512-byte blks)  }
 
139
                ddType:                                 UInt16;                                                                 {  system type (1 for Mac+)  }
 
140
                ddPad:                                  array [0..242] of UInt16;                               {  array[0..242] of SInt16; not used  }
 
141
        end;
 
142
 
 
143
        {        Driver descriptor      }
 
144
        DDMapPtr = ^DDMap;
 
145
        DDMap = record
 
146
                ddBlock:                                UInt32;                                                                 {  1st driver's starting block  }
 
147
                ddSize:                                 UInt16;                                                                 {  size of 1st driver (512-byte blks)  }
 
148
                ddType:                                 UInt16;                                                                 {  system type (1 for Mac+)  }
 
149
        end;
 
150
 
 
151
        {        Constants for the ddType field of the DDMap structure.         }
 
152
 
 
153
const
 
154
        kDriverTypeMacSCSI                      = $0001;
 
155
        kDriverTypeMacATA                       = $0701;
 
156
        kDriverTypeMacSCSIChained       = $FFFF;
 
157
        kDriverTypeMacATAChained        = $F8FF;
 
158
 
 
159
        {        Partition Map Entry    }
 
160
 
 
161
type
 
162
        PartitionPtr = ^Partition;
 
163
        Partition = packed record
 
164
                pmSig:                                  UInt16;                                                                 {  unique value for map entry blk  }
 
165
                pmSigPad:                               UInt16;                                                                 {  currently unused  }
 
166
                pmMapBlkCnt:                    UInt32;                                                                 {  # of blks in partition map  }
 
167
                pmPyPartStart:                  UInt32;                                                                 {  physical start blk of partition  }
 
168
                pmPartBlkCnt:                   UInt32;                                                                 {  # of blks in this partition  }
 
169
                pmPartName:                             packed array [0..31] of UInt8;                  {  ASCII partition name  }
 
170
                pmParType:                              packed array [0..31] of UInt8;                  {  ASCII partition type  }
 
171
                pmLgDataStart:                  UInt32;                                                                 {  log. # of partition's 1st data blk  }
 
172
                pmDataCnt:                              UInt32;                                                                 {  # of blks in partition's data area  }
 
173
                pmPartStatus:                   UInt32;                                                                 {  bit field for partition status  }
 
174
                pmLgBootStart:                  UInt32;                                                                 {  log. blk of partition's boot code  }
 
175
                pmBootSize:                             UInt32;                                                                 {  number of bytes in boot code  }
 
176
                pmBootAddr:                             UInt32;                                                                 {  memory load address of boot code  }
 
177
                pmBootAddr2:                    UInt32;                                                                 {  currently unused  }
 
178
                pmBootEntry:                    UInt32;                                                                 {  entry point of boot code  }
 
179
                pmBootEntry2:                   UInt32;                                                                 {  currently unused  }
 
180
                pmBootCksum:                    UInt32;                                                                 {  checksum of boot code  }
 
181
                pmProcessor:                    packed array [0..15] of UInt8;                  {  ASCII for the processor type  }
 
182
                pmPad:                                  array [0..187] of UInt16;                               {  array[0..187] of SInt16; not used  }
 
183
        end;
 
184
 
 
185
 
 
186
        {        Flags for the pmPartStatus field of the Partition data structure.      }
 
187
 
 
188
const
 
189
        kPartitionAUXIsValid            = $00000001;
 
190
        kPartitionAUXIsAllocated        = $00000002;
 
191
        kPartitionAUXIsInUse            = $00000004;
 
192
        kPartitionAUXIsBootValid        = $00000008;
 
193
        kPartitionAUXIsReadable         = $00000010;
 
194
        kPartitionAUXIsWriteable        = $00000020;
 
195
        kPartitionAUXIsBootCodePositionIndependent = $00000040;
 
196
        kPartitionIsWriteable           = $00000020;
 
197
        kPartitionIsMountedAtStartup = $40000000;
 
198
        kPartitionIsStartup                     = $80000000;
 
199
        kPartitionIsChainCompatible     = $00000100;
 
200
        kPartitionIsRealDeviceDriver = $00000200;
 
201
        kPartitionCanChainToNext        = $00000400;
 
202
 
 
203
 
 
204
        {        Well known driver signatures, stored in the first four byte of pmPad.  }
 
205
        kPatchDriverSignature           = FourCharCode('ptDR');                                         {  SCSI and ATA[PI] patch driver     }
 
206
        kSCSIDriverSignature            = $00010600;                                    {  SCSI  hard disk driver            }
 
207
        kATADriverSignature                     = FourCharCode('wiki');                                         {  ATA   hard disk driver            }
 
208
        kSCSICDDriverSignature          = FourCharCode('CDvr');                                         {  SCSI  CD-ROM    driver            }
 
209
        kATAPIDriverSignature           = FourCharCode('ATPI');                                         {  ATAPI CD-ROM    driver            }
 
210
        kDriveSetupHFSSignature         = FourCharCode('DSU1');                                         {  Drive Setup HFS partition         }
 
211
 
 
212
 
 
213
{$ALIGN MAC68K}
 
214
 
 
215
 
 
216
end.