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