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