|
From: John M M. <jo...@us...> - 2002-08-06 21:42:52
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm
In directory usw-pr-cvs1:/tmp/cvs-serv2300/squeak/platforms/Mac OS/vm
Modified Files:
sqMacFileLogic.c
Log Message:
3.2.8b3 fix for alias resolve issue, also fixes for runing as carbon netscape browser plugin
Index: sqMacFileLogic.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/sqMacFileLogic.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** sqMacFileLogic.c 31 May 2002 16:48:23 -0000 1.9
--- sqMacFileLogic.c 6 Aug 2002 21:42:48 -0000 1.10
***************
*** 16,19 ****
--- 16,21 ----
* 4/23/2002 JMM fix how image is found for os-9 for bundled applications
* 5/12/2002 JMM add logic to enable you to put plugins beside macclassic VM
+ * 3.2.8b1 July 24th, 2002 JMM support for os-x plugin under IE 5.x
+
*
*****************************************************************************/
***************
*** 171,174 ****
--- 173,189 ----
strcat(dst,"/");
strcat(dst,lastpart);
+
+ #if defined(__MWERKS__) && !defined(__APPLE__) && !defined(__MACH__)
+ filePath = CFStringCreateWithBytes(kCFAllocatorDefault,(UInt8 *)dst,strlen(dst),kCFStringEncodingMacRoman,false);
+ if (filePath == nil)
+ return 2;
+ sillyThing = CFURLCreateWithFileSystemPath (kCFAllocatorDefault,filePath,kCFURLPOSIXPathStyle,true);
+ CFRelease(filePath);
+ filePath = CFURLCopyFileSystemPath (sillyThing, kCFURLHFSPathStyle);
+ CFStringGetCString (filePath,dst,1000, kCFStringEncodingMacRoman);
+ CFRelease(sillyThing);
+ CFRelease(filePath);
+ #endif
+
return 0;
} else
***************
*** 183,188 ****
--- 198,212 ----
err = FSResolveAliasFile (&theFSRef,true,&isFolder,&isAlias);
+ #if defined(__MWERKS__) && !defined(__APPLE__) && !defined(__MACH__)
+ sillyThing = CFURLCreateFromFSRef(kCFAllocatorDefault,&theFSRef);
+ filePath = CFURLCopyFileSystemPath (sillyThing, kCFURLHFSPathStyle);
+ CFStringGetCString (filePath,dst,1000, kCFStringEncodingMacRoman);
+ CFRelease(sillyThing);
+ CFRelease(filePath);
+ return 0;
+ #else
err = FSRefMakePath(&theFSRef,(UInt8 *)dst,1000);
return err;
+ #endif
}
***************
*** 194,198 ****
FSSpec convertFileNameSpec,failureRetry;
OSErr err;
! Boolean isFolder,isAlias;
CFURLRef sillyThing,appendedSillyThing;
CFStringRef filePath,lastPartOfPath;
--- 218,222 ----
FSSpec convertFileNameSpec,failureRetry;
OSErr err;
! Boolean isFolder=false,isAlias=false;
CFURLRef sillyThing,appendedSillyThing;
CFStringRef filePath,lastPartOfPath;
***************
*** 206,213 ****
if ((err == noErr) && resolveAlias) {
err = ResolveAliasFile(&convertFileNameSpec,true,&isFolder,&isAlias);
}
if (err == fnfErr) {
failureRetry = convertFileNameSpec;
! CopyCStringToPascal(":",failureRetry.name);
err = FSpMakeFSRef(&failureRetry,&theFSRef);
if (err != noErr)
--- 230,242 ----
if ((err == noErr) && resolveAlias) {
err = ResolveAliasFile(&convertFileNameSpec,true,&isFolder,&isAlias);
+ if (err == fnfErr) {
+ err = lookupPath((char *) src,num,&convertFileNameSpec,false,false);
+ err = ResolveAliasFile(&convertFileNameSpec,true,&isFolder,&isAlias);
+ }
}
+
if (err == fnfErr) {
failureRetry = convertFileNameSpec;
! CopyCStringToPascal("::",failureRetry.name);
err = FSpMakeFSRef(&failureRetry,&theFSRef);
if (err != noErr)
***************
*** 241,244 ****
--- 270,274 ----
CFRelease(sillyThing);
CFRelease(filePath);
+ return;
#else
err = FSRefMakePath(&theFSRef,(UInt8 *)dst,1000);
***************
*** 724,731 ****
}
! #if defined(__MWERKS__) && !TARGET_API_MAC_CARBON
! OSErr __path2fss(const char * pathName, FSSpecPtr spec)
! {
return lookupPath((char *) pathName, strlen(pathName),spec,true,true);
}
--- 754,762 ----
}
+ #if defined(__MWERKS__)
+ int RunningOnCarbonX();
+ OSErr __path2fss(const char * pathName, FSSpecPtr spec);
! OSErr __path2fss(const char * pathName, FSSpecPtr spec) {
return lookupPath((char *) pathName, strlen(pathName),spec,true,true);
}
***************
*** 798,802 ****
err = GetProcessInformation(&PSN, &pinfo);
if (err == noErr && isSystem9_0_or_better()) {
! #if TARGET_API_MAC_CARBON
FSMakeFSSpecCompat(workingDirectory->vRefNum, workingDirectory->parID,"\p:::",workingDirectory);
#else
--- 829,833 ----
err = GetProcessInformation(&PSN, &pinfo);
if (err == noErr && isSystem9_0_or_better()) {
! #if TARGET_API_MAC_CARBON && !defined(__MWERKS__)
FSMakeFSSpecCompat(workingDirectory->vRefNum, workingDirectory->parID,"\p:::",workingDirectory);
#else
|