|
From: Andre R. <and...@us...> - 2004-10-26 21:53:28
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10610/Frontier/Common/source Modified Files: launch.c Log Message: In getapplicationfilespec, added a new Carbon/Mach-O implementation for obtaining a filespec to our application bundle, i.e. the Frontier.app "folder". Index: launch.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/launch.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** launch.c 23 Oct 2004 22:34:30 -0000 1.3 --- launch.c 26 Oct 2004 21:53:17 -0000 1.4 *************** *** 1933,1938 **** --- 1933,1945 ---- 5.0.2b21 dmb: clear unused fields on Win + 2000-06-09 Timothy Paustian: Changed because using SysEnvisons + and SysEnvRec is like Really old style. This was changed to Gestalt calls + with two new globals see mac.c initmacintosh. + 2002-11-14 AR: Switch from using globals to a local struct for providing context to the getprocesspathvisit callback routine + + 2004-10-26 aradke: New Carbon/Mach-O implementation for obtaining + a filespec to our application bundle, i.e. the Frontier.app "folder". */ *************** *** 1940,1946 **** typrocessvisitinfo info; boolean flsystem7; - //Code change by Timothy Paustian Friday, June 9, 2000 2:36:02 PM - //Changed because using SysEnvisons and SysEnvRec is like Really old style - //This was changed to Gestalt calls with two new globals see mac.c initmacintosh flsystem7 = (gSystemVersion >= 0x0700); --- 1947,1950 ---- *************** *** 1951,1971 **** if (bsprogram == nil) { /*get path to this process*/ ! ProcessInfoRec processinfo; ! ProcessSerialNumber psn; ! ! processinfo.processInfoLength = sizeof (processinfo); ! ! processinfo.processName = nil; /*place to store process name*/ ! ! processinfo.processAppSpec = fs; /*place to store process filespec*/ ! ! psn.highLongOfPSN = 0; ! ! psn.lowLongOfPSN = kCurrentProcess; ! ! if (GetProcessInformation (&psn, &processinfo) != noErr) ! return (false); ! ! return (true); } --- 1955,2004 ---- if (bsprogram == nil) { /*get path to this process*/ ! #if TARGET_RT_MAC_MACHO ! CFBundleRef mybundleref; ! CFURLRef myurlref; ! FSRef myfsref; ! boolean res; ! OSErr err; ! ! mybundleref = CFBundleGetMainBundle(); ! ! if (mybundleref == NULL) ! return (false); ! ! myurlref = CFBundleCopyBundleURL(mybundleref); ! ! if (myurlref == NULL) ! return (false); ! ! res = CFURLGetFSRef(myurlref, &myfsref); ! ! CFRelease(myurlref); ! ! if (!res) ! return (false); ! ! err = FSGetCatalogInfo(&myfsref, kFSCatInfoNone, NULL, NULL, fs, NULL); ! ! return (err == noErr); ! #else ! ProcessInfoRec processinfo; ! ProcessSerialNumber psn; ! ! processinfo.processInfoLength = sizeof (processinfo); ! ! processinfo.processName = nil; /*place to store process name*/ ! ! processinfo.processAppSpec = fs; /*place to store process filespec*/ ! ! psn.highLongOfPSN = 0; ! ! psn.lowLongOfPSN = kCurrentProcess; ! ! if (GetProcessInformation (&psn, &processinfo) != noErr) ! return (false); ! ! return (true); ! #endif } |