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
;
29 // Protocol GUID name defined in EFI1.1.
31 #define UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL_GUID
34 // Protocol defined in EFI1.1.
36 typedef EFI_UNICODE_COLLATION_PROTOCOL UNICODE_COLLATION_INTERFACE
;
39 // Protocol data structures and defines
41 #define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)
44 // Protocol member functions
47 Performs a case-insensitive comparison of two Null-terminated Unicode
50 @param This Protocol instance pointer.
51 @param Str1 A pointer to a Null-terminated Unicode string.
52 @param Str2 A pointer to a Null-terminated Unicode string.
54 @retval 0 Str1 is equivalent to Str2
55 @retval >_0 Str1 is lexically greater than Str2
56 @retval <_0 Str1 is lexically less than Str2
61 (EFIAPI
*EFI_UNICODE_COLLATION_STRICOLL
) (
62 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
69 Performs a case-insensitive comparison of a Null-terminated Unicode
70 pattern string and a Null-terminated Unicode string.
72 @param This Protocol instance pointer.
73 @param String A pointer to a Null-terminated Unicode string.
74 @param Pattern A pointer to a Null-terminated Unicode pattern string.
76 @retval TRUE Pattern was found in String.
77 @retval FALSE Pattern was not found in String.
82 (EFIAPI
*EFI_UNICODE_COLLATION_METAIMATCH
) (
83 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
90 Converts all the Unicode characters in a Null-terminated Unicode string to
91 lower case Unicode characters.
93 @param This Protocol instance pointer.
94 @param String A pointer to a Null-terminated Unicode string.
101 (EFIAPI
*EFI_UNICODE_COLLATION_STRLWR
) (
102 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.
119 (EFIAPI
*EFI_UNICODE_COLLATION_STRUPR
) (
120 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
126 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
129 @param This Protocol instance pointer.
130 @param FatSize The size of the string Fat in bytes.
131 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
132 name using an OEM character set.
133 @param String A pointer to a Null-terminated Unicode string. The string must
134 be preallocated to hold FatSize Unicode characters.
141 (EFIAPI
*EFI_UNICODE_COLLATION_FATTOSTR
) (
142 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
150 Converts a Null-terminated Unicode string to legal characters in a FAT
151 filename using an OEM character set.
153 @param This Protocol instance pointer.
154 @param String A pointer to a Null-terminated Unicode string. The string must
155 be preallocated to hold FatSize Unicode characters.
156 @param FatSize The size of the string Fat in bytes.
157 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
158 name using an OEM character set.
160 @retval TRUE Fat is a Long File Name
161 @retval FALSE Fat is an 8.3 file name
166 (EFIAPI
*EFI_UNICODE_COLLATION_STRTOFAT
) (
167 IN EFI_UNICODE_COLLATION_PROTOCOL
*This
,
174 struct _EFI_UNICODE_COLLATION_PROTOCOL
{
178 EFI_UNICODE_COLLATION_STRICOLL StriColl
;
179 EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch
;
180 EFI_UNICODE_COLLATION_STRLWR StrLwr
;
181 EFI_UNICODE_COLLATION_STRUPR StrUpr
;
184 // for supporting fat volumes
186 EFI_UNICODE_COLLATION_FATTOSTR FatToStr
;
187 EFI_UNICODE_COLLATION_STRTOFAT StrToFat
;
189 CHAR8
*SupportedLanguages
;
192 extern EFI_GUID gEfiUnicodeCollationProtocolGuid
;