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_PROTOCOL_GUID \
17  { \
18  0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
19  }
20 
21 #define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \
22  { \
23  0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49 } \
24  }
25 
27 
28 ///
29 /// Protocol GUID name defined in EFI1.1.
30 ///
31 #define UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL_GUID
32 
33 ///
34 /// Protocol defined in EFI1.1.
35 ///
37 
38 ///
39 /// Protocol data structures and defines
40 ///
41 #define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)
42 
43 //
44 // Protocol member functions
45 //
46 
47 /**
48  Performs a case-insensitive comparison of two Null-terminated strings.
49 
50  @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
51  @param Str1 A pointer to a Null-terminated string.
52  @param Str2 A pointer to a Null-terminated string.
53 
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.
57 
58 **/
59 typedef
60 INTN
63  IN CHAR16 *Str1,
64  IN CHAR16 *Str2
65  );
66 
67 /**
68  Performs a case-insensitive comparison of a Null-terminated
69  pattern string and a Null-terminated string.
70 
71  @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
72  @param String A pointer to a Null-terminated string.
73  @param Pattern A pointer to a Null-terminated pattern string.
74 
75  @retval TRUE Pattern was found in String.
76  @retval FALSE Pattern was not found in String.
77 
78 **/
79 typedef
80 BOOLEAN
83  IN CHAR16 *String,
84  IN CHAR16 *Pattern
85  );
86 
87 /**
88  Converts all the characters in a Null-terminated string to
89  lower 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 all the characters in a Null-terminated string to upper
104  case characters.
105 
106  @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
107  @param String A pointer to a Null-terminated string.
108 
109 **/
110 typedef
111 VOID
114  IN OUT CHAR16 *Str
115  );
116 
117 /**
118  Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
119  string.
120 
121  @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
122  @param FatSize The size of the string Fat in bytes.
123  @param Fat A pointer to a Null-terminated string that contains an 8.3 file
124  name using an 8-bit OEM character set.
125  @param String A pointer to a Null-terminated string. The string must
126  be allocated in advance to hold FatSize characters.
127 
128 **/
129 typedef
130 VOID
133  IN UINTN FatSize,
134  IN CHAR8 *Fat,
135  OUT CHAR16 *String
136  );
137 
138 /**
139  Converts a Null-terminated string to legal characters in a FAT
140  filename using an OEM character set.
141 
142  @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
143  @param String A pointer to a Null-terminated string.
144  @param FatSize The size of the string Fat in bytes.
145  @param Fat A pointer to a string that contains the converted version of
146  String using legal FAT characters from an OEM character set.
147 
148  @retval TRUE One or more conversions failed and were substituted with '_'
149  @retval FALSE None of the conversions failed.
150 
151 **/
152 typedef
153 BOOLEAN
156  IN CHAR16 *String,
157  IN UINTN FatSize,
158  OUT CHAR8 *Fat
159  );
160 
161 ///
162 /// The EFI_UNICODE_COLLATION_PROTOCOL is used to perform case-insensitive
163 /// comparisons of strings.
164 ///
170 
171  //
172  // for supporting fat volumes
173  //
176 
177  ///
178  /// A Null-terminated ASCII string array that contains one or more language codes.
179  /// When this field is used for UnicodeCollation2, it is specified in RFC 4646 format.
180  /// When it is used for UnicodeCollation, it is specified in ISO 639-2 format.
181  ///
183 };
184 
187 
188 #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
EFI_GUID gEfiUnicodeCollationProtocolGuid
#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
EFI_UNICODE_COLLATION_PROTOCOL UNICODE_COLLATION_INTERFACE
Protocol defined in EFI1.1.
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