|
From: <cre...@us...> - 2006-07-15 22:17:43
|
Revision: 1463 Author: creecode Date: 2006-07-15 15:17:37 -0700 (Sat, 15 Jul 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1463&view=rev Log Message: ----------- tweaks to get Windows working minor formatting tweaks Modified Paths: -------------- Frontier/branches/FSRef_Migration/Common/source/FrontierWinMain.c Frontier/branches/FSRef_Migration/Common/source/fileops.c Frontier/branches/FSRef_Migration/Common/source/filepath.c Frontier/branches/FSRef_Migration/Common/source/fileverbs.c Frontier/branches/FSRef_Migration/Common/source/langdll.c Frontier/branches/FSRef_Migration/Common/source/langevaluate.c Modified: Frontier/branches/FSRef_Migration/Common/source/FrontierWinMain.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/FrontierWinMain.c 2006-07-15 22:17:05 UTC (rev 1462) +++ Frontier/branches/FSRef_Migration/Common/source/FrontierWinMain.c 2006-07-15 22:17:37 UTC (rev 1463) @@ -3108,7 +3108,7 @@ //#endif - #if (FRONTIERCOM == 1) +#if (FRONTIERCOM == 1) gcomServerInfo.hInstance = hInstance; gcomServerInfo.hPrevInstance = hPrevInstance; gcomServerInfo.lpCmdLine = lpCmdLine; @@ -3174,7 +3174,7 @@ hInst = hInstance; shellinstance = hInstance; - /* If this is the first instance of the app. register window classes */ + /* If this is the first instance of the app. register window classes */ if (!hPrevInstance) { if (!InitializeApplication ()) return 0; Modified: Frontier/branches/FSRef_Migration/Common/source/fileops.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/fileops.c 2006-07-15 22:17:05 UTC (rev 1462) +++ Frontier/branches/FSRef_Migration/Common/source/fileops.c 2006-07-15 22:17:37 UTC (rev 1463) @@ -716,6 +716,15 @@ static boolean filegetfsvolumeinfo (const ptrfilespec fs, tyfileinfo *info) { + #ifdef WIN95VERSION + + DWORD sectorsPerCluster, bytesPerSector, numberOfFreeClusters, totalNumberOfClusters; + UINT drivetype; + bigstring volname; + bigstring errmsg; + + #endif // WIN95VERSION + clearbytes (info, sizeof (tyfileinfo)); // init all fields to zero #ifdef MACVERSION @@ -729,15 +738,10 @@ return ( true ); - #endif + #endif // MACVERSION #ifdef WIN95VERSION - DWORD sectorsPerCluster, bytesPerSector, numberOfFreeClusters, totalNumberOfClusters; - UINT drivetype; - bigstring volname; - bigstring errmsg; - if (fileisvolume (fs)) { info->flvolume = true; info->flbusy = true; @@ -2237,6 +2241,12 @@ // 6.1b16 AR: Return number of free bytes and total number of bytes for the volume. // + #ifdef WIN95VERSION + + bigstring volname; + + #endif // WIN95VERSION + *totalbytes = 0.0; *freebytes = 0.0; @@ -2266,13 +2276,10 @@ *totalbytes = (double) volinfo.totalBytes; *freebytes = (double) volinfo.freeBytes; - #endif + #endif // MACVERSION - #ifdef WIN95VERSION - bigstring volname; - getfsfile ( fs, volname); cleanendoffilename (volname); @@ -2891,43 +2898,26 @@ convertpstring ( bsvolname ); - errstatus = FSPathMakeRef ( bsvolname, &fs -> fsref, NULL ); + errstatus = FSPathMakeRef ( bsvolname, &( *fs ).fsref, NULL ); #endif #ifdef WIN95VERSION - bigstring bsvolname, bs; short ix = 0; - fs.volumeID = 0; + if ( isemptystring ( bspath ) ) + return ( false ); - copystring (bspath, bs); /*work on a copy*/ + if ( ! scanstring ( ':', bspath, &ix ) ) // no colon, No volume? + return ( false ); + else + midstring ( bspath, 1, ix, ( *fs ).fullSpecifier ); // pick off the vol name and the colon - if (isemptystring (bs)) - return (false); - - if (!scanstring (':', bs, &ix)) { /*no colon, No volume?*/ - return (false); - } - else { - midstring (bs, 1, ix, bsvolname); /*pick off the vol name and the colon*/ - - deletestring (bs, 1, ix); - } - - if (bsvol != nil) - { - copystring (bsvolname, bsvol); - - nullterminate (bsvol); - } - - copystring (bsvol, fs.fullSpecifier) - #endif - return (true); + return ( true ); + } // fileparsevolname @@ -3174,12 +3164,11 @@ // boolean flfolder; + bigstring bs; if (fileexists (fs, &flfolder)) return (true); - bigstring bs; - getfsfile ( fs, bs ); filenotfounderror ( bs ); Modified: Frontier/branches/FSRef_Migration/Common/source/filepath.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/filepath.c 2006-07-15 22:17:05 UTC (rev 1462) +++ Frontier/branches/FSRef_Migration/Common/source/filepath.c 2006-07-15 22:17:37 UTC (rev 1463) @@ -271,6 +271,12 @@ // non-existant files, we don't give up right away. // + #ifdef WIN95VERSION + + bigstring bsfolder; + + #endif // WIN95VERSION + clearbytes ( fs, sizeof ( *fs ) ); if ( isemptystring ( bspath ) ) @@ -401,8 +407,6 @@ #ifdef WIN95VERSION - bigstring bsfolder; - copystring (bspath, fsname (fs)); folderfrompath (bspath, bsfolder); @@ -417,6 +421,7 @@ nullterminate (fsname (fs)); return (true); + #endif } // pathtofilespec @@ -508,10 +513,10 @@ } // getfsfile -boolean getfsvolume (const ptrfilespec fs, long *vnum) { +boolean getfsvolume ( const ptrfilespec fs, long *vnum ) { // - // 2006-06-25 creedon: for Mac, FSRef-ized + // 2006-07-12 creedon: for Mac, FSRef-ized // // 5.1.5b11 dmb: get the volume that is actually specified in the fspec. // @@ -521,7 +526,7 @@ #ifdef MACVERSION FSCatalogInfo catalogInfo; - OSErr err = FSGetCatalogInfo ( &fs->fsref, kFSCatInfoVolume, &catalogInfo, NULL, NULL, NULL ); + OSErr err = FSGetCatalogInfo ( &( *fs ).fsref, kFSCatInfoVolume, &catalogInfo, NULL, NULL, NULL ); if ( catalogInfo.volume == 0 ) return ( false ); @@ -533,12 +538,14 @@ #endif #ifdef WIN95VERSION + + *vnum = 0; - return (fileparsevolname ((ptrstring) fsname (fs), vnum, nil)); + return ( true ); #endif - } /* getfsvolume */ + } // getfsvolume void initfsdefault (void) { Modified: Frontier/branches/FSRef_Migration/Common/source/fileverbs.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/fileverbs.c 2006-07-15 22:17:05 UTC (rev 1462) +++ Frontier/branches/FSRef_Migration/Common/source/fileverbs.c 2006-07-15 22:17:37 UTC (rev 1463) @@ -2703,17 +2703,17 @@ // created, factored from filefunctionvalue function // - tyfilespec fs, fst; + tyfilespec fs; flnextparamislast = true; if ( ! getfilespecvalue ( hp1, 1, &fs ) ) return ( false ); - if ( ! extendfilespec ( &fs, &fst ) ) + if ( ! extendfilespec ( &fs, &fs ) ) return ( false ); - if ( ! deletefile ( &fst ) ) + if ( ! deletefile ( &fs ) ) return ( false ); return ( setbooleanvalue ( true, vreturned ) ); @@ -3387,11 +3387,17 @@ case newfunc: { tyfilespec fs; + + #ifdef WIN95VERSION + boolean flfolder; + + #endif // WIN95VERSION + flnextparamislast = true; if ( ! getfilespecvalue ( hp1, 1, &fs ) ) - break; + break; #ifdef MACVERSION @@ -3405,8 +3411,6 @@ #ifdef WIN95VERSION - boolean flfolder; - if (fileexists (&fs, &flfolder)) { // 8/25/92 dmb if (!deletefile (&fs)) @@ -3888,7 +3892,7 @@ byte bsvol [258]; // 2 byte bsfolder [258]; // 6 - tyfilespec fs = { { { 0 } }, 0 }; + tyfilespec fs; if (!langcheckparamcount (hp1, 0)) /*no parameters expected*/ break; @@ -3901,7 +3905,9 @@ #else - setemptystring (bsvol); + setemptystring (bsvol); + + clearbytes ( &fs, sizeof ( fs ) ); #ifdef MACVERSION @@ -3926,7 +3932,7 @@ case getspecialpathfunc: { bigstring bsvol, bsfolder; - tyfilespec fs = { { { 0 } }, 0 }; + tyfilespec fs; boolean flcreate; if (!getstringvalue (hp1, 1, bsvol)) @@ -3940,6 +3946,8 @@ if (!getbooleanvalue (hp1, 3, &flcreate)) break; + clearbytes ( &fs, sizeof ( fs ) ); + if (!getspecialfolderpath (bsvol, bsfolder, flcreate, &fs)) break; @@ -3949,11 +3957,13 @@ case getmp3infofunc: { long seconds, bitrate, frequency, offset; - tyfilespec fs = { { { 0 } }, 0 }; + tyfilespec fs; boolean fl, flvariablebitrate; if (!langcheckparamcount (hparam1, 6)) /*preflight before changing values*/ return (false); + + clearbytes ( &fs, sizeof ( fs ) ); if (!getpathvalue (hp1, 1, &fs)) return (false); @@ -4151,3 +4161,4 @@ return (true); }/*filestart*/ + Modified: Frontier/branches/FSRef_Migration/Common/source/langdll.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/langdll.c 2006-07-15 22:17:05 UTC (rev 1462) +++ Frontier/branches/FSRef_Migration/Common/source/langdll.c 2006-07-15 22:17:37 UTC (rev 1463) @@ -1009,6 +1009,7 @@ // 2006-06-25 creedon: for Mac, FSRef-ized // + bigstring bs; typrocinfohandle hnomad; tyfilespec fs = (**hdll).fs; long ixhashbucket; @@ -1031,8 +1032,6 @@ hnomad = (**hnomad).hashlink; } // while - bigstring bs; - getfsfile ( &fs, bs ); lang2paramerror (cantfindprocinfofunctionerror, bsprocname, bs ); @@ -2851,3 +2850,4 @@ fillcalltable (dllcallbacks); } } /*initdllverbs*/ + Modified: Frontier/branches/FSRef_Migration/Common/source/langevaluate.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/langevaluate.c 2006-07-15 22:17:05 UTC (rev 1462) +++ Frontier/branches/FSRef_Migration/Common/source/langevaluate.c 2006-07-15 22:17:37 UTC (rev 1463) @@ -544,11 +544,12 @@ register hdltreenode h = htree; register boolean fl; tyvaluerecord val; - tyfilespec fs = { { { 0 } }, 0 }; + tyfilespec fs; boolean flfolder; Handle hfileloop; + + clearbytes ( &fs, sizeof ( fs ) ); - #ifdef MACVERSION FSSpec fst; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |