iPXE
UnicodeCollation.h
Go to the documentation of this file.
1/** @file
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.
5
6Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
7SPDX-License-Identifier: BSD-2-Clause-Patent
8
9**/
10
11#pragma once
12
13FILE_LICENCE ( BSD2_PATENT );
14FILE_SECBOOT ( PERMITTED );
15
16#define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \
17 { \
18 0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49 } \
19 }
20
22
23///
24/// Protocol data structures and defines
25///
26#define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)
27
28//
29// Protocol member functions
30//
31
32/**
33 Performs a case-insensitive comparison of two Null-terminated strings.
34
35 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
36 @param Str1 A pointer to a Null-terminated string.
37 @param Str2 A pointer to a Null-terminated string.
38
39 @retval 0 Str1 is equivalent to Str2.
40 @retval >0 Str1 is lexically greater than Str2.
41 @retval <0 Str1 is lexically less than Str2.
42
43**/
44typedef
48 IN CHAR16 *Str1,
49 IN CHAR16 *Str2
50 );
51
52/**
53 Performs a case-insensitive comparison of a Null-terminated
54 pattern string and a Null-terminated string.
55
56 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
57 @param String A pointer to a Null-terminated string.
58 @param Pattern A pointer to a Null-terminated pattern string.
59
60 @retval TRUE Pattern was found in String.
61 @retval FALSE Pattern was not found in String.
62
63**/
64typedef
68 IN CHAR16 *String,
69 IN CHAR16 *Pattern
70 );
71
72/**
73 Converts all the characters in a Null-terminated string to
74 lower case characters.
75
76 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
77 @param String A pointer to a Null-terminated string.
78
79**/
80typedef
84 IN OUT CHAR16 *Str
85 );
86
87/**
88 Converts all the characters in a Null-terminated string to upper
89 case characters.
90
91 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
92 @param String A pointer to a Null-terminated string.
93
94**/
95typedef
99 IN OUT CHAR16 *Str
100 );
101
102/**
103 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
104 string.
105
106 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
107 @param FatSize The size of the string Fat in bytes.
108 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
109 name using an 8-bit OEM character set.
110 @param String A pointer to a Null-terminated string. The string must
111 be allocated in advance to hold FatSize characters.
112
113**/
114typedef
118 IN UINTN FatSize,
119 IN CHAR8 *Fat,
120 OUT CHAR16 *String
121 );
122
123/**
124 Converts a Null-terminated string to legal characters in a FAT
125 filename using an OEM character set.
126
127 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
128 @param String A pointer to a Null-terminated string.
129 @param FatSize The size of the string Fat in bytes.
130 @param Fat A pointer to a string that contains the converted version of
131 String using legal FAT characters from an OEM character set.
132
133 @retval TRUE One or more conversions failed and were substituted with '_'
134 @retval FALSE None of the conversions failed.
135
136**/
137typedef
141 IN CHAR16 *String,
142 IN UINTN FatSize,
143 OUT CHAR8 *Fat
144 );
145
146///
147/// The EFI_UNICODE_COLLATION_PROTOCOL is used to perform case-insensitive
148/// comparisons of strings.
149///
155
156 //
157 // for supporting fat volumes
158 //
161
162 ///
163 /// A Null-terminated ASCII string array that contains one or more language codes.
164 /// When this field is used for UnicodeCollation2, it is specified in RFC 4646 format.
165 /// When it is used for UnicodeCollation, it is specified in ISO 639-2 format.
166 ///
168};
169
unsigned char BOOLEAN
Logical Boolean.
char CHAR8
1-byte Character
UINT64 UINTN
Unsigned value of native width.
unsigned short CHAR16
2-byte Character.
INT64 INTN
Signed value of native width.
#define EFIAPI
#define VOID
Undeclared type.
Definition Base.h:271
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
VOID(EFIAPI * EFI_UNICODE_COLLATION_FATTOSTR)(IN EFI_UNICODE_COLLATION_PROTOCOL *This, IN UINTN FatSize, IN CHAR8 *Fat, OUT CHAR16 *String)
Converts an 8.3 FAT file name in an OEM character set to a Null-terminated string.
VOID(EFIAPI * EFI_UNICODE_COLLATION_STRLWR)(IN EFI_UNICODE_COLLATION_PROTOCOL *This, IN OUT CHAR16 *Str)
Converts all the characters in a Null-terminated string to lower case characters.
BOOLEAN(EFIAPI * EFI_UNICODE_COLLATION_METAIMATCH)(IN EFI_UNICODE_COLLATION_PROTOCOL *This, IN CHAR16 *String, IN CHAR16 *Pattern)
Performs a case-insensitive comparison of a Null-terminated pattern string and a Null-terminated stri...
BOOLEAN(EFIAPI * EFI_UNICODE_COLLATION_STRTOFAT)(IN EFI_UNICODE_COLLATION_PROTOCOL *This, IN CHAR16 *String, IN UINTN FatSize, OUT CHAR8 *Fat)
Converts a Null-terminated string to legal characters in a FAT filename using an OEM character set.
INTN(EFIAPI * EFI_UNICODE_COLLATION_STRICOLL)(IN EFI_UNICODE_COLLATION_PROTOCOL *This, IN CHAR16 *Str1, IN CHAR16 *Str2)
Performs a case-insensitive comparison of two Null-terminated strings.
EFI_GUID gEfiUnicodeCollation2ProtocolGuid
VOID(EFIAPI * EFI_UNICODE_COLLATION_STRUPR)(IN EFI_UNICODE_COLLATION_PROTOCOL *This, IN OUT CHAR16 *Str)
Converts all the characters in a Null-terminated string to upper case characters.
struct _EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:921
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:951
#define IN
Definition mlx_utils.h:28
#define OUT
Definition mlx_utils.h:29
The EFI_UNICODE_COLLATION_PROTOCOL is used to perform case-insensitive comparisons of strings.
EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch
EFI_UNICODE_COLLATION_STRUPR StrUpr
EFI_UNICODE_COLLATION_STRLWR StrLwr
CHAR8 * SupportedLanguages
A Null-terminated ASCII string array that contains one or more language codes.
EFI_UNICODE_COLLATION_FATTOSTR FatToStr
EFI_UNICODE_COLLATION_STRICOLL StriColl
EFI_UNICODE_COLLATION_STRTOFAT StrToFat