]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
8a7d75b0 | 2 | Unicode Collation protocol that follows the UEFI 2.0 specification.\r |
4ca9b6c4 LG |
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 | |
d1f95000 | 5 | \r |
4ca9b6c4 | 6 | Copyright (c) 2006 - 2008, Intel Corporation \r |
d1f95000 | 7 | All rights reserved. This program and the accompanying materials \r |
8 | are licensed and made available under the terms and conditions of the BSD License \r | |
9 | which accompanies this distribution. The full text of the license may be found at \r | |
10 | http://opensource.org/licenses/bsd-license.php \r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
14 | \r | |
d1f95000 | 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 | |
d24236bf | 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 | |
a6508c05 | 30 | typedef 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 | |
41 | typedef EFI_UNICODE_COLLATION_PROTOCOL UNICODE_COLLATION_INTERFACE;\r | |
d1f95000 | 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 Unicode \r | |
53 | strings.\r | |
54 | \r | |
55 | @param This Protocol instance pointer.\r | |
56 | @param Str1 A pointer to a Null-terminated Unicode string.\r | |
57 | @param Str2 A pointer to a Null-terminated Unicode string.\r | |
58 | \r | |
59 | @retval 0 Str1 is equivalent to Str2\r | |
60 | @retval >_0 Str1 is lexically greater than Str2\r | |
61 | @retval <_0 Str1 is lexically less than Str2\r | |
62 | \r | |
63 | **/\r | |
64 | typedef\r | |
65 | INTN\r | |
8b13229b | 66 | (EFIAPI *EFI_UNICODE_COLLATION_STRICOLL)(\r |
d1f95000 | 67 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
68 | IN CHAR16 *Str1,\r | |
69 | IN CHAR16 *Str2\r | |
70 | )\r | |
71 | ;\r | |
72 | \r | |
73 | /**\r | |
74 | Performs a case-insensitive comparison of a Null-terminated Unicode \r | |
75 | pattern string and a Null-terminated Unicode string.\r | |
76 | \r | |
77 | @param This Protocol instance pointer.\r | |
78 | @param String A pointer to a Null-terminated Unicode string.\r | |
79 | @param Pattern A pointer to a Null-terminated Unicode pattern string.\r | |
80 | \r | |
81 | @retval TRUE Pattern was found in String.\r | |
82 | @retval FALSE Pattern was not found in String.\r | |
83 | \r | |
84 | **/\r | |
85 | typedef\r | |
86 | BOOLEAN\r | |
8b13229b | 87 | (EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH)(\r |
d1f95000 | 88 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
89 | IN CHAR16 *String,\r | |
90 | IN CHAR16 *Pattern\r | |
91 | )\r | |
92 | ;\r | |
93 | \r | |
94 | /**\r | |
95 | Converts all the Unicode characters in a Null-terminated Unicode string to \r | |
96 | lower case Unicode characters.\r | |
97 | \r | |
98 | @param This Protocol instance pointer.\r | |
99 | @param String A pointer to a Null-terminated Unicode string.\r | |
100 | \r | |
d1f95000 | 101 | **/\r |
102 | typedef\r | |
103 | VOID\r | |
8b13229b | 104 | (EFIAPI *EFI_UNICODE_COLLATION_STRLWR)(\r |
d1f95000 | 105 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
106 | IN OUT CHAR16 *Str\r | |
107 | )\r | |
108 | ;\r | |
109 | \r | |
110 | /**\r | |
111 | Converts all the Unicode characters in a Null-terminated Unicode string to upper\r | |
112 | case Unicode characters.\r | |
113 | \r | |
114 | @param This Protocol instance pointer.\r | |
115 | @param String A pointer to a Null-terminated Unicode string.\r | |
116 | \r | |
d1f95000 | 117 | **/\r |
118 | typedef\r | |
119 | VOID\r | |
8b13229b | 120 | (EFIAPI *EFI_UNICODE_COLLATION_STRUPR)(\r |
d1f95000 | 121 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
122 | IN OUT CHAR16 *Str\r | |
123 | )\r | |
124 | ;\r | |
125 | \r | |
126 | /**\r | |
127 | Converts an 8.3 FAT file name in an OEM character set to a Null-terminated \r | |
128 | Unicode string.\r | |
129 | \r | |
130 | @param This Protocol instance pointer.\r | |
131 | @param FatSize The size of the string Fat in bytes.\r | |
132 | @param Fat A pointer to a Null-terminated string that contains an 8.3 file\r | |
133 | name using an OEM character set.\r | |
134 | @param String A pointer to a Null-terminated Unicode string. The string must\r | |
135 | be preallocated to hold FatSize Unicode characters.\r | |
136 | \r | |
d1f95000 | 137 | **/\r |
138 | typedef\r | |
139 | VOID\r | |
8b13229b | 140 | (EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR)(\r |
d1f95000 | 141 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
142 | IN UINTN FatSize,\r | |
143 | IN CHAR8 *Fat,\r | |
144 | OUT CHAR16 *String\r | |
145 | )\r | |
146 | ;\r | |
147 | \r | |
148 | /**\r | |
149 | Converts a Null-terminated Unicode string to legal characters in a FAT \r | |
150 | filename using an OEM character set. \r | |
151 | \r | |
152 | @param This Protocol instance pointer.\r | |
153 | @param String A pointer to a Null-terminated Unicode string. The string must\r | |
154 | be preallocated to hold FatSize Unicode characters.\r | |
155 | @param FatSize The size of the string Fat in bytes.\r | |
156 | @param Fat A pointer to a Null-terminated string that contains an 8.3 file\r | |
157 | name using an OEM character set.\r | |
158 | \r | |
159 | @retval TRUE Fat is a Long File Name\r | |
160 | @retval FALSE Fat is an 8.3 file name\r | |
161 | \r | |
162 | **/\r | |
163 | typedef\r | |
164 | BOOLEAN\r | |
8b13229b | 165 | (EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT)(\r |
d1f95000 | 166 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
167 | IN CHAR16 *String,\r | |
168 | IN UINTN FatSize,\r | |
169 | OUT CHAR8 *Fat\r | |
170 | )\r | |
171 | ;\r | |
172 | \r | |
4ca9b6c4 LG |
173 | /** \r |
174 | @par Protocol Description:\r | |
175 | The EFI_UNICODE_COLLATION_PROTOCOL is used to perform case-insensitive \r | |
176 | comparisons of Unicode strings. \r | |
177 | \r | |
178 | @param StriColl\r | |
179 | Performs a case-insensitive comparison of two Null-terminated Unicode strings. \r | |
180 | \r | |
181 | @param MetaiMatch\r | |
182 | Performs a case-insensitive comparison between a Null-terminated Unicode \r | |
183 | pattern string and a Null-terminated Unicode string. The pattern string \r | |
184 | can use the '?' wildcard to match any character, and the '*' wildcard to \r | |
185 | match any substring. \r | |
186 | \r | |
187 | @param StrLwr\r | |
188 | Converts all the Unicode characters in a Null-terminated Unicode string to \r | |
189 | lowercase Unicode characters. \r | |
190 | \r | |
191 | @param StrUpr\r | |
192 | Converts all the Unicode characters in a Null-terminated Unicode string to \r | |
193 | uppercase Unicode characters. \r | |
194 | \r | |
195 | @param FatToStr\r | |
196 | Converts an 8.3 FAT file name using an OEM character set to a Null-terminated \r | |
197 | Unicode string. \r | |
198 | \r | |
199 | @param StrToFat\r | |
200 | Converts a Null-terminated Unicode string to legal characters in a FAT \r | |
201 | filename using an OEM character set. \r | |
202 | \r | |
203 | @param Supported\r | |
204 | LanguagesA Null-terminated ASCII string array that contains one or more \r | |
205 | language codes. This array is specified in RFC 4646 format.\r | |
206 | **/\r | |
d1f95000 | 207 | struct _EFI_UNICODE_COLLATION_PROTOCOL {\r |
208 | //\r | |
209 | // general\r | |
210 | //\r | |
211 | EFI_UNICODE_COLLATION_STRICOLL StriColl;\r | |
212 | EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch;\r | |
213 | EFI_UNICODE_COLLATION_STRLWR StrLwr;\r | |
214 | EFI_UNICODE_COLLATION_STRUPR StrUpr;\r | |
215 | \r | |
216 | //\r | |
217 | // for supporting fat volumes\r | |
218 | //\r | |
219 | EFI_UNICODE_COLLATION_FATTOSTR FatToStr;\r | |
220 | EFI_UNICODE_COLLATION_STRTOFAT StrToFat;\r | |
221 | \r | |
222 | CHAR8 *SupportedLanguages;\r | |
223 | };\r | |
224 | \r | |
225 | extern EFI_GUID gEfiUnicodeCollationProtocolGuid;\r | |
fd21d1aa | 226 | extern EFI_GUID gEfiUnicodeCollation2ProtocolGuid;\r |
d1f95000 | 227 | \r |
228 | #endif\r |