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