2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 #ifndef __HFS_MACOS_TYPES__
24 #define __HFS_MACOS_TYPES__
26 #include <sys/appleapiopts.h>
29 #ifdef __APPLE_API_PRIVATE
31 #include <sys/param.h>
33 #include <libkern/libkern.h>
34 #include <sys/systm.h>
37 #include <sys/types.h>
42 #define TARGET_OS_MAC 0
43 #define TARGET_OS_WIN32 0
44 #define TARGET_OS_UNIX 0
46 #define PRAGMA_IMPORT 0
47 #define PRAGMA_STRUCT_ALIGN 1
49 #define PRAGMA_STRUCT_PACK 0
50 #define PRAGMA_STRUCT_PACKPUSH 0
53 #define TYPE_LONGLONG 1
55 #define TYPE_LONGLONG 0
63 #define EXTERN_API(_type) extern _type
64 #define EXTERN_API_C(_type) extern _type
66 #define CALLBACK_API_C(_type, _name) _type ( * _name)
68 #define TARGET_API_MACOS_X 1
69 #define TARGET_API_MAC_OS8 0
70 #define TARGET_API_MAC_CARBON 0
74 /****** START OF MACOSTYPES *********/
78 4.4BSD's sys/types.h defines size_t without defining __size_t__:
79 Things are a lot clearer from here on if we define __size_t__ now.
84 Convert kernel's diagnostic flag to MacOS's
90 #endif /* DIAGNOSTIC */
92 /********************************************************************************
96 NULL The C standard for an impossible pointer value
97 nil A carry over from pascal, NULL is prefered for C
99 *********************************************************************************/
109 typedef u_int8_t UInt8
;
110 typedef int8_t SInt8
;
111 typedef u_int16_t UInt16
;
112 typedef int16_t SInt16
;
113 typedef u_int32_t UInt32
;
114 typedef int32_t SInt32
;
115 typedef u_int64_t UInt64
;
116 typedef int64_t SInt64
;
121 typedef SInt16 OSErr
;
122 typedef SInt32 OSStatus
;
123 typedef UInt32 ItemCount
;
124 typedef void * LogicalAddress
;
125 typedef UInt32 ByteCount
;
126 typedef UInt8
* BytePtr
;
127 typedef UInt32 ByteOffset
;
128 typedef UInt32 OptionBits
;
129 typedef unsigned long FourCharCode
;
130 typedef FourCharCode OSType
;
132 typedef UInt16 UniChar
;
133 typedef unsigned char Str255
[256];
134 typedef unsigned char Str31
[32];
135 typedef unsigned char * StringPtr
;
136 typedef const unsigned char * ConstStr255Param
;
137 typedef const unsigned char * ConstStr31Param
;
138 typedef const unsigned char * ConstUTF8Param
;
142 typedef UInt32 TextEncoding
;
143 typedef UniChar
* UniCharArrayPtr
;
144 typedef const UniChar
* ConstUniCharArrayPtr
;
147 /********************************************************************************
149 Boolean types and values
151 Boolean A one byte value, holds "false" (0) or "true" (1)
152 false The Boolean value of zero (0)
153 true The Boolean value of one (1)
155 *********************************************************************************/
157 The identifiers "true" and "false" are becoming keywords in C++
158 and work with the new built-in type "bool"
159 "Boolean" will remain an unsigned char for compatibility with source
160 code written before "bool" existed.
169 #endif /* !TYPE_BOOL */
171 typedef unsigned char Boolean
;
176 EXTERN_API( void ) DebugStr(ConstStr255Param debuggerMsg
);
178 /*********************************************************************************
180 Added types for HFSPlus MacOS X functionality. Needs to be incorporated to
183 *********************************************************************************/
185 typedef struct vnode
* FileReference
;
188 /***** START OF MACOSSTUBS ********/
192 SizeTDef.h -- Common definitions
194 size_t - this type is defined by several ANSI headers.
196 #if ! defined (__size_t__)
198 #if defined (__xlc) || defined (__xlC) || defined (__xlC__) || defined (__MWERKS__)
199 typedef unsigned long size_t;
201 typedef unsigned int size_t;
203 #endif /* __size_t__ */
212 dskFulErr
= -34, /*disk full*/
213 bdNamErr
= -37, /*there may be no bad names in the final system!*/
214 paramErr
= -50, /*error in user parameter list*/
215 memFullErr
= -108, /*Not enough room in heap zone*/
216 fileBoundsErr
= -1309, /*file's EOF, offset, mark or size is too big*/
217 kTECUsedFallbacksStatus
= -8783,
224 kHasBeenInited
= 0x0100,
225 kHasCustomIcon
= 0x0400,
226 kIsStationery
= 0x0800,
227 kNameLocked
= 0x1000,
229 kIsInvisible
= 0x4000,
240 /* Mac OS encodings*/
241 kTextEncodingMacRoman
= 0L,
242 kTextEncodingMacJapanese
= 1,
243 kTextEncodingMacChineseTrad
= 2,
244 kTextEncodingMacKorean
= 3,
245 kTextEncodingMacArabic
= 4,
246 kTextEncodingMacHebrew
= 5,
247 kTextEncodingMacGreek
= 6,
248 kTextEncodingMacCyrillic
= 7,
249 kTextEncodingMacDevanagari
= 9,
250 kTextEncodingMacGurmukhi
= 10,
251 kTextEncodingMacGujarati
= 11,
252 kTextEncodingMacOriya
= 12,
253 kTextEncodingMacBengali
= 13,
254 kTextEncodingMacTamil
= 14,
255 kTextEncodingMacTelugu
= 15,
256 kTextEncodingMacKannada
= 16,
257 kTextEncodingMacMalayalam
= 17,
258 kTextEncodingMacSinhalese
= 18,
259 kTextEncodingMacBurmese
= 19,
260 kTextEncodingMacKhmer
= 20,
261 kTextEncodingMacThai
= 21,
262 kTextEncodingMacLaotian
= 22,
263 kTextEncodingMacGeorgian
= 23,
264 kTextEncodingMacArmenian
= 24,
265 kTextEncodingMacChineseSimp
= 25,
266 kTextEncodingMacTibetan
= 26,
267 kTextEncodingMacMongolian
= 27,
268 kTextEncodingMacEthiopic
= 28,
269 kTextEncodingMacCentralEurRoman
= 29,
270 kTextEncodingMacVietnamese
= 30,
271 kTextEncodingMacExtArabic
= 31, /* The following use script code 0, smRoman*/
272 kTextEncodingMacSymbol
= 33,
273 kTextEncodingMacDingbats
= 34,
274 kTextEncodingMacTurkish
= 35,
275 kTextEncodingMacCroatian
= 36,
276 kTextEncodingMacIcelandic
= 37,
277 kTextEncodingMacRomanian
= 38,
278 kTextEncodingMacUnicode
= 0x7E,
280 kTextEncodingMacFarsi
= 0x8C, /* Like MacArabic but uses Farsi digits */ /* The following use script code 7, smCyrillic */
281 kTextEncodingMacUkrainian
= 0x98, /* The following use script code 32, smUnimplemented */
288 extern void RequireFileLock(FileReference vp
, int shareable
);
289 #define REQUIRE_FILE_LOCK(vp,s) RequireFileLock((vp),(s))
291 #define REQUIRE_FILE_LOCK(vp,s)
296 BlockMoveData(const void * srcPtr
, void * destPtr
, Size byteCount
);
298 #define BlockMoveData(src, dest, len) bcopy((src), (dest), (len))
301 ClearMemory(void * start
, UInt32 length
);
303 #define ClearMemory(start, length) bzero((start), (size_t)(length));
307 NewPtr(Size byteCount
);
310 NewPtrSysClear(Size byteCount
);
315 #endif /* __APPLE_API_PRIVATE */
317 #endif /* __HFS_MACOS_TYPES__ */