3 Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
4 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 Collation2 protocol that follows the UEFI 2.0 specification.
22 #ifndef _UNICODE_COLLATION2_H_
23 #define _UNICODE_COLLATION2_H_
25 #define EFI_UNICODE_COLLATION2_PROTOCOL_GUID \
27 0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49} \
30 EFI_FORWARD_DECLARATION (EFI_UNICODE_COLLATION2_PROTOCOL
);
33 // Protocol data structures and defines
35 #define EFI_UNICODE_BYTE_ORDER_MARK ((CHAR16)(0xfeff))
36 #define EFI_UNICODE_BYTE_ORDER_MARK_REVERSE ((CHAR16)(0xfffe))
39 // Protocol member functions
43 (EFIAPI
*EFI_UNICODE_COLLATION2_STRICOLL
) (
44 IN EFI_UNICODE_COLLATION2_PROTOCOL
* This
,
51 Performs a case-insensitive comparison of two Null-terminated Unicode
55 This - Protocol instance pointer.
56 Str1 - A pointer to a Null-terminated Unicode string.
57 Str2 - A pointer to a Null-terminated Unicode string.
60 0 - Str1 is equivalent to Str2
61 > 0 - Str1 is lexically greater than Str2
62 < 0 - Str1 is lexically less than Str2
69 (EFIAPI
*EFI_UNICODE_COLLATION2_METAIMATCH
) (
70 IN EFI_UNICODE_COLLATION2_PROTOCOL
* This
,
77 Performs a case-insensitive comparison of a Null-terminated Unicode
78 pattern string and a Null-terminated Unicode string.
81 This - Protocol instance pointer.
82 String - A pointer to a Null-terminated Unicode string.
83 Pattern - A pointer to a Null-terminated Unicode pattern string.
86 TRUE - Pattern was found in String.
87 FALSE - Pattern was not found in String.
94 (EFIAPI
*EFI_UNICODE_COLLATION2_STRLWR
) (
95 IN EFI_UNICODE_COLLATION2_PROTOCOL
* This
,
101 Converts all the Unicode characters in a Null-terminated Unicode string to
102 lower case Unicode characters.
105 This - Protocol instance pointer.
106 String - A pointer to a Null-terminated Unicode string.
116 (EFIAPI
*EFI_UNICODE_COLLATION2_STRUPR
) (
117 IN EFI_UNICODE_COLLATION2_PROTOCOL
* This
,
123 Converts all the Unicode characters in a Null-terminated Unicode string to upper
124 case Unicode characters.
127 This - Protocol instance pointer.
128 String - A pointer to a Null-terminated Unicode string.
138 (EFIAPI
*EFI_UNICODE_COLLATION2_FATTOSTR
) (
139 IN EFI_UNICODE_COLLATION2_PROTOCOL
* This
,
147 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
151 This - Protocol instance pointer.
152 FatSize - The size of the string Fat in bytes.
153 Fat - A pointer to a Null-terminated string that contains an 8.3 file
154 name using an OEM character set.
155 String - A pointer to a Null-terminated Unicode string. The string must
156 be preallocated to hold FatSize Unicode characters.
165 (EFIAPI
*EFI_UNICODE_COLLATION2_STRTOFAT
) (
166 IN EFI_UNICODE_COLLATION2_PROTOCOL
* This
,
174 Converts a Null-terminated Unicode string to legal characters in a FAT
175 filename using an OEM character set.
178 This - Protocol instance pointer.
179 String - A pointer to a Null-terminated Unicode string. The string must
180 be preallocated to hold FatSize Unicode characters.
181 FatSize - The size of the string Fat in bytes.
182 Fat - A pointer to a Null-terminated string that contains an 8.3 file
183 name using an OEM character set.
185 TRUE - Fat is a Long File Name
186 FALSE - Fat is an 8.3 file name
191 struct _EFI_UNICODE_COLLATION2_PROTOCOL
{
195 EFI_UNICODE_COLLATION2_STRICOLL StriColl
;
196 EFI_UNICODE_COLLATION2_METAIMATCH MetaiMatch
;
197 EFI_UNICODE_COLLATION2_STRLWR StrLwr
;
198 EFI_UNICODE_COLLATION2_STRUPR StrUpr
;
201 // for supporting fat volumes
203 EFI_UNICODE_COLLATION2_FATTOSTR FatToStr
;
204 EFI_UNICODE_COLLATION2_STRTOFAT StrToFat
;
206 CHAR8
*SupportedLanguages
;
209 extern EFI_GUID gEfiUnicodeCollation2ProtocolGuid
;