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
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.
18 Unicode Collation protocol that follows the EFI 1.0 specification.
22 #ifndef _UNICODE_COLLATION_H_
23 #define _UNICODE_COLLATION_H_
25 #define EFI_UNICODE_COLLATION_PROTOCOL_GUID \
27 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} \
30 #define EFI_UNICODE_COLLATION2_PROTOCOL_GUID \
32 0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49} \
35 EFI_FORWARD_DECLARATION (EFI_UNICODE_COLLATION_PROTOCOL
);
38 // Protocol data structures and defines
40 #define EFI_UNICODE_BYTE_ORDER_MARK ((CHAR16)(0xfeff))
41 #define EFI_UNICODE_BYTE_ORDER_MARK_REVERSE ((CHAR16)(0xfffe))
44 // Protocol member functions
48 (EFIAPI
*EFI_UNICODE_COLLATION_STRICOLL
) (
49 IN EFI_UNICODE_COLLATION_PROTOCOL
* This
,
56 Performs a case-insensitive comparison of two Null-terminated Unicode
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.
65 0 - Str1 is equivalent to Str2
66 > 0 - Str1 is lexically greater than Str2
67 < 0 - Str1 is lexically less than Str2
74 (EFIAPI
*EFI_UNICODE_COLLATION_METAIMATCH
) (
75 IN EFI_UNICODE_COLLATION_PROTOCOL
* This
,
82 Performs a case-insensitive comparison of a Null-terminated Unicode
83 pattern string and a Null-terminated Unicode string.
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.
91 TRUE - Pattern was found in String.
92 FALSE - Pattern was not found in String.
99 (EFIAPI
*EFI_UNICODE_COLLATION_STRLWR
) (
100 IN EFI_UNICODE_COLLATION_PROTOCOL
* This
,
106 Converts all the Unicode characters in a Null-terminated Unicode string to
107 lower case Unicode characters.
110 This - Protocol instance pointer.
111 String - A pointer to a Null-terminated Unicode string.
121 (EFIAPI
*EFI_UNICODE_COLLATION_STRUPR
) (
122 IN EFI_UNICODE_COLLATION_PROTOCOL
* This
,
128 Converts all the Unicode characters in a Null-terminated Unicode string to upper
129 case Unicode characters.
132 This - Protocol instance pointer.
133 String - A pointer to a Null-terminated Unicode string.
143 (EFIAPI
*EFI_UNICODE_COLLATION_FATTOSTR
) (
144 IN EFI_UNICODE_COLLATION_PROTOCOL
* This
,
152 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
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.
170 (EFIAPI
*EFI_UNICODE_COLLATION_STRTOFAT
) (
171 IN EFI_UNICODE_COLLATION_PROTOCOL
* This
,
179 Converts a Null-terminated Unicode string to legal characters in a FAT
180 filename using an OEM character set.
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.
190 TRUE - Fat is a Long File Name
191 FALSE - Fat is an 8.3 file name
196 struct _EFI_UNICODE_COLLATION_PROTOCOL
{
200 EFI_UNICODE_COLLATION_STRICOLL StriColl
;
201 EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch
;
202 EFI_UNICODE_COLLATION_STRLWR StrLwr
;
203 EFI_UNICODE_COLLATION_STRUPR StrUpr
;
206 // for supporting fat volumes
208 EFI_UNICODE_COLLATION_FATTOSTR FatToStr
;
209 EFI_UNICODE_COLLATION_STRTOFAT StrToFat
;
211 CHAR8
*SupportedLanguages
;
214 extern EFI_GUID gEfiUnicodeCollationProtocolGuid
;
215 extern EFI_GUID gEfiUnicodeCollation2ProtocolGuid
;