|
From: Andre R. <and...@us...> - 2004-10-23 22:17:30
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32760/Frontier/Common/source Modified Files: file.c Log Message: Sanitized global includes. Include frontier.h in all source files. Move inclusion of system header files into osincludes.h. Index: file.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/file.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** file.c 9 Oct 2004 07:21:57 -0000 1.1 --- file.c 23 Oct 2004 22:17:19 -0000 1.2 *************** *** 24,40 **** ******************************************************************************/ ! #ifdef MACVERSION ! #include <Files.h> ! #include <Folders.h> ! #include <Gestalt.h> ! #include <Script.h> ! #include <StandardFile.h> ! #include <standard.h> ! #include "MoreFilesExtras.h" ! #endif ! ! ! #ifdef WIN95VERSION #include "standard.h" #endif --- 24,36 ---- ******************************************************************************/ ! #include "frontier.h" #include "standard.h" + + #ifdef MACVERSION + #if TARGET_API_MAC_CARBON + #include "MoreFilesX.h" + #else + #include "MoreFilesExtras.h" + #endif #endif *************** *** 427,461 **** #ifdef MACVERSION //Code change by Timothy Paustian Monday, June 19, 2000 3:15:01 PM //Changed to Opaque call for Carbon ! #if TARGET_RT_MAC_CFM ! static pascal void iocompletion (ParmBlkPtr pb) { ! ! DisposePtr ((Ptr) pb); ! } /*iocompletion*/ ! #if !TARGET_API_MAC_CARBON ! static RoutineDescriptor iocompletionDesc = BUILD_ROUTINE_DESCRIPTOR (uppIOCompletionProcInfo, iocompletion); ! ! #define iocompletionUPP (&iocompletionDesc) #else ! //looks like we need some kind of file UPP ! //do we need to create a UPP, yes we do. ! IOCompletionUPP iocompletionDesc = nil; ! #define iocompletionUPP (iocompletionDesc) #endif ! #else ! ! static pascal void iocompletion (ParmBlkPtr pb : __A0) { ! ! DisposePtr ((Ptr) pb); ! } /*iocompletion*/ ! ! #define iocompletionUPP ((Register68kProcPtr) iocompletion) - #endif //TARGET_RT_MAC_CFM #endif //MACVERSION --- 423,451 ---- #ifdef MACVERSION + //Code change by Timothy Paustian Monday, June 19, 2000 3:15:01 PM //Changed to Opaque call for Carbon ! static pascal void iocompletion (ParmBlkPtr pb) { ! DisposePtr ((Ptr) pb); ! } /*iocompletion*/ ! ! #if TARGET_RT_MAC_CFM #if !TARGET_API_MAC_CARBON ! static RoutineDescriptor iocompletionDesc = BUILD_ROUTINE_DESCRIPTOR (uppIOCompletionProcInfo, iocompletion); ! #define iocompletionUPP (&iocompletionDesc) #else ! //looks like we need some kind of file UPP ! //do we need to create a UPP, yes we do. ! IOCompletionUPP iocompletionDesc = nil; ! #define iocompletionUPP (iocompletionDesc) #endif + #endif /*TARGET_RT_MAC_CFM*/ ! #if TARGET_RT_MAC_MACHO ! static IOCompletionUPP iocompletionUPP = &iocompletion; ! #endif /*TARGET_RT_MAC_MACHO*/ #endif //MACVERSION *************** *** 493,497 **** void fileinit() { ! #if TARGET_API_MAC_CARBON == 1 if(iocompletionDesc == nil) iocompletionDesc = NewIOCompletionUPP(iocompletion); --- 483,487 ---- void fileinit() { ! #if TARGET_API_MAC_CARBON && TARGET_RT_MAC_CFM if(iocompletionDesc == nil) iocompletionDesc = NewIOCompletionUPP(iocompletion); *************** *** 501,505 **** void fileshutdown() { ! #if TARGET_API_MAC_CARBON == 1 if(iocompletionDesc != nil) DisposeIOCompletionUPP(iocompletionDesc); --- 491,495 ---- void fileshutdown() { ! #if TARGET_API_MAC_CARBON && TARGET_RT_MAC_CFM if(iocompletionDesc != nil) DisposeIOCompletionUPP(iocompletionDesc); *************** *** 526,543 **** } ! #if TARGET_API_MAC_CARBON == 1 ! { ! FSRef myRef; ! // Update the finder ! // I don't have it using the oserror function yet because I don't quite understand ! // all of the inctricacies of the oserror function. err = FSpMakeFSRef (fs,&myRef); ! // take that, rewind it back... ! FSpSetNameLocked(&fs); ! FSGetCatalogInfo (&myRef,kFSCatInfoNone,NULL,NULL,NULL,&myRef); ! if (err==noErr) err = FNNotify(&myRef, kFNDirectoryModifiedMessage, kNilOptions); ! // end updating the finder. ! } ! #endif return (true); --- 516,527 ---- } ! #if TARGET_API_MAC_CARBON ! { ! FSRef myRef; err = FSpMakeFSRef (fs,&myRef); ! if (!err) ! FSSetNameLocked(&myRef); ! } ! #endif return (true); *************** *** 576,580 **** if (FSpOpenDF (fs, fsRdWrPerm, fnum) == noErr) { /*file exists and is open*/ ! FSpSetNameLocked(&fs); return (true); } --- 560,570 ---- if (FSpOpenDF (fs, fsRdWrPerm, fnum) == noErr) { /*file exists and is open*/ ! #if TARGET_API_MAC_CARBON ! FSRef myRef; ! if (FSpMakeFSRef (fs,&myRef)) ! FSSetNameLocked(&myRef); ! #else ! FSpSetNameLocked(&fs); ! #endif return (true); } *************** *** 652,656 **** return (false); } ! err = FSpSetNameLocked(fs); if (err!=noErr){ //sprintf(s,"error locking file name: %d",err); --- 642,656 ---- return (false); } ! #if TARGET_API_MAC_CARBON ! { ! FSRef myRef; ! err = FSpMakeFSRef (fs,&myRef); ! if (!err) ! err = FSSetNameLocked(&myRef); ! } ! #else ! err = FSpSetNameLocked(fs); ! #endif ! if (err!=noErr){ //sprintf(s,"error locking file name: %d",err); *************** *** 703,707 **** #ifdef MACVERSION OSStatus err = noErr; - FSSpec fs; // char s[256]; --- 703,706 ---- *************** *** 711,723 **** if (fnum != 0) { ! err = FSpGetFileLocation(fnum,&fs); ! if (err==noErr) FSpClearNameLocked(&fs); ! else { ! //sprintf(s,"Error is %d",err); ! //WriteToConsole(s); ! } return (!oserror (FSClose (fnum))); ! ! } return (true); --- 710,733 ---- if (fnum != 0) { ! #if TARGET_API_MAC_CARBON ! FSRef myRef; ! err = FileRefNumGetFSRef (fnum, &myRef); ! if (err == noErr) { ! FSClearNameLocked (&myRef); ! } ! #else ! FSSpec fs; ! err = FSpGetFileLocation (fnum,&fs); ! if (err==noErr) { ! FSpClearNameLocked (&fs); ! } ! #endif ! else { ! //sprintf(s,"Error is %d",err); ! //WriteToConsole(s); ! } ! return (!oserror (FSClose (fnum))); ! } return (true); *************** *** 750,754 **** #ifdef MACVERSION setfserrorparam (fs); /*in case error message takes a filename parameter*/ ! FSpClearNameLocked(&fs); return (!oserror (FSpDelete (fs))); #endif --- 760,772 ---- #ifdef MACVERSION setfserrorparam (fs); /*in case error message takes a filename parameter*/ ! #if TARGET_API_MAC_CARBON ! { ! FSRef myRef; ! if (FSpMakeFSRef (fs,&myRef)) ! FSClearNameLocked(&myRef); ! } ! #else ! FSpClearNameLocked(fs); ! #endif return (!oserror (FSpDelete (fs))); #endif |