]>
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 | |
99e8ed21 | 33 | ///\r |
34 | /// Protocol GUID name defined in EFI1.1.\r | |
35 | /// \r | |
a6508c05 | 36 | #define UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL_GUID\r |
37 | \r | |
99e8ed21 | 38 | ///\r |
39 | /// Protocol defined in EFI1.1.\r | |
40 | /// \r | |
a6508c05 | 41 | typedef EFI_UNICODE_COLLATION_PROTOCOL UNICODE_COLLATION_INTERFACE;\r |
d1f95000 | 42 | \r |
99e8ed21 | 43 | ///\r |
44 | /// Protocol data structures and defines\r | |
45 | ///\r | |
d1f95000 | 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 | |
ed66e1bc | 70 | );\r |
d1f95000 | 71 | \r |
72 | /**\r | |
73 | Performs a case-insensitive comparison of a Null-terminated Unicode \r | |
74 | pattern string and a Null-terminated Unicode string.\r | |
75 | \r | |
76 | @param This Protocol instance pointer.\r | |
77 | @param String A pointer to a Null-terminated Unicode string.\r | |
78 | @param Pattern A pointer to a Null-terminated Unicode pattern string.\r | |
79 | \r | |
80 | @retval TRUE Pattern was found in String.\r | |
81 | @retval FALSE Pattern was not found in String.\r | |
82 | \r | |
83 | **/\r | |
84 | typedef\r | |
85 | BOOLEAN\r | |
8b13229b | 86 | (EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH)(\r |
d1f95000 | 87 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
88 | IN CHAR16 *String,\r | |
89 | IN CHAR16 *Pattern\r | |
ed66e1bc | 90 | );\r |
d1f95000 | 91 | \r |
92 | /**\r | |
93 | Converts all the Unicode characters in a Null-terminated Unicode string to \r | |
94 | lower case Unicode characters.\r | |
95 | \r | |
96 | @param This Protocol instance pointer.\r | |
97 | @param String A pointer to a Null-terminated Unicode string.\r | |
98 | \r | |
d1f95000 | 99 | **/\r |
100 | typedef\r | |
101 | VOID\r | |
8b13229b | 102 | (EFIAPI *EFI_UNICODE_COLLATION_STRLWR)(\r |
d1f95000 | 103 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
104 | IN OUT CHAR16 *Str\r | |
ed66e1bc | 105 | );\r |
d1f95000 | 106 | \r |
107 | /**\r | |
108 | Converts all the Unicode characters in a Null-terminated Unicode string to upper\r | |
109 | case Unicode characters.\r | |
110 | \r | |
111 | @param This Protocol instance pointer.\r | |
112 | @param String A pointer to a Null-terminated Unicode string.\r | |
113 | \r | |
d1f95000 | 114 | **/\r |
115 | typedef\r | |
116 | VOID\r | |
8b13229b | 117 | (EFIAPI *EFI_UNICODE_COLLATION_STRUPR)(\r |
d1f95000 | 118 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
119 | IN OUT CHAR16 *Str\r | |
ed66e1bc | 120 | );\r |
d1f95000 | 121 | \r |
122 | /**\r | |
123 | Converts an 8.3 FAT file name in an OEM character set to a Null-terminated \r | |
124 | Unicode string.\r | |
125 | \r | |
126 | @param This Protocol instance pointer.\r | |
127 | @param FatSize The size of the string Fat in bytes.\r | |
128 | @param Fat A pointer to a Null-terminated string that contains an 8.3 file\r | |
129 | name using an OEM character set.\r | |
130 | @param String A pointer to a Null-terminated Unicode string. The string must\r | |
131 | be preallocated to hold FatSize Unicode characters.\r | |
132 | \r | |
d1f95000 | 133 | **/\r |
134 | typedef\r | |
135 | VOID\r | |
8b13229b | 136 | (EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR)(\r |
d1f95000 | 137 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
138 | IN UINTN FatSize,\r | |
139 | IN CHAR8 *Fat,\r | |
140 | OUT CHAR16 *String\r | |
ed66e1bc | 141 | );\r |
d1f95000 | 142 | \r |
143 | /**\r | |
144 | Converts a Null-terminated Unicode string to legal characters in a FAT \r | |
145 | filename using an OEM character set. \r | |
146 | \r | |
147 | @param This Protocol instance pointer.\r | |
148 | @param String A pointer to a Null-terminated Unicode string. The string must\r | |
149 | be preallocated to hold FatSize Unicode characters.\r | |
150 | @param FatSize The size of the string Fat in bytes.\r | |
151 | @param Fat A pointer to a Null-terminated string that contains an 8.3 file\r | |
152 | name using an OEM character set.\r | |
153 | \r | |
154 | @retval TRUE Fat is a Long File Name\r | |
155 | @retval FALSE Fat is an 8.3 file name\r | |
156 | \r | |
157 | **/\r | |
158 | typedef\r | |
159 | BOOLEAN\r | |
8b13229b | 160 | (EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT)(\r |
d1f95000 | 161 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r |
162 | IN CHAR16 *String,\r | |
163 | IN UINTN FatSize,\r | |
164 | OUT CHAR8 *Fat\r | |
ed66e1bc | 165 | );\r |
d1f95000 | 166 | \r |
44717a39 | 167 | ///\r |
168 | /// The EFI_UNICODE_COLLATION_PROTOCOL is used to perform case-insensitive \r | |
169 | /// comparisons of Unicode strings. \r | |
170 | ///\r | |
d1f95000 | 171 | struct _EFI_UNICODE_COLLATION_PROTOCOL {\r |
d1f95000 | 172 | EFI_UNICODE_COLLATION_STRICOLL StriColl;\r |
173 | EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch;\r | |
174 | EFI_UNICODE_COLLATION_STRLWR StrLwr;\r | |
175 | EFI_UNICODE_COLLATION_STRUPR StrUpr;\r | |
176 | \r | |
177 | //\r | |
178 | // for supporting fat volumes\r | |
179 | //\r | |
180 | EFI_UNICODE_COLLATION_FATTOSTR FatToStr;\r | |
181 | EFI_UNICODE_COLLATION_STRTOFAT StrToFat;\r | |
258cce13 | 182 | \r |
183 | ///\r | |
44717a39 | 184 | /// A Null-terminated ASCII string array that contains one or more \r |
258cce13 | 185 | /// language codes. This array is specified in RFC 4646 format.\r |
186 | ///\r | |
d1f95000 | 187 | CHAR8 *SupportedLanguages;\r |
188 | };\r | |
189 | \r | |
190 | extern EFI_GUID gEfiUnicodeCollationProtocolGuid;\r | |
fd21d1aa | 191 | extern EFI_GUID gEfiUnicodeCollation2ProtocolGuid;\r |
d1f95000 | 192 | \r |
193 | #endif\r |