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