19 #ifndef __CONNECTIONS__
20 #define __CONNECTIONS__
22 #ifndef __CONDITIONALMACROS__
50 #if PRAGMA_STRUCT_ALIGN
51 #pragma options align = mac68k
52 #elif PRAGMA_STRUCT_PACKPUSH
54 #elif PRAGMA_STRUCT_PACK
58 #if CALL_NOT_IN_CARBON
77 cmNoRequestPending = 6,
90 cmDataNoTimeout = 1L << 4,
91 cmCntlNoTimeout = 1L << 5,
92 cmAttnNoTimeout = 1L << 6,
93 cmDataClean = 1L << 8,
94 cmCntlClean = 1L << 9,
95 cmAttnClean = 1L << 10,
99 cmConfigChanged = 1L << 18
104 typedef long CMRecFlags;
105 typedef short CMChannel;
108 cmStatusOpening = 1L << 0,
109 cmStatusOpen = 1L << 1,
110 cmStatusClosing = 1L << 2,
111 cmStatusDataAvail = 1L << 3,
112 cmStatusCntlAvail = 1L << 4,
113 cmStatusAttnAvail = 1L << 5,
114 cmStatusDRPend = 1L << 6,
115 cmStatusDWPend = 1L << 7,
116 cmStatusCRPend = 1L << 8,
117 cmStatusCWPend = 1L << 9,
118 cmStatusARPend = 1L << 10,
119 cmStatusAWPend = 1L << 11,
120 cmStatusBreakPend = 1L << 12,
121 cmStatusListenPend = 1L << 13,
122 cmStatusIncomingCallPresent = 1L << 14,
123 cmStatusReserved0 = 1L << 15
126 typedef unsigned long CMStatFlags;
138 typedef unsigned short CMBufFields;
139 typedef Ptr CMBuffers[8];
140 typedef long CMBufferSizes[8];
141 typedef const long *ConstCMBufferSizesParam;
142 enum { cmSearchSevenBit = 1L << 0 };
144 typedef unsigned short CMSearchFlags;
145 enum { cmFlagsEOM = 1L << 0 };
147 typedef unsigned short CMFlags;
162 typedef CALLBACK_API(
long, ConnectionToolDefProcPtr)(
ConnHandle hConn,
165 typedef CALLBACK_API(
void, ConnectionSearchCallBackProcPtr)(
ConnHandle hConn,
168 typedef CALLBACK_API(
void, ConnectionCompletionProcPtr)(
ConnHandle hConn);
169 typedef CALLBACK_API(
void, ConnectionChooseIdleProcPtr)(void);
170 typedef STACK_UPP_TYPE(ConnectionToolDefProcPtr) ConnectionToolDefUPP;
172 ConnectionSearchCallBackUPP;
173 typedef STACK_UPP_TYPE(ConnectionCompletionProcPtr) ConnectionCompletionUPP;
174 typedef STACK_UPP_TYPE(ConnectionChooseIdleProcPtr) ConnectionChooseIdleUPP;
181 ConnectionToolDefUPP defProc;
188 CMBuffers bufferArray;
189 CMBufferSizes bufSizes;
191 CMBufferSizes asyncCount;
207 ConnectionCompletionUPP userCompletion;
221 #if CALL_NOT_IN_CARBON
232 #if !OPAQUE_UPP_TYPES
234 uppConnectionToolDefProcInfo = 0x0000FEF0
237 inline ConnectionToolDefUPP
240 (ProcPtr)(userRoutine), uppConnectionToolDefProcInfo,
241 GetCurrentArchitecture());
244 #define NewConnectionToolDefUPP(userRoutine) \
245 (ConnectionToolDefUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), \
246 uppConnectionToolDefProcInfo, \
247 GetCurrentArchitecture())
259 ConnectionSearchCallBackUPP
261 #if !OPAQUE_UPP_TYPES
263 uppConnectionSearchCallBackProcInfo = 0x00000FC0
266 inline ConnectionSearchCallBackUPP
269 (ProcPtr)(userRoutine), uppConnectionSearchCallBackProcInfo,
270 GetCurrentArchitecture());
273 #define NewConnectionSearchCallBackUPP(userRoutine) \
274 (ConnectionSearchCallBackUPP) NewRoutineDescriptor( \
275 (ProcPtr)(userRoutine), uppConnectionSearchCallBackProcInfo, \
276 GetCurrentArchitecture())
288 ConnectionCompletionUPP
290 #if !OPAQUE_UPP_TYPES
292 uppConnectionCompletionProcInfo = 0x000000C0
295 inline ConnectionCompletionUPP
298 (ProcPtr)(userRoutine), uppConnectionCompletionProcInfo,
299 GetCurrentArchitecture());
302 #define NewConnectionCompletionUPP(userRoutine) \
303 (ConnectionCompletionUPP) NewRoutineDescriptor( \
304 (ProcPtr)(userRoutine), uppConnectionCompletionProcInfo, \
305 GetCurrentArchitecture())
317 ConnectionChooseIdleUPP
319 #if !OPAQUE_UPP_TYPES
321 uppConnectionChooseIdleProcInfo = 0x00000000
324 inline ConnectionChooseIdleUPP
327 (ProcPtr)(userRoutine), uppConnectionChooseIdleProcInfo,
328 GetCurrentArchitecture());
331 #define NewConnectionChooseIdleUPP(userRoutine) \
332 (ConnectionChooseIdleUPP) NewRoutineDescriptor( \
333 (ProcPtr)(userRoutine), uppConnectionChooseIdleProcInfo, \
334 GetCurrentArchitecture())
348 #if !OPAQUE_UPP_TYPES
354 #define DisposeConnectionToolDefUPP(userUPP) DisposeRoutineDescriptor(userUPP)
368 #if !OPAQUE_UPP_TYPES
375 #define DisposeConnectionSearchCallBackUPP(userUPP) \
376 DisposeRoutineDescriptor(userUPP)
390 #if !OPAQUE_UPP_TYPES
396 #define DisposeConnectionCompletionUPP(userUPP) \
397 DisposeRoutineDescriptor(userUPP)
411 #if !OPAQUE_UPP_TYPES
417 #define DisposeConnectionChooseIdleUPP(userUPP) \
418 DisposeRoutineDescriptor(userUPP)
432 long p3, ConnectionToolDefUPP userUPP);
433 #if !OPAQUE_UPP_TYPES
437 ConnectionToolDefUPP userUPP) {
438 return (
long)CALL_FIVE_PARAMETER_UPP(userUPP, uppConnectionToolDefProcInfo,
439 hConn, msg, p1, p2, p3);
442 #define InvokeConnectionToolDefUPP(hConn, msg, p1, p2, p3, userUPP) \
443 (long)CALL_FIVE_PARAMETER_UPP((userUPP), uppConnectionToolDefProcInfo, \
444 (hConn), (msg), (p1), (p2), (p3))
458 ConnectionSearchCallBackUPP userUPP);
459 #if !OPAQUE_UPP_TYPES
463 ConnectionSearchCallBackUPP userUPP) {
464 CALL_THREE_PARAMETER_UPP(userUPP, uppConnectionSearchCallBackProcInfo, hConn,
468 #define InvokeConnectionSearchCallBackUPP(hConn, matchPtr, refNum, userUPP) \
469 CALL_THREE_PARAMETER_UPP((userUPP), uppConnectionSearchCallBackProcInfo, \
470 (hConn), (matchPtr), (refNum))
484 ConnectionCompletionUPP userUPP);
485 #if !OPAQUE_UPP_TYPES
488 ConnectionCompletionUPP userUPP) {
489 CALL_ONE_PARAMETER_UPP(userUPP, uppConnectionCompletionProcInfo, hConn);
492 #define InvokeConnectionCompletionUPP(hConn, userUPP) \
493 CALL_ONE_PARAMETER_UPP((userUPP), uppConnectionCompletionProcInfo, (hConn))
507 #if !OPAQUE_UPP_TYPES
513 #define InvokeConnectionChooseIdleUPP(userUPP) \
514 CALL_ZERO_PARAMETER_UPP((userUPP), uppConnectionChooseIdleProcInfo)
520 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
522 #define NewConnectionToolDefProc(userRoutine) \
523 NewConnectionToolDefUPP(userRoutine)
524 #define NewConnectionSearchCallBackProc(userRoutine) \
525 NewConnectionSearchCallBackUPP(userRoutine)
526 #define NewConnectionCompletionProc(userRoutine) \
527 NewConnectionCompletionUPP(userRoutine)
528 #define NewConnectionChooseIdleProc(userRoutine) \
529 NewConnectionChooseIdleUPP(userRoutine)
530 #define CallConnectionToolDefProc(userRoutine, hConn, msg, p1, p2, p3) \
531 InvokeConnectionToolDefUPP(hConn, msg, p1, p2, p3, userRoutine)
532 #define CallConnectionSearchCallBackProc(userRoutine, hConn, matchPtr, refNum) \
533 InvokeConnectionSearchCallBackUPP(hConn, matchPtr, refNum, userRoutine)
534 #define CallConnectionCompletionProc(userRoutine, hConn) \
535 InvokeConnectionCompletionUPP(hConn, userRoutine)
536 #define CallConnectionChooseIdleProc(userRoutine) \
537 InvokeConnectionChooseIdleUPP(userRoutine)
542 #if CALL_NOT_IN_CARBON
578 #if CALL_NOT_IN_CARBON
588 CMNew(
short procID, CMRecFlags flags, ConstCMBufferSizesParam desiredSizes,
589 long refCon,
long userData);
593 #if CALL_NOT_IN_CARBON
706 ConnectionCompletionUPP completor);
718 Boolean async, ConnectionCompletionUPP completor,
long timeout,
731 CMChannel theChannel,
Boolean async, ConnectionCompletionUPP completor,
732 long timeout, CMFlags flags);
927 ConnectionSearchCallBackUPP callBack);
1118 #if PRAGMA_STRUCT_ALIGN
1119 #pragma options align = reset
1120 #elif PRAGMA_STRUCT_PACKPUSH
1122 #elif PRAGMA_STRUCT_PACK
1126 #ifdef PRAGMA_IMPORT_OFF
1129 #pragma import reset
Set up for compiler independent conditionals.
CMErr CMDisposeIOPB(ConnHandle hConn, CMIOPBPtr theIOPB)
long InvokeConnectionToolDefUPP(ConnHandle hConn, short msg, long p1, long p2, long p3, ConnectionToolDefUPP userUPP)
void InvokeConnectionChooseIdleUPP(ConnectionChooseIdleUPP userUPP)
void DisposeConnectionChooseIdleUPP(ConnectionChooseIdleUPP userUPP)
CMErr CMPBIOKill(ConnHandle hConn, CMIOPBPtr theIOPB)
void CMGetToolName(short procID, Str255 name)
void CMClearSearch(ConnHandle hConn)
short CMChoose(ConnHandle *hConn, Point where, ConnectionChooseIdleUPP idle)
Boolean CMValidate(ConnHandle hConn)
Boolean CMMenu(ConnHandle hConn, short menuID, short item)
short CMSetConfig(ConnHandle hConn, const void *thePtr)
ConnectionChooseIdleUPP NewConnectionChooseIdleUPP(ConnectionChooseIdleProcPtr userRoutine)
ConnectionCompletionUPP NewConnectionCompletionUPP(ConnectionCompletionProcPtr userRoutine)
void InvokeConnectionCompletionUPP(ConnHandle hConn, ConnectionCompletionUPP userUPP)
CMErr CMIOKill(ConnHandle hConn, short which)
void CMActivate(ConnHandle hConn, Boolean activate)
Handle CMSetupPreflight(short procID, long *magicCookie)
void CMIdle(ConnHandle hConn)
CMErr CMStatus(ConnHandle hConn, CMBufferSizes sizes, CMStatFlags *flags)
void CMSetUserData(ConnHandle hConn, long userData)
void InvokeConnectionSearchCallBackUPP(ConnHandle hConn, Ptr matchPtr, long refNum, ConnectionSearchCallBackUPP userUPP)
void CMGetErrorString(ConnHandle hConn, short id, Str255 errMsg)
void CMRemoveSearch(ConnHandle hConn, long refnum)
CMErr CMOpen(ConnHandle hConn, Boolean async, ConnectionCompletionUPP completor, long timeout)
CMErr CMRead(ConnHandle hConn, void *theBuffer, long *toRead, CMChannel theChannel, Boolean async, ConnectionCompletionUPP completor, long timeout, CMFlags *flags)
void CMDispose(ConnHandle hConn)
CMErr CMClose(ConnHandle hConn, Boolean async, ConnectionCompletionUPP completor, long timeout, Boolean now)
short CMGetCMVersion(void)
void DisposeConnectionCompletionUPP(ConnectionCompletionUPP userUPP)
long CMAddSearch(ConnHandle hConn, ConstStr255Param theString, CMSearchFlags flags, ConnectionSearchCallBackUPP callBack)
long CMGetUserData(ConnHandle hConn)
void CMSetupPostflight(short procID)
void DisposeConnectionToolDefUPP(ConnectionToolDefUPP userUPP)
CMErr CMAbort(ConnHandle hConn)
OSErr CMIntlToEnglish(ConnHandle hConn, const void *inputPtr, Ptr *outputPtr, short language)
OSErr CMEnglishToIntl(ConnHandle hConn, const void *inputPtr, Ptr *outputPtr, short language)
short CMGetProcID(ConstStr255Param name)
ConnectionToolDefUPP NewConnectionToolDefUPP(ConnectionToolDefProcPtr userRoutine)
void CMSetRefCon(ConnHandle hConn, long refCon)
ConnectionSearchCallBackUPP NewConnectionSearchCallBackUPP(ConnectionSearchCallBackProcPtr userRoutine)
void CMSetupSetup(short procID, const void *theConfig, short count, DialogRef theDialog, long *magicCookie)
void DisposeConnectionSearchCallBackUPP(ConnectionSearchCallBackUPP userUPP)
Ptr CMGetConfig(ConnHandle hConn)
CMErr CMListen(ConnHandle hConn, Boolean async, ConnectionCompletionUPP completor, long timeout)
CMErr CMWrite(ConnHandle hConn, const void *theBuffer, long *toWrite, CMChannel theChannel, Boolean async, ConnectionCompletionUPP completor, long timeout, CMFlags flags)
long CMGetRefCon(ConnHandle hConn)
void CMReset(ConnHandle hConn)
void CMSetupXCleanup(short procID, const void *theConfig, short count, DialogRef theDialog, Boolean OKed, long *magicCookie)
CMErr CMNewIOPB(ConnHandle hConn, CMIOPBPtr *theIOPB)
CMErr CMPBWrite(ConnHandle hConn, CMIOPBPtr theIOPB, Boolean async)
Handle CMGetVersion(ConnHandle hConn)
ConnHandle CMNew(short procID, CMRecFlags flags, ConstCMBufferSizesParam desiredSizes, long refCon, long userData)
CMErr CMGetConnEnvirons(ConnHandle hConn, ConnEnvironRec *theEnvirons)
CMErr CMAccept(ConnHandle hConn, Boolean accept)
void CMEvent(ConnHandle hConn, const EventRecord *theEvent)
void CMDefault(Ptr *theConfig, short procID, Boolean allocate)
Boolean CMSetupFilter(short procID, const void *theConfig, short count, DialogRef theDialog, EventRecord *theEvent, short *theItem, long *magicCookie)
void CMResume(ConnHandle hConn, Boolean resume)
CMErr CMPBRead(ConnHandle hConn, CMIOPBPtr theIOPB, Boolean async)
void CMSetupItem(short procID, const void *theConfig, short count, DialogRef theDialog, short *theItem, long *magicCookie)
void CMBreak(ConnHandle hConn, long duration, Boolean async, ConnectionCompletionUPP completor)
GetTime & now
Get current date and time in DateTimeRec format.
Definition: DateTimeUtils.h:539
Dialog Manager interfaces.
Basic Macintosh data types.
unsigned char Boolean
Definition: MacTypes.h:318
Mixed Mode Manager Interfaces.
#define CALL_ZERO_PARAMETER_UPP(upp, procInfo)
Definition: MixedMode.h:790
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
Definition: Connections.h:200
Definition: Connections.h:148
Definition: Connections.h:175
Definition: Quickdraw.h:1648
Definition: MacTypes.h:520
Definition: OSUtils.h:131