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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       Devices.h
  3.  
  4.      Contains:   Device Manager Interfaces.
  5.  
  6.      Version:    Technology: Mac OS 8
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1985-2001 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __DEVICES__
  18. #define __DEVICES__
  19. #ifndef __OSUTILS__
  20. #include "OSUtils.h"
  21. #endif
  22. #ifndef __FILES__
  23. #include "Files.h"
  24. #endif
  25. #ifndef __QUICKDRAW__
  26. #include "Quickdraw.h"
  27. #endif
  28. #ifndef __NAMEREGISTRY__
  29. #include "NameRegistry.h"
  30. #endif
  31. #ifndef __CODEFRAGMENTS__
  32. #include "CodeFragments.h"
  33. #endif
  34. #ifndef __DRIVERFAMILYMATCHING__
  35. #include "DriverFamilyMatching.h"
  36. #endif
  37. #if PRAGMA_ONCE
  38. #pragma once
  39. #endif
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. #if PRAGMA_IMPORT
  44. #pragma import on
  45. #endif
  46. #if PRAGMA_STRUCT_ALIGN
  47.     #pragma options align=mac68k
  48. #elif PRAGMA_STRUCT_PACKPUSH
  49.     #pragma pack(push, 2)
  50. #elif PRAGMA_STRUCT_PACK
  51.     #pragma pack(2)
  52. #endif
  53. /* Values of the 'message' parameter to a Chooser device package */
  54. enum {
  55.     chooserInitMsg              = 11,                           /* the user selected this device package */
  56.     newSelMsg                   = 12,                           /* the user made new device selections */
  57.     fillListMsg                 = 13,                           /* fill the device list with choices */
  58.     getSelMsg                   = 14,                           /* mark one or more choices as selected */
  59.     selectMsg                   = 15,                           /* the user made a selection */
  60.     deselectMsg                 = 16,                           /* the user canceled a selection */
  61.     terminateMsg                = 17,                           /* allows device package to clean up */
  62.     buttonMsg                   = 19                            /* the user selected a button */
  63. };
  64. /* Values of the 'caller' parameter to a Chooser device package */
  65. enum {
  66.     chooserID                   = 1
  67. };
  68. /* Values of the 'message' parameter to a Monitor 'mntr' */
  69. enum {
  70.     initMsg                     = 1,                            /*initialization*/
  71.     okMsg                       = 2,                            /*user clicked OK button*/
  72.     cancelMsg                   = 3,                            /*user clicked Cancel button*/
  73.     hitMsg                      = 4,                            /*user clicked control in Options dialog*/
  74.     nulMsg                      = 5,                            /*periodic event*/
  75.     updateMsg                   = 6,                            /*update event*/
  76.     activateMsg                 = 7,                            /*not used*/
  77.     deactivateMsg               = 8,                            /*not used*/
  78.     keyEvtMsg                   = 9,                            /*keyboard event*/
  79.     superMsg                    = 10,                           /*show superuser controls*/
  80.     normalMsg                   = 11,                           /*show only normal controls*/
  81.     startupMsg                  = 12                            /*code has been loaded*/
  82. };
  83. /* control codes for DeskAccessories */
  84. enum {
  85.     goodbye                     = -1,                           /* heap being reinitialized */
  86.     killCode                    = 1,                            /* KillIO requested */
  87.     accEvent                    = 64,                           /* handle an event */
  88.     accRun                      = 65,                           /* time for periodic action */
  89.     accCursor                   = 66,                           /* change cursor shape */
  90.     accMenu                     = 67,                           /* handle menu item */
  91.     accUndo                     = 68,                           /* handle undo command */
  92.     accCut                      = 70,                           /* handle cut command */
  93.     accCopy                     = 71,                           /* handle copy command */
  94.     accPaste                    = 72,                           /* handle paste command */
  95.     accClear                    = 73                            /* handle clear command */
  96. };
  97. /* Control/Status Call Codes */
  98. enum {
  99.     drvStsCode                  = 8,                            /* status call code for drive status */
  100.     ejectCode                   = 7,                            /* control call eject code */
  101.     tgBuffCode                  = 8                             /* set tag buffer code */
  102. };
  103. /* miscellaneous Device Manager constants */
  104. enum {
  105.     ioInProgress                = 1,                            /* predefined value of ioResult while I/O is pending */
  106.     aRdCmd                      = 2,                            /* low byte of ioTrap for Read calls */
  107.     aWrCmd                      = 3,                            /* low byte of ioTrap for Write calls */
  108.     asyncTrpBit                 = 10,                           /* trap word modifier */
  109.     noQueueBit                  = 9                             /* trap word modifier */
  110. };
  111. /* flags used in the driver header and device control entry */
  112. enum {
  113.     dReadEnable                 = 0,                            /* set if driver responds to read requests */
  114.     dWritEnable                 = 1,                            /* set if driver responds to write requests */
  115.     dCtlEnable                  = 2,                            /* set if driver responds to control requests */
  116.     dStatEnable                 = 3,                            /* set if driver responds to status requests */
  117.     dNeedGoodBye                = 4,                            /* set if driver needs time for performing periodic tasks */
  118.     dNeedTime                   = 5,                            /* set if driver needs time for performing periodic tasks */
  119.     dNeedLock                   = 6                             /* set if driver must be locked in memory as soon as it is opened */
  120. };
  121. enum {
  122.     dNeedLockMask               = 0x4000,                       /* set if driver must be locked in memory as soon as it is opened */
  123.     dNeedTimeMask               = 0x2000,                       /* set if driver needs time for performing periodic tasks */
  124.     dNeedGoodByeMask            = 0x1000,                       /* set if driver needs to be called before the application heap is initialized */
  125.     dStatEnableMask             = 0x0800,                       /* set if driver responds to status requests */
  126.     dCtlEnableMask              = 0x0400,                       /* set if driver responds to control requests */
  127.     dWritEnableMask             = 0x0200,                       /* set if driver responds to write requests */
  128.     dReadEnableMask             = 0x0100                        /* set if driver responds to read requests */
  129. };
  130. /* run-time flags used in the device control entry */
  131. enum {
  132.     dVMImmuneBit                = 0,                            /* driver does not need VM protection */
  133.     dOpened                     = 5,                            /* driver is open */
  134.     dRAMBased                   = 6,                            /* dCtlDriver is a handle (1) or pointer (0) */
  135.     drvrActive                  = 7                             /* driver is currently processing a request */
  136. };
  137. enum {
  138.     dVMImmuneMask               = 0x0001,                       /* driver does not need VM protection */
  139.     dOpenedMask                 = 0x0020,                       /* driver is open */
  140.     dRAMBasedMask               = 0x0040,                       /* dCtlDriver is a handle (1) or pointer (0) */
  141.     drvrActiveMask              = 0x0080                        /* driver is currently processing a request */
  142. };
  143. struct DRVRHeader {
  144.     short                           drvrFlags;
  145.     short                           drvrDelay;
  146.     short                           drvrEMask;
  147.     short                           drvrMenu;
  148.     short                           drvrOpen;
  149.     short                           drvrPrime;
  150.     short                           drvrCtl;
  151.     short                           drvrStatus;
  152.     short                           drvrClose;
  153.     unsigned char                   drvrName[1];
  154. };
  155. typedef struct DRVRHeader               DRVRHeader;
  156. typedef DRVRHeader *                    DRVRHeaderPtr;
  157. typedef DRVRHeaderPtr *                 DRVRHeaderHandle;
  158. struct DCtlEntry {
  159.     Ptr                             dCtlDriver;
  160.     volatile short                  dCtlFlags;
  161.     QHdr                            dCtlQHdr;
  162.     volatile long                   dCtlPosition;
  163.     Handle                          dCtlStorage;
  164.     short                           dCtlRefNum;
  165.     long                            dCtlCurTicks;
  166.     GrafPtr                         dCtlWindow;
  167.     short                           dCtlDelay;
  168.     short                           dCtlEMask;
  169.     short                           dCtlMenu;
  170. };
  171. typedef struct DCtlEntry                DCtlEntry;
  172. typedef DCtlEntry *                     DCtlPtr;
  173. typedef DCtlPtr *                       DCtlHandle;
  174. struct AuxDCE {
  175.     Ptr                             dCtlDriver;
  176.     volatile short                  dCtlFlags;
  177.     QHdr                            dCtlQHdr;
  178.     long                            dCtlPosition;
  179.     Handle                          dCtlStorage;
  180.     short                           dCtlRefNum;
  181.     long                            dCtlCurTicks;
  182.     GrafPtr                         dCtlWindow;
  183.     short                           dCtlDelay;
  184.     short                           dCtlEMask;
  185.     short                           dCtlMenu;
  186.     SInt8                           dCtlSlot;
  187.     SInt8                           dCtlSlotId;
  188.     long                            dCtlDevBase;
  189.     Ptr                             dCtlOwner;
  190.     SInt8                           dCtlExtDev;
  191.     SInt8                           fillByte;
  192.     UInt32                          dCtlNodeID;
  193. };
  194. typedef struct AuxDCE                   AuxDCE;
  195. typedef AuxDCE *                        AuxDCEPtr;
  196. typedef AuxDCEPtr *                     AuxDCEHandle;
  197. /*  The NDRV Driver IO Entry Point and Commands */
  198. typedef UInt16                          UnitNumber;
  199. typedef UInt32                          DriverOpenCount;
  200. typedef SInt16                          DriverRefNum;
  201. typedef SInt16                          DriverFlags;
  202. typedef UInt32                          IOCommandCode;
  203. enum {
  204.     kOpenCommand                = 0,
  205.     kCloseCommand               = 1,
  206.     kReadCommand                = 2,
  207.     kWriteCommand               = 3,
  208.     kControlCommand             = 4,
  209.     kStatusCommand              = 5,
  210.     kKillIOCommand              = 6,
  211.     kInitializeCommand          = 7,                            /* init driver and device*/
  212.     kFinalizeCommand            = 8,                            /* shutdown driver and device*/
  213.     kReplaceCommand             = 9,                            /* replace an old driver*/
  214.     kSupersededCommand          = 10,                           /* prepare to be replaced by a new driver*/
  215.     kSuspendCommand             = 11,                           /* prepare driver to go to sleep*/
  216.     kResumeCommand              = 12                            /* wake up sleeping driver*/
  217. };
  218. typedef struct OpaqueAddressSpaceID*    AddressSpaceID;
  219. typedef struct OpaqueIOCommandID*       IOCommandID;
  220. typedef UInt32                          IOCommandKind;
  221. enum {
  222.     kSynchronousIOCommandKind   = 0x00000001,
  223.     kAsynchronousIOCommandKind  = 0x00000002,
  224.     kImmediateIOCommandKind     = 0x00000004
  225. };
  226. struct DriverInitInfo {
  227.     DriverRefNum                    refNum;
  228.     RegEntryID                      deviceEntry;
  229. };
  230. typedef struct DriverInitInfo           DriverInitInfo;
  231. typedef DriverInitInfo *                DriverInitInfoPtr;
  232. typedef DriverInitInfo                  DriverReplaceInfo;
  233. typedef DriverInitInfo *                DriverReplaceInfoPtr;
  234. struct DriverFinalInfo {
  235.     DriverRefNum                    refNum;
  236.     RegEntryID                      deviceEntry;
  237. };
  238. typedef struct DriverFinalInfo          DriverFinalInfo;
  239. typedef DriverFinalInfo *               DriverFinalInfoPtr;
  240. typedef DriverFinalInfo                 DriverSupersededInfo;
  241. typedef DriverFinalInfo *               DriverSupersededInfoPtr;
  242. /* Contents are command specific*/
  243. union IOCommandContents {
  244.     ParmBlkPtr                      pb;
  245.     DriverInitInfoPtr               initialInfo;
  246.     DriverFinalInfoPtr              finalInfo;
  247.     DriverReplaceInfoPtr            replaceInfo;
  248.     DriverSupersededInfoPtr         supersededInfo;
  249. };
  250. typedef union IOCommandContents         IOCommandContents;
  251. typedef CALLBACK_API_C( OSErr , DriverEntryPointPtr )(AddressSpaceID SpaceID, IOCommandID CommandID, IOCommandContents Contents, IOCommandCode Code, IOCommandKind Kind);
  252. /* Record to describe a file-based driver candidate */
  253. struct FileBasedDriverRecord {
  254.     FSSpec                          theSpec;                    /* file specification*/
  255.     MacDriverType                   theType;                    /* nameInfoStr + version number*/
  256.     Boolean                         compatibleProp;             /* true if matched using a compatible name*/
  257.     UInt8                           pad[3];                     /* alignment*/
  258. };
  259. typedef struct FileBasedDriverRecord    FileBasedDriverRecord;
  260. typedef FileBasedDriverRecord *         FileBasedDriverRecordPtr;
  261. /* Detailed Record to describe a file-based driver candidate. Includes fragment name */
  262. struct FileBasedDriverDetailed {
  263.     FileBasedDriverRecord           fileBasedDriver;
  264.     Str63                           fragName;
  265. };
  266. typedef struct FileBasedDriverDetailed  FileBasedDriverDetailed;
  267. typedef FileBasedDriverDetailed *       FileBasedDriverDetailedPtr;
  268. /* Driver Loader API */
  269. #define DECLARE_DRIVERDESCRIPTION(N_ADDITIONAL_SERVICES)
  270.         struct {
  271.             DriverDescription   fixed;
  272.             DriverServiceInfo   additional_service[N_ADDITIONAL_SERVICES-1];
  273.         };
  274. #if CALL_NOT_IN_CARBON
  275. EXTERN_API_C( SInt16 )
  276. HigherDriverVersion             (const NumVersion *     driverVersion1,
  277.                                  const NumVersion *     driverVersion2);
  278. EXTERN_API_C( OSErr )
  279. VerifyFragmentAsDriver          (CFragConnectionID      fragmentConnID,
  280.                                  DriverEntryPointPtr *  fragmentMain,
  281.                                  DriverDescriptionPtr * driverDesc);
  282. EXTERN_API_C( OSErr )
  283. GetDriverMemoryFragment         (Ptr                    memAddr,
  284.                                  long                   length,
  285.                                  ConstStr63Param        fragName,
  286.                                  CFragConnectionID *    fragmentConnID,
  287.                                  DriverEntryPointPtr *  fragmentMain,
  288.                                  DriverDescriptionPtr * driverDesc);
  289. EXTERN_API_C( OSErr )
  290. GetDriverDiskFragment           (FSSpecPtr              fragmentSpec,
  291.                                  CFragConnectionID *    fragmentConnID,
  292.                                  DriverEntryPointPtr *  fragmentMain,
  293.                                  DriverDescriptionPtr * driverDesc);
  294. EXTERN_API_C( OSErr )
  295. GetNamedDriverDiskFragment      (FSSpecPtr              fragmentSpec,
  296.                                  ConstStr63Param        fragName,
  297.                                  CFragConnectionID *    fragmentConnID,
  298.                                  DriverEntryPointPtr *  fragmentMain,
  299.                                  DriverDescriptionPtr * driverDesc);
  300. EXTERN_API_C( OSErr )
  301. InstallDriverFromFragment       (CFragConnectionID      fragmentConnID,
  302.                                  RegEntryID *           device,
  303.                                  UnitNumber             beginningUnit,
  304.                                  UnitNumber             endingUnit,
  305.                                  DriverRefNum *         refNum);
  306. EXTERN_API_C( OSErr )
  307. InstallDriverFromFile           (FSSpecPtr              fragmentSpec,
  308.                                  RegEntryID *           device,
  309.                                  UnitNumber             beginningUnit,
  310.                                  UnitNumber             endingUnit,
  311.                                  DriverRefNum *         refNum);
  312. EXTERN_API_C( OSErr )
  313. InstallDriverFromMemory         (Ptr                    memory,
  314.                                  long                   length,
  315.                                  ConstStr63Param        fragName,
  316.                                  RegEntryID *           device,
  317.                                  UnitNumber             beginningUnit,
  318.                                  UnitNumber             endingUnit,
  319.                                  DriverRefNum *         refNum);
  320. EXTERN_API_C( OSErr )
  321. InstallDriverFromResource       (SInt16                 theRsrcID,
  322.                                  ConstStr255Param       theRsrcName,
  323.                                  RegEntryIDPtr          theDevice,
  324.                                  UnitNumber             theBeginningUnit,
  325.                                  UnitNumber             theEndingUnit,
  326.                                  DriverRefNum *         theRefNum);
  327. EXTERN_API_C( OSErr )
  328. InstallDriverFromDisk           (Ptr                    theDriverName,
  329.                                  RegEntryID *           theDevice,
  330.                                  UnitNumber             theBeginningUnit,
  331.                                  UnitNumber             theEndingUnit,
  332.                                  DriverRefNum *         theRefNum);
  333. EXTERN_API_C( OSErr )
  334. FindDriversForDevice            (RegEntryID *           device,
  335.                                  FSSpec *               fragmentSpec,
  336.                                  DriverDescription *    fileDriverDesc,
  337.                                  Ptr *                  memAddr,
  338.                                  long *                 length,
  339.                                  StringPtr              fragName,
  340.                                  DriverDescription *    memDriverDesc);
  341. EXTERN_API_C( OSErr )
  342. FindDriverForDeviceFromFile     (RegEntryID *           device,
  343.                                  FSSpec *               fragmentSpec,
  344.                                  DriverDescription *    driverDesc,
  345.                                  StringPtr              fragName);
  346. EXTERN_API_C( OSErr )
  347. FindDriverCandidates            (RegEntryID *           deviceID,
  348.                                  Ptr *                  propBasedDriver,
  349.                                  RegPropertyValueSize * propBasedDriverSize,
  350.                                  StringPtr              deviceName,
  351.                                  MacDriverType *        propBasedDriverType,
  352.                                  Boolean *              gotPropBasedDriver,
  353.                                  FileBasedDriverRecordPtr  fileBasedDrivers,
  354.                                  ItemCount *            nFileBasedDrivers);
  355. EXTERN_API_C( OSErr )
  356. FindDriverCandidatesDetailed    (RegEntryIDPtr          deviceID,
  357.                                  Ptr *                  propBasedDriver,
  358.                                  RegPropertyValueSize * propBasedDriverSize,
  359.                                  StringPtr              deviceName,
  360.                                  MacDriverType *        propBasedDriverType,
  361.                                  Boolean *              gotPropBasedDriver,
  362.                                  FileBasedDriverDetailedPtr  fileBasedDrivers,
  363.                                  ItemCount *            nFileBasedDrivers);
  364. EXTERN_API_C( OSErr )
  365. ScanDriverCandidates            (RegEntryID *           deviceID,
  366.                                  FileBasedDriverRecordPtr  fileBasedDrivers,
  367.                                  ItemCount              nFileBasedDrivers,
  368.                                  FileBasedDriverRecordPtr  matchingDrivers,
  369.                                  ItemCount *            nMatchingDrivers);
  370. EXTERN_API_C( OSErr )
  371. ScanDriverCandidatesDetailed    (RegEntryID *           deviceID,
  372.                                  FileBasedDriverDetailedPtr  fileBasedDrivers,
  373.                                  ItemCount              nFileBasedDrivers,
  374.                                  FileBasedDriverDetailedPtr  matchingDrivers,
  375.                                  ItemCount *            nMatchingDrivers);
  376. EXTERN_API_C( SInt16 )
  377. CompareFileCandToPropCand       (RegEntryID *           device,
  378.                                  StringPtr              deviceName,
  379.                                  DriverTypePtr          propBasedCandidate,
  380.                                  FileBasedDriverRecordPtr  fileBasedCandidate);
  381. EXTERN_API_C( void )
  382. GetCompatibleProperty           (RegEntryID *           device,
  383.                                  StringPtr *            compatibleNames,
  384.                                  ItemCount *            nCompatibleNames);
  385. EXTERN_API_C( Boolean )
  386. CompatibleDriverNames           (StringPtr              nameInfoStr,
  387.                                  StringPtr              compatibleNames,
  388.                                  ItemCount              nCompatibleNames,
  389.                                  long *                 nameCount);
  390. EXTERN_API_C( OSErr )
  391. GetDriverForDevice              (RegEntryID *           device,
  392.                                  CFragConnectionID *    fragmentConnID,
  393.                                  DriverEntryPointPtr *  fragmentMain,
  394.                                  DriverDescriptionPtr * driverDesc);
  395. EXTERN_API_C( OSErr )
  396. InstallDriverForDevice          (RegEntryID *           device,
  397.                                  UnitNumber             beginningUnit,
  398.                                  UnitNumber             endingUnit,
  399.                                  DriverRefNum *         refNum);
  400. EXTERN_API_C( OSErr )
  401. GetDriverInformation            (DriverRefNum           refNum,
  402.                                  UnitNumber *           unitNum,
  403.                                  DriverFlags *          flags,
  404.                                  DriverOpenCount *      count,
  405.                                  StringPtr              name,
  406.                                  RegEntryID *           device,
  407.                                  CFragSystem7Locator *  driverLoadLocation,
  408.                                  CFragConnectionID *    fragmentConnID,
  409.                                  DriverEntryPointPtr *  fragmentMain,
  410.                                  DriverDescription *    driverDesc);
  411. EXTERN_API_C( OSErr )
  412. GetDriverDescription            (LogicalAddress         fragmentPtr,
  413.                                  DriverDescriptionPtr * theDriverDesc);
  414. EXTERN_API_C( OSStatus )
  415. GetNamedDriverDescFromFSSpec    (FSSpecPtr              fragmentSpec,
  416.                                  StringPtr              fragName,
  417.                                  DriverDescriptionPtr * driverDesc);
  418. EXTERN_API_C( OSErr )
  419. SetDriverClosureMemory          (CFragConnectionID      fragmentConnID,
  420.                                  Boolean                holdDriverMemory);
  421. EXTERN_API_C( OSErr )
  422. ReplaceDriverWithFragment       (DriverRefNum           theRefNum,
  423.                                  CFragConnectionID      fragmentConnID);
  424. EXTERN_API_C( OSErr )
  425. OpenInstalledDriver             (DriverRefNum           refNum,
  426.                                  SInt8                  ioPermission);
  427. EXTERN_API_C( OSErr )
  428. RenameDriver                    (DriverRefNum           refNum,
  429.                                  StringPtr              newDriverName);
  430. EXTERN_API_C( OSErr )
  431. RemoveDriver                    (DriverRefNum           refNum,
  432.                                  Boolean                immediate);
  433. EXTERN_API_C( OSErr )
  434. LookupDrivers                   (UnitNumber             beginningUnit,
  435.                                  UnitNumber             endingUnit,
  436.                                  Boolean                emptyUnits,
  437.                                  ItemCount *            returnedRefNums,
  438.                                  DriverRefNum *         refNums);
  439. EXTERN_API_C( UnitNumber )
  440. HighestUnitNumber               (void);
  441. EXTERN_API_C( OSErr )
  442. DriverGestaltOn                 (DriverRefNum           refNum);
  443. EXTERN_API_C( OSErr )
  444. DriverGestaltOff                (DriverRefNum           refNum);
  445. EXTERN_API_C( Boolean )
  446. DriverGestaltIsOn               (DriverFlags            flags);
  447.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  448.                                                                                             #pragma parameter __D0 PBOpenSync(__A0)
  449.                                                                                             #endif
  450. EXTERN_API( OSErr )
  451. PBOpenSync                      (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA000);
  452.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  453.                                                                                             #pragma parameter __D0 PBOpenAsync(__A0)
  454.                                                                                             #endif
  455. EXTERN_API( OSErr )
  456. PBOpenAsync                     (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA400);
  457.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  458.                                                                                             #pragma parameter __D0 PBOpenImmed(__A0)
  459.                                                                                             #endif
  460. EXTERN_API( OSErr )
  461. PBOpenImmed                     (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA200);
  462. #endif  /* CALL_NOT_IN_CARBON */
  463.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  464.                                                                                             #pragma parameter __D0 PBCloseSync(__A0)
  465.                                                                                             #endif
  466. EXTERN_API( OSErr )
  467. PBCloseSync                     (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA001);
  468.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  469.                                                                                             #pragma parameter __D0 PBCloseAsync(__A0)
  470.                                                                                             #endif
  471. EXTERN_API( OSErr )
  472. PBCloseAsync                    (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA401);
  473. #if CALL_NOT_IN_CARBON
  474.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  475.                                                                                             #pragma parameter __D0 PBCloseImmed(__A0)
  476.                                                                                             #endif
  477. EXTERN_API( OSErr )
  478. PBCloseImmed                    (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA201);
  479. #endif  /* CALL_NOT_IN_CARBON */
  480.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  481.                                                                                             #pragma parameter __D0 PBReadSync(__A0)
  482.                                                                                             #endif
  483. EXTERN_API( OSErr )
  484. PBReadSync                      (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA002);
  485.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  486.                                                                                             #pragma parameter __D0 PBReadAsync(__A0)
  487.                                                                                             #endif
  488. EXTERN_API( OSErr )
  489. PBReadAsync                     (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA402);
  490. #if CALL_NOT_IN_CARBON
  491.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  492.                                                                                             #pragma parameter __D0 PBReadImmed(__A0)
  493.                                                                                             #endif
  494. EXTERN_API( OSErr )
  495. PBReadImmed                     (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA202);
  496. #endif  /* CALL_NOT_IN_CARBON */
  497.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  498.                                                                                             #pragma parameter __D0 PBWriteSync(__A0)
  499.                                                                                             #endif
  500. EXTERN_API( OSErr )
  501. PBWriteSync                     (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA003);
  502.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  503.                                                                                             #pragma parameter __D0 PBWriteAsync(__A0)
  504.                                                                                             #endif
  505. EXTERN_API( OSErr )
  506. PBWriteAsync                    (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA403);
  507. #if CALL_NOT_IN_CARBON
  508.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  509.                                                                                             #pragma parameter __D0 PBWriteImmed(__A0)
  510.                                                                                             #endif
  511. EXTERN_API( OSErr )
  512. PBWriteImmed                    (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA203);
  513. /*
  514.     PBWaitIOComplete is a friendly way for applications to monitor
  515.     a pending asynchronous I/O operation in power-managed and
  516.     preemptive multitasking systems.
  517.  */
  518. #endif  /* CALL_NOT_IN_CARBON */
  519. EXTERN_API( OSErr )
  520. PBWaitIOComplete                (ParmBlkPtr             paramBlock,
  521.                                  Duration               timeout);
  522. #if CALL_NOT_IN_CARBON
  523. EXTERN_API( void )
  524. AddDrive                        (short                  drvrRefNum,
  525.                                  short                  drvNum,
  526.                                  DrvQElPtr              qEl);
  527. #endif  /* CALL_NOT_IN_CARBON */
  528. #if CALL_NOT_IN_CARBON
  529. #if CALL_NOT_IN_CARBON
  530. EXTERN_API( QHdrPtr )
  531. GetDrvQHdr                      (void)                                                      THREEWORDINLINE(0x2EBC, 0x0000, 0x0308);
  532. EXTERN_API( DCtlHandle )
  533. GetDCtlEntry                    (short                  refNum);
  534. #endif  /* CALL_NOT_IN_CARBON */
  535. #endif  /* CALL_NOT_IN_CARBON */
  536. /*
  537.     SetChooserAlert used to simply set a bit in a low-mem global
  538.     to tell the Chooser not to display its warning message when
  539.     the printer is changed. However, under MultiFinder and System 7,
  540.     this low-mem is swapped out when a layer change occurs, and the
  541.     Chooser never sees the change. It is obsolete, and completely
  542.     unsupported on the PowerPC. 68K apps can still call it if they
  543.     wish.
  544.     
  545.     pascal Boolean SetChooserAlert(Boolean f);
  546. */
  547. #if CALL_NOT_IN_CARBON
  548.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  549.                                                                                             #pragma parameter __D0 DriverInstall(__A0, __D0)
  550.                                                                                             #endif
  551. EXTERN_API( OSErr )
  552. DriverInstall                   (DRVRHeaderPtr          drvrPtr,
  553.                                  short                  refNum)                             ONEWORDINLINE(0xA03D);
  554.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  555.                                                                                             #pragma parameter __D0 DriverInstallReserveMem(__A0, __D0)
  556.                                                                                             #endif
  557. EXTERN_API( OSErr )
  558. DriverInstallReserveMem         (DRVRHeaderPtr          drvrPtr,
  559.                                  short                  refNum)                             ONEWORDINLINE(0xA43D);
  560. /*
  561.   Note: DrvrInstall() is no longer supported, becuase it never really worked anyways.
  562.         There will soon be a DriverInstall() which does the right thing.
  563.         DrvrRemove has been renamed to DriverRemove.  But, InterfaceLib for PowerPC
  564.         still exports DrvrRemove, so a macro is used to map the new name to old.
  565. */
  566.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  567.                                                                                             #pragma parameter __D0 DrvrRemove(__D0)
  568.                                                                                             #endif
  569. EXTERN_API( OSErr )
  570. DrvrRemove                      (short                  refNum)                             ONEWORDINLINE(0xA03E);
  571. #endif  /* CALL_NOT_IN_CARBON */
  572. #define DriverRemove(refNum) DrvrRemove(refNum)
  573. #if CALL_NOT_IN_CARBON
  574. #if TARGET_OS_MAC
  575.     #define MacOpenDriver OpenDriver
  576. #endif
  577. EXTERN_API( OSErr )
  578. MacOpenDriver                   (ConstStr255Param       name,
  579.                                  short *                drvrRefNum);
  580. #if TARGET_OS_MAC
  581.     #define MacCloseDriver CloseDriver
  582. #endif
  583. EXTERN_API( OSErr )
  584. MacCloseDriver                  (short                  refNum);
  585. EXTERN_API( OSErr )
  586. Control                         (short                  refNum,
  587.                                  short                  csCode,
  588.                                  const void *           csParamPtr);
  589. EXTERN_API( OSErr )
  590. Status                          (short                  refNum,
  591.                                  short                  csCode,
  592.                                  void *                 csParamPtr);
  593. EXTERN_API( OSErr )
  594. KillIO                          (short                  refNum);
  595.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  596.                                                                                             #pragma parameter __D0 Fetch(__A1)
  597.                                                                                             #endif
  598. EXTERN_API( long )
  599. Fetch                           (DCtlPtr                dce)                                THREEWORDINLINE(0x2078, 0x08F4, 0x4E90);
  600.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  601.                                                                                             #pragma parameter __D0 Stash(__A1, __D0)
  602.                                                                                             #endif
  603. EXTERN_API( long )
  604. Stash                           (DCtlPtr                dce,
  605.                                  char                   data)                               THREEWORDINLINE(0x2078, 0x08F8, 0x4E90);
  606.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  607.                                                                                             #pragma parameter IODone(__A1, __D0)
  608.                                                                                             #endif
  609. EXTERN_API( void )
  610. IODone                          (DCtlPtr                dce,
  611.                                  OSErr                  ioResult)                           THREEWORDINLINE(0x2078, 0x08FC, 0x4E90);
  612. #endif  /* CALL_NOT_IN_CARBON */
  613. #if CALL_NOT_IN_CARBON
  614.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  615.                                                                                             #pragma parameter __D0 PBControlSync(__A0)
  616.                                                                                             #endif
  617. EXTERN_API( OSErr )
  618. PBControlSync                   (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA004);
  619.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  620.                                                                                             #pragma parameter __D0 PBControlAsync(__A0)
  621.                                                                                             #endif
  622. EXTERN_API( OSErr )
  623. PBControlAsync                  (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA404);
  624.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  625.                                                                                             #pragma parameter __D0 PBControlImmed(__A0)
  626.                                                                                             #endif
  627. EXTERN_API( OSErr )
  628. PBControlImmed                  (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA204);
  629. #endif  /* CALL_NOT_IN_CARBON */
  630. #if CALL_NOT_IN_CARBON
  631. #if CALL_NOT_IN_CARBON
  632.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  633.                                                                                             #pragma parameter __D0 PBStatusSync(__A0)
  634.                                                                                             #endif
  635. EXTERN_API( OSErr )
  636. PBStatusSync                    (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA005);
  637. #endif  /* CALL_NOT_IN_CARBON */
  638. #endif  /* CALL_NOT_IN_CARBON */
  639. #if CALL_NOT_IN_CARBON
  640.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  641.                                                                                             #pragma parameter __D0 PBStatusAsync(__A0)
  642.                                                                                             #endif
  643. EXTERN_API( OSErr )
  644. PBStatusAsync                   (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA405);
  645.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  646.                                                                                             #pragma parameter __D0 PBStatusImmed(__A0)
  647.                                                                                             #endif
  648. EXTERN_API( OSErr )
  649. PBStatusImmed                   (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA205);
  650.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  651.                                                                                             #pragma parameter __D0 PBKillIOSync(__A0)
  652.                                                                                             #endif
  653. EXTERN_API( OSErr )
  654. PBKillIOSync                    (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA006);
  655.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  656.                                                                                             #pragma parameter __D0 PBKillIOAsync(__A0)
  657.                                                                                             #endif
  658. EXTERN_API( OSErr )
  659. PBKillIOAsync                   (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA406);
  660.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  661.                                                                                             #pragma parameter __D0 PBKillIOImmed(__A0)
  662.                                                                                             #endif
  663. EXTERN_API( OSErr )
  664. PBKillIOImmed                   (ParmBlkPtr             paramBlock)                         ONEWORDINLINE(0xA206);
  665. EXTERN_API( short )
  666. OpenDeskAcc                     (ConstStr255Param       deskAccName)                        ONEWORDINLINE(0xA9B6);
  667. EXTERN_API( void )
  668. CloseDeskAcc                    (short                  refNum)                             ONEWORDINLINE(0xA9B7);
  669. #endif  /* CALL_NOT_IN_CARBON */
  670. #if CALL_NOT_IN_CARBON
  671. EXTERN_API_C( short )
  672. opendeskacc                     (const char *           deskAccName);
  673. EXTERN_API_C( OSErr )
  674. opendriver                      (const char *           driverName,
  675.                                  short *                refNum);
  676. #endif  /* CALL_NOT_IN_CARBON */
  677. /*
  678.     The PBxxx() routines are obsolete.  
  679.     
  680.     Use the PBxxxSync(), PBxxxAsync(), or PBxxxImmed version instead.
  681. */
  682. #define PBControl(pb, async) ((async) ? PBControlAsync(pb) : PBControlSync(pb))
  683. #define PBStatus(pb, async) ((async) ? PBStatusAsync(pb) : PBStatusSync(pb))
  684. #define PBKillIO(pb, async) ((async) ? PBKillIOAsync(pb) : PBKillIOSync(pb))
  685. #define PBOpen(pb, async) ((async) ? PBOpenAsync(pb) : PBOpenSync(pb))
  686. #define PBClose(pb, async) ((async) ? PBCloseAsync(pb) : PBCloseSync(pb))
  687. #define PBRead(pb, async) ((async) ? PBReadAsync(pb) : PBReadSync(pb))
  688. #define PBWrite(pb, async) ((async) ? PBWriteAsync(pb) : PBWriteSync(pb))
  689. #if PRAGMA_STRUCT_ALIGN
  690.     #pragma options align=reset
  691. #elif PRAGMA_STRUCT_PACKPUSH
  692.     #pragma pack(pop)
  693. #elif PRAGMA_STRUCT_PACK
  694.     #pragma pack()
  695. #endif
  696. #ifdef PRAGMA_IMPORT_OFF
  697. #pragma import off
  698. #elif PRAGMA_IMPORT
  699. #pragma import reset
  700. #endif
  701. #ifdef __cplusplus
  702. }
  703. #endif
  704. #endif /* __DEVICES__ */