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