]> git.saurik.com Git - apple/xnu.git/blob - bsd/hfs/hfscommon/headers/CatalogPrivate.h
3fedceb27bf3ce80960d41467528e09de97f32d2
[apple/xnu.git] / bsd / hfs / hfscommon / headers / CatalogPrivate.h
1 /*
2 * Copyright (c) 2006 Apple Computer, Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
29 */
30 /*
31 File: CatalogPrivate.h
32
33 Contains: Private Catalog Manager interfaces.
34
35 Version: HFS Plus 1.0
36
37 Copyright: © 1997-1998 by Apple Computer, Inc., all rights reserved.
38
39 File Ownership:
40
41 DRI: Don Brady
42
43 Other Contact: xxx put other contact here xxx
44
45 Technology: xxx put technology here xxx
46
47 Writers:
48
49 (JL) Jim Luther
50 (msd) Mark Day
51 (DSH) Deric Horn
52 (djb) Don Brady
53
54 Change History (most recent first):
55 <MacOSX> 11/10/98 djb Remove obsolete PrepareInputName prototype;
56 <MacOSX> 4/6/98 djb Added lock data stuctures and ReleaseCatalogIterator prototype;
57 <MacOSX> 4/6/98 djb Removed CatalogDataCache since its no longer used.
58 <MacOSX> 4/2/98 djb InvalidateCatalogNodeCache does nothing under MacOS X.
59 <MacOSX> 3/31/98 djb Sync up with final HFSVolumes.h header file.
60
61 <CS10> 11/20/97 djb Radar #2002357. Fixing retry mechanism.
62 <CS9> 11/17/97 djb PrepareInputName routine now returns an error.
63 <CS8> 11/13/97 djb Radar #1683572. Move CatalogIterator to this file from
64 FileMgrInternal.i. Double size of short unicode name.
65 <CS7> 10/31/97 JL #2000184 - Changed prototypes for CreateFileThreadID and
66 ExchangeFiles.
67 <CS6> 10/17/97 msd In CatalogCacheGlobals, add room for a single UniStr255 so
68 catalog iterators can step over long Unicode names.
69 <CS5> 10/17/97 djb Add ConvertInputNameToUnicode for Catalog Create/Rename.
70 <CS4> 10/1/97 djb Change catalog iterator implementation.
71 <CS3> 7/16/97 DSH FilesInternal.i renamed FileMgrInternal.i to avoid name
72 collision
73 <CS2> 6/24/97 djb Add LocateCatalogNodeByMangledName routine.
74 <CS1> 6/24/97 djb first checked in
75 */
76
77 #ifndef __CATALOGPRIVATE__
78 #define __CATALOGPRIVATE__
79
80 #include <sys/appleapiopts.h>
81
82 #ifdef KERNEL
83 #ifdef __APPLE_API_PRIVATE
84
85 #include "../../hfs_format.h"
86
87 #include "FileMgrInternal.h"
88 #include "BTreesInternal.h"
89
90 //
91 // Private Catalog Manager Routines (for use only by Catalog Manager, CatSearch and FileID Services)
92 //
93
94
95 extern OSErr LocateCatalogNode( const ExtendedVCB *volume, HFSCatalogNodeID folderID, const CatalogName *name,
96 UInt32 hint, CatalogKey *key, CatalogRecord *data, UInt32 *newHint);
97
98 extern OSErr LocateCatalogNodeByKey ( const ExtendedVCB *volume, UInt32 hint, CatalogKey *keyPtr,
99 CatalogRecord *dataPtr, UInt32 *newHint );
100
101 extern OSErr LocateCatalogRecord( const ExtendedVCB *volume, HFSCatalogNodeID folderID, const CatalogName *name,
102 UInt32 hint, CatalogKey *keyPtr, CatalogRecord *dataPtr, UInt32 *newHint);
103
104 extern OSErr LocateCatalogNodeWithRetry ( const ExtendedVCB *volume, HFSCatalogNodeID folderID, ConstStr31Param pascalName,
105 CatalogName *unicodeName, UInt32 hint, CatalogKey *keyPtr, CatalogRecord *dataPtr,
106 UInt32 *newHint );
107 extern OSErr FlushCatalog( ExtendedVCB *volume);
108
109
110 extern void ConvertInputNameToUnicode(ConstStr31Param name, TextEncoding encodingHint,
111 TextEncoding *actualEncoding, CatalogName *catalogName);
112
113 extern void BuildCatalogKey( HFSCatalogNodeID parentID, const CatalogName *name, Boolean isHFSPlus,
114 CatalogKey *key);
115
116 extern OSErr BuildCatalogKeyUTF8(ExtendedVCB *volume, HFSCatalogNodeID parentID, const char *name,
117 UInt32 length, CatalogKey *key, UInt32 *textEncoding);
118
119 extern void CopyCatalogName( const CatalogName *srcName, CatalogName *dstName, Boolean isHFSPLus);
120
121 extern OSErr ResolveFileID( ExtendedVCB *vcb, HFSCatalogNodeID fileID, HFSCatalogNodeID *parentID, Str31 name );
122
123 #if 0
124 extern OSErr CreateFileThreadID( FIDParam *filePB, WDCBRecPtr *wdcbPtr );
125
126 extern OSErr ExchangeFiles( FIDParam *filePB, WDCBRecPtr *wdcbPtr );
127 #endif
128
129 extern void UpdateCatalogName( ConstStr31Param srcName, Str31 destName );
130
131
132 #endif /* __APPLE_API_PRIVATE */
133 #endif /* KERNEL */
134 #endif //__CATALOGPRIVATE__