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/OSTypes.h>
40 #include <libkern/libkern.h>
41 #include <sys/systm.h>
42 #include <sys/types.h>
47 #define TARGET_OS_MAC 0
48 #define TARGET_OS_WIN32 0
49 #define TARGET_OS_UNIX 0
51 #define PRAGMA_IMPORT 0
52 #define PRAGMA_STRUCT_ALIGN 1
54 #define PRAGMA_STRUCT_PACK 0
55 #define PRAGMA_STRUCT_PACKPUSH 0
58 #define TYPE_LONGLONG 1
60 #define TYPE_LONGLONG 0
68 #define EXTERN_API(_type) extern _type
69 #define EXTERN_API_C(_type) extern _type
71 #define CALLBACK_API_C(_type, _name) _type ( * _name)
73 #define TARGET_API_MACOS_X 1
74 #define TARGET_API_MAC_OS8 0
75 #define TARGET_API_MAC_CARBON 0
79 /****** START OF MACOSTYPES *********/
83 4.4BSD's sys/types.h defines size_t without defining __size_t__:
84 Things are a lot clearer from here on if we define __size_t__ now.
89 Convert kernel's diagnostic flag to MacOS's
95 #endif /* DIAGNOSTIC */
97 /********************************************************************************
101 NULL The C standard for an impossible pointer value
102 nil A carry over from pascal, NULL is prefered for C
104 *********************************************************************************/
116 typedef int16_t OSErr
;
117 typedef u_int32_t ItemCount
;
118 typedef u_int32_t ByteCount
;
119 typedef u_int8_t
* BytePtr
;
120 typedef u_int32_t ByteOffset
;
122 typedef u_int16_t UniChar
;
123 typedef unsigned char Str255
[256];
124 typedef unsigned char Str31
[32];
125 typedef unsigned char * StringPtr
;
126 typedef const unsigned char * ConstStr255Param
;
127 typedef const unsigned char * ConstStr31Param
;
128 typedef const unsigned char * ConstUTF8Param
;
130 typedef u_int8_t Byte
;
132 typedef u_int32_t TextEncoding
;
133 typedef UniChar
* UniCharArrayPtr
;
134 typedef const UniChar
* ConstUniCharArrayPtr
;
137 /********************************************************************************
139 Boolean types and values
141 Boolean A one byte value, holds "false" (0) or "true" (1)
142 false The Boolean value of zero (0)
143 true The Boolean value of one (1)
145 *********************************************************************************/
147 The identifiers "true" and "false" are becoming keywords in C++
148 and work with the new built-in type "bool"
149 "Boolean" will remain an unsigned char for compatibility with source
150 code written before "bool" existed.
159 #endif /* !TYPE_BOOL */
162 EXTERN_API( void ) DebugStr(const char * debuggerMsg
);
164 /*********************************************************************************
166 Added types for HFSPlus MacOS X functionality. Needs to be incorporated to
169 *********************************************************************************/
171 typedef struct vnode
* FileReference
;
174 /***** START OF MACOSSTUBS ********/
178 SizeTDef.h -- Common definitions
180 size_t - this type is defined by several ANSI headers.
182 #if ! defined (__size_t__)
184 #if defined (__xlc) || defined (__xlC) || defined (__xlC__) || defined (__MWERKS__)
185 typedef unsigned long size_t;
187 typedef unsigned int size_t;
189 #endif /* __size_t__ */
198 dskFulErr
= -34, /*disk full*/
199 bdNamErr
= -37, /*there may be no bad names in the final system!*/
200 paramErr
= -50, /*error in user parameter list*/
201 memFullErr
= -108, /*Not enough room in heap zone*/
202 fileBoundsErr
= -1309, /*file's EOF, offset, mark or size is too big*/
203 kTECUsedFallbacksStatus
= -8783,
210 kHasBeenInited
= 0x0100,
211 kHasCustomIcon
= 0x0400,
212 kIsStationery
= 0x0800,
213 kNameLocked
= 0x1000,
215 kIsInvisible
= 0x4000,
226 /* Mac OS encodings*/
227 kTextEncodingMacRoman
= 0L,
228 kTextEncodingMacJapanese
= 1,
229 kTextEncodingMacChineseTrad
= 2,
230 kTextEncodingMacKorean
= 3,
231 kTextEncodingMacArabic
= 4,
232 kTextEncodingMacHebrew
= 5,
233 kTextEncodingMacGreek
= 6,
234 kTextEncodingMacCyrillic
= 7,
235 kTextEncodingMacDevanagari
= 9,
236 kTextEncodingMacGurmukhi
= 10,
237 kTextEncodingMacGujarati
= 11,
238 kTextEncodingMacOriya
= 12,
239 kTextEncodingMacBengali
= 13,
240 kTextEncodingMacTamil
= 14,
241 kTextEncodingMacTelugu
= 15,
242 kTextEncodingMacKannada
= 16,
243 kTextEncodingMacMalayalam
= 17,
244 kTextEncodingMacSinhalese
= 18,
245 kTextEncodingMacBurmese
= 19,
246 kTextEncodingMacKhmer
= 20,
247 kTextEncodingMacThai
= 21,
248 kTextEncodingMacLaotian
= 22,
249 kTextEncodingMacGeorgian
= 23,
250 kTextEncodingMacArmenian
= 24,
251 kTextEncodingMacChineseSimp
= 25,
252 kTextEncodingMacTibetan
= 26,
253 kTextEncodingMacMongolian
= 27,
254 kTextEncodingMacEthiopic
= 28,
255 kTextEncodingMacCentralEurRoman
= 29,
256 kTextEncodingMacVietnamese
= 30,
257 kTextEncodingMacExtArabic
= 31, /* The following use script code 0, smRoman*/
258 kTextEncodingMacSymbol
= 33,
259 kTextEncodingMacDingbats
= 34,
260 kTextEncodingMacTurkish
= 35,
261 kTextEncodingMacCroatian
= 36,
262 kTextEncodingMacIcelandic
= 37,
263 kTextEncodingMacRomanian
= 38,
264 kTextEncodingMacUnicode
= 0x7E,
266 kTextEncodingMacFarsi
= 0x8C, /* Like MacArabic but uses Farsi digits */ /* The following use script code 7, smCyrillic */
267 kTextEncodingMacUkrainian
= 0x98, /* The following use script code 32, smUnimplemented */
274 extern void RequireFileLock(FileReference vp
, int shareable
);
275 #define REQUIRE_FILE_LOCK(vp,s) RequireFileLock((vp),(s))
277 #define REQUIRE_FILE_LOCK(vp,s)
282 BlockMoveData(const void * srcPtr
, void * destPtr
, Size byteCount
);
284 #define BlockMoveData(src, dest, len) bcopy((src), (dest), (len))
287 ClearMemory(void * start
, u_int32_t length
);
289 #define ClearMemory(start, length) bzero((start), (size_t)(length));
293 NewPtr(Size byteCount
);
296 NewPtrSysClear(Size byteCount
);
301 #endif /* __APPLE_API_PRIVATE */
303 #endif /* __HFS_MACOS_TYPES__ */