2 Unicode Collation protocol that follows the EFI 1.0 specification.
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __UNICODE_COLLATION_H__
16 #define __UNICODE_COLLATION_H__
18 #define EFI_UNICODE_COLLATION_PROTOCOL_GUID \
20 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
23 #define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \
25 0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49 } \
28 typedef struct _EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL
;
32 // Protocol GUID name defined in EFI1.1.
34 #define UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL_GUID
37 // Protocol defined in EFI1.1.
39 typedef EFI_UNICODE_COLLATION_PROTOCOL UNICODE_COLLATION_INTERFACE
;
42 // Protocol data structures and defines
44 #define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)
47 // Protocol member functions
50 Performs a case-insensitive comparison of two Null-terminated Unicode
53 @param This Protocol instance pointer.
54 @param Str1 A pointer to a Null-terminated Unicode string.
55 @param Str2 A pointer to a Null-terminated Unicode string.
57 @retval 0 Str1 is equivalent to Str2
58 @retval >_0 Str1 is lexically greater than Str2
59 @retval <_0 Str1 is lexically less than Str2
64 (EFIAPI
*EFI_UNICODE_COLLATION_STRICOLL
) (
65 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
72 Performs a case-insensitive comparison of a Null-terminated Unicode
73 pattern string and a Null-terminated Unicode string.
75 @param This Protocol instance pointer.
76 @param String A pointer to a Null-terminated Unicode string.
77 @param Pattern A pointer to a Null-terminated Unicode pattern string.
79 @retval TRUE Pattern was found in String.
80 @retval FALSE Pattern was not found in String.
85 (EFIAPI
*EFI_UNICODE_COLLATION_METAIMATCH
) (
86 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
93 Converts all the Unicode characters in a Null-terminated Unicode string to
94 lower case Unicode characters.
96 @param This Protocol instance pointer.
97 @param String A pointer to a Null-terminated Unicode string.
104 (EFIAPI
*EFI_UNICODE_COLLATION_STRLWR
) (
105 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
111 Converts all the Unicode characters in a Null-terminated Unicode string to upper
112 case Unicode characters.
114 @param This Protocol instance pointer.
115 @param String A pointer to a Null-terminated Unicode string.
122 (EFIAPI
*EFI_UNICODE_COLLATION_STRUPR
) (
123 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
129 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
132 @param This Protocol instance pointer.
133 @param FatSize The size of the string Fat in bytes.
134 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
135 name using an OEM character set.
136 @param String A pointer to a Null-terminated Unicode string. The string must
137 be preallocated to hold FatSize Unicode characters.
144 (EFIAPI
*EFI_UNICODE_COLLATION_FATTOSTR
) (
145 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
153 Converts a Null-terminated Unicode string to legal characters in a FAT
154 filename using an OEM character set.
156 @param This Protocol instance pointer.
157 @param String A pointer to a Null-terminated Unicode string. The string must
158 be preallocated to hold FatSize Unicode characters.
159 @param FatSize The size of the string Fat in bytes.
160 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
161 name using an OEM character set.
163 @retval TRUE Fat is a Long File Name
164 @retval FALSE Fat is an 8.3 file name
169 (EFIAPI
*EFI_UNICODE_COLLATION_STRTOFAT
) (
170 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
177 struct _EFI_UNICODE_COLLATION_PROTOCOL
{
181 EFI_UNICODE_COLLATION_STRICOLL StriColl
;
182 EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch
;
183 EFI_UNICODE_COLLATION_STRLWR StrLwr
;
184 EFI_UNICODE_COLLATION_STRUPR StrUpr
;
187 // for supporting fat volumes
189 EFI_UNICODE_COLLATION_FATTOSTR FatToStr
;
190 EFI_UNICODE_COLLATION_STRTOFAT StrToFat
;
192 CHAR8
*SupportedLanguages
;
195 extern EFI_GUID gEfiUnicodeCollationProtocolGuid
;
196 extern EFI_GUID gEfiUnicodeCollation2ProtocolGuid
;