|
|
1.1 root 1: /*
2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7: * Reserved. This file contains Original Code and/or Modifications of
8: * Original Code as defined in and that are subject to the Apple Public
9: * Source License Version 1.1 (the "License"). You may not use this file
10: * except in compliance with the License. Please obtain a copy of the
11: * License at http://www.apple.com/publicsource and read it before using
12: * this file.
13: *
14: * The Original Code and all software distributed under the License are
15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19: * License for the specific language governing rights and limitations
20: * under the License.
21: *
22: * @APPLE_LICENSE_HEADER_END@
23: */
24:
25: /*
26: File: MacOSStubs.h
27:
28: Contains: Definitions and routines from MacOS
29:
30: Version: Rhapsody (Titan)
31:
32: DRI: Scott Roberts
33:
34: Copyright: � 1995-1998 by Apple Computer, Inc., all rights reserved.
35:
36: Warning: *** APPLE INTERNAL USE ONLY ***
37: This file may contain unreleased API's
38:
39: BuildInfo: Built by: Scott Roberts
40:
41: Bugs: Report bugs to Radar component
42: List the version information (from above) in the Problem Description.
43:
44: HISTORY
45: 4/11/1998 Don Brady Add RequireFileLock prototype.
46: 4/1/1998 Don Brady Get rid of gHFSFlags, gReqstVol and gFlushOnlyFlag globals (not used).
47: */
48:
49: #ifndef __MACOSSTUBS__
50: #define __MACOSSTUBS__
51:
52: #if TARGET_OS_RHAPSODY
53: #include <sys/time.h>
54: #include <sys/param.h>
55: #include <sys/proc.h>
56: #ifdef KERNEL
57: #include <libkern/libkern.h>
58: #include <sys/systm.h>
59: #endif /* KERNEL */
60: #endif /* TARGET_OS_RHAPSODY */
61:
62: #ifndef __MACOSTYPES__
63: #include "MacOSTypes.h"
64: #endif
65:
66: /*
67: SizeTDef.h -- Common definitions
68:
69: size_t - this type is defined by several ANSI headers.
70: */
71: #if ! defined (__size_t__)
72: #define __size_t__
73: #if defined (__xlc) || defined (__xlC) || defined (__xlC__) || defined (__MWERKS__)
74: typedef unsigned long size_t;
75: #else /* __xlC */
76: typedef unsigned int size_t;
77: #endif /* __xlC */
78: #endif /* __size_t__ */
79:
80:
81:
82: /*
83: StdDef.h -- Common definitions
84:
85: */
86:
87: #define offsetof(structure,field) ((size_t)&((structure *) 0)->field)
88:
89:
90: /************************************************************
91:
92: String.h
93: String handling
94:
95: ************************************************************/
96:
97:
98: //int memcmp (const void *s1, const void *s2, size_t n);
99:
100:
101:
102: /*
103: File: Math64.h
104:
105: */
106:
107: /*
108: Functions to convert between [Unsigned]Wide and [S|U]Int64 types.
109:
110: These functions are necessary if source code which uses both
111: wide and SInt64 is to compile under a compiler that supports
112: long long.
113: */
114: #if TYPE_LONGLONG
115: #define SInt64ToWide(x) (*((wide*)(&x)))
116: #define WideToSInt64(x) (*((SInt64*)(&x)))
117: #define UInt64ToUnsignedWide(x) (*((UnsignedWide*)(&x)))
118: #define UnsignedWideToUInt64(x) (*((UInt64*)(&x)))
119: #else
120: #define SInt64ToWide(x) (x)
121: #define WideToSInt64(x) (x)
122: #define UInt64ToUnsignedWide(x) (x)
123: #define UnsignedWideToUInt64(x) (x)
124: #endif
125:
126:
127:
128: /*
129: File: Errors.h
130:
131: */
132: enum {
133: paramErr = -50, /*error in user parameter list*/
134: noHardwareErr = -200, /*Sound Manager Error Returns*/
135: notEnoughHardwareErr = -201, /*Sound Manager Error Returns*/
136: userCanceledErr = -128,
137: qErr = -1, /*queue element not found during deletion*/
138: vTypErr = -2, /*invalid queue element*/
139: corErr = -3, /*core routine number out of range*/
140: unimpErr = -4, /*unimplemented core routine*/
141: SlpTypeErr = -5, /*invalid queue element*/
142: seNoDB = -8, /*no debugger installed to handle debugger command*/
143: controlErr = -17, /*I/O System Errors*/
144: statusErr = -18, /*I/O System Errors*/
145: readErr = -19, /*I/O System Errors*/
146: writErr = -20, /*I/O System Errors*/
147: badUnitErr = -21, /*I/O System Errors*/
148: unitEmptyErr = -22, /*I/O System Errors*/
149: openErr = -23, /*I/O System Errors*/
150: closErr = -24, /*I/O System Errors*/
151: dRemovErr = -25, /*tried to remove an open driver*/
152: dInstErr = -26 /*DrvrInstall couldn't find driver in resources*/
153: };
154:
155: enum { /* Printing Errors */
156: iMemFullErr = -108,
157: iIOAbort = -27, /*Scrap Manager errors*/
158: noScrapErr = -100, /*No scrap exists error*/
159: noTypeErr = -102, /*No object of that type in scrap*/
160: memROZWarn = -99, /*soft error in ROZ*/
161: memROZError = -99, /*hard error in ROZ*/
162: memROZErr = -99, /*hard error in ROZ*/
163: memFullErr = -108, /*Not enough room in heap zone*/
164: nilHandleErr = -109, /*Master Pointer was NIL in HandleZone or other*/
165: memWZErr = -111, /*WhichZone failed (applied to free block)*/
166: memPurErr = -112, /*trying to purge a locked or non-purgeable block*/
167: memAdrErr = -110 /*address was odd; or out of range*/
168: };
169:
170:
171:
172: enum {
173: abortErr = -27, /*IO call aborted by KillIO*/
174: iIOAbortErr = -27, /*IO abort error (Printing Manager)*/
175: notOpenErr = -28, /*Couldn't rd/wr/ctl/sts cause driver not opened*/
176: unitTblFullErr = -29, /*unit table has no more entries*/
177: dceExtErr = -30, /*dce extension error*/
178: slotNumErr = -360, /*invalid slot # error*/
179: gcrOnMFMErr = -400, /*gcr format on high density media error*/
180: dirFulErr = -33, /*Directory full*/
181: dskFulErr = -34, /*disk full*/
182: nsvErr = -35, /*no such volume*/
183: ioErr = -36, /*I/O error (bummers)*/
184: bdNamErr = -37, /*there may be no bad names in the final system!*/
185: fnOpnErr = -38, /*File not open*/
186: eofErr = -39, /*End of file*/
187: posErr = -40, /*tried to position to before start of file (r/w)*/
188: mFulErr = -41, /*memory full (open) or file won't fit (load)*/
189: tmfoErr = -42, /*too many files open*/
190: fnfErr = -43, /*File not found*/
191: wPrErr = -44, /*diskette is write protected.*/
192: fLckdErr = -45 /*file is locked*/
193: };
194:
195:
196: enum {
197: vLckdErr = -46, /*volume is locked*/
198: fBsyErr = -47, /*File is busy (delete)*/
199: dupFNErr = -48, /*duplicate filename (rename)*/
200: opWrErr = -49, /*file already open with with write permission*/
201: rfNumErr = -51, /*refnum error*/
202: gfpErr = -52, /*get file position error*/
203: volOffLinErr = -53, /*volume not on line error (was Ejected)*/
204: permErr = -54, /*permissions error (on file open)*/
205: volOnLinErr = -55, /*drive volume already on-line at MountVol*/
206: nsDrvErr = -56, /*no such drive (tried to mount a bad drive num)*/
207: noMacDskErr = -57, /*not a mac diskette (sig bytes are wrong)*/
208: extFSErr = -58, /*volume in question belongs to an external fs*/
209: fsRnErr = -59, /*file system internal error:during rename the old entry was deleted but could not be restored.*/
210: badMDBErr = -60, /*bad master directory block*/
211: wrPermErr = -61, /*write permissions error*/
212: dirNFErr = -120, /*Directory not found*/
213: tmwdoErr = -121, /*No free WDCB available*/
214: badMovErr = -122, /*Move into offspring error*/
215: wrgVolTypErr = -123, /*Wrong volume type error [operation not supported for MFS]*/
216: volGoneErr = -124 /*Server volume has been disconnected.*/
217: };
218:
219: enum {
220: /*Dictionary Manager errors*/
221: notBTree = -410, /*The file is not a dictionary.*/
222: btNoSpace = -413, /*Can't allocate disk space.*/
223: btDupRecErr = -414, /*Record already exists.*/
224: btRecNotFnd = -415, /*Record cannot be found.*/
225: btKeyLenErr = -416, /*Maximum key length is too long or equal to zero.*/
226: btKeyAttrErr = -417, /*There is no such a key attribute.*/
227: unknownInsertModeErr = -20000, /*There is no such an insert mode.*/
228: recordDataTooBigErr = -20001, /*The record data is bigger than buffer size (1024 bytes).*/
229: invalidIndexErr = -20002 /*The recordIndex parameter is not valid.*/
230: };
231:
232:
233: enum {
234: fidNotFound = -1300, /*no file thread exists.*/
235: fidExists = -1301, /*file id already exists*/
236: notAFileErr = -1302, /*directory specified*/
237: diffVolErr = -1303, /*files on different volumes*/
238: catChangedErr = -1304, /*the catalog has been modified*/
239: desktopDamagedErr = -1305, /*desktop database files are corrupted*/
240: sameFileErr = -1306, /*can't exchange a file with itself*/
241: badFidErr = -1307, /*file id is dangling or doesn't match with the file number*/
242: notARemountErr = -1308, /*when _Mount allows only remounts and doesn't get one*/
243: fileBoundsErr = -1309, /*file's EOF, offset, mark or size is too big*/
244: fsDataTooBigErr = -1310, /*file or volume is too big for system*/
245: volVMBusyErr = -1311, /*can't eject because volume is in use by VM*/
246: envNotPresent = -5500, /*returned by glue.*/
247: envBadVers = -5501, /*Version non-positive*/
248: envVersTooBig = -5502, /*Version bigger than call can handle*/
249: fontDecError = -64, /*error during font declaration*/
250: fontNotDeclared = -65, /*font not declared*/
251: fontSubErr = -66, /*font substitution occured*/
252: fontNotOutlineErr = -32615, /*bitmap font passed to routine that does outlines only*/
253: firstDskErr = -84, /*I/O System Errors*/
254: lastDskErr = -64, /*I/O System Errors*/
255: noDriveErr = -64, /*drive not installed*/
256: offLinErr = -65, /*r/w requested for an off-line drive*/
257: noNybErr = -66 /*couldn't find 5 nybbles in 200 tries*/
258: };
259:
260: enum {
261: /* general text errors*/
262: kTextUnsupportedEncodingErr = -8738, /* specified encoding not supported for this operation*/
263: kTextMalformedInputErr = -8739, /* in DBCS, for example, high byte followed by invalid low byte*/
264: kTextUndefinedElementErr = -8740, /* text conversion errors*/
265: kTECMissingTableErr = -8745,
266: kTECTableChecksumErr = -8746,
267: kTECTableFormatErr = -8747,
268: kTECCorruptConverterErr = -8748, /* invalid converter object reference*/
269: kTECNoConversionPathErr = -8749,
270: kTECBufferBelowMinimumSizeErr = -8750, /* output buffer too small to allow processing of first input text element*/
271: kTECArrayFullErr = -8751, /* supplied name buffer or TextRun, TextEncoding, or UnicodeMapping array is too small*/
272: kTECBadTextRunErr = -8752,
273: kTECPartialCharErr = -8753, /* input buffer ends in the middle of a multibyte character, conversion stopped*/
274: kTECUnmappableElementErr = -8754,
275: kTECIncompleteElementErr = -8755, /* text element may be incomplete or is too long for internal buffers*/
276: kTECDirectionErr = -8756, /* direction stack overflow, etc.*/
277: kTECGlobalsUnavailableErr = -8770, /* globals have already been deallocated (premature TERM)*/
278: kTECItemUnavailableErr = -8771, /* item (e.g. name) not available for specified region (& encoding if relevant)*/
279: /* text conversion status codes*/
280: kTECUsedFallbacksStatus = -8783,
281: kTECNeedFlushStatus = -8784,
282: kTECOutputBufferFullStatus = -8785, /* output buffer has no room for conversion of next input text element (partial conversion)*/
283: /* deprecated error & status codes for low-level converter*/
284: unicodeChecksumErr = -8769,
285: unicodeNoTableErr = -8768,
286: unicodeVariantErr = -8767,
287: unicodeFallbacksErr = -8766,
288: unicodePartConvertErr = -8765,
289: unicodeBufErr = -8764,
290: unicodeCharErr = -8763,
291: unicodeElementErr = -8762,
292: unicodeNotFoundErr = -8761,
293: unicodeTableFormatErr = -8760,
294: unicodeDirectionErr = -8759,
295: unicodeContextualErr = -8758,
296: unicodeTextEncodingDataErr = -8757
297: };
298:
299:
300: /*
301: File: MacMemory.h
302:
303:
304: */
305:
306:
307: /*
308: File: MixedMode.h
309:
310: */
311:
312: /* Calling Conventions */
313: typedef unsigned short CallingConventionType;
314:
315: enum {
316: kPascalStackBased = 0,
317: kCStackBased = 1,
318: kRegisterBased = 2,
319: kD0DispatchedPascalStackBased = 8,
320: kD1DispatchedPascalStackBased = 12,
321: kD0DispatchedCStackBased = 9,
322: kStackDispatchedPascalStackBased = 14,
323: kThinkCStackBased = 5
324: };
325:
326: #if 0
327: /* SizeCodes we use everywhere */
328:
329: enum {
330: kNoByteCode = 0,
331: kOneByteCode = 1,
332: kTwoByteCode = 2,
333: kFourByteCode = 3
334: };
335:
336: /* Mixed Mode Routine Records */
337: typedef unsigned long ProcInfoType;
338: /* Routine Flag Bits */
339: typedef unsigned short RoutineFlagsType;
340:
341: /* * * * * * * * * * * * * *
342: * SIZE_CODE - Return the size code for an object, given its size in bytes.
343: * size - size of an object in bytes
344: */
345: #define SIZE_CODE(size) \
346: (((size) == 4) ? kFourByteCode : (((size) == 2) ? kTwoByteCode : (((size) == 1) ? kOneByteCode : 0)))
347:
348:
349: /* * * * * * * * * * * * * *
350: * RESULT_SIZE - Return the result field of a ProcInfo, given the return object�s size.
351: * This is the same for all ProcInfos
352: * sizeCode - size code
353: */
354: #define RESULT_SIZE(sizeCode) \
355: ((ProcInfoType)(sizeCode) << kResultSizePhase)
356:
357:
358:
359: /* * * * * * * * * * * * * *
360: * STACK_ROUTINE_PARAMETER - Return a parameter field of a ProcInfo, for a simple,
361: * non-dispatched, stack based routine.
362: * whichParam - which parameter
363: * sizeCode - size code
364: */
365: #define STACK_ROUTINE_PARAMETER(whichParam, sizeCode) \
366: ((ProcInfoType)(sizeCode) << (kStackParameterPhase + (((whichParam) - 1) * kStackParameterWidth)))
367:
368: #endif
369:
370:
371: #define STACK_UPP_TYPE(name) name
372: #define REGISTER_UPP_TYPE(name) name
373:
374:
375: /*
376: File: OSUtils.h
377:
378: */
379: typedef struct QElem QElem;
380:
381: typedef QElem * QElemPtr;
382: struct QHdr {
383: short qFlags;
384: QElemPtr qHead;
385: QElemPtr qTail;
386: };
387: typedef struct QHdr QHdr;
388:
389: typedef QHdr * QHdrPtr;
390:
391: typedef CALLBACK_API( void , DeferredTaskProcPtr )(long dtParam);
392: /*
393: WARNING: DeferredTaskProcPtr uses register based parameters under classic 68k
394: and cannot be written in a high-level language without
395: the help of mixed mode or assembly glue.
396: */
397: typedef REGISTER_UPP_TYPE(DeferredTaskProcPtr) DeferredTaskUPP;
398: enum { uppDeferredTaskProcInfo = 0x0000B802 }; /* register no_return_value Func(4_bytes:A1) */
399: #define NewDeferredTaskProc(userRoutine) (DeferredTaskUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDeferredTaskProcInfo, GetCurrentArchitecture())
400: #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
401: #pragma parameter CallDeferredTaskProc(__A0, __A1)
402: void CallDeferredTaskProc(DeferredTaskUPP routine, long dtParam) = 0x4E90;
403: #else
404: #define CallDeferredTaskProc(userRoutine, dtParam) CALL_ONE_PARAMETER_UPP((userRoutine), uppDeferredTaskProcInfo, (dtParam))
405: #endif
406: struct DeferredTask {
407: QElemPtr qLink;
408: short qType;
409: short dtFlags;
410: DeferredTaskUPP dtAddr;
411: long dtParam;
412: long dtReserved;
413: };
414: typedef struct DeferredTask DeferredTask;
415:
416: typedef DeferredTask * DeferredTaskPtr;
417:
418: /*
419: File: Finder.h
420:
421:
422: */
423:
424: /*
425: The following declerations used to be in Files.�,
426: but are Finder specific and were moved here.
427: */
428:
429: enum {
430: /* Finder Flags */
431: kIsOnDesk = 0x0001,
432: kColor = 0x000E,
433: kIsShared = 0x0040, /* bit 0x0080 is hasNoINITS */
434: kHasBeenInited = 0x0100, /* bit 0x0200 was the letter bit for AOCE, but is now reserved for future use */
435: kHasCustomIcon = 0x0400,
436: kIsStationery = 0x0800,
437: kNameLocked = 0x1000,
438: kHasBundle = 0x2000,
439: kIsInvisible = 0x4000,
440: kIsAlias = 0x8000
441: };
442:
443:
444: enum {
445: /* Finder Constants */
446: fOnDesk = 1,
447: fHasBundle = 8192,
448: fTrash = -3,
449: fDesktop = -2,
450: fDisk = 0
451: };
452:
453: #if PRAGMA_STRUCT_ALIGN
454: #pragma options align=mac68k
455: #elif PRAGMA_STRUCT_PACKPUSH
456: #pragma pack(push, 2)
457: #elif PRAGMA_STRUCT_PACK
458: #pragma pack(2)
459: #endif
460:
461:
462: struct FInfo {
463: OSType fdType; /*the type of the file*/
464: OSType fdCreator; /*file's creator*/
465: unsigned short fdFlags; /*flags ex. hasbundle,invisible,locked, etc.*/
466: Point fdLocation; /*file's location in folder*/
467: short fdFldr; /*folder containing file*/
468: };
469: typedef struct FInfo FInfo;
470:
471: struct FXInfo {
472: short fdIconID; /*Icon ID*/
473: short fdUnused[3]; /*unused but reserved 6 bytes*/
474: SInt8 fdScript; /*Script flag and number*/
475: SInt8 fdXFlags; /*More flag bits*/
476: short fdComment; /*Comment ID*/
477: long fdPutAway; /*Home Dir ID*/
478: };
479: typedef struct FXInfo FXInfo;
480:
481: struct DInfo {
482: Rect frRect; /*folder rect*/
483: unsigned short frFlags; /*Flags*/
484: Point frLocation; /*folder location*/
485: short frView; /*folder view*/
486: };
487: typedef struct DInfo DInfo;
488:
489: struct DXInfo {
490: Point frScroll; /*scroll position*/
491: long frOpenChain; /*DirID chain of open folders*/
492: SInt8 frScript; /*Script flag and number*/
493: SInt8 frXFlags; /*More flag bits*/
494: short frComment; /*comment*/
495: long frPutAway; /*DirID*/
496: };
497: typedef struct DXInfo DXInfo;
498:
499: #if PRAGMA_STRUCT_ALIGN
500: #pragma options align=reset
501: #elif PRAGMA_STRUCT_PACKPUSH
502: #pragma pack(pop)
503: #elif PRAGMA_STRUCT_PACK
504: #pragma pack()
505: #endif
506:
507: /*
508: File: Files.h
509:
510:
511: */
512:
513:
514: enum {
515: fsAtMark = 0,
516: fsCurPerm = 0,
517: fsRdPerm = 1,
518: fInvisible = 16384,
519: fsWrPerm = 2,
520: fsRdWrPerm = 3,
521: fsRdWrShPerm = 4,
522: fsFromStart = 1,
523: fsFromLEOF = 2,
524: fsFromMark = 3,
525: rdVerify = 64,
526: ioMapBuffer = 4,
527: ioModeReserved = 8,
528: ioDirFlg = 4, /* see IM IV-125 */
529: ioDirMask = 0x10,
530: fsRtParID = 1,
531: fsRtDirID = 2
532: };
533:
534:
535:
536: enum {
537: /* CatSearch SearchBits Constants */
538: fsSBPartialName = 1,
539: fsSBFullName = 2,
540: fsSBFlAttrib = 4,
541: fsSBFlFndrInfo = 8,
542: fsSBFlLgLen = 32,
543: fsSBFlPyLen = 64,
544: fsSBFlRLgLen = 128,
545: fsSBFlRPyLen = 256,
546: fsSBFlCrDat = 512,
547: fsSBFlMdDat = 1024,
548: fsSBFlBkDat = 2048,
549: fsSBFlXFndrInfo = 4096,
550: fsSBFlParID = 8192,
551: fsSBNegate = 16384,
552: fsSBDrUsrWds = 8,
553: fsSBDrNmFls = 16,
554: fsSBDrCrDat = 512,
555: fsSBDrMdDat = 1024,
556: fsSBDrBkDat = 2048,
557: fsSBDrFndrInfo = 4096, /* bit values for the above */
558: fsSBPartialNameBit = 0, /*ioFileName points to a substring*/
559: fsSBFullNameBit = 1, /*ioFileName points to a match string*/
560: fsSBFlAttribBit = 2, /*search includes file attributes*/
561: fsSBFlFndrInfoBit = 3, /*search includes finder info*/
562: fsSBFlLgLenBit = 5, /*search includes data logical length*/
563: fsSBFlPyLenBit = 6, /*search includes data physical length*/
564: fsSBFlRLgLenBit = 7, /*search includes resource logical length*/
565: fsSBFlRPyLenBit = 8, /*search includes resource physical length*/
566: fsSBFlCrDatBit = 9, /*search includes create date*/
567: fsSBFlMdDatBit = 10, /*search includes modification date*/
568: fsSBFlBkDatBit = 11, /*search includes backup date*/
569: fsSBFlXFndrInfoBit = 12, /*search includes extended finder info*/
570: fsSBFlParIDBit = 13, /*search includes file's parent ID*/
571: fsSBNegateBit = 14, /*return all non-matches*/
572: fsSBDrUsrWdsBit = 3, /*search includes directory finder info*/
573: fsSBDrNmFlsBit = 4, /*search includes directory valence*/
574: fsSBDrCrDatBit = 9, /*directory-named version of fsSBFlCrDatBit*/
575: fsSBDrMdDatBit = 10, /*directory-named version of fsSBFlMdDatBit*/
576: fsSBDrBkDatBit = 11, /*directory-named version of fsSBFlBkDatBit*/
577: fsSBDrFndrInfoBit = 12 /*directory-named version of fsSBFlXFndrInfoBit*/
578: };
579:
580:
581: enum {
582: fsSBDrParID = 8192,
583: fsSBDrParIDBit = 13, /*directory-named version of fsSBFlParIDBit*/
584: /* vMAttrib (GetVolParms) bit position constants */
585: bLimitFCBs = 31,
586: bLocalWList = 30,
587: bNoMiniFndr = 29,
588: bNoVNEdit = 28,
589: bNoLclSync = 27,
590: bTrshOffLine = 26,
591: bNoSwitchTo = 25,
592: bNoDeskItems = 20,
593: bNoBootBlks = 19,
594: bAccessCntl = 18,
595: bNoSysDir = 17,
596: bHasExtFSVol = 16,
597: bHasOpenDeny = 15,
598: bHasCopyFile = 14,
599: bHasMoveRename = 13,
600: bHasDesktopMgr = 12,
601: bHasShortName = 11,
602: bHasFolderLock = 10,
603: bHasPersonalAccessPrivileges = 9
604: };
605:
606:
607: enum {
608: bHasUserGroupList = 8,
609: bHasCatSearch = 7,
610: bHasFileIDs = 6,
611: bHasBTreeMgr = 5,
612: bHasBlankAccessPrivileges = 4,
613: bSupportsAsyncRequests = 3 /* asynchronous requests to this volume are handled correctly at any time*/
614: };
615:
616:
617: enum {
618: /* Desktop Database icon Constants */
619: kLargeIcon = 1,
620: kLarge4BitIcon = 2,
621: kLarge8BitIcon = 3,
622: kSmallIcon = 4,
623: kSmall4BitIcon = 5,
624: kSmall8BitIcon = 6,
625: kLargeIconSize = 256,
626: kLarge4BitIconSize = 512,
627: kLarge8BitIconSize = 1024,
628: kSmallIconSize = 64,
629: kSmall4BitIconSize = 128,
630: kSmall8BitIconSize = 256, /* Foreign Privilege Model Identifiers */
631: fsUnixPriv = 1, /* Authentication Constants */
632: kNoUserAuthentication = 1,
633: kPassword = 2,
634: kEncryptPassword = 3,
635: kTwoWayEncryptPassword = 6
636: };
637:
638:
639: /* mapping codes (ioObjType) for MapName & MapID */
640:
641: enum {
642: kOwnerID2Name = 1,
643: kGroupID2Name = 2,
644: kOwnerName2ID = 3,
645: kGroupName2ID = 4, /* types of oj object to be returned (ioObjType) for _GetUGEntry */
646: kReturnNextUser = 1,
647: kReturnNextGroup = 2,
648: kReturnNextUG = 3
649: };
650:
651:
652:
653: /* Folder and File values of access privileges */
654:
655: enum {
656: kfullPrivileges = 0x00070007, /* ; all privileges for everybody and owner*/
657: kownerPrivileges = 0x00000007 /* ; all privileges for owner only*/
658: };
659:
660: /* values of user IDs and group IDs */
661:
662: enum {
663: knoUser = 0,
664: kadministratorUser = 1
665: };
666:
667:
668: enum {
669: knoGroup = 0
670: };
671: /* Catalog position record */
672: struct CatPositionRec {
673: long initialize;
674: short priv[6];
675: };
676: typedef struct CatPositionRec CatPositionRec;
677:
678: struct FSSpec {
679: short vRefNum;
680: long parID;
681: Str255 name;
682: };
683: typedef struct FSSpec FSSpec;
684:
685: typedef FSSpec * FSSpecPtr;
686: typedef FSSpecPtr * FSSpecHandle;
687: /* pointer to array of FSSpecs */
688: typedef FSSpecPtr FSSpecArrayPtr;
689: /*
690: The only difference between "const FSSpec*" and "ConstFSSpecPtr" is
691: that as a parameter, ConstFSSpecPtr is allowed to be NULL
692: */
693: typedef const FSSpec * ConstFSSpecPtr;
694:
695: /*
696: The following are structures to be filled out with the _GetVolMountInfo call
697: and passed back into the _VolumeMount call for external file system mounts.
698: */
699: /* the "signature" of the file system */
700: typedef OSType VolumeType;
701:
702: enum {
703: /* the signature for AppleShare */
704: AppleShareMediaType = FOUR_CHAR_CODE('afpm')
705: };
706:
707: /*
708: VolMount stuff was once in FSM.�
709: */
710: struct VolMountInfoHeader {
711: short length; /* length of location data (including self) */
712: VolumeType media; /* type of media. Variable length data follows */
713: };
714: typedef struct VolMountInfoHeader VolMountInfoHeader;
715:
716: typedef VolMountInfoHeader * VolMountInfoPtr;
717: /* The new volume mount info record. The old one is included for compatibility.
718: the new record allows access by foriegn filesystems writers to the flags
719: portion of the record. This portion is now public.
720: */
721: struct VolumeMountInfoHeader {
722: short length; /* length of location data (including self) */
723: VolumeType media; /* type of media (must be registered with Apple) */
724: short flags; /* volume mount flags. Variable length data follows */
725: };
726: typedef struct VolumeMountInfoHeader VolumeMountInfoHeader;
727:
728: typedef VolumeMountInfoHeader * VolumeMountInfoHeaderPtr;
729: /* additional volume mount flags */
730:
731: enum {
732: volMountInteractBit = 15, /* Input to VolumeMount: If set, it's OK for the file system */
733: volMountInteractMask = 0x8000, /* to perform user interaction to mount the volume */
734: volMountChangedBit = 14, /* Output from VoumeMount: If set, the volume was mounted, but */
735: volMountChangedMask = 0x4000, /* the volume mounting information record needs to be updated. */
736: volMountFSReservedMask = 0x00FF, /* bits 0-7 are defined by each file system for its own use */
737: volMountSysReservedMask = 0xFF00 /* bits 8-15 are reserved for Apple system use */
738: };
739:
740: #if PRAGMA_STRUCT_ALIGN
741: #pragma options align=mac68k
742: #elif PRAGMA_STRUCT_PACKPUSH
743: #pragma pack(push, 2)
744: #elif PRAGMA_STRUCT_PACK
745: #pragma pack(2)
746: #endif
747:
748: typedef union ParamBlockRec ParamBlockRec;
749: typedef ParamBlockRec * ParmBlkPtr;
750: typedef CALLBACK_API( void , IOCompletionProcPtr )(ParmBlkPtr paramBlock);
751: /*
752: WARNING: IOCompletionProcPtr uses register based parameters under classic 68k
753: and cannot be written in a high-level language without
754: the help of mixed mode or assembly glue.
755: */
756: typedef REGISTER_UPP_TYPE(IOCompletionProcPtr) IOCompletionUPP;
757: struct IOParam {
758: QElemPtr qLink; /*queue link in header*/
759: short qType; /*type byte for safety check*/
760: short ioTrap; /*FS: the Trap*/
761: Ptr ioCmdAddr; /*FS: address to dispatch to*/
762: IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
763: OSErr ioResult; /*result code*/
764: StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
765: short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
766: short ioRefNum; /*refNum for I/O operation*/
767: SInt8 ioVersNum; /*version number*/
768: SInt8 ioPermssn; /*Open: permissions (byte)*/
769: Ptr ioMisc; /*Rename: new name (GetEOF,SetEOF: logical end of file) (Open: optional ptr to buffer) (SetFileType: new type)*/
770: Ptr ioBuffer; /*data buffer Ptr*/
771: long ioReqCount; /*requested byte count; also = ioNewDirID*/
772: long ioActCount; /*actual byte count completed*/
773: short ioPosMode; /*initial file positioning*/
774: long ioPosOffset; /*file position offset*/
775: };
776: typedef struct IOParam IOParam;
777:
778: typedef IOParam * IOParamPtr;
779: struct FileParam {
780: QElemPtr qLink; /*queue link in header*/
781: short qType; /*type byte for safety check*/
782: short ioTrap; /*FS: the Trap*/
783: Ptr ioCmdAddr; /*FS: address to dispatch to*/
784: IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
785: OSErr ioResult; /*result code*/
786: StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
787: short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
788: short ioFRefNum; /*reference number*/
789: SInt8 ioFVersNum; /*version number*/
790: SInt8 filler1;
791: short ioFDirIndex; /*GetFInfo directory index*/
792: SInt8 ioFlAttrib; /*GetFInfo: in-use bit=7, lock bit=0*/
793: SInt8 ioFlVersNum; /*file version number*/
794: FInfo ioFlFndrInfo; /*user info*/
795: unsigned long ioFlNum; /*GetFInfo: file number; TF- ioDirID*/
796: unsigned short ioFlStBlk; /*start file block (0 if none)*/
797: long ioFlLgLen; /*logical length (EOF)*/
798: long ioFlPyLen; /*physical length*/
799: unsigned short ioFlRStBlk; /*start block rsrc fork*/
800: long ioFlRLgLen; /*file logical length rsrc fork*/
801: long ioFlRPyLen; /*file physical length rsrc fork*/
802: unsigned long ioFlCrDat; /*file creation date& time (32 bits in secs)*/
803: unsigned long ioFlMdDat; /*last modified date and time*/
804: };
805: typedef struct FileParam FileParam;
806:
807: typedef FileParam * FileParamPtr;
808: struct VolumeParam {
809: QElemPtr qLink; /*queue link in header*/
810: short qType; /*type byte for safety check*/
811: short ioTrap; /*FS: the Trap*/
812: Ptr ioCmdAddr; /*FS: address to dispatch to*/
813: IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
814: OSErr ioResult; /*result code*/
815: StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
816: short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
817: long filler2;
818: short ioVolIndex; /*volume index number*/
819: unsigned long ioVCrDate; /*creation date and time*/
820: unsigned long ioVLsBkUp; /*last backup date and time*/
821: unsigned short ioVAtrb; /*volume attrib*/
822: unsigned short ioVNmFls; /*number of files in directory*/
823: unsigned short ioVDirSt; /*start block of file directory*/
824: short ioVBlLn; /*GetVolInfo: length of dir in blocks*/
825: unsigned short ioVNmAlBlks; /*for compatibilty ioVNmAlBlks * ioVAlBlkSiz <= 2 GB*/
826: unsigned long ioVAlBlkSiz; /*for compatibilty ioVAlBlkSiz is <= $0000FE00 (65,024)*/
827: unsigned long ioVClpSiz; /*GetVolInfo: bytes to allocate at a time*/
828: unsigned short ioAlBlSt; /*starting disk(512-byte) block in block map*/
829: unsigned long ioVNxtFNum; /*GetVolInfo: next free file number*/
830: unsigned short ioVFrBlk; /*GetVolInfo: # free alloc blks for this vol*/
831: };
832: typedef struct VolumeParam VolumeParam;
833:
834: typedef VolumeParam * VolumeParamPtr;
835: struct CntrlParam {
836: QElemPtr qLink; /*queue link in header*/
837: short qType; /*type byte for safety check*/
838: short ioTrap; /*FS: the Trap*/
839: Ptr ioCmdAddr; /*FS: address to dispatch to*/
840: IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
841: OSErr ioResult; /*result code*/
842: StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
843: short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
844: short ioCRefNum; /*refNum for I/O operation*/
845: short csCode; /*word for control status code*/
846: short csParam[11]; /*operation-defined parameters*/
847: };
848: typedef struct CntrlParam CntrlParam;
849:
850: typedef CntrlParam * CntrlParamPtr;
851:
852: union ParamBlockRec {
853: IOParam ioParam;
854: FileParam fileParam;
855: VolumeParam volumeParam;
856: CntrlParam cntrlParam;
857: };
858:
859:
860: struct HFileInfo {
861: QElemPtr qLink; /*queue link in header*/
862: short qType; /*type byte for safety check*/
863: short ioTrap; /*FS: the Trap*/
864: Ptr ioCmdAddr; /*FS: address to dispatch to*/
865: IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
866: OSErr ioResult; /*result code*/
867: StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
868: short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
869: short ioFRefNum;
870: SInt8 ioFVersNum;
871: SInt8 filler1;
872: short ioFDirIndex;
873: SInt8 ioFlAttrib;
874: SInt8 ioACUser;
875: FInfo ioFlFndrInfo;
876: long ioDirID;
877: unsigned short ioFlStBlk;
878: long ioFlLgLen;
879: long ioFlPyLen;
880: unsigned short ioFlRStBlk;
881: long ioFlRLgLen;
882: long ioFlRPyLen;
883: unsigned long ioFlCrDat;
884: unsigned long ioFlMdDat;
885: unsigned long ioFlBkDat;
886: FXInfo ioFlXFndrInfo;
887: long ioFlParID;
888: long ioFlClpSiz;
889: };
890: typedef struct HFileInfo HFileInfo;
891:
892: struct DirInfo {
893: QElemPtr qLink; /*queue link in header*/
894: short qType; /*type byte for safety check*/
895: short ioTrap; /*FS: the Trap*/
896: Ptr ioCmdAddr; /*FS: address to dispatch to*/
897: IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
898: OSErr ioResult; /*result code*/
899: StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
900: short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
901: short ioFRefNum;
902: SInt8 ioFVersNum;
903: SInt8 filler1;
904: short ioFDirIndex;
905: SInt8 ioFlAttrib;
906: SInt8 ioACUser;
907: DInfo ioDrUsrWds;
908: long ioDrDirID;
909: unsigned short ioDrNmFls;
910: short filler3[9];
911: unsigned long ioDrCrDat;
912: unsigned long ioDrMdDat;
913: unsigned long ioDrBkDat;
914: DXInfo ioDrFndrInfo;
915: long ioDrParID;
916: };
917: typedef struct DirInfo DirInfo;
918:
919: union CInfoPBRec {
920: HFileInfo hFileInfo;
921: DirInfo dirInfo;
922: };
923: typedef union CInfoPBRec CInfoPBRec;
924:
925: typedef CInfoPBRec * CInfoPBPtr;
926:
927: struct HIOParam {
928: QElemPtr qLink; /*queue link in header*/
929: short qType; /*type byte for safety check*/
930: short ioTrap; /*FS: the Trap*/
931: Ptr ioCmdAddr; /*FS: address to dispatch to*/
932: IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
933: OSErr ioResult; /*result code*/
934: StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
935: short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
936: short ioRefNum;
937: SInt8 ioVersNum;
938: SInt8 ioPermssn;
939: Ptr ioMisc;
940: Ptr ioBuffer;
941: long ioReqCount;
942: long ioActCount;
943: short ioPosMode;
944: long ioPosOffset;
945: };
946: typedef struct HIOParam HIOParam;
947:
948: typedef HIOParam * HIOParamPtr;
949: struct CMovePBRec {
950: QElemPtr qLink;
951: short qType;
952: short ioTrap;
953: Ptr ioCmdAddr;
954: IOCompletionUPP ioCompletion;
955: OSErr ioResult;
956: StringPtr ioNamePtr;
957: short ioVRefNum;
958: long filler1;
959: StringPtr ioNewName;
960: long filler2;
961: long ioNewDirID;
962: long filler3[2];
963: long ioDirID;
964: };
965: typedef struct CMovePBRec CMovePBRec;
966:
967: typedef CMovePBRec * CMovePBPtr;
968: struct FIDParam {
969: QElemPtr qLink; /*queue link in header*/
970: short qType; /*type byte for safety check*/
971: short ioTrap; /*FS: the Trap*/
972: Ptr ioCmdAddr; /*FS: address to dispatch to*/
973: IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
974: OSErr ioResult; /*result code*/
975: StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
976: short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
977: long filler14;
978: StringPtr ioDestNamePtr; /* dest file name */
979: long filler15;
980: long ioDestDirID; /* dest file's directory id */
981: long filler16;
982: long filler17;
983: long ioSrcDirID; /* source file's directory id */
984: short filler18;
985: long ioFileID; /* file ID */
986: };
987: typedef struct FIDParam FIDParam;
988:
989: typedef FIDParam * FIDParamPtr;
990: struct CSParam {
991: QElemPtr qLink; /*queue link in header*/
992: short qType; /*type byte for safety check*/
993: short ioTrap; /*FS: the Trap*/
994: Ptr ioCmdAddr; /*FS: address to dispatch to*/
995: IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
996: OSErr ioResult; /*result code*/
997: StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
998: short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
999: FSSpecPtr ioMatchPtr; /* match array */
1000: long ioReqMatchCount; /* maximum allowable matches */
1001: long ioActMatchCount; /* actual match count */
1002: long ioSearchBits; /* search criteria selector */
1003: CInfoPBPtr ioSearchInfo1; /* search values and range lower bounds */
1004: CInfoPBPtr ioSearchInfo2; /* search values and range upper bounds */
1005: long ioSearchTime; /* length of time to run search */
1006: CatPositionRec ioCatPosition; /* current position in the catalog */
1007: Ptr ioOptBuffer; /* optional performance enhancement buffer */
1008: long ioOptBufSize; /* size of buffer pointed to by ioOptBuffer */
1009: };
1010: typedef struct CSParam CSParam;
1011:
1012: typedef CSParam * CSParamPtr;
1013: struct HVolumeParam {
1014: QElemPtr qLink; /*queue link in header*/
1015: short qType; /*type byte for safety check*/
1016: short ioTrap; /*FS: the Trap*/
1017: Ptr ioCmdAddr; /*FS: address to dispatch to*/
1018: IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
1019: OSErr ioResult; /*result code*/
1020: StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
1021: short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
1022: long filler2;
1023: short ioVolIndex;
1024: unsigned long ioVCrDate;
1025: unsigned long ioVLsMod;
1026: short ioVAtrb;
1027: unsigned short ioVNmFls;
1028: unsigned short ioVBitMap;
1029: unsigned short ioAllocPtr;
1030: unsigned short ioVNmAlBlks;
1031: unsigned long ioVAlBlkSiz;
1032: unsigned long ioVClpSiz;
1033: unsigned short ioAlBlSt;
1034: unsigned long ioVNxtCNID;
1035: unsigned short ioVFrBlk;
1036: unsigned short ioVSigWord;
1037: short ioVDrvInfo;
1038: short ioVDRefNum;
1039: short ioVFSID;
1040: unsigned long ioVBkUp;
1041: short ioVSeqNum;
1042: unsigned long ioVWrCnt;
1043: unsigned long ioVFilCnt;
1044: unsigned long ioVDirCnt;
1045: long ioVFndrInfo[8];
1046: };
1047: typedef struct HVolumeParam HVolumeParam;
1048:
1049: typedef HVolumeParam * HVolumeParamPtr;
1050:
1051: enum {
1052: /* Large Volume Constants */
1053: kWidePosOffsetBit = 8,
1054: kMaximumBlocksIn4GB = 0x007FFFFF
1055: };
1056:
1057: struct XIOParam {
1058: QElemPtr qLink;
1059: short qType;
1060: short ioTrap;
1061: Ptr ioCmdAddr;
1062: IOCompletionUPP ioCompletion;
1063: OSErr ioResult;
1064: StringPtr ioNamePtr;
1065: short ioVRefNum;
1066: short ioRefNum;
1067: SInt8 ioVersNum;
1068: SInt8 ioPermssn;
1069: Ptr ioMisc;
1070: Ptr ioBuffer;
1071: long ioReqCount;
1072: long ioActCount;
1073: short ioPosMode; /* must have kUseWidePositioning bit set */
1074: wide ioWPosOffset; /* wide positioning offset */
1075: };
1076: typedef struct XIOParam XIOParam;
1077:
1078: typedef XIOParam * XIOParamPtr;
1079: struct XVolumeParam {
1080: QElemPtr qLink;
1081: short qType;
1082: short ioTrap;
1083: Ptr ioCmdAddr;
1084: IOCompletionUPP ioCompletion;
1085: OSErr ioResult;
1086: StringPtr ioNamePtr;
1087: short ioVRefNum;
1088: unsigned long ioXVersion; /* this XVolumeParam version (0) */
1089: short ioVolIndex;
1090: unsigned long ioVCrDate;
1091: unsigned long ioVLsMod;
1092: short ioVAtrb;
1093: unsigned short ioVNmFls;
1094: unsigned short ioVBitMap;
1095: unsigned short ioAllocPtr;
1096: unsigned short ioVNmAlBlks;
1097: unsigned long ioVAlBlkSiz;
1098: unsigned long ioVClpSiz;
1099: unsigned short ioAlBlSt;
1100: unsigned long ioVNxtCNID;
1101: unsigned short ioVFrBlk;
1102: unsigned short ioVSigWord;
1103: short ioVDrvInfo;
1104: short ioVDRefNum;
1105: short ioVFSID;
1106: unsigned long ioVBkUp;
1107: short ioVSeqNum;
1108: unsigned long ioVWrCnt;
1109: unsigned long ioVFilCnt;
1110: unsigned long ioVDirCnt;
1111: long ioVFndrInfo[8];
1112: UnsignedWide ioVTotalBytes; /* total number of bytes on volume */
1113: UnsignedWide ioVFreeBytes; /* number of free bytes on volume */
1114: };
1115: typedef struct XVolumeParam XVolumeParam;
1116:
1117: typedef XVolumeParam * XVolumeParamPtr;
1118:
1119: struct VCB {
1120: QElemPtr qLink;
1121: short qType;
1122: short vcbFlags;
1123: unsigned short vcbSigWord;
1124: unsigned long vcbCrDate;
1125: unsigned long vcbLsMod;
1126: short vcbAtrb;
1127: unsigned short vcbNmFls;
1128: short vcbVBMSt;
1129: short vcbAllocPtr;
1130: unsigned short vcbNmAlBlks;
1131: long vcbAlBlkSiz;
1132: long vcbClpSiz;
1133: short vcbAlBlSt;
1134: long vcbNxtCNID;
1135: unsigned short vcbFreeBks;
1136: Str27 vcbVN;
1137: short vcbDrvNum;
1138: short vcbDRefNum;
1139: short vcbFSID;
1140: short vcbVRefNum;
1141: Ptr vcbMAdr;
1142: Ptr vcbBufAdr;
1143: short vcbMLen;
1144: short vcbDirIndex;
1145: short vcbDirBlk;
1146: unsigned long vcbVolBkUp;
1147: unsigned short vcbVSeqNum;
1148: long vcbWrCnt;
1149: long vcbXTClpSiz;
1150: long vcbCTClpSiz;
1151: unsigned short vcbNmRtDirs;
1152: long vcbFilCnt;
1153: long vcbDirCnt;
1154: long vcbFndrInfo[8];
1155: unsigned short vcbVCSize;
1156: unsigned short vcbVBMCSiz;
1157: unsigned short vcbCtlCSiz;
1158: unsigned short vcbXTAlBlks;
1159: unsigned short vcbCTAlBlks;
1160: short vcbXTRef;
1161: short vcbCTRef;
1162: Ptr vcbCtlBuf;
1163: long vcbDirIDM;
1164: short vcbOffsM;
1165: };
1166: typedef struct VCB VCB;
1167:
1168: typedef VCB * VCBPtr;
1169: struct DrvQEl {
1170: QElemPtr qLink;
1171: short qType;
1172: short dQDrive;
1173: short dQRefNum;
1174: short dQFSID;
1175: unsigned short dQDrvSz;
1176: unsigned short dQDrvSz2;
1177: };
1178: typedef struct DrvQEl DrvQEl;
1179:
1180: typedef DrvQEl * DrvQElPtr;
1181:
1182: #if PRAGMA_STRUCT_ALIGN
1183: #pragma options align=reset
1184: #elif PRAGMA_STRUCT_PACKPUSH
1185: #pragma pack(pop)
1186: #elif PRAGMA_STRUCT_PACK
1187: #pragma pack()
1188: #endif
1189:
1190: /*
1191: File: FSM.h
1192:
1193:
1194: */
1195:
1196: /*
1197: * Miscellaneous file system values not in Files.�
1198: */
1199:
1200: enum {
1201: fsUsrCNID = 16, /* First assignable directory or file number */
1202: /* File system trap word attribute bits */
1203: kHFSBit = 9, /* HFS call: bit 9 */
1204: kHFSMask = 0x0200,
1205: kAsyncBit = 10, /* Asynchronous call: bit 10 */
1206: kAsyncMask = 0x0400
1207: };
1208:
1209:
1210:
1211: /*
1212: * UTCacheReadIP and UTCacheWriteIP cacheOption
1213: */
1214:
1215: enum {
1216: noCacheBit = 5, /* don't cache this please */
1217: noCacheMask = 0x0020,
1218: rdVerifyBit = 6, /* read verify */
1219: rdVerifyMask = 0x0040
1220: };
1221:
1222: /*
1223: * Cache routine internal error codes
1224: */
1225:
1226: enum {
1227: chNoBuf = 1, /* no free cache buffers (all in use) */
1228: chInUse = 2, /* requested block in use */
1229: chnotfound = 3, /* requested block not found */
1230: chNotInUse = 4 /* block being released was not in use */
1231: };
1232:
1233:
1234: /*
1235: * UTGetBlock options
1236: */
1237:
1238: enum {
1239: gbDefault = 0, /* default value - read if not found */
1240: /* bits and masks */
1241: gbReadBit = 0, /* read block from disk (forced read) */
1242: gbReadMask = 0x0001,
1243: gbExistBit = 1, /* get existing cache block */
1244: gbExistMask = 0x0002,
1245: gbNoReadBit = 2, /* don't read block from disk if not found in cache */
1246: gbNoReadMask = 0x0004,
1247: gbReleaseBit = 3, /* release block immediately after GetBlock */
1248: gbReleaseMask = 0x0008
1249: };
1250:
1251:
1252: /*
1253: * UTReleaseBlock options
1254: */
1255:
1256: enum {
1257: rbDefault = 0, /* default value - just mark the buffer not in-use */
1258: /* bits and masks */
1259: rbWriteBit = 0, /* force write buffer to disk */
1260: rbWriteMask = 0x0001,
1261: rbTrashBit = 1, /* trash buffer contents after release */
1262: rbTrashMask = 0x0002,
1263: rbDirtyBit = 2, /* mark buffer dirty */
1264: rbDirtyMask = 0x0004,
1265: rbFreeBit = 3, /* free the buffer (save in the hash) */
1266: rbFreeMask = 0x000A /* rbFreeMask (rbFreeBit + rbTrashBit) works as rbTrash on < System 7.0 RamCache; on >= System 7.0, rbfreeMask overrides rbTrash */
1267: };
1268:
1269: /*
1270: * UTFlushCache options
1271: */
1272:
1273: enum {
1274: fcDefault = 0, /* default value - pass this fcOption to just flush any dirty buffers */
1275: /* bits and masks */
1276: fcTrashBit = 0, /* (don't pass this as fcOption, use only for testing bit) */
1277: fcTrashMask = 0x0001, /* pass this fcOption value to flush and trash cache blocks */
1278: fcFreeBit = 1, /* (don't pass this as fcOption, use only for testing bit) */
1279: fcFreeMask = 0x0003 /* pass this fcOption to flush and free cache blocks (Note: both fcTrash and fcFree bits are set) */
1280: };
1281:
1282:
1283:
1284: /*
1285: * FCBRec.fcbFlags bits
1286: */
1287:
1288: enum {
1289: fcbWriteBit = 0, /* Data can be written to this file */
1290: fcbWriteMask = 0x01,
1291: fcbResourceBit = 1, /* This file is a resource fork */
1292: fcbResourceMask = 0x02,
1293: fcbWriteLockedBit = 2, /* File has a locked byte range */
1294: fcbWriteLockedMask = 0x04,
1295: fcbSharedWriteBit = 4, /* File is open for shared write access */
1296: fcbSharedWriteMask = 0x10,
1297: fcbFileLockedBit = 5, /* File is locked (write-protected) */
1298: fcbFileLockedMask = 0x20,
1299: fcbOwnClumpBit = 6, /* File has clump size specified in FCB */
1300: fcbOwnClumpMask = 0x40,
1301: fcbModifiedBit = 7, /* File has changed since it was last flushed */
1302: fcbModifiedMask = 0x80
1303: };
1304:
1305:
1306: /*
1307: * HFS Utility routine records
1308: */
1309:
1310: /*
1311: * record used by UTGetPathComponentName
1312: */
1313: struct ParsePathRec {
1314: StringPtr namePtr; /* pathname to parse */
1315: short startOffset; /* where to start parsing */
1316: short componentLength; /* the length of the pathname component parsed */
1317: SignedByte moreName; /* non-zero if there are more components after this one */
1318: SignedByte foundDelimiter; /* non-zero if parsing stopped because a colon (:) delimiter was found */
1319: };
1320: typedef struct ParsePathRec ParsePathRec;
1321:
1322: typedef ParsePathRec * ParsePathRecPtr;
1323: struct WDCBRec {
1324: VCBPtr wdVCBPtr; /* Pointer to VCB of this working directory */
1325: long wdDirID; /* Directory ID number of this working directory */
1326: long wdCatHint; /* Hint for finding this working directory */
1327: long wdProcID; /* Process that created this working directory */
1328: };
1329: typedef struct WDCBRec WDCBRec;
1330:
1331: typedef WDCBRec * WDCBRecPtr;
1332:
1333: /*
1334: * FormatListRec as returned by the .Sony disk driver's
1335: * Return Format List status call (csCode = 6).
1336: * If the status call to get this list for a drive is not
1337: * implemented by the driver, then a list with one entry
1338: * is contructed from the drive queue element for the drive.
1339: */
1340: struct FormatListRec {
1341: unsigned long volSize; /* disk capacity in SECTORs */
1342: SignedByte formatFlags; /* flags */
1343: SignedByte sectorsPerTrack; /* sectors per track side */
1344: unsigned short tracks; /* number of tracks */
1345: };
1346: typedef struct FormatListRec FormatListRec;
1347:
1348: typedef FormatListRec * FormatListRecPtr;
1349: /*
1350: * SizeListRec built from FormatListRecs as described above.
1351: */
1352: struct SizeListRec {
1353: short sizeListFlags; /* flags as set by external file system */
1354: FormatListRec sizeEntry; /* disk driver format list record */
1355: };
1356: typedef struct SizeListRec SizeListRec;
1357:
1358: typedef SizeListRec * SizeListRecPtr;
1359: /*
1360: * paramBlock for the diCIEvaluateSize call
1361: */
1362: struct DICIEvaluateSizeRec {
1363: short defaultSizeIndex; /* default size for this FS */
1364: short numSizeEntries; /* number of size entries */
1365: short driveNumber; /* drive number */
1366: SizeListRecPtr sizeListPtr; /* ptr to size entry table */
1367: unsigned short sectorSize; /* bytes per sector */
1368: };
1369: typedef struct DICIEvaluateSizeRec DICIEvaluateSizeRec;
1370:
1371: typedef DICIEvaluateSizeRec * DICIEvaluateSizeRecPtr;
1372: /*
1373: * paramBlock for the diCIExtendedZero call
1374: */
1375: struct DICIExtendedZeroRec {
1376: short driveNumber; /* drive number */
1377: StringPtr volNamePtr; /* ptr to volume name string */
1378: short fsid; /* file system ID */
1379: short volTypeSelector; /* volume type selector, if supports more than 1 type */
1380: unsigned short numDefectBlocks; /* number of bad logical blocks */
1381: unsigned short defectListSize; /* size of the defect list buffer in bytes */
1382: Ptr defectListPtr; /* pointer to defect list buffer */
1383: unsigned long volSize; /* size of volume in SECTORs */
1384: unsigned short sectorSize; /* bytes per sector */
1385: Ptr extendedInfoPtr; /* ptr to extended info */
1386: };
1387: typedef struct DICIExtendedZeroRec DICIExtendedZeroRec;
1388:
1389: typedef DICIExtendedZeroRec * DICIExtendedZeroRecPtr;
1390: /*
1391: * paramBlock for the diCIValidateVolName call
1392: */
1393: struct DICIValidateVolNameRec {
1394: char theChar; /* the character to validate */
1395: Boolean hasMessageBuffer; /* false if no message */
1396: short charOffset; /* position of the current character (first char = 1) */
1397: StringPtr messageBufferPtr; /* pointer to message buffer or nil */
1398: short charByteType; /* theChar's byte type (smSingleByte, smFirstByte, or smLastByte) */
1399: };
1400: typedef struct DICIValidateVolNameRec DICIValidateVolNameRec;
1401:
1402: typedef DICIValidateVolNameRec * DICIValidateVolNameRecPtr;
1403: /*
1404: * paramBlock for the diCIGetVolTypeInfo call
1405: */
1406: struct DICIGetVolTypeInfoRec {
1407: unsigned long volSize; /* size of volume in SECTORs */
1408: unsigned short sectorSize; /* bytes per sector */
1409: short numVolTypes; /* number of volume types supported */
1410: Str31 volTypesBuffer[4]; /* 4 string buffers */
1411: };
1412: typedef struct DICIGetVolTypeInfoRec DICIGetVolTypeInfoRec;
1413:
1414: typedef DICIGetVolTypeInfoRec * DICIGetVolTypeInfoRecPtr;
1415: /*
1416: * paramBlock for the diCIGetFormatString call
1417: */
1418: struct DICIGetFormatStringRec {
1419: unsigned long volSize; /* volume size in SECTORs */
1420: unsigned short sectorSize; /* sector size */
1421: short volTypeSelector; /* volume type selector */
1422: short stringKind; /* sub-function = type of string */
1423: Str255 stringBuffer; /* string buffer */
1424: };
1425: typedef struct DICIGetFormatStringRec DICIGetFormatStringRec;
1426:
1427: typedef DICIGetFormatStringRec * DICIGetFormatStringRecPtr;
1428: /*
1429: * paramBlock for the diCIGetExtendedFormatParams call
1430: */
1431: struct DICIGetExtendedFormatRec {
1432: short driveNumber; /* drive number */
1433: short volTypeSelector; /* volume type selector or 0 */
1434: unsigned long volSize; /* size of volume in SECTORs */
1435: unsigned short sectorSize; /* bytes per sector */
1436: FSSpecPtr fileSystemSpecPtr; /* pointer to the foreign file system's FSSpec */
1437: Ptr extendedInfoPtr; /* pointer to extended parameter structure */
1438: };
1439: typedef struct DICIGetExtendedFormatRec DICIGetExtendedFormatRec;
1440:
1441: typedef DICIGetExtendedFormatRec * DICIGetExtendedFormatRecPtr;
1442:
1443:
1444: /*
1445: File: Gestalt.h
1446:
1447: */
1448: typedef CALLBACK_API( OSErr , SelectorFunctionProcPtr )(OSType selector, long *response);
1449: typedef STACK_UPP_TYPE(SelectorFunctionProcPtr) SelectorFunctionUPP;
1450:
1451:
1452: /*
1453: File: TextCommon.h
1454:
1455: */
1456:
1457: /* LocaleIdentifier is an obsolete Copland typedef, will be removed soon*/
1458: typedef UInt32 LocaleIdentifier;
1459: /* TextEncodingBase type & values */
1460: /* (values 0-32 correspond to the Script Codes defined in Inside Macintosh: Text pages 6-52 and 6-53 */
1461: typedef UInt32 TextEncodingBase;
1462:
1463: enum {
1464: /* Mac OS encodings*/
1465: kTextEncodingMacRoman = 0L,
1466: kTextEncodingMacJapanese = 1,
1467: kTextEncodingMacChineseTrad = 2,
1468: kTextEncodingMacKorean = 3,
1469: kTextEncodingMacArabic = 4,
1470: kTextEncodingMacHebrew = 5,
1471: kTextEncodingMacGreek = 6,
1472: kTextEncodingMacCyrillic = 7,
1473: kTextEncodingMacDevanagari = 9,
1474: kTextEncodingMacGurmukhi = 10,
1475: kTextEncodingMacGujarati = 11,
1476: kTextEncodingMacOriya = 12,
1477: kTextEncodingMacBengali = 13,
1478: kTextEncodingMacTamil = 14,
1479: kTextEncodingMacTelugu = 15,
1480: kTextEncodingMacKannada = 16,
1481: kTextEncodingMacMalayalam = 17,
1482: kTextEncodingMacSinhalese = 18,
1483: kTextEncodingMacBurmese = 19,
1484: kTextEncodingMacKhmer = 20,
1485: kTextEncodingMacThai = 21,
1486: kTextEncodingMacLaotian = 22,
1487: kTextEncodingMacGeorgian = 23,
1488: kTextEncodingMacArmenian = 24,
1489: kTextEncodingMacChineseSimp = 25,
1490: kTextEncodingMacTibetan = 26,
1491: kTextEncodingMacMongolian = 27,
1492: kTextEncodingMacEthiopic = 28,
1493: kTextEncodingMacCentralEurRoman = 29,
1494: kTextEncodingMacVietnamese = 30,
1495: kTextEncodingMacExtArabic = 31, /* The following use script code 0, smRoman*/
1496: kTextEncodingMacSymbol = 33,
1497: kTextEncodingMacDingbats = 34,
1498: kTextEncodingMacTurkish = 35,
1499: kTextEncodingMacCroatian = 36,
1500: kTextEncodingMacIcelandic = 37,
1501: kTextEncodingMacRomanian = 38, /* The following use script code 4, smArabic*/
1502: kTextEncodingMacFarsi = 0x8C, /* Like MacArabic but uses Farsi digits*/
1503: /* The following use script code 7, smCyrillic*/
1504: kTextEncodingMacUkrainian = 0x98, /* The following use script code 32, smUnimplemented*/
1505: kTextEncodingMacVT100 = 0xFC, /* VT100/102 font from Comm Toolbox: Latin-1 repertoire + box drawing etc*/
1506: /* Special Mac OS encodings*/
1507: kTextEncodingMacHFS = 0xFF, /* Meta-value, should never appear in a table.*/
1508: /* Unicode & ISO UCS encodings begin at 0x100*/
1509: kTextEncodingUnicodeDefault = 0x0100, /* Meta-value, should never appear in a table.*/
1510: kTextEncodingUnicodeV1_1 = 0x0101,
1511: kTextEncodingISO10646_1993 = 0x0101, /* Code points identical to Unicode 1.1*/
1512: kTextEncodingUnicodeV2_0 = 0x0103, /* New location for Korean Hangul*/
1513: /* ISO 8-bit and 7-bit encodings begin at 0x200*/
1514: kTextEncodingISOLatin1 = 0x0201, /* ISO 8859-1*/
1515: kTextEncodingISOLatin2 = 0x0202, /* ISO 8859-2*/
1516: kTextEncodingISOLatinCyrillic = 0x0205, /* ISO 8859-5*/
1517: kTextEncodingISOLatinArabic = 0x0206, /* ISO 8859-6, = ASMO 708, =DOS CP 708*/
1518: kTextEncodingISOLatinGreek = 0x0207, /* ISO 8859-7*/
1519: kTextEncodingISOLatinHebrew = 0x0208, /* ISO 8859-8*/
1520: kTextEncodingISOLatin5 = 0x0209, /* ISO 8859-9*/
1521: /* MS-DOS & Windows encodings begin at 0x400*/
1522: kTextEncodingDOSLatinUS = 0x0400, /* code page 437*/
1523: kTextEncodingDOSGreek = 0x0405, /* code page 737 (formerly code page 437G)*/
1524: kTextEncodingDOSBalticRim = 0x0406, /* code page 775*/
1525: kTextEncodingDOSLatin1 = 0x0410, /* code page 850, "Multilingual"*/
1526: kTextEncodingDOSGreek1 = 0x0411, /* code page 851*/
1527: kTextEncodingDOSLatin2 = 0x0412, /* code page 852, Slavic*/
1528: kTextEncodingDOSCyrillic = 0x0413, /* code page 855, IBM Cyrillic*/
1529: kTextEncodingDOSTurkish = 0x0414, /* code page 857, IBM Turkish*/
1530: kTextEncodingDOSPortuguese = 0x0415, /* code page 860*/
1531: kTextEncodingDOSIcelandic = 0x0416, /* code page 861*/
1532: kTextEncodingDOSHebrew = 0x0417, /* code page 862*/
1533: kTextEncodingDOSCanadianFrench = 0x0418, /* code page 863*/
1534: kTextEncodingDOSArabic = 0x0419, /* code page 864*/
1535: kTextEncodingDOSNordic = 0x041A, /* code page 865*/
1536: kTextEncodingDOSRussian = 0x041B, /* code page 866*/
1537: kTextEncodingDOSGreek2 = 0x041C, /* code page 869, IBM Modern Greek*/
1538: kTextEncodingDOSThai = 0x041D, /* code page 874, also for Windows*/
1539: kTextEncodingDOSJapanese = 0x0420, /* code page 932, also for Windows*/
1540: kTextEncodingDOSChineseSimplif = 0x0421, /* code page 936, also for Windows*/
1541: kTextEncodingDOSKorean = 0x0422, /* code page 949, also for Windows; Unified Hangul Code*/
1542: kTextEncodingDOSChineseTrad = 0x0423, /* code page 950, also for Windows*/
1543: kTextEncodingWindowsLatin1 = 0x0500, /* code page 1252*/
1544: kTextEncodingWindowsANSI = 0x0500, /* code page 1252 (alternate name)*/
1545: kTextEncodingWindowsLatin2 = 0x0501, /* code page 1250, Central Europe*/
1546: kTextEncodingWindowsCyrillic = 0x0502, /* code page 1251, Slavic Cyrillic*/
1547: kTextEncodingWindowsGreek = 0x0503, /* code page 1253*/
1548: kTextEncodingWindowsLatin5 = 0x0504, /* code page 1254, Turkish*/
1549: kTextEncodingWindowsHebrew = 0x0505, /* code page 1255*/
1550: kTextEncodingWindowsArabic = 0x0506, /* code page 1256*/
1551: kTextEncodingWindowsBalticRim = 0x0507, /* code page 1257*/
1552: kTextEncodingWindowsKoreanJohab = 0x0510, /* code page 1361, for Windows NT*/
1553: /* Various national standards begin at 0x600*/
1554: kTextEncodingUS_ASCII = 0x0600,
1555: kTextEncodingJIS_X0201_76 = 0x0620,
1556: kTextEncodingJIS_X0208_83 = 0x0621,
1557: kTextEncodingJIS_X0208_90 = 0x0622,
1558: kTextEncodingJIS_X0212_90 = 0x0623,
1559: kTextEncodingJIS_C6226_78 = 0x0624,
1560: kTextEncodingGB_2312_80 = 0x0630,
1561: kTextEncodingGBK_95 = 0x0631, /* annex to GB 13000-93; for Windows 95*/
1562: kTextEncodingKSC_5601_87 = 0x0640, /* same as KSC 5601-92 without Johab annex*/
1563: kTextEncodingKSC_5601_92_Johab = 0x0641, /* KSC 5601-92 Johab annex*/
1564: kTextEncodingCNS_11643_92_P1 = 0x0651, /* CNS 11643-1992 plane 1*/
1565: kTextEncodingCNS_11643_92_P2 = 0x0652, /* CNS 11643-1992 plane 2*/
1566: kTextEncodingCNS_11643_92_P3 = 0x0653, /* CNS 11643-1992 plane 3 (was plane 14 in 1986 version)*/
1567: /* ISO 2022 collections begin at 0x800*/
1568: kTextEncodingISO_2022_JP = 0x0820,
1569: kTextEncodingISO_2022_JP_2 = 0x0821,
1570: kTextEncodingISO_2022_CN = 0x0830,
1571: kTextEncodingISO_2022_CN_EXT = 0x0831,
1572: kTextEncodingISO_2022_KR = 0x0840, /* EUC collections begin at 0x900*/
1573: kTextEncodingEUC_JP = 0x0920, /* ISO 646, 1-byte katakana, JIS 208, JIS 212*/
1574: kTextEncodingEUC_CN = 0x0930, /* ISO 646, GB 2312-80*/
1575: kTextEncodingEUC_TW = 0x0931, /* ISO 646, CNS 11643-1992 Planes 1-16*/
1576: kTextEncodingEUC_KR = 0x0940, /* ISO 646, KS C 5601-1987*/
1577: /* Misc standards begin at 0xA00*/
1578: kTextEncodingShiftJIS = 0x0A01, /* plain Shift-JIS*/
1579: kTextEncodingKOI8_R = 0x0A02, /* Russian internet standard*/
1580: kTextEncodingBig5 = 0x0A03, /* Big-5 (has variants)*/
1581: kTextEncodingMacRomanLatin1 = 0x0A04, /* Mac OS Roman permuted to align with ISO Latin-1*/
1582: kTextEncodingHZ_GB_2312 = 0x0A05, /* HZ (RFC 1842, for Chinese mail & news)*/
1583: /* Other platform encodings*/
1584: kTextEncodingNextStepLatin = 0x0B01, /* NextStep encoding*/
1585: /* EBCDIC & IBM host encodings begin at 0xC00*/
1586: kTextEncodingEBCDIC_US = 0x0C01, /* basic EBCDIC-US*/
1587: kTextEncodingEBCDIC_CP037 = 0x0C02, /* code page 037, extended EBCDIC (Latin-1 set) for US,Canada...*/
1588: /* Special value*/
1589: kTextEncodingMultiRun = 0x0FFF, /* Multi-encoding text with external run info*/
1590: /* The following are older names for backward compatibility*/
1591: kTextEncodingMacTradChinese = 2,
1592: kTextEncodingMacRSymbol = 8,
1593: kTextEncodingMacSimpChinese = 25,
1594: kTextEncodingMacGeez = 28,
1595: kTextEncodingMacEastEurRoman = 29,
1596: kTextEncodingMacUninterp = 32
1597: };
1598:
1599: /* TextEncodingVariant type & values */
1600: typedef UInt32 TextEncodingVariant;
1601:
1602: enum {
1603: /* Default TextEncodingVariant, for any TextEncodingBase*/
1604: kTextEncodingDefaultVariant = 0, /* Variants of kTextEncodingMacIcelandic */
1605: kMacIcelandicStandardVariant = 0, /* 0xBB & 0xBC are fem./masc. ordinal indicators*/
1606: kMacIcelandicTrueTypeVariant = 1, /* 0xBB & 0xBC are fi/fl ligatures*/
1607: /* Variants of kTextEncodingMacJapanese*/
1608: kMacJapaneseStandardVariant = 0,
1609: kMacJapaneseStdNoVerticalsVariant = 1,
1610: kMacJapaneseBasicVariant = 2,
1611: kMacJapanesePostScriptScrnVariant = 3,
1612: kMacJapanesePostScriptPrintVariant = 4,
1613: kMacJapaneseVertAtKuPlusTenVariant = 5, /* Variant options for most Japanese encodings (MacJapanese, ShiftJIS, EUC-JP, ISO 2022-JP) */
1614: /* These can be OR-ed into the variant value in any combination*/
1615: kJapaneseNoOneByteKanaOption = 0x20,
1616: kJapaneseUseAsciiBackslashOption = 0x40, /* Variants of kTextEncodingMacArabic*/
1617: kMacArabicStandardVariant = 0, /* 0xC0 is 8-spoke asterisk, 0x2A & 0xAA are asterisk (e.g. Cairo)*/
1618: kMacArabicTrueTypeVariant = 1, /* 0xC0 is asterisk, 0x2A & 0xAA are multiply signs (e.g. Baghdad)*/
1619: kMacArabicThuluthVariant = 2, /* 0xC0 is Arabic five-point star, 0x2A & 0xAA are multiply signs*/
1620: kMacArabicAlBayanVariant = 3, /* 8-spoke asterisk, multiply sign, Koranic ligatures & parens*/
1621: /* Variants of kTextEncodingMacFarsi*/
1622: kMacFarsiStandardVariant = 0, /* 0xC0 is 8-spoke asterisk, 0x2A & 0xAA are asterisk (e.g. Tehran)*/
1623: kMacFarsiTrueTypeVariant = 1, /* asterisk, multiply signs, Koranic ligatures, geometric shapes*/
1624: /* Variants of kTextEncodingMacHebrew*/
1625: kMacHebrewStandardVariant = 0,
1626: kMacHebrewFigureSpaceVariant = 1, /* Variants of Unicode & ISO 10646 encodings*/
1627: kUnicodeNoSubset = 0,
1628: kUnicodeNoCompatibilityVariant = 1,
1629: kUnicodeMaxDecomposedVariant = 2,
1630: kUnicodeNoComposedVariant = 3,
1631: kUnicodeNoCorporateVariant = 4, /* Variants of Big-5 encoding*/
1632: kBig5_BasicVariant = 0,
1633: kBig5_StandardVariant = 1, /* 0xC6A1-0xC7FC: kana, Cyrillic, enclosed numerics*/
1634: kBig5_ETenVariant = 2, /* adds kana, Cyrillic, radicals, etc with hi bytes C6-C8,F9*/
1635: /* The following are older names for backward compatibility*/
1636: kJapaneseStandardVariant = 0,
1637: kJapaneseStdNoVerticalsVariant = 1,
1638: kJapaneseBasicVariant = 2,
1639: kJapanesePostScriptScrnVariant = 3,
1640: kJapanesePostScriptPrintVariant = 4,
1641: kJapaneseVertAtKuPlusTenVariant = 5, /* kJapaneseStdNoOneByteKanaVariant = 6, // replaced by kJapaneseNoOneByteKanaOption*/
1642: /* kJapaneseBasicNoOneByteKanaVariant = 7, // replaced by kJapaneseNoOneByteKanaOption */
1643: kHebrewStandardVariant = 0,
1644: kHebrewFigureSpaceVariant = 1
1645: };
1646:
1647: /* TextEncodingFormat type & values */
1648: typedef UInt32 TextEncodingFormat;
1649:
1650: enum {
1651: /* Default TextEncodingFormat for any TextEncodingBase*/
1652: kTextEncodingDefaultFormat = 0, /* Formats for Unicode & ISO 10646*/
1653: kUnicode16BitFormat = 0,
1654: kUnicodeUTF7Format = 1,
1655: kUnicodeUTF8Format = 2,
1656: kUnicode32BitFormat = 3
1657: };
1658:
1659: /* TextEncoding type */
1660: typedef UInt32 TextEncoding;
1661: /* name part selector for GetTextEncodingName*/
1662: typedef UInt32 TextEncodingNameSelector;
1663:
1664: enum {
1665: kTextEncodingFullName = 0,
1666: kTextEncodingBaseName = 1,
1667: kTextEncodingVariantName = 2,
1668: kTextEncodingFormatName = 3
1669: };
1670:
1671: /* Types used in conversion */
1672: struct TextEncodingRun {
1673: ByteOffset offset;
1674: TextEncoding textEncoding;
1675: };
1676: typedef struct TextEncodingRun TextEncodingRun;
1677:
1678: typedef TextEncodingRun * TextEncodingRunPtr;
1679: typedef const TextEncodingRun * ConstTextEncodingRunPtr;
1680: struct ScriptCodeRun {
1681: ByteOffset offset;
1682: ScriptCode script;
1683: };
1684: typedef struct ScriptCodeRun ScriptCodeRun;
1685:
1686: typedef ScriptCodeRun * ScriptCodeRunPtr;
1687: typedef const ScriptCodeRun * ConstScriptCodeRunPtr;
1688: typedef UInt8 * TextPtr;
1689: typedef const UInt8 * ConstTextPtr;
1690: /* Basic types for Unicode characters and strings: */
1691: typedef UniChar * UniCharArrayPtr;
1692: typedef const UniChar * ConstUniCharArrayPtr;
1693: /* enums for TextEncoding Conversion routines*/
1694:
1695: enum {
1696: kTextScriptDontCare = -128,
1697: kTextLanguageDontCare = -128,
1698: kTextRegionDontCare = -128
1699: };
1700:
1701:
1702:
1703: /*
1704: File: UnicodeConverter.h
1705:
1706:
1707: */
1708:
1709: /* Unicode conversion contexts: */
1710: typedef struct OpaqueTextToUnicodeInfo* TextToUnicodeInfo;
1711: typedef struct OpaqueUnicodeToTextInfo* UnicodeToTextInfo;
1712: typedef struct OpaqueUnicodeToTextRunInfo* UnicodeToTextRunInfo;
1713: typedef const TextToUnicodeInfo ConstTextToUnicodeInfo;
1714: typedef const UnicodeToTextInfo ConstUnicodeToTextInfo;
1715: /* UnicodeMapVersion type & values */
1716: typedef SInt32 UnicodeMapVersion;
1717:
1718: enum {
1719: kUnicodeUseLatestMapping = -1,
1720: kUnicodeUseHFSPlusMapping = 4
1721: };
1722:
1723: /* Types used in conversion */
1724: struct UnicodeMapping {
1725: TextEncoding unicodeEncoding;
1726: TextEncoding otherEncoding;
1727: UnicodeMapVersion mappingVersion;
1728: };
1729: typedef struct UnicodeMapping UnicodeMapping;
1730:
1731: typedef UnicodeMapping * UnicodeMappingPtr;
1732: typedef const UnicodeMapping * ConstUnicodeMappingPtr;
1733: /* Control flags for ConvertFromUnicodeToText and ConvertFromTextToUnicode */
1734:
1735: enum {
1736: kUnicodeUseFallbacksBit = 0,
1737: kUnicodeKeepInfoBit = 1,
1738: kUnicodeDirectionalityBits = 2,
1739: kUnicodeVerticalFormBit = 4,
1740: kUnicodeLooseMappingsBit = 5,
1741: kUnicodeStringUnterminatedBit = 6,
1742: kUnicodeTextRunBit = 7,
1743: kUnicodeKeepSameEncodingBit = 8
1744: };
1745:
1746:
1747: enum {
1748: kUnicodeUseFallbacksMask = 1L << kUnicodeUseFallbacksBit,
1749: kUnicodeKeepInfoMask = 1L << kUnicodeKeepInfoBit,
1750: kUnicodeDirectionalityMask = 3L << kUnicodeDirectionalityBits,
1751: kUnicodeVerticalFormMask = 1L << kUnicodeVerticalFormBit,
1752: kUnicodeLooseMappingsMask = 1L << kUnicodeLooseMappingsBit,
1753: kUnicodeStringUnterminatedMask = 1L << kUnicodeStringUnterminatedBit,
1754: kUnicodeTextRunMask = 1L << kUnicodeTextRunBit,
1755: kUnicodeKeepSameEncodingMask = 1L << kUnicodeKeepSameEncodingBit
1756: };
1757:
1758: /* Values for kUnicodeDirectionality field */
1759:
1760: enum {
1761: kUnicodeDefaultDirection = 0,
1762: kUnicodeLeftToRight = 1,
1763: kUnicodeRightToLeft = 2
1764: };
1765:
1766: /* Directionality masks for control flags */
1767:
1768: enum {
1769: kUnicodeDefaultDirectionMask = kUnicodeDefaultDirection << kUnicodeDirectionalityBits,
1770: kUnicodeLeftToRightMask = kUnicodeLeftToRight << kUnicodeDirectionalityBits,
1771: kUnicodeRightToLeftMask = kUnicodeRightToLeft << kUnicodeDirectionalityBits
1772: };
1773:
1774: /* Control flags for TruncateForUnicodeToText: */
1775: /*
1776: Now TruncateForUnicodeToText uses control flags from the same set as used by
1777: ConvertFromTextToUnicode, ConvertFromUnicodeToText, etc., but only
1778: kUnicodeStringUnterminatedMask is meaningful for TruncateForUnicodeToText.
1779:
1780: Previously two special control flags were defined for TruncateForUnicodeToText:
1781: kUnicodeTextElementSafeBit = 0
1782: kUnicodeRestartSafeBit = 1
1783: However, neither of these was implemented.
1784: Instead of implementing kUnicodeTextElementSafeBit, we now use
1785: kUnicodeStringUnterminatedMask since it accomplishes the same thing and avoids
1786: having special flags just for TruncateForUnicodeToText
1787: Also, kUnicodeRestartSafeBit is unnecessary, since restart-safeness is handled by
1788: setting kUnicodeKeepInfoBit with ConvertFromUnicodeToText.
1789: If TruncateForUnicodeToText is called with one or both of the old special control
1790: flags set (bits 0 or 1), it will not generate a paramErr, but the old bits have no
1791: effect on its operation.
1792: */
1793:
1794: /* Filter bits for filter field in QueryUnicodeMappings and CountUnicodeMappings: */
1795:
1796: enum {
1797: kUnicodeMatchUnicodeBaseBit = 0,
1798: kUnicodeMatchUnicodeVariantBit = 1,
1799: kUnicodeMatchUnicodeFormatBit = 2,
1800: kUnicodeMatchOtherBaseBit = 3,
1801: kUnicodeMatchOtherVariantBit = 4,
1802: kUnicodeMatchOtherFormatBit = 5
1803: };
1804:
1805:
1806: enum {
1807: kUnicodeMatchUnicodeBaseMask = 1L << kUnicodeMatchUnicodeBaseBit,
1808: kUnicodeMatchUnicodeVariantMask = 1L << kUnicodeMatchUnicodeVariantBit,
1809: kUnicodeMatchUnicodeFormatMask = 1L << kUnicodeMatchUnicodeFormatBit,
1810: kUnicodeMatchOtherBaseMask = 1L << kUnicodeMatchOtherBaseBit,
1811: kUnicodeMatchOtherVariantMask = 1L << kUnicodeMatchOtherVariantBit,
1812: kUnicodeMatchOtherFormatMask = 1L << kUnicodeMatchOtherFormatBit
1813: };
1814:
1815: /* Control flags for SetFallbackUnicodeToText */
1816:
1817: enum {
1818: kUnicodeFallbackSequencingBits = 0
1819: };
1820:
1821:
1822: enum {
1823: kUnicodeFallbackSequencingMask = 3L << kUnicodeFallbackSequencingBits
1824: };
1825:
1826: /* values for kUnicodeFallbackSequencing field */
1827:
1828: enum {
1829: kUnicodeFallbackDefaultOnly = 0L,
1830: kUnicodeFallbackCustomOnly = 1L,
1831: kUnicodeFallbackDefaultFirst = 2L,
1832: kUnicodeFallbackCustomFirst = 3L
1833: };
1834:
1835:
1836:
1837: /*
1838: File: Timer.h
1839:
1840:
1841: */
1842:
1843:
1844: enum {
1845: /* high bit of qType is set if task is active */
1846: kTMTaskActive = (1L << 15)
1847: };
1848:
1849: typedef struct TMTask TMTask;
1850: typedef TMTask * TMTaskPtr;
1851: typedef CALLBACK_API( void , TimerProcPtr )(TMTaskPtr tmTaskPtr);
1852: /*
1853: WARNING: TimerProcPtr uses register based parameters under classic 68k
1854: and cannot be written in a high-level language without
1855: the help of mixed mode or assembly glue.
1856: */
1857: typedef REGISTER_UPP_TYPE(TimerProcPtr) TimerUPP;
1858: struct TMTask {
1859: QElemPtr qLink;
1860: short qType;
1861: TimerUPP tmAddr;
1862: long tmCount;
1863: long tmWakeUp;
1864: long tmReserved;
1865: };
1866:
1867:
1868: /*
1869: File: TextCommonPriv.h
1870:
1871:
1872: */
1873:
1874:
1875: /*
1876: -----------------------------------------------------------------------------------------------------------
1877: TextEncoding creation & extraction macros.
1878: Current packed format:
1879: 31 30 29 26 25 16 15 0
1880: |pack| format | variant | base |
1881: |vers| | | |
1882: |2bit| 4 bits | 10 bits | 16 bits |
1883: Unpacked elements
1884: base 15 0
1885: | 0 | 16 bits |
1886: variant 9 0
1887: | 0 | 10 bits |
1888: format 3 0
1889: | 0 | 4 bits |
1890: -----------------------------------------------------------------------------------------------------------
1891: */
1892:
1893: enum {
1894: kTextEncodingVersion = 0
1895: };
1896:
1897:
1898: enum {
1899: kTextEncodingBaseShiftBits = 0, /* <13>*/
1900: kTextEncodingVariantShiftBits = 16, /* <13>*/
1901: kTextEncodingFormatShiftBits = 26, /* <13><16>*/
1902: kTextEncodingVersionShiftBits = 30
1903: };
1904:
1905:
1906:
1907: enum {
1908: kTextEncodingBaseSourceMask = 0x0000FFFF, /* 16 bits <13>*/
1909: kTextEncodingVariantSourceMask = 0x000003FF, /* 10 bits <13><16>*/
1910: kTextEncodingFormatSourceMask = 0x0000000F, /* 4 bits <13><16>*/
1911: kTextEncodingVersionSourceMask = 0x00000003 /* 2 bits*/
1912: };
1913:
1914:
1915: enum {
1916: kTextEncodingBaseMask = kTextEncodingBaseSourceMask << kTextEncodingBaseShiftBits,
1917: kTextEncodingVariantMask = kTextEncodingVariantSourceMask << kTextEncodingVariantShiftBits,
1918: kTextEncodingFormatMask = kTextEncodingFormatSourceMask << kTextEncodingFormatShiftBits,
1919: kTextEncodingVersionMask = kTextEncodingVersionSourceMask << kTextEncodingVersionShiftBits
1920: };
1921:
1922:
1923: enum {
1924: kTextEncodingVersionShifted = (kTextEncodingVersion & kTextEncodingVersionSourceMask) << kTextEncodingVersionShiftBits
1925: };
1926:
1927:
1928: #define CreateTextEncodingPriv(base,variant,format) \
1929: ( ((base & kTextEncodingBaseSourceMask) << kTextEncodingBaseShiftBits) \
1930: | ((variant & kTextEncodingVariantSourceMask) << kTextEncodingVariantShiftBits) \
1931: | ((format & kTextEncodingFormatSourceMask) << kTextEncodingFormatShiftBits) \
1932: | (kTextEncodingVersionShifted) )
1933: #define GetTextEncodingBasePriv(encoding) \
1934: ((encoding & kTextEncodingBaseMask) >> kTextEncodingBaseShiftBits)
1935: #define GetTextEncodingVariantPriv(encoding) \
1936: ((encoding & kTextEncodingVariantMask) >> kTextEncodingVariantShiftBits)
1937: #define GetTextEncodingFormatPriv(encoding) \
1938: ((encoding & kTextEncodingFormatMask) >> kTextEncodingFormatShiftBits)
1939: #define IsMacTextEncoding(encoding) ((encoding & 0x0000FF00L) == 0x00000000L)
1940: #define IsUnicodeTextEncoding(encoding) ((encoding & 0x0000FF00L) == 0x00000100L)
1941: /* TextEncoding used by HFS*/
1942:
1943: enum {
1944: kMacHFSTextEncoding = 0x000000FF
1945: };
1946:
1947:
1948: /*
1949: File: Instrumentation.h
1950:
1951:
1952: */
1953: /*******************************************************************/
1954: /* Types */
1955: /*******************************************************************/
1956: /* Reference to an instrumentation class */
1957: typedef struct InstOpaqueClassRef* InstClassRef;
1958:
1959: /* Aliases to the generic instrumentation class for each type of class */
1960: typedef InstClassRef InstPathClassRef;
1961: typedef InstClassRef InstTraceClassRef;
1962: typedef InstClassRef InstHistogramClassRef;
1963: typedef InstClassRef InstSplitHistogramClassRef;
1964: typedef InstClassRef InstMagnitudeClassRef;
1965: typedef InstClassRef InstGrowthClassRef;
1966: typedef InstClassRef InstTallyClassRef;
1967:
1968: /* Reference to a data descriptor */
1969: typedef struct InstOpaqueDataDescriptorRef* InstDataDescriptorRef;
1970:
1971:
1972: /*******************************************************************/
1973: /* Constant Definitions */
1974: /*******************************************************************/
1975:
1976: /* Reference to the root of the class hierarchy */
1977: #define kInstRootClassRef ( (InstClassRef) -1)
1978:
1979: /* Options used for creating classes */
1980: typedef OptionBits InstClassOptions;
1981:
1982:
1983: enum {
1984: kInstDisableClassMask = 0x00, /* Create the class disabled */
1985: kInstEnableClassMask = 0x01, /* Create the class enabled */
1986:
1987: kInstSummaryTraceClassMask = 0x20 /* Create a summary trace class instead of a regular one */
1988: };
1989:
1990:
1991: EXTERN_API( OSErr )
1992: UTLocateVCBByRefNum (short refNum,
1993: short * vRefNum,
1994: VCBPtr * volCtrlBlockPtr);
1995:
1996: #if 0
1997: EXTERN_API( Ptr ) LMGetFCBSPtr(void);
1998: EXTERN_API( void ) LMSetFCBSPtr(Ptr value);
1999:
2000: EXTERN_API( SInt16 ) LMGetFSFCBLen(void);
2001: EXTERN_API( void ) LMSetFSFCBLen(SInt16 value);
2002:
2003: EXTERN_API( QHdrPtr ) LMGetVCBQHdr(void);
2004: EXTERN_API( void ) LMSetVCBQHdr(QHdrPtr value);
2005:
2006: EXTERN_API( Ptr ) LMGetDefVCBPtr(void);
2007: EXTERN_API( void ) LMSetDefVCBPtr(Ptr value);
2008: #endif
2009:
2010: EXTERN_API( Boolean )
2011: EqualString (ConstStr255Param str1,
2012: ConstStr255Param str2,
2013: Boolean caseSensitive,
2014: Boolean diacSensitive);
2015:
2016:
2017:
2018:
2019: /*
2020: File: LowMemPriv.h
2021:
2022:
2023: */
2024:
2025: /* The following replace storage used in low-mem on MacOS: */
2026: extern struct FSVarsRec * gFSMVars;
2027:
2028: #if TARGET_OS_RHAPSODY
2029:
2030: #define LMGetFSMVars() gFSMVars
2031:
2032: #endif
2033:
2034: #if 0
2035: EXTERN_API( void )
2036: LMSetFSMVars (Ptr value);
2037:
2038: EXTERN_API( Ptr )
2039: LMGetPMSPPtr (void);
2040: EXTERN_API( void )
2041: LMSetPMSPPtr (Ptr value);
2042:
2043: EXTERN_API( Ptr )
2044: LMGetWDCBsPtr (void);
2045: EXTERN_API( void )
2046: LMSetWDCBsPtr (Ptr value);
2047: #endif
2048:
2049: EXTERN_API( void )
2050: InsTime (QElemPtr tmTaskPtr);
2051: EXTERN_API( void )
2052: PrimeTime (QElemPtr tmTaskPtr,
2053: long count);
2054: EXTERN_API( void )
2055: RmvTime (QElemPtr tmTaskPtr);
2056:
2057:
2058:
2059:
2060: /* PROTOTYPES */
2061:
2062: #if DIAGNOSTIC
2063: extern void RequireFileLock(FileReference vp, int shareable);
2064: #else
2065: #define RequireFileLock(vp,s)
2066: #endif
2067:
2068:
2069: EXTERN_API( void )
2070: BlockMove (const void * srcPtr,
2071: void * destPtr,
2072: Size byteCount);
2073: EXTERN_API( void )
2074: BlockMoveData (const void * srcPtr,
2075: void * destPtr,
2076: Size byteCount);
2077:
2078: EXTERN_API_C( void )
2079: BlockMoveUncached (const void * srcPtr,
2080: void * destPtr,
2081: Size byteCount);
2082:
2083: EXTERN_API_C( void )
2084: BlockMoveDataUncached (const void * srcPtr,
2085: void * destPtr,
2086: Size byteCount);
2087:
2088: EXTERN_API_C( void )
2089: BlockZero (void * destPtr,
2090: Size byteCount);
2091:
2092: EXTERN_API_C( void )
2093: BlockZeroUncached (void * destPtr,
2094: Size byteCount);
2095:
2096: EXTERN_API( Ptr )
2097: NewPtr (Size byteCount);
2098:
2099: EXTERN_API( Ptr )
2100: NewPtrSys (Size byteCount);
2101:
2102: EXTERN_API( Ptr )
2103: NewPtrClear (Size byteCount);
2104:
2105: EXTERN_API( Ptr )
2106: NewPtrSysClear (Size byteCount);
2107:
2108: EXTERN_API( OSErr )
2109: MemError (void);
2110:
2111: EXTERN_API( void )
2112: DisposePtr (Ptr p);
2113:
2114: EXTERN_API( Size )
2115: GetPtrSize (Ptr p);
2116:
2117: EXTERN_API( void )
2118: SetPtrSize (Ptr p,
2119: Size newSize);
2120:
2121: EXTERN_API( void )
2122: DisposeHandle (Handle h);
2123:
2124: EXTERN_API( void )
2125: SetHandleSize (Handle h,
2126: Size newSize);
2127:
2128: /*
2129: File: DateTimeUtils.h
2130:
2131:
2132: */
2133: EXTERN_API( void )
2134: GetDateTime (unsigned long * secs);
2135:
2136:
2137:
2138:
2139: #if 0
2140: /*************************** Creation routines ***************************/
2141: /* Create a class that has no statistic or trace data. It is a path node in the class hierarchy */
2142: extern pascal OSStatus InstCreatePathClass( InstPathClassRef parentClass, const char *className,
2143: InstClassOptions options, InstPathClassRef *returnPathClass);
2144:
2145:
2146: /*
2147: Create a class that can log events to a trace buffer.
2148: */
2149: extern pascal OSStatus InstCreateTraceClass( InstPathClassRef parentClass, const char *className,
2150: OSType component, InstClassOptions options,
2151: InstTraceClassRef *returnTraceClass);
2152:
2153: /*
2154: Create a descriptor to a piece of data
2155: DataDescriptors must be used when logging trace data so that generic browsers can display the data.
2156: */
2157: extern pascal OSStatus InstCreateDataDescriptor( const char *formatString, InstDataDescriptorRef *returnDescriptor);
2158:
2159:
2160:
2161: extern pascal OSStatus InstInitialize68K( void);
2162: #endif
2163:
2164:
2165: #endif /* __MACOSSTUBS__ */
2166:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.