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