2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 #ifndef __HFS_MACOS_TYPES__
30 #define __HFS_MACOS_TYPES__
32 #include <sys/appleapiopts.h>
35 #ifdef __APPLE_API_PRIVATE
37 #include <sys/param.h>
39 #include <libkern/libkern.h>
40 #include <sys/systm.h>
43 #include <sys/types.h>
48 #define TARGET_OS_MAC 0
49 #define TARGET_OS_WIN32 0
50 #define TARGET_OS_UNIX 0
52 #define PRAGMA_IMPORT 0
53 #define PRAGMA_STRUCT_ALIGN 1
55 #define PRAGMA_STRUCT_PACK 0
56 #define PRAGMA_STRUCT_PACKPUSH 0
59 #define TYPE_LONGLONG 1
61 #define TYPE_LONGLONG 0
69 #define EXTERN_API(_type) extern _type
70 #define EXTERN_API_C(_type) extern _type
72 #define CALLBACK_API_C(_type, _name) _type ( * _name)
74 #define TARGET_API_MACOS_X 1
75 #define TARGET_API_MAC_OS8 0
76 #define TARGET_API_MAC_CARBON 0
80 /****** START OF MACOSTYPES *********/
84 4.4BSD's sys/types.h defines size_t without defining __size_t__:
85 Things are a lot clearer from here on if we define __size_t__ now.
90 Convert kernel's diagnostic flag to MacOS's
96 #endif /* DIAGNOSTIC */
98 /********************************************************************************
102 NULL The C standard for an impossible pointer value
103 nil A carry over from pascal, NULL is prefered for C
105 *********************************************************************************/
115 typedef u_int8_t UInt8
;
116 typedef int8_t SInt8
;
117 typedef u_int16_t UInt16
;
118 typedef int16_t SInt16
;
119 typedef u_int32_t UInt32
;
120 typedef int32_t SInt32
;
121 typedef u_int64_t UInt64
;
122 typedef int64_t SInt64
;
127 typedef SInt16 OSErr
;
128 typedef SInt32 OSStatus
;
129 typedef UInt32 ItemCount
;
130 typedef void * LogicalAddress
;
131 typedef UInt32 ByteCount
;
132 typedef UInt8
* BytePtr
;
133 typedef UInt32 ByteOffset
;
134 typedef UInt32 OptionBits
;
135 typedef unsigned long FourCharCode
;
136 typedef FourCharCode OSType
;
138 typedef UInt16 UniChar
;
139 typedef unsigned char Str255
[256];
140 typedef unsigned char Str31
[32];
141 typedef unsigned char * StringPtr
;
142 typedef const unsigned char * ConstStr255Param
;
143 typedef const unsigned char * ConstStr31Param
;
144 typedef const unsigned char * ConstUTF8Param
;
148 typedef UInt32 TextEncoding
;
149 typedef UniChar
* UniCharArrayPtr
;
150 typedef const UniChar
* ConstUniCharArrayPtr
;
153 /********************************************************************************
155 Boolean types and values
157 Boolean A one byte value, holds "false" (0) or "true" (1)
158 false The Boolean value of zero (0)
159 true The Boolean value of one (1)
161 *********************************************************************************/
163 The identifiers "true" and "false" are becoming keywords in C++
164 and work with the new built-in type "bool"
165 "Boolean" will remain an unsigned char for compatibility with source
166 code written before "bool" existed.
175 #endif /* !TYPE_BOOL */
177 typedef unsigned char Boolean
;
182 EXTERN_API( void ) DebugStr(ConstStr255Param debuggerMsg
);
184 /*********************************************************************************
186 Added types for HFSPlus MacOS X functionality. Needs to be incorporated to
189 *********************************************************************************/
191 typedef struct vnode
* FileReference
;
194 /***** START OF MACOSSTUBS ********/
198 SizeTDef.h -- Common definitions
200 size_t - this type is defined by several ANSI headers.
202 #if ! defined (__size_t__)
204 #if defined (__xlc) || defined (__xlC) || defined (__xlC__) || defined (__MWERKS__)
205 typedef unsigned long size_t;
207 typedef unsigned int size_t;
209 #endif /* __size_t__ */
218 dskFulErr
= -34, /*disk full*/
219 bdNamErr
= -37, /*there may be no bad names in the final system!*/
220 paramErr
= -50, /*error in user parameter list*/
221 memFullErr
= -108, /*Not enough room in heap zone*/
222 fileBoundsErr
= -1309, /*file's EOF, offset, mark or size is too big*/
223 kTECUsedFallbacksStatus
= -8783,
230 kHasBeenInited
= 0x0100,
231 kHasCustomIcon
= 0x0400,
232 kIsStationery
= 0x0800,
233 kNameLocked
= 0x1000,
235 kIsInvisible
= 0x4000,
246 /* Mac OS encodings*/
247 kTextEncodingMacRoman
= 0L,
248 kTextEncodingMacJapanese
= 1,
249 kTextEncodingMacChineseTrad
= 2,
250 kTextEncodingMacKorean
= 3,
251 kTextEncodingMacArabic
= 4,
252 kTextEncodingMacHebrew
= 5,
253 kTextEncodingMacGreek
= 6,
254 kTextEncodingMacCyrillic
= 7,
255 kTextEncodingMacDevanagari
= 9,
256 kTextEncodingMacGurmukhi
= 10,
257 kTextEncodingMacGujarati
= 11,
258 kTextEncodingMacOriya
= 12,
259 kTextEncodingMacBengali
= 13,
260 kTextEncodingMacTamil
= 14,
261 kTextEncodingMacTelugu
= 15,
262 kTextEncodingMacKannada
= 16,
263 kTextEncodingMacMalayalam
= 17,
264 kTextEncodingMacSinhalese
= 18,
265 kTextEncodingMacBurmese
= 19,
266 kTextEncodingMacKhmer
= 20,
267 kTextEncodingMacThai
= 21,
268 kTextEncodingMacLaotian
= 22,
269 kTextEncodingMacGeorgian
= 23,
270 kTextEncodingMacArmenian
= 24,
271 kTextEncodingMacChineseSimp
= 25,
272 kTextEncodingMacTibetan
= 26,
273 kTextEncodingMacMongolian
= 27,
274 kTextEncodingMacEthiopic
= 28,
275 kTextEncodingMacCentralEurRoman
= 29,
276 kTextEncodingMacVietnamese
= 30,
277 kTextEncodingMacExtArabic
= 31, /* The following use script code 0, smRoman*/
278 kTextEncodingMacSymbol
= 33,
279 kTextEncodingMacDingbats
= 34,
280 kTextEncodingMacTurkish
= 35,
281 kTextEncodingMacCroatian
= 36,
282 kTextEncodingMacIcelandic
= 37,
283 kTextEncodingMacRomanian
= 38,
284 kTextEncodingMacUnicode
= 0x7E,
286 kTextEncodingMacFarsi
= 0x8C, /* Like MacArabic but uses Farsi digits */ /* The following use script code 7, smCyrillic */
287 kTextEncodingMacUkrainian
= 0x98, /* The following use script code 32, smUnimplemented */
294 extern void RequireFileLock(FileReference vp
, int shareable
);
295 #define REQUIRE_FILE_LOCK(vp,s) RequireFileLock((vp),(s))
297 #define REQUIRE_FILE_LOCK(vp,s)
302 BlockMoveData(const void * srcPtr
, void * destPtr
, Size byteCount
);
304 #define BlockMoveData(src, dest, len) bcopy((src), (dest), (len))
307 ClearMemory(void * start
, UInt32 length
);
309 #define ClearMemory(start, length) bzero((start), (size_t)(length));
313 NewPtr(Size byteCount
);
316 NewPtrSysClear(Size byteCount
);
321 #endif /* __APPLE_API_PRIVATE */
323 #endif /* __HFS_MACOS_TYPES__ */