home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / EPPC.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  4.5 KB  |  159 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        EPPC.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __EPPC__
  18. #define __EPPC__
  19.  
  20.  
  21. #ifndef __ERRORS__
  22. #include <Errors.h>
  23. #endif
  24. /*    #include <ConditionalMacros.h>                                */
  25.  
  26. #ifndef __PPCTOOLBOX__
  27. #include <PPCToolbox.h>
  28. #endif
  29. /*    #include <AppleTalk.h>                                        */
  30. /*        #include <Types.h>                                        */
  31. /*        #include <OSUtils.h>                                    */
  32. /*            #include <MixedMode.h>                                */
  33. /*            #include <Memory.h>                                    */
  34.  
  35. #ifndef __PROCESSES__
  36. #include <Processes.h>
  37. #endif
  38. /*    #include <Events.h>                                            */
  39. /*        #include <Quickdraw.h>                                    */
  40. /*            #include <QuickdrawText.h>                            */
  41. /*    #include <Files.h>                                            */
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if GENERATINGPOWERPC
  48. #pragma options align=mac68k
  49. #endif
  50.  
  51. #ifdef __CFM68K__
  52. #pragma lib_export on
  53. #endif
  54.  
  55.  
  56. enum {
  57.     kHighLevelEvent                = 23,
  58. /* postOptions currently supported */
  59.     receiverIDMask                = 0x0000F000,
  60.     receiverIDisPSN                = 0x00008000,
  61.     receiverIDisSignature        = 0x00007000,
  62.     receiverIDisSessionID        = 0x00006000,
  63.     receiverIDisTargetID        = 0x00005000,
  64.     systemOptionsMask            = 0x00000F00,
  65.     nReturnReceipt                = 0x00000200,
  66.     priorityMask                = 0x000000FF,
  67.     nAttnMsg                    = 0x00000001,
  68. /* constant for return receipts */
  69.     HighLevelEventMsgClass        = 'jaym',
  70.     rtrnReceiptMsgID            = 'rtrn',
  71.     msgWasPartiallyAccepted        = 2,
  72.     msgWasFullyAccepted            = 1,
  73.     msgWasNotAccepted            = 0
  74. };
  75.  
  76. struct TargetID {
  77.     long                            sessionID;
  78.     PPCPortRec                        name;
  79.     LocationNameRec                    location;
  80.     PPCPortRec                        recvrName;
  81. };
  82. typedef struct TargetID TargetID;
  83.  
  84. typedef TargetID *TargetIDPtr, **TargetIDHandle, **TargetIDHdl;
  85.  
  86. typedef TargetID SenderID;
  87.  
  88. typedef SenderID *SenderIDPtr;
  89.  
  90. struct HighLevelEventMsg {
  91.     unsigned short                    HighLevelEventMsgHeaderLength;
  92.     unsigned short                    version;
  93.     unsigned long                    reserved1;
  94.     EventRecord                        theMsgEvent;
  95.     unsigned long                    userRefcon;
  96.     unsigned long                    postingOptions;
  97.     unsigned long                    msgLength;
  98. };
  99. typedef struct HighLevelEventMsg HighLevelEventMsg;
  100.  
  101. typedef HighLevelEventMsg *HighLevelEventMsgPtr, **HighLevelEventMsgHandle, **HighLevelEventMsgHdl;
  102.  
  103. typedef pascal Boolean (*GetSpecificFilterProcPtr)(void *yourDataPtr, HighLevelEventMsgPtr msgBuff, const TargetID *sender);
  104.  
  105. #if GENERATINGCFM
  106. typedef UniversalProcPtr GetSpecificFilterUPP;
  107. #else
  108. typedef GetSpecificFilterProcPtr GetSpecificFilterUPP;
  109. #endif
  110.  
  111. enum {
  112.     uppGetSpecificFilterProcInfo = kPascalStackBased
  113.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  114.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void*)))
  115.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(HighLevelEventMsgPtr)))
  116.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(TargetID*)))
  117. };
  118.  
  119. #if GENERATINGCFM
  120. #define NewGetSpecificFilterProc(userRoutine)        \
  121.         (GetSpecificFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, GetCurrentArchitecture())
  122. #else
  123. #define NewGetSpecificFilterProc(userRoutine)        \
  124.         ((GetSpecificFilterUPP) (userRoutine))
  125. #endif
  126.  
  127. #if GENERATINGCFM
  128. #define CallGetSpecificFilterProc(userRoutine, yourDataPtr, msgBuff, sender)        \
  129.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, (yourDataPtr), (msgBuff), (sender))
  130. #else
  131. #define CallGetSpecificFilterProc(userRoutine, yourDataPtr, msgBuff, sender)        \
  132.         (*(userRoutine))((yourDataPtr), (msgBuff), (sender))
  133. #endif
  134.  
  135. extern pascal OSErr PostHighLevelEvent(const EventRecord *theEvent, unsigned long receiverID, unsigned long msgRefcon, Ptr msgBuff, unsigned long msgLen, unsigned long postingOptions)
  136.  THREEWORDINLINE(0x3F3C, 0x0034, 0xA88F);
  137. extern pascal OSErr AcceptHighLevelEvent(TargetID *sender, unsigned long *msgRefcon, Ptr msgBuff, unsigned long *msgLen)
  138.  THREEWORDINLINE(0x3F3C, 0x0033, 0xA88F);
  139. extern pascal OSErr GetProcessSerialNumberFromPortName(const PPCPortRec *portName, ProcessSerialNumber *pPSN)
  140.  THREEWORDINLINE(0x3F3C, 0x0035, 0xA88F);
  141. extern pascal OSErr GetPortNameFromProcessSerialNumber(PPCPortRec *portName, const ProcessSerialNumber *pPSN)
  142.  THREEWORDINLINE(0x3F3C, 0x0046, 0xA88F);
  143. extern pascal Boolean GetSpecificHighLevelEvent(GetSpecificFilterUPP aFilter, void *yourDataPtr, OSErr *err)
  144.  THREEWORDINLINE(0x3F3C, 0x0045, 0xA88F);
  145.  
  146. #ifdef __CFM68K__
  147. #pragma lib_export off
  148. #endif
  149.  
  150. #if GENERATINGPOWERPC
  151. #pragma options align=reset
  152. #endif
  153.  
  154. #ifdef __cplusplus
  155. }
  156. #endif
  157.  
  158. #endif /* __EPPC__ */
  159.