]> git.saurik.com Git - apple/xnu.git/blame - bsd/hfs/hfscommon/Misc/BTreeWrapper.c
xnu-344.49.tar.gz
[apple/xnu.git] / bsd / hfs / hfscommon / Misc / BTreeWrapper.c
Content-type: text/html ]> git.saurik.com Git - apple/xnu.git/blame - bsd/hfs/hfscommon/Misc/BTreeWrapper.c


500 - Internal Server Error

Malformed UTF-8 character (fatal) at /usr/lib/x86_64-linux-gnu/perl5/5.38/HTML/Entities.pm line 485, <$fd> line 173.
CommitLineData
1c79356b 1/*
9bccf70c 2 * Copyright (c) 2000,2002 Apple Computer, Inc. All rights reserved.
1c79356b
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
43866e37 6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
1c79356b 7 *
43866e37
A
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1c79356b
A
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
43866e37
A
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
1c79356b
A
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
1c79356b
A
25
26#include "../headers/BTreesPrivate.h"
27
28
1c79356b
A
29// local routines
30static OSErr CheckBTreeKey(const BTreeKey *key, const BTreeControlBlock *btcb);
31static Boolean ValidHFSRecord(const void *record, const BTreeControlBlock *btcb, UInt16 recordSize);
32
33
34
35
36OSErr SearchBTreeRecord(FileReference refNum, const void* key, UInt32 hint, void* foundKey, void* data, UInt16 *dataSize, UInt32 *newHint)
37{
9bccf70c
A
38 panic("SearchBTreeRecord is dead code!");
39 return (-1);
40#if 0
1c79356b
A
41 FSBufferDescriptor btRecord;
42 BTreeIterator searchIterator;
43 FCB *fcb;
44 BTreeControlBlock *btcb;
45 OSStatus result;
46
47
48 fcb = GetFileControlBlock(refNum);
49 btcb = (BTreeControlBlock*) fcb->fcbBTCBPtr;
50
51 btRecord.bufferAddress = data;
52 btRecord.itemCount = 1;
53 if ( btcb->maxKeyLength == kHFSExtentKeyMaximumLength )
54 btRecord.itemSize = sizeof(HFSExtentRecord);
55 else if ( btcb->maxKeyLength == kHFSPlusExtentKeyMaximumLength )
56 btRecord.itemSize = sizeof(HFSPlusExtentRecord);
57 else
58 btRecord.itemSize = sizeof(CatalogRecord);
59
60 searchIterator.hint.writeCount = 0; // clear these out for debugging...
61 searchIterator.hint.reserved1 = 0;
62 searchIterator.hint.reserved2 = 0;
63
64 searchIterator.hint.nodeNum = hint;
65 searchIterator.hint.index = 0;
66
67 result = CheckBTreeKey((BTreeKey *) key, btcb);
68 ExitOnError(result);
69
70