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#ifndef __UNICODE_COLLATION_H__
12#define __UNICODE_COLLATION_H__
13
14FILE_LICENCE ( BSD2_PATENT );
15FILE_SECBOOT ( PERMITTED );
16
17#define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \
18 { \
19 0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49 } \
20 }
21
23
24///
25/// Protocol data structures and defines
26///
27#define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)
28
29//
30// Protocol member functions
31//
32
33/**
34 Performs a case-insensitive comparison of two Null-terminated strings.
35
36 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
37 @param Str1 A pointer to a Null-terminated string.
38 @param Str2 A pointer to a Null-terminated string.
39
40 @retval 0 Str1 is equivalent to Str2.
41 @retval >0 Str1 is lexically greater than Str2.
42 @retval <0 Str1 is lexically less than Str2.
43
44**/
45typedef
49 IN CHAR16 *Str1,
50 IN CHAR16 *Str2
51 );
52
53/**
54 Performs a case-insensitive comparison of a Null-terminated
55 pattern string and a Null-terminated string.
56
57 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
58 @param String A pointer to a Null-terminated string.
59 @param Pattern A pointer to a Null-terminated pattern string.
60
61 @retval TRUE Pattern was found in String.
62 @retval FALSE Pattern was not found in String.
63
64**/
65typedef
69 IN CHAR16 *String,
70 IN CHAR16 *Pattern
71 );
72
73/**
74 Converts all the characters in a Null-terminated string to
75 lower case characters.
76
77 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
78 @param String A pointer to a Null-terminated string.
79
80**/
81typedef
85 IN OUT CHAR16 *Str
86 );
87
88/**
89 Converts all the characters in a Null-terminated string to upper
90 case characters.
91
92 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
93 @param String A pointer to a Null-terminated string.
94
95**/
96typedef
100 IN OUT CHAR16 *Str
101 );
102
103/**
104 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
105 string.
106
107 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
108 @param FatSize The size of the string Fat in bytes.
109 @param Fat A pointer to a Null-terminated string that contains an 8.3 file
110 name using an 8-bit OEM character set.
111 @param String A pointer to a Null-terminated string. The string must
112 be allocated in advance to hold FatSize characters.
113
114**/
115typedef
119 IN UINTN FatSize,
120 IN CHAR8 *Fat,
121 OUT CHAR16 *String
122 );
123
124/**
125 Converts a Null-terminated string to legal characters in a FAT
126 filename using an OEM character set.
127
128 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
129 @param String A pointer to a Null-terminated string.
130 @param FatSize The size of the string Fat in bytes.
131 @param Fat A pointer to a string that contains the converted version of
132 String using legal FAT characters from an OEM character set.
133
134 @retval TRUE One or more conversions failed and were substituted with '_'
135 @retval FALSE None of the conversions failed.
136
137**/
138typedef
142 IN CHAR16 *String,
143 IN UINTN FatSize,
144 OUT CHAR8 *Fat
145 );
146
147///
148/// The EFI_UNICODE_COLLATION_PROTOCOL is used to perform case-insensitive
149/// comparisons of strings.
150///
156
157 //
158 // for supporting fat volumes
159 //
162
163 ///
164 /// A Null-terminated ASCII string array that contains one or more language codes.
165 /// When this field is used for UnicodeCollation2, it is specified in RFC 4646 format.
166 /// When it is used for UnicodeCollation, it is specified in ISO 639-2 format.
167 ///
169};
170
172
173#endif
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:272
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:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#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