]> git.saurik.com Git - apple/xnu.git/blame - bsd/hfs/hfs_macos_defs.h
xnu-201.19.3.tar.gz
[apple/xnu.git] / bsd / hfs / hfs_macos_defs.h
CommitLineData
1c79356b
A
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
1c79356b
A
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*********************************************************************************/
217typedef u_int8_t UInt8;
218typedef int8_t SInt8;
219typedef u_int16_t UInt16;
220typedef int16_t SInt16;
221typedef u_int32_t UInt32;
222typedef int32_t SInt32;
223typedef u_int64_t UInt64;
224typedef 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*********************************************************************************/
245typedef float Float32;
246typedef double Float64;
247
248struct Float80 {
249 SInt16 exp;
250 UInt16 man[4];
251};
252typedef struct Float80 Float80;
253
254struct Float96 {
255 SInt16 exp[2]; /* the second 16-bits is always zero */
256 UInt16 man[4];
257};
258typedef 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*********************************************************************************/
271typedef char * Ptr;
272typedef Ptr * Handle;
273typedef 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*********************************************************************************/
299typedef SInt16 OSErr;
300typedef SInt32 OSStatus;
301typedef void * LogicalAddress;
302typedef const void * ConstLogicalAddress;
303typedef void * PhysicalAddress;
304typedef UInt8 * BytePtr;
305typedef UInt32 ByteCount;
306typedef UInt32 ByteOffset;
307typedef SInt32 Duration;
308typedef UInt64 AbsoluteTime;
309typedef UInt32 OptionBits;
310typedef UInt32 ItemCount;
311typedef UInt32 PBVersion;
312typedef SInt16 ScriptCode;
313typedef SInt16 LangCode;
314typedef SInt16 RegionCode;
315typedef unsigned long FourCharCode;
316typedef FourCharCode OSType;
317typedef FourCharCode ResType;
318typedef OSType * OSTypePtr;
319typedef 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
339enum {
340 false = 0,
341 true = 1
342};
343
344#endif /* !TYPE_BOOL */
345
346typedef 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*********************************************************************************/
361typedef long (*ProcPtr)();
362typedef void (*Register68kProcPtr)();
363
364typedef ProcPtr UniversalProcPtr;
365
366typedef ProcPtr * ProcHandle;
367typedef 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*********************************************************************************/
385struct Point {
386 short v;
387 short h;
388};
389typedef struct Point Point;
390
391typedef Point * PointPtr;
392struct Rect {
393 short top;
394 short left;
395 short bottom;
396 short right;
397};
398typedef struct Rect Rect;
399
400typedef Rect * RectPtr;
401typedef short CharParameter;
402
403enum {
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
414typedef unsigned char Style;
415typedef short StyleParameter;
416typedef 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
441enum {
442 noErr = 0
443};
444
445
446enum {
447 kNilOptions = 0
448};
449
450#define kInvalidID 0
451
452enum {
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*********************************************************************************/
482typedef UInt16 UniChar;
483typedef unsigned char Str255[256];
484typedef unsigned char Str63[64];
485typedef unsigned char Str32[33];
486typedef unsigned char Str31[32];
487typedef unsigned char Str27[28];
488typedef 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*/
497typedef unsigned char Str32Field[34];
498typedef unsigned char * StringPtr;
499typedef StringPtr * StringHandle;
500typedef const unsigned char * ConstStr255Param;
501typedef const unsigned char * ConstStr63Param;
502typedef const unsigned char * ConstStr32Param;
503typedef const unsigned char * ConstStr31Param;
504typedef const unsigned char * ConstStr27Param;
505typedef const unsigned char * ConstStr15Param;
506#ifdef __cplusplus
507inline unsigned char StrLength(ConstStr255Param string) { return (*string); }
508#else
509#define StrLength(string) (*(unsigned char *)(string))
510#endif /* defined(__cplusplus) */
511
512typedef const unsigned char * ConstUTF8Param;
513
514/*********************************************************************************
515
516 Old names for types
517
518*********************************************************************************/
519typedef UInt8 Byte;
520typedef SInt8 SignedByte;
521typedef SInt64 * WidePtr;
522typedef UInt64 * UnsignedWidePtr;
523typedef Float80 extended80;
524typedef Float96 extended96;
525typedef SInt8 VHSelect;
526
527
528EXTERN_API( void )
529DebugStr (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*/
576enum {
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
599enum { /* 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
616enum {
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
640enum {
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
663enum {
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
677enum {
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
704enum {
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 */
757typedef unsigned short CallingConventionType;
758
759enum {
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*/
779typedef struct QElem QElem;
780
781typedef QElem * QElemPtr;
782struct QHdr {
783 short qFlags;
784 QElemPtr qHead;
785 QElemPtr qTail;
786};
787typedef struct QHdr QHdr;
788
789typedef QHdr * QHdrPtr;
790
791typedef 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*/
797typedef REGISTER_UPP_TYPE(DeferredTaskProcPtr) DeferredTaskUPP;
798enum { 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))
801struct DeferredTask {
802 QElemPtr qLink;
803 short qType;
804 short dtFlags;
805 DeferredTaskUPP dtAddr;
806 long dtParam;
807 long dtReserved;
808};
809typedef struct DeferredTask DeferredTask;
810
811typedef DeferredTask * DeferredTaskPtr;
812
813/*
814 File: Finder.h
815
816
817*/
818
819/*
820