Mac OS 9
ADSP.h
Go to the documentation of this file.
1 
19 #ifndef __ADSP__
20 #define __ADSP__
21 
22 #ifndef __MACERRORS__
23 #include <MacErrors.h>
24 #endif
25 
26 #ifndef __APPLETALK__
27 #include <AppleTalk.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 
52  enum
53  {
54  dspInit = 255,
55  dspRemove = 254,
56  dspOpen = 253,
57  dspClose = 252,
58  dspCLInit = 251,
59  dspCLRemove = 250,
60  dspCLListen = 249,
61  dspCLDeny = 248,
62  dspStatus = 247,
63  dspRead = 246,
64  dspWrite = 245,
65  dspAttention = 244,
66  dspOptions = 243,
67  dspReset = 242,
68  dspNewCID = 241
69  };
70 
71  enum
72  {
74  ocRequest = 1,
75  ocPassive = 2,
76  ocAccept = 3,
77  ocEstablish = 4
78  };
79 
80  enum
81  {
83  sListening = 1,
84  sPassive = 2,
85  sOpening = 3,
86  sOpen = 4,
87  sClosing = 5,
88  sClosed = 6
89  };
90 
91  enum
92  {
94  eClosed = 0x80,
95  eTearDown = 0x40,
96  eAttention = 0x20,
97  eFwdReset = 0x10
98  };
99 
100  enum
101  {
103  attnBufSize = 570,
104  minDSPQueueSize = 100
105  };
106 
108  typedef struct TRCCB TRCCB;
109  typedef TRCCB *TPCCB;
110  struct TRCCB
111  {
112  TPCCB ccbLink;
113  UInt16 refNum;
114  UInt16 state;
115  UInt8 userFlags;
116  UInt8 localSocket;
118  UInt16 attnCode;
119  UInt16 attnSize;
120  void *attnPtr;
121  UInt8 reserved[220];
122  };
123 
124  typedef CALLBACK_API_REGISTER68K(void, ADSPConnectionEventProcPtr,
125  (TPCCB sourceCCB));
126  typedef struct DSPParamBlock DSPParamBlock;
127  typedef DSPParamBlock *DSPPBPtr;
128  typedef CALLBACK_API_REGISTER68K(void, ADSPCompletionProcPtr,
129  (DSPPBPtr thePBPtr));
130  typedef REGISTER_UPP_TYPE(ADSPConnectionEventProcPtr) ADSPConnectionEventUPP;
131  typedef REGISTER_UPP_TYPE(ADSPCompletionProcPtr) ADSPCompletionUPP;
133  {
134  TPCCB ccbPtr;
135  ADSPConnectionEventUPP userRoutine;
136  UInt16 sendQSize;
137  void *sendQueue;
138  UInt16 recvQSize;
139  void *recvQueue;
140  void *attnPtr;
141  UInt8 localSocket;
142  UInt8 filler1;
143  };
144  typedef struct TRinitParams TRinitParams;
146  {
147  UInt16 localCID;
148  UInt16 remoteCID;
151  UInt32 sendSeq;
152  UInt16 sendWindow;
153  UInt32 recvSeq;
154  UInt32 attnSendSeq;
155  UInt32 attnRecvSeq;
156  UInt8 ocMode;
157  UInt8 ocInterval;
158  UInt8 ocMaximum;
159  UInt8 filler2;
160  };
161  typedef struct TRopenParams TRopenParams;
163  {
164  UInt8 abort;
165  UInt8 filler3;
166  };
167  typedef struct TRcloseParams TRcloseParams;
168  struct TRioParams
169  {
170  UInt16 reqCount;
171  UInt16 actCount;
172  void *dataPtr;
173  UInt8 eom;
174  UInt8 flush;
175  };
176  typedef struct TRioParams TRioParams;
178  {
179  UInt16 attnCode;
180  UInt16 attnSize;
181  void *attnData;
182  UInt8 attnInterval;
183  UInt8 filler4;
184  };
185  typedef struct TRattnParams TRattnParams;
187  {
188  TPCCB statusCCB;
189  UInt16 sendQPending;
190  UInt16 sendQFree;
191  UInt16 recvQPending;
192  UInt16 recvQFree;
193  };
194  typedef struct TRstatusParams TRstatusParams;
196  {
197  UInt16 sendBlocking;
198  UInt8 sendTimer;
199  UInt8 rtmtTimer;
200  UInt8 badSeqMax;
201  UInt8 useCheckSum;
202  };
203  typedef struct TRoptionParams TRoptionParams;
205  {
206  UInt16 newcid;
207  };
208  typedef struct TRnewcidParams TRnewcidParams;
210  {
211  QElem *qLink;
212  short qType;
213  short ioTrap;
214  Ptr ioCmdAddr;
215  ADSPCompletionUPP ioCompletion;
216  OSErr ioResult;
217  StringPtr ioNamePtr;
218  short ioVRefNum;
219  short ioCRefNum;
220  short csCode;
221  long qStatus;
222  short ccbRefNum;
223  union
224  {
225  TRinitParams initParams;
226  TRopenParams openParams;
227  TRcloseParams closeParams;
233  } u;
234  };
235 
236 #if CALL_NOT_IN_CARBON
245  ADSPConnectionEventUPP
246  NewADSPConnectionEventUPP(ADSPConnectionEventProcPtr userRoutine);
247 #if !OPAQUE_UPP_TYPES
248  enum
249  {
250  uppADSPConnectionEventProcInfo = 0x0000B802
251  };
252 #ifdef __cplusplus
253  inline ADSPConnectionEventUPP
254  NewADSPConnectionEventUPP(ADSPConnectionEventProcPtr userRoutine)
255  {
256  return (ADSPConnectionEventUPP)NewRoutineDescriptor(
257  (ProcPtr)(userRoutine), uppADSPConnectionEventProcInfo,
258  GetCurrentArchitecture());
259  }
260 #else
261 #define NewADSPConnectionEventUPP(userRoutine) \
262  (ADSPConnectionEventUPP) NewRoutineDescriptor( \
263  (ProcPtr)(userRoutine), uppADSPConnectionEventProcInfo, \
264  GetCurrentArchitecture())
265 #endif
266 #endif
267 
276  ADSPCompletionUPP
277  NewADSPCompletionUPP(ADSPCompletionProcPtr userRoutine);
278 #if !OPAQUE_UPP_TYPES
279  enum
280  {
281  uppADSPCompletionProcInfo = 0x00009802
282  };
283 #ifdef __cplusplus
284  inline ADSPCompletionUPP
285  NewADSPCompletionUPP(ADSPCompletionProcPtr userRoutine)
286  {
287  return (ADSPCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
288  uppADSPCompletionProcInfo,
289  GetCurrentArchitecture());
290  }
291 #else
292 #define NewADSPCompletionUPP(userRoutine) \
293  (ADSPCompletionUPP) \
294  NewRoutineDescriptor((ProcPtr)(userRoutine), uppADSPCompletionProcInfo, \
295  GetCurrentArchitecture())
296 #endif
297 #endif
298 
306  void
307  DisposeADSPConnectionEventUPP(ADSPConnectionEventUPP userUPP);
308 #if !OPAQUE_UPP_TYPES
309 #ifdef __cplusplus
310  inline void DisposeADSPConnectionEventUPP(ADSPConnectionEventUPP userUPP)
311  {
312  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
313  }
314 #else
315 #define DisposeADSPConnectionEventUPP(userUPP) DisposeRoutineDescriptor(userUPP)
316 #endif
317 #endif
318 
327  void
328  DisposeADSPCompletionUPP(ADSPCompletionUPP userUPP);
329 #if !OPAQUE_UPP_TYPES
330 #ifdef __cplusplus
331  inline void DisposeADSPCompletionUPP(ADSPCompletionUPP userUPP)
332  {
333  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
334  }
335 #else
336 #define DisposeADSPCompletionUPP(userUPP) DisposeRoutineDescriptor(userUPP)
337 #endif
338 #endif
339 
348 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
349 #pragma parameter InvokeADSPConnectionEventUPP(__A1, __A0)
350 #endif
351  void
352  InvokeADSPConnectionEventUPP(TPCCB sourceCCB, ADSPConnectionEventUPP userUPP);
353 #if !OPAQUE_UPP_TYPES && \
354  (!TARGET_OS_MAC || !TARGET_CPU_68K || TARGET_RT_MAC_CFM)
355 #ifdef __cplusplus
356  inline void InvokeADSPConnectionEventUPP(TPCCB sourceCCB,
357  ADSPConnectionEventUPP userUPP)
358  {
359  CALL_ONE_PARAMETER_UPP(userUPP, uppADSPConnectionEventProcInfo, sourceCCB);
360  }
361 #else
362 #define InvokeADSPConnectionEventUPP(sourceCCB, userUPP) \
363  CALL_ONE_PARAMETER_UPP((userUPP), uppADSPConnectionEventProcInfo, (sourceCCB))
364 #endif
365 #endif
366 
375 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
376 #pragma parameter InvokeADSPCompletionUPP(__A0, __A1)
377 #endif
378  void
379  InvokeADSPCompletionUPP(DSPPBPtr thePBPtr, ADSPCompletionUPP userUPP);
380 #if !OPAQUE_UPP_TYPES && \
381  (!TARGET_OS_MAC || !TARGET_CPU_68K || TARGET_RT_MAC_CFM)
382 #ifdef __cplusplus
383  inline void InvokeADSPCompletionUPP(DSPPBPtr thePBPtr,
384  ADSPCompletionUPP userUPP)
385  {
386  CALL_ONE_PARAMETER_UPP(userUPP, uppADSPCompletionProcInfo, thePBPtr);
387  }
388 #else
389 #define InvokeADSPCompletionUPP(thePBPtr, userUPP) \
390  CALL_ONE_PARAMETER_UPP((userUPP), uppADSPCompletionProcInfo, (thePBPtr))
391 #endif
392 #endif
393 
394 #endif
396 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
398 #define NewADSPConnectionEventProc(userRoutine) \
399  NewADSPConnectionEventUPP(userRoutine)
400 #define NewADSPCompletionProc(userRoutine) NewADSPCompletionUPP(userRoutine)
401 #define CallADSPConnectionEventProc(userRoutine, sourceCCB) \
402  InvokeADSPConnectionEventUPP(sourceCCB, userRoutine)
403 #define CallADSPCompletionProc(userRoutine, thePBPtr) \
404  InvokeADSPCompletionUPP(thePBPtr, userRoutine)
405 #endif
407 #if PRAGMA_STRUCT_ALIGN
408 #pragma options align = reset
409 #elif PRAGMA_STRUCT_PACKPUSH
410 #pragma pack(pop)
411 #elif PRAGMA_STRUCT_PACK
412 #pragma pack()
413 #endif
414 
415 #ifdef PRAGMA_IMPORT_OFF
416 #pragma import off
417 #elif PRAGMA_IMPORT
418 #pragma import reset
419 #endif
420 
421 #ifdef __cplusplus
422 }
423 #endif
424 
425 #endif
@ dspWrite
Definition: ADSP.h:64
@ dspReset
Definition: ADSP.h:67
@ dspCLDeny
Definition: ADSP.h:61
@ dspClose
Definition: ADSP.h:57
@ dspRead
Definition: ADSP.h:63
@ dspOptions
Definition: ADSP.h:66
@ dspOpen
Definition: ADSP.h:56
@ dspNewCID
Definition: ADSP.h:68
@ dspRemove
Definition: ADSP.h:55
@ dspCLInit
Definition: ADSP.h:58
@ dspCLListen
Definition: ADSP.h:60
@ dspStatus
Definition: ADSP.h:62
@ dspAttention
Definition: ADSP.h:65
@ dspCLRemove
Definition: ADSP.h:59
void InvokeADSPConnectionEventUPP(TPCCB sourceCCB, ADSPConnectionEventUPP userUPP)
Definition: ADSP.h:356
void DisposeADSPConnectionEventUPP(ADSPConnectionEventUPP userUPP)
Definition: ADSP.h:310
void DisposeADSPCompletionUPP(ADSPCompletionUPP userUPP)
Definition: ADSP.h:331
@ sClosing
Definition: ADSP.h:87
@ sClosed
Definition: ADSP.h:88
@ sOpening
Definition: ADSP.h:85
@ sPassive
Definition: ADSP.h:84
@ sOpen
Definition: ADSP.h:86
@ sListening
Definition: ADSP.h:83
ADSPCompletionUPP NewADSPCompletionUPP(ADSPCompletionProcPtr userRoutine)
Definition: ADSP.h:285
void InvokeADSPCompletionUPP(DSPPBPtr thePBPtr, ADSPCompletionUPP userUPP)
Definition: ADSP.h:383
@ eClosed
Definition: ADSP.h:94
@ eTearDown
Definition: ADSP.h:95
@ eAttention
Definition: ADSP.h:96
@ eFwdReset
Definition: ADSP.h:97
@ minDSPQueueSize
Definition: ADSP.h:104
@ attnBufSize
Definition: ADSP.h:103
@ ocRequest
Definition: ADSP.h:74
@ ocAccept
Definition: ADSP.h:76
@ ocPassive
Definition: ADSP.h:75
@ ocEstablish
Definition: ADSP.h:77
ADSPConnectionEventUPP NewADSPConnectionEventUPP(ADSPConnectionEventProcPtr userRoutine)
Definition: ADSP.h:254
AppleTalk Interfaces.
OSErr codes.
unsigned char * StringPtr
Definition: MacTypes.h:477
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
typedef CALLBACK_API_REGISTER68K(void, SIInterruptProcPtr,(SPBPtr inParamPtr, Ptr dataBuffer, short peakAmplitude, long sampleSize))
typedef REGISTER_UPP_TYPE(HighHookProcPtr) HighHookUPP
Definition: AppleTalk.h:342
Definition: ADSP.h:210
TRioParams ioParams
Definition: ADSP.h:228
TRattnParams attnParams
Definition: ADSP.h:229
short ccbRefNum
Definition: ADSP.h:222
TRstatusParams statusParams
Definition: ADSP.h:230
short csCode
Definition: ADSP.h:220
TRnewcidParams newCIDParams
Definition: ADSP.h:232
TRoptionParams optionParams
Definition: ADSP.h:231
long qStatus
Definition: ADSP.h:221
Definition: OSUtils.h:131
Definition: ADSP.h:111
UInt16 refNum
Definition: ADSP.h:113
UInt8 userFlags
Definition: ADSP.h:115
UInt8 localSocket
Definition: ADSP.h:116
void * attnPtr
Definition: ADSP.h:120
AddrBlock remoteAddress
Definition: ADSP.h:117
UInt16 attnSize
Definition: ADSP.h:119
UInt16 state
Definition: ADSP.h:114
UInt16 attnCode
Definition: ADSP.h:118
Definition: ADSP.h:178
UInt8 filler4
Definition: ADSP.h:183
UInt8 attnInterval
Definition: ADSP.h:182
void * attnData
Definition: ADSP.h:181
UInt16 attnSize
Definition: ADSP.h:180
Definition: ADSP.h:163
UInt8 filler3
Definition: ADSP.h:165
Definition: ADSP.h:133
UInt16 recvQSize
Definition: ADSP.h:138
UInt8 localSocket
Definition: ADSP.h:141
ADSPConnectionEventUPP userRoutine
Definition: ADSP.h:135
UInt8 filler1
Definition: ADSP.h:142
UInt16 sendQSize
Definition: ADSP.h:136
void * sendQueue
Definition: ADSP.h:137
void * attnPtr
Definition: ADSP.h:140
void * recvQueue
Definition: ADSP.h:139
Definition: ADSP.h:169
UInt8 flush
Definition: ADSP.h:174
void * dataPtr
Definition: ADSP.h:172
UInt16 actCount
Definition: ADSP.h:171
UInt8 eom
Definition: ADSP.h:173
Definition: ADSP.h:205
Definition: ADSP.h:146
UInt32 sendSeq
Definition: ADSP.h:151
UInt8 filler2
Definition: ADSP.h:159
UInt32 attnSendSeq
Definition: ADSP.h:154
UInt8 ocInterval
Definition: ADSP.h:157
UInt16 remoteCID
Definition: ADSP.h:148
UInt16 sendWindow
Definition: ADSP.h:152
AddrBlock filterAddress
Definition: ADSP.h:150
UInt32 recvSeq
Definition: ADSP.h:153
UInt8 ocMode
Definition: ADSP.h:156
AddrBlock remoteAddress
Definition: ADSP.h:149
UInt8 ocMaximum
Definition: ADSP.h:158
UInt32 attnRecvSeq
Definition: ADSP.h:155
Definition: ADSP.h:196
UInt8 sendTimer
Definition: ADSP.h:198
UInt8 useCheckSum
Definition: ADSP.h:201
UInt8 badSeqMax
Definition: ADSP.h:200
UInt8 rtmtTimer
Definition: ADSP.h:199
Definition: ADSP.h:187
UInt16 recvQFree
Definition: ADSP.h:192
UInt16 sendQFree
Definition: ADSP.h:190
UInt16 recvQPending
Definition: ADSP.h:191
UInt16 sendQPending
Definition: ADSP.h:189