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 typedef struct _EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL
;
27 // Protocol GUID name defined in EFI1.1.
29 #define UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL_GUID
32 // Protocol defined in EFI1.1.
34 typedef EFI_UNICODE_COLLATION_PROTOCOL UNICODE_COLLATION_INTERFACE
;
37 // Protocol data structures and defines
39 #define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)
42 // Protocol member functions
45 Performs a case-insensitive comparison of two Null-terminated Unicode
48 @param This Protocol instance pointer.
49 @param Str1 A pointer to a Null-terminated Unicode string.
50 @param Str2 A pointer to a Null-terminated Unicode string.
52 @retval 0 Str1 is equivalent to Str2
53 @retval >_0 Str1 is lexically greater than Str2
54 @retval <_0 Str1 is lexically less than Str2
59 (EFIAPI
*EFI_UNICODE_COLLATION_STRICOLL
) (
60 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
67 Performs a case-insensitive comparison of a Null-terminated Unicode
68 pattern string and a Null-terminated Unicode string.
70 @param This Protocol instance pointer.
71 @param String A pointer to a Null-terminated Unicode string.
72 @param Pattern A pointer to a Null-terminated Unicode pattern string.
74 @retval TRUE Pattern was found in String.
75 @retval FALSE Pattern was not found in String.
80 (EFIAPI
*EFI_UNICODE_COLLATION_METAIMATCH
) (
81 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
88 Converts all the Unicode characters in a Null-terminated Unicode string to
89 lower case Unicode characters.
91 @param This Protocol instance pointer.
92 @param String A pointer to a Null-terminated Unicode 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 upper
107 case Unicode characters.
109 @param This Protocol instance pointer.
110 @param String A pointer to a Null-terminated Unicode string.
117 (EFIAPI
*EFI_UNICODE_COLLATION_STRUPR
) (
118 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
124 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
127 @param This Protocol instance pointer.
128 @param FatSize The size of the string Fat in bytes.
129 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
130 name using an OEM character set.
131 @param String A pointer to a Null-terminated Unicode string. The string must
132 be preallocated to hold FatSize Unicode characters.
139 (EFIAPI
*EFI_UNICODE_COLLATION_FATTOSTR
) (
140 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
148 Converts a Null-terminated Unicode string to legal characters in a FAT
149 filename using an OEM character set.
151 @param This Protocol instance pointer.
152 @param String A pointer to a Null-terminated Unicode string. The string must
153 be preallocated to hold FatSize Unicode characters.
154 @param FatSize The size of the string Fat in bytes.
155 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
156 name using an OEM character set.
158 @retval TRUE Fat is a Long File Name
159 @retval FALSE Fat is an 8.3 file name
164 (EFIAPI
*EFI_UNICODE_COLLATION_STRTOFAT
) (
165 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
172 struct _EFI_UNICODE_COLLATION_PROTOCOL
{
176 EFI_UNICODE_COLLATION_STRICOLL StriColl
;
177 EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch
;
178 EFI_UNICODE_COLLATION_STRLWR StrLwr
;
179 EFI_UNICODE_COLLATION_STRUPR StrUpr
;
182 // for supporting fat volumes
184 EFI_UNICODE_COLLATION_FATTOSTR FatToStr
;
185 EFI_UNICODE_COLLATION_STRTOFAT StrToFat
;
187 CHAR8
*SupportedLanguages
;
190 extern EFI_GUID gEfiUnicodeCollationProtocolGuid
;