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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       PPCToolbox.h
  3.  
  4.      Contains:   Program-Program Communications Toolbox Interfaces.
  5.  
  6.      Version:    Technology: Mac OS 9
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1989-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 __PPCTOOLBOX__
  18. #define __PPCTOOLBOX__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __APPLETALK__
  23. #include "AppleTalk.h"
  24. #endif
  25. #if PRAGMA_ONCE
  26. #pragma once
  27. #endif
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #if PRAGMA_IMPORT
  32. #pragma import on
  33. #endif
  34. #if PRAGMA_STRUCT_ALIGN
  35.     #pragma options align=mac68k
  36. #elif PRAGMA_STRUCT_PACKPUSH
  37.     #pragma pack(push, 2)
  38. #elif PRAGMA_STRUCT_PACK
  39.     #pragma pack(2)
  40. #endif
  41. typedef UInt8 PPCServiceType;
  42. enum {
  43.     ppcServiceRealTime          = 1
  44. };
  45. typedef SInt16 PPCLocationKind;
  46. enum {
  47.     ppcNoLocation               = 0,                            /* There is no PPCLocName */
  48.     ppcNBPLocation              = 1,                            /* Use AppleTalk NBP      */
  49.     ppcNBPTypeLocation          = 2,                            /* Used for specifying a location name type during PPCOpen only */
  50.     ppcXTIAddrLocation          = 3                             /* Use TCP/IP or DNS host name address */
  51. };
  52. typedef SInt16 PPCPortKinds;
  53. enum {
  54.     ppcByCreatorAndType         = 1,                            /* Port type is specified as colloquial Mac creator and type */
  55.     ppcByString                 = 2                             /* Port type is in pascal string format */
  56. };
  57. /* Values returned for request field in PPCInform call */
  58. typedef UInt8 PPCSessionOrigin;
  59. enum {
  60.     ppcLocalOrigin              = 1,                            /* session originated from this machine */
  61.     ppcRemoteOrigin             = 2                             /* session originated from remote machine */
  62. };
  63. typedef short                           PPCPortRefNum;
  64. typedef long                            PPCSessRefNum;
  65. /*  The maximum allowed size of a fAddress in PPCXTIAddress */
  66. enum {
  67.     kMaxPPCXTIAddress           = 95
  68. };
  69. /*    
  70.     The possible types of information found in the fAddressType field of a PPCXTIAddress record
  71.     Note:   These constants are the same as the AF_INET & AF_DNS constants, defined in OpenTptInternet.x
  72. */
  73. typedef SInt16 PPCXTIAddressType;
  74. enum {
  75.     kINETAddrType               = 2,                            /*    An IP address in binary form (type InetHost).*/
  76.     kDNSAddrType                = 42                            /*    A DNS or dotted-decimal name string (no leading length byte, no NULL termination byte)*/
  77. };
  78. /*    
  79.     This structure specifies a transport independent network address in a 
  80.     form that can be used by Open Transport, or as a XTI/TLI/socket network 
  81.     address in UNIX terminology.
  82. */
  83. struct PPCXTIAddress {
  84.     PPCXTIAddressType               fAddressType;               /* A constant specifying what kind of network address this is */
  85.     UInt8                           fAddress[96];               /* The contents of the network address (variable length, NULL terminated). */
  86. };
  87. typedef struct PPCXTIAddress            PPCXTIAddress;
  88. typedef PPCXTIAddress *                 PPCXTIAddressPtr;
  89. /*
  90.     This structure is the variant type used in a LocationNameRec when an IP connection
  91.     is being established for a PPC Toolbox session.
  92.     
  93.     NOTE: The value of the xtiAddrLen must be the length of the entire PPCXTIAddress structure 
  94.     in the xtiAddr field, and not just the length of the fAddress field of the PPCXTIAddress structure.
  95. */
  96. struct PPCAddrRec {
  97.     UInt8                           Reserved[3];                /* reserved - must be initialize to 0          */
  98.     UInt8                           xtiAddrLen;                 /* size of the xtiAddr field             */
  99.     PPCXTIAddress                   xtiAddr;                    /* the transport-independent network address   */
  100. };
  101. typedef struct PPCAddrRec               PPCAddrRec;
  102. typedef PPCAddrRec *                    PPCAddrRecPtr;
  103. struct LocationNameRec {
  104.     PPCLocationKind                 locationKindSelector;       /* which variant */
  105.     union {
  106.         EntityName                      nbpEntity;              /* NBP name entity                   */
  107.         Str32                           nbpType;                /* just the NBP type string, for PPCOpen  */
  108.         PPCAddrRec                      xtiType;                /* an XTI-type network address record     */
  109.     }                                 u;
  110. };
  111. typedef struct LocationNameRec          LocationNameRec;
  112. typedef LocationNameRec *               LocationNamePtr;
  113. struct PPCPortRec {
  114.     ScriptCode                      nameScript;                 /* script of name */
  115.     Str32Field                      name;                       /* name of port as seen in browser */
  116.     PPCPortKinds                    portKindSelector;           /* which variant */
  117.     union {
  118.         Str32                           portTypeStr;            /* pascal type string */
  119.         struct {
  120.             OSType                          portCreator;
  121.             OSType                          portType;
  122.         }                                 port;
  123.     }                                 u;
  124. };
  125. typedef struct PPCPortRec               PPCPortRec;
  126. typedef PPCPortRec *                    PPCPortPtr;
  127. struct PortInfoRec {
  128.     SInt8                           filler1;
  129.     Boolean                         authRequired;
  130.     PPCPortRec                      name;
  131. };
  132. typedef struct PortInfoRec              PortInfoRec;
  133. typedef PortInfoRec *                   PortInfoPtr;
  134. typedef PortInfoRec *                   PortInfoArrayPtr;
  135. typedef union PPCParamBlockRec          PPCParamBlockRec;
  136. typedef PPCParamBlockRec *              PPCParamBlockPtr;
  137. typedef CALLBACK_API( void , PPCCompProcPtr )(PPCParamBlockPtr pb);
  138. typedef STACK_UPP_TYPE(PPCCompProcPtr)                          PPCCompUPP;
  139. #define PPCHeader 
  140.      Ptr            qLink;                  /* PPC's Internal Use */
  141.      unsigned short csCode;                 /* Requested PPC command */
  142.      unsigned short intUse;                 /* Internal Use */
  143.      Ptr            intUsePtr;              /* Internal Use */
  144.      PPCCompUPP     ioCompletion;           /* 12 --> Completion Routine */
  145.      OSErr          ioResult;               /* 16 <-- Command Result Code */
  146.      unsigned long  Reserved[5];            /* Reserved for PPC, Don't use */
  147. struct PPCOpenPBRec {
  148.     Ptr                             qLink;                      /* PPC's Internal Use */
  149.     unsigned short                  csCode;                     /* Requested PPC command */
  150.     unsigned short                  intUse;                     /* Internal Use */
  151.     Ptr                             intUsePtr;                  /* Internal Use */
  152.     PPCCompUPP                      ioCompletion;               /* 12 --> Completion Routine */
  153.     OSErr                           ioResult;                   /* 16 <--     Command Result Code */
  154.     unsigned long                   Reserved[5];                /* Reserved for PPC, Don't use */
  155.     PPCPortRefNum                   portRefNum;                 /* 38 <--   Port Reference */
  156.     long                            filler1;
  157.     PPCServiceType                  serviceType;                /* 44 -->    Bit field describing the requested port service */
  158.     UInt8                           resFlag;                    /* Must be set to 0 */
  159.     PPCPortPtr                      portName;                   /* 46 -->   PortName for PPC */
  160.     LocationNamePtr                 locationName;               /* 50 -->   If NBP Registration is required */
  161.     Boolean                         networkVisible;             /* 54 -->   make this network visible on network */
  162.     Boolean                         nbpRegistered;              /* 55 <--   The given location name was registered on the network */
  163. };
  164. typedef struct PPCOpenPBRec             PPCOpenPBRec;
  165. typedef PPCOpenPBRec *                  PPCOpenPBPtr;
  166. struct PPCInformPBRec {
  167.     Ptr                             qLink;                      /* PPC's Internal Use */
  168.     unsigned short                  csCode;                     /* Requested PPC command */
  169.     unsigned short                  intUse;                     /* Internal Use */
  170.     Ptr                             intUsePtr;                  /* Internal Use */
  171.     PPCCompUPP                      ioCompletion;               /* 12 --> Completion Routine */
  172.     OSErr                           ioResult;                   /* 16 <--     Command Result Code */
  173.     unsigned long                   Reserved[5];                /* Reserved for PPC, Don't use */
  174.     PPCPortRefNum                   portRefNum;                 /* 38 -->   Port Identifier */
  175.     PPCSessRefNum                   sessRefNum;                 /* 40 <--   Session Reference */
  176.     PPCServiceType                  serviceType;                /* 44 <--   Status Flags for type of session, local, remote */
  177.     Boolean                         autoAccept;                 /* 45 -->   if true session will be accepted automatically */
  178.     PPCPortPtr                      portName;                   /* 46 -->   Buffer for Source PPCPortRec */
  179.     LocationNamePtr                 locationName;               /* 50 -->   Buffer for Source LocationNameRec */
  180.     StringPtr                       userName;                   /* 54 -->   Buffer for Soure user's name trying to link. */
  181.     unsigned long                   userData;                   /* 58 <--   value included in PPCStart's userData */
  182.     PPCSessionOrigin                requestType;                /* 62 <--   Local or Network */
  183.     SInt8                           filler;
  184. };
  185. typedef struct PPCInformPBRec           PPCInformPBRec;
  186. typedef PPCInformPBRec *                PPCInformPBPtr;
  187. struct PPCStartPBRec {
  188.     Ptr                             qLink;                      /* PPC's Internal Use */
  189.     unsigned short                  csCode;                     /* Requested PPC command */
  190.     unsigned short                  intUse;                     /* Internal Use */
  191.     Ptr                             intUsePtr;                  /* Internal Use */
  192.     PPCCompUPP                      ioCompletion;               /* 12 --> Completion Routine */
  193.     OSErr                           ioResult;                   /* 16 <--     Command Result Code */
  194.     unsigned long                   Reserved[5];                /* Reserved for PPC, Don't use */
  195.     PPCPortRefNum                   portRefNum;                 /* 38 -->   Port Identifier */
  196.     PPCSessRefNum                   sessRefNum;                 /* 40 <--   Session Reference */
  197.     PPCServiceType                  serviceType;                /* 44 <--   Actual service method (realTime) */
  198.     UInt8                           resFlag;                    /* 45 -->   Must be set to 0  */
  199.     PPCPortPtr                      portName;                   /* 46 -->   Destination portName */
  200.     LocationNamePtr                 locationName;               /* 50 -->   NBP or NAS style service location name */
  201.     unsigned long                   rejectInfo;                 /* 54 <--   reason for rejecting the session request */
  202.     unsigned long                   userData;                   /* 58 -->   Copied to destination PPCInform parameter block */
  203.     unsigned long                   userRefNum;                 /* 62 -->   userRefNum (obtained during login process)  */
  204. };
  205. typedef struct PPCStartPBRec            PPCStartPBRec;
  206. typedef PPCStartPBRec *                 PPCStartPBPtr;
  207. struct PPCAcceptPBRec {
  208.     Ptr                             qLink;                      /* PPC's Internal Use */
  209.     unsigned short                  csCode;                     /* Requested PPC command */
  210.     unsigned short                  intUse;                     /* Internal Use */
  211.     Ptr                             intUsePtr;                  /* Internal Use */
  212.     PPCCompUPP                      ioCompletion;               /* 12 --> Completion Routine */
  213.     OSErr                           ioResult;                   /* 16 <--     Command Result Code */
  214.     unsigned long                   Reserved[5];                /* Reserved for PPC, Don't use */
  215.     short                           filler1;
  216.     PPCSessRefNum                   sessRefNum;                 /* 40 -->   Session Reference */
  217. };
  218. typedef struct PPCAcceptPBRec           PPCAcceptPBRec;
  219. typedef PPCAcceptPBRec *                PPCAcceptPBPtr;
  220. struct PPCRejectPBRec {
  221.     Ptr                             qLink;                      /* PPC's Internal Use */
  222.     unsigned short                  csCode;                     /* Requested PPC command */
  223.     unsigned short                  intUse;                     /* Internal Use */
  224.     Ptr                             intUsePtr;                  /* Internal Use */
  225.     PPCCompUPP                      ioCompletion;               /* 12 --> Completion Routine */
  226.     OSErr                           ioResult;                   /* 16 <--     Command Result Code */
  227.     unsigned long                   Reserved[5];                /* Reserved for PPC, Don't use */
  228.     short                           filler1;
  229.     PPCSessRefNum                   sessRefNum;                 /* 40 -->   Session Reference */
  230.     short                           filler2;
  231.     long                            filler3;
  232.     long                            filler4;
  233.     unsigned long                   rejectInfo;                 /* 54 -->   reason for rejecting the session request  */
  234. };
  235. typedef struct PPCRejectPBRec           PPCRejectPBRec;
  236. typedef PPCRejectPBRec *                PPCRejectPBPtr;
  237. struct PPCWritePBRec {
  238.     Ptr                             qLink;                      /* PPC's Internal Use */
  239.     unsigned short                  csCode;                     /* Requested PPC command */
  240.     unsigned short                  intUse;                     /* Internal Use */
  241.     Ptr                             intUsePtr;                  /* Internal Use */
  242.     PPCCompUPP                      ioCompletion;               /* 12 --> Completion Routine */
  243.     OSErr                           ioResult;                   /* 16 <--     Command Result Code */
  244.     unsigned long                   Reserved[5];                /* Reserved for PPC, Don't use */
  245.     short                           filler1;
  246.     PPCSessRefNum                   sessRefNum;                 /* 40 -->   Session Reference */
  247.     Size                            bufferLength;               /* 44 -->   Length of the message buffer */
  248.     Size                            actualLength;               /* 48 <--   Actual Length Written */
  249.     Ptr                             bufferPtr;                  /* 52 -->   Pointer to message buffer */
  250.     Boolean                         more;                       /* 56 -->   if more data in this block will be written */
  251.     SInt8                           filler2;
  252.     unsigned long                   userData;                   /* 58 -->   Message block userData Uninterpreted by PPC */
  253.     OSType                          blockCreator;               /* 62 -->   Message block creator Uninterpreted by PPC */
  254.     OSType                          blockType;                  /* 66 -->   Message block type Uninterpreted by PPC */
  255. };
  256. typedef struct PPCWritePBRec            PPCWritePBRec;
  257. typedef PPCWritePBRec *                 PPCWritePBPtr;
  258. struct PPCReadPBRec {
  259.     Ptr                             qLink;                      /* PPC's Internal Use */
  260.     unsigned short                  csCode;                     /* Requested PPC command */
  261.     unsigned short                  intUse;                     /* Internal Use */
  262.     Ptr                             intUsePtr;                  /* Internal Use */
  263.     PPCCompUPP                      ioCompletion;               /* 12 --> Completion Routine */
  264.     OSErr                           ioResult;                   /* 16 <--     Command Result Code */
  265.     unsigned long                   Reserved[5];                /* Reserved for PPC, Don't use */
  266.     short                           filler1;
  267.     PPCSessRefNum                   sessRefNum;                 /* 40 -->   Session Reference */
  268.     Size                            bufferLength;               /* 44 -->   Length of the message buffer */
  269.     Size                            actualLength;               /* 48 <--   Actual length read */
  270.     Ptr                             bufferPtr;                  /* 52 -->   Pointer to message buffer */
  271.     Boolean                         more;                       /* 56 <--   if true more data in this block to be read */
  272.     SInt8                           filler2;
  273.     unsigned long                   userData;                   /* 58 <--   Message block userData Uninterpreted by PPC */
  274.     OSType                          blockCreator;               /* 62 <--   Message block creator Uninterpreted by PPC */
  275.     OSType                          blockType;                  /* 66 <--   Message block type Uninterpreted by PPC */
  276. };
  277. typedef struct PPCReadPBRec             PPCReadPBRec;
  278. typedef PPCReadPBRec *                  PPCReadPBPtr;
  279. struct PPCEndPBRec {
  280.     Ptr                             qLink;                      /* PPC's Internal Use */
  281.     unsigned short                  csCode;                     /* Requested PPC command */
  282.     unsigned short                  intUse;                     /* Internal Use */
  283.     Ptr                             intUsePtr;                  /* Internal Use */
  284.     PPCCompUPP                      ioCompletion;               /* 12 --> Completion Routine */
  285.     OSErr                           ioResult;                   /* 16 <--     Command Result Code */
  286.     unsigned long                   Reserved[5];                /* Reserved for PPC, Don't use */
  287.     short                           filler1;
  288.     PPCSessRefNum                   sessRefNum;                 /* 40 -->   Session Reference */
  289. };
  290. typedef struct PPCEndPBRec              PPCEndPBRec;
  291. typedef PPCEndPBRec *                   PPCEndPBPtr;
  292. struct PPCClosePBRec {
  293.     Ptr                             qLink;                      /* PPC's Internal Use */
  294.     unsigned short                  csCode;                     /* Requested PPC command */
  295.     unsigned short                  intUse;                     /* Internal Use */
  296.     Ptr                             intUsePtr;                  /* Internal Use */
  297.     PPCCompUPP                      ioCompletion;               /* 12 --> Completion Routine */
  298.     OSErr                           ioResult;                   /* 16 <--     Command Result Code */
  299.     unsigned long                   Reserved[5];                /* Reserved for PPC, Don't use */
  300.     PPCPortRefNum                   portRefNum;                 /* 38 -->   Port Identifier */
  301. };
  302. typedef struct PPCClosePBRec            PPCClosePBRec;
  303. typedef PPCClosePBRec *                 PPCClosePBPtr;
  304. struct IPCListPortsPBRec {
  305.     Ptr                             qLink;                      /* PPC's Internal Use */
  306.     unsigned short                  csCode;                     /* Requested PPC command */
  307.     unsigned short                  intUse;                     /* Internal Use */
  308.     Ptr                             intUsePtr;                  /* Internal Use */
  309.     PPCCompUPP                      ioCompletion;               /* 12 --> Completion Routine */
  310.     OSErr                           ioResult;                   /* 16 <--     Command Result Code */
  311.     unsigned long                   Reserved[5];                /* Reserved for PPC, Don't use */
  312.     short                           filler1;
  313.     unsigned short                  startIndex;                 /* 40 -->   Start Index */
  314.     unsigned short                  requestCount;               /* 42 -->   Number of entries to be returned */
  315.     unsigned short                  actualCount;                /* 44 <--   Actual Number of entries to be returned */
  316.     PPCPortPtr                      portName;                   /* 46 -->   PortName Match */
  317.     LocationNamePtr                 locationName;               /* 50 -->   NBP or NAS type name to locate the Port Location */
  318.     PortInfoArrayPtr                bufferPtr;                  /* 54 -->   Pointer to a buffer requestCount*sizeof(PortInfo) bytes big */
  319. };
  320. typedef struct IPCListPortsPBRec        IPCListPortsPBRec;
  321. typedef IPCListPortsPBRec *             IPCListPortsPBPtr;
  322. union PPCParamBlockRec {
  323.     PPCOpenPBRec                    openParam;
  324.     PPCInformPBRec                  informParam;
  325.     PPCStartPBRec                   startParam;
  326.     PPCAcceptPBRec                  acceptParam;
  327.     PPCRejectPBRec                  rejectParam;
  328.     PPCWritePBRec                   writeParam;
  329.     PPCReadPBRec                    readParam;
  330.     PPCEndPBRec                     endParam;
  331.     PPCClosePBRec                   closeParam;
  332.     IPCListPortsPBRec               listPortsParam;
  333. };
  334. /*  PPC Calling Conventions  */
  335. #if CALL_NOT_IN_CARBON
  336.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  337.                                                                                             #pragma parameter __D0 PPCInit
  338.                                                                                             #endif
  339. EXTERN_API( OSErr )
  340. PPCInit                         (void)                                                      TWOWORDINLINE(0x7000, 0xA0DD);
  341.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  342.                                                                                             #pragma parameter __D0 PPCOpenSync(__A0)
  343.                                                                                             #endif
  344. EXTERN_API( OSErr )
  345. PPCOpenSync                     (PPCOpenPBPtr           pb)                                 TWOWORDINLINE(0x7001, 0xA0DD);
  346.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  347.                                                                                             #pragma parameter __D0 PPCOpenAsync(__A0)
  348.                                                                                             #endif
  349. EXTERN_API( OSErr )
  350. PPCOpenAsync                    (PPCOpenPBPtr           pb)                                 TWOWORDINLINE(0x7001, 0xA4DD);
  351.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  352.                                                                                             #pragma parameter __D0 PPCInformSync(__A0)
  353.                                                                                             #endif
  354. EXTERN_API( OSErr )
  355. PPCInformSync                   (PPCInformPBPtr         pb)                                 TWOWORDINLINE(0x7003, 0xA0DD);
  356.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  357.                                                                                             #pragma parameter __D0 PPCInformAsync(__A0)
  358.                                                                                             #endif
  359. EXTERN_API( OSErr )
  360. PPCInformAsync                  (PPCInformPBPtr         pb)                                 TWOWORDINLINE(0x7003, 0xA4DD);
  361.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  362.                                                                                             #pragma parameter __D0 PPCStartSync(__A0)
  363.                                                                                             #endif
  364. EXTERN_API( OSErr )
  365. PPCStartSync                    (PPCStartPBPtr          pb)                                 TWOWORDINLINE(0x7002, 0xA0DD);
  366.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  367.                                                                                             #pragma parameter __D0 PPCStartAsync(__A0)
  368.                                                                                             #endif
  369. EXTERN_API( OSErr )
  370. PPCStartAsync                   (PPCStartPBPtr          pb)                                 TWOWORDINLINE(0x7002, 0xA4DD);
  371.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  372.                                                                                             #pragma parameter __D0 PPCAcceptSync(__A0)
  373.                                                                                             #endif
  374. EXTERN_API( OSErr )
  375. PPCAcceptSync                   (PPCAcceptPBPtr         pb)                                 TWOWORDINLINE(0x7004, 0xA0DD);
  376.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  377.                                                                                             #pragma parameter __D0 PPCAcceptAsync(__A0)
  378.                                                                                             #endif
  379. EXTERN_API( OSErr )
  380. PPCAcceptAsync                  (PPCAcceptPBPtr         pb)                                 TWOWORDINLINE(0x7004, 0xA4DD);
  381.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  382.                                                                                             #pragma parameter __D0 PPCRejectSync(__A0)
  383.                                                                                             #endif
  384. EXTERN_API( OSErr )
  385. PPCRejectSync                   (PPCRejectPBPtr         pb)                                 TWOWORDINLINE(0x7005, 0xA0DD);
  386.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  387.                                                                                             #pragma parameter __D0 PPCRejectAsync(__A0)
  388.                                                                                             #endif
  389. EXTERN_API( OSErr )
  390. PPCRejectAsync                  (PPCRejectPBPtr         pb)                                 TWOWORDINLINE(0x7005, 0xA4DD);
  391.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  392.                                                                                             #pragma parameter __D0 PPCWriteSync(__A0)
  393.                                                                                             #endif
  394. EXTERN_API( OSErr )
  395. PPCWriteSync                    (PPCWritePBPtr          pb)                                 TWOWORDINLINE(0x7006, 0xA0DD);
  396.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  397.                                                                                             #pragma parameter __D0 PPCWriteAsync(__A0)
  398.                                                                                             #endif
  399. EXTERN_API( OSErr )
  400. PPCWriteAsync                   (PPCWritePBPtr          pb)                                 TWOWORDINLINE(0x7006, 0xA4DD);
  401.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  402.                                                                                             #pragma parameter __D0 PPCReadSync(__A0)
  403.                                                                                             #endif
  404. EXTERN_API( OSErr )
  405. PPCReadSync                     (PPCReadPBPtr           pb)                                 TWOWORDINLINE(0x7007, 0xA0DD);
  406.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  407.                                                                                             #pragma parameter __D0 PPCReadAsync(__A0)
  408.                                                                                             #endif
  409. EXTERN_API( OSErr )
  410. PPCReadAsync                    (PPCReadPBPtr           pb)                                 TWOWORDINLINE(0x7007, 0xA4DD);
  411.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  412.                                                                                             #pragma parameter __D0 PPCEndSync(__A0)
  413.                                                                                             #endif
  414. EXTERN_API( OSErr )
  415. PPCEndSync                      (PPCEndPBPtr            pb)                                 TWOWORDINLINE(0x7008, 0xA0DD);
  416.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  417.                                                                                             #pragma parameter __D0 PPCEndAsync(__A0)
  418.                                                                                             #endif
  419. EXTERN_API( OSErr )
  420. PPCEndAsync                     (PPCEndPBPtr            pb)                                 TWOWORDINLINE(0x7008, 0xA4DD);
  421.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  422.                                                                                             #pragma parameter __D0 PPCCloseSync(__A0)
  423.                                                                                             #endif
  424. EXTERN_API( OSErr )
  425. PPCCloseSync                    (PPCClosePBPtr          pb)                                 TWOWORDINLINE(0x7009, 0xA0DD);
  426.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  427.                                                                                             #pragma parameter __D0 PPCCloseAsync(__A0)
  428.                                                                                             #endif
  429. EXTERN_API( OSErr )
  430. PPCCloseAsync                   (PPCClosePBPtr          pb)                                 TWOWORDINLINE(0x7009, 0xA4DD);
  431.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  432.                                                                                             #pragma parameter __D0 IPCListPortsSync(__A0)
  433.                                                                                             #endif
  434. EXTERN_API( OSErr )
  435. IPCListPortsSync                (IPCListPortsPBPtr      pb)                                 TWOWORDINLINE(0x700A, 0xA0DD);
  436.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  437.                                                                                             #pragma parameter __D0 IPCListPortsAsync(__A0)
  438.                                                                                             #endif
  439. EXTERN_API( OSErr )
  440. IPCListPortsAsync               (IPCListPortsPBPtr      pb)                                 TWOWORDINLINE(0x700A, 0xA4DD);
  441.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  442.                                                                                             #pragma parameter __D0 IPCKillListPorts(__A0)
  443.                                                                                             #endif
  444. EXTERN_API( OSErr )
  445. IPCKillListPorts                (IPCListPortsPBPtr      pb)                                 TWOWORDINLINE(0x700B, 0xA0DD);
  446. EXTERN_API( OSErr )
  447. DeleteUserIdentity              (unsigned long          userRef);
  448. EXTERN_API( OSErr )
  449. GetDefaultUser                  (unsigned long *        userRef,
  450.                                  Str32                  userName);
  451. EXTERN_API( OSErr )
  452. StartSecureSession              (PPCStartPBPtr          pb,
  453.                                  Str32                  userName,
  454.                                  Boolean                useDefault,
  455.                                  Boolean                allowGuest,
  456.                                  Boolean *              guestSelected,
  457.                                  ConstStr255Param       prompt);
  458. #endif  /* CALL_NOT_IN_CARBON */
  459. typedef CALLBACK_API( Boolean , PPCFilterProcPtr )(LocationNamePtr name, PortInfoPtr port);
  460. typedef STACK_UPP_TYPE(PPCFilterProcPtr)                        PPCFilterUPP;
  461. #if OPAQUE_UPP_TYPES
  462. #if CALL_NOT_IN_CARBON
  463.     EXTERN_API(PPCCompUPP)
  464.     NewPPCCompUPP                  (PPCCompProcPtr          userRoutine);
  465.     EXTERN_API(PPCFilterUPP)
  466.     NewPPCFilterUPP                (PPCFilterProcPtr        userRoutine);
  467.     EXTERN_API(void)
  468.     DisposePPCCompUPP              (PPCCompUPP              userUPP);
  469.     EXTERN_API(void)
  470.     DisposePPCFilterUPP            (PPCFilterUPP            userUPP);
  471.     EXTERN_API(void)
  472.     InvokePPCCompUPP               (PPCParamBlockPtr        pb,
  473.                                     PPCCompUPP              userUPP);
  474.     EXTERN_API(Boolean)
  475.     InvokePPCFilterUPP             (LocationNamePtr         name,
  476.                                     PortInfoPtr             port,
  477.                                     PPCFilterUPP            userUPP);
  478. #endif  /* CALL_NOT_IN_CARBON */
  479. #else
  480.     enum { uppPPCCompProcInfo = 0x000000C0 };                       /* pascal no_return_value Func(4_bytes) */
  481.     enum { uppPPCFilterProcInfo = 0x000003D0 };                     /* pascal 1_byte Func(4_bytes, 4_bytes) */
  482.     #define NewPPCCompUPP(userRoutine)                              (PPCCompUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppPPCCompProcInfo, GetCurrentArchitecture())
  483.     #define NewPPCFilterUPP(userRoutine)                            (PPCFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppPPCFilterProcInfo, GetCurrentArchitecture())
  484.     #define DisposePPCCompUPP(userUPP)                              DisposeRoutineDescriptor(userUPP)
  485.     #define DisposePPCFilterUPP(userUPP)                            DisposeRoutineDescriptor(userUPP)
  486.     #define InvokePPCCompUPP(pb, userUPP)                           CALL_ONE_PARAMETER_UPP((userUPP), uppPPCCompProcInfo, (pb))
  487.     #define InvokePPCFilterUPP(name, port, userUPP)                 (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppPPCFilterProcInfo, (name), (port))
  488. #endif
  489. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  490. #define NewPPCCompProc(userRoutine)                             NewPPCCompUPP(userRoutine)
  491. #define NewPPCFilterProc(userRoutine)                           NewPPCFilterUPP(userRoutine)
  492. #define CallPPCCompProc(userRoutine, pb)                        InvokePPCCompUPP(pb, userRoutine)
  493. #define CallPPCFilterProc(userRoutine, name, port)              InvokePPCFilterUPP(name, port, userRoutine)
  494. #if CALL_NOT_IN_CARBON
  495. EXTERN_API( OSErr )
  496. PPCBrowser                      (ConstStr255Param       prompt,
  497.                                  ConstStr255Param       applListLabel,
  498.                                  Boolean                defaultSpecified,
  499.                                  LocationNameRec *      theLocation,
  500.                                  PortInfoRec *          thePortInfo,
  501.                                  PPCFilterUPP           portFilter,
  502.                                  ConstStr32Param        theLocNBPType)                      THREEWORDINLINE(0x303C, 0x0D00, 0xA82B);
  503. /*
  504.   The ParamBlock calls without the "Sync" or "Async" suffix are being phased out.
  505. */
  506. #endif  /* CALL_NOT_IN_CARBON */
  507. #define PPCOpen(pb, async)      ((async) ? PPCOpenAsync(pb)      : PPCOpenSync(pb))
  508. #define PPCInform(pb, async)    ((async) ? PPCInformAsync(pb)    : PPCInformSync(pb))
  509. #define PPCStart(pb, async)     ((async) ? PPCStartAsync(pb)     : PPCStartSync(pb))
  510. #define PPCAccept(pb, async)    ((async) ? PPCAcceptAsync(pb)    : PPCAcceptSync(pb))
  511. #define PPCReject(pb, async)    ((async) ? PPCRejectAsync(pb)    : PPCRejectSync(pb))
  512. #define PPCWrite(pb, async)     ((async) ? PPCWriteAsync(pb)     : PPCWriteSync(pb))
  513. #define PPCRead(pb, async)      ((async) ? PPCReadAsync(pb)      : PPCReadSync(pb))
  514. #define PPCEnd(pb, async)       ((async) ? PPCEndAsync(pb)       : PPCEndSync(pb))
  515. #define PPCClose(pb, async)     ((async) ? PPCCloseAsync(pb)     : PPCCloseSync(pb))
  516. #define IPCListPorts(pb, async) ((async) ? IPCListPortsAsync(pb) : IPCListPortsSync(pb))
  517. #if PRAGMA_STRUCT_ALIGN
  518.     #pragma options align=reset
  519. #elif PRAGMA_STRUCT_PACKPUSH
  520.     #pragma pack(pop)
  521. #elif PRAGMA_STRUCT_PACK
  522.     #pragma pack()
  523. #endif
  524. #ifdef PRAGMA_IMPORT_OFF
  525. #pragma import off
  526. #elif PRAGMA_IMPORT
  527. #pragma import reset
  528. #endif
  529. #ifdef __cplusplus
  530. }
  531. #endif
  532. #endif /* __PPCTOOLBOX__ */