20 #ifndef __OPENTRANSPORT__
21 #define __OPENTRANSPORT__
86 #if PRAGMA_STRUCT_ALIGN
87 #pragma options align = mac68k
88 #elif PRAGMA_STRUCT_PACKPUSH
90 #elif PRAGMA_STRUCT_PACK
94 #if defined(__MWERKS__) && TARGET_CPU_68K
96 #pragma pointers_in_D0
131 #define OTUNIXERRORS 0
156 #define OTDebug qDebug
166 #ifndef OTCARBONAPPLICATION
167 #define OTCARBONAPPLICATION 0
190 typedef UInt32 OTUInt16Param;
191 typedef SInt32 OTSInt16Param;
192 typedef SInt32 OTSInt8Param;
193 typedef SInt32 OTBooleanParam;
196 typedef UInt16 OTUInt16Param;
197 typedef SInt16 OTSInt16Param;
198 typedef SInt8 OTSInt8Param;
199 typedef Boolean OTBooleanParam;
202 #if defined(__MWERKS__) || defined(THINK_C) || defined(SYMANTEC_CPLUS) || \
203 defined(SYMANTEC_C) || defined(__xlc) || defined(__xlC) || \
205 typedef ByteCount OTByteCount;
206 typedef ItemCount OTItemCount;
207 typedef SInt32 OTInt32;
208 typedef UInt32 OTUInt32;
210 typedef unsigned int OTByteCount;
211 typedef unsigned int OTItemCount;
213 typedef unsigned int OTUInt32;
224 #if defined(__SC__) || defined(THINK_CPLUS) || defined(__MRC__)
227 #define _MDECL _cdecl
233 #define kOTLibraryVersion "1.1"
235 #define kOTLibraryPrefix "OTLib$"
236 #define kOTModulePrefix "OTModl$"
237 #define kOTClientPrefix "OTClnt$"
238 #define kOTKernelPrefix "OTKrnl$"
242 kOTCFMClass = FOUR_CHAR_CODE(
'otan')
248 typedef UInt32 OTTimeout;
250 typedef SInt32 OTSequence;
252 typedef SInt32 OTNameID;
259 typedef UInt32 OTQLen;
261 typedef UInt8 *OTClientName;
263 typedef SInt32 OTCommand;
265 typedef struct OpaqueOTClient *OTClient;
271 #define OTOffsetOf(structure, field) ((ByteCount) & ((structure *)0)->field)
275 #define kOTFatalErr "FB "
276 #define kOTNonfatalErr "NB "
277 #define kOTExtFatalErr "FX "
278 #define kOTExtNonfatalErr "NX "
279 #define kOTUserFatalErr "UF "
280 #define kOTUserErr "UE "
281 #define kOTUserNonfatalErr "UE "
282 #define kOTInfoErr "IE "
283 #define kOTInfoBreak "IN "
285 #if CALL_NOT_IN_CARBON
298 #define OTDebugBreak(str) OTDebugStr(str)
299 #define OTDebugTest(val, str) \
304 #define OTAssert(name, cond) \
305 ((cond) ? ((void)0) : (OTDebugStr(__FILE__ ": " #name ": " #cond)))
307 #define OTDebugBreak(str)
308 #define OTDebugTest(val, str)
309 #define OTAssert(name, cond)
312 #if qDebug > 1 || qDebug2 > 1
313 #define OTDebugBreak2(str) OTDebugStr(str)
314 #define OTDebugTest2(val, str) \
320 #define OTDebugBreak2(str)
321 #define OTDebugTest2(val, str)
342 #if CALL_NOT_IN_CARBON
351 O_NDELAY = kO_NDELAY,
352 O_NONBLOCK = kO_NONBLOCK
359 typedef UInt16 OTUnixErr;
365 #if OTKERNEL || OTUNIXERRORS
425 EPROTONOSUPPORT = 43,
426 ESOCKTNOSUPPORT = 44,
516 #define XTI2OSStatus(x) (-3149 - (x))
517 #define E2OSStatus(x) (-3199 - (x))
519 #define OSStatus2XTI(x) ((OTXTIErr)(-3149 - (x)))
520 #define OSStatus2E(x) ((OTUnixErr)(-3199 - (x)))
522 #define IsXTIError(x) ((x) < -3149 && (x) >= (-3149 - TLASTXTIERROR))
523 #define IsEError(x) ((x) < -3199 && (x) >= (-3199 - ELASTERRNO))
543 typedef UInt16 OTAddressType;
546 OTAddressType fAddressType;
576 typedef UInt32 OTStructType;
589 typedef UInt32 OTFieldsType;
605 T_EXPEDITED = 0x0002,
606 T_ACKNOWLEDGED = 0x0004,
607 T_PARTIALDATA = 0x0008,
608 T_NORECEIPT = 0x0010,
616 T_NEGOTIATE = 0x0004,
631 T_PARTSUCCESS = 0x0100,
633 T_NOTSUPPORT = 0x0400
661 typedef class TEndpoint *EndpointRef;
662 typedef class TMapper *MapperRef;
665 typedef void *EndpointRef;
666 typedef void *MapperRef;
668 #define kOTInvalidRef 0L
669 #define kOTInvalidProviderRef ((ProviderRef)0L)
670 #define kOTInvalidEndpointRef ((EndpointRef)0L)
671 #define kOTInvalidMapperRef ((MapperRef)0L)
714 T_DISCONNECT = 0x0010,
724 kPRIVATEEVENT = 0x10000000,
725 kCOMPLETEEVENT = 0x20000000,
726 T_BINDCOMPLETE = 0x20000001,
727 T_UNBINDCOMPLETE = 0x20000002,
728 T_ACCEPTCOMPLETE = 0x20000003,
729 T_REPLYCOMPLETE = 0x20000004,
730 T_DISCONNECTCOMPLETE = 0x20000005,
731 T_OPTMGMTCOMPLETE = 0x20000006,
732 T_OPENCOMPLETE = 0x20000007,
733 T_GETPROTADDRCOMPLETE = 0x20000008,
734 T_RESOLVEADDRCOMPLETE = 0x20000009,
735 T_GETINFOCOMPLETE = 0x2000000A,
736 T_SYNCCOMPLETE = 0x2000000B,
737 T_MEMORYRELEASED = 0x2000000C,
738 T_REGNAMECOMPLETE = 0x2000000D,
739 T_DELNAMECOMPLETE = 0x2000000E,
740 T_LKUPNAMECOMPLETE = 0x2000000F,
741 T_LKUPNAMERESULT = 0x20000010,
742 kOTSyncIdleEvent = 0x20000011,
743 kSTREAMEVENT = 0x21000000,
744 kOTReservedEvent1 = 0x21000001,
745 kGetmsgEvent = 0x21000002,
746 kStreamReadEvent = 0x21000003,
747 kStreamWriteEvent = 0x21000004,
748 kStreamIoctlEvent = 0x21000005,
749 kOTReservedEvent2 = 0x21000006,
750 kStreamOpenEvent = 0x21000007,
751 kPollEvent = 0x21000008,
752 kOTReservedEvent3 = 0x21000009,
753 kOTReservedEvent4 = 0x2100000A,
754 kOTReservedEvent5 = 0x2100000B,
755 kOTReservedEvent6 = 0x2100000C,
756 kOTReservedEvent7 = 0x2100000D,
757 kOTReservedEvent8 = 0x2100000E,
758 kSIGNALEVENT = 0x22000000,
760 kPROTOCOLEVENT = 0x23000000,
761 kOTProviderIsDisconnected = 0x23000001,
762 kOTProviderIsReconnected = 0x23000002,
763 kOTProviderWillClose = 0x24000001,
764 kOTProviderIsClosed = 0x24000002,
773 kOTClosePortRequest = 0x25000005,
775 kOTYieldPortRequest = 0x25000005,
777 kOTNewPortRegistered =
779 kOTPortNetworkChange = 0x25000007,
781 kOTConfigurationChanged = 0x26000001,
782 kOTSystemSleep = 0x26000002,
783 kOTSystemShutdown = 0x26000003,
784 kOTSystemAwaken = 0x26000004,
785 kOTSystemIdle = 0x26000005,
786 kOTSystemSleepPrep = 0x26000006,
787 kOTSystemShutdownPrep = 0x26000007,
788 kOTSystemAwakenPrep = 0x26000008,
789 kOTStackIsLoading = 0x27000001,
793 kOTStackIsUnloading =
799 #define IsOTPrivateEvent(x) (((x) & 0x70000000L) == kPRIVATEEVENT)
800 #define IsOTCompleteEvent(x) (((x) & 0x7f000000L) == kCOMPLETEEVENT)
801 #define IsOTProtocolEvent(x) (((x) & 0x7f000000L) == kPROTOCOLEVENT)
802 #define IsOTStreamEvent(x) (((x) & 0x7f000000L) == kSTREAMEVENT)
803 #define IsOTSignalEvent(x) (((x) & 0x7f000000L) == kSIGNALEVENT)
804 #define GetOTEventCode(x) (x)
836 typedef TVECTOR_UPP_TYPE(OTNotifyProcPtr) OTNotifyUPP;
847 #if !OPAQUE_UPP_TYPES
850 uppOTNotifyProcInfo = 0x00003FC0
858 #define NewOTNotifyUPP(userRoutine) (userRoutine)
872 #if !OPAQUE_UPP_TYPES
876 #define DisposeOTNotifyUPP(userUPP)
890 void *cookie, OTNotifyUPP userUPP);
891 #if !OPAQUE_UPP_TYPES
897 (*userUPP)(contextPtr, code, result, cookie);
900 #define InvokeOTNotifyUPP(contextPtr, code, result, cookie, userUPP) \
901 (*userUPP)(contextPtr, code, result, cookie)
912 typedef UInt32 OTXTILevel;
914 typedef UInt32 OTXTIName;
921 XTI_RCVLOWAT = 0x1004,
923 XTI_SNDLOWAT = 0x1003,
924 XTI_PROTOTYPE = 0x1005,
925 OPT_CHECKSUM = 0x0600,
926 OPT_RETRYCNT = 0x0601,
927 OPT_INTERVAL = 0x0602,
928 OPT_ENABLEEOM = 0x0603,
931 OPT_SERVERSTATUS = 0x0605,
932 OPT_ALERTENABLE = 0x0606,
933 OPT_KEEPALIVE = 0x0008
946 #define MIOC_CMD(t, v) ((((t) & 0xFF) << 8) | ((v) & 0xFF))
958 MIOC_RESERVEDf =
'f',
962 MIOC_RESERVEDi =
'i',
971 MIOC_RESERVEDp =
'p',
972 MIOC_RESERVEDr =
'r',
973 MIOC_RESERVEDs =
's',
981 I_OTGetMiscellaneousEvents =
982 ((MIOC_OT << 8) | 1),
983 I_OTSetFramingType = ((MIOC_OT << 8) | 2),
985 (
unsigned long)0xFFFFFFFF,
986 I_OTSetRawMode = ((MIOC_OT << 8) | 3),
987 kOTSetRecvMode = 0x01,
988 kOTSendErrorPacket = 0x02,
989 I_OTConnect = ((MIOC_OT << 8) | 4),
991 ((MIOC_OT << 8) | 5),
992 I_OTScript = ((MIOC_OT << 8) | 6)
1001 UInt32 fScriptLength;
1031 T_UNUSED = (
unsigned long)(-1),
1038 kT_UNSPEC = (
unsigned long)0xFFFFFFFD,
1045 T_UNSPEC = kT_UNSPEC
1061 #define kOTNoMemoryConfigurationPtr ((OTConfigurationRef)0L)
1062 #define kOTInvalidConfigurationPtr ((OTConfigurationRef)-1L)
1097 kOTBooleanOptionDataSize =
sizeof(UInt32),
1098 kOTBooleanOptionSize = kOTOptionHeaderSize + kOTBooleanOptionDataSize,
1099 kOTOneByteOptionSize = kOTOptionHeaderSize + 1,
1100 kOTTwoByteOptionSize = kOTOptionHeaderSize + 2,
1101 kOTFourByteOptionSize = kOTOptionHeaderSize +
sizeof(UInt32)
1109 #define T_ALIGN(len) \
1110 (((UInt32)(len) + (sizeof(SInt32) - 1)) & ~(sizeof(SInt32) - 1))
1119 #define OPT_NEXTHDR(theBuffer, theBufLen, prevOption) \
1120 (((char *)(prevOption) + T_ALIGN((prevOption)->len) < \
1121 (char *)(theBuffer) + (theBufLen)) \
1122 ? (TOption *)((char *)(prevOption) + T_ALIGN((prevOption)->len)) \
1162 T_SENDZERO = 0x0001,
1164 T_CAN_SUPPORT_MDATA = 0x10000000,
1165 T_CAN_RESOLVE_ADDR = 0x40000000,
1166 T_CAN_SUPPLY_MIB = 0x20000000
1180 typedef SInt32 OTDataSize;
1207 kOTInvalidPortRef = 0
1212 typedef UInt8 OTBusType;
1215 kOTUnknownBusPort = 0,
1216 kOTMotherboardBus = 1,
1222 kOTLastBusIndex = 15
1233 kOTNoDeviceType = 0,
1236 kOTLocalTalkDevice = 3,
1237 kOTIRTalkDevice = 4,
1238 kOTTokenRingDevice = 5,
1242 kOTSerialDevice = 9,
1243 kOTEthernetDevice = 10,
1246 kOTModemDevice = 13,
1247 kOTFastEthernetDevice = 14,
1250 kOTATMSNAPDevice = 17,
1251 kOTFibreChannelDevice = 18,
1252 kOTFireWireDevice = 19,
1253 kOTPseudoDevice = 1023,
1254 kOTLastDeviceIndex = 1022
1261 kOTLastSlotNumber = 255,
1262 kOTLastOtherNumber = 255
1265 typedef UInt16 OTSlotNumber;
1338 #define OTCreateNuBusPortRef(devType, slot, other) \
1339 OTCreatePortRef(kOTNuBus, devType, slot, other)
1341 #define OTCreatePCIPortRef(devType, slot, other) \
1342 OTCreatePortRef(kOTPCIBus, devType, slot, other)
1344 #define OTCreatePCCardPortRef(devType, slot, other) \
1345 OTCreatePortRef(kOTPCCardBus, devType, slot, other)
1351 kMaxModuleNameLength = 31,
1352 kMaxModuleNameSize = kMaxModuleNameLength + 1,
1353 kMaxProviderNameLength = kMaxModuleNameLength +
1355 kMaxProviderNameSize = kMaxProviderNameLength + 1,
1356 kMaxSlotIDLength = 7,
1357 kMaxSlotIDSize = kMaxSlotIDLength + 1,
1358 kMaxResourceInfoLength = 31,
1359 kMaxResourceInfoSize = 32,
1360 kMaxPortNameLength =
1361 kMaxModuleNameLength + 4,
1362 kMaxPortNameSize = kMaxPortNameLength + 1
1372 kOTPortIsActive = 0x00000001,
1373 kOTPortIsDisabled = 0x00000002,
1374 kOTPortIsUnavailable = 0x00000004,
1375 kOTPortIsOffline = 0x00000008
1382 kOTPortIsDLPI = 0x00000001,
1383 kOTPortIsTPI = 0x00000002,
1386 kOTPortCanArbitrate =
1388 kOTPortIsTransitory = 0x00000010,
1389 kOTPortAutoConnects = 0x00000020,
1390 kOTPortIsSystemRegistered = 0x00004000,
1391 kOTPortIsPrivate = 0x00008000,
1392 kOTPortIsAlias = (
unsigned long)0x80000000
1408 UInt32 fCapabilities;
1409 ItemCount fNumChildPorts;
1412 char fModuleName[32];
1414 char fResourceInfo[32];
1415 char fReserved[164];
1461 #if CALL_NOT_IN_CARBON
1555 kNetbufDataIsOTData = (
unsigned long)0xFFFFFFFE
1587 kOTNetbufDataIsOTBufferStar = (
unsigned long)0xFFFFFFFD
1604 #define OTInitBufferInfo(infoPtr, theBuffer) \
1605 (infoPtr)->fBuffer = theBuffer; \
1606 (infoPtr)->fPad = (theBuffer)->fPad1; \
1607 (infoPtr)->fOffset = 0
1619 kOTNetbufIsRawMode = (
unsigned long)0xFFFFFFFF
1647 OTSequence sequence;
1659 OTSequence sequence;
1702 OTSequence sequence;
1710 OTSequence sequence;
1722 OTSequence sequence;
1730 OTSequence sequence;
1783 UInt16 fAddressLength;
1785 UInt8 fAddressBuffer[1];
1794 #define OTNextLookupBuffer(buf) \
1795 ((TLookupBuffer *)((char *)buf + \
1796 ((OTOffsetOf(TLookupBuffer, fAddressBuffer) + \
1797 buf->fAddressLength + buf->fNameLength + 3) & \
1803 typedef struct OpaqueOTClientContextPtr *OTClientContextPtr;
1816 kInitOTForApplicationMask = 1,
1817 kInitOTForExtensionMask = 2
1831 OTClientContextPtr *outClientContext);
1849 #if CALL_NOT_IN_CARBON
1922 OTClientContextPtr clientContext);
1935 #if OTCARBONAPPLICATION
1937 #define InitOpenTransport() \
1938 InitOpenTransportInContext(kInitOTForApplicationMask, NULL)
1939 #define CloseOpenTransport() CloseOpenTransportInContext(NULL)
1940 #define OTRegisterAsClient(name, proc) \
1941 OTRegisterAsClientInContext(name, proc, NULL)
1942 #define OTUnregisterAsClient() OTUnregisterAsClientInContext(NULL)
1954 #if CALL_NOT_IN_CARBON
2007 typedef TVECTOR_UPP_TYPE(OTProcessProcPtr) OTProcessUPP;
2018 #if !OPAQUE_UPP_TYPES
2021 uppOTProcessProcInfo = 0x000000C0
2029 #define NewOTProcessUPP(userRoutine) (userRoutine)
2043 #if !OPAQUE_UPP_TYPES
2047 #define DisposeOTProcessUPP(userUPP)
2061 #if !OPAQUE_UPP_TYPES
2068 #define InvokeOTProcessUPP(arg, userUPP) (*userUPP)(arg)
2089 OTProcessUPP upp,
void *arg,
2090 OTClientContextPtr clientContext);
2100 #if CALL_NOT_IN_CARBON
2125 #if CALL_NOT_IN_CARBON
2150 #if OTCARBONAPPLICATION
2152 #define OTCreateDeferredTask(upp, arg) \
2153 OTCreateDeferredTaskInContext(upp, arg, NULL)
2165 #if CALL_NOT_IN_CARBON
2227 #if CALL_NOT_IN_CARBON
2238 OTNotifyUPP proc,
void *contextPtr);
2264 #if CALL_NOT_IN_CARBON
2312 #if CALL_NOT_IN_CARBON
2528 #define OTIsNonBlocking(ref) (!OTIsBlocking(ref))
2529 #define OTIsAsynchronous(ref) (!OTIsSynchronous(ref))
2554 OTClientContextPtr clientContext);
2568 OTNotifyUPP upp,
void *contextPtr,
2569 OTClientContextPtr clientContext);
2571 #if CALL_NOT_IN_CARBON
2596 OTNotifyUPP proc,
void *contextPtr);
2600 #if OTCARBONAPPLICATION
2602 #define OTOpenEndpoint(config, oflag, info, err) \
2603 OTOpenEndpointInContext(config, oflag, info, err, NULL)
2604 #define OTAsyncOpenEndpoint(config, oflag, info, proc, contextPtr) \
2605 OTAsyncOpenEndpointInContext(config, oflag, info, proc, contextPtr, NULL)
2643 #if CALL_NOT_IN_CARBON
2717 OTClientContextPtr clientContext);
2719 #if CALL_NOT_IN_CARBON
2729 OTAlloc(EndpointRef ref, OTStructType structType, OTFieldsType fields,
2734 #if OTCARBONAPPLICATION
2736 #define OTAlloc(ref, structType, fields, err) \
2737 OTAllocInContext(ref, structType, fields, err, NULL)
2768 #if CALL_NOT_IN_CARBON
2790 char *str, OTByteCount stringSize);
2814 OTFindOption(UInt8 *buffer, UInt32 buflen, OTXTILevel level, OTXTIName name);
2992 #if CALL_NOT_IN_CARBON
3147 OTNotifyUPP upp,
void *contextPtr,
3148 OTClientContextPtr clientContext);
3161 OTClientContextPtr clientContext);
3163 #if CALL_NOT_IN_CARBON
3189 #if OTCARBONAPPLICATION
3191 #define OTAsyncOpenMapper(config, oflag, proc, contextPtr) \
3192 OTAsyncOpenMapperInContext(config, oflag, proc, contextPtr, NULL)
3193 #define OTOpenMapper(config, oflag, err) \
3194 OTOpenMapperInContext(config, oflag, err, NULL)
3299 OTClientContextPtr clientContext);
3301 #if CALL_NOT_IN_CARBON
3326 #if OTCARBONAPPLICATION
3328 #define OTAllocMem(s) OTAllocMemInContext(s, NULL)
3382 OTMemcpy(
void *dest,
const void *src, OTByteCount nBytes);
3393 OTMemcmp(
const void *mem1,
const void *mem2, OTByteCount nBytes);
3580 void Init() { fNext =
NULL; }
3589 #define OTGetLinkObject(link, struc, field) \
3590 ((struc *)((char *)(link)-OTOffsetOf(struc, field)))
3683 inline void OTLIFO::Init() { fHead =
NULL; }
3687 inline Boolean OTLIFO::IsEmpty() {
return fHead ==
NULL; }
3706 typedef TVECTOR_UPP_TYPE(OTListSearchProcPtr) OTListSearchUPP;
3717 #if !OPAQUE_UPP_TYPES
3720 uppOTListSearchProcInfo = 0x000003D1
3728 #define NewOTListSearchUPP(userRoutine) (userRoutine)
3742 #if !OPAQUE_UPP_TYPES
3746 #define DisposeOTListSearchUPP(userUPP)
3760 OTListSearchUPP userUPP);
3761 #if !OPAQUE_UPP_TYPES
3764 OTListSearchUPP userUPP)
3769 #define InvokeOTListSearchUPP(ref, linkToCheck, userUPP) \
3770 (*userUPP)(ref, linkToCheck)
3783 void AddFirst(
OTLink *link);
3784 void AddLast(
OTLink *link);
3790 OTLink *FindLink(OTListSearchUPP proc,
const void *ref);
3792 OTLink *FindAndRemoveLink(OTListSearchUPP proc,
const void *ref);
3793 OTLink *GetIndexedLink(OTItemCount index);
3957 OTEnqueue(
void **listHead,
void *
object, OTByteCount linkOffset);
3977 inline void OTList::Init() { fHead =
NULL; }
3978 inline Boolean OTList::IsEmpty() {
return fHead ==
NULL; }
3986 inline OTLink *OTList::FindLink(OTListSearchUPP proc,
const void *ref)
3994 inline OTLink *OTList::FindAndRemoveLink(OTListSearchUPP proc,
3999 inline OTLink *OTList::GetIndexedLink(OTItemCount index)
4028 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
4029 #pragma parameter __D0 OTAtomicSetBit(__A0, __D0)
4048 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
4049 #pragma parameter __D0 OTAtomicClearBit(__A0, __D0)
4068 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
4069 #pragma parameter __D0 OTAtomicTestBit(__A0, __D0)
4088 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
4089 #pragma parameter __D0 OTCompareAndSwapPtr(__D0, __D1, __A0)
4107 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
4108 #pragma parameter __D0 OTCompareAndSwap32(__D0, __D1, __A0)
4126 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
4127 #pragma parameter __D0 OTCompareAndSwap16(__D0, __D1, __A0)
4145 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
4146 #pragma parameter __D0 OTCompareAndSwap8(__D0, __D1, __A0)
4164 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
4165 #pragma parameter __D0 OTAtomicAdd32(__D0, __A0)
4204 typedef UInt8 OTLock;
4206 #define OTClearLock(lockPtr) *(lockPtr) = 0
4207 #define OTAcquireLock(lockPtr) (OTAtomicSetBit(lockPtr, 0) == 0)
4231 void *
operator new(size_t);
4232 void operator delete(
void *) {}
4250 OSStatus AckSends() {
return OTAckSends(
this); }
4254 void CancelSynchronousCalls(OSStatus err)
4259 OSStatus InstallNotifier(OTNotifyUPP proc,
void *ptr)
4274 #if CALL_NOT_IN_CARBON
4277 ProviderRef TransferOwnership(OTClient prevOwner, OSStatus *errPtr)
4283 SInt32 Ioctl(UInt32
cmd,
void *data) {
return OTIoctl(
this,
cmd, data); }
4284 SInt32 Ioctl(UInt32
cmd,
long data)
4289 #if CALL_NOT_IN_CARBON
4299 OSStatus PutMessage(
const strbuf *ctlbuf,
const strbuf *databuf,
4304 OSStatus PutPriorityMessage(
const strbuf *ctlbuf,
const strbuf *databuf,
4319 class TEndpoint :
public TProvider
4330 OSStatus GetProtAddress(
TBind *boundAddr,
TBind *peerAddr)
4335 OSStatus ResolveAddress(
TBind *reqAddr,
TBind *retAddr, OTTimeout timeout)
4344 #if CALL_NOT_IN_CARBON
4350 void *AllocInContext(OTStructType structType, UInt32 fields,
4351 OSStatus *err =
NULL,
4352 OTClientContextPtr clientContext =
NULL)
4357 void *Alloc(OTStructType structType, UInt32 fields, OSStatus *err =
NULL)
4359 #if TARGET_API_MAC_CARBON
4362 return OTAlloc(
this, structType, fields, err);
4366 OTResult Free(
void *ptr, OTStructType structType)
4368 return OTFree(ptr, structType);
4380 OSStatus Bind(
TBind *reqAddr,
TBind *retAddr)
4382 return OTBind(
this, reqAddr, retAddr);
4385 OSStatus Unbind() {
return OTUnbind(
this); }
4389 OSStatus Connect(
TCall *sndCall,
TCall *rcvCall)
4391 return OTConnect(
this, sndCall, rcvCall);
4396 OSStatus Listen(
TCall *call) {
return OTListen(
this, call); }
4398 OSStatus Accept(EndpointRef resRef,
TCall *call)
4400 return OTAccept(
this, resRef, call);
4407 OSStatus RcvDisconnect(
TDiscon *discon)
4418 return OTSnd(
this, buf, nbytes, flags);
4423 return OTRcv(
this, buf, nbytes, flagP);
4437 #if CALL_NOT_IN_CARBON
4461 OSStatus CancelRequest(OTSequence seq) {
return OTCancelRequest(
this, seq); }
4463 OSStatus CancelReply(OTSequence seq) {
return OTCancelReply(
this, seq); }
4487 OSStatus CancelURequest(OTSequence seq)
4492 OSStatus CancelUReply(OTSequence seq) {
return OTCancelUReply(
this, seq); }
4497 OTResult CountDataBytes(OTByteCount *countPtr)
4509 class TMapper :
public TProvider
4519 OSStatus DeleteName(OTNameID theID) {
return OTDeleteNameByID(
this, theID); }
4533 #if defined(__MWERKS__) && TARGET_CPU_68K
4537 #if PRAGMA_STRUCT_ALIGN
4538 #pragma options align = reset
4539 #elif PRAGMA_STRUCT_PACKPUSH
4541 #elif PRAGMA_STRUCT_PACK
4545 #ifdef PRAGMA_IMPORT_OFF
4548 #pragma import reset
Basic Macintosh data types.
#define NULL
Definition: MacTypes.h:61
unsigned char Boolean
Definition: MacTypes.h:318
Mixed Mode Manager Interfaces.
OSErr Dequeue(QElemPtr qElement, QHdrPtr qHeader)
Remove an element from a queue.
void Enqueue(QElemPtr qElement, QHdrPtr qHeader)
Add an element to the end of a queue.
EndpointRef OTOpenEndpointInContext(OTConfigurationRef config, OTOpenFlags oflag, TEndpointInfo *info, OSStatus *err, OTClientContextPtr clientContext)
Boolean OTIsAckingSends(ProviderRef ref)
UInt32 OTElapsedMilliseconds(OTTimeStamp *startTime)
void * OTAllocMem(OTByteCount size)
OSStatus InitOpenTransportUtilities(void)
OSStatus OTCreateOptionString(const char *endPtName, TOption **opt, void *bufEnd, char *str, OTByteCount stringSize)
OTResult OTRcv(EndpointRef ref, void *buf, OTByteCount nbytes, OTFlags *flags)
OTPortRef OTGetProviderPortRef(ProviderRef ref)
void OTLeaveInterrupt(void)
void InvokeOTNotifyUPP(void *contextPtr, OTEventCode code, OTResult result, void *cookie, OTNotifyUPP userUPP)
OTDeviceType OTGetDeviceTypeFromPortRef(OTPortRef ref)
Boolean OTIsBlocking(ProviderRef ref)
OSStatus OTCancelUReply(EndpointRef ref, OTSequence seq)
OTResult OTSync(EndpointRef ref)
void OTMemset(void *dest, OTUInt8Param toSet, OTByteCount nBytes)
void InvokeOTProcessUPP(void *arg, OTProcessUPP userUPP)
OSStatus OTDontAckSends(ProviderRef ref)
OSStatus OTDeleteNameByID(MapperRef ref, OTNameID nameID)
UnsignedWide OTTimeStamp
Definition: OpenTransport.h:3484
Boolean OTCompareAndSwap16(UInt32 oldValue, UInt32 newValue, UInt16 *dest)
void OTAddFirst(OTList *list, OTLink *link)
EndpointRef OTOpenEndpoint(OTConfigurationRef cfig, OTOpenFlags oflag, TEndpointInfo *info, OSStatus *err)
OTLink * OTRemoveFirst(OTList *list)
OSStatus OTCancelReply(EndpointRef ref, OTSequence sequence)
UInt32 OTTimeStampInMicroseconds(OTTimeStamp *delta)
OSStatus OTSndRequest(EndpointRef ref, TRequest *req, OTFlags reqFlags)
Boolean OTCanLoadLibraries(void)
void OTRemoveNotifier(ProviderRef ref)
long OTDeferredTaskRef
Definition: OpenTransport.h:2099
Boolean OTRemoveLink(OTList *list, OTLink *link)
void * OTAlloc(EndpointRef ref, OTStructType structType, OTFieldsType fields, OSStatus *err)
struct OTConfiguration * OTConfigurationRef
Definition: OpenTransport.h:1059
Boolean OTScheduleInterruptTask(OTDeferredTaskRef dtCookie)
OSStatus OTBind(EndpointRef ref, TBind *reqAddr, TBind *retAddr)
OTResult OTFree(void *ptr, OTStructType structType)
void OTMemmove(void *dest, const void *src, OTByteCount nBytes)
OTLink * OTLIFODequeue(OTLIFO *list)
OSStatus OTSndReply(EndpointRef ref, TReply *reply, OTFlags replyFlags)
OSStatus OTRcvReply(EndpointRef ref, TReply *reply, OTFlags *replyFlags)
MapperRef OTOpenMapperInContext(OTConfigurationRef config, OTOpenFlags oflag, OSStatus *err, OTClientContextPtr clientContext)
OSStatus OTUnregisterAsClientInContext(OTClientContextPtr clientContext)
SInt32 OTReason
Definition: OpenTransport.h:257
OSStatus OTRegisterAsClientInContext(OTClientName name, OTNotifyUPP proc, OTClientContextPtr clientContext)
Boolean OTStrEqual(const char *src1, const char *src2)
OTPortRef OTSetBusTypeInPortRef(OTPortRef ref, OTBusType busType)
OTLink * OTLIFOStealList(OTLIFO *list)
Boolean OTAtomicClearBit(UInt8 *bytePtr, OTByteCount bitNumber)
OSStatus OTDeleteName(MapperRef ref, TNetbuf *name)
OSStatus OTUseSyncIdleEvents(ProviderRef ref, Boolean useEvents)
OSStatus OTRcvUData(EndpointRef ref, TUnitData *udata, OTFlags *flags)
SInt16 OTAtomicAdd16(SInt32 toAdd, SInt16 *dest)
Boolean OTIsInList(OTList *list, OTLink *link)
OSStatus OTPutPriorityMessage(ProviderRef ref, const strbuf *ctlbuf, const strbuf *databuf, OTBand band, OTFlags flags)
OSStatus OTCancelURequest(EndpointRef ref, OTSequence seq)
OTTimeStamp * OTSubtractTimeStamps(OTTimeStamp *result, OTTimeStamp *startTime, OTTimeStamp *endEnd)
UInt16 OTDeviceType
Definition: OpenTransport.h:1230
OSStatus OTCancelSynchronousCalls(ProviderRef ref, OSStatus err)
void OTLeaveNotifier(ProviderRef ref)
OTResult OTGetPriorityMessage(ProviderRef ref, strbuf *ctlbuf, strbuf *databuf, OTBand *bandPtr, OTFlags *flagsPtr)
UInt16 OTGetBusTypeFromPortRef(OTPortRef ref)
Boolean OTAtomicTestBit(UInt8 *bytePtr, OTByteCount bitNumber)
OSStatus OTRcvDisconnect(EndpointRef ref, TDiscon *discon)
OSStatus OTPutMessage(ProviderRef ref, const strbuf *ctlbuf, const strbuf *databuf, OTFlags flags)
OSStatus OTSndUReply(EndpointRef ref, TUnitReply *reply, OTFlags replyFlags)
void CloseOpenTransport(void)
OSStatus InitOpenTransportInContext(OTInitializationFlags flags, OTClientContextPtr *outClientContext)
OTLink * OTGetLast(OTList *list)
OSStatus OTCloseProvider(ProviderRef ref)
OTNotifyUPP NewOTNotifyUPP(OTNotifyProcPtr userRoutine)
OSStatus OTInstallNotifier(ProviderRef ref, OTNotifyUPP proc, void *contextPtr)
OSStatus OTUnbind(EndpointRef ref)
void OTLIFOEnqueue(OTLIFO *list, OTLink *link)
void OTMemzero(void *dest, OTByteCount nBytes)
void DisposeOTProcessUPP(OTProcessUPP userUPP)
UInt32 OTServiceType
Definition: OpenTransport.h:1147
void CloseOpenTransportInContext(OTClientContextPtr clientContext)
UInt32 OTXTIStates
Definition: OpenTransport.h:1009
OSStatus OTAsyncOpenEndpointInContext(OTConfigurationRef config, OTOpenFlags oflag, TEndpointInfo *info, OTNotifyUPP upp, void *contextPtr, OTClientContextPtr clientContext)
long OTCreateDeferredTaskInContext(OTProcessUPP upp, void *arg, OTClientContextPtr clientContext)
OTResult OTSnd(EndpointRef ref, void *buf, OTByteCount nbytes, OTFlags flags)
OSStatus OTSndUData(EndpointRef ref, TUnitData *udata)
OTProcessUPP NewOTProcessUPP(OTProcessProcPtr userRoutine)
UInt32 OTFlags
Definition: OpenTransport.h:597
SInt8 OTAtomicAdd8(SInt32 toAdd, SInt8 *dest)
TOption * OTFindOption(UInt8 *buffer, UInt32 buflen, OTXTILevel level, OTXTIName name)
Boolean OTFindPortByRef(OTPortRecord *portRecord, OTPortRef ref)
UInt32 OTPortRef
Definition: OpenTransport.h:1203
void * OTAllocMemInContext(OTByteCount size, OTClientContextPtr clientContext)
UInt32 OTTimeStampInMilliseconds(OTTimeStamp *delta)
void OTStrCopy(char *dest, const char *src)
SInt32 OTAtomicAdd32(SInt32 toAdd, SInt32 *dest)
OTPortRef OTCreatePortRef(OTBusType busType, OTDeviceType devType, OTSlotNumber slot, UInt16 other)
OSStatus OTAsyncOpenMapper(OTConfigurationRef cfig, OTOpenFlags oflag, OTNotifyUPP proc, void *contextPtr)
void * OTAllocInContext(EndpointRef ref, OTStructType structType, UInt32 fields, OSStatus *err, OTClientContextPtr clientContext)
OSStatus OTRcvRequest(EndpointRef ref, TRequest *req, OTFlags *reqFlags)
OTLink * OTGetFirst(OTList *list)
UInt32 OTOpenFlags
Definition: OpenTransport.h:334
OSStatus OTGetProtAddress(EndpointRef ref, TBind *boundAddr, TBind *peerAddr)
OSStatus OTRcvUDErr(EndpointRef ref, TUDErr *uderr)
OSStatus OTUnregisterAsClient(void)
void OTDebugStr(const char *str)
Boolean OTMemcmp(const void *mem1, const void *mem2, OTByteCount nBytes)
OTPortRef OTSetDeviceTypeInPortRef(OTPortRef ref, OTDeviceType devType)
OTResult OTCountDataBytes(EndpointRef ref, OTByteCount *countPtr)
OTListSearchUPP NewOTListSearchUPP(OTListSearchProcPtr userRoutine)
OSStatus OTAsyncOpenEndpoint(OTConfigurationRef cfig, OTOpenFlags oflag, TEndpointInfo *info, OTNotifyUPP proc, void *contextPtr)
OSStatus OTSndOrderlyDisconnect(EndpointRef ref)
OSStatus OTSetSynchronous(ProviderRef ref)
OSStatus OTRcvConnect(EndpointRef ref, TCall *call)
Boolean OTScheduleDeferredTask(OTDeferredTaskRef dtCookie)
UInt32 OTElapsedMicroseconds(OTTimeStamp *startTime)
void OTAddLast(OTList *list, OTLink *link)
OTConfigurationRef OTCreateConfiguration(const char *path)
OSStatus OTAsyncOpenProvider(OTConfigurationRef cfig, OTOpenFlags flags, OTNotifyUPP proc, void *contextPtr)
OSStatus OTDestroyDeferredTask(OTDeferredTaskRef dtCookie)
UInt16 OTXTIErr
Definition: OpenTransport.h:460
void DisposeOTNotifyUPP(OTNotifyUPP userUPP)
OTResult OTLook(EndpointRef ref)
Boolean OTAtomicSetBit(UInt8 *bytePtr, OTByteCount bitNumber)
OSStatus OTRegisterAsClient(OTClientName name, OTNotifyUPP proc)
Boolean OTIsSynchronous(ProviderRef ref)
OSStatus OTAckSends(ProviderRef ref)
MapperRef OTOpenMapper(OTConfigurationRef cfig, OTOpenFlags oflag, OSStatus *err)
OSStatus OTGetEndpointInfo(EndpointRef ref, TEndpointInfo *info)
OSStatus OTDestroySystemTask(OTSystemTaskRef stCookie)
Boolean OTCancelSystemTask(OTSystemTaskRef stCookie)
OSStatus InitOpenTransport(void)
OSStatus OTAccept(EndpointRef listener, EndpointRef worker, TCall *call)
OTSlotNumber OTGetSlotFromPortRef(OTPortRef ref, UInt16 *other)
OTByteCount OTStrLength(const char *str)
void OTEnqueue(void **listHead, void *object, OTByteCount linkOffset)
OSStatus OTSetAsynchronous(ProviderRef ref)
OSStatus OTRcvUReply(EndpointRef ref, TUnitReply *reply, OTFlags *replyFlags)
OSStatus OTSndDisconnect(EndpointRef ref, TCall *call)
OSStatus OTRcvURequest(EndpointRef ref, TUnitRequest *req, OTFlags *reqFlags)
Boolean OTCanMakeSyncCall(void)
OSStatus OTRegisterName(MapperRef ref, TRegisterRequest *req, TRegisterReply *reply)
Boolean OTFindPort(OTPortRecord *portRecord, const char *portName)
Boolean OTEnterNotifier(ProviderRef ref)
ProviderRef OTTransferProviderOwnership(ProviderRef ref, OTClient prevOwner, OSStatus *errPtr)
UInt32 OTGetClockTimeInSecs(void)
OSStatus OTNextOption(UInt8 *buffer, UInt32 buflen, TOption **prevOptPtr)
OSStatus OTCancelRequest(EndpointRef ref, OTSequence sequence)
Boolean OTCompareAndSwap8(UInt32 oldValue, UInt32 newValue, UInt8 *dest)
OSStatus OTConnect(EndpointRef ref, TCall *sndCall, TCall *rcvCall)
ProviderRef OTOpenProvider(OTConfigurationRef cfig, OTOpenFlags flags, OSStatus *errPtr)
Boolean OTCompareAndSwapPtr(void *oldValue, void *newValue, void **dest)
Boolean OTIsAtInterruptLevel(void)
void OTDestroyConfiguration(OTConfigurationRef cfig)
Boolean OTScheduleSystemTask(OTSystemTaskRef stCookie)
OSStatus OTSetNonBlocking(ProviderRef ref)
Boolean OTCompareAndSwap32(UInt32 oldValue, UInt32 newValue, UInt32 *dest)
OTDeferredTaskRef OTCreateDeferredTask(OTProcessUPP proc, void *arg)
OTSystemTaskRef OTCreateSystemTask(OTProcessUPP proc, void *arg)
void OTFreeMem(void *mem)
OSStatus OTAsyncOpenMapperInContext(OTConfigurationRef config, OTOpenFlags oflag, OTNotifyUPP upp, void *contextPtr, OTClientContextPtr clientContext)
OSStatus OTUnregisterPort(const char *portName, void **ref)
UInt32 OTBand
Definition: OpenTransport.h:643
SInt32 OTIoctl(ProviderRef ref, UInt32 cmd, void *data)
OSStatus OTRcvOrderlyDisconnect(EndpointRef ref)
OSStatus OTCreateOptions(const char *endPtName, char **strPtr, TNetbuf *buf)
OSStatus OTLookupName(MapperRef ref, TLookupRequest *req, TLookupReply *reply)
OTResult OTGetEndpointState(EndpointRef ref)
UInt8 OTUInt8Param
Definition: OpenTransport.h:195
void OTEnterInterrupt(void)
OTLink * OTReverseList(OTLink *list)
OTResult OTGetMessage(ProviderRef ref, strbuf *ctlbuf, strbuf *databuf, OTFlags *flagsPtr)
typedef CALLBACK_API_C(Boolean, OTListSearchProcPtr)(const void *ref
typedef CALLBACK_API(void, OTNotifyProcPtr)(void *contextPtr
long OTSystemTaskRef
Definition: OpenTransport.h:2164
void * ProviderRef
Definition: OpenTransport.h:664
void DisposeOTListSearchUPP(OTListSearchUPP userUPP)
Boolean InvokeOTListSearchUPP(const void *ref, OTLink *linkToCheck, OTListSearchUPP userUPP)
UInt32 OTEventCode
Definition: OpenTransport.h:678
OSStatus OTListen(EndpointRef ref, TCall *call)
OTConfigurationRef OTCloneConfiguration(OTConfigurationRef cfig)
OSStatus OTOptionManagement(EndpointRef ref, TOptMgmt *req, TOptMgmt *ret)
OTLink * OTFindAndRemoveLink(OTList *list, OTListSearchUPP proc, const void *ref)
OSStatus OTChangePortState(OTPortRef portRef, OTEventCode theChange, OTResult why)
OTLink * OTRemoveLast(OTList *list)
OSStatus OTResolveAddress(EndpointRef ref, TBind *reqAddr, TBind *retAddr, OTTimeout timeOut)
void OTStrCat(char *dest, const char *src)
Boolean OTGetIndexedPort(OTPortRecord *portRecord, OTItemCount index)
void OTGetTimeStamp(OTTimeStamp *currentTime)
OSStatus OTRegisterPort(OTPortRecord *portRecord, void *ref)
void * OTDequeue(void **listHead, OTByteCount linkOffset)
OTLink * OTFindLink(OTList *list, OTListSearchUPP proc, const void *ref)
UInt32 OTInitializationFlags
Definition: OpenTransport.h:1813
OTLink * OTGetIndexedLink(OTList *list, OTItemCount index)
void OTMemcpy(void *dest, const void *src, OTByteCount nBytes)
SInt32 OTResult
Definition: OpenTransport.h:510
void OTDelay(UInt32 seconds)
OSStatus OTSndURequest(EndpointRef ref, TUnitRequest *req, OTFlags reqFlags)
OSStatus OTSetBlocking(ProviderRef ref)
Definition: AEDataModel.h:175
Definition: OpenTransport.h:545
Definition: OpenTransport.h:1597
Definition: OpenTransport.h:1572
Definition: OpenTransport.h:1547
Definition: OpenTransport.h:3603
Definition: OpenTransport.h:3573
Definition: OpenTransport.h:3775
Definition: OpenTransport.h:1404
Definition: OpenTransport.h:998
Definition: TranslationExtensions.h:114
Definition: OpenTransport.h:1634
Definition: OpenTransport.h:1655
Definition: OpenTransport.h:1644
Definition: OpenTransport.h:1183
Definition: OpenTransport.h:1782
Definition: OpenTransport.h:1772
Definition: OpenTransport.h:1759
Definition: OpenTransport.h:1518
Definition: OpenTransport.h:1683
Definition: OpenTransport.h:1083
Definition: OpenTransport.h:1752
Definition: OpenTransport.h:1741
Definition: OpenTransport.h:1707
Definition: OpenTransport.h:1699
Definition: OpenTransport.h:1675
Definition: OpenTransport.h:1664
Definition: OpenTransport.h:1727
Definition: OpenTransport.h:1718
Definition: MacTypes.h:110
Definition: OpenTransport.h:1533
Definition: OpenTransport.h:1128
Definition: OpenTransport.h:1135