]> git.saurik.com Git - apple/xnu.git/blob - bsd/hfs/hfscommon/headers/HFSUnicodeWrappers.h
da936a24c11cdd65a65aca3f6b93e4d7e6e04dd5
[apple/xnu.git] / bsd / hfs / hfscommon / headers / HFSUnicodeWrappers.h
1 /*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*
24 File: HFSUnicodeWrappers.h
25
26 Contains: IPI to Unicode routines used by File Manager.
27
28 Version: HFS Plus 1.0
29
30 Written by: Mark Day
31
32 Copyright: © 1996-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 (DSH) Deric Horn
45 (msd) Mark Day
46 (djb) Don Brady
47
48 Change History (most recent first):
49
50 <CS11> 11/16/97 djb Change Unicode.h to UnicodeConverter.h.
51 <CS10> 11/7/97 msd Remove prototype for CompareUnicodeNames(). Add prototype for
52 FastUnicodeCompare().
53 <CS9> 10/13/97 djb Add encoding/index macros and add prototypes for new Get/Set
54 encodding routines.
55 <CS8> 9/15/97 djb InitUnicodeConverter now takes a boolean.
56 <CS7> 9/10/97 msd Add prototype for InitializeEncodingContext.
57 <CS6> 6/26/97 DSH Include "MockConverter" prototype for DFA usage.
58 <CS5> 6/25/97 DSH Removed Prototype definitions, and checked in Unicode.h and
59 TextCommon.h from Julio Gonzales into InternalInterfaces.
60 <CS4> 6/25/97 msd Add prototypes for some new Unicode routines that haven't
61 appeared in MasterInterfaces yet.
62 <CS3> 6/18/97 djb Add more ConversionContexts routines.
63 <CS2> 6/13/97 djb Switched to ConvertUnicodeToHFSName, ConvertHFSNameToUnicode, &
64 CompareUnicodeNames.
65 <CS1> 4/28/97 djb first checked in
66 <HFS1> 12/12/96 msd first checked in
67
68 */
69 #ifndef _HFSUNICODEWRAPPERS_
70 #define _HFSUNICODEWRAPPERS_
71
72 #include <sys/appleapiopts.h>
73
74 #ifdef KERNEL
75 #ifdef __APPLE_API_PRIVATE
76
77 #include "../../hfs_macos_defs.h"
78 #include "../../hfs_format.h"
79
80
81 extern OSErr ConvertUnicodeToUTF8Mangled ( ByteCount srcLen,
82 ConstUniCharArrayPtr srcStr,
83 ByteCount maxDstLen,
84 ByteCount *actualDstLen,
85 unsigned char* dstStr ,
86 HFSCatalogNodeID cnid);
87
88 /*
89 This routine compares two Unicode names based on an ordering defined by the HFS Plus B-tree.
90 This ordering must stay fixed for all time.
91
92 Output:
93 -n name1 < name2 (i.e. name 1 sorts before name 2)
94 0 name1 = name2
95 +n name1 > name2
96
97 NOTE: You should not depend on the magnitude of the result, just its sign. That is, when name1 < name2, then any
98 negative number may be returned.
99 */
100
101 extern SInt32 FastUnicodeCompare(register ConstUniCharArrayPtr str1, register ItemCount length1,
102 register ConstUniCharArrayPtr str2, register ItemCount length2);
103
104
105 extern SInt32 FastRelString( ConstStr255Param str1, ConstStr255Param str2 );
106
107
108 extern HFSCatalogNodeID GetEmbeddedFileID( ConstStr31Param filename, UInt32 length, UInt32 *prefixLength );
109
110 #endif /* __APPLE_API_PRIVATE */
111 #endif /* KERNEL */
112 #endif /* _HFSUNICODEWRAPPERS_ */