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 - 2011, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials are licensed and made available under
8 the terms and conditions of the BSD License that accompanies this distribution.
9 The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php.
11 
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 
15 **/
16 
17 #ifndef __UNICODE_COLLATION_H__
18 #define __UNICODE_COLLATION_H__
19 
20 FILE_LICENCE ( BSD3 );
21 
22 #define EFI_UNICODE_COLLATION_PROTOCOL_GUID \
23  { \
24  0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
25  }
26 
27 #define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \
28  { \
29  0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49 } \
30  }
31 
33 
34 
35 ///
36 /// Protocol GUID name defined in EFI1.1.
37 ///
38 #define UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL_GUID
39 
40 ///
41 /// Protocol defined in EFI1.1.
42 ///
44 
45 ///
46 /// Protocol data structures and defines
47 ///
48 #define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)
49 
50 //
51 // Protocol member functions
52 //
53 /**
54  Performs a case-insensitive comparison of two Null-terminated strings.
55 
56  @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
57  @param Str1 A pointer to a Null-terminated string.
58  @param Str2 A pointer to a Null-terminated string.
59 
60  @retval 0 Str1 is equivalent to Str2.
61  @retval >0 Str1 is lexically greater than Str2.
62  @retval <0 Str1 is lexically less than Str2.
63 
64 **/
65 typedef
66 INTN
69  IN CHAR16 *Str1,
70  IN CHAR16 *Str2
71  );
72 
73 /**
74  Performs a case-insensitive comparison of a Null-terminated
75  pattern string and a Null-terminated string.
76 
77  @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
78  @param String A pointer to a Null-terminated string.
79  @param Pattern A pointer to a Null-terminated pattern string.
80 
81  @retval TRUE Pattern was found in String.
82  @retval FALSE Pattern was not found in String.
83 
84 **/
85 typedef
86 BOOLEAN
89  IN CHAR16 *String,
90  IN CHAR16 *Pattern
91  );
92 
93 /**
94  Converts all the characters in a Null-terminated string to
95  lower case characters.
96 
97  @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
98  @param String A pointer to a Null-terminated string.
99 
100 **/
101 typedef
102 VOID
105  IN OUT CHAR16 *Str
106  );
107 
108 /**
109  Converts all the characters in a Null-terminated string to upper
110  case characters.
111 
112  @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
113  @param String A pointer to a Null-terminated string.
114 
115 **/
116 typedef
117 VOID
120  IN OUT CHAR16 *Str
121  );
122 
123 /**
124  Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
125  string.
126 
127  @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
128  @param FatSize The size of the string Fat in bytes.
129  @param Fat A pointer to a Null-terminated string that contains an 8.3 file
130  name using an 8-bit OEM character set.
131  @param String A pointer to a Null-terminated string. The string must
132  be allocated in advance to hold FatSize characters.
133 
134 **/
135 typedef
136 VOID
139  IN UINTN FatSize,
140  IN CHAR8 *Fat,
141  OUT CHAR16 *String
142  );
143 
144 /**
145  Converts a Null-terminated string to legal characters in a FAT
146  filename using an OEM character set.
147 
148  @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.
149  @param String A pointer to a Null-terminated string.
150  @param FatSize The size of the string Fat in bytes.
151  @param Fat A pointer to a string that contains the converted version of
152  String using legal FAT characters from an OEM character set.
153 
154  @retval TRUE One or more conversions failed and were substituted with '_'
155  @retval FALSE None of the conversions failed.
156 
157 **/
158 typedef
159 BOOLEAN
162  IN CHAR16 *String,
163  IN UINTN FatSize,
164  OUT CHAR8 *Fat
165  );
166 
167 ///
168 /// The EFI_UNICODE_COLLATION_PROTOCOL is used to perform case-insensitive
169 /// comparisons of strings.
170 ///
176 
177  //
178  // for supporting fat volumes
179  //
182 
183  ///
184  /// A Null-terminated ASCII string array that contains one or more language codes.
185  /// When this field is used for UnicodeCollation2, it is specified in RFC 4646 format.
186  /// When it is used for UnicodeCollation, it is specified in ISO 639-2 format.
187  ///
189 };
190 
193 
194 #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:263
unsigned char BOOLEAN
Definition: ProcessorBind.h:61
INT64 INTN
Signed value of native width.
Definition: ProcessorBind.h:77
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
Definition: ProcessorBind.h:59
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
FILE_LICENCE(BSD3)
EFI_UNICODE_COLLATION_FATTOSTR FatToStr
EFI_UNICODE_COLLATION_STRUPR StrUpr
EFI_GUID gEfiUnicodeCollationProtocolGuid
#define EFIAPI
UINT64 UINTN
Unsigned value of native width.
Definition: ProcessorBind.h:71
#define VOID
Undeclared type.
Definition: Base.h:319
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
EFI_UNICODE_COLLATION_STRLWR StrLwr
The EFI_UNICODE_COLLATION_PROTOCOL is used to perform case-insensitive comparisons of strings.
char CHAR8
Definition: ProcessorBind.h:63
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