home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / MW MPW Binaries 1.1.1a2 / mwcPPC / MWCIncludes / EPPC.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-31  |  4.6 KB  |  161 lines  |  [TEXT/MMCC]

  1. /*
  2.     File:        EPPC.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __EPPC__
  13. #define __EPPC__
  14.  
  15. #ifndef __PPCTOOLBOX__
  16. #include <PPCToolBox.h>
  17. /*    #include <AppleTalk.h>                                        */
  18. /*        #include <Types.h>                                        */
  19. /*            #include <ConditionalMacros.h>                        */
  20. /*            #include <MixedMode.h>                                */
  21. /*                #include <Traps.h>                                */
  22. /*        #include <OSUtils.h>                                    */
  23. /*    #include <Memory.h>                                            */
  24. #endif
  25.  
  26. #ifndef __PROCESSES__
  27. #include <Processes.h>
  28. /*    #include <Events.h>                                            */
  29. /*        #include <Quickdraw.h>                                    */
  30. /*            #include <QuickdrawText.h>                            */
  31. /*                #include <IntlResources.h>                        */
  32. /*    #include <Files.h>                                            */
  33. /*        #include <SegLoad.h>                                    */
  34. #endif
  35.  
  36. #ifndef __EVENTS__
  37. #endif
  38.  
  39. #define HighLevelEventMsgClass 'jaym'
  40.  
  41. #define rtrnReceiptMsgID 'rtrn'
  42.  
  43. enum  {
  44.     kHighLevelEvent                = 23,
  45. /* postOptions currently supported */
  46.     receiverIDMask                = 0x0000F000,
  47.     receiverIDisPSN                = 0x00008000,
  48.     receiverIDisSignature        = 0x00007000,
  49.     receiverIDisSessionID        = 0x00006000,
  50.     receiverIDisTargetID        = 0x00005000,
  51.     systemOptionsMask            = 0x00000F00,
  52.     nReturnReceipt                = 0x00000200,
  53.     priorityMask                = 0x000000FF,
  54.     nAttnMsg                    = 0x00000001,
  55. /* error returns from Post and Accept */
  56.     bufferIsSmall                = -607,
  57.     noOutstandingHLE            = -608,
  58.     connectionInvalid            = -609,
  59.     noUserInteractionAllowed    = -610,                            /* no user interaction allowed */
  60. /* constant for return receipts */
  61.     msgWasPartiallyAccepted        = 2,
  62.     msgWasFullyAccepted            = 1,
  63.     msgWasNotAccepted            = 0
  64. };
  65.  
  66. #if defined(powerc) || defined (__powerc)
  67. #pragma options align=mac68k
  68. #endif
  69. struct TargetID {
  70.     long                        sessionID;
  71.     PPCPortRec                    name;
  72.     LocationNameRec                location;
  73.     PPCPortRec                    recvrName;
  74. };
  75. #if defined(powerc) || defined(__powerc)
  76. #pragma options align=reset
  77. #endif
  78.  
  79. typedef struct TargetID TargetID;
  80.  
  81. typedef TargetID *TargetIDPtr, **TargetIDHdl;
  82.  
  83. typedef TargetID SenderID;
  84.  
  85. typedef SenderID *SenderIDPtr;
  86.  
  87. #if defined(powerc) || defined (__powerc)
  88. #pragma options align=mac68k
  89. #endif
  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. #if defined(powerc) || defined(__powerc)
  100. #pragma options align=reset
  101. #endif
  102.  
  103. typedef struct HighLevelEventMsg HighLevelEventMsg;
  104.  
  105. typedef HighLevelEventMsg *HighLevelEventMsgPtr, **HighLevelEventMsgHdl;
  106.  
  107. #ifdef __cplusplus
  108. extern "C" {
  109. #endif
  110.  
  111. extern pascal OSErr PostHighLevelEvent(const EventRecord *theEvent, unsigned long receiverID, unsigned long msgRefcon, Ptr msgBuff, unsigned long msgLen, unsigned long postingOptions)
  112.  THREEWORDINLINE(0x3F3C, 0x0034, 0xA88F);
  113. extern pascal OSErr AcceptHighLevelEvent(TargetID *sender, unsigned long *msgRefcon, Ptr msgBuff, unsigned long *msgLen)
  114.  THREEWORDINLINE(0x3F3C, 0x0033, 0xA88F);
  115. extern pascal OSErr GetProcessSerialNumberFromPortName(const PPCPortPtr portName, ProcessSerialNumberPtr pPSN)
  116.  THREEWORDINLINE(0x3F3C, 0x0035, 0xA88F);
  117. extern pascal OSErr GetPortNameFromProcessSerialNumber(PPCPortPtr portName, const ProcessSerialNumberPtr pPSN)
  118.  THREEWORDINLINE(0x3F3C, 0x0046, 0xA88F);
  119. #ifdef __cplusplus
  120. }
  121. #endif
  122.  
  123. typedef pascal Boolean (*GetSpecificFilterProcPtr)(void *yourDataPtr, HighLevelEventMsgPtr msgBuff, const TargetID *sender);
  124.  
  125. enum {
  126.     uppGetSpecificFilterProcInfo = kPascalStackBased
  127.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  128.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void*)))
  129.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(HighLevelEventMsgPtr)))
  130.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(TargetID*)))
  131. };
  132.  
  133. #if USESROUTINEDESCRIPTORS
  134. typedef UniversalProcPtr GetSpecificFilterUPP;
  135.  
  136. #define CallGetSpecificFilterProc(userRoutine, yourDataPtr, msgBuff, sender)        \
  137.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, (yourDataPtr), (msgBuff), (sender))
  138. #define NewGetSpecificFilterProc(userRoutine)        \
  139.         (GetSpecificFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, GetCurrentISA())
  140. #else
  141. typedef GetSpecificFilterProcPtr GetSpecificFilterUPP;
  142.  
  143. #define CallGetSpecificFilterProc(userRoutine, yourDataPtr, msgBuff, sender)        \
  144.         (*(userRoutine))((yourDataPtr), (msgBuff), (sender))
  145. #define NewGetSpecificFilterProc(userRoutine)        \
  146.         (GetSpecificFilterUPP)(userRoutine)
  147. #endif
  148.  
  149. #ifdef __cplusplus
  150. extern "C" {
  151. #endif
  152.  
  153. extern pascal Boolean GetSpecificHighLevelEvent(GetSpecificFilterUPP aFilter, void *yourDataPtr, OSErr *err)
  154.  THREEWORDINLINE(0x3F3C, 0x0045, 0xA88F);
  155. #ifdef __cplusplus
  156. }
  157. #endif
  158.  
  159. #endif
  160.  
  161.