Mac OS 9
ENET.h
Go to the documentation of this file.
1 
19 #ifndef __ENET__
20 #define __ENET__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #ifndef __OSUTILS__
27 #include <OSUtils.h>
28 #endif
29 
30 #if PRAGMA_ONCE
31 #pragma once
32 #endif
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 #if PRAGMA_IMPORT
40 #pragma import on
41 #endif
42 
43 #if PRAGMA_STRUCT_ALIGN
44 #pragma options align = mac68k
45 #elif PRAGMA_STRUCT_PACKPUSH
46 #pragma pack(push, 2)
47 #elif PRAGMA_STRUCT_PACK
48 #pragma pack(2)
49 #endif
50 
51  enum
52  {
53  ENetSetGeneral = 253, /*Set "general" mode*/
54  ENetGetInfo = 252, /*Get info*/
55  ENetRdCancel = 251, /*Cancel read*/
56  ENetRead = 250, /*Read*/
57  ENetWrite = 249, /*Write*/
58  ENetDetachPH = 248, /*Detach protocol handler*/
59  ENetAttachPH = 247, /*Attach protocol handler*/
60  ENetAddMulti = 246, /*Add a multicast address*/
61  ENetDelMulti = 245 /*Delete a multicast address*/
62  };
63 
64  enum
65  {
66  EAddrRType = FOUR_CHAR_CODE('eadr') /*Alternate address resource type*/
67  };
68 
69  typedef struct EParamBlock EParamBlock;
70  typedef EParamBlock *EParamBlkPtr;
71  typedef CALLBACK_API_REGISTER68K(void, ENETCompletionProcPtr,
72  (EParamBlkPtr thePBPtr));
73  typedef REGISTER_UPP_TYPE(ENETCompletionProcPtr) ENETCompletionUPP;
74  struct EParamBlock
75  {
76  QElem *qLink; /*General EParams*/
77  short qType; /*queue type*/
78  short ioTrap; /*routine trap*/
79  Ptr ioCmdAddr; /*routine address*/
80  ENETCompletionUPP ioCompletion; /*completion routine*/
81  OSErr ioResult; /*result code*/
82  StringPtr ioNamePtr; /*->filename*/
83  short ioVRefNum; /*volume reference or drive number*/
84  short ioRefNum; /*driver reference number*/
85  short csCode; /*Call command code*/
86  union
87  {
88  struct
89  {
90  short eProtType; /*Ethernet protocol type*/
91  Ptr ePointer; /*No support for PowerPC code*/
92  short eBuffSize; /*buffer size*/
93  short eDataSize; /*number of bytes read*/
94  } EParms1;
95  struct
96  {
97  Byte eMultiAddr[6]; /*Multicast Address*/
98  } EParms2;
99  } u;
100  };
101 
102 #if CALL_NOT_IN_CARBON
111  ENETCompletionUPP
112  NewENETCompletionUPP(ENETCompletionProcPtr userRoutine);
113 #if !OPAQUE_UPP_TYPES
114  enum
115  {
116  uppENETCompletionProcInfo = 0x00009802
117  }; /* register no_return_value Func(4_bytes:A0) */
118 #ifdef __cplusplus
119  inline ENETCompletionUPP
120  NewENETCompletionUPP(ENETCompletionProcPtr userRoutine)
121  {
122  return (ENETCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
123  uppENETCompletionProcInfo,
124  GetCurrentArchitecture());
125  }
126 #else
127 #define NewENETCompletionUPP(userRoutine) \
128  (ENETCompletionUPP) \
129  NewRoutineDescriptor((ProcPtr)(userRoutine), uppENETCompletionProcInfo, \
130  GetCurrentArchitecture())
131 #endif
132 #endif
133 
142  void
143  DisposeENETCompletionUPP(ENETCompletionUPP userUPP);
144 #if !OPAQUE_UPP_TYPES
145 #ifdef __cplusplus
146  inline void DisposeENETCompletionUPP(ENETCompletionUPP userUPP)
147  {
148  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
149  }
150 #else
151 #define DisposeENETCompletionUPP(userUPP) DisposeRoutineDescriptor(userUPP)
152 #endif
153 #endif
154 
163 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
164 #pragma parameter InvokeENETCompletionUPP(__A0, __A1)
165 #endif
166  void
167  InvokeENETCompletionUPP(EParamBlkPtr thePBPtr, ENETCompletionUPP userUPP);
168 #if !OPAQUE_UPP_TYPES && \
169  (!TARGET_OS_MAC || !TARGET_CPU_68K || TARGET_RT_MAC_CFM)
170 #ifdef __cplusplus
171  inline void InvokeENETCompletionUPP(EParamBlkPtr thePBPtr,
172  ENETCompletionUPP userUPP)
173  {
174  CALL_ONE_PARAMETER_UPP(userUPP, uppENETCompletionProcInfo, thePBPtr);
175  }
176 #else
177 #define InvokeENETCompletionUPP(thePBPtr, userUPP) \
178  CALL_ONE_PARAMETER_UPP((userUPP), uppENETCompletionProcInfo, (thePBPtr))
179 #endif
180 #endif
181 
182 #endif /* CALL_NOT_IN_CARBON */
183 
184 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
185 /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
186 #define NewENETCompletionProc(userRoutine) NewENETCompletionUPP(userRoutine)
187 #define CallENETCompletionProc(userRoutine, thePBPtr) \
188  InvokeENETCompletionUPP(thePBPtr, userRoutine)
189 #endif /* CALL_NOT_IN_CARBON */
190 
191 #if CALL_NOT_IN_CARBON
192 
232  OSErr
233  EWrite(EParamBlkPtr thePBptr, Boolean async);
234 
284  OSErr
285  EAttachPH(EParamBlkPtr thePBptr, Boolean async);
286 
322  OSErr
323  EDetachPH(EParamBlkPtr thePBptr, Boolean async);
324 
374  OSErr
375  ERead(EParamBlkPtr thePBptr, Boolean async);
376 
412  OSErr
413  ERdCancel(EParamBlkPtr thePBptr, Boolean async);
414 
457  OSErr
458  EGetInfo(EParamBlkPtr thePBptr, Boolean async);
459 
500  OSErr
501  ESetGeneral(EParamBlkPtr thePBptr, Boolean async);
502 
543  OSErr
544  EAddMulti(EParamBlkPtr thePBptr, Boolean async);
545 
589  OSErr
590  EDelMulti(EParamBlkPtr thePBptr, Boolean async);
591 
592 #endif /* CALL_NOT_IN_CARBON */
593 
594 #if PRAGMA_STRUCT_ALIGN
595 #pragma options align = reset
596 #elif PRAGMA_STRUCT_PACKPUSH
597 #pragma pack(pop)
598 #elif PRAGMA_STRUCT_PACK
599 #pragma pack()
600 #endif
601 
602 #ifdef PRAGMA_IMPORT_OFF
603 #pragma import off
604 #elif PRAGMA_IMPORT
605 #pragma import reset
606 #endif
607 
608 #ifdef __cplusplus
609 }
610 #endif
611 
612 #endif /* __ENET__ */
613 * /*/*/ * /*/*/ * /*/*/
void DisposeENETCompletionUPP(ENETCompletionUPP userUPP)
OSErr EDelMulti(EParamBlkPtr thePBptr, Boolean async)
Decrement a multicast address counter.
OSErr ESetGeneral(EParamBlkPtr thePBptr, Boolean async)
Switch The .ENET Driver to general-transmission.
OSErr EWrite(EParamBlkPtr thePBptr, Boolean async)
Send a data packet over Ethernet.
OSErr EGetInfo(EParamBlkPtr thePBptr, Boolean async)
Return information about The .ENET Driver.
OSErr EAttachPH(EParamBlkPtr thePBptr, Boolean async)
Attach protocol handler to The .ENET Driver.
OSErr ERdCancel(EParamBlkPtr thePBptr, Boolean async)
Cancel execution of a specific call to the ERead function.
void InvokeENETCompletionUPP(EParamBlkPtr thePBPtr, ENETCompletionUPP userUPP)
OSErr EDetachPH(EParamBlkPtr thePBptr, Boolean async)
Detach a protocol handler from The .ENET Driver.
ENETCompletionUPP NewENETCompletionUPP(ENETCompletionProcPtr userRoutine)
OSErr EAddMulti(EParamBlkPtr thePBptr, Boolean async)
Add a multicast address to the node.
OSErr ERead(EParamBlkPtr thePBptr, Boolean async)
Read a data packet and place it in a data buffer.
Basic Macintosh data types.
unsigned char * StringPtr
Definition: MacTypes.h:477
unsigned char Boolean
Definition: MacTypes.h:318
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
OS Utilities Interfaces.
typedef CALLBACK_API_REGISTER68K(void, SIInterruptProcPtr,(SPBPtr inParamPtr, Ptr dataBuffer, short peakAmplitude, long sampleSize))
typedef REGISTER_UPP_TYPE(HighHookProcPtr) HighHookUPP
Definition: ENET.h:75
Definition: OSUtils.h:131