|
From: <cre...@us...> - 2006-06-25 19:02:40
|
Revision: 1416 Author: creecode Date: 2006-06-25 12:02:32 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1416&view=rev Log Message: ----------- FSRef-ized Modified Paths: -------------- Frontier/branches/FSRef_Migration/Common/UserLandIACToolkit/landsystem7.c Frontier/branches/FSRef_Migration/Common/headers/lang.h Frontier/branches/FSRef_Migration/Common/headers/langexternal.h Frontier/branches/FSRef_Migration/Common/source/langdll.c Frontier/branches/FSRef_Migration/Common/source/langevaluate.c Frontier/branches/FSRef_Migration/Common/source/langexternal.c Frontier/branches/FSRef_Migration/Common/source/langvalue.c Modified: Frontier/branches/FSRef_Migration/Common/UserLandIACToolkit/landsystem7.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/UserLandIACToolkit/landsystem7.c 2006-06-25 09:25:52 UTC (rev 1415) +++ Frontier/branches/FSRef_Migration/Common/UserLandIACToolkit/landsystem7.c 2006-06-25 19:02:32 UTC (rev 1416) @@ -176,140 +176,6 @@ */ -#if TARGET_API_MAC_OS8 - -static void MakePascalStringWLen (StringPtr theDest, int theDestLen, char *theSrc, int theSrcLen) { - - /* - 10/22/91 dmb: imported this code from Leonard Rosenthal. Reformmatted - somewhat, but left variable names as he had them. comments are his. - - Given a C string, put it into a pascal storage area. We also make - sure that the length of the pascal string isn't too long (the caller - specifiys the longest length possible). We are passed in the length - of the C string... This makes our life simpler... - */ - - theDest [0] = theSrcLen > theDestLen ? theDestLen : theSrcLen; - - BlockMove (theSrc, &(theDest[1]), theDest [0]); - } /*MakePascalStringWLen*/ - - -static OSErr HCProgramToPortAndLoc (char *theName, short len, LocationNameRec *theLoc, PortInfoRec *thePort) { - - /* - 10/22/91 dmb: imported this code from Leonard Rosenthal. Reformmatted - somewhat, but left variable names as he had them. comments are his. - - Convert a Hypercard program name (<zone>:<mac>:<program>) to a port. - If that program has more than one port open, we take the first port - we find! - */ - - char *appleZone = 0; - char *macName = 0; - char *progName = 0; - char *theLastChar = 0; - PPCPortRec thePortSearchSpec; - IPCListPortsPBRec thePBRec; - int theErr; - - /* - Assemble a location. This is a bit of a pain, as we must - carefully unpack the incomming string... - */ - - /* - First job -- find the end of the incomming string so we don't - run off into memory... - */ - - theLastChar = theName; - - appleZone = theName; /* First thing there... */ - - while (--len >= 0) { - - if (*theLastChar == ':') { - - if (!macName) { - - macName = theLastChar + 1; - } - else if (!progName) { - - progName = theLastChar + 1; - } - } - - theLastChar++; - } - - /* - Right, make sure that we got everything... - */ - - if ((progName == 0) || (macName == 0)) - return (1); /* Random error... */ - - /* - Next, assemble a port record that we can use to specify what - the hell we are looking for... Use a roman script (sorry, guys), - match only names that have our program, and match all types. - That way we will get the first type. - */ - - thePortSearchSpec.nameScript = smRoman; - - thePortSearchSpec.portKindSelector = ppcByString; - - MakePascalStringWLen ((StringPtr) thePortSearchSpec.name, 32, progName, (Size)(theLastChar - progName)); - - MakePascalStringWLen ((StringPtr) thePortSearchSpec.u.portTypeStr, 32, "=", 1); - - /* - Next job is to fill in the location record that the guy passed - in. The objString is the mac we wish to connect to. The zone - is the apple zone. We let the type be random... so we set it - to PPCToolBox as defined by IM VI 6 7-23. - */ - - theLoc -> locationKindSelector = ppcNBPLocation; - - /*bundle*/ { - - register EntityName *theE = &(theLoc -> u.nbpEntity); - - MakePascalStringWLen ((StringPtr) &(theE -> objStr), 32, macName, (int) (progName - macName - 1)); - - MakePascalStringWLen ((StringPtr) &(theE -> typeStr), 32, "PPCToolBox", 10); - - MakePascalStringWLen ((StringPtr) &(theE -> zoneStr), 32, appleZone, (macName - appleZone - 1)); - } - - /* - Right. Finally, we fill in the parameter block we are to pass - to IPCListPorts. - */ - - thePBRec.startIndex = 0; - thePBRec.requestCount = 1; - thePBRec.portName = &thePortSearchSpec; - thePBRec.locationName = theLoc; - thePBRec.bufferPtr = thePort; - - /* - Call the damm routine and try to get the stupid port back! - */ - theErr = IPCListPortsSync (&thePBRec); - - return (theErr); - } /*HCProgramToPortAndLoc*/ - -#endif - - static boolean isthisprocess (ProcessSerialNumber *targetPSN) { register OSErr err; @@ -329,105 +195,25 @@ static boolean landchecksameprocess (tynetworkaddress *adr) { -#if TARGET_API_MAC_CARBON == 1 + # pragma unused (adr) -#endif + /* 3/9/92 dmb: if GetProcessSerialNumberFromPortName returns an error, leave flsendingtoself false, but return true. adr may be a valid port that doesn't have a psn */ - #if TARGET_API_MAC_CARBON == 1 //what the hell do I do here? - return true; - #else + return ( true ); - register OSErr err; - ProcessSerialNumber targetPSN; - - if (!(*adr).target.location.locationKindSelector) { /*might be sending to ourself*/ - - err = GetProcessSerialNumberFromPortName (&(*adr).target.name, &targetPSN); - - if (err == noErr) - return (isthisprocess (&targetPSN)); - } - return (false); - #endif } /*landchecksameprocess*/ -#if TARGET_API_MAC_OS8 - -static boolean goodstring32 (byte s32 []) { - - register byte *s = s32; - register short len = *s; - - if ((len == 0) || (len > 32)) - return (false); - - while (--len >= 0) { - - if ((*++s) < ' ') /*non-printing character*/ - return (false); - } - - return (true); - } /*goodstring32*/ - - pascal boolean landstring2networkaddress (ConstStr255Param bsadr, tynetworkaddress *adr) { - - /* - 10/27/91 dmb: even when HCProgramToPortAndLoc's IPCListPorts call returns noErr, - the network address may be invalid. so a reality check is done on the port name - to attempt to verify that something has actually been found - */ - - register hdllandglobals hg = landgetglobals (); - LocationNameRec loc; - PortInfoRec port; - register OSErr err; - - if ((**hg).transport == macsystem6) /*can't call do networks on System 6*/ - return (false); - - err = HCProgramToPortAndLoc ((char *) bsadr + 1, stringlength (bsadr), &loc, &port); - - if (err != noErr) { - - landseterror (err); - - return (false); - } - - if (!goodstring32 (port.name.name)) { /*make sure it actually found something*/ - - landseterror (noResponseErr); - - return (false); - } - - (*adr).target.sessionID = 0; - - (*adr).target.location = loc; - - (*adr).target.name = port.name; - - /* - return (landchecksameprocess (adr)); - */ - - return (true); - } /*landstring2networkaddress*/ -#else - -pascal boolean landstring2networkaddress (ConstStr255Param bsadr, tynetworkaddress *adr) { #pragma unused (bsadr, adr) /* 2004-10-21 aradke: Can't do this on Carbon, send back a bogus error. @@ -438,63 +224,11 @@ return (false); } /*landstring2networkaddress*/ -#endif - -#if !TARGET_API_MAC_CARBON - //Code change by Timothy Paustian Friday, July 21, 2000 10:40:43 PM - //we don't do anything on Carbon because we can't use this anyway. - -static pascal Boolean landbrowserfilter (LocationNamePtr ln, PortInfoPtr port) { -#pragma unused (ln) - - register hdllandglobals hg; - register tyapplicationid id; - long type; - - #ifdef flcomponent - long curA5 = SetUpAppA5 (); - #endif - - hg = landgetglobals (); - - id = (**hg).macnetglobals.idforbrowser; - - #ifdef flcomponent - RestoreA5 (curA5); - #endif - - if (id == 0) /*no filtering, everything qualifies*/ - return (true); - - if ((*port).name.portKindSelector != ppcByString) /*MacDTS magic*/ - return (false); - - BlockMove ((*port).name.u.portTypeStr + 1, (Ptr) &type, 4); /*MacDTS magic*/ - - return (type == id); - } /*landbrowserfilter*/ - - - #if !TARGET_RT_MAC_CFM - - #define landbrowserfilterUPP (&landbrowserfilter) - - #else - - static RoutineDescriptor landbrowserfilterDesc = BUILD_ROUTINE_DESCRIPTOR (uppPPCFilterProcInfo, landbrowserfilter); - - #define landbrowserfilterUPP (&landbrowserfilterDesc) - - #endif - -#endif - - pascal boolean landbrowsenetworkapps (ConstStr255Param bsprompt, tynetworkaddress *adr, tyapplicationid id) { -#if TARGET_API_MAC_CARBON + # pragma unused (bsprompt, adr, id) -#endif + /* 7/15/91 DW: return false on system 6. @@ -503,65 +237,7 @@ 6/8/92 dmb: use landseterror to communicate error code to caller */ - #if !TARGET_API_MAC_CARBON - register hdllandglobals hg = landgetglobals (); - register OSErr err; - register boolean senddirect = false; - LocationNameRec loc; - PortInfoRec port; - PPCFilterUPP filter = landbrowserfilterUPP; - long appA5; - - if ((**hg).transport == macsystem6) /*can't call PPCBrowser on System 6*/ - return (false); - - (**hg).macnetglobals.idforbrowser = id; /*for communication with landbrowserfilter*/ - - shellactivate (); - - loc = (*adr).target.location; - - port.name = (*adr).target.name; - - #ifdef flcomponent - - appA5 = SetUpCurA5 (); /*for system*/ - - #endif - - err = PPCBrowser ( - - bsprompt, (ConstStr255Param) nil, true, &loc, &port, filter, nil); - - #ifdef flcomponent - - RestoreA5 (appA5); - - #endif - - if (err != noErr) { /*user cancelled the browser*/ - - landseterror (err); - - return (false); - } - - (**hg).macnetglobals.flhavebrowsed = true; /*default to the same port next time*/ - - (*adr).target.sessionID = 0; - - (*adr).target.location = loc; - - (*adr).target.name = port.name; - - /* - return (landchecksameprocess (adr)); - */ - - return (true); - #else return false; - #endif } /*landbrowsenetworkapps*/ Modified: Frontier/branches/FSRef_Migration/Common/headers/lang.h =================================================================== --- Frontier/branches/FSRef_Migration/Common/headers/lang.h 2006-06-25 09:25:52 UTC (rev 1415) +++ Frontier/branches/FSRef_Migration/Common/headers/lang.h 2006-06-25 19:02:32 UTC (rev 1416) @@ -1107,7 +1107,7 @@ extern boolean setdoublevalue (double, tyvaluerecord *); -extern boolean setfilespecvalue (tyfilespec *, tyvaluerecord *); +extern boolean setfilespecvalue (ptrfilespec, tyvaluerecord *); extern boolean setexternalvalue (Handle, tyvaluerecord *); @@ -1268,7 +1268,7 @@ extern boolean getostypevalue (hdltreenode, short, OSType *); -extern boolean getfilespecvalue (hdltreenode, short, tyfilespec *); +extern boolean getfilespecvalue ( hdltreenode, short, ptrfilespec ); extern boolean getpointvalue (hdltreenode, short, Point *); Modified: Frontier/branches/FSRef_Migration/Common/headers/langexternal.h =================================================================== --- Frontier/branches/FSRef_Migration/Common/headers/langexternal.h 2006-06-25 09:25:52 UTC (rev 1415) +++ Frontier/branches/FSRef_Migration/Common/headers/langexternal.h 2006-06-25 19:02:32 UTC (rev 1416) @@ -245,7 +245,7 @@ extern boolean langexternalzoom (tyvaluerecord, hdlhashtable, bigstring); -extern boolean langexternalzoomfilewindow (const tyvaluerecord *, tyfilespec *, boolean); +extern boolean langexternalzoomfilewindow (const tyvaluerecord *, ptrfilespec, boolean); extern boolean langexternalwindowopen (tyvaluerecord, hdlwindowinfo *); Modified: Frontier/branches/FSRef_Migration/Common/source/langdll.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/langdll.c 2006-06-25 09:25:52 UTC (rev 1415) +++ Frontier/branches/FSRef_Migration/Common/source/langdll.c 2006-06-25 19:02:32 UTC (rev 1416) @@ -29,7 +29,10 @@ #include "standard.h" #ifdef MACVERSION -#include "langxcmd.h" + + #include "langxcmd.h" + #include "MoreFilesX.h" + #endif #include "memory.h" @@ -1000,9 +1003,11 @@ static boolean locateprocinfo (tydllinfohandle hdll, bigstring bsprocname, typrocinfohandle *hprocinfoptr) { - /* - Look up the proc name in the hash table of procs - */ + // + // Look up the proc name in the hash table of procs + // + // 2006-06-25 creedon: for Mac, FSRef-ized + // typrocinfohandle hnomad; tyfilespec fs = (**hdll).fs; @@ -1024,12 +1029,16 @@ } hnomad = (**hnomad).hashlink; - }/*while*/ + } // while - lang2paramerror (cantfindprocinfofunctionerror, bsprocname, fsname (&fs)); + bigstring bs; + + getfsfile ( &fs, bs ); + + lang2paramerror (cantfindprocinfofunctionerror, bsprocname, bs ); return (false); - } /*locateprocinfo*/ + } // locateprocinfo static void freeprocinfobuckets (tydllinfohandle hdll) { @@ -1100,18 +1109,24 @@ static boolean loadprocinforesource (tydllinfohandle hdll) { - /* - Platoform-specific code for loading the library's ProcInfo resource - - Caller is responsible for setting langerror - */ + // + // Platoform-specific code for loading the library's ProcInfo resource + // + // Caller is responsible for setting langerror + // + // 2006-06-25 creedon: for Mac, FSRef-ized + // #ifdef MACVERSION + tyfilespec fs = (**hdll).fs; short resfile; Handle hRes; + HFSUniStr255 resourceforkname; + + FSGetResourceForkName ( &resourceforkname ); - resfile = FSpOpenResFile (&fs, fsRdPerm); + FSOpenFork ( &fs.fsref, resourceforkname.length, resourceforkname.unicode, fsRdWrPerm, &resfile ); if (ResError() == noErr) { @@ -1128,11 +1143,14 @@ (**hdll).resdata = *hRes; } - CloseResFile (resfile); + FSCloseFork ( resfile ); + } + #endif #ifdef WIN95VERSION + HRSRC frh; HGLOBAL rh; @@ -1152,7 +1170,7 @@ #endif return ((**hdll).hres != NULL); - } /*loadprocinforesource*/ + } // loadprocinforesource static void unloadprocinforesource (tydllinfohandle hdll) { @@ -1215,7 +1233,9 @@ "I Counter ;Count the next number\0", "\0\0" END - + + 2006-06-25 creedon: for Mac, FSRef-ized + */ typrocinfohandle hprocinfo; @@ -1232,12 +1252,18 @@ if (!loadprocinforesource (hdll)) { tyfilespec fs = (**hdll).fs; + bigstring bs; + getfsfile ( &fs, bs ); + if (bsprocname != nil) - lang2paramerror (cantfindprocinfoerror, bsprocname, fsname (&fs)); + + lang2paramerror (cantfindprocinfoerror, bsprocname, bs); + else - langparamerror (cantfindprocinfoloaderror, fsname (&fs)); + langparamerror (cantfindprocinfoloaderror, bs ); + return (false); } @@ -1380,7 +1406,7 @@ } /*removelibrary*/ -static tydllinfohandle getlibrary (const tyfilespec *fs) { +static tydllinfohandle getlibrary (const ptrfilespec fs) { /* Search linked list of stay-resident libraries for one with the given file path @@ -1401,7 +1427,7 @@ } /*getlibrary*/ -static tydllinfohandle newlibrary (const tyfilespec *fs) { +static tydllinfohandle newlibrary (const ptrfilespec fs) { /* Allocate and clear a handle for the library @@ -1441,70 +1467,84 @@ static boolean openlibrary (tydllinfohandle hdll) { - /* - Platform-specific code for loading the library code into memory - */ + // + // Platform-specific code for loading the library code into memory + // + // 2006-06-25 creedon: for Mac, FSRef-ized + // tyfilespec fs = (**hdll).fs; -#ifdef WIN95VERSION - - bigstring fn; - - #if (FRONTIERCOM == 1) - filefrompath ((ptrstring) fsname (&fs), fn); - - nullterminate(fn); - - if (stricmp (stringbaseaddress(fn), "COMDLL.DLL") == 0) { - - (**hdll).hdllsyshandle = (tydllsyshandle) COMStartup(); /*** FIXME: make sure we deal properly with the COM DLL ***/ + #ifdef WIN95VERSION + + bigstring fn; + + #if (FRONTIERCOM == 1) + filefrompath ((ptrstring) fsname (&fs), fn); + + nullterminate(fn); + + if (stricmp (stringbaseaddress(fn), "COMDLL.DLL") == 0) { - return ((**hdll).hdllsyshandle != nil); - } - #endif - - copystring (fsname (&fs), fn); + (**hdll).hdllsyshandle = (tydllsyshandle) COMStartup(); /*** FIXME: make sure we deal properly with the COM DLL ***/ + + return ((**hdll).hdllsyshandle != nil); + } + #endif - nullterminate(fn); - - (**hdll).hdllsyshandle = LoadLibrary (stringbaseaddress(fn)); - -#endif - -#ifdef MACVERSION - - long response; - OSErr err; - CFragConnectionID connID; - Ptr mainAddr; - Str255 errName; + copystring (fsname (&fs), fn); + + nullterminate(fn); - err = Gestalt (gestaltCFMAttr, &response); /* make sure we have the Code Fragment Manager (CFM) */ + (**hdll).hdllsyshandle = LoadLibrary (stringbaseaddress(fn)); - if ((err != noErr) || (response & (1 << gestaltCFMPresent)) == 0) - goto exit; + #endif - err = GetDiskFragment (&fs, 0, kCFragGoesToEOF, fsname (&fs), kReferenceCFrag, &connID, &mainAddr, errName); + #ifdef MACVERSION - if (err != noErr) - goto exit; + long response; + OSErr err; + CFragConnectionID connID; + Ptr mainAddr; + Str255 errName; - (**hdll).hdllsyshandle = connID; - -exit: - -#endif + err = Gestalt (gestaltCFMAttr, &response); /* make sure we have the Code Fragment Manager (CFM) */ + + if ((err != noErr) || (response & (1 << gestaltCFMPresent)) == 0) + goto exit; + + bigstring bs; + FSSpec fst; + + getfsfile ( &fs, bs ); + + FSRefMakeFSSpec ( &fs.fsref, &fst ); + + err = GetDiskFragment (&fst, 0, kCFragGoesToEOF, bs, kReferenceCFrag, &connID, &mainAddr, errName); + + if (err != noErr) + goto exit; + + (**hdll).hdllsyshandle = connID; + exit: + + #endif + if ((**hdll).hdllsyshandle == NULL) { - lang2paramerror (cantconnecttodllerror, bsfunctionname, fsname (&fs)); + bigstring bs; + getfsfile ( &fs, bs ); + + lang2paramerror (cantconnecttodllerror, bsfunctionname, bs ); + return (false); } return (true); - } /*openlibrary*/ + + } // openlibrary static void closelibrary (tydllinfohandle hdll) { @@ -1538,7 +1578,7 @@ } /*closelibrary*/ -static tydllinfohandle loadlibrary (const tyfilespec *fs) { +static tydllinfohandle loadlibrary (const ptrfilespec fs) { /* Load the library into memory and prepare it for use @@ -1713,32 +1753,38 @@ static boolean callprocwithparams (tydllinfohandle hdll, typrocinfohandle hprocinfo, tydllparamblock *params, tyvaluerecord *vreturned) { - /* - Call the library proc with the given set of parameters + // + // Call the library proc with the given set of parameters + // + // If the proc address hasn't been looked up yet, we do so now and save it for later + // + // After completing the call, we set up the result value or the error message + // + // 2006-06-25 creedon: for Mac, FSRef-ized + // - If the proc address hasn't been looked up yet, we do so now and save it for later - - After completing the call, we set up the result value or the error message - */ - boolean fl = false; - lockhandle ((Handle) hprocinfo); /* just to be sure our data doesn't move around */ + lockhandle ((Handle) hprocinfo); // just to be sure our data doesn't move around - /* If procaddress is undefined, look it up now and save it for future reference */ + // If procaddress is undefined, look it up now and save it for future reference if ((**hprocinfo).procaddress == nil) if (!lookupprocaddress (hdll, hprocinfo)) { + bigstring bs; + tyfilespec fs = (**hdll).fs; - lang2paramerror (cantfinddllfunctionerror, (**hprocinfo).bsprocname, fsname (&fs)); + getfsfile ( &fs, bs ); + + lang2paramerror (cantfinddllfunctionerror, (**hprocinfo).bsprocname, bs ); goto exit; } - /* Now release the thread globals, call the library proc, and grab the thread globals again */ + // Now release the thread globals, call the library proc, and grab the thread globals again releasethreadglobals (); @@ -1754,7 +1800,7 @@ grabthreadglobals (); - /* Set up the return value of the call or the error message */ + // Set up the return value of the call or the error message if (fl) { @@ -1788,7 +1834,8 @@ unlockhandle ((Handle) hprocinfo); return (fl); - } /*callprocwithparams*/ + + } // callprocwithparams static boolean callproc (hdltreenode hparam1, tydllinfohandle hdll, typrocinfohandle hprocinfo, tyvaluerecord *vreturned) { @@ -1855,7 +1902,7 @@ } /*callstayresident*/ -static boolean callvolatile (hdltreenode hparam1, const tyfilespec *fs, bigstring bsprocname, tyvaluerecord *vreturned) { +static boolean callvolatile (hdltreenode hparam1, const ptrfilespec fs, bigstring bsprocname, tyvaluerecord *vreturned) { /* Load the library just for this call, get the procinfo, make the call, and unload the library @@ -1901,7 +1948,7 @@ } /*callvolatile*/ -static boolean islibraryloaded (const tyfilespec *fs) { +static boolean islibraryloaded (const ptrfilespec fs) { /* Implements the dll.isloaded kernel verb @@ -1913,7 +1960,7 @@ } /*islibraryloaded*/ -static boolean dodllload (const tyfilespec *fs, tydllinfohandle *hdllptr) { +static boolean dodllload (const ptrfilespec fs, tydllinfohandle *hdllptr) { /* Implements dll.load kernel verb @@ -1948,7 +1995,7 @@ } /*dodllload*/ -static boolean dodllunload (const tyfilespec *fs) { +static boolean dodllunload (const ptrfilespec fs) { /* Implements dll.unload kernel verb @@ -1971,7 +2018,7 @@ } /*dodllunload*/ -static boolean dodllcall (hdltreenode hparam1, const tyfilespec *fs, bigstring bsprocname, tyvaluerecord *vreturned) { +static boolean dodllcall (hdltreenode hparam1, const ptrfilespec fs, bigstring bsprocname, tyvaluerecord *vreturned) { /* Implements the dll.call kernel verb @@ -2067,7 +2114,7 @@ //Changed to Opaque call for Carbon //I have to ask andre how to handle this stuff, this looks like plug in stuff. //This routine -static boolean getprocinfo (const tyfilespec *fs, bigstring bsprocname, tydllmoduleinfo *info) { +static boolean getprocinfo (const ptrfilespec fs, bigstring bsprocname, tydllmoduleinfo *info) { /* 5.0.2 dmb: added fs parameter for errror reporting @@ -2146,7 +2193,7 @@ } /*getprocinfo*/ -static boolean islibraryloaded (const tyfilespec *fs, Handle * hModule) { +static boolean islibraryloaded (const ptrfilespec fs, Handle * hModule) { #ifdef WIN95VERSION bigstring fn; @@ -2186,7 +2233,7 @@ } /*islibraryloaded*/ -static Handle doloadlibrary (const tyfilespec *fs, boolean flforce) { +static Handle doloadlibrary (const ptrfilespec fs, boolean flforce) { Handle hModule = NULL; @@ -2267,7 +2314,7 @@ } /*dofreelibrary*/ -static boolean loaddllmodule (const tyfilespec *fs, bigstring bsprocname, tydllmoduleinfo *info) { +static boolean loaddllmodule (const ptrfilespec fs, bigstring bsprocname, tydllmoduleinfo *info) { boolean fl = false; #ifdef WIN95VERSION Modified: Frontier/branches/FSRef_Migration/Common/source/langevaluate.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/langevaluate.c 2006-06-25 09:25:52 UTC (rev 1415) +++ Frontier/branches/FSRef_Migration/Common/source/langevaluate.c 2006-06-25 19:02:32 UTC (rev 1416) @@ -41,6 +41,12 @@ #include "osacomponent.h" #endif +#ifdef MACVERSION + + #include "MoreFilesX.h" + +#endif + #define fltryerrorstackcode false @@ -518,31 +524,41 @@ #endif static boolean fileloopguts (hdltreenode htree, ptrfilespec fsfolder, bigstring bsidentifier, long ctlevels, tyvaluerecord *valtree) { - /* - the core of fileloop evaluation, now recursive. + + // + // the core of fileloop evaluation, now recursive. + // + // if ctlevels is -1, do one level and process folders just like files. + // + // if ctlevels is not -1, only process files, and recurse for folders to the specified depth + // + // 2006-06-25 creedon: for Mac, minimally FSRef-ized + // + // 1992-10-08 dmb: break & return must kick out of all levels of recursion (whew!) + // - if ctlevels is -1, do one level and process folders just like files. - - if ctlevels is not -1, only process files, and recurse for folders - to the specified depth - - 10/8/92 dmb: break & return must kick out of all levels of recursion (whew!) - */ - register hdltreenode h = htree; register boolean fl; tyvaluerecord val; - tyfilespec fs; + tyfilespec fs = { { { 0 } }, 0 }; boolean flfolder; Handle hfileloop; + + + #ifdef MACVERSION -#ifdef MACVERSION - if (isemptystring ((*fsfolder).name)) /*loop over mounted volumes*/ - fl = diskinitloop (nil, &hfileloop); - else -#endif - fl = fileinitloop (fsfolder, nil, &hfileloop); + FSSpec fsfoldert; + FSRefMakeFSSpec ( &( *fsfolder ).fsref, &fsfoldert ); + + if ( isemptystring ( fsfoldert.name ) ) /*loop over mounted volumes*/ + fl = diskinitloop (nil, &hfileloop); + else + + #endif + + fl = fileinitloop (fsfolder, nil, &hfileloop); + if (!fl) return (false); @@ -632,19 +648,8 @@ assert (!leakingmemory (&val)); - #if TARGET_API_MAC_CARBON == 1 /*PBS 10/03/01: fix crashing bug copying filespecs*/ - - fsfolder.vRefNum = (**val.data.filespecvalue).vRefNum; - fsfolder.parID = (**val.data.filespecvalue).parID; - - copystring ((**val.data.filespecvalue).name, fsfolder.name); - - #else - fsfolder = **val.data.filespecvalue; - #endif - if (!langgetidentifier ((**h).param1, bsidentifier)) return (false); Modified: Frontier/branches/FSRef_Migration/Common/source/langexternal.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/langexternal.c 2006-06-25 09:25:52 UTC (rev 1415) +++ Frontier/branches/FSRef_Migration/Common/source/langexternal.c 2006-06-25 19:02:32 UTC (rev 1416) @@ -524,9 +524,11 @@ boolean langexternalregisterwindow (hdlexternalvariable hv) { - /* - 5.1.5b10 dmb: even if windowgetpath fails, the fspec has the (unsaved) default name - */ + // + // 2006-06-25 creedon: replace copystring with getfsfile + // + // 5.1.5b10 dmb: even if windowgetpath fails, the fspec has the (unsaved) default name + // hdlwindowinfo hinfo; WindowPtr w; @@ -549,7 +551,7 @@ windowgetfspec (w, &fs); - copystring (fsname (&fs), bsname); + getfsfile ( &fs, bsname); //shellgetwindowtitle (hinfo, bsname); } @@ -562,9 +564,11 @@ boolean langexternalunregisterwindow (hdlwindowinfo hinfo) { - /* - 5.1.5b10 dmb: even if windowgetpath fails, the fspec has the (unsaved) default name - */ + // + // 2006-06-25 creedon: replace copystring with getfsfile + // + // 5.1.5b10 dmb: even if windowgetpath fails, the fspec has the (unsaved) default name + // tyfilespec fs; bigstring bsname; @@ -580,7 +584,7 @@ windowgetfspec (w, &fs); - copystring (fsname (&fs), bsname); + getfsfile ( &fs, bsname ); //shellgetwindowtitle (hinfo, bsname); } @@ -1884,7 +1888,7 @@ } /*langexternalgetexternalparam*/ -static boolean langexternaledit (hdlexternalvariable hv, hdlwindowinfo hparent, tyfilespec *fs, bigstring bstitle, const Rect *rzoom) { +static boolean langexternaledit (hdlexternalvariable hv, hdlwindowinfo hparent, ptrfilespec fs, bigstring bstitle, const Rect *rzoom) { /* 6.16.97 dmb: the guts of langexternalzoom[from|filewindow] @@ -2113,7 +2117,7 @@ } /*langexternalzoom*/ -boolean langexternalzoomfilewindow (const tyvaluerecord *val, tyfilespec *fs, boolean flhidden) { +boolean langexternalzoomfilewindow (const tyvaluerecord *val, ptrfilespec fs, boolean flhidden) { /* create and open a new window containing the file-based external value in val. Modified: Frontier/branches/FSRef_Migration/Common/source/langvalue.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/langvalue.c 2006-06-25 09:25:52 UTC (rev 1415) +++ Frontier/branches/FSRef_Migration/Common/source/langvalue.c 2006-06-25 19:02:32 UTC (rev 1416) @@ -5188,7 +5188,7 @@ } /*getostypevalue*/ -boolean getfilespecvalue ( hdltreenode hfirst, short pnum, tyfilespec *fsval ) { +boolean getfilespecvalue ( hdltreenode hfirst, short pnum, ptrfilespec fsval ) { tyvaluerecord val; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |