]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Efi/Protocol/UnicodeCollation/UnicodeCollation.h
Update Guid Value format.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Efi / Protocol / UnicodeCollation / UnicodeCollation.h
1 /*++
2
3 Copyright (c) 2004, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 UnicodeCollation.h
15
16 Abstract:
17
18 Unicode Collation protocol that follows the EFI 1.0 specification.
19
20 --*/
21
22 #ifndef _UNICODE_COLLATION_H_
23 #define _UNICODE_COLLATION_H_
24
25 #define EFI_UNICODE_COLLATION_PROTOCOL_GUID \
26 { \
27 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} \
28 }
29
30 #define EFI_UNICODE_COLLATION2_PROTOCOL_GUID \
31 { \
32 0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49} \
33 }
34
35 EFI_FORWARD_DECLARATION (EFI_UNICODE_COLLATION_PROTOCOL);
36
37 //
38 // Protocol data structures and defines
39 //
40 #define EFI_UNICODE_BYTE_ORDER_MARK ((CHAR16)(0xfeff))
41 #define EFI_UNICODE_BYTE_ORDER_MARK_REVERSE ((CHAR16)(0xfffe))
42
43 //
44 // Protocol member functions
45 //
46 typedef
47 INTN
48 (EFIAPI *EFI_UNICODE_COLLATION_STRICOLL) (
49 IN EFI_UNICODE_COLLATION_PROTOCOL * This,
50 IN CHAR16 *Str1,
51 IN CHAR16 *Str2
52 )
53 /*++
54
55 Routine Description:
56 Performs a case-insensitive comparison of two Null-terminated Unicode
57 strings.
58
59 Arguments:
60 This - Protocol instance pointer.
61 Str1 - A pointer to a Null-terminated Unicode string.
62 Str2 - A pointer to a Null-terminated Unicode string.
63
64 Returns:
65 0 - Str1 is equivalent to Str2
66 > 0 - Str1 is lexically greater than Str2
67 < 0 - Str1 is lexically less than Str2
68
69 --*/
70 ;
71
72 typedef
73 BOOLEAN
74 (EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH) (
75 IN EFI_UNICODE_COLLATION_PROTOCOL * This,
76 IN CHAR16 *String,
77 IN CHAR16 *Pattern
78 )
79 /*++
80
81 Routine Description:
82 Performs a case-insensitive comparison of a Null-terminated Unicode
83 pattern string and a Null-terminated Unicode string.
84
85 Arguments:
86 This - Protocol instance pointer.
87 String - A pointer to a Null-terminated Unicode string.
88 Pattern - A pointer to a Null-terminated Unicode pattern string.
89
90 Returns:
91 TRUE - Pattern was found in String.
92 FALSE - Pattern was not found in String.
93
94 --*/
95 ;
96
97 typedef
98 VOID
99 (EFIAPI *EFI_UNICODE_COLLATION_STRLWR) (
100 IN EFI_UNICODE_COLLATION_PROTOCOL * This,
101 IN OUT CHAR16 *Str
102 )
103 /*++
104
105 Routine Description:
106 Converts all the Unicode characters in a Null-terminated Unicode string to
107 lower case Unicode characters.
108
109 Arguments:
110 This - Protocol instance pointer.
111 String - A pointer to a Null-terminated Unicode string.
112
113 Returns:
114 NONE
115
116 --*/
117 ;
118
119 typedef
120 VOID
121 (EFIAPI *EFI_UNICODE_COLLATION_STRUPR) (
122 IN EFI_UNICODE_COLLATION_PROTOCOL * This,
123 IN OUT CHAR16 *Str
124 )
125 /*++
126
127 Routine Description:
128 Converts all the Unicode characters in a Null-terminated Unicode string to upper
129 case Unicode characters.
130
131 Arguments:
132 This - Protocol instance pointer.
133 String - A pointer to a Null-terminated Unicode string.
134
135 Returns:
136 NONE
137
138 --*/
139 ;
140
141 typedef
142 VOID
143 (EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR) (
144 IN EFI_UNICODE_COLLATION_PROTOCOL * This,
145 IN UINTN FatSize,
146 IN CHAR8 *Fat,
147 OUT CHAR16 *String
148 )
149 /*++
150
151 Routine Description:
152 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
153 Unicode string.
154
155 Arguments:
156 This - Protocol instance pointer.
157 FatSize - The size of the string Fat in bytes.
158 Fat - A pointer to a Null-terminated string that contains an 8.3 file
159 name using an OEM character set.
160 String - A pointer to a Null-terminated Unicode string. The string must
161 be preallocated to hold FatSize Unicode characters.
162 Returns:
163 NONE
164
165 --*/
166 ;
167
168 typedef
169 BOOLEAN
170 (EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT) (
171 IN EFI_UNICODE_COLLATION_PROTOCOL * This,
172 IN CHAR16 *String,
173 IN UINTN FatSize,
174 OUT CHAR8 *Fat
175 )
176 /*++
177
178 Routine Description:
179 Converts a Null-terminated Unicode string to legal characters in a FAT
180 filename using an OEM character set.
181
182 Arguments:
183 This - Protocol instance pointer.
184 String - A pointer to a Null-terminated Unicode string. The string must
185 be preallocated to hold FatSize Unicode characters.
186 FatSize - The size of the string Fat in bytes.
187 Fat - A pointer to a Null-terminated string that contains an 8.3 file
188 name using an OEM character set.
189 Returns:
190 TRUE - Fat is a Long File Name
191 FALSE - Fat is an 8.3 file name
192
193 --*/
194 ;
195
196 struct _EFI_UNICODE_COLLATION_PROTOCOL {
197 //
198 // general
199 //
200 EFI_UNICODE_COLLATION_STRICOLL StriColl;
201 EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch;
202 EFI_UNICODE_COLLATION_STRLWR StrLwr;
203 EFI_UNICODE_COLLATION_STRUPR StrUpr;
204
205 //
206 // for supporting fat volumes
207 //
208 EFI_UNICODE_COLLATION_FATTOSTR FatToStr;
209 EFI_UNICODE_COLLATION_STRTOFAT StrToFat;
210
211 CHAR8 *SupportedLanguages;
212 };
213
214 extern EFI_GUID gEfiUnicodeCollationProtocolGuid;
215 extern EFI_GUID gEfiUnicodeCollation2ProtocolGuid;
216
217 #endif