summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbeard%netscape.com <devnull@localhost>2000-06-20 23:03:43 +0000
committerbeard%netscape.com <devnull@localhost>2000-06-20 23:03:43 +0000
commitf50d3a2e470c3e734aeb189507d38e29583ab605 (patch)
treed19837e069036c1ab9ac985deb3a2ebe06082829
parent9dd873eda7f938a5e0bf44f821c80f1cebfe70dc (diff)
downloadnspr-hg-f50d3a2e470c3e734aeb189507d38e29583ab605.tar.gz
bug #42100, Carbon compatibility. r=gordon, saari, pinkerton, sfraser
-rw-r--r--pr/src/md/mac/macdll.c2
-rw-r--r--pr/src/md/mac/macsockotpt.c41
-rw-r--r--pr/src/md/mac/mdmac.c4
3 files changed, 20 insertions, 27 deletions
diff --git a/pr/src/md/mac/macdll.c b/pr/src/md/mac/macdll.c
index ba9465d0..c2986930 100644
--- a/pr/src/md/mac/macdll.c
+++ b/pr/src/md/mac/macdll.c
@@ -538,6 +538,8 @@ OSErr NSLoadIndexedFragment(const FSSpec *fileSpec, PRUint32 fragmentIndex,
BlockMoveData(fragNameBlock, &fragName[1], nameLen);
fragName[0] = nameLen;
}
+
+ // DebugStr(fragName);
err = GetDiskFragment(fileSpec, fragOffset, fragLength, fragName,
kLoadCFrag, outConnectionID, &main, errName);
diff --git a/pr/src/md/mac/macsockotpt.c b/pr/src/md/mac/macsockotpt.c
index d9c3bb7f..4fc643f2 100644
--- a/pr/src/md/mac/macsockotpt.c
+++ b/pr/src/md/mac/macsockotpt.c
@@ -54,8 +54,8 @@ static struct {
static PRBool gOTInitialized;
static pascal void DNSNotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie);
-static pascal void NotifierRoutine(void * contextPtr, OTEventCode code,
- OTResult result, void * cookie);
+static pascal void NotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie);
+static pascal void RawEndpointNotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie);
static PRBool GetState(PRFileDesc *fd, PRBool *readReady, PRBool *writeReady, PRBool *exceptReady);
@@ -65,24 +65,20 @@ extern void DoneWaitingOnThisThread(PRThread *thread);
#if TARGET_CARBON
OTClientContextPtr clientContext = NULL;
-OTNotifyUPP DNSNotifierRoutineUPP;
-OTNotifyUPP notifierRoutineUPP;
-
-#define DNS_NOTIFIER_ROUTINE DNSNotifierRoutineUPP
-#define NOTIFIER_ROUTINE notifierRoutineUPP
-#define INIT_OPEN_TRANSPORT() InitOpenTransport(clientContext, kInitOTForExtensionMask)
-#define OT_OPEN_INTERNET_SERVICES(config, flags, err) OTOpenInternetServices(config, flags, err, clientContext)
-#define OT_OPEN_ENDPOINT(config, flags, info, err) OTOpenEndpoint(config, flags, info, err, clientContext)
+#define INIT_OPEN_TRANSPORT() InitOpenTransportInContext(kInitOTForExtensionMask, &clientContext)
+#define OT_OPEN_INTERNET_SERVICES(config, flags, err) OTOpenInternetServicesInContext(config, flags, err, clientContext)
+#define OT_OPEN_ENDPOINT(config, flags, info, err) OTOpenEndpointInContext(config, flags, info, err, clientContext)
#else
-#define DNS_NOTIFIER_ROUTINE DNSNotifierRoutine
-#define NOTIFIER_ROUTINE NotifierRoutine
#define INIT_OPEN_TRANSPORT() InitOpenTransport()
#define OT_OPEN_INTERNET_SERVICES(config, flags, err) OTOpenInternetServices(config, flags, err)
#define OT_OPEN_ENDPOINT(config, flags, info, err) OTOpenEndpoint(config, flags, info, err)
#endif /* TARGET_CARBON */
+static OTNotifyUPP DNSNotifierRoutineUPP;
+static OTNotifyUPP NotifierRoutineUPP;
+static OTNotifyUPP RawEndpointNotifierRoutineUPP;
void _MD_InitNetAccess()
{
@@ -103,14 +99,9 @@ void _MD_InitNetAccess()
PR_ASSERT(hasOTTCPIP == PR_TRUE);
-#if TARGET_CARBON
DNSNotifierRoutineUPP = NewOTNotifyUPP(DNSNotifierRoutine);
- notifierRoutineUPP = NewOTNotifyUPP(NotifierRoutine);
-
- errOT = OTAllocClientContext((UInt32)0, &clientContext);
- PR_ASSERT(err == kOTNoError);
-#endif
-
+ NotifierRoutineUPP = NewOTNotifyUPP(NotifierRoutine);
+ RawEndpointNotifierRoutineUPP = NewOTNotifyUPP(RawEndpointNotifierRoutine);
errOT = INIT_OPEN_TRANSPORT();
PR_ASSERT(err == kOTNoError);
@@ -135,7 +126,7 @@ static void _MD_FinishInitNetAccess()
PR_ASSERT((dnsContext.serviceRef != NULL) && (errOT == kOTNoError));
/* Install notify function for DNR Address To String completion */
- errOT = OTInstallNotifier(dnsContext.serviceRef, DNS_NOTIFIER_ROUTINE, &dnsContext);
+ errOT = OTInstallNotifier(dnsContext.serviceRef, DNSNotifierRoutineUPP, &dnsContext);
PR_ASSERT(errOT == kOTNoError);
/* Put us into async mode */
@@ -146,7 +137,7 @@ static void _MD_FinishInitNetAccess()
}
-pascal void DNSNotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie)
+static pascal void DNSNotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie)
{
#pragma unused(contextPtr)
_PRCPU * cpu = _PR_MD_CURRENT_CPU();
@@ -268,7 +259,7 @@ WakeUpNotifiedThread(PRThread *thread, OTResult result)
// Notification routine
// Async callback routine.
// A5 is OK. Cannot allocate memory here
-pascal void NotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie)
+static pascal void NotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie)
{
PRFilePrivate *secret = (PRFilePrivate *) contextPtr;
_MDFileDesc * md = &(secret->md);
@@ -1043,7 +1034,7 @@ typedef struct RawEndpointAndThread
// Notification routine for raw endpoints not yet attached to a PRFileDesc.
// Async callback routine.
// A5 is OK. Cannot allocate memory here
-pascal void RawEndpointNotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie)
+static pascal void RawEndpointNotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie)
{
RawEndpointAndThread *endthr = (RawEndpointAndThread *) contextPtr;
PRThread * thread = endthr->thread;
@@ -1200,7 +1191,7 @@ PRInt32 _MD_accept(PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen, PRInterva
endthr->thread = me;
endthr->endpoint = (EndpointRef) newosfd;
- err = OTInstallNotifier((ProviderRef) newosfd, RawEndpointNotifierRoutine, endthr);
+ err = OTInstallNotifier((ProviderRef) newosfd, RawEndpointNotifierRoutineUPP, endthr);
PR_ASSERT(err == kOTNoError);
err = OTSetAsynchronous((EndpointRef) newosfd);
@@ -1799,7 +1790,7 @@ void _MD_makenonblock(PRFileDesc *fd)
// fd changes, but the secret structure does not;
// (b) the notifier func refers only to the secret data structure
// anyway.
- err = OTInstallNotifier(endpointRef, NOTIFIER_ROUTINE, fd->secret);
+ err = OTInstallNotifier(endpointRef, NotifierRoutineUPP, fd->secret);
PR_ASSERT(err == kOTNoError);
// Now that we have a NotifierRoutine installed, we can make the endpoint asynchronous
diff --git a/pr/src/md/mac/mdmac.c b/pr/src/md/mac/mdmac.c
index c762baa7..bca487a7 100644
--- a/pr/src/md/mac/mdmac.c
+++ b/pr/src/md/mac/mdmac.c
@@ -344,7 +344,7 @@ void PR_InitMemory(void) {
#if TARGET_CARBON
extern OTClientContextPtr clientContext;
-#define CLOSE_OPEN_TRANSPORT() CloseOpenTransport(clientContext)
+#define CLOSE_OPEN_TRANSPORT() CloseOpenTransportInContext(clientContext)
#else
@@ -739,7 +739,7 @@ extern long _MD_GetArchitecture(char *buf, long count)
{
long len;
-#if defined(GENERATINGPOWERPC) && GENERATINGPOWERPC
+#if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
len = PR_snprintf(buf, count, "PowerPC");
#else
len = PR_snprintf(buf, count, "Motorola68k");