|
|
1.1 root 1: /*
2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7: * Reserved. This file contains Original Code and/or Modifications of
8: * Original Code as defined in and that are subject to the Apple Public
9: * Source License Version 1.1 (the "License"). You may not use this file
10: * except in compliance with the License. Please obtain a copy of the
11: * License at http://www.apple.com/publicsource and read it before using
12: * this file.
13: *
14: * The Original Code and all software distributed under the License are
15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19: * License for the specific language governing rights and limitations
20: * under the License.
21: *
22: * @APPLE_LICENSE_HEADER_END@
23: */
24:
25: /*
26: File: BTreeScanner.h
27:
28: Contains: xxx put contents here xxx
29:
30: Version: xxx put version here xxx
31:
32: Copyright: � 1997 by Apple Computer, Inc., all rights reserved.
33:
34: File Ownership:
35:
36: DRI: xxx put dri here xxx
37:
38: Other Contact: xxx put other contact here xxx
39:
40: Technology: xxx put technology here xxx
41:
42: Writers:
43:
44: (msd) Mark Day
45:
46: Change History (most recent first):
47:
48: <CS1> 7/28/97 msd first checked in
49: */
50:
51: #include "FileMgrInternal.h"
52: #include "HFSBtreesPriv.h"
53: #include "BTreesPrivate.h"
54:
55:
56: /*
57: BTScanState - This structure is used to keep track of the current state
58: of a BTree scan. It contains both the dynamic state information (like
59: the current node number and record number) and information that is static
60: for the duration of a scan (such as buffer pointers).
61:
62: NOTE: recordNum may equal or exceed the number of records in the node
63: number nodeNum. If so, then the next attempt to get a record will move
64: to a new node number.
65: */
66: struct BTScanState {
67: // The following fields are set up once at initialization time.
68: // They are not changed during a scan.
69: void * buffer;
70: UInt32 bufferSize;
71: BTreeControlBlock * btcb;
72:
73: // The following fields are the dynamic state of the current scan.
74: UInt32 nodeNum; // zero is first node
75: UInt32 recordNum; // zero is first record
76: BTNodeDescriptor * currentNode; // points to current node within buffer
77: UInt32 nodesLeftInBuffer; // number of valid nodes still in the buffer
78: UInt32 recordsFound; // number of leaf records seen so far
79: UInt32 lastCachedNode; // last node put in cache
80: };
81: typedef struct BTScanState BTScanState;
82:
83:
84: OSErr BTScanInitialize(
85: const FCB * btreeFile,
86: UInt32 startingNode,
87: UInt32 startingRecord,
88: UInt32 recordsFound,
89: void * buffer,
90: UInt32 bufferSize,
91: BTScanState * scanState);
92:
93: OSErr BTScanTerminate(
94: const BTScanState * scanState,
95: UInt32 * startingNode,
96: UInt32 * startingRecord,
97: UInt32 * recordsFound);
98:
99: OSErr BTScanNextRecord(
100: BTScanState * scanState,
101: Boolean avoidIO,
102: void * * key,
103: void * * data,
104: UInt32 * dataSize);
105:
106: OSErr BTScanCacheNode(BTScanState *scanState);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.