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 
6 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8 
9 **/
10 
11 #ifndef __UNICODE_COLLATION_H__
12 #define __UNICODE_COLLATION_H__
13 
14 FILE_LICENCE ( BSD2_PATENT );
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 **/
44 typedef
45 INTN
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 **/
64 typedef
65 BOOLEAN
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 **/
80 typedef
81 VOID
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 **/
95 typedef
96 VOID
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 **/
114 typedef
115 VOID
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 **/
137 typedef
138 BOOLEAN
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 
171 
172 #endif
EFI_GUID gEfiUnicodeCollation2ProtocolGuid
CHAR8 * SupportedLanguages
A Null-terminated ASCII string array that contains one or more language codes.
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.
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
unsigned char BOOLEAN
INT64 INTN
Signed value of native width.
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.
unsigned short CHAR16
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...
EFI_UNICODE_COLLATION_STRICOLL StriColl
#define OUT
Definition: mlx_utils.h:29
EFI_UNICODE_COLLATION_FATTOSTR FatToStr
EFI_UNICODE_COLLATION_STRUPR StrUpr
#define EFIAPI
UINT64 UINTN
Unsigned value of native width.
#define VOID
Undeclared type.
Definition: Base.h:271
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.
#define IN
Definition: mlx_utils.h:28
FILE_LICENCE(BSD2_PATENT)
EFI_UNICODE_COLLATION_STRLWR StrLwr
The EFI_UNICODE_COLLATION_PROTOCOL is used to perform case-insensitive comparisons of strings.
char CHAR8
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.
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.
EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch
EFI_UNICODE_COLLATION_STRTOFAT StrToFat