-
-//*******************************************************************************
-// Routine: LocateCatalogNode
-//
-// Function: Locates the catalog record for an existing folder or file
-// CNode and returns pointers to the key and data records.
-//
-//*******************************************************************************
-
-OSErr
-LocateCatalogNode(const ExtendedVCB *volume, HFSCatalogNodeID folderID, const CatalogName *name,
- UInt32 hint, CatalogKey *keyPtr, CatalogRecord *dataPtr, UInt32 *newHint)
-{
- OSErr result;
- CatalogName *nodeName = NULL; /* To ward off uninitialized use warnings from compiler */
- HFSCatalogNodeID threadParentID;
-
-
- result = LocateCatalogRecord(volume, folderID, name, hint, keyPtr, dataPtr, newHint);
- ReturnIfError(result);
-
- // if we got a thread record, then go look up real record
- switch ( dataPtr->recordType )
- {
- case kHFSFileThreadRecord:
- case kHFSFolderThreadRecord:
- threadParentID = dataPtr->hfsThread.parentID;
- nodeName = (CatalogName *) &dataPtr->hfsThread.nodeName;
- break;
-
- case kHFSPlusFileThreadRecord:
- case kHFSPlusFolderThreadRecord:
- threadParentID = dataPtr->hfsPlusThread.parentID;
- nodeName = (CatalogName *) &dataPtr->hfsPlusThread.nodeName;
- break;
-
- default:
- threadParentID = 0;
- break;
- }
-
- if ( threadParentID ) // found a thread
- result = LocateCatalogRecord(volume, threadParentID, nodeName, kNoHint, keyPtr, dataPtr, newHint);
-
- return result;
-}
-