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.
13 Module Name: UnicodeCollation.h
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 typedef struct _EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL
;
28 // Protocol data structures and defines
30 #define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)
33 // Protocol member functions
36 Performs a case-insensitive comparison of two Null-terminated Unicode
39 @param This Protocol instance pointer.
40 @param Str1 A pointer to a Null-terminated Unicode string.
41 @param Str2 A pointer to a Null-terminated Unicode string.
43 @retval 0 Str1 is equivalent to Str2
44 @retval >_0 Str1 is lexically greater than Str2
45 @retval <_0 Str1 is lexically less than Str2
50 (EFIAPI
*EFI_UNICODE_COLLATION_STRICOLL
) (
51 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
58 Performs a case-insensitive comparison of a Null-terminated Unicode
59 pattern string and a Null-terminated Unicode string.
61 @param This Protocol instance pointer.
62 @param String A pointer to a Null-terminated Unicode string.
63 @param Pattern A pointer to a Null-terminated Unicode pattern string.
65 @retval TRUE Pattern was found in String.
66 @retval FALSE Pattern was not found in String.
71 (EFIAPI
*EFI_UNICODE_COLLATION_METAIMATCH
) (
72 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
79 Converts all the Unicode characters in a Null-terminated Unicode string to
80 lower case Unicode characters.
82 @param This Protocol instance pointer.
83 @param String A pointer to a Null-terminated Unicode string.
90 (EFIAPI
*EFI_UNICODE_COLLATION_STRLWR
) (
91 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
97 Converts all the Unicode characters in a Null-terminated Unicode string to upper
98 case Unicode characters.
100 @param This Protocol instance pointer.
101 @param String A pointer to a Null-terminated Unicode string.
108 (EFIAPI
*EFI_UNICODE_COLLATION_STRUPR
) (
109 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
115 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
118 @param This Protocol instance pointer.
119 @param FatSize The size of the string Fat in bytes.
120 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
121 name using an OEM character set.
122 @param String A pointer to a Null-terminated Unicode string. The string must
123 be preallocated to hold FatSize Unicode characters.
130 (EFIAPI
*EFI_UNICODE_COLLATION_FATTOSTR
) (
131 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
139 Converts a Null-terminated Unicode string to legal characters in a FAT
140 filename using an OEM character set.
142 @param This Protocol instance pointer.
143 @param String A pointer to a Null-terminated Unicode string. The string must
144 be preallocated to hold FatSize Unicode characters.
145 @param FatSize The size of the string Fat in bytes.
146 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
147 name using an OEM character set.
149 @retval TRUE Fat is a Long File Name
150 @retval FALSE Fat is an 8.3 file name
155 (EFIAPI
*EFI_UNICODE_COLLATION_STRTOFAT
) (
156 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
163 struct _EFI_UNICODE_COLLATION_PROTOCOL
{
167 EFI_UNICODE_COLLATION_STRICOLL StriColl
;
168 EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch
;
169 EFI_UNICODE_COLLATION_STRLWR StrLwr
;
170 EFI_UNICODE_COLLATION_STRUPR StrUpr
;
173 // for supporting fat volumes
175 EFI_UNICODE_COLLATION_FATTOSTR FatToStr
;
176 EFI_UNICODE_COLLATION_STRTOFAT StrToFat
;
178 CHAR8
*SupportedLanguages
;
181 extern EFI_GUID gEfiUnicodeCollationProtocolGuid
;