Lines Matching defs:theGlobals

218 static OSErr 		FSCopyFolderLevel( FSCopyObjectGlobals *theGlobals, const HFSUniStr255 *destName );
287 FSDeleteObjectGlobals *theGlobals);
624 FSCopyObjectGlobals theGlobals;
626 theGlobals.ref = *source;
627 theGlobals.destRef = *destDir;
628 theGlobals.copyParams = copyParams;
629 theGlobals.filterParams = filterParams;
630 theGlobals.maxLevels = maxLevels;
631 theGlobals.currentLevel = 0;
632 theGlobals.quitFlag = false;
633 theGlobals.containerChanged = false;
634 theGlobals.result = ( source != NULL && destDir != NULL &&
637 theGlobals.actualObjects = 0;
640 if( theGlobals.result == noErr )
641 theGlobals.result = FSCopyFolderLevel(&theGlobals, destName);
643 if( theGlobals.result == noErr && newDir != NULL)
644 *newDir = theGlobals.ref;
650 (void) CallCopyObjectFilterProc(filterParams->filterProcPtr, theGlobals.containerChanged,
651 theGlobals.currentLevel, theGlobals.result, &theGlobals.catalogInfo,
652 &theGlobals.ref, filterParams->fileSpecPtr,
656 mycheck_noerr(theGlobals.result); // put up debug assert in debug builds
658 return ( theGlobals.result );
663 OSErr FSCopyFolderLevel( FSCopyObjectGlobals *theGlobals, const HFSUniStr255 *destName )
667 if ( (theGlobals->maxLevels == 0) ||
668 (theGlobals->currentLevel < theGlobals->maxLevels) )
674 FilterParams *filterPtr = theGlobals->filterParams;
677 theGlobals->result = FSGetCatalogInfo( &theGlobals->ref, filterPtr->whichInfo,
678 &theGlobals->catalogInfo, &filterPtr->fileName,
681 if (theGlobals->currentLevel == 0 && destName)
685 ((FInfo *)(theGlobals->catalogInfo.finderInfo))->fdFlags &= ~kHasBeenInited;
694 if ( theGlobals->result == noErr && !theGlobals->copyParams->copyingToDropFolder)
696 originalCreateDate = theGlobals->catalogInfo.createDate;
697 theGlobals->catalogInfo.createDate = theGlobals->copyParams->magicBusyCreateDate;
703 originalPermissions = *((FSPermissionInfo*)theGlobals->catalogInfo.permissions);
704 ((FSPermissionInfo*)theGlobals->catalogInfo.permissions)->mode |= kRWXUserAccessMask;
707 if( theGlobals->result == noErr )
709 theGlobals->result = FSCreateDirectoryUnicode( &theGlobals->destRef, filterPtr->fileName.length,
711 &theGlobals->catalogInfo, &newDirRef,
715 ++theGlobals->currentLevel; // setup to go to the next level
719 if( theGlobals->result == noErr )
720 theGlobals->result = CopyItemsForks(&theGlobals->ref, &newDirRef, theGlobals->copyParams);
721 if( theGlobals->result == noErr ) // Open FSIterator for flat access to theGlobals->ref
722 theGlobals->result = FSOpenIterator(&theGlobals->ref, kFSIterateFlat, &iterator);
723 if( theGlobals->result == noErr )
730 theGlobals->result = FSGetCatalogInfoBulk( iterator, 1, &theGlobals->actualObjects,
731 &theGlobals->containerChanged, filterPtr->whichInfo,
732 &theGlobals->catalogInfo, &theGlobals->ref,
734 if ( ( (theGlobals->result == noErr) || (theGlobals->result == errFSNoMoreItems) ) &&
735 ( theGlobals->actualObjects != 0 ) )
742 if ( (theGlobals->catalogInfo.nodeFlags & kFSNodeIsDirectoryMask) != 0 )
744 theGlobals->destRef = newDirRef;
745 osErr = FSCopyFolderLevel(theGlobals, NULL);
746 theGlobals->result = noErr; // don't want one silly mistake to kill the party...
750 osErr = CopyFile( &theGlobals->ref, &theGlobals->catalogInfo,
752 theGlobals->copyParams, &theGlobals->ref);
756 if( filterPtr->filterProcPtr != NULL && !theGlobals->quitFlag )
758 theGlobals->quitFlag = CallCopyObjectFilterProc(filterPtr->filterProcPtr,
759 theGlobals->containerChanged, theGlobals->currentLevel,
760 osErr, &theGlobals->catalogInfo,
761 &theGlobals->ref, filterPtr->fileSpecPtr,
765 } while ( ( theGlobals->result == noErr ) && ( !theGlobals->quitFlag ) );
773 if ( (theGlobals->result == errFSNoMoreItems) || (theGlobals->result == afpAccessDenied) )
774 theGlobals->result = noErr;
778 if( theGlobals->result == noErr )
780 theGlobals->ref = newDirRef;
781 theGlobals->result = FSGetCatalogInfo(&newDirRef, kFSCatInfoNone, NULL,
786 --theGlobals->currentLevel;
790 if (theGlobals->result == noErr && ! theGlobals->copyParams->copyingToDropFolder)
792 theGlobals->catalogInfo.createDate = originalCreateDate;
793 *((FSPermissionInfo*)theGlobals->catalogInfo.permissions) = originalPermissions;
794 theGlobals->result = FSSetCatalogInfo(&newDirRef, kFSCatInfoCreateDate
797 | kFSCatInfoPermissions, &theGlobals->catalogInfo);
806 if( theGlobals->result != noErr && theGlobals->result != dupFNErr )
810 mycheck_noerr( theGlobals->result ); // put up debug assert in debug builds
812 return theGlobals->result;
1419 FSDeleteObjectGlobals theGlobals;
1421 theGlobals.result = ( container != NULL ) ? noErr : paramErr;
1424 if( theGlobals.result == noErr )
1425 FSDeleteFolderLevel(container, &theGlobals);
1427 mycheck_noerr( theGlobals.result );
1429 return ( theGlobals.result );
1435 FSDeleteObjectGlobals *theGlobals)
1442 theGlobals->result = FSOpenIterator(container, kFSIterateFlat + kFSIterateDelete, &iterator);
1443 if ( theGlobals->result == noErr )
1448 theGlobals->result = FSGetCatalogInfoBulk( iterator, 1, &theGlobals->actualObjects,
1449 NULL, kFSCatInfoNodeFlags, &theGlobals->catalogInfo,
1451 if ( (theGlobals->result == noErr) && (theGlobals->actualObjects == 1) )
1454 nodeFlags = theGlobals->catalogInfo.nodeFlags;
1459 FSDeleteFolderLevel(&itemToDelete, theGlobals);
1461 if ( theGlobals->result == noErr) // are we still OK to delete?
1465 theGlobals->catalogInfo.nodeFlags = nodeFlags & ~kFSNodeLockedMask;
1466 (void) FSSetCatalogInfo(&itemToDelete, kFSCatInfoNodeFlags, &theGlobals->catalogInfo);
1469 theGlobals->result = FSDeleteObject(&itemToDelete);
1472 } while ( theGlobals->result == noErr );
1475 if ( theGlobals->result == errFSNoMoreItems )
1476 theGlobals->result = noErr;
1482 mycheck_noerr( theGlobals->result );