]> git.saurik.com Git - apple/xnu.git/blob - bsd/hfs/hfscommon/headers/HFSUnicodeWrappers.h
xnu-344.49.tar.gz
[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 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
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
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 File: HFSUnicodeWrappers.h
27
28 Contains: IPI to Unicode routines used by File Manager.
29
30 Version: HFS Plus 1.0
31
32 Written by: Mark Day
33
34 Copyright: © 1996-1997 by Apple Computer, Inc., all rights reserved.
35
36 File Ownership:
37
38 DRI: xxx put dri here xxx
39
40 Other Contact: xxx put other contact here xxx
41
42 Technology: xxx put technology here xxx
43
44 Writers:
45
46 (DSH) Deric Horn
47 (msd) Mark Day
48 (djb) Don Brady
49
50 Change History (most recent first):
51
52 <CS11> 11/16/97 djb Change Unicode.h to UnicodeConverter.h.
53 <CS10> 11/7/97 msd Remove prototype for CompareUnicodeNames(). Add prototype for
54 FastUnicodeCompare().
55 <CS9> 10/13/97 djb Add encoding/index macros and add prototypes for new Get/Set
56 encodding routines.
57 <CS8> 9/15/97 djb InitUnicodeConverter now takes a boolean.
58 <CS7> 9/10/97 msd Add prototype for InitializeEncodingContext.
59 <CS6> 6/26/97 DSH Include "MockConverter" prototype for DFA usage.
60 <CS5> 6/25/97 DSH Removed Prototype definitions, and checked in Unicode.h and
61 TextCommon.h from Julio Gonzales into InternalInterfaces.
62 <CS4> 6/25/97 msd Add prototypes for some new Unicode routines that haven't
63 appeared in MasterInterfaces yet.
64 <CS3> 6/18/97 djb Add more ConversionContexts routines.
65 <CS2> 6/13/97 djb Switched to ConvertUnicodeToHFSName, ConvertHFSNameToUnicode, &
66 CompareUnicodeNames.
67 <CS1> 4/28/97 djb first checked in
68 <HFS1> 12/12/96 msd first checked in
69
70 */
71 #ifndef _HFSUNICODEWRAPPERS_
72 #define _HFSUNICODEWRAPPERS_
73
74 #include <sys/appleapiopts.h>
75
76 #ifdef KERNEL
77 #ifdef __APPLE_API_PRIVATE
78
79 #include "../../hfs_macos_defs.h"
80 #include "../../hfs_format.h"
81
82
83 extern OSErr ConvertUnicodeToUTF8Mangled ( ByteCount srcLen,
84 ConstUniCharArrayPtr srcStr,
85 ByteCount maxDstLen,
86 ByteCount *actualDstLen,
87 unsigned char* dstStr ,
88 HFSCatalogNodeID cnid);
89
90 /*
91 This routine compares two Unicode names based on an ordering defined by the HFS Plus B-tree.
92 This ordering must stay fixed for all time.
93
94 Output:
95 -n name1 < name2 (i.e. name 1 sorts before name 2)
96 0 name1 = name2
97 +n name1 > name2
98
99 NOTE: You should not depend on the magnitude of the result, just its sign. That is, when name1 < name2, then any
100 negative number may be returned.
101 */
102
103 extern SInt32 FastUnicodeCompare(register ConstUniCharArrayPtr str1, register ItemCount length1,
104 register ConstUniCharArrayPtr str2, register ItemCount length2);
105
106
107 extern SInt32 FastRelString( ConstStr255Param str1, ConstStr255Param str2 );
108
109
110 extern HFSCatalogNodeID GetEmbeddedFileID( ConstStr31Param filename, UInt32 length, UInt32 *prefixLength );
111
112 #endif /* __APPLE_API_PRIVATE */
113 #endif /* KERNEL */
114 #endif /* _HFSUNICODEWRAPPERS_ */