]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Protocol/UnicodeCollation.h
MdePkg: Add definition for new warning code EFI_WARN_FILE_SYSTEM.
[mirror_edk2.git] / MdePkg / Include / Protocol / UnicodeCollation.h
... / ...
CommitLineData
1/** @file\r
2 Unicode Collation protocol that follows the UEFI 2.0 specification.\r
3 This protocol is used to allow code running in the boot services environment \r
4 to perform lexical comparison functions on Unicode strings for given languages.\r
5\r
6Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
7This program and the accompanying materials are licensed and made available under \r
8the terms and conditions of the BSD License that accompanies this distribution. \r
9The full text of the license may be found at\r
10http://opensource.org/licenses/bsd-license.php. \r
11 \r
12THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
13WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
14\r
15**/\r
16\r
17#ifndef __UNICODE_COLLATION_H__\r
18#define __UNICODE_COLLATION_H__\r
19\r
20#define EFI_UNICODE_COLLATION_PROTOCOL_GUID \\r
21 { \\r
22 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
23 }\r
24\r
25#define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \\r
26 { \\r
27 0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49 } \\r
28 }\r
29\r
30typedef struct _EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL;\r
31\r
32\r
33///\r
34/// Protocol GUID name defined in EFI1.1.\r
35/// \r
36#define UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL_GUID\r
37\r
38///\r
39/// Protocol defined in EFI1.1.\r
40/// \r
41typedef EFI_UNICODE_COLLATION_PROTOCOL UNICODE_COLLATION_INTERFACE;\r
42\r
43///\r
44/// Protocol data structures and defines\r
45///\r
46#define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)\r
47\r
48//\r
49// Protocol member functions\r
50//\r
51/**\r
52 Performs a case-insensitive comparison of two Null-terminated strings.\r
53\r
54 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.\r
55 @param Str1 A pointer to a Null-terminated string.\r
56 @param Str2 A pointer to a Null-terminated string.\r
57\r
58 @retval 0 Str1 is equivalent to Str2.\r
59 @retval >0 Str1 is lexically greater than Str2.\r
60 @retval <0 Str1 is lexically less than Str2.\r
61\r
62**/\r
63typedef\r
64INTN\r
65(EFIAPI *EFI_UNICODE_COLLATION_STRICOLL)(\r
66 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
67 IN CHAR16 *Str1,\r
68 IN CHAR16 *Str2\r
69 );\r
70\r
71/**\r
72 Performs a case-insensitive comparison of a Null-terminated \r
73 pattern string and a Null-terminated string.\r
74\r
75 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.\r
76 @param String A pointer to a Null-terminated string.\r
77 @param Pattern A pointer to a Null-terminated pattern string.\r
78\r
79 @retval TRUE Pattern was found in String.\r
80 @retval FALSE Pattern was not found in String.\r
81\r
82**/\r
83typedef\r
84BOOLEAN\r
85(EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH)(\r
86 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
87 IN CHAR16 *String,\r
88 IN CHAR16 *Pattern\r
89 );\r
90\r
91/**\r
92 Converts all the characters in a Null-terminated string to \r
93 lower case characters.\r
94\r
95 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.\r
96 @param String A pointer to a Null-terminated string.\r
97\r
98**/\r
99typedef\r
100VOID\r
101(EFIAPI *EFI_UNICODE_COLLATION_STRLWR)(\r
102 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
103 IN OUT CHAR16 *Str\r
104 );\r
105\r
106/**\r
107 Converts all the characters in a Null-terminated string to upper\r
108 case characters.\r
109\r
110 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.\r
111 @param String A pointer to a Null-terminated string.\r
112\r
113**/\r
114typedef\r
115VOID\r
116(EFIAPI *EFI_UNICODE_COLLATION_STRUPR)(\r
117 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
118 IN OUT CHAR16 *Str\r
119 );\r
120\r
121/**\r
122 Converts an 8.3 FAT file name in an OEM character set to a Null-terminated \r
123 string.\r
124\r
125 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.\r
126 @param FatSize The size of the string Fat in bytes.\r
127 @param Fat A pointer to a Null-terminated string that contains an 8.3 file\r
128 name using an 8-bit OEM character set.\r
129 @param String A pointer to a Null-terminated string. The string must\r
130 be allocated in advance to hold FatSize characters.\r
131\r
132**/\r
133typedef\r
134VOID\r
135(EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR)(\r
136 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
137 IN UINTN FatSize,\r
138 IN CHAR8 *Fat,\r
139 OUT CHAR16 *String\r
140 );\r
141\r
142/**\r
143 Converts a Null-terminated string to legal characters in a FAT \r
144 filename using an OEM character set. \r
145\r
146 @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance.\r
147 @param String A pointer to a Null-terminated string.\r
148 @param FatSize The size of the string Fat in bytes.\r
149 @param Fat A pointer to a string that contains the converted version of \r
150 String using legal FAT characters from an OEM character set.\r
151\r
152 @retval TRUE One or more conversions failed and were substituted with '_'\r
153 @retval FALSE None of the conversions failed.\r
154\r
155**/\r
156typedef\r
157BOOLEAN\r
158(EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT)(\r
159 IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r
160 IN CHAR16 *String,\r
161 IN UINTN FatSize,\r
162 OUT CHAR8 *Fat\r
163 );\r
164\r
165///\r
166/// The EFI_UNICODE_COLLATION_PROTOCOL is used to perform case-insensitive \r
167/// comparisons of strings. \r
168///\r
169struct _EFI_UNICODE_COLLATION_PROTOCOL {\r
170 EFI_UNICODE_COLLATION_STRICOLL StriColl;\r
171 EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch;\r
172 EFI_UNICODE_COLLATION_STRLWR StrLwr;\r
173 EFI_UNICODE_COLLATION_STRUPR StrUpr;\r
174\r
175 //\r
176 // for supporting fat volumes\r
177 //\r
178 EFI_UNICODE_COLLATION_FATTOSTR FatToStr;\r
179 EFI_UNICODE_COLLATION_STRTOFAT StrToFat;\r
180 \r
181 ///\r
182 /// A Null-terminated ASCII string array that contains one or more language codes.\r
183 /// When this field is used for UnicodeCollation2, it is specified in RFC 4646 format.\r
184 /// When it is used for UnicodeCollation, it is specified in ISO 639-2 format.\r
185 ///\r
186 CHAR8 *SupportedLanguages;\r
187};\r
188\r
189extern EFI_GUID gEfiUnicodeCollationProtocolGuid;\r
190extern EFI_GUID gEfiUnicodeCollation2ProtocolGuid;\r
191\r
192#endif\r