2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 #ifndef __HFS_MACOS_TYPES__
25 #define __HFS_MACOS_TYPES__
27 #include <sys/appleapiopts.h>
30 #ifdef __APPLE_API_PRIVATE
32 #include <sys/param.h>
34 #include <libkern/libkern.h>
35 #include <sys/systm.h>
38 #include <sys/types.h>
43 #define TARGET_OS_MAC 0
44 #define TARGET_OS_WIN32 0
45 #define TARGET_OS_UNIX 0
47 #define PRAGMA_IMPORT 0
48 #define PRAGMA_STRUCT_ALIGN 1
50 #define PRAGMA_STRUCT_PACK 0
51 #define PRAGMA_STRUCT_PACKPUSH 0
54 #define TYPE_LONGLONG 1
56 #define TYPE_LONGLONG 0
64 #define EXTERN_API(_type) extern _type
65 #define EXTERN_API_C(_type) extern _type
67 #define CALLBACK_API_C(_type, _name) _type ( * _name)
69 #define TARGET_API_MACOS_X 1
70 #define TARGET_API_MAC_OS8 0
71 #define TARGET_API_MAC_CARBON 0
75 /****** START OF MACOSTYPES *********/
79 4.4BSD's sys/types.h defines size_t without defining __size_t__:
80 Things are a lot clearer from here on if we define __size_t__ now.
85 Convert kernel's diagnostic flag to MacOS's
91 #endif /* DIAGNOSTIC */
93 /********************************************************************************
97 NULL The C standard for an impossible pointer value
98 nil A carry over from pascal, NULL is prefered for C
100 *********************************************************************************/
110 typedef u_int8_t UInt8
;
111 typedef int8_t SInt8
;
112 typedef u_int16_t UInt16
;
113 typedef int16_t SInt16
;
114 typedef u_int32_t UInt32
;
115 typedef int32_t SInt32
;
116 typedef u_int64_t UInt64
;
117 typedef int64_t SInt64
;
122 typedef SInt16 OSErr
;
123 typedef SInt32 OSStatus
;
124 typedef UInt32 ItemCount
;
125 typedef void * LogicalAddress
;
126 typedef UInt32 ByteCount
;
127 typedef UInt8
* BytePtr
;
128 typedef UInt32 ByteOffset
;
129 typedef UInt32 OptionBits
;
130 typedef unsigned long FourCharCode
;
131 typedef FourCharCode OSType
;
133 typedef UInt16 UniChar
;
134 typedef unsigned char Str255
[256];
135 typedef unsigned char Str31
[32];
136 typedef unsigned char * StringPtr
;
137 typedef const unsigned char * ConstStr255Param
;
138 typedef const unsigned char * ConstStr31Param
;
139 typedef const unsigned char * ConstUTF8Param
;
143 typedef UInt32 TextEncoding
;
144 typedef UniChar
* UniCharArrayPtr
;
145 typedef const UniChar
* ConstUniCharArrayPtr
;
148 /********************************************************************************
150 Boolean types and values
152 Boolean A one byte value, holds "false" (0) or "true" (1)
153 false The Boolean value of zero (0)
154 true The Boolean value of one (1)
156 *********************************************************************************/
158 The identifiers "true" and "false" are becoming keywords in C++
159 and work with the new built-in type "bool"
160 "Boolean" will remain an unsigned char for compatibility with source
161 code written before "bool" existed.
170 #endif /* !TYPE_BOOL */
172 typedef unsigned char Boolean
;
177 EXTERN_API( void ) DebugStr(ConstStr255Param debuggerMsg
);
179 /*********************************************************************************
181 Added types for HFSPlus MacOS X functionality. Needs to be incorporated to
184 *********************************************************************************/
186 typedef struct vnode
* FileReference
;
189 /***** START OF MACOSSTUBS ********/
193 SizeTDef.h -- Common definitions
195 size_t - this type is defined by several ANSI headers.
197 #if ! defined (__size_t__)
199 #if defined (__xlc) || defined (__xlC) || defined (__xlC__) || defined (__MWERKS__)
200 typedef unsigned long size_t;
202 typedef unsigned int size_t;
204 #endif /* __size_t__ */
213 dskFulErr
= -34, /*disk full*/
214 bdNamErr
= -37, /*there may be no bad names in the final system!*/
215 paramErr
= -50, /*error in user parameter list*/
216 memFullErr
= -108, /*Not enough room in heap zone*/
217 fileBoundsErr
= -1309, /*file's EOF, offset, mark or size is too big*/
218 kTECUsedFallbacksStatus
= -8783,
225 kHasBeenInited
= 0x0100,
226 kHasCustomIcon
= 0x0400,
227 kIsStationery
= 0x0800,
228 kNameLocked
= 0x1000,
230 kIsInvisible
= 0x4000,
241 /* Mac OS encodings*/
242 kTextEncodingMacRoman
= 0L,
243 kTextEncodingMacJapanese
= 1,
244 kTextEncodingMacChineseTrad
= 2,
245 kTextEncodingMacKorean
= 3,
246 kTextEncodingMacArabic
= 4,
247 kTextEncodingMacHebrew
= 5,
248 kTextEncodingMacGreek
= 6,
249 kTextEncodingMacCyrillic
= 7,
250 kTextEncodingMacDevanagari
= 9,
251 kTextEncodingMacGurmukhi
= 10,
252 kTextEncodingMacGujarati
= 11,
253 kTextEncodingMacOriya
= 12,
254 kTextEncodingMacBengali
= 13,
255 kTextEncodingMacTamil
= 14,
256 kTextEncodingMacTelugu
= 15,
257 kTextEncodingMacKannada
= 16,
258 kTextEncodingMacMalayalam
= 17,
259 kTextEncodingMacSinhalese
= 18,
260 kTextEncodingMacBurmese
= 19,
261 kTextEncodingMacKhmer
= 20,
262 kTextEncodingMacThai
= 21,
263 kTextEncodingMacLaotian
= 22,
264 kTextEncodingMacGeorgian
= 23,
265 kTextEncodingMacArmenian
= 24,
266 kTextEncodingMacChineseSimp
= 25,
267 kTextEncodingMacTibetan
= 26,
268 kTextEncodingMacMongolian
= 27,
269 kTextEncodingMacEthiopic
= 28,
270 kTextEncodingMacCentralEurRoman
= 29,
271 kTextEncodingMacVietnamese
= 30,
272 kTextEncodingMacExtArabic
= 31, /* The following use script code 0, smRoman*/
273 kTextEncodingMacSymbol
= 33,
274 kTextEncodingMacDingbats
= 34,
275 kTextEncodingMacTurkish
= 35,
276 kTextEncodingMacCroatian
= 36,
277 kTextEncodingMacIcelandic
= 37,
278 kTextEncodingMacRomanian
= 38,
279 kTextEncodingMacUnicode
= 0x7E,
281 kTextEncodingMacFarsi
= 0x8C, /* Like MacArabic but uses Farsi digits */ /* The following use script code 7, smCyrillic */
282 kTextEncodingMacUkrainian
= 0x98, /* The following use script code 32, smUnimplemented */
289 extern void RequireFileLock(FileReference vp
, int shareable
);
290 #define REQUIRE_FILE_LOCK(vp,s) RequireFileLock((vp),(s))
292 #define REQUIRE_FILE_LOCK(vp,s)
297 BlockMoveData(const void * srcPtr
, void * destPtr
, Size byteCount
);
299 #define BlockMoveData(src, dest, len) bcopy((src), (dest), (len))
302 ClearMemory(void * start
, UInt32 length
);
304 #define ClearMemory(start, length) bzero((start), (size_t)(length));
308 NewPtr(Size byteCount
);
311 NewPtrSysClear(Size byteCount
);
316 #endif /* __APPLE_API_PRIVATE */
318 #endif /* __HFS_MACOS_TYPES__ */