Files.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:276k
源码类别:

多媒体编程

开发平台:

Visual C++

  1.                                                                                             #endif
  2. EXTERN_API( OSErr ) PBGetAltAccessSync(HParmBlkPtr paramBlock)                              TWOWORDINLINE(0x7060, 0xA060);
  3.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  4.                                                                                             #pragma parameter __D0 PBGetAltAccessAsync(__A0)
  5.                                                                                             #endif
  6. EXTERN_API( OSErr ) PBGetAltAccessAsync(HParmBlkPtr paramBlock)                             TWOWORDINLINE(0x7060, 0xA460);
  7.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  8.                                                                                             #pragma parameter __D0 PBSetAltAccessSync(__A0)
  9.                                                                                             #endif
  10. EXTERN_API( OSErr ) PBSetAltAccessSync(HParmBlkPtr paramBlock)                              TWOWORDINLINE(0x7061, 0xA060);
  11.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  12.                                                                                             #pragma parameter __D0 PBSetAltAccessAsync(__A0)
  13.                                                                                             #endif
  14. EXTERN_API( OSErr ) PBSetAltAccessAsync(HParmBlkPtr paramBlock)                             TWOWORDINLINE(0x7061, 0xA460);
  15. #endif  /* CALL_NOT_IN_CARBON */
  16. #define PBSetAltAccess(pb, async) ((async) ? PBSetAltAccessAsync(pb) : PBSetAltAccessSync(pb))
  17. #define PBGetAltAccess(pb, async) ((async) ? PBGetAltAccessAsync(pb) : PBGetAltAccessSync(pb))
  18. #endif  /* TARGET_CPU_68K */
  19. /*
  20.     The PBxxx() routines are obsolete.  
  21.     
  22.     Use the PBxxxSync() or PBxxxAsync() version instead.
  23. */
  24. #define PBGetVInfo(pb, async) ((async) ? PBGetVInfoAsync(pb) : PBGetVInfoSync(pb))
  25. #define PBXGetVolInfo(pb, async) ((async) ? PBXGetVolInfoAsync(pb) : PBXGetVolInfoSync(pb))
  26. #define PBGetVol(pb, async) ((async) ? PBGetVolAsync(pb) : PBGetVolSync(pb))
  27. #define PBSetVol(pb, async) ((async) ? PBSetVolAsync(pb) : PBSetVolSync(pb))
  28. #define PBFlushVol(pb, async) ((async) ? PBFlushVolAsync(pb) : PBFlushVolSync(pb))
  29. #define PBCreate(pb, async) ((async) ? PBCreateAsync(pb) : PBCreateSync(pb))
  30. #define PBDelete(pb, async) ((async) ? PBDeleteAsync(pb) : PBDeleteSync(pb))
  31. #define PBOpenDF(pb, async) ((async) ? PBOpenDFAsync(pb) : PBOpenDFSync(pb))
  32. #define PBOpenRF(pb, async) ((async) ? PBOpenRFAsync(pb) : PBOpenRFSync(pb))
  33. #define PBRename(pb, async) ((async) ? PBRenameAsync(pb) : PBRenameSync(pb))
  34. #define PBGetFInfo(pb, async) ((async) ? PBGetFInfoAsync(pb) : PBGetFInfoSync(pb))
  35. #define PBSetFInfo(pb, async) ((async) ? PBSetFInfoAsync(pb) : PBSetFInfoSync(pb))
  36. #define PBSetFLock(pb, async) ((async) ? PBSetFLockAsync(pb) : PBSetFLockSync(pb))
  37. #define PBRstFLock(pb, async) ((async) ? PBRstFLockAsync(pb) : PBRstFLockSync(pb))
  38. #define PBSetFVers(pb, async) ((async) ? PBSetFVersAsync(pb) : PBSetFVersSync(pb))
  39. #define PBAllocate(pb, async) ((async) ? PBAllocateAsync(pb) : PBAllocateSync(pb))
  40. #define PBGetEOF(pb, async) ((async) ? PBGetEOFAsync(pb) : PBGetEOFSync(pb))
  41. #define PBSetEOF(pb, async) ((async) ? PBSetEOFAsync(pb) : PBSetEOFSync(pb))
  42. #define PBGetFPos(pb, async) ((async) ? PBGetFPosAsync(pb) : PBGetFPosSync(pb))
  43. #define PBSetFPos(pb, async) ((async) ? PBSetFPosAsync(pb) : PBSetFPosSync(pb))
  44. #define PBFlushFile(pb, async) ((async) ? PBFlushFileAsync(pb) : PBFlushFileSync(pb))
  45. #define PBCatSearch(pb, async) ((async) ? PBCatSearchAsync(pb) : PBCatSearchSync(pb))
  46. #define PBOpenWD(pb, async) ((async) ? PBOpenWDAsync(pb) : PBOpenWDSync(pb))
  47. #define PBCloseWD(pb, async) ((async) ? PBCloseWDAsync(pb) : PBCloseWDSync(pb))
  48. #define PBHSetVol(pb, async) ((async) ? PBHSetVolAsync(pb) : PBHSetVolSync(pb))
  49. #define PBHGetVol(pb, async) ((async) ? PBHGetVolAsync(pb) : PBHGetVolSync(pb))
  50. #define PBCatMove(pb, async) ((async) ? PBCatMoveAsync(pb) : PBCatMoveSync(pb))
  51. #define PBDirCreate(pb, async) ((async) ? PBDirCreateAsync(pb) : PBDirCreateSync(pb))
  52. #define PBGetWDInfo(pb, async) ((async) ? PBGetWDInfoAsync(pb) : PBGetWDInfoSync(pb))
  53. #define PBGetFCBInfo(pb, async) ((async) ? PBGetFCBInfoAsync(pb) : PBGetFCBInfoSync(pb))
  54. #define PBGetCatInfo(pb, async) ((async) ? PBGetCatInfoAsync(pb) : PBGetCatInfoSync(pb))
  55. #define PBSetCatInfo(pb, async) ((async) ? PBSetCatInfoAsync(pb) : PBSetCatInfoSync(pb))
  56. #define PBAllocContig(pb, async) ((async) ? PBAllocContigAsync(pb) : PBAllocContigSync(pb))
  57. #define PBLockRange(pb, async) ((async) ? PBLockRangeAsync(pb) : PBLockRangeSync(pb))
  58. #define PBUnlockRange(pb, async) ((async) ? PBUnlockRangeAsync(pb) : PBUnlockRangeSync(pb))
  59. #define PBSetVInfo(pb, async) ((async) ? PBSetVInfoAsync(pb) : PBSetVInfoSync(pb))
  60. #define PBHGetVInfo(pb, async) ((async) ? PBHGetVInfoAsync(pb) : PBHGetVInfoSync(pb))
  61. #define PBHOpen(pb, async) ((async) ? PBHOpenAsync(pb) : PBHOpenSync(pb))
  62. #define PBHOpenRF(pb, async) ((async) ? PBHOpenRFAsync(pb) : PBHOpenRFSync(pb))
  63. #define PBHOpenDF(pb, async) ((async) ? PBHOpenDFAsync(pb) : PBHOpenDFSync(pb))
  64. #define PBHCreate(pb, async) ((async) ? PBHCreateAsync(pb) : PBHCreateSync(pb))
  65. #define PBHDelete(pb, async) ((async) ? PBHDeleteAsync(pb) : PBHDeleteSync(pb))
  66. #define PBHRename(pb, async) ((async) ? PBHRenameAsync(pb) : PBHRenameSync(pb))
  67. #define PBHRstFLock(pb, async) ((async) ? PBHRstFLockAsync(pb) : PBHRstFLockSync(pb))
  68. #define PBHSetFLock(pb, async) ((async) ? PBHSetFLockAsync(pb) : PBHSetFLockSync(pb))
  69. #define PBHGetFInfo(pb, async) ((async) ? PBHGetFInfoAsync(pb) : PBHGetFInfoSync(pb))
  70. #define PBHSetFInfo(pb, async) ((async) ? PBHSetFInfoAsync(pb) : PBHSetFInfoSync(pb))
  71. #define PBMakeFSSpec(pb, async) ((async) ? PBMakeFSSpecAsync(pb) : PBMakeFSSpecSync(pb))
  72. #define PBHGetVolParms(pb, async) ((async) ? PBHGetVolParmsAsync(pb) : PBHGetVolParmsSync(pb))
  73. #define PBHGetLogInInfo(pb, async) ((async) ? PBHGetLogInInfoAsync(pb) : PBHGetLogInInfoSync(pb))
  74. #define PBHGetDirAccess(pb, async) ((async) ? PBHGetDirAccessAsync(pb) : PBHGetDirAccessSync(pb))
  75. #define PBHSetDirAccess(pb, async) ((async) ? PBHSetDirAccessAsync(pb) : PBHSetDirAccessSync(pb))
  76. #define PBHMapID(pb, async) ((async) ? PBHMapIDAsync(pb) : PBHMapIDSync(pb))
  77. #define PBHMapName(pb, async) ((async) ? PBHMapNameAsync(pb) : PBHMapNameSync(pb))
  78. #define PBHCopyFile(pb, async) ((async) ? PBHCopyFileAsync(pb) : PBHCopyFileSync(pb))
  79. #define PBHMoveRename(pb, async) ((async) ? PBHMoveRenameAsync(pb) : PBHMoveRenameSync(pb))
  80. #define PBHOpenDeny(pb, async) ((async) ? PBHOpenDenyAsync(pb) : PBHOpenDenySync(pb))
  81. #define PBHOpenRFDeny(pb, async) ((async) ? PBHOpenRFDenyAsync(pb) : PBHOpenRFDenySync(pb))
  82. #define PBExchangeFiles(pb, async) ((async) ? PBExchangeFilesAsync(pb) : PBExchangeFilesSync(pb))
  83. #define PBCreateFileIDRef(pb, async) ((async) ? PBCreateFileIDRefAsync(pb) : PBCreateFileIDRefSync(pb))
  84. #define PBResolveFileIDRef(pb, async) ((async) ? PBResolveFileIDRefAsync(pb) : PBResolveFileIDRefSync(pb))
  85. #define PBDeleteFileIDRef(pb, async) ((async) ? PBDeleteFileIDRefAsync(pb) : PBDeleteFileIDRefSync(pb))
  86. #define PBGetForeignPrivs(pb, async) ((async) ? PBGetForeignPrivsAsync(pb) : PBGetForeignPrivsSync(pb))
  87. #define PBSetForeignPrivs(pb, async) ((async) ? PBSetForeignPrivsAsync(pb) : PBSetForeignPrivsSync(pb))
  88. #define PBDTAddIcon(pb, async) ((async) ? PBDTAddIconAsync(pb) : PBDTAddIconSync(pb))
  89. #define PBDTGetIcon(pb, async) ((async) ? PBDTGetIconAsync(pb) : PBDTGetIconSync(pb))
  90. #define PBDTGetIconInfo(pb, async) ((async) ? PBDTGetIconInfoAsync(pb) : PBDTGetIconInfoSync(pb))
  91. #define PBDTAddAPPL(pb, async) ((async) ? PBDTAddAPPLAsync(pb) : PBDTAddAPPLSync(pb))
  92. #define PBDTRemoveAPPL(pb, async) ((async) ? PBDTRemoveAPPLAsync(pb) : PBDTRemoveAPPLSync(pb))
  93. #define PBDTGetAPPL(pb, async) ((async) ? PBDTGetAPPLAsync(pb) : PBDTGetAPPLSync(pb))
  94. #define PBDTSetComment(pb, async) ((async) ? PBDTSetCommentAsync(pb) : PBDTSetCommentSync(pb))
  95. #define PBDTRemoveComment(pb, async) ((async) ? PBDTRemoveCommentAsync(pb) : PBDTRemoveCommentSync(pb))
  96. #define PBDTGetComment(pb, async) ((async) ? PBDTGetCommentAsync(pb) : PBDTGetCommentSync(pb))
  97. #define PBDTFlush(pb, async) ((async) ? PBDTFlushAsync(pb) : PBDTFlushSync(pb))
  98. #define PBDTReset(pb, async) ((async) ? PBDTResetAsync(pb) : PBDTResetSync(pb))
  99. #define PBDTGetInfo(pb, async) ((async) ? PBDTGetInfoAsync(pb) : PBDTGetInfoSync(pb))
  100. #define PBDTDelete(pb, async) ((async) ? PBDTDeleteAsync(pb) : PBDTDeleteSync(pb))
  101. typedef SInt16                          FSVolumeRefNum;
  102. enum {
  103.     kFSInvalidVolumeRefNum      = 0
  104. };
  105. #if TARGET_OS_WIN32
  106. struct FSRef {
  107.     UInt8                           hidden[600];                /* private to File Manager; oo need symbolic constant */
  108. };
  109. typedef struct FSRef                    FSRef;
  110. #else
  111. struct FSRef {
  112.     UInt8                           hidden[80];                 /* private to File Manager; oo need symbolic constant */
  113. };
  114. typedef struct FSRef                    FSRef;
  115. #endif  /* TARGET_OS_WIN32 */
  116. typedef FSRef *                         FSRefPtr;
  117. /*  CatalogInfoBitmap describes which fields of the CatalogInfo you wish to get or set.*/
  118. typedef UInt32                          FSCatalogInfoBitmap;
  119. enum {
  120.     kFSCatInfoNone              = 0x00000000,
  121.     kFSCatInfoTextEncoding      = 0x00000001,
  122.     kFSCatInfoNodeFlags         = 0x00000002,                   /* Locked (bit 0) and directory (bit 4) only */
  123.     kFSCatInfoVolume            = 0x00000004,
  124.     kFSCatInfoParentDirID       = 0x00000008,
  125.     kFSCatInfoNodeID            = 0x00000010,
  126.     kFSCatInfoCreateDate        = 0x00000020,
  127.     kFSCatInfoContentMod        = 0x00000040,
  128.     kFSCatInfoAttrMod           = 0x00000080,
  129.     kFSCatInfoAccessDate        = 0x00000100,
  130.     kFSCatInfoBackupDate        = 0x00000200,
  131.     kFSCatInfoPermissions       = 0x00000400,                   /* Should this be finer granularity? */
  132.     kFSCatInfoFinderInfo        = 0x00000800,
  133.     kFSCatInfoFinderXInfo       = 0x00001000,
  134.     kFSCatInfoValence           = 0x00002000,                   /* Folders only, zero for files */
  135.     kFSCatInfoDataSizes         = 0x00004000,                   /* Data fork logical and physical size */
  136.     kFSCatInfoRsrcSizes         = 0x00008000,                   /* Resource fork logical and physical size */
  137.     kFSCatInfoSharingFlags      = 0x00010000,                   /* sharingFlags: kioFlAttribMountedBit, kioFlAttribSharePointBit */
  138.     kFSCatInfoUserPrivs         = 0x00020000,                   /* userPrivileges */
  139.     kFSCatInfoAllDates          = 0x000003E0,
  140.     kFSCatInfoGettableInfo      = 0x0003FFFF,
  141.     kFSCatInfoSettableInfo      = 0x00001FE3,                   /* flags, dates, permissions, Finder info, text encoding */
  142.     kFSCatInfoReserved          = (long)0xFFFC0000              /* bits that are currently reserved */
  143. };
  144. /*  Constants for nodeFlags field of FSCatalogInfo*/
  145. enum {
  146.     kFSNodeLockedBit            = 0,
  147.     kFSNodeLockedMask           = 0x0001,
  148.     kFSNodeIsDirectoryBit       = 4,
  149.     kFSNodeIsDirectoryMask      = 0x0010
  150. };
  151. struct FSCatalogInfo {
  152.     UInt16                          nodeFlags;                  /* node flags */
  153.     FSVolumeRefNum                  volume;                     /* object's volume ref */
  154.     UInt32                          parentDirID;                /* parent directory's ID */
  155.     UInt32                          nodeID;                     /* file/directory ID */
  156.     UInt8                           sharingFlags;               /* kioFlAttribMountedBit and kioFlAttribSharePointBit */
  157.     UInt8                           userPrivileges;             /* user's effective AFP privileges (same as ioACUser) */
  158.     UInt8                           reserved1;
  159.     UInt8                           reserved2;
  160.     UTCDateTime                     createDate;                 /* date and time of creation */
  161.     UTCDateTime                     contentModDate;             /* date and time of last fork modification */
  162.     UTCDateTime                     attributeModDate;           /* date and time of last attribute modification */
  163.     UTCDateTime                     accessDate;                 /* date and time of last access (for Mac OS X) */
  164.     UTCDateTime                     backupDate;                 /* date and time of last backup */
  165.     UInt32                          permissions[4];             /* permissions (for Mac OS X) */
  166.     UInt8                           finderInfo[16];             /* Finder information part 1 */
  167.     UInt8                           extFinderInfo[16];          /* Finder information part 2 */
  168.     UInt64                          dataLogicalSize;            /* files only */
  169.     UInt64                          dataPhysicalSize;           /* files only */
  170.     UInt64                          rsrcLogicalSize;            /* files only */
  171.     UInt64                          rsrcPhysicalSize;           /* files only */
  172.     UInt32                          valence;                    /* folders only */
  173.     TextEncoding                    textEncodingHint;
  174. };
  175. typedef struct FSCatalogInfo            FSCatalogInfo;
  176. typedef FSCatalogInfo *                 FSCatalogInfoPtr;
  177. struct FSRefParam {
  178.     QElemPtr                        qLink;                      /*queue link in header*/
  179.     short                           qType;                      /*type byte for safety check*/
  180.     short                           ioTrap;                     /*FS: the Trap*/
  181.     Ptr                             ioCmdAddr;                  /*FS: address to dispatch to*/
  182.     IOCompletionUPP                 ioCompletion;               /*completion routine addr (0 for synch calls)*/
  183.     volatile OSErr                  ioResult;                   /*result code*/
  184.     ConstStringPtr                  ioNamePtr;                  /*ptr to Vol:FileName string*/
  185.     short                           ioVRefNum;                  /*volume refnum (DrvNum for Eject and MountVol)*/
  186.     SInt16                          reserved1;                  /* was ioRefNum */
  187.     UInt8                           reserved2;                  /* was ioVersNum */
  188.     UInt8                           reserved3;                  /* was ioPermssn */
  189.     const FSRef *                   ref;                        /* Input ref; the target of the call */
  190.     FSCatalogInfoBitmap             whichInfo;
  191.     FSCatalogInfo *                 catInfo;
  192.     UniCharCount                    nameLength;                 /* input name length for create/rename */
  193.     const UniChar *                 name;                       /* input name for create/rename */
  194.     long                            ioDirID;
  195.     FSSpec *                        spec;
  196.     FSRef *                         parentRef;                  /* ref of directory to move another ref to */
  197.     FSRef *                         newRef;                     /* Output ref */
  198.     TextEncoding                    textEncodingHint;           /* for Rename, MakeFSRefUnicode */
  199.     HFSUniStr255 *                  outName;                    /* Output name for GetCatalogInfo */
  200. };
  201. typedef struct FSRefParam               FSRefParam;
  202. typedef FSRefParam *                    FSRefParamPtr;
  203. typedef struct OpaqueFSIterator*        FSIterator;
  204. enum {
  205.     kFSIterateFlat              = 0,                            /* Immediate children of container only */
  206.     kFSIterateSubtree           = 1,                            /* Entire subtree rooted at container */
  207.     kFSIterateReserved          = (long)0xFFFFFFFE
  208. };
  209. typedef OptionBits                      FSIteratorFlags;
  210. enum {
  211.                                                                 /* CatalogSearch constants */
  212.     fsSBNodeID                  = 0x00008000,                   /* search by range of nodeID */
  213.     fsSBAttributeModDate        = 0x00010000,                   /* search by range of attributeModDate */
  214.     fsSBAccessDate              = 0x00020000,                   /* search by range of accessDate */
  215.     fsSBPermissions             = 0x00040000,                   /* search by value/mask of permissions */
  216.     fsSBNodeIDBit               = 15,
  217.     fsSBAttributeModDateBit     = 16,
  218.     fsSBAccessDateBit           = 17,
  219.     fsSBPermissionsBit          = 18
  220. };
  221. struct FSSearchParams {
  222.     Duration                        searchTime;                 /* a Time Manager duration */
  223.     OptionBits                      searchBits;                 /* which fields to search on */
  224.     UniCharCount                    searchNameLength;
  225.     const UniChar *                 searchName;
  226.     FSCatalogInfo *                 searchInfo1;                /* values and lower bounds */
  227.     FSCatalogInfo *                 searchInfo2;                /* masks and upper bounds */
  228. };
  229. typedef struct FSSearchParams           FSSearchParams;
  230. typedef FSSearchParams *                FSSearchParamsPtr;
  231. struct FSCatalogBulkParam {
  232.     QElemPtr                        qLink;                      /*queue link in header*/
  233.     short                           qType;                      /*type byte for safety check*/
  234.     short                           ioTrap;                     /*FS: the Trap*/
  235.     Ptr                             ioCmdAddr;                  /*FS: address to dispatch to*/
  236.     IOCompletionUPP                 ioCompletion;               /*completion routine addr (0 for synch calls)*/
  237.     volatile OSErr                  ioResult;                   /*result code*/
  238.     Boolean                         containerChanged;           /* true if container changed since last iteration */
  239.     UInt8                           reserved;                   /* make following fields 4-byte aligned */
  240.     FSIteratorFlags                 iteratorFlags;
  241.     FSIterator                      iterator;
  242.     const FSRef *                   container;                  /* directory/volume to iterate */
  243.     ItemCount                       maximumItems;
  244.     ItemCount                       actualItems;
  245.     FSCatalogInfoBitmap             whichInfo;
  246.     FSCatalogInfo *                 catalogInfo;                /* returns an array */
  247.     FSRef *                         refs;                       /* returns an array */
  248.     FSSpec *                        specs;                      /* returns an array */
  249.     HFSUniStr255 *                  names;                      /* returns an array */
  250.     const FSSearchParams *          searchParams;
  251. };
  252. typedef struct FSCatalogBulkParam       FSCatalogBulkParam;
  253. typedef FSCatalogBulkParam *            FSCatalogBulkParamPtr;
  254. typedef UInt16                          FSAllocationFlags;
  255. enum {
  256.     kFSAllocDefaultFlags        = 0x0000,                       /* as much as possible, not contiguous */
  257.     kFSAllocAllOrNothingMask    = 0x0001,                       /* allocate all of the space, or nothing */
  258.     kFSAllocContiguousMask      = 0x0002,                       /* new space must be one contiguous piece */
  259.     kFSAllocNoRoundUpMask       = 0x0004,                       /* don't round up allocation to clump size */
  260.     kFSAllocReservedMask        = 0xFFF8                        /* these bits are reserved and must not be set */
  261. };
  262. struct FSForkIOParam {
  263.     QElemPtr                        qLink;                      /*queue link in header*/
  264.     short                           qType;                      /*type byte for safety check*/
  265.     short                           ioTrap;                     /*FS: the Trap*/
  266.     Ptr                             ioCmdAddr;                  /*FS: address to dispatch to*/
  267.     IOCompletionUPP                 ioCompletion;               /*completion routine addr (0 for synch calls)*/
  268.     volatile OSErr                  ioResult;                   /*result code*/
  269.     void *                          reserved1;                  /* was ioNamePtr */
  270.     SInt16                          reserved2;                  /* was ioVRefNum */
  271.     SInt16                          forkRefNum;                 /* same as ioRefNum */
  272.     UInt8                           reserved3;                  /* was ioVersNum */
  273.     SInt8                           permissions;                /* desired access to the fork */
  274.     const FSRef *                   ref;                        /* which object to open */
  275.     Ptr                             buffer;                     /*data buffer Ptr*/
  276.     UInt32                          requestCount;               /*requested byte count*/
  277.     UInt32                          actualCount;                /*actual byte count completed*/
  278.     UInt16                          positionMode;               /*initial file positioning*/
  279.     SInt64                          positionOffset;             /*file position offset*/
  280.     FSAllocationFlags               allocationFlags;
  281.     UInt64                          allocationAmount;
  282.     UniCharCount                    forkNameLength;             /* input; length of fork name */
  283.     const UniChar *                 forkName;                   /* input; name of fork */
  284.     CatPositionRec                  forkIterator;
  285.     HFSUniStr255 *                  outForkName;                /* output; name of fork */
  286. };
  287. typedef struct FSForkIOParam            FSForkIOParam;
  288. typedef FSForkIOParam *                 FSForkIOParamPtr;
  289. struct FSForkInfo {
  290.     SInt8                           flags;                      /* copy of FCB flags */
  291.     SInt8                           permissions;
  292.     FSVolumeRefNum                  volume;
  293.     UInt32                          reserved2;
  294.     UInt32                          nodeID;                     /* file or directory ID */
  295.     UInt32                          forkID;                     /* fork ID */
  296.     UInt64                          currentPosition;
  297.     UInt64                          logicalEOF;
  298.     UInt64                          physicalEOF;
  299.     UInt64                          process;                    /* should be ProcessSerialNumber */
  300. };
  301. typedef struct FSForkInfo               FSForkInfo;
  302. typedef FSForkInfo *                    FSForkInfoPtr;
  303. struct FSForkCBInfoParam {
  304.     QElemPtr                        qLink;                      /*queue link in header*/
  305.     short                           qType;                      /*type byte for safety check*/
  306.     short                           ioTrap;                     /*FS: the Trap*/
  307.     Ptr                             ioCmdAddr;                  /*FS: address to dispatch to*/
  308.     IOCompletionUPP                 ioCompletion;               /*completion routine addr (0 for synch calls)*/
  309.     volatile OSErr                  ioResult;                   /*result code*/
  310.     SInt16                          desiredRefNum;              /* 0 to iterate, non-0 for specific refnum */
  311.     SInt16                          volumeRefNum;               /* volume to match, or 0 for all volumes */
  312.     SInt16                          iterator;                   /* 0 to start iteration */
  313.     SInt16                          actualRefNum;               /* actual refnum found */
  314.     FSRef *                         ref;
  315.     FSForkInfo *                    forkInfo;
  316.     HFSUniStr255 *                  forkName;
  317. };
  318. typedef struct FSForkCBInfoParam        FSForkCBInfoParam;
  319. typedef FSForkCBInfoParam *             FSForkCBInfoParamPtr;
  320. typedef UInt32                          FSVolumeInfoBitmap;
  321. enum {
  322.     kFSVolInfoNone              = 0x0000,
  323.     kFSVolInfoCreateDate        = 0x0001,
  324.     kFSVolInfoModDate           = 0x0002,
  325.     kFSVolInfoBackupDate        = 0x0004,
  326.     kFSVolInfoCheckedDate       = 0x0008,
  327.     kFSVolInfoFileCount         = 0x0010,
  328.     kFSVolInfoDirCount          = 0x0020,
  329.     kFSVolInfoSizes             = 0x0040,                       /* totalBytes and freeBytes */
  330.     kFSVolInfoBlocks            = 0x0080,                       /* blockSize, totalBlocks, freeBlocks */
  331.     kFSVolInfoNextAlloc         = 0x0100,
  332.     kFSVolInfoRsrcClump         = 0x0200,
  333.     kFSVolInfoDataClump         = 0x0400,
  334.     kFSVolInfoNextID            = 0x0800,
  335.     kFSVolInfoFinderInfo        = 0x1000,
  336.     kFSVolInfoFlags             = 0x2000,
  337.     kFSVolInfoFSInfo            = 0x4000,                       /* filesystemID, signature */
  338.     kFSVolInfoDriveInfo         = 0x8000,                       /* driveNumber, driverRefNum */
  339.     kFSVolInfoGettableInfo      = 0xFFFF,                       /* This seems like it is here just for completeness */
  340.     kFSVolInfoSettableInfo      = 0x3004                        /* backup date, Finder info, flags */
  341. };
  342. struct FSVolumeInfo {
  343.                                                                 /* Dates -- zero means "never" or "unknown" */
  344.     UTCDateTime                     createDate;
  345.     UTCDateTime                     modifyDate;
  346.     UTCDateTime                     backupDate;
  347.     UTCDateTime                     checkedDate;
  348.                                                                 /* File/Folder counts -- return zero if unknown */
  349.     UInt32                          fileCount;                  /* total files on volume */
  350.     UInt32                          folderCount;                /* total folders on volume */
  351.                                                                 /* Note: no root directory counts */
  352.     UInt64                          totalBytes;                 /* total number of bytes on volume */
  353.     UInt64                          freeBytes;                  /* number of free bytes on volume */
  354.                                                                 /* HFS and HFS Plus specific.  Set fields to zero if not appropriate */
  355.     UInt32                          blockSize;                  /* size (in bytes) of allocation blocks */
  356.     UInt32                          totalBlocks;                /* number of allocation blocks in volume */
  357.     UInt32                          freeBlocks;                 /* number of unused allocation blocks */
  358.     UInt32                          nextAllocation;             /* start of next allocation search */
  359.     UInt32                          rsrcClumpSize;              /* default resource fork clump size */
  360.     UInt32                          dataClumpSize;              /* default data fork clump size */
  361.     UInt32                          nextCatalogID;              /* next unused catalog node ID ooo OYG ooo need to make HFSVolumes.h work Should be HFSCatalogNodeID*/
  362.     UInt8                           finderInfo[32];             /* information used by Finder */
  363.                                                                 /* Identifying information */
  364.     UInt16                          flags;                      /* ioVAtrb */
  365.     UInt16                          filesystemID;               /* ioVFSID */
  366.     UInt16                          signature;                  /* ioVSigWord, unique within an FSID */
  367.     UInt16                          driveNumber;                /* ioVDrvInfo */
  368.     short                           driverRefNum;               /* ioVDRefNum */
  369. };
  370. typedef struct FSVolumeInfo             FSVolumeInfo;
  371. typedef FSVolumeInfo *                  FSVolumeInfoPtr;
  372. struct FSVolumeInfoParam {
  373.     QElemPtr                        qLink;                      /*queue link in header*/
  374.     short                           qType;                      /*type byte for safety check*/
  375.     short                           ioTrap;                     /*FS: the Trap*/
  376.     Ptr                             ioCmdAddr;                  /*FS: address to dispatch to*/
  377.     IOCompletionUPP                 ioCompletion;               /*completion routine addr (0 for synch calls)*/
  378.     volatile OSErr                  ioResult;                   /*result code*/
  379.     StringPtr                       ioNamePtr;                  /* unused */
  380.     FSVolumeRefNum                  ioVRefNum;                  /* volume refnum */
  381.     UInt32                          volumeIndex;                /* index, or 0 to use ioVRefNum */
  382.     FSVolumeInfoBitmap              whichInfo;                  /* which volumeInfo fields to get/set */
  383.     FSVolumeInfo *                  volumeInfo;                 /* information about the volume */
  384.     HFSUniStr255 *                  volumeName;                 /* output; pointer to volume name */
  385.     FSRef *                         ref;                        /* volume's FSRef */
  386. };
  387. typedef struct FSVolumeInfoParam        FSVolumeInfoParam;
  388. typedef FSVolumeInfoParam *             FSVolumeInfoParamPtr;
  389. /*
  390.     MakeFSRef
  391.     Create an FSRef for an existing object specified by a combination
  392.     of volume refnum, parent directory, and pathname.
  393.     ->  ioCompletion    A pointer to a completion routine
  394.     <-  ioResult        The result code of the function
  395.     ->  ioNamePtr       A pointer to a pathname
  396.     ->  ioVRefNum       A volume specification
  397.     ->  ioDirID         A directory ID
  398.     <-  newRef          A pointer to an FSRef
  399. */
  400. EXTERN_API( OSErr )
  401. FSpMakeFSRef                    (const FSSpec *         source,
  402.                                  FSRef *                newRef)                             THREEWORDINLINE(0x303C, 0x041A, 0xAA52);
  403.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  404.                                                                                             #pragma parameter __D0 PBMakeFSRefSync(__A0)
  405.                                                                                             #endif
  406. EXTERN_API( OSErr )
  407. PBMakeFSRefSync                 (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x706E, 0xA260);
  408.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  409.                                                                                             #pragma parameter PBMakeFSRefAsync(__A0)
  410.                                                                                             #endif
  411. EXTERN_API( void )
  412. PBMakeFSRefAsync                (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x706E, 0xA660);
  413. /*
  414.     MakeFSRefUnicode
  415.     Create an FSRef for an existing object specified by 
  416.     Parent FSRef and Unicode name.
  417.     ->  ioCompletion    A pointer to a completion routine
  418.     <-  ioResult        The result code of the function
  419.     ->  ref             A pointer to the parent directory FSRef
  420.     ->  name            A pointer to Unicde name
  421.     ->  nameLength      The length of the Unicode Name
  422.     ->  textEncodingHint A suggested text encoding to use for the name
  423.     <-  newRef          A pointer to an FSRef
  424. */
  425. EXTERN_API( OSErr )
  426. FSMakeFSRefUnicode              (const FSRef *          parentRef,
  427.                                  UniCharCount           nameLength,
  428.                                  const UniChar *        name,
  429.                                  TextEncoding           textEncodingHint,
  430.                                  FSRef *                newRef)                             THREEWORDINLINE(0x303C, 0x0A1B, 0xAA52);
  431.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  432.                                                                                             #pragma parameter __D0 PBMakeFSRefUnicodeSync(__A0)
  433.                                                                                             #endif
  434. EXTERN_API( OSErr )
  435. PBMakeFSRefUnicodeSync          (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x707A, 0xA260);
  436.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  437.                                                                                             #pragma parameter PBMakeFSRefUnicodeAsync(__A0)
  438.                                                                                             #endif
  439. EXTERN_API( void )
  440. PBMakeFSRefUnicodeAsync         (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x707A, 0xA660);
  441. /*
  442.     CompareFSRefs
  443.     Test whether two FSRefs refer to the same file or directory.
  444.     If they do, noErr is returned.  Otherwise, an appropriate error
  445.     (such as errFSRefsDifferent) is returned.
  446.     ->  ioCompletion    A pointer to a completion routine
  447.     <-  ioResult        The result code of the function
  448.     ->  ref             A pointer to the first FSRef
  449.     ->  parentRef       A pointer to the second FSRef
  450. */
  451. EXTERN_API( OSErr )
  452. FSCompareFSRefs                 (const FSRef *          ref1,
  453.                                  const FSRef *          ref2)                               THREEWORDINLINE(0x303C, 0x0435, 0xAA52);
  454.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  455.                                                                                             #pragma parameter __D0 PBCompareFSRefsSync(__A0)
  456.                                                                                             #endif
  457. EXTERN_API( OSErr )
  458. PBCompareFSRefsSync             (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x707C, 0xA260);
  459.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  460.                                                                                             #pragma parameter PBCompareFSRefsAsync(__A0)
  461.                                                                                             #endif
  462. EXTERN_API( void )
  463. PBCompareFSRefsAsync            (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x707C, 0xA660);
  464. /*
  465.     CreateFileUnicode
  466.     Creates a new file.  The input filename is in Unicode.
  467.     You can optionally set catalog info for the file.
  468.     ->  ioCompletion    A pointer to a completion routine
  469.     <-  ioResult        The result code of the function
  470.     ->  ref             The directory where the file is to be created
  471.     ->  whichInfo       Which catalog info fields to set
  472.     ->  catInfo         The values for catalog info fields to set; may be NULL
  473.     ->  nameLength      Number of Unicode characters in the file's name
  474.     ->  name            A pointer to the Unicode name
  475.     <-  spec            A pointer to the FSSpec for the new directory; may be NULL
  476.     <-  newRef          A pointer to the FSRef for the new file; may be NULL
  477. */
  478. EXTERN_API( OSErr )
  479. FSCreateFileUnicode             (const FSRef *          parentRef,
  480.                                  UniCharCount           nameLength,
  481.                                  const UniChar *        name,
  482.                                  FSCatalogInfoBitmap    whichInfo,
  483.                                  const FSCatalogInfo *  catalogInfo, /* can be NULL */
  484.                                  FSRef *                newRef, /* can be NULL */
  485.                                  FSSpec *               newSpec) /* can be NULL */          THREEWORDINLINE(0x303C, 0x0E1C, 0xAA52);
  486.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  487.                                                                                             #pragma parameter __D0 PBCreateFileUnicodeSync(__A0)
  488.                                                                                             #endif
  489. EXTERN_API( OSErr )
  490. PBCreateFileUnicodeSync         (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7070, 0xA260);
  491.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  492.                                                                                             #pragma parameter PBCreateFileUnicodeAsync(__A0)
  493.                                                                                             #endif
  494. EXTERN_API( void )
  495. PBCreateFileUnicodeAsync        (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7070, 0xA660);
  496. /*
  497.     CreateDirectoryUnicode
  498.     Creates a new directory.  The input directory name is in Unicode.
  499.     You can optionally set catalog info for the directory.
  500.     ->  ioCompletion    A pointer to a completion routine
  501.     <-  ioResult        The result code of the function
  502.     ->  ref             The parent directory where the directory is to be created
  503.     ->  whichInfo       Which catalog info fields to set
  504.     ->  catInfo         The values for catalog info fields to set; may be NULL
  505.     ->  nameLength      Number of Unicode characters in the directory's name
  506.     ->  name            A pointer to the Unicode name
  507.     <-  ioDirID         The DirID of the new directory
  508.     <-  spec            A pointer to the FSSpec for the new directory; may be NULL
  509.     <-  newRef          A pointer to the FSRef for the new directory; may be NULL
  510. */
  511. EXTERN_API( OSErr )
  512. FSCreateDirectoryUnicode        (const FSRef *          parentRef,
  513.                                  UniCharCount           nameLength,
  514.                                  const UniChar *        name,
  515.                                  FSCatalogInfoBitmap    whichInfo,
  516.                                  const FSCatalogInfo *  catalogInfo, /* can be NULL */
  517.                                  FSRef *                newRef, /* can be NULL */
  518.                                  FSSpec *               newSpec, /* can be NULL */
  519.                                  UInt32 *               newDirID) /* can be NULL */         THREEWORDINLINE(0x303C, 0x101D, 0xAA52);
  520.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  521.                                                                                             #pragma parameter __D0 PBCreateDirectoryUnicodeSync(__A0)
  522.                                                                                             #endif
  523. EXTERN_API( OSErr )
  524. PBCreateDirectoryUnicodeSync    (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7071, 0xA260);
  525.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  526.                                                                                             #pragma parameter PBCreateDirectoryUnicodeAsync(__A0)
  527.                                                                                             #endif
  528. EXTERN_API( void )
  529. PBCreateDirectoryUnicodeAsync   (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7071, 0xA660);
  530. /*
  531.     DeleteObject
  532.     Deletes an existing file or directory.
  533.     ->  ioCompletion    A pointer to a completion routine
  534.     <-  ioResult        The result code of the function
  535.     ->  ref             The file or directory to be deleted
  536. */
  537. EXTERN_API( OSErr )
  538. FSDeleteObject                  (const FSRef *          ref)                                THREEWORDINLINE(0x303C, 0x021E, 0xAA52);
  539.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  540.                                                                                             #pragma parameter __D0 PBDeleteObjectSync(__A0)
  541.                                                                                             #endif
  542. EXTERN_API( OSErr )
  543. PBDeleteObjectSync              (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7072, 0xA260);
  544.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  545.                                                                                             #pragma parameter PBDeleteObjectAsync(__A0)
  546.                                                                                             #endif
  547. EXTERN_API( void )
  548. PBDeleteObjectAsync             (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7072, 0xA660);
  549. /*
  550.     MoveObject
  551.     Move an existing file or directory into a different directory.
  552.     ->  ioCompletion    A pointer to a completion routine
  553.     <-  ioResult        The result code of the function
  554.     ->  ref             The file or directory to be moved
  555.     ->  parentRef       The file or directory will be moved into this directory
  556.     <-  newRef          A new FSRef for the file or directory in its new location;
  557.                         optional, may be NULL
  558.     NOTE: Moving an object may change its FSRef.  If you want to continue to
  559.     refer to the object, you should pass a non-NULL pointer in newRef and use
  560.     that returned FSRef to access the object after the move.  The FSRef passed
  561.     in "ref" may or may not be usable to access the object after it is moved.
  562.     "newRef" may point to the same storage as "parentRef" or "ref".
  563. */
  564. EXTERN_API( OSErr )
  565. FSMoveObject                    (const FSRef *          ref,
  566.                                  const FSRef *          destDirectory,
  567.                                  FSRef *                newRef) /* can be NULL */           THREEWORDINLINE(0x303C, 0x061F, 0xAA52);
  568.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  569.                                                                                             #pragma parameter __D0 PBMoveObjectSync(__A0)
  570.                                                                                             #endif
  571. EXTERN_API( OSErr )
  572. PBMoveObjectSync                (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7073, 0xA260);
  573.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  574.                                                                                             #pragma parameter PBMoveObjectAsync(__A0)
  575.                                                                                             #endif
  576. EXTERN_API( void )
  577. PBMoveObjectAsync               (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7073, 0xA660);
  578. /*
  579.     ExchangeObjects
  580.     swap the contents of two files.
  581.     ->  ioCompletion    A pointer to a completion routine
  582.     <-  ioResult        The result code of the function
  583.     ->  ref             The first file 
  584.     ->  parentRef       The second file 
  585. */
  586. EXTERN_API( OSErr )
  587. FSExchangeObjects               (const FSRef *          ref,
  588.                                  const FSRef *          destRef)                            THREEWORDINLINE(0x303C, 0x0421, 0xAA52);
  589.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  590.                                                                                             #pragma parameter __D0 PBExchangeObjectsSync(__A0)
  591.                                                                                             #endif
  592. EXTERN_API( OSErr )
  593. PBExchangeObjectsSync           (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7075, 0xA260);
  594.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  595.                                                                                             #pragma parameter PBExchangeObjectsAsync(__A0)
  596.                                                                                             #endif
  597. EXTERN_API( void )
  598. PBExchangeObjectsAsync          (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7075, 0xA660);
  599. /*
  600.     RenameUnicode
  601.     Change the name of an existing file or directory.  The new name is in
  602.     Unicode.
  603.     ->  ioCompletion    A pointer to a completion routine
  604.     <-  ioResult        The result code of the function
  605.     ->  ref             The file or directory to be moved
  606.     ->  nameLength      Number of Unicode characters in the new name
  607.     ->  name            A pointer to the new Unicode name
  608.     ->  textEncodingHint A suggested text encoding to use for the name
  609.     <-  newRef          A new FSRef for the file or directory; may be NULL
  610.     NOTE: Renaming an object may change its FSRef.  If you want to continue to
  611.     refer to the object, you should pass a non-NULL pointer in newRef and use
  612.     that returned FSRef to access the object after the rename.  The FSRef passed
  613.     in "ref" may or may not be usable to access the object after it is renamed.
  614.     "newRef" may point to the same storage as "ref".
  615. */
  616. EXTERN_API( OSErr )
  617. FSRenameUnicode                 (const FSRef *          ref,
  618.                                  UniCharCount           nameLength,
  619.                                  const UniChar *        name,
  620.                                  TextEncoding           textEncodingHint,
  621.                                  FSRef *                newRef) /* can be NULL */           THREEWORDINLINE(0x303C, 0x0A20, 0xAA52);
  622.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  623.                                                                                             #pragma parameter __D0 PBRenameUnicodeSync(__A0)
  624.                                                                                             #endif
  625. EXTERN_API( OSErr )
  626. PBRenameUnicodeSync             (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7074, 0xA260);
  627.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  628.                                                                                             #pragma parameter PBRenameUnicodeAsync(__A0)
  629.                                                                                             #endif
  630. EXTERN_API( void )
  631. PBRenameUnicodeAsync            (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7074, 0xA660);
  632. /*
  633.     GetCatalogInfo
  634.     Returns various information about a given file or directory.
  635.     ->  ioCompletion    A pointer to a completion routine
  636.     <-  ioResult        The result code of the function
  637.     ->  ref             The file or directory whose information is to be returned
  638.     ->  whichInfo       Which catalog info fields to get
  639.     <-  catInfo         The returned values of catalog info fields; may be NULL
  640.     <-  spec            A pointer to the FSSpec for the object; may be NULL
  641.     <-  parentRef       A pointer to the FSRef for the object's parent directory; may be NULL
  642.     <-  outName         The Unicode name is returned here.  This pointer may be NULL.
  643.     Note: All of the outputs are optional; if you don't want that particular output, just
  644.     set its pointer to NULL.  This is the call to use to map from an FSRef to an FSSpec.
  645. */
  646. EXTERN_API( OSErr )
  647. FSGetCatalogInfo                (const FSRef *          ref,
  648.                                  FSCatalogInfoBitmap    whichInfo,
  649.                                  FSCatalogInfo *        catalogInfo, /* can be NULL */
  650.                                  HFSUniStr255 *         outName, /* can be NULL */
  651.                                  FSSpec *               fsSpec, /* can be NULL */
  652.                                  FSRef *                parentRef) /* can be NULL */        THREEWORDINLINE(0x303C, 0x0C22, 0xAA52);
  653.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  654.                                                                                             #pragma parameter __D0 PBGetCatalogInfoSync(__A0)
  655.                                                                                             #endif
  656. EXTERN_API( OSErr )
  657. PBGetCatalogInfoSync            (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7076, 0xA260);
  658.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  659.                                                                                             #pragma parameter PBGetCatalogInfoAsync(__A0)
  660.                                                                                             #endif
  661. EXTERN_API( void )
  662. PBGetCatalogInfoAsync           (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7076, 0xA660);
  663. /*
  664.     SetCatalogInfo
  665.     Set catalog information about a given file or directory.
  666.     ->  ioCompletion    A pointer to a completion routine
  667.     <-  ioResult        The result code of the function
  668.     ->  ref             The file or directory whose information is to be changed
  669.     ->  whichInfo       Which catalog info fields to set
  670.     ->  catInfo         The new values of catalog info fields
  671.     Note: Only some of the catalog info fields may be set.  The settable fields
  672.     are given by the constant kFSCatInfoSettableInfo; no other bits may be set in
  673.     whichInfo.
  674. */
  675. EXTERN_API( OSErr )
  676. FSSetCatalogInfo                (const FSRef *          ref,
  677.                                  FSCatalogInfoBitmap    whichInfo,
  678.                                  const FSCatalogInfo *  catalogInfo)                        THREEWORDINLINE(0x303C, 0x0623, 0xAA52);
  679.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  680.                                                                                             #pragma parameter __D0 PBSetCatalogInfoSync(__A0)
  681.                                                                                             #endif
  682. EXTERN_API( OSErr )
  683. PBSetCatalogInfoSync            (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7077, 0xA260);
  684.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  685.                                                                                             #pragma parameter PBSetCatalogInfoAsync(__A0)
  686.                                                                                             #endif
  687. EXTERN_API( void )
  688. PBSetCatalogInfoAsync           (FSRefParam *           paramBlock)                         TWOWORDINLINE(0x7077, 0xA660);
  689. /*
  690.     OpenIterator
  691.     Creates an FSIterator to iterate over a directory or subtree.  The
  692.     iterator can then be passed to GetCatalogInfoBulk or CatalogSearch.
  693.     ->  ioCompletion    A pointer to a completion routine
  694.     <-  ioResult        The result code of the function
  695.     <-  iterator        The returned FSIterator
  696.     ->  iteratorFlags   Controls whether the iterator iterates over subtrees
  697.                         or just the immediate children of the container.
  698.     ->  container       An FSRef for the directory to iterate (or root of
  699.                         the subtree to iterate).
  700. */
  701. EXTERN_API( OSErr )
  702. FSOpenIterator                  (const FSRef *          container,
  703.                                  FSIteratorFlags        iteratorFlags,
  704.                                  FSIterator *           iterator)                           THREEWORDINLINE(0x303C, 0x0624, 0xAA52);
  705.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  706.                                                                                             #pragma parameter __D0 PBOpenIteratorSync(__A0)
  707.                                                                                             #endif
  708. EXTERN_API( OSErr )
  709. PBOpenIteratorSync              (FSCatalogBulkParam *   paramBlock)                         TWOWORDINLINE(0x7078, 0xA260);
  710.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  711.                                                                                             #pragma parameter PBOpenIteratorAsync(__A0)
  712.                                                                                             #endif
  713. EXTERN_API( void )
  714. PBOpenIteratorAsync             (FSCatalogBulkParam *   paramBlock)                         TWOWORDINLINE(0x7078, 0xA660);
  715. /*
  716.     CloseIterator
  717.     Invalidates and disposes an FSIterator.
  718.     ->  ioCompletion    A pointer to a completion routine
  719.     <-  ioResult        The result code of the function
  720.     ->  iterator        The returned FSIterator
  721. */
  722. EXTERN_API( OSErr )
  723. FSCloseIterator                 (FSIterator             iterator)                           THREEWORDINLINE(0x303C, 0x0225, 0xAA52);
  724.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  725.                                                                                             #pragma parameter __D0 PBCloseIteratorSync(__A0)
  726.                                                                                             #endif
  727. EXTERN_API( OSErr )
  728. PBCloseIteratorSync             (FSCatalogBulkParam *   paramBlock)                         TWOWORDINLINE(0x705B, 0xA260);
  729.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  730.                                                                                             #pragma parameter PBCloseIteratorAsync(__A0)
  731.                                                                                             #endif
  732. EXTERN_API( void )
  733. PBCloseIteratorAsync            (FSCatalogBulkParam *   paramBlock)                         TWOWORDINLINE(0x705B, 0xA660);
  734. /*
  735.     GetCatalogInfoBulk
  736.     Iterates over catalog objects and returns information about them.
  737.     For now, iterator must have been created with kFSIterateFlat option.
  738.     ->  ioCompletion    A pointer to a completion routine
  739.     <-  ioResult        The result code of the function
  740.     ->  iterator        The iterator
  741.     ->  maximumItems    The maximum number of items to return
  742.     <-  actualItems     The actual number of items returned
  743.     <-  containerChanged Set to true if the container's contents changed
  744.     ->  whichInfo       The catalog information fields to return for each item
  745.     <-  catalogInfo     An array of catalog information; one for each returned item
  746.     <-  refs            An array of FSRefs; one for each returned item
  747.     <-  specs           An array of FSSpecs; one for each returned item
  748.     <-  names           An array of filenames; one for each returned item
  749.     Note: The catalogInfo, refs, specs, names, and containerChanged are all optional outputs;
  750.     if you don't want that particular output, set its pointer to NULL.
  751. */
  752. EXTERN_API( OSErr )
  753. FSGetCatalogInfoBulk            (FSIterator             iterator,
  754.                                  ItemCount              maximumObjects,
  755.                                  ItemCount *            actualObjects,
  756.                                  Boolean *              containerChanged, /* can be NULL */
  757.                                  FSCatalogInfoBitmap    whichInfo,
  758.                                  FSCatalogInfo *        catalogInfos, /* can be NULL */
  759.                                  FSRef *                refs, /* can be NULL */
  760.                                  FSSpec *               specs, /* can be NULL */
  761.                                  HFSUniStr255 *         names) /* can be NULL */            THREEWORDINLINE(0x303C, 0x1226, 0xAA52);
  762.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  763.                                                                                             #pragma parameter __D0 PBGetCatalogInfoBulkSync(__A0)
  764.                                                                                             #endif
  765. EXTERN_API( OSErr )
  766. PBGetCatalogInfoBulkSync        (FSCatalogBulkParam *   paramBlock)                         TWOWORDINLINE(0x705C, 0xA260);
  767.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  768.                                                                                             #pragma parameter PBGetCatalogInfoBulkAsync(__A0)
  769.                                                                                             #endif
  770. EXTERN_API( void )
  771. PBGetCatalogInfoBulkAsync       (FSCatalogBulkParam *   paramBlock)                         TWOWORDINLINE(0x705C, 0xA660);
  772. /*
  773.     CatalogSearch
  774.     Iterates over catalog objects, searching for objects that match given
  775.     search criteria.  Returns various information about matching objects.
  776.     For now, iterator must have been created with kFSIterateSubtree option
  777.     and the container must have been the root directory of a volume.
  778.     ->  ioCompletion    A pointer to a completion routine
  779.     <-  ioResult        The result code of the function
  780.     ->  iterator        The iterator
  781.     ->  maximumItems    The maximum number of items to return
  782.     <-  actualItems     The actual number of items returned
  783.     <-  containerChanged Set to true if the container's contents changed
  784.     ->  whichInfo       The catalog information fields to return for each item
  785.     <-  catalogInfo     An array of catalog information; one for each returned item
  786.     <-  refs            An array of FSRefs; one for each returned item
  787.     <-  specs           An array of FSSpecs; one for each returned item
  788.     <-  names           An array of filenames; one for each returned item
  789.     ->  searchParams    The criteria that controls the matching, including timeout, a bitmap
  790.                         controlling the fields to compare, and the (Unicode) name to compare.
  791.     Note: The catalogInfo, refs, specs, and names are all optional outputs; if you don't want
  792.     that particular output, set its pointer to NULL.
  793. */
  794. EXTERN_API( OSErr )
  795. FSCatalogSearch                 (FSIterator             iterator,
  796.                                  const FSSearchParams * searchCriteria,
  797.                                  ItemCount              maximumObjects,
  798.                                  ItemCount *            actualObjects,
  799.                                  Boolean *              containerChanged, /* can be NULL */
  800.                                  FSCatalogInfoBitmap    whichInfo,
  801.                                  FSCatalogInfo *        catalogInfos, /* can be NULL */
  802.                                  FSRef *                refs, /* can be NULL */
  803.                                  FSSpec *               specs, /* can be NULL */
  804.                                  HFSUniStr255 *         names) /* can be NULL */            THREEWORDINLINE(0x303C, 0x1427, 0xAA52);
  805.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  806.                                                                                             #pragma parameter __D0 PBCatalogSearchSync(__A0)
  807.                                                                                             #endif
  808. EXTERN_API( OSErr )
  809. PBCatalogSearchSync             (FSCatalogBulkParam *   paramBlock)                         TWOWORDINLINE(0x705D, 0xA260);
  810.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  811.                                                                                             #pragma parameter PBCatalogSearchAsync(__A0)
  812.                                                                                             #endif
  813. EXTERN_API( void )
  814. PBCatalogSearchAsync            (FSCatalogBulkParam *   paramBlock)                         TWOWORDINLINE(0x705D, 0xA660);
  815. /*
  816.     CreateFork
  817.     Create a named fork for a file or directory.
  818.     ->  ioCompletion    A pointer to a completion routine
  819.     <-  ioResult        The result code of the function
  820.     ->  ref             The file or directory
  821.     ->  forkNameLength  The length of the fork name (in Unicode characters)
  822.     ->  forkName        The name of the fork to open (in Unicode)
  823. */
  824. EXTERN_API( OSErr )
  825. FSCreateFork                    (const FSRef *          ref,
  826.                                  UniCharCount           forkNameLength,
  827.                                  const UniChar *        forkName) /* can be NULL */         THREEWORDINLINE(0x303C, 0x0636, 0xAA52);
  828.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  829.                                                                                             #pragma parameter __D0 PBCreateForkSync(__A0)
  830.                                                                                             #endif
  831. EXTERN_API( OSErr )
  832. PBCreateForkSync                (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x707D, 0xA260);
  833.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  834.                                                                                             #pragma parameter PBCreateForkAsync(__A0)
  835.                                                                                             #endif
  836. EXTERN_API( void )
  837. PBCreateForkAsync               (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x707D, 0xA660);
  838. /*
  839.     DeleteFork
  840.     Delete a named fork of a file or directory.
  841.     ->  ioCompletion    A pointer to a completion routine
  842.     <-  ioResult        The result code of the function
  843.     ->  ref             The file or directory
  844.     ->  forkNameLength  The length of the fork name (in Unicode characters)
  845.     ->  forkName        The name of the fork to open (in Unicode)
  846. */
  847. EXTERN_API( OSErr )
  848. FSDeleteFork                    (const FSRef *          ref,
  849.                                  UniCharCount           forkNameLength,
  850.                                  const UniChar *        forkName) /* can be NULL */         THREEWORDINLINE(0x303C, 0x0637, 0xAA52);
  851.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  852.                                                                                             #pragma parameter __D0 PBDeleteForkSync(__A0)
  853.                                                                                             #endif
  854. EXTERN_API( OSErr )
  855. PBDeleteForkSync                (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x707E, 0xA260);
  856.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  857.                                                                                             #pragma parameter PBDeleteForkAsync(__A0)
  858.                                                                                             #endif
  859. EXTERN_API( void )
  860. PBDeleteForkAsync               (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x707E, 0xA660);
  861. /*
  862.     IterateForks
  863.     Return the names and sizes of the forks of a file or directory.
  864.     One fork is returned per call.
  865.     ->  ioCompletion    A pointer to a completion routine.
  866.     <-  ioResult        The result code of the function.
  867.     ->  ref             The file or directory containing the forks.
  868.     <-  positionOffset  The length of the fork, in bytes.
  869.     <-  allocationAmount The space allocated to the fork (physical length).
  870.     <-  outForkName     The name of the fork in Unicode.
  871.     <>  forkIterator    Maintains state between calls for a given FSRef.
  872.                         Before the first call, set the initialize field to zero.
  873. */
  874. EXTERN_API( OSErr )
  875. FSIterateForks                  (const FSRef *          ref,
  876.                                  CatPositionRec *       forkIterator,
  877.                                  HFSUniStr255 *         forkName, /* can be NULL */
  878.                                  SInt64 *               forkSize, /* can be NULL */
  879.                                  UInt64 *               forkPhysicalSize) /* can be NULL */ THREEWORDINLINE(0x303C, 0x0A38, 0xAA52);
  880.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  881.                                                                                             #pragma parameter __D0 PBIterateForksSync(__A0)
  882.                                                                                             #endif
  883. EXTERN_API( OSErr )
  884. PBIterateForksSync              (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x707F, 0xA260);
  885.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  886.                                                                                             #pragma parameter PBIterateForksAsync(__A0)
  887.                                                                                             #endif
  888. EXTERN_API( void )
  889. PBIterateForksAsync             (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x707F, 0xA660);
  890. /*
  891.     OpenFork
  892.     Open a fork for reading and/or writing.  Allows the opened fork
  893.     to grow beyond 2GB in size.  All volumes should support data and
  894.     resource forks.  Other named forks may be supported by some
  895.     volumes.
  896.     ->  ioCompletion    A pointer to a completion routine
  897.     <-  ioResult        The result code of the function
  898.     ->  ref             The file or directory containing the fork to open
  899.     ->  forkNameLength  The length of the fork name (in Unicode characters)
  900.     ->  forkName        The name of the fork to open (in Unicode)
  901.     ->  permissions     The access (read and/or write) you want
  902.     <-  forkRefNum      The reference number for accessing the open fork
  903. */
  904. EXTERN_API( OSErr )
  905. FSOpenFork                      (const FSRef *          ref,
  906.                                  UniCharCount           forkNameLength,
  907.                                  const UniChar *        forkName, /* can be NULL */
  908.                                  SInt8                  permissions,
  909.                                  SInt16 *               forkRefNum)                         THREEWORDINLINE(0x303C, 0x0928, 0xAA52);
  910.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  911.                                                                                             #pragma parameter __D0 PBOpenForkSync(__A0)
  912.                                                                                             #endif
  913. EXTERN_API( OSErr )
  914. PBOpenForkSync                  (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7079, 0xA260);
  915.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  916.                                                                                             #pragma parameter PBOpenForkAsync(__A0)
  917.                                                                                             #endif
  918. EXTERN_API( void )
  919. PBOpenForkAsync                 (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7079, 0xA660);
  920. /*
  921.     ReadFork
  922.     Read data from a fork opened via OpenFork.  The first byte to read is
  923.     indicated by a combination of positionMode and positionOffset.
  924.     ->  ioCompletion    A pointer to a completion routine
  925.     <-  ioResult        The result code of the function
  926.     ->  forkRefNum      The reference number of the fork to read from
  927.     <-  buffer          Pointer to buffer where data will be returned
  928.     ->  requestCount    The number of bytes to read
  929.     <-  actualCount     The number of bytes actually read
  930.     ->  positionMode    The base location for start of read
  931.     ->  positionOffset  The offset from base location for start of read
  932. */
  933. EXTERN_API( OSErr )
  934. FSReadFork                      (SInt16                 forkRefNum,
  935.                                  UInt16                 positionMode,
  936.                                  SInt64                 positionOffset,
  937.                                  ByteCount              requestCount,
  938.                                  void *                 buffer,
  939.                                  ByteCount *            actualCount) /* can be NULL */      THREEWORDINLINE(0x303C, 0x0A29, 0xAA52);
  940.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  941.                                                                                             #pragma parameter __D0 PBReadForkSync(__A0)
  942.                                                                                             #endif
  943. EXTERN_API( OSErr )
  944. PBReadForkSync                  (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7051, 0xA2A8);
  945.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  946.                                                                                             #pragma parameter PBReadForkAsync(__A0)
  947.                                                                                             #endif
  948. EXTERN_API( void )
  949. PBReadForkAsync                 (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7051, 0xA6A8);
  950. /*
  951.     WriteFork
  952.     Write data to a fork opened via OpenFork.  The first byte to write is
  953.     indicated by a combination of positionMode and positionOffset.
  954.     ->  ioCompletion    A pointer to a completion routine
  955.     <-  ioResult        The result code of the function
  956.     ->  forkRefNum      The reference number of the fork to write to
  957.     ->  buffer          Pointer to data to write
  958.     ->  requestCount    The number of bytes to write
  959.     <-  actualCount     The number of bytes actually written
  960.     ->  positionMode    The base location for start of write
  961.     ->  positionOffset  The offset from base location for start of write
  962. */
  963. EXTERN_API( OSErr )
  964. FSWriteFork                     (SInt16                 forkRefNum,
  965.                                  UInt16                 positionMode,
  966.                                  SInt64                 positionOffset,
  967.                                  ByteCount              requestCount,
  968.                                  void *                 buffer,
  969.                                  ByteCount *            actualCount) /* can be NULL */      THREEWORDINLINE(0x303C, 0x0A2A, 0xAA52);
  970.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  971.                                                                                             #pragma parameter __D0 PBWriteForkSync(__A0)
  972.                                                                                             #endif
  973. EXTERN_API( OSErr )
  974. PBWriteForkSync                 (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7052, 0xA2A8);
  975.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  976.                                                                                             #pragma parameter PBWriteForkAsync(__A0)
  977.                                                                                             #endif
  978. EXTERN_API( void )
  979. PBWriteForkAsync                (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7052, 0xA6A8);
  980. /*
  981.     GetForkPosition
  982.     Get the current (default) position of a fork that was
  983.     opened via OpenFork.
  984.     ->  ioCompletion    A pointer to a completion routine
  985.     <-  ioResult        The result code of the function
  986.     ->  forkRefNum      The reference number of the fork
  987.     <-  positionOffset  The current position of the fork
  988. */
  989. EXTERN_API( OSErr )
  990. FSGetForkPosition               (SInt16                 forkRefNum,
  991.                                  SInt64 *               position)                           THREEWORDINLINE(0x303C, 0x032B, 0xAA52);
  992.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  993.                                                                                             #pragma parameter __D0 PBGetForkPositionSync(__A0)
  994.                                                                                             #endif
  995. EXTERN_API( OSErr )
  996. PBGetForkPositionSync           (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7053, 0xA260);
  997.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  998.                                                                                             #pragma parameter PBGetForkPositionAsync(__A0)
  999.                                                                                             #endif
  1000. EXTERN_API( void )
  1001. PBGetForkPositionAsync          (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7053, 0xA660);
  1002. /*
  1003.     SetForkPosition
  1004.     Set the current (default) position of a fork that was
  1005.     opened via OpenFork.
  1006.     ->  ioCompletion    A pointer to a completion routine
  1007.     <-  ioResult        The result code of the function
  1008.     ->  forkRefNum      The reference number of the fork
  1009.     ->  positionMode    The base location for the new position
  1010.     ->  positionOffset  The offset of the new position from the base
  1011. */
  1012. EXTERN_API( OSErr )
  1013. FSSetForkPosition               (SInt16                 forkRefNum,
  1014.                                  UInt16                 positionMode,
  1015.                                  SInt64                 positionOffset)                     THREEWORDINLINE(0x303C, 0x042C, 0xAA52);
  1016.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1017.                                                                                             #pragma parameter __D0 PBSetForkPositionSync(__A0)
  1018.                                                                                             #endif
  1019. EXTERN_API( OSErr )
  1020. PBSetForkPositionSync           (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7054, 0xA260);
  1021.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1022.                                                                                             #pragma parameter PBSetForkPositionAsync(__A0)
  1023.                                                                                             #endif
  1024. EXTERN_API( void )
  1025. PBSetForkPositionAsync          (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7054, 0xA660);
  1026. /*
  1027.     GetForkSize
  1028.     Get the current logical size (end-of-file) of an open fork.
  1029.     ->  ioCompletion    A pointer to a completion routine
  1030.     <-  ioResult        The result code of the function
  1031.     ->  forkRefNum      The reference number of the fork
  1032.     <-  positionOffset  The logical size of the fork, in bytes
  1033. */
  1034. EXTERN_API( OSErr )
  1035. FSGetForkSize                   (SInt16                 forkRefNum,
  1036.                                  SInt64 *               forkSize)                           THREEWORDINLINE(0x303C, 0x032D, 0xAA52);
  1037.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1038.                                                                                             #pragma parameter __D0 PBGetForkSizeSync(__A0)
  1039.                                                                                             #endif
  1040. EXTERN_API( OSErr )
  1041. PBGetForkSizeSync               (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7055, 0xA260);
  1042.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1043.                                                                                             #pragma parameter PBGetForkSizeAsync(__A0)
  1044.                                                                                             #endif
  1045. EXTERN_API( void )
  1046. PBGetForkSizeAsync              (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7055, 0xA660);
  1047. /*
  1048.     SetForkSize
  1049.     Set the logical size (end-of-file) of an open fork.  This
  1050.     may cause space to be allocated or deallocated.
  1051.     ->  ioCompletion    A pointer to a completion routine
  1052.     <-  ioResult        The result code of the function
  1053.     ->  forkRefNum      The reference number of the fork
  1054.     ->  positionMode    The base location for the new size
  1055.     ->  positionOffset  The offset of the new size from the base
  1056. */
  1057. EXTERN_API( OSErr )
  1058. FSSetForkSize                   (SInt16                 forkRefNum,
  1059.                                  UInt16                 positionMode,
  1060.                                  SInt64                 positionOffset)                     THREEWORDINLINE(0x303C, 0x042E, 0xAA52);
  1061.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1062.                                                                                             #pragma parameter __D0 PBSetForkSizeSync(__A0)
  1063.                                                                                             #endif
  1064. EXTERN_API( OSErr )
  1065. PBSetForkSizeSync               (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7056, 0xA260);
  1066.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1067.                                                                                             #pragma parameter PBSetForkSizeAsync(__A0)
  1068.                                                                                             #endif
  1069. EXTERN_API( void )
  1070. PBSetForkSizeAsync              (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7056, 0xA660);
  1071. /*
  1072.     AllocateFork
  1073.     Allocate space to an open fork.  Typically, the space to be
  1074.     allocated is beyond the current size of the fork, to reserve
  1075.     space so the file will be able to grow later.  Some volume
  1076.     formats are unable to allocate space beyond the logical size
  1077.     of the fork.
  1078.     ->  ioCompletion    A pointer to a completion routine
  1079.     <-  ioResult        The result code of the function
  1080.     ->  forkRefNum      The reference number of the fork
  1081.     ->  positionMode    The base location for start of allocation
  1082.     ->  positionOffset  The offset of the start of allocation
  1083.     ->  allocationFlags Zero or more of the following flags:
  1084.         kFSAllocContiguousMask
  1085.                 Any newly allocated space must be one contiguous piece.
  1086.         kFSAllocAllOrNothingMask
  1087.                 All of the request space must be available, or the call
  1088.                 will fail.  (If not set, the call may succeed even though
  1089.                 some of the requested space wasn't allocated.)
  1090.         kFSAllocNoRoundUpMask
  1091.                 Do not allocate additional space.  (If not set, a volume
  1092.                 may allocate additional space in order to reduce fragmentation.)
  1093.     <>  allocationAmount    The number of bytes to allocate
  1094.                             On output, the number of bytes actually added
  1095. */
  1096. EXTERN_API( OSErr )
  1097. FSAllocateFork                  (SInt16                 forkRefNum,
  1098.                                  FSAllocationFlags      flags,
  1099.                                  UInt16                 positionMode,
  1100.                                  SInt64                 positionOffset,
  1101.                                  UInt64                 requestCount,
  1102.                                  UInt64 *               actualCount) /* can be NULL */      THREEWORDINLINE(0x303C, 0x092F, 0xAA52);
  1103.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1104.                                                                                             #pragma parameter __D0 PBAllocateForkSync(__A0)
  1105.                                                                                             #endif
  1106. EXTERN_API( OSErr )
  1107. PBAllocateForkSync              (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7057, 0xA260);
  1108.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1109.                                                                                             #pragma parameter PBAllocateForkAsync(__A0)
  1110.                                                                                             #endif
  1111. EXTERN_API( void )
  1112. PBAllocateForkAsync             (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7057, 0xA660);
  1113. /*
  1114.     FlushFork
  1115.     Flush a fork.  Any data written to this fork refnum is flushed to the device.
  1116.     The volume's control structures are also flushed to the device.
  1117.     ->  ioCompletion    A pointer to a completion routine
  1118.     <-  ioResult        The result code of the function
  1119.     ->  forkRefNum      The reference number of the fork to flush
  1120. */
  1121. EXTERN_API( OSErr )
  1122. FSFlushFork                     (SInt16                 forkRefNum)                         THREEWORDINLINE(0x303C, 0x0130, 0xAA52);
  1123.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1124.                                                                                             #pragma parameter __D0 PBFlushForkSync(__A0)
  1125.                                                                                             #endif
  1126. EXTERN_API( OSErr )
  1127. PBFlushForkSync                 (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7058, 0xA260);
  1128.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1129.                                                                                             #pragma parameter PBFlushForkAsync(__A0)
  1130.                                                                                             #endif
  1131. EXTERN_API( void )
  1132. PBFlushForkAsync                (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7058, 0xA660);
  1133. /*
  1134.     CloseFork
  1135.     Flush and close a fork.  Any data written to this fork refnum is flushed
  1136.     to the device.  The volume's control structures are also flushed to the device.
  1137.     ->  ioCompletion    A pointer to a completion routine
  1138.     <-  ioResult        The result code of the function
  1139.     ->  forkRefNum      The reference number of the fork to close
  1140. */
  1141. EXTERN_API( OSErr )
  1142. FSCloseFork                     (SInt16                 forkRefNum)                         THREEWORDINLINE(0x303C, 0x0131, 0xAA52);
  1143.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1144.                                                                                             #pragma parameter __D0 PBCloseForkSync(__A0)
  1145.                                                                                             #endif
  1146. EXTERN_API( OSErr )
  1147. PBCloseForkSync                 (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7059, 0xA260);
  1148.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1149.                                                                                             #pragma parameter PBCloseForkAsync(__A0)
  1150.                                                                                             #endif
  1151. EXTERN_API( void )
  1152. PBCloseForkAsync                (FSForkIOParam *        paramBlock)                         TWOWORDINLINE(0x7059, 0xA660);
  1153. /*
  1154.     GetForkCBInfo
  1155.     Return information about an open fork.
  1156.     ->  ioCompletion    A pointer to a completion routine
  1157.     <-  ioResult        The result code of the function
  1158.     <>  desiredRefNum   If non-zero on input, then get information for this refnum;
  1159.                         unchanged on output.  If zero on input, iterate over all open
  1160.                         forks (possibly limited to a single volume); on output, contains
  1161.                         the fork's refnum.
  1162.     ->  volumeRefNum    Used when desiredRefNum is zero on input.  Set to 0 to iterate over all
  1163.                         volumes, or set to a FSVolumeRefNum to limit iteration to that volume.
  1164.     <>  iterator        Used when desiredRefNum is zero on input.  Set to 0 before iterating.
  1165.                         Pass the iterator returned by the previous call to continue iterating.
  1166.     <-  actualRefNum    The refnum of the open fork.
  1167.     <-  ref             The FSRef for the file or directory that contains the fork.
  1168.     <-  forkInfo        Various information about the open fork.
  1169.     <-  outForkName     The name of the fork
  1170.     Note: the foundRefNum, ref, forkInfo, and fork name outputs are all optional; if you don't want
  1171.     a particular output, then set its pointer to NULL.  If forkName is NULL, then forkNameLength
  1172.     will be undefined.
  1173.     Note: Returning the forkInfo generally does not require a disk access.  Returning the
  1174.     ref or forkName may cause disk access for some volume formats.
  1175. */
  1176. EXTERN_API( OSErr )
  1177. FSGetForkCBInfo                 (SInt16                 desiredRefNum,
  1178.                                  FSVolumeRefNum         volume,
  1179.                                  SInt16 *               iterator, /* can be NULL */
  1180.                                  SInt16 *               actualRefNum, /* can be NULL */
  1181.                                  FSForkInfo *           forkInfo, /* can be NULL */
  1182.                                  FSRef *                ref, /* can be NULL */
  1183.                                  HFSUniStr255 *         outForkName) /* can be NULL */      THREEWORDINLINE(0x303C, 0x0C32, 0xAA52);
  1184.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1185.                                                                                             #pragma parameter __D0 PBGetForkCBInfoSync(__A0)
  1186.                                                                                             #endif
  1187. EXTERN_API( OSErr )
  1188. PBGetForkCBInfoSync             (FSForkCBInfoParam *    paramBlock)                         TWOWORDINLINE(0x705A, 0xA260);
  1189.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1190.                                                                                             #pragma parameter PBGetForkCBInfoAsync(__A0)
  1191.                                                                                             #endif
  1192. EXTERN_API( void )
  1193. PBGetForkCBInfoAsync            (FSForkCBInfoParam *    paramBlock)                         TWOWORDINLINE(0x705A, 0xA660);
  1194. /*
  1195.     GetVolumeInfo
  1196.     Returns various information about a given volume, or indexing over all volumes.
  1197.     ->  ioCompletion    A pointer to a completion routine
  1198.     <-  ioResult        The result code of the function
  1199.     <>  ioVRefNum       On input, the volume reference number or drive number whose
  1200.                         information is to be returned (if volumeIndex is 0); same
  1201.                         as "volume" input to FSGetVolumeInfo.
  1202.                         On output, the actual volume reference number; same as
  1203.                         "actualVolume" output of FSGetVolumeInfo.
  1204.     ->  volumeIndex     The index of the desired volume, or 0 to use ioVRefNum
  1205.     ->  whichInfo       Which volInfo info fields to get
  1206.     <-  volumeInfo      The returned values of Volume info fields; may be NULL
  1207.     <-  name            The Unicode name is returned here.  This pointer may be NULL.
  1208.     Note: All of the outputs are optional; if you don't want that particular output, just
  1209.     set it's pointer to NULL.
  1210. */
  1211. EXTERN_API( OSErr )
  1212. FSGetVolumeInfo                 (FSVolumeRefNum         volume,
  1213.                                  ItemCount              volumeIndex,
  1214.                                  FSVolumeRefNum *       actualVolume, /* can be NULL */
  1215.                                  FSVolumeInfoBitmap     whichInfo,
  1216.                                  FSVolumeInfo *         info, /* can be NULL */
  1217.                                  HFSUniStr255 *         volumeName, /* can be NULL */
  1218.                                  FSRef *                rootDirectory) /* can be NULL */    THREEWORDINLINE(0x303C, 0x0D33, 0xAA52);
  1219.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1220.                                                                                             #pragma parameter __D0 PBGetVolumeInfoSync(__A0)
  1221.                                                                                             #endif
  1222. EXTERN_API( OSErr )
  1223. PBGetVolumeInfoSync             (FSVolumeInfoParam *    paramBlock)                         TWOWORDINLINE(0x701D, 0xA260);
  1224.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1225.                                                                                             #pragma parameter PBGetVolumeInfoAsync(__A0)
  1226.                                                                                             #endif
  1227. EXTERN_API( void )
  1228. PBGetVolumeInfoAsync            (FSVolumeInfoParam *    paramBlock)                         TWOWORDINLINE(0x701D, 0xA660);
  1229. /*
  1230.     SetVolumeInfo
  1231.     Set information about a given volume.
  1232.     ->  ioCompletion    A pointer to a completion routine
  1233.     <-  ioResult        The result code of the function
  1234.     ->  ioVRefNum       The volume whose information is to be changed
  1235.     ->  whichInfo       Which catalog info fields to set
  1236.     ->  volumeInfo      The new values of volume info fields
  1237.     Note: Only some of the volume info fields may be set.  The settable fields
  1238.     are given by the constant kFSVolInfoSettableInfo; no other bits may be set in
  1239.     whichInfo.
  1240. */
  1241. EXTERN_API( OSErr )
  1242. FSSetVolumeInfo                 (FSVolumeRefNum         volume,
  1243.                                  FSVolumeInfoBitmap     whichInfo,
  1244.                                  const FSVolumeInfo *   info)                               THREEWORDINLINE(0x303C, 0x0534, 0xAA52);
  1245.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1246.                                                                                             #pragma parameter __D0 PBSetVolumeInfoSync(__A0)
  1247.                                                                                             #endif
  1248. EXTERN_API( OSErr )
  1249. PBSetVolumeInfoSync             (FSVolumeInfoParam *    paramBlock)                         TWOWORDINLINE(0x701E, 0xA260);
  1250.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1251.                                                                                             #pragma parameter PBSetVolumeInfoAsync(__A0)
  1252.                                                                                             #endif
  1253. EXTERN_API( void )
  1254. PBSetVolumeInfoAsync            (FSVolumeInfoParam *    paramBlock)                         TWOWORDINLINE(0x701E, 0xA660);
  1255. /*
  1256.     FSGetDataForkName
  1257.     Returns the constant for the name of the data fork (the empty string)
  1258. */
  1259. EXTERN_API( OSErr )
  1260. FSGetDataForkName               (HFSUniStr255 *         dataForkName)                       THREEWORDINLINE(0x303C, 0x0218, 0xAA52);
  1261. /*
  1262.     FSGetResourceForkName
  1263.     Returns the constant for the name of the resource fork
  1264.     (currently "RESOURCE_FORK").
  1265. */
  1266. EXTERN_API( OSErr )
  1267. FSGetResourceForkName           (HFSUniStr255 *         resourceForkName)                   THREEWORDINLINE(0x303C, 0x0219, 0xAA52);
  1268. #if PRAGMA_STRUCT_ALIGN
  1269.     #pragma options align=reset
  1270. #elif PRAGMA_STRUCT_PACKPUSH
  1271.     #pragma pack(pop)
  1272. #elif PRAGMA_STRUCT_PACK
  1273.     #pragma pack()
  1274. #endif
  1275. #ifdef PRAGMA_IMPORT_OFF
  1276. #pragma import off
  1277. #elif PRAGMA_IMPORT
  1278. #pragma import reset
  1279. #endif
  1280. #ifdef __cplusplus
  1281. }
  1282. #endif
  1283. #endif /* __FILES__ */