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