]> git.saurik.com Git - apple/xnu.git/blob - bsd/hfs/hfs_macos_defs.h
xnu-201.tar.gz
[apple/xnu.git] / bsd / hfs / hfs_macos_defs.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
11 *
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
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 File: hfs_macos_types.h
24
25 Contains: Basic Macintosh OS data types.
26
27 Version: System 7.5
28
29 DRI: Nick Kledzik
30
31 */
32
33
34 #ifndef __hfs_macos_types__
35 #define __hfs_macos_types__
36
37
38 #include <sys/param.h>
39 #ifdef KERNEL
40 #include <libkern/libkern.h>
41 #include <sys/systm.h>
42 #endif
43
44 #include <sys/types.h>
45 #include <sys/time.h>
46 #include <sys/proc.h>
47 #include <sys/lock.h>
48
49 /****** START OF CONDITIONALMACROS *********/
50
51 #if defined(__ppc__) || defined(powerpc) || defined(ppc)
52 #define TARGET_CPU_PPC 1
53 #define TARGET_CPU_68K 0
54 #define TARGET_CPU_X86 0
55 #define TARGET_CPU_MIPS 0
56 #define TARGET_CPU_SPARC 0
57 #define TARGET_CPU_ALPHA 0
58 #define TARGET_RT_MAC_CFM 0
59 #define TARGET_RT_MAC_MACHO 1
60 #define TARGET_RT_MAC_68881 0
61 #define TARGET_RT_LITTLE_ENDIAN 0
62 #define TARGET_RT_BIG_ENDIAN 1
63 #elif defined(m68k)
64 #define TARGET_CPU_PPC 0
65 #define TARGET_CPU_68K 1
66 #define TARGET_CPU_X86 0
67 #define TARGET_CPU_MIPS 0
68 #define TARGET_CPU_SPARC 0
69 #define TARGET_CPU_ALPHA 0
70 #define TARGET_RT_MAC_CFM 0
71 #define TARGET_RT_MAC_MACHO 1
72 #define TARGET_RT_MAC_68881 0
73 #define TARGET_RT_LITTLE_ENDIAN 0
74 #define TARGET_RT_BIG_ENDIAN 1
75 #elif defined(sparc)
76 #define TARGET_CPU_PPC 0
77 #define TARGET_CPU_68K 0
78 #define TARGET_CPU_X86 0
79 #define TARGET_CPU_MIPS 0
80 #define TARGET_CPU_SPARC 1
81 #define TARGET_CPU_ALPHA 0
82 #define TARGET_RT_MAC_CFM 0
83 #define TARGET_RT_MAC_MACHO 1
84 #define TARGET_RT_MAC_68881 0
85 #define TARGET_RT_LITTLE_ENDIAN 0
86 #define TARGET_RT_BIG_ENDIAN 1
87 #elif defined(__i386__) || defined(i386) || defined(intel)
88 #define TARGET_CPU_PPC 0
89 #define TARGET_CPU_68K 0
90 #define TARGET_CPU_X86 1
91 #define TARGET_CPU_MIPS 0
92 #define TARGET_CPU_SPARC 0
93 #define TARGET_CPU_ALPHA 0
94 #define TARGET_RT_MAC_CFM 0
95 #define TARGET_RT_MAC_MACHO 1
96 #define TARGET_RT_MAC_68881 0
97 #define TARGET_RT_LITTLE_ENDIAN 1
98 #define TARGET_RT_BIG_ENDIAN 0
99 #else
100 #error unrecognized GNU C compiler
101 #endif
102
103
104 #define TARGET_OS_MAC 0
105 #define TARGET_OS_WIN32 0
106 #define TARGET_OS_UNIX 0
107
108 #define PRAGMA_IMPORT 0
109 #define PRAGMA_STRUCT_ALIGN 1
110 #define PRAGMA_ONCE 0
111 #define PRAGMA_STRUCT_PACK 0
112 #define PRAGMA_STRUCT_PACKPUSH 0
113 #define PRAGMA_ENUM_PACK 0
114 #define PRAGMA_ENUM_ALWAYSINT 0
115 #define PRAGMA_ENUM_OPTIONS 0
116 #define FOUR_CHAR_CODE(x) (x)
117
118 #define TYPE_EXTENDED 0
119 #if __GNUC__ >= 2
120 #define TYPE_LONGLONG 1
121 #else
122 #define TYPE_LONGLONG 0
123 #endif
124 #ifdef __cplusplus
125 #define TYPE_BOOL 1
126 #else
127 #define TYPE_BOOL 0
128 #endif
129
130 #define FUNCTION_PASCAL 0
131 #define FUNCTION_DECLSPEC 0
132 #define FUNCTION_WIN32CC 0
133
134
135 #define EXTERN_API(_type) extern _type
136 #define EXTERN_API_C(_type) extern _type
137 #define EXTERN_API_STDCALL(_type) extern _type
138 #define EXTERN_API_C_STDCALL(_type) extern _type
139
140 #define DEFINE_API(_type) _type
141 #define DEFINE_API_C(_type) _type
142 #define DEFINE_API_STDCALL(_type) _type
143 #define DEFINE_API_C_STDCALL(_type) _type
144
145 #define CALLBACK_API(_type, _name) _type ( * _name)
146 #define CALLBACK_API_C(_type, _name) _type ( * _name)
147 #define CALLBACK_API_STDCALL(_type, _name) _type ( * _name)
148 #define CALLBACK_API_C_STDCALL(_type, _name) _type ( * _name)
149
150 #define TARGET_API_MACOS_X 1
151 #define TARGET_API_MAC_OS8 0
152 #define TARGET_API_MAC_CARBON 0
153
154 #define ONEWORDINLINE(w1)
155 #define TWOWORDINLINE(w1,w2)
156 #define THREEWORDINLINE(w1,w2,w3)
157 #define FOURWORDINLINE(w1,w2,w3,w4)
158 #define FIVEWORDINLINE(w1,w2,w3,w4,w5)
159 #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)
160 #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)
161 #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)
162 #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)
163 #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)
164 #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)
165 #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)
166
167
168 /****** START OF MACOSTYPES *********/
169
170
171 /*
172 4.4BSD's sys/types.h defines size_t without defining __size_t__:
173 Things are a lot clearer from here on if we define __size_t__ now.
174 */
175 #define __size_t__
176
177 /*
178 Convert kernel's diagnostic flag to MacOS's
179 */
180 #if HFS_DIAGNOSTIC
181 #define DEBUG_BUILD 1
182 #else
183 #define DEBUG_BUILD 0
184 #endif /* DIAGNOSTIC */
185
186 /********************************************************************************
187
188 Special values in C
189
190 NULL The C standard for an impossible pointer value
191 nil A carry over from pascal, NULL is prefered for C
192
193 *********************************************************************************/
194 #ifndef NULL
195 #define NULL 0
196 #endif
197
198 #ifndef nil
199 #define nil NULL
200 #endif
201
202
203 /********************************************************************************
204
205 Base integer types for all target OS's and CPU's
206
207 UInt8 8-bit unsigned integer
208 SInt8 8-bit signed integer
209 UInt16 16-bit unsigned integer
210 SInt16 16-bit signed integer
211 UInt32 32-bit unsigned integer
212 SInt32 32-bit signed integer
213 UInt64 64-bit unsigned integer
214 SInt64 64-bit signed integer
215
216 *********************************************************************************/
217 typedef u_int8_t UInt8;
218 typedef int8_t SInt8;
219 typedef u_int16_t UInt16;
220 typedef int16_t SInt16;
221 typedef u_int32_t UInt32;
222 typedef int32_t SInt32;
223 typedef u_int64_t UInt64;
224 typedef int64_t SInt64;
225
226
227
228 /********************************************************************************
229
230 Base floating point types
231
232 Float32 32 bit IEEE float: 1 sign bit, 8 exponent bits, 23 fraction bits
233 Float64 64 bit IEEE float: 1 sign bit, 11 exponent bits, 52 fraction bits
234 Float80 80 bit MacOS float: 1 sign bit, 15 exponent bits, 1 integer bit, 63 fraction bits
235 Float96 96 bit 68881 float: 1 sign bit, 15 exponent bits, 16 pad bits, 1 integer bit, 63 fraction bits
236
237 Note: These are fixed size floating point types, useful when writing a floating
238 point value to disk. If your compiler does not support a particular size
239 float, a struct is used instead.
240 Use of of the NCEG types (e.g. double_t) or an ANSI C type (e.g. double) if
241 you want a floating point representation that is natural for any given
242 compiler, but might be a different size on different compilers.
243
244 *********************************************************************************/
245 typedef float Float32;
246 typedef double Float64;
247
248 struct Float80 {
249 SInt16 exp;
250 UInt16 man[4];
251 };
252 typedef struct Float80 Float80;
253
254 struct Float96 {
255 SInt16 exp[2]; /* the second 16-bits is always zero */
256 UInt16 man[4];
257 };
258 typedef struct Float96 Float96;
259
260
261
262 /********************************************************************************
263
264 MacOS Memory Manager types
265
266 Ptr Pointer to a non-relocatable block
267 Handle Pointer to a master pointer to a relocatable block
268 Size The number of bytes in a block (signed for historical reasons)
269
270 *********************************************************************************/
271 typedef char * Ptr;
272 typedef Ptr * Handle;
273 typedef long Size;
274 /********************************************************************************
275
276 Higher level basic types
277
278 OSErr 16-bit result error code
279 OSStatus 32-bit result error code
280 LogicalAddress Address in the clients virtual address space
281 ConstLogicalAddress Address in the clients virtual address space that will only be read
282 PhysicalAddress Real address as used on the hardware bus
283 BytePtr Pointer to an array of bytes
284 ByteCount The size of an array of bytes
285 ByteOffset An offset into an array of bytes
286 ItemCount 32-bit iteration count
287 OptionBits Standard 32-bit set of bit flags
288 PBVersion ?
289 Duration 32-bit millisecond timer for drivers
290 AbsoluteTime 64-bit clock
291 ScriptCode The coarse features of a written language (e.g. Roman vs Cyrillic)
292 LangCode A particular language (e.g. English)
293 RegionCode A variation of a language (British vs American English)
294 FourCharCode A 32-bit value made by packing four 1 byte characters together
295 OSType A FourCharCode used in the OS and file system (e.g. creator)
296 ResType A FourCharCode used to tag resources (e.g. 'DLOG')
297
298 *********************************************************************************/
299 typedef SInt16 OSErr;
300 typedef SInt32 OSStatus;
301 typedef void * LogicalAddress;
302 typedef const void * ConstLogicalAddress;
303 typedef void * PhysicalAddress;
304 typedef UInt8 * BytePtr;
305 typedef UInt32 ByteCount;
306 typedef UInt32 ByteOffset;
307 typedef SInt32 Duration;
308 typedef UInt64 AbsoluteTime;
309 typedef UInt32 OptionBits;
310 typedef UInt32 ItemCount;
311 typedef UInt32 PBVersion;
312 typedef SInt16 ScriptCode;
313 typedef SInt16 LangCode;
314 typedef SInt16 RegionCode;
315 typedef unsigned long FourCharCode;
316 typedef FourCharCode OSType;
317 typedef FourCharCode ResType;
318 typedef OSType * OSTypePtr;
319 typedef ResType * ResTypePtr;
320
321
322 /********************************************************************************
323
324 Boolean types and values
325
326 Boolean A one byte value, holds "false" (0) or "true" (1)
327 false The Boolean value of zero (0)
328 true The Boolean value of one (1)
329
330 *********************************************************************************/
331 /*
332 The identifiers "true" and "false" are becoming keywords in C++
333 and work with the new built-in type "bool"
334 "Boolean" will remain an unsigned char for compatibility with source
335 code written before "bool" existed.
336 */
337 #if !TYPE_BOOL
338
339 enum {
340 false = 0,
341 true = 1
342 };
343
344 #endif /* !TYPE_BOOL */
345
346 typedef unsigned char Boolean;
347
348
349 /********************************************************************************
350
351 Function Pointer Types
352
353 ProcPtr Generic pointer to a function
354 Register68kProcPtr Pointer to a 68K function that expects parameters in registers
355 UniversalProcPtr Pointer to classic 68K code or a RoutineDescriptor
356
357 ProcHandle Pointer to a ProcPtr
358 UniversalProcHandle Pointer to a UniversalProcPtr
359
360 *********************************************************************************/
361 typedef long (*ProcPtr)();
362 typedef void (*Register68kProcPtr)();
363
364 typedef ProcPtr UniversalProcPtr;
365
366 typedef ProcPtr * ProcHandle;
367 typedef UniversalProcPtr * UniversalProcHandle;
368
369 /********************************************************************************
370
371 Quickdraw Types
372
373 Point 2D Quickdraw coordinate, range: -32K to +32K
374 Rect Rectangluar Quickdraw area
375 Style Quickdraw font rendering styles
376 StyleParameter Style when used as a parameter (historical 68K convention)
377 StyleField Style when used as a field (historical 68K convention)
378 CharParameter Char when used as a parameter (historical 68K convention)
379
380 Note: The original Macintosh toolbox in 68K Pascal defined Style as a SET.
381 Both Style and CHAR occupy 8-bits in packed records or 16-bits when
382 used as fields in non-packed records or as parameters.
383
384 *********************************************************************************/
385 struct Point {
386 short v;
387 short h;
388 };
389 typedef struct Point Point;
390
391 typedef Point * PointPtr;
392 struct Rect {
393 short top;
394 short left;
395 short bottom;
396 short right;
397 };
398 typedef struct Rect Rect;
399
400 typedef Rect * RectPtr;
401 typedef short CharParameter;
402
403 enum {
404 normal = 0,
405 bold = 1,
406 italic = 2,
407 underline = 4,
408 outline = 8,
409 shadow = 0x10,
410 condense = 0x20,
411 extend = 0x40
412 };
413
414 typedef unsigned char Style;
415 typedef short StyleParameter;
416 typedef Style StyleField;
417
418
419 /********************************************************************************
420
421 Common Constants
422
423 noErr OSErr: function performed properly - no error
424 kNilOptions OptionBits: all flags false
425 kInvalidID KernelID: NULL is for pointers as kInvalidID is for ID's
426 kVariableLengthArray array bounds: variable length array
427
428 Note: kVariableLengthArray is used in array bounds to specify a variable length array.
429 It is ususally used in variable length structs when the last field is an array
430 of any size. Before ANSI C, we used zero as the bounds of variable length
431 array, but zero length array are illegal in ANSI C. Example usage:
432
433 struct FooList
434 {
435 short listLength;
436 Foo elements[kVariableLengthArray];
437 };
438
439 *********************************************************************************/
440
441 enum {
442 noErr = 0
443 };
444
445
446 enum {
447 kNilOptions = 0
448 };
449
450 #define kInvalidID 0
451
452 enum {
453 kVariableLengthArray = 1
454 };
455
456
457
458 /********************************************************************************
459
460 String Types
461
462 UniChar A single UniCode character (16-bits)
463
464 StrNNN Pascal string holding up to NNN bytes
465 StringPtr Pointer to a pascal string
466 StringHandle Pointer to a StringPtr
467 ConstStrNNNParam For function parameters only - means string is const
468
469 CStringPtr Pointer to a C string (same as: char*)
470 ConstCStringPtr Pointer to a const C string (same as: const char*)
471
472 Note: The length of a pascal string is stored in the first byte.
473 A pascal string does not have a termination byte and can be at most 255 bytes long.
474 The first character in a pascal string is offset one byte from the start of the string.
475
476 A C string is terminated with a byte of value zero.
477 A C string has no length limitation.
478 The first character in a C string is the first byte of the string.
479
480
481 *********************************************************************************/
482 typedef UInt16 UniChar;
483 typedef unsigned char Str255[256];
484 typedef unsigned char Str63[64];
485 typedef unsigned char Str32[33];
486 typedef unsigned char Str31[32];
487 typedef unsigned char Str27[28];
488 typedef unsigned char Str15[16];
489 /*
490 The type Str32 is used in many AppleTalk based data structures.
491 It holds up to 32 one byte chars. The problem is that with the
492 length byte it is 33 bytes long. This can cause weird alignment
493 problems in structures. To fix this the type "Str32Field" has
494 been created. It should only be used to hold 32 chars, but
495 it is 34 bytes long so that there are no alignment problems.
496 */
497 typedef unsigned char Str32Field[34];
498 typedef unsigned char * StringPtr;
499 typedef StringPtr * StringHandle;
500 typedef const unsigned char * ConstStr255Param;
501 typedef const unsigned char * ConstStr63Param;
502 typedef const unsigned char * ConstStr32Param;
503 typedef const unsigned char * ConstStr31Param;
504 typedef const unsigned char * ConstStr27Param;
505 typedef const unsigned char * ConstStr15Param;
506 #ifdef __cplusplus
507 inline unsigned char StrLength(ConstStr255Param string) { return (*string); }
508 #else
509 #define StrLength(string) (*(unsigned char *)(string))
510 #endif /* defined(__cplusplus) */
511
512 typedef const unsigned char * ConstUTF8Param;
513
514 /*********************************************************************************
515
516 Old names for types
517
518 *********************************************************************************/
519 typedef UInt8 Byte;
520 typedef SInt8 SignedByte;
521 typedef SInt64 * WidePtr;
522 typedef UInt64 * UnsignedWidePtr;
523 typedef Float80 extended80;
524 typedef Float96 extended96;
525 typedef SInt8 VHSelect;
526
527
528 EXTERN_API( void )
529 DebugStr (ConstStr255Param debuggerMsg);
530
531 /*********************************************************************************
532
533 Added types for HFSPlus MacOS X functionality. Needs to be incorporated to
534 other places
535
536 *********************************************************************************/
537
538 typedef struct vnode* FileReference;
539 #define kNoFileReference NULL
540
541
542 #define HFSInstrumentation 0
543
544
545 /***** START OF MACOSSTUBS ********/
546
547
548 /*
549 SizeTDef.h -- Common definitions
550
551 size_t - this type is defined by several ANSI headers.
552 */
553 #if ! defined (__size_t__)
554 #define __size_t__
555 #if defined (__xlc) || defined (__xlC) || defined (__xlC__) || defined (__MWERKS__)
556 typedef unsigned long size_t;
557 #else /* __xlC */
558 typedef unsigned int size_t;
559 #endif /* __xlC */
560 #endif /* __size_t__ */
561
562
563 /*
564 StdDef.h -- Common definitions
565
566 */
567
568 #define offsetof(structure,field) ((size_t)&((structure *) 0)->field)
569
570
571
572 /*
573 File: Errors.h
574
575 */
576 enum {
577 paramErr = -50, /*error in user parameter list*/
578 noHardwareErr = -200, /*Sound Manager Error Returns*/
579 notEnoughHardwareErr = -201, /*Sound Manager Error Returns*/
580 userCanceledErr = -128,
581 qErr = -1, /*queue element not found during deletion*/
582 vTypErr = -2, /*invalid queue element*/
583 corErr = -3, /*core routine number out of range*/
584 unimpErr = -4, /*unimplemented core routine*/
585 SlpTypeErr = -5, /*invalid queue element*/
586 seNoDB = -8, /*no debugger installed to handle debugger command*/
587 controlErr = -17, /*I/O System Errors*/
588 statusErr = -18, /*I/O System Errors*/
589 readErr = -19, /*I/O System Errors*/
590 writErr = -20, /*I/O System Errors*/
591 badUnitErr = -21, /*I/O System Errors*/
592 unitEmptyErr = -22, /*I/O System Errors*/
593 openErr = -23, /*I/O System Errors*/
594 closErr = -24, /*I/O System Errors*/
595 dRemovErr = -25, /*tried to remove an open driver*/
596 dInstErr = -26 /*DrvrInstall couldn't find driver in resources*/
597 };
598
599 enum { /* Printing Errors */
600 iMemFullErr = -108,
601 iIOAbort = -27, /*Scrap Manager errors*/
602 noScrapErr = -100, /*No scrap exists error*/
603 noTypeErr = -102, /*No object of that type in scrap*/
604 memROZWarn = -99, /*soft error in ROZ*/
605 memROZError = -99, /*hard error in ROZ*/
606 memROZErr = -99, /*hard error in ROZ*/
607 memFullErr = -108, /*Not enough room in heap zone*/
608 nilHandleErr = -109, /*Master Pointer was NIL in HandleZone or other*/
609 memWZErr = -111, /*WhichZone failed (applied to free block)*/
610 memPurErr = -112, /*trying to purge a locked or non-purgeable block*/
611 memAdrErr = -110 /*address was odd; or out of range*/
612 };
613
614
615
616 enum {
617 abortErr = -27, /*IO call aborted by KillIO*/
618 iIOAbortErr = -27, /*IO abort error (Printing Manager)*/
619 notOpenErr = -28, /*Couldn't rd/wr/ctl/sts cause driver not opened*/
620 unitTblFullErr = -29, /*unit table has no more entries*/
621 dceExtErr = -30, /*dce extension error*/
622 slotNumErr = -360, /*invalid slot # error*/
623 gcrOnMFMErr = -400, /*gcr format on high density media error*/
624 dirFulErr = -33, /*Directory full*/
625 dskFulErr = -34, /*disk full*/
626 nsvErr = -35, /*no such volume*/
627 ioErr = -36, /*I/O error (bummers)*/
628 bdNamErr = -37, /*there may be no bad names in the final system!*/
629 fnOpnErr = -38, /*File not open*/
630 eofErr = -39, /*End of file*/
631 posErr = -40, /*tried to position to before start of file (r/w)*/
632 mFulErr = -41, /*memory full (open) or file won't fit (load)*/
633 tmfoErr = -42, /*too many files open*/
634 fnfErr = -43, /*File not found*/
635 wPrErr = -44, /*diskette is write protected.*/
636 fLckdErr = -45 /*file is locked*/
637 };
638
639
640 enum {
641 vLckdErr = -46, /*volume is locked*/
642 fBsyErr = -47, /*File is busy (delete)*/
643 dupFNErr = -48, /*duplicate filename (rename)*/
644 opWrErr = -49, /*file already open with with write permission*/
645 rfNumErr = -51, /*refnum error*/
646 gfpErr = -52, /*get file position error*/
647 volOffLinErr = -53, /*volume not on line error (was Ejected)*/
648 permErr = -54, /*permissions error (on file open)*/
649 volOnLinErr = -55, /*drive volume already on-line at MountVol*/
650 nsDrvErr = -56, /*no such drive (tried to mount a bad drive num)*/
651 noMacDskErr = -57, /*not a mac diskette (sig bytes are wrong)*/
652 extFSErr = -58, /*volume in question belongs to an external fs*/
653 fsRnErr = -59, /*file system internal error:during rename the old entry was deleted but could not be restored.*/
654 badMDBErr = -60, /*bad master directory block*/
655 wrPermErr = -61, /*write permissions error*/
656 dirNFErr = -120, /*Directory not found*/
657 tmwdoErr = -121, /*No free WDCB available*/
658 badMovErr = -122, /*Move into offspring error*/
659 wrgVolTypErr = -123, /*Wrong volume type error [operation not supported for MFS]*/
660 volGoneErr = -124 /*Server volume has been disconnected.*/
661 };
662
663 enum {
664 /*Dictionary Manager errors*/
665 notBTree = -410, /*The file is not a dictionary.*/
666 btNoSpace = -413, /*Can't allocate disk space.*/
667 btDupRecErr = -414, /*Record already exists.*/
668 btRecNotFnd = -415, /*Record cannot be found.*/
669 btKeyLenErr = -416, /*Maximum key length is too long or equal to zero.*/
670 btKeyAttrErr = -417, /*There is no such a key attribute.*/
671 unknownInsertModeErr = -20000, /*There is no such an insert mode.*/
672 recordDataTooBigErr = -20001, /*The record data is bigger than buffer size (1024 bytes).*/
673 invalidIndexErr = -20002 /*The recordIndex parameter is not valid.*/
674 };
675
676
677 enum {
678 fidNotFound = -1300, /*no file thread exists.*/
679 fidExists = -1301, /*file id already exists*/
680 notAFileErr = -1302, /*directory specified*/
681 diffVolErr = -1303, /*files on different volumes*/
682 catChangedErr = -1304, /*the catalog has been modified*/
683 desktopDamagedErr = -1305, /*desktop database files are corrupted*/
684 sameFileErr = -1306, /*can't exchange a file with itself*/
685 badFidErr = -1307, /*file id is dangling or doesn't match with the file number*/
686 notARemountErr = -1308, /*when _Mount allows only remounts and doesn't get one*/
687 fileBoundsErr = -1309, /*file's EOF, offset, mark or size is too big*/
688 fsDataTooBigErr = -1310, /*file or volume is too big for system*/
689 volVMBusyErr = -1311, /*can't eject because volume is in use by VM*/
690 envNotPresent = -5500, /*returned by glue.*/
691 envBadVers = -5501, /*Version non-positive*/
692 envVersTooBig = -5502, /*Version bigger than call can handle*/
693 fontDecError = -64, /*error during font declaration*/
694 fontNotDeclared = -65, /*font not declared*/
695 fontSubErr = -66, /*font substitution occured*/
696 fontNotOutlineErr = -32615, /*bitmap font passed to routine that does outlines only*/
697 firstDskErr = -84, /*I/O System Errors*/
698 lastDskErr = -64, /*I/O System Errors*/
699 noDriveErr = -64, /*drive not installed*/
700 offLinErr = -65, /*r/w requested for an off-line drive*/
701 noNybErr = -66 /*couldn't find 5 nybbles in 200 tries*/
702 };
703
704 enum {
705 /* general text errors*/
706 kTextUnsupportedEncodingErr = -8738, /* specified encoding not supported for this operation*/
707 kTextMalformedInputErr = -8739, /* in DBCS, for example, high byte followed by invalid low byte*/
708 kTextUndefinedElementErr = -8740, /* text conversion errors*/
709 kTECMissingTableErr = -8745,
710 kTECTableChecksumErr = -8746,
711 kTECTableFormatErr = -8747,
712 kTECCorruptConverterErr = -8748, /* invalid converter object reference*/
713 kTECNoConversionPathErr = -8749,
714 kTECBufferBelowMinimumSizeErr = -8750, /* output buffer too small to allow processing of first input text element*/
715 kTECArrayFullErr = -8751, /* supplied name buffer or TextRun, TextEncoding, or UnicodeMapping array is too small*/
716 kTECBadTextRunErr = -8752,
717 kTECPartialCharErr = -8753, /* input buffer ends in the middle of a multibyte character, conversion stopped*/
718 kTECUnmappableElementErr = -8754,
719 kTECIncompleteElementErr = -8755, /* text element may be incomplete or is too long for internal buffers*/
720 kTECDirectionErr = -8756, /* direction stack overflow, etc.*/
721 kTECGlobalsUnavailableErr = -8770, /* globals have already been deallocated (premature TERM)*/
722 kTECItemUnavailableErr = -8771, /* item (e.g. name) not available for specified region (& encoding if relevant)*/
723 /* text conversion status codes*/
724 kTECUsedFallbacksStatus = -8783,
725 kTECNeedFlushStatus = -8784,
726 kTECOutputBufferFullStatus = -8785, /* output buffer has no room for conversion of next input text element (partial conversion)*/
727 /* deprecated error & status codes for low-level converter*/
728 unicodeChecksumErr = -8769,
729 unicodeNoTableErr = -8768,
730 unicodeVariantErr = -8767,
731 unicodeFallbacksErr = -8766,
732 unicodePartConvertErr = -8765,
733 unicodeBufErr = -8764,
734 unicodeCharErr = -8763,
735 unicodeElementErr = -8762,
736 unicodeNotFoundErr = -8761,
737 unicodeTableFormatErr = -8760,
738 unicodeDirectionErr = -8759,
739 unicodeContextualErr = -8758,
740 unicodeTextEncodingDataErr = -8757
741 };
742
743
744 /*
745 File: MacMemory.h
746
747
748 */
749
750
751 /*
752 File: MixedMode.h
753
754 */
755
756 /* Calling Conventions */
757 typedef unsigned short CallingConventionType;
758
759 enum {
760 kPascalStackBased = 0,
761 kCStackBased = 1,
762 kRegisterBased = 2,
763 kD0DispatchedPascalStackBased = 8,
764 kD1DispatchedPascalStackBased = 12,
765 kD0DispatchedCStackBased = 9,
766 kStackDispatchedPascalStackBased = 14,
767 kThinkCStackBased = 5
768 };
769
770
771 #define STACK_UPP_TYPE(name) name
772 #define REGISTER_UPP_TYPE(name) name
773
774
775 /*
776 File: OSUtils.h
777
778 */
779 typedef struct QElem QElem;
780
781 typedef QElem * QElemPtr;
782 struct QHdr {
783 short qFlags;
784 QElemPtr qHead;
785 QElemPtr qTail;
786 };
787 typedef struct QHdr QHdr;
788
789 typedef QHdr * QHdrPtr;
790
791 typedef CALLBACK_API( void , DeferredTaskProcPtr )(long dtParam);
792 /*
793 WARNING: DeferredTaskProcPtr uses register based parameters under classic 68k
794 and cannot be written in a high-level language without
795 the help of mixed mode or assembly glue.
796 */
797 typedef REGISTER_UPP_TYPE(DeferredTaskProcPtr) DeferredTaskUPP;
798 enum { uppDeferredTaskProcInfo = 0x0000B802 }; /* register no_return_value Func(4_bytes:A1) */
799 #define NewDeferredTaskProc(userRoutine) (DeferredTaskUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDeferredTaskProcInfo, GetCurrentArchitecture())
800 #define CallDeferredTaskProc(userRoutine, dtParam) CALL_ONE_PARAMETER_UPP((userRoutine), uppDeferredTaskProcInfo, (dtParam))
801 struct DeferredTask {
802 QElemPtr qLink;
803 short qType;
804 short dtFlags;
805 DeferredTaskUPP dtAddr;
806 long dtParam;
807 long dtReserved;
808 };
809 typedef struct DeferredTask DeferredTask;
810
811 typedef DeferredTask * DeferredTaskPtr;
812
813 /*
814 File: Finder.h
815
816
817 */
818
819 /*
820 The following declerations used to be in Files.\89,
821 but are Finder specific and were moved here.
822 */
823
824 enum {
825 /* Finder Flags */
826 kIsOnDesk = 0x0001,
827 kColor = 0x000E,
828 kIsShared = 0x0040, /* bit 0x0080 is hasNoINITS */
829 kHasBeenInited = 0x0100, /* bit 0x0200 was the letter bit for AOCE, but is now reserved for future use */
830 kHasCustomIcon = 0x0400,
831 kIsStationery = 0x0800,
832 kNameLocked = 0x1000,
833 kHasBundle = 0x2000,
834 kIsInvisible = 0x4000,
835 kIsAlias = 0x8000
836 };
837
838
839 enum {
840 /* Finder Constants */
841 fOnDesk = 1,
842 fHasBundle = 8192,
843 fTrash = -3,
844 fDesktop = -2,
845 fDisk = 0
846 };
847
848 #if PRAGMA_STRUCT_ALIGN
849 #pragma options align=mac68k
850 #elif PRAGMA_STRUCT_PACKPUSH
851 #pragma pack(push, 2)
852 #elif PRAGMA_STRUCT_PACK
853 #pragma pack(2)
854 #endif
855
856
857 struct FInfo {
858 OSType fdType; /*the type of the file*/
859 OSType fdCreator; /*file's creator*/
860 unsigned short fdFlags; /*flags ex. hasbundle,invisible,locked, etc.*/
861 Point fdLocation; /*file's location in folder*/
862 short fdFldr; /*folder containing file*/
863 };
864 typedef struct FInfo FInfo;
865
866 struct FXInfo {
867 short fdIconID; /*Icon ID*/
868 short fdUnused[3]; /*unused but reserved 6 bytes*/
869 SInt8 fdScript; /*Script flag and number*/
870 SInt8 fdXFlags; /*More flag bits*/
871 short fdComment; /*Comment ID*/
872 long fdPutAway; /*Home Dir ID*/
873 };
874 typedef struct FXInfo FXInfo;
875
876 struct DInfo {
877 Rect frRect; /*folder rect*/
878 unsigned short frFlags; /*Flags*/
879 Point frLocation; /*folder location*/
880 short frView; /*folder view*/
881 };
882 typedef struct DInfo DInfo;
883
884 struct DXInfo {
885 Point frScroll; /*scroll position*/
886 long frOpenChain; /*DirID chain of open folders*/
887 SInt8 frScript; /*Script flag and number*/
888 SInt8 frXFlags; /*More flag bits*/
889 short frComment; /*comment*/
890 long frPutAway; /*DirID*/
891 };
892 typedef struct DXInfo DXInfo;
893
894 #if PRAGMA_STRUCT_ALIGN
895 #pragma options align=reset
896 #elif PRAGMA_STRUCT_PACKPUSH
897 #pragma pack(pop)
898 #elif PRAGMA_STRUCT_PACK
899 #pragma pack()
900 #endif
901
902
903 enum {
904 fsRtParID = 1,
905 fsRtDirID = 2
906 };
907
908
909
910 #if PRAGMA_STRUCT_ALIGN
911 #pragma options align=mac68k
912 #elif PRAGMA_STRUCT_PACKPUSH
913 #pragma pack(push, 2)
914 #elif PRAGMA_STRUCT_PACK
915 #pragma pack(2)
916 #endif
917
918
919 #if PRAGMA_STRUCT_ALIGN
920 #pragma options align=reset
921 #elif PRAGMA_STRUCT_PACKPUSH
922 #pragma pack(pop)
923 #elif PRAGMA_STRUCT_PACK
924 #pragma pack()
925 #endif
926
927
928 /*
929 * UTGetBlock options
930 */
931
932 enum {
933 gbDefault = 0, /* default value - read if not found */
934 /* bits and masks */
935 gbReadBit = 0, /* read block from disk (forced read) */
936 gbReadMask = 0x0001,
937 gbExistBit = 1, /* get existing cache block */
938 gbExistMask = 0x0002,
939 gbNoReadBit = 2, /* don't read block from disk if not found in cache */
940 gbNoReadMask = 0x0004,
941 gbReleaseBit = 3, /* release block immediately after GetBlock */
942 gbReleaseMask = 0x0008
943 };
944
945
946 /*
947 * UTReleaseBlock options
948 */
949
950 enum {
951 rbDefault = 0, /* default value - just mark the buffer not in-use */
952 /* bits and masks */
953 rbWriteBit = 0, /* force write buffer to disk */
954 rbWriteMask = 0x0001,
955 rbTrashBit = 1, /* trash buffer contents after release */
956 rbTrashMask = 0x0002,
957 rbDirtyBit = 2, /* mark buffer dirty */
958 rbDirtyMask = 0x0004,
959 rbFreeBit = 3, /* free the buffer (save in the hash) */
960 rbFreeMask = 0x000A /* rbFreeMask (rbFreeBit + rbTrashBit) works as rbTrash on < System 7.0 RamCache; on >= System 7.0, rbfreeMask overrides rbTrash */
961 };
962
963 /*
964 * UTFlushCache options
965 */
966
967 enum {
968 fcDefault = 0, /* default value - pass this fcOption to just flush any dirty buffers */
969 /* bits and masks */
970 fcTrashBit = 0, /* (don't pass this as fcOption, use only for testing bit) */
971 fcTrashMask = 0x0001, /* pass this fcOption value to flush and trash cache blocks */
972 fcFreeBit = 1, /* (don't pass this as fcOption, use only for testing bit) */
973 fcFreeMask = 0x0003 /* pass this fcOption to flush and free cache blocks (Note: both fcTrash and fcFree bits are set) */
974 };
975
976
977
978 /*
979 * FCBRec.fcbFlags bits
980 */
981
982 enum {
983 fcbWriteBit = 0, /* Data can be written to this file */
984 fcbWriteMask = 0x01,
985 fcbResourceBit = 1, /* This file is a resource fork */
986 fcbResourceMask = 0x02,
987 fcbWriteLockedBit = 2, /* File has a locked byte range */
988 fcbWriteLockedMask = 0x04,
989 fcbSharedWriteBit = 4, /* File is open for shared write access */
990 fcbSharedWriteMask = 0x10,
991 fcbFileLockedBit = 5, /* File is locked (write-protected) */
992 fcbFileLockedMask = 0x20,
993 fcbOwnClumpBit = 6, /* File has clump size specified in FCB */
994 fcbOwnClumpMask = 0x40,
995 fcbModifiedBit = 7, /* File has changed since it was last flushed */
996 fcbModifiedMask = 0x80
997 };
998
999
1000 /*
1001 File: TextCommon.h
1002
1003 */
1004
1005 /* LocaleIdentifier is an obsolete Copland typedef, will be removed soon*/
1006 typedef UInt32 LocaleIdentifier;
1007 /* TextEncodingBase type & values */
1008 /* (values 0-32 correspond to the Script Codes defined in Inside Macintosh: Text pages 6-52 and 6-53 */
1009 typedef UInt32 TextEncodingBase;
1010
1011 enum {
1012 /* Mac OS encodings*/
1013 kTextEncodingMacRoman = 0L,
1014 kTextEncodingMacJapanese = 1,
1015 kTextEncodingMacChineseTrad = 2,
1016 kTextEncodingMacKorean = 3,
1017 kTextEncodingMacArabic = 4,
1018 kTextEncodingMacHebrew = 5,
1019 kTextEncodingMacGreek = 6,
1020 kTextEncodingMacCyrillic = 7,
1021 kTextEncodingMacDevanagari = 9,
1022 kTextEncodingMacGurmukhi = 10,
1023 kTextEncodingMacGujarati = 11,
1024 kTextEncodingMacOriya = 12,
1025 kTextEncodingMacBengali = 13,
1026 kTextEncodingMacTamil = 14,
1027 kTextEncodingMacTelugu = 15,
1028 kTextEncodingMacKannada = 16,
1029 kTextEncodingMacMalayalam = 17,
1030 kTextEncodingMacSinhalese = 18,
1031 kTextEncodingMacBurmese = 19,
1032 kTextEncodingMacKhmer = 20,
1033 kTextEncodingMacThai = 21,
1034 kTextEncodingMacLaotian = 22,
1035 kTextEncodingMacGeorgian = 23,
1036 kTextEncodingMacArmenian = 24,
1037 kTextEncodingMacChineseSimp = 25,
1038 kTextEncodingMacTibetan = 26,
1039 kTextEncodingMacMongolian = 27,
1040 kTextEncodingMacEthiopic = 28,
1041 kTextEncodingMacCentralEurRoman = 29,
1042 kTextEncodingMacVietnamese = 30,
1043 kTextEncodingMacExtArabic = 31, /* The following use script code 0, smRoman*/
1044 kTextEncodingMacSymbol = 33,
1045 kTextEncodingMacDingbats = 34,
1046 kTextEncodingMacTurkish = 35,
1047 kTextEncodingMacCroatian = 36,
1048 kTextEncodingMacIcelandic = 37,
1049 kTextEncodingMacRomanian = 38,
1050 kTextEncodingMacUnicode = 0x7E,
1051 /* The following use script code 4, smArabic */
1052 kTextEncodingMacFarsi = 0x8C, /* Like MacArabic but uses Farsi digits */
1053 /* The following use script code 7, smCyrillic */
1054 kTextEncodingMacUkrainian = 0x98, /* The following use script code 32, smUnimplemented */
1055 kTextEncodingMacVT100 = 0xFC, /* VT100/102 font from Comm Toolbox: Latin-1 repertoire + box drawing etc*/
1056 /* Special Mac OS encodings*/
1057 kTextEncodingMacHFS = 0xFF, /* Meta-value, should never appear in a table.*/
1058 /* Unicode & ISO UCS encodings begin at 0x100*/
1059 kTextEncodingUnicodeDefault = 0x0100, /* Meta-value, should never appear in a table.*/
1060 kTextEncodingUnicodeV1_1 = 0x0101,
1061 kTextEncodingISO10646_1993 = 0x0101, /* Code points identical to Unicode 1.1*/
1062 kTextEncodingUnicodeV2_0 = 0x0103, /* New location for Korean Hangul*/
1063 /* ISO 8-bit and 7-bit encodings begin at 0x200*/
1064 kTextEncodingISOLatin1 = 0x0201, /* ISO 8859-1*/
1065 kTextEncodingISOLatin2 = 0x0202, /* ISO 8859-2*/
1066 kTextEncodingISOLatinCyrillic = 0x0205, /* ISO 8859-5*/
1067 kTextEncodingISOLatinArabic = 0x0206, /* ISO 8859-6, = ASMO 708, =DOS CP 708*/
1068 kTextEncodingISOLatinGreek = 0x0207, /* ISO 8859-7*/
1069 kTextEncodingISOLatinHebrew = 0x0208, /* ISO 8859-8*/
1070 kTextEncodingISOLatin5 = 0x0209, /* ISO 8859-9*/
1071 /* MS-DOS & Windows encodings begin at 0x400*/
1072 kTextEncodingDOSLatinUS = 0x0400, /* code page 437*/
1073 kTextEncodingDOSGreek = 0x0405, /* code page 737 (formerly code page 437G)*/
1074 kTextEncodingDOSBalticRim = 0x0406, /* code page 775*/
1075 kTextEncodingDOSLatin1 = 0x0410, /* code page 850, "Multilingual"*/
1076 kTextEncodingDOSGreek1 = 0x0411, /* code page 851*/
1077 kTextEncodingDOSLatin2 = 0x0412, /* code page 852, Slavic*/
1078 kTextEncodingDOSCyrillic = 0x0413, /* code page 855, IBM Cyrillic*/
1079 kTextEncodingDOSTurkish = 0x0414, /* code page 857, IBM Turkish*/
1080 kTextEncodingDOSPortuguese = 0x0415, /* code page 860*/
1081 kTextEncodingDOSIcelandic = 0x0416, /* code page 861*/
1082 kTextEncodingDOSHebrew = 0x0417, /* code page 862*/
1083 kTextEncodingDOSCanadianFrench = 0x0418, /* code page 863*/
1084 kTextEncodingDOSArabic = 0x0419, /* code page 864*/
1085 kTextEncodingDOSNordic = 0x041A, /* code page 865*/
1086 kTextEncodingDOSRussian = 0x041B, /* code page 866*/
1087 kTextEncodingDOSGreek2 = 0x041C, /* code page 869, IBM Modern Greek*/
1088 kTextEncodingDOSThai = 0x041D, /* code page 874, also for Windows*/
1089 kTextEncodingDOSJapanese = 0x0420, /* code page 932, also for Windows*/
1090 kTextEncodingDOSChineseSimplif = 0x0421, /* code page 936, also for Windows*/
1091 kTextEncodingDOSKorean = 0x0422, /* code page 949, also for Windows; Unified Hangul Code*/
1092 kTextEncodingDOSChineseTrad = 0x0423, /* code page 950, also for Windows*/
1093 kTextEncodingWindowsLatin1 = 0x0500, /* code page 1252*/
1094 kTextEncodingWindowsANSI = 0x0500, /* code page 1252 (alternate name)*/
1095 kTextEncodingWindowsLatin2 = 0x0501, /* code page 1250, Central Europe*/
1096 kTextEncodingWindowsCyrillic = 0x0502, /* code page 1251, Slavic Cyrillic*/
1097 kTextEncodingWindowsGreek = 0x0503, /* code page 1253*/
1098 kTextEncodingWindowsLatin5 = 0x0504, /* code page 1254, Turkish*/
1099 kTextEncodingWindowsHebrew = 0x0505, /* code page 1255*/
1100 kTextEncodingWindowsArabic = 0x0506, /* code page 1256*/
1101 kTextEncodingWindowsBalticRim = 0x0507, /* code page 1257*/
1102 kTextEncodingWindowsKoreanJohab = 0x0510, /* code page 1361, for Windows NT*/
1103 /* Various national standards begin at 0x600*/
1104 kTextEncodingUS_ASCII = 0x0600,
1105 kTextEncodingJIS_X0201_76 = 0x0620,
1106 kTextEncodingJIS_X0208_83 = 0x0621,
1107 kTextEncodingJIS_X0208_90 = 0x0622,
1108 kTextEncodingJIS_X0212_90 = 0x0623,
1109 kTextEncodingJIS_C6226_78 = 0x0624,
1110 kTextEncodingGB_2312_80 = 0x0630,
1111 kTextEncodingGBK_95 = 0x0631, /* annex to GB 13000-93; for Windows 95*/
1112 kTextEncodingKSC_5601_87 = 0x0640, /* same as KSC 5601-92 without Johab annex*/
1113 kTextEncodingKSC_5601_92_Johab = 0x0641, /* KSC 5601-92 Johab annex*/
1114 kTextEncodingCNS_11643_92_P1 = 0x0651, /* CNS 11643-1992 plane 1*/
1115 kTextEncodingCNS_11643_92_P2 = 0x0652, /* CNS 11643-1992 plane 2*/
1116 kTextEncodingCNS_11643_92_P3 = 0x0653, /* CNS 11643-1992 plane 3 (was plane 14 in 1986 version)*/
1117 /* ISO 2022 collections begin at 0x800*/
1118 kTextEncodingISO_2022_JP = 0x0820,
1119 kTextEncodingISO_2022_JP_2 = 0x0821,
1120 kTextEncodingISO_2022_CN = 0x0830,
1121 kTextEncodingISO_2022_CN_EXT = 0x0831,
1122 kTextEncodingISO_2022_KR = 0x0840, /* EUC collections begin at 0x900*/
1123 kTextEncodingEUC_JP = 0x0920, /* ISO 646, 1-byte katakana, JIS 208, JIS 212*/
1124 kTextEncodingEUC_CN = 0x0930, /* ISO 646, GB 2312-80*/
1125 kTextEncodingEUC_TW = 0x0931, /* ISO 646, CNS 11643-1992 Planes 1-16*/
1126 kTextEncodingEUC_KR = 0x0940, /* ISO 646, KS C 5601-1987*/
1127 /* Misc standards begin at 0xA00*/
1128 kTextEncodingShiftJIS = 0x0A01, /* plain Shift-JIS*/
1129 kTextEncodingKOI8_R = 0x0A02, /* Russian internet standard*/
1130 kTextEncodingBig5 = 0x0A03, /* Big-5 (has variants)*/
1131 kTextEncodingMacRomanLatin1 = 0x0A04, /* Mac OS Roman permuted to align with ISO Latin-1*/
1132 kTextEncodingHZ_GB_2312 = 0x0A05, /* HZ (RFC 1842, for Chinese mail & news)*/
1133 /* Other platform encodings*/
1134 kTextEncodingNextStepLatin = 0x0B01, /* NextStep encoding*/
1135 /* EBCDIC & IBM host encodings begin at 0xC00*/
1136 kTextEncodingEBCDIC_US = 0x0C01, /* basic EBCDIC-US*/
1137 kTextEncodingEBCDIC_CP037 = 0x0C02, /* code page 037, extended EBCDIC (Latin-1 set) for US,Canada...*/
1138 /* Special value*/
1139 kTextEncodingMultiRun = 0x0FFF, /* Multi-encoding text with external run info*/
1140 /* The following are older names for backward compatibility*/
1141 kTextEncodingMacTradChinese = 2,
1142 kTextEncodingMacRSymbol = 8,
1143 kTextEncodingMacSimpChinese = 25,
1144 kTextEncodingMacGeez = 28,
1145 kTextEncodingMacEastEurRoman = 29,
1146 kTextEncodingMacUninterp = 32
1147 };
1148
1149 /* TextEncodingVariant type & values */
1150 typedef UInt32 TextEncodingVariant;
1151
1152 enum {
1153 /* Default TextEncodingVariant, for any TextEncodingBase*/
1154 kTextEncodingDefaultVariant = 0, /* Variants of kTextEncodingMacIcelandic */
1155 kMacIcelandicStandardVariant = 0, /* 0xBB & 0xBC are fem./masc. ordinal indicators*/
1156 kMacIcelandicTrueTypeVariant = 1, /* 0xBB & 0xBC are fi/fl ligatures*/
1157 /* Variants of kTextEncodingMacJapanese*/
1158 kMacJapaneseStandardVariant = 0,
1159 kMacJapaneseStdNoVerticalsVariant = 1,
1160 kMacJapaneseBasicVariant = 2,
1161 kMacJapanesePostScriptScrnVariant = 3,
1162 kMacJapanesePostScriptPrintVariant = 4,
1163 kMacJapaneseVertAtKuPlusTenVariant = 5, /* Variant options for most Japanese encodings (MacJapanese, ShiftJIS, EUC-JP, ISO 2022-JP) */
1164 /* These can be OR-ed into the variant value in any combination*/
1165 kJapaneseNoOneByteKanaOption = 0x20,
1166 kJapaneseUseAsciiBackslashOption = 0x40, /* Variants of kTextEncodingMacArabic*/
1167 kMacArabicStandardVariant = 0, /* 0xC0 is 8-spoke asterisk, 0x2A & 0xAA are asterisk (e.g. Cairo)*/
1168 kMacArabicTrueTypeVariant = 1, /* 0xC0 is asterisk, 0x2A & 0xAA are multiply signs (e.g. Baghdad)*/
1169 kMacArabicThuluthVariant = 2, /* 0xC0 is Arabic five-point star, 0x2A & 0xAA are multiply signs*/
1170 kMacArabicAlBayanVariant = 3, /* 8-spoke asterisk, multiply sign, Koranic ligatures & parens*/
1171 /* Variants of kTextEncodingMacFarsi*/
1172 kMacFarsiStandardVariant = 0, /* 0xC0 is 8-spoke asterisk, 0x2A & 0xAA are asterisk (e.g. Tehran)*/
1173 kMacFarsiTrueTypeVariant = 1, /* asterisk, multiply signs, Koranic ligatures, geometric shapes*/
1174 /* Variants of kTextEncodingMacHebrew*/
1175 kMacHebrewStandardVariant = 0,
1176 kMacHebrewFigureSpaceVariant = 1, /* Variants of Unicode & ISO 10646 encodings*/
1177 kUnicodeNoSubset = 0,
1178 kUnicodeNoCompatibilityVariant = 1,
1179 kUnicodeMaxDecomposedVariant = 2,
1180 kUnicodeNoComposedVariant = 3,
1181 kUnicodeNoCorporateVariant = 4, /* Variants of Big-5 encoding*/
1182 kBig5_BasicVariant = 0,
1183 kBig5_StandardVariant = 1, /* 0xC6A1-0xC7FC: kana, Cyrillic, enclosed numerics*/
1184 kBig5_ETenVariant = 2, /* adds kana, Cyrillic, radicals, etc with hi bytes C6-C8,F9*/
1185 /* The following are older names for backward compatibility*/
1186 kJapaneseStandardVariant = 0,
1187 kJapaneseStdNoVerticalsVariant = 1,
1188 kJapaneseBasicVariant = 2,
1189 kJapanesePostScriptScrnVariant = 3,
1190 kJapanesePostScriptPrintVariant = 4,
1191 kJapaneseVertAtKuPlusTenVariant = 5, /* kJapaneseStdNoOneByteKanaVariant = 6, // replaced by kJapaneseNoOneByteKanaOption*/
1192 /* kJapaneseBasicNoOneByteKanaVariant = 7, // replaced by kJapaneseNoOneByteKanaOption */
1193 kHebrewStandardVariant = 0,
1194 kHebrewFigureSpaceVariant = 1
1195 };
1196
1197 /* TextEncodingFormat type & values */
1198 typedef UInt32 TextEncodingFormat;
1199
1200 enum {
1201 /* Default TextEncodingFormat for any TextEncodingBase*/
1202 kTextEncodingDefaultFormat = 0, /* Formats for Unicode & ISO 10646*/
1203 kUnicode16BitFormat = 0,
1204 kUnicodeUTF7Format = 1,
1205 kUnicodeUTF8Format = 2,
1206 kUnicode32BitFormat = 3
1207 };
1208
1209 /* TextEncoding type */
1210 typedef UInt32 TextEncoding;
1211 /* name part selector for GetTextEncodingName*/
1212 typedef UInt32 TextEncodingNameSelector;
1213
1214 enum {
1215 kTextEncodingFullName = 0,
1216 kTextEncodingBaseName = 1,
1217 kTextEncodingVariantName = 2,
1218 kTextEncodingFormatName = 3
1219 };
1220
1221 /* Types used in conversion */
1222 struct TextEncodingRun {
1223 ByteOffset offset;
1224 TextEncoding textEncoding;
1225 };
1226 typedef struct TextEncodingRun TextEncodingRun;
1227
1228 typedef TextEncodingRun * TextEncodingRunPtr;
1229 typedef const TextEncodingRun * ConstTextEncodingRunPtr;
1230 struct ScriptCodeRun {
1231 ByteOffset offset;
1232 ScriptCode script;
1233 };
1234 typedef struct ScriptCodeRun ScriptCodeRun;
1235
1236 typedef ScriptCodeRun * ScriptCodeRunPtr;
1237 typedef const ScriptCodeRun * ConstScriptCodeRunPtr;
1238 typedef UInt8 * TextPtr;
1239 typedef const UInt8 * ConstTextPtr;
1240 /* Basic types for Unicode characters and strings: */
1241 typedef UniChar * UniCharArrayPtr;
1242 typedef const UniChar * ConstUniCharArrayPtr;
1243 /* enums for TextEncoding Conversion routines*/
1244
1245 enum {
1246 kTextScriptDontCare = -128,
1247 kTextLanguageDontCare = -128,
1248 kTextRegionDontCare = -128
1249 };
1250
1251
1252
1253 /*
1254 File: UnicodeConverter.h
1255
1256
1257 */
1258
1259 /* Unicode conversion contexts: */
1260 typedef struct OpaqueTextToUnicodeInfo* TextToUnicodeInfo;
1261 typedef struct OpaqueUnicodeToTextInfo* UnicodeToTextInfo;
1262 typedef struct OpaqueUnicodeToTextRunInfo* UnicodeToTextRunInfo;
1263 typedef const TextToUnicodeInfo ConstTextToUnicodeInfo;
1264 typedef const UnicodeToTextInfo ConstUnicodeToTextInfo;
1265 /* UnicodeMapVersion type & values */
1266 typedef SInt32 UnicodeMapVersion;
1267
1268 enum {
1269 kUnicodeUseLatestMapping = -1,
1270 kUnicodeUseHFSPlusMapping = 4
1271 };
1272
1273 /* Types used in conversion */
1274 struct UnicodeMapping {
1275 TextEncoding unicodeEncoding;
1276 TextEncoding otherEncoding;
1277 UnicodeMapVersion mappingVersion;
1278 };
1279 typedef struct UnicodeMapping UnicodeMapping;
1280
1281 typedef UnicodeMapping * UnicodeMappingPtr;
1282 typedef const UnicodeMapping * ConstUnicodeMappingPtr;
1283 /* Control flags for ConvertFromUnicodeToText and ConvertFromTextToUnicode */
1284
1285 enum {
1286 kUnicodeUseFallbacksBit = 0,
1287 kUnicodeKeepInfoBit = 1,
1288 kUnicodeDirectionalityBits = 2,
1289 kUnicodeVerticalFormBit = 4,
1290 kUnicodeLooseMappingsBit = 5,
1291 kUnicodeStringUnterminatedBit = 6,
1292 kUnicodeTextRunBit = 7,
1293 kUnicodeKeepSameEncodingBit = 8
1294 };
1295
1296
1297 enum {
1298 kUnicodeUseFallbacksMask = 1L << kUnicodeUseFallbacksBit,
1299 kUnicodeKeepInfoMask = 1L << kUnicodeKeepInfoBit,
1300 kUnicodeDirectionalityMask = 3L << kUnicodeDirectionalityBits,
1301 kUnicodeVerticalFormMask = 1L << kUnicodeVerticalFormBit,
1302 kUnicodeLooseMappingsMask = 1L << kUnicodeLooseMappingsBit,
1303 kUnicodeStringUnterminatedMask = 1L << kUnicodeStringUnterminatedBit,
1304 kUnicodeTextRunMask = 1L << kUnicodeTextRunBit,
1305 kUnicodeKeepSameEncodingMask = 1L << kUnicodeKeepSameEncodingBit
1306 };
1307
1308 /* Values for kUnicodeDirectionality field */
1309
1310 enum {
1311 kUnicodeDefaultDirection = 0,
1312 kUnicodeLeftToRight = 1,
1313 kUnicodeRightToLeft = 2
1314 };
1315
1316 /* Directionality masks for control flags */
1317
1318 enum {
1319 kUnicodeDefaultDirectionMask = kUnicodeDefaultDirection << kUnicodeDirectionalityBits,
1320 kUnicodeLeftToRightMask = kUnicodeLeftToRight << kUnicodeDirectionalityBits,
1321 kUnicodeRightToLeftMask = kUnicodeRightToLeft << kUnicodeDirectionalityBits
1322 };
1323
1324 /* Control flags for TruncateForUnicodeToText: */
1325 /*
1326 Now TruncateForUnicodeToText uses control flags from the same set as used by
1327 ConvertFromTextToUnicode, ConvertFromUnicodeToText, etc., but only
1328 kUnicodeStringUnterminatedMask is meaningful for TruncateForUnicodeToText.
1329
1330 Previously two special control flags were defined for TruncateForUnicodeToText:
1331 kUnicodeTextElementSafeBit = 0
1332 kUnicodeRestartSafeBit = 1
1333 However, neither of these was implemented.
1334 Instead of implementing kUnicodeTextElementSafeBit, we now use
1335 kUnicodeStringUnterminatedMask since it accomplishes the same thing and avoids
1336 having special flags just for TruncateForUnicodeToText
1337 Also, kUnicodeRestartSafeBit is unnecessary, since restart-safeness is handled by
1338 setting kUnicodeKeepInfoBit with ConvertFromUnicodeToText.
1339 If TruncateForUnicodeToText is called with one or both of the old special control
1340 flags set (bits 0 or 1), it will not generate a paramErr, but the old bits have no
1341 effect on its operation.
1342 */
1343
1344 /* Filter bits for filter field in QueryUnicodeMappings and CountUnicodeMappings: */
1345
1346 enum {
1347 kUnicodeMatchUnicodeBaseBit = 0,
1348 kUnicodeMatchUnicodeVariantBit = 1,
1349 kUnicodeMatchUnicodeFormatBit = 2,
1350 kUnicodeMatchOtherBaseBit = 3,
1351 kUnicodeMatchOtherVariantBit = 4,
1352 kUnicodeMatchOtherFormatBit = 5
1353 };
1354
1355
1356 enum {
1357 kUnicodeMatchUnicodeBaseMask = 1L << kUnicodeMatchUnicodeBaseBit,
1358 kUnicodeMatchUnicodeVariantMask = 1L << kUnicodeMatchUnicodeVariantBit,
1359 kUnicodeMatchUnicodeFormatMask = 1L << kUnicodeMatchUnicodeFormatBit,
1360 kUnicodeMatchOtherBaseMask = 1L << kUnicodeMatchOtherBaseBit,
1361 kUnicodeMatchOtherVariantMask = 1L << kUnicodeMatchOtherVariantBit,
1362 kUnicodeMatchOtherFormatMask = 1L << kUnicodeMatchOtherFormatBit
1363 };
1364
1365 /* Control flags for SetFallbackUnicodeToText */
1366
1367 enum {
1368 kUnicodeFallbackSequencingBits = 0
1369 };
1370
1371
1372 enum {
1373 kUnicodeFallbackSequencingMask = 3L << kUnicodeFallbackSequencingBits
1374 };
1375
1376 /* values for kUnicodeFallbackSequencing field */
1377
1378 enum {
1379 kUnicodeFallbackDefaultOnly = 0L,
1380 kUnicodeFallbackCustomOnly = 1L,
1381 kUnicodeFallbackDefaultFirst = 2L,
1382 kUnicodeFallbackCustomFirst = 3L
1383 };
1384
1385
1386
1387 /*
1388 File: Timer.h
1389
1390
1391 */
1392
1393
1394 enum {
1395 /* high bit of qType is set if task is active */
1396 kTMTaskActive = (1L << 15)
1397 };
1398
1399 typedef struct TMTask TMTask;
1400 typedef TMTask * TMTaskPtr;
1401 typedef CALLBACK_API( void , TimerProcPtr )(TMTaskPtr tmTaskPtr);
1402 /*
1403 WARNING: TimerProcPtr uses register based parameters under classic 68k
1404 and cannot be written in a high-level language without
1405 the help of mixed mode or assembly glue.
1406 */
1407 typedef REGISTER_UPP_TYPE(TimerProcPtr) TimerUPP;
1408 struct TMTask {
1409 QElemPtr qLink;
1410 short qType;
1411 TimerUPP tmAddr;
1412 long tmCount;
1413 long tmWakeUp;
1414 long tmReserved;
1415 };
1416
1417
1418 /*
1419 File: TextCommonPriv.h
1420
1421
1422 */
1423
1424
1425 /*
1426 -----------------------------------------------------------------------------------------------------------
1427 TextEncoding creation & extraction macros.
1428 Current packed format:
1429 31 30 29 26 25 16 15 0
1430 |pack| format | variant | base |
1431 |vers| | | |
1432 |2bit| 4 bits | 10 bits | 16 bits |
1433 Unpacked elements
1434 base 15 0
1435 | 0 | 16 bits |
1436 variant 9 0
1437 | 0 | 10 bits |
1438 format 3 0
1439 | 0 | 4 bits |
1440 -----------------------------------------------------------------------------------------------------------
1441 */
1442
1443 enum {
1444 kTextEncodingVersion = 0
1445 };
1446
1447
1448 enum {
1449 kTextEncodingBaseShiftBits = 0, /* <13>*/
1450 kTextEncodingVariantShiftBits = 16, /* <13>*/
1451 kTextEncodingFormatShiftBits = 26, /* <13><16>*/
1452 kTextEncodingVersionShiftBits = 30
1453 };
1454
1455
1456
1457 enum {
1458 kTextEncodingBaseSourceMask = 0x0000FFFF, /* 16 bits <13>*/
1459 kTextEncodingVariantSourceMask = 0x000003FF, /* 10 bits <13><16>*/
1460 kTextEncodingFormatSourceMask = 0x0000000F, /* 4 bits <13><16>*/
1461 kTextEncodingVersionSourceMask = 0x00000003 /* 2 bits*/
1462 };
1463
1464
1465 enum {
1466 kTextEncodingBaseMask = kTextEncodingBaseSourceMask << kTextEncodingBaseShiftBits,
1467 kTextEncodingVariantMask = kTextEncodingVariantSourceMask << kTextEncodingVariantShiftBits,
1468 kTextEncodingFormatMask = kTextEncodingFormatSourceMask << kTextEncodingFormatShiftBits,
1469 kTextEncodingVersionMask = kTextEncodingVersionSourceMask << kTextEncodingVersionShiftBits
1470 };
1471
1472
1473 enum {
1474 kTextEncodingVersionShifted = (kTextEncodingVersion & kTextEncodingVersionSourceMask) << kTextEncodingVersionShiftBits
1475 };
1476
1477
1478 #define CreateTextEncodingPriv(base,variant,format) \
1479 ( ((base & kTextEncodingBaseSourceMask) << kTextEncodingBaseShiftBits) \
1480 | ((variant & kTextEncodingVariantSourceMask) << kTextEncodingVariantShiftBits) \
1481 | ((format & kTextEncodingFormatSourceMask) << kTextEncodingFormatShiftBits) \
1482 | (kTextEncodingVersionShifted) )
1483 #define GetTextEncodingBasePriv(encoding) \
1484 ((encoding & kTextEncodingBaseMask) >> kTextEncodingBaseShiftBits)
1485 #define GetTextEncodingVariantPriv(encoding) \
1486 ((encoding & kTextEncodingVariantMask) >> kTextEncodingVariantShiftBits)
1487 #define GetTextEncodingFormatPriv(encoding) \
1488 ((encoding & kTextEncodingFormatMask) >> kTextEncodingFormatShiftBits)
1489 #define IsMacTextEncoding(encoding) ((encoding & 0x0000FF00L) == 0x00000000L)
1490 #define IsUnicodeTextEncoding(encoding) ((encoding & 0x0000FF00L) == 0x00000100L)
1491 /* TextEncoding used by HFS*/
1492
1493 enum {
1494 kMacHFSTextEncoding = 0x000000FF
1495 };
1496
1497
1498 /*
1499 File: Instrumentation.h
1500
1501
1502 */
1503 /*******************************************************************/
1504 /* Types */
1505 /*******************************************************************/
1506 /* Reference to an instrumentation class */
1507 typedef struct InstOpaqueClassRef* InstClassRef;
1508
1509 /* Aliases to the generic instrumentation class for each type of class */
1510 typedef InstClassRef InstPathClassRef;
1511 typedef InstClassRef InstTraceClassRef;
1512 typedef InstClassRef InstHistogramClassRef;
1513 typedef InstClassRef InstSplitHistogramClassRef;
1514 typedef InstClassRef InstMagnitudeClassRef;
1515 typedef InstClassRef InstGrowthClassRef;
1516 typedef InstClassRef InstTallyClassRef;
1517
1518 /* Reference to a data descriptor */
1519 typedef struct InstOpaqueDataDescriptorRef* InstDataDescriptorRef;
1520
1521
1522 /*******************************************************************/
1523 /* Constant Definitions */
1524 /*******************************************************************/
1525
1526 /* Reference to the root of the class hierarchy */
1527 #define kInstRootClassRef ( (InstClassRef) -1)
1528
1529 /* Options used for creating classes */
1530 typedef OptionBits InstClassOptions;
1531
1532
1533 enum {
1534 kInstDisableClassMask = 0x00, /* Create the class disabled */
1535 kInstEnableClassMask = 0x01, /* Create the class enabled */
1536
1537 kInstSummaryTraceClassMask = 0x20 /* Create a summary trace class instead of a regular one */
1538 };
1539
1540
1541
1542 EXTERN_API( Boolean )
1543 EqualString (ConstStr255Param str1,
1544 ConstStr255Param str2,
1545 Boolean caseSensitive,
1546 Boolean diacSensitive);
1547
1548
1549
1550
1551 /*
1552 File: LowMemPriv.h
1553
1554
1555 */
1556
1557
1558 EXTERN_API( void )
1559 InsTime (QElemPtr tmTaskPtr);
1560 EXTERN_API( void )
1561 PrimeTime (QElemPtr tmTaskPtr,
1562 long count);
1563 EXTERN_API( void )
1564 RmvTime (QElemPtr tmTaskPtr);
1565
1566
1567
1568
1569 /* PROTOTYPES */
1570
1571 #if HFS_DIAGNOSTIC
1572 extern void RequireFileLock(FileReference vp, int shareable);
1573 #define REQUIRE_FILE_LOCK(vp,s) RequireFileLock((vp),(s))
1574 #else
1575 #define REQUIRE_FILE_LOCK(vp,s)
1576 #endif
1577
1578
1579 EXTERN_API( void )
1580 BlockMove (const void * srcPtr,
1581 void * destPtr,
1582 Size byteCount);
1583 EXTERN_API( void )
1584 BlockMoveData (const void * srcPtr,
1585 void * destPtr,
1586 Size byteCount);
1587
1588 EXTERN_API_C( void )
1589 BlockMoveUncached (const void * srcPtr,
1590 void * destPtr,
1591 Size byteCount);
1592
1593 EXTERN_API_C( void )
1594 BlockMoveDataUncached (const void * srcPtr,
1595 void * destPtr,
1596 Size byteCount);
1597
1598 EXTERN_API_C( void )
1599 BlockZero (void * destPtr,
1600 Size byteCount);
1601
1602 EXTERN_API_C( void )
1603 BlockZeroUncached (void * destPtr,
1604 Size byteCount);
1605
1606 EXTERN_API( Ptr )
1607 NewPtr (Size byteCount);
1608
1609 EXTERN_API( Ptr )
1610 NewPtrSys (Size byteCount);
1611
1612 EXTERN_API( Ptr )
1613 NewPtrClear (Size byteCount);
1614
1615 EXTERN_API( Ptr )
1616 NewPtrSysClear (Size byteCount);
1617
1618 EXTERN_API( OSErr )
1619 MemError (void);
1620
1621 EXTERN_API( void )
1622 DisposePtr (Ptr p);
1623
1624 EXTERN_API( Size )
1625 GetPtrSize (Ptr p);
1626
1627 EXTERN_API( void )
1628 SetPtrSize (Ptr p,
1629 Size newSize);
1630
1631 EXTERN_API( void )
1632 DisposeHandle (Handle h);
1633
1634 EXTERN_API( void )
1635 SetHandleSize (Handle h,
1636 Size newSize);
1637
1638 /*
1639 File: DateTimeUtils.h
1640
1641
1642 */
1643 EXTERN_API( void )
1644 GetDateTime (unsigned long * secs);
1645
1646
1647
1648 #endif /* __hfs_macos_types__ */