|
From: <cre...@us...> - 2006-07-04 07:43:47
|
Revision: 1443 Author: creecode Date: 2006-07-04 00:43:44 -0700 (Tue, 04 Jul 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1443&view=rev Log Message: ----------- fixed getmachinename function to work on Mac OS X Modified Paths: -------------- Frontier/branches/FSRef_Migration/Common/source/fileops.c Modified: Frontier/branches/FSRef_Migration/Common/source/fileops.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/fileops.c 2006-07-04 07:42:05 UTC (rev 1442) +++ Frontier/branches/FSRef_Migration/Common/source/fileops.c 2006-07-04 07:43:44 UTC (rev 1443) @@ -192,14 +192,28 @@ boolean getmachinename (bigstring bsname) { + // + // 2006-05-15 creedon: fix to work on Mac OS X + // + boolean fl; + #ifdef MACVERSION + + fl = CFStringGetPascalString (CSCopyMachineName (), bsname, sizeof (bigstring), kCFStringEncodingMacRoman); + + if (!fl) + setemptystring (bsname); + + #endif + #ifdef WIN95VERSION + DWORD len; - len = sizeof(bigstring) - 2; + len = sizeof (bigstring) - 2; - fl = GetComputerName (stringbaseaddress(bsname), &len); + fl = GetComputerName (stringbaseaddress (bsname), &len); if (fl) setstringlength (bsname, len); @@ -207,19 +221,9 @@ setemptystring (bsname); #endif - #ifdef MACVERSION - StringHandle hstring = GetString (-16413); - - fl = hstring != nil; - - if (fl) - texthandletostring ((Handle) hstring, bsname); - else - setemptystring (bsname); - #endif - return (fl); - } /*getmachinename*/ + + } // getmachinename #ifdef MACVERSION This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |