2 Unicode Collation protocol that follows the UEFI 2.0 specification.
3 This protocol is used to allow code running in the boot services environment
4 to perform lexical comparison functions on Unicode strings for given languages.
6 Copyright (c) 2006 - 2008, Intel Corporation
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #ifndef __UNICODE_COLLATION_H__
18 #define __UNICODE_COLLATION_H__
20 #define EFI_UNICODE_COLLATION_PROTOCOL_GUID \
22 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
25 #define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \
27 0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49 } \
30 typedef struct _EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL
;
34 /// Protocol GUID name defined in EFI1.1.
36 #define UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL_GUID
39 /// Protocol defined in EFI1.1.
41 typedef EFI_UNICODE_COLLATION_PROTOCOL UNICODE_COLLATION_INTERFACE
;
44 /// Protocol data structures and defines
46 #define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)
49 // Protocol member functions
52 Performs a case-insensitive comparison of two Null-terminated Unicode
55 @param This Protocol instance pointer.
56 @param Str1 A pointer to a Null-terminated Unicode string.
57 @param Str2 A pointer to a Null-terminated Unicode string.
59 @retval 0 Str1 is equivalent to Str2
60 @retval >_0 Str1 is lexically greater than Str2
61 @retval <_0 Str1 is lexically less than Str2
66 (EFIAPI
*EFI_UNICODE_COLLATION_STRICOLL
)(
67 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
73 Performs a case-insensitive comparison of a Null-terminated Unicode
74 pattern string and a Null-terminated Unicode string.
76 @param This Protocol instance pointer.
77 @param String A pointer to a Null-terminated Unicode string.
78 @param Pattern A pointer to a Null-terminated Unicode pattern string.
80 @retval TRUE Pattern was found in String.
81 @retval FALSE Pattern was not found in String.
86 (EFIAPI
*EFI_UNICODE_COLLATION_METAIMATCH
)(
87 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.
102 (EFIAPI
*EFI_UNICODE_COLLATION_STRLWR
)(
103 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
108 Converts all the Unicode characters in a Null-terminated Unicode string to upper
109 case Unicode characters.
111 @param This Protocol instance pointer.
112 @param String A pointer to a Null-terminated Unicode string.
117 (EFIAPI
*EFI_UNICODE_COLLATION_STRUPR
)(
118 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
123 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
126 @param This Protocol instance pointer.
127 @param FatSize The size of the string Fat in bytes.
128 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
129 name using an OEM character set.
130 @param String A pointer to a Null-terminated Unicode string. The string must
131 be preallocated to hold FatSize Unicode characters.
136 (EFIAPI
*EFI_UNICODE_COLLATION_FATTOSTR
)(
137 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
144 Converts a Null-terminated Unicode string to legal characters in a FAT
145 filename using an OEM character set.
147 @param This Protocol instance pointer.
148 @param String A pointer to a Null-terminated Unicode string. The string must
149 be preallocated to hold FatSize Unicode characters.
150 @param FatSize The size of the string Fat in bytes.
151 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
152 name using an OEM character set.
154 @retval TRUE Fat is a Long File Name
155 @retval FALSE Fat is an 8.3 file name
160 (EFIAPI
*EFI_UNICODE_COLLATION_STRTOFAT
)(
161 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
168 /// The EFI_UNICODE_COLLATION_PROTOCOL is used to perform case-insensitive
169 /// comparisons of Unicode strings.
171 struct _EFI_UNICODE_COLLATION_PROTOCOL
{
172 EFI_UNICODE_COLLATION_STRICOLL StriColl
;
173 EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch
;
174 EFI_UNICODE_COLLATION_STRLWR StrLwr
;
175 EFI_UNICODE_COLLATION_STRUPR StrUpr
;
178 // for supporting fat volumes
180 EFI_UNICODE_COLLATION_FATTOSTR FatToStr
;
181 EFI_UNICODE_COLLATION_STRTOFAT StrToFat
;
184 /// A Null-terminated ASCII string array that contains one or more
185 /// language codes. This array is specified in RFC 4646 format.
187 CHAR8
*SupportedLanguages
;
190 extern EFI_GUID gEfiUnicodeCollationProtocolGuid
;
191 extern EFI_GUID gEfiUnicodeCollation2ProtocolGuid
;