Mac OS 9
EPPC.h
Go to the documentation of this file.
1 
19 #ifndef __EPPC__
20 #define __EPPC__
21 
22 #ifndef __MACERRORS__
23 #include <MacErrors.h>
24 #endif
25 
26 #ifndef __APPLETALK__
27 #include <AppleTalk.h>
28 #endif
29 
30 #ifndef __FILES__
31 #include <Files.h>
32 #endif
33 
34 #ifndef __PPCTOOLBOX__
35 #include <PPCToolbox.h>
36 #endif
37 
38 #ifndef __PROCESSES__
39 #include <Processes.h>
40 #endif
41 
42 #ifndef __EVENTS__
43 #include <Events.h>
44 #endif
45 
46 #if PRAGMA_ONCE
47 #pragma once
48 #endif
49 
50 #ifdef __cplusplus
51 extern "C"
52 {
53 #endif
54 
55 #if PRAGMA_IMPORT
56 #pragma import on
57 #endif
58 
59 #if PRAGMA_STRUCT_ALIGN
60 #pragma options align = mac68k
61 #elif PRAGMA_STRUCT_PACKPUSH
62 #pragma pack(push, 2)
63 #elif PRAGMA_STRUCT_PACK
64 #pragma pack(2)
65 #endif
66 
67  enum
68  {
69  /* postOptions currently supported */
70  receiverIDMask = 0x0000F000,
71  receiverIDisPSN = 0x00008000,
72  receiverIDisSignature = 0x00007000,
73  receiverIDisSessionID = 0x00006000,
74  receiverIDisTargetID = 0x00005000,
75  systemOptionsMask = 0x00000F00,
76  nReturnReceipt = 0x00000200,
77  priorityMask = 0x000000FF,
78  nAttnMsg = 0x00000001
79  };
80 
81  enum
82  {
83  /* constant for return receipts */
84  HighLevelEventMsgClass = FOUR_CHAR_CODE('jaym'),
85  rtrnReceiptMsgID = FOUR_CHAR_CODE('rtrn')
86  };
87 
88  enum
89  {
90  msgWasPartiallyAccepted = 2,
91  msgWasFullyAccepted = 1,
92  msgWasNotAccepted = 0
93  };
94 
95  struct TargetID
96  {
97  long sessionID;
98  PPCPortRec name;
99  LocationNameRec location;
100  PPCPortRec recvrName;
101  };
102  typedef struct TargetID TargetID;
103  typedef TargetID *TargetIDPtr;
104  typedef TargetIDPtr *TargetIDHandle;
105  typedef TargetIDHandle TargetIDHdl;
106  typedef TargetID SenderID;
107  typedef SenderID *SenderIDPtr;
109  {
110  unsigned short HighLevelEventMsgHeaderLength;
111  unsigned short version;
112  unsigned long reserved1;
113  EventRecord theMsgEvent;
114  unsigned long userRefcon;
115  unsigned long postingOptions;
116  unsigned long msgLength;
117  };
118  typedef struct HighLevelEventMsg HighLevelEventMsg;
122  typedef CALLBACK_API(Boolean,
123  GetSpecificFilterProcPtr)(void *contextPtr,
125  const TargetID *sender);
126  typedef STACK_UPP_TYPE(GetSpecificFilterProcPtr) GetSpecificFilterUPP;
127 #if CALL_NOT_IN_CARBON
136  GetSpecificFilterUPP
137  NewGetSpecificFilterUPP(GetSpecificFilterProcPtr userRoutine);
138 #if !OPAQUE_UPP_TYPES
139  enum
140  {
141  uppGetSpecificFilterProcInfo = 0x00000FD0
142  }; /* pascal 1_byte Func(4_bytes, 4_bytes, 4_bytes) */
143 #ifdef __cplusplus
144  inline GetSpecificFilterUPP
145  NewGetSpecificFilterUPP(GetSpecificFilterProcPtr userRoutine)
146  {
147  return (GetSpecificFilterUPP)NewRoutineDescriptor(
148  (ProcPtr)(userRoutine), uppGetSpecificFilterProcInfo,
149  GetCurrentArchitecture());
150  }
151 #else
152 #define NewGetSpecificFilterUPP(userRoutine) \
153  (GetSpecificFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), \
154  uppGetSpecificFilterProcInfo, \
155  GetCurrentArchitecture())
156 #endif
157 #endif
158 
167  void
168  DisposeGetSpecificFilterUPP(GetSpecificFilterUPP userUPP);
169 #if !OPAQUE_UPP_TYPES
170 #ifdef __cplusplus
171  inline void DisposeGetSpecificFilterUPP(GetSpecificFilterUPP userUPP)
172  {
173  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
174  }
175 #else
176 #define DisposeGetSpecificFilterUPP(userUPP) DisposeRoutineDescriptor(userUPP)
177 #endif
178 #endif
179 
188  Boolean
190  const TargetID *sender,
191  GetSpecificFilterUPP userUPP);
192 #if !OPAQUE_UPP_TYPES
193 #ifdef __cplusplus
194  inline Boolean InvokeGetSpecificFilterUPP(void *contextPtr,
196  const TargetID *sender,
197  GetSpecificFilterUPP userUPP)
198  {
199  return (Boolean)CALL_THREE_PARAMETER_UPP(
200  userUPP, uppGetSpecificFilterProcInfo, contextPtr, msgBuff, sender);
201  }
202 #else
203 #define InvokeGetSpecificFilterUPP(contextPtr, msgBuff, sender, userUPP) \
204  (Boolean) CALL_THREE_PARAMETER_UPP((userUPP), uppGetSpecificFilterProcInfo, \
205  (contextPtr), (msgBuff), (sender))
206 #endif
207 #endif
208 
209 #endif /* CALL_NOT_IN_CARBON */
210 
211 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
212 /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
213 #define NewGetSpecificFilterProc(userRoutine) \
214  NewGetSpecificFilterUPP(userRoutine)
215 #define CallGetSpecificFilterProc(userRoutine, contextPtr, msgBuff, sender) \
216  InvokeGetSpecificFilterUPP(contextPtr, msgBuff, sender, userRoutine)
217 #endif /* CALL_NOT_IN_CARBON */
218 
219 #if CALL_NOT_IN_CARBON
220 #if CALL_NOT_IN_CARBON
229  OSErr
230  PostHighLevelEvent(const EventRecord *theEvent, void *receiverID,
231  unsigned long msgRefcon, void *msgBuff, unsigned long msgLen,
232  unsigned long postingOptions);
233 
234 #endif /* CALL_NOT_IN_CARBON */
235 
236 #endif /* CALL_NOT_IN_CARBON */
237 
238 #if CALL_NOT_IN_CARBON
239 #if CALL_NOT_IN_CARBON
248  OSErr
249  AcceptHighLevelEvent(TargetID *sender, unsigned long *msgRefcon, void *msgBuff,
250  unsigned long *msgLen);
251 
252 #endif /* CALL_NOT_IN_CARBON */
253 
254 #endif /* CALL_NOT_IN_CARBON */
255 
256 #if CALL_NOT_IN_CARBON
257 #if CALL_NOT_IN_CARBON
258 
267  OSErr
269  ProcessSerialNumber *pPSN);
270 
271 #endif /* CALL_NOT_IN_CARBON */
272 
273 #endif /* CALL_NOT_IN_CARBON */
274 
275 #if CALL_NOT_IN_CARBON
276 #if CALL_NOT_IN_CARBON
277 
286  OSErr
288  const ProcessSerialNumber *pPSN);
289 
290 #endif /* CALL_NOT_IN_CARBON */
291 
292 #endif /* CALL_NOT_IN_CARBON */
293 
294 #if CALL_NOT_IN_CARBON
295 #if CALL_NOT_IN_CARBON
304  Boolean
305  GetSpecificHighLevelEvent(GetSpecificFilterUPP aFilter, void *contextPtr,
306  OSErr *err);
307 
308 #endif /* CALL_NOT_IN_CARBON */
309 
310 #endif /* CALL_NOT_IN_CARBON */
311 
312 #if PRAGMA_STRUCT_ALIGN
313 #pragma options align = reset
314 #elif PRAGMA_STRUCT_PACKPUSH
315 #pragma pack(pop)
316 #elif PRAGMA_STRUCT_PACK
317 #pragma pack()
318 #endif
319 
320 #ifdef PRAGMA_IMPORT_OFF
321 #pragma import off
322 #elif PRAGMA_IMPORT
323 #pragma import reset
324 #endif
325 
326 #ifdef __cplusplus
327 }
328 #endif
329 
330 #endif /* __EPPC__ */
331 * / align = reset
332 #elif PRAGMA_STRUCT_PACKPUSH
333 #pragma pack(pop)
334 #elif PRAGMA_STRUCT_PACK
335 #pragma pack()
336 #endif
337 
338 #ifdef PRAGMA_IMPORT_OFF
339 #pragma import off
340 #elif PRAGMA_IMPORT
341 #pragma import reset
342 #endif
343 
344 #ifdef __cplusplus
345 }
346 #endif
347 
348 #endif /* __EPPC__ */
349 * /
AppleTalk Interfaces.
Boolean GetSpecificHighLevelEvent(GetSpecificFilterUPP aFilter, void *contextPtr, OSErr *err)
OSErr AcceptHighLevelEvent(TargetID *sender, unsigned long *msgRefcon, void *msgBuff, unsigned long *msgLen)
OSErr GetProcessSerialNumberFromPortName(const PPCPortRec *portName, ProcessSerialNumber *pPSN)
GetProcessSerialNumberFromPortName Get the serial number of a process.
GetSpecificFilterUPP NewGetSpecificFilterUPP(GetSpecificFilterProcPtr userRoutine)
OSErr PostHighLevelEvent(const EventRecord *theEvent, void *receiverID, unsigned long msgRefcon, void *msgBuff, unsigned long msgLen, unsigned long postingOptions)
Boolean InvokeGetSpecificFilterUPP(void *contextPtr, HighLevelEventMsgPtr msgBuff, const TargetID *sender, GetSpecificFilterUPP userUPP)
void DisposeGetSpecificFilterUPP(GetSpecificFilterUPP userUPP)
OSErr GetPortNameFromProcessSerialNumber(PPCPortRec *portName, const ProcessSerialNumber *pPSN)
GetPortNameFromProcessSerialNumber Get the port name of a process.
Event Manager Interfaces.
File Manager (MFS, HFS, and HFS+) Interfaces.
OSErr codes.
unsigned char Boolean
Definition: MacTypes.h:318
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
Program-Program Communications Toolbox Interfaces.
Process Manager Interfaces.
Definition: Events.h:224
Definition: EPPC.h:109
Definition: PPCToolbox.h:138
Definition: PPCToolbox.h:151
Definition: Processes.h:65
Definition: EPPC.h:96